1 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
3 cs-tokenizer.cs: Fix typo.
6 2008-09-28 Miguel de Icaza <miguel@novell.com>
8 * eval.cs (InteractiveBase): The quit command now just sets a
9 flag, instead of calling Environment.Exit(), it is milder on
12 CompiledMethod is now in Mono.CSharp, not nested inside
13 the Evaluator, it was inconvenient to use.
15 2008-09-27 Miguel de Icaza <miguel@novell.com>
17 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
18 code to be invoked without having to reparse.
20 2008-09-27 Miguel de Icaza <miguel@novell.com>
22 * ecore.cs: The recent changes to FieldExpr broke this as well.
23 Fixes LINQ queries in the interactive shell.
25 * Multiple files: indentation fixing for the Mono coding
26 guidelines for the switch statement.
28 * eval.cs: Make the Evaluator API thread safe.
30 2008-09-26 Marek Safar <marek.safar@gmail.com>
32 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
35 2008-09-26 Marek Safar <marek.safar@gmail.com>
38 * statement.cs: Check possible mistaken empty statement using
41 2008-09-25 Miguel de Icaza <miguel@novell.com>
43 * eval.cs (LoadAssembly, ReferenceAssembly): Call
44 RootNamespace.ComputeNamespaces to update the internal list of
45 namespaces, this is no longer done for us.
47 (InteractiveBase): Use the Evaluator APIs instead of calling into
50 2008-09-25 Marek Safar <marek.safar@gmail.com>
53 * expression.cs: Missing mutator for access to multidimensional
56 2008-09-25 Marek Safar <marek.safar@gmail.com>
58 * class.cs, statement: Emit DebuggerHidden attribute for iterator
61 * driver.cs: Missing input argument check.
63 2008-09-25 Marek Safar <marek.safar@gmail.com>
65 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
66 expression.cs, statement.cs, rootcontext.cs, class.cs,
67 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
70 2008-09-24 Miguel de Icaza <miguel@novell.com>
72 * ecore.cs (FieldExpr): Only initialize eclass when we return a
73 fully constructed FieldExpr, fixes the regression introduced in
76 * ecore.cs, expression.cs: Plug back the eclass initialization as
77 otherwise it regresses `csharp'.
79 2008-09-24 Marek Safar <marek.safar@gmail.com>
81 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
82 ecore.cs, attribute.cs: Moved obsolete method checks from emit
83 phase to resolve phase. It resolves problems with expression trees
84 and fixes bugs #323796, #325156.
86 2008-09-23 Marek Safar <marek.safar@gmail.com>
88 * codegen.cs: Report better error when symbol writer is missing.
90 2008-09-23 Marek Safar <marek.safar@gmail.com>
92 * codegen.cs: Set .NET symbol writer.
94 * decl.cs: Guard against null generic arguments.
96 * report.cs: Don't report exactly same additional details.
98 2008-09-22 Marek Safar <marek.safar@gmail.com>
100 A fix for bug #324917
101 * cs-parser.jay: Add missing multidimensional non-expression type
104 2008-09-22 Marek Safar <marek.safar@gmail.com>
106 A fix for bug #428191
107 * anonymous.cs: Create an outer generic fields also for non-storey
110 2008-09-22 Marek Safar <marek.safar@gmail.com>
112 A fix for bug #378294
113 * class.cs: Make fixed size buffers gmcs feature only.
115 2008-09-22 Marek Safar <marek.safar@gmail.com>
117 A fix for bug #355622, #324993
118 * assign.cs, const.cs, class.cs: Create new EmitContext for each
121 2008-09-19 Marek Safar <marek.safar@gmail.com>
123 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
126 2008-09-19 Marek Safar <marek.safar@gmail.com>
128 A fix for bug #416110
129 * generic.cs: Struct constraint results in default ctor and
130 ValueType base type constraint to be set.
132 2008-09-19 Marek Safar <marek.safar@gmail.com>
134 A fix for bug #423791
135 * generic.cs: Fixed params output type type-inference.
137 2008-09-19 Marek Safar <marek.safar@gmail.com>
139 * cs-parser.jay, expression.cs: Fixed few expression crashes.
141 2008-09-19 Marek Safar <marek.safar@gmail.com>
143 * cs-tokenizer.cs: Don't break on extra partial modifier.
145 2008-09-19 Marek Safar <marek.safar@gmail.com>
147 A fix for bug #427592
148 * generic.cs: Use common parameter resolve method.
150 2008-09-18 Marek Safar <marek.safar@gmail.com>
152 A fix for bug #414758
153 * expression.cs, ecore.cs: Fixed crash when accessing non-static
156 2008-09-18 Marek Safar <marek.safar@gmail.com>
158 * driver.cs, namespace.cs: Read types and namespaces after all
159 requested assemblies are loaded, fixes issues with System.Core
160 auto-reference, and #419888.
162 2008-09-18 Marek Safar <marek.safar@gmail.com>
164 A fix for bug #417705
165 * cs-parser.jay: Fixed as/is operator expression split.
167 2008-09-18 Marek Safar <marek.safar@gmail.com>
169 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
170 Fixed expression tree representation of empty new expression and
171 new initializer expression.
173 2008-09-18 Miguel de Icaza <miguel@novell.com>
175 * eval.cs: Remove warning, keep reference to driver around.
177 * Hide fields that do not need to be public.
179 2008-09-17 Marek Safar <marek.safar@gmail.com>
181 A fix for bug #426385
182 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
183 conversion for array elements.
185 2008-09-17 Marek Safar <marek.safar@gmail.com>
187 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
188 void parsing conflicts.
190 2008-09-15 Marek Safar <marek.safar@gmail.com>
192 A fix for bug #425601
193 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
194 System.Core only when there is no custom ExtensionAttribute
197 2008-09-15 Miguel de Icaza <miguel@novell.com>
199 * namespace.cs: Do not report CS0246 (name
201 2008-09-12 Marek Safar <marek.safar@gmail.com>
203 A fix for bug #425669
204 * generic.cs: Don't cache generic static anonymous method
207 2008-09-12 Marek Safar <marek.safar@gmail.com>
209 * generic.cs, class.cs, delegate.cs: Check recursive inherited
210 conflicting constraints.
212 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
214 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
217 2008-09-12 Marek Safar <marek.safar@gmail.com>
219 * literal.cs, convert.cs, expression.cs, statement.cs: More null
220 to null pointer conversion fixes.
222 2008-09-11 Marek Safar <marek.safar@gmail.com>
224 * cs-parser.jay, expression.cs: An implicitly typed local variable
225 declarator cannot use an array initializer.
227 2008-09-11 Marek Safar <marek.safar@gmail.com>
229 * cs-parser.jay: Reduced number of printed tokens, add sorting.
231 2008-09-11 Marek Safar <marek.safar@gmail.com>
233 * generic.cs (InflatedConstraints): Don't crash when constraints
236 * cs-parser.jay: const_declarator is a block.
238 * constant.cs: Check for not allowed NaN conversions.
240 2008-09-10 Miguel de Icaza <miguel@novell.com>
242 * driver.cs: Drop --shell argument, the compiler is no longer a
245 * eval.cs: Move most of the code that deals with evaluation into
246 this file and document the public API from repl.cs
248 * repl.cs: Remove from here.
250 2008-09-10 Marek Safar <marek.safar@gmail.com>
252 A fix for bug #424684
253 * generic.cs: Generic class constraints must come first.
255 2008-09-09 Miguel de Icaza <miguel@novell.com>
257 * cs-parser.jay: Improve error reporting for syntax errors in
258 statements and expressions, we now report the expected tokens
259 instead of reporting the useless "; expected".
261 Drop the strings from the token declaration, it turns out that
262 they did not do what I thought they did. Instead they were adding
263 two sets of tokens to the tables.
265 2008-09-09 Marek Safar <marek.safar@gmail.com>
267 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
268 delegate.cs: Share special type check.
270 2008-09-09 Marek Safar <marek.safar@gmail.com>
272 A fix for bug #423981
273 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
275 2008-09-09 Marek Safar <marek.safar@gmail.com>
277 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
280 2008-09-09 Marek Safar <marek.safar@gmail.com>
282 A fix for bugs: #324750, #335946
283 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
284 lookup rule to determine ?-based tokens.
286 2008-09-08 Miguel de Icaza <miguel@novell.com>
288 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
289 expressions (like event adding or removing) end up here, so we
290 need to treat those as statements.
292 Add LoadAssembly method.
294 2008-09-04 Miguel de Icaza <miguel@novell.com>
296 * repl.cs: Add Time method.
298 2008-09-05 Marek Safar <marek.safar@gmail.com>
300 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
302 2008-09-05 Miguel de Icaza <miguel@novell.com>
304 * repl.cs: Add workaround for old compilers.
306 2008-09-04 Jb Evain <jbevain@novell.com>
308 * repl.cs (PrettyPrint): pretty print everything that
309 implements IDictionary, as well as IEnumerables. Also,
310 add a quit helper property.
312 2008-09-04 Marek Safar <marek.safar@gmail.com>
314 * constant.cs: Better error reporting for decimal literals.
316 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
319 2008-09-04 Marek Safar <marek.safar@gmail.com>
320 Miguel de Icaza <miguel@novell.com>
322 A fix for bug #422951
323 * assign.cs (Assign.DoResolve): Perform the type conversions
324 checks before we attempt to initialize `New' initializers.
326 2008-09-04 Marek Safar <marek.safar@gmail.com>
328 A fix for bug #422853
329 * delegate.cs (DelegateCreation): Add special handling for
330 EmptyExpression.Null instance expression which is just another
331 hack for undecided member instance exression.
333 2008-09-04 Marek Safar <marek.safar@gmail.com>
335 * expression.cs, ecore.cs: Emit full expression tree for reduced
338 2008-09-04 Marek Safar <marek.safar@gmail.com>
340 * expression.cs (This): Guard against multi-resolving.
342 * ecore.cs, statement.cs (Throw): Simplified.
344 * flowanalysis.cs: Also verify event fields.
346 2008-09-04 Miguel de Icaza <miguel@novell.com>
348 * assign.cs (Assign.DoResolve): Perform the type conversions
349 checks before we attempt to initialize `New' initializers.
351 * repl.cs (PrettyPrint): Add Hashtable prettyprint
353 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
356 * repl.cs: Update help.
358 2008-09-03 Miguel de Icaza <miguel@novell.com>
360 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
361 handling of the default config handling, including the special
362 treatment of System.Core assembly.
364 Fixes the REPL processing for LINQ.
366 2008-09-03 Marek Safar <marek.safar@gmail.com>
368 A fix for bug #422507
369 * expression.cs (UnboxCast): Add missing child expression mutator.
371 2008-09-03 Marek Safar <marek.safar@gmail.com>
373 * driver.cs: Don't self reference System.Core assembly.
375 2008-09-03 Marek Safar <marek.safar@gmail.com>
377 A fix for bug #422507
378 * expression.cs (StringConcat): Add missing type mutator.
380 2008-09-03 Marek Safar <marek.safar@gmail.com>
382 * generic.cs (TypeInferenceContext): Follow equality rule for
383 constructed type lower bound type inference.
385 2008-09-02 Miguel de Icaza <miguel@novell.com>
387 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
388 <dblank@cs.brynmawr.edu> which updates the cursor position on
391 2008-09-02 Marek Safar <marek.safar@gmail.com>
393 A fix for bug #367145
394 * driver.cs: Fixed import of extension methods when using -noconfig
397 2008-09-02 Marek Safar <marek.safar@gmail.com>
399 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
400 version from non-generic implementation instead.
402 2008-09-01 Marek Safar <marek.safar@gmail.com>
404 A fix for bug #418908
405 * class.cs: Use AddScopeStatement for field initializers.
407 2008-09-01 Marek Safar <marek.safar@gmail.com>
409 A fix for bug #415385
410 * ecore.cs, convert.cs: Do method group conversion for equal group types.
412 2008-09-01 Marek Safar <marek.safar@gmail.com>
414 A fix for bug #421736
415 * iterators.cs: Don't crash on unreachable iterators.
417 2008-09-01 Marek Safar <marek.safar@gmail.com>
419 A fix for bug #421628
420 * parameter.cs, attribute.cs: Clone also parameter attributes.
422 2008-08-30 Miguel de Icaza <miguel@novell.com>
424 * namespace.cs (LookupType): In EvalMode, try to replace
425 the TypeBuilder from our cache with a Type as Reflection.Emit does
426 not like to mix code from older assemblies emitted and new
429 This sounds like a serious Mono bug that prevents multiple
430 assemblies to be generated and consumed at the same time.
432 * cs-parser.jay (push_current_class): Do not make interactive
433 classes internal or private, make them public as we currently
434 generate each new class in a new assembly.
436 2008-08-29 Miguel de Icaza <miguel@novell.com>
438 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
439 remove types that are entered into the global namespace during
440 parsing so that we can remove them on failure.
442 * cs-parser.jay: Parsing: we now keep track of types that are
443 entered into global variables and queue those in case the parsing
446 This happens in a few situations: during partial-input, we invoke
447 the parser repeatedly for example with the string "class X", this
448 would cause X to be registed, and we need to remove this
449 registration so that another parse attempt later with say "class X {"
452 Additionally, if there is an error in the resolution phase, for
453 example: "class X : NonExistant {}" th
455 * cs-parser.jay: Be more precise with the errors being raised,
456 instead of flagging all exceptions during parsing to be attributed
457 to the parsing process, distinguish those from errors happening in
458 the actions and hint that using -v would produce the actual
461 * repl.cs: Do not load all compiler references on each reset,
462 doing the partial reset takes care of this.
464 2008-08-28 Miguel de Icaza <miguel@novell.com>
466 * repl.cs: Add support for loading all the files from
467 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
470 Introduce a micro-parser that is able to deambiguate on its input
471 whether we are dealing with a compilation unit (namespace, class,
472 interface, struct, delegate) declaration or a statement. This
473 allows both declarations and statements to be entered.
475 Set history size by default to 300 lines.
477 Instead of distinguishing based on the parser.InteractiveResult,
478 have only two cases: statements were parsed, or a compilation unit
479 was. Always pull the Using statement additions from the
480 compilation unit parse.
482 * cs-tokenizer.cs: Rename tokens to better describe their intent
483 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
485 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
486 EvalMode is used to trigger the lookup of global variables while
487 StatementMode is used turn variable declarations into static
490 * getline.cs: Allow history size to be set.
492 2008-08-29 Marek Safar <marek.safar@gmail.com>
494 A fix for bug #360755
495 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
497 2008-08-29 Marek Safar <marek.safar@gmail.com>
499 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
501 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
502 member name, it is too confusing
504 * decl.cs, class.cs: Don't report unused fields with attached attribute.
506 * rootcontext.cs: Finally default to warning level 4.
508 2008-08-28 Marek Safar <marek.safar@gmail.com>
510 * class.cs (CheckBase): Ignore overloaded operators.
512 2008-08-28 Marek Safar <marek.safar@gmail.com>
514 A fix for bug #420830
515 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
517 2008-08-28 Marek Safar <marek.safar@gmail.com>
519 A fix for bug #420832
520 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
522 2008-08-28 Marek Safar <marek.safar@gmail.com>
524 A fix for bug #420386
525 * nullables.cs: Fixed logic of nullable user comparison operators involving
528 2008-08-28 Marek Safar <marek.safar@gmail.com>
530 * attribute (IsClsCompliant): Use FALSE value for pointer types.
532 2008-08-27 Miguel de Icaza <miguel@novell.com>
534 * repl.cs: Add support for aborting the running code with C-c.
536 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
538 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
540 2008-08-27 Miguel de Icaza <miguel@novell.com>
542 * cs-parser.jay (interactive_statement_list): A new set of rules
543 for hosting statements that uses the "interactive_" prefix.
545 * repl.cs: Add support for parsing `using' as a statement or as a
546 directive. Deambiguating before passing this to the parser.
548 We need to distinguish statement_expressions that occur at the
549 toplevel vs those that occur embedded into expressions.
551 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
552 that fixes the cursor key handling, and a history bug.
554 2008-08-26 Miguel de Icaza <miguel@novell.com>
556 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
557 limitations in Console, instead the 2.0 bootstrap libraries now
558 include the Console bits.
560 Also, remove the use of Nullables from getline.cs
564 Interactive support for the C# compiler. Use gmcs --shell to
565 enter a read-eval-print loop shell.
567 Docs: http://www.mono-project.com/CsharpRepl
569 * sources: include repl.cs here and getline.cs for gmcs.exe,
570 everything else is getline.cs impaired.
572 * Makefile: when bootstrapping pass a special flag
573 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
574 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
575 This distinguishes those two cases.
577 * repl.cs: Support for a read-eval-print loop. Will be soon
578 refactored into eval support and then REPL on top of it.
580 * ecore.cs: If a simplename lookup fails, before erroring out,
581 if we are in EvalMode to resolve the name to a declaration in the
584 This means that variable declarations that happened in previous
585 classes (as repl puts every statement in a separate class) are
586 made visible in this way.
588 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
589 triggered an error due to the end of file being reached. This is
590 used to do multi-line input, and notify the caller that the user
591 needs to provide more text before a successful parse.
593 Add new grammar rules after the INTERACTIVE_PARSER token is seen
594 to drive the evaluation with a custom wrapper.
596 * driver.cs: Add support for --shell, and refactor some code to be
599 * namespace.cs: Add support for serializing the contents of the
600 namespaces and reloading them.
602 * getline.cs: A managed implementation of ReadLine under
603 X11/Apache2 license terms. Easy to embed in other applications as
606 * namespace.cs: Add some functions to save and restore the
609 * rootcontext.cs: New public field.
611 * cs-tokenizer.cs: Add support for one of the possible characters
612 we introduce into the token stream.
614 This patch does not affect the regular tokenization process, the
615 only performance hit would happen if there is an invalid character
618 * support.cs: Move isatty helper routine here.
620 * codegen.cs: Small cleanup, and add a mechanism to initialize the
621 code generator for in-memory assemblies.
623 2008-08-26 Marek Safar <marek.safar@gmail.com>
625 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
626 parameter cannot be always used as a type.
628 2008-08-21 Marek Safar <marek.safar@gmail.com>
630 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
632 2008-08-21 Marek Safar <marek.safar@gmail.com>
634 * convert.cs: Implement explicit array to IList<T> conversion.
636 2008-08-20 Marek Safar <marek.safar@gmail.com>
638 A fix for bug #362740
639 * cs-tokenizer.cs: Handle UTF-16 surrogates.
641 2008-08-20 Marek Safar <marek.safar@gmail.com>
643 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
644 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
645 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
646 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
647 handling to use just one type of infrastructure and deal with generics
650 2008-07-23 Martin Baulig <martin@ximian.com>
652 *** Merged this from trunk revision 108527 ***
655 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
656 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
659 2008-08-15 Marek Safar <marek.safar@gmail.com>
661 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
664 2008-08-15 Marek Safar <marek.safar@gmail.com>
666 * delegate.cs: Fixed compiler crash when creating delegate using partial
669 * typemanager.cs: MulticastDelegate is not a delegate.
671 2008-08-14 Marek Safar <marek.safar@gmail.com>
673 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
676 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
678 * cs-parser.jay (type): Allow 'var' in mcs too.
679 (local_variable_type): Likewise.
681 2008-08-14 Marek Safar <marek.safar@gmail.com>
683 * driver.cs: Removed broken -noconfig variants.
685 2008-08-14 Marek Safar <marek.safar@gmail.com>
687 A fix for bug #417078
688 * expression.cs: Emit correctly left side pointer operators.
690 2008-08-13 Marek Safar <marek.safar@gmail.com>
692 * generic.cs, lambda.cs: Inflate method generic arguments only.
694 2008-08-12 Marek Safar <marek.safar@gmail.com>
696 * class.cs: Fixed struct layout check regression.
698 2008-08-12 Marek Safar <marek.safar@gmail.com>
700 * cs-parser.jay, enum.cs: Simplified enum parsing.
702 * decl.cs: Check all type parameters conflicts.
704 * expression.cs, statement.cs, attribute.cs: More expression checks.
706 2008-08-11 Marek Safar <marek.safar@gmail.com>
708 * generic.cs: Add type inference types restriction.
710 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
711 anonymous.cs, expression.cs: Allocate less accessor parameters.
713 2008-08-08 Marek Safar <marek.safar@gmail.com>
715 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
718 2008-08-08 Marek Safar <marek.safar@gmail.com>
720 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
722 2008-08-07 Marek Safar <marek.safar@gmail.com>
724 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
725 Also fixes #362146 and #381592.
727 2008-08-07 Marek Safar <marek.safar@gmail.com>
729 * ecore.cs: Reduced constant cannot be used as an attribute value.
731 * cs-parser.jay: Base expression has to be a type.
733 * expression.cs (Conditional): Uses ReducedExpression.
735 2008-08-06 Marek Safar <marek.safar@gmail.com>
737 A fix for bug #376826
738 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
739 address of hoisted local variable or parameter cannot be taken.
741 2008-08-05 Marek Safar <marek.safar@gmail.com>
743 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
744 anonymous method inside checked/unchecked expression.
746 2008-08-05 Marek Safar <marek.safar@gmail.com>
748 * typemanager.cs (IsEqual): Guard against null.
750 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
751 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
752 routine. Fixed few misleading conversion errors.
754 2008-08-04 Marek Safar <marek.safar@gmail.com>
756 * class.cs: Consider generics when checking cycles in struct layout.
758 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
760 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
762 2008-08-04 Marek Safar <marek.safar@gmail.com>
764 A fix for bug #414165
765 * anonymous.cs: Use same anonymous implementation method for all anonymous
768 2008-08-04 Marek Safar <marek.safar@gmail.com>
770 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
773 2008-08-04 Marek Safar <marek.safar@gmail.com>
775 * cs-parser.jay: Typeof argument has to be a type expression.
777 * namespace.cs: Check alias and namespace definitions collisions.
779 * class.cs, pending.cs: Moved explicit interface accessor implementation
782 * delegate.cs, expression.cs: Verify special name invocations.
784 2008-08-01 Marek Safar <marek.safar@gmail.com>
786 * cs-parser.jay: Don't choke on empty generic type arguments.
788 * cs-tokenizer.cs: Handle escaped preprocessor directives.
790 * expression.cs, ecore.cs: Minor expressions bugs.
792 2008-08-01 Marek Safar <marek.safar@gmail.com>
794 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
795 and added more error handling.
797 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
799 * modifiers.cs, enum.cs: Fixed.
801 2008-07-31 Jb Evain <jbevain@novell.com>
803 * driver.cs: remove -pkg ability of smcs.
805 2008-07-30 Marek Safar <marek.safar@gmail.com>
807 * statement.cs (Switch): Correctly set empty default target for single
810 2008-07-30 Marek Safar <marek.safar@gmail.com>
812 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
813 string switch statement implementation to use string dictionary which
814 significantly (2-8x) improves performance of generated code.
816 2008-07-29 Marek Safar <marek.safar@gmail.com>
818 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
819 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
821 2008-07-29 Marek Safar <marek.safar@gmail.com>
823 A fix for bug #412595
824 * typemanager.cs, convert.cs, expression.cs: Some types are never
825 convertible to each other.
827 2008-07-29 Marek Safar <marek.safar@gmail.com>
829 * nullable.cs (CreateNullConstant): An error messages update.
831 2008-07-29 Marek Safar <marek.safar@gmail.com>
833 A fix for bug #412595
834 * cfold.cs: Don't cast undefined bool constant.
836 2008-07-29 Martin Baulig <martin@ximian.com>
839 (SymbolWriter.Reset): New public static method.
842 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
844 2008-07-28 Marek Safar <marek.safar@gmail.com>
846 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
848 * expression.cs (ElementAccess): Exact size allocation.
850 2008-07-26 Marek Safar <marek.safar@gmail.com>
852 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
854 2008-07-25 Marek Safar <marek.safar@gmail.com>
856 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
858 * class.cs: Removed $PRIVATE$ field hack which caused problems during
861 2008-07-25 Marek Safar <marek.safar@gmail.com>
863 A fix for bug #412217
864 * assign.cs: Mutate also assignment type.
866 2008-07-25 Marek Safar <marek.safar@gmail.com>
868 A fix for bug #323644
869 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
872 2008-07-25 Marek Safar <marek.safar@gmail.com>
874 A fix for bug #412134
875 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
876 non-enumerable operands when overloading equality or bitwise operators.
878 2008-07-25 Marek Safar <marek.safar@gmail.com>
880 * anonymous.cs: Cache closed generic anonymous method delegates.
882 2008-07-24 Marek Safar <marek.safar@gmail.com>
884 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
885 anonymous.cs, statement.cs: Always emit anonymous method as static method
886 when is instance free. Use nesting for nested anynomous methods blocks.
888 2008-07-23 Marek Safar <marek.safar@gmail.com>
890 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
893 2008-07-23 Marek Safar <marek.safar@gmail.com>
895 * expression.cs: Removed MakeSimpleCall.
897 2008-07-23 Marek Safar <marek.safar@gmail.com>
899 A fix for bug #323012
900 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
901 Base method implementing interface has to be public.
903 2008-07-23 Marek Safar <marek.safar@gmail.com>
905 * cs-parser.jay: Don't break on missing argument.
907 2008-07-22 Marek Safar <marek.safar@gmail.com>
909 A fix for bug #320993
910 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
911 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
913 2008-07-22 Marek Safar <marek.safar@gmail.com>
915 A fix for bug #320748
916 * convert.cs: Implicit user operators cannot convert to interfaces
918 2008-07-22 Marek Safar <marek.safar@gmail.com>
920 A fix for bug #312686
921 * driver.cs: Ignore empty assembly references.
923 2008-07-22 Marek Safar <marek.safar@gmail.com>
925 A fix for bug #387040
926 * ecore.cs: Skip constrains check for an explicit implementation.
928 2008-07-21 Marek Safar <marek.safar@gmail.com>
930 A fix for bug #409045
931 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
932 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
933 identifiers are file specific unless passed as input arguments.
935 2008-07-21 Marek Safar <marek.safar@gmail.com>
937 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
938 to emit UnmanagedMarshal data under 2.0 profile.
940 2008-07-21 Marek Safar <marek.safar@gmail.com>
942 A fix for bug #410369
943 * parameter.cs: Clone correctly ParamsParameter.
945 2008-07-21 Marek Safar <marek.safar@gmail.com>
947 * expression.cs (Argument): Always report type for type based expressions
950 2008-07-18 Marek Safar <marek.safar@gmail.com>
952 A fix for bug #410666
953 * anonymous.cs: Correctly initialize generic storey reference.
955 2008-07-18 Marek Safar <marek.safar@gmail.com>
957 * convert.cs: Don't box same type arguments.
959 2008-07-18 Marek Safar <marek.safar@gmail.com>
961 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
962 Finished missing generic type mutators.
964 2008-07-18 Marek Safar <marek.safar@gmail.com>
966 * iterators.cs, statement.cs: Finished statements CloneTo.
968 2008-07-18 Marek Safar <marek.safar@gmail.com>
970 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
972 * expression.cs: Emit optimized default value expressions in expression tree
975 2008-07-18 Marek Safar <marek.safar@gmail.com>
977 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
979 2008-07-17 Marek Safar <marek.safar@gmail.com>
981 A fix for bug #367536
982 * cs-parser.jay: Check static constructor of generic types for an access
985 2008-07-17 Marek Safar <marek.safar@gmail.com>
987 A fix for bug #353800
988 * lambda.cs: Emit ret for contextual statements.
990 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
991 up emitting redundant ret for all anonymous methods with return.
993 2008-07-17 Marek Safar <marek.safar@gmail.com>
995 A fix for bug #365188
996 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
997 create anonymous method storey in unreachable block.
999 2008-07-17 Marek Safar <marek.safar@gmail.com>
1001 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1002 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1003 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1004 statement.cs: Fixed relevant defects found by Gendarme.
1006 2008-07-17 Marek Safar <marek.safar@gmail.com>
1008 A fix for bug #325291
1009 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
1010 statement.cs: Replaced IAnonymousHost with top level block flag.
1012 2008-07-17 Marek Safar <marek.safar@gmail.com>
1014 * cs-parser.jay: Clean up unused open_parens.
1016 2008-07-17 Marek Safar <marek.safar@gmail.com>
1018 * ecore.cs: Custom error message for a range variable assignment.
1020 2008-07-16 Marek Safar <marek.safar@gmail.com>
1022 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1025 2008-07-16 Marek Safar <marek.safar@gmail.com>
1027 * literal.cs: Null literal is of object type.
1029 2008-07-16 Marek Safar <marek.safar@gmail.com>
1031 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1032 expression of nullable equality comparison.
1034 2008-07-15 Marek Safar <marek.safar@gmail.com>
1036 * expression.cs(PointerArithmetic): Removed redundant assignment.
1038 2008-07-15 Marek Safar <marek.safar@gmail.com>
1040 * decl.cs (GetSignatureForError): Report full namespace name for containers.
1042 2008-07-14 Marek Safar <marek.safar@gmail.com>
1044 A fix for bug #408361
1045 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1046 they are replaced by GetMethod.
1048 2008-07-14 Marek Safar <marek.safar@gmail.com>
1050 A fix for bug #408721 by jeremie.laval@gmail.com
1051 * expression.cs (Indirection): Implemented CloneTo.
1053 2008-07-14 Marek Safar <marek.safar@gmail.com>
1055 * statement.cs (AssignableSlots): Temporary disabled variable initialization
1058 2008-07-14 Marek Safar <marek.safar@gmail.com>
1060 * report.cs (EnableReporting): Don't reinitialize 0-based values.
1062 2008-07-11 Marek Safar <marek.safar@gmail.com>
1064 * linq.cs: Reset tranparent parameter counter in probing mode.
1066 2008-07-11 Marek Safar <marek.safar@gmail.com>
1068 * anonymous.cs: Mutate anonymous method type.
1070 2008-07-11 Marek Safar <marek.safar@gmail.com>
1072 * ecore.cs, anonymous.cs: Mutate field expressions.
1074 2008-07-10 Marek Safar <marek.safar@gmail.com>
1076 A fix for bug #369670
1077 * linq.cs, statement.cs: Use explicit block for query expressions variables.
1079 2008-07-10 Marek Safar <marek.safar@gmail.com>
1081 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1083 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
1086 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1087 only one '>', and finds a '>>', abort the generic lookahead.
1089 2008-07-10 Marek Safar <marek.safar@gmail.com>
1091 A fix for bug #319902
1092 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
1094 2008-07-10 Marek Safar <marek.safar@gmail.com>
1096 A fix for bug #406371
1097 * statement.cs: Moved EmitSymbolInfo to Block.
1099 2008-07-09 Marek Safar <marek.safar@gmail.com>
1101 * ecore.cs: Report better error for extension method overload failures.
1103 2008-07-09 Marek Safar <marek.safar@gmail.com>
1105 * expression.cs (Is): No need to box reference values.
1107 2008-07-09 Marek Safar <marek.safar@gmail.com>
1109 * class.cs: Use event resolve context when initializing CreateEmitContext.
1111 2008-07-09 Marek Safar <marek.safar@gmail.com>
1113 A fix for bug #394436
1114 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1115 method used inside expression trees. Added more LINQ to expression tree
1118 2008-07-08 Marek Safar <marek.safar@gmail.com>
1120 A fix for bug #378189, #370577
1121 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1124 2008-07-08 Marek Safar <marek.safar@gmail.com>
1126 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1129 2008-07-08 Marek Safar <marek.safar@gmail.com>
1131 A fix for bug #406702
1132 * anonymous.cs: Always park anonymous method in the nearest parent storey.
1134 2008-07-07 Marek Safar <marek.safar@gmail.com>
1136 A fix for bug #406648
1137 * cs-parser.jay: Report nullable use in mcs for some cases.
1139 2008-07-07 Marek Safar <marek.safar@gmail.com>
1141 * ecore.cs: Improved argument mismatch error messages.
1143 2008-07-07 Marek Safar <marek.safar@gmail.com>
1145 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1147 2008-07-07 Marek Safar <marek.safar@gmail.com>
1149 * expression.cs (TypeOf): Mutate type argument.
1151 2008-07-04 Marek Safar <marek.safar@gmail.com>
1153 * class.cs: Report missing partial modifier for correct type.
1155 2008-07-04 Marek Safar <marek.safar@gmail.com>
1157 * ecore.cs, expression.cs (VariableReference): Variable property is
1160 2008-07-04 Marek Safar <marek.safar@gmail.com>
1162 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1164 2008-07-04 Marek Safar <marek.safar@gmail.com>
1166 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1169 2008-07-04 Marek Safar <marek.safar@gmail.com>
1171 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1172 anonymous method storey to an instance method when only "this" is hoisted.
1174 2008-07-03 Marek Safar <marek.safar@gmail.com>
1176 A fix for bug #321615
1177 * expression.cs: Pointer comparisons use unsigned operator.
1179 2008-07-03 Marek Safar <marek.safar@gmail.com>
1181 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1183 2008-07-02 Marek Safar <marek.safar@gmail.com>
1185 A fix for bug #404905
1186 * class.cs: Always initialize local unsafe variables.
1188 2008-06-30 Marek Safar <marek.safar@gmail.com>
1190 A fix for bug #396987
1191 * expression.cs (NewInitialize): Clear local temporary variable for next run
1193 2008-06-27 Marek Safar <marek.safar@gmail.com>
1195 A fix for bug #401020
1196 * ecore.cs: Both types and modifiers have to match for ref and out arguments
1198 2008-06-27 Marek Safar <marek.safar@gmail.com>
1200 A fix for bug #398319
1201 * cs-parser.jay: Implemented undocumented base access expression inside
1204 2008-06-26 Marek Safar <marek.safar@gmail.com>
1206 A fix for bug #404227
1207 * cs-parser.jay: Parse namespace declaration using qualified identifier.
1209 2008-06-26 Marek Safar <marek.safar@gmail.com>
1211 A fix for bug #404227
1212 * convert.cs: Fixed explicit array to interface cast.
1214 2008-06-26 Marek Safar <marek.safar@gmail.com>
1216 A fix for bug #403894
1217 * delegate.cs: Mutate DelegateInvocation type.
1219 2008-06-26 Marek Safar <marek.safar@gmail.com>
1221 A fix for bug #379348
1222 * delegate.cs: Box a load of generic parameters.
1224 2008-06-26 Marek Safar <marek.safar@gmail.com>
1226 * expression.cs: Add an array creation arguments mutate.
1228 2008-06-26 Marek Safar <marek.safar@gmail.com>
1230 A fix for bug #386068
1231 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1234 2008-06-25 Marek Safar <marek.safar@gmail.com>
1236 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1239 2008-06-25 Marek Safar <marek.safar@gmail.com>
1241 A fix for bug #403518
1242 * delegate.cs: Type correctly anonymous method new invocation.
1244 2008-06-24 Marek Safar <marek.safar@gmail.com>
1246 A fix for bug #394826
1247 * anonymous.cs: Fully qualify members when resolving anonymous type internal
1250 2008-06-24 Marek Safar <marek.safar@gmail.com>
1252 A fix for bug #394826
1253 * anonymous.cs, iterators.cs: Construct generic storey only when is really
1256 2008-06-24 Marek Safar <marek.safar@gmail.com>
1258 * class.cs: Clone indexer parameters for localized capturing.
1260 2008-06-24 Marek Safar <marek.safar@gmail.com>
1262 A fix for bug #402379
1263 * expression.cs: Don't crash when an object initializer resolve fails.
1265 2008-06-24 Marek Safar <marek.safar@gmail.com>
1267 A fix for bug #402888
1268 * expression.cs: Mutate conditional expression.
1270 2008-06-24 Marek Safar <marek.safar@gmail.com>
1272 A fix for bug #401012
1273 * class.cs: Keep StructLayout in shared container.
1275 2008-06-24 Marek Safar <marek.safar@gmail.com>
1277 A fix for bug #400438
1278 * decl.cs, class.cs: Only properties can be automatically implemented.
1280 2008-06-24 Marek Safar <marek.safar@gmail.com>
1282 * statement.cs (ChangeToIterator): Copy also labels.
1284 2008-06-23 Marek Safar <marek.safar@gmail.com>
1286 * ecore.cs: Pass type argument details to parent extension method.
1288 2008-06-23 Marek Safar <marek.safar@gmail.com>
1290 A fix for bug #375966
1291 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1293 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
1295 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1297 2008-06-22 Marek Safar <marek.safar@gmail.com>
1299 A fix for bug #394347
1300 * anonymous.cs: Cache compatible delegates as compatibility check produces
1301 a new method every time.
1303 2008-06-20 Marek Safar <marek.safar@gmail.com>
1305 * anonymous.cs: Propagate storey reference for single references.
1307 2008-06-20 Marek Safar <marek.safar@gmail.com>
1309 A fix for bug #387615
1310 * assign.cs, expression.cs: Correctly clone compound assignment.
1312 2008-06-19 Marek Safar <marek.safar@gmail.com>
1314 A fix for bug #359611, #359604
1315 * anonymous.cs: Mutate all types of hoisted parameters.
1317 2008-06-19 Marek Safar <marek.safar@gmail.com>
1319 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1320 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1321 expression.cs, codegen.cs, statement.cs
1323 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
1324 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
1326 ** Anonymous methods, lambda expressions rewrite **
1328 Anonymous expressions are now resolved when an explicit block is resolved
1329 and they don't require any registration procedure anymore. Further,
1330 anonymous methods are defined when explicit block is emitted which allows
1331 better control of whole process and opens possibilities for more
1332 optimizations as well as alternative to reverse whole process.
1334 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
1335 process consistent and to correctly emit hoisted generic methods when they
1336 have at least 1 hoisted variable.
1338 2008-06-17 Martin Baulig <martin@ximian.com>
1340 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
1342 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
1343 virtual property; check it in Emit().
1344 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
1346 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
1348 (Indexer.Define): Likewise.
1350 2008-06-17 Marek Safar <marek.safar@gmail.com>
1352 * convert.cs: Don't use IsInterface on type arguments.
1354 * delegate.cs: DelegateInvocation uses MethodInfo.
1356 * parameter.cs: Removed IsTypeParameter.
1358 * generic-mcs.cs: More missing stuff.
1360 2008-06-16 Martin Baulig <martin@ximian.com>
1363 (Modifiers.DEBUGGER_HIDDEN): New public const.
1366 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
1369 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
1370 (AbstractPropertyEventMethod): Likewise.
1371 (Constructor.Emit): Likewise.
1372 (SourceMethod.SetCompilerGenerated): Removed.
1374 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
1378 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
1379 if we're an `IteratorHost'.
1380 (AnonymousMethodMethod..ctor): Don't set
1381 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
1384 2008-06-16 Marek Safar <marek.safar@gmail.com>
1386 * statement.cs: Clean-up foreach statements.
1388 2008-06-12 Marek Safar <marek.safar@gmail.com>
1390 * class.cs: Stop using public method which should not exist
1391 (MethodBuilder.SetGenericMethodSignature).
1393 2008-06-11 Martin Baulig <martin@ximian.com>
1396 (Location.LookupFile): Add `CompilationUnit' argument; when given
1397 a relative file name, make it relative to the directory the .cs
1398 file is located in instead of using the current directory.
1400 2008-06-11 Martin Baulig <martin@ximian.com>
1403 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
1404 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
1405 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
1406 (SourceMethod.SetCompilerGenerated): Likewise.
1408 2008-06-11 Marek Safar <marek.safar@gmail.com>
1410 * codegen.cs, driver: Only write symbol file when it's asked for.
1412 2008-06-11 Marek Safar <marek.safar@gmail.com>
1414 * codegen.cs: Don't use assembly writer error handling for symbol writer.
1416 2008-06-10 Martin Baulig <martin@ximian.com>
1418 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
1420 2008-06-09 Marek Safar <marek.safar@gmail.com>
1422 A fix for bug #316290
1423 * expression.cs: Include decimal operators in predefined table.
1425 * parameters.cs: More readonlyness.
1427 2008-06-09 Marek Safar <marek.safar@gmail.com>
1429 A fix for bug #397213
1430 * cs-parser.jay: One more missing current_local_parameters reset.
1432 2008-06-09 Marek Safar <marek.safar@gmail.com>
1434 A fix for bug #396633
1435 * class.cs: Host backing field in partial container.
1437 2008-06-09 Marek Safar <marek.safar@gmail.com>
1439 A fix for bug #397068
1440 * expression.cs: Check both operand types when predefined operator is used.
1442 2008-06-05 Martin Baulig <martin@ximian.com>
1444 Merged the `debugger-kahalo' branch.
1447 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
1448 we're an iterator method.
1449 (SourceMethod): Reflect latest symbol writer changes;
1450 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
1451 now `start_row' and `end_row'.
1452 (Constructor.Emit): Fix the logic whether to emit symbol information.
1454 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
1458 (CompilationUnit): New public class; derives from `SourceFile'.
1459 (SourceFileEntry.DefineSymbolInfo): New public method.
1460 (SourceFileEntry.SetChecksum): New public method.
1461 (Location): Encode hidden line numbers by using `column == 255';
1462 the .ctor now accepts `column == -1' to mark a hidden line number.
1463 (Location.Hidden): New public property.
1464 (Location.CheckPoint): Add `CompilationUnit'.
1465 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
1466 (Location.Push): Add `CompilationUnit compile_unit' argument.
1467 (Location.CompilationUnit): New public property.
1470 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
1472 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
1474 * driver.cs: `SourceFile' -> `CompilationUnit'.
1476 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
1478 * namespace.cs: `SourceFile' -> `CompilationUnit'.
1480 * cs-tokenizer.cs: Add support for `#pragma checksum' and
1484 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
1485 new symbol writer API to also pass the file.
1487 2008-06-05 Marek Safar <marek.safar@gmail.com>
1489 * statement.cs: Emit catch variable assignment using variable expression.
1491 2008-06-05 Marek Safar <marek.safar@gmail.com>
1493 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
1494 with other variable types.
1496 2008-06-04 Marek Safar <marek.safar@gmail.com>
1498 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
1499 GetLength method emit, it breaks resolve rules.
1501 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
1502 Marek Safar <marek.safar@gmail.com>
1504 A fix for bug #395542
1505 * cs-parser.jay: The trailing comma is allowed in anonymous type member
1508 2008-06-02 Marek Safar <marek.safar@gmail.com>
1510 A fix for bug #395287
1511 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
1513 2008-05-31 Marek Safar <marek.safar@gmail.com>
1515 A fix for bug #395845
1516 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
1517 non-nullable parameter type.
1519 2008-05-31 Marek Safar <marek.safar@gmail.com>
1521 * class.cs: Handle contructor initializer as a statement in top-level block.
1523 2008-05-30 Marek Safar <marek.safar@gmail.com>
1525 * attribute.cs: Don't mix old and new corlib types when emitting corlib
1526 security attributes.
1528 2008-05-24 Marek Safar <marek.safar@gmail.com>
1530 * ecore.cs, expression.cs: Small IVariable refactoring.
1532 2008-05-22 Marek Safar <marek.safar@gmail.com>
1534 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
1536 2008-05-21 Marek Safar <marek.safar@gmail.com>
1538 * cs-parser.jay: Removed redundant catch type check.
1540 2008-05-21 Marek Safar <marek.safar@gmail.com>
1542 A fix for bug #390372
1543 * nullable.cs: Set correct return type.
1545 2008-05-21 Marek Safar <marek.safar@gmail.com>
1547 A fix for bug #391062
1548 * typemanager.cs: Fixed crash when comparing null types.
1550 2008-05-21 Marek Safar <marek.safar@gmail.com>
1552 A fix for bug #391871
1553 * cs-parser.jay: Better error handling for invalid catch type.
1555 2008-05-20 Marek Safar <marek.safar@gmail.com>
1557 A fix for bug #392155
1558 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
1560 2008-05-15 Marek Safar <marek.safar@gmail.com>
1562 A fix for bug #390666
1563 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
1566 2008-05-15 Marek Safar <marek.safar@gmail.com>
1568 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
1571 2008-05-13 Marek Safar <marek.safar@gmail.com>
1573 A fix for bug #389625
1574 * delegate.cs, generic.cs: Some progress on method group return type
1577 2008-05-13 Marek Safar <marek.safar@gmail.com>
1579 A fix for bug #378419
1580 * namespace.cs: Inspect also parent namespaces not only namespace entries.
1582 2008-05-12 Marek Safar <marek.safar@gmail.com>
1584 * class.cs (Constructor): Added IsCompilerGenerated.
1586 2008-05-12 Marek Safar <marek.safar@gmail.com>
1588 * expression.cs: Enum binary operators can accept non-enum operand only when
1589 is implicitly convertible to underlying type.
1591 2008-05-12 Marek Safar <marek.safar@gmail.com>
1593 A fix for bug #389272
1594 * support.cs: Workaround System.InvalidOperationException for enums.
1596 2008-05-12 Marek Safar <marek.safar@gmail.com>
1598 A fix for bug #389073
1599 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
1601 2008-05-10 Marek Safar <marek.safar@gmail.com>
1603 * driver.cs: Split Parse.
1605 * location.cs (LookupFile): Uses string.Empty.
1607 2008-05-07 Marek Safar <marek.safar@gmail.com>
1609 * expression.cs, parameter.cs: Small ParameterReference clean up.
1611 2008-05-07 Marek Safar <marek.safar@gmail.com>
1613 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
1614 hack. Fixes #387502.
1616 2008-05-06 Martin Baulig <martin@ximian.com>
1618 * class.cs (Constructor.Emit): Fix the logic whether to emit
1621 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
1624 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
1625 InvalidOperationException when the iterator is before the start or
1628 2008-05-06 Marek Safar <marek.safar@gmail.com>
1630 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
1631 when left is nullable type.
1633 2008-05-06 Marek Safar <marek.safar@gmail.com>
1635 A fix for bug #386628
1636 * expression.cs (LocalVariableReference): Continue in resolving when
1637 variable is not assigned.
1639 2008-05-05 Marek Safar <marek.safar@gmail.com>
1641 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
1642 nullable operations.
1644 2008-05-04 Marek Safar <marek.safar@gmail.com>
1646 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
1647 it saves many redundant temporary variables for nullable operations.
1649 2008-05-03 Marek Safar <marek.safar@gmail.com>
1651 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
1653 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
1656 * nullable.cs: Constant coalescing operator optimizations.
1658 2008-05-03 Marek Safar <marek.safar@gmail.com>
1660 * constant.cs: Use unsigned conversion for values which are unsigned only.
1662 2008-05-03 Marek Safar <marek.safar@gmail.com>
1664 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
1665 coalescing operator as it should be.
1667 2008-05-02 Marek Safar <marek.safar@gmail.com>
1669 A fix for bug #371016
1670 * expression.cs: All predefined delegate operators require implicit method
1673 2008-05-02 Marek Safar <marek.safar@gmail.com>
1675 * constant.cs: Emit long constant as uint when fits the range.
1677 * convert.cs, expression.cs: Fixed few unsafe conversions.
1679 2008-05-02 Marek Safar <marek.safar@gmail.com>
1681 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
1683 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
1686 * convert.cs (ImplicitNumericConversion): Don't modify the type of
1688 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
1690 2008-05-01 Marek Safar <marek.safar@gmail.com>
1692 * constant.cs, literal.cs: IsLiteral property for error reporting.
1694 * ecore.cs, expression.cs: Implemented Property expression.
1696 2008-05-01 Marek Safar <marek.safar@gmail.com>
1698 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
1700 * nullable.cs: Implemented nullable coalescing null operator.
1702 * ecore.cs, expression.cs: Expression trees work.
1704 2008-05-01 Marek Safar <marek.safar@gmail.com>
1706 * ecore.cs: CreateExpressionTree is finally abstract.
1708 * expression.cs, linq.cs: Updated.
1710 2008-05-01 Marek Safar <marek.safar@gmail.com>
1712 * expression.cs, ecore.cs: Block base access expression inside expression
1715 2008-05-01 Marek Safar <marek.safar@gmail.com>
1717 A fix for bug #385058
1718 * expression.cs: User-defined operator implementations always take
1719 precedence over predefined operator implementations.
1721 2008-04-30 Marek Safar <marek.safar@gmail.com>
1723 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
1724 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
1725 expression tree conversions.
1727 2008-04-30 Marek Safar <marek.safar@gmail.com>
1729 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
1730 operators method details to Operator class.
1732 2008-04-30 Marek Safar <marek.safar@gmail.com>
1734 * anonymous.cs: Pass unsafe flags to anonymous container.
1736 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
1737 inside expression tree.
1739 2008-04-29 Martin Baulig <martin@ximian.com>
1741 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
1742 (Tokenizer.PopPosition): Also restore the `line'.
1744 2008-04-29 Marek Safar <marek.safar@gmail.com>
1746 * delegate.cs: Implemented Invoke expression.
1748 2008-04-29 Marek Safar <marek.safar@gmail.com>
1750 * expression.cs: Fixed equality reference comparison regression.
1752 2008-04-29 Marek Safar <marek.safar@gmail.com>
1754 * ecore.cs: Clean up EmptyCast hack.
1756 * expression.cs, nullable.cs: Implemented enum binary and unary operations
1757 using correct conversion rules. Also fixes #383993.
1759 2008-04-28 Martin Baulig <martin@ximian.com>
1761 * class.cs (Constructor.Emit): Don't emit debugging information
1762 for generated default .ctor's.
1764 2008-04-28 Marek Safar <marek.safar@gmail.com>
1766 * convert.cs: Empty-cast ushort to int conversion.
1768 2008-04-28 Marek Safar <marek.safar@gmail.com>
1770 A fix for bug #384191
1771 * ecore.cs, expression.cs: Fixed expression cloning.
1773 2008-04-28 Marek Safar <marek.safar@gmail.com>
1775 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
1777 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
1779 Fix #381559, test-638.cs, test-639.cs
1780 * assign.cs (CompoundAssign.Helper): New wrapper.
1781 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
1783 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
1784 Pass unconverted expressions to the params array creation expression.
1785 (FieldExpr.EmitAssign): Don't special-case StringConcat.
1786 (PropertyExpr.EmitAssign): Likewise.
1787 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
1788 element if it is of kind CompoundAssign.Helper.
1789 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
1790 first before anything else.
1791 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
1792 (ArrayAccess.LoadArrayAndArguments): Simplify.
1794 2008-04-27 Marek Safar <marek.safar@gmail.com>
1796 * expression.cs: Fixed cloning of typeof(void).
1798 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
1800 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
1801 (Assign.Emit): Likewise. Move it to ...
1802 (CompoundAssign.DoResolve): ... here and ...
1803 (CompoundAssign.Emit): ... here.
1804 (EventAddOrRemove): New helper to handle += and -= on events, and
1805 avoid the use of BinaryDelegates.
1806 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
1807 (EventExpr.EmitAddOrRemove): Improve.
1808 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
1810 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
1811 create VarExprs for 'foo.bar.var'.
1812 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
1813 is a highly inappropriate name for its functionality.
1815 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
1817 Simplify handling of multiple assignments
1818 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
1820 (SimpleAssign): New. Class to be used for normal assignments.
1821 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
1822 * expression.cs, parameter.cs, statement.cs: Likewise.
1824 2008-04-25 Marek Safar <marek.safar@gmail.com>
1826 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
1827 for incompatible underlying types, more to come, uff.
1829 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
1832 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
1833 Handle 'leave_copy'.
1835 2008-04-25 Marek Safar <marek.safar@gmail.com>
1837 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
1839 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
1841 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
1842 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
1843 * statement.cs (While, Do, For): Allow test to have side effects.
1844 (For.DoEmit): Always emit InitStatement.
1847 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
1848 Always create SideEffectConstant.
1849 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
1850 of type EnumConstant.
1852 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
1853 Handle 'right' being SideEffectConstant of type 'bool'.
1855 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
1856 Use left.EmitBranchable instead of open coding it, so as to
1857 improve optimization opportunities.
1859 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
1861 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
1863 (Expression.EmitSideEffect): Document.
1865 2008-04-23 Marek Safar <marek.safar@gmail.com>
1867 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
1869 2008-04-23 Marek Safar <marek.safar@gmail.com>
1871 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
1873 2008-04-23 Marek Safar <marek.safar@gmail.com>
1875 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
1876 conversion to expression tree.
1878 2008-04-23 Marek Safar <marek.safar@gmail.com>
1880 * ecore.cs: Removed unused expression.
1882 2008-04-22 Marek Safar <marek.safar@gmail.com>
1884 * expression.cs: Implemented NegateChecked and New expressions.
1886 2008-04-22 Marek Safar <marek.safar@gmail.com>
1888 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
1890 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
1893 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
1894 needing final 'ret' instruction.
1896 2008-04-22 Marek Safar <marek.safar@gmail.com>
1898 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
1900 2008-04-21 Marek Safar <marek.safar@gmail.com>
1902 * expression.cs: Emit ldnull and not null expression as an instance argument
1903 of static method expression calls.
1905 2008-04-21 Marek Safar <marek.safar@gmail.com>
1907 A fix for bug #378200
1908 * expression.cs: Fixed crash when creating parameterless expression tree
1911 2008-04-21 Marek Safar <marek.safar@gmail.com>
1913 A fix for bug #375297
1914 * anonymous.cs: Fixed crash when inferring from null argument anonymous
1917 2008-04-21 Marek Safar <marek.safar@gmail.com>
1919 A fix for bug #377596
1920 * decl.cs, class.cs: Emit delegate type argument attributes.
1922 2008-04-21 Marek Safar <marek.safar@gmail.com>
1924 A fix for bug #365314
1925 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
1927 2008-04-21 Marek Safar <marek.safar@gmail.com>
1929 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
1932 2008-04-21 Marek Safar <marek.safar@gmail.com>
1934 * generic.cs (TypeParameter): Removed redundant location.
1936 2008-04-19 Marek Safar <marek.safar@gmail.com>
1938 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
1939 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
1940 FullNamedExpression in all declaration type expression, statements will come
1943 2008-04-18 Marek Safar <marek.safar@gmail.com>
1945 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
1946 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
1948 2008-04-18 Marek Safar <marek.safar@gmail.com>
1950 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
1953 2008-04-17 Marek Safar <marek.safar@gmail.com>
1955 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
1958 2008-04-17 Marek Safar <marek.safar@gmail.com>
1960 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
1964 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
1966 Hook up 'EmitSideEffect'
1967 * constant.cs (Constant.EmitSideEffect): New.
1968 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
1969 (SideEffectConstant.EmitSideEffect): New.
1970 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
1971 unconditional branch in EmitBranchable.
1972 (FieldExpr.EmitBranchable): New.
1973 * expression.cs (Unary.EmitSideEffect): New.
1974 (Binary.EmitSideEffect): New.
1975 (VariableReference.EmitSideEffect): New. Do nothing.
1977 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
1979 Introduce 'EmitSideEffect'
1980 * ecore.cs (Expression.EmitSideEffect): New.
1981 (TypeCast): Rename from EmptyCast.
1983 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
1984 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
1985 * convert.cs, nullable.cs: Update to changes.
1987 2008-04-16 Marek Safar <marek.safar@gmail.com>
1989 * class.cs, cs-parser.jay: Early check for base types expression.
1991 2008-04-16 Marek Safar <marek.safar@gmail.com>
1993 * decl.cs (MemberName): Declare PrettyName as obsolete.
1995 2008-04-16 Marek Safar <marek.safar@gmail.com>
1997 * namespace.cs: Use MemberName comparison.
1999 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2002 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
2004 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2005 (MemberName.FullyQualifiedName): New. Provides the functionality
2006 that users assume FullName would have.
2007 * ecore.cs, namespace.cs: Update to changes.
2009 * statement.cs (Using.assign): Make into ExpressionStatement.
2010 (Using.EmitPreTryBody): Simplify.
2012 2008-04-16 Marek Safar <marek.safar@gmail.com>
2014 * report.cs: ColorFormat is protected.
2016 * rootcontext.cs: Unused fields clean-up.
2018 * namespace.cs: Made UsingEntry name private.
2020 2008-04-16 Marek Safar <marek.safar@gmail.com>
2022 * cs-tokenizer.cs, location.cs: Removed unused field.
2024 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
2025 Raja R Harinath <harinath@hurrynot.org>
2028 * constant.cs (SideEffectConstant.value): Rename from 'left'.
2029 (SideEffectConstant.side_effect): Rename from 'right'.
2030 (SideEffectConstant..ctor): Normalize 'side_effect'.
2031 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2032 value of this constant.
2033 * cfold.cs: Update to changes.
2035 2008-04-15 Marek Safar <marek.safar@gmail.com>
2037 * cs-paser.jay: Removed unused variable.
2039 * driver.cs: Made Compile instance method.
2041 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
2043 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2045 2008-04-15 Marek Safar <marek.safar@gmail.com>
2047 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
2049 2008-04-13 Jb Evain <jbevain@novell.com>
2051 * namespace.cs: update the System.Core fullname for 2.1
2052 * driver.cs: update the list of required assemblies for 2.1.
2053 Merged from the Moonlight 2 branch.
2055 2008-04-11 Marek Safar <marek.safar@gmail.com>
2057 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2058 types and user defined operators. User operators arguments has to be checked
2059 for null value before invocation, which also means no operator is called
2060 when any argument is not convertible to unwrapped nullable type.
2062 2008-04-09 Marek Safar <marek.safar@gmail.com>
2064 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2065 of Unary expressions to follow operator overloading rules precisely.
2066 Also fixes #321794, #323794
2068 2008-04-08 Marek Safar <marek.safar@gmail.com>
2070 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2073 2008-04-08 Marek Safar <marek.safar@gmail.com>
2075 * expression.cs, ecore.cs: Implemented MemberInit expression.
2077 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
2079 Fix mono/tests/exception4.cs
2080 * statement.cs (ExceptionStatement, TryCatch): Revert to using
2081 ec.NeedReturnLabel () rather emitting a 'nop'.
2083 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2085 (TryCatch.SomeCodeFollows): Likewise.
2086 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2087 for 'break', 'continue' and 'return' statements inside a try.
2088 We're fairly sure that the generated IL stream will have more
2089 instructions textually following the try.
2090 (FlowBranchingTryCatch): Likewise.
2092 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2093 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2096 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2097 wrapper -- forward everything to CollectionForeach.
2098 (CollectionForeach.NonDisposableWrapper): New.
2099 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2100 instead of a pop + branch to end.
2102 2008-04-07 Marek Safar <marek.safar@gmail.com>
2104 A fix for bug #377485
2105 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
2106 Propagate location for extension method groups. Report conversion failure at
2109 2008-04-07 Marek Safar <marek.safar@gmail.com>
2111 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2112 ListInit and Field expressions.
2114 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
2116 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2117 Since $PC is always -1 inside the body of MoveNext, the fault
2119 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2120 * statement.cs (ExceptionStatement.emit_finally): Likewise.
2121 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2123 The denouement! Fix #324708
2124 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2125 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2126 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2127 'finally' inside the finally clause.
2129 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2130 inside an iterator. Don't emit the body of the 'finally' inside
2131 the finally clause yet.
2133 Use the ResumableStatement infrastructure for MoveNext ()
2134 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2135 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
2136 'old_resume_points'. Move dispatcher upfront.
2137 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2138 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2139 in an enumerator. This encodes the main fix in this patch series
2140 -- we can only jump into the first instruction of a try from the
2141 outside, but we want to emit try/finally regions in iterators and
2142 resume in the middle of them.
2144 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
2146 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2147 of NeedReturnLabel here.
2149 Introduce a common point for emitting try/finally to IL
2150 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
2151 features of the various subclasses, which are now driven by ...
2152 (ExceptionStatement.EmitPreTryBody): ... this and ...
2153 (ExceptionStatement.EmitTryBody): ... this and the original
2155 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2156 Remove DoEmit and update to follow above protocol.
2158 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2159 of the dispatcher are the same, skip emitting the 'switch'.
2160 * iterator.cs (Iterator.EmitDispose): Update to changes.
2162 Clean up handling of 'using' statement
2163 * statement.cs (UsingTemporary): New. Carved out of ...
2164 (Using): ... this. Simplify drastically. Handle exactly
2166 * cs-parser.jay (using_statement): Split. Create UsingTemporary
2167 or Using as appropriate. If there are multiple variable declared,
2168 create nested Using statements.
2169 (resource_acquisition): Kill.
2171 * statement.cs (ExceptionStatement.EmitForDispose): Use
2172 EmitFinallyBody, not EmitFinally.
2174 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2175 * iterator.cs: Update to changes.
2177 Start using the ResumableStatement infrastructure
2178 * statement.cs (ResumeableStatement.PrepareForDispose): New.
2179 (ResumableStatement.EmitForDispose): New.
2180 (ExceptionStatement): Override them.
2181 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2182 EmitForDispose to create the body of the Dispose method. Don't
2185 * iterator.cs (Iterator.AddResumePoint): Move here from ...
2186 * statement.cs (Toplevel.AddResumePoint): ... here.
2187 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2188 * flowanalysis.cs (FlowBranchingIterator): New.
2189 * codegen.cs (EmitContext): Update to changes.
2191 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2192 (Iterator.old_resume_points): Rename from 'resume_points'.
2193 (Iterator.MoveNextStatement): Remove unused class.
2195 New infrastructure for try/finally in iterators (still unused)
2196 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2197 (FlowBranchingToplevel.AddResumePoint): Hook into
2198 ToplevelBlock.AddResumePoint.
2199 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2200 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2201 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
2202 resume points and assign program-counter values.
2203 (ExceptionBlock.AddResumePoint): Collect resume points for
2204 de-muxer at the top of try block.
2205 * iterators.cs (Yield.CheckContext): Simplify.
2206 (Yield.Resolve): Use FlowBranching.AddResumePoint.
2208 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
2210 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2211 argument to an ExitStatement.
2212 (FlowBranchingException): Refactor saved origins code.
2213 * statement.cs (ExitStatement): Update to cahges.
2214 * iterator.cs (YieldBreak): Likewise.
2216 * statement.cs (ResumableStatement): New. Common base class for
2217 YieldReturn and ExceptionStatement.
2218 (ExitStatement): New. Common base class for Return and YieldBreak.
2219 (Return): Update to changes.
2220 * iterator.cs (YieldBreak): Likewise.
2221 * lambda.cs (ContextualReturn): Likewise.
2224 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2225 emit a meaningful error message.
2227 Fix #324765, #319508
2228 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2229 (VariableInfo.SetAssigned): Set it.
2230 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2231 determine if CS0219 or CS0168 is appropriate. Don't use
2232 flow-analysis information.
2233 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2234 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
2235 (EmitContext.EndFlowBranching): ... this.
2237 2008-04-03 Marek Safar <marek.safar@gmail.com>
2239 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2241 2008-04-03 Marek Safar <marek.safar@gmail.com>
2243 A fix for bug #376508
2244 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2245 ImplicitConversionExists.
2247 2008-04-03 Marek Safar <marek.safar@gmail.com>
2249 * expression.cs (Binary): Added remaining binary operators to expression
2252 * nullable.cs: Optimize shift with null argument.
2254 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
2256 Fix minor IL regression
2257 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2258 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2259 * cs-parser.jay (try_statement): Update to changes.
2261 * statement.cs (TryFinally.need_exc_block): Delete.
2262 (TryFinally): Update to changes.
2264 Now all ExceptionStatements are unconditional
2265 * statement.cs (CollectionForeach.DisposableWrapper): New.
2266 Extract out the try/finally code into a new wrapper.
2267 (CollectionForeach.Resolve): Use it to simplify the code.
2269 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
2271 Start at simplifying ExceptionStatement semantics a bit
2272 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2273 * cs-parser.jay (try_statement): Update to changes.
2274 (opt_catch_clauses): Remove.
2275 * flowanalysis.cs: Update to changes.
2276 (FlowBranching.BranchingType.TryCatch): New.
2277 (FlowBranchingTryCatch): New.
2279 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2280 (FlowBranching.CreateBranching): Update to changes.
2281 (FlowBranchingBlock.AddSibling): Add sanity check.
2282 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2285 * iterators.cs (Iterator.MarkFinally): Remove.
2286 * statement.cs (ExceptionStatement): Update to changes.
2288 Add support for skipping over finally blocks at runtime. First
2289 in a series to fix #324708
2290 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2291 (Iterator.EmitMoveNext): Initialize it.
2292 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2293 branch over the body of the 'finally' clause.
2295 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
2297 Avoid lopsided use of Foo/DoFoo names
2298 * statement.cs (ExpressionStatement.EmitFinallyBody):
2299 Rename from EmitFinally.
2300 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2301 * iterator.cs: Update to changes.
2303 2008-04-02 Marek Safar <marek.safar@gmail.com>
2305 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2306 based on UserOperatorCall. More binary nullable operators clean up.
2308 2008-04-02 Martin Baulig <martin@ximian.com>
2310 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2312 2008-04-02 Marek Safar <marek.safar@gmail.com>
2314 * nullable.cs: Merge user and empty conversions when lifting expression
2317 * expression.cs (StringConcat): Implemented expression tree representation.
2319 2008-04-01 Marek Safar <marek.safar@gmail.com>
2321 * nullable.cs: When lifting null literal and a user operator exists, no call
2324 2008-04-01 Marek Safar <marek.safar@gmail.com>
2326 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
2329 2008-04-01 Marek Safar <marek.safar@gmail.com>
2331 * nullable.cs, expression.cs: Use namespace instead heavily nested
2332 monster abstract class.
2334 2008-04-01 Marek Safar <marek.safar@gmail.com>
2336 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
2337 lifting of null literal and user operators. Clean up of some temporary
2340 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
2342 Fix #368224, test-629.cs
2343 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
2344 if it crossed an unwind-protect boundary.
2345 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
2346 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
2347 inside an unwind-protected region.
2348 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
2349 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
2350 'leave' instead of a 'br' if unwind-protected.
2351 (Iterator.EmitYieldBreak): Likewise.
2353 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
2355 * driver.cs: Only define versioninfo resources if no win32 resource
2358 2008-03-28 Marek Safar <marek.safar@gmail.com>
2360 A fix for bug #372375
2361 * convert.cs: Fixed boxing of nullable types.
2363 2008-03-28 Marek Safar <marek.safar@gmail.com>
2365 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
2368 2008-03-28 Marek Safar <marek.safar@gmail.com>
2370 A fix for bug #374619
2371 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
2373 2008-03-27 Marek Safar <marek.safar@gmail.com>
2375 * lambda.cs: Check return type only for invocation.
2377 2008-03-27 Marek Safar <marek.safar@gmail.com>
2379 A fix for bug #374214
2380 * ecore.cs: Correctly report argument type mismatch.
2382 2008-03-27 Marek Safar <marek.safar@gmail.com>
2384 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
2385 and not rely on broken IsEnum.
2387 2008-03-27 Marek Safar <marek.safar@gmail.com>
2389 * nullable.cs: New file, extracted from generic.cs.
2391 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
2393 2008-03-27 Marek Safar <marek.safar@gmail.com>
2395 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
2396 predefined comparison operators and null literals.
2398 * report.cs: New warning ID.
2400 2008-03-25 Marek Safar <marek.safar@gmail.com>
2402 A fix for bug #370577
2403 * lambda.cs: Check return type too.
2405 2008-03-25 Marek Safar <marek.safar@gmail.com>
2407 A fix for bug #372846
2408 * class.cs: Automatic properties can be declared as unsafe.
2410 2008-03-20 Marek Safar <marek.safar@gmail.com>
2412 * location.cs: Use string based concatenation.
2414 * expression.cs: LiftedBinaryOperator is gmcs only.
2416 2008-03-20 Marek Safar <marek.safar@gmail.com>
2418 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
2419 conversions rules and expression trees.
2421 2008-03-19 Marek Safar <marek.safar@gmail.com>
2423 * delegate.cs: Use extension method source as delegate target.
2425 2008-03-19 Marek Safar <marek.safar@gmail.com>
2427 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
2428 binary operations to be purely based on binary operations and optimized
2429 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
2430 and other ET refactoring.
2432 * typemanager.cs: Fixed warning.
2434 2008-03-17 Marek Safar <marek.safar@gmail.com>
2436 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
2438 * symbolwriter.cs: Fixed.
2440 2008-03-17 Marek Safar <marek.safar@gmail.com>
2442 * anonymous.cs, driver.cs: Reset anonymous types counters.
2444 2008-03-17 Marek Safar <marek.safar@gmail.com>
2446 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
2448 * class.cs: Use fullname for all type member definitions.
2450 2008-02-19 Martin Baulig <martin@ximian.com>
2453 (IMethodData.EmitExtraSymbolInfo): New interface method.
2454 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
2455 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
2456 interface method here as an empty public virtual method.
2459 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
2460 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
2461 CodeGen.SymbolWriter.SetRealMethodName().
2463 2008-02-18 Martin Baulig <martin@ximian.com>
2466 (ScopeInfo.EmitType): Override this and emit debugging
2467 information for captured variables.
2468 (RootScopeInfo.EmitType): Override this and emit symbol
2469 information for a captured `this'.
2471 2008-02-15 Martin Baulig <martin@ximian.com>
2473 * iterators.cs: Emit debugging info.
2476 (EmitContext.Flags): Add `OmitDebuggingInfo'.
2477 (EmitContext.OmitDebuggingInfo): New public property.
2480 (While): Override Emit() and don't emit symbol info there; do it
2481 inside DoEmit() instead.
2482 (Block.Emit): Omit symbol information while emitting the scope
2483 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
2485 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
2486 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
2487 .ctor to make `IsIterator' work.
2489 2008-03-14 Martin Baulig <martin@ximian.com>
2491 * symbolwriter.cs: Added the new symbol writer function from the
2492 debugger's `terrania' branch; temporarily enclose them inside
2493 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
2496 2008-03-14 Martin Baulig <martin@ximian.com>
2499 (SymbolWriter): Make this a public static class.
2502 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
2503 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
2505 2008-03-14 Marek Safar <marek.safar@gmail.com>
2507 A fix for bug #370577
2508 * statement.cs, lambda.cs: Added extra limitations when dealing with void
2511 2008-03-14 Marek Safar <marek.safar@gmail.com>
2513 * typemanager.cs (CSharpName): Made 250 times faster.
2515 2008-03-13 Marek Safar <marek.safar@gmail.com>
2517 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
2519 2008-03-12 Marek Safar <marek.safar@gmail.com>
2521 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
2522 crash when predefined field does not exist.
2524 2008-03-12 Marek Safar <marek.safar@gmail.com>
2526 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
2528 2008-03-12 Marek Safar <marek.safar@gmail.com>
2530 * class.cs (FixedField): Don't crash when contructors are missing.
2532 2008-03-11 Marek Safar <marek.safar@gmail.com>
2534 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
2535 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
2536 check internal types accessibility for internal and external types.
2537 Replaced EnumToUnderlying by GetEnumUnderlyingType.
2539 2008-03-11 Marek Safar <marek.safar@gmail.com>
2541 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
2542 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
2543 attribute.cs, statement: Use corect instance of predefined types (work
2544 related to #364674).
2546 2008-03-07 Marek Safar <marek.safar@gmail.com>
2548 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
2550 2008-03-07 Marek Safar <marek.safar@gmail.com>
2552 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
2553 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
2554 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
2555 predefined types clean up, delayed predefined types members initialization
2556 (work related to #364674).
2558 2008-03-05 Marek Safar <marek.safar@gmail.com>
2560 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
2562 2008-03-05 Marek Safar <marek.safar@gmail.com>
2564 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
2565 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
2566 predefined types clean up (work related to #364674).
2568 2008-03-04 Marek Safar <marek.safar@gmail.com>
2570 * ecore.cs: Print an error message instead of throwing exception.
2572 2008-03-04 Marek Safar <marek.safar@gmail.com>
2574 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
2575 expression.cs, statement.cs: Unififed null literal representation.
2577 2008-03-03 Marek Safar <marek.safar@gmail.com>
2579 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
2580 expression.cs: Refactored binary operators resolve phase and improved speed.
2581 The nullable code is still missing and won't work correctly, more fixes
2584 It also fixes #323726, #324312, #324248, and many other unreported issues.
2586 2008-02-29 Zoltan Varga <vargaz@gmail.com>
2588 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
2591 2008-02-27 Marek Safar <marek.safar@gmail.com>
2593 * ecore.cs: Clean-up and split BetterConversion.
2595 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
2598 * enum.cs (EnumMember.Value): Only access 'value' if
2599 ResolveValue says it's ok.
2600 (EnumMember.DoResolveValue): Don't set prev_member.value.
2601 (Enum.GetDefinition): Reverse arguments of Equals --
2602 EnumMember.Value can return 'null'.
2604 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
2606 2008-02-22 Marek Safar <marek.safar@gmail.com>
2608 * generic.cs, expression.cs: More ongoing work on expression trees.
2610 2008-02-21 Marek Safar <marek.safar@gmail.com>
2612 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
2613 handle missing matches when mutiple operators exist.
2615 2008-02-20 Marek Safar <marek.safar@gmail.com>
2617 A fix for bug #363218
2618 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
2621 2008-02-20 Marek Safar <marek.safar@gmail.com>
2623 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
2624 update. This time to deal correctly with SideEffectConstant expression used
2625 as an argument for another constant folding.
2627 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
2629 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
2632 2008-02-19 Marek Safar <marek.safar@gmail.com>
2634 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
2636 2008-02-19 Marek Safar <marek.safar@gmail.com>
2638 A fix for bug #328136
2639 * expression.cs: Do not fold immediately LogicalAnd operators when the left
2640 side is a false constant, because we still need to evaluate the right-hand
2643 * statement.cs (If): Emit two types of boolean constants (simple constant,
2644 side-effect constant).
2646 2008-02-19 Marek Safar <marek.safar@gmail.com>
2648 * constant.cs (SideEffectConstant): Don't emit boolean constant.
2650 * expression.cs: Fold immediately LogicalAnd operators when both sides are
2653 2008-02-18 Marek Safar <marek.safar@gmail.com>
2655 A fix for bug #361457
2656 * ecore.cs (IsApplicable): Params methods have lower priority.
2658 * support.cs: Return correct parameter modifier for params types.
2660 2008-02-18 Marek Safar <marek.safar@gmail.com>
2662 * generic.cs (TypeParameter): Cache attribute target name.
2664 * support.cs: Removed unused variable.
2666 * typemanager.cs: Removed debugging leftover.
2668 * ecore.cs: Use local type instead of a property;
2670 * class.cs (VerifyMembers): Consider also parent to test whether type member
2673 * expression.cs (FullMethodDesc): Removed.
2675 * attribute.cs (IsValidArgumentType): Made static.
2677 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
2679 Cleanup to be more readable.
2680 * Makefile (GMCS_PROFILE): Remove.
2681 (COMPILER_NAME): New helper.
2683 2008-02-15 Miguel de Icaza <miguel@novell.com>
2685 * cs-tokenizer.cs: if a conditional expression happens inside a
2686 (...) this also means that we do not need to de-ambiguate between
2687 an parenthesized expression and a cast.
2691 * constant.cs (SideEffectConstant): a constant value that happens
2692 to have a side effect.
2694 Fixes the build regressions introduced by the fix for #359789
2696 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
2698 * expression.cs (Conditional.Emit): when emitting the ternary
2699 operator, use local variables to generate code verifiable code.
2701 The verifier cannot infer that the type on stack before the
2702 stloc.0 is executed is of type ParentB. This happens because the
2703 stack merge algorithm uses only parent types when deciding which
2704 is the common type. This is described in Part III 1.8.1.3 of ECMA
2707 This code compiled with mcs is not verifiable under MS. The MS
2708 verifier picks the first common interface of Foo and Bar, which is
2709 wrong, but doesn't use a full join type of the 2 interfaces.
2711 CSC uses a clever hack to compile such code in a verifiable
2712 way. It stores the intermediate values in a local variable with
2717 2008-02-14 Miguel de Icaza <miguel@novell.com>
2719 * expression.cs: Do not fold BitwiseAnd operators when the left
2720 side is a false constant, because we still need to evaluate the
2725 * support.cs: Instead of throwing an InternalErrorException when
2726 the position of the stream is outside the boundary of our buffer,
2727 reset the state of the reader, and restart the reading from the
2728 beginning of the file.
2730 2008-02-14 Marek Safar <marek.safar@gmail.com>
2732 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
2734 2008-02-14 Marek Safar <marek.safar@gmail.com>
2736 A fix for bug #361686
2737 * decl.cs: A protected types used inside a private class which parents
2738 derives from the protected class are accessible.
2740 2008-02-13 Marek Safar <marek.safar@gmail.com>
2742 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
2743 the parameterless constructor.
2745 2008-02-13 Marek Safar <marek.safar@gmail.com>
2747 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
2748 lookup methods to use standard member cache when doing member lookup.
2750 2008-02-12 Marek Safar <marek.safar@gmail.com>
2752 * driver.cs: Don't report full path for referenced module as assembly error.
2754 2008-02-12 Marek Safar <marek.safar@gmail.com>
2756 * Makefile: Fixed `qh' target to work on all machines.
2758 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
2759 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
2760 and HasElementType with TypeManager implementation.
2762 2008-02-08 Marek Safar <marek.safar@gmail.com>
2764 A fix for bugs #325134, #359749
2765 * expression.cs, ecore.cs: Try to resolve an extension method even if the
2766 first binds point to non-method member expression.
2768 2008-02-08 Marek Safar <marek.safar@gmail.com>
2770 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
2772 2008-02-08 Marek Safar <marek.safar@gmail.com>
2774 A fix for bugs #321394, #323028
2775 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
2776 Reworked naive IsAccessibleAs implementation to handle nested types.
2778 2008-02-05 Jb Evain <jbevain@novell.com>
2780 * class.cs: use generic type comparison for parameters
2783 2008-02-05 Marek Safar <marek.safar@gmail.com>
2785 A fix for bug #325372
2786 * class.cs: Use generic type comparison when testing method signatures.
2788 2008-02-05 Marek Safar <marek.safar@gmail.com>
2790 A fix for bug #357047
2791 * ecore.cs: Applied C# 3.0 changes to better conversion.
2793 2008-02-05 Marek Safar <marek.safar@gmail.com>
2795 A fix for bug #358374
2796 * cs-parser.jay: Correctly set modifiers for all constructor types.
2798 2008-02-04 Marek Safar <marek.safar@gmail.com>
2800 A fix for bug #355251
2801 * generic.cs: Added base class constraint based type inference.
2803 2008-02-01 Marek Safar <marek.safar@gmail.com>
2805 A fix for bug #357255
2806 * decl.cs: One more missing visibility check.
2808 2008-02-01 Marek Safar <marek.safar@gmail.com>
2810 * support.cs: Fixed broken return.
2812 2008-01-25 Marek Safar <marek.safar@gmail.com>
2814 * report.cs: Correctly reset warnings count after probing.
2816 2008-01-25 Martin Baulig <martin@ximian.com>
2819 (NamespaceEntry.SymbolFileID): Make this work again after
2820 MemberName.ToString() is gone.
2822 2008-01-25 Marek Safar <marek.safar@gmail.com>
2824 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
2827 2008-01-25 Marek Safar <marek.safar@gmail.com>
2829 * generic.cs: Use full implicit conversion for type inference fixing.
2831 2008-01-24 Marek Safar <marek.safar@gmail.com>
2833 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
2834 Fixed user operator conversions.
2836 2008-01-24 Marek Safar <marek.safar@gmail.com>
2838 * generic.cs: Do nullable type to null comparison optimization during
2841 2008-01-24 Marek Safar <marek.safar@gmail.com>
2843 A fix for bug #355163
2844 * generic.cs: Enabled l-value resolve on nullable expressions.
2846 2008-01-24 Marek Safar <marek.safar@gmail.com>
2848 A fix for bug #353986
2849 * class.cs: Ingore static ctors with parameters for any further checks.
2851 2008-01-24 Marek Safar <marek.safar@gmail.com>
2853 A fix for bug #354310
2854 * namespace.cs: Removed redundant check.
2856 2008-01-24 Marek Safar <marek.safar@gmail.com>
2858 A fix for bug #354928
2859 * expression.cs: ElementInitializers can be resolved only once.
2861 2008-01-24 Marek Safar <marek.safar@gmail.com>
2863 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
2864 Condition expressions.
2866 2008-01-23 Marek Safar <marek.safar@gmail.com>
2868 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
2870 2008-01-22 Marek Safar <marek.safar@gmail.com>
2872 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
2875 * generic.cs: Implemented coalesce expression.
2877 2008-01-22 Marek Safar <marek.safar@gmail.com>
2879 A fix for bug #355145
2880 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
2881 expression tree type inference.
2883 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
2886 * expression.cs (Binary.IsUnsignedType): Fix typo.
2888 2008-01-22 Marek Safar <marek.safar@gmail.com>
2890 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
2892 2008-01-22 Marek Safar <marek.safar@gmail.com>
2894 A fix for bug #355161
2895 * ecore.cs, expression.cs: Wider range of extension method supported
2898 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
2900 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
2901 AssemblyBuilder to operate in compiler context. Fixes mcs part of
2904 2008-01-22 Marek Safar <marek.safar@gmail.com>
2906 A fix for bug #355148
2907 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
2909 2008-01-22 Miguel de Icaza <miguel@novell.com>
2911 * expression.cs (CreateExpressionTree): Add support for or and
2912 logical or, and indent following the coding conventions.
2914 * typemanager.cs (LinqExpression): renamed from
2915 ExpressionTreeManager, for a shorter name.
2917 Use TypeManager.CoreLookupType to lookup types from our core
2918 assemblies and turn those into "Type" variables.
2920 Consumers that previously used "Namespace" and "Type" from this
2921 class should instead use the TypeExpression which is a type that
2922 is fully resolved (without involving the regular C# resolution
2925 This typically looks like this:
2927 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
2928 new MemberAccess (texpr, name, type_arguments, loc)
2930 This avoids the problem in: #355178
2932 2008-01-21 Marek Safar <marek.safar@gmail.com>
2934 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
2935 feature in parser only as we do in other cases.
2937 2008-01-21 Marek Safar <marek.safar@gmail.com>
2939 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
2940 typemanager.cs: A refactoring of params arguments to reuse existing
2941 expressions (params -> array initializer) to emit params argument instead
2942 of specialized handling.
2943 It was required by expression tree implementation and it has other benefits
2944 as well, we now apply same optimization for params arguments as we do for
2947 2008-01-18 Marek Safar <marek.safar@gmail.com>
2949 A fix for bug #353526
2950 * generic.cs: A type inference of params arguments may not required any
2951 temporary array creation.
2953 2008-01-18 Marek Safar <marek.safar@gmail.com>
2955 A fix for bug #353534
2956 * generic.cs, ecore.cs, expression.cs: A method group type inference is
2957 supported for delegates only.
2959 2008-01-18 Marek Safar <marek.safar@gmail.com>
2961 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
2962 type for more than 1 candidates.
2964 2008-01-18 Marek Safar <marek.safar@gmail.com>
2966 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
2969 2008-01-16 Marek Safar <marek.safar@gmail.com>
2971 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
2972 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
2973 operator) expressions.
2975 2008-01-16 Zoltan Varga <vargaz@gmail.com>
2977 * statement.cs: Avoid declaring an IL variable for this_variable since it is
2978 not accessed from the generated IL.
2980 2008-01-14 Marek Safar <marek.safar@gmail.com>
2982 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
2983 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
2984 statement.cs: The first expression tree implementation drop, mostly
2985 infrastructure work.
2987 2008-01-14 Marek Safar <marek.safar@gmail.com>
2989 * ecore.cs (IsNestedChild): Refactored.
2991 2008-01-11 Marek Safar <marek.safar@gmail.com>
2993 * lambda.cs: Don't use a cast on unknown expression statement.
2995 2008-01-10 Geoff Norton <gnorton@novell.com>
2997 * cs-tokenizer.cs: One more token to distinguish between method and lambda
3000 2008-01-09 Marek Safar <marek.safar@gmail.com>
3002 * doc.cs: Report better /doc crash details.
3004 2008-01-09 Marek Safar <marek.safar@gmail.com>
3006 A fix for bug #352536
3007 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3009 2008-01-08 Marek Safar <marek.safar@gmail.com>
3011 A fix for bug #352287
3012 * ecore.cs, expression.cs: Do `this' access checking in all member access
3015 2008-01-08 Marek Safar <marek.safar@gmail.com>
3017 * rootcontext.cs, driver.cs: Switch to linq mode by default.
3019 * report.cs: Reset message stacks.
3021 2008-01-08 Marek Safar <marek.safar@gmail.com>
3023 * generic.cs (InferInPhases): Correctly calculate params position.
3025 2008-01-08 Marek Safar <marek.safar@gmail.com>
3027 * cs-tokenizer.cs: No need to parse full string when parsing lambda
3030 2008-01-07 Marek Safar <marek.safar@gmail.com>
3032 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3034 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3036 * driver.cs: Updated --help option.
3038 2008-01-07 Marek Safar <marek.safar@gmail.com>
3040 * generic.cs (InferParamsTypeArguments): Removed.
3041 (InferInPhases): Add params type inference.
3042 (LowerBoundInference): Fixed scoring mechanism.
3044 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3046 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
3048 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3049 byte array for unsigned "baked" assemblies.
3051 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
3053 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3054 array for assemblies that are not strongnamed.
3056 2008-01-04 Marek Safar <marek.safar@gmail.com>
3058 A fix for bug #351481
3059 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3060 declaring type for nested generic types.
3062 2008-01-04 Marek Safar <marek.safar@gmail.com>
3064 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3065 instead of ToString.
3067 2008-01-03 Marek Safar <marek.safar@gmail.com>
3069 A fix for bug #351047
3070 * expression.cs (Binary.ResolveOperator): Allow equality operators between
3071 null and structs only when equality and inequality operators are defined
3072 either as an user-operators or predefined operators.
3074 2008-01-03 Marek Safar <marek.safar@gmail.com>
3076 A fix for bug #351047
3077 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3079 2008-01-03 Marek Safar <marek.safar@gmail.com>
3081 A fix for bug #351257
3082 * cs-tokenizer.cs: Advance line number for '\r' correctly.
3084 2008-01-03 Marek Safar <marek.safar@gmail.com>
3086 A fix for bug #351157
3087 * class.cs (Using): Fixed yet another broken cloning.
3089 (Block): Put back more sensible default value for statements.
3091 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
3093 * codegen.cs: Allow AssemblyVersion with only major version component.
3096 2007-12-29 Marek Safar <marek.safar@gmail.com>
3098 A fix for bug #324654
3099 * class.cs: Use FullName property as member name.
3101 2007-12-28 Marek Safar <marek.safar@gmail.com>
3103 A fix for bug #342117
3104 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3105 constructor constraint.
3107 2007-12-28 Marek Safar <marek.safar@gmail.com>
3109 A fix for bug #338273
3110 * class.cs (ProbertyBase): Access modifier checks are required for overrides
3113 2007-12-28 Marek Safar <marek.safar@gmail.com>
3115 A fix for bug #350839
3116 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3118 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3120 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3123 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3125 * statement.cs: Changed some Hashtables to use HybridDictionaries
3126 instead. It was observed that some HashTables only contained a few
3127 items in the vast majority of cases. Since HybridDictionary is
3128 more efficient on small sets (<10 elements), "known_variables"
3129 from class ExplicitBlock as well as "labels" and "constants " from
3130 class Block were changed to HybridDictionaries.
3132 Atsai results: (56216kb->54987kb)
3134 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3137 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3139 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3142 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3144 * expression.cs: foreach loop to for loop, saved on allocation of
3145 enumerator (59333kb->59141kb)
3147 * statement.cs. Changed foreach loops to for loops, saved on
3148 allocation of enumerator (59141kb->59006kb)
3150 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3151 when constructed with no specified capacity. This was causing a
3152 few ArrayLists to allocate more memory than they would potentially
3153 need in the Block class and MemberCache class. Setting the
3154 ArrayLists to construct with a capacity of 1 saves some
3155 memory. (56216kb->55585kb)
3157 2007-12-27 Marek Safar <marek.safar@gmail.com>
3159 A fix for bug #347189 (2nd issue)
3160 * expression.cs (MemberAccess): Nested type can be found in base non-generic
3163 2007-12-27 Miguel de Icaza <miguel@novell.com>
3165 * report.cs: Do not use colors if stdout and stderr are not a
3168 2007-12-27 Marek Safar <marek.safar@gmail.com>
3170 A fix for bug #346998
3171 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3174 2007-12-27 Marek Safar <marek.safar@gmail.com>
3176 A fix for bug #343465
3177 * class.cs: Explicit method name for nested types uses dots only.
3179 2007-12-27 Marek Safar <marek.safar@gmail.com>
3181 A fix for bug #343707
3182 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3184 2007-12-27 Marek Safar <marek.safar@gmail.com>
3186 * ecore.cs: Report type inference errors only when arguments count matches
3189 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3191 * expression.cs, report.cs: New warning.
3193 * typemanager.cs: Catch anonymous method type too.
3195 2007-12-23 Marek Safar <marek.safar@gmail.com>
3197 A fix for bug #346379
3198 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3200 2007-12-23 Marek Safar <marek.safar@gmail.com>
3202 A fix for bug #347359
3203 * expression.cs (Invocation): Don't resolve already resolved expression.
3205 2007-12-23 Marek Safar <marek.safar@gmail.com>
3207 A fix for bug #347189
3208 * class.cs (FixedField): Use non-dependent code only in the define phase.
3210 2007-12-23 Marek Safar <marek.safar@gmail.com>
3212 A fix for bug #348076
3213 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3215 2007-12-22 Marek Safar <marek.safar@gmail.com>
3217 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3218 discovered extension methods.
3220 2007-12-22 Marek Safar <marek.safar@gmail.com>
3222 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3225 2007-12-21 Miguel de Icaza <miguel@novell.com>
3227 * report.cs (ErrorMessage): Add support for using colors on
3228 terminals that support it.
3230 2007-12-21 Marek Safar <marek.safar@gmail.com>
3232 * ecore.cs: Use information about expanded params for error reporting.
3234 2007-12-21 Marek Safar <marek.safar@gmail.com>
3236 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3237 and logic for params overloads.
3239 2007-12-15 Miguel de Icaza <miguel@novell.com>
3241 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3242 as this is also created from the parser. Fixes #349034
3244 2007-12-12 Miguel de Icaza <miguel@novell.com>
3246 * statement.cs (Throw.CloneTo): it is valid to have empty
3247 expressions for throw.
3249 2007-12-03 Marek Safar <marek.safar@gmail.com>
3251 * cs-parser.jay: Set delegate constraint parsing region correctly.
3253 2007-12-03 Marek Safar <marek.safar@gmail.com>
3255 A fix for bug #345467
3256 * typemanager.cs (IsEqual): Compare generic parameters position only.
3258 2007-11-28 Marek Safar <marek.safar@gmail.com>
3260 * expression.cs (BaseAccess): Type arguments can be null.
3262 2007-11-27 Raja R Harinath <harinath@gmail.com>
3264 * statement.cs (Block.Resolve): Ensure flow-branching tree is
3265 consistent even when an error has occured.
3266 (Switch.Resolve): Likewise.
3268 2007-11-22 Marek Safar <marek.safar@gmail.com>
3270 A fix for bug #334505
3271 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3274 2007-11-22 Marek Safar <marek.safar@gmail.com>
3276 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
3277 refactorings required to resolve extension methods correctly when mixing
3278 generics and non-generics members.
3280 2007-11-20 Marek Safar <marek.safar@gmail.com>
3282 A fix for bug #342584
3283 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3286 2007-11-19 Marek Safar <marek.safar@gmail.com>
3288 A fix for bug #342512
3289 * delegate.cs: Use delegate argument expression when is available. Don't
3290 emit virtual call when class is sealed.
3292 2007-11-16 Marek Safar <marek.safar@gmail.com>
3294 A fix for bug #325423
3295 * assign.cs (FieldInitializer): Use resolved expression for emit.
3297 * class.cs: Print less confusing error message.
3299 2007-11-16 Marek Safar <marek.safar@gmail.com>
3301 * cs-tokenizer.cs: Removed GMCS ifdefs.
3303 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3306 * cs-parser.jay: Disabled nullable check.
3308 * generic-mcs: Copied more generic stuff.
3310 2007-11-16 Marek Safar <marek.safar@gmail.com>
3312 * gcs-parser.jay: Merged to cs-parser.jay.
3314 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3315 * *.csproj, *.sources: Updated to use only jay parser file.
3317 2007-11-16 Marek Safar <marek.safar@gmail.com>
3319 * gcs-parser.jay: Added nullable and default expression feature checks.
3321 2007-11-16 Marek Safar <marek.safar@gmail.com>
3323 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
3324 it fixes many TODOs and hidden bugs.
3326 * expression: Removed duplicate error check.
3328 2007-11-15 Marek Safar <marek.safar@gmail.com>
3330 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
3331 implicitly type local variable only when it is used in a declaration.
3333 2007-11-15 Marek Safar <marek.safar@gmail.com>
3335 * attribute.cs: Use CS0612 for empty strings.
3337 2007-11-14 Marek Safar <marek.safar@gmail.com>
3339 * lambda.cs, statement.cs: Contextual return may act as a statement.
3341 2007-11-14 Marek Safar <marek.safar@gmail.com>
3343 A fix for a regression cause by #324222
3344 * class.cs: Don't report unused even when it implements an interface.
3346 2007-11-13 Marek Safar <marek.safar@gmail.com>
3348 A fix for bug #341205
3349 * ecore.cs, expression.cs: Method group expression cannot do static
3350 method access with an instance reference check before overloading takes
3353 2007-11-13 Marek Safar <marek.safar@gmail.com>
3355 A fix for bug #325359
3356 * class.cs: Use predictable name for automatically generated property.
3358 2007-11-12 Marek Safar <marek.safar@gmail.com>
3360 A fix for bug #324996
3361 * expression.cs (Is): Handle case where D is nullable and T is not
3364 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
3366 2007-11-12 Marek Safar <marek.safar@gmail.com>
3368 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
3369 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
3370 Flush small error reporting changes.
3372 2007-11-09 Marek Safar <marek.safar@gmail.com>
3374 A fix for bug #324996
3375 * expression.cs: Rewrote Is expression implementation to work with
3376 generics, nullable types, anonymous method. A const result expression
3377 uses existing infrastructure instead of custom not fully-featured one.
3379 2007-11-08 Marek Safar <marek.safar@gmail.com>
3381 A fix for bug #340202
3382 * class.cs: Consider generics for volatile field.
3384 2007-11-08 Marek Safar <marek.safar@gmail.com>
3386 A fix for bug #335594
3387 * expression.cs: Use conversion rules when handling string addition.
3389 2007-11-07 Marek Safar <marek.safar@gmail.com>
3391 A fix for bug #336651
3392 * expression.cs: Fixed a crash when probing is on.
3394 2007-11-07 Marek Safar <marek.safar@gmail.com>
3396 A fix for bug #324242
3397 * covert.cs: Added a conversion from any nullable-type with an
3398 underlying enum-type to the type System.Enum.
3400 2007-11-07 Marek Safar <marek.safar@gmail.com>
3402 A fix for bug #324222
3403 * class.cs: Report all non-used event fields.
3405 2007-11-07 Marek Safar <marek.safar@gmail.com>
3407 A fix for bug #325161
3408 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
3409 qualifier for generic types.
3411 2007-11-07 Marek Safar <marek.safar@gmail.com>
3413 A fix for bug #322971
3414 * expression.cs, ecore.cs: Added intermediate result value check for
3417 2007-11-07 Marek Safar <marek.safar@gmail.com>
3419 A fix for bug #324754
3420 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
3421 when it was requested.
3423 2007-11-07 Marek Safar <marek.safar@gmail.com>
3425 A fix for bug #325101
3426 * expression.cs: Do type not value comparison for `is' expression.
3428 2007-11-07 Marek Safar <marek.safar@gmail.com>
3430 A fix for bug #320236
3431 * convert.cs: Don't apply user conversion on underlying target type.
3433 2007-11-06 Marek Safar <marek.safar@gmail.com>
3435 * expression.cs: Don't use unresolved expression for error reporting.
3437 2007-11-06 Marek Safar <marek.safar@gmail.com>
3439 A fix for bugs #337712, #324490
3440 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
3441 overloading resolution too.
3443 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
3444 the process consistent and more robust.
3446 * expression.cs, linq.cs, report.cs: Update.
3448 2007-11-02 Marek Safar <marek.safar@gmail.com>
3450 A fix for bug #332909
3451 * attribute.cs: Resolve attributes in correct context using error
3454 * rootcontext.cs: Define Obsolete attribute members as core members.
3456 2007-11-02 Marek Safar <marek.safar@gmail.com>
3458 * statement.cs: Removed unused methods.
3460 2007-10-31 Wade Berrier <wberrier@novell.com>
3462 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
3463 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
3466 2007-10-31 Marek Safar <marek.safar@gmail.com>
3468 A fix for bug #338102
3469 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
3470 methods registered as non-generics.
3472 2007-10-31 Marek Safar <marek.safar@gmail.com>
3474 A fix for bugs #337712, #324490
3475 * delegate.cs: Delegate covariance and contravariance is not allowed for
3478 2007-10-31 Marek Safar <marek.safar@gmail.com>
3480 A fix for bug #337719
3481 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
3484 2007-10-30 Marek Safar <marek.safar@gmail.com>
3486 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
3488 2007-10-29 Marek Safar <marek.safar@gmail.com>
3490 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
3493 2007-10-29 Raja R Harinath <rharinath@novell.com>
3495 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
3497 2007-10-29 Marek Safar <marek.safar@gmail.com>
3499 A fix for bug #334652
3500 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
3501 extension methods when we have not found the best candidate in normal
3504 2007-10-27 Marek Safar <marek.safar@gmail.com>
3506 * AssemblyInfo.cs: Keep up-to-date.
3508 2007-10-27 Marek Safar <marek.safar@gmail.com>
3510 * Makefile: Fixed generics compiler name.
3512 2007-10-27 Marek Safar <marek.safar@gmail.com>
3514 * lambda.test: removed, lambda parsing is done differently.
3516 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
3518 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
3520 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
3522 2007-10-27 Marek Safar <marek.safar@gmail.com>
3524 * Makefile, *.sources : All C# compilers are in mcs folder.
3526 * *.cs: Use existing 2_1 define for smcs.
3528 2007-10-26 Marek Safar <marek.safar@gmail.com>
3530 A fix for bug #335847
3531 * assign.cs, expression.cs: Couple of changes to avoid creating a
3532 temporary variable for each object initializer assignment statement. It
3533 simplifies struct initialization too, otherwise two temporary variables
3535 Implemented optimization of redundant default element initializers.
3537 2007-10-25 Marek Safar <marek.safar@gmail.com>
3539 A fix for bug #336766
3540 * expression.cs (Class.CheckBase): Use generic name when method is
3543 2007-10-25 Marek Safar <marek.safar@gmail.com>
3545 A fix for bug #334737
3546 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
3547 variable and not variable argument for prepared copies.
3549 2007-10-24 Marek Safar <marek.safar@gmail.com>
3551 A fix for bug #325110
3552 * class.cs, expression.cs, attribute.cs: Use open generic method when
3553 checking conditional attribute.
3555 2007-10-24 Marek Safar <marek.safar@gmail.com>
3557 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
3558 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
3559 FeatureIsNotAvailable.
3561 2007-10-24 Marek Safar <marek.safar@gmail.com>
3563 ** C# 3.0 Partial methods
3565 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
3566 methods support. Because of member cache issue with generics only
3567 non-generics partial methods are fully supported.
3569 2007-10-23 Marek Safar <marek.safar@gmail.com>
3571 * class.cs, decl.cs: Rewrote member overloads check to cope with
3572 generics and to use member cache for member checking. It also improves
3573 performance and fixes remaining overloads issues.
3575 2007-10-20 Marek Safar <marek.safar@gmail.com>
3577 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
3578 roottypes.cs, typemanager.cs:
3580 A member cache creation logic changed to add members immediately and
3581 not rely on fallback. The member cache is now only prefered way
3582 how to access and find type declaration members. It saves 5 MB of memory
3583 during MWF compilation and makes code ready for more optimizations and
3584 clean-ups, it's also a pre-requirement for partial methods.
3586 2007-10-18 Raja R Harinath <harinath@gmail.com>
3588 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
3589 handling for generic parameters.
3591 2007-10-15 Marek Safar <marek.safar@gmail.com>
3593 * class.cs (FixedField): Removed redundant volatile check.
3595 2007-10-15 Marek Safar <marek.safar@gmail.com>
3597 * class.cs, decl.cs: Fixed overload members verification to do only one
3598 check per possible collision.
3600 2007-10-13 Marek Safar <marek.safar@gmail.com>
3602 A fix for bug #325478
3603 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
3604 and create only one disposable flags container.
3606 2007-10-12 Marek Safar <marek.safar@gmail.com>
3608 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
3609 * statement.cs (Fixed): Fixed variables cloning.
3611 2007-10-12 Marek Safar <marek.safar@gmail.com>
3613 A fix for bug #333342
3614 * class.cs (EventField): Don't mark value type event as synchronized.
3616 2007-10-12 Marek Safar <marek.safar@gmail.com>
3618 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
3619 inference to identify best candidate method correctly.
3620 (ProperyExpr): A range variable is read only and cannot be modified.
3622 2007-10-11 Marek Safar <marek.safar@gmail.com>
3624 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
3625 logic to identify best candidate method correctly.
3627 2007-10-11 Marek Safar <marek.safar@gmail.com>
3629 * location.cs (Equals, GetHashCode): Removed.
3631 2007-10-11 Marek Safar <marek.safar@gmail.com>
3633 * report.cs: Implemented message recorder. It is used mainly for lambda
3634 expressions to capture otherwise swallowed error messages.
3636 * anonymous.cs, lambda.cs.cs: Do full parameters check.
3638 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
3640 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
3642 * expression.cs (MemberAccess): Always report lookup failure.
3644 * location.cs: Implemented Equals, GetHashCode.
3646 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
3648 2007-10-10 Jb Evain <jbevain@novell.com>
3650 * codegen.cs: re-enable assembly version check.
3652 2007-10-09 Marek Safar <marek.safar@gmail.com>
3654 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
3657 * namespace.cs (UsingAlias): Do correct version check.
3659 2007-10-08 Marek Safar <marek.safar@gmail.com>
3661 * expresison.cs, ecore.cs: Issue extension method error message when
3664 * rootcontext.cs: Added ISO_2 compiler mode option.
3666 2007-10-08 Marek Safar <marek.safar@gmail.com>
3668 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
3671 2007-10-08 Marek Safar <marek.safar@gmail.com>
3673 * attribute.cs (GetString, GetBoolean): Work with both literal and
3676 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
3677 Moved method overload specific methods to MethodGroupExpr.
3679 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
3680 it should be less memory consuming.
3682 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
3684 * codegen.cs: remove the assembly version check until the buildbot is
3687 2007-10-07 Jb Evain <jbevain@novell.com>
3689 * attribute.cs (Attribute.GetString): if the value
3690 expression is a StringConstant, return its string value.
3692 2007-10-07 Jb Evain <jbevain@novell.com>
3694 * typemanager.cs: add `assembly_version_attribute_type`.
3695 * codegen.cs: on attribute emission, check that the
3696 AssemblyVersionAttribute doesn't overflow.
3698 2007-10-05 Marek Safar <marek.safar@gmail.com>
3700 A fix for bug #324677
3701 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
3702 parent container of a scope container with currently resolved one.
3704 2007-10-05 Marek Safar <marek.safar@gmail.com>
3706 A fix for bug #325534
3707 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
3710 2007-10-05 Marek Safar <marek.safar@gmail.com>
3712 A fix for bug #327504
3713 * class.cs (Operator.Define): Refactored implicit and explicit user
3714 operator conversion rules.
3716 2007-10-05 Marek Safar <marek.safar@gmail.com>
3718 A fix for bug #327520
3719 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
3721 2007-10-04 Marek Safar <marek.safar@gmail.com>
3723 A fix for bug #328022
3724 * class.cs (MethodData.Define): Use correct method to check whether
3725 a method implementents an accessor.
3727 2007-10-04 Marek Safar <marek.safar@gmail.com>
3729 A fix for bug #330069
3730 * statement.cs (Fixed.Resolve): Read the first array element only when
3731 an array is instantiated.
3733 2007-10-04 Marek Safar <marek.safar@gmail.com>
3735 * expression.cs, assign.cs, generics.cs: Print correct operator when
3736 compound assignment is used.
3738 2007-10-04 Marek Safar <marek.safar@gmail.com>
3740 A fix for bug #325841
3741 * expression.cs (ArrayAccess): Use full argument cloning only for
3742 string compound concatenation.
3744 2007-10-03 Marek Safar <marek.safar@gmail.com>
3746 A fix for bug #328774
3747 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
3749 (PropertyExpr.EmitAssign): Fixed string concatenation compound
3752 2007-10-03 Raja R Harinath <rharinath@novell.com>
3755 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
3756 Event accessibility checks here. Remove some bogus code that
3757 accidently made GenericMethods work.
3758 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
3760 2007-09-25 Marek Safar <marek.safar@gmail.com>
3762 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
3764 * statement.cs (Block): Refactored AddVariable to allow error handling
3767 * generic.cs: New stub.
3769 2007-09-23 Marek Safar <marek.safar@gmail.com>
3771 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
3774 2007-09-17 Marek Safar <marek.safar@gmail.com>
3776 * class.cs: Use partial container to record whether any partial part
3777 contains static field initializer and therefore default contructor has
3780 2007-09-14 Marek Safar <marek.safar@gmail.com>
3782 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
3783 mono-list when only one of two partial parts has defined accessibility
3786 2007-09-14 Marek Safar <marek.safar@gmail.com>
3788 A fix for bug #82845
3790 * class.cs (TypeContainer): Set correct resolve context for all field
3793 2007-09-13 Marek Safar <marek.safar@gmail.com>
3795 * assign.cs: Fixed a crash when field is resolved twice with an error.
3797 * codegen.cs: Changed InFieldInitializer to be flag.
3799 * anonymous.cs, ecore.cs, expression.cs: Update after
3800 IsInFieldInitializer rename.
3802 * const.cs: Removed unused parameter.
3804 * class.cs: Changed the way how we resolve and emit field initializers.
3805 The field initilizers have to have access to contructor block to emit
3806 compiler generated code.
3808 2007-09-13 Marek Safar <marek.safar@gmail.com>
3810 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
3811 generics use TypeContainer instead.
3813 2007-09-12 Marek Safar <marek.safar@gmail.com>
3815 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
3817 * lambda.cs (ResolveParameters): Use more powerful
3818 InflateGenericArgument.
3820 * parameters.cs: Better exception message.
3822 2007-09-10 Marek Safar <marek.safar@gmail.com>
3824 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
3825 correct expression block type.
3827 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
3829 * expression.cs (Invocation): Extracted method group resolve to
3832 2007-09-07 Marek Safar <marek.safar@gmail.com>
3834 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
3835 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
3837 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
3838 generic extension methods.
3840 2007-09-06 Marek Safar <marek.safar@gmail.com>
3842 A fix for bug #82676 (Do I get it right now?)
3843 * convert.cs (Binary.ResolveOperator): An interface is converted to the
3844 object before a standard conversion is applied.
3846 2007-09-06 Marek Safar <marek.safar@gmail.com>
3848 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
3851 2007-09-05 Marek Safar <marek.safar@gmail.com>
3853 A fix for bug #82676
3854 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
3855 non-generic interface types.
3857 2007-09-05 Marek Safar <marek.safar@gmail.com>
3859 A fix for bug #82690
3860 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
3862 2007-09-05 Marek Safar <marek.safar@gmail.com>
3864 A fix for bug #82571
3865 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
3866 modifier for container based methods.
3868 2007-09-05 Marek Safar <marek.safar@gmail.com>
3870 A fix for bug #82676
3871 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
3872 any interface-type T means to any of interface type T.
3874 2007-09-04 Marek Safar <marek.safar@gmail.com>
3876 * namespace.cs: We have 2 versions of System.Core assembly.
3878 2007-09-04 Marek Safar <marek.safar@gmail.com>
3880 A fix for bug #82652
3881 * class.cs (Class.GetClassBases): Compare types and not expressions.
3883 2007-09-04 Marek Safar <marek.safar@gmail.com>
3885 A fix for bug #82620
3886 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
3887 actually never worked before.
3888 (IndexerAccess): Emit prepared arguments before they are modified.
3890 2007-09-04 Marek Safar <marek.safar@gmail.com>
3892 A fix for bug #82563
3893 * assign.cs: Revert wrong fix.
3895 * expression.cs (VariableReference.EmitAssign): Handle ref reference
3897 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
3898 Instead of ldelema/stdind we have to use temporary variables to handle
3899 cases like String.Concat (params string[]).
3901 2007-08-31 Marek Safar <marek.safar@gmail.com>
3903 * class.cs: EmitAttributes to Emit rename.
3905 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
3907 (MemberCore.HasClsCompliantAttribute): Don't depend on
3908 GetClsCompliantAttributeValue execution.
3910 2007-08-31 Marek Safar <marek.safar@gmail.com>
3912 * anonymous.cs: Use shorter type prefix.
3914 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
3917 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
3918 variables when probing is on.
3920 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
3921 unresolved variables.
3922 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
3923 handle transparent identifiers.
3925 2007-08-26 Marek Safar <marek.safar@gmail.com>
3927 * attribute.cs (IsClsCompliant): Add nullable types test.
3929 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
3931 * doc.cs : catch other types of exception than XmlException to
3932 report CS1570. Fixed bug #82565.
3934 2007-08-23 Marek Safar <marek.safar@gmail.com>
3936 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
3937 The number of delegate parameters has to match.
3938 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
3941 2007-08-21 Marek Safar <marek.safar@gmail.com>
3943 * anonymous.cs (AnonymousMethod): Generate private anonymous method
3944 to fix problem with private arguments.
3946 2007-08-20 Marek Safar <marek.safar@gmail.com>
3948 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
3950 * decl.cs (MemberName): Ignore generic type with no generic arguments.
3952 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
3953 empty. Add cloning suport.
3955 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
3957 2007-08-20 Marek Safar <marek.safar@gmail.com>
3959 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
3960 to create EmptyCast. It handles EmptyConstantCast specialization for
3963 2007-08-18 Marek Safar <marek.safar@gmail.com>
3965 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
3966 (EmitArrayArgument): One routine for array arguments.
3967 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
3969 2007-08-17 Marek Safar <marek.safar@gmail.com>
3971 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
3973 2007-08-17 Marek Safar <marek.safar@gmail.com>
3975 * anonymous.cs: MemberLookupFinal update.
3977 * class.cs (ConstructorInitializer): Is expression based.
3979 * delegate.cs: MethodGroupExpr update.
3981 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
3983 (Error_MemberLookupFailed): Customizable error override.
3984 (MethodGroupExpr): Keep queried type for later usage.
3985 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
3988 * expression.cs: Error_MemberLookupFailed refactoring.
3989 (New.DoResolve): Resolve as much as possible.
3990 (ElementInitializer.Error_MemberLookupFailed): Object initializer
3991 customization for invalid member types.
3993 * statement.cs: MethodGroupExpr update.
3995 2007-08-16 Marek Safar <marek.safar@gmail.com>
3997 * modifier.cs (Check): Check all modifiers and not only accessibility
4000 2007-08-16 Marek Safar <marek.safar@gmail.com>
4002 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4003 type and not an expression.
4005 2007-08-16 Marek Safar <marek.safar@gmail.com>
4007 * statement.cs (Catch.Clone): Type and variable can be null.
4009 2007-08-16 Marek Safar <marek.safar@gmail.com>
4011 A fix for bug #81979
4012 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4013 I am really not sure whether this is the best fix.
4015 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4018 2007-08-14 Marek Safar <marek.safar@gmail.com>
4020 ** C# 3.0 Object and collection initializers (major re-write)
4022 * assign.cs (DoResolve): Initializers are not assign related.
4024 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4025 used during collection or object initialization.
4027 * expression.cs (Error_InvalidArguments): Add initializers specific
4028 messages. More will come later because it requires some general
4030 (New.DoResolve): Better error handling for unsafe types.
4031 (EmptyExpressionStatement): New class.
4032 (ElementInitializer): An object initializer expression.
4033 (CollectionElementInitializer): A collection initializer expression.
4034 (CollectionOrObjectInitializers): A block of object or collection
4036 (NewInitialize): New expression with element/object initializers.
4038 * statement.cs: Reverted object/collection initializer hacks.
4040 * typemanager.cs (CSharpName): Filter __arglist type.
4042 2007-08-09 Marek Safar <marek.safar@gmail.com>
4044 ** C# 3.0 Anonymous Types (update to the latest standard)
4046 * expression.cs (Binary.ResolveOperator): Threat all null based types
4048 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4049 (AnonymousTypeParameter): Updated.
4051 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4052 (AnonymousTypeClass): New anonymous type container.
4054 * class.cs (AddField): Return operation result.
4056 * generic.cs: Another empty TypeArguments overload.
4058 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4059 are stored at top of normal hierarchy.
4061 * typemanager.cs (CSharpName): Filter anonymous types.
4063 2007-08-09 Marek Safar <marek.safar@gmail.com>
4065 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4066 as single Concat call. How could we miss that :-(
4068 2007-08-08 Marek Safar <marek.safar@gmail.com>
4070 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4072 2007-08-07 Miguel de Icaza <miguel@novell.com>
4074 * expression.cs: Fix the previous commit, the creation of the
4075 arguments array list needs also to be conditional on the arguments
4078 * class.cs: Add a little bit of help to help narrow down problems.
4080 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4081 not try to copy in that case.
4083 * driver.cs: When building SMCS, include a new different set of
4084 default assemblies here. Do this here so we can control whether
4085 to include the default assemblies with /noconfig.
4087 2007-08-03 Marek Safar <marek.safar@gmail.com>
4089 A fix for bug #81979
4090 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4093 2007-08-03 Marek Safar <marek.safar@gmail.com>
4095 A fix for bug #82300
4097 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4098 we are in probing scope.
4100 2007-08-03 Marek Safar <marek.safar@gmail.com>
4102 A fix for bug #82301
4104 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4105 (Statement.CloneTo): Clone and not map children blocks.
4107 2007-08-03 Marek Safar <marek.safar@gmail.com>
4109 A fix for bug #82299
4111 * expression.cs (LocalVariableReference.CloneTo): Remap local info
4114 * statement.cs (Statement.CloneTo): Clone variables before statements
4115 to allow remaping of local variables.
4117 2007-08-03 Marek Safar <marek.safar@gmail.com>
4119 A fix for bug #82296
4122 * report.cs: Log crash details for future clone problems.
4124 * statement.cs (Return.Clone): Don't clone non-existent expression.
4126 2007-08-03 Raja R Harinath <harinath@gmail.com>
4128 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4129 (Class.AddBasesForPart): Move CS0537 check here from ...
4130 * cs-parser.jay (class_declaration): ... here. Move calling of
4131 'AddBasesForPart' to ...
4132 (class_bases): ... here.
4133 (struct_declaration, interface_declaration): Update to changes.
4135 2007-08-02 Marek Safar <marek.safar@gmail.com>
4137 A fix for bug #81923
4139 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4140 conversion is allowed.
4142 2007-08-02 Marek Safar <marek.safar@gmail.com>
4144 A fix for bug #81564
4146 * ecore.cs (EventExpr): Add IsBase handling.
4148 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4151 2007-08-02 Raja R Harinath <harinath@gmail.com>
4153 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4154 * cs-parser.jay: Some whitespace cleanups.
4155 (current_delegate): New.
4157 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4158 a dummy code block, and use 'type_name' instead of 'member_name'.
4159 (interface_declaration, class_declaration): Likewise.
4160 (delegate_declaration): Likewise. Rearrange slightly and use
4162 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4163 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
4165 2007-08-02 Marek Safar <marek.safar@gmail.com>
4167 A fix for bug #82039
4169 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4172 * typemanager.cs (CSharpName): Split to string overload.
4174 2007-08-02 Marek Safar <marek.safar@gmail.com>
4177 * report.cs: Updated warning CS0472.
4179 2007-08-01 Marek Safar <marek.safar@gmail.com>
4181 A fix for bug #82181
4183 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4185 2007-08-01 Marek Safar <marek.safar@gmail.com>
4187 A fix for bug #82277
4188 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4190 2007-08-01 Marek Safar <marek.safar@gmail.com>
4192 ** C# 3.0 Type Inference (major bits are working)
4194 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4195 (.ImplicitStandardConversionExists): Uses compatible.
4196 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4197 (.InferReturnType): New method.
4198 (.Compatible): Refactored.
4199 (.ResolveParameters): Uses factory to create resolved parameters.
4200 (.CompatibleMethod): Add probing mode support.
4201 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4202 clearly distinguish between 2 different operations.
4203 (LambdaMethod): Moved to lambda.cs.
4204 (AnonymousMethod): Removed unused fields and methods.
4205 (AnonymousDelegate): Simplified.
4207 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4209 * convert. cs (ImplicitConversionStandard): Compatible works differently.
4211 * delegate.cs (Delegate): New mehods to reduce code duplication.
4212 (.GetConstructor): New method.
4213 (.GetInvokeMethod): New method.
4214 (DelegateCreation): Updated.
4216 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4218 (OverloadResolve): Made probing little bit faster.
4220 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4223 * generic.cs (TypeInferenceContext): Dummy implementation.
4225 * iterators.cs: Updated after Resolve/Define rename.
4227 * lambda.cs (LambdaExpression)
4228 (.ResolveParameters): Handles both type of arguments and type inference too.
4230 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4231 (InflateTypes): Updated.
4233 * support.cs (InflateTypes): Changed signature and updated.
4235 * typemanager.cs (LookupMemberCache): Better dynamic type check.
4236 (MemberLookup_FindMembers): More MS tricks.
4237 (GetParameterData): Ditto.
4238 (GetDelegateParameters): Uses quick path for dynamic types.
4240 2007-08-01 Marek Safar <marek.safar@gmail.com>
4242 * class.cs (MethodData.Define): EmitContext is required for generic stuff
4245 2007-07-31 Marek Safar <marek.safar@gmail.com>
4247 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4250 2007-07-26 Jb Evain <jbevain@novell.com>
4252 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4253 which takes a boolean 'report_errors', similar to the GetMethod.
4254 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4255 in .net 2.1, do not report errors here.
4257 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4258 System.Runtime.CompilerServices.RequiredAttributeAttribute and
4259 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4262 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4263 of the type InternalsVisibleToAttribute before the first call
4264 to CoreLookupType which is allowed to fail (third boolean parameter
4265 to true). Because, during the resolution for a type that is not
4266 immediately found, we try to check if the type is not defined in
4267 a friend assembly, and to do so, we need the
4268 InternalVisibleToAttribute.
4270 2007-07-23 Miguel de Icaza <miguel@novell.com>
4272 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4273 feature that allows structs to be compared against null and inline
4274 the result as true or false.
4276 Notice that the same code is not permitted inside a generic block
4277 of code that would do:
4279 class Foo<T> where T : struct {
4286 It is only allowed if the type of T is not bound (no where
4287 clause). In my opinion, this CSC 2 behavior is broken but people
4288 seem to be using it (IronRuby does, a few bug reports on bugzilla
4289 have it and some people have complained about it).
4291 All of the users that depend on this behavior have code that is
4294 * report.cs (Warning, Error): make these take object arguments,
4295 not strings, as that allows us to take advantage of Format.
4297 2007-07-20 William Holmes <billholmes54@gmail.com>
4299 * decl.cs: Changed MemberName.CountTypeArguments to also check the
4300 Left member variable for the Count.
4301 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
4302 MemberName.CountTypeArguments to avoid a NRE.
4304 This code is contributed under the MIT X11 license
4306 2007-07-18 Marek Safar <marek.safar@gmail.com>
4308 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4310 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4312 * doc.cs : generic method arguments are written as ``x while generic
4313 type arguments are `x. Combined with the previous change, fixed bug
4316 2007-07-18 Raja R Harinath <rharinath@novell.com>
4319 * expression.cs (Binary.ResolveOperator): When converting
4320 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4322 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4324 * doc.cs : when T: or whatever x: is specified, it does not really
4325 check the doc comment's syntax correctness. Fixed bug #82006.
4327 2007-07-18 Marek Safar <marek.safar@gmail.com>
4329 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
4330 LambdaExpression better.
4332 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
4334 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
4336 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
4337 as it can be generated.
4339 * expression.cs (Invocation.Error_InvalidArguments): Show correct
4342 * lambda.cs (LambdaExpression): Refactored to share same code with
4343 AnonymousMethodExpression.
4345 2007-07-17 Marek Safar <marek.safar@gmail.com>
4347 * anonymous.cs (MakeName): Include host name for easier debugging.
4348 (LambdaMethod): New class for lambda spcecific stuff.
4350 * attribute.cs: Set EmitContext return type.
4352 * class.cs: Set EmitContext return type.
4354 * codegen.cs (EmitContext): Return type cannot be null to stop messing
4355 with null/void meaning.
4357 * iterators.cs (ContainerType): Implemented.
4359 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
4361 * statement.cs (Return): Updated to lambda expressions.
4362 (Block.CloneTo): Parent can be null.
4364 2007-07-13 Marek Safar <marek.safar@gmail.com>
4366 A fix for bug #81917
4367 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
4369 * class.cs (FixedField): Check whether field is in unsafe scope.
4371 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
4372 (FieldExpr.Emit): Fixed buffers cannot be volatile.
4374 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
4377 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
4379 2007-07-13 Marek Safar <marek.safar@gmail.com>
4381 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
4382 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
4385 2007-07-13 Marek Safar <marek.safar@gmail.com>
4387 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
4389 2007-07-13 Marek Safar <marek.safar@gmail.com>
4391 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
4392 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
4394 * codegen.cs(EmitContext): Add ProbingMode flag.
4396 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
4398 * driver.cs: For now set both warning values.
4400 * ecore.cs (SimpleName): Name is readonly.
4401 (MethodGroup.OverloadResolve): One quick path for probing.
4403 * expression.cs (Unary): Set Oper r/o.
4404 (Binary): Set Oper r/o.
4405 (ParameterReference): Set few instance variables as r/o.
4406 (ParameterReference.DoResolveBase): Don't capture aruments when
4408 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
4409 (Arglist): arguments are private.
4410 (SizeOf): type is private and r/o.
4411 (MemberAccess): arguments are private.
4413 * report.cs: Enhanced reporting on/off capabilities.
4415 * lambda.cs: Uses ec.IsInProbingMode.
4416 (ContextualReturn): Derives from return.
4418 * rootcontext.cs: For now set both warning values.
4420 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
4422 (Return.Resolve): Don't die immediately.
4423 (Block.Resolve): Speed-up probing.
4424 (Block.CloneTo): Clone only child blocks.
4426 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
4428 * iterators.cs: reverted Miguel's latest change (r81925) as it
4429 breaks the build in System.
4431 2007-07-13 Miguel de Icaza <miguel@novell.com>
4433 * iterators.cs (Yield.CheckContext): Check for the iterator type
4434 also here as we can call into Yield even in codepaths that are not
4436 (MethodOrOperator is the only path that was checked).
4438 In addition to the standard check, use a more specific check for
4439 constructors to report a more verbose error.
4441 2007-07-12 Miguel de Icaza <miguel@novell.com>
4443 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
4444 report the warning and continue
4446 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
4447 values on the stack on the call to Emit. Use EmitStatement if
4448 possible, or using Emit + Pop if not possible. Fixes #82064
4450 2007-07-12 Raja R Harinath <rharinath@novell.com>
4452 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
4453 avoid try...finally in some cases.
4455 2007-07-10 Marek Safar <marek.safar@gmail.com>
4457 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
4459 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
4460 instead of method. Re-use standard error handling.
4461 (ConstructorInitializer.Emit): Simplified.
4463 * delegate.cs: Updated after Invocation.EmitCall change.
4465 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
4466 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
4467 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
4468 method and don't permanently changing input arguments.
4469 (MethodGroupExpr): Introduced resolved best_candidate, when method group
4470 is resolved it has one of the candidates is the best one which is later
4471 used to emit. Removed a few unused method.
4472 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
4474 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
4475 (Binary.ResolveOperator): Ditto.
4476 (ConditionalLogicalOperator.DoResolve): Ditto.
4477 (Invocation): Uses method group.
4478 (Invocation.DoResolve): Simplified.
4479 (Invocation.EmitCall): Removed useless is_static.
4480 (Invocation.Emit): Delegate to method group.
4481 (Invocation.EmitStatement): Simplified.
4482 (New): Uses method group.
4483 (MemberAccess.DoResolve): Don't destroy original expression.
4485 * statement.cs (ForEach.Resolve): Use null for no method arguments.
4487 2007-07-04 Marek Safar <marek.safar@gmail.com>
4489 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
4492 * lambda.cs: Add custom error message type.
4494 2007-07-03 Marek Safar <marek.safar@gmail.com>
4496 * lambda.cs: Simplified little bit.
4498 * parameter.cs: Introduced ImplicitLambdaParameter.
4499 (Parameters.CreateFullyResolved): New factory instead of ctor.
4503 * delegate.cs: Updated parameter creation.
4505 2007-07-03 Marek Safar <marek.safar@gmail.com>
4507 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
4510 * generic.cs: Synchronized with gmcs.
4512 2007-07-03 Marek Safar <marek.safar@gmail.com>
4514 * class.cs (Indexer): Check return type as soon as possible.
4516 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
4519 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
4521 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
4523 * parameter.cs (Parameter): Use expression type when it is available.
4525 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
4526 method modifier for the first parameter only.
4528 2007-06-24 Marek Safar <marek.safar@gmail.com>
4530 A fix for bug #81938
4531 * typemanager.cs (ChangeType): Fixed couple of char conversions.
4533 * constant.cs: Tide up an exception message.
4535 2007-06-22 Marek Safar <marek.safar@gmail.com>
4537 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
4538 an uninitialized variable is used.
4540 * expression.cs (LocalVariableReference.DoResolve): Ditto.
4542 2007-06-22 Marek Safar <marek.safar@gmail.com>
4544 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
4545 not found error handling.
4547 * expression.cs (ArrayCreation): Removed redundant fields and little bit
4549 (ArrayCreation.ResolveArrayElement): To be ready to customization.
4550 (ArrayCreation.DoResolve): Simplified.
4551 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
4552 its own resolve process.
4553 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
4555 2007-06-20 Marek Safar <marek.safar@gmail.com>
4557 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
4560 2007-06-20 Marek Safar <marek.safar@gmail.com>
4562 * cs-tokenizer.cs: Removed var related stuff.
4564 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
4565 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
4566 a type and a keyword at same time.
4568 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
4571 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
4572 implicitly typed arrays, more changes will follow.
4574 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
4576 2007-06-19 Marek Safar <marek.safar@gmail.com>
4578 * ecore.cs (VarExpr): Removed Handled field.
4580 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
4581 build-in assign functionality.
4582 (ForEach.Resolve): Removed all implicitly typed local variable code and
4584 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
4585 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
4587 2007-06-18 Marek Safar <marek.safar@gmail.com>
4589 * assign.cs: Removed implicitly typed local variable check.
4591 * expression.cs (LocalVariableReference.DoResolve): Add check for self
4592 referencing implicitly typed local variable.
4593 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
4596 * statement.cs (Fixed): Removed unsupported implicitly typed local
4599 2007-06-15 Marek Safar <marek.safar@gmail.com>
4601 * decl.cs (MemberName): Moved all Unbound stuff to parser.
4603 2007-06-14 Marek Safar <marek.safar@gmail.com>
4605 A fix for bugs #81855 and #76274
4606 * attribute.cs (AttachTo): Always set owner for global attributes to
4609 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
4612 * cs-parser.jay: Assembly and module attributes must precede all other
4613 elements except using clauses and extern alias declarations.
4615 2007-06-13 Marek Safar <marek.safar@gmail.com>
4617 A fix for bug #81748
4619 * expression.cs: More checks for non ISO-1 features.
4621 2007-06-12 Marek Safar <marek.safar@gmail.com>
4623 A fix for bug #81807
4624 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
4625 present inside switch statement and it is required by nullable check.
4627 2007-06-12 Marek Safar <marek.safar@gmail.com>
4629 A fix for bug #81840
4630 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
4631 when type matching fails.
4633 * namespace.cs: Tiny error message change.
4635 2007-06-12 Marek Safar <marek.safar@gmail.com>
4637 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
4638 reporting. Added automatic property check.
4640 * class.cs: Updated after CheckAbstractAndExtern relocation.
4641 (AEventPropertyAccessor.GetSignatureForError): Customized.
4643 2007-06-11 Marek Safar <marek.safar@gmail.com>
4645 * class.cs (DefineBaseTypes): Base type can be undefined.
4647 * ecore.cs (TypeLookup): Minor refactoring.
4648 (DoResolveAsTypeStep): Removed redundant check.
4650 * namespace.cs (Lookup): Removed redundant check.
4652 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
4653 ResolveAsTypeTerminal step.
4654 (BootstrapCorlib_*): Simplified.
4655 (PopulateCoreType): Core types can be now external.
4657 2007-06-07 Marek Safar <marek.safar@gmail.com>
4659 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
4661 (InferTypeArguments): Infers anonymous expression type arguments.
4662 (Compatible): Split to Compatible and InferTypeArguments.
4664 * lambda.cs: Updated.
4666 2007-06-08 Marek Safar <marek.safar@gmail.com>
4668 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
4670 2007-06-07 Raja R Harinath <harinath@gmail.com>
4672 Fix #80477, cs0135-2.cs, cs0135-3.cs
4673 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
4674 names to the "known" variables list.
4675 (Block.CheckInvariantMeaningInBlock): Handle the fact the
4676 parameter names are also "known".
4677 (Block.CheckError136): Remove.
4678 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
4681 2007-06-07 Marek Safar <marek.safar@gmail.com>
4683 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
4685 2007-06-06 Marek Safar <marek.safar@gmail.com>
4687 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
4688 internal error not an user error.
4690 * expression.cs (IsApplicable): Refactored to make debugging easier.
4692 * support.cs: More tricks for non-mono runtimes.
4694 * typemanager.cs (CoreLookupType): Made public.
4695 (InitSystemCore): All linq specific stuff moved to linq.cs
4697 2007-06-05 Marek Safar <marek.safar@gmail.com>
4699 * typemanager.cs (CSharpSignature): One more missing build-in types
4701 More tricks for non-mono runtime.
4703 2007-06-05 Raja R Harinath <harinath@gmail.com>
4705 * statement.cs (Block.CheckError136_InParents): Remove.
4706 (Block.AddVariable): Use GetParameterInfo instead.
4707 (ToplevelBlock.ProcessArguments): Likewise.
4709 2007-06-04 Raja R Harinath <rharinath@novell.com>
4711 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
4713 (ToplevelBlock.GetParameterInfo): Split out of ...
4714 (ToplevelBlock.GetParameterRefernce): ... this.
4715 (ToplevelBlock.ParameterMap): Remove.
4716 * expression.cs (ParameterReference): Update to use
4717 ToplevelParameterInfo.
4719 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
4722 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
4723 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
4725 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
4726 (ToplevelBlock.ProcessParameters) ... here.
4727 (ToplevelBlock..ctor): Invoke it.
4729 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
4732 * statement.cs (IKnownVariable): New interface.
4733 (LocalInfo): Implement it.
4734 (ToplevelParameterInfo): New class.
4735 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
4736 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
4737 GetKnownVariableInfo.
4739 2007-06-03 Raja R Harinath <harinath@gmail.com>
4741 Partly speed up CS0136 error checks.
4742 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
4743 'recurse' parameter.
4744 (Block.DoCheckError136): Only check errors in parameters. Move
4745 local variable checks ...
4746 (Block.AddVariable): ... here, and ...
4747 (ToplevelBlock.ResolveMeta): ... here.
4749 2007-06-02 Raja R Harinath <harinath@gmail.com>
4751 * statement.cs (Block.IsChildOf): Remove.
4753 * statement.cs (Statement.Clone): Move special case code ...
4754 (Block.CloneTo): ... here.
4756 2007-05-29 Raja R Harinath <rharinath@novell.com>
4758 * statement.cs (ToplevelBlock.container): Remove field. It's
4759 redundant with 'Parent'.
4760 (ToplevelBlock.ContainerBlock): Remove accessor.
4761 (ToplevelBlock..ctor): Update to changes. Register anonymous
4762 child with parent here, ...
4763 * cs-parser.jay (end_anonymous): ... not here. Don't modify
4765 (start_anonymous): Don't save current_block.
4766 (top_current_block): Remove.
4768 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
4769 (Block.Resolve): Update to changes.
4770 (Block..ctor): Move setting of "correct" 'Toplevel'
4771 and 'Explicit' fields to ...
4772 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
4774 2007-05-27 Raja R Harinath <harinath@gmail.com>
4777 * statement.cs (Block.Implicit): Remove.
4778 (Block): Update to changes.
4779 * flowanalysis.cs: Likewise.
4781 Mildly speed up CheckInvariantMeaningInBlock
4782 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
4783 Recursively call AddKnownVariable to all enclosing blocks.
4784 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
4785 Remove recursive calls.
4786 (Block): Update to changes.
4788 New ExplicitBlock invariants
4789 * statement.cs (Block.Explicit): New field. It points to the
4790 immediately enclosing non-implicit block.
4791 (Block..ctor): Maintain the invariant.
4792 * cs-parser.jay: Take advantage of invariant.
4794 Introduce ExplicitBlock
4795 * statement.cs (ExplicitBlock): New.
4796 (ToplevelBlock): Derive from it.
4797 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
4799 (Block.Implicit): Update to changes.
4800 * cs-parser.jay: Update to changes.
4803 * codegen.cs (EmitContext.IsLastStatement): Remove.
4804 * statement.cs (Block.DoEmit): Update to changes.
4806 2007-05-25 Raja R Harinath <rharinath@novell.com>
4808 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
4809 modifying current_block directly.
4811 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
4813 * class.cs: Implemented automatic properties (C# 3.0)
4814 Thanks to Marek for the help.
4816 2007-05-23 Raja R Harinath <rharinath@novell.com>
4818 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
4819 variable as assigned, note also that all its components are
4821 (MyBitVector.SetRange): New. Function to set multiple bits to true.
4823 2007-05-19 Marek Safar <marek.safar@gmail.com>
4825 * anonymous.cs, class.cs: Emit Compiler generated attribute when
4826 member is marked as compiler generated.
4828 * decl.cs (MemberCore): Refactored ModFlags into property.
4830 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
4831 (Check): Check only accessibility modifiers.
4833 2007-05-18 Raja R Harinath <rharinath@novell.com>
4835 Track all assignable slots in one bit array
4836 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
4837 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
4838 logic from VariableMap constructor here. Use the same 'offset'
4839 variable that's later used for computing offsets of local
4841 * flowanalysis.cs (UsageVector.parameters): Remove.
4842 (UsageVector): Update to changes.
4843 (VariableMap): Remove.
4845 Avoid creating ParameterMap in every block
4846 * statement.cs (Block.ParameterMap): Move ...
4847 (ToplevelBlock.ParameterMap): ... here.
4848 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
4850 * flowanalysis.cs (FlowBranching.param_map): Remove.
4851 (FlowBranching.UsageVector): Update to changes.
4852 (FlowBranchingToplevel.CheckOutParameters): Likewise.
4854 * statement.cs (Block.CloneTo): Clone Toplevel field too.
4856 * expression.cs (ParameterReference): Distinguish between block
4857 where parameter was referenced and declared.
4859 2007-05-18 Marek Safar <marek.safar@gmail.com>
4861 * flowanalysis.cs, statement.cs: Put back improved error handling.
4863 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
4867 Imporved object and collection initialization (C# 3.0).
4869 2007-05-15 Marek Safar <marek.safar@gmail.com>
4871 A fix for bug #81380
4872 * expression.cs (Is.DoResolve): Only value types have constant `is'
4875 2007-05-15 Raja R Harinath <rharinath@novell.com>
4877 * statement.cs (ToplevelBlock.child): Remove.
4879 2007-05-15 Raja R Harinath <harinath@gmail.com>
4881 Rationalize ResolveMeta: refactoring
4882 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
4883 out constant handling code into ...
4884 (Block.DoResolveConstants): ... this.
4886 Rationalize ResolveMeta: kill local_map
4887 * statement.cs (Block.local_map, Block.LocalMap): Remove.
4888 (Block.AssignableSlots): New.
4889 (Block.ResolveMeta): Make protected. Don't create a VariableMap
4890 for locals -- move code from VariableMap here. Avoid unnecessary
4892 * flowanalysis.cs (FlowBranching.local_map): Remove.
4893 (FlowBranching..ctor): Use Block.AssignableSlots.
4894 (VariableMap): Remove unused constructors.
4896 2007-05-11 Raja R Harinath <rharinath@novell.com>
4898 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
4900 2007-05-11 Marek Safar <marek.safar@gmail.com>
4902 * typemanager.cs (IsFriendAssembly): Should not be called for building
4905 2007-05-09 Marek Safar <marek.safar@gmail.com>
4907 * literal.cs (NullConstant): Print null in all cases.
4909 * expression.cs (Binary.ResolveOperator): Implemented delegate
4910 comparison based on C# 2.0 changes.
4912 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
4914 This code is contributed under the MIT X11 license
4916 The following enables support for several C# 3.0 language features:
4918 * cs-tokenizer.cs: Added support for the "var" keyword.
4920 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
4921 Added VarExpr class to facilitate type inferencing.
4923 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
4924 to support anonymous types.
4926 * assign.cs: Added support for type inferencing and initialization.
4928 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
4930 * expression.cs: Added implicit array support to ArrayCreation.
4931 Added 5 types and 1 interface:
4933 IInitializable Implementing classes can inject initializing
4934 statements after object instantiation.
4936 Initializer Stores data for object initialization.
4938 AnonymousType An expression for anonymous types.
4940 AnonymousTypeParameter Stores data about an anonymous type's field.
4942 NewInitialize An expression for object initialization.
4944 CollectionInitialize An expression for collection initialization.
4946 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
4949 2007-05-06 Marek Safar <marek.safar@gmail.com>
4951 A fix for bug #81500
4952 * cs-tokenizer.cs: Add special handling for coalescing operator.
4954 2007-05-06 Marek Safar <marek.safar@gmail.com>
4956 A fix for bug #81529
4957 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
4958 its value from base class until it is redefined.
4960 2007-05-02 Raja R Harinath <rharinath@novell.com>
4962 Fix regression in cs0631-3.cs
4963 * cs-parser.jay (operator_declarator): Add opt_attributes to error
4964 fallback. Make error fallback catch more cases.
4966 2007-05-01 Miguel de Icaza <miguel@novell.com>
4968 * cs-parser.jay: Allow parameters in operator declarations to have
4971 2007-04-27 Miguel de Icaza <miguel@novell.com>
4973 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
4976 * lambda.cs (ContextualReturn.Resolve): An expression is valid
4977 inside the ContextualReturn, it does not have to be an
4978 ExpressionStatement.
4980 2007-04-24 Miguel de Icaza <miguel@novell.com>
4982 * lambda.cs (ContextualReturn.Resolve): if the return type is not
4985 2007-04-23 Miguel de Icaza <miguel@novell.com>
4987 * anonymous.cs (AnonymousContainer): split the virtual Resolve
4988 method in two methods: ResolveNoDefine and Resolve.
4990 ResolveNoDefine will stop just after ResolveTopBlock has been
4993 Resolve will then continue by creating a method and issuing the
4994 call to method.Define ().
4996 (AnonymousMethod): Split and implement the new Resolve and
4997 ResolveNoDefine as well.
4999 * lambda.cs (LambdaExpression): Split the anonymous method
5000 resolution code into a separate routine (CoreCompatibilityTest)
5001 from DoCompatibleTest.
5003 (LambdaExpression.TryBuild): New method, this method tries to
5004 build the LambdaExpression with the given set of types to be used
5005 as the types for the various parameters of the lambda expression.
5007 If the compilation succeed with the given types, the infered type
5008 of the Anonymous method is returned, otherwise null is returned.
5010 2007-04-23 Marek Safar <marek.safar@gmail.com>
5012 A fix for bug #81414
5013 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5015 2007-04-22 Miguel de Icaza <miguel@novell.com>
5017 * cs-tokenizer.cs: Change various identifiers here from the
5018 camelCasing to the recommended Linux-like style for instance
5019 variables from the Coding Guidelines.
5021 2007-04-19 Martin Baulig <martin@ximian.com>
5024 (Convert.ImplicitReferenceConversionCore): Allow conversions from
5025 System.Enum to System.ValueType.
5027 2007-04-13 Martin Baulig <martin@ximian.com>
5029 Rewrote implicit reference conversions. We need to distinguish
5030 between implicit reference conversions (13.1.4) and implicit
5031 boxing conversions (13.1.5).
5033 According to the spec, there's an an implicit conversion
5034 "From a one-dimensional array-type S[] to IList<T> and base
5035 interfaces of this interface, provided there is an implicit
5036 reference conversion from S to T." Note that this does not
5037 include boxing conversions.
5040 (Convert.ImplicitTypeParameterBoxingConversion): New method.
5041 (Convert.ImplicitReferenceConversion): Split into
5042 ImplicitReferenceConversionCore() and
5043 ImplicitBoxingConversionExist().
5044 (Convert.ImplicitReferenceConversionExists): Use the new
5045 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5047 2007-04-12 Martin Baulig <martin@ximian.com>
5049 * convert.cs (Convert.ImplicitReferenceConversion): Move the
5050 `TypeManager.null_type' checks up to the top of the method.
5052 2007-04-11 Marek Safar <marek.safar@gmail.com>
5054 A fix for bug #81350
5055 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5058 2007-04-11 Martin Baulig <martin@ximian.com>
5060 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5061 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5062 to make this work for generic classes; fixes #79561.
5064 2007-04-11 Martin Baulig <martin@ximian.com>
5066 * expression.cs (As): Add support for nullable types; fixes #79371.
5068 2007-04-11 Martin Baulig <martin@ximian.com>
5070 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5071 `type.FullName' is null; fixes #80243.
5073 2007-04-11 Martin Baulig <martin@ximian.com>
5075 * expression.cs (Invocation.IsApplicable): Don't modify the method
5076 if type inference succeeded, but the method was not applicable.
5079 2007-04-10 Marek Safar <marek.safar@gmail.com>
5081 A fix for bug #81324
5082 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5083 internal and external namespaces containers.
5085 2007-04-10 Martin Baulig <martin@ximian.com>
5087 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5088 TypeManager.DropGenericMethodArguments() so we also call
5089 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
5091 2007-04-10 Martin Baulig <martin@ximian.com>
5093 * iterators.cs (Iterator.CreateIterator): Don't crash if
5094 `method.ReturnType' is null. This happens if something went wrong
5095 while resolving that typ (we already reported an error in this case).
5097 2007-04-10 Martin Baulig <martin@ximian.com>
5099 * expression.cs (New.DoResolve): Don't call CheckComImport() on
5100 generic interfaces; report the CS0144 directly.
5102 2007-04-10 Martin Baulig <martin@ximian.com>
5104 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5105 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5107 2007-04-10 Martin Baulig <martin@ximian.com>
5109 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5111 2007-04-09 Raja R Harinath <rharinath@novell.com>
5114 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5115 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5118 * statement.cs (For.Resolve): If resolution fails, use
5121 2007-04-08 Marek Safar <marek.safar@gmail.com>
5123 * anonymous.cs (MakeName): Make faster and zero-based.
5124 (VerifyExplicitParameterCompatibility): Back to mode where generic
5125 parameter is ignored.
5126 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5128 * class.cs (EmitType): Method can emit another new method.
5130 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5132 * driver.cs: Updated.
5134 * lambda.cs: Reuse predefined empty parameters.
5136 * parameter.cs: Updated
5138 * support.cs: Implemented InflateTypes.
5140 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5141 (InitSystemCore): Introduced to isolate 3.0 dependencies.
5143 2007-04-03 Martin Baulig <martin@ximian.com>
5147 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5148 version of TypeManager.IsOverride() which also works with generic
5151 2007-04-03 Martin Baulig <martin@ximian.com>
5156 (Convert.ExplicitReferenceConversion): We need to cast when
5157 converting from IList<T> to S[].
5159 2007-04-01 Marek Safar <marek.safar@gmail.com>
5161 * decl.cs (FindExtensionMethods): Consider all candidates with same name
5164 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5166 2007-03-31 Marek Safar <marek.safar@gmail.com>
5168 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5169 argument and return type inferring.
5171 * codegen.cs (InferReturnType): Flag whether return can be inferred.
5172 (ReturnType): Turned to property.
5174 * statement.cs (Return): Implemented return type inferring.
5176 * support.cs (ReflectionParameters): Use local types if possible.
5178 2007-03-30 Raja R Harinath <rharinath@novell.com>
5180 * flowanalysis.cs (FlowBranching.Reachability): Remove.
5181 (FlowBranching.UsageVector): Update to changes.
5183 Prepare to kill 'Reachability'
5184 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5185 argument of constructor.
5187 2007-03-29 Raja R Harinath <rharinath@novell.com>
5189 Prepare to kill 'Reachability'
5190 * flowanalysis.cs (UsageVector.is_unreachable): New.
5191 (UsageVector): Update to maintain 'is_unreachable' in parallel to
5192 'reachability', and verify they're consistent.
5195 * expression.cs (New.EmitStatement): Handle type parameters here too.
5197 2007-03-29 Martin Baulig <martin@ximian.com>
5202 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5203 CompilerGeneratedClass.
5204 (ScopeInfo.EmitScopeInstance): Make this protected.
5205 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5206 `ec.CurrentAnonymousMethod.Scope == Scope'.
5208 * statement.cs (Block.ScopeInfo): Make this a property.
5210 2007-03-27 Raja R Harinath <harinath@gmail.com>
5212 Prepare to kill 'Reachability'
5213 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5214 (FlowBranching.UsageVector.Reachability): Remove property.
5215 (FlowBranching.UsageVector.IsUnreachable): New property.
5216 (FlowBranching.UsageVector.ResetBarrier): New.
5217 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5218 * codegen.cs, statement.cs: Update to changes.
5220 2007-03-27 Martin Baulig <martin@ximian.com>
5225 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5228 2007-03-26 Raja R Harinath <rharinath@novell.com>
5230 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5231 instead of TriState. Remove all mention of TriState.
5233 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5234 replaced by a boolean. Add boolean 'is_unreachable' field, check
5235 and maintain invariants.
5237 2007-03-25 Marek Safar <marek.safar@gmail.com>
5239 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5241 2007-03-25 Marek Safar <marek.safar@gmail.com>
5243 * expression.cs: Stop using obsolete 2.0 opcodes.
5245 2007-03-25 Marek Safar <marek.safar@gmail.com>
5247 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5248 one of the latests Martin's fixes.
5250 2007-03-23 Miguel de Icaza <miguel@novell.com>
5252 * expression.cs: On BigEndian systems, swap the bytes, temporary
5253 solution until we get a new bitconverter class.
5255 2007-03-23 Martin Baulig <martin@ximian.com>
5259 * decl.cs (MemberCache.AddMembers): Add generic methods both as
5260 "Method" and "Method`1". Normally, a cache lookup is done on the
5261 "Method" form (ie. without the generic arity), but this one makes
5262 lookups on the full form work as well.
5264 2007-03-22 Raja R Harinath <rharinath@novell.com>
5266 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5269 2007-03-20 Bill Holmes <billholmes54@gmail.com>
5271 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5272 ordered_member_list, to TypeBuilder to store members to be defined
5273 in the order they were parsed in.
5274 - ordered_explicit_member_list contains all properties indexers
5275 and methods that are defined as explicit implementation of an
5276 interface or base class.
5277 - ordered_member_list contains all properties indexers and methods
5278 that are not defined as explicit implementation of an interface
5281 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
5282 functionality in these removed classes has been replaced with
5283 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
5284 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5286 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5287 to CheckForDuplications inside GetMethod and SetMethod Define Method
5288 to handle method property and indexer name conflicts.
5292 All code is contributed under the MIT/X11 license.
5294 2007-03-20 Martin Baulig <martin@ximian.com>
5296 * class.cs (TypeContainer.Interfaces): Removed; they're now
5297 included in `TypeContainer.Types'.
5299 2007-03-20 Martin Baulig <martin@ximian.com>
5301 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
5303 * class.cs (TypeContainer.CreateType): New public method. This is
5304 now called before DefineType() to create the TypeBuilders.
5305 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5306 has already been created by CreateType().
5307 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5308 don't resolve our base classes here; this has been moved into
5309 DefineBaseTypes(). We're now called from CreateType().
5310 (TypeContainer.DefineBaseTypes): New private method; resolve our
5311 base classes here. We're now called from DefineType().
5314 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5315 our types first to create all the TypeBuilders. After that, call
5316 TypeContainer.DefineType() on all the types which'll resolve their
5317 base classes and setup the resolve order.
5319 2007-03-20 Martin Baulig <martin@ximian.com>
5321 * class.cs (TypeContainer.Enums): Removed; they're now included in
5322 `TypeContainer.Types'.
5324 2007-03-20 Martin Baulig <martin@ximian.com>
5327 (TypeContainer.DefineType): Don't call ResolveMembers() here.
5328 (TypeContainer.DoResolveMembers): Call DefineType() on our
5329 `compiler_generated' classes; moved here from DefineNestedTypes().
5332 (RootContext.ResolveTree): Call ResolveMembers() on all
5333 TypeContainer's in the `type_container_resolve_order'.
5335 2007-03-19 Marek Safar <marek.safar@gmail.com>
5337 * class.cs: Use corlib to handle InternalMethodImplAttribute.
5339 2007-03-17 Marek Safar <marek.safar@gmail.com>
5341 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
5342 implementation flags.
5344 2007-03-17 Marek Safar <marek.safar@gmail.com>
5346 * class.cs: More optimizations for type parameters.
5348 2007-03-15 Marek Safar <marek.safar@gmail.com>
5350 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
5352 * ecore.cs, parameter.cs: More common code for both corlibs.
5354 * typemanager.cs (IsGenericMethod): Simplified.
5356 2007-03-15 Raja R Harinath <rharinath@novell.com>
5358 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5360 * statement.cs, iterators.cs, lambda.cs: Update to changes.
5362 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
5363 unconditionally. Simplify explanation.
5364 (Try.Resolve, Using.Resolve): Likewise.
5366 2007-03-15 Martin Baulig <martin@ximian.com>
5370 * decl.cs (DeclSpace): If we're a partial class, use our
5371 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
5373 2007-03-15 Raja R Harinath <rharinath@novell.com>
5375 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5377 (FlowBranching.UsageVector): Update to changes.
5378 (FlowBranching.MergeSiblings): Likewise.
5379 * statement.cs: Likewise.
5381 2007-03-15 Martin Baulig <martin@ximian.com>
5386 (MemberCache): Added a special .ctor for type parameters.
5389 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
5392 2007-03-09 Martin Baulig <martin@ximian.com>
5394 * enum.cs (Enum): Make this a TypeContainer.
5395 (EnumMember): Derive from `Const'.
5398 (Const.DoResolveValue): New protected virtual method; move most of
5399 the functionality of ResolveValue() here so we can override it in
5401 (Const.CreateConstantReference): Make this virtual.
5403 * class.cs (Kind): Add `Kind.Enum'.
5404 (TypeContainer.Emit): Don't emit the enums here; they're already
5405 in the `RootContext.typecontainer_resolve_order'.
5407 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
5408 here; they're already in the `typecontainer_resolve_order'.
5410 * ecore.cs (EnumConstant.ConvertImplicitly): Add
5411 TypeManager.DropGenericTypeArguments().
5414 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
5415 (TypeManager.IsEnumType): Likewise.
5416 (TypeManager.EnumToUnderlying): Likewise.
5417 (TypeManager.IsEqual): Add support for enums.
5419 2007-03-12 Raja R Harinath <rharinath@novell.com>
5421 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
5422 DefaultParameterValueAttribute to be undefined, say if System.dll
5425 2007-03-11 Marek Safar <marek.safar@gmail.com>
5427 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
5430 2007-03-10 Marek Safar <marek.safar@gmail.com>
5432 * class.cs, parameter.cs: Unified parameters verification.
5434 2007-03-08 Martin Baulig <martin@ximian.com>
5436 * cs-parser.jay (constructor_header): Pass the location to the
5437 newly created TopLevelBlock.
5439 2007-03-07 Martin Baulig <martin@ximian.com>
5441 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
5443 2007-03-06 Miguel de Icaza <miguel@novell.com>
5445 * convert.cs (ExplicitReferenceConversionExists): Sync this method
5446 with the changes from David, fixes the build.
5448 2007-03-05 David Mitchell <dmitchell@logos.com>
5450 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
5451 and its base interfaces to a one-dimensional array type S[],
5452 provided there is an implicit or explicit reference conversion
5455 2007-03-03 Marek Safar <marek.safar@gmail.com>
5457 * cs-tokenizer.cs: Implemented basic linq grammar.
5459 * driver.cs: Set linq lang version on demand.
5461 2007-02-26 Marek Safar <marek.safar@gmail.com>
5463 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
5465 2007-02-25 Marek Safar <marek.safar@gmail.com>
5467 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
5470 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
5472 Check property and event extern attributes.
5474 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
5477 2007-02-24 Marek Safar <marek.safar@gmail.com>
5479 A fix for bug #80407
5480 * ecore.cs: Don't report ambiguity error when methods have same parent.
5482 2007-02-23 Marek Safar <marek.safar@gmail.com>
5484 A fix for bug #80878
5485 * class.cs, cs-parser.jay: Event property can host anonymous methods.
5487 2007-02-22 Marek Safar <marek.safar@gmail.com>
5489 * attribute.cs: Enable ExtensionAttribute presence test.
5491 2007-02-22 Marek Safar <marek.safar@gmail.com>
5493 * class.cs: Warn about missing GetHashCode only when Equals is override.
5495 * decl.cs: Check accessibility of type arguments.
5497 * typemanager.cs: Correctly report nullable array.
5499 2007-02-20 Marek Safar <marek.safar@gmail.com>
5501 * class.cs, report.cs: Capture more details when things go wrong.
5503 2007-02-20 Marek Safar <marek.safar@gmail.com>
5505 A fix for bug #80650
5506 * cs-parser.jay: Anonymous container starts at constructor declaration
5507 and not at block beginning because it has to be usable in constructor
5510 * statement.cs: Use context location and not block one for error reporting.
5512 2007-02-18 Marek Safar <marek.safar@gmail.com>
5514 A fix for bug #78712
5515 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
5518 2007-02-18 Marek Safar <marek.safar@gmail.com>
5520 A fix for bug #80493 by Atsushi Enomoto
5521 * cs-parser.jay: Ignore invalid attribute target.
5523 2007-02-18 Marek Safar <marek.safar@gmail.com>
5525 * cs-tokenizer.cs: Ignore '\0' as white space character.
5527 2007-02-17 Miguel de Icaza <miguel@novell.com>
5529 * cs-parser.jay: Add support for lambda expressions to the mcs
5532 * lambda.cs: Only clone when we are probing, not on the final call
5533 (Compatible is the final call).
5535 * statement.cs (CloneContext): Introduce class to provide block
5536 remapping during clone.
5538 All statements Clone themselves now.
5540 (Clone): special handling for blocks, when we clone a block, we
5541 register the block inside this routine, as children of the block
5542 might trigger a lookup.
5544 * expression.cs: Add support for CloneContext in all expressions.
5546 2007-02-17 Marek Safar <marek.safar@gmail.com>
5548 A fix for bug #80493
5549 * statement.cs: Report ambiguous warning when interfaces are not related.
5551 2007-02-15 Marek Safar <marek.safar@gmail.com>
5553 C# 3.0 extension methods.
5555 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
5556 cannot be used directly.
5558 * class.cs (Class.Emit): Emit extension attribute if any class method
5559 is extension method.
5560 (Method.Define): Add basic extension method validation conditions.
5561 (Method.Emit): Emit extension attribute for method.
5563 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
5564 extension method exists. Currently we follow same approach as Microsoft
5565 does, emit even if a method or a class are private but this can change
5568 * cs-parser.jay: Add handling of `this' keyword in method parameters
5571 * decl.cs (DeclSpace.IsStaticClass): New property.
5572 (MemberCache.FindExtensionMethods): Looks for extension methods with
5573 defined name and extension type.
5575 * doc.cs: Updated after OverloadResolve changes.
5577 * driver.cs: Add new soft reference to System.Core.dll.
5579 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
5580 (ExtensionMethodGroupExpr): Represents group of extension methods.
5582 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
5583 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
5584 to MethodGroupExpr and made non-static for easier customization.
5585 (Invocation.DoResolve): Add extension method lookup when no standard
5587 (MemberAccess.DoResolve): Try extension methods if no member exists.
5589 * modifiers.cs: Add METHOD_EXTENSION modifier.
5591 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
5592 as well as candidate extension type.
5593 (ComputeNamespaces): When assembly constains extension methods registers
5595 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
5596 extension method lookup.
5597 (Namespace.LookupExtensionMethod): Looks for extension method in this
5599 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
5600 find a method which matches name and extensionType.
5602 * parameter.cs (Parameter): Add This modifer.
5603 (HasExtensionMethodModifier): New property.
5604 (Resolve): Add extension parameter check.
5605 (ModFlags): turned to property to exclude this modifier as it is not real
5607 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
5609 * support.cs (ParameterData): Add ExtensionMethodType.
5610 (ReflectionParameters): Implemented ExtensionMethodType interface property.
5612 * typemanager.cs: Add type and ctor extension attribute type.
5614 2007-02-15 Miguel de Icaza <miguel@novell.com>
5616 * report.cs (DisableErrors, EnableErrors): used to prevent error
5617 output when we are "trying" to compile various methods with
5620 * ecore.cs (Expression): Add Clone method that calls the virtual
5621 CloneTo method. The current CloneTo method in Expression throws
5622 an exception so we can track down all the places where this must
5623 be implemented (not using abstract, because that would be a lot of
5624 up-front-work before we can start testing the implementation
5627 Important: we only need Clone capabilities for expressions created
5628 by the parser, as the expressions we will be cloning are
5629 expressions in the pre-resolved state. This vastly simplifies
5632 (SimpleName): Add CloneTo that does nothing.
5633 (EmptyCast): Add CloneTo.
5635 * expression.cs (Binary): Implement CloneTo.
5636 (Invocation.IsApplicable): Store the current ec in
5637 EmitContext.TempEc and restore it on return. This is used so we
5638 do not have to sprinkle hundres of methods with an extra
5639 EmitContext, we know that the only user is the lambda expression
5640 ImplicitConversionExists code.
5642 (Argument): Add Cloning capabilities.
5643 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
5644 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
5645 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
5646 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
5647 IndexerAccess): Add Clone capability.
5649 (LocalVariableReference, This): TODO: needs cloned Block mapping.
5651 (Argument): Add cloning capability.
5653 * assign.cs (Assign): Implement CloneTo.
5655 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
5657 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
5658 version by calling Convert with the EmitContext (that we are
5659 currently storing in ec, this is not great, but will do for now,
5660 to avoid passing EmitContext parameters to hundreds of functions
5661 that do not need them now).
5663 (SetExpression): Remove, it is not needed.
5665 (ContextualReturn): Implement CloneTo.
5667 * statement.cs (Statement): Implement cloning infrastructure,
5668 similar to expressions.
5670 (Block): Partial implementation of Clone for statements.
5672 (Return): Implement clone.
5674 * constant.cs (Constant.CloneTo): New method, does nothing.
5676 * codegen.cs (TempEc): Add a static EmitContext as a temporary
5677 solution, until we decide how to exactly do this.
5679 2007-02-14 Marek Safar <marek.safar@gmail.com>
5681 A fix for bug #80493
5682 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
5683 a property is override we need to use second accessor.
5685 2007-02-13 Marek Safar <marek.safar@gmail.com>
5687 A fix for bug #80418
5688 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
5691 2007-02-13 Marek Safar <marek.safar@gmail.com>
5693 Another fix for bug #80749
5694 * pending.cs: Abstract class has priority over interfaces.
5696 2007-02-13 Marek Safar <marek.safar@gmail.com>
5698 Another fix for bug #80749
5699 * pending.cs: Abstract class has priority over interfaces.
5701 2007-02-13 Marek Safar <marek.safar@gmail.com>
5703 Another fix for bug #80749
5704 * pending.cs: Abstract class has priority over interfaces.
5706 2007-02-13 Marek Safar <marek.safar@gmail.com>
5708 Another fix for bug #80749
5709 * pending.cs: Abstract class has priority over interfaces.
5711 2007-02-13 Marek Safar <marek.safar@gmail.com>
5713 * class.cs Better error message.
5715 * driver.cs: Add shorter versions of -optimize option.
5717 2007-02-13 Martin Baulig <martin@ximian.com>
5719 * class.cs (Constructor.Emit): Check the return value of
5720 ec.ResolveTopBlock() and return on error.
5722 2007-02-13 Raja R Harinath <rharinath@novell.com>
5724 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
5725 message to fix error message regression.
5727 2007-02-12 Marek Safar <marek.safar@gmail.com>
5729 * delegate.cs: Delegate creation expression cannot be of Nullable type.
5731 2007-02-12 Marek Safar <marek.safar@gmail.com>
5733 A fix for bug #80749
5734 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
5735 its parent container.
5737 * class.cs (DefineFieldInitializers): Each initializer can has different
5740 * const.cs: Updated.
5742 2007-02-11 Miguel de Icaza <miguel@novell.com>
5744 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
5745 now all the heavy lifting to check that embedded statements or
5746 expressions have the right form is done in the ContextualReturn.
5748 (ContextualReturn): New class.
5750 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
5751 method that can be invoked to report 201, so we do not replicate
5754 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
5756 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
5757 treating tabs as spaces.
5759 2007-02-09 Marek Safar <marek.safar@gmail.com>
5761 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
5762 * assign.cs: Use full implicit conversion for right side check.
5764 2007-02-09 Marek Safar <marek.safar@gmail.com>
5766 * statement.cs (Switch): Switch over boolean type is not standardized.
5768 2007-02-08 Marek Safar <marek.safar@gmail.com>
5770 A fix for bug #80755
5771 * decl.cs (FindBaseEvent): Don't use method cache for events.
5773 2007-02-07 Marek Safar <marek.safar@gmail.com>
5775 * cs-parser.jay: Better syntax error handling.
5777 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
5778 instead of underlying type value.
5780 2007-02-06 Marek Safar <marek.safar@gmail.com>
5782 * driver.cs: Check define identifier before is registered.
5784 * namespace.cs: Use existing error message.
5786 * report.cs: New warning.
5788 2007-02-06 Marek Safar <marek.safar@gmail.com>
5790 A fix for bug #80742
5791 * expression.cs: Delegate Invoke method can be called directly.
5793 2007-02-06 Marek Safar <marek.safar@gmail.com>
5795 A fix for bug #80676
5796 * class.cs (IsEntryPoint): The Main method can have params modifier.
5798 2007-02-04 Miguel de Icaza <miguel@novell.com>
5800 * parameter.cs (Parameter, Parameters): Add Clone method.
5802 * anonymous.cs (Compatible): Turn method into virtual method, so
5803 LambdaExpression can implement a different behavior.
5805 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
5806 out the basic checking here, so it can be used by
5809 * lambda.cs: Introduce "Compatible" function that will do the
5812 2007-02-02 Marek Safar <marek.safar@gmail.com>
5814 * attribute.cs: Unified one error message.
5816 * class.cs (Class): Use type attributes and not properties to test static
5818 (IsEntryPoint): Don's pass local variable.
5820 * convert.cs: Removed duplicate check.
5822 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
5824 * driver.cs: Don't crash when soft reference does not exist.
5826 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
5827 (UsingEntry): Removed redundant allocation.
5829 * parameter.cs: Add fast path for type parameters.
5831 * support.cs: Don't allocate attribute when it's not used.
5833 2007-01-30 Miguel de Icaza <miguel@novell.com>
5836 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
5837 this into a virtual method, so we can override it in LambdaExpression.
5839 * driver.cs: Improve diagnostics in case of failure.
5841 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
5842 write a function that is slightly more complex and that parses:
5844 type identifier [, type identifier]* )
5846 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
5849 (canEmpty ? i >= 0 : i > 0)
5851 2007-01-30 Raja R Harinath <rharinath@novell.com>
5853 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
5854 exception on possibly valid code.
5856 2007-01-29 Raja R Harinath <rharinath@novell.com>
5858 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
5860 (parse_opt_type_arguments): Remove. It's almost the same as
5862 (parse_namespace_or_typename): Use parse_less_than.
5864 2007-01-28 Miguel de Icaza <miguel@novell.com>
5866 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
5867 this bug took a few hours to find, because the state saved and
5868 restored by PushPosition and PopPosition was ignoring the state of
5869 parse_generic_less_than.
5871 I can also now remove the handling of OP_LT and OP_GT, this solves
5874 * cs-tokenizer.cs: store the location for the ARROW token, we use
5877 (PushPosition, PopPosition): save/restore also `current_token',
5878 restore `parse_generic_less_than' (was missing).
5880 (parse_opt_type_arguments): use parse_type, not
5881 parse_namespace_or_typename to parse types.
5883 * lambda.cs: Empty new file, will eventually have the lambda
5884 expression implementation.
5886 * lambda.test: used to test the internal tokenizer.
5888 * report.cs (FeatureIsNotISO1): Rename from
5889 FeatureIsNotStandardized, because it was about the language level
5890 (1 vs 2) it was not about standarization.
5892 (FeatureRequiresLINQ): New.
5894 * support.cs (SeekableStreamReader): Only require that the reader
5895 is a TextReader, not a StreamReader, so we can plug StringReader.
5897 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
5898 given position in the input stream the following tokens can be
5899 parsed as a type followed by an identifier.
5901 (is_punct): after a '(' if parse_type_and_parameter returns true,
5902 then return a special token OPEN_PARENS_LAMBDA which is used to
5903 avoid reduce/reduce errors in the grammar for the
5904 lambda_expression rules.
5906 (parse_type): implement a type parser inside the
5907 tokenizer, the parser only returns true or false depending on
5908 whether the input at a given position can be parsed as a type.
5910 (peek_token): new method used during type parsing.
5912 2007-01-28 Raja R Harinath <rharinath@novell.com>
5915 * anonymous.cs (ScopeInfo.InflateParameters): New.
5916 (AnonymousContainer.Resolve): Use it to redirect types of
5917 delegate parameters.
5919 2007-01-27 Raja R Harinath <rharinath@novell.com>
5922 * expression.cs (Error_InvalidArguments): Don't use two different
5923 messages for CS1503. Use ExtraInformation and
5924 SymbolRelatedToPreviousError instead.
5927 * decl.cs (DeclSpace.initialize_type_params): Don't access
5928 'type_params' of a partial class directly.
5930 2007-01-26 Miguel de Icaza <miguel@novell.com>
5932 * constant.cs: Removed a handful of out-of-range checks that were
5935 2007-01-25 Marek Safar <marek.safar@gmail.com>
5937 * expression.cs (CheckUselessComparison): Add additional check for char
5940 * namespace.cs: Fixed typo.
5942 2007-01-23 Miguel de Icaza <miguel@novell.com>
5944 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
5945 gone, instead we inline the test, preventing the needless casts to
5946 longs, ulongs and doubles for the parameters, avoiding calls to
5947 methods that overchecked stuff, and instead inlined things
5950 2007-01-20 Marek Safar <marek.safar@gmail.com>
5952 * cs-parser.jay: Better parameter error handling.
5954 2007-01-17 Marek Safar <marek.safar@gmail.com>
5956 A fix for bug #80368, #80522
5957 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
5958 whether array initializer contains constants only.
5959 (ArrayCreation.Emit): Use better formula to decide when
5960 are array initializers for static initialization.
5961 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
5962 have to emit even constants otherwise they are pre-initialized.
5964 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
5965 Raja R Harinath <rharinath@novell.com>
5967 Fix emit order of 'get' vs. 'set'.
5968 * support.cs (Accessors): New.
5969 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
5970 Note the order in which accessors are declared in the source.
5971 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
5972 Refactored from Property.Define and Indexer.Define.
5973 (PropertyBase.DefineAccessors): New helper that calls the above in
5974 appropriate order as noted by the parser.
5975 (Property.Define, Indexer.Define): Update to changes.
5976 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
5978 2007-01-17 Raja R Harinath <rharinath@novell.com>
5980 Fix cs0029-6.cs and gcs0029-2.cs (regression)
5981 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
5982 there's an implicit conversion from the current type to the target
5983 type before converting the underlying constant.
5985 2007-01-16 Marek Safar <marek.safar@gmail.com>
5987 * const.cs (ResolveValue): Updated after constant conversion was made more
5990 * constant.cs (GetAttributableValue): constant to object conversion is
5991 used for attributes only.
5992 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
5993 constant conversions.
5994 (LongConstant.ConvertImplicitly): Ditto.
5996 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
5997 (ImplicitConversionStandard): Handle constant conversion as extra step.
5998 It solves the issue when constant conversion was called indirectly like
5999 inside array initializer and constant folding was skipped.
6001 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6004 * statement.cs(ImplicitConversionStandard): Updated after constant
6005 conversion was made more generic.
6007 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
6009 * expression.cs (As.DoResolve): Use GenericConstraints instead of
6010 Constraints, solves the problem where the compiler incorrectly
6011 reported that a type parameter was not constrained to a class (Bug
6014 2007-01-14 Marek Habersack <grendello@gmail.com>
6016 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6018 2007-01-14 Marek Safar <marek.safar@gmail.com>
6020 A fix for bug #80368
6021 * assign.cs (FieldInitializer): New class implements field
6022 initializer statement.
6024 * attribute.cs: Update after FieldMember rename.
6026 * class.cs (PropertyBasedMember): New common class for property based
6028 (InterfaceMemberBase): New base class for all members which can be used as
6029 an interface members.
6030 (MethodCore): Moved really common code to InterfaceMemberBase.
6031 (Method.Define): Equal and GetHasCode detection is relevant for methods
6033 (MethodData.Define): Don't assume that public event implements an
6034 interface automatically.
6035 (MethodData.DefineMethodBuilder): Issue an error even if only extern
6037 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6038 (FieldMember): Merged with FieldBase.
6039 (EventProperty.AEventPropertyAccessor): New specialization to check whether
6040 event extern modifier can be used.
6041 (EventField.EventFieldAccessor): Moved event field specific code here.
6042 (Event.AllowedModifiers): Even event can be extern.
6043 (Event.FindOutBaseMethod): New override specific to events.
6044 (Indexer.parameters): Reintroduce parameters because base class holds
6045 only properties common data.
6046 (Indexer.CheckForDuplications): Indexers are threated as methods so we
6047 need do extra parameters check.
6049 * const.cs: Update after FieldMember rename.
6051 * decl.cs (MemberCache.FindBaseEvent): New method.
6053 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6054 to reflect that indexer is now derived from PropertyBased.
6056 * ecore.cs (GetMemberType): Made public.
6057 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6060 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6062 * typemanager.cs (CSharpSignature): Correctly print event accessors.
6063 (RegisterEvent): Removed.
6064 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6065 (GetPrivateFieldOfEvent): Renamed to GetEventField.
6067 2007-01-11 Raja R Harinath <rharinath@novell.com>
6070 * statement.cs (CollectionForeach.TryType): Prefer generic
6071 GetEnumerator over non-generic variant. Fix code to follow comments.
6073 2007-01-09 Raja R Harinath <rharinath@novell.com>
6076 * support.cs (ReflectionParameter): Don't use an invalid index on
6077 the generic parameter data.
6079 2007-01-08 Miguel de Icaza <miguel@novell.com>
6081 * driver.cs: Just add a tiny bit of infrastructure.
6083 2007-01-02 Marek Safar <marek.safar@gmail.com>
6085 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6086 where field type is struct from current assembly.
6088 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6091 2007-01-02 Marek Safar <marek.safar@gmail.com>
6093 A fix for bug #80381
6094 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6097 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6099 (Namespace.LookupType): Always use core types from corlib when speficied.
6101 * report.cs: A new warning.
6103 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6104 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6105 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6107 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6108 (InitCoreTypes): Set expression type of object_type and value_type
6109 immediately after lookup.
6111 2007-01-01 Miguel de Icaza <miguel@novell.com>
6113 * cs-tokenizer.cs: Accept Pc class characters (Connector
6114 Punctuation) as valid identifiers. Fixes #78259
6116 * expression.cs (Invocation.DoResolve): Moved the check for the
6117 use of `this' for doing method calls to the Invocation resolution
6118 step, after overload resolution has taken place instead of doing
6119 the check at the low-level `This.DoResolve' level.
6121 The `This.DoResolve'(appens before overload resolution, so it has
6122 no way of knowing if the method that will be called will be
6123 instace or static, triggering an erroneous report for cs0188 (Bug
6126 We now do the check for instance method invocations after we know
6127 what method will be called.
6129 (This.CheckThisUsage): Move the actual use of this structure
6130 checking into its own method and expose it.
6132 * Everywhere that called Error_ValueCannotBeConverted: pass a new
6135 Exceptions: Null.ConvertImplicitly,
6136 Constant.ImplicitConversionRequired as there are too many call
6137 sites for passing the ec.
6139 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6140 EmitContext, if the value is null, then we do not try to provide
6141 the extra information from the error (If a userdefined conversion
6142 exists, as UserDefinedConversion requires a non null-EmitContext).
6146 2006-12-30 Raja R Harinath <rharinath@novell.com>
6148 * flowanalysis.cs (MyBitVector): Document some invariants.
6149 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6150 introduced below, and add a couple of others,
6152 2006-12-30 Marek Safar <marek.safar@gmail.com>
6154 * attribute.cs (GetMethodObsoleteAttribute): Uses new
6155 GetPropertyFromAccessor and GetEventFromAccessor.
6157 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6158 overrides non-obsolete one.
6159 (Indexer.Define): Error message has been moved to the parser.
6161 * cs-parser.jay: Better syntax errors handling.
6163 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6164 when an invocation has no arguments.
6166 * ecore.cs: Removed not used caching.
6168 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6171 * report.cs: Add a new warning.
6173 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6175 * typemanager.cs (enumeration_type): Removed.
6176 (CSharpSignature): Reuses IsSpecialMethod.
6177 (IsEqual): Hack for MS BCL.
6178 (GetPropertyFromAccessor): New method.
6179 (GetEventFromAccessor): New method.
6180 (IsSpecialMethod): Fixed to handle more cases.
6182 2006-12-30 Marek Safar <marek.safar@gmail.com>
6184 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6185 Made white spaces array static.
6187 * ecore.cs (RemoveGenericArity): Optimized.
6189 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6191 (MyBitVector.initialize_vector): Simplified.
6193 2006-12-22 Miguel de Icaza <miguel@novell.com>
6195 * ecore.cs: Am not entirely happy with this hack, but it seems to
6196 address the issue in 80257 (a small test case for
6199 I set the MethodGroupExpr.Type to an internal compiler type
6200 (itself in this case) to force the resolution to take place. Why
6201 it does not take place with a null is beyond me.
6203 2006-12-20 Marek Safar <marek.safar@gmail.com>
6205 A fix for bug #80288
6206 * expression.cs (ResolveOperator): Consider user defined conversion for
6207 logical and operator too.
6208 (EmitBranchable): Optimization for logical and when full constant folding
6209 could not be applied but one operand is constant.
6211 2006-12-19 Marek Safar <marek.safar@gmail.com>
6213 * class.cs (GetClassBases): Write 5 times every day, will never use
6214 FullName for error reporting.
6216 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6218 2006-12-19 Martin Baulig <martin@ximian.com>
6220 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6221 the symbol file info here.
6223 2006-12-18 Marek Safar <marek.safar@gmail.com>
6225 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6226 of `elseif' is taking then following sections are not taking.
6227 Fixes an issue reported on mono mailing list.
6229 2006-12-18 Marek Safar <marek.safar@gmail.com>
6231 A fix for bug #80300
6232 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6233 a caller is not taking.
6235 2006-12-18 Raja R Harinath <rharinath@novell.com>
6237 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6238 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6239 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6240 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6241 * class.cs: Update to changes.
6243 2006-12-17 Marek Safar <marek.safar@gmail.com>
6245 A fix for bug #79934
6246 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6249 * class.cs (ResolveMembers): Register an iterator in current container and
6252 2006-12-16 Raja R Harinath <rharinath@novell.com>
6255 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6256 satisfy a params annotated parameter.
6258 2006-12-16 Marek Safar <marek.safar@gmail.com>
6260 A fix for bug #77014
6261 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6262 paramters correctly and not rely on hacks in Parameters class.
6263 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6265 (Invocation.VerifyArgumentsCompat): Ditto.
6266 (Invocation.EmitArguments): Changed to correctly emit params arguments at
6269 * parameter.cs (HasParams): Don't assume that params is the last one.
6271 * support.cs (ReflectionParameters.ctor): Look for params attribute
6273 (ReflectionParameters.ParameterType): Removed hack when we returned last
6274 parameter for out of range parameters.
6275 (ParameterName, ParameterModifier): Ditto.
6277 2006-12-14 Marek Safar <marek.safar@gmail.com>
6279 A fix for bug #79987
6280 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6281 when assembly is not CLS compliant but type is. I have no idea why is this
6284 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6286 2006-12-13 Miguel de Icaza <miguel@novell.com>
6288 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6289 in struct constructors, they are basically no-ops.
6291 2006-12-12 Marek Safar <marek.safar@gmail.com>
6293 * cs-tokenizer.cs (Position): Save preprocessor status too.
6295 2006-12-12 Marek Safar <marek.safar@gmail.com>
6297 A fix for bug #77794
6298 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6300 2006-12-12 Marek Safar <marek.safar@gmail.com>
6302 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6304 (pp_expr): Report error for an invalid expression.
6305 (handle_preprocessing_directive): Simplified; add more error checking.
6307 2006-12-11 Marek Safar <marek.safar@gmail.com>
6309 A fix for bug #74939
6310 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6311 directives handling.
6313 2006-12-10 Marek Safar <marek.safar@gmail.com>
6315 A fix for bugs #80093, and #75984
6316 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6317 logic, it seems to me as it worked before "by coincidence".
6318 (xtoken): Simplified to use reworked handle_preprocessing_directive.
6319 (cleanup): Enabled endif check.
6321 2006-12-09 Marek Safar <marek.safar@gmail.com>
6323 A fix for bug #80162
6324 * statement.cs (CollectionForeach.TryType): Generics and non-generics
6325 enumerators are never ambiguous.
6327 2006-12-08 Raja R Harinath <rharinath@novell.com>
6330 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
6332 2006-12-06 Marek Safar <marek.safar@gmail.com>
6334 A fix for bug #80144
6335 * class.cs (EventProperty.Define): Explicit implementation means
6336 that an even is used.
6338 2006-12-06 Marek Safar <marek.safar@gmail.com>
6340 Fixes the operators implementation (part II)
6342 * cfold.cs (DoConstantNumericPromotions): Renamed to
6343 DoBinaryNumericPromotions and simplified.
6344 (BinaryFold): Couple of conversion fixes; simplified.
6346 * constant.cs, ecore.cs, literal.cs
6347 (ToType): Renamed to ConvertImplicitly.
6348 (Reduce): Renamed to ConvertExplicitly.
6350 * class.cs, convert.cs: Updated.
6352 * expression.cs: TryReduce doesn't throw an exception.
6354 2006-12-01 Marek Safar <marek.safar@gmail.com>
6356 A fix for bug #80108
6357 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
6360 2006-11-30 Marek Safar <marek.safar@gmail.com>
6362 Fixes unary operators implementation (part I)
6365 * cfold.cs (Error_CompileTimeOverflow): Made internal
6367 * const.cs (IConstant): Changed to use reference to constant and
6368 not constant itself.
6369 Updated IConstant implementations.
6371 * constant.cs (CreateConstant): New factory method.
6372 Updated IConstant implementation.
6374 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
6376 * ecore.cs: Updated to use CreateConstantReference.
6378 * enum.cs: Reflects IConstant changes.
6380 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
6382 * literal.cs (NullConstant): Change to be independently usable.
6384 2006-11-29 Martin Baulig <martin@ximian.com>
6386 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
6387 we need to emit the scope initializer before calling the base .ctor.
6389 * anonymous.cs: Merged back from the new anonymous methods branch.
6390 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
6392 * expression.cs (ParameterReference.DoResolveBase): Create a
6393 "normal" ScopeInfo when capturing parameters rather than using the
6394 root scope; this makes things work with anonymous methods having
6398 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
6400 2006-11-22 Marek Safar <marek.safar@gmail.com>
6402 A fix for bug #79987
6403 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
6404 check to a base class.
6405 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
6406 only when assembly has missing attribute.
6407 * report.cs: Update.
6409 2006-11-21 Marek Safar <marek.safar@gmail.com>
6411 * cs-tokenizer.cs: Merged with gmcs version.
6413 2006-11-20 Marek Safar <marek.safar@gmail.com>
6416 * cs-parser.jay: Better error message when partial keyword is misplaced.
6418 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
6420 A fix for bug #79810
6421 report.cs: CS1058 only applies to 2.0 profile (gmcs).
6422 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
6423 a RuntimeWrappedException by default.
6425 2006-11-18 Marek Safar <marek.safar@gmail.com>
6427 A fix for bug #79843
6428 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
6430 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
6432 2006-11-18 Marek Safar <marek.safar@gmail.com>
6434 * driver.cs, namespace.cs: Uses faster IndexOf version.
6436 2006-11-17 Marek Safar <marek.safar@gmail.com>
6438 A fix for bug #79941
6439 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
6441 (Operator.Define): Implicit/Explicit operator of same type is duplicate
6442 even if internal name is different.
6443 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
6444 (UserDefinedConversion): Simplified as the operators cannot be internal.
6445 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
6447 (MethodLookup): Replaced EmitContext with parentType.
6448 * expression.cs: Updated.
6450 2006-11-09 Raja R Harinath <rharinath@novell.com>
6452 * driver.cs (BadAssembly): Handle all the ugliness of
6453 DefineDynamicAssembly.
6455 2006-11-08 Raja R Harinath <rharinath@novell.com>
6457 Address parts of #58244 -- most of what's left is in the runtime
6458 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
6459 CS1509 error checks, and handle them for all assembly loads, not
6460 just the first invocation.
6461 (LoadModule): Likewise. Move handling of 'adder_method' ...
6462 * codegen.cs (AssemblyClass.AddModule): ... here.
6464 2006-11-02 Marek Safar <marek.safar@gmail.com>
6466 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
6467 IEnumerable<T> is ambiguous.
6469 2006-10-31 Marek Safar <marek.safar@gmail.com>
6471 A fix for bug #67689
6472 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
6473 GetEnumerator is ambiguous.
6475 * report.cs: Add new warning.
6477 2006-10-29 Marek Safar <marek.safar@gmail.com>
6479 A fix for bug #78602
6480 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6481 to protected member can be nested type.
6483 2006-10-28 Marek Safar <marek.safar@gmail.com>
6485 A fix for bug #78965
6486 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6487 to protected member must derive from current type.
6489 2006-10-27 Marek Safar <marek.safar@gmail.com>
6491 assign.cs: Reuses error method.
6493 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
6494 instead of type for constants.
6495 (Expression.Error_ValueAssignment): Common error method.
6497 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
6500 2006-10-27 Marek Safar <marek.safar@gmail.com>
6502 A fix for bug #79081
6503 * expression.cs (MemberAccess.DoResolve): Check nested type
6506 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
6508 * doc.cs : nested delegates were not handled. Fixed bug #79754.
6510 2006-10-26 Marek Safar <marek.safar@gmail.com>
6512 A fix for bug #76591
6513 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
6515 2006-10-26 Marek Safar <marek.safar@gmail.com>
6517 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
6518 type forwarder of the same type multiple times.
6520 2006-10-26 Raja R Harinath <rharinath@novell.com>
6523 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
6524 instance as an rvalue, even when we later resolve as an lvalue.
6526 2006-10-25 Martin Baulig <martin@ximian.com>
6528 * anonymous.cs: Fix #79673.
6530 2006-10-24 Marek Safar <marek.safar@seznam.cz>
6532 A fix for bug #79666
6533 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
6534 ignored when is optimized (= default value) as its value is already set.
6536 2006-10-23 Marek Safar <marek.safar@seznam.cz>
6538 A fix for bug #79724
6539 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
6540 TypeContainer for type lookup.
6542 2006-10-23 Marek Safar <marek.safar@seznam.cz>
6544 A fix for bug #79231
6545 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
6546 * expression.cs (OverloadResolve): Always convert type name for
6548 (ResolveNamespaceOrType): Don't confuse a nested type with any
6551 2006-10-18 Martin Baulig <martin@ximian.com>
6553 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
6555 2006-10-17 Miguel de Icaza <miguel@novell.com>
6557 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
6558 an int32, but requesting an int64 from the conversion
6560 2006-10-12 Martin Baulig <martin@ximian.com>
6563 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
6565 2006-10-12 Martin Baulig <martin@ximian.com>
6568 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
6570 2006-10-11 Miguel de Icaza <miguel@novell.com>
6572 * convert.cs: Remove broken code: I was doing the "Existance"
6573 tests for Implicit conversions.
6575 2006-10-10 Miguel de Icaza <miguel@novell.com>
6577 * convert.cs: Added one missing case in
6578 ImplicitStandardConversionExists uint64 to intptr.
6582 * typemanager.cs (uintptr_type): another core known type.
6584 * ecore.cs (OperatorCast): routine used to do cast operations that
6585 depend on op_Explicit. We could change some of the Decimal
6586 conversions to use this.
6588 This one has a probe mechanism that checks both types for an op_
6589 which it coudl be used to eliminate two classes: CastToDecimal
6590 and CastFromDecimal.
6592 * convert.cs: Implement the conversions documented in #59800
6594 2006-10-10 Martin Baulig <martin@ximian.com>
6596 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
6597 before RootScope.ResolveMembers().
6599 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
6600 `CurrentType' if appropriate.
6602 2006-10-09 Marek Safar <marek.safar@seznam.cz>
6604 A fix for bug #78568
6605 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
6606 when contains binary operators.
6607 * cs-parser.jay: Updated.
6609 2006-10-09 Martin Baulig <martin@ximian.com>
6612 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
6613 moved that into Define() and also do the other type parameter
6614 checks there. Fixes #79094. Added gtest-292.cs.
6617 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
6618 since that doesn't include type parameters; don't use `Ldelema'
6619 for type parameters. Fixes #78980. Added gtest-293.cs.
6621 2006-10-08 Marek Safar <marek.safar@seznam.cz>
6624 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
6625 conversion is allowed.
6627 2006-10-06 Marek Safar <marek.safar@seznam.cz>
6629 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
6630 error reporting when no error occurs.
6632 2006-10-06 Marek Safar <marek.safar@seznam.cz>
6634 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
6637 2006-10-06 Raja R Harinath <rharinath@novell.com>
6640 * class.cs (DefineTypeBuilder): Check circular dependencies before
6641 setting the parent of the TypeBuilder.
6642 (CheckRecursiveDefinition): Don't use 'BaseType', since
6643 it may not be valid until after DefineTypeBuilder. Use
6644 'base_type' instead.
6646 2006-10-04 Martin Baulig <martin@ximian.com>
6648 Merged the Anonymous Methods patch.
6650 * anonymous.cs, iterators.cs: The new anonymous methods code.
6652 * statement.cs (Variable): New public abstract class.
6653 (LocalInfo.Variable): New public property.
6654 (LocalInfo.ResolveVariable): New public method.
6655 (Block.Flags): Add `IsIterator'.
6656 (Block.AddVariable): Improved the CS0136 check.
6657 (Block.AnonymousChildren): New public property.
6658 (Block.AddAnonymousChild): New public method.
6659 (ToplevelBlock): Update to use the new anonymous method framework.
6660 (ToplevelBlock.ctor): `container' is now a `Block' and not a
6661 `ToplevelBlock'; this is required to correctly implement the
6663 (Fixed, Using): Use `TemporaryVariable' instead of directly
6664 creating the `LocalBuilder'.
6666 * parameter.cs (Parameter.ResolveVariable): New public method.
6667 (Parameters.ResolveVariable): Likewise.
6669 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
6671 * class.cs (TypeContainer): Replaced the `iterators' list and
6672 corresponding methods with a list of `CompilerGeneratedClass'es.
6673 (TypeContainer.ResolveMembers): New public method.
6674 (Method): `IIteratorContainer' has been replaced by
6677 * expression.cs (VariableReference): New public abstract base
6678 class for `LocalVariableReference', `ParameterReference' and
6681 * codegen.cs (EmitContext): Removed `capture_context',
6682 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
6683 (EmitContext.EmitThis): Removed.
6685 * cs-parser.jay: Replace `iterator_container' with
6688 2006-10-04 Martin Baulig <martin@ximian.com>
6690 * generic.cs (GenericMethod): Don't make this abstract.
6691 (Constraints.Clone): Added dummy implementation.
6693 2006-10-04 Raja R Harinath <harinath@gmail.com>
6696 * namespace.cs (LookForAnyGenericType): Avoid nullref on
6697 'declspaces'. Avoid allocating arrays willy-nilly.
6700 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
6701 cases out of the switch.
6703 2006-09-28 Marek Safar <marek.safar@seznam.cz>
6705 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
6706 message when non-generic type is used with the type arguments.
6707 * expression.cs: Updated.
6709 2006-09-28 Raja R Harinath <rharinath@novell.com>
6712 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
6713 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6714 Change semantics slightly. Don't insist on having only one
6715 temporary EmptyExpression -- just throttle the creation of new ones.
6718 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
6719 non-interfaces too. If no methods are found, don't try to create
6722 2006-09-28 Marek Safar <marek.safar@seznam.cz>
6724 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
6727 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
6728 us produce better error message.
6730 2006-09-27 Marek Safar <marek.safar@seznam.cz>
6732 * expression.cs (Binary.ResolveOperator): Warn about a side effect
6733 of the `|' operator.
6735 * report.cs: A new warning added.
6737 2006-09-27 Martin Baulig <martin@ximian.com>
6739 * generic.cs (GenericMethod): Don't make this abstract.
6741 2006-09-27 Martin Baulig <martin@ximian.com>
6744 (InternalErrorException): Added overloaded ctor taking a params array.
6746 2006-09-26 Marek Safar <marek.safar@seznam.cz>
6748 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
6749 Fixed the cases when same error was reported twice.
6751 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
6752 now report symbol information.
6754 2006-09-25 Martin Baulig <martin@ximian.com>
6756 * class.cs: Completely unified with the gmcs version.
6758 2006-09-25 Martin Baulig <martin@ximian.com>
6760 * typemanager.cs (TypeManager.IsNullableType): New public function.
6761 (TypeManager.IsNullableTypeOf): Likewise.
6762 (TypeManager.IsNullableValueType): Likewise.
6764 * class.cs (MethodCore): Added the `GenericMethod' argument from
6765 gmcs and also unified all classes derived from `MethodCore' with gmcs.
6767 2006-09-24 Raja R Harinath <harinath@gmail.com>
6769 * convert.cs: Unify with gmcs version.
6771 2006-09-24 Marek Safar <marek.safar@seznam.cz>
6773 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
6774 verify them as well.
6776 * report.cs: New warning.
6778 2006-09-24 Marek Safar <marek.safar@seznam.cz>
6780 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
6781 for anonymous block with out argument.
6783 2006-09-24 Marek Safar <marek.safar@seznam.cz>
6785 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
6786 not used private events only.
6788 2006-09-23 Marek Safar <marek.safar@seznam.cz>
6790 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
6792 * const.cs (Const.Define): Check for constant type.
6793 (Const.IsConstantTypeValid): Looks for valid constant types.
6795 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
6797 * ecore.cs (EmptyConstantCast): New common class for all constant based
6800 * expression.cs (Is.DoResolve): Handle null constant especially.
6801 (New.DoResolve): Check for new void().
6802 (MemberAccess.DoResolve): Cope with all kind of nulls.
6804 * literal.cs (NullConstant): Uses EmptyConstantCast.
6805 (NullDefault): Based on EmptyConstantCast.
6806 (NullLiteral): Uses EmptyConstantCast.
6808 * statement.cs (Block.ResolveMeta): Check for constant type.
6810 2006-09-22 Martin Baulig <martin@ximian.com>
6812 * delegate.cs, attribute.cs: Merged with the gmcs versions.
6814 2006-09-22 Raja R Harinath <rharinath@novell.com>
6816 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
6820 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
6821 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
6824 2006-09-22 Martin Baulig <martin@ximian.com>
6826 * ecore.cs: Merged with the gmcs version.
6828 * generic.cs (ConstructedType): New dummy class.
6829 (TypeArguments): Don't make this abstract.
6832 (TypeManager.IsGenericTypeDefinition): New method.
6833 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
6835 2006-09-22 Raja R Harinath <rharinath@novell.com>
6837 * expression.cs (ComposedCast): Check for arrays of TypedReference
6838 before creating the type, not after.
6840 2006-09-21 Marek Safar <marek.safar@seznam.cz>
6842 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
6843 after ToType change.
6845 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
6846 when constant must be implicitly convertible.
6848 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
6850 * ecore.cs (NullCast): Derives from NullConstant.
6852 * expression.cs (Is.DoResolve): Removed useless variables.
6853 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
6854 (New.Constantify): Add enum support.
6855 (MemberAccess.DoResolve): Add warning when accessing null constant or
6858 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
6861 * literal.cs (NullConstant): New abstract class with common
6862 functionality for all null specializations.
6863 (NullDefault): Represents default(X) when result can be
6865 (NullLiteral): Updated.
6867 * report.cs: Add new warning.
6869 2006-09-21 Martin Baulig <martin@ximian.com>
6871 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
6873 2006-09-21 Martin Baulig <martin@ximian.com>
6875 * generic.cs (GenericConstraints): New dummy class.
6876 (Constraints): Likewise.
6877 (TypeParameter): Likewise.
6878 (TypeParameterName): Likewise.
6879 (GenericMethod): Likewise.
6881 * typemanager.cs (TypeManager.GetGenericArguments): New method.
6883 * decl.cs: Merged with the gmcs version.
6885 2006-09-21 Raja R Harinath <rharinath@novell.com>
6887 * generic.cs (TypeParameter): Implement IMemberContainer.
6888 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
6890 * rootcontext.cs: Unify with gmcs version.
6892 * report.cs: Unify with gmcs version.
6893 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
6894 from gmcs/generics.cs.
6895 * generics.cs (TypeParameter): New dummy class.
6897 * support.cs: Unify with gmcs version.
6899 2006-09-20 Raja R Harinath <rharinath@novell.com>
6901 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
6902 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
6904 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
6905 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
6906 * mcs.exe.sources: Add generic.cs.
6908 * codegen.cs: Unify with gmcs version.
6910 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
6911 (EmitContext): Add GenericDeclContainer implementation.
6912 * decl.cs (MemberCore, DeclSpace): Likewise.
6913 * namespace.cs: Remove #ifdef GMCS_SOURCE.
6915 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
6916 MCS TypeManager has a corresponding dummy method.
6918 2006-09-19 Martin Baulig <martin@ximian.com>
6920 * expression.cs: Completely merged with the gmcs version.
6922 2006-09-19 Martin Baulig <martin@ximian.com>
6924 * expression.cs (Invocation): Merged with the gmcs version.
6925 (ArrayAccess.GetStoreOpcode): Likewise.
6927 2006-09-19 Martin Baulig <martin@ximian.com>
6930 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
6931 (TypeManager.IsGenericMethodDefinition): Likewise.
6933 2006-09-19 Martin Baulig <martin@ximian.com>
6936 (TypeManager.IsEqual): Moved the gmcs implementation here.
6937 (TypeManager.DropGenericTypeArguments): Likewise.
6938 (TypeManager.DropGenericMethodArguments): Likewise.
6939 (TypeManager.GetTypeArguments): Moved here from gmcs.
6940 (TypeManager.HasGenericArguments): Likewise.
6942 2006-09-19 Martin Baulig <martin@ximian.com>
6944 * expression.cs (Binary): Merged with the gmcs version.
6946 2006-09-19 Martin Baulig <martin@ximian.com>
6948 * expression.cs (Probe, As, Is): Merged with the gmcs version.
6950 2006-09-19 Martin Baulig <martin@ximian.com>
6952 * typemanager.cs: Merged with the gmcs version.
6954 2006-09-16 Raja R Harinath <rharinath@novell.com>
6956 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
6957 * driver.cs: Likewise.
6959 2006-09-16 Marek Safar <marek.safar@seznam.cz>
6962 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
6963 only if parent type is class.
6964 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
6967 2006-09-15 Marek Safar <marek.safar@seznam.cz>
6970 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
6972 * typemanager.cs(CSharpName): Converts NullType to null.
6974 2006-09-15 Martin Baulig <martin@ximian.com>
6977 (TypeManager.GetMethodName): Added mcs implementation.
6978 (TypeManager.IsEqual): Likewise.
6981 (SimpleName.RemoveGenericArity): Added dummy implementation.
6983 * pending.cs: Merged with the gmcs version.
6985 2006-09-15 Martin Baulig <martin@ximian.com>
6987 * statement.cs: Merge with the gmcs version.
6989 2006-09-15 Martin Baulig <martin@ximian.com>
6991 * statement.cs (Switch): Merge with the gmcs implementation
6992 (without nullables), which is newer.
6994 2006-09-15 Martin Baulig <martin@ximian.com>
6996 * statement.cs (Block.Variables): Make this public.
6997 (ToplevelBlock.Parameters): Make this a property.
6998 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7000 2006-09-15 Martin Baulig <martin@ximian.com>
7002 * namespace.cs: Merge with the gmcs version.
7004 2006-09-15 Martin Baulig <martin@ximian.com>
7006 * decl.cs (MemberName): Minor code cleanups.
7008 2006-09-15 Martin Baulig <martin@ximian.com>
7010 * parameter.cs: Merge with the gmcs version.
7012 2006-09-15 Martin Baulig <martin@ximian.com>
7014 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7015 and an error in mcs.
7017 2006-09-15 Martin Baulig <martin@ximian.com>
7019 * flowanalysis.cs: Merged from GMCS; added the generics code into
7020 a `GMCS_SOURCE' conditional so we can share this file.
7022 2006-09-08 Martin Baulig <martin@ximian.com>
7024 * typemanager.cs (TypeManager.interlocked_type): New public field.
7025 (TypeManager.int_interlocked_compare-exchange): New public field.
7026 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7027 enumerator types here and call InitGenericCoreTypes().
7028 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7029 after calling InitEnumUnderlyingTypes().
7032 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7033 `classes_second_stage'.
7035 2006-09-14 Marek Safar <marek.safar@seznam.cz>
7037 * assign.cs, ecore.cs, expression.cs: Share error message text.
7038 * class.cs (FieldMember.Define): Check for varible of static type.
7039 * driver.cs (LoadAssembly): Uses error output for errors.
7040 * statement.cs: Updated.
7042 2006-09-08 Marek Safar <marek.safar@seznam.cz>
7044 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7047 2006-09-07 Martin Baulig <martin@ximian.com>
7050 (MainDriver): Revert r62663 from Marek; see #70506 for details.
7052 2006-08-29 Miguel de Icaza <miguel@novell.com>
7054 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7056 2006-08-17 Miguel de Icaza <miguel@novell.com>
7058 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7059 #52019 and #79064, the use of the \uXXXX sequence in source code
7060 to represent unicode characters.
7062 2006-08-15 Marek Safar <marek.safar@seznam.cz>
7064 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7066 * class.cs, ecore.cs, statement.cs: Merged to one error message.
7068 2006-08-13 Miguel de Icaza <miguel@novell.com>
7070 * assign.cs: Catch attempts to assign to a method groups in += and
7073 2006-08-13 Marek Safar <marek.safar@seznam.cz>
7076 * cs-parser.jay: Don't destroy current array type by typeof of array's.
7078 2006-08-12 Marek Safar <marek.safar@seznam.cz>
7080 * class.cs (Method.Define): Issue a warning when generic method looks like
7082 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7085 2006-08-09 Marek Safar <marek.safar@seznam.cz>
7087 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7089 * decl.cs (MemberCache.FindMembers): When container is interface we need to
7090 search all base interfaces as a member can be ambiguous.
7091 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7092 Constructor member type filter.
7093 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7094 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7095 reporting for returned memberinfos.
7096 * report.cs: Updated.
7097 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7098 version to work on all runtimes.
7099 (TypeManager.RealMemberLookup): Removed members filtering.
7101 2006-08-08 Raja R Harinath <rharinath@novell.com>
7103 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7104 (PropertyExpr.EmitAssign): Likewise.
7105 * expression.cs (Indirection.EmitAssign): Likewise.
7106 (LocalVariableReference.EmitAssign): Likewise.
7107 (ParameterReference.EmitAssign): Likewise.
7108 (Invocation.EmitArguments): Likewise.
7109 (ArrayAccess.EmitAssign): Likewise.
7110 (IndexerAccess.EmitAssign): Likewise.
7111 (This.EmitAssign): Likewise.
7112 (ConditionalLogicalOperator.Emit): Likewise.
7115 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
7116 instead of ArrayList. If the hashtable has a LocalBuilder, don't
7117 leave it in after returning it.
7118 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
7120 2006-08-06 Marek Safar <marek.safar@seznam.cz>
7122 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7125 2006-08-03 Raja R Harinath <rharinath@novell.com>
7127 Fix cs0146-3.cs and cs0146-4.cs.
7128 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7129 enclosing types don't depend on the current type.
7131 2006-08-02 Raja R Harinath <rharinath@novell.com>
7134 * class.cs (TypeContainer.DoDefineMembers): Use
7135 FindBaseMemberWithSameName on Parent, since we're interested in
7136 whether we hide inherited members or not.
7137 (FindBaseMemberWithSameName): Make slightly more robust.
7139 Fix the non-generic testcase from #77396
7140 * decl.cs (DeclSpace.DeclContainer): Remove override.
7142 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7143 declspaces for doppelgangers too.
7144 (UsingEntry): Implement IResolveContext.
7145 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
7146 'this' as the resolve context.
7147 (LocalAliasEntry): Likewise.
7149 Implement parts of #77403
7150 * roottypes.cs (RootDeclSpace): New. Used to represent the
7151 toplevel declaration space. Each namespace declaration introduces
7152 a "partial" root declaretion space.
7153 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7154 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7155 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7156 from 'current_namespace.SlaveDeclSpace'.
7157 (namespace_declaration): Likewise.
7158 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7159 check. It can't happen now.
7160 * decl.cs (DeclSpace.LookupType): Likewise.
7161 * driver.cs (MainDriver): Sanity check.
7163 2006-08-01 Raja R Harinath <rharinath@novell.com>
7165 * decl.cs (DeclSpace.FindNestedType): Remove.
7166 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7167 LookupTypeContainer to get the container of the nested type.
7168 * class.cs (TypeContainer.FindNestedType): Make non-override.
7170 2006-07-31 Raja R Harinath <rharinath@novell.com>
7172 * decl.cs (DeclSpace.PartialContainer): Move field from ...
7173 * class.cs (TypeContainer.PartialContainer): ... here.
7174 (TypeContainer.AddBasesForPart): New helper.
7175 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
7177 * cs-parser.jay (current_class): Convert to DeclSpace.
7178 (struct_declaration, interface_declaration, class_declaration):
7179 Use AddBasesForPart instead of .Bases directly.
7180 * const.cs, iterators.cs: Update to changes.
7182 2006-07-28 Raja R Harinath <rharinath@novell.com>
7184 * class.cs (TypeContainer.AddMemberType): Rename from
7186 (TypeContainer.AddMember): Rename from AddToMemberContainer.
7187 (AddTypeContainer): New. Combine AddClassOrStruct and
7189 (AddPartial): Update. Add 'is_partial' argument.
7190 * roottypes.cs: Update to changes.
7191 * cs-parser.jay (push_current_class): New helper for handling
7192 current_container and current_class.
7193 (struct_declaration, interface_declaration, class_declaration):
7196 2006-07-26 Raja R Harinath <rharinath@novell.com>
7198 * roottypes.cs: Rename from tree.cs.
7200 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7201 * tree.cs (Tree, ITreeDump): Remove types.
7202 * rootcontext.cs (tree, Tree): Remove fields.
7203 (root, ToplevelTypes): New.
7204 * *.cs: Update to rename.
7206 * tree.cs (Tree.RecordDecl): Remove.
7207 (RootTypes.AddToTypeContainer): Record the toplevel type in its
7209 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7211 2006-07-23 Raja R Harinath <harinath@gmail.com>
7213 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7214 DoFlowAnalysis and OmitStructFlowAnalysis here.
7215 (ec.With): Rename from WithUnsafe and generalize.
7216 (ec.WithCheckState): Remove. All users can be handled by 'With'.
7217 (ec.WithFlowAnalyis): New.
7218 * ecore.cs, expression.cs, statement.cs: Update.
7220 2006-07-22 Raja R Harinath <harinath@gmail.com>
7222 * statement.cs (Block.ResolveMeta): Simplify slightly.
7224 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
7225 multiple boolean fields. Convert InUnsafe, constant_check_state,
7226 check_state to flags.
7227 (CheckState, ConstantCheckState): Update.
7228 (InUnsafe): New read-only property.
7229 (FlagsHandle): Rename from CheckStateHandle and convert to handle
7231 (WithUnsafe): New helper similar to WithCheckState.
7232 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7233 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7235 2006-07-21 Raja R Harinath <rharinath@novell.com>
7237 Make comparisons use the same IL irrespective of whether they're
7238 in a 'checked' or 'unchecked' context: one of the issues in #78899
7239 * codegen.cs (EmitContext.CheckState): Make read-only property.
7240 (EmitContext.ConstantCheckState): Likewise.
7241 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7242 helper that implement a save/restore stack for CheckState
7243 values. This is the only way to change check-state.
7244 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7245 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7246 (CheckedExpr.EmitBranchable): New forwarding method.
7247 (UnCheckedExpr): Likewise.
7248 * statement.cs (Block.ResolveMeta): Use WithCheckState.
7249 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7250 (Checked.Resolve, checked.DoEmit): Likewise.
7252 2006-07-20 Miguel de Icaza <miguel@novell.com>
7254 * anonymous.cs: Cache the resolved anonymous delegate, and return
7255 this so that the ResolveTopBlock is only triggered once, not
7258 Currently we trigger ResolvetopBlock twice due to a first pass of
7259 argument check compatibility, and a second pass that does the
7262 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7264 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7266 * rootcontext.cs (Reset): Add helper_classes.
7268 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7271 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7274 2006-07-13 Miguel de Icaza <miguel@novell.com>
7276 * statement.cs (Lock): Handle expressions of type
7277 TypeManager.null_type specially. Fixes #78770
7279 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7281 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7284 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7286 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7287 for accessors as well.
7288 * ecore.cs (EventExpr): Add AccessorTable.
7290 2006-07-01 Marek Safar <marek.safar@seznam.cz>
7293 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7294 for CS0122 where appropriate.
7295 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7297 (Filter): Assembly can be null in the case of top level attributes.
7299 2006-06-25 Marek Safar <marek.safar@seznam.cz>
7303 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7304 is done at global level.
7306 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7308 A fix for #77002, Implemented TypeForwarder support.
7310 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7311 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7312 * typemanager.cs (): Add type_forwarder_attr_type.
7314 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7316 * report.cs: Add CS0469 warning.
7318 2006-06-21 Martin Baulig <martin@ximian.com>
7320 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7321 the `try'-block, so we also report CS0016 etc. there.
7323 2006-06-21 Martin Baulig <martin@ximian.com>
7326 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
7328 2006-06-21 Martin Baulig <martin@ximian.com>
7330 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
7331 also report CS1686 for parameters.
7333 2006-06-21 Martin Baulig <martin@ximian.com>
7335 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
7336 instead of an error if the value is not implicitly convertible to
7337 the switch types; fixes #77964.
7339 2006-06-21 Raja R Harinath <rharinath@novell.com>
7342 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
7343 FieldBuilder is null.
7346 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
7347 'left' and 'right' before error-checking.
7349 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
7351 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
7353 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
7354 (FieldExpr.DoResolve): likewise.
7355 (PropertyExpr.InstanceResolve): likewise.
7356 (EventExpr.InstanceResolve): likewise.
7358 2006-06-04 Marek Safar <marek.safar@seznam.cz>
7360 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
7361 attribute applicable tests for attribute argument.
7363 2006-06-02 Raja R Harinath <rharinath@novell.com>
7366 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
7367 (Binary.OverloadResolve_PredefinedIntegral): New.
7368 (Binary.OverloadResolve_PredefinedFloating): New.
7369 (Binary.OverloadResolve_PredefinedString): New.
7370 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
7371 Follow the standard more closely, and treat numeric promotions in
7372 terms of overload resolution.
7373 (Binary.CheckShiftArguments): Simplify.
7375 2006-06-01 Raja R Harinath <rharinath@novell.com>
7377 * flowanalysis.cs (MyBitVector): Simplify representation.
7378 (MyBitVector.Clone): Avoid allocating BitArray.
7379 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
7380 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
7381 (*): Update. Change all references to MyBitVector.And and
7382 MyBitVector.Or to &= and |=.
7384 2006-05-29 Raja R Harinath <rharinath@novell.com>
7387 * cs-parser.jay (formal_parameter_list): Extend the pattern below
7388 to param arguments too.
7390 2006-05-26 Miguel de Icaza <miguel@novell.com>
7392 * cs-parser.jay: Catch another parsing form for arglist being
7393 followed by other arguments. Fixes #78313.
7395 2006-05-24 Raja R Harinath <rharinath@novell.com>
7397 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
7398 checking of out parameters to ...
7399 (FlowBranchingToplevel.Merge): ... here.
7400 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
7401 set, propagate the origin upward, and only complain if there was
7403 (FlowBranchingException.AddContinueOrigin): Likewise.
7404 (FlowBranchingException.AddReturnOrigin): Likewise.
7405 (FlowBranchingException.AddGotoOrigin): Likewise.
7407 2006-05-23 Raja R Harinath <rharinath@novell.com>
7409 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
7410 unreachable, skip it.
7411 (FlowBranchingException.Merge): Always propagate jumps, even if
7412 the finally block renders subsequent code unreachable.
7414 2006-05-18 Raja R Harinath <rharinath@novell.com>
7417 * statement.cs (Goto.Resolve): Move responsibility for resolving
7418 'goto' to FlowBranching.AddGotoOrigin.
7419 (Goto.SetResolvedTarget): New. Callback to set the
7420 LabeledStatement that's the target of the goto.
7421 (Goto.DoEmit): Use Leave instead of Br when crossing an
7422 unwind-protect boundary.
7423 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
7424 LookupLabel and adjust to new semantics.
7425 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
7426 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
7427 Goto.SetResolvedTarget to update target.
7428 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
7429 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
7430 AddBreakOrigin & co. Delay propagation until ...
7431 (FlowBranchingException.Merge): ... this.
7433 * statement.cs (Block.Resolve): Always depend on flow-branching to
7434 determine unreachability. Kill workaround that originally emitted
7435 only one statement after an "unreachable" label (see infloop in
7438 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
7439 This is still "wrong", but anything better would probably need a
7440 multi-pass algorithm.
7441 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
7442 usage vector. Force current usage vector to be reachable, to
7443 optimistically signify backward jumps.
7444 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
7446 (FlowBranchingLabeled.Merge): New. If no backward jump was
7447 detected, return the original salted-away usage vector instead,
7448 updated with appropriate changes. Print unreachable warning if
7450 * statement.cs (Block.Resolve): Don't print unreachable warning on
7451 a labeled statement.
7453 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
7455 * driver.cs: Pass filename without path to AssemblyBuilder's
7456 AddResourceFile. Fixes bug #78407.
7458 2006-05-17 Raja R Harinath <rharinath@novell.com>
7460 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
7461 * flowanalysis.cs (FlowBranchingLabeled): ... here.
7462 (FlowBranching.MergeChild): Overwrite
7463 reachability information from Labeled branchings too.
7465 2006-05-16 Raja R Harinath <rharinath@novell.com>
7467 * statement.cs (Goto.Resolve): Merge jump origins here ...
7468 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
7470 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
7471 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
7472 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
7473 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
7475 * statement.cs (Goto.Resolve): ... not here.
7476 (Goto.Emit): Remove CS1632 check.
7478 2006-05-14 Marek Safar <marek.safar@seznam.cz>
7480 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
7483 2006-05-11 Raja R Harinath <rharinath@novell.com>
7485 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
7486 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
7487 (FlowBranchingException.Label): Likewise.
7489 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
7491 (MyBitVector.Or): Use it to avoid losing information (Count).
7492 (FlowBranching.MergeOrigins): Likewise.
7494 * flowanalysis.cs (UsageVector.IsDirty): Remove.
7495 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
7496 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
7497 (UsageVector.ToString): Simplify.
7498 (UsageVector.MergeSiblings): Move here from ...
7499 (FlowBranching.Merge): ... here.
7500 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
7503 2006-05-10 Raja R Harinath <rharinath@novell.com>
7505 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
7506 null bitvector is treated as all-true.
7508 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
7509 (MyBitVector): Rationalize invariants. 'vector != null' implies
7510 that we have our own copy of the bitvector. Otherwise,
7511 'InheritsFrom == null' implies all inherited bits are true.
7513 2006-05-09 Marek Safar <marek.safar@seznam.cz>
7515 * statement.cs (LocalInfo): Add IsConstant.
7516 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
7517 local variable for constants.
7519 2006-05-09 Raja R Harinath <rharinath@novell.com>
7521 * flowanalysis.cs (MyBitVector.Empty): New.
7522 (MyBitVector): Don't allow InheritedFrom to be null.
7523 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
7524 (UsageVector, FlowBranching): Update to changes.
7526 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
7527 recursion. The 'Parent == null' condition isn't sufficient for
7529 (FlowBranching.AddBreakOrigin): Likewise.
7530 (FlowBranching.AddContinueOrigin): Likewise.
7531 (FlowBranching.AddReturnOrigin): Likewise.
7532 (FlowBranching.StealFinallyClauses): Likewise.
7533 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
7534 (FlowBranching.CheckOutParameters): Likewise.
7535 (FlowBranchingToplevel): Terminate all the above recursions here.
7536 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
7537 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
7539 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
7541 (FlowBranchingToplevel): New. Empty for now.
7542 (FlowBranching.MergeTopBlock): Update.
7543 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
7544 branching for the anonymous delegate.
7545 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
7547 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
7548 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
7549 information at the start of the merge. Reorganize.
7551 2006-05-07 Marek Safar <marek.safar@seznam.cz>
7553 * class.cs (MethodData.Define): Method cannot implement interface accessor.
7555 2006-05-07 Marek Safar <marek.safar@seznam.cz>
7557 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
7558 to newly introduced ctor.
7560 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
7561 message to one place.
7562 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
7565 2006-05-07 Marek Safar <marek.safar@seznam.cz>
7567 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
7569 * ecore.cs (Expression.ResolveAsConstant): Updated.
7571 * statement.cs (ResolveMeta): Updated.
7573 2006-05-06 Marek Safar <marek.safar@seznam.cz>
7575 * cs-parser.jay: __arglist cannot be used in initializer.
7577 2006-05-06 Marek Safar <marek.safar@seznam.cz>
7580 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
7583 2006-05-05 Raja R Harinath <rharinath@novell.com>
7585 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
7586 (LabeledStatement): Add 'name' parameter.
7587 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
7588 (Block.AddLabel): Update to changes.
7589 * cs-parser.jay (labeled_statement): Likewise.
7591 * flowanalysis.cs (BranchingType.Labeled): New.
7592 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
7593 (FlowBranchingLabeled): New. Does nothing for now, but will
7594 eventually handle 'goto' flows.
7595 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
7596 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
7597 that's terminated ...
7598 (Block.Resolve): ... here.
7600 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
7601 (UsageVector.MergeFinallyOrigins): Likewise.
7602 (FlowBranching.InTryOrCatch): Likewise.
7603 (FlowBranching.AddFinallyVector): Likewise.
7604 (FlowBranchingException): Update to changes.
7607 * statement.cs (Return.Resolve): Move error checking to ...
7608 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
7609 (FlowBranchingException): Handle return origins like break and
7611 (FlowBranching.UsageVector.CheckOutParameters): Remove.
7613 2006-05-04 Marek Safar <marek.safar@seznam.cz>
7616 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
7619 2006-05-04 Marek Safar <marek.safar@seznam.cz>
7622 * class.cs (MethodData.Define): Do public accessor check only when method
7623 implements an interface.
7625 2006-05-04 Raja R Harinath <rharinath@novell.com>
7627 Remove special handling of 'break'
7628 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
7629 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
7630 (UsageVector.Break): Remove.
7631 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
7633 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
7635 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
7636 UsageVector.Breaks (). Don't set NeedsReturnLabel.
7638 2006-05-03 Marek Safar <marek.safar@seznam.cz>
7641 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
7642 be the interface member.
7644 2006-05-03 Marek Safar <marek.safar@seznam.cz>
7647 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
7648 for emitting small (int) values.
7650 2006-05-03 Raja R Harinath <rharinath@novell.com>
7653 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
7654 control-flow passes through the 'finally' after merging-in all the
7655 control-flows from 'try' and the 'catch' clauses.
7657 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
7658 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
7659 always true at the only non-recursive entry point.
7660 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
7661 FlowBranchingBreakable.
7662 (FlowBranchingLoop): Remove.
7663 * statement.cs (Return.DoResolve): Update to changes.
7666 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
7667 (FlowBranching.CreateBranching): Handle it: create a
7668 FlowBranchingContinuable.
7669 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
7670 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
7671 except that it handles the 'continue' command.
7672 (FlowBranching.UsageVector.MergeOrigins): Rename from
7674 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
7675 except that it overrides AddContinueOrigin.
7676 (FlowBranchingException): Override AddContinueOrigin, similar to
7678 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
7679 Create a new branching around the embedded statement.
7680 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
7681 control flow after the embedded statement.
7682 (Continue.Resolve): Move all error checking to AddContinueOrigin.
7684 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
7685 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
7686 FlowBranchingBreakable.
7687 (FlowBranchingSwitch): Remove.
7690 * statement.cs (Break.Resolve): Simplify. Move responsibility for
7691 error reporting to ...
7692 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
7693 Rename from 'AddBreakVector'. Add new location argument. Return
7694 a bool indicating whether the 'break' crosses an unwind-protect.
7695 (FlowBranchingException.AddBreakOrigin): Add.
7696 (FlowBranchingException.Merge): Propagate 'break's to surrounding
7697 flowbranching after updating with the effects of the 'finally'
7699 (FlowBranchingBreakable): New common base class for
7700 FlowBranchingLoop and FlowBranchingSwitch.
7702 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
7704 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
7706 2006-05-02 Raja R Harinath <rharinath@novell.com>
7708 * statement.cs (Do.Resolve): If the loop is infinite, set the
7710 (While.Resolve, For.Resolve): Set a barrier after the embedded
7711 statement. There's no direct control flow that goes from the end
7712 of the embedded statement to the end of the loop.
7713 * flowanalysis.cs (FlowBranching.Infinite): Remove.
7714 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
7715 above ensure that the reachability is correctly computed.
7717 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
7718 (UsageVector.MergeBreakOrigins): If the current path is
7719 unreachable, treat it as if all parameters/locals are initialized.
7720 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
7721 infinite loops before merging-in break origins.
7723 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
7724 (Reachability.Reachable): Split part into ...
7725 (Reachability.Unreachable): ... this. Simplify.
7726 (Reachability.IsUnreachable): Use 'Unreachable' instead.
7728 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
7729 (Reachability.SetThrowsSometimes): Likewise.
7730 (FlowBranchingBlock.MergeTopBlock): Don't compare against
7731 TriState.Always, use corresponding property.
7732 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
7733 (Block.Resolve): Likewise. Remove some redundant checks.
7735 2006-05-02 Raja R Harinath <harinath@gmail.com>
7737 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
7738 (Reachability.Meet): Don't bother checking AlwaysThrows --
7739 barrier is always set.
7740 (FlowBranchingBlock.Merge): Likewise.
7742 2006-05-01 Raja R Harinath <harinath@gmail.com>
7744 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
7745 checks for unreachable.
7747 2006-05-01 Marek Safar <marek.safar@seznam.cz>
7750 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
7752 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
7753 whether field is really assigned.
7755 2006-04-30 Raja R Harinath <harinath@gmail.com>
7757 * flowanalysis.cs (Reachability): Make 4-argument constructor
7759 (Reachability.Meet): Rename from 'And'. Remove static variant.
7760 (Reachability.Always): Rename from the highly misleading
7761 'Reachability.Never'.
7762 (FlowBranching.Merge): Update to changes. Mark an impossible
7763 situation with a 'throw'.
7764 (*): Update to changes.
7766 2006-04-29 Raja R Harinath <harinath@gmail.com>
7768 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
7770 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
7771 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
7772 (*): Update to changes.
7773 * statement.cs: Update to changes.
7775 2006-04-28 Marek Safar <marek.safar@seznam.cz>
7778 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
7780 2006-04-28 Raja R Harinath <harinath@gmail.com>
7782 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
7785 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
7786 argument to two arguments: an usage-vector and a bool. Move call
7787 to FlowBranching.Merge () ...
7788 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
7790 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
7791 handling of loop and switch reachability to ...
7792 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
7794 2006-04-27 Raja R Harinath <harinath@gmail.com>
7796 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
7797 handling to FlowBranchingLoop.InLoop.
7798 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
7800 2006-04-26 Marek Safar <marek.safar@seznam.cz>
7803 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
7804 anonymous method is allowed from AnonymousContainer here.
7806 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
7808 2006-04-24 Raja R Harinath <rharinath@novell.com>
7811 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
7813 2006-04-23 Marek Safar <marek.safar@seznam.cz>
7816 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
7817 (DoubleConstant.Reduce): Ditto.
7819 2006-04-23 Raja R Harinath <rharinath@novell.com>
7821 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
7822 Remove 'lvalue_right_side' argument. Move parts to ...
7823 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
7824 (LocalVariable.DoResolveLValue): ... these.
7826 2006-04-21 Raja R Harinath <rharinath@novell.com>
7829 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
7830 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
7831 (LocalVariableReference.DoResolveBase): Use it to implement new
7833 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
7834 (Argument.Resolve): Simplify. Move CS1510 check ...
7835 * ecore.cs (Expression.ResolveLValue): ... here.
7836 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
7837 (PropertyExpr.DoResolveLValue): Likewise.
7838 (FieldExpr.Report_AssignToReadonly): Likewise.
7839 (FieldExpr.DoResolve): Add 'out_access' argument. Use
7840 LValueMemberAccess or LValueMemberOutAccess on instance depending
7842 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
7843 DoResolve as appropriate.
7845 2006-04-20 Raja R Harinath <rharinath@novell.com>
7848 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
7849 implicit conversions on 'out' and 'ref' arguments.
7851 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
7852 improve clarity. Remove dead code.
7855 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
7856 (Catch.Resolve): Resolve VarBlock if it exists.
7858 2006-04-19 Miguel de Icaza <miguel@novell.com>
7860 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
7861 twice, this was some residual code, the enumerator was emitted
7862 properly in the two branche of if later.
7864 2006-04-19 Raja R Harinath <rharinath@novell.com>
7866 * expression.cs (Cast.ResolveLValue): Remove. The result of a
7867 cast is never an lvalue.
7868 (Cast.DoResolve, Cast.ResolveRest): Combine.
7869 (Argument.Emit): Simplify slightly. Move 'Expr is
7870 IMemoryLocation' check ...
7871 (Argument.Resolve): ... here.
7872 (Argument.Error_LValueRequired): Remove. Inline into only user.
7874 Simplifications. Fix cs0191-2.cs
7875 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
7876 CS1649 and CS1651 to ...
7877 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
7878 the actual selection of the error code and message to a lookup
7879 table. Add a dummy return value to simplify callsites.
7880 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
7881 readonly fields of other instances of the same type. Move CS0197
7883 * expression.cs (Argument.Resolve): ... here. Simplify code.
7884 Ensure that ec.InRefOutArgumentResolving is only set during LValue
7885 resolution of an out or ref argument. The code simplification
7886 above uses this invariant.
7888 2006-04-18 Raja R Harinath <rharinath@novell.com>
7890 Possibly fix #77752. Fix cs1690-[4-7].cs.
7891 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
7892 CheckMarshallByRefAccess. Drop parameter.
7893 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
7895 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
7897 * report.cs (AllWarnings): Add CS1690.
7898 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
7900 (LocalVariableReference.DoResolveBase): Update.
7902 2006-04-09 Marek Safar <marek.safar@seznam.cz>
7904 * class.cs (MethodOrOperator): Moved common parts from method class.
7905 detect obsolete attributes.
7906 (Method.Define): Simplified as it reuses code from base.
7907 (Constructor.ValidAttributeTargets): Fixed issue found during
7909 (Destructor.ValidAttributeTargets): Fixed issue found during
7911 (Operator): Finished refactoring set off by #78020. Operator class is now
7912 ordinary method class.
7914 * anonymous.cs: Updated.
7916 * decl.cs (DeclSpace): Add IsGeneric
7918 2006-04-09 Marek Safar <marek.safar@seznam.cz>
7920 * class.cs (Constructor.Emit): Don't emit the attributes twice.
7922 2006-04-09 Marek Safar <marek.safar@seznam.cz>
7924 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
7925 detect obsolete attributes.
7926 (Method.CreateEmitContext): Moved to MethodOrOperator.
7928 2006-04-09 Marek Safar <marek.safar@seznam.cz>
7931 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
7932 customized exception to make crash detection easier.
7933 (MethodOrOperator): Started to work on new base class for methods and
7935 (Method): Derives from MethodOrOperator.
7936 (Constructor.Emit): Emits its own attributes.
7937 (AbstractPropertyEventMethod.Emit): Ditto.
7938 (Operator): Derives from MethodOrOperator, will refactor fully in extra
7940 (Operator.Emit): It's temporary more tricky than should be.
7942 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
7944 * report.cs (InternalErrorException): Add ctor with inner exception.
7946 2006-04-08 Marek Safar <marek.safar@seznam.cz>
7949 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
7952 2006-04-07 Marek Safar <marek.safar@seznam.cz>
7955 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
7958 2006-04-06 Marek Safar <marek.safar@seznam.cz>
7960 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
7961 attribute is present and Guid not.
7962 (Interface.ApplyAttributeBuilder): Ditto.
7964 * attribute.cs: Add error message.
7966 2006-04-06 Marek Safar <marek.safar@seznam.cz>
7970 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
7971 sources (it's composite) so hold them in extra array as they are used in
7972 Emit phase only. It worked in the previous versions by mistake.
7973 (Attribute.Emit): Emit attribute for more owners when exist.
7975 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
7976 it has now different behaviour.
7978 2006-04-04 Marek Safar <marek.safar@seznam.cz>
7980 * constant.cs (Constant.IsDefaultInitializer): New method.
7982 * class.cs: Updated.
7984 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
7985 re-initialize default values. It saves KBs almost for every assembly.
7986 Thanks Zoltan for the idea.
7987 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
7988 (ArrayCreation.DoResolve): Resolve only once.
7989 (ArrayCreation.Emit): Emit static initializer only when it is faster.
7990 (ArrayCreation.GetAttributableValue): Cope with optimized values.
7992 2006-04-03 Zoltan Varga <vargaz@gmail.com>
7994 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
7997 2006-04-01 Marek Safar <marek.safar@seznam.cz>
7999 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8000 in an embedded statement too.
8002 2006-04-01 Raja R Harinath <rharinath@novell.com>
8005 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8007 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8011 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8014 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8016 2006-03-31 Marek Safar <marek.safar@seznam.cz>
8018 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8021 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8022 LocalTemporary change.
8024 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8026 (ClassOrStruct.DefineFieldInitializers): Implemented static field
8027 initializers optimization.
8028 (ClassOrStruct.TypeAttr): Moved from modifiers.
8029 (Constructor.CheckBase): Don't crash when static ctor has parameters.
8030 (FieldBase.ResolveInitializer): Resolves initializer.
8031 (FieldBase.HasDefaultInitializer): New property.
8033 * cs-parser.jay: Removed message.
8035 * expression.cs (CompilerGeneratedThis): New specialization.
8037 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8039 2006-03-28 Marek Safar <marek.safar@seznam.cz>
8041 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8043 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8045 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8046 be now EnumConstants only.
8048 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8050 * attribute.cs, driver.cs: Reset more caches.
8052 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8054 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8056 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8058 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8059 for easier reuse. Updated all overrides.
8060 (IntegralConstant): New base class for all integral constants.
8061 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8062 of the constant range, report custom error.
8063 (UIntConstant.Reduce): Fixed uint conversion.
8065 * ecore.cs, literal.cs: Reduce updates.
8067 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8071 * class.cs (Constructor.Define): Removed extra if for default ctors.
8072 A patch from Atsushi Enomoto.
8074 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8076 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8077 GetAttributableValue.
8079 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8082 * convert.cs (ImplicitConversionRequired): Error message moved to
8085 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8086 automatic implicit conversion of an output value.
8087 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8089 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8091 (TypeOf.GetAttributableValue): Add extra handling for object type.
8093 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8094 special error message.
8096 2006-03-25 Marek Safar <marek.safar@seznam.cz>
8098 * class.cs (Constructor.Emit): Don't crash when struct ctor is
8100 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8101 compatible with MS runtime.
8103 2006-03-23 Marek Safar <marek.safar@seznam.cz>
8105 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8106 attribute arguments here.
8108 * class.cs (Indexer.Define): The check was moved to attribute class.
8110 2006-03-22 Marek Safar <marek.safar@seznam.cz>
8112 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8113 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8116 2006-03-22 Raja R Harinath <rharinath@novell.com>
8118 Support ParameterDefaultValueAttribute in gmcs. Also applied to
8119 mcs to keep code differences small.
8120 * attribute.cs (Attribute.GetParameterDefaultValue): New.
8121 * typemanager.cs (parameter_default_value_attribute_type): New.
8122 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
8125 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8127 * expression.cs (StringConcat.Append): Reverted back to no warning state.
8129 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8131 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8133 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8136 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
8138 * doc-bootstrap.cs : fix build.
8140 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8142 * expression.cs (StringConcat.Append): Issue a warning when empty string
8145 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8147 * assign.cs (CompoundAssign.ResolveSource): Removed.
8149 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8152 * class.cs (TypeContainer.FindMethods): Removed.
8153 (TypeContainer.CheckMemberUsage): Made static.
8155 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8157 * constant.cs (CheckRange): Removed unused type argument.
8158 (CheckUnsigned): Removed unused type argument.
8160 * cs-parser.jay: Updated after MemberAccess clean up.
8161 Uses Length for empty string test.
8163 * cs-tokenizer.cs: Uses Length for empty string test.
8164 (IsCastToken): Made static.
8165 (is_hex): Made static.
8166 (real_type_suffix): Made static.
8168 * decl.cs (SetupCache): Made static.
8169 (OnGenerateDocComment): Removed unused ds argument.
8171 * delegate.cs (VerifyDelegate): Removed unused argument.
8173 * doc.cs: Uses Length for empty string test.
8175 * driver.cs: Uses Length for empty string test.
8177 * enum.cs (IsValidEnumType): Made static
8179 * expression.cs (EnumLiftUp): Removed unused argument.
8180 (ResolveMethodGroup): Ditto.
8181 (BetterConversion): Ditto.
8182 (GetVarargsTypes): Ditto.
8183 (UpdateIndices): Ditto.
8184 (ValidateInitializers): Ditto.
8185 (MemberAccess.ctor): Ditto.
8186 (GetIndexersForType): Ditto.
8188 * flowanalysis.cs: (MergeFinally): Removed unused argument.
8190 * iterators.cs: Updated after MemberAccess clean up.
8192 * location.cs: Uses Length for empty string test.
8194 * namespace.cs: Uses Length for empty string test.
8196 * report.cs (CheckWarningCode): Made static.
8198 * statement.cs (LabeledStatement): Removed unused argument.
8200 * typemanager.cs (FilterNone): Removed.
8202 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8204 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8207 * class.cs: Updated.
8209 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8211 * cs-parser.jay.cs: __arglist is not allowed for delegates.
8213 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8217 * expression.cs (VerifyArgumentsCompat): Reverted to double error
8218 reporting, it's more tricky than I thought.
8220 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8224 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
8226 (AnonymousMethod.ImplicitStandardConversionExists): New method.
8227 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8228 Add more error reporting; Fixed issue with params.
8230 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8232 * cs-parser.jay: AnonymousMethod requires host container.
8234 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8236 2006-03-18 Raja R Harinath <harinath@gmail.com>
8238 * class.cs: Change 'TypeContainer ds' constructor argument to
8239 'DeclSpace parent'. Some classes were missed below due to
8240 different naming convention.
8242 * class.cs (MemberCore.Parent): Delete. This makes the
8243 ParentContainer changes below enforceable by the compiler.
8245 Treat pointers to enclosing declaration space as 'DeclSpace', not
8247 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8248 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8250 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8252 (Block.AddThisVariable): Likewise.
8253 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8254 (AbstractPropertyEventMethod.Emit): Likewise.
8255 (AbstractPropertyEventMethod.EmitMethod): Likewise.
8256 (GetMethod.Define, SetMethod.Define): Likewise.
8257 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8258 (DelegateMethod.EmitMethod): Likewise.
8260 Fix regression test-partial-13.cs.
8261 Rationalize use of PartialContainer. Ensure that the partial
8262 class semantics can be tied to type-correctness, i.e., any
8263 violation will cause a compile error.
8264 * class.cs, const.cs: Access all fields that belong to class
8265 TypeContainer via ParentContainer. Arguments of EmitContexts and
8266 Resolve()-like functions still use 'Parent'.
8268 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8269 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8270 (PropertyMethod.CheckModifiers): Remove unused argument.
8271 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8274 2006-03-17 Raja R Harinath <harinath@gmail.com>
8276 Make semantics of PartialContainer simpler.
8277 * decl.cs (DeclSpace.IsPartial): Remove.
8278 * class.cs (TypeContainer.IsPartial): Likewise.
8279 (TypeContainer..ctor): Set PartialContainer to point to self.
8280 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8281 (TypeContainer.FindNestedType): Likewise.
8282 (MemberCore.ParentContainer): Simplify. Remove deprecation.
8284 2006-03-17 Marek Safar <marek.safar@seznam.cz>
8286 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8288 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8290 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8293 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8295 * class.cs (Operator.Define): An error for base conversion was not
8298 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
8300 * iterator.cs : yield break is allowed in try statement which has
8301 catch clauses. Fixed bug #77767.
8303 2006-03-13 Marek Safar <marek.safar@seznam.cz>
8305 A fix for #77593, #77574.
8307 * class.cs (MethodCore.CheckBase): Another if for operator.
8309 2006-03-09 Marek Safar <marek.safar@seznam.cz>
8311 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8314 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8315 (DelegateCreation.ImplicitStandardConversionExists): New method for just
8318 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8321 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8322 Updated after another emitcontext usage was clean up. It should help us to
8323 synchronize with gmcs easier.
8325 2006-03-04 Marek Safar <marek.safar@seznam.cz>
8329 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
8330 (Event.Define): ditto
8331 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8333 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
8334 Removed redundant code and set NewSlot for Invoke method too.
8336 * parameter.cs (Parameters.ctor): Add custom, type ctor.
8337 (Parameters.MergeGenerated): New method. Use this method when you merge
8338 compiler generated argument with user arguments.
8340 2006-03-03 Marek Safar <marek.safar@seznam.cz>
8342 * attribute.cs (ResolveAsTypeTerminal): Removed.
8344 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
8345 specialization for predefined types; 30% speed up.
8346 Finally placed obsolete check to right place.
8347 (Expression.ResolveType): Removed.
8349 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
8350 Updated after ResolveType was removed.
8352 * expression.cs (Cast.ctor): Check void cast.
8353 (Binary.ResolveAsTypeTerminal): Is never type.
8354 (Conditional.ResolveAsTypeTerminal): Is never type.
8356 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
8358 2006-03-01 Raja R Harinath <rharinath@novell.com>
8361 * expression.cs (ParameterReference.DoResolveBase): Change return
8363 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
8367 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
8370 * typemanager.cs (GetFullNameSignature): Don't nullref on
8371 protected accessors.
8373 2006-02-27 Marek Safar <marek.safar@seznam.cz>
8375 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
8376 these two separated members to simplify the code.
8377 (Attribute.Resolve): Refactored to use new fields and methods.
8378 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
8379 implemented obsolete attribute checking.
8380 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
8381 implemented obsolete checking again. It look line never ending quest ;-)
8382 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
8384 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
8386 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
8388 *class.cs (Property.Define): Add RegisterProperty call.
8390 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
8391 argument groups (only 2).
8393 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
8394 encoding expression to arguments.
8395 (Expression.ExprClassToResolveFlags): Just turned to property.
8397 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
8398 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
8399 optimized as well as implemented support for zero-length attributes.
8401 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
8402 Add caching of PropertyInfo's.
8404 2006-02-25 Marek Safar <marek.safar@seznam.cz>
8406 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
8407 error multiple times.
8409 2006-02-25 Marek Safar <marek.safar@seznam.cz>
8411 New partial class implementation.
8412 A fix for #77027, #77029, #77403
8414 * attribute.cs (Attributable): Made attributes protected.
8416 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
8417 the replacements of ClassPart and PartialContainer.
8418 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
8419 (TypeContainer.AddInterface): Ditto.
8420 (TypeContainer.AddPartial): The main method for partial classes. It checks
8421 for errors and merges ModFlags and attributes. At the end class is added to
8423 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
8425 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
8426 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
8427 from the rest of partial classes.
8428 (TypeContainer.GetClassBases): Simplified.
8429 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
8431 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
8432 (TypeContainer.HasExplicitLayout): Uses Flags now.
8433 (PartialContainer): Removed.
8434 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
8435 (StaticClass): Was merged with Class.
8436 (Class.GetClassBases): class and static class bases are verified here.
8437 (Class.TypeAttr): Added static attributes when class is static.
8438 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
8439 (MemberBase): In some cases we need to call parent container for partial
8440 class. It should be eliminated but it's not easy now.
8442 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
8444 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
8445 partial classed to accumulate class comments.
8446 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
8448 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
8450 * driver.cs (MainDriver): Tree.GetDecl was removed.
8452 * modifiers.cs (Modifiers): Add partial modifier.
8454 * tree.cs (Tree.decl): Removed.
8455 (RootTypes): Started to use this class more often for root types
8458 2006-02-22 Marek Safar <marek.safar@seznam.cz>
8462 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
8463 external interface does not have an attribute.
8465 2006-02-22 Marek Safar <marek.safar@seznam.cz>
8467 Another prerequisites for new partial classs implementation.
8469 * attribute.cs (Attribute.Equal): Implemented.
8470 (Attribute.Emit): Changed as attributes can be applied more than twice.
8471 (Attributes.Emit): Check for duplicate attributes here.
8473 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
8474 as a parameter, clean-up.
8476 2006-02-11 Marek Safar <marek.safar@seznam.cz>
8480 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
8481 contains obsolete attribute check which can in some cases look for base
8482 type of current class which is not initialized yet.
8483 (TypeContainer.BaseType): Replacement of ptype.
8485 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
8487 2006-02-11 Marek Safar <marek.safar@seznam.cz>
8489 First of prerequisites for new partial classs implemention.
8491 * attribute.cs (Attributable): Extended by ResolveContext;
8492 Attributes finally have correct context for resolving in all cases.
8493 (AttachTo): Attribute owner is assigned here.
8495 * codegen.cs (IResolveContext): Introduce new interface to hold
8496 all information needed in resolving phase.
8497 (EmitContext): Implements IResolveContext; more clean-up needed here.
8499 * decl.cs (MemberCore): Implemented IResolveContext.
8501 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
8502 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
8503 parameter.cs, statement.cs, tree.cs, typemanager.cs:
8504 Refactored to use new IResolveContext instead of EmitContext; cleanup
8506 2006-02-06 Miguel de Icaza <miguel@novell.com>
8508 * codegen.cs (EmitScopeInitFromBlock): check here the
8509 capture_context, there is no need to make two calls to the
8512 * anonymous.cs: Add some debugging messages that might help me
8513 track other instances of this problem in the future (the
8514 regression of test 467).
8516 * cs-parser.jay: track the variable block, as we need to initalize
8517 any captured variables declared in this block for the "catch"
8518 portion of the "Try" statement.
8520 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
8521 scope initialization for captured variables.
8523 Also, move the emit for the variables after the block location has
8526 2006-02-06 Marek Safar <marek.safar@seznam.cz>
8528 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
8530 2006-02-02 Miguel de Icaza <miguel@novell.com>
8532 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
8533 commit yesterday, the initialization for the roots is necessary.
8534 What is not necessary is the scope activation.
8536 2006-02-02 Raja R Harinath <rharinath@novell.com>
8538 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
8539 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
8541 (Argument.Resolve): Remove CS0206 checks.
8543 2006-02-01 Miguel de Icaza <miguel@novell.com>
8545 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
8546 scopes for all the roots, the scopes will now be emitted when the
8547 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
8549 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
8550 code. This reduces a lot of existing cruft.
8552 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
8553 that the ScopeInfo is generated as we enter the scope, not at the
8554 time of use, which is what we used to do before.
8556 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
8557 every time a Block is about to be emitted if we have a
8560 2006-02-01 Raja R Harinath <rharinath@novell.com>
8562 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
8564 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
8566 * typemanager.cs (cons_param_array_attribute): Make private.
8567 (Reset): Set it to null.
8568 (InitCoreHelpers): Don't initialize it.
8569 (ConsParamArrayAttribute): New. Initialize it as needed.
8570 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
8572 2006-01-31 Miguel de Icaza <miguel@novell.com>
8574 * expression.cs: There might be errors reported during the
8575 selection of applicable methods. If there are errors, do not
8576 continue execution as it will lead the compiler to crash.
8578 2006-01-30 Miguel de Icaza <miguel@novell.com>
8580 * expression.cs: Member access is not allowed on anonymous
8581 methods. Fixes #77402.
8583 2006-01-30 Raja R Harinath <rharinath@novell.com>
8586 * cs-parser.jay (VariableDeclaration): Don't set
8587 current_array_type to null.
8588 (field_declaration, event_declaration, declaration_statement):
8589 Set it to null here.
8591 2006-01-28 Raja R Harinath <harinath@gmail.com>
8593 * typemanager.cs (GenericParameterPosition): New.
8596 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
8598 * doc.cs : To process "include" elements, first we should create
8599 another list than XmlNodeList, because it could result in node
8600 removal, which could result in that the XmlNodeList gives up
8603 (Also made code identical to gmcs again.)
8605 2006-01-25 Miguel de Icaza <miguel@novell.com>
8607 * ecore.cs: Introduce an error report that we were not catching
8608 before, if not silent, we must report the error. Gonzalo ran into
8611 2006-01-23 Miguel de Icaza <miguel@novell.com>
8613 A fix for bug: #76957
8615 * iterators.cs (MoveNextMethod.CreateMethodHost): call
8616 ComputeMethodHost before creating the method, this is a new
8619 * anonymous.cs (AnonymousContainer): Now we track all the scopes
8620 that this method references (RegisterScope). The actual scope
8621 where the method is hosted is computed with the ComputeMethodHost
8622 before we create the method.
8624 Moved the Deepest routine here.
8626 (AnonymousContainer.ComputeMethodHost): New routine used to
8627 compute the proper ScopeInfo that will host the anonymous method.
8629 (ScopeInfo): Deal with multiple roots. The problem was that we
8630 did not have a unique root where all ScopeInfos could be hanged
8631 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
8634 Remove AdjustMethodScope which is now computed at the end. Remove
8635 LinkScope which did a partial link, instead link all ScopeInfos
8636 before code generation from the new "LinkScopes" routine.
8638 Simplify all the Add* routines as they no longer need to maintain
8639 the tree, they just need to record that they are using variables
8642 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
8643 routines to produce the forest of ScopeInfo trees.
8645 * class.cs (TypeContainer.AppendMethod): This is just like
8646 AddMethod, but ensures that an interface implementation method
8647 (IEnumerable.XXX) is not inserted at the beginning of the queue of
8648 methods, but at the end.
8650 We use this functionality to ensure that the generated MoveNext
8651 method in the iterator class is resolved/emitted before the
8652 enumerator methods created.
8654 This is required because the MoveNext method computes the right
8655 ScopeInfo for the method. And the other methods will eventually
8656 need to resolve and fetch information computed from the anonymous
8659 2006-01-21 Raja R Harinath <harinath@gmail.com>
8660 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8663 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
8665 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
8666 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
8668 2006-01-18 Raja R Harinath <rharinath@novell.com>
8670 Fix #76656, cs0231-2.cs.
8671 * cs-parser.jay (formal_parameter_list): Make error case catch
8673 (parenthesized_expression_0): Add CS1026 check.
8674 (invocation_expression): Remove unused { $$ = lexer.Location }.
8676 2006-01-17 Raja R Harinath <rharinath@novell.com>
8679 * cs-parser.jay (statement_expression): Don't list out the
8680 individual statement-expressions. Convert syntax error into
8683 2006-01-16 Raja R Harinath <rharinath@novell.com>
8686 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
8687 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
8688 CheckIntermediateModification.
8689 (FieldExpr.DoResolve): Add new two-argument version that
8690 allows us to resolve the InstanceExpression as an lvalue.
8691 The one-argument variant is now just a wrapper.
8692 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
8693 Resolve the lhs as an lvalue if the it has a value type.
8694 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
8695 from Assign.DoResolve.
8696 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
8697 resolved as an lvalue.
8698 (PropertyExpr.DoResolve): Update.
8699 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
8700 has a value type. Move CS1612 check here from
8701 CheckIntermediateModification.
8702 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
8703 * expression.cs (EmptyExpression.OutAccess): New. Used as the
8704 'right_side' of a ResolveLValue on an 'out' argument.
8705 (EmptyExpression.LValueMemberAccess): New. Used as the
8706 'right_side' of a propagated ResolveLValue on a value type.
8707 (LocalVariableReference.DoResolveBase): Recognize
8708 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
8710 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
8711 EmptyExpression.Null.
8713 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
8715 * typemanager.cs : added IsGenericParameter(). In mcs it always
8717 * doc.cs : for generic parameters, use GenericParameterPosition,
8720 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
8722 * expression.cs: Fix Console.WriteLine ((this = x).foo);
8724 2006-01-12 Miguel de Icaza <miguel@novell.com>
8726 This fixes the problem where we used ldfld instead of ldflda to
8727 load the "THIS" pointer on captured parameters, when THIS is a
8728 value type. See bug #77205.
8730 * iterators.cs (CapturedThisReference.Emit): Pass false to
8731 EmitThis (we do not need the address).
8733 * codegen.cs (EmitThis): it needs to know whether we need the
8734 address of `this' or not. This is used by value types.
8736 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
8737 every other call passes false.
8739 2006-01-12 Raja R Harinath <rharinath@novell.com>
8742 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
8744 * expression.cs (Invocation.OverloadResolve): Update.
8745 (Invocation.DoResolve): Avoid double resolution of invocation.
8747 2006-01-11 Raja R Harinath <rharinath@novell.com>
8750 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
8751 unary negation of floating point types as 0-expr; negation cannot
8752 overflow in floating point types.
8755 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
8756 on operands of 'void' type.
8759 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
8760 and ExclusiveOr for boolean constants too.
8762 2006-01-09 Raja R Harinath <rharinath@novell.com>
8765 * expression.cs (Invocation.OverloadResolve): Replace reflected
8766 override methods with their base virtual methods, rather than
8768 * typemanager.cs (TypeManager.GetOverride): New.
8770 2006-01-05 Jb Evain <jbevain@gmail.com>
8772 * class.cs (Property.Define, Indexer.Define): do not tag the
8773 properties as SpecialName | RTSpecialName.
8775 2006-01-04 Miguel de Icaza <miguel@novell.com>
8777 * class.cs (MethodCore.IsDuplicateImplementation): This method was
8778 doing a low-level comparission of parameter types. It was lacking
8779 a check for __argslist.
8781 2005-12-30 Miguel de Icaza <miguel@novell.com>
8783 * expression.cs (ParameterReference.DoResolveBase): Allow
8784 reference parameters if they are local to this block.
8786 This allows the ref and out parameters of a delegate to be used in
8787 an anonymous method, for example:
8789 delegate void set (out int x);
8791 set s = delegate (out int x){
8795 This is used by functionality introduced late in the C# language.
8797 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
8798 method that take ref and out parameters.
8800 Fixes #77119 which was a late change in the spec.
8802 2005-12-23 Miguel de Icaza <miguel@novell.com>
8804 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
8805 parent if its the same scope. Fixes #77060.
8807 2005-12-21 Miguel de Icaza <miguel@novell.com>
8809 * driver.cs: Report the case of no source files and no -out:
8812 2005-12-20 Raja R Harinath <rharinath@novell.com>
8815 * expression.cs (ComposedCast.GetSignatureForError): Define.
8817 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8821 * namespace.cs (NamespaceEntry): Add extern_aliases as a
8822 ListDictionary, to contain the ExternAliasEntry entries (in
8823 addition to the NamespaceEntry.aliases hashtable). This field is
8824 shared between the original entry and its doppelganger (bodyless
8826 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
8827 extern_aliases field.
8828 (NamespaceEntry.Lookup): Move the IsImplicit check after the
8829 lookup in extern_aliases.
8831 2005-12-16 Raja R Harinath <rharinath@novell.com>
8834 * class.cs (TypeContainer.Mark_HasEquals): New.
8835 (TypeContainer.Mark_HasGetHashCode): New.
8836 (ClassPart): Override them.
8837 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
8840 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
8841 'parent' argument to the base constructor.
8843 Remove all mention of TypeContainer from decl.cs.
8844 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
8845 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
8846 (DeclSpace.DeclSpace): Likewise.
8847 (DeclSpace.DefineMembers): Remove unused argument.
8848 * cs-parser.jay (pop_current_class): Update to changes. Simplify
8849 debugging check -- we don't care if the debug code throws an
8850 InvalidCastException instead of an InternalErrorException.
8851 * class.cs (TypeContainer.DefineMembers): Update to changes.
8852 (TypeContainer.DoDefineMembers): Likewise.
8853 (TypeContainer.GetMethods): Likewise.
8854 (PropertyMember.Define): Likewise.
8855 (MemberBase.Parent): New property that forwards to
8856 MemberCore.Parent, but ensures that we get a TypeContainer.
8857 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
8858 (RootContext.PopulateTypes): Likewise. Remove special case code
8859 for !RootContext.StdLib: DefineMembers is idempotent.
8861 2005-12-14 Miguel de Icaza <miguel@novell.com>
8863 * convert.cs (ExplicitConversionCore): Check the return value from
8864 ExplicitConversionCore which can return null on failure. Fixes #76914
8866 2005-12-13 Marek Safar <marek.safar@seznam.cz>
8868 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
8870 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
8872 * doc.cs : The search for referenced namespace was insufficient to
8873 get global one as it used to do. Fixed bug #76965.
8875 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
8877 * doc.cs : check name in cref in the last phase that whether it is
8880 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
8882 * cs-tokenizer.cs : reverted the latest change: it somehow broke
8885 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
8887 * doc.cs : so it turned out that we cannot skip override check for
8888 interface members. Fixed bug #76954.
8890 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
8892 * cs-tokenizer.cs : fixed bug #75984:
8893 - #warning and #error should not be handled when the source line
8895 - #line is not checked strictly when the source line is disabled.
8896 - #define and #undef is on the other hand checked strictly at any
8899 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
8901 * cs-tokenizer.cs : missing Location (actually, filename) in one of
8904 2005-12-05 Marek Safar <marek.safar@seznam.cz>
8906 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
8908 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
8910 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
8911 (FieldBase.Initializer): Initializer is now optional.
8912 (EventField.Define): Only event field can have initializer.
8914 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
8916 * const.cs (Const): Reuse initializer.
8918 * cs-parser.jay: Updated after FieldBase changes.
8919 Added current_array_type to simplify array initializers.
8921 * ecore.cs (NullCast.IsDefaultValue): Implemented.
8923 * expression.cs, iterators.cs: Updated.
8925 * namespace.cs (NamespaceEntry): Made UsingFound private.
8927 2005-12-05 Marek Safar <marek.safar@seznam.cz>
8929 * parameterCollection.cs: Obsolete, removed.
8930 * parser.cs: Obsolete, removed.
8932 2005-12-05 Marek Safar <marek.safar@seznam.cz>
8935 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
8937 * enum.cs (Enum.Define): Set obsolete context here.
8939 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
8942 - FindDocumentedMember() now expects 1) paramList as null
8943 when "we don't have to check the number of parameters" and
8944 2) Type.EmptyTypes when "there is no arguments".
8945 - Introduced FoundMember struct to hold the exact type which was
8946 used to find the documented member (the above change broke
8947 test-xml-044; it might be better just to use DeclaringType than
8948 what MS does, like this change does, but it depends on usage.)
8950 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
8952 * doc.cs : documented member might be from DeclaringType for nested
8953 types. Fixed bug #76782.
8955 2005-12-03 Ben Maurer <bmaurer@ximian.com>
8957 * anonymous.cs: Have the param code handle leaving copies on the
8958 stack etc. Allows anonymous params to take part in the assignment
8959 code (++, +=, etc). Fixes bug #76550
8961 * expression.cs: Handle the prepare_for_load/leave_copy by passing
8962 it down to the anon code.
8964 * iterators.cs: Use dummy var here
8966 * codegen.cs: Handle new vars
8968 2005-12-01 Marek Safar <marek.safar@seznam.cz>
8971 * class.cs (MethodData.Define): Set proper Obsolete context.
8973 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
8975 (FieldExpr.DoResolve): Ditto.
8977 2005-12-01 Marek Safar <marek.safar@seznam.cz>
8980 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
8981 parent is not obsolete.
8983 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
8985 * doc.cs : (FindDocumentedMember) find parameterless members first
8986 and get CS0419 in the early stage. Fixed first case of bug #76727.
8988 2005-11-30 Marek Safar <marek.safar@seznam.cz>
8991 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
8992 no error was reported.
8994 *expression.cs (Binary.DoResolve): left can be null.
8996 2005-11-22 Marek Safar <marek.safar@seznam.cz>
8999 * class.cs (MethodData.Emit): Parameters should be labeled first.
9001 2005-11-21 Marek Safar <marek.safar@seznam.cz>
9004 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9006 2005-11-18 Marek Safar <marek.safar@seznam.cz>
9008 * attribute.cs (AreParametersCompliant): Moved to Parameter.
9010 * class.cs (MethodCore): Parameter clean up.
9011 (IMethodData): Added ParameterInfo.
9012 (MethodData): Parameter clean up.
9013 (Indexer.Define): Parameter clean up.
9025 * typemanager.cs: Parameter clean up.
9027 * delegate.cs (Define): Get rid of duplicated code.
9029 * expression.cs (ParameterReference): Removed useless parameters
9031 (Invocation): Ditto.
9033 * parameter.cs (ParamsParameter): New class, params specialization.
9034 (ArglistParameter): Attemp to separate arglist.
9035 (Parameter): Refactored to be reusable and faster.
9036 (Parameter.Modifier): Made understandable.
9037 (Parameters): Changed to be used as a class for `this' assembly
9038 parameters. Refactored to use new specialized classes.
9040 * support.cs (ParameterData): Added Types property.
9041 (InternalParameters): Deleted.
9043 2005-08-20 Martin Baulig <martin@ximian.com>
9045 Merging this patch from GMCS to fix #75867.
9047 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9048 scope if we don't already have it.
9050 2005-11-17 Martin Baulig <martin@ximian.com>
9053 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9054 inherit the scope from our parent. Fixes #76653.
9056 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9058 * doc.cs : the previous patch does not actually fix the bug.
9059 PropertyInfo override check is now implemented and really fixed it.
9060 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9062 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9064 * doc.cs : apply "override filter" also to properties.
9067 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9069 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9070 no need to check overrides. For classes, omit those results from
9071 interfaces since they must exist in the class. Fixed bug #76726.
9073 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9075 * typemanager.cs : (GetFullNameSignature) differentiate indexers
9076 with different parameters. Fixed the second problem in #76685.
9078 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9080 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9081 get expected 'protected' access in CheckValidFamilyAccess()).
9084 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9086 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9087 Fixed bug #76705. CS1569 was incorrectly commented out.
9089 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9091 * doc.cs : use Invocation.IsOverride() to do real override check.
9092 * expression.cs : made Invocation.IsOverride() internal.
9094 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9096 * doc.cs : use TypeManager.FindMembers() instead of (possible)
9097 TypeBuilder.FindMembers() and filter overriden base members out.
9100 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9102 * doc.cs : ref/out parameters are represented as '@' (instead of
9103 '&' in type FullName). Fixed bug #76630 (additionally crefs).
9105 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9107 * doc.cs : when there was no '.' in cref to methods in doc comment,
9108 then parameters were missing in the output. Fixed bug #76691.
9110 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9112 * driver.cs : don't output docs when there is an error.
9115 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9118 Now it should detect indexers. Fixed primary concern in bug #76685.
9119 Fixed CS0419 message to not show the identical member signature in
9122 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9124 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9125 instead of Type.FindMembers() since it does not handle events.
9128 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
9130 * codegen.cs: Fixed typo (speficied -> specified).
9132 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9135 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9137 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9139 * attribute.cs: Changed error message.
9141 * cs-tokenizer.cs: One more check.
9143 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9145 * statement.cs (Block.Resolve): Ignore empty statement.
9147 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9149 * report.cs: Made error/warning methods more strict to avoid
9152 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9153 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9154 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9155 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9157 2005-11-08 Marek Safar <marek.safar@seznam.cz>
9159 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9160 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9162 * class.cs (TypeContainer.IsComImport): New property.
9163 (Constructor.Define): Create proper ctor for ComImport types.
9165 * expression.cs (New.CheckComImport): Fixed.
9167 2005-11-07 Miguel de Icaza <miguel@novell.com>
9169 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9170 that a parameter has been captured does not mean that we do not
9171 have to do the rest of the processing. This fixes the second part
9172 of #76592. If there was another anonymous method capturing
9173 values in the past, the Scope would never be set for the second
9174 method that captured the same parameter.
9176 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9177 properly manipulate the stack. Second part of fix for #76592.
9179 * expression.cs (New): Add support for invoking "new" on
9180 interfaces that have been flagged with the ComImport attribute and
9181 the CoClass. Fixes #76637
9183 * statement.cs (Try.DoEmit): When a variable is captured, do not
9184 try to emit the vi.LocalBuilder variable as it has been captured.
9185 Create a temporary variable and store the results on the
9186 FieldBuilder. Fixes #76642
9188 2005-11-07 Marek Safar <marek.safar@seznam.cz>
9190 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9192 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9194 * expression.cs (Binary.DoResolve): Added && optimalization.
9196 * typemanager.cs (AddUserType): Removed useless argument.
9198 2005-11-04 Marek Safar <marek.safar@seznam.cz>
9200 * statement.cs (Block.variables): Uses ListDictionary.
9202 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9205 * class.cs (PartialContainer.EmitType): Customized to emit
9206 security attributes.
9207 (ClassPart.ApplyAttributeBuilder): Transform security attribute
9208 for partial classes.
9210 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9213 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9214 access has to be fixed.
9216 * typemanager.cs (IsUnmanagedType): Wrong common field type.
9218 2005-11-01 Marek Safar <marek.safar@seznam.cz>
9221 * ecore.cs (NullCast.Reduce): Implemented.
9223 * expression.cs (ArrayCreation.CheckIndices): Correcly check
9226 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9228 (Foreach.Resolve): Catch null properly.
9230 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9232 * cs-tokenizer.cs: Warning text fix.
9234 * driver.cs: AllWarningNumbers exposed on public interface.
9236 * report.cs (): Reviewed warning numbers.
9237 (IsValidWarning): Use binary search.
9239 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9241 * driver.cs: Implemeted resource visibility.
9242 (Resources): New class for code sharing between /res: and
9245 2005-10-28 Marek Safar <marek.safar@seznam.cz>
9248 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9251 * convert (Convert.ImplicitReferenceConversion): NullCast holds
9254 * ecore.cs (NullCast): Child is contant only.
9256 * literal.cs (NullLiteral.Reduce): null can be converted to any
9259 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
9261 * driver.cs: Use Encoding.Default as default code page instead
9264 2005-10-27 Raja R Harinath <rharinath@novell.com>
9267 * expression.cs (Invocation.Error_InvalidArguments): Handle
9268 __arglist parameters.
9269 (Invocation.VerifyArgumentsCompat): Likewise.
9270 * support.cs (ReflectionParameters.GetSignatureForError): Print
9271 __arglist parameters.
9272 (InternalParamters.GetSignatureForError): Likewise.
9273 * parameter.cs (Parameters.GetSignatureForError): Likewise.
9275 2005-10-26 Marek Safar <marek.safar@seznam.cz>
9277 * attribute.cs (GetPropertyValue): Made public.
9279 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9281 Add new property WrapNonExceptionThrows to handle 2.0 assembly
9283 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9286 * driver.cs: Reflect method name change.
9288 * statement.cs (Try.Resolve): Warn when try has both general
9291 * typemanager.cs: runtime_compatibility_attr_type new predefined
9294 2005-10-26 Raja R Harinath <harinath@gmail.com>
9297 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9298 treat it as an empty parameter list.
9300 2005-10-26 Raja R Harinath <rharinath@novell.com>
9303 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
9304 ResolveAsTypeStep silent.
9305 * statement.cs (Block.AddConstant): Mark block as used.
9306 (Block.ResolveMeta): Avoid piling on error messages
9307 if a constant initializer resolution fails.
9309 2005-10-25 Raja R Harinath <rharinath@novell.com>
9311 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9313 (NamespaceEntry.VerifyAllUsing): New.
9314 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
9315 behaviour. Delegates actual resolution of alias to ...
9316 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
9317 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9319 * driver.cs (Driver.MainDriver): Update.
9321 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9322 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9324 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
9326 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
9327 RootNamespace.DefineNamespacesForAll.
9329 2005-10-24 Raja R Harinath <harinath@gmail.com>
9331 * typemanager.cs (assemblies, external_aliases, modules)
9332 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
9333 (ComputeNamespaces, GetRootNamespace): Remove extra staging
9334 overhead. Move resposibility ...
9335 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
9336 * driver.cs, attribute.cs, codegen.cs: Update to changes.
9338 2005-10-23 Raja R Harinath <harinath@gmail.com>
9340 * namespace.cs (RootNamespace.all_namespaces): Renamed from
9341 cached_namespaces. Improve usage.
9342 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
9343 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
9344 Move from GlobalRootNamespace and simplify.
9345 (RootNamespace.Global): Make instance variable.
9346 (RootNamespace.RootNamespace): Add "alias name" parameter.
9347 (GlobalRootNamespace): Simplify drastically.
9348 (Namespace.Lookup): Don't use GetNamespace.
9349 * typemanager.cs (GetRootNamespace): Rename from
9350 ComputeNamespaceForAlias.
9351 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
9353 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9355 * anonymous.cs (AnonymousContainer): Don't crash when container
9358 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9360 * expression.cs (Binary.DoResolve): Warn when comparing same
9363 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9366 * expression.cs (Binary.DoResolve): It looks like there are no
9367 convetsion rules in enum context.
9369 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9371 Add support for extern alias qualifiers.
9372 * typemanager.cs: Move some LookupTypeReflection code
9373 to namespace.cs, to have cleaner code. Added some methods
9374 to help us keep track of the extern aliased references.
9375 * driver.cs: Add suport for extern alias assemblies on command
9376 line and check for their warnings/errors. Also keep track of the
9377 extern aliased assemblies.
9378 * namespace.cs: Move the global functionality of Namespace
9379 to GlobalRootNamespace/RootNamespace. Now the global namespace
9380 is GlobalRootNamespace.Globa. Also the code moved from
9381 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
9382 Finally added LocalAliasEntry (AliasEntry before) and
9383 ExternAliasEntry, to handle alias statements.
9384 * cs-parser.jay: Add support in the grammar for extern alias
9386 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
9387 Update callings to Namespace (now in GlobalRootNamespace).
9389 2005-10-18 Raja R Harinath <rharinath@novell.com>
9392 * class.cs (TypeContainer.DefineType): Move updating of
9393 topological sort earlier in the code.
9394 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
9396 2005-10-18 Marek Safar <marek.safar@seznam.cz>
9399 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
9401 * constant.cs (Constant.TryReduce): Moved from Cast class.
9402 (Reduce): Made little bit more OO and fixed missing conversions.
9404 * ecore.cs (Reduce): Implemented.
9405 (Binary.EnumLiftUp): New method to upgrade values to enum values.
9407 * literal.cs (Reduce): Implemented.
9409 * class.cs: Reverted Miguel's wrong commit.
9411 2005-10-14 Miguel de Icaza <miguel@novell.com>
9413 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
9415 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
9417 * cs-parser.jay, expression.cs : CS0214 was missing error location
9418 for constants. Fixed bug #76404.
9420 2005-10-11 Marek Safar <marek.safar@seznam.cz>
9423 * convert.cs (ExplicitConversionCore): Fixed object->enum
9426 2005-10-10 Raja R Harinath <rharinath@novell.com>
9428 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
9430 (PropertyExpr.EmitCall): Likewise.
9431 * expression.cs (Invocation.EmitArguments): Handle case where
9433 (Invocation.EmitCall): Avoid allocating temporary variable if
9434 there are no arguments.
9436 2005-10-07 Raja R Harinath <rharinath@novell.com>
9439 * convert.cs (ImplicitConversionStandard): Move conversion of
9440 void* to arbitrary pointer types ...
9441 (ExplicitConversionStandard): .. here.
9442 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
9443 error to always print typenames.
9445 2005-10-07 Raja R Harinath <rharinath@novell.com>
9447 * convert.cs (GetConversionOperator): Rename from
9448 GetConversionOperators. Move operator selection code from ...
9449 (UserDefinedConversion): ... here.
9451 2005-10-06 Marek Safar <marek.safar@seznam.cz>
9453 * convert.cs (ExplicitConversionCore): Removed duplicate enum
9456 2005-10-05 Marek Safar <marek.safar@seznam.cz>
9458 * assign.cs (Assign.DoResolve): Error method changed.
9460 * cfold.cs (DoConstantNumericPromotions): Error method changed.
9462 * const.cs (ResolveValue): Reset in_transit immediately.
9464 * constant.cs: Error method changed.
9466 * convert.cs: Removed useless location parameter.
9467 (ExplicitNumericConversion): Don't do double enum check.
9468 (ExplicitConversionCore): Renamed from ExplicitConversion.
9469 (ExplicitUnsafe): Extracted from ExplicitConversion.
9470 (ExplicitConversion): Uses for error reporting.
9472 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
9474 (ResolveBoolean): Uses common error method.
9475 (CastToDecimal): Get rid of ec.
9476 (CastFromDecimal): Optimized.
9477 (ConvCast): Get rid of ec.
9479 * enum.cs (ResolveValue): Reset in_transit immediately.
9480 (Emit): Return after first error.
9482 * expression.cs: Convert changes.
9484 * literal.cs: Error method changed.
9486 * statement.cs: Error method changed.
9488 2005-10-03 Raja R Harinath <rharinath@novell.com>
9490 * support.cs (SeekableStreamReader.Position): Don't error out when
9491 the requested position is just beyond the end of the current
9494 2005-09-28 Raja R Harinath <rharinath@novell.com>
9496 * support.cs (SeekableStreamReader): Simplify drastically. Don't
9497 try to keep in sync with the byte count of the underlying Stream.
9498 However, this limits us to a window size of 2048 characters: i.e.,
9499 the maximum lookahead of our lexer/parser can be 2048 characters.
9501 2005-09-28 Marek Safar <marek.safar@seznam.cz>
9504 * driver.cs: Fix compilation files with full root path.
9506 2005-09-25 Miguel de Icaza <miguel@novell.com>
9508 * report.cs (SymbolRelatedToPreviousError): Format the output so
9509 it does not use an open parenthesis that is never closed.
9511 * driver.cs: Follow coding guidelines
9513 2005-09-27 Marek Safar <marek.safar@seznam.cz>
9516 * const.cs (Const.ResolveValue): Check for assigning non-null
9517 value to reference type.
9519 2005-09-27 Marek Safar <marek.safar@seznam.cz>
9521 * anonymous.cs: Implemented ExprClassName.
9523 * assign.cs (Assign.DoResolve): Don't chrash when type is not
9526 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
9529 * class.cs (StaticClass.DefineContainerMembers): Report protected
9532 * codegen.cs: if(ed) PRODUCTION.
9534 * convert.cs (Error_CannotImplicitConversion): Better error
9537 * cs-parser.jay: More error checks.
9539 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
9541 * driver.cs (CSCParseOption): Enabled wrong option check.
9543 * ecore.cs (Expression.ExprClassName): Turned to property.
9544 (MemberExpr.CheckIntermediateModification): For checking boxed
9545 value types modification.
9547 * statement.cs (Fixed.Resolve): Expression type must be
9548 convertible to fixed type.
9549 (CollectionForeach.GetEnumeratorFilter,TryType):
9550 Small refactoring for easier error checking.
9552 2005-09-26 Marek Safar <marek.safar@seznam.cz>
9554 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
9557 * class.cs (GeneratedBaseInitializer): New class for customization
9558 compiler generated initializers.
9559 (MemberBase.DoDefine): Check Obsolete attribute here.
9560 (FieldMember.DoDefine): Ditto.
9562 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
9565 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
9566 (MemberCore.GetObsoleteAttribute): Removed argument.
9567 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
9568 (MemberCore.CheckObsoleteType): New helper.
9572 * statement.cs: Updates after MemberCore changes.
9574 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
9575 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
9577 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
9578 obsolete attribute for compiler construct.
9579 (As.DoResolve): Cache result.
9581 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
9583 2005-09-26 Raja R Harinath <rharinath@novell.com>
9586 * expression.cs (This.VerifyFixed): In a value type T, the type of
9587 'this' is T&, iow, 'this' is either an out or ref parameter. In a
9588 value type R, 'this' is treated as a value parameter.
9590 2005-09-22 Miguel de Icaza <miguel@novell.com>
9592 * statement.cs (Lock): Use the TemporaryVariable class instead of
9593 manually using local variables as those do not work when variables
9596 * ecore.cs: Moved the TemporaryVariable class from being a nested
9597 class inside Foreach to be a public class that can be employed in
9600 2005-09-19 Marek Safar <marek.safar@seznam.cz>
9602 * cs-parser.jay: interface_accessors replaced by
9603 accessor_declarations.
9605 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
9608 * statement.cs (GotoCase.Resolve): Convert null constant to
9610 (SwitchLabel.ResolveAndReduce): Ditto.
9611 (SwitchLabel.NullStringCase): Custom null stamp.
9612 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
9614 typemanager.cs (CSharpSignature): Don't skip first argument
9617 2005-09-18 Miguel de Icaza <miguel@novell.com>
9619 * driver.cs: Set InEmacs based on the environment variable EMACS.
9621 * location.cs (InEmacs): in this mode, do not report column
9622 location as it confuses Emacs.
9624 2005-09-16 Marek Safar <marek.safar@seznam.cz>
9626 * cfold.cs, constant.cs, convert.cs, ecore.cs,
9627 expression.cs, iterators.cs, literal.cs: Store constants and
9630 * class.cs (MemberBase.ShortName): Pass location.
9632 * cs-parser.jay: Some location fixes.
9634 * ecore.cs (Expression.Location): Made virtual.
9636 2005-09-05 Miguel de Icaza <miguel@novell.com>
9638 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
9639 if the underlying types are the same, otherwise we need to produce
9640 code that will do the proper cast.
9642 This was exposed by Marek's constant rewrite which produced
9643 invalid code for the call site:
9646 void Method (X v) {}
9650 This fixes test-49.cs
9652 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
9654 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
9655 Type/Object should be allowed as well. Fixed bug #75968.
9657 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
9659 * expression.cs : (Binary.DoResolve): when one is enum constant and
9660 another is constant 0, then return enum one *as enum type*.
9663 2005-09-02 Raja R Harinath <rharinath@novell.com>
9665 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
9669 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
9670 flow-branching for LocalVariableReferences in case we were invoked
9671 from a MemberAccess.
9672 * expression.cs (LocalVariableReference.VerifyAssigned): New.
9674 (LocalVariableReference.DoResolveBase): ... this.
9675 (MemberAccess.Resolve): Do the check that was disabled during
9678 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
9681 (PartialContainer.Create): check abstract/sealed/static strictly
9682 but abstract/sealed can exist only at one side. Fixed bug #75883.
9684 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
9687 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
9688 specified, don't default to UnmanagedType.I4.
9690 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
9692 * expression.cs : conditional operator should check possibly
9693 incorrect assign expression. Fixed bug #75946.
9695 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
9697 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
9698 Reverting the change. gmcs is much complex than mcs on this matter.
9700 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
9702 * cs-tokenizer.cs : To read another token ahead of the actual
9703 consumption, use new SavedToken and cache token instead of moving
9704 back the stream with SeekableStreamReader (it seemed problematic).
9706 driver.cs : Thus use StreamReader directly.
9707 * support.cs : Thus removed SeekableStreamReader.
9709 2005-08-30 Raja R Harinath <rharinath@novell.com>
9712 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
9713 (ScopeInfo.EmitScopeType): Use it to construct field names from
9714 names of captured locals.
9717 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
9718 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
9719 Pass 'target_type' to BoxedCast. Don't default to 'object'.
9720 (ExplicitConversion): Remove enum cases already handled by
9721 implicit conversion. Move implicit conversion check to the beginning.
9722 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
9723 * expression.cs (ArrayCreation.EmitDynamicInitializers):
9724 Don't treat System.Enum as a struct.
9726 2005-08-30 Jb Evain <jbevain@gmail.com>
9728 * attribute.cs: handles as expression in parameters.
9730 2005-08-30 Raja R Harinath <rharinath@novell.com>
9733 * class.cs (TypeContainer.VerifyClsName): Don't use a
9734 PartialContainer when verifying CLS compliance.
9735 (AbstractPropertyEventMethod): Set Parent here, ...
9736 (PropertyMethod): ... not here.
9738 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
9740 * attribute.cs : escaped attribute name should not be allowed to be
9741 resolved (e.g. @class as classAttribute). Fixed bug #75930.
9743 2005-08-29 Raja R Harinath <rharinath@novell.com>
9746 * convert.cs (ImplicitStandardConversionExists): Allow zero also
9747 when converting a long constant to unsigned long.
9748 * expression.cs (Invocation.OverloadResolve): Add sanity check to
9749 detect where IsApplicable and VerifyArgumentsCompat disagree.
9751 2005-08-29 Raja R Harinath <rharinath@novell.com>
9752 and Carlos Alberto Cortez <carlos@unixmexico.org>
9755 * class.cs (TypeContainer.CanElideInitializer): New helper.
9756 (TypeContainer.EmitFieldInitializers): Use it to determine if we
9757 can safely emitting the initializer of a field.
9759 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
9761 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
9762 allowed inside a switch (without loop). Fixed bug #75433.
9764 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
9766 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
9767 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
9769 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
9771 * driver.cs : kinda reverting the default encoding changes (not exact
9772 revert since I noticed that "codepage:reset" might not work fine).
9774 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
9776 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
9777 Location. Now getter and setter store location correctly.
9778 (errors/cs0111-12.cs now reports the expected location.)
9780 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
9782 * driver.cs : Use default encoding on the environment.
9783 Removed (now that) extra parameter for SeekableStreamReader.
9784 * support.cs : (SeekableStreamReader) third .ctor() argument for
9785 StreamReader is not required (always true). preamble size could
9786 be acquired in simpler and safe way.
9788 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
9790 * cs-parser.jay: report CS0642 at warning level 3
9791 and report CS0642 for an if else statement also
9792 fixes bug #74745. Patch by John Luke (and a bit
9794 Removed extra CS0642 warning check for "while",
9796 * statement.cs: In Block.Resolve(), CS0642 check
9797 is reimplemented to check a sequence of an empty
9798 statement and a block.
9800 Both fix bug #66777.
9802 2005-08-24 Marek Safar <marek.safar@seznam.cz>
9804 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
9805 detection until I fix it.
9807 * cs-tokenizer.cs: Changed error message.
9809 * cs-parser.jay: Fixed 2 error locations.
9811 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
9812 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
9815 * enum.cs (GetSignatureForError): Fixed.
9817 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
9821 * typemanager.cs (RegisterProperty): Removed.
9823 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
9825 2005-08-24 Raja R Harinath <rharinath@novell.com>
9828 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
9829 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
9831 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9833 * expression.cs : tiny fix is required for not warning positive ulong.
9836 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9838 * expression.cs : add CS0652 check for constant and integral
9839 expression. Fixed bug #53974.
9841 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9843 * expression.cs : in DoNumericPromotions(), check if there is implicit
9844 conversion overload for string (to check CS0034). Fixed bug #52492.
9846 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9848 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
9850 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9852 * ecore.cs : report location when it is *not* Null.
9854 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9860 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
9861 correctly. Fixed bug #75721.
9863 2005-08-23 Raja R Harinath <rharinath@novell.com>
9865 * support.cs (SeekableStreamReader.Position): Avoid an expensive
9866 loop that performs 'min (pos, char_count)'.
9869 * expression.cs (Unary.ResolveOperator): Don't discard implicit
9870 converted value in Operator.OnesComplement.
9872 2005-08-22 Ben Maurer <bmaurer@ximian.com>
9874 * anonymous.cs: If the anon method is pulled into a helper class,
9875 it needs to be `internal' not `private'. Fixes runtime behavior on
9878 2005-08-20 Martin Baulig <martin@ximian.com>
9880 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9881 scope if we don't already have it.
9883 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
9884 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
9887 2005-08-17 Marek Safar <marek.safar@seznam.cz>
9890 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
9893 2005-08-16 Marek Safar <marek.safar@seznam.cz>
9895 The big constants rewrite
9896 Fix #75746, #75685 and more
9897 As a side effect saved 1MB for MWF ;-)
9899 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
9900 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
9901 enum based for corlib compilation.
9903 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
9906 * class.cs (FixedField.Define): Use ResolveAsConstant.
9908 * const.cs (IConstant): Interface constants and enums.
9909 (Const.ResolveValue): New method for constant resolvning.
9910 (ExternalConstant): Constants from imported assemblies.
9912 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
9913 conversion; like enums.
9914 (Constant.ToType): Converts this constant to different type.
9915 (Constant.Increment): Adds 1.
9917 * convert.cs (ImplicitConversionRequired): Simplified.
9919 * cs-parser.jay: Create EnumMember directly.
9921 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
9923 * doc.cs (GenerateEnumDocComment): Removed.
9925 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
9926 (ConvertIntLiteral): Removed.
9927 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
9929 * enum.cs (EnumMember): Implement IConstant.
9930 (Enum.IsValidEnumConstant): Removed.
9931 (Enum.GetNextDefaultValue): Removed.
9932 (Enum.FindMembers): Updated.
9933 (Enum.GenerateDocComment): Iterate enum members.
9935 * expression.cs (Cast.TryReduce): Handle enums correctly.
9936 (New.Constantify): Made public.
9937 (MemberAccess.DoResolve): Removed contant specific if(s).
9939 * literal.cs (NullLiteral): Implement new abstract methods.
9941 * statement.cs (GotoCase.Resolve): Use new constant methods.
9942 (SwitchLabel.ResolveAndReduce): Use new constant methods.
9944 * typemanager.cs (LookupEnum): Removed.
9945 (IsEnumType): Fixed to work with corlib.
9946 (RegisterConstant): Removed.
9947 (LookupConstant): Removed.
9948 (GetConstant): Changed to work with IConstant.
9950 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
9952 * location.cs : Fixed overflown (>255) column number.
9954 2005-08-03 Raja R Harinath <rharinath@novell.com>
9956 First cut of the qualified-alias-member feature.
9957 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
9959 * cs-parser.jay (DOUBLE_COLON): New token.
9960 (namespace_or_type_name): Add rule for recognizing
9961 qualified-alias-members.
9962 (primary_expression): Likewise.
9963 (element_access): Allow QualifiedAliasMember as a possible
9964 type-bearing expression.
9965 (local_variable_type, local_variable_pointer_type): Likewise.
9966 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
9967 aliases in the current and enclosing namespace declarations.
9968 (NamespaceEntry.UsingAlias): Add CS0440 warning.
9969 * decl.cs (MemberName.is_double_colon): New.
9970 (MemberName.MemberName): Add new constructor for alias-member.
9971 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
9972 * expression.cs (QualifiedAliasMember): New expression type.
9974 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
9976 * location.cs : it borked when no argument was specified.
9978 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
9980 * location.cs : tiny ToString() format fix.
9982 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
9984 * statement.cs : oops, it was missing.
9986 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
9988 A set of fixes for precise line/column location.
9991 "token" field now holds a file/line "delta", a line number offset
9992 from the segment, and a column number. See also:
9993 http://lists.ximian.com/pipermail/mono-devel-list/2004-
9994 December/009508.html
9995 Removed static IsNull. Use instance IsNull property instead.
9997 For some tokens it stores Location. For Identifier it stores
9998 LocatedToken which is a pair of string name and location.
9999 Column numbers are adjusted only at getChar().
10001 Use Location.ToString() for reporting (it now contains column).
10003 Largely modified to use LocatedToken instead of
10004 string (IDENTIFIER), and to acquire Location from some tokens.
10005 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10006 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10008 Now MemberName holds Location. DeclSpace.ctor() receives Location
10009 as a parameter. Removed extra parameters to all derived classes.
10010 Replaced Location.IsNull() with instance property.
10011 * assign.cs, expression.cs :
10012 Added .ctor() overload that omits Location.
10014 Added "nameEscaped" flag that indicates the identifier was escaped
10015 in the source file. This fixes bug #57047.
10017 2005-08-02 Marek Safar <marek.safar@seznam.cz>
10019 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10020 New method, looking for lo-case imported cls type.
10022 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10025 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10027 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10029 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10030 all_imported_types.
10031 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10033 Optimized to save 3.5 MB for SWF compilation.
10035 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10037 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10038 (PartialContainer.Create): Moved logic AddToContainer.
10039 (PartialContainer.MarkForDuplicationCheck): Shares name.
10041 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10044 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10046 (Namespace.GetSignatureForError): New method.
10048 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10049 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10051 2005-08-01 Raja R Harinath <rharinath@novell.com>
10054 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10055 member lookup rather than qualifier_type, since qualifier_type can
10058 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10060 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10063 2005-07-31 Miguel de Icaza <miguel@novell.com>
10065 * statement.cs: Copy the local exception into the exception
10066 captured local. Fixes 75674
10068 2005-07-31 Raja R Harinath <harinath@gmail.com>
10071 * expression.cs (Invocation.OverloadResolve): Don't report error
10072 CS1501 if error CS1502 has been reported.
10073 (New.DoResolve): Delegate CS1501 reporting to
10074 Invocation.OverloadResolve.
10077 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10078 invariant-meaning-in-block property in an enclosing block if
10081 2005-07-29 Marek Safar <marek.safar@seznam.cz>
10083 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10084 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10085 (Switch.CheckSwitch): Just save 50kb for SWF.
10087 2005-07-27 Martin Baulig <martin@ximian.com>
10089 * anonymous.cs (CaptureContext.AddField): Added
10090 `AnonymousContainer am' argument; compute its toplevel scope if
10091 it's not already computed. Fixes #75649.
10093 2005-07-26 Raja R Harinath <rharinath@novell.com>
10096 * class.cs (Constructor.Emit): Reset block to null if the block
10099 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10101 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10103 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10105 * class.cs (MethodData.Define): Check whether accessor implementing
10106 interface is public.
10108 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10110 2005-07-22 Marek Safar <marek.safar@seznam.cz>
10113 * namespace.cs (LookupType): Moved same type check to...
10115 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10116 with the same name.
10118 2005-07-21 Raja R Harinath <rharinath@novell.com>
10120 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10121 already found a typebuilder.
10122 * class.cs (MethodCore.IsDuplicateImplementation): Compare
10123 MemberNames, not strings.
10125 * const.cs (Error_ExpressionMustBeConst):
10126 Rename from Error_EpressionMustBeConst.
10127 * const.cs, class.cs, statement.cd: Update.
10129 2005-07-21 Marek Safar <marek.safar@seznam.cz>
10133 * const.cs (Const.LookupConstantValue): Report missing contant expression
10135 (Error_EpressionMustBeConstant): Only one error method.
10137 * class.cs, statement.c: Updated.
10139 2005-07-20 Raja R Harinath <rharinath@novell.com>
10141 * statement.cs (Block.Flags): Add back HasVarargs.
10142 (Block.flags): Make protected.
10143 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10145 * typemanager.cs (types, typecontainers, user_types): Remove.
10146 (UserTypes, TypeContainers): Likewise.
10147 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10148 (CleanUp, Reset): Update.
10149 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
10150 (GetNestedType): Use Type.GetNestedType.
10151 (CoreLookupType): Take two arguments, the namespace and the
10152 basename of the type. Update to use the Namespace.Lookup
10154 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10155 (RealMemberLookup): Use IsNestedChildOf instead of playing with
10156 string concatenation and substring matches.
10157 * class.cs, enum.cs, delegate.cs: Update to changes.
10159 2005-07-20 Marek Safar <marek.safar@seznam.cz>
10161 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10162 Expression and made virtual.
10164 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10165 (ImplicitStandardConversionExists): Fixed `byte' typo ?
10167 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10169 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10172 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10175 2005-07-18 Marek Safar <marek.safar@seznam.cz>
10178 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10179 AssemblyCultureAttribute is not used on executable.
10182 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10184 2005-07-16 Raja R Harinath <rharinath@novell.com>
10187 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10188 New. Reports CS0252/CS0253.
10189 Mostly taken from preliminary patch by Duncak Mak.
10190 (Binary.DoResolveOperator): Store results of operator lookup.
10191 Use them to detect if we need to warn about unintended reference
10194 2005-07-15 Raja R Harinath <rharinath@novell.com>
10197 * namespace.cs (Namespace.Lookup): Add back location parameter.
10198 (Namespace.LookupType): Add CS0436 report. Add location parameter.
10199 * delegate.cs, ecore.cs, expression.cs: Update to changes.
10201 * codegen.cs (EmitContext.DeclSpace): Make readonly.
10202 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10203 (Namespace.LookupType): ... this.
10204 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10206 * typemanager.cs (LookupTypeReflection): Remove buggy code that
10207 purported to handle pointers.
10208 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10211 2005-07-15 Marek Safar <marek.safar@seznam.cz>
10213 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10216 2005-07-15 Raja R Harinath <rharinath@novell.com>
10218 * namespace.cs (Namespace.Lookup): Drop location parameter.
10219 (NamespaceEntry.LookupAlias): Remove. Merge into ...
10220 (NamespaceEntry.Lookup): ... this.
10221 (NamespaceEntry.Error_AmbiguousTypeReference):
10222 Move here from DeclSpace.
10223 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10225 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10226 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10227 Move to NamespaceEntry.
10228 * delegate.cs, expression.cs: Update to changes.
10230 2005-07-14 Marek Safar <marek.safar@seznam.cz>
10232 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10233 CheckAttributeType and refactored.
10234 (Attribute.ResolvePossibleAttributeType): Changed to reuse
10235 ResolveAsTypeTerminal error handling.
10236 (ResolveAsTypeTerminal): Introduced because of global attributes extra
10238 (GetSignatureForError): Print errors in same way.
10241 * codegen.cs: Reflect attribute GetSignatureForError change.
10244 * expression.cs: Add silent parameter to ResolveAsTypeStep.
10246 * namespace.cs (UsingEntry): Refactored to make fields private.
10249 statement.cs: Error_UnexpectedKind has extra parameter.
10251 2005-07-14 Raja R Harinath <rharinath@novell.com>
10253 * ecore.cs (IAlias): Remove.
10254 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
10255 that implement the interface.
10256 * namespace.cs (Namespace): Likewise.
10257 (Namespace.declspaces): Renamed from 'defined_names'.
10258 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
10259 DeclSpace instead of an IAlias.
10260 * tree.cs (Tree.AddDecl): Update.
10262 2005-07-12 Raja R Harinath <rharinath@novell.com>
10264 * statement.cs (Block.Flags); Remove HasVarargs.
10265 (Block.HasVarargs): Move to ToplevelBlock.
10266 (Block.ThisVariable, Block.AddThisVariable): Likewise.
10267 (Block.Variables): Make protected. Initialize variable hashtable
10269 (Block.AddVariable): Update.
10270 (Block.Resolve): Update to changes.
10271 (ToplevelBlock.HasVarargs): New boolean.
10272 (ToplevelBlock.ThisVariable): Move here from Block.
10273 (ToplevelBlock.AddThisVariable): Likewise.
10274 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
10275 * expression.cs (This.ResolveBase): Update to changes.
10276 (ArglistAccess.DoResolve): Likewise.
10278 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10281 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10283 * class.cs (TypeContainer.VerifyMembers): Distinguish between
10284 not used and not used & assigned.
10285 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10287 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10290 * expression.cs (Is.DoResolve): null is never provided type.
10292 2005-07-08 Marek Safar <marek.safar@seznam.cz>
10295 * cs-parser.jay: Less strict event error rule to catch more errors.
10297 2005-07-08 Martin Baulig <martin@ximian.com>
10299 Fix test-iter-10.cs - distinguish whether we `yield' in a property
10300 gettter (allowed) or setter (not allowed).
10302 * class.cs (Accessor): Implement IIteratorContainer.
10303 (Accessor.Yields): New public field.
10304 (PropertyBase.PropertyMethod.Define): Handle iterators on a
10305 per-accessor basis.
10308 (get_accessor_declaration, set_accessor_declaration): Set the
10309 `yields' flag on the accessor, not the property.
10310 (property_declaration): Do the iterators check on a per-accessor
10311 basis and not for the whole property.
10313 2005-07-08 Martin Baulig <martin@ximian.com>
10315 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10316 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10318 2005-07-07 Marek Safar <marek.safar@seznam.cz>
10321 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10322 (ExtractSecurityPermissionSet): Cope with self referencing security
10323 attributes properly.
10325 * driver.cs (SetOutputFile): Made public property OutputFile.
10327 2005-07-07 Raja R Harinath <rharinath@novell.com>
10330 * class.cs (TypeContainer.first_nonstatic_field): Rename from
10331 has_nonstatic_fields. Make into a FieldBase pointer.
10332 (TypeContainer.AddField): Add CS0282 check.
10333 (TypeContainer.EmitType): Update.
10335 2005-07-06 Miguel de Icaza <miguel@novell.com>
10337 * cs-tokenizer.cs (consume_identifier): Do not create strings to
10338 compare if they start with __.
10340 2005-07-06 Raja R Harinath <rharinath@novell.com>
10342 * statement.cs (Switch.SwitchGoverningType): Only look at
10343 UserCasts that don't need implicit standard conversions to one of
10344 the allowed switch types (Fixes test-322.cs).
10345 (LocalInfo.Resolve): Re-enable sanity-test.
10347 2005-07-06 Marek Safar <marek.safar@seznam.cz>
10349 * cs-tokenizer.cs (consume_identifier): Detect double undescores
10351 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
10353 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
10355 2005-07-06 Raja R Harinath <rharinath@novell.com>
10358 * ecore.cs (SimpleName.GetSignatureForError): Add.
10359 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
10360 (MemberAccess.GetSignatureForError): Add.
10362 2005-07-05 Marek Safar <marek.safar@seznam.cz>
10364 The big error and warning messages review.
10394 * typemanager.cs: Updated.
10396 * class.cs: (MethodCore.SetYields): Moved here to share.
10397 (PropertyMethod.Define): Moved iterator setup here.
10399 * iterators.cs: Add orig_method to have full access to parent
10402 2005-07-05 Raja R Harinath <rharinath@novell.com>
10404 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
10405 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
10406 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
10407 variable of struct type.
10408 * expression.cs (Unary.ResolveOperator): Update to change.
10409 (Indirection.VerifyFixed): Likewise.
10410 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
10411 (ParameterReference.VerifyFixed): Value parameters are fixed.
10412 (This.VerifyFixed): Treat 'this' as a value parameter.
10413 * statement.cs (LocalInfo.IsFixed): Remove.
10415 2005-07-01 Martin Baulig <martin@ximian.com>
10417 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
10418 `ec.EmitThis ()' to get the correct scope.
10420 2005-07-01 Martin Baulig <martin@ximian.com>
10422 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
10423 instance is a ParameterReference; fixes #75299.
10425 2005-07-01 Martin Baulig <martin@ximian.com>
10427 Reverted Marek's latest patch (r46725):
10428 - it contains structural changes which are neither mentioned in
10429 the ChangeLog nor explained anywhere; for example the additional
10430 argument of EmitContext's and Iterator's .ctor's and the
10431 TypeContainer.DefineMembers() change.
10432 - structural changes like this should go in in seperate patches
10433 and not be hidden in a huge patch which just seems to affect
10434 warnings and errors.
10435 a big and hard to understand patch.
10436 - it breaks iterators and causes regressions, for instance in
10439 2005-06-30 Raja R Harinath <rharinath@novell.com>
10442 * expression.cs (Indexers.map): Remove.
10443 (Indexers.Append): Filter out inaccessible setters and getters.
10444 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
10447 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
10448 Refactored from ...
10449 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
10450 (FieldExpr.Emit, PropertyExpr.Emit): Update.
10451 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
10452 * expression.cs (Invocation.EmitCall): Add CS0120 check.
10454 2005-06-30 Marek Safar <marek.safar@seznam.cz>
10457 * class.cs (FieldBase.GetInitializerExpression): One more field
10460 2005-06-28 Miguel de Icaza <miguel@novell.com>
10462 * pending.cs: Do not define a proxy if the base method is virtual,
10463 it will be picked up by the runtime (bug 75270).
10465 2005-06-08 Martin Baulig <martin@ximian.com>
10467 The big Iterators rewrite :-)
10469 * iterators.cs: Rewrite this to use the anonymous methods framework.
10471 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
10472 before the TypeContainers; see 2test-21.cs.
10475 (TypeContainer.DefineType): Don't create a new EmitContext if we
10476 already have one (this only happens if we're an Iterator).
10477 (TypeContainer.Define): Also call Define() on all our iterators.
10478 (Method.CreateEmitContext): Added support for iterators.
10481 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
10482 (AnonymousContainer.CreateMethodHost): Moved here from
10483 AnonymousMethod and made abstract.
10484 (AnonymousContainer.CreateScopeType): New abstract method.
10485 (AnonymousContainer.IsIterator): New public property.
10486 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
10487 get the ScopeTypeBuilder rather than manually defining it here.
10488 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
10491 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
10492 before RootContext.DefineTypes().
10494 * codegen.cs (EmitContext.RemapToProxy): Removed.
10495 (EmitContext.CurrentAnonymousMethod): Changed type from
10496 AnonymousMethod -> AnonymousContainer.
10497 (EmitContext.ResolveTopBlock): Protect from being called twice.
10498 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
10499 (EmitContext.EmitThis): Removed the iterators hacks; use the
10500 anonymous methods framework for that.
10503 (ToplevelBlock.Container): Make this a property, not a field.
10504 (ToplevelBlock.ReParent): New public method; move the
10505 ToplevelBlock into a new container.
10506 (Foreach.TemporaryVariable): Simplify.
10508 2005-06-05 Martin Baulig <martin@ximian.com>
10510 * statement.cs (LocalInfo.CompilerGenerated): New flag.
10511 (Block.AddTemporaryVariable): New public method; creates a new
10512 `LocalInfo' for a temporary variable.
10513 (Block.EmitMeta): Create the LocalBuilders for all the temporary
10515 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
10516 non-iterator variables.
10518 2005-06-05 Martin Baulig <martin@ximian.com>
10520 * statement.cs (Foreach.TemporaryVariable): Create the
10521 LocalBuilder in the Emit phase and not in Resolve since in some
10522 situations, we don't have an ILGenerator during Resolve; see
10523 2test-19.cs for an example.
10525 2005-06-04 Martin Baulig <martin@ximian.com>
10527 **** Merged r45395 from GCS ****
10529 The big Foreach rewrite - Part II.
10531 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
10532 with `PropertyInfo ienumerator_getcurrent'.
10534 * codegen.cs (VariableStorage): Removed.
10537 (Foreach): Derive from Statement, not ExceptionStatement.
10538 (Foreach.CollectionForeach): New nested class. Moved all the code
10539 dealing with collection foreach here.
10540 (Foreach.ForeachHelperMethods): Removed.
10541 (Foreach.TemporaryVariable): Implement IMemoryLocation.
10543 2005-05-23 Martin Baulig <martin@ximian.com>
10545 * statement.cs (Try.DoResolve): Don't create a `finally' if we
10546 don't need to. Fix #75014.
10548 2005-05-20 Martin Baulig <martin@ximian.com>
10550 Merged r44808 from GMCS.
10552 * class.cs (TypeContainer.CircularDepException): Removed.
10553 (TypeContainer.DefineType): Removed the `InTransit' stuff.
10554 (TypeContainer.CheckRecursiveDefinition): Check for circular class
10555 (CS0146) and interface (CS0529) dependencies here.
10557 2005-06-21 Raja R Harinath <rharinath@novell.com>
10559 * expression.cs (Invocation.EmitCall): Fix initialization
10560 'this_call' to reflect current behaviour. Fix indentation.
10562 * convert.cs (FindMostEncompassedType): Add two trivial special
10563 cases (number_of_types == 0 || number_of_types == 1).
10564 (FindMostEncompasingType): Likewise.
10566 2005-06-17 Raja R Harinath <rharinath@novell.com>
10568 Some cleanups preparing for the fix of #75283.
10569 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
10571 (EventExpr.InstanceResolve): Likewise.
10572 (EventExpr.DoResolve): Remove redundant checks.
10574 2005-06-10 Duncan Mak <duncan@novell.com>
10576 * cs-tokenizer.cs (process_directives): New flag for controlling
10577 the processing of preprocessor directives.
10578 (x_token): After seeing a '#', return Token.NONE instead of going
10579 to handle_preprocessing_directive() when not processing
10580 directives. This avoids unnecessary processing during the token peek in
10585 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
10586 the existing error reporting methods instead of Report.Error.
10588 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
10589 after Raja's rewrite.
10591 2005-06-08 Miguel de Icaza <miguel@novell.com>
10593 * class.cs: Small fix.
10595 2005-06-08 Raja R Harinath <rharinath@novell.com>
10598 * class.cs (GetPartialBases): Fix return value check of
10599 part.GetClassBases.
10601 2005-06-07 Raja R Harinath <rharinath@novell.com>
10603 Ensure that partial classes are registered in their enclosing
10604 namespace. Initial part of fix of #75160.
10605 * tree.cs (Tree.RecordDecl): Add new namespace argument.
10606 Register declspace with namespace here, not in
10607 DeclSpace.RecordDecl.
10608 * cs-parser.jay: Pass namespace to RecordDecl.
10609 * class.cs (PartialContainer.Create): Likewise.
10610 (ClassPart.DefineType): New sanity-check. Throws an exception if
10612 * decl.cs (Declspace.RecordDecl): Remove.
10613 * namespace.cs (NamespaceEntry.DefineName): Remove.
10615 2005-06-06 Marek Safar <marek.safar@seznam.cz>
10617 * rootcontext.cs: Reset TargetExt as well.
10619 2005-06-03 Raja R Harinath <rharinath@novell.com>
10621 * ecore.cs (Expression.Resolve): Emit CS0654 error when
10622 -langversion:ISO-1.
10624 2005-06-02 Raja R Harinath <rharinath@novell.com>
10626 Fix #75080, cs0119.cs.
10627 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
10629 (Expression.Resolve): ... this. Use it. Remove bogus code
10630 allowing ExprClass.Type and ExprClass.Namespace for
10631 ResolveFlags.VariableOrValue.
10632 (Expression.Resolve) [1-argument variant]: Change default resolve
10633 flags based on language version.
10634 (Expression.Error_UnexpectedKind): Use a simple string array
10635 rather than an ArrayList.
10636 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
10637 not ExprClass.Type.
10638 (TypeOfVoid.DoResolve): Likewise.
10639 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
10640 flags argument -- it always has the same value.
10642 2005-05-31 Raja R Harinath <rharinath@novell.com>
10645 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
10646 Use it in the error message.
10647 * assign.cs, expression.cs, statement.cs: Update.
10649 2005-05-30 Raja R Harinath <rharinath@novell.com>
10652 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
10653 the "almostMatchedMember" case too.
10654 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
10655 that failed the accessibility checks to 'almost_match'.
10657 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
10659 * attribute.cs: Use internal MethodBuilder methods to set
10660 ExactSpelling and SetLastError on PInvoke methods, instead
10661 of passing them via charset. Fixes #75060.
10663 2005-05-27 Raja R Harinath <rharinath@novell.com>
10665 * parameter.cs (Parameter): Remove TODO comment.
10666 (Parameter.DefineParameter): Remove Location parameter.
10667 (Parameters.LabelParameters): Likewise.
10668 * class.cs (Constructor.Emit): Update to change.
10669 (MethodData.Emit): Likewise.
10670 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
10671 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
10673 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
10676 Removed Parameters.Location and added Parameter.Location instead.
10677 Removed Location parameter from Emit() and GetSignature().
10684 Modified all related calls.
10686 2005-05-26 Raja R Harinath <rharinath@novell.com>
10688 Improve user-defined conversion handling.
10689 * convert.cs (GetConversionOperators): Rewrite. Return only the
10690 applicable operators.
10691 (AddConversionOperators): New. Helper for GetConversionOperators.
10692 (FindMostEncompassedType, FindMostEncompassingType): Verify that
10693 there is only one most encompassed/encompassing type.
10694 (FindMostSpecificSource, FindMostSpecificTarget): Remove
10695 "applicable operator" handling.
10696 (UserConversion): Move cache here from GetConversionOperators.
10697 Directly cache the chosen operator, rather than the whole
10699 (ExplicitNumericConversion): Fix buggy implementation of Decimal
10700 case. Allow conversion of decimal to sbyte and byte too.
10701 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
10702 New static methods. Used to avoid allocating EmptyExpressions in
10705 2005-05-24 Duncan Mak <duncan@novell.com>
10707 * ecore.cs (CastFromDecimal): New class for casting a decimal to
10708 another class, used in Convert.ExplicitNumericConversion.
10709 (CastToDecimal): New class, similar to above, but casts to
10710 System.Decimal, used in Convert.ImplicitNumericConversion and also
10711 in explicit convesion from double/float to decimal.
10713 * convert.cs (ImplicitNumericConversion): Handle implicit
10714 conversions to System.Decimal.
10715 (ExplicitNumericConversion): handle explicit conversions to
10720 2005-05-20 Miguel de Icaza <miguel@novell.com>
10722 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
10723 know the type at this stage, just break through. Fixes #75008
10725 2005-05-19 Martin Baulig <martin@ximian.com>
10728 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
10729 to disable error reporting.
10731 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
10732 here since we don't want to report an error; see the new test-336.cs.
10734 2005-05-19 Raja R Harinath <rharinath@novell.com>
10736 * statement.cs (ToplevelBlock.GetParameterReference)
10737 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
10738 Move here from class Block.
10739 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
10740 * expression.cs (ParameterReference.DoResolveBase): Likewise.
10742 2005-05-18 Martin Baulig <martin@ximian.com>
10747 (FlowBranching.Reachability): Add non-static public And() and Or()
10749 (FlowBranchingSwitch): New class; do the `break_origins' thing
10750 like in FlowBranchingLoop.
10751 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
10752 reachability, not just locals and parameters.
10753 (FlowBranching.MergeChild): Remove some of the hacks for loop and
10754 switch; MergeBreakOrigins() now takes care of that.
10756 2005-05-18 Martin Baulig <martin@ximian.com>
10758 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10759 a loop and may leave it, reset the barrier; fixes #74974.
10761 2005-05-17 Marek Safar <marek.safar@seznam.cz>
10763 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
10766 * cs-parser.jay: Catch more lexical errors.
10768 * report.cs: Add one more Error method.
10771 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
10773 2005-05-17 Martin Baulig <martin@ximian.com>
10775 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
10778 2005-05-16 Raja R Harinath <rharinath@novell.com>
10780 Fix test-382.cs. Emit values of decimal constants.
10781 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
10783 (TypeContainer.AddField): ... this.
10784 (TypeContainer.EmitFieldInitializers): Allow the list of fields
10785 with initializers to include 'Const's.
10786 (ClassPart.RegisterFieldForInitialization): Forward to
10788 * const.cs (Const.Const): Pass initializer to base class.
10789 (Const.Define): In case of decimal constants, register them for
10790 initialization in a static constructor.
10792 2005-05-14 Martin Baulig <martin@ximian.com>
10794 * statement.cs (Block.Resolve): Correctly handle unreachable code;
10795 do not call ResolveUnreachable() on unreachable statements in
10796 here, see the comment in the source code.
10798 2005-05-13 Raja R Harinath <rharinath@novell.com>
10801 * expression.cs (BinaryResolveOperator): If one of the operands of
10802 an equality comparison is 'null' and the other is a pointer type,
10803 convert the null to a NullPointer.
10804 * convert.cs (ImplicitReferenceConversion): If the expression is a
10805 NullLiteral and the target type is a pointer type, return a
10806 NullPointer instead.
10807 (ImplicitConversionStandard): Likewise.
10809 2005-05-13 Marek Safar <marek.safar@seznam.cz>
10811 * cs-parser.jay: Set readonly context based on special constructs.
10813 * expression.cs (LocalVariableReference.DoResolveBase): Improved
10814 readonly variable error handling.
10816 * rootcontext.cs (EmitCode): Don't verify members when error
10819 * statement.cs (LocalInfo): Add reaodnly context information.
10820 (SetReadOnlyContext, GetReadOnlyContext): New methods.
10822 2005-05-13 Raja R Harinath <rharinath@novell.com>
10824 * statement.cs (Block.Resolve): Revert change below. Modify fix
10825 for #74041 to initialize 'resolved' to false only for explicit
10826 blocks. Fixes #74873.
10828 2005-05-12 Raja R Harinath <harinath@gmail.com>
10831 * typemanager.cs (unmanaged_enclosing_types): New.
10832 (IsUnmanagedType): Avoid infloops by using
10833 'unmanaged_enclosing_types' to talk with recursive invocations.
10835 2005-05-13 Martin Baulig <martin@ximian.com>
10837 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
10838 instance variable, not a local. Fix #74873.
10839 (Block.ResolveUnreachable): Set it to true here.
10841 2005-05-11 Duncan Mak <duncan@novell.com>
10843 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
10844 continuing to process for 'arg'.
10845 (handle_preprocessing_directive): Check the argument of the #endif
10846 directive and report error CS1025 if there are any trailing
10849 According to the C# spec, having even whitespace after the #endif
10850 directive is illegal; however, because we call arg.TrimEnd ()
10851 beforehand, we have the same behavior as csc, allowing whitespace
10852 after the directive.
10856 2005-05-11 Marek Safar <marek.safar@seznam.cz>
10860 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
10861 (Constructor.GetObsoleteAttribute): Implemented correctly.
10863 2005-05-10 Martin Baulig <martin@ximian.com>
10865 * support.cs (ReflectionParameters.ParameterModifier): Use
10866 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
10867 and `ParameterAttributes.In'. Fixes #74884.
10869 2005-05-10 Marek Safar <marek.safar@seznam.cz>
10871 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
10873 * expression.cs (Argument.GetParameterModifier): Turned to property.
10874 (Invocation.Error_InvalidArguments): Add more descriptive errors.
10876 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
10879 2005-05-09 Raja R Harinath <rharinath@novell.com>
10882 * decl.cs (MemberCache.AddMethods): Register override methods,
10883 rather than non-override methods.
10884 * typemanager.cs (RegisterOverride): New.
10885 (IsOverride): Update.
10887 2005-05-09 Marek Safar <marek.safar@seznam.cz>
10891 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
10892 recursive declaration.
10894 * statement.cs (Block.ResolveMeta): Report any error in resolving.
10896 2005-05-06 Marek Safar <marek.safar@seznam.cz>
10898 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
10900 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
10902 2005-05-05 Raja R Harinath <rharinath@novell.com>
10905 * decl.cs (DeclSpace.FamilyAccessible):
10906 Use TypeManager.IsNestedFamilyAccessible.
10908 Fix reopened #64812.
10909 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
10912 2005-05-04 Raja R Harinath <rharinath@novell.com>
10913 Abin Thomas <projectmonokochi@rediffmail.com>
10914 Anoob V E <projectmonokochi@rediffmail.com>
10915 Harilal P R <projectmonokochi@rediffmail.com>
10918 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
10919 allow access to all static members.
10921 2005-05-04 Martin Baulig <martin@ximian.com>
10923 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
10925 2005-05-04 Martin Baulig <martin@ximian.com>
10929 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
10930 section at the end; make things work if `default' is not the last
10933 2005-05-04 Martin Baulig <martin@ximian.com>
10937 * statement.cs (Switch): Replaced the `got_default' field with a
10938 `default_section' one.
10939 (Switch.CheckSwitch): Set `default_section' here.
10940 (Switch.Resolve): If we're a constant switch and the constant is
10941 not found, use the default section.
10943 2005-05-03 Martin Baulig <martin@ximian.com>
10945 * expression.cs (ArrayAccess.EmitGetLength): New public method.
10947 * statement.cs (Foreach.ArrayForeach): New nested class.
10948 (Foreach.TemporaryVariable): New nested class.
10949 (Foreach.EmitArrayForeach): Removed; this is now in the new
10950 ArrayForeach class.
10952 2005-05-03 Raja R Harinath <rharinath@novell.com>
10954 * pending.cs (BaseImplements): Move the #74773 fix here. This is
10956 (VerifyPendingMethods): Revert change below.
10958 * typemanager.cs (IsOverride, RegisterNonOverride): New.
10959 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
10960 that used to trigger warning -28. Remove warning -28.
10961 * expression.cs (Invocation.OverloadResolve): Use
10962 TypeManager.IsOverride to distinguish override methods.
10965 * pending.cs (VerifyPendingMethods): If a base type implements the
10966 requested interface, don't bother checking individual methods of
10967 the base type. As a side-effect, this prevents the creation of
10968 unnecessary proxies.
10970 2005-05-02 Martin Baulig <martin@ximian.com>
10974 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10975 Also `And' the locals if the old vector is null.
10976 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
10977 null; in this case we basically reset all the variables.
10979 2005-05-02 Martin Baulig <martin@ximian.com>
10983 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
10984 Added `FlowBranching branching' argument; always `and' the
10985 variables instead of `or'ing them unless we're an infinite loop.
10987 * statement.cs (While.Resolve): Create a new sibling unless we're
10990 2005-05-02 Martin Baulig <martin@ximian.com>
10994 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
10995 arguments; use it instead of creating a new TopLevelBlock.
10996 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
10997 our ConstructorInitializer.
11000 (TopLevelBlock.TopLevelBranching): New public property.
11001 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11002 and create our `TopLevelBranching'.
11004 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11005 anonymous method host, use `block.TopLevelBranching' rather than
11006 creating a new branching.
11008 2005-04-20 Miguel de Icaza <miguel@novell.com>
11010 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11011 a ScopeInfo, if any of the current children is a child of the new
11012 entry, move those children there.
11014 2005-04-30 Martin Baulig <martin@ximian.com>
11016 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11017 at the beginning of a SwitchSection. Fix #73335.
11019 2005-04-27 Marek Safar <marek.safar@seznam.cz>
11022 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11024 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11025 (FieldExpr.DoResolve): Obsolete members are ignored for field
11028 2005-04-26 Marek Safar <marek.safar@seznam.cz>
11030 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11031 of arrays detection.
11033 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11035 (Field.VerifyClsCompliance): Volatile fields are not compliant.
11037 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11040 2005-04-25 Ben Maurer <bmaurer@ximian.com>
11042 * cs-parser.jay: Use the prefered version of -unsafe in error
11045 2005-04-22 Marek Safar <marek.safar@seznam.cz>
11047 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11050 2005-04-20 John Luke <john.luke@gmail.com>
11052 * driver.cs: fix typo in error message, --outout to --output
11054 2005-04-20 Marek Safar <marek.safar@seznam.cz>
11056 * codegen.cs (InRefOutArgumentResolving): New field.
11058 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11059 fields outside contructor.
11061 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11063 2005-04-19 Miguel de Icaza <miguel@novell.com>
11065 * anonymous.cs (CaptureContext.EmitParameterInstance): The
11066 parameter code was not completed ever, so it was not as up-to-date
11067 as local variables. Must finish it.
11069 The bug fix was to compare the Toplevel of the block, not the
11070 current block. Thanks for Ben for pointing this out.
11072 2005-04-19 Raja R Harinath <rharinath@novell.com>
11074 * decl.cs (AddMethods): Use the declaring type of the problem
11075 method to determine if we want to squash a warning.
11077 2005-04-19 Marek Safar <marek.safar@seznam.cz>
11079 * attribute.cs: Removed debug output.
11081 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11083 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11086 2005-04-18 Raja R Harinath <rharinath@novell.com>
11089 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11090 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11091 all null comparisons against reference types.
11093 2005-04-18 Marek Safar <marek.safar@seznam.cz>
11096 * class.cs (TypeContainer.CircularDepException) New nested
11098 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11099 (TypeContainer.DefineType): Removed error, reset InTransit before
11101 (Class.DefineType): Throw exception when is in Transit.
11102 Catch exception and report error.
11103 (Struct.DefineType): Throw exception when is in Transit.
11104 Catch exception and report error.
11105 (Interface.DefineType): Throw exception when is in Transit.
11106 Catch exception and report error.
11108 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11109 handle nested exception handlers.
11111 * flowanalysis.cs (InTryWithCatch): New method, search for try with
11114 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11115 InFinally and InCatch storage.
11117 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11118 (Catch.Resolve): Set and Restore ec.InCatch.
11119 (Try.Resolve): Set and Restore ec.InFinally.
11120 (Try.HasCatch): True when try has catch.
11122 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
11124 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11125 for the same event member, so exclude such cases from warning 419.
11128 2005-04-16 Miguel de Icaza <miguel@novell.com>
11130 * expression.cs (Binary.ResolveOperator): Apply patch from John
11131 Luke to fix bug 59864: operators &, | and ^ on enumerations
11132 require that the same enum type on both sides.
11134 * driver.cs: Add warnings to old flag usage, this is to assist
11135 people who produce Makefiles and hope that the Makefiles will be
11138 * class.cs (TypeContainer.EmitType): Moved the definition of the
11139 special $PRIVATE$ field from the resolve phase to the Emit phase.
11140 During resolve we do not know if we are a struct with
11141 HasExplicitLayout, we know this only after the attributes for the
11144 Set the FieldOffset to zero on the dummy field that we create for
11145 the class. Fixes 74590.
11147 2005-04-16 Raja R Harinath <rharinath@novell.com>
11150 * ecore.cs (PropertyExpr.resolved): New.
11151 (DoResolve): Use it to handle a case of double resolution here.
11152 Handle a case of identical-name-and-type-name.
11153 * expression.cs (ArrayCreation.CheckIndices): Avoid double
11154 resolution by storing the results of expression resolution back
11155 into the "probes" array.
11157 2005-04-15 Raja R Harinath <rharinath@novell.com>
11159 Fix cs0208-7.cs and cs0208-8.cs.
11160 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11161 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
11162 error reporting to point out the reason a struct is not unmanaged.
11164 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11166 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
11167 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11169 2005-04-13 Raja R Harinath <rharinath@novell.com>
11172 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11173 IdenticalNameAndTypeName here.
11174 (EventExpr.InstanceResolve): Likewise.
11176 2005-04-13 Marek Safar <marek.safar@seznam.cz>
11178 C# 2.0 DefaultCharSetAttribute implementation
11180 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11181 which allows us to set GlobalNamespace for every resolve.
11182 (Attribute.ResolveArguments): Cut from Resolve.
11183 (Attribute.GetCharSetValue): Returns CharSet named argument.
11184 (Attribute.DefinePInvokeMethod): Gets default charset from
11186 (GlobalAttribute.ResolveAsTypeStep): Override.
11187 (GlobalAttribute.ResolveArguments): Override.
11189 * class.cs (TypeAttr): Is protected.
11191 * codegen.cs (ModuleClass.DefaultCharSet): New member.
11192 (ModuleClass.DefaultCharSetType): New memeber.
11193 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11195 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11196 charset from module.
11198 * delegate.cs (TypeAttr): Override.
11199 (Delegate.DefineType): Use this TypeAttr.
11201 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11202 at very early stage (before types are defined) to resolve model
11203 module attributes. It will probably not work with corlib but it
11206 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11207 charset from module.
11209 * typemanager.cs (default_charset_type): New type.
11211 2005-04-13 Raja R Harinath <rharinath@novell.com>
11213 * decl.cs (MemberCache.AddMethods): Don't warn if
11214 System.Object.Finalize has buggy MethodAttributes.
11216 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11219 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11221 * doc.cs : detect ambiguous reference to overloaded members.
11222 Fixed bug #71603. MS 1.1 csc does not detect it.
11224 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11226 * doc.cs : delegates must not be referenced with parameters.
11229 2005-04-12 Miguel de Icaza <miguel@novell.com>
11231 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11233 2005-04-10 Miguel de Icaza <miguel@novell.com>
11235 * driver.cs (MainDriver): Stop processing if the CLS stage found
11238 (CompilerCallableEntryPoint.InvokeCompiler): Always
11239 reset after execution; Take a TextWriter argument for the
11242 * report.cs: Use the error stream instead of hardcoding stderr.
11244 2005-04-09 Miguel de Icaza <miguel@novell.com>
11246 * class.cs: Reduce code paths to test, too small of an
11247 optimization to make it worth the extra testing. Always perform
11250 2005-04-08 Raja R Harinath <rharinath@novell.com>
11253 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11254 operators that had errors reported on them.
11256 2005-04-08 Marek Safar <marek.safar@seznam.cz>
11258 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11260 (Attribute.Resolve): Add named argument type checking.
11262 * class.cs (FixedField.Define): Use IsPrimitiveType
11264 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11266 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11267 unsafe parameter types.
11269 * statement.cs (Using.ResolveExpression): Add better error description.
11271 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11273 2005-04-08 Raja R Harinath <rharinath@novell.com>
11276 * attribute.cs (Attribute.GetAttributeUsage): Resolve
11277 AttributeUsageAttribute in the emitcontext of the attribute class,
11278 not in the emitcontext of the attributable entity it was attached to.
11279 * cs-parser.jay: Use 'current_class', not 'current_container',
11280 when creating a GlobalAttribute.
11282 2005-04-08 Alp Toker <alp@atoker.com>
11284 * pending.cs: The fix to #58413 failed to compile methods implementing
11285 interfaces with/without params modifiers and vice versa, even though
11286 params modifiers aren't part of the signature. Make the modifier check
11287 less strict as in csc.
11289 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
11290 Anoob V E <projectmonokochi@rediffmail.com>
11291 Harilal P R <projectmonokochi@rediffmail.com>
11294 * pending.cs (TypeAndMethods.mods): New. Store the parameter
11295 modifiers of pending methods.
11296 (PendingImplementation.PendingImplementation): Initialize it.
11297 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11298 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11299 with ParameterData. Add check for modifiers.
11300 * class.cs (MethodData.Define): Update to changes.
11302 2005-04-07 Raja R Harinath <rharinath@novell.com>
11304 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11306 2005-04-07 Marek Safar <marek.safar@seznam.cz>
11308 * class.cs (PropertyMethod.Define): Check private accessor in abstract
11311 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11314 * typemanager.cs: Registered RequiredAttributeAttribute.
11316 2005-04-06 Marek Safar <marek.safar@seznam.cz>
11318 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11319 Warning CS0169 is back at level 3.
11320 (IMethodData.SetMemberIsUsed): New method.
11322 * decl.cs (IsUsed): New value; moved from FieldBase.Status
11323 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
11325 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
11327 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
11329 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
11332 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
11335 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
11336 to avoid the problems with nested types.
11338 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
11339 Anoob V.E <projectmonokochi@rediffmail.com>
11340 Harilal P.R <projectmonokochi@rediffmail.com>
11341 Raja R Harinath <rharinath@novell.com>
11344 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
11346 * typemanager (GetConstructor): Make public.
11348 2005-04-05 John Luke <john.luke@gmail.com>
11349 Raja R Harinath <rharinath@novell.com>
11352 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
11353 struct too. Return false quicker in a few cases.
11354 (VerifyUnManaged): Use it.
11356 2005-04-05 Raja R Harinath <rharinath@novell.com>
11359 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
11360 not 'unreachable_seen'.
11362 2005-04-04 Marek Safar <marek.safar@seznam.cz>
11364 * attribute.cs (Attribute.GetValue): Removed unused.
11366 * codegen.cs (CodeGen.TrimExt): Removed unused.
11368 * cs-parser.jay (output): Removed unused.
11370 * cs-tokenizer.cs (hex_digits): Removed unused.
11372 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
11374 * expression.cs (Indirection.LoadExprValue): Removed unused.
11375 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
11377 * iterators.cs (Iterator.param_types): Removed unused.
11379 * statement.cs (Goto.block): Removed unused.
11380 (ToplevelBlock.did): Removed unused.
11381 (Switch.ResolveConstantSwitch): Removed unused.
11383 2005-04-01 Ben Maurer <bmaurer@ximian.com>
11385 * rootcontext.cs: Allow mcs to bootstrap with the compilation
11388 2005-04-01 Raja R Harinath <rharinath@novell.com>
11390 Fix #74232 and cs0208-3.cs.
11391 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
11392 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
11393 unmanaged type. Don't use FieldBuilders when 't' is a
11394 TypeBuilder. Use ModFlags and MemberType fields.
11395 * class.cs (MemberBase.member_type): Rename from MemberType.
11396 (MemberBase.MemberType): New property. Determines member_type on
11398 (MemberBase.DoDefine): Don't initialize MemberType here.
11399 (FieldMember.Define): Likewise.
11401 2005-04-01 Marek Safar <marek.safar@seznam.cz>
11404 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
11405 Attributes are emitted there.
11407 2005-04-01 Raja R Harinath <rharinath@novell.com>
11409 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
11410 keyword in 'partial enum' too.
11411 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
11413 Report from Kamil Skalski <nazgul@omega.pl>.
11416 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
11417 have partial containers too.
11419 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
11420 in block' checks to Block.CheckInvariantMeaningInBlock.
11421 * statement.cs (Block.GetKnownVariableInfo): Make private.
11422 (Block.IsVariableUsedInChildBlock): Remove.
11423 (Block.IsVariableUsedInBlock): Likewise.
11424 (Block.CheckInvariantMeaningInBlock): New. Show location of
11425 conflicting declaration.
11426 (Block.AddVariable): Make error messages less long-winded and more
11427 specific. Show location of conflicting declaration.
11428 * parameter.cs (Parameters.Location): New readonly property.
11430 2005-03-31 Raja R Harinath <rharinath@novell.com>
11432 Clean up semantics of invoking ResolveMemberAccess.
11433 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
11434 can have an instance, ensure that we pass in a non-TypeExpression
11435 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
11436 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
11437 argument. Update to changes and simplify.
11438 (FieldExpr.Emitinstance): Remove CS0120 check.
11439 (PropertyExpr.EmitInstance): Likewise.
11440 * expression.cs (Argument.Resolve): Likewise.
11441 (Invocation.DoResolve): Update to changes in semantics of
11442 InstanceExpression.
11444 2005-03-31 Marek Safar <marek.safar@seznam.cz>
11447 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
11450 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
11452 2005-03-31 Raja R Harinath <rharinath@novell.com>
11454 Fix difference in behaviour with commandline invocation.
11455 * driver.cs (Driver.Reset): New.
11456 (CompilerCallableEntryPoint): Call it.
11458 * statement.cs (If.Resolve): Avoid spurious "uninitialized
11459 variable" warnings if the boolean expression failed to resolve.
11461 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
11463 * attribute.cs: Fix the union of several permissions when some of them
11464 are unrestricted (so the result isn't an unrestricted permission set).
11467 2005-03-30 Raja R Harinath <rharinath@novell.com>
11469 * ecore.cs (MemberExpr): New class. Convert from interface
11471 (MemberExpr.ResolveMemberAccess): Refactor and move here from
11472 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
11474 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
11475 (MethodGroupExpr.IsExplicitImpl): Remove.
11476 (Expression.GetFieldFromEvent): Remove.
11477 (SimpleName.MemberStaticCheck): Remove.
11478 (SimpleName.DoSimpleNameResolve): Update to changes.
11479 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
11480 (MemberAccess.IdenticalNameAndTypeName): Remove.
11481 (MemberAccess.error176): Move to MemberExpr.
11482 (MemberAccess.DoResolve): Update to changes.
11483 (BaseAccess.DoResolve): Likewise.
11485 2005-03-30 Marek Safar <marek.safar@seznam.cz>
11487 C# 2.0 Conditional attribute class implementation
11489 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
11490 Analyzes class whether it has attribute which has ConditionalAttribute
11491 and its condition is not defined.
11493 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
11494 (Class.IsExcluded): New method. Search for at least one defined
11495 condition in ConditionalAttribute of attribute class.
11497 2005-03-30 Raja R Harinath <rharinath@novell.com>
11499 * ecore.cs (PropertyExpr): Derive from Expression, not
11500 ExpressionStatement.
11501 (PropertyExpr.EmitStatement): Remove.
11503 2005-03-29 Raja R Harinath <rharinath@novell.com>
11506 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
11507 internal field "value__" of an enum be private. The examples for
11508 "value__" that I found on MSDN all used FieldAttributes.Private.
11510 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
11511 Don't mention IL method attribute names.
11513 Fix #47991. Remove a TODO.
11514 * statement.cs (Block.Toplevel): Make into a field.
11515 (Block.Parameters): Move into ToplevelBlock.
11516 (Block.known_variables): Rename from child_variable_names.
11517 (Block.Block): Remove variants that take Parameters. Initialize
11518 'Toplevel' with the immediately surrounding toplevel block.
11519 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
11520 LocalInfo parameter.
11521 (Block.GetKnownVariableInfo): New.
11522 (Block.IsVariableNameUsedInChildBlock): Update.
11523 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
11524 the block, even though it may not be in scope.
11525 (Block.AddVariable): Remove Parameters parameter. Use
11526 Toplevel.Parameters instead.
11527 (Block.AddConstant): Remove Parameters parameter.
11528 (Block.GetParameterReference): Update to use Toplevel.Parameters.
11529 (Block.IsParamaterReference): Likewise.
11530 (Block.IsLocalParameter): Likewise. Simplify a lot.
11531 (ToplevelBlock.Parameters): New. Moved from Block.
11532 (ToplevelBlock.ToplevelBlock): Update to changes. Always
11533 initialize Parameters to a non-null value.
11534 * cs-parser.jay: Update to changes.
11535 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
11536 simple names that mean different things in the same block. Use
11537 Block.IsVariableNameUsedInBlock.
11539 2005-03-28 Raja R Harinath <rharinath@novell.com>
11541 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
11542 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
11543 GetTypeHandle. It is possible for a reflected type to derive from
11544 a TypeBuilder (e.g., int[] derives from the TypeBuilder
11545 System.Array during mscorlib compilation).
11546 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
11547 contain a method_hash, don't create one either. Don't create a
11548 deep copy of the base cache's method_hash.
11549 (MemberCache.SetupCache): Rename back from DeepCopy.
11550 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
11551 already initialized. If we see an override function, add its
11552 underlying base virtual function to the member_hash too.
11554 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
11556 2005-03-26 Raja R Harinath <harinath@acm.org>
11559 * assign.cs (Assign.DoResolve): When the RHS of an assignment
11560 fails to resolve, ensure that the LHS is still resolved as an
11563 2005-03-25 Raja R Harinath <harinath@acm.org>
11565 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
11567 (Enum.current_ec): Remove.
11568 (Enum.LookupEnumValue): Remove EmitContext argument.
11569 Just uses the one created during DefineType.
11570 (Enum.FindMembers): Update.
11571 * expression.cs (MemberAccess.DoResolve): Update.
11573 2005-03-22 Marek Safar <marek.safar@seznam.cz>
11575 * assign.cs (Assign.DoResolve): Check for CS1717 when
11576 source and target are same (uses Equals).
11578 * expression.cs (LocalVariableReference, ParameterReference,
11579 This): Implemented Equals, GetHashCode.
11581 * statement.cs (Block.GetParameterReference): Removed useless
11584 2005-03-22 Raja R Harinath <rharinath@novell.com>
11587 * statement.cs (Block.AddVariable): Ensure that we skip implicit
11588 blocks before deciding whether the error is cs0136 or cs0128.
11590 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
11591 (using_alias_directive, using_namespace_directive): Pass
11592 MemberName, not an expression to Namespace.UsingAlias and
11594 (MakeName): Use the MemberName of the namespace.
11595 * namespace.cs (Namespace.MemberName): New.
11596 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
11597 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
11599 * decl.cs (MemberName.Name): Make readonly.
11600 (MemberName.FromDotted): New "constructor".
11601 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
11602 (MemberCore.Name): Compute from MemberName on demand.
11603 (MemberCore.SetMemberName): Provide a way to change the
11605 (MemberCore.AddToContainer): Don't take a fullname parameter.
11606 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
11607 fully qualified name of the container to the member name.
11608 (TypeContainer.AddToTypeContainer): Use a fully qualified name
11609 only if the type is a member of the root container.
11610 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
11611 MemberName.Left rather than searching for an embedded ".".
11612 (PartialContainer.CreatePart): Update to changes in RootContext.
11613 (MemberBase.ShortName): Turn into a property. Use
11614 MemberCore.SetMemberName.
11615 (MemberBase.ExplicitInterfaceName): Remove.
11616 (MemberBase.UpdateMemberName): Remove.
11617 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
11618 (PropertyBase.SetMemberName): New override.
11619 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
11620 (Tree.GetDecl): New.
11621 (Tree.AllDecls): Rename from Decls.
11622 * attribute.cs, enum.cs, report.cs: Update to changes.
11623 * driver.cs (MainDriver): Use MemberName.FromDotted on
11624 RootContext.MainClass.
11626 2005-03-21 Marek Safar <marek.safar@seznam.cz>
11628 * class.cs (FixedField.Define): Check for CS1664 and more sanity
11631 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
11633 2005-03-18 Marek Safar <marek.safar@seznam.cz>
11635 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
11636 property accessor modifiers.
11638 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
11639 fixed buffer attribute (CS1716).
11640 (PropertyMethod.HasCustomAccessModifier): When property accessor
11641 has custom modifier.
11643 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
11645 (PropertyExpr.DoResolveLValue): Add CS0272.
11647 2005-03-17 Miguel de Icaza <miguel@novell.com>
11649 * convert.cs: When converting to a pointer, use the proper Conv.U
11650 or Conv.I depending on the source data type.
11652 * cs-tokenizer.cs: Make the size for large decimal constants,
11655 2005-03-17 Martin Baulig <martin@ximian.com>
11657 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
11658 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
11660 2005-03-17 Martin Baulig <martin@ximian.com>
11662 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
11663 to bool so we can return an error condition.
11664 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
11667 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
11669 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
11672 2005-03-16 Raja R Harinath <rharinath@novell.com>
11674 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
11675 Refactor to avoid traversing the list of assemblies, and to avoid
11676 string concatenation.
11677 * typemanager.cs (guid_attr_type): Remove.
11678 (negative_hits, pointers, references): Remove hashes.
11680 (GetConstructedType): New. Uses type_hash to handle constructed
11681 types (arrays, references, pointers).
11682 (GetReferenceType, GetPointerType): Use it.
11683 (GetNestedType): New. Uses type_hash to handle nested types of
11685 (LookupType, LookupTypeDirect): Remove.
11686 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
11687 'types' hash and LookupTypeReflection directly.
11688 (params_string, params_object): Use GetConstructedType.
11689 * namespace.cs (Namespace.cached_types): New. Cache of reflected
11691 (Namespace.Lookup): Use cached_types.
11692 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
11693 provided by old TypeManager.LookupType.
11694 * rootcontext.cs (MakeFQN): Remove.
11695 * decl.cs (DeclSpace.MakeFQN): Likewise.
11696 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
11697 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11698 TypeManager.GetConstructedType.
11699 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
11701 2005-03-15 Marek Safar <marek.safar@seznam.cz>
11703 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
11706 * cs-parser.jay: Reports CS1527 for any namespace element.
11708 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
11711 * expression.cs (ParameterReference.IsAssigned): Changed error to
11713 (Error_WrongNumArguments): Moved CS0245 detection here.
11715 * statement.cs (Return.Resolve): Add CS1622 report.
11717 2005-03-11 Marek Safar <marek.safar@seznam.cz>
11719 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
11721 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
11723 * attribute.cs expression.cs: Get rid of some allocations.
11725 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
11727 * doc.cs : just eliminate the latest change.
11729 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
11731 * doc.cs : commented out the latest change. It breaks xml-030.cs
11733 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
11735 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
11736 fail. So invoke CreateType() in FindDocumentedType().
11738 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
11740 * cs-tokenizer.cs : added IsKeyword().
11741 * doc.cs : Detect keyword incorrectly used as identifier.
11742 Allow identifiers prefixed by @.
11744 2005-03-10 Marek Safar <marek.safar@seznam.cz>
11746 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
11747 It caused exception in namespace resolving (again!).
11749 * class.cs (Class.ctor): Removed exit.
11750 (PropertyMethod.ctor): ditto.
11752 * codegen.cs (Codegen.Reset): Reset static data.
11753 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
11755 * cs-tokenizer.cs (Cleanup): Removed.
11757 * driver.cs (GetSystemDir): Rewrote to one line command.
11758 It caused problem with unloaded dynamic modules.
11759 (UnixParseOption): Removed Exit.
11760 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
11761 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
11762 Now can be mcs used as library.
11764 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
11767 * location.cs (Reset): Reset static data.
11769 * namespace.cs (Reset): Reset static data.
11771 * report.cs (Report.Reset): Reset static data.
11773 * rootcontext.cs (RootContext.Reset): Reset static data.
11775 * tree.cs (RootTypes.ctor): Use Location.Null
11777 * typemanager.cs (TypeManager.Reset): Reset static data.
11778 (CoreLookupType): Removed Exit.
11779 (TypeHandle.Reset): Reset static data.
11781 2005-03-10 Raja R Harinath <rharinath@novell.com>
11784 * typemanager.cs (ComputeNamespaces): Import namespaces from
11785 referenced modules too.
11787 2005-03-09 Raja R Harinath <rharinath@novell.com>
11789 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
11792 2005-03-09 Raja R Harinath <rharinath@novell.com>
11794 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
11795 enclosing DeclSpace. This ensures that a name-lookup populates
11796 more caches and there are fewer 'TypeExpression's. Carve out
11797 nested type lookup into ...
11798 (LookupNestedTypeInHierarchy): ... this.
11800 2005-03-09 Raja R Harinath <rharinath@novell.com>
11802 Clean up a few partial-class semantics.
11803 Fixes test-357.cs and cs1618-2.cs.
11804 * cs-parser.jay (struct_declaration): Use 'current_class' as
11805 parent of newly-created struct. Remove call to Register ().
11806 Use 'pop_current_class' to complete handing the current struct.
11807 (interface_declaration): Likewise.
11808 (class_declaration): Likewise.
11809 (enum_declaration): Use 'current_class' as parent of newly created
11811 (delegate_declaration): Likewise.
11812 (pop_current_class): New function. This is used to handle closing
11813 up the 'current_class' and 'current_container', and pointing them
11814 to the enclosing class/container.
11815 (CSharpParser): Initialize 'current_class' too.
11816 * decl.cs (MemberCore): Add check for invariant: a partial
11817 container is not a parsed entity, and thus does not enclose any
11819 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
11820 (DeclSpace.BaseTypeExpr): Use it.
11821 (DeclSpace.LookupType): Add check for invariant.
11822 * class.cs (TypeContainer): Add check for invariant: a nested
11823 class should have the same NamespaceEntry as its enclosing class.
11824 (TypeContainer.EmitFieldInitializers): Make virtual.
11825 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
11827 (TypeContainer.Register): Remove.
11828 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
11829 null. Use TypeResolveEmitContext for resolving base types and
11830 interfaces. Move initialization of Parts.TypeBuilder here from
11832 (TypeContainer.DefineNestedTypes): ... here.
11833 (PartialContainer): Take a Namespace not a NamespaceEntry.
11834 (PartialContainer.Create): Don't use Register. Call the
11835 appropriate Add... function directly.
11836 (ClassPart): Take both the PartialContainer and the enclosing
11837 class as constructor arguments.
11838 (ClassPart.EmitFieldInitializers): Override.
11839 (ClassPart.PartFindNestedTypes): Remove.
11840 (FieldBase.GetInitializerExpression): Resolve the initializer
11841 expression in the emit context of the enclosing class.
11842 * tree.cs (RootTypes): Remove Register ().
11844 2005-03-08 Marek Safar <marek.safar@seznam.cz>
11846 * cs-parser.jay: Removed CS0134.
11848 * driver.cs: Removed CS1901.
11850 * expression.cs (SizeOf.DoResolve): Don't report CS0233
11851 for predefined types.
11853 2005-03-07 Duncan Mak <duncan@novell.com>
11855 * codegen.cs (Save): Catch UnauthorizedAccessException as
11856 well. Fixes bug #73454.
11858 2005-03-07 Marek Safar <marek.safar@seznam.cz>
11860 * cs-tokenizer.cs (xtoken): Add CS1035.
11862 * class.cs (MethodData.Define): Add CS0683.
11863 (FieldMember.ctor): Add CS0681.
11865 2005-03-07 Raja R Harinath <rharinath@novell.com>
11867 * ecore.cs (SimpleName.DoResolve): Rename from
11868 SimpleName.DoResolveAllowStatic.
11869 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
11870 Pass 'intermediate' flag to MemberStaticCheck.
11871 (SimpleName.MemberStaticCheck): Skip "static check" only in case
11872 of "intermediate" lookups via MemberAccess.
11873 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
11874 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
11876 2005-03-07 Raja R Harinath <rharinath@novell.com>
11879 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
11880 slipped in because of variable names that are identical to a
11881 builtin type's BCL equivalent ('string String;', 'int Int32;').
11882 (PropertyExpr.EmitInstance): Likewise.
11884 2005-03-04 Marek Safar <marek.safar@seznam.cz>
11886 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
11888 * report.cs (warning_ignore_table): Made public.
11890 2005-03-04 Raja R Harinath <rharinath@novell.com>
11893 * class.cs (MethodData.Emit): Pass 'container' to
11894 container.GetObsoleteAttribute instead of 'container.Parent'.
11896 2005-03-03 Marek Safar <marek.safar@seznam.cz>
11898 * cs-parser.jay: Add 1534 error test.
11900 * iterators.cs (Yield.CheckContext): Add error 1629.
11901 (Iterator.ctor): Save unsafe modifier.
11902 (MoveNextMethod.DoEmit): Restore unsafe context.
11904 * namespace.cs (UsingAlias): Better error message.
11906 2005-03-03 Dan Winship <danw@novell.com>
11908 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
11909 the warning message [#73219]
11911 2005-03-03 Raja R Harinath <rharinath@novell.com>
11913 Fix compile with MCS 1.0.0.0.
11914 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
11915 w_restore to not depend on string constant folding.
11917 2005-03-03 Raja R Harinath <rharinath@novell.com>
11919 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
11920 CS0246 check to users who passed 'silent = false'.
11921 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
11923 (SimpleName.SimpleNameResolve): Update.
11924 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
11925 (MemberAccess.IdenticalNameAndTypeName): Update.
11926 * doc.cs (FindDocumentedTypeNonArray): Update.
11928 2005-03-03 Raja R Harinath <rharinath@novell.com>
11930 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
11931 * parameters.cs (ComputeAndDefineParameters): Remove.
11932 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
11933 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
11934 Use GetParameterInfo.
11936 2005-03-02 Marek Safar <marek.safar@seznam.cz>
11938 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
11940 2005-03-02 Raja R Harinath <rharinath@novell.com>
11942 Unify DeclSpace.LookupType and DeclSpace.FindType.
11943 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
11944 is in charge of defining nested types on demand.
11945 (DeclSpace.LookupType): Use it when the current_type is a
11946 TypeBuilder. Use LookupTypeDirect for reflected types.
11947 (DeclSpace.FindType): Remove.
11948 (DeclSpace.LookupInterfaceOrClass): Likewise.
11949 (DeclSpace.DefineTypeAndParents): Likewise.
11950 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
11951 DeclSpace.LookupType.
11952 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
11953 * typemanager.cs (LookupType): Simplify.
11954 (AddUserType): Remove type from negative_hits.
11955 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
11956 * class.cs (TypeContainer.FindMembers): Move handling of nested
11958 (TypeContainer.FindMembers_NestedTypes): ... here.
11959 (TypeContainer.FindNestedType): Implement override.
11960 (ClassPart.FindNestedType): Delegate to PartialContainer.
11961 (ClassPart.PartFindNestedType): Looks up the nested types of the
11964 2005-03-02 Martin Baulig <martin@ximian.com>
11966 * class.cs (TypeContainer.DoDefineMembers): We also need a default
11967 static constructor in static classes.
11969 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
11971 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
11972 sizeParamIndex is not specified.
11974 2005-03-01 Marek Safar <marek.safar@seznam.cz>
11977 * report.cs (WarningMessage.IsEnabled): Missing null check.
11979 2005-02-28 Marek Safar <marek.safar@seznam.cz>
11981 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
11982 in the fields and not in the properties.
11984 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
11986 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
11989 2005-02-28 Marek Safar <marek.safar@seznam.cz>
11991 * attribute.cs: Small refactoring (improved robustness).
11992 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
11993 (ValidateGuid): Removed.
11994 (Resolve): Removed referenced to above mentioned.
11995 (GetAttributeUsage): Made private and changed to work without
11997 (GetIndexerAttributeValue): Don't crash.
11998 (GetConditionalAttributeValue): Ditto.
11999 (GetClsCompliantAttributeValue): Ditto.
12000 (ExtractSecurityPermissionSet): All attributes exceptions are
12002 (GetPropertyValue): New helper.
12003 (GetMethodImplOptions): New method.
12004 (DefinePInvokeMethod): Reuse common code. Implemented handling of
12005 some missing properties.
12007 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12008 (Method.ApplyAttributeBuilder): Updated.
12010 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12013 2005-02-28 Raja R Harinath <rharinath@novell.com>
12016 * report.cs (Report.SymbolRelatedToPreviousError): Handle
12017 non-simple types (array, pointer, reference).
12019 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12021 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12023 * class.cs (MethodCore.IsDuplicateImplementation): Special error
12025 (Method.CheckBase): Catch wrong destructor here.
12026 (MethodData.Define): Add errors 550, 668.
12028 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12030 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12032 * pending.cs (VerifyPendingMethods): Add error 551.
12034 * typemanager.cs (CSharpName): Next error report helper.
12036 2005-02-25 Marek Safar <marek.safar@seznam.cz>
12038 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12039 attributes. Removed useless attribute double check.
12040 It saves almost 2MBs for corlib.
12042 2005-02-25 Raja R Harinath <rharinath@novell.com>
12045 * statement.cs (ExpressionStatement.Resolve): Make robust to being
12046 called twice in case of error.
12048 2005-02-23 Chris Toshok <toshok@ximian.com>
12050 Fix compiler portions of #72827.
12051 * statement.cs (Block.Emit): call Begin/EndScope on the
12052 EmitContext instead of the ILGenerator.
12054 * codegen.cs (EmitContext.BeginScope): new method, call
12055 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12057 (EmitContext.BeginScope): same, but EndScope and CloseScope
12059 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12060 offset and call the superclass's OpenScope(int) with it.
12061 (SymbolWriter.CloseScope): get the current il
12062 offset and call superclass's CloseScope(int) with it.
12064 2005-02-23 Marek Safar <marek.safar@seznam.cz>
12066 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12067 CS1677 for out and ref as well.
12069 * class.cs (Method.Define): Add error CS1599 detection.
12071 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12073 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12075 * delegate.cs (Delegate.Define): Add error CS1599 detection.
12077 * support.cs.cs (ModifierDesc): New helper method.
12079 2005-02-23 Raja R Harinath <rharinath@novell.com>
12080 Abin Thomas <projectmonokochi@rediffmail.com>
12081 Anoob V E <projectmonokochi@rediffmail.com>
12082 Harilal P R <projectmonokochi@rediffmail.com>
12084 Fix #57851, #72718.
12085 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12086 MemberLookup (used for error reporting) actually returns a result.
12087 Fix error report number (122, not 112).
12089 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
12090 Anoob V E <projectmonokochi@rediffmail.com>
12091 Harilal P R <projectmonokochi@rediffmail.com>
12094 * pending.cs (PendingImplementation.GetAbstractMethods):
12095 Find NonPublic members too.
12097 2005-02-22 Marek Safar <marek.safar@seznam.cz>
12099 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12102 * class.cs (MethodCore.CheckMethodAgainstBase):
12103 Add error 239 report.
12105 2005-02-21 Raja R Harinath <rharinath@novell.com>
12108 * expression.cs (Invocation.IsApplicable): Make public.
12109 (Invocation.IsParamsMethodApplicable): Likewise.
12110 * delegate.cs (Delegate.VerifyApplicability): Don't use
12111 Invocation.VerifyArgumentCompat for parameter applicability
12112 testing. Use Invocation.IsApplicable and
12113 Invocation.IsParamsMethodApplicable.
12115 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12117 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12119 * class.cs (Operator.Define): Add error 217 report.
12121 2005-02-21 Raja R Harinath <rharinath@novell.com>
12123 * namespace.cs (UsingEntry.Resolve): Undo change below.
12125 2005-02-21 Raja R Harinath <rharinath@novell.com>
12128 * ecore.cs (Expression.MemberLookupFailed): Add argument to
12129 disable the error message when the extended MemberLookup also
12131 (Expression.MemberLookupFinal): Update.
12132 (SimpleName.DoSimpleNameResolve): Update.
12133 * expression.cs (MemberAccess.ResolveNamespaceOrType):
12134 Don't use MemberLookupFinal.
12135 (New.DoResolve): Update.
12136 (BaseAccess.CommonResolve): Update.
12138 2005-02-21 Raja R Harinath <rharinath@novell.com>
12141 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12142 occured previously, don't resolve again.
12144 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12147 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12148 argument. Call ResolveAttributeUsage for unresolved.
12149 when types doesn't match ctor arguments.
12151 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12152 for nested attribute classes.
12153 (Class.attribute_usage): Removed.
12154 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12155 for attribute class.
12157 * ecore.cs (IsAttribute): Removed.
12159 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12161 * rootcontext.cs (RegisterAttribute): Removed, attributes are
12163 (attribute_types): Removed.
12164 (EmitCode): Global attributes are emited as the latest.
12166 2005-02-18 Marek Safar <marek.safar@seznam.cz>
12168 * class.cs (EmitFieldInitializers): Don't emit field initializer
12169 for default values when optimilization is on.
12171 * constant.cs (Constant.IsDefaultValue): New property.
12173 * driver.cs: Add /optimize handling.
12177 * literal.cs: Implement new IsDefaultValue property.
12179 * rootcontext.cs (Optimize): New field, holds /optimize option.
12181 2005-02-18 Raja R Harinath <rharinath@novell.com>
12183 Fix crasher in re-opened #72347.
12184 * namespace.cs (Namespace.Lookup): Return null if
12185 DeclSpace.DefineType returns null.
12188 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12190 2005-02-18 Raja R Harinath <rharinath@novell.com>
12192 Fix remainder of #63202. Change semantics of DoResolveLValue: it
12193 now returns null if it cannot resolve to an lvalue.
12194 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12195 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12196 returned null. Remove check for SimpleName.
12197 (EventExpr.DoResolveLValue): New.
12198 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12199 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
12201 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
12202 avoid CS0131 error.
12203 (Unary.ResolveOperator): Move CS0211 check ...
12204 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
12206 (Unary.DoResolveLValue): Simplify.
12207 (AddressOf.DoResolveLValue): New.
12208 (ArrayAccess.DoResolveLValue): New.
12210 2005-02-16 Marek Safar <marek.safar@seznam.cz>
12212 * attribute.cs (Attribute.Resolve): Add arguments casting for
12213 when types doesn't match ctor arguments.
12215 2005-02-16 Raja R Harinath <rharinath@novell.com>
12217 Fix parts of #63202.
12218 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12219 lookup of operator in base type. Ensure that all checks happen
12220 when the operator resolves to an "op_..." method.
12222 2005-02-15 Raja R Harinath <rharinath@novell.com>
12225 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12226 'ignore_cs0104' parameter. Pass it to ...
12227 (NamespaceEntry.Lookup): ... this.
12228 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12229 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12230 (TypeLookupExpression.DoResolveAsTypeStep): Update.
12231 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12232 Update. Request that cs0104 errors be ignored.
12233 (ComposedCast.ResolveAsTypeStep): Update.
12235 2005-02-14 Raja R Harinath <rharinath@novell.com>
12238 * expression.cs (Invocation.BetterFunction): Remove support for
12239 comparing virtual functions and their overrides.
12240 (Invocation.IsOverride): New.
12241 (Invocation.OverloadResolve): Don't consider 'override' functions
12242 during candidate selection. Store them in a lookaside list.
12243 If the selected method is a 'virtual' function, use the list to
12244 find any overrides that are closer to the LHS type.
12246 2005-02-14 Marek Safar <marek.safar@seznam.cz>
12248 * expression.cs (New.DoResolve): Add complex core type reduction.
12249 (New.Constantify): Converts complex core type syntax like 'new int ()'
12250 to simple constant.
12252 2005-02-14 Raja R Harinath <rharinath@novell.com>
12254 * decl.cs (EntryType.EntryType): New constructor to create an
12255 updated copy of a cache entry.
12256 (MemberCache.AddMethods): Use it.
12257 (MemberCache.ClearDeclaredOnly): Remove.
12258 (MemberCache.MemberCache): Update.
12260 2005-02-11 Miguel de Icaza <miguel@novell.com>
12262 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12263 variable. This one is represents the actual low-level declaration
12264 of the method, as opposed to the semantic level `IsStatic'.
12266 An anonymous method which is hosted into a static method might be
12267 actually an instance method. IsStatic would reflect the
12268 container, while MethodIsStatic represents the actual code
12271 * expression.cs (ParameterReference): Use the new MethodIsStatic
12272 instead of IsStatic.
12274 * anonymous.cs (AnonymousMethod.Compatible): Pass the
12275 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12276 set on the current EmitContext.
12278 * expression.cs (Cast): Overload DoResolveLValue so we can pass
12279 resolve our casted expression as an LValue. This triggers the
12280 proper LValue processing that is later required by Assign.
12284 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12286 2005-02-11 Marek Safar <marek.safar@seznam.cz>
12288 C# 2.0 Fixed buffer implementation
12290 * anonymous.cs: Update after RegisterHelperClass renaming.
12292 * attribute.cs (AttributeTester.fixed_buffer_cache):
12293 Cache of external fixed buffers.
12294 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12295 implementation if field is fixed buffer else null.
12298 (TypeContainer.AddField): Accept FieldMember instead of Field.
12299 (FieldBase.IsFieldClsCompliant): Extracted code from
12300 VerifyClsCompliance descendant customization.
12301 (FixedField): New class handles fixed buffer fields.
12302 (FixedFieldExternal): Keeps information about imported fixed
12304 (IFixedField): Make access to internal or external fixed buffer
12307 * cs-parser.jay: Add fixed buffer parsing.
12309 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12312 * expression.cs (Indirection): Extended implementation to accept
12313 fixed buffer field.
12314 (PointerArithmetic.Emit): Get element from fixed buffer as well.
12315 (ElementAccess.MakePointerAccess): Get type as parameter.
12316 (DoResolve): Add fixed buffer field expression conversion.
12317 (DoResolveLValue): Ditto.
12318 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12319 (ArrayPtr): Derives from FixedBufferPtr.
12320 (ArrayPtr.Emit): Add extra emit for array elements.
12322 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12324 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
12325 for compiler generated types.
12326 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
12328 * statement.cs (Fixed): Refactored to be easier add fixed buffer
12329 and consume less memory.
12330 (Fixed.Resolve): Add fixed buffer case.
12332 * typemanager.cs (compiler_generated_attr_ctor,
12333 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
12334 (HasElementType): Add our own implementation to work on every
12337 2005-02-11 Miguel de Icaza <miguel@novell.com>
12339 * anonymous.cs (CaptureContext): Track whether `this' has been
12342 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
12343 only captured `this' if it was implicitly done (instance
12344 methods/variables were used).
12346 * codegen.cs (EmitContext.CaptureThis): New method to flag that
12347 `this' must be captured.
12349 2005-01-30 Miguel de Icaza <miguel@novell.com>
12351 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
12352 is null it means that there has been no need to capture anything,
12353 so we just create a sibling.
12355 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
12357 Just a partial fix. The other half is fairly elusive.
12359 2005-02-10 Raja R Harinath <rharinath@novell.com>
12361 Fix #52586, cs0121-4.cs.
12362 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
12363 and return a hashtable.
12364 (MemberCache.ClearDeclaredOnly): New.
12365 (MemberCache.MemberCache): Update to change. Make a deep copy of
12366 the method_hash of a base type too.
12367 (MemberCache.AddMethods): Adapt to having a deep copy of the base
12368 type methods. Overwrite entries with the same MethodHandle so
12369 that the ReflectedType is correct. The process leaves in base
12370 virtual functions and their overrides as distinct entries.
12371 (CacheEntry): Now a class instead of a struct. It shouldn't alter
12372 matters since it was boxed in a ArrayList before.
12373 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
12375 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
12376 case of a virtual function and its override (choose the overload
12378 (Invocation.OverloadResolve): Avoid 'override' members during
12379 'applicable_type' calculation.
12381 2005-02-09 Raja R Harinath <rharinath@novell.com>
12383 Combine two near-redundant caches.
12384 * typemanager.cs (method_params): Rename from method_internal_params.
12385 (TypeManager.GetParameterData): New. Replace
12386 Invocation.GetParameterData.
12387 (TypeManager.LookupParametersByBuilder): Remove.
12388 * expression.cs (Invocation.method_parameter_cache): Remove.
12389 (Invocation.GetParameterData): Remove.
12391 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
12394 2005-02-08 Raja R Harinath <rharinath@novell.com>
12397 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
12398 TypeManager.multicast_delegate_type is null, resolve it by looking
12399 up "System.MulticastDelegate".
12400 * rootcontext.cs (RootContext.ResolveCore): Simplify.
12402 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
12403 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
12404 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
12407 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
12408 (LabeledStatement.AddReference): New. Set 'referenced'.
12409 (Goto.Resolve): Use it.
12411 2005-02-05 John Luke <john.luke@gmail.com>
12413 * driver.cs: remove duplicate -doc line in Usage ()
12415 2005-02-04 Raja R Harinath <rharinath@novell.com>
12417 * location.cs (Location.AddFile): Fix CS2002 error report.
12419 2005-02-02 Martin Baulig <martin@ximian.com>
12421 * delegate.cs (Delegate.DefineType): Report an internal error if
12422 TypeManager.multicast_delegate_type is null. See bug #72015 for
12425 2005-02-02 Raja R Harinath <rharinath@novell.com>
12427 Fix a crasher in a variant of #31984.
12428 * const.cs (Constant.CheckBase): New override that defers the
12429 new-or-override check in case the base type hasn't been populated
12431 (Constant.Define): Ensure the new-or-override check is performed.
12433 2005-02-01 Duncan Mak <duncan@ximian.com>
12435 * const.cs (LookupConstantValue): Check that `ce' is not null
12436 before calling GetValue ().
12438 2005-02-01 Raja R Harinath <rharinath@novell.com>
12440 Fix test-334.cs (#69519).
12441 * cs-parser.jay (using_alias_directive): Pass in an expression to
12442 NamespaceEntry.UsingAlias.
12443 (using_namespace_directive): Pass in an expression to
12444 NamespaceEntry.Using.
12445 (namespace_name): Don't flatten to a string.
12446 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
12447 (NamespaceEntry.AliasEntry.Resolve): Lookup using
12449 (NamespaceEntry.UsingEntry): Likewise.
12450 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
12452 (NamespaceEntry.LookupForUsing): Remove.
12453 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
12455 (NamespaceEntry.Lookup): Remove support for dotted names.
12457 2005-02-01 Raja R Harinath <rharinath@novell.com>
12459 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
12461 (NamespaceEntry.ImplicitParent): Compute on demand.
12462 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
12463 parallels the current.
12464 (NamespaceEntry.LookupForUsing): Use it.
12465 (NamespaceEntry.Lookup): If the current namespace-entry is
12466 implicit, don't search aliases and using tables.
12468 2005-02-01 Raja R Harinath <rharinath@novell.com>
12471 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
12473 (TypeContainer.BaseCache): Compute on demand.
12474 (TypeContainer.FindMembers): Define constants and types if they're
12475 not already created.
12476 (FieldMember.Define): Move resetting of ec.InUnsafe before error
12478 * const.cs (Constant.Define): Make idempotent.
12480 2005-01-29 Miguel de Icaza <miguel@novell.com>
12482 * pending.cs: Produce better code (no nops produced by using Ldarg
12485 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
12486 i - 1' it should be arg + 1.
12490 2005-01-28 Raja R Harinath <rharinath@novell.com>
12492 * attribute.cs (Attribute.CheckAttributeType): Make private
12494 (Attribute.ResolveType): Make virtual.
12495 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
12496 handling of RootContext.Tree.Types.
12498 2005-01-27 Raja R Harinath <rharinath@novell.com>
12500 Update attribute-handling to use the SimpleName/MemberAccess
12502 * cs-parser.jay (attribute): Pass in an expression to the
12503 constructors of Attribute and GlobalAttribute.
12504 * attribute.cs (Attribute): Take an expression for the name.
12505 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
12506 passed in attribute name expression.
12507 (Attribute.CheckAttributeType): Use it.
12508 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
12509 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
12510 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
12511 argument to prevent error messages if the lookup fails.
12513 2005-01-27 Marek Safar <marek.safar@seznam.cz>
12515 * expression.cs (Indirection): Implemented IVariable interface
12516 to support indirection in AddressOf operator.
12517 (PointerArithmetic.Emit): Add optimalization for case where
12518 result can be precomputed.
12520 2005-01-26 Martin Baulig <martin@ximian.com>
12522 * class.cs (TypeContainer.AttributeTargets): Return the correct
12523 AttributeTargets depending on our `Kind' instead of throwing an
12524 exception; fixes #71632.
12526 2005-01-26 Marek Safar <marek.safar@seznam.cz>
12529 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
12532 2005-01-25 Raja R Harinath <rharinath@novell.com>
12535 * expression.cs (MemberAccess.DoResolve): Don't complain with
12536 cs0572 when the LHS of a member access has identical name and type
12539 2005-01-25 Marek Safar <marek.safar@seznam.cz>
12542 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
12544 Create custom PermissionSet only for PermissionSetAttribute.
12546 2005-01-24 Marek Safar <marek.safar@seznam.cz>
12549 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
12550 delegates in static class.
12552 2005-01-24 Martin Baulig <martin@ximian.com>
12554 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12555 merging an implicit block, just use its reachability.
12557 * statement.cs (Block.Resolve): Make the unreachable code check
12558 work wrt. implicit blocks; see test-337 from #63842.
12560 2005-01-21 Alp Toker <alp@atoker.com>
12562 * cs-parser.jay: destructor_declaration's container is PartialContainer
12563 not Class when partial types are used, so use Kind prop instead of
12566 2005-01-22 Miguel de Icaza <miguel@ximian.com>
12568 * cs-parser.jay: Improve error reporting when an interface
12569 declares new types.
12571 2005-01-20 Dick Porter <dick@ximian.com>
12573 * support.cs: SeekableStreamReader fix from Sandor Dobos
12574 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
12575 chars are read. Fixes bug 70369.
12577 2005-01-20 Raja R Harinath <rharinath@novell.com>
12579 * cs-parser.jay (catch_clause): Simplify current_block handling
12582 2005-01-17 Miguel de Icaza <miguel@ximian.com>
12584 * convert.cs (ImplicitStandardConversionExists): Synchronize the
12585 code with ImplicitStandardConversion to handle the implicit
12586 conversion of method groups into valid delegate invocations.
12588 The problem is that in parameter handling we were using this code
12589 path. Fixes bug #64698
12591 2005-01-19 Raja R Harinath <rharinath@novell.com>
12593 * cs-parser.jay: Fix several infelicities.
12594 - Avoid assigning to the parser value stack. Code like
12595 '$3 = null' is unclean. Synthesize a value for the code block
12597 - Avoid using oob_stack for storing location information. Use ...
12598 (_mark_): ... this. New (empty) rule. Saves the current location
12600 (foreach_statement): Avoid using oob_stack for current_block
12601 handling. Use technique used in for_statement and
12602 using_statement. Synthesize a value for the code block to store
12603 additional intermediate information.
12605 2005-01-13 Miguel de Icaza <miguel@ximian.com>
12607 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
12608 of a different type is only allowed to private fields of a
12609 containing type, not on fields of a base class.
12611 See test-174.cs and error cs0122-9.cs
12613 2005-01-13 Raja R Harinath <rharinath@novell.com>
12615 Fix test-335.cs (bug #58126).
12616 * cs-parser.jay (argument): Split out non-expression parts of the
12617 rule into 'non_simple_argument'.
12618 (invocation_expression): Support parenthesized invocations with
12619 multiple arguments, and with single non-simple arguments.
12621 2005-01-13 Raja R Harinath <rharinath@novell.com>
12623 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
12626 2005-01-12 Raja R Harinath <rharinath@novell.com>
12628 Fix cs0038-1.cs, cs1640-6.cs.
12629 * ecore.cs (Expression.Resolve): Remove special-case for
12630 SimpleName in error-handling.
12631 (Expression.almostMatchedMembers): Relax access permission to
12633 (Expression.MemberLookupFailed): Handle duplicates in
12634 almostMatchedMembers list.
12635 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
12636 * expression.cs (New.DoResolve): Report CS1540 for more cases.
12637 * typemanager.cs (GetFullNameSignature): Use the MethodBase
12638 overload if the passed in MemberInfo is a MethodBase.
12640 2005-01-12 Marek Safar <marek.safar@seznam.cz>
12643 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
12644 for non-CAS & merge permission sets properly.
12646 2005-01-11 Raja R Harinath <rharinath@novell.com>
12648 Improve standard-compliance of simple name and member access
12649 resolution. Fixes bugs #52697, #57200, #67520, #69519.
12650 * ecore.cs (FullNamedExpression): New abstract base class
12651 for Namespaces and TypeExpressions.
12652 (ResolveFlags.SimpleName): Remove.
12653 (SimpleName): Remove support for dotted names.
12654 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
12655 DeclSpace.FindType and DeclSpace.LookupType.
12656 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
12657 (Expression.ExprClassName): Make member function.
12658 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
12659 a namespace. Remove creation of dotted "SimpleName"s.
12660 (MemberAccess.DoResolve): Likewise.
12661 * decl.cs (DeclSpace.Cache): Make private.
12662 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
12663 (DeclSpace.FindType): Update.
12664 (DeclSpace.LookupType): Move here from RootContext. Return a
12665 FullNamedExpression.
12666 * namespace.cs (Namespace): Derive from FullNamedExpression
12667 so that it can be part of expression resolution.
12668 (Namespace.Lookup): Return an FullNamedExpression.
12669 (NamespaceEntry.LookupAlias): Lookup aliases only in current
12671 * rootcontext.cs (NamespaceLookup): Remove.
12672 (LookupType): Move to DeclSpace.
12673 * attribute.cs (CheckAttributeType): Update.
12674 * doc.cs (FindDocumentedType): Remove allowAlias argument.
12675 (FindDocumentedTypeNonArray): Likewise.
12677 2005-01-11 Raja R Harinath <rharinath@novell.com>
12679 Fix cs0509.cs, cs1632.cs.
12680 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
12681 is the same as IsInterface.
12682 (TypeContainer.GetClassBases): Likewise.
12683 * statement.cs (LabeledStatement.ig): New field.
12684 (LabeledStatement.LabelTarget): Save ILGenerator which created the
12686 (LabeledStatement.DoEmit): Check that the label was created with
12687 the same ILGenerator.
12689 2005-01-10 Marek Safar <marek.safar@seznam.cz>
12692 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
12693 accessors to its properties.
12695 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
12696 from accessors to property.
12698 2005-01-10 Marek Safar <marek.safar@seznam.cz>
12701 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
12702 only for overrides.
12704 2005-01-08 Miguel de Icaza <miguel@ximian.com>
12706 * attribute.cs: Check for null and empty strings.
12708 I have lost another battle to Paolo.
12710 2005-01-07 Marek Safar <marek.safar@seznam.cz>
12713 * class.cs (PropertyMethod): Set Parent field in ctors.
12714 (SetMethod.InternalParameters): Add unsafe switch hack.
12715 Override MarkForDuplicationCheck where it is appropriate.
12717 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
12718 It says whether container allows members with the same name.
12719 Base default is no.
12720 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
12721 Removed is_method parameter.
12723 2005-01-06 Duncan Mak <duncan@ximian.com>
12725 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
12726 because the previous change led to incorrect reporting of CS1032
12727 ("Cannot define/undefine preprocessor symbols after first token in
12728 file"). Instead of using `tokens_seen' as the only flag that
12729 triggers CS1040, introduce `comments_seen'. This new flag is used
12730 to signify having seen comments on the current line, so it is
12731 unset after a newline.
12733 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
12735 * doc.cs : When searching for a type, find nested type too.
12736 This fixes bug #71040.
12738 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
12741 - Warn missing member comment on those classes which also does not
12742 have doc comments. Fixed bug #71041.
12743 - Don't warn missing doc comment on default constructor.
12746 2005-01-06 Duncan Mak <duncan@ximian.com>
12748 * cs-tokenizer.cs (xtoken): After handling traditional C-style
12749 comments, set `tokens_seen' to true. This allows us to detect
12750 misplaced preprocessor directives (i.e. not at the beginning of
12751 the a line, nor after whitespaces). In that case, report error
12752 CS1040. This fixes bug #56460.
12754 * cs-parser.jay (interface_member_declaration): Add checks for
12755 IsExplicitImpl, and report CS0541 error if an interface member is
12756 defined as an explicit interface declaration.
12758 2005-01-06 Marek Safar <marek.safar@seznam.cz>
12761 * class.cs (PropertyMethod): Set Parent field in ctors.
12762 (SetMethod.InternalParameters): Add unsafe switch hack.
12764 * decl.cs (MemberCore.Parent): Cannot be readonly.
12766 2005-01-06 Raja R Harinath <rharinath@novell.com>
12768 * decl.cs (DeclSpace.ResolveType): Remove.
12769 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
12770 Merge in code from ...
12771 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
12772 * class.cs, enum.cs: Update to changes.
12774 2005-01-06 Miguel de Icaza <miguel@ximian.com>
12776 * anonymous.cs: Ensure that we init the scope of our parent if it
12777 has not been initialized yet.
12779 2004-12-30 Duncan Mak <duncan@ximian.com>
12781 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
12782 if field.FieldBuilder is null. Fixes #70758.
12784 * convert.cs: Fixed some typos and updated some of the comments.
12785 (ImplicitStandardConversionExists):
12786 (TryImplicitIntConversion): If `target_type' is an interface and
12787 the type of `ic' implements this interface, return true or a new
12788 BoxedCast instead of null. This fixes #70468.
12790 2004-12-29 Duncan Mak <duncan@ximian.com>
12792 * expression.cs (Argument.Emit): Check that Expr is
12793 IMemoryLocation before casting to it, and report CS1510 otherwise.
12797 2004-12-21 Ben Maurer <bmaurer@ximian.com>
12799 * statement.cs (Block.ThisVariable): remove the recursion here, to
12800 make the --profile more sane.
12802 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
12804 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
12805 assembly, by JB Evain.
12807 2004-12-17 Raja R Harinath <rharinath@novell.com>
12809 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
12810 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
12811 "parent" refers to enclosing type/class. "base" refers to superclass.
12813 2004-12-17 Raja R Harinath <rharinath@novell.com>
12815 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
12816 Ensure that we only have GlobalAttributes.
12817 * attribute.cs (Attribute.Emit): Make non-virtual.
12818 (GlobalAttribute.Emit): Remove.
12819 (Attribute.Resolve): Make virtual.
12820 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
12821 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
12822 the argument. Don't create one.
12823 (Attribute.GetObsoleteAttribute): Likewise.
12824 (Attribute.GetClsCompliantAttributeValue): Likewise.
12825 * class.cs, decl.cs: Update to changes.
12827 2004-12-17 Marek Safar <marek.safar@seznam.cz>
12829 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
12831 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
12833 * statement.cs (Foreach.Resolve): Add error 186 report.
12835 2004-12-16 Marek Safar <marek.safar@seznam.cz>
12837 * expression.cs (Conditional.DoResolve): Add warning 429.
12839 * statement.cs (If.Resolve): Add warning 665.
12841 2004-12-16 Raja R Harinath <rharinath@novell.com>
12843 New invariant: RootContext.Tree.Types.NamespaceEntry == null
12844 except when in the parser, and in GlobalAttribute.
12845 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
12846 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
12847 RootContext.Tree.Types.NamespaceEntry once work is done.
12848 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
12849 and resets RootContext.Tree.Types.NamespaceEntry.
12851 2004-12-15 Marek Safar <marek.safar@seznam.cz>
12853 * cs-parser.jay: Don't create a block for every variable.
12855 2004-12-14 Miguel de Icaza <miguel@ximian.com>
12857 * location.cs: Provide extra information.
12859 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
12860 variables from the captured environment, it is the ldarg_0.
12862 2004-12-14 Marek Safar <marek.safar@seznam.cz>
12864 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
12867 * class.cs: Changed warning level for 169 to avoid developer
12868 displeasure from warning flooding. It will be changed back when they
12869 fix most of current BCL warnings.
12871 * RootContext.cs: Pushed default WarningLevel to 3.
12873 * statement.cs: Removed unused variable.
12875 2004-12-14 Marek Safar <marek.safar@seznam.cz>
12877 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
12878 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
12879 Add error 502 report.
12880 (StaticClass.DefineType): Add error 441 report.
12881 (Class.AllowedModifiersProp): New virtual property as temporary
12882 extension to AllowedModifiers.
12883 (Class.DefineType): Add error 418 report. Moved ModFlags check here
12884 to share implementation with StaticClass and don't call virtual
12887 * driver.cs (MainDriver): Add error 1558 test.
12889 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
12890 report. Moved error 36 test here.
12892 * statement.cs (Throw.Resolve): Add error 724 report.
12894 * typemanager.cs: Add out_attribute_type core type.
12896 2004-12-13 Marek Safar <marek.safar@seznam.cz>
12898 * class.cs (TypeContainer.VerifyClsCompliance): Add error
12900 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
12902 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
12905 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
12907 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
12908 Add error 3023 report.
12909 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
12911 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
12914 2004-12-12 John Luke <john.luke@gmail.com>
12916 * driver.cs (AddArgs): take -- into account when
12917 adding arguments, fixes bug 65710
12919 2004-12-12 Martin Baulig <martin@ximian.com>
12921 * expression.cs (Unary.TryReduceNegative): Added support for
12922 SByteConstant and ByteConstant.
12923 (Unary.Reduce): Check error values from TryReduceNegative().
12925 2004-12-10 Marek Safar <marek.safar@seznam.cz>
12927 * attributes.cs (Attribute.Resolve): Avoid multiple error report
12928 and report exception as error 182.
12930 2004-12-10 Raja R Harinath <rharinath@novell.com>
12932 * driver.cs (Main): Fix message when there are warnings.
12934 2004-12-09 Miguel de Icaza <miguel@ximian.com>
12936 * delegate.cs: Fixed my fix from yesterday, sorry about that.
12938 2004-12-09 Marek Safar <marek.safar@seznam.cz>
12940 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
12941 Reduced number of warnings.
12943 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
12945 2004-12-08 Miguel de Icaza <miguel@ximian.com>
12947 * driver.cs: Removed message.
12949 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
12951 2004-12-08 <vargaz@freemail.hu>
12953 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
12955 2004-12-08 Martin Baulig <martin@ximian.com>
12957 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
12958 instead of a CS3002 for properties and indexer.
12960 2004-12-08 Martin Baulig <martin@ximian.com>
12962 * decl.cs (MemberName.ToString): Make this work again.
12964 2004-12-08 Marek Safar <marek.safar@seznam.cz>
12966 * attribute.cs (Resolve): Add error 591 detection.
12968 * class.cs (FieldMember.Define): Add error 1547 detection.
12969 (Indexer.Define): Add error 620 detection.
12970 (Operator.Define): Add error 590 detection.
12972 * ecore.cs: Missing argument for error 79.
12974 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
12977 2004-12-07 Marek Safar <marek.safar@seznam.cz>
12980 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
12983 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
12985 * cs-parser.jay : handle doc comments on implicit/explicit operators.
12986 Some operator comments were suppressed.
12987 * doc.cs : Implicit/explicit operator name in doc comments are like
12988 "op_Explicit(type)~returnType", so added suffix handling.
12990 2004-12-07 Martin Baulig <martin@ximian.com>
12993 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
12994 (MemberCore.GetClsCompliantAttributeValue): Likewise.
12995 (DeclSpace.ec): New protected field; store the EmitContext here.
12996 (DeclSpace.EmitContext): New public property; moved here from
12998 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13001 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13002 (Enum.Emit): Don't create a new EmitContext.
13004 * delegate.cs (Delegate.DefineType): Always create the
13007 * iterators.cs (Iterators.DefineIterator): Create a new
13008 EmitContext and store it in `ec'.
13010 2004-08-24 Martin Baulig <martin@ximian.com>
13013 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13014 this for accessibility checks.
13015 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13016 IsNestedFamilyAccessible.
13017 (TypeManager.IsSubclassOf): New method, do what the name actually
13020 2004-12-06 Raja R Harinath <rharinath@novell.com>
13022 Fix crash on cs0657-17.cs.
13023 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13024 Use RootContext.Tree.Types, not 'new RootTypes ()'.
13025 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13026 the case where the NamespaceEntry gets overwritten.
13028 2004-12-06 Marek Safar <marek.safar@seznam.cz>
13030 Fixed #69195, #56821
13031 * ecore.cs (ResolveBoolean): Tiny refactoring.
13033 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13034 of right expression resolving when left is false constant and
13035 operator is LogicalAnd OR true constant and operator is LogicalOr.
13037 * statement.cs (ResolveUnreachable): Always reports warning.
13039 2004-12-05 Miguel de Icaza <miguel@ximian.com>
13041 * class.cs: Distinguish between 1721 and 1722 (just a little help
13042 for the programmer).
13044 2004-12-03 Miguel de Icaza <miguel@ximian.com>
13046 * delegate.cs: Only allow this on new versions of the language.
13048 2004-12-02 Duncan Mak <duncan@ximian.com>
13050 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13052 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13053 here as a static method. Take an additional bool out parameter
13054 `must_do_cs1540_check' for signaling to InstanceResolve.
13055 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13056 member field from PropertyExpr class and made it an argument of
13057 the method instead.
13058 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13059 check for MarshalByRefObject, and report CS0122 instead of CS1540.
13060 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13061 and `remove_accessor' as well as InstanceResolve: report CS0122
13066 2004-12-03 Raja R Harinath <rharinath@novell.com>
13068 Fix test-327.cs, test-328.cs, and put in early infrastructure
13069 for eventually fixing #52697.
13070 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13071 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13072 from other methods.
13073 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13074 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13075 (VerifyUsing, error246): Update.
13076 * rootcontext.cs (RootContext.NamespaceLookup): Just use
13077 'NamespaceEntry.LookupNamespaceOrType'.
13079 2004-12-03 Martin Baulig <martin@ximian.com>
13081 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13082 method as our child, call AnonymousMethod.Compatible() on it.
13084 2004-12-03 Raja R Harinath <rharinath@novell.com>
13086 Disable XML documentation support in 'basic' profile.
13087 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13088 Redirect XmlElement to System.Object.
13089 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13090 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13091 * mcs.exe.sources: Add doc-bootstrap.cs.
13092 * doc-bootstrap.cs: New file. Contains empty stub implementation
13095 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
13097 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13098 comments are allowed.
13100 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
13102 * delegate.cs: Add checks for subtypes in paramaters and return values
13103 in VerifyMethod () to add support for Covariance/Contravariance
13106 2004-12-02 Miguel de Icaza <miguel@ximian.com>
13108 * report.cs: Remove extra closing parenthesis.
13110 * convert.cs (Error_CannotImplicitConversion): If the name of the
13111 types are the same, provide some extra information.
13113 * class.cs (FieldBase): Use an unused bit field from the field to
13114 encode the `has_offset' property from the FieldMember. This saves
13115 a couple of Ks on bootstrap compilation.
13117 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13118 method as our child, return the AnonymousMethod resolved
13121 * expression.cs (New.DoResolve): Allow return values from
13122 NewDelegate to also include AnonymousMethods.
13126 2004-12-02 Marek Safar <marek.safar@seznam.cz>
13129 * attribute.cs (Resolve): Improved implementation of params
13130 attribute arguments.
13132 * support.cs (ParameterData): Add HasParams to be faster.
13134 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
13136 all things are for /doc support:
13138 * doc.cs: new file that supports XML documentation generation.
13139 * mcs.exe.sources: added doc.cs.
13141 Handle /doc command line option.
13142 Report error 2006 instead of 5 for missing file name for /doc.
13143 Generate XML documentation when required, after type resolution.
13145 Added support for picking up documentation (/// and /** ... */),
13146 including a new XmlCommentState enumeration.
13148 Added lines to fill Documentation element for field, constant,
13149 property, indexer, method, constructor, destructor, operator, event
13150 and class, struct, interface, delegate, enum.
13151 Added lines to warn incorrect comment.
13153 Added Documentation field (passed only when /doc was specified).
13155 Added DocComment, DocCommentHeader, GenerateDocComment() and
13156 OnGenerateDocComment() and some supporting private members for
13157 /doc feature to MemberCore.
13159 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13161 Added overriden DocCommentHeader.
13163 Added overriden DocCommentHeader and GenerateDocComment().
13165 2004-12-01 Miguel de Icaza <miguel@ximian.com>
13167 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13168 unwrapping the enumeration values, chain to
13169 DoConstantNumericPromotions again, so we can promote things to the
13170 fundamental types (takes care of enums that are bytes, sbytes).
13174 2004-12-01 Raja R Harinath <rharinath@novell.com>
13176 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13177 Fix long-standing bug in type-lookup. Use FindType instead of
13178 LookupType when ec.ResolvingTypeTree.
13179 (Attribute.ResolveType, Attribute.Resolve)
13180 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13182 (Attributes.Search): Remove internal version. Update.
13183 (Attributes.SearchMulti): Update.
13184 (Attributes.GetClsCompliantAttribute): Remove.
13185 (Attributes.GetIndexerNameAttribute): Remove.
13186 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13187 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13188 * class.cs (Indexer.Define): Likewise.
13190 2004-12-01 Marek Safar <marek.safar@seznam.cz>
13193 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13194 MarshallByReference members access.
13196 * expression.cs: Use CheckMarshallByRefAccess;
13197 Better error CS0197 message.
13199 * report.cs: Print whole related error message.
13201 2004-11-30 Raja R Harinath <rharinath@novell.com>
13203 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13204 the current directory to help debugging.
13206 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13208 * class (GetClassBases): Better error 60 report.
13209 (EventProperty): Disabled warning 67 detection.
13211 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13214 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13216 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13219 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13222 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13224 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13226 2004-11-26 Miguel de Icaza <miguel@ximian.com>
13228 * attribute.cs (Attribute.Resolve): Refine error reporting and
13229 report a cs0117 if the identifier does not exist, to distinguish
13230 from 0617 which is a miss-use of the actual identifier.
13232 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13233 between cs0070 and cs0079.
13235 * class.cs (MemberBase.DoDefine): When reporting a wrong
13236 accessibility level, we use MethodCore to compare instead of
13237 Method (this was a regression in some refactoring effort).
13239 So now we correctly report cs0056 again.
13241 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13242 testing the target_type (which was known to be object_type) and
13243 not the source type (which is anonymous_method).
13245 Fixed reporting of error cs1660.
13247 * expression.cs (UserCast.Source): Expose the underlying cast.
13249 * statement.cs (Switch.SwitchGoverningType): Sort the list of
13250 allowed types to find a match to int32 first (most common).
13252 In addition, it ignores any ImplicitUserConversions that did an
13253 internal implicit conversion (as the switch statement allows only
13254 one integral conversion to exist).
13256 * class.cs (PartialContainer.Create): rename `name' to
13257 `member_name' for clarity. Then replace the string calls with a
13258 call to MemberName.GetPartialName, as now using
13259 MemberName.ToString is an error (this is due to the side effects
13260 it had, that were fixed in the past).
13262 This will restore the error reporting on a number of partial class
13263 errors that were missusing this (and getting an exception as a
13264 results, which is now just a plain textual warning, because
13265 yyparse debug output would crash otherwise).
13267 2004-11-26 Raja R Harinath <rharinath@novell.com>
13269 * Makefile (PROGRAM_INSTALL_DIR): Remove.
13271 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13273 * rootcontext.cs (LookupType): Make sure to cache lookups that
13274 don't give us a negative result. This saves about 5% of corlib
13277 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13279 * report.cs (AbstractMessage.Print): messages are sent to stderr
13281 * class.cs (TypeContainer.GetClassBases): It is an error to have a
13282 non-interface in the list of interfaces (at this point, either
13283 parent was properly set, or a base class is being listed in the
13284 interfaces section).
13286 This flags error 1722, and resolves the crash from bug 69259.
13288 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13290 * statement.cs (Using.EmitExpressionFinally): make this work right
13291 for valuetypes. Fixes 69926.
13293 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13295 * const.cs (Const.ChangeType): Cope with the "0 literal can be
13296 converted to an enum" here, before we try to change the underlying
13297 type. This code exists, but it is a different code path than the
13298 one used while encoding constants.
13300 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13301 old bug: when converting from the null literal to a pointer,
13302 return an EmptyCast, not the NullLiteral.
13304 This fixes #69921, the recent null_type changes probably made this
13305 bug more prominent.
13307 (ImplicitReferenceConversionExists): In addition, resynchronized
13308 the code here, so it matches the same code in
13309 ImplicitReferenceConversionExists for the `from any class-type S
13310 to any interface-type T'.
13313 2004-11-25 Marek Safar <marek.safar@seznam.cz>
13315 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13317 2004-11-24 Miguel de Icaza <miguel@ximian.com>
13319 * cs-parser.jay: Use verbosity accordingly.
13321 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13323 * expression.cs (Unary.ResolveOperator): Do not report warning;
13324 AddressOf reads from variable.
13326 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
13328 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13332 * attribute.cs (Attributable): Removed CheckTargets.
13333 (Attributes.Emit): Explicit attribute targets are tested here.
13335 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
13336 not enabled for interfaces.
13338 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
13339 (GetAssemblyName): Ouch next bug there.
13341 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
13343 * expression.cs: Error 275 added.
13345 2004-11-23 Marek Safar <marek.safar@seznam.cz>
13347 Fix bug #69177 (Implemented decimal constant support)
13349 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
13350 (BinaryFold): Add DecimalConstant.
13352 * const.cs (Define): Decimal constant
13354 (ChangeType): Add decimal type handling.
13355 (LookupConstantValue): Don't set value for decimal type but
13356 emit DecimalConstantAttribute. Needed for constant optimization.
13358 * constant.cs (ToDecimal): New method.
13359 (ConvertToDecimal): New method.
13360 (IntConstant): Implemented ConvertToDecimal.
13361 (DecimalConstant.Emit): Emit optimized version for decimals in
13364 * expression.cs (ResolveOperator): Changed order of constant
13365 reduction to work correctly with native types which have
13366 overloaded operators.
13367 (ResolveMemberAccess): Extract constant value from attribute
13370 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
13372 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
13373 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
13374 (ChangeType): Decimal is special.
13375 (TypeToCoreType): Add decimal type.
13377 2004-11-22 Marek Safar <marek.safar@seznam.cz>
13379 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
13382 2004-11-22 Marek Safar <marek.safar@seznam.cz>
13384 * class.cs (EventField.ApplyAttributeBuilder): Fix error
13387 2004-11-19 Marek Safar <marek.safar@seznam.cz>
13389 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
13391 * pending.cs (PendingImplementation): Grab only interfaces.
13393 2004-11-19 Marek Safar <marek.safar@seznam.cz>
13395 * statement.cs (ForeachHelperMethods): Add location member and
13396 error 202 detection.
13398 2004-11-19 Raja R Harinath <rharinath@novell.com>
13400 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
13401 automatically handled by executable.make.
13402 (PROGRAM): Make profile-specific.
13404 2004-11-18 Marek Safar <marek.safar@seznam.cz>
13406 * expression.cs (DoResolveBase): Fixed wrong warning for out
13409 2004-11-18 Martin Baulig <martin@ximian.com>
13411 Merged latest changes into gmcs. Please keep this comment in
13412 here, it makes it easier for me to see what changed in MCS since
13413 the last time I merged.
13415 2004-11-17 Raja R Harinath <rharinath@novell.com>
13417 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
13418 (TypeHandle.GetMemberCache): New.
13419 (TypeHandle.TypeHandle): Update.
13420 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
13421 (TypeManager.LookupParentInterfacesCache):
13422 Rename from LookupInterfaceCache. Optimize slightly.
13423 (TypeManager.MemberLookup_FindMembers): Update.
13424 * decl.cs (MemberCache.MemberCache): Set Container to null in the
13425 multi-type variant.
13426 (AddCacheContents): Rename from AddHashtable.
13427 * class.cs (TypeContainer.parent_container): Remove.
13428 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
13429 (TypeContainer.DoDefineMembers): Don't initialize it.
13430 Update to name changes.
13432 2004-11-17 Miguel de Icaza <miguel@ximian.com>
13434 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
13435 that factors the code to check access modifiers on override.
13437 (PropertyBase): Use the code here.
13439 Patch from Lluis S'anchez, fixes bug #69361.
13441 2004-11-15 Miguel de Icaza <miguel@ximian.com>
13443 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
13444 routine that is used to report the use of a captured variable
13445 whose address has been taken.
13447 There are two checks: one when variables are being captured and
13448 the other check is when the address of a variable is taken.
13450 (because an anonymous methods might be resolved before *or* after
13451 the address has been taken) and
13453 * expression.cs (Conditional.DoResolve): Remove the special
13454 casing that Martin added to trueExpr and falseExpr being both
13455 NullLiteral. We get the right behavior now just by introducing
13456 the null_type into the compiler.
13458 * convert.cs (ExplicitConversion): Change the code to use
13459 null_type instead of testing `expr is NullLiteral'.
13460 (ImplicitConversionStandard): use null_type too.
13461 (ImplicitReferenceConversionExists): use null_type too.
13462 (ImplicitReferenceConversion): use null_type too.
13464 * literal.cs: The type of `NullLiteral' is now null_type instead
13466 (Resolve): Set the type here.
13468 * typemanager.cs: Introduce null_type.
13470 2004-11-17 Martin Baulig <martin@ximian.com>
13472 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
13473 direction, like FindMembers() does. Fixes #69546, testcase is in
13476 2004-11-16 Martin Baulig <martin@ximian.com>
13478 This is based on a patch from Marek Safar, see bug #69082.
13479 Fixes bugs #63705 and #67130.
13481 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
13482 method; create a MemberCache for an interface type and cache the
13485 * decl.cs (IMemberContainer.ParentContainer): Removed.
13486 (IMemberContainer.ParentCache): New property.
13487 (MemberCache.SetupCacheForInterface): Removed.
13488 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
13489 to create a cache for an interface's "parent".
13491 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
13494 2004-11-16 Martin Baulig <martin@ximian.com>
13496 Merged back from gmcs; these changes already went into gmcs a
13497 couple of weeks ago.
13500 (TypeManager.AddUserType): Removed the `ifaces' argument.
13501 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
13503 (TypeManager.AddUserInterface): Removed.
13504 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
13506 (TypeManager.GetInterfaces): Likewise.
13507 (TypeManager.GetExplicitInterfaces): Likewise.
13509 * ecore.cs (TypeExpr.GetInterfaces): Removed.
13511 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
13512 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
13514 2004-11-14 Ben Maurer <bmaurer@ximian.com>
13516 * statement.cs: Avoid adding bools to a hashtable.
13518 2004-11-07 Miguel de Icaza <miguel@ximian.com>
13520 * expression.cs (Invocation.OverloadResolve): Flag error if we are
13521 calling an unsafe method from a safe location.
13523 2004-11-06 Marek Safar <marek.safar@seznam.cz>
13526 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
13528 2004-11-06 Miguel de Icaza <miguel@ximian.com>
13530 * namespace.cs (VerifyUsing): use GetPartialName instead of
13533 2004-11-05 Miguel de Icaza <miguel@ximian.com>
13535 * statement.cs (Return.Resolve): Fix regression in typo: if
13536 `in_exc', we have to request a NeedReturnLabel, this was a typo
13537 introduced in the anonymous method check-in. Fixes #69131.
13539 * Indexers were using the ShortName when defining themselves,
13540 causing a regression in the compiler bootstrap when applying the
13541 patch from 2004-11-02 (first part), now they use their full name
13542 and the bug is gone.
13544 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
13546 * driver.cs: Strip the path from the names of embedded resources. Fixes
13549 2004-11-04 Raja R Harinath <rharinath@novell.com>
13551 Fix error message regression: cs0104-2.cs.
13552 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
13553 (AliasEntry.Resolve): Update.
13554 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
13556 (RootContext.LookupType): Update.
13558 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
13560 * cs-parser.jay: Add support for handling accessor modifiers
13561 * class: Add support port accessor modifiers and error checking,
13562 define PropertyMethod.Define as virtual (not abstract anymore)
13563 * ecore.cs: Add checking for proeprties access with access modifiers
13564 * iterators.cs: Modify Accessor constructor call based in the modified
13566 2004-11-02 Ben Maurer <bmaurer@ximian.com>
13568 * expression.cs (StringConcat): Handle being called twice,
13569 as when we have a concat in a field init with more than two
13572 2004-11-02 Miguel de Icaza <miguel@ximian.com>
13574 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
13575 special case explicit implementations, we should always produce
13576 the .property or .event declaration.
13578 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
13579 since it will not return correct data if people use this
13580 unresolved in the presence of using statements (see test-313).
13582 * class.cs (MethodData.Define): If we are an explicit interface
13583 implementation, set the method name to the full name of the
13584 interface plus the name of the method.
13586 Notice that using the method.MethodName.GetFullName() does not
13587 work, as it will only contain the name as declared on the source
13588 file (it can be a shorthand in the presence of using statements)
13589 and not the fully qualifed type name, for example:
13593 class D : ICloneable {
13594 object ICloneable.Clone () {
13598 Would produce a method called `ICloneable.Clone' instead of
13599 `System.ICloneable.Clone'.
13601 * namespace.cs (Alias.Resolve): Use GetPartialName.
13603 2004-11-01 Marek Safar <marek.safar@seznam.cz>
13605 * cs-parser.jay: Add error 1055 report.
13607 2004-11-01 Miguel de Icaza <miguel@ximian.com>
13609 * assign.cs (Assign.DoResolve): Only do the transform of
13610 assignment into a New if the types are compatible, if not, fall
13611 through and let the implicit code deal with the errors and with
13612 the necessary conversions.
13614 2004-11-01 Marek Safar <marek.safar@seznam.cz>
13616 * cs-parser.jay: Add error 1031 report.
13618 * cs-tokenizer.cs: Add location for error 1038.
13620 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13622 * cs-parser.jay: Add error 1016 report.
13624 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13626 * cs-parser.jay: Add errors 1575,1611 report.
13628 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13630 * cs-parser.jay: Add error 1001 report.
13632 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13635 * attribute.cs (GetMarshal): Add method argument for
13636 caller identification.
13638 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
13639 agument for GetMarshal and RuntimeMissingSupport.
13641 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13643 * attribute.cs (ExtractSecurityPermissionSet): Removed
13644 TypeManager.code_access_permission_type.
13646 * typemanager.cs: Removed TypeManager.code_access_permission_type.
13648 2004-10-27 Miguel de Icaza <miguel@ximian.com>
13650 * expression.cs (LocalVariableReference.DoResolveLValue): Check
13651 for obsolete use of a variable here. Fixes regression on errors
13652 cs0619-25 and cs0619-26.
13654 2004-10-27 Marek Safar <marek.safar@seznam.cz>
13656 Fix #62358, implemented security attribute encoding.
13658 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
13659 Tests permitted SecurityAction for assembly or other types.
13660 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
13661 data from SecurityPermissionAttribute to PermisionSet class.
13663 * class.cs (ApplyAttributeBuilder): Added special handling
13664 for System.Security.Permissions.SecurityAttribute based types.
13666 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
13667 special handling for System.Security.Permissions.SecurityAttribute
13670 * enum.cs (ApplyAttributeBuilder): Added special handling
13671 for System.Security.Permissions.SecurityAttribute based types.
13673 * parameter.cs (ApplyAttributeBuilder): Added special handling
13674 for System.Security.Permissions.SecurityAttribute based types.
13676 * rootcontext.cs: Next 2 core types.
13678 * typemanager.cs (TypeManager.security_permission_attr_type):
13679 Built in type for the SecurityPermission Attribute.
13680 (code_access_permission_type): Build in type.
13682 2004-10-17 Miguel de Icaza <miguel@ximian.com>
13684 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
13685 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
13686 all of this information into
13687 EmitContext.EmitCapturedVariableInstance.
13689 * codegen.cs (EmitCapturedVariableInstance): move here the
13690 funcionality of emitting an ldarg.0 in the presence of a
13691 remapping. This centralizes the instance emit code.
13693 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
13694 then emit a load of this: it means that we have reached the
13695 topmost ScopeInfo: the one that contains the pointer to the
13696 instance of the class hosting the anonymous method.
13698 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
13699 captures to the topmost CaptureContext.
13701 2004-10-12 Miguel de Icaza <miguel@ximian.com>
13703 * expression.cs (LocalVariableReference): Move the knowledge about
13704 the iterators into codegen's EmitCapturedVariableInstance.
13706 2004-10-11 Miguel de Icaza <miguel@ximian.com>
13708 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
13709 all code paths return a value from an anonymous method (it is the
13710 same as the 161 error, but for anonymous methods).
13712 2004-10-08 Miguel de Icaza <miguel@ximian.com>
13714 The introduction of anonymous methods in the compiler changed
13715 various ways of doing things in the compiler. The most
13716 significant one is the hard split between the resolution phase
13717 and the emission phases of the compiler.
13719 For instance, routines that referenced local variables no
13720 longer can safely create temporary variables during the
13721 resolution phase: they must do so from the emission phase,
13722 since the variable might have been "captured", hence access to
13723 it can not be done with the local-variable operations from the runtime.
13727 (Block.Flags): New flag `IsTopLevel' to indicate that this block
13728 is a toplevel block.
13730 (ToplevelBlock): A new kind of Block, these are the blocks that
13731 are created by the parser for all toplevel method bodies. These
13732 include methods, accessors and anonymous methods.
13734 These contain some extra information not found in regular blocks:
13735 A pointer to an optional CaptureContext (for tracking captured
13736 local variables and parameters). A pointer to the parent
13739 (Return.Resolve): Catch missmatches when returning a value from an
13740 anonymous method (error 1662).
13741 Invoke NeedReturnLabel from the Resolve phase instead of the emit
13744 (Break.Resolve): ditto.
13746 (SwitchLabel): instead of defining the labels during the
13747 resolution phase, we now turned the public ILLabel and ILLabelCode
13748 labels into methods called GetILLabelCode() and GetILLabel() that
13749 only define the label during the Emit phase.
13751 (GotoCase): Track the SwitchLabel instead of the computed label
13752 (its contained therein). Emit the code by using
13753 SwitchLabel.GetILLabelCode ().
13755 (LocalInfo.Flags.Captured): A new flag has been introduce to track
13756 whether the Local has been captured or not.
13758 (LocalInfo.IsCaptured): New property, used to tell whether the
13759 local has been captured.
13761 * anonymous.cs: Vastly updated to contain the anonymous method
13764 The main classes here are: CaptureContext which tracks any
13765 captured information for a toplevel block and ScopeInfo used to
13766 track the activation frames for various local variables.
13768 Each toplevel block has an optional capture context associated
13769 with it. When a method contains an anonymous method both the
13770 toplevel method and the anonymous method will create a capture
13771 context. When variables or parameters are captured, they are
13772 recorded on the CaptureContext that owns them, for example:
13776 MyDelegate d = delegate {
13781 Here `a' will be recorded as captured on the toplevel
13782 CapturedContext, the inner captured context will not have anything
13783 (it will only have data if local variables or parameters from it
13784 are captured in a nested anonymous method.
13786 The ScopeInfo is used to track the activation frames for local
13787 variables, for example:
13789 for (int i = 0; i < 10; i++)
13790 for (int j = 0; j < 10; j++){
13791 MyDelegate d = delegate {
13796 At runtime this captures a single captured variable `i', but it
13797 captures 10 different versions of the variable `j'. The variable
13798 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
13799 recorded on a child.
13801 The toplevel ScopeInfo will also track information like the `this'
13802 pointer if instance variables were referenced (this is necessary
13803 as the anonymous method lives inside a nested class in the host
13804 type of the method).
13806 (AnonymousMethod): Expanded to track the Toplevel, implement
13807 `AnonymousMethod.Compatible' to tell whether an anonymous method
13808 can be converted to a target delegate type.
13810 The routine now also produces the anonymous method content
13812 (AnonymousDelegate): A helper class that derives from
13813 DelegateCreation, this is used to generate the code necessary to
13814 produce the delegate for the anonymous method that was created.
13816 * assign.cs: API adjustments for new changes in
13817 Convert.ImplicitStandardConversionExists.
13819 * class.cs: Adjustments to cope with the fact that now toplevel
13820 blocks are of type `ToplevelBlock'.
13822 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
13823 insteda of standard blocks.
13825 Flag errors if params arguments are passed to anonymous methods.
13827 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
13828 `CurrentAnonymousMethod' which points to the current Anonymous
13829 Method. The variable points to the AnonymousMethod class that
13830 holds the code being compiled. It is set in the new EmitContext
13831 created for the anonymous method.
13833 (EmitContext.Phase): Introduce a variable and an enumeration to
13834 assist in enforcing some rules about when and where we are allowed
13835 to invoke certain methods (EmitContext.NeedsReturnLabel is the
13836 only one that enfonces this right now).
13838 (EmitContext.HaveCaptureInfo): new helper method that returns
13839 whether we have a CapturedContext initialized.
13841 (EmitContext.CaptureVariable): New method used to register that a
13842 LocalInfo must be flagged for capturing.
13844 (EmitContext.CapturedParameter): New method used to register that a
13845 parameters must be flagged for capturing.
13847 (EmitContext.CapturedField): New method used to register that a
13848 field must be flagged for capturing.
13850 (EmitContext.HaveCapturedVariables,
13851 EmitContext.HaveCapturedFields): Return whether there are captured
13852 variables or fields.
13854 (EmitContext.EmitMethodHostInstance): This is used to emit the
13855 instance for the anonymous method. The instance might be null
13856 (static methods), this (for anonymous methods that capture nothing
13857 and happen to live side-by-side with the current method body) or a
13858 more complicated expression if the method has a CaptureContext.
13860 (EmitContext.EmitTopBlock): Routine that drives the emission of
13861 code: it will first resolve the top block, then emit any metadata
13862 and then emit the code. The split is done so that we can extract
13863 any anonymous methods and flag any captured variables/parameters.
13865 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
13866 during this phase, the ILGenerator should not be used as labels
13867 and local variables declared here might not be accessible to any
13868 code that is part of an anonymous method.
13870 Exceptions to this include the temporary variables that are
13871 created by some statements internally for holding temporary
13874 (EmitContext.EmitMeta): New routine, in charge of emitting all the
13877 (EmitContext.TemporaryReturn): This method is typically called
13878 from the Emit phase, and its the only place where we allow the
13879 ReturnLabel to be defined other than the EmitMeta. The reason is
13880 that otherwise we would have to duplicate a lot of logic in the
13881 Resolve phases of various methods that today is on the Emit
13884 (EmitContext.NeedReturnLabel): This no longer creates the label,
13885 as the ILGenerator is not valid during the resolve phase.
13887 (EmitContext.EmitThis): Extended the knowledge in this class to
13888 work in anonymous methods in addition to iterators.
13890 (EmitContext.EmitCapturedVariableInstance): This emits whatever
13891 code is necessary on the stack to access the instance to a local
13892 variable (the variable will be accessed as a field).
13894 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
13895 EmitContext.EmitAddressOfParameter): Routines to support
13896 parameters (not completed at this point).
13898 Removals: Removed RemapLocal and RemapLocalLValue. We probably
13899 will also remove the parameters.
13901 * convert.cs (Convert): Define a `ConstantEC' which points to a
13902 null. This is just to prefity some code that uses
13903 ImplicitStandardConversion code and do not have an EmitContext
13906 The idea is to flag explicitly that at that point in time, it is
13907 known that the conversion will not trigger the delegate checking
13908 code in implicit conversions (which requires a valid
13911 Everywhere: pass new EmitContext parameter since
13912 ImplicitStandardConversionExists now requires it to check for
13913 anonymous method conversions.
13915 (Convert.ImplicitStandardConversionExists): If the type of an
13916 expression is the anonymous_method_type, and the type is a
13917 delegate, we invoke the AnonymousMethod.Compatible method to check
13918 whether an implicit conversion is possible.
13920 (Convert.ImplicitConversionStandard): Only do implicit method
13921 group conversions if the language level is not ISO_1.
13923 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
13924 MethodInfo for the Invoke method. used by Delegate and
13927 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
13928 method conversions if the target type is a delegate.
13930 Removed extra debugging nops.
13932 (LocalVariableReference): Turn the `local_info' into a public
13935 Add `prepared' field, the same hack used for FieldExprs to cope
13936 with composed assignments, as Local variables do not necessarily
13937 operate purely on the stack as they used to: they can be captured
13940 Add `temp' for a temporary result, like fields.
13942 Refactor DoResolve and DoResolveLValue into DoResolveBase.
13944 It now copes with Local variables that are captured and emits the
13945 proper instance variable to load it from a field in the captured
13948 (ParameterReference.DoResolveBase): During the resolve phase,
13949 capture parameters if we are in an anonymous method.
13951 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
13952 anonymous method, use the EmitContext helper routines to emit the
13953 parameter reference.
13955 * iterators.cs: Set RemapToProxy to true/false during the
13958 * parameters.cs (GetParameterByName): New helper method.
13960 * typemanager.cs (anonymous_method_type) a new type that
13961 represents an anonyous method. This is always an internal type,
13962 used as a fencepost to test against the anonymous-methodness of an
13965 2004-10-20 Marek Safar <marek.safar@seznam.cz>
13967 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
13969 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
13971 2004-10-18 Martin Baulig <martin@ximian.com>
13973 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
13974 `Type' directly, but call ResolveType() on it.
13975 (Catch.Resolve): Likewise.
13976 (Foreach.Resolve): Likewise.
13978 2004-10-18 Martin Baulig <martin@ximian.com>
13980 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
13981 `Type' directly, but call ResolveType() on it.
13982 (Probe.DoResolve): Likewise.
13983 (ArrayCreation.LookupType): Likewise.
13984 (TypeOf.DoResolve): Likewise.
13985 (SizeOf.DoResolve): Likewise.
13987 2004-10-18 Martin Baulig <martin@ximian.com>
13989 * expression.cs (Invocation.BetterFunction): Put back
13990 TypeManager.TypeToCoreType().
13992 2004-10-18 Raja R Harinath <rharinath@novell.com>
13994 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
13997 2004-10-18 Martin Baulig <martin@ximian.com>
13999 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
14000 `Type' directly, but call ResolveType() on it.
14002 2004-10-18 Martin Baulig <martin@ximian.com>
14004 * class.cs (FieldMember.Define): Don't access the TypeExpr's
14005 `Type' directly, but call ResolveType() on it.
14006 (MemberBase.DoDefine): Likewise.
14008 * expression.cs (New.DoResolve): Don't access the TypeExpr's
14009 `Type' directly, but call ResolveType() on it.
14010 (ComposedCast.DoResolveAsTypeStep): Likewise.
14012 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14013 `Type' directly, but call ResolveType() on it.
14015 2004-10-17 John Luke <john.luke@gmail.com>
14017 * class.cs (Operator.GetSignatureForError): use CSharpName
14019 * parameter.cs (Parameter.GetSignatureForError): Returns
14020 correct name even if was not defined.
14022 2004-10-13 Raja R Harinath <rharinath@novell.com>
14025 * class.cs (TypeContainer.EmitContext): New property.
14026 (DefineNestedTypes): Create an emitcontext for each part.
14027 (MethodCore.DoDefineParameters): Use container's emitcontext.
14028 Pass type array to InternalParameters.
14029 (MemberBase.DoDefine): Use container's emitcontext.
14030 (FieldMember.Define): Likewise.
14031 (Event.Define): Likewise.
14032 (SetMethod.GetParameterInfo): Change argument to EmitContext.
14033 Pass type array to InternalParameters.
14034 (SetIndexerMethod.GetParameterInfo): Likewise.
14035 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14036 * delegate.cs (Define): Pass emitcontext to
14037 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
14038 array to InternalParameters.
14039 * expression.cs (ParameterReference.DoResolveBase): Pass
14040 emitcontext to GetParameterInfo.
14041 (ComposedCast.DoResolveAsTypeStep): Remove check on
14042 ec.ResolvingTypeTree.
14043 * parameter.cs (Parameter.Resolve): Change argument to
14044 EmitContext. Use ResolveAsTypeTerminal.
14045 (Parameter.GetSignature): Change argument to EmitContext.
14046 (Parameters.ComputeSignature): Likewise.
14047 (Parameters.ComputeParameterTypes): Likewise.
14048 (Parameters.GetParameterInfo): Likewise.
14049 (Parameters.ComputeAndDefineParameterTypes): Likewise.
14050 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
14051 * support.cs (InternalParameters..ctor): Remove variant that takes
14053 * typemanager.cs (system_intptr_expr): New.
14054 (InitExpressionTypes): Initialize it.
14056 2004-10-12 Chris Toshok <toshok@ximian.com>
14058 * cs-parser.jay: fix location for try_statement and catch_clause.
14060 2004-10-11 Martin Baulig <martin@ximian.com>
14062 * report.cs: Don't make --fatal abort on warnings, we have
14063 -warnaserror for that.
14065 2004-10-07 Raja R Harinath <rharinath@novell.com>
14067 More DeclSpace.ResolveType avoidance.
14068 * decl.cs (MemberCore.InUnsafe): New property.
14069 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
14070 with newly created EmitContext.
14071 (FieldMember.Define): Likewise.
14072 * delegate.cs (Delegate.Define): Likewise.
14073 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14074 only if normal name-lookup fails.
14075 (TypeExpr.DoResolve): Enable error-checking.
14076 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14077 (SizeOf.DoResolve): Likewise.
14078 (ComposedCast.DoResolveAsTypeStep): Likewise.
14079 (StackAlloc.DoResolve): Likewise.
14080 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14081 (Block.Unsafe): New property.
14082 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14083 (Unsafe): Set 'unsafe' flag of contained block.
14084 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14085 (Fixed.Resolve): Likewise.
14086 (Catch.Resolve): Likewise.
14087 (Using.ResolveLocalVariableDecls): Likewise.
14088 (Foreach.Resolve): Likewise.
14090 2004-10-05 John Luke <john.luke@gmail.com>
14092 * cs-parser.jay: add location to error CS0175
14094 2004-10-04 Miguel de Icaza <miguel@ximian.com>
14096 * ecore.cs (Expression.Constantity): Add support for turning null
14099 * const.cs (Const.Define): Allow constants to be reference types
14100 as long as the value is Null.
14102 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
14104 * namespace.cs (NamespaceEntry.Using): No matter which warning
14105 level is set, check if this namespace name has already been added.
14107 2004-10-03 Ben Maurer <bmaurer@ximian.com>
14109 * expression.cs: reftype [!=]= null should always use br[true,false].
14112 2004-10-03 Marek Safar <marek.safar@seznam.cz>
14115 * attribute.cs: Enum conversion moved to
14116 GetAttributeArgumentExpression to be applied to the all
14119 2004-10-01 Raja R Harinath <rharinath@novell.com>
14121 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14122 * class.c (TypeContainer.DefineType): Flag error if
14123 base types aren't accessible due to access permissions.
14124 * decl.cs (DeclSpace.ResolveType): Move logic to
14125 Expression.ResolveAsTypeTerminal.
14126 (DeclSpace.ResolveTypeExpr): Thin layer over
14127 Expression.ResolveAsTypeTerminal.
14128 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14129 Refactor code into NestedAccess. Use it.
14130 (DeclSpace.NestedAccess): New.
14131 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14132 argument to silence errors. Check access permissions.
14133 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14134 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14135 (Cast.DoResolve): Likewise.
14136 (New.DoResolve): Likewise.
14137 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14138 (TypeOf.DoResolve): Likewise.
14140 * expression.cs (Invocation.BetterConversion): Return the Type of
14141 the better conversion. Implement section 14.4.2.3 more faithfully.
14142 (Invocation.BetterFunction): Make boolean. Make correspondence to
14143 section 14.4.2.2 explicit.
14144 (Invocation.OverloadResolve): Update.
14145 (Invocation): Remove is_base field.
14146 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
14147 (Invocation.Emit): Likewise.
14149 2004-09-27 Raja R Harinath <rharinath@novell.com>
14151 * README: Update to changes.
14153 2004-09-24 Marek Safar <marek.safar@seznam.cz>
14155 * cs-parser.jay: Reverted 642 warning fix.
14157 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14160 * decl.cs (FindMemberWithSameName): Indexer can have more than
14163 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14165 * expression.cs (LocalVariableReference.DoResolveLValue):
14166 Do not report warning 219 for out values.
14167 (EmptyExpression.Null): New member to avoid extra allocations.
14169 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14171 * cs-parser.jay: Fix wrong warning 642 report.
14173 * cs-tokenizer.cs (CheckNextToken): New helper;
14174 Inspect next character if is same as expected.
14176 2004-09-23 Martin Baulig <martin@ximian.com>
14178 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14179 (Convert.ImplicitReferenceConversionExists): Likewise.
14181 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14183 * class.cs (Operator.Define): Add error 448 and 559 report.
14185 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14187 * class.cs (MemberBase.IsTypePermitted): New protected
14188 method for checking error CS0610.
14190 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14192 * class.cs (TypeContainer.HasExplicitLayout): New property
14193 Returns whether container has StructLayout attribute set Explicit.
14194 (FieldMember): New abstract class for consts and fields.
14195 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14196 (Field): Reuse FieldMember.
14198 * const.cs (Const): Reuse FieldMember.
14200 * rootcontext.cs: EmitConstants call moved to class.
14202 2004-09-22 Martin Baulig <martin@ximian.com>
14204 Thanks to Peter Sestoft for this bug report.
14206 * expression.cs (Conditional): If both the `trueExpr' and the
14207 `falseExpr' is a NullLiteral, return a NullLiteral.
14209 2004-09-22 Martin Baulig <martin@ximian.com>
14211 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14212 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14213 for the "get_Current" call.
14215 2004-09-22 Martin Baulig <martin@ximian.com>
14217 Marek and me just fixed one of our oldest bugs: #28562 :-)
14219 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14221 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14222 we're an EnumConstant, just return that.
14223 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14224 an EnumConstant. In this case, we need to use GetValueAsEnumType()
14225 to get the value which'll actually be written into the attribute.
14226 However, we have to use GetValue() to access the attribute's value
14229 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14231 * constant.cs (Constant.IsNegative): New abstract property
14234 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14235 (StackAlloc.DoResolve): Reused IsNegative.
14237 2004-09-21 Martin Baulig <martin@ximian.com>
14239 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14240 if we're used in an iterator, we may be called from different
14243 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14244 we actually have an exception block.
14246 2004-09-20 John Luke <jluke@cfl.rr.com>
14248 * class.cs, cs-parser.jay: Improve the error report for 1520:
14249 report the actual line where the error happens, not where the
14250 class was declared.
14252 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14253 Pass location information that was available elsewhere.
14255 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
14257 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14258 runtime to delay sign assemblies.
14260 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14262 * cs-parser.jay: Do not report the stack trace, this is barely
14265 2004-08-22 John Luke <john.luke@gmail.com>
14267 * driver.cs : check that a resource id is not already used
14268 before adding it, report CS1508 if it is, bug #63637
14270 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14272 * ecore.cs: Removed dead code.
14274 2004-09-18 Marek Safar <marek.safar@seznam.cz>
14276 * class.cs: Do not report warning CS0067 on the interfaces.
14278 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14280 * cs-parser.jay: Add error 504 report.
14282 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14284 * rootcontext.cs: WarningLevel is 4 by default now.
14286 * statement.cs (Fixed.Resolve): Do not null
14289 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14292 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14293 deep search when property is not virtual.
14294 (PropertyExpr.ResolveAccessors): Make one call for both
14297 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14300 * statement.cs: Error 152 report constains also location.
14302 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14305 * const.cs: Explicitly set constant as static.
14307 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14310 * cs-parser.jay: Add error 1017 report.
14312 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14314 Fixed bug #59980, #64224
14315 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14317 * typemanager.cs (IsSpecialMethod): Simplified
14319 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14321 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14322 condition with better params.
14324 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14327 * attribute.cs (Resolve): Property has to have both
14330 2004-09-14 Martin Baulig <martin@ximian.com>
14332 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
14334 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14337 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
14338 called and is obsolete then this member suppress message
14339 when call is inside next [Obsolete] method or type.
14341 * expression.cs: Use TestObsoleteMethodUsage member.
14343 2004-09-14 Martin Baulig <martin@ximian.com>
14345 * cs-parser.jay: Sync a bit with the GMCS version.
14347 2004-09-14 Martin Baulig <martin@ximian.com>
14349 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
14350 (CSharpParser.yacc_verbose_flag): New public field.
14352 * genericparser.cs: Removed.
14354 2004-09-14 Raja R Harinath <rharinath@novell.com>
14356 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
14358 2004-09-13 Marek Safar <marek.safar@seznam.cz>
14360 * class.cs (MethodCore.CheckBase): Fix bug #65757.
14362 2004-09-10 Martin Baulig <martin@ximian.com>
14364 Backported my MemberName changes from GMCS into MCS.
14366 - we are now using a special `MemberName' class instead of using
14367 strings; in GMCS, the `MemberName' also contains the type
14370 - changed the grammar rules a bit:
14371 * the old `member_name' is now a `namespace_or_type_name':
14372 The rule is that we use `namespace_or_type_name' everywhere
14373 where we expect either a "member name" (GetEnumerator) or a
14374 "member name" with an explicit interface name
14375 (IEnumerable.GetEnumerator).
14376 In GMCS, the explicit interface name may include type arguments
14377 (IEnumerable<T>.GetEnumerator).
14378 * we use `member_name' instead of just `IDENTIFIER' for
14380 The rule is that we use `member_name' wherever a member may
14381 have type parameters in GMCS.
14383 * decl.cs (MemberName): New public class.
14384 (MemberCore.MemberName): New public readonly field.
14385 (MemberCore.ctor): Take a `MemberName' argument, not a string.
14386 (DeclSpace): Likewise.
14388 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
14389 * enum.cs (Enum.ctor): Likewise.
14391 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
14393 (AliasEntry.ctor): Take a MemberName, not an Expression.
14394 (AliasEntry.UsingAlias): Likewise.
14396 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
14397 (IMethodData.MemberName): Changed type from string to MemberName.
14398 (MemberBase.ExplicitInterfaceName): Likewise.
14399 (AbstractPropertyEventMethod.SetupName): Make this private.
14400 (AbstractPropertyEventMethod.ctor): Added `string prefix'
14401 argument; compute the member name here.
14402 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
14403 on the `member.MemberName' and the `prefix'.
14405 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
14407 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
14408 thus, we get a `MemberName' instead of a `string'. These
14409 declarations may have type parameters in GMCS.
14410 (interface_method_declaration, delegate_declaration): Likewise.
14411 (class_declaration, interface_declaration): Likewise.
14412 (method_header): Use `namespace_or_type_name' instead of
14413 `member_name'. We may be an explicit interface implementation.
14414 (property_declaration, event_declaration): Likewise.
14415 (member_name): This is now just an `IDENTIFIER', not a
14416 `namespace_or_type_name'.
14417 (type_name, interface_type): Removed.
14418 (namespace_or_type_name): Return a MemberName, not an Expression.
14419 (primary_expression): Use `member_name' instead of `IDENTIFIER';
14420 call GetTypeExpression() on the MemberName to get an expression.
14421 (IndexerDeclaration.interface_type): Changed type from string to
14423 (MakeName): Operate on MemberName's instead of string's.
14425 2004-09-13 Raja R Harinath <rharinath@novell.com>
14428 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
14429 (NamespaceEntry.Lookup): Add new argument to flag if we want the
14430 lookup to avoid symbols introduced by 'using'.
14431 * rootcontext.cs (NamespaceLookup): Update.
14433 2004-09-12 Marek Safar <marek.safar@seznam.cz>
14435 * class.cs (TypeContainer.DoDefineMembers): Do not call
14436 DefineDefaultConstructor for static classes.
14438 2004-09-12 Marek Safar <marek.safar@seznam.cz>
14440 * attribute.cs (Attribute.Resolve): Add error 653 report.
14442 * class.cs (Class.ApplyAttributeBuilder): Add error 641
14444 (Method.ApplyAttributeBuilder): Add error 685 report.
14445 (Operator.Define): Add error 564 report.
14447 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
14449 * expression.cs (Invocation.DoResolve): Add error
14450 245 and 250 report.
14452 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
14455 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14457 * class.cs (ConstructorInitializer.Resolve):
14458 Wrong error number (515->516).
14460 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14462 * class.cs (Indexer.Define): Add error 631 report.
14464 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14466 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
14468 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14470 * expression.cs (Probe.DoResolve): Add error CS0241 report.
14472 2004-09-10 Marek Safar <marek.safar@seznam.cz>
14474 * cs-parser.jay: Added error CS0241 report.
14476 2004-09-10 Raja R Harinath <rharinath@novell.com>
14478 * cs-parser.jay (fixed_statement): Introduce a scope for the
14479 declaration in the 'fixed' statement.
14481 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14483 * cs-parser.jay: Added CS0230 error report.
14485 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14487 * cs-parser.jay: Added errors CS0231 and CS0257 report.
14489 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14491 * expression.cs (Argument.Resolve): Added error CS0192 and
14494 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14496 C# 2.0 #pragma warning feature
14498 * cs-tokenizer.cs (PreProcessPragma): New method;
14499 Handles #pragma directive.
14501 * report.cs (WarningRegions): New class; Support
14502 class for #pragma warning directive. It tests whether
14503 warning is enabled for a given line.
14505 2004-09-08 Miguel de Icaza <miguel@ximian.com>
14507 * const.cs: Add more descriptive error report, tahnks to
14510 2004-09-08 Marek Safar <marek.safar@seznam.cz>
14512 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
14514 2004-09-07 Miguel de Icaza <miguel@ximian.com>
14516 * expression.cs: Apply patch from Ben: Remove dead code from
14517 ArrayCreation, and remove the TurnintoConstant call in const.cs,
14518 as that code just threw an exception anwyays.
14520 * const.cs: Remove the call to the turnintoconstant, for details
14523 * literal.cs: The type of the null-literal is the null type; So
14524 we use a placeholder type (literal.cs:System.Null, defined here)
14527 * expression.cs (Conditional.DoResolve): Remove some old code that
14528 is no longer needed, conversions have been fixed.
14530 (ArrayCreationExpression.DoResolve): Return false if we fail to
14531 resolve the inner expression.
14533 2004-09-07 Raja R Harinath <rharinath@novell.com>
14536 * cs-parser.jay (delegate_declaration): Record a delegate
14537 declaration as a type declaration.
14538 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
14540 2004-09-06 Miguel de Icaza <miguel@ximian.com>
14542 * parameter.cs: Do not crash if the type can not be resolved.
14544 * expression.cs: Report errors with unsafe pointers, fixes #64896
14546 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
14548 * expression.cs: Pointer arith always needs to do a conv.i
14549 if the operand is a long. fix 65320
14551 2004-09-04 Marek Safar <marek.safar@seznam.cz>
14553 Fixed cs0619-37.cs, cs0619-38.cs
14555 * enum.cs (GetObsoleteAttribute): Removed.
14557 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
14558 on Enum member is double staged. The first is tested member
14561 2004-09-04 Marek Safar <marek.safar@seznam.cz>
14563 Fixed #56986, #63631, #65231
14565 * class.cs: (TypeContainer.AddToMemberContainer): New method,
14566 adds member to name container.
14567 (TypeContainer.AddToTypeContainer): New method, adds type to
14569 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
14570 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
14571 AddOperator): Simplified by reusing AddToMemberContainer.
14572 (TypeContainer.UserDefinedStaticConstructor): Changed to property
14574 (Method.CheckForDuplications): Fixed implementation to test all
14576 (MemberBase): Detection whether member is explicit interface
14577 implementation is now in constructor.
14578 (MemberBase.UpdateMemberName): Handles IndexerName.
14579 (Accessor): Changed to keep also location information.
14580 (AbstractPropertyEventMethod): Is derived from MemberCore.
14581 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
14582 will be emited or not.
14583 (PropertyBase.AreAccessorsDuplicateImplementation):
14584 Tests whether accessors are not in collision with some method.
14585 (Operator): Is derived from MethodCore to simplify common
14588 * decl.cs (Flags.TestMethodDuplication): Test for duplication
14590 (DeclSpace.AddToContainer): Adds the member to defined_names
14591 table. It tests for duplications and enclosing name conflicts.
14593 * enum.cs (EnumMember): Clean up to reuse the base structures
14595 2004-09-03 Martin Baulig <martin@ximian.com>
14597 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
14598 into TypeContainer, to make partial classes work again.
14600 2004-09-03 Martin Baulig <martin@ximian.com>
14602 * rootcontext.cs (RootContext.V2): Removed.
14604 2004-03-23 Martin Baulig <martin@ximian.com>
14606 * expression.cs (Invocation.OverloadResolve): Added `bool
14607 may_fail' argument and use it instead of the Location.IsNull() hack.
14609 2004-09-03 Martin Baulig <martin@ximian.com>
14611 Merged latest changes into gmcs. Please keep this comment in
14612 here, it makes it easier for me to see what changed in MCS since
14613 the last time I merged.
14615 2004-09-03 Raja R Harinath <rharinath@novell.com>
14618 * expression.cs (BetterConversion): Don't allow either conversion
14619 to be null. Remove redundant implicit conversion test when 'q ==
14620 null' -- when this function is invoked, we already know that the
14621 implicit conversion exists.
14622 (BetterFunction): Assume that 'best' is non-null. Remove
14623 redundant reimplementation of IsApplicable when 'best' is null.
14624 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
14625 number of arguments.
14626 (IsAncestralType): Extract from OverloadResolve.
14627 (OverloadResolve): Make robust to the MethodGroupExpr being
14628 unsorted. Implement all the logic of Section 14.5.5.1, and
14629 support overloading of methods from multiple applicable types.
14630 Clean up logic somewhat. Don't pass null methods to BetterFunction.
14632 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
14633 (RealError, Warning): Append type of report to related symbol.
14635 2004-09-03 Marek Safar <marek.safar@seznam.cz>
14637 * enum.cs: Fixed CLS-Compliance checks for enum members.
14638 Error tests cs3008-8.cs, cs3014-8.cs
14640 2004-09-02 Marek Safar <marek.safar@seznam.cz>
14642 Fixed bug #62342, #63102
14643 * class.cs: ImplementIndexer uses member.IsExplicitImpl
14644 like ImplementMethod.
14646 2004-09-02 Marek Safar <marek.safar@seznam.cz>
14648 * attribute.cs (Attribute.GetAttributeArgumentExpression):
14651 2004-09-02 Martin Baulig <martin@ximian.com>
14653 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
14654 TypeManager.GetArgumentTypes() rather than calling GetParameters()
14657 2004-09-01 Marek Safar <marek.safar@seznam.cz>
14659 C# 2.0 Static classes implemented
14661 * class.cs (TypeContainer): instance_constructors,
14662 initialized_fields, initialized_static_fields,
14663 default_constructor, base_inteface_types are protected to be
14664 accessible from StaticClass.
14665 (TypeContainer.DefineDefaultConstructor): New virtual method
14666 for custom default constructor generating
14667 (StaticClass): New class to handle "Static classes" feature.
14669 * cs-parser.jay: Handle static keyword on class like instance
14672 * driver.cs: Added "/langversion" command line switch with two
14673 options (iso-1, default).
14675 2004-08-31 Marek Safar <marek.safar@seznam.cz>
14677 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
14679 2004-08-31 Miguel de Icaza <miguel@ximian.com>
14681 * delegate.cs: Style.
14683 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
14685 * delegate.cs: Add seperate instance expr field for miguel.
14687 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
14689 * PointerArithmetic (Resolve): make sure we are not doing
14690 pointer arith on void*. Also, make sure we are resolved
14691 by not setting eclass until resolve.
14693 All callers: Make sure that PointerArithmetic gets resolved.
14695 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
14697 * ArrayCreation (LookupType): If the type does not resolve
14698 to an array, give an error.
14700 2004-08-27 Marek Safar <marek.safar@seznam.cz>
14702 * statement.cs (Try.Resolve): Fixed bug #64222
14704 2004-08-27 Martin Baulig <martin@ximian.com>
14707 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
14710 2004-08-26 Marek Safar <marek.safar@seznam.cz>
14712 * ecore.cs (Constantify): Get underlying type via
14713 System.Enum.GetUnderlyingType to avoid StackOverflow on the
14714 Windows in special cases.
14716 2004-08-26 Marek Safar <marek.safar@seznam.cz>
14718 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
14719 for obtaining also private methods.
14720 (GetRemoveMethod): Used GetRemoveMethod (true)
14721 for obtaining also private methods.
14723 2004-08-24 Martin Baulig <martin@ximian.com>
14725 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
14726 MethodAttributes.HideBySig for operators.
14728 2004-08-23 Martin Baulig <martin@ximian.com>
14730 Back to the old error reporting system :-)
14732 * report.cs (Message): Removed.
14733 (Report.MessageData, ErrorData, WarningData): Removed.
14734 (Report.Error, Warning): Back to the old system.
14736 2004-08-23 Martin Baulig <martin@ximian.com>
14738 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
14740 * class.cs (TypeContainer.ParentContainer): New public virtual
14741 method; replaces the explicit interface implementation.
14742 (ClassPart.ParentContainer): Override.
14744 2004-08-23 Martin Baulig <martin@ximian.com>
14746 * statement.cs (Switch): Added support for constant switches; see
14747 #59428 or test-285.cs.
14749 2004-08-22 Marek Safar <marek.safar@seznam.cz>
14752 * statement.cs (GetEnumeratorFilter): Removed useless
14753 logic because C# specs is strict. GetEnumerator must be
14756 2004-08-22 Martin Baulig <martin@ximian.com>
14758 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14759 a switch and may break, reset the barrier. Fixes #59867.
14761 2004-08-22 Marek Safar <marek.safar@seznam.cz>
14763 CLS-Compliance speed up (~5% for corlib)
14765 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
14766 New method. Tests container for CLS-Compliant names
14768 * class.cs (TypeContainer.VerifyClsName): New method.
14769 Checks whether container name is CLS Compliant.
14770 (Constructor): Implements IMethodData.
14772 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
14773 low-case table for CLS Compliance test.
14774 (MemberCache.VerifyClsParameterConflict): New method.
14775 Checks method parameters for CS3006 error.
14777 * enum.cs (EnumMember): Is derived from MemberCore.
14778 (Enum.VerifyClsName): Optimized for better performance.
14780 2004-08-06 Marek Safar <marek.safar@seznam.cz>
14782 * report.cs: Renamed Error_T to Error and changed all
14785 2004-08-06 Marek Safar <marek.safar@seznam.cz>
14787 * class.cs (TypeContainer.IndexerArrayList): New inner class
14788 container for indexers.
14789 (TypeContainer.DefaultIndexerName): New constant for default
14790 indexer name. Replaced all "Item" with this constant.
14791 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
14793 * typemanager.cs (TypeManager.default_member_ctor): Cache here
14794 DefaultMemberAttribute constructor.
14796 2004-08-05 Martin Baulig <martin@ximian.com>
14798 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
14801 2004-08-05 Marek Safar <marek.safar@seznam.cz>
14803 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
14804 multi platforms problem.
14806 * compiler.csproj: Included shared files.
14808 2004-08-04 Marek Safar <marek.safar@seznam.cz>
14810 Fix bug 60333, 55971 in the more general way
14811 * attribute.cs (Attribute.GetAttributeArgumentExpression):
14812 Added arg_type argument for constant conversion.
14813 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
14815 2004-08-04 Marek Safar <marek.safar@seznam.cz>
14818 * class.cs (TypeContainer ): New inner classes MethodArrayList,
14819 OperatorArrayList, MethodCoreArrayList for typecontainer
14820 containers. Changed class member types to these new types.
14821 (MethodArrayList.DefineMembers): Added test for CS0659.
14823 2004-08-04 Miguel de Icaza <miguel@ximian.com>
14825 * cfold.cs: Synchronize the folding with the code in expression.cs
14826 Binary.DoNumericPromotions for uint operands.
14828 * attribute.cs: Revert patch from Raja, it introduced a regression
14829 while building Blam-1.2.1 (hard to isolate a test case).
14831 2004-08-04 Marek Safar <marek.safar@seznam.cz>
14835 (TypeContainer.Define): Renamed to DefineContainerMembers because of
14837 (MethodCore.parent_method): New member. The method we're overriding
14838 if this is an override method.
14839 (MethodCore.CheckBase): Moved from Method class and made common.
14840 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
14842 (MethodCore.CheckForDuplications): New abstract method. For custom
14843 member duplication search in a container
14844 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
14845 method and its return type.
14846 (Event.conflict_symbol): New member. Symbol with same name in the
14850 (MemberCache.FindMemberWithSameName): New method. The method
14851 is looking for conflict with inherited symbols.
14853 2004-08-04 Martin Baulig <martin@ximian.com>
14855 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
14857 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
14859 2004-08-03 Marek Safar <marek.safar@seznam.cz>
14861 * report.cs (Message): New enum for better error, warning reference in
14863 (MessageData): New inner abstract class. It generally handles printing of
14864 error and warning messages.
14865 Removed unused Error, Warning, Message methods.
14867 2004-08-03 Marek Safar <marek.safar@seznam.cz>
14869 Fix for cs0592-8.cs test
14871 (Attributable.ValidAttributeTargets): Made public.
14872 (Attribute.ExplicitTarget): New member for explicit target value.
14873 (Attribute.CheckTargets): Now we translate explicit attribute
14874 target to Target here.
14876 2004-08-03 Ben Maurer <bmaurer@ximian.com>
14878 * ecore.cs (MethodGroupExpr): new IsBase property.
14880 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
14882 * delegate.cs (DelegateCreation): store a MethodGroupExpr
14883 rather than an instance expr.
14885 (DelegateCreation.Emit): Use the method group rather than
14886 the instance expression. Also, if you have base.Foo as the
14887 method for a delegate, make sure to emit ldftn, not ldftnvirt.
14889 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
14891 (NewDelegate.DoResolve): Only check for the existance of Invoke
14892 if the method is going to be needed. Use MethodGroupExpr.
14894 (NewDelegate.Emit): Remove, DelegateCreation implements this.
14896 * expression.cs: For pointer arith., make sure to use
14897 the size of the type, not the size of the pointer to
14900 2004-08-03 Marek Safar <marek.safar@seznam.cz>
14903 * class.cs (Class): Added error CS0502 test.
14905 2004-08-03 John Luke <jluke@cfl.rr.com>
14906 Raja R Harinath <rharinath@novell.com>
14909 * attribute.cs (Attribute.complained_before): New flag.
14910 (Attribute.ResolveType, Attribute.Resolve),
14911 (Attribute.DefinePInvokeMethod): Set it.
14912 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
14914 2004-08-03 Martin Baulig <martin@ximian.com>
14916 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
14917 use a user-defined operator; we still need to do numeric
14918 promotions in case one argument is a builtin type and the other
14919 one has an implicit conversion to that type. Fixes #62322.
14921 2004-08-02 Martin Baulig <martin@ximian.com>
14923 * statement.cs (LocalInfo.Flags): Added `IsThis'.
14924 (LocalInfo.IsThis): New public property.
14925 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
14927 2004-08-01 Martin Baulig <martin@ximian.com>
14929 * class.cs (TypeContainer.GetClassBases): Don't set the default
14930 here since we may get called from GetPartialBases().
14931 (TypeContainer.DefineType): If GetClassBases() didn't return a
14932 parent, use the default one.
14934 2004-07-30 Duncan Mak <duncan@ximian.com>
14936 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
14938 2004-07-30 Martin Baulig <martin@ximian.com>
14940 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
14942 * class.cs (SourceMethod): New public class, derive from the
14943 symbol writer's ISourceMethod.
14944 (Method): Use the new symbol writer API.
14946 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
14947 as argument and use the new symbol writer.
14950 (SourceFile): Implement the symbol writer's ISourceFile.
14951 (Location.SymbolDocument): Removed.
14952 (Location.SourceFile): New public property.
14954 * symbolwriter.cs: Use the new symbol writer API.
14956 2004-07-30 Raja R Harinath <rharinath@novell.com>
14958 * Makefile (install-local): Remove. Functionality moved to
14961 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
14963 * Makefile: Install mcs.exe.config file together with mcs.exe.
14964 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
14965 correct runtime version.
14967 2004-07-25 Martin Baulig <martin@ximian.com>
14970 (TypeContainer.RegisterOrder): Removed, this was unused.
14971 (TypeContainer, interface_order): Removed.
14972 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
14973 TypeContainer as argument since we can also be called with a
14974 `PartialContainer' for a partial class/struct/interface.
14975 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
14976 of checking whether we're an `Interface' - we could be a
14977 `PartialContainer'.
14978 (PartialContainer.Register): Override; call
14979 AddClass()/AddStruct()/AddInterface() on our parent.
14981 * cs-parser.jay (interface_member_declaration): Add things to the
14982 `current_container', not the `current_class'.
14984 * rootcontext.cs (RegisterOrder): The overloaded version which
14985 takes an `Interface' was unused, removed.
14987 * typemanager.cs (TypeManager.LookupInterface): Return a
14988 `TypeContainer', not an `Interface'.
14989 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
14990 contain a `PartialContainer' for an interface, so check it's
14991 `Kind' to figure out what it is.
14993 2004-07-25 Martin Baulig <martin@ximian.com>
14995 * class.cs (Class.DefaultTypeAttributes): New public constant.
14996 (Struct.DefaultTypeAttributes): Likewise.
14997 (Interface.DefaultTypeAttributes): Likewise.
14998 (PartialContainer.TypeAttr): Override this and add the
14999 DefaultTypeAttributes.
15001 2004-07-25 Martin Baulig <martin@ximian.com>
15003 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15004 we can just use the `Parent' field instead.
15006 2004-07-25 Martin Baulig <martin@ximian.com>
15008 * class.cs (TypeContainer.Emit): Renamed to EmitType().
15010 2004-07-25 Martin Baulig <martin@ximian.com>
15012 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15013 our parts before defining any methods.
15014 (TypeContainer.VerifyImplements): Make this virtual.
15015 (ClassPart.VerifyImplements): Override and call VerifyImplements()
15016 on our PartialContainer.
15018 2004-07-25 Martin Baulig <martin@ximian.com>
15020 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15022 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15023 argument, we can just use the `Parent' field instead.
15026 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
15027 (MemberBase.DoDefine): Likewise.
15029 2004-07-24 Martin Baulig <martin@ximian.com>
15031 * decl.cs (MemberCore.Parent): New public field.
15032 (DeclSpace.Parent): Moved to MemberCore.
15034 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15035 (MemberBase.ctor): Added TypeContainer argument, pass it to our
15037 (FieldBase, Field, Operator): Likewise.
15038 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15039 (EventField, Event): Likewise.
15041 2004-07-23 Martin Baulig <martin@ximian.com>
15043 * class.cs (PartialContainer): New public class.
15044 (ClassPart): New public class.
15045 (TypeContainer): Added support for partial classes.
15046 (TypeContainer.GetClassBases): Splitted some of the functionality
15047 out into GetNormalBases() and GetPartialBases().
15049 * cs-tokenizer.cs (Token.PARTIAL): New token.
15050 (Tokenizer.consume_identifier): Added some hacks to recognize
15051 `partial', but only if it's immediately followed by `class',
15052 `struct' or `interface'.
15054 * cs-parser.jay: Added support for partial clases.
15056 2004-07-23 Martin Baulig <martin@ximian.com>
15058 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15059 a `DeclSpace' and also made it readonly.
15060 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15061 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15062 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15064 * cs-parser.jay: Pass the `current_class', not the
15065 `current_container' (at the moment, this is still the same thing)
15066 to a new Method, Property, Event, Indexer or Constructor.
15068 2004-07-23 Martin Baulig <martin@ximian.com>
15070 * cs-parser.jay (CSharpParser): Added a new `current_class' field
15071 and removed the `current_interface' one.
15072 (struct_declaration, class_declaration, interface_declaration):
15073 Set `current_class' to the newly created class/struct/interface;
15074 set their `Bases' and call Register() before parsing their body.
15076 2004-07-23 Martin Baulig <martin@ximian.com>
15078 * class.cs (Kind): New public enum.
15079 (TypeContainer): Made this class abstract.
15080 (TypeContainer.Kind): New public readonly field.
15081 (TypeContainer.CheckDef): New public method; moved here from
15083 (TypeContainer.Register): New public abstract method.
15084 (TypeContainer.GetPendingImplementations): New public abstract
15086 (TypeContainer.GetClassBases): Removed the `is_class' and
15087 `is_iface' parameters.
15088 (TypeContainer.DefineNestedTypes): Formerly known as
15090 (ClassOrStruct): Made this class abstract.
15092 * tree.cs (RootTypes): New public type.
15094 2004-07-20 Martin Baulig <martin@ximian.com>
15096 * tree.cs (Tree.RecordNamespace): Removed.
15097 (Tree.Namespaces): Removed.
15099 * rootcontext.cs (RootContext.IsNamespace): Removed.
15101 * cs-parser.jay (namespace_declaration): Just create a new
15102 NamespaceEntry here.
15104 2004-07-20 Martin Baulig <martin@ximian.com>
15106 * statement.cs (ExceptionStatement): New abstract class. This is
15107 now used as a base class for everyone who's using `finally'.
15108 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15109 our local variables before using them.
15111 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15112 virtual method. This is used by Yield.Resolve() to "steal" an
15113 outer block's `finally' clauses.
15114 (FlowBranchingException): The .ctor now takes an ExceptionStatement
15117 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15118 version which takes an ExceptionStatement. This version must be
15119 used to create exception branchings.
15122 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15123 (Iterator.EmitMoveNext): Added exception support; protect the
15124 block with a `fault' clause, properly handle 'finally' clauses.
15125 (Iterator.EmitDispose): Run all the `finally' clauses here.
15127 2004-07-20 Martin Baulig <martin@ximian.com>
15129 * iterator.cs: This is the first of a set of changes in the
15130 iterator code. Match the spec more closely: if we're an
15131 IEnumerable, then GetEnumerator() must be called. The first time
15132 GetEnumerator() is called, it returns the current instance; all
15133 subsequent invocations (if any) must create a copy.
15135 2004-07-19 Miguel de Icaza <miguel@ximian.com>
15137 * expression.cs: Resolve the constant expression before returning
15140 2004-07-19 Martin Baulig <martin@ximian.com>
15142 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15143 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15144 the return type of the new EmitContext.
15146 2004-07-18 Martin Baulig <martin@ximian.com>
15148 * class.cs (Property.Define): Fix iterators.
15150 * iterators.cs (Iterator.Define): Moved the
15151 `container.AddInterator (this)' call here from the .ctor; only do
15152 it if we resolved successfully.
15154 2004-07-17 Miguel de Icaza <miguel@ximian.com>
15156 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15157 `true' for preprocessing directives that we parse. The return
15158 value indicates whether we should return to regular tokenizing or
15159 not, not whether it was parsed successfully.
15161 In the past if we were in: #if false ... #line #endif, we would
15162 resume parsing after `#line'. See bug 61604.
15164 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15165 building: IsEnumType should return true only for enums, not for
15166 enums or System.Enum itself. This fixes #61593.
15168 Likely what happened is that corlib was wrong: mcs depended on
15169 this bug in some places. The bug got fixed, we had to add the
15170 hack, which caused bug 61593.
15172 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15173 that was a workaround for the older conditions.
15175 2004-07-16 Ben Maurer <bmaurer@ximian.com>
15177 * assign.cs: IAssignMethod has a new interface, as documented
15178 inline. All assignment code now uses this new api.
15180 * ecore.cs, expression.cs: All classes which implement
15181 IAssignMethod now use the new interface.
15183 * expression.cs (Invocation): add a hack to EmitCall so that
15184 IndexerAccess can be the target of a compound assignment without
15185 evaluating its arguments twice.
15187 * statement.cs: Handle changes in Invocation api.
15189 2004-07-16 Martin Baulig <martin@ximian.com>
15191 * iterators.cs: Rewrote this. We're now using one single Proxy
15192 class for both the IEnumerable and the IEnumerator interface and
15193 `Iterator' derives from Class so we can use the high-level API.
15195 * class.cs (TypeContainer.AddIterator): New method.
15196 (TypeContainer.DoDefineType): New protected virtual method, which
15197 is called from DefineType().
15198 (TypeContainer.DoDefineMembers): Call DefineType() and
15199 DefineMembers() on all our iterators.
15200 (TypeContainer.Emit): Call Emit() on all our iterators.
15201 (TypeContainer.CloseType): Call CloseType() on all our iterators.
15203 * codegen.cs (EmitContext.CurrentIterator): New public field.
15205 2004-07-15 Martin Baulig <martin@ximian.com>
15208 (TypeManager.not_supported_exception_type): New type.
15210 2004-07-14 Martin Baulig <martin@ximian.com>
15212 * iterators.cs: Use real error numbers.
15214 2004-07-14 Martin Baulig <martin@ximian.com>
15216 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15217 requires this to be a System.Collection.IEnumerable and not a
15218 class implementing that interface.
15219 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
15221 2004-07-13 Marek Safar <marek.safar@seznam.cz>
15223 * class.cs: Fixed previous fix, it broke some error tests.
15225 2004-07-12 Martin Baulig <martin@ximian.com>
15227 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15230 2004-07-09 Miguel de Icaza <miguel@ximian.com>
15232 * assign.cs (LocalTemporary): Add new argument: is_address,If
15233 `is_address' is true, then the value that we store is the address
15234 to the real value, and not the value itself.
15236 * ecore.cs (PropertyExpr): use the new local temporary
15237 stuff to allow us to handle X.Y += z (where X is a struct)
15239 2004-07-08 Martin Baulig <martin@ximian.com>
15241 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15242 not always return, just like we're doing in Using.Resolve().
15244 2004-07-07 Miguel de Icaza <miguel@ximian.com>
15246 * cs-parser.jay (fixed_statement): flag this as Pinned.
15248 2004-07-06 Miguel de Icaza <miguel@ximian.com>
15250 * typemanager.cs (TypeManager): Removed MakePinned method, this
15251 mechanism is replaced with the .NET 2.x compatible mechanism of
15252 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15254 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
15255 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15256 `IsFixed' property which has a different meaning.
15258 2004-07-02 Raja R Harinath <rharinath@novell.com>
15260 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15261 visible from inside a nested class, not just the names of the
15262 immediately enclosing class.
15263 Fix for bug #60730.
15265 2004-06-24 Raja R Harinath <rharinath@novell.com>
15267 * expression.cs (BetterConversion): Remove buggy special-case
15268 handling of "implicit constant expression conversions". At this
15269 point, we already know that the conversion is possible -- we're
15270 only checking to see which is better.
15272 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15274 * cs-parser.jay: Added error CS0210 test.
15276 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15278 * cs-parser.jay: Added error CS0134 test.
15280 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15283 * cs-parser.jay: Added error CS0145 test.
15285 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15287 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15289 2004-06-23 Ben Maurer <bmaurer@ximian.com>
15291 * expression.cs (StackAlloc.Resolve): The argument may not
15292 be a constant; deal with this case.
15294 2004-06-23 Marek Safar <marek.safar@seznam.cz>
15296 * attribute.cs (IndexerName_GetIndexerName): Renamed to
15297 GetIndexerAttributeValue.
15298 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15300 * class.cs (Indexer.Define): Added error tests for CS0415,
15303 2004-06-23 Miguel de Icaza <miguel@ximian.com>
15305 * attribute.cs (Attribute.Resolve): Keep field code in sync with
15308 2004-06-23 Martin Baulig <martin@ximian.com>
15310 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15311 neither return nor throw, reset the barrier as well. Fixes #60457.
15313 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
15315 * class.cs : EventAttributes is now set to None by default.
15316 This fixes bug #60459.
15318 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15321 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15322 Don't throw exception but return null (it's sufficient now).
15324 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15326 * typemanager.cs (GetArgumentTypes): Faster implementation.
15328 2004-06-18 Martin Baulig <martin@ximian.com>
15330 * attribute.cs (Attribute.Resolve): Check whether we're an
15331 EmptyCast which a Constant child. Fixes #60333.
15333 2004-06-17 Ben Maurer <bmaurer@ximian.com>
15335 * statement.cs (EmitCollectionForeach): Account for the fact that
15336 not all valuetypes are in areas which we can take the address of.
15337 For these variables, we store to a temporary variable. Also, make
15338 sure that we dont emit a `callvirt' on a valuetype method.
15340 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15342 * expression.cs (StackAlloc.DoReSolve): Added test for
15343 negative parameter (CS0247).
15345 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15348 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
15350 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15353 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
15356 2004-06-14 Marek Safar <marek.safar@seznam.cz>
15358 Fix bug #58254 & cs1555.cs, cs1556.cs
15359 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
15361 2004-06-14 Marek Safar <marek.safar@seznam.cz>
15363 * cs-parser.jay: Added error CS1669 test for indexers.
15365 2004-06-11 Martin Baulig <martin@ximian.com>
15367 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
15368 call this twice: for params and varargs methods.
15370 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15373 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
15375 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15377 * attribute.cs (Attribute.GetValidTargets): Made public.
15380 (AbstractPropertyEventMethod): New class for better code sharing.
15381 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
15383 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
15385 2004-06-11 Raja R Harinath <rharinath@novell.com>
15388 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
15389 that the call to Resolve is part of a MemberAccess.
15390 (Expression.Resolve): Use it for SimpleName resolution.
15391 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
15392 Add 'intermediate' boolean argument.
15393 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
15394 error message when the SimpleName can be resolved ambiguously
15395 between an expression and a type.
15396 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
15398 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
15399 call on the left-side.
15401 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15404 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
15406 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15408 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
15410 2004-06-11 Martin Baulig <martin@ximian.com>
15412 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
15413 varargs methods if applicable.
15415 2004-06-11 Martin Baulig <martin@ximian.com>
15417 * expression.cs (Invocation.EmitCall): Don't use
15418 `method.CallingConvention == CallingConventions.VarArgs' since the
15419 method could also have `CallingConventions.HasThis'.
15421 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15423 * class.cs (Event.GetSignatureForError): Implemented.
15424 Fixed crash in error test cs3010.cs
15426 2004-06-10 Miguel de Icaza <miguel@ximian.com>
15428 * cs-tokenizer.cs: Change the way we track __arglist to be
15429 consistent with the other keywords.
15431 2004-06-09 Miguel de Icaza <miguel@ximian.com>
15433 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
15436 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
15438 * codegen.cs: Check that all referenced assemblies have a strongname
15439 before strongnaming the compiled assembly. If not report error CS1577.
15440 Fix bug #56563. Patch by Jackson Harper.
15441 * typemanager.cs: Added a method to return all referenced assemblies.
15442 Fix bug #56563. Patch by Jackson Harper.
15444 2004-06-08 Marek Safar <marek.safar@seznam.cz>
15447 (Method.ApplyAttributeBuilder): Moved and added conditional
15448 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
15451 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
15453 2004-06-08 Marek Safar <marek.safar@seznam.cz>
15456 * class.cs: (EventField.attribute_targets): Changed default target.
15458 2004-06-08 Martin Baulig <martin@ximian.com>
15460 * expression.cs (Invocation.EmitCall): Enable varargs methods.
15462 2004-06-08 Martin Baulig <martin@ximian.com>
15464 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
15466 2004-06-07 Martin Baulig <martin@ximian.com>
15468 Added support for varargs methods.
15470 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
15473 * cs-parser.jay: Added support for `__arglist'.
15475 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
15477 * expression.cs (Argument.AType): Added `ArgList'.
15478 (Invocation): Added support for varargs methods.
15479 (ArglistAccess): New public class.
15480 (Arglist): New public class.
15482 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
15484 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
15485 a method's top-level block if the method has varargs.
15487 * support.cs (ReflectionParameters, InternalParameters): Added
15488 support for varargs methods.
15490 2004-06-07 Miguel de Icaza <miguel@ximian.com>
15492 * class.cs: Provide location in indexer error report.
15494 * driver.cs: Use standard names.
15496 * namespace.cs: Catch the use of using after a namespace has been
15497 declared also on using aliases.
15499 2004-06-03 Raja R Harinath <rharinath@novell.com>
15502 * typemanager.cs (closure_private_ok, closure_invocation_type)
15503 (closure_qualifier_type, closure_invocation_assembly)
15504 (FilterWithClosure): Move to ...
15505 (Closure): New internal nested class.
15506 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
15507 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
15508 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
15509 (MemberLookup, MemberLookupFailed): Use it.
15510 * expression.cs (New.DoResolve): Treat the lookup for the
15511 constructor as being qualified by the 'new'ed type.
15512 (Indexers.GetIndexersForTypeOrInterface): Update.
15514 2004-06-03 Marek Safar <marek.safar@seznam.cz>
15517 (GetConditionalAttributeValue): New method. Returns
15518 condition of ConditionalAttribute.
15519 (SearchMulti): New method. Returns all attributes of type 't'.
15520 Use it when attribute is AllowMultiple = true.
15521 (IsConditionalMethodExcluded): New method.
15524 (Method.IsExcluded): Implemented. Returns true if method has conditional
15525 attribute and the conditions is not defined (method is excluded).
15526 (IMethodData): Extended interface for ConditionalAttribute support.
15527 (PropertyMethod.IsExcluded): Implemented.
15530 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
15533 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
15536 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
15538 * expression.cs (ArrayCreationExpression): Make this just an
15539 `expression'. It can't be a statement, so the code here was
15542 2004-06-02 Marek Safar <marek.safar@seznam.cz>
15545 * typemanager.cs (GetFullNameSignature): New method for
15548 2004-06-02 Marek Safar <marek.safar@seznam.cz>
15551 * class.cs (MemberBase.GetSignatureForError): New virtual method.
15552 Use this method when MethodBuilder is null.
15553 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
15554 Added test for error CS0626 (MONO reports error for this situation).
15555 (IMethodData.GetSignatureForError): Extended interface.
15557 2004-06-01 Marek Safar <marek.safar@seznam.cz>
15560 (AttributeTester.GetObsoleteAttribute): Returns instance of
15561 ObsoleteAttribute when type is obsolete.
15564 (TypeContainer.VerifyObsoleteAttribute): Override.
15565 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
15566 (MethodCode.VerifyObsoleteAttribute): Override.
15567 (MemberBase.VerifyObsoleteAttribute): Override.
15570 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
15571 and report proper error.
15574 Delegate.VerifyObsoleteAttribute): Override.
15577 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
15578 and report proper error.
15579 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
15582 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
15586 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
15587 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
15588 Added test for ObsoleteAttribute.
15591 (Catch): Derived from Statement.
15593 2004-06-01 Marek Safar <marek.safar@seznam.cz>
15595 Fixed bug #59071 & cs0160.cs
15597 * statement.cs (Try.Resolve): Check here whether order of catch
15598 clauses matches their dependencies.
15600 2004-05-31 Miguel de Icaza <miguel@ximian.com>
15602 * Reverted patch to namespace.cs (Use lookuptypedirect). This
15603 caused a regression: #59343. Referencing nested classes from an
15604 assembly stopped working.
15606 2004-05-31 Martin Baulig <martin@ximian.com>
15608 MCS is now frozen for beta 2.
15610 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15612 * convert.cs: add a trivial cache for overload operator resolution.
15614 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15616 * decl.cs: If possible, use lookuptypedirect here. We can only do
15617 this if there is no `.' after the namespace. Avoids using
15618 LookupType, which does lots of slow processing.
15619 (FindNestedType) New method, does what it says :-).
15620 * namespace.cs: use LookupTypeDirect.
15621 * rootcontext.cs: use membercache, if possible.
15622 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
15624 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15627 According to the spec,
15629 In a member access of the form E.I, if E is a single identifier,
15630 and if the meaning of E as a simple-name (§7.5.2) is a constant,
15631 field, property, localvariable, or parameter with the same type as
15632 the meaning of E as a type-name (§3.8), then both possible
15633 meanings of E are permitted.
15635 We did not check that E as a simple-name had the same type as E as
15638 This trivial check gives us 5-7% on bootstrap time.
15640 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15642 * expression.cs (Invocation.OverloadResolve): Avoid the
15643 use of hashtables and boxing here by allocating on demand.
15645 2004-05-30 Martin Baulig <martin@ximian.com>
15647 * rootcontext.cs (RootContext.LookupType): Don't cache things if
15648 we're doing a silent lookup. Don't try to lookup nested types in
15649 TypeManager.object_type (thanks to Ben Maurer).
15651 2004-05-30 Martin Baulig <martin@ximian.com>
15653 Committing a patch from Ben Maurer.
15655 * rootcontext.cs (RootContext.LookupType): Cache negative results.
15657 2004-05-29 Martin Baulig <martin@ximian.com>
15659 * class.cs (IMethodData.ShouldIgnore): New method.
15661 * typemanager.cs (TypeManager.MethodFlags): Don't take a
15662 `Location' argument, we don't need it anywhere. Use
15663 `IMethodData.ShouldIgnore ()' instead of
15664 `MethodData.GetMethodFlags ()'.
15665 (TypeManager.AddMethod): Removed.
15666 (TypeManager.AddMethod2): Renamed to AddMethod.
15668 2004-05-29 Martin Baulig <martin@ximian.com>
15670 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
15672 * convert.cs (Convert.ImplicitReferenceConversion): If we're
15673 converting from a class type S to an interface type and we already
15674 have an object on the stack, don't box it again. Fixes #52578.
15676 2004-05-29 Martin Baulig <martin@ximian.com>
15678 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15679 Added support for `params' parameters. Fixes #59267.
15681 2004-05-29 Martin Baulig <martin@ximian.com>
15683 * literal.cs (NullPointer): Provide a private .ctor which sets
15684 `type' to TypeManager.object_type. Fixes #59048.
15686 2004-05-29 Martin Baulig <martin@ximian.com>
15688 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
15689 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
15691 * ecore.cs (EventExpr.instance_expr): Make the field private.
15693 2004-05-26 Marek Safar <marek.safar@seznam.cz>
15695 Fixed bug #50080 & cs0214-2.cs
15696 * expression.cs (Cast.DoResolve): Check unsafe context here.
15698 * statement.cs (Resolve.DoResolve): Likewise.
15700 2004-05-26 Martin Baulig <martin@ximian.com>
15702 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
15704 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
15705 (RootContext.LookupType): Pass down the `silent' flag.
15707 2004-05-25 Martin Baulig <martin@ximian.com>
15710 (MethodGroupExpr.IdenticalTypeName): New public property.
15711 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
15712 expression actually refers to a type.
15714 2004-05-25 Martin Baulig <martin@ximian.com>
15716 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
15717 for #56176 and made it actually work.
15719 2004-05-25 Martin Baulig <martin@ximian.com>
15721 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
15722 (FieldExpr, PropertyExpr): Override and implement
15723 CacheTemporaries. Fixes #52279.
15725 2004-05-25 Miguel de Icaza <miguel@ximian.com>
15727 * location.cs: In the new compiler listing a file twice is a
15728 warning, not an error.
15730 2004-05-24 Martin Baulig <martin@ximian.com>
15732 * enum.cs (Enum.DefineType): For the `BaseType' to be a
15733 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
15735 2004-05-24 Martin Baulig <martin@ximian.com>
15737 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
15738 walking the `using' list. Fixes #53921.
15740 2004-05-24 Martin Baulig <martin@ximian.com>
15742 * const.cs (Const.LookupConstantValue): Added support for
15743 EmptyCast's; fixes #55251.
15745 2004-05-24 Martin Baulig <martin@ximian.com>
15747 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
15748 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
15749 which does the CS0135 check. The reason is that we first need to
15750 check whether the variable actually exists.
15752 2004-05-24 Martin Baulig <martin@ximian.com>
15754 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
15755 than RootContext.LookupType() to find the explicit interface
15756 type. Fixes #58584.
15758 2004-05-24 Raja R Harinath <rharinath@novell.com>
15760 * Makefile: Simplify. Use executable.make.
15761 * mcs.exe.sources: New file. List of sources of mcs.exe.
15763 2004-05-24 Anders Carlsson <andersca@gnome.org>
15767 Use the invariant culture when doing String.Compare for CLS case
15770 2004-05-23 Martin Baulig <martin@ximian.com>
15772 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
15773 don't have any dots. Fixes #52622, added cs0246-8.cs.
15775 * namespace.cs (NamespaceEntry.Lookup): Likewise.
15777 2004-05-23 Marek Safar <marek.safar@seznam.cz>
15779 * class.cs (MemberBase.Define): Reuse MemberType member for
15780 resolved type. Other methods can use it too.
15782 2004-05-23 Martin Baulig <martin@ximian.com>
15784 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
15785 the variable also exists in the current block (otherwise, we need
15786 to report a CS0103). Fixes #58670.
15788 2004-05-23 Martin Baulig <martin@ximian.com>
15790 * flowanalysis.cs (Reachability.Reachable): Compute this
15791 on-the-fly rather than storing it as a field.
15793 2004-05-23 Martin Baulig <martin@ximian.com>
15795 * flowanalysis.cs (Reachability.And): Manually compute the
15796 resulting `barrier' from the reachability.
15798 2004-05-23 Marek Safar <marek.safar@seznam.cz>
15801 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
15802 instance of ObsoleteAttribute when symbol is obsolete.
15805 (IMethodData): Extended interface for ObsoleteAttribute support.
15807 2004-05-22 Marek Safar <marek.safar@seznam.cz>
15809 * attribute.cs: Fix bug #55970
15811 2004-05-22 Marek Safar <marek.safar@seznam.cz>
15815 (GetObsoleteAttribute): New method. Creates the instance of
15817 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
15818 ObsoleteAttribute when member is obsolete.
15819 (AttributeTester.Report_ObsoleteMessage): Common method for
15820 Obsolete error/warning reporting.
15823 (TypeContainer.base_classs_type): New member for storing parent type.
15826 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
15827 for this MemberCore.
15829 2004-05-21 Marek Safar <marek.safar@seznam.cz>
15831 * attribute.cs, const.cs: Fix bug #58590
15833 2004-05-21 Martin Baulig <martin@ximian.com>
15835 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
15836 out parameters if the end of the method is unreachable. Fixes
15839 2004-05-21 Marek Safar <marek.safar@seznam.cz>
15841 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
15842 Hari was right, why extra method.
15844 2004-05-21 Marek Safar <marek.safar@seznam.cz>
15846 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
15848 2004-05-20 Martin Baulig <martin@ximian.com>
15850 Merged this back from gmcs to keep the differences to a minumum.
15852 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
15853 instead of a Declspace.
15854 (Attribute.ResolveType): Likewise.
15855 (Attributes.Search): Likewise.
15856 (Attributes.Contains): Likewise.
15857 (Attributes.GetClsCompliantAttribute): Likewise.
15859 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
15861 (MethodData.ApplyAttributes): Take an EmitContext instead of a
15864 2004-05-19 Marek Safar <marek.safar@seznam.cz>
15866 Fix bug #58688 (MCS does not report error when the same attribute
15869 * attribute.cs (Attribute.Emit): Distinction between null and default.
15871 2004-05-19 Raja R Harinath <rharinath@novell.com>
15873 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
15874 of a top-level attribute without an attribute target.
15875 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
15877 (Attribute.Conditional_GetConditionName),
15878 (Attribute.Obsolete_GetObsoleteMessage): Update.
15879 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
15880 part of ScanForIndexerName.
15881 (Attribute.CanIgnoreInvalidAttribute): New function.
15882 (Attribute.ScanForIndexerName): Move to ...
15883 (Attributes.ScanForIndexerName): ... here.
15884 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
15885 (Attributes.Search): New internal variant that can choose not to
15886 complain if types aren't resolved. The original signature now
15888 (Attributes.GetClsCompliantAttribute): Use internal variant, with
15889 complaints suppressed.
15890 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
15891 only if it not useful.
15892 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
15893 top-level for attributes that are shared between the assembly
15894 and a top-level class.
15895 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
15896 * class.cs: Update to reflect changes.
15897 (DefineIndexers): Fuse loops.
15898 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
15899 a couple more variants of attribute names.
15901 2004-05-18 Marek Safar <marek.safar@seznam.cz>
15903 Fix bug #52585 (Implemented explicit attribute declaration)
15906 (Attributable.ValidAttributeTargets): New abstract method. It gets
15907 list of valid attribute targets for explicit target declaration.
15908 (Attribute.Target): It holds target itself.
15909 (AttributeSection): Removed.
15910 (Attribute.CheckTargets): New method. It checks whether attribute
15911 target is valid for the current element.
15914 (EventProperty): New class. For events that are declared like
15915 property (with add and remove accessors).
15916 (EventField): New class. For events that are declared like field.
15919 * cs-parser.jay: Implemented explicit attribute target declaration.
15921 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
15922 Override ValidAttributeTargets.
15925 (ReturnParameter): Class for applying custom attributes on
15927 (ParameterAtribute): New class. Class for applying custom
15928 attributes on the parameter type.
15930 2004-05-17 Miguel de Icaza <miguel@ximian.com>
15932 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
15935 (Method): Allow UNSAFE here.
15937 * modifiers.cs: Support unsafe reporting.
15939 2004-05-17 Marek Safar <marek.safar@seznam.cz>
15941 * decl.cs: Fix bug #58478.
15943 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15945 * statement.cs: When checking for unreachable code on an EmptyStatement,
15946 set the location. Fixes bug #58488.
15948 2004-05-13 Miguel de Icaza <miguel@ximian.com>
15950 * driver.cs: Add -pkg handling.
15952 From Gonzalo: UseShelLExecute=false
15954 2004-05-12 Marek Safar <marek.safar@seznam.cz>
15957 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
15959 (Attribute.IsClsCompliaceRequired): Moved to base for better
15961 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
15962 when attribute is AttributeUsageAttribute.
15963 (Attribute.GetValidTargets): Simplified.
15964 (Attribute.GetAttributeUsage): New method returns AttributeUsage
15965 attribute for this type.
15966 (Attribute.ApplyAttributes): Method renamed to Emit and make
15968 (GlobalAttributeSection): New class for special handling of global
15969 attributes (assembly, module).
15970 (AttributeSection.Emit): New method.
15972 * class.cs: Implemented Attributable abstract methods.
15973 (MethodCore.LabelParameters): Moved to Parameter class.
15974 (Accessor): Is back simple class.
15975 (PropertyMethod): Implemented Attributable abstract class.
15976 (DelegateMethod): Implemented Attributable abstract class.
15977 (Event): New constructor for disctintion between normal Event
15978 and Event with accessors.
15980 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
15982 * codegen.cs, const.cs, decl.cs, delegate.cs:
15983 (CommonAssemblyModulClass): Implemented Attributable abstract class
15986 * enum.cs: Implement IAttributeSupport interface.
15987 (EnumMember): New class for emum members. Implemented Attributable
15991 (ParameterBase): Is abstract.
15992 (ReturnParameter): New class for easier [return:] attribute handling.
15994 * typemanager.cs: Removed builder_to_attr.
15996 2004-05-11 Raja R Harinath <rharinath@novell.com>
15999 * attribute.cs (Attribute.GetPositionalValue): New function.
16000 * class.cs (TypeContainer.VerifyMembers): New function.
16001 (TypeContainer.Emit): Use it.
16002 (ClassOrStruct): New base class for Class and Struct.
16003 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
16004 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16006 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16007 then each non-static field should have a FieldOffset attribute.
16008 Otherwise, none of the fields should have a FieldOffset attribute.
16009 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
16010 and FieldOffset attributes.
16011 * typemanager.cs (TypeManager.struct_layout_attribute_type)
16012 (TypeManager.field_offset_attribute_type): New core types.
16013 (TypeManager.InitCoreTypes): Initialize them.
16015 2004-05-11 Michal Moskal <malekith@pld-linux.org>
16017 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16018 Return correct type.
16021 2004-05-09 Miguel de Icaza <miguel@ximian.com>
16023 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16024 be implicitly converted to ulong.
16026 * expression.cs: The logic for allowing operator &, | and ^ worked
16027 was wrong, it worked before because we did not report an error in
16028 an else branch. Fixes 57895.
16030 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16031 allow volatile fields to be reference types.
16033 2004-05-07 Miguel de Icaza <miguel@ximian.com>
16035 * driver.cs: Add support for /debug-
16037 2004-05-07 Raja R Harinath <rharinath@novell.com>
16039 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
16040 Add a 'complain' parameter to silence errors.
16041 (Attribute.Resolve): Update to changes. Put in sanity check to catch
16042 silently overlooked type-resolutions.
16043 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16044 to reflect changes.
16045 (Attributes.Search): New function.
16046 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16047 (Attributes.GetAttributeFullName): Remove hack.
16048 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
16049 Update to reflect changes.
16050 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16051 Use Attributes.Search instead of nested loops.
16053 2004-05-07 Marek Safar <marek.safar@seznam.cz>
16056 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16057 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16058 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16060 * report.cs: (Report.Warning): Renamed to Warning_T because of
16061 parameter collision.
16063 2004-05-05 Raja R Harinath <rharinath@novell.com>
16065 * expression.cs (MemberAccess.ResolveMemberAccess):
16066 Exit with non-zero status after Report.Error.
16067 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16069 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16071 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16073 * support.cs: Don't hang when the file is empty.
16075 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16077 * support.cs: In SeekableStreamReader, compute the preamble size of the
16078 underlying stream. Position changes should take into account that initial
16081 2004-05-03 Todd Berman <tberman@sevenl.net>
16083 * driver.cs: remove unused GetSysVersion function.
16085 2004-05-03 Todd Berman <tberman@sevenl.net>
16087 * driver.cs: Remove the hack from saturday, as well as the hack
16088 from jackson (LoadAssemblyFromGac), also adds the CWD to the
16089 link_paths to get that bit proper.
16091 2004-05-01 Todd Berman <tberman@sevenl.net>
16093 * driver.cs: Try a LoadFrom before a Load, this checks the current
16094 path. This is currently a bug in mono that is be fixed, however, this
16095 provides a workaround for now. This will be removed when the bug
16098 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
16100 * CryptoConvert.cs: Updated to latest version. Fix issue with
16101 incomplete key pairs (#57941).
16103 2004-05-01 Todd Berman <tberman@sevenl.net>
16105 * driver.cs: Remove '.' from path_chars, now System.* loads properly
16108 2004-04-30 Jackson Harper <jackson@ximian.com>
16110 * codegen.cs: Open keys readonly.
16112 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16114 * typemanager.cs: don't report cyclic struct layout when a struct
16115 contains 2 or more fields of the same type. Failed for Pango.AttrShape
16116 which has 2 Pango.Rectangle fields.
16118 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
16120 * expression.cs: Handle IntPtr comparisons with IL code
16121 rather than a method call.
16123 2004-04-29 Martin Baulig <martin@ximian.com>
16125 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
16126 the list of PropertyInfo's in class hierarchy and find the
16127 accessor. Fixes #56013.
16129 2004-04-29 Martin Baulig <martin@ximian.com>
16131 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16133 2004-04-29 Martin Baulig <martin@ximian.com>
16135 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16137 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16139 2004-04-29 Martin Baulig <martin@ximian.com>
16141 * class.cs (ConstructorInitializer.Resolve): Check whether the
16142 parent .ctor is accessible. Fixes #52146.
16144 2004-04-29 Martin Baulig <martin@ximian.com>
16146 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16148 * statement.cs (Using.EmitLocalVariableDecls): Use
16149 TypeManager.idisposable_type, not typeof (IDisposable).
16150 (Foreach.EmitCollectionForeach): Added support for valuetypes.
16152 2004-04-29 Martin Baulig <martin@ximian.com>
16154 * class.cs (Event.Define): Don't emit the field and don't set
16155 RTSpecialName and SpecialName for events on interfaces. Fixes
16158 2004-04-29 Raja R Harinath <rharinath@novell.com>
16160 Refactor Attribute.ApplyAttributes.
16161 * attribute.cs (Attributable): New base class for objects that can
16162 have Attributes applied on them.
16163 (Attribute): Make AttributeUsage fields public.
16164 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16165 (Attribute.IsInternalCall): New property.
16166 (Attribute.UsageAttr): Convert to a public read-only property.
16167 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16168 (Attribute.ResolveType, Attribute.Resolve)
16169 (Attribute.ScanForIndexerName): Update to reflect changes.
16170 (Attribute.CheckAttributeTarget): Re-format.
16171 (Attribute.ApplyAttributes): Refactor, to various
16172 Attributable.ApplyAttributeBuilder methods.
16173 * decl.cs (MemberCore): Make Attributable.
16174 * class.cs (Accessor): Make Attributable.
16175 (MethodData.ApplyAttributes): Use proper attribute types, not
16177 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16178 (TypeContainer.ApplyAttributeBuilder)
16179 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16180 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
16181 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16182 (Operator.ApplyAttributeBuilder): New factored-out methods.
16183 * const.cs (Const.ApplyAttributeBuilder): Likewise.
16184 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16185 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16186 * parameter.cs (ParameterBase): New Attributable base class
16187 that can also represent Return types.
16188 (Parameter): Update to the changes.
16190 2004-04-29 Jackson Harper <jackson@ximian.com>
16192 * driver.cs: Prefer the corlib system version when looking for
16193 assemblies in the GAC. This is still a hack, but its a better hack
16196 2004-04-29 Marek Safar <marek.safar@seznam.cz>
16198 * decl.cs, enum.cs: Improved error 3005 reporting.
16200 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16201 (related_symbols): New private member for list of symbols
16202 related to reported error/warning.
16204 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16206 2004-04-29 Martin Baulig <martin@ximian.com>
16208 * ecore.cs (Expression.Constantify): If we're an enum and
16209 TypeManager.TypeToCoreType() doesn't give us another type, use
16210 t.UnderlyingSystemType. Fixes #56178.
16212 2004-04-29 Martin Baulig <martin@ximian.com>
16214 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16215 interfaces and for each interface, only add members directly
16216 declared in that interface. Fixes #53255.
16218 2004-04-28 Martin Baulig <martin@ximian.com>
16220 * expression.cs (ConditionalLogicalOperator): Use a temporary
16221 variable for `left' to avoid that we evaluate it more than once;
16224 2004-04-28 Martin Baulig <martin@ximian.com>
16226 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16229 2004-04-28 Martin Baulig <martin@ximian.com>
16231 * statement.cs (LocalInfo.Resolve): Check whether the type is not
16234 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16235 whether the type is not void (CS1547).
16237 2004-04-28 Martin Baulig <martin@ximian.com>
16239 * expression.cs (Unary.DoResolveLValue): Override this and report
16240 CS0131 for anything but Operator.Indirection.
16242 2004-04-28 Martin Baulig <martin@ximian.com>
16244 Committing a patch from Ben Maurer; see bug #50820.
16246 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16249 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16252 2004-04-28 Martin Baulig <martin@ximian.com>
16254 Committing a patch from Ben Maurer; see bug #50820.
16256 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16259 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16262 2004-04-28 Martin Baulig <martin@ximian.com>
16264 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16265 (Block.AddLabel): Call DoLookupLabel() to only search in the
16268 2004-04-28 Martin Baulig <martin@ximian.com>
16270 * cfold.cs (ConstantFold.BinaryFold): Added special support for
16271 comparing StringConstants and NullLiterals in Equality and Inequality.
16273 2004-04-28 Jackson Harper <jackson@ximian.com>
16275 * driver.cs: Attempt to load referenced assemblies from the
16276 GAC. This is the quick and dirty version of this method that
16277 doesnt take into account versions and just takes the first
16278 canidate found. Will be good enough for now as we will not have more
16279 then one version installed into the GAC until I update this method.
16281 2004-04-28 Martin Baulig <martin@ximian.com>
16283 * typemanager.cs (TypeManager.CheckStructCycles): New public
16284 static method to check for cycles in the struct layout.
16286 * rootcontext.cs (RootContext.PopulateTypes): Call
16287 TypeManager.CheckStructCycles() for each TypeContainer.
16288 [Note: We only need to visit each type once.]
16290 2004-04-28 Martin Baulig <martin@ximian.com>
16292 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16294 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16295 success and added `out object value'. Use a `bool resolved' field
16296 to check whether we've already been called rather than
16297 `ConstantValue != null' since this breaks for NullLiterals.
16299 2004-04-28 Raja R Harinath <rharinath@novell.com>
16301 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16302 setting of this flag, since the 'set' method may be non-public.
16304 2004-04-28 Raja R Harinath <rharinath@novell.com>
16306 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16307 check on current_vector.Block.
16309 2004-04-27 Martin Baulig <martin@ximian.com>
16311 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16312 a field initializer. Fixes #56459.
16314 2004-04-27 Martin Baulig <martin@ximian.com>
16316 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16317 we're not attempting to use an indexer. Fixes #52154.
16319 2004-04-27 Martin Baulig <martin@ximian.com>
16321 * statement.cs (Return): Don't create a return label if we don't
16322 need it; reverts my change from January 20th. Thanks to Ben
16325 2004-04-27 Martin Baulig <martin@ximian.com>
16327 According to the spec, `goto' can only leave a nested scope, but
16330 * statement.cs (Block.LookupLabel): Only lookup in the current
16331 block, don't recurse into parent or child blocks.
16332 (Block.AddLabel): Check in parent and child blocks, report
16333 CS0140/CS0158 if we find a duplicate.
16334 (Block): Removed this indexer for label lookups.
16335 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
16336 this already does the error reporting for us.
16339 (FlowBranching.UsageVector.Block): New public variable; may be null.
16340 (FlowBranching.CreateSibling): Added `Block' argument.
16341 (FlowBranching.LookupLabel): New public virtual method. Lookup a
16342 label for the target of a `goto' and check whether we're not
16343 leaving a `finally'.
16345 2004-04-27 Martin Baulig <martin@ximian.com>
16347 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16348 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
16351 2004-04-27 Martin Baulig <martin@ximian.com>
16353 * statement.cs (Block.AddLabel): Also check for implicit blocks
16354 and added a CS0158 check.
16356 2004-04-27 Martin Baulig <martin@ximian.com>
16358 * flowanalysis.cs (FlowBranchingLoop): New class.
16359 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
16360 UsageVector's instead of an ArrayList.
16361 (FlowBranching.Label): Likewise.
16362 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
16363 (FlowBranching.AddBreakVector): New method.
16365 2004-04-27 Miguel de Icaza <miguel@ximian.com>
16367 * attribute.cs: Small regression fix: only convert the type if we
16368 the type is different, fixes System.Drawing build.
16370 2004-04-27 Martin Baulig <martin@ximian.com>
16372 * attribute.cs (Attribute.Resolve): If we have a constant value
16373 for a named field or property, implicity convert it to the correct
16376 2004-04-27 Raja R Harinath <rharinath@novell.com>
16378 * statement.cs (Block.Block): Implicit blocks share
16379 'child_variable_names' fields with parent blocks.
16380 (Block.AddChildVariableNames): Remove.
16381 (Block.AddVariable): Mark variable as "used by a child block" in
16382 every surrounding block.
16383 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
16384 been used in a child block, complain about violation of "Invariant
16385 meaning in blocks" rule.
16386 * cs-parser.jay (declare_local_variables): Don't use
16387 AddChildVariableNames.
16388 (foreach_statement): Don't create an implicit block: 'foreach'
16389 introduces a scope.
16391 2004-04-23 Miguel de Icaza <miguel@ximian.com>
16393 * convert.cs (ImplicitNumericConversion): 0 is also positive when
16394 converting from 0L to ulong. Fixes 57522.
16396 2004-04-22 Marek Safar <marek.safar@seznam.cz>
16398 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
16399 derived class hides via 'new' keyword field from base class (test-242.cs).
16400 TODO: Handle this in the more general way.
16402 * class.cs (CheckBase): Ditto.
16404 2004-04-22 Marek Safar <marek.safar@seznam.cz>
16406 * decl.cs (caching_flags): New member for storing cached values
16408 (MemberCore.Flags): New enum where bit flags for caching_flags
16410 (MemberCore.cls_compliance): Moved to caching_flags.
16411 (DeclSpace.Created): Moved to caching_flags.
16413 * class.cs: Use caching_flags instead of DeclSpace.Created
16415 2004-04-21 Miguel de Icaza <miguel@ximian.com>
16417 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
16418 if we are only a derived class, not a nested class.
16420 * typemanager.cs: Same as above, but do this at the MemberLookup
16421 level (used by field and methods, properties are handled in
16422 PropertyExpr). Allow for the qualified access if we are a nested
16425 2004-04-21 Marek Safar <marek.safar@seznam.cz>
16427 * class.cs: Refactoring.
16428 (IMethodData): New inteface; Holds links to parent members
16429 to avoid member duplication (reduced memory allocation).
16430 (Method): Implemented IMethodData interface.
16431 (PropertyBase): New inner classes for get/set methods.
16432 (PropertyBase.PropertyMethod): Implemented IMethodData interface
16433 (Event): New inner classes for add/remove methods.
16434 (Event.DelegateMethod): Implemented IMethodData interface.
16436 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
16437 EmitContext (related to class.cs refactoring).
16439 2004-04-21 Raja R Harinath <rharinath@novell.com>
16441 * delegate.cs (Delegate.VerifyApplicability): If the number of
16442 arguments are the same as the number of parameters, first try to
16443 verify applicability ignoring any 'params' modifier on the last
16447 2004-04-16 Raja R Harinath <rharinath@novell.com>
16449 * class.cs (TypeContainer.AddIndexer): Use
16450 'ExplicitInterfaceName' to determine if interface name was
16451 explicitly specified. 'InterfaceType' is not initialized at this time.
16452 (TypeContainer.DefineIndexers): Remove use of temporary list. The
16453 Indexers array is already in the required order. Initialize
16454 'IndexerName' only if there are normal indexers.
16455 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
16456 (TypeContainer.Emit): Emit DefaultMember attribute only if
16457 IndexerName is initialized.
16460 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
16462 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
16465 2004-04-15 Raja R Harinath <rharinath@novell.com>
16467 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
16471 * attribute.cs (Attribute.Resolve): Check for duplicate named
16475 2004-04-15 Miguel de Icaza <miguel@ximian.com>
16477 * iterators.cs (MarkYield): track whether we are in an exception,
16478 and generate code accordingly. Use a temporary value to store the
16479 result for our state.
16481 I had ignored a bit the interaction of try/catch with iterators
16482 since their behavior was not entirely obvious, but now it is
16483 possible to verify that our behavior is the same as MS .NET 2.0
16487 2004-04-14 Miguel de Icaza <miguel@ximian.com>
16489 * iterators.cs: Avoid creating temporaries if there is no work to
16492 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
16493 Enumerations, use TypeManager.EnumToUnderlying and call
16496 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
16499 (This.Emit): Use EmitContext.EmitThis to emit our
16502 (This.EmitAssign): Ditto.
16504 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
16505 codepaths, we will move all the functionality into
16508 (FieldExpr.EmitAssign): Ditto.
16510 This fixes several hidden bugs that I uncovered while doing a code
16511 review of this today.
16513 * codegen.cs (EmitThis): reworked so the semantics are more clear
16514 and also support value types "this" instances.
16516 * iterators.cs: Changed so that for iterators in value types, we
16517 do not pass the value type as a parameter.
16519 Initialization of the enumerator helpers is now done in the caller
16520 instead of passing the parameters to the constructors and having
16521 the constructor set the fields.
16523 The fields have now `assembly' visibility instead of private.
16525 2004-04-11 Miguel de Icaza <miguel@ximian.com>
16527 * expression.cs (Argument.Resolve): Check if fields passed as ref
16528 or out are contained in a MarshalByRefObject.
16530 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
16531 another compiler type.
16533 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
16535 * class.cs (Indexer.Define): use the new name checking method.
16536 Also, return false on an error.
16537 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
16538 (is_identifier_[start/part]_character): make static.
16540 2004-04-10 Miguel de Icaza <miguel@ximian.com>
16542 * expression.cs (Binary.ResolveOperator): Do no append strings
16543 twice: since we can be invoked more than once (array evaluation)
16544 on the same concatenation, take care of this here. Based on a fix
16545 from Ben (bug #56454)
16547 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
16549 * codegen.cs: Fix another case where CS1548 must be reported (when
16550 delay-sign isn't specified and no private is available #56564). Fix
16551 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
16552 error when MCS is used on the MS runtime and we need to delay-sign
16553 (which seems unsupported by AssemblyBuilder - see #56621).
16555 2004-04-08 Marek Safar <marek.safar@seznam.cz>
16557 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
16558 (TypeManager.ComputeNamespaces): Faster implementation for
16561 * compiler.csproj: Updated AssemblyName to mcs.
16563 2004-04-07 Miguel de Icaza <miguel@ximian.com>
16565 * rootcontext.cs: Add new types to the boot resolution.
16567 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
16568 MulticastDelegate is not allowed.
16570 * typemanager.cs: Add new types to lookup: System.TypedReference
16573 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
16574 check for TypedReference or ArgIterator, they are not allowed.
16576 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
16577 makes us properly catch 1510 in some conditions (see bug 56016 for
16580 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
16582 * CryptoConvert.cs: update from corlib version
16585 2004-04-05 Miguel de Icaza <miguel@ximian.com>
16587 * class.cs (Indexer.Define): Check indexername declaration
16589 2004-04-05 Marek Safar <marek.safar@seznam.cz>
16591 * attribute.cs (IsClsCompliant): Fixed problem with handling
16592 all three states (compliant, not-compliant, undetected).
16594 2004-03-30 Marek Safar <marek.safar@seznam.cz>
16596 * attribute.cs (Attribute): Location is now public.
16597 (Resolve): Store resolved arguments (pos_values) in attribute class.
16598 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
16599 (GetClsCompliantAttributeValue): New method that gets
16600 CLSCompliantAttribute value.
16601 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
16602 if exists else null.
16603 (AttributeTester): New class for CLS-Compliant verification routines.
16605 * class.cs (Emit): Add CLS-Compliant verification.
16606 (Method.GetSignatureForError): Implemented.
16607 (Constructor.GetSignatureForError): Implemented
16608 (Constructor.HasCompliantArgs): Returns if constructor has
16609 CLS-Compliant arguments.
16610 (Constructor.Emit): Override.
16611 (Construcor.IsIdentifierClsCompliant): New method; For constructors
16612 is needed to test only parameters.
16613 (FieldBase.GetSignatureForError): Implemented.
16614 (TypeContainer): New member for storing base interfaces.
16615 (TypeContainer.FindMembers): Search in base interfaces too.
16617 * codegen.cs (GetClsComplianceAttribute): New method that gets
16618 assembly or module CLSCompliantAttribute value.
16619 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
16621 (ModuleClass.Emit): Add error 3012 test.
16623 * const.cs (Emit): Override and call base for CLS-Compliant tests.
16625 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
16626 state for all decl types.
16627 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
16628 if CLS-Compliant tests are required.
16629 (IsClsCompliaceRequired): New method. Analyze whether code
16630 must be CLS-Compliant.
16631 (IsExposedFromAssembly): New method. Returns true when MemberCore
16632 is exposed from assembly.
16633 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
16634 value or gets cached value.
16635 (HasClsCompliantAttribute): New method. Returns true if MemberCore
16636 is explicitly marked with CLSCompliantAttribute.
16637 (IsIdentifierClsCompliant): New abstract method. This method is
16638 used to testing error 3005.
16639 (IsIdentifierAndParamClsCompliant): New method. Common helper method
16640 for identifier and parameters CLS-Compliant testing.
16641 (VerifyClsCompliance): New method. The main virtual method for
16642 CLS-Compliant verifications.
16643 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
16644 null. I don't know why is null (too many public members !).
16645 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
16646 and get value of first CLSCompliantAttribute that found.
16648 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
16649 (VerifyClsCompliance): Override and add extra tests.
16651 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
16652 clscheck- disable CLS-Compliant verification event if assembly is has
16653 CLSCompliantAttribute(true).
16655 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
16656 ApllyAttribute is now called in emit section as in the other cases.
16657 Possible future Emit integration.
16658 (IsIdentifierClsCompliant): New override.
16659 (VerifyClsCompliance): New override.
16660 (GetEnumeratorName): Returns full enum name.
16662 * parameter.cs (GetSignatureForError): Implemented.
16664 * report.cs (WarningData): New struct for Warning message information.
16665 (LocationOfPreviousError): New method.
16666 (Warning): New method. Reports warning based on the warning table.
16667 (Error_T): New method. Reports error based on the error table.
16669 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
16670 verifications are done here.
16672 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
16674 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
16675 CLSCompliantAttribute.
16676 (all_imported_types): New member holds all imported types from other
16678 (LoadAllImportedTypes): New method fills static table with exported types
16679 from all referenced assemblies.
16680 (Modules): New property returns all assembly modules.
16682 2004-03-30 Miguel de Icaza <miguel@ximian.com>
16684 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
16685 throwing a parser error.
16687 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
16688 which removes the hardcoded get_/set_ prefixes for properties, as
16689 IL allows for the properties to be named something else.
16693 * expression.cs: Do not override operand before we know if it is
16694 non-null. Fix 56207
16696 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
16698 * typemanager.cs: support for pinned variables.
16700 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
16702 * decl.cs, typemanager.cs: Avoid using an arraylist
16703 as a buffer if there is only one result set.
16705 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
16707 * expression.cs: Make sure you cant call a static method
16708 with an instance expression, bug #56174.
16710 2004-03-29 Miguel de Icaza <miguel@ximian.com>
16712 * class.cs (IsDuplicateImplementation): Improve error reporting to
16713 flag 663 (method only differs in parameter modifier).
16715 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
16716 in preprocessor directives.
16718 * location.cs (LookupFile): Allow for the empty path.
16720 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
16721 better approach for some of that patch, but its failing with the
16722 CharSet enumeration. For now try/catch will do.
16724 * typemanager.cs: Do not crash if a struct does not have fields.
16727 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
16729 * expression.cs: cs0213, cant fix a fixed expression.
16732 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
16734 * cs-parser.jay: detect invalid embeded statements gracefully.
16737 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
16739 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
16742 the invocation type may not be a subclass of the tye of the item/
16743 The type of the item must be a subclass of the invocation item.
16748 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
16750 * attribute.cs: Added methods to get a string and a bool from an
16751 attribute. Required to information from AssemblyKeyFileAttribute,
16752 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
16753 * codegen.cs: Modified AssemblyName creation to include support for
16754 strongnames. Catch additional exceptions to report them as CS1548.
16755 * compiler.csproj: Updated include CryptoConvert.cs.
16756 * compiler.csproj.user: Removed file - user specific configuration.
16757 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
16758 Mono.Security assembly. The original class is maintained and tested in
16759 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
16760 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
16761 like CSC 8.0 (C# v2) supports.
16762 * Makefile: Added CryptoConvert.cs to mcs sources.
16763 * rootcontext.cs: Added new options for strongnames.
16765 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
16767 * driver.cs: For --expect-error, report error code `2'
16768 if the program compiled with no errors, error code `1' if
16769 it compiled with an error other than the one expected.
16771 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
16773 * compiler.csproj: Updated for Visual Studio .NET 2003.
16774 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
16775 * compiler.sln: Updated for Visual Studio .NET 2003.
16777 2004-03-24 Ravi Pratap M <ravi@ximian.com>
16779 * expression.cs: Fix bug #47234. We basically need to apply the
16780 rule that we prefer the conversion of null to a reference type
16781 when faced with a conversion to 'object' (csc behaviour).
16783 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
16785 * statement.cs: Shorter form for foreach, eliminates
16786 a local variable. r=Martin.
16788 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
16790 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
16791 checks if we can use brtrue/brfalse to test for 0.
16792 * expression.cs: use the above in the test for using brtrue/brfalse.
16793 cleanup code a bit.
16795 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
16797 * expression.cs: Rewrite string concat stuff. Benefits:
16799 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
16800 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
16801 rather than a concat chain.
16803 * typemanager.cs: Add lookups for more concat overloads.
16805 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
16807 * expression.cs: Emit shorter il code for array init.
16824 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
16826 * statement.cs: Before, two switch blocks would be merged if the
16827 total size of the blocks (end_item - begin_item + 1) was less than
16828 two times the combined sizes of the blocks.
16830 Now, it will only merge if after the merge at least half of the
16835 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
16837 * class.cs : csc build fix for GetMethods(). See bug #52503.
16839 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
16841 * expression.cs: Make sure fp comparisons work with NaN.
16842 This fixes bug #54303. Mig approved this patch a long
16843 time ago, but we were not able to test b/c the runtime
16846 2004-03-19 Miguel de Icaza <miguel@ximian.com>
16848 * ecore.cs (TypExpr.GetHashCode): implement this overload.
16850 2004-03-19 Martin Baulig <martin@ximian.com>
16852 * class.cs (MemberCore.IsDuplicateImplementation): Report the
16853 error here and not in our caller.
16855 2004-03-19 Martin Baulig <martin@ximian.com>
16857 * interface.cs: Completely killed this file.
16858 (Interface): We're now a TypeContainer and live in class.cs.
16860 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
16861 argument; we're now also called for interfaces.
16862 (TypeContainer.DefineMembers): Allow this method being called
16864 (TypeContainer.GetMethods): New public method; formerly known as
16865 Interface.GetMethod(). This is used by PendingImplementation.
16866 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
16867 it's now private and non-static.
16868 (Interface): Moved this here; it's now implemented similar to
16870 (Method, Property, Event, Indexer): Added `bool is_interface'
16871 argument to their .ctor's.
16872 (MemberBase.IsInterface): New public field.
16874 * cs-parser.jay: Create normal Method, Property, Event, Indexer
16875 instances instead of InterfaceMethod, InterfaceProperty, etc.
16876 (opt_interface_base): Removed; we now use `opt_class_base' instead.
16877 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
16879 2004-03-19 Martin Baulig <martin@ximian.com>
16881 * class.cs (MethodCore.IsDuplicateImplementation): New private
16882 method which does the CS0111 checking.
16883 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
16884 Use IsDuplicateImplementation().
16886 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
16888 * decl.cs (FindMemberToOverride): New method to find the correct
16889 method or property to override in the base class.
16891 - Make Method/Property use the above method to find the
16892 version in the base class.
16893 - Remove the InheritableMemberSignatureCompare as it is now
16896 This patch makes large code bases much faster to compile, as it is
16897 O(n) rather than O(n^2) to do this validation.
16899 Also, it fixes bug 52458 which is that nested classes are not
16900 taken into account when finding the base class member.
16902 Reviewed/Approved by Martin.
16904 2004-03-17 Marek Safar <marek.safar@seznam.cz>
16906 * interface.cs: In all interface classes removed redundant
16907 member initialization.
16909 2004-03-16 Martin Baulig <martin@ximian.com>
16911 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
16913 2004-03-15 Miguel de Icaza <miguel@ximian.com>
16915 * decl.cs (DefineTypeAndParents): New helper method to define a
16916 type's containers before the type itself is defined; This is a
16917 bug exposed by the recent changes to Windows.Forms when an
16918 implemented interface was defined inside a class that had not been
16921 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
16923 (Check): Loop correctly to report errors modifiers
16924 (UNSAFE was not in the loop, since it was the same as TOP).
16926 * interface.cs: Every interface member now takes a ModFlags,
16927 instead of a "is_new" bool, which we set on the base MemberCore.
16929 Every place where we called "UnsafeOk" in the interface, now we
16930 call the proper member (InterfaceMethod.UnsafeOK) instead to get
16931 the unsafe settings from the member declaration instead of the
16932 container interface.
16934 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
16936 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
16937 `set_indexer_name' to the pending bits (one per type).
16939 We fixed a bug today that was picking the wrong method to
16940 override, since for properties the existing InterfaceMethod code
16941 basically ignored the method name. Now we make sure that the
16942 method name is one of the valid indexer names.
16944 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
16946 * support.cs (SeekableStreamReader): Keep track of stream byte
16947 positions and don't mix them with character offsets to the buffer.
16949 Patch from Gustavo Giráldez
16951 2004-03-15 Marek Safar <marek.safar@seznam.cz>
16953 * interface.cs (InterfaceSetGetBase): Removed double member
16954 initialization, base class does it as well.
16956 2004-03-13 Martin Baulig <martin@ximian.com>
16958 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
16959 when compiling corlib.
16961 2004-03-13 Miguel de Icaza <miguel@ximian.com>
16963 * convert.cs (ExplicitConversion): We were reporting an error on
16964 certain conversions (object_type source to a value type, when the
16965 expression was `null') before we had a chance to pass it through
16966 the user defined conversions.
16968 * driver.cs: Replace / and \ in resource specifications to dots.
16971 * class.cs: Add check for duplicate operators. Fixes 52477
16973 2004-03-11 Miguel de Icaza <miguel@ximian.com>
16975 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
16976 that are in the middle of the statements, not only at the end.
16979 * class.cs (TypeContainer.AddField): No longer set the
16980 `HaveStaticConstructor' flag, now we call it
16981 `UserDefineStaticConstructor' to diferentiate the slightly
16982 semantic difference.
16984 The situation is that we were not adding BeforeFieldInit (from
16985 Modifiers.TypeAttr) to classes that could have it.
16986 BeforeFieldInit should be set to classes that have no static
16991 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
16993 And most importantly Zoltan's comment:
16995 http://bugzilla.ximian.com/show_bug.cgi?id=44229
16997 "I think beforefieldinit means 'it's ok to initialize the type sometime
16998 before its static fields are used', i.e. initialization does not need
16999 to be triggered by the first access to the type. Setting this flag
17000 helps the JIT to compile better code, since it can run the static
17001 constructor at JIT time, and does not need to generate code to call it
17002 (possibly lots of times) at runtime. Unfortunately, mcs does not set
17003 this flag for lots of classes like String.
17005 csc sets this flag if the type does not have an explicit static
17006 constructor. The reasoning seems to be that if there are only static
17007 initalizers for a type, and no static constructor, then the programmer
17008 does not care when this initialization happens, so beforefieldinit
17011 This bug prevents the AOT compiler from being usable, since it
17012 generates so many calls to mono_runtime_class_init that the AOT code
17013 is much slower than the JITted code. The JITted code is faster,
17014 because it does not generate these calls if the vtable is type is
17015 already initialized, which is true in the majority of cases. But the
17016 AOT compiler can't do this."
17018 2004-03-10 Miguel de Icaza <miguel@ximian.com>
17020 * class.cs (MethodData.Emit): Refactor the code so symbolic
17021 information is generated for destructors; For some reasons we
17022 were taking a code path that did not generate symbolic information
17025 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
17027 * class.cs: Create a Constructor.CheckBase method that
17028 takes care of all validation type code. The method
17029 contains some code that was moved from Define.
17031 It also includes new code that checks for duplicate ctors.
17032 This fixes bug #55148.
17034 2004-03-09 Joshua Tauberer <tauberer@for.net>
17036 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17037 a { ... }-style array creation invokes EmitStaticInitializers
17038 which is not good for reference-type arrays. String, decimal
17039 and now null constants (NullCast) are not counted toward
17040 static initializers.
17042 2004-03-05 Martin Baulig <martin@ximian.com>
17044 * location.cs (SourceFile.HasLineDirective): New public field;
17045 specifies whether the file contains or is referenced by a "#line"
17047 (Location.DefineSymbolDocuments): Ignore source files which
17048 either contain or are referenced by a "#line" directive.
17050 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
17052 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17053 direct access to our parent, so check the method inline there.
17055 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
17057 * expression.cs (Invocation.EmitCall): Miguel's last commit
17058 caused a regression. If you had:
17063 In Foo the implict this would be null.
17065 2004-02-27 Miguel de Icaza <miguel@ximian.com>
17067 * expression.cs (Invocation.EmitCall): If the method is not
17068 virtual, do not emit a CallVirt to it, use Call.
17070 * typemanager.cs (GetFullNameSignature): Improve the method to
17071 cope with ".ctor" and replace it with the type name.
17073 * class.cs (ConstructorInitializer.Resolve): Now the method takes
17074 as an argument the ConstructorBuilder where it is being defined,
17075 to catch the recursive constructor invocations.
17077 2004-02-26 Miguel de Icaza <miguel@ximian.com>
17079 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17080 routines to check if a type is an enumerable/enumerator allow
17081 classes that implement the IEnumerable or IEnumerator interfaces.
17083 * class.cs (Property, Operator): Implement IIteratorContainer, and
17084 implement SetYields.
17086 (Property.Define): Do the block swapping for get_methods in the
17087 context of iterators. We need to check if Properties also
17088 include indexers or not.
17090 (Operator): Assign the Block before invoking the
17091 OperatorMethod.Define, so we can trigger the Iterator code
17094 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
17095 Property and Operator classes are not created when we parse the
17096 declarator but until we have the block completed, so we use a
17097 singleton SimpleIteratorContainer.Simple to flag whether the
17098 SetYields has been invoked.
17100 We propagate this setting then to the Property or the Operator to
17101 allow the `yield' to function.
17103 2004-02-25 Marek Safar <marek.safar@seznam.cz>
17105 * codegen.cs: Implemented attribute support for modules.
17106 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17107 Assembly/Module functionality.
17109 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17110 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17111 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17113 2004-02-16 Marek Safar <marek.safar@seznam.cz>
17115 * interface.cs (FindMembers): The operation is performed on all base
17116 interfaces and not only on the first. It is required for future CLS Compliance patch.
17118 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
17120 * statement.cs, codegen.cs:
17121 This patch deals with patterns such as:
17123 public class List : IEnumerable {
17125 public MyEnumerator GetEnumerator () {
17126 return new MyEnumerator(this);
17129 IEnumerator IEnumerable.GetEnumerator () {
17133 public struct MyEnumerator : IEnumerator {
17138 Before, there were a few things we did wrong:
17139 1) we would emit callvirt on a struct, which is illegal
17140 2) we emited ldarg when we needed to emit ldarga
17141 3) we would mistakenly call the interface methods on an enumerator
17142 type that derived from IEnumerator and was in another assembly. For example:
17144 public class MyEnumerator : IEnumerator
17146 Would have the interface methods called, even if there were public impls of the
17147 method. In a struct, this lead to invalid IL code.
17149 2004-02-11 Marek Safar <marek.safar@seznam.cz>
17151 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17154 * delegate.cs (Define): Fixed crash when delegate type is undefined.
17156 2004-02-11 Miguel de Icaza <miguel@ximian.com>
17158 * cs-parser.jay: Fix small regression: we were not testing V2
17159 compiler features correctly.
17161 * interface.cs: If the emit context is null, then create one
17163 2004-02-09 Marek Safar <marek.safar@seznam.cz>
17165 * decl.cs (GetSignatureForError): New virtual method to get full name
17166 for error messages.
17168 * attribute.cs (IAttributeSupport): New interface for attribute setting.
17169 Now it is possible to rewrite ApplyAttributes method to be less if/else.
17171 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17172 Duplicated members and code in these classes has been removed.
17173 Better encapsulation in these classes.
17175 2004-02-07 Miguel de Icaza <miguel@ximian.com>
17177 * assign.cs (Assign.DoResolve): When dealing with compound
17178 assignments, there is a new rule in ECMA C# 2.4 (might have been
17179 there before, but it is documented here) that states that in:
17183 If b is of type int, and the `op' is a shift-operator, then the
17184 above is evaluated as:
17188 * expression.cs (Binary.ResolveOperator): Instead of testing for
17189 int/uint/long/ulong, try to implicitly convert to any of those
17190 types and use that in pointer arithmetic.
17192 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17193 method to print information for from the type, not from the
17194 null-method we were given.
17196 2004-02-01 Duncan Mak <duncan@ximian.com>
17198 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17199 parsing for cmd, fixes bug #53694.
17201 2004-02-04 Marek Safar <marek.safar@seznam.cz>
17203 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17204 in the member name duplication tests. Property and operator name duplication
17205 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17207 2004-02-03 Marek Safar <marek.safar@seznam.cz>
17209 * interface.cs (PopulateMethod): Fixed crash when interface method
17210 returns not existing type (error test cs0246-3.cs).
17212 2004-02-02 Ravi Pratap M <ravi@ximian.com>
17214 * cs-parser.jay (interface_accessors): Re-write actions to also
17215 store attributes attached to get and set methods. Fix spelling
17218 (inteface_property_declaration): Modify accordingly.
17220 (InterfaceAccessorInfo): New helper class to store information to pass
17221 around between rules that use interface_accessors.
17223 * interface.cs (Emit): Apply attributes on the get and set
17224 accessors of properties and indexers too.
17226 * attribute.cs (ApplyAttributes): Modify accordingly to use the
17227 right MethodBuilder when applying attributes to the get and set accessors.
17229 2004-01-31 Miguel de Icaza <miguel@ximian.com>
17231 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17233 2004-01-26 Miguel de Icaza <miguel@ximian.com>
17235 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17237 2004-01-25 Miguel de Icaza <miguel@ximian.com>
17239 * cs-parser.jay: Remove YIELD token, instead use the new grammar
17240 changes that treat `yield' specially when present before `break'
17241 or `return' tokens.
17243 * cs-tokenizer.cs: yield is no longer a keyword.
17245 2004-01-23 Marek Safar <marek.safar@seznam.cz>
17247 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17248 setting for default constructors.
17249 For default constructors are almost every time set wrong Modifier. The
17250 generated IL code has been alright. But inside mcs this values was
17251 wrong and this was reason why several of my CLS Compliance tests
17254 2004-01-22 Martin Baulig <martin@ximian.com>
17256 * cs-parser.jay (namespace_or_type_name): Return an Expression,
17257 not a QualifiedIdentifier. This is what `type_name_expression'
17258 was previously doing.
17259 (type_name_expression): Removed; the code is now in
17260 `namespace_or_type_name'.
17261 (qualified_identifier): Removed, use `namespace_or_type_name'
17263 (QualifiedIdentifier): Removed this class.
17265 2004-01-22 Martin Baulig <martin@ximian.com>
17267 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17268 not a string as alias name.
17270 2004-01-21 Miguel de Icaza <miguel@ximian.com>
17272 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17273 #52730 bug, and instead compute correctly the need to use a
17274 temporary variable when requesting an address based on the
17275 static/instace modified of the field and the constructor.
17277 2004-01-21 Martin Baulig <martin@ximian.com>
17279 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17280 class and namespace before looking up aliases. Fixes #52517.
17282 2004-01-21 Martin Baulig <martin@ximian.com>
17284 * flowanalysis.cs (UsageVector.Merge): Allow variables being
17285 assinged in a 'try'; fixes exception4.cs.
17287 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17288 * class.cs : Implemented parameter-less constructor for TypeContainer
17290 * decl.cs: Attributes are now stored here. New property OptAttributes
17292 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17294 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17296 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17298 * typemanager.cs (CSharpSignature): Now reports also inner class name.
17299 (CSharpSignature): New method for indexer and property signature.
17301 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17303 * pending.cs (IsVirtualFilter): Faster implementation.
17305 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17307 * typemanager.cs: Avoid inclusion of same assembly more than once.
17309 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17311 * cs-parser.jay: Fixed problem where the last assembly attribute
17312 has been applied also to following declaration (class, struct, etc.)
17314 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17316 * class.cs: Added error CS0538, CS0539 reporting.
17317 Fixed crash on Microsoft runtime when field type is void.
17319 * cs-parser.jay: Added error CS0537 reporting.
17321 * pending.cs: Added error CS0535 reporting.
17322 Improved error report for errors CS0536, CS0534.
17324 2004-01-20 Miguel de Icaza <miguel@ximian.com>
17326 Merge a few bits from the Anonymous Method MCS tree.
17328 * statement.cs (ToplevelBlock): New class for toplevel methods,
17329 will hold anonymous methods, lifted variables.
17331 * cs-parser.jay: Create toplevel blocks for delegates and for
17332 regular blocks of code.
17334 2004-01-20 Martin Baulig <martin@ximian.com>
17336 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
17337 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
17338 and `NeedExplicitReturn'; added `IsLastStatement'.
17339 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
17340 have a `ReturnLabel' or we're not unreachable.
17342 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
17343 child's reachability; don't just override ours with it. Fixes
17344 #58058 (lluis's example).
17345 (FlowBranching): Added public InTryOrCatch(), InCatch(),
17346 InFinally(), InLoop(), InSwitch() and
17347 BreakCrossesTryCatchBoundary() methods.
17349 * statement.cs (Return): Do all error checking in Resolve().
17350 Unless we are the last statement in a top-level block, always
17351 create a return label and jump to it.
17352 (Break, Continue): Do all error checking in Resolve(); also make
17353 sure we aren't leaving a `finally'.
17354 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
17355 statement in a top-level block.
17356 (Block.Flags): Added `IsDestructor'.
17357 (Block.IsDestructor): New public property.
17359 2004-01-20 Martin Baulig <martin@ximian.com>
17361 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
17363 2004-01-20 Martin Baulig <martin@ximian.com>
17365 * statement.cs (Statement.ResolveUnreachable): New public method.
17366 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
17367 (Block.Resolve): Resolve unreachable statements.
17369 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
17371 * expression.cs: We need to fix the case where we do
17372 not have a temp variable here.
17374 * assign.cs: Only expression compound assignments need
17375 temporary variables.
17377 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
17379 * flowanalysis.cs: Reduce memory allocation in a few ways:
17380 - A block with no variables should not allocate a bit
17382 - A method with no out parameters does not need any tracking
17383 for assignment of the parameters, so we need not allocate
17386 public readonly Type[] VariableTypes;
17387 public readonly string[] VariableNames;
17388 Are redundant. The data is already stored in the variable
17389 map, so we need not allocate another array for it.
17390 - We need to add alot of checks for if (params | locals) == null
17391 due to the first two changes.
17393 2004-01-18 Miguel de Icaza <miguel@ximian.com>
17395 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
17396 implement IMemoryLocation, we store a copy on a local variable and
17397 take the address of it. Patch from Benjamin Jemlich
17399 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
17400 to use a special "type_name_expression" rule which reduces the
17401 number of "QualifiedIdentifier" classes created, and instead
17402 directly creates MemberAccess expressions.
17404 2004-01-17 Miguel de Icaza <miguel@ximian.com>
17406 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
17407 that fixes #52853. Null literal assignment to ValueType
17409 * class.cs (MethodData.Emit): Instead of checking the name of the
17410 method to determine if its a destructor, create a new derived
17411 class from Method called Destructor, and test for that.
17413 * cs-parser.jay: Create a Destructor object instead of a Method.
17415 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
17419 2004-01-16 Miguel de Icaza <miguel@ximian.com>
17421 * expression.cs (Binary.ResolveOperator): Perform an implicit
17422 conversion from MethodGroups to their delegate types on the
17423 Addition operation.
17425 * delegate.cs: Introduce a new class DelegateCreation that is the
17426 base class for `NewDelegate' and `ImplicitDelegateCreation',
17427 factor some code in here.
17429 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
17430 conversion from MethodGroups to compatible delegate types.
17432 * ecore.cs (Expression.Resolve): Do not flag error 654
17433 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
17434 we allow conversions from MethodGroups to delegate types now.
17436 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
17437 assignments in v2 either.
17439 2004-01-10 Miguel de Icaza <miguel@ximian.com>
17441 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
17442 static read-only fields in ctors.
17444 Applied patch from Benjamin Jemlich
17446 * expression.cs (UnaryMutator): Avoid leaking local variables.
17448 2004-01-09 Miguel de Icaza <miguel@ximian.com>
17450 * cs-tokenizer.cs (IsCastToken): Allow the various native types
17451 here to return true, as they can be used like this:
17453 (XXX) int.MEMBER ()
17455 Fixed 49836 and all the other dups
17457 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
17459 * driver.cs: Implement /win32res and /win32icon.
17461 2004-01-08 Miguel de Icaza <miguel@ximian.com>
17463 * cs-parser.jay: Add a rule to improve error handling for the
17464 common mistake of placing modifiers after the type.
17466 2004-01-07 Miguel de Icaza <miguel@ximian.com>
17468 * cs-parser.jay (interface_event_declaration): Catch
17469 initialization of events on interfaces, and report cs0068
17471 * cs-parser.jay (interface_event_declaration): Catch
17472 initialization of events.
17474 * ecore.cs: Better report missing constructors.
17476 * expression.cs (Binary.ResolveOperator): My previous bug fix had
17477 the error reporting done in the wrong place. Fix.
17479 * expression.cs (Binary.ResolveOperator): Catch the
17480 operator + (E x, E y) error earlier, and later allow for implicit
17481 conversions in operator +/- (E e, U x) from U to the underlying
17484 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
17485 52596, if the container class is abstract, the default constructor
17486 is protected otherwise its public (before, we were always public).
17488 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
17491 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
17492 Jemlich that fixes bug #52597, MCS was generating invalid code for
17493 idisposable structs. Thanks to Ben for following up with this
17496 2004-01-06 Miguel de Icaza <miguel@ximian.com>
17498 * driver.cs: Allow assemblies without code to be generated, fixes
17501 2004-01-07 Nick Drochak <ndrochak@gol.com>
17503 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
17505 2004-01-05 Miguel de Icaza <miguel@ximian.com>
17507 * cs-parser.jay: Add rules to improve error reporting if fields or
17508 methods are declared at the namespace level (error 116)
17510 * Add rules to catch event add/remove
17512 2004-01-04 David Sheldon <dave-mono@earth.li>
17514 * expression.cs: Added matching ")" to error message for
17517 2004-01-03 Todd Berman <tberman@gentoo.org>
17519 * ecore.cs, attribute.cs:
17520 Applying fix from #52429.
17522 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17524 * ecore.cs, expression.cs, statement.cs:
17525 Total rewrite of how we handle branching. We
17526 now handle complex boolean expressions with fewer
17527 jumps. As well if (x == 0) no longer emits a ceq.
17529 if (x is Foo) is much faster now, because we generate
17532 Overall, we get a pretty big improvement on our benchmark
17533 tests. The code we generate is smaller and more readable.
17535 I did a full two-stage bootstrap. The patch was reviewed
17536 by Martin and Miguel.
17538 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17540 * cs-parser.jay: Make primary_expression not take a QI.
17541 we dont need this because the member_access rule covers
17542 us here. So we replace the rule with just IDENTIFIER.
17544 This has two good effects. First, we remove a s/r conflict.
17545 Second, we allocate many fewer QualifiedIdentifier objects.
17547 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17549 * attribute.cs: Handle MarshalAs attributes as pseudo, and
17550 set the correct information via SRE. This prevents
17551 hanging on the MS runtime. Fixes #29374.
17553 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17555 * convert.cs: correctly handle conversions to value types
17556 from Enum and ValueType as unboxing conversions.
17558 Fixes bug #52569. Patch by Benjamin Jemlich.
17560 2004-01-02 Ravi Pratap <ravi@ximian.com>
17562 * expression.cs (BetterConversion): Prefer int -> uint
17563 over int -> ulong (csc's behaviour). This fixed bug #52046.
17565 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
17567 * decl.cs (MemberCache.FindMembers): now returns a
17570 * typemanager.cs: In general, go with with ^^.
17571 (CopyNewMethods): take an IList.
17572 (RealMemberLookup): Only allocate an arraylist
17573 if we copy from two sets of methods.
17575 This change basically does two things:
17576 1) Fewer array lists allocated due to CopyNewMethods.
17577 2) the explicit cast in MemberList costed ALOT.
17579 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
17581 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
17582 a hashtable to avoid needless string allocations when an identifier is
17583 used more than once (the common case).
17585 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
17587 * pending.cs: MS's TypeBuilder.GetInterfaces ()
17588 is broken, it will not return anything. So, we
17589 have to use the information we have in mcs to
17592 * typemanager.cs: Add a cache for GetInterfaces,
17593 since this will now be used more often (due to ^^)
17595 (GetExplicitInterfaces) New method that gets the
17596 declared, not effective, interfaces on a type
17597 builder (eg, if you have interface IFoo, interface
17598 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
17601 This patch makes MCS able to bootstrap itself on
17604 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
17606 * expression.cs: Remove the Nop's that Miguel put
17609 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
17611 * report.cs, codegen.cs: Give the real stack trace to
17612 the error when an exception is thrown.
17614 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
17616 * decl.cs: only allocate hashtables for ifaces if
17619 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
17621 * expression.cs: fix the error from cs0121-2.cs
17622 (a parent interface has two child interfaces that
17623 have a function with the same name and 0 params
17624 and the function is called through the parent).
17626 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
17628 * class.cs, rootcontext.cs, typmanager.cs: do not
17631 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
17633 * codegen.cs: remove stack for the ec flow branching.
17634 It is already a linked list, so no need.
17636 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
17638 * Makefile: Allow custom profiler here.
17640 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
17642 * typemanager.cs (LookupType):
17643 - Use a static char [], because split takes
17644 a param array for args, so it was allocating
17646 - Do not store true in a hashtable, it boxes.
17648 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
17650 * flowanalysis.cs: bytify common enums.
17652 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
17654 * modifiers.cs: Add a new set of flags for the
17655 flags allowed on explicit interface impls.
17656 * cs-parser.jay: catch the use of modifiers in
17657 interfaces correctly.
17658 * class.cs: catch private void IFoo.Blah ().
17660 All related to bug #50572.
17662 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
17664 * decl.cs: Rewrite the consistant accessability checking.
17665 Accessability is not linear, it must be implemented in
17666 a tableish way. Fixes #49704.
17668 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
17670 * expression.cs: Handle negation in a checked context.
17671 We must use subtraction from zero. Fixes #38674.
17673 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
17675 * class.cs: Ignore static void main in DLLs.
17676 * rootcontext.cs: Handle the target type here,
17677 since we are have to access it from class.cs
17678 * driver.cs: account for the above.
17680 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
17682 * report.cs: Give line numbers and files if available.
17684 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
17686 * driver.cs: Implement /addmodule.
17688 * typemanager.cs: Change 'modules' field so it now contains Modules not
17691 2003-12-20 Martin Baulig <martin@ximian.com>
17693 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
17694 (FieldBase.IsAssigned): Removed this field.
17695 (FieldBase.SetAssigned): New public method.
17696 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
17698 2003-12-20 Martin Baulig <martin@ximian.com>
17700 * expression.cs (LocalVariableReference.DoResolve): Don't set
17701 `vi.Used' if we're called from DoResolveLValue().
17703 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
17704 returns the usage vector it just merged into the current one -
17705 pass this one to UsageWarning().
17706 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
17707 of the `EmitContext', don't call this recursively on our children.
17709 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
17711 * driver.cs: Implement /target:module.
17713 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
17715 * support.cs (CharArrayHashtable): New helper class.
17717 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
17718 char arrays, not strings, so we can avoid creating a string in
17719 consume_identifier if the identifier is a keyword.
17721 2003-12-16 Martin Baulig <martin@ximian.com>
17723 * statement.cs (LocalInfo.Assigned): Removed this property.
17724 (LocalInfo.Flags): Removed `Assigned'.
17725 (LocalInfo.IsAssigned): New public method; takes the EmitContext
17726 and uses flow analysis.
17727 (Block.UsageWarning): Made this method private.
17728 (Block.Resolve): Call UsageWarning() if appropriate.
17730 * expression.cs (LocalVariableReference.DoResolve): Always set
17731 LocalInfo.Used here.
17733 2003-12-13 Martin Baulig <martin@ximian.com>
17735 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
17736 any value here; we're now using flow analysis to figure out
17737 whether a statement/block returns a value.
17739 2003-12-13 Martin Baulig <martin@ximian.com>
17741 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
17743 (FlowBranching.MergeFinally): Don't call
17744 `branching.CheckOutParameters()' here, this is called in
17746 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
17747 when adding the `finally' vector.
17749 2003-12-13 Martin Baulig <martin@ximian.com>
17752 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
17753 actually work and also fix #48962.
17755 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
17757 * decl.cs: Do not check System.Object for nested types,
17758 since we know it does not have any. Big bang for buck:
17761 Run 1: 8.35 seconds
17762 Run 2: 8.32 seconds
17763 corlib: 17.99 seconds
17765 Run 1: 8.17 seconds
17766 Run 2: 8.17 seconds
17767 corlib: 17.39 seconds
17769 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
17771 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
17772 time we are returning 0 members, so we save alot here.
17774 2003-12-11 Martin Baulig <martin@ximian.com>
17776 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
17777 `MergeChild()', also just take the `FlowBranching' as argument;
17778 call Merge() on it and return the result.
17779 (FlowBranching.Merge): We don't need to do anything if we just
17782 2003-12-11 Martin Baulig <martin@ximian.com>
17784 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
17785 them in an `ArrayList' to reduce memory usage. Thanks to Ben
17786 Maurer for this idea.
17788 2003-12-11 Martin Baulig <martin@ximian.com>
17790 * flowanalysis.cs (MergeResult): This class is now gone; we now
17791 use the `UsageVector' for this. The reason for this is that if a
17792 branching just has one sibling, we don't need to "merge" them at
17793 all - that's the next step to do.
17794 (FlowBranching.Merge): We now return a `UsageVector' instead of a
17797 2003-12-11 Martin Baulig <martin@ximian.com>
17799 Reworked flow analyis and made it more precise and bug-free. The
17800 most important change is that we're now using a special `Reachability'
17801 class instead of having "magic" meanings of `FlowReturns'. I'll
17802 do some more cleanups and optimizations and also add some more
17803 documentation this week.
17805 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
17806 largely reworked this class.
17807 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
17808 the new `Reachability' class instead of having "magic" values here.
17809 (FlowBranching): We're now using an instance of `Reachability'
17810 instead of having separate `Returns', `Breaks' etc. fields.
17812 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
17813 based on flow analysis; ignore the return value of block.Emit ().
17815 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
17817 * driver.cs typemanager.cs: Find the mono extensions to corlib even
17818 if they are private.
17820 2003-12-09 Martin Baulig <martin@ximian.com>
17822 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
17823 call them directly on the UsageVector.
17825 2003-12-09 Martin Baulig <martin@ximian.com>
17827 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
17828 Changed return type from `FlowReturns' to `Reachability'.
17830 2003-12-09 Martin Baulig <martin@ximian.com>
17832 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
17833 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
17834 `Reachable' fields with a single `Reachability' one.
17836 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
17838 * class.cs (FindMembers): Remove foreach's.
17843 Run 1: 8.74 seconds
17844 Run 2: 8.71 seconds
17847 Run 1: 8.64 seconds
17848 Run 2: 8.58 seconds
17851 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
17856 This patch does a few things:
17857 1. EmptyStatement is now a singleton, so it is never reallocated.
17858 2. All blah is EmptyStatement constructs have been changed to
17859 blah == EmptyStatement.Value, which is much faster and valid
17860 now that EmptyStatement is a singleton.
17861 3. When resolving a block, rather than allocating a new array for
17862 the non-empty statements, empty statements are replaced with
17863 EmptyStatement.Value
17864 4. Some recursive functions have been made non-recursive.
17865 Mainly the performance impact is from (3), however (1) and (2) are needed for
17866 this to work. (4) does not make a big difference in normal situations, however
17867 it makes the profile look saner.
17872 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
17873 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
17874 Total memory allocated: 56397 KB
17877 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
17878 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
17879 Total memory allocated: 55666 KB
17881 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
17883 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
17884 than the hashtable in a hashtable version
17886 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
17887 we always end up concating a string. This results in a huge perf
17888 loss, because many strings have to be tracked by the GC. In this
17889 patch, we first use a hashtable that works with two keys, so that
17890 the strings do not need to be concat'ed.
17894 Run 1: 8.74 seconds
17895 Run 2: 8.71 seconds
17898 Run 1: 8.65 seconds
17899 Run 2: 8.56 seconds
17901 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
17903 * Makefile: Add a new target `do-time' that does a quick and simple
17904 profile, leaving easy to parse output.
17906 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
17908 * codegen.cs (Init): Create the dynamic assembly with
17909 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
17911 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
17913 * support.cs: Make the PtrHashtable use only one
17914 instance of its comparer.
17916 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
17918 * typemanager.cs: Fix lookup of GetNamespaces.
17920 2003-11-29 Miguel de Icaza <miguel@ximian.com>
17922 * expression.cs: Removed redundant line.
17924 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
17925 ArrayLists, use for loops with bounds.
17927 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
17930 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
17931 arraylists, use for loop with bounds.
17933 The above three changes give us a 0.071 second performance
17934 improvement out of 3.294 seconds down to 3.223. On my machine
17935 the above changes reduced the memory usage by 1,387 KB during
17936 compiler bootstrap.
17938 * cs-parser.jay (QualifiedIdentifier): New class used to represent
17939 QualifiedIdentifiers. Before we created a new string through
17940 concatenation, and mostly later on, the result would be
17941 manipulated by DecomposeQI through string manipulation.
17943 This reduced the compiler memory usage for bootstrapping from
17944 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
17945 compile times in 0.05 seconds.
17947 2003-11-28 Dick Porter <dick@ximian.com>
17949 * support.cs: Do string compares with the Invariant culture.
17957 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
17958 the comparison is done with the Invariant culture.
17960 2003-11-27 Miguel de Icaza <miguel@ximian.com>
17962 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
17963 GetEnumerator method.
17965 (ProbeCollectionType): Iterate starting at the most specific type
17966 upwards looking for a GetEnumerator
17968 * expression.cs: Shift count can be up to 31 for int/uint and 63
17971 2003-11-26 Miguel de Icaza <miguel@ximian.com>
17973 * statement.cs (Block.LookupLabel): Also look for the label on the
17974 children blocks. Use a hash table to keep track of visited
17977 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
17978 we actually did transform the other operand, otherwise fall back
17979 to the common codepath that casts to long.
17981 * cs-tokenizer.cs: Use the same code pattern as the int case.
17982 Maybe I should do the parsing myself, and avoid depending on the
17983 Parse routines to get this done.
17985 2003-11-25 Miguel de Icaza <miguel@ximian.com>
17987 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
17988 which fixes bug 51347. This time test it.
17990 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
17991 attributes for example can not tell the difference between these.
17992 The difference was only a syntax feature of the language.
17994 * attribute.cs: Apply attributes to delegates.
17996 * delegate.cs: Call the apply attributes method.
17998 2003-11-24 Miguel de Icaza <miguel@ximian.com>
18000 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18001 comparing 0 vs Byte.MinValue, not the value
18003 (ImplicitConversionRequired): When reporting a conversion error,
18004 use error 31 to print out the constant error instead of the
18007 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18008 which fixes bug 51347.
18010 2003-11-22 Miguel de Icaza <miguel@ximian.com>
18012 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
18013 which fixes the -warnaserror command line option.
18015 2003-11-21 Miguel de Icaza <miguel@ximian.com>
18017 * cfold.cs (DoNumericPromotions): During constant folding of
18018 additions on UIntConstant, special case intconstants with
18019 IntConstants like we do on the expression binary operator.
18021 2003-11-12 Miguel de Icaza <miguel@ximian.com>
18023 * convert.cs (ImplicitReferenceConversion): We were missing a case
18024 (System.Enum are not value types or class types, so we need to
18025 classify them separatedly).
18027 * driver.cs: We do not support error 2007.
18029 2003-11-12 Jackson Harper <jackson@ximian.com>
18031 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18032 system directory. Also use the full file name so users can
18033 libraries names mscorlib-o-tron.dll in a non system dir.
18035 2003-11-10 Martin Baulig <martin@ximian.com>
18037 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18038 (TypeManager.InitCoreTypes): Initialize them here, but instead of
18039 calling `ResolveType()' on them, directly assign their `Type'.
18041 2003-11-08 Martin Baulig <martin@ximian.com>
18043 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18044 return value and the `out parent' parameter.
18045 (TypeContainer.DefineType): Moved the CS0644 check into
18046 GetClassBases(). Don't pass the interface types to the
18047 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18048 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18050 * ecore.cs (TypeExpr.IsAttribute): New property.
18051 (TypeExpr.GetInterfaces): New method.
18053 * interface.cs (Interface.GetInterfaceTypeByName): Return a
18054 TypeExpr instead of a Type.
18055 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18056 (Interface.DefineType): Don't pass the interface types to the
18057 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18058 them later and then call `TypeBulider.AddInterfaceImplementation()'.
18060 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18061 instead of a `Type[]'.
18062 (TypeManager.RegisterBuilder): Likewise.
18063 (TypeManager.AddUserInterface): Likewise.
18064 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18065 `Type[]' and also return a `TypeExpr[]'.
18066 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18068 2003-11-08 Martin Baulig <martin@ximian.com>
18070 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18073 2003-11-08 Martin Baulig <martin@ximian.com>
18075 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18076 TypeManager.ResolveExpressionTypes().
18078 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18079 instead of an Expression.
18080 (TypeExpr): This is now an abstract base class for `TypeExpression'.
18081 (TypeExpression): New public class; formerly known as `TypeExpr'.
18083 * expression.cs (ComposedCast): Derive from TypeExpr.
18085 * typemanager.cs (TypeManager.system_*_expr): These are now
18086 TypExpr's instead of Expression's.
18087 (TypeManager.ResolveExpressionTypes): New public static function;
18088 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18091 2003-11-06 Miguel de Icaza <miguel@ximian.com>
18093 * expression.cs (New.DoResolve): Do not dereference value that
18094 might be a null return.
18096 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18097 sure that the constant value has the right type. Fixes an
18098 unreported bug, similar to 50425.
18100 * const.cs (Const.LookupConstantValue): Call
18101 ImplicitStandardConversionExists before doing a conversion to
18102 avoid havng the TypeManager.ChangeType do conversions.
18104 Reduced the number of casts used
18106 (Const.ChangeType): New routine to enable reuse of the constant
18107 type changing code from statement.
18109 * typemanager.cs (ChangeType): Move common initialization to
18110 static global variables.
18114 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18115 every value type to go through, even if it was void. Fix that.
18117 * cs-tokenizer.cs: Use is_identifier_start_character on the start
18118 character of the define, and the is_identifier_part_character for
18119 the rest of the string.
18121 2003-11-05 Miguel de Icaza <miguel@ximian.com>
18123 * expression.cs (UnaryMutator.EmitCode): When I updated
18124 LocalVariableReference.DoResolve, I overdid it, and dropped an
18125 optimization done on local variable references.
18127 2003-11-04 Miguel de Icaza <miguel@ximian.com>
18129 * ecore.cs: Convert the return from Ldlen into an int.
18131 2003-10-20 Miguel de Icaza <miguel@ximian.com>
18133 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18134 the accessibility, this is a special case for toplevel non-public
18135 classes (internal for instance).
18137 2003-10-20 Nick Drochak <ndrochak@gol.com>
18139 * ecore.cs: Fix typo and build. Needed another right paren.
18141 2003-10-19 Miguel de Icaza <miguel@ximian.com>
18143 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
18144 `internal' case regular and protected, but not allowing protected
18145 to be evaluated later. Bug 49840
18147 2003-10-15 Miguel de Icaza <miguel@ximian.com>
18149 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18150 to kb.Nlast, and not the kb.nFirst to isolate the switch
18153 Extract the underlying type, so enumerations of long/ulong are
18154 treated like long/ulong.
18156 2003-10-14 Miguel de Icaza <miguel@ximian.com>
18158 * expression.cs (New): Overload the meaning of RequestedType to
18159 track the possible creation of the NewDelegate type, since
18160 DoResolve is invoked more than once for new constructors on field
18163 See bugs: #48800 and #37014
18165 * cs-parser.jay (declare_local_constants): Take an arraylist
18166 instead of a single constant.
18168 (local_constant_declaration): It should take a
18169 constant_declarators, not a constant_declarator. Fixes 49487
18171 * convert.cs: Fix error report.
18173 2003-10-13 Jackson Harper <jackson@ximian.com>
18175 * typemanager.cs (TypeToCoreType): Add float and double this fixes
18178 2003-10-09 Martin Baulig <martin@ximian.com>
18180 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18182 (MethodCore.DoDefineParameters): Removed the TypeContainer
18183 argument; use the DeclSpace which was passed to the .ctor instead.
18184 (MethodCore.CheckParameter): Take a DeclSpace instead of a
18185 TypeContainer; we only need a DeclSpace here.
18187 2003-10-09 Martin Baulig <martin@ximian.com>
18189 * class.cs (MethodData): Added additional `DeclSpace ds' argument
18191 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18192 EmitContext's .ctor.
18194 2003-10-09 Martin Baulig <martin@ximian.com>
18196 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18197 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18198 AsAccessible(), moved them as well.
18200 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18202 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18204 * cs-parser.jay : Renamed yyName to yyNames related to jay.
18206 2003-10-07 Miguel de Icaza <miguel@ximian.com>
18208 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18209 generation for >=, as spotted by Paolo, bug 48679.
18210 Patch from David Waite.
18212 * cs-tokenizer.cs: Add handling for #pragma.
18214 * cs-parser.jay: Allow for both yield and yield return in the
18215 syntax. The anti-cobolization of C# fight will go on!
18217 * class.cs (TypeBuilder.DefineType): Catch error condition here
18218 (Parent.DefineType erroring out and returning null).
18220 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18221 coping with enumerations variables, we were mistakenly processing
18222 them as a regular value type instead of built-in types. Fixes the
18225 * typemanager.cs (IsBuiltinOrEnum): New method.
18227 2003-09-30 Miguel de Icaza <miguel@ximian.com>
18229 * cs-parser.jay: Upgrade: yield now needs the return clause.
18231 2003-09-19 Martin Baulig <martin@ximian.com>
18233 * decl.cs (MemberCache.SetupCacheForInterface): Take a
18234 `MemberCache parent' argument. Normally, an interface doesn't
18235 have a parent type except System.Object, but we use this in gmcs
18236 for generic type parameters.
18238 2003-09-18 Martin Baulig <martin@ximian.com>
18240 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18241 on `type.IsInterface'; don't check whether the type has a parent
18242 to determine whether it's an interface.
18244 2003-09-15 Martin Baulig <martin@ximian.com>
18246 * class.cs (TypeContainer.DefineType): Added an error flag to
18247 avoid reporting duplicate CS0146's ("class definition is
18250 * driver.cs (Driver.MainDriver): Abort if
18251 RootContext.ResolveTree() reported any errors.
18253 2003-09-07 Martin Baulig <martin@ximian.com>
18255 * report.cs (Error, Warning): Added overloaded versions which take
18256 a `params object[] args' and call String.Format().
18258 2003-09-07 Martin Baulig <martin@ximian.com>
18260 * decl.cs (DeclSpace..ctor): Don't call
18261 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18262 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
18263 (DeclSpace.RecordDecl): New method.
18265 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18267 2003-09-02 Ravi Pratap <ravi@ximian.com>
18269 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18270 value attributes to be applied to ParameterBuilders.
18272 * class.cs (MethodCore.LabelParameters): Make static and more
18273 generic so that it can be used from other places - like interface
18274 methods, for instance.
18276 * interface.cs (Interface.Emit): Call LabelParameters before
18277 emitting attributes on the InterfaceMethod.
18279 2003-08-26 Martin Baulig <martin@ximian.com>
18281 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18282 resolving aliases; fixes #47927.
18284 2003-08-26 Martin Baulig <martin@ximian.com>
18286 * statement.cs (Using.DoResolve): This is internally emitting a
18287 try/finally clause, so we need to set ec.NeedExplicitReturn if we
18288 do not always return. Fixes #47681.
18290 2003-08-26 Martin Baulig <martin@ximian.com>
18292 * decl.cs (MemberCore): Moved WarningNotHiding(),
18293 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18295 (AdditionResult): Make this nested in DeclSpace.
18296 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18297 argument; call NamespaceEntry.Define() unless we're nested in a
18300 * namespace.cs (Namespace.DefineName): New public function. This
18301 is called from DeclSpace's .ctor to add
18302 (Namespace.Lookup): Include DeclSpaces in the lookup.
18304 * class.cs (Operator): Derive from MemberBase, not MemberCore.
18306 * const.cs (Const): Derive from MemberBase, not MemberCore.
18308 2003-08-25 Martin Baulig <martin@ximian.com>
18310 * convert.cs (Convert.ExplicitReferenceConversion): When
18311 converting from an interface type to a class, unbox if the target
18312 type is a struct type. Fixes #47822.
18314 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18316 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18319 2003-08-22 Martin Baulig <martin@ximian.com>
18321 * class.cs (TypeManager.DefineType): When defining a nested type,
18322 call DefineType() on our parent; fixes #47801.
18324 2003-08-22 Martin Baulig <martin@ximian.com>
18326 * class.cs (MethodData.Define): While checking if a method is an
18327 interface implementation, improve the test a bit more to fix #47654.
18329 2003-08-22 Martin Baulig <martin@ximian.com>
18331 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
18332 correctly; fixes #47722.
18334 2003-08-22 Martin Baulig <martin@ximian.com>
18336 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
18337 LocalVariableReference, ensure it's not read-only. Fixes #47536.
18339 * statement.cs (Fixed.DoResolve): Make all variables read-only.
18341 2003-08-22 Martin Baulig <martin@ximian.com>
18343 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
18344 can only be assigned in static constructors. Fixes #47161.
18346 2003-08-22 Martin Baulig <martin@ximian.com>
18348 Rewrote and improved the flow analysis code.
18350 * flowbranching.cs (FlowBranching): Make this class abstract.
18351 (FlowBranching.CreateBranching): New static function to create a
18352 new flow branching.
18353 (FlowBranchingBlock, FlowBranchingException): New classes.
18354 (FlowBranching.UsageVector.Type): New public readonly field.
18355 (FlowBranching.UsageVector.Breaks): Removed the setter.
18356 (FlowBranching.UsageVector.Returns): Removed the setter.
18357 (FlowBranching.UsageVector): Added Break(), Return(),
18358 NeverReachable() and Throw() methods to modify the reachability.
18359 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
18360 done by FlowBranching.Merge().
18361 (FlowBranching.UsageVector.MergeChild): New method; merges the
18362 merge result into the current vector.
18363 (FlowBranching.Merge): New abstract method to merge a branching.
18365 2003-08-12 Martin Baulig <martin@ximian.com>
18367 * expression.cs (Indirection.CacheTemporaries): Create the
18368 LocalTemporary with the pointer type, not its element type.
18370 2003-08-10 Miguel de Icaza <miguel@ximian.com>
18372 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
18373 token was a keyword or not.
18375 Add `error' options where an IDENTIFIER was expected; Provide
18376 CheckToken and CheckIdentifierToken convenience error reporting
18379 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
18381 * decl.cs: Rename `NamespaceEntry Namespace' public field into
18382 NameSpaceEntry NameSpaceEntry.
18384 (LookupInterfaceOrClass): Avoid creating a full qualified name
18385 from namespace and name: avoid doing lookups when we know the
18386 namespace is non-existant. Use new Tree.LookupByNamespace which
18387 looks up DeclSpaces based on their namespace, name pair.
18389 * driver.cs: Provide a new `parser verbose' to display the
18390 exception thrown during parsing. This is turned off by default
18391 now, so the output of a failure from mcs is more graceful.
18393 * namespace.cs: Track all the namespaces defined in a hashtable
18396 (IsNamespace): New method
18398 2003-08-09 Miguel de Icaza <miguel@ximian.com>
18400 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
18401 we know that we need to concatenate (full typename can never be
18406 * statement.cs: Use a bitfield; Do not initialize to null things
18407 which are done by the constructor by default.
18409 * cs-parser.jay: bug fix, parameter was 4, not 3.
18411 * expression.cs: Just use the property;
18413 * statement.cs: No need for GetVariableInfo method.
18415 2003-08-08 Martin Baulig <martin@ximian.com>
18417 * flowanalysis.cs (FlowReturns): This is now nested in the
18418 `FlowBranching' class.
18419 (MyBitVector): Moved this here from statement.cs.
18420 (FlowBranching.SiblingType): New enum type.
18421 (FlowBranching.CreateSibling): Added `SiblingType' argument.
18423 2003-08-07 Martin Baulig <martin@ximian.com>
18425 * flowanalysis.cs (FlowBranchingType): This is now nested in the
18426 `FlowBranching' class and called `BranchingType'.
18428 2003-08-07 Martin Baulig <martin@ximian.com>
18430 * flowanalysis.cs: Moved all the control flow analysis code into
18433 2003-08-07 Martin Baulig <martin@ximian.com>
18435 * assign.cs (Assign.DoResolve): `target' must either be an
18436 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
18439 2003-08-07 Miguel de Icaza <miguel@ximian.com>
18441 * expression.cs (BinaryMethod): This kind of expression is created by the
18442 Binary class if it determines that the operator has to be handled
18445 (BinaryDelegate): This kind of expression is created if we are
18446 dealing with a + or - operator on delegates.
18448 (Binary): remove method, argumetns, and DelegateOperator: when
18449 dealing with methods,
18451 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
18453 * statement.cs (Block): use bitfields for the three extra booleans
18454 we had in use. Remove unused topblock parameter.
18456 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
18458 * assign.cs: Drop extra unneeded tests.
18460 2003-08-06 Miguel de Icaza <miguel@ximian.com>
18462 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
18464 * statement.cs (Foreach): Use VariableStorage instead of
18467 * codegen.cs (VariableStorage): New class used by clients that
18468 require a variable stored: locals or fields for variables that
18469 need to live across yield.
18471 Maybe provide a convenience api for EmitThis+EmitLoad?
18473 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
18476 2003-08-05 Miguel de Icaza <miguel@ximian.com>
18478 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
18479 RemapParameterLValue): New methods that are used to turn a
18480 precomputed FieldInfo into an expression like this:
18484 The idea is to use this instead of making LocalVariableReference
18485 have more than one meaning.
18487 * cs-parser.jay: Add error production to BASE.
18489 * ecore.cs: Deal with TypeManager.GetField returning null, which
18490 is now a valid return value.
18492 (FieldExprNoAddress): New expression for Fields whose address can
18495 * expression.cs (LocalVariableReference): During the resolve
18496 phases, create new expressions if we are in a remapping context.
18497 Remove code that dealt with remapping here.
18499 (ParameterReference): same.
18501 (ProxyInstance): New expression, like the `This' expression, but
18502 it is born fully resolved. We know what we are doing, so remove
18503 the errors that are targeted to user-provided uses of `this'.
18505 * statement.cs (Foreach): our variable is now stored as an
18506 Expression; During resolution, follow the protocol, dont just
18507 assume it will return this.
18509 2003-08-06 Martin Baulig <martin@ximian.com>
18511 * support.cs (SeekableStreamReader.cs): New public class.
18513 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
18514 SeekableStreamReader instead of the normal StreamReader.
18516 2003-08-04 Martin Baulig <martin@ximian.com>
18518 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
18519 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
18520 deambiguate casts and delegate invocations.
18521 (parenthesized_expression): Use the new tokens to ensure this is
18522 not a cast of method invocation.
18524 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
18525 when reading a `)' and Deambiguate_CloseParens () was previously
18528 * expression.cs (ParenthesizedExpression): New class. This is
18529 just used for the CS0075 test.
18530 (Binary.DoResolve): Check for CS0075.
18532 2003-07-29 Ravi Pratap <ravi@ximian.com>
18534 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
18535 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
18536 reference comparison.
18538 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
18539 examine the ReturnType for equality - this is necessary in the
18540 cases of implicit and explicit operators whose signature also
18541 includes the return type.
18543 2003-07-26 Miguel de Icaza <miguel@ximian.com>
18545 * namespace.cs: Cache the result of the namespace computation,
18546 instead of computing it every time.
18548 2003-07-24 Miguel de Icaza <miguel@ximian.com>
18550 * decl.cs: Use a global arraylist that we reuse over invocations
18551 to avoid excesive memory consumption. Reduces memory usage on an
18552 mcs compile by one meg (45 average).
18554 * typemanager.cs (LookupTypeReflection): In .NET pointers are
18555 private, work around that.
18557 2003-07-23 Miguel de Icaza <miguel@ximian.com>
18559 * literal.cs (IntLiteral): Define Zero and One static literals.
18561 * cs-parser.jay (integer_literal): use static literals to reduce
18562 memory usage for the most used literals (0, 1 and -1). 211kb
18563 reduced in memory usage.
18565 Replace all calls to `new ArrayList' with `new
18566 ArrayList(4)' which is a good average number for most allocations,
18567 and also requires only 16 bytes of memory for its buffer by
18570 This reduced MCS memory usage in seven megabytes for the RSS after
18573 2003-07-28 Ravi Pratap <ravi@ximian.com>
18575 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
18576 handle params methods the correct way by forming only one
18577 applicable set with params and normal methods in them. Earlier we
18578 were looking at params methods only if we found no normal methods
18579 which was not the correct thing to do.
18581 (Invocation.BetterFunction): Take separate arguments indicating
18582 when candidate and the best method are params methods in their
18585 This fixes bugs #43367 and #46199.
18587 * attribute.cs: Documentation updates.
18589 (CheckAttribute): Rename to CheckAttributeTarget.
18590 (GetValidPlaces): Rename to GetValidTargets.
18592 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
18593 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
18597 2003-07-28 Martin Baulig <martin@ximian.com>
18599 * class.cs (TypeContainer.DefineMembers): Use the base type's full
18600 name when looking up the base class of a nested class. Fixes #46977.
18602 2003-07-26 Martin Baulig <martin@ximian.com>
18604 * expression.cs (Indexers.Indexer): New nested struct; contains
18605 getter, setter and the indexer's type.
18606 (Indexers.Properties): This is now an ArrayList of
18607 Indexers.Indexer's.
18608 (IndexerAccess.DoResolveLValue): Correctly set the type if the
18609 indexer doesn't have any getters.
18611 * assign.cs (Assign.DoResolve): Also do the implicit conversions
18612 for embedded property and indexer assignments.
18614 2003-07-26 Martin Baulig <martin@ximian.com>
18616 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
18617 preprocessor directive is not the first non-whitespace character
18620 2003-07-26 Martin Baulig <martin@ximian.com>
18622 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
18623 namespace parsing, follow the spec more closely.
18625 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
18626 NamespaceEntry.Lookup().
18628 2003-07-25 Martin Baulig <martin@ximian.com>
18630 * MethodCore.cs (OverridesSomething): New public field; it's set
18631 from TypeContainer.DefineMembers if this method overrides
18632 something (which doesn't need to be a method). Fix #39462.
18634 2003-07-25 Ravi Pratap <ravi@ximian.com>
18636 * typemanager.cs (GetMembers): Ensure that the list of members is
18637 reversed. This keeps things in sync.
18639 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
18640 find an AttributeUsage attribute.
18642 * expression.cs (Invocation.OverloadResolve): Perform the check
18643 which disallows Invoke to be directly called on a Delegate.
18645 (Error_InvokeOnDelegate): Report error cs1533.
18647 2003-07-25 Martin Baulig <martin@ximian.com>
18649 * expression.cs (Indexers.GetIndexersForType): Only look in the
18650 interface hierarchy if the requested type is already an
18651 interface. Fixes #46788 while keeping #46502 fixed.
18653 2003-07-25 Martin Baulig <martin@ximian.com>
18655 * class.cs (TypeContainer.DefineMembers): Check whether all
18656 readonly fields have been assigned and report warning CS0649 if
18659 * statement.cs (LocalInfo.IsFixed): Always return true if this is
18662 2003-07-24 Ravi Pratap <ravi@ximian.com>
18664 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
18665 returned from GetMethods to make things consistent with the
18666 assumptions MCS makes about ordering of methods.
18668 This should comprehensively fix bug #45127 and it does :-)
18670 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
18671 ordering is actually reverse.
18673 * Clean up some debug messages I left lying around.
18675 * interface.cs (Populate*): Get rid of code which emits attributes
18676 since the stage in which we emit attributes is the 'Emit' stage,
18677 not the define stage.
18679 (Emit): Move attribute emission for interface members here.
18681 2003-07-22 Ravi Pratap <ravi@ximian.com>
18683 * expression.cs (Invocation.OverloadResolve): Follow the spec more
18684 closely: we eliminate methods in base types when we have an
18685 applicable method in a top-level type.
18687 Please see section 14.5.5.1 for an exact description of what goes
18690 This fixes bug #45127 and a host of other related to corlib compilation.
18692 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
18693 array is the method corresponding to the top-level type (this is
18694 because of the changes made to icall.c) so we change this
18697 (MethodGroupExpr.Name): This too.
18699 * typemanager.cs (GetElementType): New method which does the right
18700 thing when compiling corlib.
18702 * everywhere: Make use of the above in the relevant places.
18704 2003-07-22 Martin Baulig <martin@ximian.com>
18706 * cs-parser.jay (invocation_expression): Moved
18707 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
18708 `cast_expression', but create a InvocationOrCast which later
18709 resolves to either an Invocation or a Cast.
18711 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
18712 method; call this before EmitStatement() to make sure that this
18713 expression can be used as a statement.
18715 * expression.cs (InvocationOrCast): New class; resolves to either
18716 an Invocation or a Cast.
18718 * statement.cs (StatementExpression): Call ResolveStatement() on
18719 the ExpressionStatement before emitting it.
18721 2003-07-21 Martin Baulig <martin@ximian.com>
18723 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
18724 `ref' and `out' attributes match; fixes #46220.
18725 (MemberAccess.ResolveMemberAccess): You can't reference a type
18726 through an expression; fixes #33180.
18727 (Indexers.GetIndexersForType): Don't return the indexers from
18728 interfaces the class implements; fixes #46502.
18730 2003-07-21 Martin Baulig <martin@ximian.com>
18732 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
18733 CS0661 checks; fixes bug #30442.
18735 2003-07-21 Martin Baulig <martin@ximian.com>
18737 * decl.cs (AdditionResult): Added `Error'.
18739 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
18741 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
18742 makes cs0031.cs actually work.
18744 2003-07-20 Martin Baulig <martin@ximian.com>
18746 * namespace.cs: Fixed that bug which caused a crash when compiling
18747 the debugger's GUI.
18749 2003-07-20 Miguel de Icaza <miguel@ximian.com>
18751 * typemanager.cs (LookupTypeReflection): Never expose types which
18752 are NotPublic, NestedPrivate, NestedAssembly, or
18753 NestedFamANDAssem. We used to return these, and later do a check
18754 that would report a meaningful error, but the problem is that we
18755 would not get the real match, if there was a name override.
18757 2003-07-18 Miguel de Icaza <miguel@ximian.com>
18759 * namespace.cs (Namespace, Name): Do not compute the namespace
18760 name dynamically, compute it in the constructor. This reduced
18761 memory usage by 1697 KB.
18763 * driver.cs: Use --pause to pause at the end.
18765 2003-07-17 Peter Williams <peter@newton.cx>
18767 * Makefile: Change the name of the test target so that it doesn't
18768 conflict with the recursive test target.
18770 2003-07-17 Miguel de Icaza <miguel@ximian.com>
18772 * expression.cs (LocalVariableReference.Emit, EmitAssign,
18773 AddressOf): Do not use EmitThis, that was wrong, use the actual
18776 2003-07-15 Miguel de Icaza <miguel@ximian.com>
18778 * class.cs (MethodData.Define): While checking if a method is an
18779 interface implementation, improve the test: If we are not public
18780 (use new test here: use the computed MethodAttributes directly,
18781 instead of the parsed modifier flags) check if the `implementing'
18782 method comes from an interface or not.
18784 * pending.cs (VerifyPendingMethods): Slightly better error
18787 * makefile: add test target that does the mcs bootstrap.
18789 2003-07-16 Ravi Pratap <ravi@ximian.com>
18791 * interface.cs (Define): Do nothing here since there are no
18792 members to populate etc. Move the attribute emission out of here
18793 since this was just totally the wrong place to put it. Attribute
18794 application happens during the 'Emit' phase, not in the 'Define'
18797 (Emit): Add this method and move the attribute emission here
18799 * rootcontext.cs (EmitCode): Call the Emit method on interface
18802 2003-07-14 Ravi Pratap M <ravi@ximian.com>
18804 * expression.cs (OverloadResolve): Report error only if Location
18805 is not 'Null' which means that there was a probe going on.
18807 2003-07-14 Martin Baulig <martin@ximian.com>
18809 * expression.cs (ConditionalLogicalOperator): New public class to
18810 implement user defined conditional logical operators.
18811 This is section 14.11.2 in the spec and bug #40505.
18813 2003-07-14 Martin Baulig <martin@ximian.com>
18815 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
18817 2003-07-14 Martin Baulig <martin@ximian.com>
18819 * codegen.cs (EmitContext.InFixedInitializer): New public field.
18821 * ecore.cs (IVariable.VerifyFixed): New interface method.
18823 * expression.cs (Unary.ResolveOperator): When resolving the `&'
18824 operator, check whether the variable is actually fixed. Fixes bug
18825 #36055. Set a variable definitely assigned when taking its
18826 address as required by the spec.
18828 * statement.cs (LocalInfo.IsFixed): New field.
18829 (LocalInfo.MakePinned): Set `IsFixed' to true.
18831 2003-07-14 Ravi Pratap M <ravi@ximian.com>
18833 * attribute.cs (Attribute.Resolve): While doing a Member lookup
18834 for .ctors, ensure that we only ask for members declared in the
18835 attribute type (BindingFlags.DeclaredOnly).
18839 * expression.cs (Error_WrongNumArguments): Report error 1501
18840 correctly the way CSC does.
18842 2003-07-13 Martin Baulig <martin@ximian.com>
18844 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
18845 lookup on the fully qualified name, to make things like "X.X" work
18846 where "X.X" is a fully qualified type name, but we also have a
18847 namespace "X" in the using list. Fixes #41975.
18849 2003-07-13 Martin Baulig <martin@ximian.com>
18851 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
18852 function. If we're a CompoundAssign, we need to create an embedded
18853 CompoundAssign, not an embedded Assign.
18854 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
18857 2003-07-13 Martin Baulig <martin@ximian.com>
18859 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
18860 work to fix bug #46088.
18862 2003-07-13 Ravi Pratap <ravi@ximian.com>
18864 * class.cs (Operator.Emit): Do not emit attributes here - it is
18865 taken care of by the Method class that we delegate too. This takes
18866 care of bug #45876.
18868 2003-07-10 Martin Baulig <martin@ximian.com>
18870 * expression.cs (TypeOfVoid): New class.
18871 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
18873 2003-07-10 Martin Baulig <martin@ximian.com>
18875 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
18878 2003-07-10 Martin Baulig <martin@ximian.com>
18880 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
18881 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
18883 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
18885 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
18887 2003-07-10 Martin Baulig <martin@ximian.com>
18889 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
18890 of decimal. Fixes #42850.
18892 NOTE: I also fixed the created byte blob, but this doesn't work on
18893 the MS runtime and csc never produces any byte blobs for decimal
18896 2003-07-10 Martin Baulig <martin@ximian.com>
18898 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
18899 structs; fixes #32068.
18900 (Block.AddChildVariableNames): Fixed #44302.
18902 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18904 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
18906 2003-07-07 Miguel de Icaza <miguel@ximian.com>
18908 * attribute.cs: And this test is onger needed.
18910 2003-07-08 Martin Baulig <martin@ximian.com>
18912 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
18913 inaccessible types. Fixes #36313.
18915 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
18917 * namespace.cs (NamespaceEntry): Create implicit entries for all
18918 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
18919 implicit entries for N1.N2 and N1.
18921 2003-07-08 Martin Baulig <martin@ximian.com>
18923 Rewrote the handling of namespaces to fix a lot of the issues
18924 wrt. `using' aliases etc.
18926 * namespace.cs (Namespace): Splitted this class into a
18927 per-assembly `Namespace' and a per-file `NamespaceEntry'.
18929 * typemanager.cs (TypeManager.IsNamespace): Removed.
18930 (TypeManager.ComputeNamespaces): Only compute namespaces from
18931 loaded assemblies here, not the namespaces from the assembly we're
18932 currently compiling.
18934 2003-07-08 Martin Baulig <martin@ximian.com>
18936 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
18938 2003-07-07 Miguel de Icaza <miguel@ximian.com>
18940 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
18943 I thought about the memory savings here, but LookupTypeReflection
18944 is used under already very constrained scenarios. Compiling
18945 corlib or mcs only exposes one hit, so it would not really reduce
18946 any memory consumption.
18948 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18950 * typemanager.cs: fixes bug #45889 by only adding public types from
18951 other assemblies to the list of known types.
18953 2003-07-07 Miguel de Icaza <miguel@ximian.com>
18955 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
18956 on the type we resolved.
18958 2003-07-05 Martin Baulig <martin@ximian.com>
18960 * pending.cs (PendingImplementation.ParentImplements): Don't
18961 create the proxy if the parent is abstract.
18963 * class.cs (TypeContainer.DefineIndexers): Process explicit
18964 interface implementations first. Fixes #37714.
18966 2003-07-04 Miguel de Icaza <miguel@ximian.com>
18968 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
18969 defined recursively; but since we modify the input parameters
18970 (left is set to `this' temporarily), we reset this value if the
18971 left_is_explicit is false, which gives the original semantics to
18974 * literal.cs (NullPointer): new class used to represent a null
18975 literal in a pointer context.
18977 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
18978 type is a pointer, use a NullPointer object instead of a
18979 NullLiteral. Closes 43687
18981 (ExplicitConversion): Convert pointer values using
18982 the conv opcode to the proper type.
18984 * ecore.cs (New): change ValueTypeVariable property into a method,
18985 that returns whether the valuetype is suitable for being used.
18987 * expression.cs (Binary.DoNumericPromotions): Only return if we
18988 the int constant was a valid uint, and we can return both left and
18989 right as uints. If not, we continue processing, to trigger the
18990 type conversion. This fixes 39018.
18992 * statement.cs (Block.EmitMeta): During constant resolution, set
18993 the CurrentBlock property on the emitcontext, so that we resolve
18994 constants propertly.
18996 2003-07-02 Martin Baulig <martin@ximian.com>
18998 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
18999 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19001 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19002 than emitting it here.
19004 * statement.cs: Fixed some more flow analysis bugs.
19006 2003-07-02 Martin Baulig <martin@ximian.com>
19008 * class.cs (MethodData.Define): When implementing interface
19009 methods, set Final unless we're Virtual.
19011 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19012 check work for interface methods.
19014 2003-07-01 Martin Baulig <martin@ximian.com>
19016 * ecore.cs (EmitContext.This): Replaced this property with a
19017 GetThis() method which takes a Location argument. This ensures
19018 that we get the correct error location for a CS0188.
19020 2003-07-01 Miguel de Icaza <miguel@ximian.com>
19022 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19023 ImplicitStandardConversion.
19025 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19027 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
19029 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19032 2003-06-30 Miguel de Icaza <miguel@ximian.com>
19034 * class.cs (Constructor.Define): Turn off initlocals for unsafe
19037 (MethodData.Define): Turn off initlocals for unsafe methods.
19039 2003-06-29 Miguel de Icaza <miguel@ximian.com>
19041 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19042 complete; Fixes #37521.
19044 * delegate.cs: Use Modifiers.TypeAttr to compute the
19045 TypeAttributes, instead of rolling our own. This makes the flags
19046 correct for the delegates.
19048 2003-06-28 Miguel de Icaza <miguel@ximian.com>
19050 * class.cs (Constructor.Define): Set the private flag for static
19051 constructors as well.
19053 * cs-parser.jay (statement_expression): Set the return value to
19054 null, to avoid a crash when we catch an error.
19056 2003-06-24 Miguel de Icaza <miguel@ximian.com>
19058 * cs-parser.jay: Applied patch from Jackson that adds support for
19059 extern and unsafe modifiers to destructor declarations.
19061 * expression.cs: Report error 21 if the user is trying to index a
19064 * driver.cs: Add an error message, suggested by the bug report.
19066 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19067 if we do not have a ": this ()" constructor initializer. Fixes 45149
19069 2003-06-14 Miguel de Icaza <miguel@ximian.com>
19071 * namespace.cs: Add some information to reduce FAQs.
19073 2003-06-13 Miguel de Icaza <miguel@ximian.com>
19075 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19076 underlying enumeration types. Fixes #43915.
19078 * expression.cs: Treat ushort/short as legal values to be used in
19079 bitwise operations.
19081 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19083 * delegate.cs: transfer custom attributes for paramenters from
19084 the delegate declaration to Invoke and BeginInvoke.
19086 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19088 * attribute.cs: handle custom marshalers and emit marshal info
19091 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
19093 * makefile.gnu: Added anonymous.cs to the compiler sources.
19095 2003-05-28 Miguel de Icaza <miguel@ximian.com>
19097 * iterators.cs: Change the name of the proxy class to include two
19100 * cs-parser.jay: Update grammar to include anonymous methods.
19102 * anonymous.cs: new file.
19104 2003-05-27 Miguel de Icaza <miguel@ximian.com>
19106 * class.cs (Field.Define): Add missing test for pointers and
19109 2003-05-27 Ravi Pratap <ravi@ximian.com>
19111 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19112 we use the stobj opcode.
19114 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19115 since it wasn't the correct fix.
19117 It still is puzzling that we are required to use stobj for IntPtr
19118 which seems to be a ValueType.
19120 2003-05-26 Miguel de Icaza <miguel@ximian.com>
19122 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19123 during regular simple name resolution. Now, the trick is that
19124 instead of returning for processing the simplename, we do a
19125 TypeManager.LookupType (ie, a rooted lookup as opposed to a
19126 contextual lookup type). If a match is found, return that, if
19127 not, return for further composition.
19129 This fixes long-standing 30485.
19131 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19132 using the address to initialize an object, do an Stobj instead of
19133 using the regular Stelem.
19135 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19136 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19137 Because if we are a BaseIndexerAccess that value will be true.
19140 * statement.cs (GotoCase.Resolve): Return after reporting an
19141 error, do not attempt to continue.
19143 * expression.cs (PointerArithmetic.Emit): If our operand is a
19144 long, convert our constants to match the operand before
19145 multiplying. Convert to I type before adding. Fixes 43670.
19147 2003-05-14 Ravi Pratap <ravi@ximian.com>
19149 * enum.cs (ImplicitConversionExists) : Rename to
19150 ImplicitEnumConversionExists to remove ambiguity.
19152 * ecore.cs (NullCast): New type of cast expression class which
19153 basically is very similar to EmptyCast with the difference being
19154 it still is a constant since it is used only to cast a null to
19156 (eg. (string) null)
19158 * convert.cs (ImplicitReferenceConversion): When casting a null
19159 literal, we return a NullCast.
19161 * literal.cs (NullLiteralTyped): Remove - I don't see why this
19162 should be around anymore.
19164 The renaming (reported was slightly wrong). Corrections:
19166 ConvertImplicitStandard -> ImplicitConversionStandard
19167 ConvertExplicitStandard -> ExplicitConversionStandard
19169 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19170 before passing them in !
19172 * convert.cs (ImplicitConversionStandard): When comparing for
19173 equal expr and target types, ensure that expr is not a
19176 In general, we must not be checking (expr_type ==
19177 target_type) in the top level conversion methods
19178 (ImplicitConversion, ExplicitConversion etc). This checking is
19179 done in the methods that they delegate to.
19181 2003-05-20 Miguel de Icaza <miguel@ximian.com>
19183 * convert.cs: Move Error_CannotConvertType,
19184 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19185 ImplicitNumericConversion, ImplicitConversionExists,
19186 ImplicitUserConversionExists, StandardConversionExists,
19187 FindMostEncompassedType, FindMostSpecificSource,
19188 FindMostSpecificTarget, ImplicitUserConversion,
19189 ExplicitUserConversion, GetConversionOperators,
19190 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19191 TryImplicitIntConversion, Error_CannotConvertImplicit,
19192 ConvertImplicitRequired, ConvertNumericExplicit,
19193 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19194 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19197 Perform the following renames:
19199 StandardConversionExists -> ImplicitStandardConversionExists
19200 ConvertImplicit -> ImplicitConversion
19201 ConvertImplicitStandard -> ImplicitStandardConversion
19202 TryImplicitIntConversion -> ImplicitIntConversion
19203 ConvertImplicitRequired -> ImplicitConversionRequired
19204 ConvertNumericExplicit -> ExplicitNumericConversion
19205 ConvertReferenceExplicit -> ExplicitReferenceConversion
19206 ConvertExplicit -> ExplicitConversion
19207 ConvertExplicitStandard -> ExplicitStandardConversion
19209 2003-05-19 Martin Baulig <martin@ximian.com>
19211 * statement.cs (TypeInfo.StructInfo): Made this type protected.
19212 (TypeInfo): Added support for structs having structs as fields.
19214 * ecore.cs (FieldExpr): Implement IVariable.
19215 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19216 VariableInfo for the field.
19218 2003-05-18 Martin Baulig <martin@ximian.com>
19220 * expression.cs (This.DoResolve): Report a CS0027 if we're
19221 emitting a field initializer.
19223 2003-05-18 Martin Baulig <martin@ximian.com>
19225 * expression.cs (This.ResolveBase): New public function.
19226 (This.DoResolve): Check for CS0188.
19228 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19231 * ecore.cs (MethodGroupExpr.DoResolve): Set the
19232 `instance_expression' to null if we don't have any non-static
19235 2003-05-18 Martin Baulig <martin@ximian.com>
19237 Reworked the way how local variables and parameters are handled by
19238 the flow analysis code.
19240 * statement.cs (TypeInfo, VariableMap): New public classes.
19241 (VariableInfo): New public class. This is now responsible for
19242 checking whether a variable has been assigned. It is used for
19243 parameters and local variables.
19244 (Block.EmitMeta): Take the InternalParameters as argument; compute
19245 the layout of the flow vectors here.
19246 (Block.LocalMap, Block.ParameterMap): New public properties.
19247 (FlowBranching): The .ctor doesn't get the InternalParameters
19248 anymore since Block.EmitMeta() now computes the layout of the flow
19250 (MyStructInfo): This class is now known as `StructInfo' and nested
19251 in `TypeInfo'; we don't access this directly anymore.
19253 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19254 property and removed IsAssigned(), IsFieldAssigned(),
19255 SetAssigned() and SetFieldAssigned(); we now call them on the
19256 VariableInfo so we don't need to duplicate this code everywhere.
19258 * expression.cs (ParameterReference): Added `Block block' argument
19260 (LocalVariableReference, ParameterReference, This): The new
19261 VariableInfo class is now responsible for all the definite
19264 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19265 IsParameterAssigned, SetParameterAssigned): Removed.
19267 2003-05-18 Martin Baulig <martin@ximian.com>
19269 * typemanager.cs (InitCoreTypes): Try calling
19270 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19271 the 3-args-version. Corlib now also needs our `void_type'.
19272 (GetMethod): Added overloaded version which takes an optional
19273 `bool report_errors' to allow lookups of optional methods.
19275 2003-05-12 Martin Baulig <martin@ximian.com>
19277 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19278 only used for locals and not for parameters.
19280 2003-05-12 Miguel de Icaza <miguel@ximian.com>
19282 * support.cs (InternalParameters.ParameterType): Return the
19283 ExternalType of the parameter.
19285 * parameter.cs (Parameter.ExternalType): drop the two arguments,
19288 2003-05-11 Miguel de Icaza <miguel@ximian.com>
19290 * class.cs (MethodData.Define): Do not set the `newslot' on
19291 interface members, if they are also flagged as "override".
19293 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19294 better code for ++i and i++. This only works for static fields
19295 and local variables.
19297 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19298 want to pull the DeclSpace out of the builder_to_declspace instead
19299 of the TypeBuilder (like in TypeContainer.FindMembers).
19301 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19302 instead of LookupTypeContainer. Fixes the crash on .NET for
19303 looking up interface members.
19305 * const.cs: Create our own emit context during the Definition
19306 stage, so that constants are evaluated in the proper context, when
19307 a recursive definition happens.
19309 2003-05-11 Martin Baulig <martin@ximian.com>
19311 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
19312 new block for a switch section.
19313 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19314 the adding/lookup in the switch block. Fixes #39828.
19316 2003-05-09 Miguel de Icaza <miguel@ximian.com>
19318 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19319 functionality: I needed to convert the data after I had performed
19320 the add/sub operation into the operands type size.
19322 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19323 pass the type for the box operation, otherwise the resulting
19324 object would have been of type object.
19326 (BoxedCast): Add constructor to specify the type to box as.
19328 2003-05-07 Miguel de Icaza <miguel@ximian.com>
19330 * iterators.cs: I was reusing the `count' variable inadvertently,
19331 take steps to not allow this to happen.
19333 2003-05-06 Miguel de Icaza <miguel@ximian.com>
19335 * attribute.cs (Attribute.Resolve): Params attributes are encoded
19336 by creating an array at the point where the params starts and
19337 putting all those arguments there, then adjusting the size of the
19340 2003-05-05 Miguel de Icaza <miguel@ximian.com>
19342 * expression.cs (New.AddressOf): Implement interface
19343 IMemoryLocation. This is used when the `new' operator is used in
19344 the context of an invocation to a method on a value type.
19346 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
19349 * namespace.cs: Also check the using aliases here.
19351 * driver.cs: Move the test for using validity after the types have
19352 been entered, so we do a single pass that also includes the using
19355 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
19356 in the regular case. CreateSiblingForFinally is doing extra
19359 * attribute.cs (GetAttributeArgumentExpression): Store the result
19360 on an out value, and use the return value to indicate failure
19361 instead of using null (which is a valid return for Constant.GetValue).
19363 * statement.cs: Perform the analysis flow for the increment
19364 portion after the statement, because this will be the real flow of
19365 execution. Fixes #42385
19367 * codegen.cs (EmitContext.EmitArgument,
19368 EmitContext.EmitStoreArgument): New helper functions when the
19369 RemapToProxy flag is set.
19371 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
19374 Add support for remapping parameters.
19376 * iterators.cs: Propagate parameter values; Store parameter
19377 values in the proxy classes.
19379 2003-05-04 Miguel de Icaza <miguel@ximian.com>
19381 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
19382 need a proxy reference; I do not know what I was thinking
19384 * cs-parser.jay (constructor_initializer): catch another error,
19385 and display nice message.
19387 (field_declaration): catch void field declaration
19388 to flag a better error.
19390 * class.cs (MemberBase.CheckBase): Report an error instead of a
19391 warning if a new protected member is declared in a struct.
19392 (Field.Define): catch the error of readonly/volatile.
19394 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
19396 (FieldExpr.AddressOf): ditto. Catch error where the address of a
19397 volatile variable is taken
19399 2003-05-02 Miguel de Icaza <miguel@ximian.com>
19401 * statement.cs (Fixed.Resolve): Report an error if we are not in
19404 2003-05-01 Miguel de Icaza <miguel@ximian.com>
19406 * typemanager.cs: reuse the code that handles type clashes for
19407 delegates and enumerations.
19409 * class.cs (Report28): Always report.
19411 * expression.cs (EncodeAsAttribute): Allow nulls here.
19413 2003-04-28 Miguel de Icaza <miguel@ximian.com>
19415 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
19416 the functionality for testing whether an expression is valid for
19417 an attribute here. Also handle the case of arrays of elements
19420 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
19421 encoding a linear array into an array of objects that are suitable
19422 to be passed to an CustomAttributeBuilder.
19424 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
19426 * ecore.cs: (FieldExpr): Handle field remapping here.
19428 * iteratators.cs: Pass the instance variable (if the method is an
19429 instance method) to the constructors, so we can access the field
19430 variables on the class.
19432 TODO: Test this with structs. I think the THIS variable on
19433 structs might have to be a pointer, and not a refenrece
19435 2003-04-27 Miguel de Icaza <miguel@ximian.com>
19437 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
19438 local variables to fields in a proxy class.
19440 * iterators.cs (PopulateProxy): Rename our internal fields to
19442 Create a <THIS> field if we are an instance method, so we can
19443 reference our parent container variables.
19444 (MapVariable): Called back from the EmitContext code to enter a
19445 new variable to field mapping into the proxy class (we just create
19449 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
19450 for using the remapped locals to fields.
19452 I placed the code here, because that gives the same semantics to
19453 local variables, and only changes the Emit code.
19455 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
19456 statements inside iterators.
19457 (VariableInfo): Add a FieldBuilder for the cases when we are
19458 remapping local variables to fields in a proxy class
19460 * ecore.cs (SimpleNameResolve): Avoid testing two times for
19461 current_block != null.
19463 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
19464 not cope with strings, as it has been moved to the
19465 TableSwitchEmit. Fixed bug in switch generation.
19467 * expression.cs (New.DoResolve): Provide more context for the user
19468 when reporting an error.
19470 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
19473 * expression.cs (MemberAccess.DoResolve): When we get a type back,
19474 check the permissions for it. Note than in a type-resolution
19475 context the check was already present in DeclSpace.ResolveType,
19476 but was missing from the MemberAccess.
19478 (ArrayCreation.CheckIndices): warn if the user has
19479 more nested levels of expressions, but there are no more
19480 dimensions specified. Avoids crash on bug 41906.
19482 2003-04-26 Miguel de Icaza <miguel@ximian.com>
19484 * statement.cs (Block): replace Implicit bool, for a generic
19486 New flag: `Unchecked'. This is used during the EmitMeta phase
19487 (which is out-of-line with the regular Resolve/Emit process for a
19488 statement, as this is done ahead of time, but still gets a chance
19489 to call constant resolve).
19491 (Block.Flags): new enum for adding a new flag.
19493 (Block.EmitMeta): track the state of unchecked.
19495 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
19496 to enable constant resolution to work there as well.
19498 2003-04-22 Miguel de Icaza <miguel@ximian.com>
19500 * typemanager.cs (ienumerable_type): Also look up
19501 System.Collections.IEnumerable.
19503 2003-04-21 Miguel de Icaza <miguel@ximian.com>
19505 TODO: Test more than one conditional per method.
19507 * class.cs (Indexer.Define): Report the location where the user is
19508 referencing the unsupported feature.
19510 (MethodData): Overload the use of `conditionals' to
19511 minimize the creation of needless ArrayLists. This saves roughly
19512 212kb on my machine.
19514 (Method): Implement the new IIteratorContainer interface.
19515 (Method.SetYields): Implement the method by setting the ModFlags
19516 to contain METHOD_YIELDS.
19518 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
19519 which just got set to null.
19521 * iterators.cs: New file.
19523 (Yield, YieldBreak): New statements.
19525 * statement.cs (Return.Resolve): Flag an error if we are used in
19526 an iterator method.
19528 * codegen.cs (InIterator): New flag set if the code is being
19529 compiled in an iterator method.
19531 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
19532 internal modifier, and we just use it to avoid adding extra
19533 fields, as this is seldom used.
19535 * cs-parser.jay: Add yield_statement (yield and yield break).
19537 * driver.cs: New flag -v2 to turn on version 2 features.
19539 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
19540 hashtable when v2 is enabled.
19542 2003-04-20 Miguel de Icaza <miguel@ximian.com>
19544 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
19545 there is already a namespace defined with this name.
19547 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
19548 people upgraded their corlibs.
19550 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
19551 always use fully qualified types, no need to use the compiler
19554 (TypeManager.IsNamespace): Use binarysearch.
19556 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
19557 AddDelegate): I did not quite use the new IsValid API properly: I
19558 have to pass the short-name and the fullname. I was passing only
19559 the basename instead of the fullname sometimes.
19561 (TypeContainer.DefineType): call NamespaceClash.
19563 * interface.cs (Interface.DefineType): use NamespaceClash before
19566 * delegate.cs (Delegate.DefineType): use NamespaceClash before
19569 * enum.cs: (Enum.DefineType): use NamespaceClash before
19572 * typemanager.cs (: 3-line patch that gives us some tasty 11%
19573 speed increase. First, use the negative_hits cache when we get a
19574 negative. Second, add the type with its full original name
19575 instead of the new . and + encoded name (reflection uses + to
19576 separate type from a nested type). Use LookupTypeReflection
19577 directly which bypasses the type->name hashtable (that we already
19578 know does not contain the type.
19580 * decl.cs (DeclSpace.ResolveTypeExpr): track the
19581 location/container type.
19583 * driver.cs: When passing utf8, use directly the UTF8Encoding.
19585 2003-04-19 Miguel de Icaza <miguel@ximian.com>
19587 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
19589 * delegate.cs (NewDelegate.Resolve): Test whether an instance
19590 method is being referenced in the method group from a static
19591 context, and report error 120 if so.
19593 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
19596 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
19597 is created, we create the A namespace).
19599 * cs-parser.jay: A namespace also introduces a DeclarationFound.
19602 2003-04-18 Miguel de Icaza <miguel@ximian.com>
19604 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
19605 invocation to ModuleBuilder.GetType with the same values will
19606 return a new type instance, so we need to cache its return
19609 * expression.cs (Binary.ResolveOperator): Only allow the compare
19610 operators on enums if they are of the same type.
19612 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
19613 types of ValueType on their own case. Before we were giving them
19614 the same treatment as objects.
19616 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
19617 fullname. Short name is used to compare against container name.
19618 Fullname is used to check against defined namespace names.
19620 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
19621 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
19623 (Method.CheckBase): Call parent.
19624 (MemberBase.CheckBase): Check for protected members on sealed
19626 (PropertyBase.CheckBase): Call parent.
19627 (Field.Define): Call parent.
19629 * report.cs: Negative error codes are now mapped to 8000 - code,
19630 so that the display is render more nicely.
19632 * typemanager.cs: Do not use try/catch, instead report a regular
19635 (GetPointerType, GetReferenceType): These methods provide
19636 mechanisms to obtain the T* and T& from a T. We had the code
19637 previously scattered around the code base, and it also used
19638 TypeManager.LookupType that would go through plenty of caches.
19639 This one goes directly to the type source.
19641 In some places we did the Type.GetType followed by
19642 ModuleBuilder.GetType, but not in others, so this unifies the
19643 processing as well.
19645 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
19646 statements now that we have namespace information.
19648 * typemanager.cs (IsNamespace): New method, returns whether the
19649 string presented is a namespace or not.
19651 (ComputeNamespaces): New public entry point, computes the list of
19652 available namespaces, using the GetNamespaces API call in Mono, or
19653 the slower version in MS.NET.
19655 Now before we start the semantic analysis phase, we have a
19656 complete list of namespaces including everything that the user has
19659 Deleted old code to cache namespaces in .nsc files.
19661 2003-04-17 Miguel de Icaza <miguel@ximian.com>
19663 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
19664 class/struct location definition Location for the implicit
19665 constructor location.
19667 (Operator.Define): Use the location of the operator for the
19668 implicit Method definition.
19670 (Constructor.Emit): use the constructor location for the implicit
19671 base initializer constructor.
19673 * ecore.cs: Remove ITypeExpression. This interface is now gone,
19674 and the Expression class now contains two new methods:
19676 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
19677 isolate type lookup from the rest of the resolution process.
19679 Since we use Expressions to hold type definitions due to the way
19680 we parse the input we have historically overloaded Resolve to
19681 perform the Type lookups if a special flag is passed. Now this is
19682 eliminated and two methods take their place.
19684 The differences in the two methods between xStep and xTerminal is
19685 that xStep is involved in our current lookup system that uses
19686 SimpleNames to compose a name, while xTerminal is used just to
19687 catch the case where the simplename lookup failed.
19689 2003-04-16 Miguel de Icaza <miguel@ximian.com>
19691 * expression.cs (ResolveMemberAccess): Remove redundant code.
19692 TypeExpr expressions are always born fully resolved.
19694 * interface.cs (PopulateMethod): Do not lookup the types twice.
19695 We were doing it once during SemanticAnalysis and once during
19698 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
19699 in local variable type definitions, were being returned as a
19700 SimpleName (we decomposed everything into a string), that is
19701 because primary_expression was being used instead of a type in the
19702 grammar (reduce/reduce conflicts).
19704 The part that was wrong is that we converted the expression into a
19705 string (an oversimplification in one hand, compounded with primary
19706 expressions doing string concatenation).
19712 Would return "A.B.C[]" as a SimpleName. This stopped things like
19713 using clauses from working on this particular context. And a type
19714 was being matched directly against "A.B.C[]".
19716 We now use the correct approach, and allow for ComposedCast to be
19717 part of the unary expression. So the "A.B.C []" become a composed
19718 cast of "A.B.C" (as a nested group of MemberAccess with a
19719 SimpleName at the end) plus the rank composition "[]".
19723 2003-04-10 Miguel de Icaza <miguel@ximian.com>
19725 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
19726 for the access level checking.
19728 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
19729 `TypeContainer container', because I kept getting confused when I
19730 was debugging this code.
19732 * expression.cs (Indexers): Instead of tracking getters/setters,
19733 we now track them in parallel. We create one arraylist less, but
19734 most importantly it is possible now for the LValue code to find a
19735 matching get for a set.
19737 (IndexerAccess.DoResolveLValue): Update the code.
19738 GetIndexersForType has been modified already to extract all the
19739 indexers from a type. The code assumed it did not.
19741 Also make the code set the correct return type for the indexer.
19742 This was fixed a long time ago for properties, but was missing for
19743 indexers. It used to be void_type.
19745 (Binary.Emit): Test first for doubles instead of
19746 floats, as they are more common.
19748 (Binary.EmitBranchable): Use the .un version of the branch opcodes
19749 when dealing with floats and the <=, >= operators. This fixes bug
19752 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
19753 to load the array value by emitting a load on the foreach variable
19754 type. This was incorrect.
19756 We now emit the code to load an element using the the array
19757 variable type, and then we emit the conversion operator.
19761 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
19763 * attribute.cs: Avoid allocation of ArrayLists in the common case.
19765 2003-04-09 Miguel de Icaza <miguel@ximian.com>
19767 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
19768 test for protection before we test for signatures.
19770 (MethodSignature.ToString): implement.
19772 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
19773 to the case where we reduced into a LongConstant.
19775 * decl.cs (CheckAccessLevel): If the type is an array, we can not
19776 depend on whether the information is acurrate, because the
19777 Microsoft runtime will always claim that the array type is public,
19778 regardless of the real state.
19780 If the type is a pointer, another problem happens: the type is
19781 reported as non-public in Microsoft.
19783 In both cases we have to call CheckAccessLevel recursively with
19784 the underlying type as the argument to be tested.
19786 2003-04-08 Miguel de Icaza <miguel@ximian.com>
19788 * assign.cs (Assign.Emit): If we are dealing with a compound
19789 assignment expression, we should use the code path that stores the
19790 intermediate result in a temporary value. This fixes #40903.
19792 *expression.cs (Indirection.ToString): Provide ToString method for
19795 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
19797 * class.cs: Null out fields holding references to Block objects so
19798 they can be garbage collected.
19800 * expression.cs (OverloadResolve): Remove unused local.
19802 2003-04-07 Martin Baulig <martin@ximian.com>
19804 * codegen.cs (EmitContext.CurrentFile): New public field.
19805 (EmitContext.Mark): Use the CurrentFile to check whether the
19806 location is in the correct file.
19807 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
19809 2003-04-07 Martin Baulig <martin@ximian.com>
19811 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
19813 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
19814 location. [FIXME: The location argument which gets passed to this
19815 method is sometimes wrong!]
19817 2003-04-07 Nick Drochak <ndrochak@gol.com>
19819 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
19821 2003-04-07 Miguel de Icaza <miguel@ximian.com>
19823 * expression.cs (Indirection.EmitAssign): We were using the
19824 temporary, but returning immediately instead of continuing the
19827 2003-04-06 Martin Baulig <martin@ximian.com>
19829 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
19830 if it's a nested child, but also deriving from the outer class.
19833 * typemanager.cs (IsNestedChildOf): Make this work if it's a
19834 nested child, but also deriving from the outer class. See
19836 (FilterWithClosure): We may access private members of the outer
19837 class if we're a nested child and deriving from the outer class.
19838 (RealMemberLookup): Only set `closure_private_ok' if the
19839 `original_bf' contained BindingFlags.NonPublic.
19841 2003-04-05 Martin Baulig <martin@ximian.com>
19843 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
19845 2003-04-02 Miguel de Icaza <miguel@ximian.com>
19847 * class.cs (Event.Define): Do not allow abstract events to have
19850 2003-04-01 Miguel de Icaza <miguel@ximian.com>
19852 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
19853 block in event declarations.
19855 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
19856 value type, get its address.
19858 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
19859 leaving a class on the stack instead of a boolean value (int
19860 0/1). Change the code so we compare against null, and then the
19861 result against zero.
19863 * class.cs (TypeContainer.GetClassBases): We were checking for the
19864 parent class being sealed too late.
19866 * expression.cs (Binary.Emit): For <= and >= when dealing with
19867 floating point values, use cgt.un and clt.un instead of cgt and
19870 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
19872 * statement.cs: Apply the same optimization as MS: skip the
19873 GetEnumerator returning an IEnumerator, and use the one returning a
19874 CharEnumerator instead. This allows us to avoid the try-finally block
19877 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
19879 * cs-parser.jay: Attributes cannot be applied to
19880 namespaces. Fixes #40473
19882 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19885 (Add*): check if the name is valid using the full name for constants,
19886 fields, properties and events.
19888 2003-03-28 Miguel de Icaza <miguel@ximian.com>
19890 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
19891 char constants to be part of the enumeration.
19893 * expression.cs (Conditional.DoResolve): Add support for operator
19894 true. Implements the missing functionality from 14.12
19896 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
19897 operator true/false as required by the spec.
19899 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
19900 implicit conversion to boolean.
19902 * statement.cs (Statement.ResolveBoolean): A boolean expression is
19903 also one where the type implements `operator true'.
19905 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
19906 get an expression that will invoke operator true based on an
19909 (GetConversionOperators): Removed the hack that called op_True
19912 (Expression.ResolveBoolean): Move this from Statement.
19914 2003-03-17 Miguel de Icaza <miguel@ximian.com>
19916 * ecore.cs (FieldExpr): do not allow initialization of initonly
19917 fields on derived classes
19919 2003-03-13 Martin Baulig <martin@ximian.com>
19921 * statement.cs (Block.Emit): Call ig.BeginScope() and
19922 ig.EndScope() when compiling with debugging info; call
19923 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
19925 2003-03-08 Miguel de Icaza <miguel@ximian.com>
19927 * expression.cs (Indexers): Do not construct immediately, allow
19928 for new members to be appended as we go. Fixes 38143
19930 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19932 * expression.cs: save/restore context when resolving an unchecked
19935 2003-03-05 Miguel de Icaza <miguel@ximian.com>
19937 * cfold.cs: Catch division by zero in modulus operator during
19940 2003-03-03 Miguel de Icaza <miguel@ximian.com>
19942 * interface.cs (Interface.DefineMembers): Avoid defining members
19945 2003-02-27 Miguel de Icaza <miguel@ximian.com>
19947 * driver.cs: handle the +/- options for -noconfig
19949 * statement.cs (Unckeched.Resolve): Also track the state of
19950 unchecked in the Resolve phase.
19952 2003-02-27 Martin Baulig <martin@ximian.com>
19954 * ecore.cs (Expression.MemberLookup): Don't create a
19955 MethodGroupExpr for something which is not a method. Fixes #38291.
19957 2003-02-25 Miguel de Icaza <miguel@ximian.com>
19959 * class.cs (MemberBase.CheckParameters): Also check that the type
19960 is unmanaged if it is a pointer.
19962 * expression.cs (SizeOf.Resolve): Add location information.
19964 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
19965 a managed type is declared.
19967 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
19968 parameter modifiers as well. Fixes bug 38606
19970 * class.cs: Very sad. Am backing out the speed up changes
19971 introduced by the ArrayList -> Array in the TypeContainer, as they
19972 were not actually that much faster, and introduced a bug (no error
19973 reports on duplicated methods).
19975 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
19976 source first, this will guarantee that we have a valid expression
19977 before calling in lower levels functions that will require a
19978 resolved object. Then use this original_source in the
19979 target.ResolveLValue instead of the original source that was
19982 Another change. Use target.Resolve instead of LValueResolve.
19983 Although we are resolving for LValues, we will let the Assign code
19984 take care of that (it will be called again from Resolve). This
19985 basically allows code like this:
19987 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
19988 class Y { void A (X x) { x [0] += o; }
19990 The problem was that the indexer was trying to resolve for
19991 set_Item (idx, object o) and never finding one. The real set_Item
19992 was set_Item (idx, X). By delaying the process we get the right
19997 2003-02-23 Martin Baulig <martin@ximian.com>
19999 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20000 while calling DoEmit ().
20002 * codegen.cs (EmitContext.Mark): Don't mark locations in other
20003 source files; if you use the #line directive inside a method, the
20004 compiler stops emitting line numbers for the debugger until it
20005 reaches the end of the method or another #line directive which
20006 restores the original file.
20008 2003-02-23 Martin Baulig <martin@ximian.com>
20010 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20012 2003-02-23 Martin Baulig <martin@ximian.com>
20014 * statement.cs (Block.AddChildVariableNames): We need to call this
20015 recursively, not just for our immediate children.
20017 2003-02-23 Martin Baulig <martin@ximian.com>
20019 * class.cs (Event.Define): Always make the field private, like csc does.
20021 * typemanager.cs (TypeManager.RealMemberLookup): Make events
20022 actually work, fixes bug #37521.
20024 2003-02-23 Miguel de Icaza <miguel@ximian.com>
20026 * delegate.cs: When creating the various temporary "Parameters"
20027 classes, make sure that we call the ComputeAndDefineParameterTypes
20028 on those new parameters (just like we do with the formal ones), to
20029 allow them to be resolved in the context of the DeclSpace.
20031 This fixes the bug that Dick observed in Bugzilla #38530.
20033 2003-02-22 Miguel de Icaza <miguel@ximian.com>
20035 * expression.cs (ResolveMemberAccess): When resolving a constant,
20036 do not attempt to pull a constant if the value was not able to
20037 generate a valid constant.
20039 * const.cs (LookupConstantValue): Do not report more errors than required.
20041 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20043 * expression.cs: fixes bug #38328.
20045 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20047 * class.cs: Changed all the various members that can be part of a
20048 class from being an ArrayList to be an Array of the right type.
20049 During the DefineType type_list, interface_list, delegate_list and
20050 enum_list are turned into types, interfaces, delegates and enums
20053 And during the member population, indexer_list, event_list,
20054 constant_list, field_list, instance_constructor_list, method_list,
20055 operator_list and property_list are turned into their real arrays.
20057 Although we could probably perform this operation earlier, for
20058 good error reporting we need to keep the lists and remove the
20059 lists for longer than required.
20061 This optimization was triggered by Paolo profiling the compiler
20062 speed on the output of `gen-sample-program.pl' perl script.
20064 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20065 not crash in methods like MemberLookupFailed that use this field.
20067 This problem arises when the compiler fails to resolve a type
20068 during interface type definition for example.
20070 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20072 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20073 inherit from System.Object, so we have to stop at null, not only
20074 when reaching System.Object.
20076 2003-02-17 Miguel de Icaza <miguel@ximian.com>
20078 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20079 DeclaredOnly because the parent indexer might have had a different
20080 name, but did not loop until the top of the hierarchy was reached.
20082 The problem this one fixes is 35492: when a class implemented an
20083 indexer from an interface, we were getting the interface method
20084 (which was abstract) and we were flagging an error (can not invoke
20087 This also keeps bug 33089 functioning, and test-148 functioning.
20089 * typemanager.cs (IsSpecialMethod): The correct way of figuring
20090 out if a method is special is to see if it is declared in a
20091 property or event, or whether it is one of the predefined operator
20092 names. This should fix correctly #36804.
20094 2003-02-15 Miguel de Icaza <miguel@ximian.com>
20096 The goal here is to remove the dependency on EmptyCast.Peel ().
20097 Killing it completely.
20099 The problem is that currently in a number of places where
20100 constants are expected, we have to "probe" for an EmptyCast, and
20101 Peel, which is not the correct thing to do, as this will be
20102 repetitive and will likely lead to errors.
20104 The idea is to remove any EmptyCasts that are used in casts that
20105 can be reduced to constants, so we only have to cope with
20108 This bug hunt was triggered by Bug 37363 and the desire to remove
20109 the duplicate pattern where we were "peeling" emptycasts to check
20110 whether they were constants. Now constants will always be
20113 * ecore.cs: Use an enumconstant here instead of wrapping with
20116 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20117 throwing me off. By handling this we can get rid of a few hacks.
20119 * statement.cs (Switch): Removed Peel() code.
20121 2003-02-14 Miguel de Icaza <miguel@ximian.com>
20123 * class.cs: Location information for error 508
20125 * expression.cs (New.DoResolve): Add a guard against double
20126 resolution of an expression.
20128 The New DoResolve might be called twice when initializing field
20129 expressions (see EmitFieldInitializers, the call to
20130 GetInitializerExpression will perform a resolve on the expression,
20131 and later the assign will trigger another resolution
20133 This leads to bugs (#37014)
20135 * delegate.cs: The signature for EndInvoke should contain any ref
20136 or out parameters as well. We were not doing this in the past.
20138 * class.cs (Field.Define): Do not overwrite the type definition
20139 inside the `volatile' group. Turns out that volatile enumerations
20140 were changing the type here to perform a validity test, which
20143 2003-02-12 Miguel de Icaza <miguel@ximian.com>
20145 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20146 and structs, we do not want to load the instance variable
20148 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20149 enum_type has to be handled like an object reference (implicit
20150 conversions exists from this to object), but the regular IsClass
20151 and IsValueType tests will never return true for this one.
20153 Also we use TypeManager.IsValueType instead of type.IsValueType,
20154 just for consistency with the rest of the code (this is only
20155 needed if we ever use the construct exposed by test-180.cs inside
20156 corlib, which we dont today).
20158 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
20160 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20163 2003-02-09 Martin Baulig <martin@ximian.com>
20165 * namespace.cs (Namespace..ctor): Added SourceFile argument.
20166 (Namespace.DefineNamespaces): New static public method; this is
20167 called when we're compiling with debugging to add all namespaces
20168 to the symbol file.
20170 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20171 pass it to the Namespace's .ctor.
20173 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20174 and MethodBase arguments; pass the namespace ID to the symwriter;
20175 pass the MethodBase instead of the token to the symwriter.
20176 (SymbolWriter.DefineNamespace): New method to add a namespace to
20179 2003-02-09 Martin Baulig <martin@ximian.com>
20181 * symbolwriter.cs: New file. This is a wrapper around
20182 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
20183 methods here in near future.
20185 2003-02-09 Martin Baulig <martin@ximian.com>
20187 * codegen.cs (EmitContext.Mark): Just pass the arguments to
20188 ILGenerator.MarkSequencePoint() which are actually used by the
20191 2003-02-09 Martin Baulig <martin@ximian.com>
20193 * location.cs (SourceFile): New public sealed class. This
20194 contains the name and an index which is used in the location's token.
20195 (Location): Reserve an appropriate number of bits in the token for
20196 the source file instead of walking over that list, this gives us a
20197 really huge performance improvement when compiling with debugging.
20199 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20200 `SourceFile' argument instead of a string.
20201 (Driver.ProcessFile): Add all the files via Location.AddFile(),
20202 but don't parse/tokenize here, we need to generate the list of all
20203 source files before we do that.
20204 (Driver.ProcessFiles): New static function. Parses/tokenizes all
20207 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20208 instead of a string.
20210 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20213 2003-02-09 Martin Baulig <martin@ximian.com>
20215 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20216 filename on `#line default'.
20218 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20220 * statement.cs: don't clear the pinned var when the fixed statement
20221 returns from the method (fixes bug#37752).
20223 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20225 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
20228 2003-02-07 Martin Baulig <martin@ximian.com>
20230 * driver.cs: Removed the `--debug-args' command line argument.
20232 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20233 automatically by the AsssemblyBuilder.
20234 (CodeGen.InitializeSymbolWriter): We don't need to call any
20235 initialization function on the symbol writer anymore. This method
20236 doesn't take any arguments.
20238 2003-02-03 Miguel de Icaza <miguel@ximian.com>
20240 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20241 from referenced assemblies as well.
20243 2003-02-02 Martin Baulig <martin@ximian.com>
20245 * class.cs (MethodData.Emit): Generate debugging info for external methods.
20247 2003-02-02 Martin Baulig <martin@ximian.com>
20249 * class.cs (Constructor.Emit): Open the symbol writer before
20250 emitting the constructor initializer.
20251 (ConstructorInitializer.Emit): Call ec.Mark() to allow
20252 single-stepping through constructor initializers.
20254 2003-01-30 Miguel de Icaza <miguel@ximian.com>
20256 * class.cs: Handle error 549: do not allow virtual methods in
20259 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20261 * decl.cs: Check access levels when resolving types
20263 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20265 * statement.cs: Add parameters and locals set in catch blocks that might
20266 return to set vector
20268 2003-01-29 Miguel de Icaza <miguel@ximian.com>
20270 * class.cs (Operator): Set the SpecialName flags for operators.
20272 * expression.cs (Invocation.DoResolve): Only block calls to
20273 accessors and operators on SpecialName methods.
20275 (Cast.TryReduce): Handle conversions from char constants.
20278 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20280 * statement.cs: small memory and time optimization in FlowBranching.
20282 2003-01-28 Pedro Mart <yoros@wanadoo.es>
20284 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20285 problem that the last fix but in the other sid (Set).
20287 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20288 access when there is no indexer in the hierarchy.
20290 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20292 * class.cs: Combine some if statements.
20294 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20296 * driver.cs: fixed bug #37187.
20298 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
20300 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20301 any indexer, it's needed to build a list with all the indexers in the
20302 hierarchy (AllGetters), else we have problems. Fixes #35653.
20304 2003-01-23 Miguel de Icaza <miguel@ximian.com>
20306 * class.cs (MethodData.Define): It is wrong for an interface
20307 implementation to be static in both cases: explicit and implicit.
20308 We were only handling this in one case.
20310 Improve the if situation there to not have negations.
20312 * class.cs (Field.Define): Turns out that we do not need to check
20313 the unsafe bit on field definition, only on usage. Remove the test.
20315 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20317 * driver.cs: use assembly.Location instead of Codebase (the latest
20318 patch made mcs fail when using MS assemblies).
20320 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
20322 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20323 get the path to *corlib.dll.
20325 2003-01-21 Nick Drochak <ndrochak@gol.com>
20329 * typemanager.cs: Remove compiler warnings
20331 2003-01-20 Duncan Mak <duncan@ximian.com>
20333 * AssemblyInfo.cs: Bump the version number to 0.19.
20335 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20337 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
20339 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
20341 * class.cs (Constructor::Emit): Emit debugging info for constructors.
20343 2003-01-17 Miguel de Icaza <miguel@ximian.com>
20345 * cs-parser.jay: Small fix: we were not comparing the constructor
20346 name correctly. Thanks to Zoltan for the initial pointer.
20348 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
20350 * cs-tokenizer.cs: Set file name when specified with #line
20352 2003-01-15 Miguel de Icaza <miguel@ximian.com>
20354 * cs-parser.jay: Only perform the constructor checks here if we
20355 are named like the class; This will help provider a better
20356 error. The constructor path is taken when a type definition is
20357 not found, but most likely the user forgot to add the type, so
20358 report that rather than the constructor error.
20360 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
20362 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
20365 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20367 * cs-parser.jay: Add cleanup call.
20369 2003-01-13 Duncan Mak <duncan@ximian.com>
20371 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
20372 consistent with other methods.
20374 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20376 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
20378 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
20380 * attribute.cs: only set GuidAttr to true when we have a
20383 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20387 * typemanager.cs: fixes to allow mcs compile corlib with the new
20388 Type.IsSubclassOf fix.
20390 2003-01-08 Miguel de Icaza <miguel@ximian.com>
20392 * expression.cs (LocalVariableReference.DoResolve): Classify a
20393 constant as a value, not as a variable. Also, set the type for
20396 * cs-parser.jay (fixed_statement): take a type instead of a
20397 pointer_type, so we can produce a better error message later.
20399 * statement.cs (Fixed.Resolve): Flag types that are not pointers
20402 (For.DoEmit): Make inifinite loops have a
20403 non-conditional branch back.
20405 (Fixed.DoEmit): First populate the pinned variables, then emit the
20406 statement, then clear the variables. Before I was emitting the
20407 code once for each fixed piece.
20410 2003-01-08 Martin Baulig <martin@ximian.com>
20412 * statement.cs (FlowBranching.MergeChild): A break in a
20413 SWITCH_SECTION does not leave a loop. Fixes #36155.
20415 2003-01-08 Martin Baulig <martin@ximian.com>
20417 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
20418 lives in the same number space than `param_map'. Fixes #36154.
20420 2003-01-07 Miguel de Icaza <miguel@ximian.com>
20422 * cs-parser.jay (constructor_declaration): Set the
20423 Constructor.ModFlags before probing for it. This makes the
20424 compiler report 514, 515 and 132 (the code was there, but got
20427 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
20428 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
20429 (GotoCase.Resolve): Set `Returns' to ALWAYS.
20431 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
20433 * enum.cs: create the enum static fields using the enum type.
20435 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
20437 * class.cs: don't try to create the ParamBuilder for the return
20438 type if it's not needed (and handle it breaking for the ms runtime
20441 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
20443 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
20445 2002-12-29 Miguel de Icaza <miguel@ximian.com>
20447 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
20448 the command. This showed up while compiling the JANET source
20449 code, which used \r as its only newline separator.
20451 2002-12-28 Miguel de Icaza <miguel@ximian.com>
20453 * class.cs (Method.Define): If we are an operator (because it
20454 reuses our code), then set the SpecialName and HideBySig. #36128
20456 2002-12-22 Miguel de Icaza <miguel@ximian.com>
20458 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
20459 exception, report error 120 `object reference required'.
20461 * driver.cs: Add --pause option, used during to measure the size
20462 of the process as it goes with --timestamp.
20464 * expression.cs (Invocation.DoResolve): Do not allow methods with
20465 SpecialName to be invoked.
20467 2002-12-21 Miguel de Icaza <miguel@ximian.com>
20469 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
20470 number before adding it.
20472 2002-12-21 Ravi Pratap <ravi@ximian.com>
20474 * ecore.cs (StandardImplicitConversion): When in an unsafe
20475 context, we allow conversion between void * to any other pointer
20476 type. This fixes bug #35973.
20478 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
20480 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
20481 is not thrown when extensionless outputs are used
20483 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20485 * rootcontext.cs: fixed compilation of corlib.
20487 2002-12-19 Miguel de Icaza <miguel@ximian.com>
20489 * attribute.cs (Attributes.Contains): Add new method.
20491 * class.cs (MethodCore.LabelParameters): if the parameter is an
20492 `out' parameter, check that no attribute `[In]' has been passed.
20494 * enum.cs: Handle the `value__' name in an enumeration.
20496 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
20498 * decl.cs: Added special case to allow overrides on "protected
20501 2002-12-18 Ravi Pratap <ravi@ximian.com>
20503 * attribute.cs (Attributes.AddAttributeSection): Rename to this
20504 since it makes much more sense.
20506 (Attributes.ctor): Don't require a Location parameter.
20508 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
20510 * attribute.cs (ApplyAttributes): Remove extra Location parameters
20511 since we already have that information per attribute.
20513 * everywhere : make appropriate changes.
20515 * class.cs (LabelParameters): Write the code which actually
20516 applies attributes to the return type. We can't do this on the MS
20517 .NET runtime so we flag a warning in the case an exception is
20520 2002-12-18 Miguel de Icaza <miguel@ximian.com>
20522 * const.cs: Handle implicit null conversions here too.
20524 2002-12-17 Ravi Pratap <ravi@ximian.com>
20526 * class.cs (MethodCore.LabelParameters): Remove the extra
20527 Type [] parameter since it is completely unnecessary. Instead
20528 pass in the method's attributes so that we can extract
20529 the "return" attribute.
20531 2002-12-17 Miguel de Icaza <miguel@ximian.com>
20533 * cs-parser.jay (parse): Use Report.Error to flag errors instead
20534 of ignoring it and letting the compile continue.
20536 * typemanager.cs (ChangeType): use an extra argument to return an
20537 error condition instead of throwing an exception.
20539 2002-12-15 Miguel de Icaza <miguel@ximian.com>
20541 * expression.cs (Unary.TryReduce): mimic the code for the regular
20542 code path. Perform an implicit cast in the cases where we can
20543 implicitly convert to one of the integral types, and then reduce
20544 based on that constant. This fixes bug #35483.
20546 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20548 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
20550 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20552 * namespace.cs: fixed bug #35489.
20554 2002-12-12 Miguel de Icaza <miguel@ximian.com>
20556 * class.cs: Remove some dead code.
20558 * cs-parser.jay: Estimate the number of methods needed
20559 (RootContext.MethodCount);
20561 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
20562 numbers instead of StringBuilders.
20564 * support.cs (PtrHashtable): Add constructor with initial size;
20565 We can now reduce reallocations of the method table.
20567 2002-12-10 Ravi Pratap <ravi@ximian.com>
20569 * attribute.cs (ApplyAttributes): Keep track of the emitted
20570 attributes on a per-target basis. This fixes bug #35413.
20572 2002-12-10 Miguel de Icaza <miguel@ximian.com>
20574 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
20575 default to the Windows 1252 encoding.
20577 (UnixParseOption): Support version, thanks to Alp for the missing
20580 * AssemblyInfo.cs: Add nice assembly information.
20582 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
20585 * cs-parser.jay: Allow a trailing comma before the close bracked
20586 in the attribute_section production.
20588 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
20589 address of the instance was being taken, I will take this out,
20590 because we take the address of the object immediately here.
20592 2002-12-09 Ravi Pratap <ravi@ximian.com>
20594 * typemanager.cs (AreMultipleAllowed): Take care of the most
20595 obvious case where attribute type is not in the current assembly -
20598 2002-12-08 Miguel de Icaza <miguel@ximian.com>
20600 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
20601 definitions, instead of doing that afterwards.
20603 Also we use a nice little hack, depending on the constructor, we
20604 know if we are a "composed" name or a simple name. Hence, we
20605 avoid the IndexOf test, and we avoid
20607 * codegen.cs: Add code to assist in a bug reporter to track down
20608 the source of a compiler crash.
20610 2002-12-07 Ravi Pratap <ravi@ximian.com>
20612 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
20613 types have been emitted for a given element and flag an error
20614 if something which does not have AllowMultiple set is used more
20617 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
20618 attribute types and their corresponding AllowMultiple properties
20620 (AreMultipleAllowed): Check the property for a given type.
20622 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
20623 property in the case we have a TypeContainer.
20625 (Attributes.AddAttribute): Detect duplicates and just skip on
20626 adding them. This trivial fix catches a pretty gross error in our
20627 attribute emission - global attributes were being emitted twice!
20629 Bugzilla bug #33187 is now fixed.
20631 2002-12-06 Miguel de Icaza <miguel@ximian.com>
20633 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
20634 instead of pp_and).
20636 * expression.cs (Binary.ResolveOperator): I can only use the
20637 Concat (string, string, string) and Concat (string, string,
20638 string, string) if the child is actually a concatenation of
20641 2002-12-04 Miguel de Icaza <miguel@ximian.com>
20643 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
20644 context where we need a 2-character lookahead.
20646 * pending.cs (PendingImplementation): Rework so we can keep track
20647 of interface types all the time, and flag those which were
20648 implemented by parents as optional.
20650 2002-12-03 Miguel de Icaza <miguel@ximian.com>
20652 * expression.cs (Binary.ResolveOperator): Use
20653 String.Concat(string,string,string) or
20654 String.Concat(string,string,string,string) when possible.
20656 * typemanager: More helper methods.
20659 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
20661 * pending.cs: remove the bogus return from GetMissingInterfaces()
20662 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
20664 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20666 * namespace.cs: avoid duplicated 'using xxx' being added to
20667 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
20668 when we get more than one 'using' statement for the same namespace.
20669 Report a CS0105 warning for it.
20671 2002-11-30 Miguel de Icaza <miguel@ximian.com>
20673 * cs-tokenizer.cs (consume_identifier): use read directly, instead
20674 of calling getChar/putback, uses internal knowledge of it.
20676 (xtoken): Reorder tokenizer so most common patterns are checked
20677 first. This reduces the compilation time in another 5% (from 8.11s
20678 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
20680 The parsing time is 22% of the compilation in mcs, and from that
20681 64% is spent on the tokenization process.
20683 I tried using a binary search for keywords, but this is slower
20684 than the hashtable. Another option would be to do a couple of
20687 * Not use a StringBuilder, instead use an array of chars,
20688 with a set value. Notice that this way we could catch
20689 the 645 error without having to do it *afterwards*.
20691 * We could write a hand-parser to avoid the hashtable
20692 compares altogether.
20694 The identifier consumption process takes 37% of the tokenization
20695 time. Another 15% is spent on is_number. 56% of the time spent
20696 on is_number is spent on Int64.Parse:
20698 * We could probably choose based on the string length to
20699 use Int32.Parse or Int64.Parse and avoid all the 64-bit
20702 Another 3% is spend on wrapping `xtoken' in the `token' function.
20704 Handle 0xa0 as whitespace (#34752)
20706 2002-11-26 Miguel de Icaza <miguel@ximian.com>
20708 * typemanager.cs (IsCLRType): New routine to tell whether a type
20709 is one of the builtin types.
20711 Maybe it needs to use TypeCodes to be faster. Maybe we could use
20712 typecode in more places instead of doing pointer comparissions.
20713 We could leverage some knowledge about the way the typecodes are
20716 New code to cache namespaces in assemblies, it is currently not
20717 invoked, to be used soon.
20719 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
20721 * expression.cs (Binary.ResolveOperator): specially handle
20722 strings, and do not perform user-defined operator overloading for
20725 2002-11-24 Miguel de Icaza <miguel@ximian.com>
20727 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
20728 internalcall as it is a pretty simple operation; Avoid whenever
20729 possible to call Char.IsLetter.
20731 (consume_identifier): Cut by half the number of
20732 hashtable calls by merging the is_keyword and GetKeyword behavior.
20734 Do not short-circuit, because if we do, we
20735 report errors (ie, #if false && true would produce an invalid
20739 2002-11-24 Martin Baulig <martin@ximian.com>
20741 * expression.cs (Cast.TryReduce): If we're in checked syntax,
20742 check constant ranges and report a CS0221. Fixes #33186.
20744 2002-11-24 Martin Baulig <martin@ximian.com>
20746 * cs-parser.jay: Make this work for uninitialized variable
20747 declarations in the `for' initializer. Fixes #32416.
20749 2002-11-24 Martin Baulig <martin@ximian.com>
20751 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
20752 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
20754 2002-11-24 Martin Baulig <martin@ximian.com>
20756 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
20757 argument; if true, we also check for user-defined conversions.
20758 This is only needed if both arguments are of a user-defined type.
20759 Fixes #30443, added test-175.cs.
20760 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
20762 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
20764 2002-11-24 Martin Baulig <martin@ximian.com>
20766 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
20767 function to get the store opcode.
20768 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
20769 only emit the Ldelema if the store opcode is Stobj. You must run
20770 both test-34 and test-167 to test this. Fixes #34529.
20772 2002-11-23 Martin Baulig <martin@ximian.com>
20774 * ecore.cs (Expression.MemberLookup): Added additional
20775 `qualifier_type' argument which is used when we're being called
20776 from MemberAccess.DoResolve() and null if we're called from a
20778 (Expression.MemberLookupFailed): New method to report errors; this
20779 does the CS1540 check and reports the correct error message.
20781 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
20782 argument for the CS1540 check and redone the way how we're dealing
20783 with private members. See the comment in the source code for details.
20784 (FilterWithClosure): Reverted this back to revision 1.197; renamed
20785 `closure_start_type' to `closure_qualifier_type' and check whether
20786 it's not null. It was not this filter being broken, it was just
20787 being called with the wrong arguments.
20789 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
20790 and pass it the correct `qualifier_type'; this also does the error
20793 2002-11-22 Miguel de Icaza <miguel@ximian.com>
20795 * expression.cs (Invocation.EmitParams): If the we are dealing
20796 with a non-built-in value type, load its address as well.
20798 (ArrayCreation): Use a a pretty constant instead
20799 of the hardcoded value 2. Use 6 instead of 2 for the number of
20800 static initializers.
20802 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
20803 because they are not really value types, just glorified integers.
20805 * driver.cs: Do not append .exe, the CSC compiler does not do it.
20807 * ecore.cs: Remove redundant code for enumerations, make them use
20808 the same code path as everything else, fixes the casting issue
20809 with enumerations in Windows.Forms.
20811 * attribute.cs: Do only cast to string if it is a string, the
20812 validation happens later.
20814 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
20815 people upgrade their corlibs.
20817 * ecore.cs: Oops, enumerations were not following the entire code path
20819 2002-11-21 Miguel de Icaza <miguel@ximian.com>
20821 * typemanager.cs (FilterWithClosure): Commented out the test for
20822 1540 in typemanager.cs, as it has problems when accessing
20823 protected methods from a parent class (see test-174.cs).
20825 * attribute.cs (Attribute.ValidateGuid): new method.
20826 (Attribute.Resolve): Use above.
20828 2002-11-19 Miguel de Icaza <miguel@ximian.com>
20830 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
20832 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
20833 handling for enumerations, as we only needed the TypeContainer
20834 functionality to begin with (this is required for the fix below to
20835 work for enums that reference constants in a container class for
20838 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
20840 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
20841 a valid TypeBuilder to perform lookups on.o
20843 * class.cs (InheritableMemberSignatureCompare): Use true in the
20844 call to GetGetMethod and GetSetMethod, because we are comparing
20845 the signature, and we need to get the methods *even* if they are
20848 (PropertyBase.CheckBase): ditto.
20850 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
20851 GotoCase.Resolve): Use Peel on EmpytCasts.
20853 * ecore.cs (EmptyCast): drop child, add Peel method.
20855 2002-11-17 Martin Baulig <martin@ximian.com>
20857 * ecore.cs (EmptyCast.Child): New public property.
20859 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
20860 label resolved to an EmptyCast. Fixes #34162.
20861 (GotoCase.Resolve): Likewise.
20862 (Block.EmitMeta): Likewise.
20864 2002-11-17 Martin Baulig <martin@ximian.com>
20866 * expression.cs (Invocation.BetterConversion): Prefer int over
20867 uint; short over ushort; long over ulong for integer literals.
20868 Use ImplicitConversionExists instead of StandardConversionExists
20869 since we also need to check for user-defined implicit conversions.
20870 Fixes #34165. Added test-173.cs.
20872 2002-11-16 Martin Baulig <martin@ximian.com>
20874 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
20875 with the `true' and `false' literals. Fixes #33151.
20877 2002-11-16 Martin Baulig <martin@ximian.com>
20879 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
20880 October 22nd; don't do the cs1540 check for static members.
20882 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
20883 now using our own filter here and doing the cs1540 check again.
20885 2002-11-16 Martin Baulig <martin@ximian.com>
20887 * support.cs (InternalParameters): Don't crash if we don't have
20888 any fixed parameters. Fixes #33532.
20890 2002-11-16 Martin Baulig <martin@ximian.com>
20892 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
20893 when looking up static methods to make this work on Windows.
20896 2002-11-16 Martin Baulig <martin@ximian.com>
20898 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
20899 a setter rather than using PropertyInfo.CanWrite.
20901 2002-11-15 Nick Drochak <ndrochak@gol.com>
20903 * class.cs: Allow acces to block member by subclasses. Fixes build
20906 2002-11-14 Martin Baulig <martin@ximian.com>
20908 * class.cs (Constructor.Emit): Added the extern/block check.
20911 2002-11-14 Martin Baulig <martin@ximian.com>
20913 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
20914 iteration while looking for indexers, this is needed because the
20915 indexer may have a different name in our base classes. Fixed the
20916 error reporting (no indexers at all, not get accessor, no
20917 overloaded match). Fixes bug #33089.
20918 (IndexerAccess.DoResolveLValue): Likewise.
20920 2002-11-14 Martin Baulig <martin@ximian.com>
20922 * class.cs (PropertyBase.CheckBase): Make this work for multiple
20923 indexers. Fixes the first part of bug #33089.
20924 (MethodSignature.InheritableMemberSignatureCompare): Added support
20927 2002-11-13 Ravi Pratap <ravi@ximian.com>
20929 * attribute.cs (Attribute.Resolve): Catch the
20930 NullReferenceException and report it since it isn't supposed to
20933 2002-11-12 Miguel de Icaza <miguel@ximian.com>
20935 * expression.cs (Binary.EmitBranchable): Also handle the cases for
20936 LogicalOr and LogicalAnd that can benefit from recursively
20937 handling EmitBranchable. The code now should be nice for Paolo.
20939 2002-11-08 Miguel de Icaza <miguel@ximian.com>
20941 * typemanager.cs (LookupType): Added a negative-hit hashtable for
20942 the Type lookups, as we perform quite a number of lookups on
20943 non-Types. This can be removed once we can deterministically tell
20944 whether we have a type or a namespace in advance.
20946 But this might require special hacks from our corlib.
20950 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
20951 and double which avoids a conversion from an integer to a double.
20953 * expression.cs: tiny optimization, avoid calling IsConstant,
20954 because it effectively performs the lookup twice.
20956 2002-11-06 Miguel de Icaza <miguel@ximian.com>
20958 But a bogus return here to keep the semantics of the old code
20959 until the Mono runtime is fixed.
20961 * pending.cs (GetMissingInterfaces): New method used to remove all
20962 the interfaces that are already implemented by our parent
20963 classes from the list of pending methods.
20965 * interface.cs: Add checks for calls after ResolveTypeExpr.
20967 2002-11-05 Miguel de Icaza <miguel@ximian.com>
20969 * class.cs (Class.Emit): Report warning 67: event not used if the
20970 warning level is beyond 3.
20972 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
20973 being a NullLiteral.
20975 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
20978 * class.cs (TypeContainer.GetClassBases): Cover a missing code
20979 path that might fail if a type can not be resolved.
20981 * expression.cs (Binary.Emit): Emit unsigned versions of the
20984 * driver.cs: use error 5.
20986 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
20988 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
20990 2002-11-01 Miguel de Icaza <miguel@ximian.com>
20992 * cs-parser.jay (switch_section): A beautiful patch from Martin
20993 Baulig that fixed 33094.
20995 2002-10-31 Miguel de Icaza <miguel@ximian.com>
20997 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
20998 Check whether the base is abstract and report an error if so.
21000 * expression.cs (IndexerAccess.DoResolveLValue,
21001 IndexerAccess.DoResolve): ditto.
21003 (Invocation.DoResolve): ditto.
21005 (Invocation.FullMethodDesc): Improve the report string.
21007 * statement.cs (Block): Eliminate IsVariableDefined as it is
21008 basically just a wrapper for GetVariableInfo.
21010 * ecore.cs (SimpleName): Use new
21012 * support.cs (ReflectionParamter.ParameterType): We unwrap the
21013 type, as we return the actual parameter ref/unref state on a
21016 2002-10-30 Miguel de Icaza <miguel@ximian.com>
21018 * support.cs: Return proper flags REF/OUT fixing the previous
21021 * expression.cs: Reverted last patch, that was wrong. Is_ref is
21022 not used to mean `ref' but `ref or out' in ParameterReference
21024 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21025 full type signature instead of calling TypeManger.CSharpName
21028 * support.cs (InternalParameters.ParameterDesc): Do not compare
21029 directly to the modflags, because REF/OUT will actually be bitsets
21032 * delegate.cs (VerifyMethod): Check also the modifiers.
21034 * cs-tokenizer.cs: Fix bug where floating point values with an
21035 exponent where a sign was missing was ignored.
21037 * driver.cs: Allow multiple assemblies to be specified in a single
21040 2002-10-28 Miguel de Icaza <miguel@ximian.com>
21042 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
21043 because identifiers after a parenthesis would end up in this kind
21044 of production, and we needed to desamiguate it for having casts
21047 (UserDefinedType *) xxx
21049 2002-10-24 Miguel de Icaza <miguel@ximian.com>
21051 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21052 we should set on the Bindingflags.NonPublic, but not turn on
21053 private_ok. private_ok controls whether a Private member is
21054 returned (this is chekced on the filter routine), while the
21055 BindingFlags.NonPublic just controls whether private/protected
21056 will be allowed. This fixes the problem part of the problem of
21057 private properties being allowed to be used in derived classes.
21059 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21060 so we can call the children DoResolveLValue method (this will
21061 properly signal errors on lvalue assignments to base properties)
21063 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21064 getter are null, and we have a property info, we know that this
21065 happened because the lookup failed, so we report an error 122 for
21066 protection level violation.
21068 We also silently return if setter and getter are null in the
21069 resolve functions, this condition only happens if we have flagged
21070 the error before. This is the other half of the problem.
21072 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21073 not have accessibility information, that is why we were returning
21074 true in the filter function in typemanager.cs.
21076 To properly report 122 (property is inaccessible because of its
21077 protection level) correctly, we report this error in ResolveAccess
21078 by failing if both the setter and the getter are lacking (ie, the
21081 DoResolve and DoLResolve have been modified to check for both
21082 setter/getter being null and returning silently, the reason being
21083 that I did not want to put the knowledge about this error in upper
21086 int old = Report.Errors;
21087 x = new PropertyExpr (...);
21088 if (old != Report.Errors)
21093 So the property expr is returned, but it is invalid, so the error
21094 will be flagged during the resolve process.
21096 * class.cs: Remove InheritablePropertySignatureCompare from the
21097 class, as we no longer depend on the property signature to compute
21098 whether it is possible to implement a method or not.
21100 The reason is that calling PropertyInfo.GetGetMethod will return
21101 null (in .NET, in Mono it works, and we should change this), in
21102 cases where the Get Method does not exist in that particular
21107 class X { public virtual int A { get { return 1; } } }
21109 class Z : Y { public override int A { get { return 2; } } }
21111 Would fail in Z because the parent (Y) would not have the property
21112 defined. So we avoid this completely now (because the alternative
21113 fix was ugly and slow), and we now depend exclusively on the
21116 (PropertyBase.CheckBase): Use a method-base mechanism to find our
21117 reference method, instead of using the property.
21119 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21120 routines are gone now.
21122 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21123 names, they were incorrectly named.
21125 * cs-tokenizer.cs: Return are more gentle token on failure.
21127 * pending.cs (PendingImplementation.InterfaceMethod): This routine
21128 had an out-of-sync index variable, which caused it to remove from
21129 the list of pending methods the wrong method sometimes.
21131 2002-10-22 Miguel de Icaza <miguel@ximian.com>
21133 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21134 CanWrite, because those refer to this particular instance of the
21135 property, and do not take into account the fact that we can
21136 override single members of a property.
21138 Constructor requires an EmitContext. The resolution process does
21139 not happen here, but we need to compute the accessors before,
21140 because the resolution does not always happen for properties.
21142 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21143 subclass, before we did not update this flag, but we did update
21146 (GetAccessors): Drop this routine, as it did not work in the
21147 presence of partially overwritten set/get methods.
21149 Notice that this broke the cs1540 detection, but that will require
21152 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21156 * driver.cs: issue a warning instead of an error if we don't support
21157 debugging for the platform. Also ignore a couple of errors that may
21158 arise when trying to write the symbols. Undo my previous patch.
21160 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21162 * driver.cs: ignore /debug switch except for Unix platforms.
21164 2002-10-23 Nick Drochak <ndrochak@gol.com>
21166 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21168 2002-10-21 Miguel de Icaza <miguel@ximian.com>
21170 * driver.cs: Do not make mcs-debug conditional, so we do not break
21171 builds that use it.
21173 * statement.cs (UsageVector.MergeChildren): I would like Martin to
21174 review this patch. But basically after all the children variables
21175 have been merged, the value of "Breaks" was not being set to
21176 new_breaks for Switch blocks. I think that it should be set after
21177 it has executed. Currently I set this to the value of new_breaks,
21178 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21179 conservative, but I do not understand this code very well.
21181 I did not break anything in the build, so that is good ;-)
21183 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21185 2002-10-20 Mark Crichton <crichton@gimp.org>
21187 * cfold.cs: Fixed compile blocker. Really fixed it this time.
21189 2002-10-20 Nick Drochak <ndrochak@gol.com>
21191 * cfold.cs: Fixed compile blocker.
21193 2002-10-20 Miguel de Icaza <miguel@ximian.com>
21195 * driver.cs: I was chekcing the key, not the file.
21197 2002-10-19 Ravi Pratap <ravi@ximian.com>
21199 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21200 message that we were generating - we just need to silently return
21203 2002-10-19 Miguel de Icaza <miguel@ximian.com>
21205 * class.cs (Event.Define): Change my previous commit, as this
21206 breaks the debugger. This is a temporary hack, as it seems like
21207 the compiler is generating events incorrectly to begin with.
21209 * expression.cs (Binary.ResolveOperator): Added support for
21210 "U operator - (E x, E y)"
21212 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21215 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21216 init-only variables, but this path did not take into account that
21217 there might be also instance readonly variables. Correct this
21220 This fixes bug 32253
21222 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21225 * driver.cs: Change the extension for modules to `netmodule'
21227 * cs-parser.jay: Improved slightly the location tracking for
21228 the debugger symbols.
21230 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21231 modifiers that were specified instead of the hardcoded value
21232 (FamAndAssem). This was basically ignoring the static modifier,
21233 and others. Fixes 32429.
21235 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21236 fixed a bug in the process (32476)
21238 * expression.cs (ArrayAccess.EmitAssign): Patch from
21239 hwang_rob@yahoo.ca that fixes bug 31834.3
21241 2002-10-18 Miguel de Icaza <miguel@ximian.com>
21243 * driver.cs: Make the module extension .netmodule.
21245 2002-10-16 Miguel de Icaza <miguel@ximian.com>
21247 * driver.cs: Report an error if the resource file is not found
21248 instead of crashing.
21250 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21251 false, like Emit does.
21253 2002-10-16 Nick Drochak <ndrochak@gol.com>
21255 * typemanager.cs: Remove unused private member. Also reported mcs
21256 bug to report this as a warning like csc.
21258 2002-10-15 Martin Baulig <martin@gnome.org>
21260 * statement.cs (Statement.Emit): Made this a virtual method; emits
21261 the line number info and calls DoEmit().
21262 (Statement.DoEmit): New protected abstract method, formerly knows
21263 as Statement.Emit().
21265 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21267 2002-10-11 Miguel de Icaza <miguel@ximian.com>
21269 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21270 have fixed a remaining problem: not every AddXXXX was adding a
21271 fully qualified name.
21273 Now everyone registers a fully qualified name in the DeclSpace as
21274 being defined instead of the partial name.
21276 Downsides: we are slower than we need to be due to the excess
21277 copies and the names being registered this way.
21279 The reason for this is that we currently depend (on the corlib
21280 bootstrap for instance) that types are fully qualified, because
21281 we dump all the types in the namespace, and we should really have
21282 types inserted into the proper namespace, so we can only store the
21283 basenames in the defined_names array.
21285 2002-10-10 Martin Baulig <martin@gnome.org>
21287 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21288 from bug #31834, see the bug report for a testcase which is
21291 2002-10-10 Martin Baulig <martin@gnome.org>
21293 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21294 flow analysis code for this.
21296 * statement.cs (Do, While, For): Tell the flow analysis code about
21298 (FlowBranching.UsageVector): Added support for infinite loops.
21299 (Block.Resolve): Moved the dead code elimination here and use flow
21302 2002-10-09 Miguel de Icaza <miguel@ximian.com>
21304 * class.cs (Field.Define): Catch cycles on struct type
21307 * typemanager.cs (IsUnmanagedtype): Do not recursively check
21308 fields if the fields are static. We only need to check instance
21311 * expression.cs (As.DoResolve): Test for reference type.
21313 * statement.cs (Using.ResolveExpression): Use
21314 ConvertImplicitRequired, not ConvertImplicit which reports an
21316 (Using.ResolveLocalVariableDecls): ditto.
21318 * expression.cs (Binary.ResolveOperator): Report errors in a few
21319 places where we had to.
21321 * typemanager.cs (IsUnmanagedtype): Finish implementation.
21323 2002-10-08 Miguel de Icaza <miguel@ximian.com>
21325 * expression.cs: Use StoreFromPtr instead of extracting the type
21326 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
21328 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
21329 an enumeration value to a System.Enum, but System.Enum is not a
21330 value type, but an class type, so we need to box.
21332 (Expression.ConvertExplicit): One codepath could return
21333 errors but not flag them. Fix this. Fixes #31853
21335 * parameter.cs (Resolve): Do not allow void as a parameter type.
21337 2002-10-06 Martin Baulig <martin@gnome.org>
21339 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
21340 if it's a class type and not a struct. Fixes #31815.
21342 2002-10-06 Martin Baulig <martin@gnome.org>
21344 * statement.cs: Reworked the flow analysis code a bit to make it
21345 usable for dead code elimination.
21347 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21349 * cs-parser.jay: allow empty source files. Fixes bug #31781.
21351 2002-10-04 Miguel de Icaza <miguel@ximian.com>
21353 * expression.cs (ComposedCast.DoResolveType): A quick workaround
21354 to fix the test 165, will investigate deeper.
21356 2002-10-04 Martin Baulig <martin@gnome.org>
21358 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
21359 finally blocks actually work.
21360 (Try.Resolve): We don't need to create a sibling for `finally' if
21361 there is no finally block.
21363 2002-10-04 Martin Baulig <martin@gnome.org>
21365 * class.cs (Constructor.Define): The default accessibility for a
21366 non-default constructor is private, not public.
21368 2002-10-04 Miguel de Icaza <miguel@ximian.com>
21370 * class.cs (Constructor): Make AllowedModifiers public, add
21373 * cs-parser.jay: Perform the modifiers test here, as the
21374 constructor for the Constructor class usually receives a zero
21375 because of the way we create it (first we create, later we
21376 customize, and we were never checking the modifiers).
21378 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
21379 is a version of LookupTypeReflection that includes the type-name
21380 cache. This can be used as a fast path for functions that know
21381 the fully qualified name and are only calling into *.GetType() to
21382 obtain a composed type.
21384 This is also used by TypeManager.LookupType during its type
21387 (LookupType): We now also track the real type name, as sometimes
21388 we can get a quey for the real type name from things like
21389 ComposedCast. This fixes bug 31422.
21391 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
21392 complete type fullname, it does not have to go through the type
21393 resolution system to obtain the composed version of the type (for
21394 obtaining arrays or pointers).
21396 (Conditional.Emit): Use the EmitBoolExpression to
21397 generate nicer code, as requested by Paolo.
21399 (ArrayCreation.CheckIndices): Use the patch from
21400 hwang_rob@yahoo.ca to validate the array initializers.
21402 2002-10-03 Miguel de Icaza <miguel@ximian.com>
21404 * class.cs (ConstructorInitializer.Emit): simplify code by using
21405 Invocation.EmitCall, and at the same time, fix the bugs in calling
21406 parent constructors that took variable arguments.
21408 * ecore.cs (Expression.ConvertNumericExplicit,
21409 Expression.ImplicitNumericConversion): Remove the code that
21410 manually wrapped decimal (InternalTypeConstructor call is now gone
21413 * expression.cs (Cast.TryReduce): Also handle decimal types when
21414 trying to perform a constant fold on the type.
21416 * typemanager.cs (IsUnmanagedtype): Partially implemented.
21418 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
21419 that only turned off an error report, and did nothing else.
21421 2002-10-02 Miguel de Icaza <miguel@ximian.com>
21423 * driver.cs: Handle and ignore /fullpaths
21425 2002-10-01 Miguel de Icaza <miguel@ximian.com>
21427 * expression.cs (Binary.ResolveOperator): Catch the case where
21428 DoNumericPromotions returns true,
21430 (Binary.DoNumericPromotions): Simplify the code, and the tests.
21432 2002-09-27 Miguel de Icaza <miguel@ximian.com>
21434 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
21437 2002-09-26 Miguel de Icaza <miguel@ximian.com>
21439 * ecore.cs (ConvertNumericExplicit): It is not enough that the
21440 conversion exists, but it is also required that the conversion be
21441 performed. This manifested in "(Type64Enum) 2".
21443 * class.cs (TypeManager.AddMethod): The fix is not to change
21444 AddEnum, because that one was using a fully qualified name (every
21445 DeclSpace derivative does), but to change the AddMethod routine
21446 that was using an un-namespaced name. This now correctly reports
21447 the duplicated name.
21449 Revert patch until I can properly fix it. The issue
21450 is that we have a shared Type space across all namespaces
21451 currently, which is wrong.
21453 Options include making the Namespace a DeclSpace, and merge
21454 current_namespace/current_container in the parser.
21456 2002-09-25 Miguel de Icaza <miguel@ximian.com>
21458 * cs-parser.jay: Improve error reporting when we get a different
21459 kind of expression in local_variable_type and
21460 local_variable_pointer_type.
21462 Propagate this to avoid missleading errors being reported.
21464 * ecore.cs (ImplicitReferenceConversion): treat
21465 TypeManager.value_type as a target just like object_type. As
21470 Is valid, and needs to result in the int 1 being boxed before it
21471 is assigned to the value type v.
21473 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
21474 to validate the enumeration name.
21476 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
21477 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
21478 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
21480 * ecore.cs (TryImplicitIntConversion): When doing an
21481 implicit-enumeration-conversion, check if the type is 64-bits and
21482 perform a conversion before passing to EnumConstant.
21484 2002-09-23 Miguel de Icaza <miguel@ximian.com>
21486 * decl.cs (Error_AmbiguousTypeReference); New routine used to
21487 report ambiguous type references. Unlike the MS version, we
21488 report what the ambiguity is. Innovation at work ;-)
21490 (DeclSpace.FindType): Require a location argument to
21491 display when we display an ambiguous error.
21493 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
21495 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
21497 * expression.cs (EmitDynamicInitializers): Apply patch from
21498 hwang_rob@yahoo.ca that fixes the order in which we emit our
21501 2002-09-21 Martin Baulig <martin@gnome.org>
21503 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
21504 delegate takes no arguments.
21506 2002-09-20 Miguel de Icaza <miguel@ximian.com>
21508 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
21511 * expression.cs: Extract the underlying type.
21513 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
21515 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
21517 2002-09-19 Miguel de Icaza <miguel@ximian.com>
21519 * class.cs (TypeContainer.DefineType): We can not use the nice
21520 PackingSize with the size set to 1 DefineType method, because it
21521 will not allow us to define the interfaces that the struct
21524 This completes the fixing of bug 27287
21526 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
21527 means also structs. This fixes part of the problem.
21528 (Expresion.ImplicitReferenceConversionExists): ditto.
21530 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
21531 error if there were no errors reported during the type lookup
21532 process, to avoid duplicates or redundant errors. Without this
21533 you would get an ambiguous errors plus a type not found. We have
21534 beaten the user enough with the first error.
21536 (DeclSparce.FindType): Emit a warning if we have an ambiguous
21539 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
21540 during the resolution process, stop the lookup, this avoids
21541 repeated error reports (same error twice).
21543 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
21545 * typemanager.cs (LookupType): Redo the type lookup code to match
21546 the needs of System.Reflection.
21548 The issue is that System.Reflection requires references to nested
21549 types to begin with a "+" sign instead of a dot. So toplevel
21550 types look like: "NameSpace.TopLevelClass", and nested ones look
21551 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
21554 2002-09-19 Martin Baulig <martin@gnome.org>
21556 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
21557 says that a method always returns or always throws an exception,
21558 don't report the CS0161.
21560 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
21561 set `Returns = new_returns'.
21563 2002-09-19 Martin Baulig <martin@gnome.org>
21565 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
21566 to an enum constant, check for a CS0176.
21568 2002-09-18 Miguel de Icaza <miguel@ximian.com>
21570 * class.cs (TypeContainer.CheckPairedOperators): Now we check
21571 for operators that must be in pairs and report errors.
21573 * ecore.cs (SimpleName.DoResolveType): During the initial type
21574 resolution process, when we define types recursively, we must
21575 check first for types in our current scope before we perform
21576 lookups in the enclosing scopes.
21578 * expression.cs (MakeByteBlob): Handle Decimal blobs.
21580 (Invocation.VerifyArgumentsCompat): Call
21581 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
21582 I thought we were supposed to always call this, but there are a
21583 few places in the code where we dont do it.
21585 2002-09-17 Miguel de Icaza <miguel@ximian.com>
21587 * driver.cs: Add support in -linkres and -resource to specify the
21588 name of the identifier.
21590 2002-09-16 Miguel de Icaza <miguel@ximian.com>
21592 * ecore.cs (StandardConversionExists): Sync with the conversion
21593 code: allow anything-* to void* conversions.
21595 (FindMostSpecificSource): Use an Expression argument
21596 instead of a Type, because we might be handed over a Literal which
21597 gets a few more implicit conversions that plain types do not. So
21598 this information was being lost.
21600 Also, we drop the temporary type-holder expression when not
21603 2002-09-17 Martin Baulig <martin@gnome.org>
21605 * class.cs (PropertyBase.CheckBase): Don't check the base class if
21606 this is an explicit interface implementation.
21608 2002-09-17 Martin Baulig <martin@gnome.org>
21610 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
21611 different `IndexerName' attributes.
21613 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
21614 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
21615 virtual CommonResolve().
21617 2002-09-16 Miguel de Icaza <miguel@ximian.com>
21619 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
21620 and convert that to the UnderlyingType.
21622 * statement.cs (Foreach.Resolve): Indexers are just like variables
21623 or PropertyAccesses.
21625 * cs-tokenizer.cs (consume_string): Track line numbers and columns
21626 inside quoted strings, we were not doing this before.
21628 2002-09-16 Martin Baulig <martin@gnome.org>
21630 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
21631 resolve it. This is needed for the definite assignment check of the
21632 instance expression, fixes bug #29846.
21633 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
21635 2002-09-16 Nick Drochak <ndrochak@gol.com>
21637 * parameter.cs: Fix compile error. Cannot reference static member
21638 from an instance object. Is this an mcs bug?
21640 2002-09-14 Martin Baulig <martin@gnome.org>
21642 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
21643 multiple times. Fixes bug #30295, added test-166.cs.
21645 2002-09-14 Martin Baulig <martin@gnome.org>
21647 * statement.cs (Block.Emit): Don't emit unreachable code.
21648 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
21649 `break' statements.
21650 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
21652 2002-09-14 Martin Baulig <martin@gnome.org>
21654 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
21657 2002-09-14 Martin Baulig <martin@gnome.org>
21659 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
21660 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
21661 be false on the ms runtime.
21663 2002-09-13 Martin Baulig <martin@gnome.org>
21665 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
21666 the CS0038 error message.
21668 2002-09-12 Miguel de Icaza <miguel@ximian.com>
21670 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
21671 constant inside, return it.
21673 2002-09-12 Martin Baulig <martin@gnome.org>
21675 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
21676 implicit conversion can be done between enum types.
21678 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
21679 check whether an implicit conversion to the current enum's UnderlyingType
21680 exists and report an error if not.
21682 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
21683 without debugging support.
21685 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
21686 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
21688 2002-09-12 Martin Baulig <martin@gnome.org>
21690 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
21692 * ecore.cs (IMemberExpr.DeclaringType): New property.
21693 (SimpleName.SimpleNameResolve): Check whether we're accessing a
21694 nonstatic member of an outer type (CS0038).
21696 2002-09-11 Miguel de Icaza <miguel@ximian.com>
21698 * driver.cs: Activate the using-error detector at warning level
21699 4 (at least for MS-compatible APIs).
21701 * namespace.cs (VerifyUsing): Small buglett fix.
21703 * pending.cs (PendingImplementation): pass the container pointer.
21705 * interface.cs (GetMethods): Allow for recursive definition. Long
21706 term, I would like to move every type to support recursive
21707 definitions, not the current ordering mechanism that we have right
21710 The situation is this: Attributes are handled before interfaces,
21711 so we can apply attributes to interfaces. But some attributes
21712 implement interfaces, we will now handle the simple cases
21713 (recursive definitions will just get an error).
21715 * parameter.cs: Only invalidate types at the end if we fail to
21718 2002-09-09 Martin Baulig <martin@gnome.org>
21720 * ecore.cs (PropertyExpr.Emit): Also check for
21721 TypeManager.system_int_array_get_length so this'll also work when
21722 compiling corlib. Fixes #30003.
21724 2002-09-09 Martin Baulig <martin@gnome.org>
21726 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
21727 and throw an exception if we can't get the type's size. Fixed #30040,
21730 2002-09-09 Martin Baulig <martin@gnome.org>
21732 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
21734 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
21735 context. Fixes bug #30027.
21737 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
21738 virtual functions. Fixes bug #30043, added test-164.cs.
21740 2002-09-08 Ravi Pratap <ravi@ximian.com>
21742 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
21744 2002-09-08 Nick Drochak <ndrochak@gol.com>
21746 * driver.cs: Use an object to get the windows codepage since it's not a
21749 2002-09-08 Miguel de Icaza <miguel@ximian.com>
21751 * statement.cs (For.Emit): for infinite loops (test == null)
21752 return whether there is a break inside, not always "true".
21754 * namespace.cs (UsingEntry): New struct to hold the name of the
21755 using definition, the location where it is defined, and whether it
21756 has been used in a successful type lookup.
21758 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
21763 2002-09-06 Ravi Pratap <ravi@ximian.com>
21765 * attribute.cs : Fix incorrect code which relied on catching
21766 a NullReferenceException to detect a null being passed in
21767 where an object was expected.
21769 2002-09-06 Miguel de Icaza <miguel@ximian.com>
21771 * statement.cs (Try): flag the catch variable as assigned
21773 * expression.cs (Cast): Simplified by using ResolveType instead of
21774 manually resolving.
21776 * statement.cs (Catch): Fix bug by using ResolveType.
21778 2002-09-06 Ravi Pratap <ravi@ximian.com>
21780 * expression.cs (BetterConversion): Special case for when we have
21781 a NullLiteral as the argument and we have to choose between string
21782 and object types - we choose string the way csc does.
21784 * attribute.cs (Attribute.Resolve): Catch the
21785 NullReferenceException and report error #182 since the Mono
21786 runtime no more has the bug and having this exception raised means
21787 we tried to select a constructor which takes an object and is
21790 2002-09-05 Ravi Pratap <ravi@ximian.com>
21792 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
21793 message (1502, 1503) when we can't locate a method after overload
21794 resolution. This is much more informative and closes the bug
21797 * interface.cs (PopulateMethod): Return if there are no argument
21798 types. Fixes a NullReferenceException bug.
21800 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
21801 expressions too. Previously we were checking only in one place for
21802 positional arguments leaving out named arguments.
21804 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
21805 type to the enum type is not allowed. Remove code corresponding to
21808 (ConvertNumericExplicit): Allow explicit conversions from
21809 the underlying type to enum type. This precisely follows the spec
21810 and closes a bug filed by Gonzalo.
21812 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21815 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
21817 2002-09-03 Miguel de Icaza <miguel@ximian.com>
21819 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
21820 it was important that we stored the right value after the
21821 reduction in `converted'.
21823 2002-09-04 Martin Baulig <martin@gnome.org>
21825 * location.cs (Location.SymbolDocument): Use full pathnames for the
21828 2002-08-30 Miguel de Icaza <miguel@ximian.com>
21830 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
21831 of the expression resolve mechanism, because that will catch the
21832 SimpleName error failures.
21834 (Conditional): If we can not resolve the
21835 expression, return, do not crash.
21837 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21840 (location): display token name instead of its number.
21842 2002-08-28 Martin Baulig <martin@gnome.org>
21844 * expression.cs (Binary.ResolveOperator): Don't silently return
21845 but return an error if an operator cannot be applied between two
21848 2002-08-28 Martin Baulig <martin@gnome.org>
21850 * class.cs (Constructor.Define): Set the permission attributes
21851 correctly instead of making all constructors public.
21853 2002-08-28 Martin Baulig <martin@gnome.org>
21855 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
21856 for private members before reporting a CS0103; if we find anything,
21859 2002-08-28 Martin Baulig <martin@gnome.org>
21861 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
21862 to check whether `closure_start_type == closure_invocation_type',
21863 we also need to check whether `m.DeclaringType == closure_invocation_type'
21864 before bypassing the permission checks. We might be accessing
21865 protected/private members from the base class.
21866 (TypeManager.RealMemberLookup): Only set private_ok if private
21867 members were requested via BindingFlags.NonPublic.
21869 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
21871 * expression.cs (MemberAccess.ResolveMemberAccess): Set
21872 MethodGroupExpr.IsExplicitImpl if appropriate.
21873 (Invocation.DoResolve): Don't report the CS0120 for explicit
21874 interface implementations.
21876 2002-08-27 Martin Baulig <martin@gnome.org>
21878 * expression.cs (Invocation.DoResolve): If this is a static
21879 method and we don't have an InstanceExpression, we must report
21882 2002-08-25 Martin Baulig <martin@gnome.org>
21884 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
21885 `==' between a valuetype and an object.
21887 2002-08-25 Miguel de Icaza <miguel@ximian.com>
21889 * ecore.cs (TypeExpr): Provide a ToString method.
21891 2002-08-24 Martin Baulig <martin@gnome.org>
21893 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
21894 now called proggie.dbg and it's a binary file.
21896 2002-08-23 Martin Baulig <martin@gnome.org>
21898 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
21900 2002-08-23 Martin Baulig <martin@gnome.org>
21902 * struct.cs (MyStructInfo.ctor): Make this work with empty
21903 structs; it's not allowed to use foreach() on null.
21905 2002-08-23 Martin Baulig <martin@gnome.org>
21907 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
21908 writer the full pathname of the generated assembly.
21910 2002-08-23 Martin Baulig <martin@gnome.org>
21912 * statements.cs (FlowBranching.UsageVector.MergeChildren):
21913 A `finally' block never returns or breaks; improved handling of
21916 2002-08-23 Martin Baulig <martin@gnome.org>
21918 * statement.cs (Throw.Resolve): Allow `throw null'.
21920 2002-08-23 Martin Baulig <martin@gnome.org>
21922 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
21923 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
21924 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
21925 MemberLookup would return a wrong event if this is an explicit
21926 interface implementation and the class has an event with the same
21929 2002-08-23 Martin Baulig <martin@gnome.org>
21931 * statement.cs (Block.AddChildVariableNames): New public method.
21932 (Block.AddChildVariableName): Likewise.
21933 (Block.IsVariableNameUsedInChildBlock): Likewise.
21934 (Block.AddVariable): Check whether a variable name has already
21935 been used in a child block.
21937 * cs-parser.jay (declare_local_variables): Mark all variable names
21938 from the current block as being used in a child block in the
21941 2002-08-23 Martin Baulig <martin@gnome.org>
21943 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
21944 find the symbol writer.
21946 * driver.cs: csc also allows the arguments to /define being
21947 separated by commas, not only by semicolons.
21949 2002-08-23 Martin Baulig <martin@gnome.org>
21951 * interface.cs (Interface.GetMembers): Added static check for events.
21953 2002-08-15 Martin Baulig <martin@gnome.org>
21955 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
21956 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
21958 * ecore.cs (Expression.MemberLookup): Added documentation and explained
21959 why the MethodData.EmitDestructor() change was necessary.
21961 2002-08-20 Martin Baulig <martin@gnome.org>
21963 * class.cs (TypeContainer.FindMembers): Added static check for events.
21965 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
21967 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
21968 use Type.GetEvents(), not Type.FindMembers().
21970 2002-08-20 Martin Baulig <martin@gnome.org>
21972 * decl.cs (MemberCache): Added a special method cache which will
21973 be used for method-only searched. This ensures that a method
21974 search will return a MethodInfo with the correct ReflectedType for
21977 2002-08-20 Martin Baulig <martin@gnome.org>
21979 * decl.cs (DeclSpace.FindMembers): Made this public.
21981 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21983 * delegate.cs: fixed build on windows.
21984 [FIXME: Filed as bug #29150: MCS must report these errors.]
21986 2002-08-19 Ravi Pratap <ravi@ximian.com>
21988 * ecore.cs (StandardConversionExists): Return a false
21989 if we are trying to convert the void type to anything else
21990 since that is not allowed.
21992 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
21993 we flag error 70 in the event an event is trying to be accessed
21994 directly from outside the declaring type.
21996 2002-08-20 Martin Baulig <martin@gnome.org>
21998 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
21999 MemberCache from typemanager.cs to decl.cs.
22001 2002-08-19 Martin Baulig <martin@gnome.org>
22003 * class.cs (TypeContainer): Implement IMemberContainer.
22004 (TypeContainer.DefineMembers): Create the MemberCache.
22005 (TypeContainer.FindMembers): Do better BindingFlags checking; only
22006 return public members if BindingFlags.Public was given, check
22007 whether members are static.
22009 2002-08-16 Martin Baulig <martin@gnome.org>
22011 * decl.cs (DeclSpace.Define): Splitted this in Define and
22012 DefineMembers. DefineMembers is called first and initializes the
22015 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
22016 DefineMembers() on all our DeclSpaces.
22018 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22019 but call DefineMembers() on all nested interfaces. We call their
22020 Define() in our new Define() function.
22022 * interface.cs (Interface): Implement IMemberContainer.
22023 (Interface.Define): Moved all code except the attribute stuf to
22025 (Interface.DefineMembers): Initialize the member cache.
22027 * typemanager.cs (IMemberFinder): Removed this interface, we don't
22028 need this anymore since we can use MemberCache.FindMembers directly.
22030 2002-08-19 Martin Baulig <martin@gnome.org>
22032 * typemanager.cs (MemberCache): When creating the cache for an
22033 interface type, add all inherited members.
22034 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22035 to `out bool used_cache' and documented it.
22036 (TypeManager.MemberLookup): If we already used the cache in the first
22037 iteration, we don't need to do the interfaces check.
22039 2002-08-19 Martin Baulig <martin@gnome.org>
22041 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
22042 here from IMemberFinder and don't implement this interface anymore.
22043 (DeclSpace.MemberCache): Moved here from IMemberFinder.
22045 * typemanager.cs (IMemberFinder): This interface is now only used by
22046 classes which actually support the member cache.
22047 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22048 since we only put DeclSpaces into this Hashtable.
22049 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22050 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22052 2002-08-16 Martin Baulig <martin@gnome.org>
22054 * typemanager.cs (ICachingMemberFinder): Removed.
22055 (IMemberFinder.MemberCache): New property.
22056 (TypeManager.FindMembers): Merged this with RealFindMembers().
22057 This function will never be called from TypeManager.MemberLookup()
22058 so we can't use the cache here, just the IMemberFinder.
22059 (TypeManager.MemberLookup_FindMembers): Check whether the
22060 IMemberFinder has a MemberCache and call the cache's FindMembers
22062 (MemberCache): Rewrote larger parts of this yet another time and
22063 cleaned it up a bit.
22065 2002-08-15 Miguel de Icaza <miguel@ximian.com>
22067 * driver.cs (LoadArgs): Support quoting.
22069 (Usage): Show the CSC-like command line arguments.
22071 Improved a few error messages.
22073 2002-08-15 Martin Baulig <martin@gnome.org>
22075 * typemanager.cs (IMemberContainer.Type): New property.
22076 (IMemberContainer.IsInterface): New property.
22078 The following changes are conditional to BROKEN_RUNTIME, which is
22079 defined at the top of the file.
22081 * typemanager.cs (MemberCache.MemberCache): Don't add the base
22082 class'es members, but add all members from TypeHandle.ObjectType
22083 if we're an interface.
22084 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22085 is the current type.
22086 (MemberCache.CacheEntry.Container): Removed this field.
22087 (TypeHandle.GetMembers): Include inherited members.
22089 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22091 * typemanager.cs: fixed compilation and added a comment on a field that
22094 2002-08-15 Martin Baulig <martin@gnome.org>
22096 * class.cs (ConstructorInitializer.Resolve): In the
22097 Expression.MemberLookup call, use the queried_type as
22100 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22101 declared' attribute, it's always true.
22102 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22103 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22104 temporary wrapper for FindMembers which tells MemberLookup whether
22105 members from the base classes are included in the return value.
22106 This will go away soon.
22107 (TypeManager.MemberLookup): Use this temporary hack here; once the
22108 new MemberCache is completed, we don't need to do the DeclaredOnly
22109 looping here anymore since the MemberCache will take care of this.
22110 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22111 (MemberCache): When creating the MemberCache for a class, get
22112 members from the current class and all its base classes.
22113 (MemberCache.CacheEntry.Container): New field. This is a
22114 temporary hack until the Mono runtime is fixed to distinguish
22115 between ReflectedType and DeclaringType. It allows us to use MCS
22116 with both the MS runtime and the unfixed Mono runtime without
22117 problems and without accecting performance.
22118 (MemberCache.SearchMembers): The DeclaredOnly looping from
22119 TypeManager.MemberLookup is now done here.
22121 2002-08-14 Martin Baulig <martin@gnome.org>
22123 * statement.cs (MyStructInfo.MyStructInfo): Don't call
22124 Type.GetFields on dynamic types but get the fields from the
22125 corresponding TypeContainer.
22126 (MyStructInfo.GetStructInfo): Added check for enum types.
22128 * typemanager.cs (MemberList.IsSynchronized): Implemented.
22129 (MemberList.SyncRoot): Implemented.
22130 (TypeManager.FilterWithClosure): No need to check permissions if
22131 closure_start_type == closure_invocation_type, don't crash if
22132 closure_invocation_type is null.
22134 2002-08-13 Martin Baulig <martin@gnome.org>
22136 Rewrote TypeContainer.FindMembers to use a member cache. This
22137 gives us a speed increase of about 35% for the self-hosting MCS
22138 build and of about 15-20% for the class libs (both on GNU/Linux).
22140 * report.cs (Timer): New class to get enhanced profiling. This
22141 whole class is "TIMER" conditional since it remarkably slows down
22144 * class.cs (MemberList): New class. This is an IList wrapper
22145 which we're now using instead of passing MemberInfo[]'s around to
22146 avoid copying this array unnecessarily.
22147 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22148 (ICachingMemberFinder, IMemberContainer): New interface.
22149 (TypeManager.FilterWithClosure): If `criteria' is null, the name
22150 has already been checked, otherwise use it for the name comparision.
22151 (TypeManager.FindMembers): Renamed to RealMemberFinder and
22152 provided wrapper which tries to use ICachingMemberFinder.FindMembers
22153 if possible. Returns a MemberList, not a MemberInfo [].
22154 (TypeHandle): New class, implements IMemberContainer. We create
22155 one instance of this class per type, it contains a MemberCache
22156 which is used to do the member lookups.
22157 (MemberCache): New class. Each instance of this class contains
22158 all members of a type and a name-based hash table.
22159 (MemberCache.FindMembers): This is our new member lookup
22160 function. First, it looks up all members of the requested name in
22161 the hash table. Then, it walks this list and sorts out all
22162 applicable members and returns them.
22164 2002-08-13 Martin Baulig <martin@gnome.org>
22166 In addition to a nice code cleanup, this gives us a performance
22167 increase of about 1.4% on GNU/Linux - not much, but it's already
22168 half a second for the self-hosting MCS compilation.
22170 * typemanager.cs (IMemberFinder): New interface. It is used by
22171 TypeManager.FindMembers to call FindMembers on a TypeContainer,
22172 Enum, Delegate or Interface.
22173 (TypeManager.finder_to_member_finder): New PtrHashtable.
22174 (TypeManager.finder_to_container): Removed.
22175 (TypeManager.finder_to_delegate): Removed.
22176 (TypeManager.finder_to_interface): Removed.
22177 (TypeManager.finder_to_enum): Removed.
22179 * interface.cs (Interface): Implement IMemberFinder.
22181 * delegate.cs (Delegate): Implement IMemberFinder.
22183 * enum.cs (Enum): Implement IMemberFinder.
22185 * class.cs (TypeContainer): Implement IMemberFinder.
22187 2002-08-12 Martin Baulig <martin@gnome.org>
22189 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22191 2002-08-12 Martin Baulig <martin@gnome.org>
22193 * ecore.cs (ITypeExpression): New interface for expressions which
22195 (TypeExpression): Renamed to TypeLookupExpression.
22196 (Expression.DoResolve): If we're doing a types-only lookup, the
22197 expression must implement the ITypeExpression interface and we
22198 call DoResolveType() on it.
22199 (SimpleName): Implement the new ITypeExpression interface.
22200 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22201 hack, the situation that we're only looking up types can't happen
22202 anymore when this method is called. Moved the type lookup code to
22203 DoResolveType() and call it.
22204 (SimpleName.DoResolveType): This ITypeExpression interface method
22205 is now doing the types-only lookup.
22206 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22207 (ResolveFlags): Added MaskExprClass.
22209 * expression.cs (MemberAccess): Implement the ITypeExpression
22211 (MemberAccess.DoResolve): Added support for a types-only lookup
22212 when we're called via ITypeExpression.DoResolveType().
22213 (ComposedCast): Implement the ITypeExpression interface.
22215 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
22216 Expression.Resolve() with ResolveFlags.Type instead.
22218 2002-08-12 Martin Baulig <martin@gnome.org>
22220 * interface.cs (Interface.Define): Apply attributes.
22222 * attribute.cs (Attribute.ApplyAttributes): Added support for
22223 interface attributes.
22225 2002-08-11 Martin Baulig <martin@gnome.org>
22227 * statement.cs (Block.Emit): Only check the "this" variable if we
22228 do not always throw an exception.
22230 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22231 whether the property has a set accessor.
22233 2002-08-11 Martin Baulig <martin@gnome.org>
22235 Added control flow analysis support for structs.
22237 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22238 with control flow analysis turned off.
22239 (IVariable): New interface.
22240 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22241 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22242 (FieldExpr.DoResolve): Resolve the instance expression with flow
22243 analysis turned off and do the definite assignment check after the
22244 resolving when we know what the expression will resolve to.
22246 * expression.cs (LocalVariableReference, ParameterReference):
22247 Implement the new IVariable interface, only call the flow analysis
22248 code if ec.DoFlowAnalysis is true.
22249 (This): Added constructor which takes a Block argument. Implement
22250 the new IVariable interface.
22251 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22252 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22253 This does the definite assignment checks for struct members.
22255 * class.cs (Constructor.Emit): If this is a non-static `struct'
22256 constructor which doesn't have any initializer, call
22257 Block.AddThisVariable() to tell the flow analysis code that all
22258 struct elements must be initialized before control returns from
22261 * statement.cs (MyStructInfo): New public class.
22262 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22263 argument to this indexer. If non-zero, check an individual struct
22264 member, not the whole struct.
22265 (FlowBranching.CheckOutParameters): Check struct members.
22266 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22267 overloaded versions of these methods which take an additional
22268 `int field_idx' argument to check struct members.
22269 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22270 overloaded versions of these methods which take an additional
22271 `string field_name' argument to check struct member.s
22272 (VariableInfo): Implement the IVariable interface.
22273 (VariableInfo.StructInfo): New public property. Returns the
22274 MyStructInfo instance of the variable if it's a struct or null.
22275 (Block.AddThisVariable): New public method. This is called from
22276 Constructor.Emit() for non-static `struct' constructor which do
22277 not have any initializer. It creates a special variable for the
22278 "this" instance variable which will be checked by the flow
22279 analysis code to ensure that all of the struct's fields are
22280 initialized before control returns from the constructor.
22281 (UsageVector): Added support for struct members. If a
22282 variable/parameter is a struct with N members, we reserve a slot
22283 in the usage vector for each member. A struct is considered fully
22284 initialized if either the struct itself (slot 0) or all its
22285 members are initialized.
22287 2002-08-08 Martin Baulig <martin@gnome.org>
22289 * driver.cs (Driver.MainDriver): Only report an error CS5001
22290 if there were no compilation errors.
22292 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22293 `UnsafeContext' property to determine whether the parent is in
22294 unsafe context rather than checking the parent's ModFlags:
22295 classes nested in an unsafe class are unsafe as well.
22297 2002-08-08 Martin Baulig <martin@gnome.org>
22299 * statement.cs (UsageVector.MergeChildren): Distinguish between
22300 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22301 we return. Added test17() and test18() to test-154.cs.
22303 2002-08-08 Martin Baulig <martin@gnome.org>
22305 * typemanager.cs (TypeManager.FilterWithClosure): If we have
22306 Family access, make sure the invoking type isn't a subclass of the
22307 queried type (that'd be a CS1540).
22309 * ecore.cs (Expression.MemberLookup): Added overloaded version of
22310 this method which takes an additional `Type invocation_type'.
22312 * expression.cs (BaseAccess.DoResolve): Use the base type as
22313 invocation and query type.
22314 (MemberAccess.DoResolve): If the lookup failed and we're about to
22315 report a CS0122, try a lookup with the ec.ContainerType - if this
22316 succeeds, we must report a CS1540.
22318 2002-08-08 Martin Baulig <martin@gnome.org>
22320 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22321 (MethodGroupExpr): Implement the IMemberExpr interface.
22323 * expression (MemberAccess.ResolveMemberAccess): No need to have
22324 any special code for MethodGroupExprs anymore, they're now
22327 2002-08-08 Martin Baulig <martin@gnome.org>
22329 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
22330 Family, FamANDAssem and FamORAssem permissions.
22331 (TypeManager.IsSubclassOrNestedChildOf): New public method.
22333 2002-08-08 Martin Baulig <martin@gnome.org>
22335 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
22336 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
22339 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
22341 * driver.cs: implemented /resource option to embed managed resources.
22343 2002-08-07 Martin Baulig <martin@gnome.org>
22345 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
22346 (FieldBase.HasFieldInitializer): New public property.
22347 (FieldBase.GetInitializerExpression): New public method. Resolves and
22348 returns the field initializer and makes sure it is only resolved once.
22349 (TypeContainer.EmitFieldInitializers): Call
22350 FieldBase.GetInitializerExpression to get the initializer, this ensures
22351 that it isn't resolved multiple times.
22353 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
22354 the resolving process (SimpleName/MemberLookup) that we're currently
22355 emitting a field initializer (which must not access any instance members,
22356 this is an error CS0236).
22358 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
22359 argument, if the `IsFieldInitializer' flag is set, we must report and
22360 error CS0236 and not an error CS0120.
22362 2002-08-07 Martin Baulig <martin@gnome.org>
22364 * ecore.cs (IMemberExpr): New public interface.
22365 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
22366 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
22367 if the expression is an IMemberExpr.
22369 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
22370 to be null, implicitly default to `this' if we're non-static in
22371 this case. Simplified the code a lot by using the new IMemberExpr
22372 interface. Also fixed bug #28176 here.
22374 2002-08-06 Martin Baulig <martin@gnome.org>
22376 * cs-parser.jay (SimpleLookup): Removed. We need to create
22377 ParameterReferences during semantic analysis so that we can do a
22378 type-only search when resolving Cast, TypeOf and SizeOf.
22379 (block): Pass the `current_local_parameters' to the Block's
22382 * class.cs (ConstructorInitializer): Added `Parameters parameters'
22383 argument to the constructor.
22384 (ConstructorInitializer.Resolve): Create a temporary implicit
22385 block with the parameters.
22387 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
22388 references here if we aren't doing a type-only search.
22390 * statement.cs (Block): Added constructor which takes a
22391 `Parameters parameters' argument.
22392 (Block.Parameters): New public property.
22394 * support.cs (InternalParameters.Parameters): Renamed `parameters'
22395 to `Parameters' and made it public readonly.
22397 2002-08-06 Martin Baulig <martin@gnome.org>
22399 * ecore.cs (Expression.Warning): Made this public as well.
22401 * report.cs (Report.Debug): Print the contents of collections.
22403 2002-08-06 Martin Baulig <martin@gnome.org>
22405 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
22406 used to tell Resolve() which kinds of expressions it may return.
22407 (Expression.Resolve): Added overloaded version of this method which
22408 takes a `ResolveFlags flags' argument. This can be used to tell
22409 Resolve() which kinds of expressions it may return. Reports a
22411 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
22412 ResolveFlags.SimpleName.
22413 (Expression.Error118): Added overloaded version of this method which
22414 takes a `ResolveFlags flags' argument. It uses the flags to determine
22415 which kinds of expressions are allowed.
22417 * expression.cs (Argument.ResolveMethodGroup): New public method.
22418 Resolves an argument, but allows a MethodGroup to be returned.
22419 This is used when invoking a delegate.
22421 * TODO: Updated a bit.
22423 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22425 Fixed compilation with csc.
22427 * ecore.cs: Expression.Error made public. Is this correct? Should
22428 Warning be made public too?
22430 * expression.cs: use ea.Location instead of ea.loc.
22431 [FIXME: Filed as bug #28607: MCS must report these errors.]
22433 2002-08-06 Martin Baulig <martin@gnome.org>
22435 * ecore.cs (Expression.loc): Moved the location here instead of
22436 duplicating it in all derived classes.
22437 (Expression.Location): New public property.
22438 (Expression.Error, Expression.Warning): Made them non-static and
22439 removed the location argument.
22440 (Expression.Warning): Added overloaded version which takes an
22441 `int level' argument.
22442 (Expression.Error118): Make this non-static and removed the
22443 expression and location arguments.
22444 (TypeExpr): Added location argument to the constructor.
22446 * expression.cs (StaticCallExpr): Added location argument to
22448 (Indirection, PointerArithmetic): Likewise.
22449 (CheckedExpr, UnCheckedExpr): Likewise.
22450 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
22451 (StringPtr): Likewise.
22454 2002-08-05 Martin Baulig <martin@gnome.org>
22456 * expression.cs (BaseAccess.DoResolve): Actually report errors.
22458 * assign.cs (Assign.DoResolve): Check whether the source
22459 expression is a value or variable.
22461 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
22462 while resolving the corresponding blocks.
22464 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
22465 an error, don't silently return null.
22467 * statement.cs (Block.AddVariable): Do the error reporting here
22468 and distinguish between CS0128 and CS0136.
22469 (Block.DoResolve): Report all unused labels (warning CS0164).
22470 (LabeledStatement): Pass the location to the constructor.
22471 (LabeledStatement.HasBeenReferenced): New property.
22472 (LabeledStatement.Resolve): Set it to true here.
22474 * statement.cs (Return.Emit): Return success even after reporting
22475 a type mismatch error (CS0126 or CS0127), this is what csc does and
22476 it avoids confusing the users with any consecutive errors.
22478 2002-08-05 Martin Baulig <martin@gnome.org>
22480 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
22482 * const.cs (Const.LookupConstantValue): Catch circular definitions.
22484 * expression.cs (MemberAccess.DoResolve): Silently return if an
22485 error has already been reported.
22487 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
22488 error has already been reported.
22490 2002-08-05 Martin Baulig <martin@gnome.org>
22492 * statement.cs (UsageVector): Only initialize the `parameters'
22493 vector if we actually have any "out" parameters.
22495 2002-08-05 Martin Baulig <martin@gnome.org>
22497 * expression.cs (Binary.ResolveOperator): When combining delegates,
22498 they must have the same type.
22500 2002-08-05 Martin Baulig <martin@gnome.org>
22502 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
22503 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
22504 work with the ms runtime and we also don't need it: if we're a
22505 PropertyBuilder and not in the `indexer_arguments' hash, then we
22506 are a property and not an indexer.
22508 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
22509 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
22510 since the latter one doesn't work with the ms runtime.
22512 2002-08-03 Martin Baulig <martin@gnome.org>
22514 Fixed bugs #27998 and #22735.
22516 * class.cs (Method.IsOperator): New public field.
22517 (Method.CheckBase): Report CS0111 if there's already a method
22518 with the same parameters in the current class. Report CS0508 when
22519 attempting to change the return type of an inherited method.
22520 (MethodData.Emit): Report CS0179 if a method doesn't have a body
22521 and it's not marked abstract or extern.
22522 (PropertyBase): New abstract base class for Property and Indexer.
22523 (PropertyBase.CheckBase): Moved here from Property and made it work
22525 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
22526 the same so we can reuse it there.
22527 (Property, Indexer): Derive from PropertyBase.
22528 (MethodSignature.inheritable_property_signature_filter): New delegate
22529 to find properties and indexers.
22531 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
22532 argument and improved error reporting.
22534 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
22535 EmptyReadOnlyParameters and made it a property.
22537 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
22538 version of this method which takes a `PropertyInfo indexer'.
22539 (TypeManager.RegisterIndexer): New method.
22541 * class.cs: Added myself as author of this file :-)
22543 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22545 * class.cs: fixed compilation on windoze.
22547 2002-08-03 Martin Baulig <martin@gnome.org>
22549 * interface.cs (Interface.GetInterfaceBases): Check whether all
22550 base interfaces are at least as accessible than the current one.
22552 * class.cs (TypeContainer.GetClassBases): Check whether base types
22553 are at least as accessible than the current type.
22554 (TypeContainer.AsAccessible): Implemented and made non-static.
22555 (MemberBase.CheckParameters): Report errors if the accessibility
22558 * delegate.cs (Delegate.Delegate): The default visibility is
22559 internal for top-level types and private for nested types.
22560 (Delegate.Define): Report errors if the accessibility checks fail.
22562 * enum.cs (Enum.Enum): The default visibility is internal for
22563 top-level types and private for nested types.
22564 (Enum.DefineType): Compute the correct visibility.
22566 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
22567 function which takes a `bool is_toplevel' instead of a TypeContainer.
22569 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
22572 2002-08-02 Martin Baulig <martin@gnome.org>
22574 * expression.cs (LocalVariableReferenc): Added constructor which
22575 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
22576 (LocalVariableReference.IsReadOnly): New property.
22577 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
22578 variable is readonly, use our own readonly flag to do this; you can
22579 use the new constructor to get a writable reference to a read-only
22582 * cs-parser.jay (foreach_statement, using_statement): Get a writable
22583 reference to the local variable.
22585 2002-08-01 Miguel de Icaza <miguel@ximian.com>
22587 * rootcontext.cs (ResolveCore): Also include System.Exception
22589 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
22590 we reach an EmptyStatement.
22592 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
22595 * expression.cs (Binary.ResolveOperator): Check error result in
22598 use brtrue/brfalse directly and avoid compares to null.
22600 2002-08-02 Martin Baulig <martin@gnome.org>
22602 * class.cs (TypeContainer.Define): Define all nested interfaces here.
22603 Fixes bug #28407, added test-155.cs.
22605 2002-08-01 Martin Baulig <martin@gnome.org>
22607 * class.cs (Event.EmitDefaultMethod): Make this work with static
22608 events. Fixes #28311, added verify-3.cs.
22610 2002-08-01 Martin Baulig <martin@gnome.org>
22612 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
22613 `is_disposable' fields.
22614 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
22615 `hm.is_disposable' if we're using the collection pattern.
22616 (Foreach.EmitCollectionForeach): Use the correct type for the
22617 enumerator's local variable, only emit the try/finally block if
22618 necessary (fixes #27713).
22620 2002-08-01 Martin Baulig <martin@gnome.org>
22622 * ecore.cs (Expression.report118): Renamed to Error118 and made
22625 * statement.cs (Throw.Resolve): Check whether the expression is of
22626 the correct type (CS0118) and whether the type derives from
22627 System.Exception (CS0155).
22628 (Catch.Resolve): New method. Do the type lookup here and check
22629 whether it derives from System.Exception (CS0155).
22630 (Catch.CatchType, Catch.IsGeneral): New public properties.
22632 * typemanager.cs (TypeManager.exception_type): Added.
22634 2002-07-31 Miguel de Icaza <miguel@ximian.com>
22636 * driver.cs: Updated About function.
22638 2002-07-31 Martin Baulig <martin@gnome.org>
22640 Implemented Control Flow Analysis.
22642 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
22643 (EmitContext.CurrentBranching): Added.
22644 (EmitContext.StartFlowBranching): Added.
22645 (EmitContext.EndFlowBranching): Added.
22646 (EmitContext.KillFlowBranching): Added.
22647 (EmitContext.IsVariableAssigned): Added.
22648 (EmitContext.SetVariableAssigned): Added.
22649 (EmitContext.IsParameterAssigned): Added.
22650 (EmitContext.SetParameterAssigned): Added.
22651 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
22652 Added control flow analysis stuff here.
22654 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
22655 resolve the expression as lvalue.
22656 (LocalVariableReference.DoResolve): Check whether the variable has
22657 already been assigned.
22658 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
22659 the parameter as assigned here.
22660 (ParameterReference.DoResolve): Check whether the parameter has already
22662 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
22663 expression as lvalue.
22665 * statement.cs (FlowBranching): New class for the flow analysis code.
22666 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
22667 (LabeledStatement.IsDefined): New public property.
22668 (LabeledStatement.AddUsageVector): New public method to tell flow
22669 analyis that the label may be reached via a forward jump.
22670 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
22672 (VariableInfo.Number): New public field. This is used by flow analysis
22673 to number all locals of a block.
22674 (Block.CountVariables): New public property. This is the number of
22675 local variables in this block (including the locals from all parent
22677 (Block.EmitMeta): Number all the variables.
22679 * statement.cs: Added flow analysis support to all classes.
22681 2002-07-31 Martin Baulig <martin@gnome.org>
22683 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
22684 To get debugging messages, compile mcs with /define:MCS_DEBUG and
22685 then use this argument.
22687 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
22689 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
22690 use this to specify /define options.
22692 2002-07-29 Martin Baulig <martin@gnome.org>
22694 * statement.cs (Fixed): Moved all code that does variable lookups
22695 and resolvings from Emit to Resolve.
22697 * statement.cs (For): Moved all code that does variable lookups
22698 and resolvings from Emit to Resolve.
22700 * statement.cs (Using): Moved all code that does variable lookups
22701 and resolvings from Emit to Resolve.
22703 2002-07-29 Martin Baulig <martin@gnome.org>
22705 * attribute.cs (Attribute.Resolve): Explicitly catch a
22706 System.NullReferenceException when creating the
22707 CustromAttributeBuilder and report a different warning message.
22709 2002-07-29 Martin Baulig <martin@gnome.org>
22711 * support.cs (ParameterData.ParameterName): Added method to
22712 get the name of a parameter.
22714 * typemanager.cs (TypeManager.IsValueType): New public method.
22716 2002-07-29 Martin Baulig <martin@gnome.org>
22718 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
22719 is a flag which specifies that it's either ref or out.
22720 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
22721 the out parameter to `out Parameter.Modifier mod', also set the
22722 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
22724 * support.cs (InternalParameters.ParameterModifier): Distinguish
22725 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
22726 Parameter.Modifier.ISBYREF flag if it's either ref or out.
22728 * expression.cs (Argument.GetParameterModifier): Distinguish
22729 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
22730 Parameter.Modifier.ISBYREF flag if it's either ref or out.
22732 2002-07-29 Martin Baulig <martin@gnome.org>
22734 * expression.cs (ParameterReference.ParameterReference): Added
22735 `Location loc' argument to the constructor.
22737 * cs-parser.jay: Pass location to ParameterReference.
22739 2002-07-28 Miguel de Icaza <miguel@ximian.com>
22741 * statement.cs (Try): Initialize the location.
22743 * cs-parser.jay: pass location to Try.
22745 * expression.cs (Unary.Reduce): Change the prototype to return
22746 whether a constant fold could be performed or not. The result is
22747 returned in an out parameters. In the case of Indirection and
22748 AddressOf, we want to perform the full tests.
22750 2002-07-26 Miguel de Icaza <miguel@ximian.com>
22752 * statement.cs (Statement.Emit): Flag dead code.
22754 2002-07-27 Andrew Birkett <andy@nobugs.org>
22756 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
22758 2002-07-27 Martin Baulig <martin@gnome.org>
22760 * class.cs (MethodData.Define): Put back call to
22761 TypeManager.AddMethod(), accidentally commented this out.
22763 * report.cs (Debug): New public method to print debugging information,
22764 this is `[Conditional ("DEBUG")]'.
22766 2002-07-26 Martin Baulig <martin@gnome.org>
22768 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
22769 (switch_statement): Push the current_block to the switch_stack and
22770 pop it again when we're done with the switch.
22771 (switch_section): The new block is a child of the current_block.
22772 Fixes bug #24007, added test-152.cs.
22774 2002-07-27 Martin Baulig <martin@gnome.org>
22776 * expression.cs (Invocation.EmitArguments): When calling a varargs
22777 function with only its fixed arguments, we need to pass an empty
22780 2002-07-27 Martin Baulig <martin@gnome.org>
22782 Mono 0.13 has been released.
22784 2002-07-25 Miguel de Icaza <miguel@ximian.com>
22786 * driver.cs: Rename --resource to --linkres, because that is what
22787 we do currently, we dont support --resource yet.
22789 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
22791 2002-07-25 Martin Baulig <martin@gnome.org>
22793 * class.cs (MethodData): New public class. This is a `method builder'
22794 class for a method or one accessor of a Property/Indexer/Event.
22795 (MethodData.GetMethodFlags): Moved here from MemberBase.
22796 (MethodData.ApplyAttributes): Likewise.
22797 (MethodData.ApplyObsoleteAttribute): Likewise.
22798 (MethodData.ApplyConditionalAttribute): Likewise.
22799 (MethodData.ApplyDllImportAttribute): Likewise.
22800 (MethodData.CheckAbstractAndExternal): Likewise.
22801 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
22802 (MethodData.Emit): Formerly known as Method.Emit().
22803 (MemberBase): Moved everything which was specific to a single
22804 accessor/method to MethodData.
22805 (Method): Create a new MethodData and call Define() and Emit() on it.
22806 (Property, Indexer, Event): Create a new MethodData objects for each
22807 accessor and call Define() and Emit() on them.
22809 2002-07-25 Martin Baulig <martin@gnome.org>
22811 Made MethodCore derive from MemberBase to reuse the code from there.
22812 MemberBase now also checks for attributes.
22814 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
22815 (MemberBase.GetMethodFlags): Moved here from class Method and marked
22817 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
22818 `CallingConventions cc' and `Attributes opt_attrs' arguments.
22819 (MemberBase.ApplyAttributes): New virtual method; applies the
22820 attributes to a method or accessor.
22821 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
22822 (MemberBase.ApplyConditionalAttribute): Likewise.
22823 (MemberBase.ApplyDllImportAttribute): Likewise.
22824 (MemberBase.CheckAbstractAndExternal): Likewise.
22825 (MethodCore.ParameterTypes): This is now a property instead of a
22826 method, it's initialized from DoDefineParameters().
22827 (MethodCore.ParameterInfo): Removed the set accessor.
22828 (MethodCore.DoDefineParameters): New protected virtual method to
22829 initialize ParameterTypes and ParameterInfo.
22830 (Method.GetReturnType): We can now simply return the MemberType.
22831 (Method.GetMethodFlags): Override the MemberBase version and add
22832 the conditional flags.
22833 (Method.CheckBase): Moved some code from Define() here, call
22834 DoDefineParameters() here.
22835 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
22836 here to avoid some larger code duplication.
22837 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
22838 ensure that abstract and external accessors don't declare a body.
22840 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
22841 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
22842 lookup in the attribute's parent classes, so we need to abort as soon
22843 as we found the first match.
22844 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
22845 the attribute has no arguments.
22847 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
22850 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22852 * cs-parser.jay: reverted previous patch.
22854 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22856 * cs-parser.jay: fixed bug #22119.
22858 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22860 * attribute.cs: fixed compilation. The error was:
22861 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
22862 be assigned to before control leaves the current method."
22863 [FIXME: Filed as bug #28186: MCS must report this error.]
22865 2002-07-25 Martin Baulig <martin@gnome.org>
22867 * attribute.cs (Attribute.Conditional_GetConditionName): New static
22868 method to pull the condition name ouf of a Conditional attribute.
22869 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
22870 the obsolete message and error flag out of an Obsolete attribute.
22872 * class.cs (Method.GetMethodFlags): New public method to get the
22873 TypeManager.MethodFlags for this method.
22874 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
22876 (Method.Define): Get and apply the Obsolete and Conditional attributes;
22877 if we're overriding a virtual function, set the new private variable
22878 `parent_method'; call the new TypeManager.AddMethod().
22880 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
22881 the MethodBuilder and the Method in a PtrHashtable.
22882 (TypeManager.builder_to_method): Added for this purpose.
22883 (TypeManager.MethodFlags): Added IsObsoleteError.
22884 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
22885 Obsolete and Conditional arguments in MethodBuilders. If we discover
22886 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
22887 the message from the attribute.
22889 2002-07-24 Martin Baulig <martin@gnome.org>
22891 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
22892 preprocessor directives, ensure that the argument to #define/#undef is
22893 exactly one identifier and that it's actually an identifier.
22895 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
22898 2002-07-24 Martin Baulig <martin@gnome.org>
22900 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
22901 initialize it to TypeManager.object_type in the constructor.
22902 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
22903 of the `hm.get_current' method if we're using the collection pattern.
22904 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
22905 for the explicit conversion to make it work when we're using the collection
22906 pattern and the `Current' property has a different return type than `object'.
22909 2002-07-24 Martin Baulig <martin@gnome.org>
22911 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
22912 does not match, but don't report any errors. This method is called in
22913 order for all methods in a MethodGroupExpr until a matching method is
22914 found, so we don't want to bail out if the first method doesn't match.
22915 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
22916 matches, report the 123. Fixes #28070.
22918 2002-07-24 Martin Baulig <martin@gnome.org>
22920 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
22921 TypeManager.TypeToCoreType() to the top of the method so the
22922 following equality checks will work. Fixes #28107.
22924 2002-07-24 Martin Baulig <martin@gnome.org>
22926 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
22927 operand is of type uint, and the other operand is of type sbyte,
22928 short or int, the operands are converted to type long." -
22929 Actually do what this comment already told us. Fixes bug #28106,
22932 2002-07-24 Martin Baulig <martin@gnome.org>
22934 * class.cs (MethodBase): New abstract class. This is now a base
22935 class for Property, Indexer and Event to avoid some code duplication
22936 in their Define() and DefineMethods() methods.
22937 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
22938 generic methods for Define() and DefineMethods().
22939 (FieldBase): Derive from MemberBase, not MemberCore.
22940 (Property): Derive from MemberBase, not MemberCore.
22941 (Property.DefineMethod): Moved all the code from this method to the
22942 new MethodBase.DefineAccessor(), just call it with appropriate
22944 (Property.Define): Call the new Property.DoDefine(), this does some
22945 sanity checks and we don't need to duplicate the code everywhere.
22946 (Event): Derive from MemberBase, not MemberCore.
22947 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
22948 accessors, this will also make them work with interface events.
22949 (Indexer): Derive from MemberBase, not MemberCore.
22950 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
22951 (Indexer.Define): Use the new MethodBase functions.
22953 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
22954 argument to the constructor.
22955 (Interface.FindMembers): Added support for interface events.
22956 (Interface.PopluateEvent): Implemented.
22958 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
22960 2002-07-22 Miguel de Icaza <miguel@ximian.com>
22962 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
22963 but this is required to check for a method name being the same as
22964 the containing class.
22968 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22970 * interface.cs: initialize variable.
22972 2002-07-23 Martin Baulig <martin@gnome.org>
22974 Implemented the IndexerName attribute in interfaces.
22976 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
22977 name if this is an explicit interface implementation.
22978 (Indexer.InterfaceIndexerName): New public variable. If we're
22979 implementing an interface indexer, this is the IndexerName in that
22980 interface. Otherwise, it's the IndexerName.
22981 (Indexer.DefineMethod): If we're implementing interface indexer,
22982 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
22983 and Pending.ImplementIndexer methods.
22984 (Indexer.Define): Also define the PropertyBuilder if we're
22985 implementing an interface indexer and this is neither an explicit
22986 interface implementation nor do the IndexerName match the one in
22989 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
22990 If a method is defined here, then we always need to create a proxy
22991 for it. This is used when implementing interface indexers.
22992 (Pending.IsInterfaceIndexer): New public method.
22993 (Pending.ImplementIndexer): New public method.
22994 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
22995 This is used when implementing interface indexers to define a proxy
22997 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
22998 define a proxy if necessary.
23000 * interface.cs (Interface.IndexerName): New public variable.
23001 (Interface.PopulateIndexer): Set the IndexerName.
23002 (Interface.DefineIndexers): New private method. Populate all the
23003 indexers and make sure their IndexerNames match.
23005 * typemanager.cs (IndexerPropertyName): Added support for interface
23008 2002-07-22 Martin Baulig <martin@gnome.org>
23010 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23011 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23012 ret if HasReturnLabel.
23013 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23016 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23017 and set the ec.LoopBeginTryCatchLevel.
23018 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23019 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23020 the current ec.TryCatchLevel, the branch goes out of an exception
23021 block. In this case, we need to use Leave and not Br.
23023 2002-07-22 Martin Baulig <martin@gnome.org>
23025 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23026 block unless the block does not always return or it is contained in
23027 another try { ... } catch { ... } block. Fixes bug #26506.
23028 Added verify-1.cs to the test suite.
23030 2002-07-22 Martin Baulig <martin@gnome.org>
23032 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23033 then we do not always return. Fixes bug #24985.
23035 2002-07-22 Martin Baulig <martin@gnome.org>
23037 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23038 lookup on a per-class level; ie. walk up the class hierarchy until we
23039 found at least one applicable method, then choose the best among them.
23040 Fixes bug #24463 and test-29.cs.
23042 2002-07-22 Martin Baulig <martin@gnome.org>
23044 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23045 return types of the methods. The return type is not part of the
23046 signature and we must not check it to make the `new' modifier work.
23047 Fixes bug #27999, also added test-147.cs.
23048 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23050 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23051 on the method's return type.
23053 2002-07-21 Martin Baulig <martin@gnome.org>
23055 * assign.cs: Make this work if the rightmost source is a constant and
23056 we need to do an implicit type conversion. Also adding a few more tests
23057 to test-38.cs which should have caught this.
23059 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23060 target in the makefile for this. The makefile.gnu is primarily intended
23061 for end-users who don't want to debug the compiler.
23063 2002-07-21 Martin Baulig <martin@gnome.org>
23065 * assign.cs: Improved the Assign class so it can now handle embedded
23066 assignments (X = Y = Z = something). As a side-effect this'll now also
23067 consume less local variables. test-38.cs now passes with MCS, added
23068 a few new test cases to that test.
23070 2002-07-20 Martin Baulig <martin@gnome.org>
23072 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23073 instructions. Fixes bug #27977, also added test-146.cs.
23075 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23077 * cs-tokenizer.cs: fixed getHex ().
23079 2002-07-19 Martin Baulig <martin@gnome.org>
23081 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23082 not Type.GetType() to lookup the array type. This is needed when
23083 we're constructing an array of a user-defined type.
23084 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23085 single-dimensional arrays, but also for single-dimensial arrays of
23088 2002-07-19 Martin Baulig <martin@gnome.org>
23090 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23091 this function is called, it's not allowed to share LocalBuilders
23092 among ILGenerators.
23094 2002-07-19 Martin Baulig <martin@gnome.org>
23096 * expression.cs (Argument.Resolve): Report an error 118 when trying
23097 to pass a type as argument.
23099 2002-07-18 Martin Baulig <martin@gnome.org>
23101 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23102 Conv_R_Un for the signed `long' type.
23104 2002-07-15 Miguel de Icaza <miguel@ximian.com>
23106 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23107 `expr' for the temporary result, as that will fail if we do
23108 multiple resolves on the same expression.
23110 2002-07-05 Miguel de Icaza <miguel@ximian.com>
23112 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23113 ec.TypeContainer for looking up aliases.
23115 * class.cs (TypeContainer): Remove LookupAlias from here.
23117 * decl.cs (DeclSpace); Move here.
23119 2002-07-01 Miguel de Icaza <miguel@ximian.com>
23121 * class.cs (FindMembers): Only call filter if the constructor
23122 bulider is not null.
23124 Also handle delegates in `NestedTypes' now. Now we will perform
23125 type lookups using the standard resolution process. This also
23128 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23129 This uses Expressions (the limited kind that can be parsed by the
23130 tree) instead of strings.
23132 * expression.cs (ComposedCast.ToString): Implement, used to flag
23133 errors since now we have to render expressions.
23135 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
23138 * ecore.cs (SimpleName.ToString): ditto.
23140 * cs-parser.jay: Instead of using strings to assemble types, use
23141 Expressions to assemble the type (using SimpleName, ComposedCast,
23142 MemberAccess). This should fix the type lookups in declarations,
23143 because we were using a different code path for this.
23145 * statement.cs (Block.Resolve): Continue processing statements
23146 even when there is an error.
23148 2002-07-17 Miguel de Icaza <miguel@ximian.com>
23150 * class.cs (Event.Define): Also remove the `remove' method from
23151 the list of pending items.
23153 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23154 generate more compact code.
23156 2002-07-17 Martin Baulig <martin@gnome.org>
23158 * const.cs (Const.LookupConstantValue): Add support for constant
23159 `unchecked' and `checked' expressions.
23160 Also adding test case test-140.cs for this.
23162 2002-07-17 Martin Baulig <martin@gnome.org>
23164 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23165 check whether mi.ReturnType implements the IEnumerator interface; the
23166 `==' and the IsAssignableFrom() will fail in this situation.
23168 2002-07-16 Ravi Pratap <ravi@ximian.com>
23170 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
23173 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23175 * expression.cs: fixed bug #27811.
23177 2002-07-14 Miguel de Icaza <miguel@ximian.com>
23179 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23180 Molaro: when we are a ref, the value already contains a pointer
23181 value, do not take the address of it.
23183 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23184 * removed mb-parser.jay and mb-tokenizer.cs
23186 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23188 * expression.cs: check against the building corlib void type.
23190 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23192 * ecore.cs: fix for valuetype static readonly fields: when
23193 initializing them, we need their address, not the address of a copy.
23195 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23197 * typemanager.cs: register also enum_type in corlib.
23199 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23201 * class.cs: allow calling this (but not base) initializers in structs.
23203 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23205 * ecore.cs: make sure we compare against the building base types
23208 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23210 * typemanager.cs: fix TypeToCoreType() to handle void and object
23211 (corlib gets no more typerefs after this change).
23213 2002-07-12 Miguel de Icaza <miguel@ximian.com>
23215 * expression.cs (ArrayCreation.EmitArrayArguments): use
23216 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23218 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23219 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
23220 array indexes, the runtime actually forbids them.
23222 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23223 for array arguments here.
23225 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23226 instead of the default for ValueTypes.
23228 (New.DoEmit): Use IsValueType instead of
23229 IsSubclassOf (value_type)
23230 (New.DoResolve): ditto.
23231 (Invocation.EmitCall): ditto.
23233 * assign.cs (Assign): ditto.
23235 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23236 Statements *are* currently doing part of their resolution during
23239 Expressions do always resolve during resolve, but statements are
23240 only required to propagate resolution to their children.
23242 2002-07-11 Miguel de Icaza <miguel@ximian.com>
23244 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23246 (LoadAssembly): Do not add the dll if it is already specified
23248 (MainDriver): Add the System directory to the link path at the end,
23249 after all the other -L arguments.
23251 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23252 wrong opcode for loading bytes and bools (ldelem.i1 instead of
23253 ldelem.u1) and using the opposite for sbytes.
23255 This fixes Digger, and we can finally run it.
23257 * driver.cs (UnixParseOption): Move the option parsing here.
23258 (CSCParseOption): Implement CSC-like parsing of options.
23260 We now support both modes of operation, the old Unix way, and the
23261 new CSC-like way. This should help those who wanted to make cross
23262 platform makefiles.
23264 The only thing broken is that /r:, /reference: and /lib: are not
23265 implemented, because I want to make those have the same semantics
23266 as the CSC compiler has, and kill once and for all the confussion
23267 around this. Will be doing this tomorrow.
23269 * statement.cs (Unsafe.Resolve): The state is checked during
23270 resolve, not emit, so we have to set the flags for IsUnsfe here.
23272 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23274 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23275 not catch the Error_ObjectRefRequired in SimpleName (as it is
23276 possible to have a class/instance variable name that later gets
23277 deambiguated), we have to check this here.
23279 2002-07-10 Ravi Pratap <ravi@ximian.com>
23281 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23282 make static and put into Expression.
23284 (Event.Define): Register the private field of the event with the
23285 TypeManager so that GetFieldFromEvent can get at it.
23287 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23288 keep track of the private field associated with an event which
23291 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23294 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23296 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23298 * expression.cs (Binary.EmitBranchable): this routine emits the
23299 Binary expression in a branchable context. This basically means:
23300 we need to branch somewhere, not just get the value on the stack.
23302 This works together with Statement.EmitBoolExpression.
23304 * statement.cs (Statement.EmitBoolExpression): Use
23307 2002-07-09 Miguel de Icaza <miguel@ximian.com>
23309 * statement.cs (For): Reduce the number of jumps in loops.
23311 (For): Implement loop inversion for the For statement.
23313 (Break): We can be breaking out of a Try/Catch controlled section
23314 (foreach might have an implicit try/catch clause), so we need to
23315 use Leave instead of Br.
23317 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23318 now). If the instace expression supports IMemoryLocation, we use
23319 the AddressOf method from the IMemoryLocation to extract the
23320 address instead of emitting the instance.
23322 This showed up with `This', as we were emitting the instance
23323 always (Emit) instead of the Address of This. Particularly
23324 interesting when This is a value type, as we dont want the Emit
23325 effect (which was to load the object).
23327 2002-07-08 Miguel de Icaza <miguel@ximian.com>
23329 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
23331 * statement.cs (Checked): Set the CheckedState during the resolve
23332 process too, as the ConvCast operations track the checked state on
23333 the resolve process, and not emit.
23335 * cs-parser.jay (namespace_member_declaration): Flag that we have
23336 found a declaration when we do. This is used to flag error 1529
23338 * driver.cs: Report ok when we display the help only.
23340 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
23342 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
23344 2002-07-04 Miguel de Icaza <miguel@ximian.com>
23346 * cs-tokenizer.cs (define): We also have to track locally the
23347 defines. AllDefines is just used for the Conditional Attribute,
23348 but we also need the local defines for the current source code.
23350 2002-07-03 Miguel de Icaza <miguel@ximian.com>
23352 * statement.cs (While, For, Do): These loops can exit through a
23353 Break statement, use this information to tell whether the
23354 statement is the last piece of code.
23356 (Break): Flag that we break.
23358 * codegen.cs (EmitContexts): New `Breaks' state variable.
23360 2002-07-03 Martin Baulig <martin@gnome.org>
23362 * class.cs (TypeContainer.MethodModifiersValid): Allow override
23363 modifiers in method declarations in structs. Otherwise, you won't
23364 be able to override things like Object.Equals().
23366 2002-07-02 Miguel de Icaza <miguel@ximian.com>
23368 * class.cs (Method, Property, Indexer): Do not allow the public
23369 modifier to be used in explicit interface implementations.
23371 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
23372 override modifiers in method declarations in structs
23374 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
23376 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
23377 integer or real overflow, report an error
23379 2002-07-02 Martin Baulig <martin@gnome.org>
23381 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
23382 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
23383 to tell the runtime about our newly created System.Object and
23384 System.ValueType types.
23386 2002-07-02 Miguel de Icaza <miguel@ximian.com>
23388 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
23389 struct instead of Ldarg/Starg.
23391 2002-07-02 Martin Baulig <martin@gnome.org>
23393 * expression.cs (Indirection.Indirection): Call
23394 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
23396 2002-07-02 Martin Baulig <martin@gnome.org>
23398 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
23399 ValueType, call TypeManager.TypeToCoreType() on it.
23400 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
23401 the OpCodes.Newarr argument.
23403 2002-07-02 Martin Baulig <martin@gnome.org>
23405 * expression.cs (Invocation.EmitCall): When compiling corlib,
23406 replace all calls to the system's System.Array type to calls to
23407 the newly created one.
23409 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
23410 System.Array methods.
23411 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
23412 from the system's System.Array type which must be replaced.
23414 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
23416 * typemanager.cs: load unverifiable_code_ctor so we can build
23417 corlib using the correct type. Avoid using GetTypeCode() with
23419 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
23420 TypeManager.object_type to allow building corlib.
23422 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
23424 * ecore.cs: handle System.Enum separately in LoadFromPtr().
23426 2002-07-01 Martin Baulig <martin@gnome.org>
23428 * class.cs: Make the last change actually work, we need to check
23429 whether `ifaces != null' to avoid a crash.
23431 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23433 * class.cs: when we build structs without fields that implement
23434 interfaces, we need to add the interfaces separately, since there is
23435 no API to both set the size and add the interfaces at type creation
23438 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23440 * expression.cs: the dimension arguments to the array constructors
23441 need to be converted if they are a long.
23443 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
23445 * class.cs: don't emit ldarg.0 if there is no parent constructor
23446 (fixes showstopper for corlib).
23448 2002-06-29 Martin Baulig <martin@gnome.org>
23450 MCS now compiles corlib on GNU/Linux :-)
23452 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
23453 ie. check for MethodImplOptions.InternalCall.
23455 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
23456 and TypeManager.attribute_type are null, so we must explicitly check
23457 whether parent is not null to find out whether it's an attribute type.
23458 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
23459 and SetBuilder, not only if the property is neither abstract nor external.
23460 This is necessary to set the MethodImplOptions on the accessor methods.
23461 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
23462 SetBuilder, see Property.Emit().
23464 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
23465 populate "System.Object", "System.ValueType" and "System.Attribute" since
23466 they've already been populated from BootCorlib_PopulateCoreTypes().
23468 2002-06-29 Martin Baulig <martin@gnome.org>
23470 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
23471 is the NullLiteral, we also need to make sure that target_type is not
23474 2002-06-29 Martin Baulig <martin@gnome.org>
23476 * rootcontext.cs (RootContext.ResolveCore): We must initialize
23477 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
23478 before calling BootstrapCorlib_ResolveDelegate ().
23480 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23482 * statement.cs: fixed build-breaker. All tests passed ok.
23484 2002-06-27 Martin Baulig <martin@gnome.org>
23486 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
23487 for System.Decimal when compiling corlib.
23489 2002-06-27 Martin Baulig <martin@gnome.org>
23491 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
23492 switch blocks which contain nothing but a default clause.
23494 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
23496 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
23498 2002-06-27 Martin Baulig <martin@gnome.org>
23500 * ecore.cs (PropertyExpr.PropertyExpr): Call
23501 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
23503 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
23504 is already a TypeBuilder.
23506 2002-06-27 Martin Baulig <martin@gnome.org>
23508 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
23509 `target_type == TypeManager.array_type', not IsAssignableFrom() in
23510 the "from an array-type to System.Array" case. This makes it work
23511 when compiling corlib.
23513 2002-06-27 Martin Baulig <martin@gnome.org>
23515 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
23516 non-static PropertyExpr, set its InstanceExpression. This makes
23517 the `ICollection.Count' property work in System/Array.cs.
23519 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
23521 * driver.cs: Made error handling more consistent. Errors now
23522 tracked by Report class, so many methods which used to return int
23523 now return void. Main() now prints success/failure and
23524 errors/warnings message.
23526 Renamed '--probe' compiler argument to '--expect-error'. Removed
23527 the magic number return values (123 and 124). Now, if the
23528 expected error occurs, the compiler exits with success (exit value
23529 0). If the compilation completes without seeing that particular
23530 error, the compiler exits with failure (exit value 1). The
23531 makefile in mcs/errors has been changed to handle the new behaviour.
23533 * report.cs: Made 'expected error' number a property and renamed
23534 it from 'Probe' to 'ExpectedError'.
23536 * genericparser.cs: Removed error handling support, since it is
23537 now all done by Report class.
23539 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
23540 class, so parse() no longer returns an int.
23542 * namespace.cs: Use Report.Error instead of GenericParser.error
23544 2002-06-22 Miguel de Icaza <miguel@ximian.com>
23546 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
23547 TypeContainer.AddOperator): At the front of the list put the
23548 explicit implementations, so they get resolved/defined first.
23550 2002-06-21 Miguel de Icaza <miguel@ximian.com>
23552 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
23553 interface type is implemented by this TypeContainer. Used during
23554 explicit interface implementation.
23556 (Property.Define, Indexer.Define, Method.Define): Validate that
23557 the given interface in the explicit implementation is one of the
23558 base classes for the containing type.
23560 Also if we are explicitly implementing an interface, but there is
23561 no match in the pending implementation table, report an error.
23563 (Property.Define): Only define the property if we are
23564 not explicitly implementing a property from an interface. Use the
23565 correct name also for those properties (the same CSC uses,
23566 although that is really not needed).
23568 (Property.Emit): Do not emit attributes for explicitly implemented
23569 properties, as there is no TypeBuilder.
23571 (Indexer.Emit): ditto.
23573 Hiding then means that we do not really *implement* a pending
23574 implementation, which makes code fail.
23576 2002-06-22 Martin Baulig <martin@gnome.org>
23578 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
23579 the return value of Object.GetType(). [FIXME: we need to do this whenever
23580 we get a type back from the reflection library].
23582 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
23584 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
23586 2002-06-20 Miguel de Icaza <miguel@ximian.com>
23588 * attribute.cs: Return null if we can not look up the type.
23590 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
23591 the interface types found.
23593 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
23594 interface types found.
23596 * typemanager.cs (GetInterfaces): Make this routine returns alll
23597 the interfaces and work around the lame differences between
23598 System.Type and System.Reflection.Emit.TypeBuilder in the results
23599 result for GetInterfaces.
23601 (ExpandInterfaces): Given an array of interface types, expand and
23602 eliminate repeated ocurrences of an interface. This expands in
23603 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
23606 2002-06-21 Martin Baulig <martin@gnome.org>
23608 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
23611 2002-06-21 Martin Baulig <martin@gnome.org>
23613 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
23614 and called with one of the core types, return the corresponding typebuilder for
23617 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
23620 2002-06-21 Martin Baulig <martin@gnome.org>
23622 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
23623 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
23624 (Expression.ConvertReferenceExplicit): Likewise.
23626 * expression.cs (ElementAccess.DoResolve): Likewise.
23627 (ElementAccess.DoResolveLValue): Likewise.
23629 2002-06-10 Martin Baulig <martin@gnome.org>
23631 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
23632 add the "value" parameter to the parameter list.
23634 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
23637 2002-06-19 Miguel de Icaza <miguel@ximian.com>
23639 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
23640 the argument to an int, uint, long or ulong, per the spec. Also
23641 catch negative constants in array creation.
23643 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
23645 * class.cs: do not allow the same interface to appear twice in
23646 the definition list.
23648 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
23650 * ecore.cs: don't use ldlen with System.Array.
23652 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
23654 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
23656 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
23658 * modifiers.cs: produce correct field attributes for protected
23659 internal. Easy fix so miguel can work on ther harder stuff:-)
23661 2002-06-18 Miguel de Icaza <miguel@ximian.com>
23663 * pending.cs: New file. Move the code from class.cs here.
23664 Support clearning the pending flag for all methods (when not doing
23665 explicit interface implementation).
23667 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
23669 * rootcontext.cs: added a couple more types needed to bootstrap.
23671 2002-06-17 Miguel de Icaza <miguel@ximian.com>
23673 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
23674 constructor in the type, instead of any constructor in the type
23675 hierarchy. Thanks to Paolo for finding this bug (it showed up as
23676 a bug in the Mono runtime when applying the params attribute).
23678 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23679 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
23681 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
23683 * expression.cs (Unary.ResolveOperator): Use TypeManager
23684 to resolve the type.
23686 2002-06-13 Ravi Pratap <ravi@ximian.com>
23688 * cs-parser.jay (enum_member_declaration): Pass in the attributes
23691 * enum.cs (AddEnumMember): Add support to store the attributes associated
23692 with each member too.
23694 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
23695 field builders too - this takes care of the enum member case.
23697 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
23699 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
23700 address-of operator on both value types and pointers.
23702 2002-06-10 Martin Baulig <martin@gnome.org>
23704 * interface.cs (Interface.PopulateIndexer): Add the indexer's
23705 PropertyBuilder to the `property_builders' list.
23707 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
23708 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
23709 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
23710 find any indexers which are inherited from an interface.
23712 2002-06-09 Martin Baulig <martin@gnome.org>
23714 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
23715 the same type as the constant if necessary. There's also a test-130.cs
23718 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
23720 * typemanager.cs (TypeManager.ChangeType): Previously known as
23721 Enum.ChangeEnumType().
23723 2002-06-09 Martin Baulig <martin@gnome.org>
23725 * expression.cs (Cast.TryReduce): Added support for consts.
23727 2002-06-08 Ravi Pratap <ravi@ximian.com>
23729 * class.cs (Accessor): Hold attributes information so we can pass
23732 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
23733 Modify to pass in attributes attached to the methods.
23735 (add_accessor_declaration, remove_accessor_declaration): Ditto.
23737 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
23738 to handle the Accessor kind :-)
23740 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
23742 2002-06-08 Martin Baulig <martin@gnome.org>
23744 * expression.cs (Unary.TryReduceNegative): Added support for
23747 2002-06-08 Martin Baulig <martin@gnome.org>
23749 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
23750 name can't be found in the `defined_names' - the caller will do a
23751 MemberLookup in this case and thus find methods in System.Enum
23752 such as Enum.IsDefined().
23754 2002-06-08 Martin Baulig <martin@gnome.org>
23756 * enum.cs (Enum.ChangeEnumType): This is a custom version of
23757 Convert.ChangeType() which works with TypeBuilder created types.
23758 (Enum.LookupEnumValue, Enum.Define): Use it here.
23760 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
23761 `TypeBuilder.BaseType != null' check.
23762 (TypeContainer.FindMembers): Only lookup parent members if we
23763 actually have a parent.
23764 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
23765 (ConstructorInitializer.Resolve): Likewise.
23767 * interface.cs (Interface.FindMembers): Added
23768 `TypeBuilder.BaseType != null' check.
23770 * rootcontext.cs (RootContext.ResolveCore): Added
23771 "System.Runtime.CompilerServices.IndexerNameAttribute" to
23772 classes_second_stage.
23774 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
23775 debug_type and trace_type when compiling with --nostdlib.
23777 2002-06-07 Martin Baulig <martin@gnome.org>
23779 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
23780 (AddField): Set it to true when adding a non-static field.
23781 (DefineType): Use `have_nonstatic_fields' to find out whether we
23782 have non-static fields, not `Fields != null'.
23784 2002-06-02 Miguel de Icaza <miguel@ximian.com>
23786 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
23787 dereferencing a null on the static-field code path)
23789 2002-05-30 Martin Baulig <martin@gnome.org>
23791 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
23792 to take command line arguments. Use reflection to call the new
23793 custom `Initialize' function on the symbol writer and pass it the
23794 command line arguments.
23796 * driver.cs (--debug-args): New command line argument to pass command
23797 line arguments to the symbol writer.
23799 2002-05-28 Miguel de Icaza <miguel@ximian.com>
23801 * assign.cs (DoResolve): Forgot to do the implicit conversion to
23802 the target type for indexers and properties. Thanks to Joe for
23805 2002-05-27 Miguel de Icaza <miguel@ximian.com>
23807 * typemanager.cs (MethodFlags): returns the method flags
23808 (Obsolete/ShouldIgnore) that control warning emission and whether
23809 the invocation should be made, or ignored.
23811 * expression.cs (Invocation.Emit): Remove previous hack, we should
23812 not do this on matching a base type, we should do this based on an attribute
23814 Only emit calls to System.Diagnostics.Debug and
23815 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
23816 on the command line.
23818 * rootcontext.cs: Global settings for tracing and debugging.
23820 * cs-tokenizer.cs (define): New utility function to track
23821 defines. Set the global settings for TRACE and DEBUG if found.
23823 2002-05-25 Ravi Pratap <ravi@ximian.com>
23825 * interface.cs (Populate*): Pass in the TypeContainer as well as
23826 the DeclSpace as parameters so that we can create EmitContexts and
23827 then use that to apply attributes etc.
23829 (PopulateMethod, PopulateEvent, PopulateProperty)
23830 (PopulateIndexer): Apply attributes everywhere.
23832 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
23835 (ApplyAttributes): Update accordingly.
23837 We now apply interface attributes for all members too.
23839 2002-05-26 Miguel de Icaza <miguel@ximian.com>
23841 * class.cs (Indexer.Define); Correctly check if we are explicit
23842 implementation (instead of checking the Name for a ".", we
23843 directly look up if the InterfaceType was specified).
23845 Delay the creation of the PropertyBuilder.
23847 Only create the PropertyBuilder if we are not an explicit
23848 interface implementation. This means that explicit interface
23849 implementation members do not participate in regular function
23850 lookups, and hence fixes another major ambiguity problem in
23851 overload resolution (that was the visible effect).
23853 (DefineMethod): Return whether we are doing an interface
23856 * typemanager.cs: Temporary hack until we get attributes in
23857 interfaces (Ravi is working on that) and we get IndexerName
23858 support in interfaces.
23860 * interface.cs: Register the indexers as properties.
23862 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
23863 warning, I have verified that this is a bug in the .NET runtime
23864 (JavaScript suffers of the same problem).
23866 * typemanager.cs (MemberLookup): When looking up members for
23867 interfaces, the parent of an interface is the implicit
23868 System.Object (so we succeed in searches of Object methods in an
23869 interface method invocation. Example: IEnumerable x; x.ToString
23872 2002-05-25 Miguel de Icaza <miguel@ximian.com>
23874 * class.cs (Event): Events should also register if they do
23875 implement the methods that an interface requires.
23877 * typemanager.cs (MemberLookup); use the new GetInterfaces
23880 (GetInterfaces): The code used to lookup interfaces for a type is
23881 used in more than one place, factor it here.
23883 * driver.cs: Track the errors at the bottom of the file, we kept
23886 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
23887 instance if the method we are calling is static!
23889 2002-05-24 Miguel de Icaza <miguel@ximian.com>
23891 * attribute.cs (ApplyAttributes): Make this function filter out
23892 the IndexerName attribute (as that attribute in reality is never
23893 applied) and return the string constant for the IndexerName
23896 * class.cs (TypeContainer.Emit): Validate that all the indexers
23897 have the same IndexerName attribute, and if so, set the
23898 DefaultName attribute on the class.
23900 * typemanager.cs: The return value might contain other stuff (not
23901 only methods). For instance, consider a method with an "Item"
23902 property and an Item method.
23904 * class.cs: If there is a problem with the parameter types,
23907 2002-05-24 Ravi Pratap <ravi@ximian.com>
23909 * ecore.cs (ImplicitConversionExists): Wrapper function which also
23910 looks at user defined conversion after making a call to
23911 StandardConversionExists - we need this for overload resolution.
23913 * expression.cs : Update accordingly the various method calls.
23915 This fixes 2 bugs filed against implicit user defined conversions
23917 2002-05-22 Miguel de Icaza <miguel@ximian.com>
23919 * statement.cs: Track the result of the assignment.
23921 2002-05-21 Miguel de Icaza <miguel@ximian.com>
23923 * expression.cs (MemberAccess): Improved error reporting for
23924 inaccessible members.
23926 2002-05-22 Martin Baulig <martin@gnome.org>
23928 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
23929 itself with debugging support.
23931 2002-05-22 Martin Baulig <martin@gnome.org>
23933 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
23934 Removed, this isn't needed anymore.
23936 2002-05-20 Martin Baulig <martin@gnome.org>
23938 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
23939 be underlying type for an enum.
23941 2002-05-20 Miguel de Icaza <miguel@ximian.com>
23943 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
23944 that splits out the loading of just the core types.
23946 * rootcontext.cs (ResolveCore): Split the struct resolution in
23947 two, so we can load the enumeration underlying types before any
23950 * expression.cs (Is): Bandaid until we fix properly Switch (see
23951 bug #24985 for details).
23953 * typemanager.cs (ImplementsInterface): The hashtable will contain
23954 a null if there are no interfaces implemented.
23956 2002-05-18 Miguel de Icaza <miguel@ximian.com>
23958 * cs-parser.jay (indexer_declarator): It is fine to have array
23961 2002-05-17 Miguel de Icaza <miguel@ximian.com>
23963 * typemanager.cs: (RegisterBuilder): New function used to register
23964 TypeBuilders that implement interfaces. Since
23965 TypeBuilder.GetInterfaces (as usual) does not work with lame
23967 (AddUserType): register interfaces.
23969 (ImplementsInterface): Use the builder_to_ifaces hash if we are
23970 dealing with TypeBuilder. Also, arrays are showing up as
23971 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
23972 methods can not be invoked on them!
23974 * ecore.cs (ExplicitReferenceConversionExists): Made public.
23975 (ImplicitReferenceConversionExists): Split out from
23976 StandardConversionExists.
23978 * expression.cs (As): We were only implementing one of the three
23979 cases for the as operator. We now implement them all.
23980 (Is): Implement the various other cases for Is as well.
23982 * typemanager.cs (CACHE): New define used to control if we want or
23983 not the FindMembers cache. Seems to have a negative impact on
23984 performance currently
23986 (MemberLookup): Nested types have full acess to
23987 enclosing type members
23989 Remove code that coped with instance/static returns for events, we
23990 now catch this in RealFindMembers.
23992 (RealFindMembers): only perform static lookup if the instance
23993 lookup did not return a type or an event.
23995 2002-05-17 Miguel de Icaza <miguel@ximian.com>
23997 * assign.cs (CompoundAssign): We pass more semantic information
23998 now to Compound Assignments than we did before: now we have all
23999 the information at hand, and now we resolve the target *before* we
24000 do the expression expansion, which allows the "CacheValue" method
24001 to have the effect we intended (before, a [x] += 1 would generate
24002 two differen ArrayAccess expressions from the ElementAccess,
24003 during the resolution process).
24005 (CompoundAssign.DoResolve): Resolve target and original_source here.
24007 2002-05-16 Miguel de Icaza <miguel@ximian.com>
24009 * expression.cs (ArrayAccess): dropped debugging information.
24011 * typemanager.cs: Small bug fix: I was always returning i_members,
24012 instead of one of i_members or s_members (depending on which had
24015 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
24016 method is invoked before any code generation takes place, and it
24017 is a mechanism to inform that the expression will be invoked more
24018 than once, and that the method should use temporary values to
24019 avoid having side effects
24021 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24023 * ecore.cs (Expression.CacheTemporaries): Provide empty default
24026 * expression.cs (Indirection, ArrayAccess): Add support for
24027 CacheTemporaries in these two bad boys.
24029 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24030 ldobj or ldind_ref.
24031 (StoreFromPtr): Handle stobj as well.
24033 * expression.cs (UnaryMutator): Share more code.
24035 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24036 down: I was not tracking the Filter function as well, which
24037 was affecting the results of the cache.
24039 2002-05-15 Miguel de Icaza <miguel@ximian.com>
24041 * attribute.cs: Remove the hack to handle the CharSet property on
24044 2002-05-14 Miguel de Icaza <miguel@ximian.com>
24046 * attribute.cs (DoResolve): More uglyness, we now only try to
24047 resolve the attribute partially, to extract the CharSet
24048 information (only if we are a StructLayout attribute). Otherwise
24050 (GetExtraTypeInfo): Add some code to conditionally kill in the
24051 future this. I am more and more convinced that the .NET
24052 framework has special code to handle the attribute setting on
24055 * expression.cs (IsParamsMethodApplicable): Revert my previous
24056 foreach change here, it was wrong.
24058 2002-05-13 Miguel de Icaza <miguel@ximian.com>
24060 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24061 (pp_expr): do not abort on unknown input, just return.
24062 (eval): abort if there are pending chars.
24064 * attribute.cs (Attribute.Resolve): Positional parameters are
24065 optional. Deal with that case.
24067 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24068 the Ansi/Unicode/Auto information for the type.
24070 (TypeContainer.DefineType): instantiate the EmitContext here, as
24071 we will be using it during the type definition (to resolve
24072 attributes) and during the emit phase.
24074 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24075 to pull type information out of the attributes
24077 (Attribute.Resolve): track the constructor builder, and allow for
24078 multiple invocations (structs and classes will use this).
24080 * ecore.cs (MemberLookupFinal): new version with all the
24081 parameters customizable.
24083 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24084 constructors. Return if the result value is null (as the error
24085 would have been flagged already by MemberLookupFinal)
24087 Do not allow instances of abstract classes or interfaces to be
24090 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24091 We have to compare the assembly property here when dealing with
24092 FamANDAssem and Assembly access modifiers, because we might be
24093 creating an assembly from *modules* (that means that we are not
24094 getting TypeBuilders for types defined in other modules that are
24095 part of this assembly).
24097 (Method.Emit): If the method is marked abstract and has a body,
24100 (TypeContainer.DefineMembers): If both the defined member and the
24101 parent name match are methods, then do not emit any warnings: let
24102 the Method.Define routine take care of flagging warnings. But if
24103 there is a mismatch (method overrides something else, or method is
24104 overriwritten by something, then emit warning).
24106 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24107 set to null, this means `do not check for the return type on the
24110 (Method.Define): set the return type for the method signature to
24111 null, so that we get methods with the same name and parameters and
24112 different return types. This is used to flag warning 114 (you are
24113 hiding a method, and you probably want to use the new/override
24116 * typemanager.cs (MemberLookup): Implemented proper access
24117 control, closing a long standing set of bug reports. The problem
24118 was that the Framework only has two bits: Public and NonPublic,
24119 and NonPublic includes private and protected methods, but we need
24120 to enforce the FamANDAssem, FamOrAssem and Family.
24122 2002-05-11 Miguel de Icaza <miguel@ximian.com>
24124 * statement.cs (GotoCase): Return true: Ammounts to giving up
24125 knowledge on whether we return or not, and letting the other case
24126 be responsible for it.
24128 2002-05-10 Miguel de Icaza <miguel@ximian.com>
24130 * driver.cs: Do not load directories for each file processed, only
24131 do it if there is a pattern.
24133 * ecore.cs: Report readonly assigns here as well, as we might have
24134 been resolved only by MemberAccess.
24136 (SimpleName.SimpleNameResolve): Also be useful for LValue
24137 resolution. We need this to propagate assign to local readonly variables
24139 * typemanager.cs: Use a ptrhashtable for the criteria, because we
24140 do not want to reuse potential criteria memory.
24142 * class.cs (MyEventBuilder): Set reflected_type;
24144 * ecore.cs (Constantify): Added support for constifying bools.
24146 (RootContext.LookupType): Added a cache for values looked up in
24147 the declaration space.
24149 * typemanager.cs (FindMembers): Now is a front-end to
24150 RealFindMembers, and provides a two-level hashtable-based cache to
24153 15% performance improvement: from 22.5 to 19.2 seconds.
24155 * expression.cs (IsParamsMethodApplicable): use foreach.
24156 (Invocation.DoResolve): ditto.
24157 (New.DoResolve): ditto.
24158 (ArrayCreation.DoResolve): ditto.
24160 * ecore.cs (FindMostEncompassingType): use foreach.
24162 * delegate.cs (NewDelegate.DoResolve): Use foreach
24164 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24165 (RemoveMethods): use foreach.
24167 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24168 nested foreach statements instead of for, and also break out of
24169 the inner loop once a match is found.
24171 (Invocation.OverloadResolve): Use foreach, simplify the code.
24173 2002-05-08 Miguel de Icaza <miguel@ximian.com>
24175 * cfold.cs (BinaryFold): During an enumeration evaluation context,
24176 we actually unwrap the expression to allow for extra information
24179 * expression.cs: Use Shr_Un on unsigned operations.
24181 2002-05-08 Ravi Pratap <ravi@ximian.com>
24183 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
24184 applicable operators was not being considered correctly. This closes
24185 the bug Miguel reported.
24187 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24189 * attribute.cs: check that the type derives from System.Attribute
24190 and report the correct error in that case (moved the duplicate code to
24191 its own method, too).
24193 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24195 * attribute.cs: lookup attribute type name as the spec says: first the
24196 bare attribute name and then name + "Attribute" (nant compiles with
24197 mcs after this fix).
24199 2002-05-07 Miguel de Icaza <miguel@ximian.com>
24201 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
24202 Because of the way we parse things, we should try to see if a
24203 UIntConstant can fit in an integer.
24205 2002-05-07 Ravi Pratap <ravi@ximian.com>
24207 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24208 when we are in an explicit context.
24210 (ConvertReferenceExplicit): When converting from Iface type S to Class
24211 T make sure the rules are implemented as an OR.
24213 * parameter.cs (ParameterType): Make it a property for now although the
24214 purpose really isn't anything immediate.
24216 * expression.cs (Is*Applicable): Do better checking on the parameter type
24217 of a ref/out parameter. The ones from the system assemblies are already
24218 marked with the correct type so we don't need to do any correction.
24220 * ecore.cs (StandardConversionExists): Conversion from Interface types to
24221 the object type is standard too so include that.
24223 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24225 * ecore.cs (StandardConversionExists): Augment with missing code:
24226 deal with IntConstant, LongConstants and Enumerations.
24228 * assign.cs: Report the error, instead of failing silently
24230 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24231 typecontainer that they are declared, because the
24232 typecontainer/namespace will have the list of using clauses that
24233 need to be applied.
24235 Assembly Attributes were escaping the normal registration
24238 (EmitCode): Apply attributes within an EmitContext that represents
24239 the container they were declared on.
24241 * cs-parser.jay: Track bases for structs. How did I get this wrong?
24243 2002-05-06 Ravi Pratap <ravi@ximian.com>
24245 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24246 Revamp completely - make much cleaner as we now operate only
24249 (FindMostSpecificSource, FindMostSpecificTarget): New methods
24250 to implement the logic detailed in the spec more correctly.
24252 (UserDefinedConversion): Update accordingly.
24254 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24256 * statement.cs: Return flow analysis information up.
24258 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24261 (token): Do not consume an extra character before calling
24264 2002-05-06 Piers Haken <piersh@friskit.com>
24266 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24268 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24270 * class.cs (Constructor.Emit): Set the IsStatic flag in the
24271 EmitContext during the instance constructor initializer
24272 resolution, to stop access to instance variables.
24274 This is mandated by the spec, last paragraph of the `constructor
24275 initializers' section.
24277 2002-05-05 Miguel de Icaza <miguel@ximian.com>
24279 * cs-parser.jay, class.cs (Accessor): new class used to represent
24280 an accessor (get or set). In the past we used `null' to represent
24281 a missing accessor. But this is ambiguous because there was no
24282 way to tell in abstract indexers/properties if one of them was
24285 Now there is a way of addressing that.
24287 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24288 instead of FindMembers.
24290 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24291 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24293 * attribute.cs: Treat indexers and properties as the same in terms
24294 of applying attributes
24296 * ecore.cs (FindMostEncompassedType): Use statically initialized
24297 EmptyExpressions()s like we do elsewhere to avoid creating useless
24298 objects (and we take this out of the tight loop).
24300 (GetConversionOperators): Move the code to extract the actual
24301 operators to a separate routine to clean things up.
24303 2002-05-04 Miguel de Icaza <miguel@ximian.com>
24305 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24306 events are always registered FieldBuilders.
24308 * class.cs (FieldBase): New class shared by Fields
24310 * delegate.cs: If we are a toplevel delegate, use our full name.
24311 If we are a nested delegate, then only use our tail name.
24313 2002-05-02 Ravi Pratap <ravi@ximian.com>
24315 * expression.cs (IsApplicable): Ensure that we add the "&" to
24316 ref/out types before comparing it with the type of the argument.
24318 (IsParamsMethodApplicable): Ditto.
24320 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
24323 * delegate.cs : Handle the case when we have more than one applicable
24324 method. Flag an error only when we finish checking all.
24326 2002-05-02 Miguel de Icaza <miguel@ximian.com>
24328 * expression.cs: Add support for boolean static initializers.
24330 2002-05-01 Miguel de Icaza <miguel@ximian.com>
24332 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
24334 * parameter.cs (ComputeParameterTypes,
24335 ComputeAndDefineParameterTypes): Better error handling: now we
24336 clear the `types' cache if we fail during any of the type lookups.
24337 We also return the status code correctly to our caller
24339 * delegate.cs: If we fail to define a delegate, abort the extra
24342 * expression.cs (Binary.ResolveOperator): for
24343 operator==(object,object) and operator !=(object, object) we also
24344 have to verify that there is an implicit conversion from one to
24347 (ArrayAccess.DoResolve): Array Access can operate on
24350 2002-04-30 Miguel de Icaza <miguel@ximian.com>
24352 * assign.cs (CompoundAssign): A new class used as a "flag" that
24353 the assignment actually is happening as part of a compound
24354 assignment operator.
24356 During compound assignment, a few new rules exist to enable things
24363 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
24364 to the type of x) if y is implicitly convertible to the type of x,
24365 and the operator is a builtin operator and the return type of the
24366 operator is explicitly convertible to the type of x.
24368 * rootcontext.cs: Reset warning level to 2. 4 catches various
24369 "interesting" features in mcs, we must clean this up at some
24370 point, but currently am trying to kill other bugs ;-)
24372 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
24373 in container classes as well.
24375 * expression.cs (Binary.ResolveOperator): Handle string case
24376 before anything else (as operator overloading does emit an error
24377 before doing anything else).
24379 This code could go away when we move to a table driven model, but
24380 i could not come up with a good plan last night.
24382 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
24384 * typemanager.cs (CSharpName): reimplementation using regex.
24385 * class.cs: added null check for fields in Emit
24386 * rootcontext.cs: set warninglevel to 4
24388 2002-04-29 Miguel de Icaza <miguel@ximian.com>
24390 * typemanager.cs (CSharpName): reimplemented with Lupus
24393 2002-04-28 Miguel de Icaza <miguel@ximian.com>
24395 * statement.cs (If): correclty implement Resolve, because we were
24396 not catching sem errors in there. The same process is needed
24398 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
24401 (Statement.Warning_DeadCodeFound): Factorize code.
24402 (While): Report dead code here too.
24404 (Statement): Added Resolve virtual method to allow
24405 for resolution split from the emit code.
24407 2002-04-26 Miguel de Icaza <miguel@ximian.com>
24409 * statement.cs (EmitBoolExpression): No longer try to resolve the
24411 (MakeBoolean): New utility function that resolve, implicitly
24412 converts to boolean and tags the expression.
24415 (If, Do): Implement dead code elimination.
24416 (While): Implement loop inversion
24418 (Do, While, For, If): Resolve the expression prior to calling our
24421 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
24424 - added method Report28 (warning: program has more than one entry point)
24425 - added method IsEntryPoint, implements paragraph 10.1 of the spec
24426 - modified method Method.Define, the part at the end of the method
24428 * rootcontext.cs: added static public Location EntryPointLocation;
24430 * ../errors/cs0028.cs : Add test case for the above warning.
24433 - modified method CSharpName to allow arrays of primitive type to
24434 be printed nicely (e.g. instead of System.Int32[][] it now prints
24436 - added method CSharpSignature: returns the signature of a method
24437 in string format to be used in reporting errors, warnings, etc.
24439 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
24442 2002-04-26 Ravi Pratap <ravi@ximian.com>
24444 * delegate.cs (Define): Fix extremely silly bug where I was
24445 setting the type of the 'object' parameter of the BeginInvoke
24446 method to System.IAsyncResult instead of System.Object ;-)
24448 2002-04-26 Miguel de Icaza <miguel@ximian.com>
24450 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
24453 (Constructor.Emit): return if we fail to initialize the
24454 constructor. Another door closed!
24456 * expression.cs (New.DoResolve): Improve error message (from -6 to
24457 1501). Use DeclaredOnly lookup to find the exact constructor.
24459 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
24460 loop. This is useful.
24462 * cs-parser.jay: Adjust the default parameters so that destructors
24463 have the proper signature.
24465 2002-04-26 Martin Baulig <martin@gnome.org>
24467 * driver.cs (LoadAssembly): If `assembly' contains any characters
24468 which are only valid in path names and not in assembly names
24469 (currently slash, backslash and point), use Assembly.LoadFrom ()
24470 instead of Assembly.Load () on the `assembly' (before iteration
24471 over the link_paths).
24473 2002-04-26 Martin Baulig <martin@gnome.org>
24475 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
24477 2002-04-25 Miguel de Icaza <miguel@ximian.com>
24479 * class.cs (Property): use the new typemanager.MemberLookup
24481 (TypeContainer.MemberLookup): Implement using the
24482 TypeManager.MemberLookup now.
24484 * typemanager.cs: Make MemberLookup a function of the TypeManager,
24485 and return MemberInfos, so that these can be used without an
24486 EmitContext (what we had before).
24488 2002-04-24 Miguel de Icaza <miguel@ximian.com>
24490 * expression.cs: Fix the case where the argument to params if the
24491 type of the params. I omitted handling this before. Fixed
24493 2002-04-22 Miguel de Icaza <miguel@ximian.com>
24495 * driver.cs: Call BootCorlib_PopulateCoreType
24497 * class.cs (Property.CheckBase): Check for properties only, not
24500 * interface.cs: Temporary hack: try/catch around the
24501 CustomAttributeBuilder, because I am getting an exception that I
24504 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
24505 types whose definitions are required to be there (attributes are
24506 defined before standard types).
24508 Compute definitions as we boot the various types, as they are used
24509 immediately (value_type class will need object_type, but if we do
24510 not initialize object_type, we will pass a null, which will let
24511 the runtime pick the System.Object from the existing corlib, which
24512 is not what we want).
24514 2002-04-22 Patrik Torstensson <totte@labs2.com>
24516 * cs-tokenizer.cs: fixed a number of trim() issues.
24518 2002-04-22 Ravi Pratap <ravi@ximian.com>
24520 * expression.cs (Argument.Type): Ensure that we return the correct
24521 type when we have out or ref parameters [in which case we
24524 2002-04-22 Miguel de Icaza <miguel@ximian.com>
24526 * class.cs (Property, Indexer): Allow extern modifier in there.
24528 * typemanager.cs (InitBaseTypes): Initializes object_type and
24529 value_type, since those will be used early on during the bootstrap
24530 process to compile corlib.
24532 (InitCoreTypes): Move code from here to InitBaseTypes.
24534 2002-04-21 Miguel de Icaza <miguel@ximian.com>
24536 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
24537 single-dimension arrays as using the ldlen opcode.
24539 Daniel Lewis discovered this optimization.
24541 * typemanager.cs: Add signature for System.Array::get_Length
24543 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24545 * statement.cs: report the error when the foreach does not apply to an
24546 array nor a collection.
24548 2002-04-19 Miguel de Icaza <miguel@ximian.com>
24550 * expression.cs: Add implicit conversions to the operator ~.
24552 * constant.cs (DecimalConstant.Emit): Emit decimal value.
24554 * typemanager.cs: Locate the decimal constructor.
24556 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24558 * attribute.cs: use the new property of TypeOf.
24559 * expression.cs: added 'get' property around typearg.
24561 These changes fix a build breaker reported by NickD. Is this the
24562 correct way to fix? If not, please, revert my changes and make it
24565 2002-04-17 Miguel de Icaza <miguel@ximian.com>
24567 * attribute.cs: Add support for typeof in attribute invocations.
24568 I am not sure that this is right though.
24570 2002-04-14 Duncan Mak <duncan@ximian.com>
24572 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
24573 Binary.Operator.Division case.
24575 2002-04-13 Ravi Pratap <ravi@ximian.com>
24577 * class.cs (DefineType): Ensure that we do a proper check on
24578 attribute types and also register it with the TypeManager.
24580 (TypeContainer.Targets): The default for attribute types is
24581 AttributeTargets.All.
24583 * attribute.cs (ApplyAttributes): Registering the attribute type
24584 is done elsewhere, not when we discover we have a Usage attribute.
24586 2002-04-12 Ravi Pratap <ravi@ximian.com>
24588 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
24589 and get rid of is_delegate parameter.
24591 * everywhere : update.
24593 2002-04-12 Ravi Pratap <ravi@ximian.com>
24595 * cs-parser.jay (compilation_unit): Revamp completely to use
24596 some new ideas that I got from Rhys' grammar to solve the problems
24597 with assembly level attributes.
24599 (outer_declaration): New grammar production.
24601 (attribute_sections): Add.
24603 (opt_attributes): Base on attribute_sections
24605 (namespace_declaration): Allow opt_attributes to tackle the case
24606 when we have assembly level attributes - we are clever in this
24609 * attribute.cs (ApplyAttributes): Do not worry about assembly
24610 attributes in the non-global context.
24612 * rootcontext.cs (AddGlobalAttributes): Go back to using this
24613 instead of SetGlobalAttributes.
24615 * class.cs, rootcontext.cs : Ensure we define and generate
24616 attribute types before anything else.
24618 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
24619 and flag the new error -20 for the case when the attribute type
24620 does not have valid targets specified. csc does not catch this.
24622 * ../errors/errors.txt : update for error # -20
24624 2002-04-11 Ravi Pratap <ravi@ximian.com>
24626 * support.cs (InternalParameters.ParameterModifier): Do some null
24627 checking and return sane values.
24629 * class.cs (Method.Define): If we are a PInvoke method, ensure
24630 that we are static and extern. Report error # 601
24632 * ../errors/cs0601.cs : Add test case for the above error.
24634 2002-04-07 Ravi Pratap <ravi@ximian.com>
24636 * rootcontext.cs (attribute_types): We need to keep type of
24637 all attribute types separately and emit code for them first.
24639 (RegisterAttribute) : Implement.
24641 * class.cs (DefineType): Check if the current Type is a custom
24642 attribute type and register it accordingly.
24644 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
24645 adding the first attribute twice and rename to
24647 (SetGlobalAttributes): this.
24649 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
24652 * attribute.cs (ApplyAttributes): Take an additional argument telling us
24653 if we are processing global arguments. Hmm, I am unsure of this.
24655 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24657 * expression.cs: added static array of strings to avoid calling
24658 Enum.ToString () for Operator in Binary. Significant recover of
24661 2002-04-10 Miguel de Icaza <miguel@ximian.com>
24663 * class.cs (FindMembers): Allow the Builders of the various
24664 members to be null. If they are skip them. This only happens
24665 during the PInvoke declaration.
24667 2002-04-09 Miguel de Icaza <miguel@ximian.com>
24669 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
24670 failure, so we do not keep going afterwards.
24672 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
24673 wanted to pass `false' as the `is_delegate' argument. If this is
24674 the case, why not use delegate_type == null to mean `is_delegate =
24675 false' and anything else as is_delegate = true.
24677 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
24679 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
24680 code for the section, not the beginning of the tests.
24682 2002-04-08 Miguel de Icaza <miguel@ximian.com>
24684 * cfold.cs: Handle operator + (Enum x, Underlying x)
24686 * expression.cs (Binary): same. Warn about errors where we have
24687 Enum/Enum in operator + as well.
24689 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
24692 - added support for switch(bool)
24693 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
24694 - add TableSwitchEmit() to handle table-based switch statements
24696 2002-04-05 Ravi Pratap <ravi@ximian.com>
24698 * expression.cs (Invocation.OverloadResolve): Factor out code which
24699 does parameter compatibility checking with arguments so that we can
24700 re-use the code even from Delegate.VerifyApplicability
24702 (VerifyArgumentsCompat): Move above code here.
24704 * delegate.cs (VerifyApplicability): Get rid of duplicate code
24705 and instead make a call to the above method.
24707 2002-03-31 Ravi Pratap <ravi@ximian.com>
24709 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
24710 We use it to keep track of classes which are attribute types.
24712 2002-04-02 Miguel de Icaza <miguel@ximian.com>
24714 * delegate.cs (Delegate.Define): Correctly define the types in the
24715 presence of fixed and array parameters.
24717 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
24720 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
24721 include NonPublic after the first iteration.
24723 * class.cs (Indexer.CheckBase): Only check if both parents are
24726 * cs-parser.jay (accessor_body): If empty, set to null.
24728 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
24729 same code path here to resolve constants names that we did have in
24730 MemberAccess.DoResolve. There is too much code duplicated here.
24732 2002-04-01 Miguel de Icaza <miguel@ximian.com>
24734 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
24736 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
24739 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
24740 tokens, numbers and strings.
24742 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
24745 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
24746 asyncronous parameters and the regular parameters.
24748 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
24749 specify the target directory.
24751 * expression.cs: (This.DoResolve): Simplify
24752 (As.Emit): Optimize, do not generate IsInst if the expression is
24753 always of the given type.
24755 (Is.DoResolve): Bug fix, we were reporting both always/never for
24758 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
24759 creating too many unnecessary arrays.
24761 2002-03-31 Miguel de Icaza <miguel@ximian.com>
24763 * class.cs (EmitFieldInitializer): Use Assign expression to assign
24764 fields instead of rolling our own initializer. Takes care of all
24765 implicit conversions, and drops unnecessary static checks/argument.
24767 2002-03-31 Dick Porter <dick@ximian.com>
24769 * driver.cs: use the GetDirectories() return values properly, and
24770 use "/" as path separator.
24772 2002-03-30 Miguel de Icaza <miguel@ximian.com>
24774 * expression.cs (Unary): Optimize - - expr into expr.
24775 (Binary): Optimize a + (-b) into a -b.
24777 * codegen.cs (CodeGen): Made all methods static.
24779 2002-03-29 Miguel de Icaza <miguel@ximian.com>
24783 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
24784 TypeBuilder property.
24786 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
24789 * tree.cs: Removed the various RecordXXXX, and replaced with a
24790 single RecordDecl. Removed all the accessor methods, and just
24791 left a single access point Type
24793 * enum.cs: Rename DefineEnum to DefineType.
24795 * decl.cs: New abstract method `DefineType' used to unify the
24796 Defines for Enumerations, Interfaces, TypeContainers and
24799 (FindType): Moved LookupInterfaceOrClass here. Moved the
24800 LookupBaseClasses method that used to live in class.cs and
24801 interface.cs here, and renamed to FindType.
24803 * delegate.cs: Implement DefineType. Take advantage of the
24804 refactored pattern for locating the parent builder without taking
24805 the parent_builder argument (which we know does not work if we are
24806 nested, and triggering a toplevel definition).
24808 2002-03-28 Miguel de Icaza <miguel@ximian.com>
24810 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
24811 accessibility of a member has changed during override and report
24814 * class.cs (Method.Define, Property.Define): Only complain on
24815 overrides if the method is private, any other accessibility is
24816 fine (and since we just checked the permission is the same, we are
24819 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
24820 and elif are processed always. The other pre-processing
24821 directives are only processed if we are "taking" the path
24823 2002-03-29 Martin Baulig <martin@gnome.org>
24825 * class.cs (Method.Emit): Only emit symbolic debugging info if the
24826 current location is not Null.
24828 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
24829 a separate method so we can profile it.
24831 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
24832 `span.Seconds' are just seconds, but no minutes or hours.
24833 (MainDriver): Profile the CodeGen.SaveSymbols calls.
24835 2002-03-28 Miguel de Icaza <miguel@ximian.com>
24837 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
24838 Remove the gratuitous set of Final:
24840 // If an interface implementation, then we can set Final.
24841 if (((flags & MethodAttributes.Abstract) == 0) &&
24842 implementing.DeclaringType.IsInterface)
24843 flags |= MethodAttributes.Final;
24845 I do not know what I was smoking when I used that.
24848 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
24849 step into fixing the name resolution issues for delegates and
24850 unifying the toplevel name resolution.
24852 2002-03-28 Martin Baulig <martin@gnome.org>
24854 * class.cs (Method.Emit): If we have a symbol writer, call its
24855 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
24856 tell it about the current method.
24858 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
24859 writer that we're going to emit the first byte of IL code for a new
24860 statement (a new source line).
24861 (EmitContext.EmitTopBlock): If we have a symbol writer, call
24862 EmitContext.Mark() before emitting any code.
24864 * location.cs (SymbolDocument): Return null when we're Null.
24866 * statement.cs (Statement): Moved the `Location loc' variable here.
24867 (Statement.EmitBoolExpression): If we have a symbol writer, call
24868 ec.Mark() before emitting any code to tell it that we're at the
24869 beginning of a new statement.
24870 (StatementExpression): Added `Location' argument to the constructor.
24871 (Block): Added public readonly variable `StartLocation' and public
24872 variable `EndLocation'. The latter is to be set using SetEndLocation().
24873 (Block): Added constructor which takes a start and end location.
24874 (Block.SetEndLocation): New method. This sets the end location.
24875 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
24876 local variables we create.
24877 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
24878 each statement and do also mark the begin and end of the block.
24880 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
24881 tell it the current lexer.Location, use Location.Null for the end of the
24883 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
24884 current block, set its end location using SetEndLocation().
24885 (statement_expression): StatementExpression constructor now takes the
24886 lexer.Location as additional argument.
24887 (for_statement, declare_local_variables): Likewise.
24888 (declare_local_variables): When creating a new implicit block, use the
24889 new Block constructor and pass it the lexer.Location.
24891 2002-03-28 Miguel de Icaza <miguel@ximian.com>
24893 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
24894 members also on the parent interfaces recursively.
24896 2002-03-27 Miguel de Icaza <miguel@ximian.com>
24898 * report.cs: Use new formats, since Gonzalo finished the missing
24901 * expression.cs (Binary.ResolveOperator): added missing operator|
24902 operator& and operator^ for bool/bool.
24904 * cs-parser.jay: CheckDef now takes a Location argument that is
24905 used to report errors more precisly (instead of reporting the end
24906 of a definition, we try to track something which is a lot closer
24907 to the source of the problem).
24909 * cs-tokenizer.cs: Track global token use, so we can properly flag
24910 the use of #define/#undef after the first token has been seen.
24912 Also, rename the reportXXXX to Error_DescriptiveName
24914 * decl.cs (DeclSpace.IsTopLevel): Move property here from
24915 TypeContainer, so that Enum and Interface can use this too.
24917 * class.cs (TypeContainer.LookupInterfaceOrClass,
24918 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
24919 `builder' argument. Typically this was used to pass the parent
24920 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
24923 The problem is that a nested class could trigger the definition of
24924 a toplevel class, and the builder would be obviously wrong in that
24927 So we drop this argument, and we compute dynamically the
24928 TypeBuilder/ModuleBuilder (the correct information was available
24929 to us anyways from DeclSpace.Parent)
24931 * interface.cs (Interface.DefineInterface): Drop builder
24932 parameter cleanup like class.cs
24934 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
24937 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
24940 (Try.Emit): Propagate the returns value from the statement.
24942 (Return.Emit): Even if we are leavning
24944 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
24946 * modifiers.cs: Fix the computation of MethodAttributes flags.
24948 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
24950 * driver.cs: allow compilation of files that start with '/'.
24951 Add a default case when checking the argument of --target.
24953 2002-03-25 Miguel de Icaza <miguel@ximian.com>
24955 * interface.cs: Implement the same search algorithm for types in
24956 the interface code.
24958 * delegate.cs: Do not allow multiple definition.
24960 * Recovered ChangeLog that got accidentally amputated
24962 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
24964 * rootcontext.cs: Load manually enum to allow core classes to
24965 contain enumerations.
24967 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
24968 Update to new static methods in TypeManager.
24970 * typemanager.cs (GetMethod, GetConstructor): Use our
24971 implementation of FindMembers to find the members, since during
24972 corlib compilation, the types are TypeBuilders and GetMethod and
24973 GetConstructor do not work.
24975 Make all methods in TypeManager static.
24977 (InitCodeHelpers): Split the functionality from
24978 the InitCodeTypes function.
24980 * driver.cs: Call InitCodeHelpers after we have populated the
24983 * cs-parser.jay (delegate_declaration): we did not used to compute
24984 the delegate name correctly for void delegates.
24986 2002-03-24 Miguel de Icaza <miguel@ximian.com>
24988 * rootcontext.cs (RootContext): Init the interface_resolve_order
24989 and type_container_resolve_order always.
24991 (ResolveCore, BootstrapCorlib_ResolveClass,
24992 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
24993 compiler when compiling with --nostdlib
24995 * class.cs (TypeContainer.DefineType): Check that our parent is
24996 not null. This test is most important when we are bootstraping
24999 * codegen.cs: Split out the symbol writing code.
25001 2002-03-25 Martin Baulig <martin@gnome.org>
25003 * driver.cs (-g): Made -g an alias for --debug.
25005 2002-03-24 Martin Baulig <martin@gnome.org>
25007 * codegen.cs (SymbolWriter): New public variable. Returns the
25008 current symbol writer.
25009 (CodeGen): Added `bool want_debugging_support' argument to the
25010 constructor. If true, tell the ModuleBuild that we want debugging
25011 support and ask it for the ISymbolWriter.
25012 (Save): If we have a symbol writer, call it's Close() method after
25013 saving the assembly.
25015 * driver.c (--debug): New command line argument to create a
25016 debugger information file.
25018 * location.cs (SymbolDocument): New public property. Returns an
25019 ISymbolDocumentWriter object for the current source file or null
25020 if we don't have a symbol writer.
25022 2002-03-21 Miguel de Icaza <miguel@ximian.com>
25024 * driver.cs (LoadAssembly): Correctly return when all the paths
25025 have been tried and not before.
25027 * statement.cs (Switch.Emit): return the actual coverage for this
25028 statement (returns/not-returns)
25030 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25031 switch of the statement if we are the last switch section. That
25032 kills two problems: try/catch problems (we used to emit an empty
25033 nop at the end) and switch statements where all branches would
25036 2002-03-19 Miguel de Icaza <miguel@ximian.com>
25038 * driver.cs: Add default assemblies (the equivalent to the
25039 Microsoft CSC.RSP file)
25041 * cs-tokenizer.cs: When updating `cols and setting it to zero,
25042 also update tokens_seen and set it to false.
25044 * driver.cs: Implement --recurse for Mike.
25046 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25047 correctly splitting out the paths.
25049 2002-03-18 Miguel de Icaza <miguel@ximian.com>
25051 * interface.cs (Interface.PopulateProperty): Instead of using
25052 `parent' as the declaration space for the set parameters, use
25055 * support.cs (InternalParameters): InternalParameters constructor
25056 takes a DeclSpace instead of a TypeContainer.
25058 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25059 types are being initialized, load the address of it before calling
25062 (New): Provide a mechanism to disable the generation of local
25063 value type temporaries when the caller will be providing us with
25064 an address to store it.
25066 (ArrayCreation.EmitDynamicInitializers): Use it.
25068 2002-03-17 Miguel de Icaza <miguel@ximian.com>
25070 * expression.cs (Invocation.EmitArguments): Only probe for array
25071 property if there is more than one argument. Sorry about that.
25073 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25074 empty param arrays.
25076 * class.cs (Method.LabelParameters): Fix incorrect code path that
25077 prevented the `ParamArrayAttribute' from being applied to the
25080 2002-03-16 Miguel de Icaza <miguel@ximian.com>
25082 * support.cs (ReflectionParameters): Correctly compute whether the
25083 last argument is a params array. Fixes the problem with
25086 * typemanager.cs: Make the assemblies array always be non-null
25087 (empty, but non-null)
25089 * tree.cs (RecordDecl): New function that abstracts the recording
25090 of names. This reports error 101, and provides a pointer to the
25091 previous declaration. Fixes a crash in the compiler.
25093 * cs-parser.jay (constructor_declaration): Update to new grammar,
25094 and provide a constructor_body that can be empty.
25096 2002-03-15 Miguel de Icaza <miguel@ximian.com>
25098 * driver.cs: Add support for --resources.
25100 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25101 Make all types for the various array helper methods be integer.
25103 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25104 CheckState to ConvCast.
25106 (ConvCast): Now it takes a `checked' state argument, to avoid
25107 depending on the emit context for the conversion, and just using
25108 the resolve time setting.
25110 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25111 instead of Invocation.EmitArguments. We do not emit the original
25112 arguments, instead we emit those which have been converted to
25113 unsigned int expressions.
25115 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25117 * codegen.cs: ditto.
25119 * expression.cs (LocalVariableReference): Drop the use of the
25120 Store function that depended on the variable index.
25122 * statement.cs (VariableInfo): Drop the `Idx' property from this
25123 class, as this is not taking into account the indexes for
25124 temporaries tat we generate during the execution, getting the
25127 * class.cs: First emit class initializers, then call the parent
25130 * expression.cs (Binary): Fix opcode emision.
25131 (UnaryMutator.EmitCode): Support checked code generation
25133 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25134 matches for events for both the Static and Instance scans,
25135 pointing to the same element. Fix that.
25137 2002-03-14 Miguel de Icaza <miguel@ximian.com>
25139 * rootcontext.cs (ResolveTree): Always set the
25140 interface_resolve_order, because nested interfaces will be calling
25143 * class.cs (GetInterfaceOrClass): Track the same resolution
25144 process used by TypeManager.LookupType. This fixes the nested
25145 type lookups in class declarations (separate path from
25148 (TypeContainer.DefineType): Also define nested interfaces.
25149 (TypeContainer.RegisterOrder): New public function used to
25150 register the order in which child interfaces need to be closed.
25152 Nested interfaces need to be closed after their parents have been
25155 * interface.cs (InterfaceAttr): Put all the logic for computing
25156 the interface attribute here.
25158 (DefineInterface): Register our interface order with the
25159 RootContext or with the TypeContainer depending on the case.
25161 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25163 * cs-parser.jay: rework foreach statement to work with the new
25164 changes to the policy on SimpleNames.
25166 * report.cs: support Stacktrace on warnings as well.
25168 * makefile: drop --unsafe and /unsafe from the compile.
25170 2002-03-13 Ravi Pratap <ravi@ximian.com>
25172 * ecore.cs (StandardConversionExists): Modify to take an Expression
25173 as the first parameter. Ensure we do null -> reference type conversion
25176 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25177 temporary Expression objects.
25179 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25181 * interface.cs: workaround bug in method overloading resolution
25182 (there is already a bugzilla bug for it).
25184 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25186 We could also solve this problem by having a separate path for
25187 performing type lookups, instead of DoResolve, we could have a
25188 ResolveType entry point, and only participating pieces of the
25189 production (simplename, deref, array) would implement this.
25191 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25192 signal SimpleName to only resolve type names and not attempt to
25193 resolve anything else.
25195 * expression.cs (Cast): Set the flag.
25197 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25199 * class.cs: Only report 108 if there is no `new' modifier.
25201 * cs-parser.jay: rework foreach statement to work with the new
25202 changes to the policy on SimpleNames.
25204 * report.cs: support Stacktrace on warnings as well.
25206 * makefile: drop --unsafe and /unsafe from the compile.
25208 2002-03-11 Miguel de Icaza <miguel@ximian.com>
25210 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25211 lookups here, instead of doing that at parse time. This means
25212 that our grammar will not introduce `LocalVariableReferences' as
25213 expressions at this point. That solves the problem of code like
25217 static void Main ()
25221 This is only half the fix. The full fix requires parameters to
25222 also be handled in this way.
25224 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25225 makes the use more obvious of the DeclSpace. The
25226 ec.TypeContainer.TypeBuilder is now only used to pull the
25227 TypeBuilder for it.
25229 My theory is that I can get rid of the TypeBuilder completely from
25230 the EmitContext, and have typecasts where it is used (from
25231 DeclSpace to where it matters).
25233 The only pending problem is that the code that implements Aliases
25234 is on TypeContainer, and probably should go in DeclSpace.
25236 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25237 lookups here, instead of doing that at parse time. This means
25238 that our grammar will not introduce `LocalVariableReferences' as
25239 expressions at this point. That solves the problem of code like
25243 static void Main ()
25247 This is only half the fix. The full fix requires parameters to
25248 also be handled in this way.
25250 * class.cs (Property.DefineMethod): When implementing an interface
25251 method, set newslot, when implementing an abstract method, do not
25252 set the flag (before we tried never setting it, or always setting
25253 it, which is the difference).
25254 (Indexer.DefineMethod): same.
25255 (Method.DefineMethod): same.
25257 * ecore.cs: Only set the status used flag if we get back a Field.
25259 * attribute.cs: Temporary hack, so Paolo can keep working.
25261 2002-03-08 Ravi Pratap <ravi@ximian.com>
25263 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25264 the unmanaged type in the case we have a MarshalAs attribute.
25266 (Resolve): Handle the case when we are parsing the special MarshalAs
25267 attribute [we need to store the unmanaged type to use later]
25269 * typemanager.cs (marshal_as_attr_type): Built in type for the
25270 MarshalAs Attribute.
25272 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
25273 on parameters and accordingly set the marshalling info.
25275 2002-03-09 Miguel de Icaza <miguel@ximian.com>
25277 * class.cs: Optimizing slightly by removing redundant code after
25278 we switched to the `NoTypes' return value.
25279 (Property.DefineMethod): use NoTypes here too.
25281 This fixes the bug I introduced in my last batch of changes.
25283 2002-03-05 Ravi Pratap <ravi@ximian.com>
25285 * tree.cs (RecordEnum): Add. We now keep track of enums too.
25287 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25288 Enums since those are types too.
25290 * cs-parser.jay (enum_declaration): Record enums as we parse them.
25292 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
25293 thanks to a call during the lookup process.
25295 2002-03-07 Miguel de Icaza <miguel@ximian.com>
25297 * statement.cs (Foreach): Lots of work to accomodate a particular
25298 kind of foreach statement that I had not kept in mind. It is
25299 possible to have foreachs on classes that provide a GetEnumerator
25300 method that return objects that implement the "pattern" for using
25301 a foreach, there is no need to support GetEnumerator
25304 This is needed to compile nant.
25306 * decl.cs: Only report 114 if the member is not `Finalize' and if
25307 the warning level is at least 2.
25309 * class.cs: Moved the compare function from Method to
25312 (MethodSignature.InheritableMemberSignatureCompare): Add new
25313 filter function that is used to extract inheritable methods from a
25316 (Method.Define): Use the new `inheritable_method_signature_filter'
25319 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25322 2002-03-06 Miguel de Icaza <miguel@ximian.com>
25324 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
25326 * cs-parser.jay: Add opt_semicolon to the interface declaration.
25328 * expression.cs: Pass location information to
25329 ConvertImplicitStandard.
25331 * class.cs: Added debugging code to track return values from
25334 2002-03-05 Miguel de Icaza <miguel@ximian.com>
25336 * expression.cs (Is.DoResolve): If either side of the `is' is an
25337 interface, do not flag the warning.
25339 * ecore.cs (ImplicitReferenceConversion): We need a separate test
25342 * report.cs: Allow for --fatal to be used with --probe.
25344 * typemanager.cs (NoTypes): Move the definition for the empty Type
25347 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
25349 (TypeContainer.DefineProxy): New function used to proxy to parent
25350 implementations when implementing interfaces.
25351 (TypeContainer.ParentImplements): used to lookup if our parent
25352 implements a public function that is required by an interface.
25353 (TypeContainer.VerifyPendingMethods): Hook this up.
25355 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
25356 `modules' and `assemblies' arraylists into arrays. We only grow
25357 these are the very early start up of the program, so this improves
25358 the speedof LookupType (nicely measured).
25360 * expression.cs (MakeByteBlob): Replaced unsafe code with
25361 BitConverter, as suggested by Paolo.
25363 * cfold.cs (ConstantFold.Binary): Special case: perform constant
25364 folding of string concatenation, but if either side is a string,
25365 and the other is not, then return null, and let the runtime use
25366 the concatenation on the string plus the object (using
25367 `Object.ToString').
25369 2002-03-04 Miguel de Icaza <miguel@ximian.com>
25371 Constant Folding has been implemented now.
25373 * expression.cs (Unary.Reduce): Do not throw an exception, catch
25374 the error instead on types that are not supported in one's
25377 * constant.cs (Constant and all children): New set of functions to
25378 perform implict and explicit conversions.
25380 * ecore.cs (EnumConstant): Implement the new functions to perform
25381 conversion by proxying to the child expression.
25383 * codegen.cs: (ConstantCheckState): Constant evaluation has its
25384 own separate setting that can not be turned off from the command
25385 line using --unchecked or --checked and is only controlled using
25386 the checked/unchecked statements and expressions. This setting is
25387 used by the constant folder to flag errors.
25389 * expression.cs (CheckedExpr, UncheckedExpr): Set the
25390 ConstantCheckState as well.
25392 During Resolve, they also have to flag the state, because the
25393 constant folder runs completely in the Resolve phase.
25395 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
25398 2002-03-01 Miguel de Icaza <miguel@ximian.com>
25400 * cfold.cs: New file, this file contains the constant folder.
25402 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
25403 argument to track whether we are using the resulting address to
25404 load or store a value and provide better error messages.
25406 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
25407 new AddressOf arguments.
25409 * statement.cs (Foreach.EmitCollectionForeach): Update
25411 * expression.cs (Argument.Emit): Call AddressOf with proper
25412 arguments to track usage.
25414 (New.DoEmit): Call AddressOf with new arguments.
25416 (Unary.Emit): Adjust AddressOf call.
25418 2002-03-01 Ravi Pratap <ravi@ximian.com>
25420 * cs-parser.jay (member_access): Change the case for pre-defined types
25421 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
25424 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
25427 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
25428 essentially like methods and apply attributes like MethodImplOptions to them too.
25430 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
25433 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
25434 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
25437 * Update code everywhere accordingly.
25439 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
25441 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
25443 2002-02-28 Ravi Pratap <ravi@ximian.com>
25445 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
25446 try performing lookups against those instead of jumping straight into using
25447 the 'using' clauses.
25449 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
25451 (LookupType): Perform lookups in implicit parents too.
25453 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
25454 sequence as RootContext.LookupType.
25456 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
25457 the various cases of namespace lookups into this method.
25459 2002-03-01 Miguel de Icaza <miguel@ximian.com>
25461 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
25462 in positional arguments)
25464 * class.cs (Operator): Update the AllowedModifiers to contain
25467 * cs-parser.jay: Update operator declaration to allow for the
25468 operator body to be empty.
25470 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
25473 2002-02-27 Miguel de Icaza <miguel@ximian.com>
25475 * class.cs (Method.Emit): Label parameters.
25477 * driver.cs: Return 1 or 0 as the program exit code.
25479 2002-02-26 Miguel de Icaza <miguel@ximian.com>
25481 * expression.cs: Special case the `null' object when trying to
25482 auto-compute the type, as anything can be explicitly converted to
25485 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
25486 spotting this Paolo.
25488 (Expression.ImplicitNumericConversion): Perform comparissions of
25489 the type using the underlying type in the case of an enumeration
25490 rather than using the enumeration type for the compare.
25492 Cope with the underlying == type case, which is not possible to
25495 (Expression.ConvertNumericExplicit): Perform comparissions of
25496 the type using the underlying type in the case of an enumeration
25497 rather than using the enumeration type for the compare.
25499 * driver.cs: If the user does not supply an extension, assume .exe
25501 * cs-parser.jay (if_statement): Rewrote so that we can track the
25502 location for the if statement.
25504 * expression.cs (Binary.ConstantFold): Only concat strings when
25505 the operation is "+", not everything ;-)
25507 * statement.cs (Statement.EmitBoolExpression): Take a location
25509 (If, While, Do): Track location.
25511 * expression.cs (Binary.ResolveOperator): In the object + string
25512 case, I was missing a call to ConvertImplicit
25514 2002-02-25 Ravi Pratap <ravi@ximian.com>
25516 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
25517 Location arguments. Ensure we use RootContext.LookupType to do our work
25518 and not try to do a direct Type.GetType and ModuleBuilder.GetType
25520 * interface.cs (PopulateMethod): Handle the type of the parameter being
25523 * expression.cs (Invocation.BetterFunction): Handle the case when we
25524 have a params method with no fixed arguments and a call is made with no
25527 2002-02-25 Miguel de Icaza <miguel@ximian.com>
25529 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
25530 the verbatim-string-literal
25532 * support.cs (InternalParameters.ParameterModifier): handle null
25534 (InternalParameters.ParameterType): ditto.
25536 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
25537 duplicating the name of the variable parameter.
25538 (GetParameterByName): Fix bug where we were not looking up array
25539 paramters if they were the only present (thanks Paolo!).
25540 (GetParameterInfo): We only have an empty set of types if both
25541 fixed and array are set to null.
25542 (GetParameterInfo-idx): Handle FixedParameter == null
25544 * cs-parser.jay: Handle the case where there is no catch
25545 statements (missing null test).
25547 2002-02-22 Miguel de Icaza <miguel@ximian.com>
25549 * driver.cs (MainDriver): Be conservative on our command line
25552 Catch DirectoryNotFoundException when calling GetFiles.
25554 (SplitPathAndPattern): Used to split the input specification into
25555 a path and a pattern that we can feed to Directory.GetFiles.
25557 2002-02-21 Miguel de Icaza <miguel@ximian.com>
25559 * statement.cs (Fixed): Implement the last case of the Fixed
25560 statement (string handling).
25562 * expression.cs (StringPtr): New class used to return a char * to
25563 a string; Used by the Fixed statement.
25565 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
25567 * expression.cs (Binary.ResolveOperator): Remove redundant
25568 MemberLookup pn parent type.
25569 Optimize union call, we do not need a union if the types are the same.
25570 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
25573 Specialize the use of MemberLookup everywhere, instead of using
25574 the default settings.
25576 (StackAlloc): Implement stackalloc keyword.
25578 * cs-parser.jay: Add rule to parse stackalloc.
25580 * driver.cs: Handle /h, /help, /?
25582 * expression.cs (MakeByteBlob): Removed the hacks we had in place
25583 before we supported unsafe code.
25585 * makefile: add --unsafe to the self compilation of mcs.
25587 2002-02-20 Miguel de Icaza <miguel@ximian.com>
25589 * expression.cs (PointerArithmetic): New class that is used to
25590 perform pointer arithmetic.
25591 (Binary.Resolve): Handle pointer arithmetic
25592 Handle pointer comparission.
25593 (ArrayPtr): Utility expression class that is used to take the
25594 address of an array.
25596 (ElementAccess): Implement array access for pointers
25598 * statement.cs (Fixed): Implement fixed statement for arrays, we
25599 are missing one more case before we are done.
25601 * expression.cs (Indirection): Implement EmitAssign and set the
25602 ExprClass to Variable. This allows pointer dereferences to be
25603 treated as variables, and to have values assigned to them.
25605 * ecore.cs (Expression.StoreFromPtr): New utility function to
25606 store values dereferencing.
25608 2002-02-20 Ravi Pratap <ravi@ximian.com>
25610 * expression.cs (Binary.ResolveOperator): Ensure that we are
25611 not trying to operate on a void type - this fixes the reported
25614 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
25615 the parent implementation is sealed.
25617 * ../errors/cs0239.cs : Add.
25619 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
25621 * typemanager.cs (unverifiable_code_type): Corresponds to
25622 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
25623 which have unsafe code in them.
25625 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
25628 2002-02-19 Miguel de Icaza <miguel@ximian.com>
25630 * cs-tokenizer.cs: Add support for @"litreal strings"
25632 Make tokenizer accept pre-processor directives
25633 on any column (remove the old C-like limitation).
25635 * rootcontext.cs (EmitCode): Emit any global attributes.
25636 (AddGlobalAttributes): Used to keep track of assembly attributes.
25638 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
25640 * cs-parser.jay: Add support for global attributes.
25642 2002-02-17 Miguel de Icaza <miguel@ximian.com>
25644 * expression.cs (Indirection): New helper class. Unary will
25645 create Indirection classes to be able to implement the
25646 IMemoryLocation interface on it.
25648 2002-02-16 Miguel de Icaza <miguel@ximian.com>
25650 * cs-parser.jay (fixed_statement): reference the right statement.
25652 * statement.cs (Fixed.Emit): Finish implementing the fixed
25653 statement for the &x case.
25655 2002-02-14 Miguel de Icaza <miguel@ximian.com>
25657 * class.cs (Property.Define, Method.Define): Remove newslot when
25660 * modifiers.cs: My use of NewSlot when `Abstract' was set was
25661 wrong. NewSlot should only be used if the `new' keyword is present.
25663 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
25664 locating our system dir. Sorry about this.
25666 2002-02-13 Miguel de Icaza <miguel@ximian.com>
25668 * driver.cs (GetSystemDir): Compute correctly the location of our
25669 system assemblies. I was using the compiler directory instead of
25670 the library directory.
25672 2002-02-13 Ravi Pratap <ravi@ximian.com>
25674 * expression.cs (BetterFunction): Put back in what Miguel commented out
25675 since it is the correct fix. The problem is elsewhere ;-)
25677 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
25678 parameters of the parms method are themselves compatible or not !
25680 (StandardConversionExists): Fix very dangerous bug where we were forgetting
25681 to check that a class implements an interface before saying that an implicit
25682 conversion was allowed. Use ImplementsInterface to do the checking.
25684 2002-02-13 Miguel de Icaza <miguel@ximian.com>
25686 * class.cs (Method.Define): Track whether we are an explicit
25687 implementation or not. And only call DefineMethodOverride if we
25688 are an explicit implementation.
25690 (Property.DefineMethod): Ditto.
25692 2002-02-11 Ravi Pratap <ravi@ximian.com>
25694 * expression.cs (BetterFunction): Catch hideous bug which was
25695 preventing us from detecting ambiguous calls due to implicit casts i.e
25698 2002-01-29 Miguel de Icaza <miguel@ximian.com>
25700 * support.cs (Pair): Remove un-needed method. I figured why I was
25701 getting the error in cs-parser.jay, the variable in a foreach loop
25702 is readonly, and the compiler does not really treat this as a variable.
25704 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
25705 instead of EQUALS in grammar.
25707 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
25709 * expression.cs (Unary.DoResolve): Check whether the argument is
25712 2002-01-28 Miguel de Icaza <miguel@ximian.com>
25714 * support.cs: Api for Pair to set a value. Despite the fact that
25715 the variables are public the MS C# compiler refuses to compile
25716 code that accesses the field if the variable is part of a foreach
25719 * statement.cs (Fixed): Begin implementation of the fixed
25722 (Block.AddVariable): Return the VariableInfo on success and null
25723 on failure instead of true/false.
25725 * cs-parser.jay (foreach): Catch errors on variables already
25726 defined (we were ignoring this value before) and properly unwind
25727 the block hierarchy
25729 (fixed_statement): grammar for the fixed statement.
25731 2002-01-25 Miguel de Icaza <miguel@ximian.com>
25733 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
25734 pointer types to be incretemented.
25736 (SizeOf): Implement.
25738 * cs-parser.jay (pointer_member_access): Implement
25739 expr->IDENTIFIER production.
25741 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
25742 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
25745 (Unary): Implement indirection.
25747 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
25748 use in non-unsafe context).
25750 (SimpleName.DoResolve): Check for pointers in field access on safe
25753 (Expression.LoadFromPtr): Factor the load-indirect code in this
25754 function. This was duplicated in UnboxCast and ParameterReference
25756 2002-01-24 Miguel de Icaza <miguel@ximian.com>
25758 * expression.cs (ComposedCast): report an error if a pointer cast
25759 is used in a safe region.
25761 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
25762 pointer type casts in unsafe context.
25764 * codegen.cs (EmitContext): Set up IsUnsafe.
25766 * cs-parser.jay (non_expression_type): Add productions for pointer
25769 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
25770 code. We should not use force into static mode if the method is
25771 not virtual. Fixes bug in MIS
25773 * statement.cs (Do.Emit, While.Emit, For.Emit,
25774 Statement.EmitBoolExpression): Add support to Do and While to
25775 propagate infinite loop as `I do return' semantics.
25777 Improve the For case to also test for boolean constants.
25779 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
25780 to the list of attributes we can add.
25782 Remove `EmitContext' argument.
25784 * class.cs (Method.Define): Apply parameter attributes.
25785 (Constructor.Define): Apply parameter attributes.
25786 (MethodCore.LabelParameters): Move here the core of labeling
25789 * support.cs (ReflectionParameters.ParameterModifier,
25790 InternalParameters.ParameterModifier): Use IsByRef on the type and
25791 only return the OUT bit for these parameters instead of in/out/ref
25794 This is because I miss-understood things. The ParameterInfo.IsIn
25795 and IsOut represent whether the parameter has the [In] and [Out]
25798 2002-01-22 Miguel de Icaza <miguel@ximian.com>
25800 * ecore.cs (FieldExpr.Emit): Release temporaries.
25802 * assign.cs (LocalTemporary.Release): new function.
25804 * codegen.cs (EmitContext.GetTemporaryStorage,
25805 EmitContext.FreeTemporaryStorage): Rework the way we deal with
25806 temporary storage. Now we can "put back" localbuilders when we
25809 2002-01-21 Miguel de Icaza <miguel@ximian.com>
25811 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
25812 need to make a copy of the variable to generate verifiable code.
25814 2002-01-19 Miguel de Icaza <miguel@ximian.com>
25816 * driver.cs: Compute dynamically the system directory.
25818 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
25819 Slower, but more generally useful. Used by the abstract
25820 registering implementation.
25822 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
25823 the rules for the special rule on Type/instances. First check if
25824 we have the same name, and if so, try that special static path
25825 rather than the instance path.
25827 2002-01-18 Miguel de Icaza <miguel@ximian.com>
25829 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
25832 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
25833 Enum, ValueType, Delegate or Array for non-corlib compiles.
25835 * cs-tokenizer.cs: Catch long identifiers (645)
25837 * typemanager.cs (IndexerPropetyName): Ravi never tested this
25840 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
25841 fix, we were returning too early, so we were not registering
25842 pending methods from abstract classes.
25844 Do not register pending methods if the class is abstract.
25846 * expression.cs (Conditional.DoResolve): Report circular implicit
25847 conversions when we neecd to compute it for conditional
25850 (Is.DoResolve): If the expression is always of the provided type,
25851 flag warning 183. If the expression can not ever be of the
25852 provided type flag warning 184.
25854 * class.cs: Catch 169 as well.
25856 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
25859 2002-01-18 Nick Drochak <ndrochak@gol.com>
25861 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
25863 2002-01-17 Miguel de Icaza <miguel@ximian.com>
25865 * interface.cs: (PopulateMethod): Check for pointers being defined
25866 only if the unsafe context is active.
25867 (PopulateProperty): ditto.
25868 (PopulateIndexer): ditto.
25870 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
25871 specified. If pointers are present, make sure that they are
25872 present in an unsafe context.
25873 (Constructor, Constructor.Define): ditto.
25874 (Field, Field.Define): ditto.
25875 (Property, Property.Define): ditto.
25876 (Event, Event.Define): ditto.
25878 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
25879 hashtable if there are classes or structs defined.
25881 * expression.cs (LocalVariableReference.DoResolve): Simplify this
25882 code, as the constant resolution moved.
25884 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
25885 the metadata, so we can flag error 133.
25887 * decl.cs (MemberCore.UnsafeOK): New function to test that a
25888 pointer is being declared in an unsafe context.
25890 2002-01-16 Miguel de Icaza <miguel@ximian.com>
25892 * modifiers.cs (Modifiers.Check): Require a Location argument.
25893 Report error 227 for Unsafe use.
25895 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
25897 * statement.cs (For.Emit): If the test is null, then report that
25898 we do `return', as we wont reach anything afterwards.
25900 (Switch.SwitchGoverningType): Track the expression that matched
25903 * driver.cs: Allow negative numbers as an error code to flag.
25905 * cs-parser.jay: Handle 1551.
25907 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
25909 2002-01-15 Miguel de Icaza <miguel@ximian.com>
25911 * cs-parser.jay: Report 1518 (type declaration can only contain
25912 class, struct, interface, enum or delegate)
25914 (switch_label): Report 1523 (keywords `case' or `default' must
25917 (opt_switch_sections): Report 1522 (empty switch)
25919 * driver.cs: Report 1515 (response file specified multiple times)
25920 Report 1516 (Source file specified multiple times).
25922 * expression.cs (Argument.Resolve): Signal 1510
25924 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
25925 access not allowed in static code)
25927 2002-01-11 Ravi Pratap <ravi@ximian.com>
25929 * typemanager.cs (IsPointerType): Utility method which we are going
25932 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
25933 the object type, so we take care of that.
25935 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
25937 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
25938 added to non-params parameters :-)
25940 * typemanager.cs (CSharpName): Include 'void' type too.
25942 (void_ptr_type): Include in the set of core types.
25944 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
25947 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
25950 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
25951 completely forgotten about it.
25953 2002-01-10 Ravi Pratap <ravi@ximian.com>
25955 * cs-parser.jay (pointer_type): Add. This begins our implementation
25956 of parsing rules for unsafe code.
25958 (unsafe_statement): Implement.
25960 (embedded_statement): Modify to include the above.
25962 * statement.cs (Unsafe): Implement new class for unsafe blocks.
25964 * codegen.cs (EmitContext.InUnsafe): Add. This determines
25965 if the current context is an unsafe one.
25967 * cs-parser.jay (local_variable_pointer_type): Since local variable types
25968 are handled differently, we need separate rules for them.
25970 (local_variable_declaration): Update to use local_variable_pointer_type
25971 to allow variable declarations of unmanaged pointer types.
25973 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
25974 in unsafe contexts.
25976 * ../errors/cs0214.cs : Add.
25978 2002-01-16 Nick Drochak <ndrochak@gol.com>
25980 * makefile: remove 'response' file when cleaning.
25982 2002-01-15 Miguel de Icaza <miguel@ximian.com>
25984 * cs-parser.jay: Report 1524.
25986 2002-01-14 Miguel de Icaza <miguel@ximian.com>
25988 * typemanager.cs (RegisterMethod): drop checking if we have
25989 registered this from here
25991 2002-01-12 Miguel de Icaza <miguel@ximian.com>
25993 * class.cs (Method.EmitDestructor): Implement calling our base
25996 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
25997 value of InFinally.
25999 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26000 this routine and will wrap the call in a try/catch block. Deal
26003 2002-01-11 Miguel de Icaza <miguel@ximian.com>
26005 * ecore.cs (Expression.MemberLookup): instead of taking a
26006 parameter `same_type' that was used to tell whether we could
26007 access private members we compute our containing type from the
26010 (FieldExpr): Added partial support for volatile fields. This does
26011 not work for volatile fields exposed from assemblies, as I can not
26012 figure out how to extract the modreq from it.
26014 Updated all the source files to use this.
26016 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26017 because it is referenced by MemberLookup very often.
26019 2002-01-09 Ravi Pratap <ravi@ximian.com>
26021 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26022 TypeBuilder.GetCustomAttributes to retrieve what we need.
26024 Get rid of redundant default_member_attr_type as this is the same as
26025 default_member_type which already exists.
26027 * interface.cs, attribute.cs : Update accordingly.
26029 2002-01-08 Miguel de Icaza <miguel@ximian.com>
26031 * typemanager.cs: Enable IndexerPropertyName again. It does not
26032 work for TYpeBuilders though. Ravi, can you please fix this?
26034 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26036 * expression.cs (Argument.Emit): Handle the case of ref objects
26037 being passed to ref functions;
26039 (ParameterReference.EmitLoad): Loads the content of the pointer
26040 without dereferencing.
26042 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26044 * cs-tokenizer.cs: Implemented the pre-processing expressions.
26046 2002-01-08 Ravi Pratap <ravi@ximian.com>
26048 * class.cs (Indexer.DefineMethod): Incorporate the interface
26049 type in the name of the method if we are doing explicit interface
26052 * expression.cs (ConversionExists): Remove as it is completely obsolete.
26054 (BetterConversion): Fix extremely trivial bug where we were referring to
26055 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26058 * ../errors/bug16.cs : Add although we have fixed it.
26060 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26062 * expression.cs (BaseIndexer): Begin implementation.
26064 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26066 * cs-parser.jay (indexer_declarator): Use qualified_identifier
26067 production directly to remove a shift/reduce, and implement
26068 explicit interface implementation.
26070 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26071 after a floating point suffix.
26073 * expression.cs (DoNumericPromotions): Improved the conversion for
26074 uint/uint. If we have a constant, we avoid doing a typecast to a
26077 * class.cs (Indexer): Implement explicit interface implementation
26080 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26082 * class.cs: make the default instance constructor public and hidebysig.
26084 2001-01-03 Ravi Pratap <ravi@ximian.com>
26086 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26087 so we can call it from elsewhere.
26089 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26090 we emit it internally if the class has a defined indexer; otherwise the user
26091 emits it by decorating the class definition with the DefaultMemberAttribute.
26093 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26094 attribute is not used on a type which defines an indexer.
26096 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26097 character when we skip whitespace.
26099 * ../errors/cs0646.cs : Add.
26101 2002-01-03 Miguel de Icaza <miguel@ximian.com>
26103 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26106 * makefile: Add practical target `mcs3.exe' which builds the third
26107 generation compiler.
26109 * expression.cs (New): Fix structures constructor calling.
26111 * class.cs (Property, Method, Indexer): Emit Final flag on the
26112 method if we are an interface implementation and we are not
26115 * ecore.cs (PropertyExpr): New public field `IsBase', tells
26116 whether this property is referencing a `base' method.
26118 * expression.cs (Invocation.EmitCall): take an extra argument:
26119 is_base, this is used to determine whether the `call' or
26120 `callvirt' opcode should be used.
26123 * delegate.cs: update EmitCall.
26125 * class.cs (Method.Define): Set NewSlot for the cases where we are
26126 not implementing an interface method.
26128 (Property.Define): ditto.
26130 2002-01-02 Miguel de Icaza <miguel@ximian.com>
26132 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26133 'r'. Allows mcs to parse itself fully.
26135 2002-01-02 Ravi Pratap <ravi@ximian.com>
26137 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26138 of the number of initializers that require the InitializeArray method.
26140 (CheckIndices): Store the Expression in all cases - not the plain value. Also
26141 update the above field where necessary.
26143 (MakeByteBlob): Update accordingly.
26145 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
26148 (EmitDynamicInitializers): Update in accordance with the new optimization.
26150 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26151 same OpCode applies.
26153 * cs-parser.jay : Fix some glaring errors I introduced.
26155 2002-01-01 Ravi Pratap <ravi@ximian.com>
26157 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26158 so that we can check for name clashes there too.
26160 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26161 for interface indexers.
26163 * interfaces.cs (Define): Emit the default member attribute.
26165 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26166 variable was being referred to while setting the value ;-)
26168 2002-01-01 Miguel de Icaza <miguel@ximian.com>
26170 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26171 byte-by-byte information when we know the data is zero.
26173 Make the block always a multiple of 4, because
26174 DefineInitializedData has a bug.
26176 * assign.cs: Fix, we should assign from the temporary, not from
26179 * expression.cs (MakeByteBlob): Fix my incorrect code.
26181 2001-12-31 Miguel de Icaza <miguel@ximian.com>
26183 * typemanager.cs (EnumToUnderlying): This function is used to get
26184 the underlying type from an enumeration, because it does not
26187 * constant.cs: Use the I4_S form for values between -128 and 127.
26189 * statement.cs (Block.LookupLabel): Looks up a label.
26190 (Block): Drop support for labeled blocks.
26192 (LabeledStatement): New kind of statement that represents a label
26195 (Goto): Finally implement this bad boy.
26197 * cs-parser.jay: Update to reflect new mechanism to implement
26200 2001-12-30 Miguel de Icaza <miguel@ximian.com>
26202 * codegen.cs (EmitContext.This): a codegen property that keeps the
26203 a single instance of this instead of creating many different this
26206 * delegate.cs (Delegate.DoResolve): Update to use the property;
26208 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26210 * expression.cs (BaseAccess.DoResolve): Ditto.
26212 2001-12-29 Ravi Pratap <ravi@ximian.com>
26214 * typemanager.cs (methodimpl_attr_type): Add to hold the type
26215 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26217 (InitCoreTypes): Update accordingly.
26219 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26220 so we can quickly store the state.
26222 (ApplyAttributes): Set the correct implementation flags
26223 for InternalCall methods.
26225 2001-12-29 Miguel de Icaza <miguel@ximian.com>
26227 * expression.cs (EmitCall): if a method is not virtual, then do
26228 not use callvirt on it.
26230 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26231 user defined stuff) requires the use of stobj, which takes an
26232 address on the stack instead of an array and an index. So emit
26233 the Ldelema operation for it.
26235 (EmitStoreOpcode): Use stobj for valuetypes.
26237 (UnaryMutator.EmitCode): Use the right 1 value depending on
26238 whether we are dealing with int64/uint64, float or doubles.
26240 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26241 constructors that I implemented last night.
26243 (Constructor.IsDefault): Fix to work properly for static
26246 * cs-parser.jay (CheckDef): report method signature errors.
26247 Update error number 103 to be 132.
26249 * decl.cs: New AdditionResult enumeration value: MethodExists.
26250 Although we do this check for methods later on in the semantic
26251 analysis, catching repeated default constructors is so easy that
26252 we catch these here.
26254 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26257 (ParameterReference.EmitAssign, Emit): handle
26260 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26261 (ArrayAccess.EmitStoreOpcode): ditto.
26263 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26265 * expression.cs (MakeByteBlob): Complete all the missing types
26266 (uint, short, ushort, byte, sbyte)
26268 * class.cs: Only init instance field initializers on instance
26271 Rename `constructors' to instance_constructors.
26273 (TypeContainer.AddConstructor): Only add constructors to the list
26274 if it is not static.
26276 Make sure that we handle default_static_constructor independently
26277 everywhere where we handle instance_constructors
26279 2001-12-28 Miguel de Icaza <miguel@ximian.com>
26281 * class.cs: Do not lookup or create a base initializer for a
26282 static constructor.
26284 (ConstructorInitializer.Resolve): use the proper type to lookup
26287 * cs-parser.jay: Report error 1585 (modifiers between type and name).
26289 * enum.cs, interface.cs: Remove CloseType, this is taken care by
26292 * decl.cs: CloseType is now an virtual method, the default
26293 implementation just closes this type.
26295 2001-12-28 Ravi Pratap <ravi@ximian.com>
26297 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26298 to PreserveSig by default. Also emit HideBySig on such methods.
26300 Basically, set the defaults to standard values.
26302 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26303 argument, if candidate is better, it can't be worse than the best !
26305 (Invocation): Re-write bits to differentiate between methods being
26306 applicable in their expanded form and their normal form - for params
26309 Get rid of use_standard everywhere as only standard conversions are allowed
26310 in overload resolution.
26312 More spec conformance.
26314 2001-12-27 Miguel de Icaza <miguel@ximian.com>
26316 * driver.cs: Add --timestamp, to see where the compiler spends
26319 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26320 `this' in static code.
26322 (SimpleName.DoResolve): Implement in terms of a helper function
26323 that allows static-references to be passed upstream to
26326 (Expression.ResolveWithSimpleName): Resolve specially simple
26327 names when called by MemberAccess to implement the special
26330 (Expression.ImplicitReferenceConversion): Handle conversions from
26331 Null to reference types before others, as Null's type is
26334 * expression.cs (Invocation.EmitCall): Handle the special case of
26335 calling methods declared on a reference type from a ValueType
26336 (Base classes System.Object and System.Enum)
26338 (MemberAccess.Resolve): Only perform lookups on Enumerations if
26339 the left hand side is a TypeExpr, not on every enumeration.
26341 (Binary.Resolve): If types are reference types, then do a cast to
26342 object on operators != and == of both arguments.
26344 * typemanager.cs (FindMembers): Extract instance and static
26345 members if requested.
26347 * interface.cs (PopulateProperty): Use void_type instead of null
26348 as the return type for the setter method.
26350 (PopulateIndexer): ditto.
26352 2001-12-27 Ravi Pratap <ravi@ximian.com>
26354 * support.cs (ReflectionParameters): Fix minor bug where we
26355 were examining the wrong parameter for the ParamArray attribute.
26357 Cope with requests for the type of the parameter at position
26358 greater than the params parameter's. We now return the element
26359 type of the params array as that makes more sense.
26361 * expression.cs (Invocation.IsParamsMethodApplicable): Update
26362 accordingly as we no longer have to extract the element type
26365 (Invocation.OverloadResolve): Update.
26367 2001-12-27 Miguel de Icaza <miguel@ximian.com>
26369 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
26370 against IEnumerator, test whether the return value is a descendant
26371 of the IEnumerator interface.
26373 * class.cs (Indexer.Define): Use an auxiliary method to implement
26374 the other bits of the method definition. Begin support for
26375 explicit interface implementation.
26377 (Property.DefineMethod): Use TypeManager.void_type instead of null
26378 for an empty return value.
26380 2001-12-26 Miguel de Icaza <miguel@ximian.com>
26382 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
26383 dealing with a FieldExpr which is composed of a FieldBuilder, in
26384 the code path we did extract the constant, but we should have
26385 obtained the underlying value to be able to cast it (otherwise we
26386 end up in an infinite loop, this is what Ravi was running into).
26388 (ArrayCreation.UpdateIndices): Arrays might be empty.
26390 (MemberAccess.ResolveMemberAccess): Add support for section
26391 14.5.4.1 that deals with the special case of E.I when E is a type
26392 and something else, that I can be a reference to a static member.
26394 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
26395 handle a particular array type to create byte blobs, it is just
26396 something we dont generate byteblobs for.
26398 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
26401 * location.cs (Push): remove the key from the hashtable that we
26402 are about to add. This happens for empty files.
26404 * driver.cs: Dispose files after we have parsed them.
26406 (tokenize): new function that only runs the tokenizer on its
26407 input, for speed testing.
26409 2001-12-26 Ravi Pratap <ravi@ximian.com>
26411 * class.cs (Event.Define): Define the private field only if there
26412 are no accessors defined.
26414 * expression.cs (ResolveMemberAccess): If there is no associated
26415 field with the event, that means we have an event defined with its
26416 own accessors and we should flag error cs0070 since transforming
26417 ourselves into a field is not valid in that case.
26419 * ecore.cs (SimpleName.DoResolve): Same as above.
26421 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
26422 and charset to sane values.
26424 2001-12-25 Ravi Pratap <ravi@ximian.com>
26426 * assign.cs (DoResolve): Perform check on events only if they
26427 are being accessed outside the declaring type.
26429 * cs-parser.jay (event_declarations): Update rules to correctly
26430 set the type of the implicit parameter etc.
26432 (add_accessor, remove_accessor): Set current local parameters.
26434 * expression.cs (Binary): For delegate addition and subtraction,
26435 cast the return value from the method into the appropriate delegate
26438 2001-12-24 Ravi Pratap <ravi@ximian.com>
26440 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
26441 of these as the workaround is unnecessary.
26443 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
26444 delegate data - none of that is needed at all.
26446 Re-write bits to extract the instance expression and the delegate method
26449 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
26452 * attribute.cs (ApplyAttributes): New method to take care of common tasks
26453 of attaching attributes instead of duplicating code everywhere.
26455 * everywhere : Update code to do attribute emission using the above method.
26457 2001-12-23 Miguel de Icaza <miguel@ximian.com>
26459 * expression.cs (IsParamsMethodApplicable): if there are not
26460 parameters, return immediately.
26462 * ecore.cs: The 0 literal can be implicity converted to an enum
26465 (SimpleName.DoResolve): First lookup the type, then lookup the
26468 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
26469 want to get its address. If the InstanceExpression is not
26470 addressable, store the result in a temporary variable, then get
26473 * codegen.cs: Only display 219 errors on warning level or above.
26475 * expression.cs (ArrayAccess): Make it implement the
26476 IMemoryLocation interface.
26478 (Binary.DoResolve): handle the operator == (object a, object b)
26479 and operator != (object a, object b) without incurring into a
26480 BoxedCast (because 5 != o should never be performed).
26482 Handle binary enumerator operators.
26484 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
26485 value type, otherwise use Ldelem_ref.
26487 Use precomputed names;
26489 (AddressOf): Implement address of
26491 * cs-parser.jay (labeled_statement): Fix recursive block
26492 addition by reworking the production.
26494 * expression.cs (New.DoEmit): New has a special case:
26496 If we are dealing with a ValueType, we have a few
26497 situations to deal with:
26499 * The target of New is a ValueType variable, that is
26500 easy, we just pass this as the variable reference
26502 * The target of New is being passed as an argument,
26503 to a boxing operation or a function that takes a
26506 In this case, we need to create a temporary variable
26507 that is the argument of New.
26510 2001-12-23 Ravi Pratap <ravi@ximian.com>
26512 * rootcontext.cs (LookupType): Check that current_type is not null before
26513 going about looking at nested types.
26515 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
26516 not implement the IAssignMethod interface any more.
26518 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
26519 where we tranform them into FieldExprs if they are being resolved from within
26520 the declaring type.
26522 * ecore.cs (SimpleName.DoResolve): Do the same here.
26524 * assign.cs (DoResolve, Emit): Clean up code considerably.
26526 * ../errors/bug10.cs : Add.
26528 * ../errors/cs0070.cs : Add.
26530 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
26532 * assign.cs : Get rid of EventIsLocal everywhere.
26534 2001-12-23 Miguel de Icaza <miguel@ximian.com>
26536 * ecore.cs (ConvertIntLiteral): finished the implementation.
26538 * statement.cs (SwitchLabel): Convert the value we are using as a
26539 key before looking up the table.
26541 2001-12-22 Miguel de Icaza <miguel@ximian.com>
26543 * codegen.cs (EmitTopBlock): Require a Location argument now.
26545 * cs-parser.jay (constructor_declarator): We need to setup
26546 current_local_parameters before we parse the
26547 opt_constructor_initializer, to allow the variables to be bound
26548 to the constructor arguments.
26550 * rootcontext.cs (LookupType): First lookup nested classes in our
26551 class and our parents before we go looking outside our class.
26553 * expression.cs (ConstantFold): Extract/debox the values at the
26556 * rootcontext.cs (EmitCode): Resolve the constants first before we
26557 resolve the types. This is not really needed, but it helps debugging.
26559 * statement.cs: report location.
26561 * cs-parser.jay: pass location to throw statement.
26563 * driver.cs: Small bug fix.
26565 * report.cs: Updated format to be 4-zero filled digits.
26567 2001-12-22 Ravi Pratap <ravi@ximian.com>
26569 * expression.cs (CheckIndices): Fix minor bug where the wrong
26570 variable was being referred to ;-)
26572 (DoEmit): Do not call EmitStaticInitializers when the
26573 underlying type is System.Object.
26575 2001-12-21 Ravi Pratap <ravi@ximian.com>
26577 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
26578 and do the usual workaround for SRE.
26580 * class.cs (MyEventBuilder.EventType): New member to get at the type
26581 of the event, quickly.
26583 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
26585 * assign.cs (Assign.DoResolve): Handle the case when the target
26586 is an EventExpr and perform the necessary checks.
26588 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
26591 (SimpleName.MemberStaticCheck): Include check for EventExpr.
26593 (EventExpr): Set the type in the constructor itself since we
26594 are meant to be born fully resolved.
26596 (EventExpr.Define): Revert code I wrote earlier.
26598 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
26599 instance expression is null. The instance expression is a This in that case
26600 or a null, depending on whether it is a static method or not.
26602 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
26603 refers to more than one method.
26605 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
26606 and accordingly flag errors.
26608 2001-12-21 Miguel de Icaza <miguel@ximian.com>
26610 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
26612 2001-12-22 Miguel de Icaza <miguel@ximian.com>
26614 * location.cs (ToString): Provide useful rutine.
26616 2001-12-21 Miguel de Icaza <miguel@ximian.com>
26618 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
26619 objects, return the actual integral boxed.
26621 * statement.cs (SwitchLabel): define an ILLabel for each
26624 (Switch.CheckSwitch): If the value is a Literal, extract
26625 the underlying literal.
26627 Also in the unused hashtable we had, add the SwitchLabel so we can
26628 quickly look this value up.
26630 * constant.cs: Implement a bunch of new constants. Rewrite
26631 Literal based on this. Made changes everywhere to adapt to this.
26633 * expression.cs (Expression.MakeByteBlob): Optimize routine by
26634 dereferencing array only once, and also copes with enumrations.
26636 bytes are two bytes wide, not one.
26638 (Cast): Perform constant conversions.
26640 * ecore.cs (TryImplicitIntConversion): Return literals instead of
26641 wrappers to the literals here.
26643 * expression.cs (DoNumericPromotions): long literals can converted
26644 to ulong implicity (this is taken care of elsewhere, but I was
26645 missing this spot).
26647 * ecore.cs (Expression.Literalize): Make the return type Literal,
26648 to improve type checking.
26650 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
26652 2001-12-20 Miguel de Icaza <miguel@ximian.com>
26654 * literal.cs: Revert code from ravi that checked the bounds. The
26655 bounds are sane by the definition of the type itself.
26657 * typemanager.cs: Fix implementation of ImplementsInterface. We
26658 need to actually look up in our parent hierarchy for interfaces
26661 * const.cs: Use the underlying type for enumerations
26663 * delegate.cs: Compute the basename for the delegate creation,
26664 that should fix the delegate test case, and restore the correct
26665 Type Lookup semantics in rootcontext
26667 * rootcontext.cs: Revert Ravi's last patch. The correct way of
26668 referencing a nested type with the Reflection API is using the "+"
26671 * cs-parser.jay: Do not require EOF token at the end.
26673 2001-12-20 Ravi Pratap <ravi@ximian.com>
26675 * rootcontext.cs (LookupType): Concatenate type names with
26676 a '.' instead of a '+' The test suite passes again.
26678 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
26679 field of the enumeration.
26681 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
26682 the case when the member is an EventExpr.
26684 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
26685 static has an associated instance expression.
26687 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
26689 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
26691 * class.cs (Event.Define): Register event and perform appropriate checks
26694 We define the Add and Remove methods even if the use provides none because
26695 in that case, we provide default implementations ourselves.
26697 Define a private field of the type of the event. This is done by the CSC compiler
26698 and we should be doing it too ;-)
26700 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
26701 More methods we use in code we generate.
26703 (multicast_delegate_type, delegate_type): Two separate types since the distinction
26706 (InitCoreTypes): Update accordingly for the above.
26708 * class.cs (Event.Emit): Generate code for default accessors that we provide
26710 (EmitDefaultMethod): Do the job in the above.
26712 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
26715 2001-12-20 Miguel de Icaza <miguel@ximian.com>
26717 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
26718 builders even if we were missing one.
26720 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
26721 pass the Basename as our class name instead of the Name. The
26722 basename will be correctly composed for us.
26724 * parameter.cs (Paramters): Now takes a Location argument.
26726 * decl.cs (DeclSpace.LookupType): Removed convenience function and
26727 make all the code call directly LookupType in RootContext and take
26728 this chance to pass the Location information everywhere.
26730 * Everywhere: pass Location information.
26732 2001-12-19 Miguel de Icaza <miguel@ximian.com>
26734 * class.cs (Constructor.Define): Updated way of detecting the
26735 length of the parameters.
26737 (TypeContainer.DefineType): Use basename as the type name for
26740 (TypeContainer.Define): Do not recursively define types here, as
26741 definition is taken care in order by the RootContext.
26743 * tree.cs: Keep track of namespaces in a per-file basis.
26745 * parameter.cs (Parameter.ComputeSignature): Update to use
26748 (Parameters.GetSignature): ditto.
26750 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
26751 instead of a TypeContainer.
26753 (Interface.SemanticAnalysis): Use `this' instead of our parent to
26754 resolve names. Because we need to be resolve in our context, not
26757 * driver.cs: Implement response files.
26759 * class.cs (TypeContainer.DefineType): If we are defined, do not
26760 redefine ourselves.
26762 (Event.Emit): Emit the code for add/remove handlers.
26763 (Event.Define): Save the MethodBuilders for add/remove.
26765 * typemanager.cs: Use pair here too.
26767 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
26768 DictionaryEntry requires the first argument to be non-null.
26770 (enum_declaration): Compute full name for registering the
26773 (delegate_declaration): Instead of using
26774 formal_parameter_list, use opt_formal_parameter_list as the list
26777 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
26778 (EventParsing): New property that controls whether `add' and
26779 `remove' are returned as tokens or identifiers (for events);
26781 2001-12-19 Ravi Pratap <ravi@ximian.com>
26783 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
26784 use MyEventBuilder only and let it wrap the real builder for us.
26786 (MyEventBuilder): Revamp constructor etc.
26788 Implement all operations that we perform on EventBuilder in precisely the same
26791 (FindMembers): Update to use the EventBuilder member.
26793 (Event.Emit): Update accordingly.
26795 2001-12-18 Ravi Pratap <ravi@ximian.com>
26797 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
26798 by calling the appropriate methods.
26800 (GetCustomAttributes): Make stubs as they cannot possibly do anything
26803 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
26805 2001-12-17 Ravi Pratap <ravi@ximian.com>
26807 * delegate.cs (Delegate.Populate): Check that the return type
26808 and various parameters types are indeed accessible.
26810 * class.cs (Constructor.Define): Same here.
26812 (Field.Define): Ditto.
26814 (Event.Define): Ditto.
26816 (Operator.Define): Check that the underlying Method defined itself
26817 correctly - so it's MethodBuilder should not be null.
26819 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
26820 expression happens to be null.
26822 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
26823 members but as of now we don't seem to be able to do anything really useful with it.
26825 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
26826 not the EventBuilder.
26828 2001-12-18 Miguel de Icaza <miguel@ximian.com>
26830 * cs-tokenizer.cs: Add support for defines.
26831 Add support for #if, #elif, #else, #endif
26833 (eval_var): evaluates a variable.
26834 (eval): stubbed for evaluating functions.
26836 * cs-parser.jay: Pass the defines information
26838 * driver.cs: Add --define command line option.
26840 * decl.cs: Move MemberCore here.
26842 Make it the base class for DeclSpace. This allows us to catch and
26843 report 108 and 109 for everything now.
26845 * class.cs (TypeContainer.Define): Extract all the members
26846 before populating and emit the warning 108 (new keyword required
26847 to override) instead of having each member implement this.
26849 (MemberCore.Define): New abstract method, we will be using this in
26850 the warning reporting engine in Populate.
26852 (Operator.Define): Adjust to new MemberCore protocol.
26854 * const.cs (Const): This does not derive from Expression, it is a
26855 temporary object we use to create fields, it is a MemberCore.
26857 * class.cs (Method.Define): Allow the entry point to be in a
26860 * driver.cs: Rewrite the argument handler to clean it up a bit.
26862 * rootcontext.cs: Made it just an auxiliary namespace feature by
26863 making everything static.
26865 * driver.cs: Adapt code to use RootContext type name instead of
26868 * delegate.cs: Remove RootContext argument.
26870 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
26873 * class.cs (Event.Define): The lookup can fail.
26875 * cs-tokenizer.cs: Begin implementation of pre-procesor.
26877 * expression.cs: Resolve the this instance before invoking the code.
26879 2001-12-17 Miguel de Icaza <miguel@ximian.com>
26881 * cs-parser.jay: Add a production in element_access that allows
26882 the thing to become a "type" reference. This way we can parse
26883 things like "(string [])" as a type.
26885 Note that this still does not handle the more complex rules of
26889 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
26891 * ecore.cs: (CopyNewMethods): new utility function used to
26892 assemble the list of methods from running FindMembers.
26894 (MemberLookup): Rework FindMembers so that
26896 2001-12-16 Miguel de Icaza <miguel@ximian.com>
26898 * class.cs (TypeContainer): Remove Delegates who fail to be
26901 * delegate.cs (Populate): Verify that we dont get null return
26902 values. TODO: Check for AsAccessible.
26904 * cs-parser.jay: Use basename to emit error 574 (destructor should
26905 have the same name as container class), not the full name.
26907 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
26908 possible representation.
26910 Also implements integer type suffixes U and L.
26912 2001-12-15 Miguel de Icaza <miguel@ximian.com>
26914 * expression.cs (ArrayCreation.DoResolve): We need to do the
26915 argument resolution *always*.
26917 * decl.cs: Make this hold the namespace. Hold the root context as
26919 (LookupType): Move here.
26921 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
26923 * location.cs (Row, Name): Fixed the code, it was always returning
26924 references to the first file.
26926 * interface.cs: Register properties defined through interfaces.
26928 * driver.cs: Add support for globbing on the command line
26930 * class.cs (Field): Make it derive from MemberCore as well.
26933 2001-12-15 Ravi Pratap <ravi@ximian.com>
26935 * class.cs (Event::Define): Check that the type of the event is a delegate
26936 type else flag error #66.
26938 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
26941 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
26942 values of EntryPoint, CharSet etc etc.
26944 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
26946 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
26947 be null and we should ignore this. I am not sure if this is really clean. Apparently,
26948 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
26949 which needs this to do its work.
26951 * ../errors/cs0066.cs : Add.
26953 2001-12-14 Miguel de Icaza <miguel@ximian.com>
26955 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
26958 * class.cs: (MethodSignature.MethodSignature): Removed hack that
26959 clears out the parameters field.
26960 (MemberSignatureCompare): Cleanup
26962 (MemberCore): New base class used to share code between MethodCore
26965 (RegisterRequiredImplementations) BindingFlags.Public requires
26966 either BindingFlags.Instace or Static. Use instance here.
26968 (Property): Refactored code to cope better with the full spec.
26970 * parameter.cs (GetParameterInfo): Return an empty array instead
26973 * class.cs (Property): Abstract or extern properties have no bodies.
26975 * parameter.cs (GetParameterInfo): return a zero-sized array.
26977 * class.cs (TypeContainer.MethodModifiersValid): Move all the
26978 method modifier validation to the typecontainer so we can reuse
26979 this on properties.
26981 (MethodCore.ParameterTypes): return an empty sized array of types.
26983 (Property.Define): Test property modifier validity.
26985 Add tests for sealed/override too.
26987 (Method.Emit): abstract or extern methods have no bodies.
26989 2001-12-14 Ravi Pratap <ravi@ximian.com>
26991 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
26994 (Method::Define, ::Emit): Modify accordingly.
26996 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
26998 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27000 * makefile: Pass in /unsafe.
27002 2001-12-13 Miguel de Icaza <miguel@ximian.com>
27004 * class.cs (MakeKey): Kill routine.
27006 * class.cs (TypeContainer.Define): Correctly define explicit
27007 method implementations (they require the full interface name plus
27010 * typemanager.cs: Deply the PtrHashtable here and stop using the
27011 lame keys. Things work so much better.
27013 This of course broke everyone who depended on `RegisterMethod' to
27014 do the `test for existance' test. This has to be done elsewhere.
27016 * support.cs (PtrHashtable): A hashtable that avoid comparing with
27017 the object stupid Equals method (because, that like fails all over
27018 the place). We still do not use it.
27020 * class.cs (TypeContainer.SetRequiredInterface,
27021 TypeContainer.RequireMethods): Killed these two routines and moved
27022 all the functionality to RegisterRequiredImplementations.
27024 (TypeContainer.RegisterRequiredImplementations): This routine now
27025 registers all the implementations required in an array for the
27026 interfaces and abstract methods. We use an array of structures
27027 which can be computed ahead of time to reduce memory usage and we
27028 also assume that lookups are cheap as most classes will not
27029 implement too many interfaces.
27031 We also avoid creating too many MethodSignatures.
27033 (TypeContainer.IsInterfaceMethod): Update and optionally does not
27034 clear the "pending" bit if we find that there are problems with
27037 (TypeContainer.VerifyPendingMethods): Update to report errors of
27038 methods that look like implementations but are not.
27040 (TypeContainer.Define): Add support for explicit interface method
27043 2001-12-12 Miguel de Icaza <miguel@ximian.com>
27045 * typemanager.cs: Keep track of the parameters here instead of
27046 being a feature of the TypeContainer.
27048 * class.cs: Drop the registration of parameters here, as
27049 InterfaceMethods are also interface declarations.
27051 * delegate.cs: Register methods with the TypeManager not only with
27052 the TypeContainer. This code was buggy.
27054 * interface.cs: Full registation here.
27056 2001-12-11 Miguel de Icaza <miguel@ximian.com>
27058 * expression.cs: Remove reducer for binary expressions, it can not
27061 * const.cs: Put here the code that used to go into constant.cs
27063 * constant.cs: Put here the code for constants, this is a new base
27064 class for Literals.
27066 * literal.cs: Make Literal derive from Constant.
27068 2001-12-09 Miguel de Icaza <miguel@ximian.com>
27070 * statement.cs (Return.Emit): Report error 157 if the user
27071 attempts to return from a finally block.
27073 (Return.Emit): Instead of emitting a return, jump to the end of
27076 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27077 LocalBuilder to store the result of the function. ReturnLabel is
27078 the target where we jump.
27081 2001-12-09 Radek Doulik <rodo@ximian.com>
27083 * cs-parser.jay: remember alias in current namespace
27085 * ecore.cs (SimpleName::DoResolve): use aliases for types or
27088 * class.cs (LookupAlias): lookup alias in my_namespace
27090 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27092 (LookupAlias): lookup alias in this and if needed in parent
27095 2001-12-08 Miguel de Icaza <miguel@ximian.com>
27099 * rootcontext.cs: (ModuleBuilder) Made static, first step into
27100 making things static. I need this to avoid passing the
27101 TypeContainer when calling ParameterType.
27103 * support.cs (InternalParameters.ParameterType): Remove ugly hack
27104 that did string manipulation to compute the type and then call
27105 GetType. Use Parameter.ParameterType instead.
27107 * cs-tokenizer.cs: Consume the suffix for floating values.
27109 * expression.cs (ParameterReference): figure out whether this is a
27110 reference parameter or not. Kill an extra variable by computing
27111 the arg_idx during emission.
27113 * parameter.cs (Parameters.GetParameterInfo): New overloaded
27114 function that returns whether a parameter is an out/ref value or not.
27116 (Parameter.ParameterType): The type of the parameter (base,
27117 without ref/out applied).
27119 (Parameter.Resolve): Perform resolution here.
27120 (Parameter.ExternalType): The full type (with ref/out applied).
27122 * statement.cs (Using.Emit, Using.EmitExpression): Implement
27123 support for expressions on the using statement.
27125 2001-12-07 Miguel de Icaza <miguel@ximian.com>
27127 * statement.cs (Using.EmitLocalVariableDecls): Split the
27128 localvariable handling of the using statement.
27130 (Block.EmitMeta): Keep track of variable count across blocks. We
27131 were reusing slots on separate branches of blocks.
27133 (Try.Emit): Emit the general code block, we were not emitting it.
27135 Check the type of the declaration to be an IDisposable or
27136 something that can be implicity converted to it.
27138 Emit conversions if required.
27140 * ecore.cs (EmptyExpression): New utility class.
27141 (Expression.ImplicitConversionExists): New utility function.
27143 2001-12-06 Miguel de Icaza <miguel@ximian.com>
27145 * statement.cs (Using): Implement.
27147 * expression.cs (LocalVariableReference): Support read only variables.
27149 * statement.cs: Remove the explicit emit for the Leave opcode.
27150 (VariableInfo): Add a readonly field.
27152 2001-12-05 Miguel de Icaza <miguel@ximian.com>
27154 * ecore.cs (ConvCast): new class used to encapsulate the various
27155 explicit integer conversions that works in both checked and
27156 unchecked contexts.
27158 (Expression.ConvertNumericExplicit): Use new ConvCast class to
27159 properly generate the overflow opcodes.
27161 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27163 * statement.cs: The correct type for the EmptyExpression is the
27164 element_type, not the variable type. Ravi pointed this out.
27166 2001-12-04 Ravi Pratap <ravi@ximian.com>
27168 * class.cs (Method::Define): Handle PInvoke methods specially
27169 by using DefinePInvokeMethod instead of the usual one.
27171 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27172 above to do the task of extracting information and defining the method.
27174 2001-12-04 Ravi Pratap <ravi@ximian.com>
27176 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27177 of the condition for string type.
27179 (Emit): Move that here.
27181 (ArrayCreation::CheckIndices): Keep string literals in their expression
27184 (EmitDynamicInitializers): Handle strings appropriately.
27186 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27188 * codegen.cs (EmitContext): Replace multiple variables with a
27189 single pointer to the current Switch statement.
27191 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27194 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27198 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27201 (Foreach.Emit): Foreach on arrays was not setting
27202 up the loop variables (for break/continue).
27204 (GotoCase): Semi-implented.
27206 2001-12-03 Ravi Pratap <ravi@ximian.com>
27208 * attribute.cs (CheckAttribute): Handle system attributes by using
27209 Attribute.GetAttributes to examine information we need.
27211 (GetValidPlaces): Same here.
27213 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27215 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27217 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27219 (Method::Define): Set appropriate flags if we have a DllImport attribute.
27221 (Method::Emit): Handle the case when we are a PInvoke method.
27223 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27225 * expression.cs: Use ResolveWithSimpleName on compound names.
27227 2001-12-02 Ravi Pratap <ravi@ximian.com>
27229 * constant.cs (EmitConstant): Make sure we resolve the associated expression
27230 before trying to reduce it.
27232 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27234 * constant.cs (LookupConstantValue): Implement.
27236 (EmitConstant): Use the above in emitting the constant.
27238 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27239 that are user-defined by doing a LookupConstantValue on them.
27241 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27244 2001-11-29 Miguel de Icaza <miguel@ximian.com>
27246 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27248 (BaseAccess.DoResolve): Implement.
27250 (MemberAccess.DoResolve): Split this routine into a
27251 ResolveMemberAccess routine that can be used independently
27253 2001-11-28 Miguel de Icaza <miguel@ximian.com>
27255 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27256 As that share bits of the implementation. Is returns a boolean,
27257 while As returns the Type that is being probed.
27259 2001-12-01 Ravi Pratap <ravi@ximian.com>
27261 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27262 instead of a Literal - much easier.
27264 (EnumInTransit): Remove - utterly useless :-)
27266 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27268 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27270 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27271 chain when we have no associated expression.
27273 2001-11-30 Ravi Pratap <ravi@ximian.com>
27275 * constant.cs (Define): Use Location while reporting the errror.
27277 Also emit a warning when 'new' is used and there is no inherited
27280 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
27283 (LookupEnumValue): Implement to lookup an enum member's value and define it
27286 (Populate): Re-write accordingly to use the above routine.
27288 2001-11-27 Miguel de Icaza <miguel@ximian.com>
27290 * expression.cs (This): Fix prototype for DoResolveLValue to
27291 override the base class DoResolveLValue.
27293 * cs-parser.cs: Report errors cs574 and cs575 (destructor
27296 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27297 (we need to load the address of the field here). This fixes
27300 (FieldExpr.DoResolveLValue): Call the DoResolve
27301 function to initialize the Instance expression.
27303 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27304 correctly the GetEnumerator operation on a value type.
27306 * cs-parser.jay: Add more simple parsing error catches.
27308 * statement.cs (Switch): Add support for string switches.
27309 Handle null specially.
27311 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
27313 2001-11-28 Ravi Pratap <ravi@ximian.com>
27315 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27317 (declare_local_constant): New helper function.
27319 * statement.cs (AddConstant): Keep a separate record of constants
27321 (IsConstant): Implement to determine if a variable is a constant.
27323 (GetConstantExpression): Implement.
27325 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
27327 * statement.cs (IsVariableDefined): Re-write.
27329 2001-11-27 Ravi Pratap <ravi@ximian.com>
27331 * class.cs (TypeContainer::FindMembers): Look for constants
27332 in the case when we are looking for MemberTypes.Field
27334 * expression.cs (MemberAccess::DoResolve): Check that in the
27335 case we are a FieldExpr and a Literal, we are not being accessed
27336 by an instance reference.
27338 * cs-parser.jay (local_constant_declaration): Implement.
27340 (declaration_statement): Implement for constant declarations.
27342 2001-11-26 Miguel de Icaza <miguel@ximian.com>
27344 * statement.cs (Switch): Catch double defaults.
27346 (Switch): More work on the switch() statement
27347 implementation. It works for integral values now, need to finish
27351 2001-11-24 Miguel de Icaza <miguel@ximian.com>
27353 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
27354 integer literals into other integer literals. To be used by
27357 2001-11-24 Ravi Pratap <ravi@ximian.com>
27359 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
27362 (EmitDynamicInitializers): Cope with the above since we extract data
27363 directly from ArrayData now.
27365 (ExpectInitializers): Keep track of whether initializers are mandatory
27368 (Bounds): Make it a hashtable to prevent the same dimension being
27369 recorded for every element in that dimension.
27371 (EmitDynamicInitializers): Fix bug which prevented the Set array method
27374 Also fix bug which was causing the indices to be emitted in the reverse
27377 2001-11-24 Miguel de Icaza <miguel@ximian.com>
27379 * expression.cs (ArrayCreation): Implement the bits that Ravi left
27380 unfinished. They do not work, because the underlying code is
27383 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27385 * cs-parser.jay: Remove bogus fixme.
27387 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
27388 on Switch statement.
27390 2001-11-23 Ravi Pratap <ravi@ximian.com>
27392 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
27395 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
27396 parameter. Apparently, any expression is allowed.
27398 (ValidateInitializers): Update accordingly.
27400 (CheckIndices): Fix some tricky bugs thanks to recursion.
27402 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
27403 I was being completely brain-dead.
27405 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
27406 and re-write acordingly.
27408 (DelegateInvocation): Re-write accordingly.
27410 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
27412 (MakeByteBlob): Handle types more correctly.
27414 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
27415 initialization from expressions but it is incomplete because I am a complete
27418 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27420 * statement.cs (If.Emit): Fix a bug that generated incorrect code
27421 on If. Basically, we have to return `true' (ie, we do return to
27422 our caller) only if both branches of the if return.
27424 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
27425 short-circuit operators, handle them as short circuit operators.
27427 (Cast.DoResolve): Resolve type.
27428 (Cast.Cast): Take an expression as the target type.
27430 * cs-parser.jay (cast_expression): Remove old hack that only
27431 allowed a limited set of types to be handled. Now we take a
27432 unary_expression and we resolve to a type during semantic
27435 Use the grammar productions from Rhys to handle casts (this is
27436 not complete like Rhys syntax yet, we fail to handle that corner
27437 case that C# has regarding (-x), but we will get there.
27439 2001-11-22 Ravi Pratap <ravi@ximian.com>
27441 * class.cs (EmitFieldInitializer): Take care of the case when we have a
27442 field which is an array type.
27444 * cs-parser.jay (declare_local_variables): Support array initialization too.
27446 * typemanager.cs (MakeKey): Implement.
27448 (everywhere): Use the above appropriately.
27450 * cs-parser.jay (for_statement): Update for array initialization while
27451 declaring variables.
27453 * ecore.cs : The error message was correct, it's the variable's names that
27454 were misleading ;-) Make the code more readable.
27456 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
27457 the correct type etc.
27459 (ConvertExplicit): Handle Enum types by examining the underlying type.
27461 2001-11-21 Ravi Pratap <ravi@ximian.com>
27463 * parameter.cs (GetCallingConvention): Always return
27464 CallingConventions.Standard for now.
27466 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27468 * expression.cs (Binary.ResolveOperator): Update the values of `l'
27469 and `r' after calling DoNumericPromotions.
27471 * ecore.cs: Fix error message (the types were in the wrong order).
27473 * statement.cs (Foreach.ProbeCollectionType): Need to pass
27474 BindingFlags.Instance as well
27476 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
27477 implicit int literal conversion in an empty cast so that we
27478 propagate the right type upstream.
27480 (UnboxCast): new class used to unbox value types.
27481 (Expression.ConvertExplicit): Add explicit type conversions done
27484 (Expression.ImplicitNumericConversion): Oops, forgot to test for
27485 the target type before applying the implicit LongLiterals to ULong
27488 2001-11-21 Miguel de Icaza <miguel@ximian.com>
27490 * cs-parser.jay (for_statement): Reworked the way For works: now
27491 we declare manually any variables that are introduced in
27492 for_initializer to solve the problem of having out-of-band code
27493 emition (that is what got for broken).
27495 (declaration_statement): Perform the actual variable declaration
27496 that used to be done in local_variable_declaration here.
27498 (local_variable_declaration): Do not declare anything, just pass
27499 the information on a DictionaryEntry
27501 2001-11-20 Ravi Pratap <ravi@ximian.com>
27503 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
27504 re-write of the logic to now make it recursive.
27506 (UpdateIndices): Re-write accordingly.
27508 Store element data in a separate ArrayData list in the above methods.
27510 (MakeByteBlob): Implement to dump the array data into a byte array.
27512 2001-11-19 Ravi Pratap <ravi@ximian.com>
27514 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
27517 * constant.cs (Define): Implement.
27519 (EmitConstant): Re-write fully.
27521 Pass in location info.
27523 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
27526 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
27527 DictionaryEntry since we need location info too.
27529 (constant_declaration): Update accordingly.
27531 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
27532 code into another method : UpdateIndices.
27534 2001-11-18 Ravi Pratap <ravi@ximian.com>
27536 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
27537 some type checking etc.
27539 2001-11-17 Ravi Pratap <ravi@ximian.com>
27541 * expression.cs (ArrayCreation::ValidateInitializers): Implement
27542 bits to provide dimension info if the user skips doing that.
27544 Update second constructor to store the rank correctly.
27546 2001-11-16 Ravi Pratap <ravi@ximian.com>
27548 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
27549 and try to implement.
27551 * ../errors/cs0150.cs : Add.
27553 * ../errors/cs0178.cs : Add.
27555 2001-11-16 Miguel de Icaza <miguel@ximian.com>
27557 * statement.cs: Implement foreach on multi-dimensional arrays.
27559 * parameter.cs (Parameters.GetParameterByName): Also lookup the
27560 name of the params argument.
27562 * expression.cs: Use EmitStoreOpcode to get the right opcode while
27563 initializing the array.
27565 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
27566 we can use this elsewhere.
27568 * statement.cs: Finish implementation of foreach for single
27571 * cs-parser.jay: Use an out-of-band stack to pass information
27572 around, I wonder why I need this.
27574 foreach_block: Make the new foreach_block the current_block.
27576 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
27577 function used to return a static Parameters structure. Used for
27578 empty parameters, as those are created very frequently.
27580 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
27582 2001-11-15 Ravi Pratap <ravi@ximian.com>
27584 * interface.cs : Default modifier is private, not public. The
27585 make verify test passes again.
27587 2001-11-15 Ravi Pratap <ravi@ximian.com>
27589 * support.cs (ReflectionParameters): Fix logic to determine
27590 whether the last parameter is a params one. Test 9 passes again.
27592 * delegate.cs (Populate): Register the builders we define with
27593 RegisterParameterForBuilder. Test 19 passes again.
27595 * cs-parser.jay (property_declaration): Reference $6 instead
27596 of $$ to get at the location.
27598 (indexer_declaration): Similar stuff.
27600 (attribute): Ditto.
27602 * class.cs (Property): Register parameters for the Get and Set methods
27603 if they exist. Test 23 passes again.
27605 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
27606 call to EmitArguments as we are sure there aren't any params arguments.
27607 Test 32 passes again.
27609 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
27610 IndexOutOfRangeException.
27612 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
27613 Test 33 now passes again.
27615 2001-11-15 Miguel de Icaza <miguel@ximian.com>
27617 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
27618 broke a bunch of things. Will have to come up with a better way
27619 of tracking locations.
27621 * statement.cs: Implemented foreach for single dimension arrays.
27623 2001-11-09 Miguel de Icaza <miguel@ximian.com>
27625 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
27626 an error. This removes the lookup from the critical path.
27628 * cs-parser.jay: Removed use of temporary_loc, which is completely
27631 2001-11-14 Miguel de Icaza <miguel@ximian.com>
27633 * support.cs (ReflectionParameters.ParameterModifier): Report
27634 whether the argument is a PARAMS argument or not.
27636 * class.cs: Set the attribute `ParamArrayAttribute' on the
27637 parameter argument.
27639 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
27640 and cons_param_array_attribute (ConstructorInfo for
27641 ParamArrayAttribute).,
27643 * codegen.cs: Emit the return using the `Return' statement, that
27644 way we can report the error correctly for missing return values.
27646 * class.cs (Method.Emit): Clean up.
27648 * expression.cs (Argument.Resolve): Take another argument: the
27649 location where this argument is used. Notice that this is not
27650 part of the "Argument" class as to reduce the size of the
27651 structure (we know the approximate location anyways).
27653 Test if the argument is a variable-reference, if not, then
27654 complain with a 206.
27656 (Argument.Emit): Emit addresses of variables.
27658 (Argument.FullDesc): Simplify.
27660 (Invocation.DoResolve): Update for Argument.Resolve.
27662 (ElementAccess.DoResolve): ditto.
27664 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
27665 method should be virtual, as this method is always virtual.
27667 (NewDelegate.DoResolve): Update for Argument.Resolve.
27669 * class.cs (ConstructorInitializer.DoResolve): ditto.
27671 * attribute.cs (Attribute.Resolve): ditto.
27673 2001-11-13 Miguel de Icaza <miguel@ximian.com>
27675 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
27677 * expression.cs (ParameterReference): Drop IStackStorage and implement
27678 IAssignMethod instead.
27680 (LocalVariableReference): ditto.
27682 * ecore.cs (FieldExpr): Drop IStackStorage and implement
27683 IAssignMethod instead.
27685 2001-11-13 Miguel de Icaza <miguel@ximian.com>
27687 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
27688 enumerations that are used in heavily used structures derive from
27689 byte in a laughable and pathetic attempt to reduce memory usage.
27690 This is the kind of pre-optimzations that you should not do at
27691 home without adult supervision.
27693 * expression.cs (UnaryMutator): New class, used to handle ++ and
27694 -- separatedly from the other unary operators. Cleans up the
27695 code, and kills the ExpressionStatement dependency in Unary.
27697 (Unary): Removed `method' and `Arguments' from this class, making
27698 it smaller, and moving it all to SimpleCall, so I can reuse this
27699 code in other locations and avoid creating a lot of transient data
27700 strucutres when not required.
27702 * cs-parser.jay: Adjust for new changes.
27704 2001-11-11 Miguel de Icaza <miguel@ximian.com>
27706 * enum.cs (Enum.Populate): If there is a failure during
27709 * cs-parser.jay (opt_enum_base): we used to catch type errors
27710 here, but this is really incorrect. The type error should be
27711 catched during semantic analysis.
27713 2001-12-11 Ravi Pratap <ravi@ximian.com>
27715 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
27716 current_local_parameters as expected since I, in my stupidity, had forgotten
27719 * attribute.cs (GetValidPlaces): Fix stupid bug.
27721 * class.cs (Method::Emit): Perform check on applicability of attributes.
27723 (Constructor::Emit): Ditto.
27725 (Field::Emit): Ditto.
27727 (Field.Location): Store location information.
27729 (Property, Event, Indexer, Operator): Ditto.
27731 * cs-parser.jay (field_declaration): Pass in location for each field.
27733 * ../errors/cs0592.cs : Add.
27735 2001-11-12 Ravi Pratap <ravi@ximian.com>
27737 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
27739 (InitCoreTypes): Update accordingly.
27741 (RegisterAttrType, LookupAttr): Implement.
27743 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
27744 info about the same.
27746 (Resolve): Update to populate the above as necessary.
27748 (Error592): Helper.
27750 (GetValidPlaces): Helper to the above.
27752 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
27754 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
27756 2001-11-12 Ravi Pratap <ravi@ximian.com>
27758 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
27760 * ../errors/cs0617.cs : Add.
27762 2001-11-11 Ravi Pratap <ravi@ximian.com>
27764 * enum.cs (Emit): Rename to Populate to be more consistent with what
27765 we expect it to do and when exactly it is called.
27767 * class.cs, rootcontext.cs : Update accordingly.
27769 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
27770 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
27772 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
27774 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
27775 of a fieldinfo using the above, when dealing with a FieldBuilder.
27777 2001-11-10 Ravi Pratap <ravi@ximian.com>
27779 * ../errors/cs0031.cs : Add.
27781 * ../errors/cs1008.cs : Add.
27783 * ../errrors/cs0543.cs : Add.
27785 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
27788 (FindMembers): Implement.
27790 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
27791 enums and delegates too.
27793 (enum_types): Rename to builder_to_enum.
27795 (delegate_types): Rename to builder_to_delegate.
27797 * delegate.cs (FindMembers): Implement.
27799 2001-11-09 Ravi Pratap <ravi@ximian.com>
27801 * typemanager.cs (IsEnumType): Implement.
27803 * enum.cs (Emit): Re-write parts to account for the underlying type
27804 better and perform checking etc.
27806 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
27807 of the underlying type.
27809 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
27812 * enum.cs (error31): Helper to report error #31.
27814 * cs-parser.jay (enum_declaration): Store location of each member too.
27816 * enum.cs (member_to_location): New hashtable.
27818 (AddEnumMember): Update location hashtable.
27820 (Emit): Use the location of each member while reporting errors.
27822 2001-11-09 Miguel de Icaza <miguel@ximian.com>
27824 * cs-parser.jay: A for_initializer if is a
27825 local_variable_declaration really ammount to have an implicit
27826 block with the variable declaration and no initializer for for.
27828 * statement.cs (For.Emit): Cope with null initializers.
27830 This fixes the infinite loop on for initializers.
27832 2001-11-08 Miguel de Icaza <miguel@ximian.com>
27834 * enum.cs: More cleanup.
27836 * ecore.cs: Remove dead code.
27838 * class.cs (Property.Emit): More simplification.
27839 (Event.Emit): ditto.
27841 Reworked to have less levels of indentation.
27843 2001-11-08 Ravi Pratap <ravi@ximian.com>
27845 * class.cs (Property): Emit attributes.
27855 * enum.cs (Emit): Ditto.
27857 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
27860 * class.cs (Field, Event, etc.): Move attribute generation into the
27861 Emit method everywhere.
27863 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
27864 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
27865 as we had no way of defining nested enums !
27867 * rootcontext.cs : Adjust code accordingly.
27869 * typemanager.cs (AddEnumType): To keep track of enum types separately.
27871 2001-11-07 Ravi Pratap <ravi@ximian.com>
27873 * expression.cs (EvalConstantExpression): Move into ecore.cs
27875 * enum.cs (Enum): Rename some members and make them public and readonly
27876 according to our convention.
27878 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
27881 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
27883 (Enum::Emit): Write a simple version for now which doesn't try to compute
27884 expressions. I shall modify this to be more robust in just a while.
27886 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
27888 (TypeContainer::CloseType): Create the Enum types too.
27890 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
27892 * expression.cs (EvalConstantExpression): Get rid of completely.
27894 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
27895 user-defined values and other cases.
27897 (IsValidEnumLiteral): Helper function.
27899 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
27900 out there in the case we had a literal FieldExpr.
27902 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
27904 (Literalize): Revamp a bit to take two arguments.
27906 (EnumLiteral): New class which derives from Literal to wrap enum literals.
27908 2001-11-06 Ravi Pratap <ravi@ximian.com>
27910 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
27912 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
27914 (Resolve): Use the above to ensure we have proper initializers.
27916 2001-11-05 Ravi Pratap <ravi@ximian.com>
27918 * expression.cs (Expression::EvalConstantExpression): New method to
27919 evaluate constant expressions.
27921 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
27923 2001-11-07 Miguel de Icaza <miguel@ximian.com>
27925 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
27928 (Binary.ResolveOperator): Handle operator != (object a, object b)
27929 and operator == (object a, object b);
27931 (Binary.DoNumericPromotions): Indicate whether the numeric
27932 promotion was possible.
27934 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
27937 Made the ArrayAccess implement interface IAssignMethod instead of
27938 IStackStore as the order in which arguments are passed reflects
27941 * assign.cs: Instead of using expr.ExprClass to select the way of
27942 assinging, probe for the IStackStore/IAssignMethod interfaces.
27944 * typemanager.cs: Load InitializeArray definition.
27946 * rootcontext.cs (RootContext.MakeStaticData): Used to define
27947 static data that can be used to initialize arrays.
27949 2001-11-05 Miguel de Icaza <miguel@ximian.com>
27951 * expression.cs: Handle operator== and operator!= for booleans.
27953 (Conditioal.Reduce): Implement reducer for the ?: operator.
27955 (Conditional.Resolve): Implement dead code elimination.
27957 (Binary.Resolve): Catch string literals and return a new
27958 concatenated string.
27960 (Unary.Reduce): Implement reduction of unary expressions.
27962 * ecore.cs: Split out the expression core handling here.
27964 (Expression.Reduce): New method used to perform constant folding
27965 and CSE. This is needed to support constant-expressions.
27967 * statement.cs (Statement.EmitBoolExpression): Pass true and false
27968 targets, and optimize for !x.
27970 2001-11-04 Ravi Pratap <ravi@ximian.com>
27972 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
27973 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
27974 set custom atttributes.
27976 * literal.cs (Literal::GetValue): New abstract method to return the actual
27977 value of the literal, cast as an object.
27979 (*Literal): Implement GetValue method.
27981 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
27982 expressions to the arraylist but objects of type Argument.
27984 * class.cs (TypeContainer::Emit): Emit our attributes too.
27986 (Method::Emit, Constructor::Emit): Ditto.
27988 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
27989 to be ignoring earlier.
27991 2001-11-03 Ravi Pratap <ravi@ximian.com>
27993 * attribute.cs (AttributeSection::Define): Implement to do the business
27994 of constructing a CustomAttributeBuilder.
27996 (Attribute): New trivial class. Increases readability of code.
27998 * cs-parser.jay : Update accordingly.
28000 (positional_argument_list, named_argument_list, named_argument): New rules
28002 (attribute_arguments): Use the above so that we are more correct.
28004 2001-11-02 Ravi Pratap <ravi@ximian.com>
28006 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28007 to perform all checks for a method with a params parameter.
28009 (Invocation::OverloadResolve): Update to use the above method and therefore
28010 cope correctly with params method invocations.
28012 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
28015 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28016 constructors in our parent too because we can't afford to miss out on
28019 * attribute.cs (AttributeSection): New name for the class Attribute
28021 Other trivial changes to improve readability.
28023 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28024 use the new class names.
28026 2001-11-01 Ravi Pratap <ravi@ximian.com>
28028 * class.cs (Method::Define): Complete definition for params types too
28030 (Indexer::Define): Ditto.
28032 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28033 Cope everywhere with a request for info about the array parameter.
28035 2001-11-01 Ravi Pratap <ravi@ximian.com>
28037 * tree.cs (RecordNamespace): Fix up to check for the correct key.
28039 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
28040 local_variable_type to extract the string corresponding to the type.
28042 (local_variable_type): Fixup the action to use the new helper method.
28044 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
28047 * expression.cs : Clean out code which uses the above.
28049 2001-10-31 Ravi Pratap <ravi@ximian.com>
28051 * typemanager.cs (RegisterMethod): Check if we already have an existing key
28052 and bale out if necessary by returning a false.
28054 (RegisterProperty): Ditto.
28056 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28057 and print out appropriate error messages.
28059 * interface.cs (everywhere): Ditto.
28061 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28062 location to constructor.
28064 * class.cs (Property, Event, Indexer): Update accordingly.
28066 * ../errors/cs111.cs : Added.
28068 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28069 of a method, as laid down by the spec.
28071 (Invocation::OverloadResolve): Use the above method.
28073 2001-10-31 Ravi Pratap <ravi@ximian.com>
28075 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28076 now take a TypeContainer and a Parameters object.
28078 (ParameterData): Modify return type of ParameterModifier method to be
28079 Parameter.Modifier and not a string.
28081 (ReflectionParameters, InternalParameters): Update accordingly.
28083 * expression.cs (Argument::GetParameterModifier): Same here.
28085 * support.cs (InternalParameters::ParameterType): Find a better way of determining
28086 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28087 symbol in it at all so maybe this is only for now.
28089 2001-10-30 Ravi Pratap <ravi@ximian.com>
28091 * support.cs (InternalParameters): Constructor now takes an extra argument
28092 which is the actual Parameters class.
28094 (ParameterDesc): Update to provide info on ref/out modifiers.
28096 * class.cs (everywhere): Update call to InternalParameters to pass in
28097 the second argument too.
28099 * support.cs (ParameterData): Add ParameterModifier, which is a method
28100 to return the modifier info [ref/out etc]
28102 (InternalParameters, ReflectionParameters): Implement the above.
28104 * expression.cs (Argument::ParameterModifier): Similar function to return
28105 info about the argument's modifiers.
28107 (Invocation::OverloadResolve): Update to take into account matching modifiers
28110 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28111 a new SetFormalParameters object which we pass to InternalParameters.
28113 2001-10-30 Ravi Pratap <ravi@ximian.com>
28115 * expression.cs (NewArray): Merge into the ArrayCreation class.
28117 2001-10-29 Ravi Pratap <ravi@ximian.com>
28119 * expression.cs (NewArray): Merge classes NewBuiltinArray and
28120 NewUserdefinedArray into one as there wasn't much of a use in having
28123 * expression.cs (Argument): Change field's name to ArgType from Type.
28125 (Type): New readonly property which returns the proper type, taking into
28126 account ref/out modifiers.
28128 (everywhere): Adjust code accordingly for the above.
28130 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28131 whether we are emitting for a ref or out parameter.
28133 * expression.cs (Argument::Emit): Use the above field to set the state.
28135 (LocalVariableReference::Emit): Update to honour the flag and emit the
28138 * parameter.cs (Attributes): Set the correct flags for ref parameters.
28140 * expression.cs (Argument::FullDesc): New function to provide a full desc.
28142 * support.cs (ParameterData): Add method ParameterDesc to the interface.
28144 (ReflectionParameters, InternalParameters): Implement the above method.
28146 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28149 (Invocation::FullMethodDesc): Ditto.
28151 2001-10-29 Miguel de Icaza <miguel@ximian.com>
28153 * cs-parser.jay: Add extra production for the second form of array
28156 * expression.cs (ArrayCreation): Update to reflect the above
28159 * Small changes to prepare for Array initialization.
28161 2001-10-28 Miguel de Icaza <miguel@ximian.com>
28163 * typemanager.cs (ImplementsInterface): interface might be null;
28164 Deal with this problem;
28166 Also, we do store negative hits on the cache (null values), so use
28167 this instead of calling t.GetInterfaces on the type everytime.
28169 2001-10-28 Ravi Pratap <ravi@ximian.com>
28171 * typemanager.cs (IsBuiltinType): New method to help determine the same.
28173 * expression.cs (New::DoResolve): Get rid of array creation code and instead
28174 split functionality out into different classes.
28176 (New::FormArrayType): Move into NewBuiltinArray.
28178 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28181 (NewBuiltinArray): New class to handle creation of built-in arrays.
28183 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28184 account creation of one-dimensional arrays.
28186 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28188 (NewUserdefinedArray::DoResolve): Implement.
28190 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28192 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28193 we maintain inside the TypeManager. This is necessary to perform lookups on the
28196 (LookupType): Update to perform GetType on the module builders too.
28198 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28200 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28202 2001-10-23 Ravi Pratap <ravi@ximian.com>
28204 * expression.cs (New::DoResolve): Implement guts of array creation.
28206 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28208 2001-10-27 Miguel de Icaza <miguel@ximian.com>
28210 * expression.cs: Fix bug I introduced lsat night that broke
28213 (Expression.Resolve): Report a 246 error (can not resolve name)
28214 if we find a SimpleName in the stream.
28216 (Expression.ResolveLValue): Ditto.
28218 (Expression.ResolveWithSimpleName): This function is a variant of
28219 ResolveName, this one allows SimpleNames to be returned without a
28220 warning. The only consumer of SimpleNames is MemberAccess
28222 2001-10-26 Miguel de Icaza <miguel@ximian.com>
28224 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28225 might arrive here. I have my doubts that this is correct.
28227 * statement.cs (Lock): Implement lock statement.
28229 * cs-parser.jay: Small fixes to support `lock' and `using'
28231 * cs-tokenizer.cs: Remove extra space
28233 * driver.cs: New flag --checked, allows to turn on integer math
28236 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28237 Threading.Monitor.Exit
28239 2001-10-23 Miguel de Icaza <miguel@ximian.com>
28241 * expression.cs (IndexerAccess::DoResolveLValue): Set the
28242 Expression Class to be IndexerAccess.
28244 Notice that Indexer::DoResolve sets the eclass to Value.
28246 2001-10-22 Miguel de Icaza <miguel@ximian.com>
28248 * class.cs (TypeContainer::Emit): Emit code for indexers.
28250 * assign.cs (IAssignMethod): New interface implemented by Indexers
28251 and Properties for handling assignment.
28253 (Assign::Emit): Simplify and reuse code.
28255 * expression.cs (IndexerAccess, PropertyExpr): Implement
28256 IAssignMethod, clean up old code.
28258 2001-10-22 Ravi Pratap <ravi@ximian.com>
28260 * typemanager.cs (ImplementsInterface): New method to determine if a type
28261 implements a given interface. Provides a nice cache too.
28263 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28266 (ConvertReferenceExplicit): Ditto.
28268 * delegate.cs (Delegate::Populate): Update to define the parameters on the
28269 various methods, with correct names etc.
28271 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
28272 Operator.UnaryNegation.
28274 * cs-parser.jay (operator_declarator): Be a little clever in the case where
28275 we have a unary plus or minus operator.
28277 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
28280 * everywhere : update accordingly.
28282 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28285 * class.cs (Method::Define): For the case where we are implementing a method
28286 inherited from an interface, we need to set the MethodAttributes.Final flag too.
28287 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28289 2001-10-21 Ravi Pratap <ravi@ximian.com>
28291 * interface.cs (FindMembers): Implement to work around S.R.E
28294 * typemanager.cs (IsInterfaceType): Implement.
28296 (FindMembers): Update to handle interface types too.
28298 * expression.cs (ImplicitReferenceConversion): Re-write bits which
28299 use IsAssignableFrom as that is not correct - it doesn't work.
28301 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28302 and accordingly override EmitStatement.
28304 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28305 using the correct logic :-)
28307 2001-10-19 Ravi Pratap <ravi@ximian.com>
28309 * ../errors/cs-11.cs : Add to demonstrate error -11
28311 2001-10-17 Miguel de Icaza <miguel@ximian.com>
28313 * assign.cs (Assign::Resolve): Resolve right hand side first, and
28314 then pass this as a hint to ResolveLValue.
28316 * expression.cs (FieldExpr): Add Location information
28318 (FieldExpr::LValueResolve): Report assignment to readonly
28321 (Expression::ExprClassFromMemberInfo): Pass location information.
28323 (Expression::ResolveLValue): Add new method that resolves an
28326 (Expression::DoResolveLValue): Default invocation calls
28329 (Indexers): New class used to keep track of indexers in a given
28332 (IStackStore): Renamed from LValue, as it did not really describe
28333 what this did. Also ResolveLValue is gone from this interface and
28334 now is part of Expression.
28336 (ElementAccess): Depending on the element access type
28338 * typemanager.cs: Add `indexer_name_type' as a Core type
28339 (System.Runtime.CompilerServices.IndexerNameAttribute)
28341 * statement.cs (Goto): Take a location.
28343 2001-10-18 Ravi Pratap <ravi@ximian.com>
28345 * delegate.cs (Delegate::VerifyDelegate): New method to verify
28346 if two delegates are compatible.
28348 (NewDelegate::DoResolve): Update to take care of the case when
28349 we instantiate a delegate from another delegate.
28351 * typemanager.cs (FindMembers): Don't even try to look up members
28352 of Delegate types for now.
28354 2001-10-18 Ravi Pratap <ravi@ximian.com>
28356 * delegate.cs (NewDelegate): New class to take care of delegate
28359 * expression.cs (New): Split the delegate related code out into
28360 the NewDelegate class.
28362 * delegate.cs (DelegateInvocation): New class to handle delegate
28365 * expression.cs (Invocation): Split out delegate related code into
28366 the DelegateInvocation class.
28368 2001-10-17 Ravi Pratap <ravi@ximian.com>
28370 * expression.cs (New::DoResolve): Implement delegate creation fully
28371 and according to the spec.
28373 (New::DoEmit): Update to handle delegates differently.
28375 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
28376 because of which we were printing out arguments in reverse order !
28378 * delegate.cs (VerifyMethod): Implement to check if the given method
28379 matches the delegate.
28381 (FullDelegateDesc): Implement.
28383 (VerifyApplicability): Implement.
28385 * expression.cs (Invocation::DoResolve): Update to accordingly handle
28386 delegate invocations too.
28388 (Invocation::Emit): Ditto.
28390 * ../errors/cs1593.cs : Added.
28392 * ../errors/cs1594.cs : Added.
28394 * delegate.cs (InstanceExpression, TargetMethod): New properties.
28396 2001-10-16 Ravi Pratap <ravi@ximian.com>
28398 * typemanager.cs (intptr_type): Core type for System.IntPtr
28400 (InitCoreTypes): Update for the same.
28402 (iasyncresult_type, asynccallback_type): Ditto.
28404 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
28407 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
28410 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
28411 the builders for the 4 members of a delegate type :-)
28413 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
28416 * expression.cs (New::DoResolve): Implement guts for delegate creation.
28418 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
28420 2001-10-15 Miguel de Icaza <miguel@ximian.com>
28422 * statement.cs (Break::Emit): Implement.
28423 (Continue::Emit): Implement.
28425 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
28426 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
28427 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
28428 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
28431 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
28432 properties that track the label for the current loop (begin of the
28433 loop and end of the loop).
28435 2001-10-15 Ravi Pratap <ravi@ximian.com>
28437 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
28438 use of emitting anything at all.
28440 * class.cs, rootcontext.cs : Get rid of calls to the same.
28442 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
28444 (Populate): Define the constructor correctly and set the implementation
28447 * typemanager.cs (delegate_types): New hashtable to hold delegates that
28450 (AddDelegateType): Implement.
28452 (IsDelegateType): Implement helper method.
28454 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
28456 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
28457 and accordingly handle it.
28459 * delegate.cs (Populate): Take TypeContainer argument.
28460 Implement bits to define the Invoke method. However, I still haven't figured out
28461 how to take care of the native int bit :-(
28463 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
28464 Qualify the name of the delegate, not its return type !
28466 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
28469 (StandardConversionExists): Checking for array types turns out to be recursive.
28471 (ConvertReferenceExplicit): Implement array conversion.
28473 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
28475 2001-10-12 Ravi Pratap <ravi@ximian.com>
28477 * cs-parser.jay (delegate_declaration): Store the fully qualified
28478 name as it is a type declaration.
28480 * delegate.cs (ReturnType, Name): Rename members to these. Make them
28483 (DefineDelegate): Renamed from Define. Does the same thing essentially,
28484 as TypeContainer::DefineType.
28486 (Populate): Method in which all the definition of the various methods (Invoke)
28489 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
28492 (CloseDelegate): Finally creates the delegate.
28494 * class.cs (TypeContainer::DefineType): Update to define delegates.
28495 (Populate, Emit and CloseType): Do the same thing here too.
28497 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
28498 delegates in all these operations.
28500 2001-10-14 Miguel de Icaza <miguel@ximian.com>
28502 * expression.cs: LocalTemporary: a new expression used to
28503 reference a temporary that has been created.
28505 * assign.cs: Handle PropertyAccess back here, so that we can
28506 provide the proper semantic access to properties.
28508 * expression.cs (Expression::ConvertReferenceExplicit): Implement
28509 a few more explicit conversions.
28511 * modifiers.cs: `NEW' modifier maps to HideBySig.
28513 * expression.cs (PropertyExpr): Make this into an
28514 ExpressionStatement, and support the EmitStatement code path.
28516 Perform get/set error checking, clean up the interface.
28518 * assign.cs: recognize PropertyExprs as targets, and if so, turn
28519 them into toplevel access objects.
28521 2001-10-12 Miguel de Icaza <miguel@ximian.com>
28523 * expression.cs: PropertyExpr::PropertyExpr: use work around the
28526 * typemanager.cs: Keep track here of our PropertyBuilders again to
28527 work around lameness in SRE.
28529 2001-10-11 Miguel de Icaza <miguel@ximian.com>
28531 * expression.cs (LValue::LValueResolve): New method in the
28532 interface, used to perform a second resolution pass for LValues.
28534 (This::DoResolve): Catch the use of this in static methods.
28536 (This::LValueResolve): Implement.
28538 (This::Store): Remove warning, assigning to `this' in structures
28541 (Invocation::Emit): Deal with invocation of
28542 methods on value types. We need to pass the address to structure
28543 methods rather than the object itself. (The equivalent code to
28544 emit "this" for structures leaves the entire structure on the
28545 stack instead of a pointer to it).
28547 (ParameterReference::DoResolve): Compute the real index for the
28548 argument based on whether the method takes or not a `this' pointer
28549 (ie, the method is static).
28551 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
28552 value types returned from functions when we need to invoke a
28553 method on the sturcture.
28556 2001-10-11 Ravi Pratap <ravi@ximian.com>
28558 * class.cs (TypeContainer::DefineType): Method to actually do the business of
28559 defining the type in the Modulebuilder or Typebuilder. This is to take
28560 care of nested types which need to be defined on the TypeBuilder using
28561 DefineNestedMethod.
28563 (TypeContainer::GetClassBases): Implement. Essentially the code from the
28564 methods in RootContext, only ported to be part of TypeContainer.
28566 (TypeContainer::GetInterfaceOrClass): Ditto.
28568 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
28570 * interface.cs (Interface::DefineInterface): New method. Does exactly
28571 what RootContext.CreateInterface did earlier, only it takes care of nested types
28574 (Interface::GetInterfaces): Move from RootContext here and port.
28576 (Interface::GetInterfaceByName): Same here.
28578 * rootcontext.cs (ResolveTree): Re-write.
28580 (PopulateTypes): Re-write.
28582 * class.cs (TypeContainer::Populate): Populate nested types too.
28583 (TypeContainer::Emit): Emit nested members too.
28585 * typemanager.cs (AddUserType): Do not make use of the FullName property,
28586 instead just use the name argument passed in as it is already fully
28589 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
28590 to TypeContainer mapping to see if a type is user-defined.
28592 * class.cs (TypeContainer::CloseType): Implement.
28594 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
28595 the default constructor.
28597 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
28600 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
28602 * interface.cs (CloseType): Create the type here.
28604 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
28607 Remove all the methods which are now in TypeContainer.
28609 2001-10-10 Ravi Pratap <ravi@ximian.com>
28611 * delegate.cs (Define): Re-write bits to define the delegate
28614 2001-10-10 Miguel de Icaza <miguel@ximian.com>
28616 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
28618 * expression.cs (ImplicitReferenceConversion): handle null as well
28619 as a source to convert to any reference type.
28621 * statement.cs (Return): Perform any implicit conversions to
28622 expected return type.
28624 Validate use of return statement.
28626 * codegen.cs (EmitContext): Pass the expected return type here.
28628 * class.cs (Method, Constructor, Property): Pass expected return
28629 type to EmitContext.
28631 2001-10-09 Miguel de Icaza <miguel@ximian.com>
28633 * expression.cs: Make DoResolve take an EmitContext instead of a
28636 Replaced `l' and `location' for `loc', for consistency.
28638 (Error, Warning): Remove unneeded Tc argument.
28640 * assign.cs, literal.cs, constant.cs: Update to new calling
28643 * codegen.cs: EmitContext now contains a flag indicating whether
28644 code is being generated in a static method or not.
28646 * cs-parser.jay: DecomposeQI, new function that replaces the old
28647 QualifiedIdentifier. Now we always decompose the assembled
28648 strings from qualified_identifier productions into a group of
28651 2001-10-08 Miguel de Icaza <miguel@ximian.com>
28653 * rootcontext.cs: Deal with field-less struct types correctly now
28654 by passing the size option to Define Type.
28656 * class.cs: Removed hack that created one static field.
28658 2001-10-07 Miguel de Icaza <miguel@ximian.com>
28660 * statement.cs: Moved most of the code generation here.
28662 2001-10-09 Ravi Pratap <ravi@ximian.com>
28664 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
28667 (ElementAccess): Remove useless bits for now - keep checks as the spec
28670 2001-10-08 Ravi Pratap <ravi@ximian.com>
28672 * expression.cs (ElementAccess::DoResolve): Remove my crap code
28673 and start performing checks according to the spec.
28675 2001-10-07 Ravi Pratap <ravi@ximian.com>
28677 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
28678 rank_specifiers instead.
28680 (rank_specifiers): Change the order in which the rank specifiers are stored
28682 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
28684 * expression.cs (ElementAccess): Implement the LValue interface too.
28686 2001-10-06 Ravi Pratap <ravi@ximian.com>
28688 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
28689 except that user defined conversions are not included.
28691 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
28692 perform the conversion of the return type, if necessary.
28694 (New::DoResolve): Check whether we are creating an array or an object
28695 and accordingly do the needful.
28697 (New::Emit): Same here.
28699 (New::DoResolve): Implement guts of array creation.
28701 (New::FormLookupType): Helper function.
28703 2001-10-07 Miguel de Icaza <miguel@ximian.com>
28705 * codegen.cs: Removed most of the code generation here, and move the
28706 corresponding code generation bits to the statement classes.
28708 Added support for try/catch/finalize and throw.
28710 * cs-parser.jay: Added support for try/catch/finalize.
28712 * class.cs: Catch static methods having the flags override,
28713 virtual or abstract.
28715 * expression.cs (UserCast): This user cast was not really doing
28716 what it was supposed to do. Which is to be born in fully resolved
28717 state. Parts of the resolution were being performed at Emit time!
28721 2001-10-05 Miguel de Icaza <miguel@ximian.com>
28723 * expression.cs: Implicity convert the result from UserCast.
28725 2001-10-05 Ravi Pratap <ravi@ximian.com>
28727 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
28728 prevented it from working correctly.
28730 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
28731 merely ConvertImplicit.
28733 2001-10-05 Miguel de Icaza <miguel@ximian.com>
28735 * typemanager.cs: Make the LookupTypeContainer function static,
28736 and not per-instance.
28738 * class.cs: Make static FindMembers (the one that takes a Type
28741 * codegen.cs: Add EmitForeach here.
28743 * cs-parser.jay: Make foreach a toplevel object instead of the
28744 inline expansion, as we need to perform semantic analysis on it.
28746 2001-10-05 Ravi Pratap <ravi@ximian.com>
28748 * expression.cs (Expression::ImplicitUserConversion): Rename to
28749 UserDefinedConversion.
28751 (Expression::UserDefinedConversion): Take an extra argument specifying
28752 whether we look for explicit user conversions too.
28754 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
28756 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
28758 (ExplicitUserConversion): Make it a call to UserDefinedConversion
28759 with the appropriate arguments.
28761 * cs-parser.jay (cast_expression): Record location too.
28763 * expression.cs (Cast): Record location info.
28765 (Expression::ConvertExplicit): Take location argument.
28767 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
28768 to determine if we are doing explicit conversions.
28770 (UserCast::Emit): Update accordingly.
28772 (Expression::ConvertExplicit): Report an error if everything fails.
28774 * ../errors/cs0030.cs : Add.
28776 2001-10-04 Miguel de Icaza <miguel@ximian.com>
28778 * modifiers.cs: If the ABSTRACT keyword is present, also set the
28779 virtual and newslot bits.
28781 * class.cs (TypeContainer::RegisterRequiredImplementations):
28782 Record methods we need.
28784 (TypeContainer::MakeKey): Helper function to make keys for
28785 MethodBases, since the Methodbase key is useless.
28787 (TypeContainer::Populate): Call RegisterRequiredImplementations
28788 before defining the methods.
28790 Create a mapping for method_builders_to_methods ahead of time
28791 instead of inside a tight loop.
28793 (::RequireMethods): Accept an object as the data to set into the
28794 hashtable so we can report interface vs abstract method mismatch.
28796 2001-10-03 Miguel de Icaza <miguel@ximian.com>
28798 * report.cs: Make all of it static.
28800 * rootcontext.cs: Drop object_type and value_type computations, as
28801 we have those in the TypeManager anyways.
28803 Drop report instance variable too, now it is a global.
28805 * driver.cs: Use try/catch on command line handling.
28807 Add --probe option to debug the error reporting system with a test
28810 * report.cs: Add support for exiting program when a probe
28811 condition is reached.
28813 2001-10-03 Ravi Pratap <ravi@ximian.com>
28815 * expression.cs (Binary::DoNumericPromotions): Fix the case when
28816 we do a forcible conversion regardless of type, to check if
28817 ForceConversion returns a null.
28819 (Binary::error19): Use location to report error.
28821 (Unary::error23): Use location here too.
28823 * ../errors/cs0019.cs : Check in.
28825 * ../errors/cs0023.cs : Check in.
28827 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
28828 case of a non-null MethodInfo object with a length of 0 !
28830 (Binary::ResolveOperator): Flag error if overload resolution fails to find
28831 an applicable member - according to the spec :-)
28832 Also fix logic to find members in base types.
28834 (Unary::ResolveOperator): Same here.
28836 (Unary::report23): Change name to error23 and make first argument a TypeContainer
28837 as I was getting thoroughly confused between this and error19 :-)
28839 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
28840 (::FindMostEncompassedType): Implement.
28841 (::FindMostEncompassingType): Implement.
28842 (::StandardConversionExists): Implement.
28844 (UserImplicitCast): Re-vamp. We now need info about most specific
28845 source and target types so that we can do the necessary conversions.
28847 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
28848 mathematical union with no duplicates.
28850 2001-10-03 Miguel de Icaza <miguel@ximian.com>
28852 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
28853 in order from base classes to child classes, so that we can in
28854 child classes look up in our parent for method names and
28855 attributes (required for handling abstract, virtual, new, override
28856 constructs: we need to instrospect our base class, and if we dont
28857 populate the classes in order, the introspection might be
28858 incorrect. For example, a method could query its parent before
28859 the parent has any methods and would determine that the parent has
28860 no abstract methods (while it could have had them)).
28862 (RootContext::CreateType): Record the order in which we define the
28865 2001-10-02 Miguel de Icaza <miguel@ximian.com>
28867 * class.cs (TypeContainer::Populate): Also method definitions can
28868 fail now, keep track of this.
28870 (TypeContainer::FindMembers): Implement support for
28871 DeclaredOnly/noDeclaredOnly flag.
28873 (Constructor::Emit) Return the ConstructorBuilder.
28875 (Method::Emit) Return the MethodBuilder.
28876 Check for abstract or virtual methods to be public.
28878 * rootcontext.cs (RootContext::CreateType): Register all the
28879 abstract methods required for the class to be complete and the
28880 interface methods that must be implemented.
28882 * cs-parser.jay: Report error 501 (method requires body if it is
28883 not marked abstract or extern).
28885 * expression.cs (TypeOf::Emit): Implement.
28887 * typemanager.cs: runtime_handle_type, new global type.
28889 * class.cs (Property::Emit): Generate code for properties.
28891 2001-10-02 Ravi Pratap <ravi@ximian.com>
28893 * expression.cs (Unary::ResolveOperator): Find operators on base type
28894 too - we now conform exactly to the spec.
28896 (Binary::ResolveOperator): Same here.
28898 * class.cs (Operator::Define): Fix minor quirk in the tests.
28900 * ../errors/cs0215.cs : Added.
28902 * ../errors/cs0556.cs : Added.
28904 * ../errors/cs0555.cs : Added.
28906 2001-10-01 Miguel de Icaza <miguel@ximian.com>
28908 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
28909 single integer which is really efficient
28911 2001-10-01 Ravi Pratap <ravi@ximian.com>
28913 * expression.cs (Expression::ImplicitUserConversion): Use location
28914 even in the case when we are examining True operators.
28916 * class.cs (Operator::Define): Perform extensive checks to conform
28917 with the rules for operator overloading in the spec.
28919 * expression.cs (Expression::ImplicitReferenceConversion): Implement
28920 some of the other conversions mentioned in the spec.
28922 * typemanager.cs (array_type): New static member for the System.Array built-in
28925 (cloneable_interface): For System.ICloneable interface.
28927 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
28928 we start resolving the tree and populating types.
28930 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
28932 2001-10-01 Miguel de Icaza <miguel@ximian.com>
28934 * expression.cs (Expression::ExprClassFromMemberInfo,
28935 Expression::Literalize): Create literal expressions from
28936 FieldInfos which are literals.
28938 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
28939 type casts, because they were wrong. The test suite in tests
28942 (ImplicitNumericConversion): ushort to ulong requires a widening
28945 Int32 constant to long requires widening cast as well.
28947 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
28948 for integers because the type on the stack is not i4.
28950 2001-09-30 Miguel de Icaza <miguel@ximian.com>
28952 * expression.cs (report118): require location argument.
28954 * parameter.cs: Do not dereference potential null value.
28956 * class.cs: Catch methods that lack the `new' keyword when
28957 overriding a name. Report warnings when `new' is used without
28958 anything being there to override.
28960 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
28962 * class.cs: Only add constructor to hashtable if it is non-null
28963 (as now constructors can fail on define).
28965 (TypeManager, Class, Struct): Take location arguments.
28967 Catch field instance initialization in structs as errors.
28969 accepting_filter: a new filter for FindMembers that is static so
28970 that we dont create an instance per invocation.
28972 (Constructor::Define): Catch errors where a struct constructor is
28975 * cs-parser.jay: Pass location information for various new
28978 * delegate.cs (Delegate): take a location argument.
28980 * driver.cs: Do not call EmitCode if there were problesm in the
28981 Definition of the types, as many Builders wont be there.
28983 * decl.cs (Decl::Decl): Require a location argument.
28985 * cs-tokenizer.cs: Handle properly hex constants that can not fit
28986 into integers, and find the most appropiate integer for it.
28988 * literal.cs: Implement ULongLiteral.
28990 * rootcontext.cs: Provide better information about the location of
28991 failure when CreateType fails.
28993 2001-09-29 Miguel de Icaza <miguel@ximian.com>
28995 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
28998 * expression.cs (Binary::CheckShiftArguments): Add missing type
29000 (Binary::ResolveOperator): Add type to the logical and and logical
29001 or, Bitwise And/Or and Exclusive Or code paths, it was missing
29004 (Binary::DoNumericPromotions): In the case where either argument
29005 is ulong (and most signed types combined with ulong cause an
29006 error) perform implicit integer constant conversions as well.
29008 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29010 * expression.cs (UserImplicitCast): Method should always be
29012 (Invocation::BetterConversion): Simplified test for IntLiteral.
29014 (Expression::ImplicitNumericConversion): Split this routine out.
29015 Put the code that performs implicit constant integer conversions
29018 (Expression::Resolve): Become a wrapper around DoResolve so we can
29019 check eclass and type being set after resolve.
29021 (Invocation::Badness): Remove this dead function
29023 (Binary::ResolveOperator): Do not compute the expensive argumnets
29024 unless we have a union for it.
29026 (Probe::Emit): Is needs to do an isinst and then
29027 compare against null.
29029 (::CanConvert): Added Location argument. If the Location argument
29030 is null (Location.Null), then we do not report errors. This is
29031 used by the `probe' mechanism of the Explicit conversion. We do
29032 not want to generate an error for something that the user
29033 explicitly requested to be casted. But the pipeline for an
29034 explicit cast first tests for potential implicit casts.
29036 So for now, if the Location is null, it means `Probe only' to
29037 avoid adding another argument. Might have to revise this
29040 (ClassCast): New class used to type cast objects into arbitrary
29041 classes (used in Explicit Reference Conversions).
29043 Implement `as' as well.
29045 Reverted all the patches from Ravi below: they were broken:
29047 * The use of `level' as a mechanism to stop recursive
29048 invocations is wrong. That was there just to catch the
29049 bug with a strack trace but not as a way of addressing
29052 To fix the problem we have to *understand* what is going
29053 on and the interactions and come up with a plan, not
29054 just get things going.
29056 * The use of the type conversion cache that I proposed
29057 last night had an open topic: How does this work across
29058 protection domains. A user defined conversion might not
29059 be public in the location where we are applying the
29060 conversion, a different conversion might be selected
29061 (ie, private A->B (better) but public B->A (worse),
29062 inside A, A->B applies, but outside it, B->A will
29065 * On top of that (ie, even if the above is solved),
29066 conversions in a cache need to be abstract. Ie, `To
29067 convert from an Int to a Short use an OpcodeCast', not
29068 `To convert from an Int to a Short use the OpcodeCast on
29069 the variable 5' (which is what this patch was doing).
29071 2001-09-28 Ravi Pratap <ravi@ximian.com>
29073 * expression.cs (Invocation::ConversionExists): Re-write to use
29074 the conversion cache
29076 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29077 cache all conversions done, not just user-defined ones.
29079 (Invocation::BetterConversion): The real culprit. Use ConversionExists
29080 to determine if a conversion exists instead of acutually trying to
29081 perform the conversion. It's faster too.
29083 (Expression::ConvertExplicit): Modify to use ConversionExists to check
29084 and only then attempt the implicit conversion.
29086 2001-09-28 Ravi Pratap <ravi@ximian.com>
29088 * expression.cs (ConvertImplicit): Use a cache for conversions
29089 already found. Check level of recursion and bail out if necessary.
29091 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29093 * typemanager.cs (string_concat_string_string, string_concat_object_object):
29094 Export standard methods that we expect for string operations.
29096 * statement.cs (Block::UsageWarning): Track usage of variables and
29097 report the errors for not used variables.
29099 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29102 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29104 * codegen.cs: remove unnneded code
29106 * expression.cs: Removed BuiltinTypeAccess class
29108 Fix the order in which implicit conversions are
29111 The previous fixed dropped support for boxed conversions (adding a
29112 test to the test suite now)
29114 (UserImplicitCast::CanConvert): Remove test for source being null,
29115 that code is broken. We should not feed a null to begin with, if
29116 we do, then we should track the bug where the problem originates
29117 and not try to cover it up here.
29119 Return a resolved expression of type UserImplicitCast on success
29120 rather than true/false. Ravi: this is what I was talking about,
29121 the pattern is to use a static method as a "constructor" for
29124 Also, do not create arguments until the very last minute,
29125 otherwise we always create the arguments even for lookups that
29126 will never be performed.
29128 (UserImplicitCast::Resolve): Eliminate, objects of type
29129 UserImplicitCast are born in a fully resolved state.
29131 * typemanager.cs (InitCoreTypes): Init also value_type
29132 (System.ValueType).
29134 * expression.cs (Cast::Resolve): First resolve the child expression.
29136 (LValue): Add new method AddressOf to be used by
29139 Change the argument of Store to take an EmitContext instead of an
29140 ILGenerator, because things like FieldExpr need to be able to call
29141 their children expression to generate the instance code.
29143 (Expression::Error, Expression::Warning): Sugar functions for
29146 (Expression::MemberLookup): Accept a TypeContainer instead of a
29147 Report as the first argument.
29149 (Expression::ResolvePrimary): Killed. I still want to improve
29150 this as currently the code is just not right.
29152 (Expression::ResolveMemberAccess): Simplify, but it is still
29155 (Unary::Resolve): Catch errors in AddressOf operators.
29157 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29158 index to a byte for the short-version, or the compiler will choose
29159 the wrong Emit call, which generates the wrong data.
29161 (ParameterReference::Emit, ::Store): same.
29163 (FieldExpr::AddressOf): Implement.
29165 * typemanager.cs: TypeManager: made public variable instead of
29168 * driver.cs: document --fatal.
29170 * report.cs (ErrorMessage, WarningMessage): new names for the old
29171 Error and Warning classes.
29173 * cs-parser.jay (member_access): Turn built-in access to types
29174 into a normal simplename
29176 2001-09-27 Ravi Pratap <ravi@ximian.com>
29178 * expression.cs (Invocation::BetterConversion): Fix to cope
29179 with q being null, since this was introducing a bug.
29181 * expression.cs (ConvertImplicit): Do built-in conversions first.
29183 2001-09-27 Ravi Pratap <ravi@ximian.com>
29185 * expression.cs (UserImplicitCast::Resolve): Fix bug.
29187 2001-09-27 Ravi Pratap <ravi@ximian.com>
29189 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29190 I had introduced long ago (what's new ?).
29192 * expression.cs (UserImplicitCast::CanConvert): Static method to do
29193 the work of all the checking.
29194 (ConvertImplicit): Call CanConvert and only then create object if necessary.
29195 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29197 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29198 that is the right way.
29200 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
29201 overloading resolution. Use everywhere instead of cutting and pasting code.
29203 (Binary::ResolveOperator): Use MakeUnionSet.
29205 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
29206 we have to convert to bool types. Not complete yet.
29208 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29210 * typemanager.cs (TypeManager::CSharpName): support ushort.
29212 * expression.cs (Expression::TryImplicitIntConversion): Attempts
29213 to provide an expression that performsn an implicit constant int
29214 conversion (section 6.1.6).
29215 (Expression::ConvertImplicitRequired): Reworked to include
29216 implicit constant expression conversions.
29218 (Expression::ConvertNumericExplicit): Finished.
29220 (Invocation::Emit): If InstanceExpression is null, then it means
29221 that we perform a call on this.
29223 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29225 * expression.cs (Unary::Emit): Remove some dead code.
29226 (Probe): Implement Resolve and Emit for `is'.
29227 (Expression::ConvertImplicitRequired): Attempt to do constant
29228 expression conversions here. Maybe should be moved to
29229 ConvertImplicit, but I am not sure.
29230 (Expression::ImplicitLongConstantConversionPossible,
29231 Expression::ImplicitIntConstantConversionPossible): New functions
29232 that tell whether is it possible to apply an implicit constant
29233 expression conversion.
29235 (ConvertNumericExplicit): Started work on explicit numeric
29238 * cs-parser.jay: Update operator constants.
29240 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29241 (Parameters::GetSignature): Hook up VerifyArgs here.
29242 (Parameters::VerifyArgs): Verifies that no two arguments have the
29245 * class.cs (Operator): Update the operator names to reflect the
29246 ones that the spec expects (as we are just stringizing the
29249 * expression.cs (Unary::ResolveOperator): Fix bug: Use
29250 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29251 previous usage did only work for our methods.
29252 (Expression::ConvertImplicit): Handle decimal implicit numeric
29253 conversions as well.
29254 (Expression::InternalTypeConstructor): Used to invoke constructors
29255 on internal types for default promotions.
29257 (Unary::Emit): Implement special handling for the pre/post
29258 increment/decrement for overloaded operators, as they need to have
29259 the same semantics as the other operators.
29261 (Binary::ResolveOperator): ditto.
29262 (Invocation::ConversionExists): ditto.
29263 (UserImplicitCast::Resolve): ditto.
29265 2001-09-26 Ravi Pratap <ravi@ximian.com>
29267 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29268 operator, return after emitting body. Regression tests pass again !
29270 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29271 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29272 (Invocation::OverloadResolve): Ditto.
29273 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29275 * everywhere : update calls to the above methods accordingly.
29277 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29279 * assign.cs (Assign): Make it inherit from ExpressionStatement.
29281 * expression.cs (ExpressionStatement): New base class used for
29282 expressions that can appear in statements, so that we can provide
29283 an alternate path to generate expression that do not leave a value
29286 (Expression::Emit, and all the derivatives): We no longer return
29287 whether a value is left on the stack or not. Every expression
29288 after being emitted leaves a single value on the stack.
29290 * codegen.cs (EmitContext::EmitStatementExpression): Use the
29291 facilties of ExpressionStatement if possible.
29293 * cs-parser.jay: Update statement_expression.
29295 2001-09-25 Miguel de Icaza <miguel@ximian.com>
29297 * driver.cs: Change the wording of message
29299 2001-09-25 Ravi Pratap <ravi@ximian.com>
29301 * expression.cs (Binary::ResolveOperator): Had forgottten to set
29302 the type of the expression to the return type of the method if
29303 we have an overloaded operator match ! The regression tests pass again !
29304 (Unary::ResolveOperator): Ditto.
29306 * expression.cs (Invocation::ConversionExists): Correct the member lookup
29307 to find "op_Implicit", not "implicit" ;-)
29308 (UserImplicitCast): New class to take care of user-defined implicit conversions.
29309 (ConvertImplicit, ForceConversion): Take TypeContainer argument
29311 * everywhere : Correct calls to the above accordingly.
29313 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29314 (ConvertImplicit): Do user-defined conversion if it exists.
29316 2001-09-24 Miguel de Icaza <miguel@ximian.com>
29318 * assign.cs: track location.
29319 (Resolve): Use implicit conversions on assignment.
29321 * literal.cs: Oops. Not good, Emit of short access values should
29322 pass (Bytes) or the wrong argument will be selected.
29324 * expression.cs (Unary::Emit): Emit code for -expr.
29326 (Unary::ResolveOperator): Handle `Substract' for non-constants
29327 (substract from zero from the non-constants).
29328 Deal with Doubles as well.
29330 (Expression::ConvertImplicitRequired): New routine that reports an
29331 error if no implicit conversion exists.
29333 (Invocation::OverloadResolve): Store the converted implicit
29334 expressions if we make them
29336 2001-09-24 Ravi Pratap <ravi@ximian.com>
29338 * class.cs (ConstructorInitializer): Take a Location argument.
29339 (ConstructorBaseInitializer): Same here.
29340 (ConstructorThisInitializer): Same here.
29342 * cs-parser.jay : Update all calls accordingly.
29344 * expression.cs (Unary, Binary, New): Take location argument.
29345 Update accordingly everywhere.
29347 * cs-parser.jay : Update all calls to the above to take a location
29350 * class.cs : Ditto.
29352 2001-09-24 Ravi Pratap <ravi@ximian.com>
29354 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
29355 (Invocation::BetterConversion): Same here
29356 (Invocation::ConversionExists): Ditto.
29358 (Invocation::ConversionExists): Implement.
29360 2001-09-22 Ravi Pratap <ravi@ximian.com>
29362 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
29363 Also take an additional TypeContainer argument.
29365 * All over : Pass in TypeContainer as argument to OverloadResolve.
29367 * typemanager.cs (CSharpName): Update to check for the string type and return
29370 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
29373 2001-09-21 Ravi Pratap <ravi@ximian.com>
29375 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
29376 (Invocation::BetterFunction): Implement.
29377 (Invocation::BetterConversion): Implement.
29378 (Invocation::ConversionExists): Skeleton, no implementation yet.
29380 Okay, things work fine !
29382 2001-09-21 Miguel de Icaza <miguel@ximian.com>
29384 * typemanager.cs: declare and load enum_type, delegate_type and
29387 * expression.cs (Expression::Emit): Now emit returns a value that
29388 tells whether a value is left on the stack or not. This strategy
29389 might be reveted tomorrow with a mechanism that would address
29390 multiple assignments.
29391 (Expression::report118): Utility routine to report mismatches on
29394 (Unary::Report23): Report impossible type/operator combination
29397 (Unary::IsIncrementableNumber): Whether the type can be
29398 incremented or decremented with add.
29399 (Unary::ResolveOperator): Also allow enumerations to be bitwise
29401 (Unary::ResolveOperator): Implement ++, !, ~,
29403 (Invocation::Emit): Deal with new Emit convetion.
29405 * All Expression derivatives: Updated their Emit method to return
29406 whether they leave values on the stack or not.
29408 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
29409 stack for expressions that are statements.
29411 2001-09-20 Miguel de Icaza <miguel@ximian.com>
29413 * expression.cs (LValue): New interface. Must be implemented by
29415 (LocalVariableReference, ParameterReference, FieldExpr): Implement
29418 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
29419 interface for generating code, simplifies the code.
29421 2001-09-20 Ravi Pratap <ravi@ximian.com>
29423 * expression.cs (everywhere): Comment out return statements in ::Resolve
29424 methods to avoid the warnings.
29426 2001-09-20 Miguel de Icaza <miguel@ximian.com>
29428 * driver.cs (parse): Report error 2001 if we can not open the
29431 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
29434 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
29437 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
29438 otherwise nested blocks end up with the same index.
29440 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
29442 * expression.cs: Instead of having FIXMEs in the Resolve
29443 functions, throw exceptions so it is obvious that we are facing a
29446 * cs-parser.jay (invocation_expression): Pass Location information.
29448 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
29449 Use a basename for those routines because .NET does not like paths
29452 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
29455 2001-09-19 Miguel de Icaza <miguel@ximian.com>
29457 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
29458 are loading the correct data types (throws an exception if not).
29459 (TypeManager::InitCoreTypes): Use CoreLookupType
29461 * expression.cs (Unary::ResolveOperator): return the child
29462 expression for expressions which are just +expr.
29463 (Unary::ResolveOperator): Return negative literals for -LITERAL
29464 expressions (otherwise they are Unary {Literal}).
29465 (Invocation::Badness): Take into account `Implicit constant
29466 expression conversions'.
29468 * literal.cs (LongLiteral): Implement long literal class.
29469 (IntLiteral): export the `Value' of the intliteral.
29471 2001-09-19 Ravi Pratap <ravi@ximian.com>
29473 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
29475 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
29476 instead of 'Operator'
29478 * expression.cs (Binary::ResolveOperator): Update accordingly.
29479 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
29482 * cs-parser.jay (unary_expression): Update to use the new names.
29484 * gen-treedump.cs (GetUnary): Same here.
29486 * expression.cs (Unary::Resolve): Implement.
29487 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
29488 operators are found instead of making noise ;-)
29489 (Unary::ResolveOperator): New method to do precisely the same thing which
29490 Binary::ResolveOperator does for Binary expressions.
29491 (Unary.method, .Arguments): Add.
29492 (Unary::OperName): Implement.
29493 (Unary::ForceConversion): Copy and Paste !
29495 * class.cs (Operator::Define): Fix a small bug for the case when we have
29498 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
29499 for the inbuilt operators. Only overloading works for now ;-)
29501 2001-09-18 Miguel de Icaza <miguel@ximian.com>
29503 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
29504 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
29506 * expression.cs (This::Emit): Implement.
29507 (This::Resolve): Implement.
29508 (TypeOf:Resolve): Implement.
29509 (Expression::ResolveSimpleName): Add an implicit this to instance
29511 (MemberAccess::Resolve): Deal with Parameters and Fields.
29512 Bind instance variable to Field expressions.
29513 (FieldExpr::Instance): New field used to track the expression that
29514 represents the object instance.
29515 (FieldExpr::Resolve): Track potential errors from MemberLookup not
29517 (FieldExpr::Emit): Implement.
29519 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
29520 the last instruction contains a return opcode to avoid generating
29521 the last `ret' instruction (this generates correct code, and it is
29522 nice to pass the peverify output).
29524 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
29525 initializer for static and instance variables.
29526 (Constructor::Emit): Allow initializer to be null in the case of
29527 static constructors. Only emit initializer for instance
29530 (TypeContainer::FindMembers): Return a null array if there are no
29533 Also fix the code for the MemberTypes.Method branch, as it was not
29534 scanning that for operators (or tried to access null variables before).
29536 * assign.cs (Assign::Emit): Handle instance and static fields.
29540 * driver.cs: Stop compilation if there are parse errors.
29542 * cs-parser.jay (constructor_declaration): Provide default base
29543 initializer for non-static constructors.
29544 (constructor_declarator): Do not provide a default base
29545 initializers if none was specified.
29546 Catch the fact that constructors should not have parameters.
29548 * class.cs: Do not emit parent class initializers for static
29549 constructors, that should be flagged as an error.
29551 2001-09-18 Ravi Pratap <ravi@ximian.com>
29553 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
29554 Move back code into TypeContainer::Populate.
29556 2001-09-18 Ravi Pratap <ravi@ximian.com>
29558 * class.cs (TypeContainer::AddConstructor): Fix the check to
29559 compare against Name, not Basename.
29560 (Operator::OpType): Change Plus and Minus to Add and Subtract.
29562 * cs-parser.jay : Update accordingly.
29564 * class.cs (TypeContainer::FindMembers): For the case where we are searching
29565 for methods, don't forget to look into the operators too.
29566 (RegisterMethodBuilder): Helper method to take care of this for
29567 methods, constructors and operators.
29568 (Operator::Define): Completely revamp.
29569 (Operator.OperatorMethod, MethodName): New fields.
29570 (TypeContainer::Populate): Move the registering of builders into
29571 RegisterMethodBuilder.
29572 (Operator::Emit): Re-write.
29574 * expression.cs (Binary::Emit): Comment out code path to emit method
29575 invocation stuff for the case when we have a user defined operator. I am
29576 just not able to get it right !
29578 2001-09-17 Miguel de Icaza <miguel@ximian.com>
29580 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
29583 (Expression::MemberLookup): Provide a version that allows to
29584 specify the MemberTypes and BindingFlags.
29586 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
29587 so it was not fetching variable information from outer blocks.
29589 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
29590 Beforefieldinit as it was buggy.
29592 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
29593 that Ravi put here.
29595 * class.cs (Constructor::Emit): Only emit if block is not null.
29596 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
29597 deal with this by semantically definining it as if the user had
29600 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
29601 constructors as we now "emit" them at a higher level.
29603 (TypeContainer::DefineDefaultConstructor): Used to define the
29604 default constructors if none was provided.
29606 (ConstructorInitializer): Add methods Resolve and Emit.
29608 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
29610 2001-09-17 Ravi Pratap <ravi@ximian.com>
29612 * class.cs (TypeContainer::EmitDefaultConstructor): Register
29613 the default constructor builder with our hashtable for methodbuilders
29616 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
29617 and argument_count is 0 in which case we have a match.
29618 (Binary::ResolveOperator): More null checking and miscellaneous coding
29621 2001-09-17 Ravi Pratap <ravi@ximian.com>
29623 * rootcontext.cs (IsNameSpace): Compare against null.
29625 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
29627 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
29628 and Unary::Operator.
29630 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
29633 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
29634 we have overloaded operators.
29635 (Binary::ResolveOperator): Implement the part which does the operator overload
29638 * class.cs (Operator::Emit): Implement.
29639 (TypeContainer::Emit): Emit the operators we have too.
29641 * expression.cs (Binary::Emit): Update to emit the appropriate code for
29642 the case when we have a user-defined operator.
29644 2001-09-17 Miguel de Icaza <miguel@ximian.com>
29646 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
29648 2001-09-16 Ravi Pratap <ravi@ximian.com>
29650 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
29651 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
29652 (Constructor::Emit): Implement.
29653 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
29654 if we have no work to do.
29655 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
29658 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
29659 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
29661 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
29664 2001-09-15 Ravi Pratap <ravi@ximian.com>
29666 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
29668 (Tree::RecordNamespace): Method to do what the name says ;-)
29669 (Tree::Namespaces): Property to get at the namespaces hashtable.
29671 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
29674 * rootcontext.cs (IsNamespace): Fixed it :-)
29676 2001-09-14 Miguel de Icaza <miguel@ximian.com>
29678 * class.cs (TypeContainer::FindMembers): Add support for
29680 (MethodCore): New class that encapsulates both the shared aspects
29681 of a Constructor and a Method.
29682 (Method, Constructor): Factored pieces into MethodCore.
29684 * driver.cs: Added --fatal which makes errors throw exceptions.
29685 Load System assembly as well as part of the standard library.
29687 * report.cs: Allow throwing exceptions on errors for debugging.
29689 * modifiers.cs: Do not use `parent', instead use the real type
29690 container to evaluate permission settings.
29692 * class.cs: Put Ravi's patch back in. He is right, and we will
29693 have to cope with the
29695 2001-09-14 Ravi Pratap <ravi@ximian.com>
29697 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
29698 FamORAssem, not FamANDAssem.
29700 2001-09-14 Miguel de Icaza <miguel@ximian.com>
29702 * driver.cs: Added --parse option that only parses its input files
29705 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
29706 incorrect. IsTopLevel is not used to tell whether an object is
29707 root_types or not (that can be achieved by testing this ==
29708 root_types). But to see if this is a top-level *class* (not
29709 necessarly our "toplevel" container).
29711 2001-09-14 Ravi Pratap <ravi@ximian.com>
29713 * enum.cs (Enum::Define): Modify to call the Lookup method on the
29714 parent instead of a direct call to GetType.
29716 2001-09-14 Ravi Pratap <ravi@ximian.com>
29718 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
29719 Modifiers.TypeAttr. This should just be a call to that method.
29721 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
29722 object so that we can determine if we are top-level or not.
29724 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
29727 * enum.cs (Enum::Define): Ditto.
29729 * modifiers.cs (FieldAttr): Re-write.
29731 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
29732 (TypeContainer::HaveStaticConstructor): New property to provide access
29733 to precisely that info.
29735 * modifiers.cs (MethodAttr): Re-write.
29736 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
29738 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
29739 of top-level types as claimed.
29741 2001-09-13 Miguel de Icaza <miguel@ximian.com>
29743 * expression.cs (MemberLookup): Fruitless attempt to lookup
29744 constructors. Maybe I need to emit default constructors? That
29745 might be it (currently .NET emits this for me automatically).
29746 (Invocation::OverloadResolve): Cope with Arguments == null.
29747 (Invocation::EmitArguments): new function, shared by the new
29748 constructor and us.
29749 (Invocation::Emit): Handle static and instance methods. Emit
29750 proper call instruction for virtual or non-virtual invocations.
29751 (New::Emit): Implement.
29752 (New::Resolve): Implement.
29753 (MemberAccess:Resolve): Implement.
29754 (MethodGroupExpr::InstanceExpression): used conforming to the spec
29755 to track instances.
29756 (FieldExpr::Resolve): Set type.
29758 * support.cs: Handle empty arguments.
29760 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
29761 SimpleLookup): Auxiliary routines to help parse a qualifier
29764 Update qualifier_identifier rule.
29766 * codegen.cs: Removed debugging messages.
29768 * class.cs: Make this a global thing, this acts just as a "key" to
29769 objects that we might have around.
29771 (Populate): Only initialize method_builders_to_methods once.
29773 * expression.cs (PropertyExpr): Initialize type from the
29776 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
29777 Resolve pattern. Attempt to implicitly convert value to boolean.
29780 * expression.cs: Set the type for the int32/int32 argument case.
29781 (Binary::ResolveOperator): Set the return type to boolean for
29782 comparission operators
29784 * typemanager.cs: Remove debugging print code.
29786 (Invocation::Resolve): resolve type.
29788 * class.cs: Allocate a MemberInfo of the correct size, as the code
29789 elsewhere depends on the test to reflect the correct contents.
29791 (Method::) Keep track of parameters, due to System.Reflection holes
29793 (TypeContainer::Populate): Keep track of MethodBuilders to Method
29796 (TypeContainer::FindMembers): Use ArrayList and then copy an array
29797 of the exact size and return that.
29799 (Class::LookupMethodByBuilder): New function that maps
29800 MethodBuilders to its methods. Required to locate the information
29801 on methods because System.Reflection bit us again.
29803 * support.cs: New file, contains an interface ParameterData and
29804 two implementations: ReflectionParameters and InternalParameters
29805 used to access Parameter information. We will need to grow this
29808 * expression.cs (Invocation::GetParameterData): implement a cache
29809 and a wrapper around the ParameterData creation for methods.
29810 (Invocation::OverloadResolve): Use new code.
29812 2001-09-13 Ravi Pratap <ravi@ximian.com>
29814 * class.cs (TypeContainer::EmitField): Remove and move into
29815 (Field::Define): here and modify accordingly.
29816 (Field.FieldBuilder): New member.
29817 (TypeContainer::Populate): Update accordingly.
29818 (TypeContainer::FindMembers): Implement.
29820 2001-09-13 Miguel de Icaza <miguel@ximian.com>
29822 * statement.cs: (VariableInfo::VariableType): New field to be
29823 initialized with the full type once it is resolved.
29825 2001-09-12 Miguel de Icaza <miguel@ximian.com>
29827 * parameter.cs (GetParameterInfo): Use a type cache to compute
29828 things only once, and to reuse this information
29830 * expression.cs (LocalVariableReference::Emit): Implement.
29831 (OpcodeCast::Emit): fix.
29833 (ParameterReference::Resolve): Implement.
29834 (ParameterReference::Emit): Implement.
29836 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
29837 that are expressions need to stay as Expressions.
29839 * typemanager.cs (CSharpName): Returns the C# name of a type if
29842 * expression.cs (Expression::ConvertImplicit): New function that
29843 implements implicit type conversions.
29845 (Expression::ImplicitReferenceConversion): Implements implicit
29846 reference conversions.
29848 (EmptyCast): New type for transparent casts.
29850 (OpcodeCast): New type for casts of types that are performed with
29851 a sequence of bytecodes.
29853 (BoxedCast): New type used for casting value types into reference
29854 types. Emits a box opcode.
29856 (Binary::DoNumericPromotions): Implements numeric promotions of
29857 and computation of the Binary::Type.
29859 (Binary::EmitBranchable): Optimization.
29861 (Binary::Emit): Implement code emission for expressions.
29863 * typemanager.cs (TypeManager): Added two new core types: sbyte
29866 2001-09-12 Ravi Pratap <ravi@ximian.com>
29868 * class.cs (TypeContainer::FindMembers): Method which does exactly
29869 what Type.FindMembers does, only we don't have to use reflection. No
29870 implementation yet.
29872 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
29873 typecontainer objects as we need to get at them.
29874 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
29876 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
29877 typecontainer object.
29879 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
29880 of just a Report object.
29882 2001-09-11 Ravi Pratap <ravi@ximian.com>
29884 * class.cs (Event::Define): Go back to using the prefixes "add_" and
29886 (TypeContainer::Populate): Now define the delegates of the type too.
29887 (TypeContainer.Delegates): Property to access the list of delegates defined
29890 * delegates.cs (Delegate::Define): Implement partially.
29892 * modifiers.cs (TypeAttr): Handle more flags.
29894 2001-09-11 Ravi Pratap <ravi@ximian.com>
29896 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
29898 (Operator::Define): Re-write logic to get types by using the LookupType method
29899 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
29900 (Indexer::Define): Ditto.
29901 (Event::Define): Ditto.
29902 (Property::Define): Ditto.
29904 2001-09-10 Ravi Pratap <ravi@ximian.com>
29906 * class.cs (TypeContainer::Populate): Now define operators too.
29907 (TypeContainer.Operators): New property to access the list of operators
29909 (Operator.OperatorMethodBuilder): New member to hold the method builder
29910 for the operator we are defining.
29911 (Operator::Define): Implement.
29913 2001-09-10 Ravi Pratap <ravi@ximian.com>
29915 * class.cs (Event::Define): Make the prefixes of the accessor methods
29916 addOn_ and removeOn_
29918 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
29919 of the location being passed in too. Ideally, this should go later since all
29920 error reporting should be done through the Report object.
29922 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
29923 (Populate): Iterate thru the indexers we have and define them too.
29924 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
29925 for the get and set accessors.
29926 (Indexer::Define): Implement.
29928 2001-09-09 Miguel de Icaza <miguel@ximian.com>
29930 * expression.cs (Binary::Resolve): Beginning of it. I scratched
29931 my previous implementation, did not work.
29933 * typemanager.cs: Add a couple of missing types (the longs).
29935 * literal.cs: Use TypeManager.bool_type instead of getting it.
29937 * expression.cs (EventExpr): New kind of expressions.
29938 (Expressio::ExprClassFromMemberInfo): finish
29940 2001-09-08 Miguel de Icaza <miguel@ximian.com>
29942 * assign.cs: Emit stores to static fields differently.
29944 2001-09-08 Ravi Pratap <ravi@ximian.com>
29946 * Merge in changes and adjust code to tackle conflicts. Backed out my
29947 code in Assign::Resolve ;-)
29949 2001-09-08 Ravi Pratap <ravi@ximian.com>
29951 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
29952 instead Report.Error and also pass in the location.
29953 (CSharpParser::Lexer): New readonly property to return the reference
29954 to the Tokenizer object.
29955 (declare_local_variables): Use Report.Error with location instead of plain
29959 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
29960 (Operator.CheckBinaryOperator): Ditto.
29962 * cs-parser.jay (operator_declarator): Update accordingly.
29964 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
29965 (CheckBinaryOperator): Same here.
29967 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
29968 on the name without any prefixes of namespace names etc. This is because we
29969 already might have something already fully qualified like
29970 'System.Console.WriteLine'
29972 * assign.cs (Resolve): Begin implementation. Stuck ;-)
29974 2001-09-07 Ravi Pratap <ravi@ximian.com>
29976 * cs-tokenizer.cs (location): Return a string which also contains
29979 * expression.cs (ElementAccess): New class for expressions of the
29980 type 'element access.'
29981 (BaseAccess): New class for expressions of the type 'base access.'
29982 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
29985 * cs-parser.jay (element_access): Implement action.
29986 (base_access): Implement actions.
29987 (checked_expression, unchecked_expression): Implement.
29989 * cs-parser.jay (local_variable_type): Correct and implement.
29990 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
29992 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
29994 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
29995 name and the specifiers.
29997 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
29999 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
30000 making them all public ;-)
30002 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30005 2001-09-07 Miguel de Icaza <miguel@ximian.com>
30007 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30009 (FieldExpr, PropertyExprs): New resolved expressions.
30010 (SimpleName::MemberStaticCheck): Perform static checks for access
30011 to non-static fields on static methods. Maybe this should be
30012 generalized for MemberAccesses.
30013 (SimpleName::ResolveSimpleName): More work on simple name
30016 * cs-parser.jay (primary_expression/qualified_identifier): track
30017 the parameter index.
30019 * codegen.cs (CodeGen::Save): Catch save exception, report error.
30020 (EmitContext::EmitBoolExpression): Chain to expression generation
30021 instead of temporary hack.
30022 (::EmitStatementExpression): Put generic expression code generation.
30024 * assign.cs (Assign::Emit): Implement variable assignments to
30025 local variables, parameters and fields.
30027 2001-09-06 Miguel de Icaza <miguel@ximian.com>
30029 * statement.cs (Block::GetVariableInfo): New method, returns the
30030 VariableInfo for a variable name in a block.
30031 (Block::GetVariableType): Implement in terms of GetVariableInfo
30033 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30034 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30036 2001-09-06 Ravi Pratap <ravi@ximian.com>
30038 * cs-parser.jay (operator_declaration): Continue on my quest : update
30039 to take attributes argument.
30040 (event_declaration): Ditto.
30041 (enum_declaration): Ditto.
30042 (indexer_declaration): Ditto.
30044 * class.cs (Operator::Operator): Update constructor accordingly.
30045 (Event::Event): Ditto.
30047 * delegate.cs (Delegate::Delegate): Same here.
30049 * enum.cs (Enum::Enum): Same here.
30051 2001-09-05 Ravi Pratap <ravi@ximian.com>
30053 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30055 * ../tests/cs0658.cs : New file to demonstrate error 0658.
30057 * attribute.cs (Attributes): New class to encapsulate all attributes which were
30058 being passed around as an arraylist.
30059 (Attributes::AddAttribute): Method to add attribute sections.
30061 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30062 (struct_declaration): Update accordingly.
30063 (constant_declaration): Update.
30064 (field_declaration): Update.
30065 (method_header): Update.
30066 (fixed_parameter): Update.
30067 (parameter_array): Ditto.
30068 (property_declaration): Ditto.
30069 (destructor_declaration): Ditto.
30071 * class.cs (Struct::Struct): Update constructors accordingly.
30072 (Class::Class): Ditto.
30073 (Field::Field): Ditto.
30074 (Method::Method): Ditto.
30075 (Property::Property): Ditto.
30076 (TypeContainer::OptAttribute): update property's return type.
30078 * interface.cs (Interface.opt_attributes): New member.
30079 (Interface::Interface): Update to take the extra Attributes argument.
30081 * parameter.cs (Parameter::Parameter): Ditto.
30083 * constant.cs (Constant::Constant): Ditto.
30085 * interface.cs (InterfaceMemberBase): New OptAttributes field.
30086 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
30087 the attributes as a parameter.
30088 (InterfaceProperty): Update constructor call.
30089 (InterfaceEvent): Ditto.
30090 (InterfaceMethod): Ditto.
30091 (InterfaceIndexer): Ditto.
30093 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
30094 pass the attributes too.
30095 (interface_event_declaration): Ditto.
30096 (interface_property_declaration): Ditto.
30097 (interface_method_declaration): Ditto.
30098 (interface_declaration): Ditto.
30100 2001-09-05 Miguel de Icaza <miguel@ximian.com>
30102 * class.cs (Method::Define): Track the "static Main" definition to
30103 create an entry point.
30105 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30106 EntryPoint if we find it.
30108 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30109 (EmitContext::ig): Make this variable public.
30111 * driver.cs: Make the default output file be the first file name
30112 with the .exe extension.
30114 Detect empty compilations
30116 Handle various kinds of output targets. Handle --target and
30117 rename -t to --dumper.
30119 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30120 methods inherited from Expression return now an Expression. This
30121 will is used during the tree rewriting as we resolve them during
30124 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30125 the spec. Missing entirely is the information about
30126 accessability of elements of it.
30128 (Expression::ExprClassFromMemberInfo): New constructor for
30129 Expressions that creates a fully initialized Expression based on
30130 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30133 (Invocation::Resolve): Begin implementing resolution of invocations.
30135 * literal.cs (StringLiteral): Implement Emit.
30137 2001-09-05 Ravi Pratap <ravi@ximian.com>
30139 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30142 2001-09-04 Ravi Pratap <ravi@ximian.com>
30144 * cs-parser.jay (attribute_arguments): Implement actions.
30145 (attribute): Fix bug in production. Implement action.
30146 (attribute_list): Implement.
30147 (attribute_target): Implement.
30148 (attribute_target_specifier, opt_target_specifier): Implement
30149 (CheckAttributeTarget): New method to check if the attribute target
30151 (attribute_section): Implement.
30152 (opt_attributes): Implement.
30154 * attribute.cs : New file to handle attributes.
30155 (Attribute): Class to hold attribute info.
30157 * cs-parser.jay (opt_attribute_target_specifier): Remove production
30158 (attribute_section): Modify production to use 2 different rules to
30159 achieve the same thing. 1 s/r conflict down !
30160 Clean out commented, useless, non-reducing dimension_separator rules.
30162 * class.cs (TypeContainer.attributes): New member to hold list
30163 of attributes for a type.
30164 (Struct::Struct): Modify to take one more argument, the attribute list.
30165 (Class::Class): Ditto.
30166 (Field::Field): Ditto.
30167 (Method::Method): Ditto.
30168 (Property::Property): Ditto.
30170 * cs-parser.jay (struct_declaration): Update constructor call to
30171 pass in the attributes too.
30172 (class_declaration): Ditto.
30173 (constant_declaration): Ditto.
30174 (field_declaration): Ditto.
30175 (method_header): Ditto.
30176 (fixed_parameter): Ditto.
30177 (parameter_array): Ditto.
30178 (property_declaration): Ditto.
30180 * constant.cs (Constant::Constant): Update constructor similarly.
30181 Use System.Collections.
30183 * parameter.cs (Parameter::Parameter): Update as above.
30185 2001-09-02 Ravi Pratap <ravi@ximian.com>
30187 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30188 (TypeContainer.delegates): New member to hold list of delegates.
30190 * cs-parser.jay (delegate_declaration): Implement the action correctly
30191 this time as I seem to be on crack ;-)
30193 2001-09-02 Miguel de Icaza <miguel@ximian.com>
30195 * rootcontext.cs (RootContext::IsNamespace): new function, used to
30196 tell whether an identifier represents a namespace.
30198 * expression.cs (NamespaceExpr): A namespace expression, used only
30199 temporarly during expression resolution.
30200 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30201 utility functions to resolve names on expressions.
30203 2001-09-01 Miguel de Icaza <miguel@ximian.com>
30205 * codegen.cs: Add hook for StatementExpressions.
30207 * class.cs: Fix inverted test for static flag in methods.
30209 2001-09-02 Ravi Pratap <ravi@ximian.com>
30211 * class.cs (Operator::CheckUnaryOperator): Correct error number used
30212 to make it coincide with MS' number.
30213 (Operator::CheckBinaryOperator): Ditto.
30215 * ../errors/errors.txt : Remove error numbers added earlier.
30217 * ../errors/cs1019.cs : Test case for error # 1019
30219 * ../errros/cs1020.cs : Test case for error # 1020
30221 * cs-parser.jay : Clean out commented cruft.
30222 (dimension_separators, dimension_separator): Comment out. Ostensibly not
30223 used anywhere - non-reducing rule.
30224 (namespace_declarations): Non-reducing rule - comment out.
30226 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30227 with TypeContainer::AddEnum.
30229 * delegate.cs : New file for delegate handling classes.
30230 (Delegate): Class for declaring delegates.
30232 * makefile : Update.
30234 * cs-parser.jay (delegate_declaration): Implement.
30236 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
30238 * class.cs (Event::Define): Implement.
30239 (Event.EventBuilder): New member.
30241 * class.cs (TypeContainer::Populate): Update to define all enums and events
30243 (Events): New property for the events arraylist we hold. Shouldn't we move to using
30244 readonly fields for all these cases ?
30246 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30248 * class.cs (Property): Revamp to use the convention of making fields readonly.
30249 Accordingly modify code elsewhere.
30251 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30252 the Define method of the Property class.
30254 * class.cs : Clean up applied patch and update references to variables etc. Fix
30256 (TypeContainer::Populate): Update to define all the properties we have. Also
30257 define all enumerations.
30259 * enum.cs (Define): Implement.
30261 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30263 * cs-parser.jay (overloadable_operator): The semantic value is an
30264 enum of the Operator class.
30265 (operator_declarator): Implement actions.
30266 (operator_declaration): Implement.
30268 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30269 validity of definitions.
30270 (Operator::CheckBinaryOperator): Static method to check for binary operators
30271 (TypeContainer::AddOperator): New method to add an operator to a type.
30273 * cs-parser.jay (indexer_declaration): Added line to actually call the
30274 AddIndexer method so it gets added ;-)
30276 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
30277 already taken care of by the MS compiler ?
30279 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30281 * class.cs (Operator): New class for operator declarations.
30282 (Operator::OpType): Enum for the various operators.
30284 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30286 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30287 ostensibly handle this in semantic analysis.
30289 * cs-parser.jay (general_catch_clause): Comment out
30290 (specific_catch_clauses, specific_catch_clause): Ditto.
30291 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30292 (catch_args, opt_catch_args): New productions.
30293 (catch_clause): Rewrite to use the new productions above
30294 (catch_clauses): Modify accordingly.
30295 (opt_catch_clauses): New production to use in try_statement
30296 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30297 and re-write the code in the actions to extract the specific and
30298 general catch clauses by being a little smart ;-)
30300 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30301 Hooray, try and catch statements parse fine !
30303 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30305 * statement.cs (Block::GetVariableType): Fix logic to extract the type
30306 string from the hashtable of variables.
30308 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30309 I end up making that mistake ;-)
30310 (catch_clauses): Fixed gross error which made Key and Value of the
30311 DictionaryEntry the same : $1 !!
30313 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30315 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30317 * cs-parser.jay (event_declaration): Correct to remove the semicolon
30318 when the add and remove accessors are specified.
30320 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30322 * cs-parser.jay (IndexerDeclaration): New helper class to hold
30323 information about indexer_declarator.
30324 (indexer_declarator): Implement actions.
30325 (parsing_indexer): New local boolean used to keep track of whether
30326 we are parsing indexers or properties. This is necessary because
30327 implicit_parameters come into picture even for the get accessor in the
30328 case of an indexer.
30329 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
30331 * class.cs (Indexer): New class for indexer declarations.
30332 (TypeContainer::AddIndexer): New method to add an indexer to a type.
30333 (TypeContainer::indexers): New member to hold list of indexers for the
30336 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
30338 * cs-parser.jay (add_accessor_declaration): Implement action.
30339 (remove_accessor_declaration): Implement action.
30340 (event_accessors_declaration): Implement
30341 (variable_declarators): swap statements for first rule - trivial.
30343 * class.cs (Event): New class to hold information about event
30345 (TypeContainer::AddEvent): New method to add an event to a type
30346 (TypeContainer::events): New member to hold list of events.
30348 * cs-parser.jay (event_declaration): Implement actions.
30350 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
30352 * cs-parser.jay (dim_separators): Implement. Make it a string
30353 concatenating all the commas together, just as they appear.
30354 (opt_dim_separators): Modify accordingly
30355 (rank_specifiers): Update accordingly. Basically do the same
30356 thing - instead, collect the brackets here.
30357 (opt_rank_sepcifiers): Modify accordingly.
30358 (array_type): Modify to actually return the complete type string
30359 instead of ignoring the rank_specifiers.
30360 (expression_list): Implement to collect the expressions
30361 (variable_initializer): Implement. We make it a list of expressions
30362 essentially so that we can handle the array_initializer case neatly too.
30363 (variable_initializer_list): Implement.
30364 (array_initializer): Make it a list of variable_initializers
30365 (opt_array_initializer): Modify accordingly.
30367 * expression.cs (New::NType): Add enumeration to help us
30368 keep track of whether we have an object/delegate creation
30369 or an array creation.
30370 (New:NewType, New::Rank, New::Indices, New::Initializers): New
30371 members to hold data about array creation.
30372 (New:New): Modify to update NewType
30373 (New:New): New Overloaded contructor for the array creation
30376 * cs-parser.jay (array_creation_expression): Implement to call
30377 the overloaded New constructor.
30379 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
30381 * class.cs (TypeContainer::Constructors): Return member
30382 constructors instead of returning null.
30384 2001-08-26 Miguel de Icaza <miguel@ximian.com>
30386 * typemanager.cs (InitCoreTypes): Initialize the various core
30387 types after we have populated the type manager with the user
30388 defined types (this distinction will be important later while
30389 compiling corlib.dll)
30391 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
30392 on Expression Classification. Now all expressions have a method
30393 `Resolve' and a method `Emit'.
30395 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
30396 generation from working. Also add some temporary debugging
30399 2001-08-24 Miguel de Icaza <miguel@ximian.com>
30401 * codegen.cs: Lots of code generation pieces. This is only the
30402 beginning, will continue tomorrow with more touches of polish. We
30403 handle the fundamentals of if, while, do, for, return. Others are
30404 trickier and I need to start working on invocations soon.
30406 * gen-treedump.cs: Bug fix, use s.Increment here instead of
30409 * codegen.cs (EmitContext): New struct, used during code
30410 emission to keep a context. Most of the code generation will be
30413 * cs-parser.jay: Add embedded blocks to the list of statements of
30414 this block. So code generation proceeds in a top down fashion.
30416 2001-08-23 Miguel de Icaza <miguel@ximian.com>
30418 * statement.cs: Add support for multiple child blocks.
30420 2001-08-22 Miguel de Icaza <miguel@ximian.com>
30422 * codegen.cs (EmitCode): New function, will emit the code for a
30423 Block of code given a TypeContainer and its ILGenerator.
30425 * statement.cs (Block): Standard public readonly optimization.
30426 (Block::Block constructors): Link children.
30427 (Block::Child): Child Linker.
30428 (Block::EmitVariables): Emits IL variable declarations.
30430 * class.cs: Drop support for MethodGroups here, delay until
30432 (Method::): Applied the same simplification that I did before, and
30433 move from Properties to public readonly fields.
30434 (Method::ParameterTypes): Returns the parameter types for the
30435 function, and implements a cache that will be useful later when I
30436 do error checking and the semantic analysis on the methods is
30438 (Constructor::GetCallingConvention): Renamed from CallingConvetion
30439 and made a method, optional argument tells whether this is a class
30440 or a structure to apply the `has-this' bit.
30441 (Method::GetCallingConvention): Implement, returns the calling
30443 (Method::Define): Defines the type, a second pass is performed
30444 later to populate the methods.
30446 (Constructor::ParameterTypes): implement a cache similar to the
30447 one on Method::ParameterTypes, useful later when we do semantic
30450 (TypeContainer::EmitMethod): New method. Emits methods.
30452 * expression.cs: Removed MethodGroup class from here.
30454 * parameter.cs (Parameters::GetCallingConvention): new method.
30456 2001-08-21 Miguel de Icaza <miguel@ximian.com>
30458 * class.cs (TypeContainer::Populate): Drop RootContext from the
30461 (Constructor::CallingConvention): Returns the calling convention.
30462 (Constructor::ParameterTypes): Returns the constructor parameter
30465 (TypeContainer::AddConstructor): Keep track of default constructor
30466 and the default static constructor.
30468 (Constructor::) Another class that starts using `public readonly'
30469 instead of properties.
30471 (Constructor::IsDefault): Whether this is a default constructor.
30473 (Field::) use readonly public fields instead of properties also.
30475 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
30476 track of static constructors; If none is used, turn on
30477 BeforeFieldInit in the TypeAttributes.
30479 * cs-parser.jay (opt_argument_list): now the return can be null
30480 for the cases where there are no arguments.
30482 (constructor_declarator): If there is no implicit `base' or
30483 `this', then invoke the default parent constructor.
30485 * modifiers.cs (MethodAttr): New static function maps a set of
30486 modifiers flags into a MethodAttributes enum
30487 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
30488 MethodAttr, TypeAttr to represent the various mappings where the
30489 modifiers are used.
30490 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
30492 2001-08-19 Miguel de Icaza <miguel@ximian.com>
30494 * parameter.cs (GetParameterInfo): Fix bug where there would be no
30497 * interface.cs (PopulateIndexer): Implemented the code generator
30498 for interface indexers.
30500 2001-08-17 Miguel de Icaza <miguel@ximian.com>
30502 * interface.cs (InterfaceMemberBase): Now we track the new status
30505 (PopulateProperty): Implement property population. Woohoo! Got
30506 Methods and Properties going today.
30508 Removed all the properties for interfaces, and replaced them with
30509 `public readonly' fields.
30511 2001-08-16 Miguel de Icaza <miguel@ximian.com>
30513 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
30514 initialize their hashtables/arraylists only when they are needed
30515 instead of doing this always.
30517 * parameter.cs: Handle refs and out parameters.
30519 * cs-parser.jay: Use an ArrayList to construct the arguments
30520 instead of the ParameterCollection, and then cast that to a
30523 * parameter.cs: Drop the use of ParameterCollection and use
30524 instead arrays of Parameters.
30526 (GetParameterInfo): Use the Type, not the Name when resolving
30529 2001-08-13 Miguel de Icaza <miguel@ximian.com>
30531 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
30532 and instead use public readonly fields.
30534 * class.cs: Put back walking code for type containers.
30536 2001-08-11 Miguel de Icaza <miguel@ximian.com>
30538 * class.cs (MakeConstant): Code to define constants.
30540 * rootcontext.cs (LookupType): New function. Used to locate types
30543 2001-08-08 Miguel de Icaza <miguel@ximian.com>
30545 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
30546 this System.Reflection code is. Kudos to Microsoft
30548 * typemanager.cs: Implement a type cache and avoid loading all
30549 types at boot time. Wrap in LookupType the internals. This made
30550 the compiler so much faster. Wow. I rule!
30552 * driver.cs: Make sure we always load mscorlib first (for
30553 debugging purposes, nothing really important).
30555 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
30556 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
30558 * rootcontext.cs: Lookup types on their namespace; Lookup types
30559 on namespaces that have been imported using the `using' keyword.
30561 * class.cs (TypeContainer::TypeAttr): Virtualize.
30562 (Class::TypeAttr): Return attributes suitable for this bad boy.
30563 (Struct::TypeAttr): ditto.
30564 Handle nested classes.
30565 (TypeContainer::) Remove all the type visiting code, it is now
30566 replaced with the rootcontext.cs code
30568 * rootcontext.cs (GetClassBases): Added support for structs.
30570 2001-08-06 Miguel de Icaza <miguel@ximian.com>
30572 * interface.cs, statement.cs, class.cs, parameter.cs,
30573 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
30574 Drop use of TypeRefs, and use strings instead.
30576 2001-08-04 Miguel de Icaza <miguel@ximian.com>
30580 * class.cs (Struct::Struct): set the SEALED flags after
30581 checking the modifiers.
30582 (TypeContainer::TypeAttr): new property, returns the
30583 TypeAttributes for a class.
30585 * cs-parser.jay (type_list): Oops, list production was creating a
30586 new list of base types.
30588 * rootcontext.cs (StdLib): New property.
30589 (GetInterfaceTypeByName): returns an interface by type name, and
30590 encapsulates error handling here.
30591 (GetInterfaces): simplified.
30592 (ResolveTree): Encapsulated all the tree resolution here.
30593 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
30596 * driver.cs: Add support for --nostdlib, to avoid loading the
30597 default assemblies.
30598 (Main): Do not put tree resolution here.
30600 * rootcontext.cs: Beginning of the class resolution.
30602 2001-08-03 Miguel de Icaza <miguel@ximian.com>
30604 * rootcontext.cs: Provide better error reporting.
30606 * cs-parser.jay (interface_base): set our $$ to be interfaces.
30608 * rootcontext.cs (CreateInterface): Handle the case where there
30609 are no parent interfaces.
30611 (CloseTypes): Routine to flush types at the end.
30612 (CreateInterface): Track types.
30613 (GetInterfaces): Returns an array of Types from the list of
30614 defined interfaces.
30616 * typemanager.c (AddUserType): Mechanism to track user types (puts
30617 the type on the global type hash, and allows us to close it at the
30620 2001-08-02 Miguel de Icaza <miguel@ximian.com>
30622 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
30623 RecordInterface instead.
30625 * cs-parser.jay: Updated to reflect changes above.
30627 * decl.cs (Definition): Keep track of the TypeBuilder type that
30628 represents this type here. Not sure we will use it in the long
30629 run, but wont hurt for now.
30631 * driver.cs: Smaller changes to accomodate the new code.
30633 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
30636 * rootcontext.cs (CreateInterface): New method, used to create
30637 the System.TypeBuilder type for interfaces.
30638 (ResolveInterfaces): new entry point to resolve the interface
30640 (CodeGen): Property, used to keep track of the code generator.
30642 2001-07-26 Miguel de Icaza <miguel@ximian.com>
30644 * cs-parser.jay: Add a second production for delegate_declaration
30647 (enum_body): Put an opt_comma here instead of putting it on
30648 enum_body or enum_member_declarations so we can handle trailing
30649 commas on enumeration members. Gets rid of a shift/reduce.
30651 (type_list): Need a COMMA in the middle.
30653 (indexer_declaration): Tell tokenizer to recognize get/set
30655 * Remove old targets.
30657 * Re-add the parser target.
30659 2001-07-13 Simon Cozens <simon@simon-cozens.org>
30661 * cs-parser.jay: Add precendence rules for a number of operators
30662 ot reduce the number of shift/reduce conflicts in the grammar.
30664 2001-07-17 Miguel de Icaza <miguel@ximian.com>
30666 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
30669 Get rid of old crufty code.
30671 * rootcontext.cs: Use this to keep track of the parsed
30672 representation and the defined types available to the program.
30674 * gen-treedump.cs: adjust for new convention.
30676 * type.cs: Split out the type manager, and the assembly builder
30679 * typemanager.cs: the type manager will live here now.
30681 * cil-codegen.cs: And the code generator here.
30683 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
30685 * makefile: Fixed up for easy making.
30687 2001-07-13 Simon Cozens <simon@simon-cozens.org>
30689 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
30692 (unary_expression): Expand pre_increment_expression and
30693 post_decrement_expression to reduce a shift/reduce.
30695 2001-07-11 Simon Cozens
30697 * cs-tokenizer.cs: Hex numbers should begin with a 0.
30699 Improve allow_keyword_as_indent name.
30701 2001-06-19 Miguel de Icaza <miguel@ximian.com>
30703 * Adjustments for Beta2.
30705 2001-06-13 Miguel de Icaza <miguel@ximian.com>
30707 * decl.cs: Added `Define' abstract method.
30708 (InTransit): new property, used to catch recursive definitions.
30710 * interface.cs: Implement `Define'.
30712 * modifiers.cs: Map Modifiers.constants to
30713 System.Reflection.TypeAttribute flags.
30715 * class.cs: Keep track of types and user-defined types.
30716 (BuilderInit): New method for creating an assembly
30717 (ResolveType): New function to launch the resolution process, only
30718 used by interfaces for now.
30720 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
30721 that are inserted into the name space.
30723 2001-06-08 Miguel de Icaza <miguel@ximian.com>
30725 * ARGH. I have screwed up my tree so many times due to the use of
30726 rsync rather than using CVS. Going to fix this at once.
30728 * driver.cs: Objetify driver. Load assemblies, use assemblies to
30731 2001-06-07 Miguel de Icaza <miguel@ximian.com>
30733 * Experiment successful: Use System.Type rather that our own
30736 2001-05-25 Miguel de Icaza <miguel@ximian.com>
30738 * cs-parser.jay: Removed nsAliases from here.
30740 Use new namespaces, handle `using XXX;'
30742 * namespace.cs: Reimplemented namespace handling, use a recursive
30743 definition of the class. Now we can keep track of using clauses
30744 and catch invalid using clauses.
30746 2001-05-24 Miguel de Icaza <miguel@ximian.com>
30748 * gen-treedump.cs: Adapted for all the renaming.
30750 * expression.cs (Expression): this class now has a Type property
30751 which returns an expression Type.
30753 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
30754 `Type', as this has a different meaning now in the base
30756 2001-05-22 Miguel de Icaza <miguel@ximian.com>
30758 * interface.cs, class.cs: Removed from all the sources the
30759 references to signature computation, as we can not do method
30760 signature computation during the parsing time, as we are not
30761 trying to solve at that point distinguishing:
30765 void a (NS.Blah x) {}
30768 Which depending on the context might be valid or not, as we do not
30769 know if Blah is the same thing as NS.Blah at that point.
30771 * Redid everything so the code uses TypeRefs now instead of
30772 Types. TypeRefs are just temporary type placeholders, that need
30773 to be resolved. They initially have a pointer to a string and the
30774 current scope in which they are used. This is used later by the
30775 compiler to resolve the reference to an actual Type.
30777 * DeclSpace is no longer a CIR.Type, and neither are
30778 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
30779 are all DeclSpaces, but no Types.
30781 * type.cs (TypeRefManager): This implements the TypeRef manager,
30782 which keeps track of all the types that need to be resolved after
30783 the parsing has finished.
30785 2001-05-13 Miguel de Icaza <miguel@ximian.com>
30787 * ARGH. We are going to have to store `foreach' as a class rather
30788 than resolving it, as we need to verify error 1579 after name
30789 resolution. *OR* we could keep a flag that says `This request to
30790 IEnumerator comes from a foreach statement' which we can then use
30791 to generate the error.
30793 2001-05-10 Miguel de Icaza <miguel@ximian.com>
30795 * class.cs (TypeContainer.AddMethod): we now add methods to the
30796 MethodGroup instead of the method hashtable.
30798 * expression.cs: Add MethodGroup abstraction, which gets us one
30799 step closer to the specification in the way we handle method
30802 * cs-parser.jay (primary_expression): qualified_identifier now
30803 tried to match up an identifier to a local variable reference or
30804 to a parameter reference.
30806 current_local_parameters is now a parser global variable that
30807 points to the current parameters for the block, used during name
30810 (property_declaration): Now creates an implicit `value' argument to
30813 2001-05-09 Miguel de Icaza <miguel@ximian.com>
30815 * parameter.cs: Do not use `param' arguments as part of the
30816 signature, per the spec.
30818 2001-05-08 Miguel de Icaza <miguel@ximian.com>
30820 * decl.cs: Base class for classes, structs and interfaces. This
30821 is the "Declaration Space"
30823 * cs-parser.jay: Use CheckDef for checking declaration errors
30824 instead of having one on each function.
30826 * class.cs: Factor out some code for handling error handling in
30827 accordance to the "Declarations" section in the "Basic Concepts"
30828 chapter in the ECMA C# spec.
30830 * interface.cs: Make all interface member classes derive from
30831 InterfaceMemberBase.
30833 2001-05-07 Miguel de Icaza <miguel@ximian.com>
30835 * Many things: all interfaces are parsed and generated in
30836 gen-treedump. Support for member variables, constructors,
30837 destructors, properties, constants is there.
30839 Beginning of the IL backend, but very little done, just there for
30842 2001-04-29 Miguel de Icaza <miguel@ximian.com>
30844 * cs-parser.jay: Fix labeled statement.
30846 * cs-tokenizer.cs (escape): Escape " and ' always.
30847 ref_line, ref_name: keep track of the line/filename as instructed
30848 by #line by the compiler.
30851 2001-04-27 Miguel de Icaza <miguel@ximian.com>
30853 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
30854 to match the values in System.CodeDOM.
30856 Divid renamed to Divide.
30858 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
30860 (Statements.set): remove.
30862 * System.CodeDOM/CodeCatchClause.cs: always have a valid
30865 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
30866 falseStatements always have valid values.
30868 * cs-parser.jay: Use System.CodeDOM now.