1 2008-09-15 Miguel de Icaza <miguel@novell.com>
3 * namespace.cs: Do not report CS0246 (name
5 2008-09-12 Marek Safar <marek.safar@gmail.com>
8 * generic.cs: Don't cache generic static anonymous method
11 2008-09-12 Marek Safar <marek.safar@gmail.com>
13 * generic.cs, class.cs, delegate.cs: Check recursive inherited
14 conflicting constraints.
16 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
18 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
21 2008-09-12 Marek Safar <marek.safar@gmail.com>
23 * literal.cs, convert.cs, expression.cs, statement.cs: More null
24 to null pointer conversion fixes.
26 2008-09-11 Marek Safar <marek.safar@gmail.com>
28 * cs-parser.jay, expression.cs: An implicitly typed local variable
29 declarator cannot use an array initializer.
31 2008-09-11 Marek Safar <marek.safar@gmail.com>
33 * cs-parser.jay: Reduced number of printed tokens, add sorting.
35 2008-09-11 Marek Safar <marek.safar@gmail.com>
37 * generic.cs (InflatedConstraints): Don't crash when constraints
40 * cs-parser.jay: const_declarator is a block.
42 * constant.cs: Check for not allowed NaN conversions.
44 2008-09-10 Miguel de Icaza <miguel@novell.com>
46 * driver.cs: Drop --shell argument, the compiler is no longer a
49 * eval.cs: Move most of the code that deals with evaluation into
50 this file and document the public API from repl.cs
52 * repl.cs: Remove from here.
54 2008-09-10 Marek Safar <marek.safar@gmail.com>
57 * generic.cs: Generic class constraints must come first.
59 2008-09-09 Miguel de Icaza <miguel@novell.com>
61 * cs-parser.jay: Improve error reporting for syntax errors in
62 statements and expressions, we now report the expected tokens
63 instead of reporting the useless "; expected".
65 Drop the strings from the token declaration, it turns out that
66 they did not do what I thought they did. Instead they were adding
67 two sets of tokens to the tables.
69 2008-09-09 Marek Safar <marek.safar@gmail.com>
71 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
72 delegate.cs: Share special type check.
74 2008-09-09 Marek Safar <marek.safar@gmail.com>
77 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
79 2008-09-09 Marek Safar <marek.safar@gmail.com>
81 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
84 2008-09-09 Marek Safar <marek.safar@gmail.com>
86 A fix for bugs: #324750, #335946
87 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
88 lookup rule to determine ?-based tokens.
90 2008-09-08 Miguel de Icaza <miguel@novell.com>
92 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
93 expressions (like event adding or removing) end up here, so we
94 need to treat those as statements.
96 Add LoadAssembly method.
98 2008-09-04 Miguel de Icaza <miguel@novell.com>
100 * repl.cs: Add Time method.
102 2008-09-05 Marek Safar <marek.safar@gmail.com>
104 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
106 2008-09-05 Miguel de Icaza <miguel@novell.com>
108 * repl.cs: Add workaround for old compilers.
110 2008-09-04 Jb Evain <jbevain@novell.com>
112 * repl.cs (PrettyPrint): pretty print everything that
113 implements IDictionary, as well as IEnumerables. Also,
114 add a quit helper property.
116 2008-09-04 Marek Safar <marek.safar@gmail.com>
118 * constant.cs: Better error reporting for decimal literals.
120 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
123 2008-09-04 Marek Safar <marek.safar@gmail.com>
124 Miguel de Icaza <miguel@novell.com>
126 A fix for bug #422951
127 * assign.cs (Assign.DoResolve): Perform the type conversions
128 checks before we attempt to initialize `New' initializers.
130 2008-09-04 Marek Safar <marek.safar@gmail.com>
132 A fix for bug #422853
133 * delegate.cs (DelegateCreation): Add special handling for
134 EmptyExpression.Null instance expression which is just another
135 hack for undecided member instance exression.
137 2008-09-04 Marek Safar <marek.safar@gmail.com>
139 * expression.cs, ecore.cs: Emit full expression tree for reduced
142 2008-09-04 Marek Safar <marek.safar@gmail.com>
144 * expression.cs (This): Guard against multi-resolving.
146 * ecore.cs, statement.cs (Throw): Simplified.
148 * flowanalysis.cs: Also verify event fields.
150 2008-09-04 Miguel de Icaza <miguel@novell.com>
152 * assign.cs (Assign.DoResolve): Perform the type conversions
153 checks before we attempt to initialize `New' initializers.
155 * repl.cs (PrettyPrint): Add Hashtable prettyprint
157 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
160 * repl.cs: Update help.
162 2008-09-03 Miguel de Icaza <miguel@novell.com>
164 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
165 handling of the default config handling, including the special
166 treatment of System.Core assembly.
168 Fixes the REPL processing for LINQ.
170 2008-09-03 Marek Safar <marek.safar@gmail.com>
172 A fix for bug #422507
173 * expression.cs (UnboxCast): Add missing child expression mutator.
175 2008-09-03 Marek Safar <marek.safar@gmail.com>
177 * driver.cs: Don't self reference System.Core assembly.
179 2008-09-03 Marek Safar <marek.safar@gmail.com>
181 A fix for bug #422507
182 * expression.cs (StringConcat): Add missing type mutator.
184 2008-09-03 Marek Safar <marek.safar@gmail.com>
186 * generic.cs (TypeInferenceContext): Follow equality rule for
187 constructed type lower bound type inference.
189 2008-09-02 Miguel de Icaza <miguel@novell.com>
191 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
192 <dblank@cs.brynmawr.edu> which updates the cursor position on
195 2008-09-02 Marek Safar <marek.safar@gmail.com>
197 A fix for bug #367145
198 * driver.cs: Fixed import of extension methods when using -noconfig
201 2008-09-02 Marek Safar <marek.safar@gmail.com>
203 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
204 version from non-generic implementation instead.
206 2008-09-01 Marek Safar <marek.safar@gmail.com>
208 A fix for bug #418908
209 * class.cs: Use AddScopeStatement for field initializers.
211 2008-09-01 Marek Safar <marek.safar@gmail.com>
213 A fix for bug #415385
214 * ecore.cs, convert.cs: Do method group conversion for equal group types.
216 2008-09-01 Marek Safar <marek.safar@gmail.com>
218 A fix for bug #421736
219 * iterators.cs: Don't crash on unreachable iterators.
221 2008-09-01 Marek Safar <marek.safar@gmail.com>
223 A fix for bug #421628
224 * parameter.cs, attribute.cs: Clone also parameter attributes.
226 2008-08-30 Miguel de Icaza <miguel@novell.com>
228 * namespace.cs (LookupType): In EvalMode, try to replace
229 the TypeBuilder from our cache with a Type as Reflection.Emit does
230 not like to mix code from older assemblies emitted and new
233 This sounds like a serious Mono bug that prevents multiple
234 assemblies to be generated and consumed at the same time.
236 * cs-parser.jay (push_current_class): Do not make interactive
237 classes internal or private, make them public as we currently
238 generate each new class in a new assembly.
240 2008-08-29 Miguel de Icaza <miguel@novell.com>
242 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
243 remove types that are entered into the global namespace during
244 parsing so that we can remove them on failure.
246 * cs-parser.jay: Parsing: we now keep track of types that are
247 entered into global variables and queue those in case the parsing
250 This happens in a few situations: during partial-input, we invoke
251 the parser repeatedly for example with the string "class X", this
252 would cause X to be registed, and we need to remove this
253 registration so that another parse attempt later with say "class X {"
256 Additionally, if there is an error in the resolution phase, for
257 example: "class X : NonExistant {}" th
259 * cs-parser.jay: Be more precise with the errors being raised,
260 instead of flagging all exceptions during parsing to be attributed
261 to the parsing process, distinguish those from errors happening in
262 the actions and hint that using -v would produce the actual
265 * repl.cs: Do not load all compiler references on each reset,
266 doing the partial reset takes care of this.
268 2008-08-28 Miguel de Icaza <miguel@novell.com>
270 * repl.cs: Add support for loading all the files from
271 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
274 Introduce a micro-parser that is able to deambiguate on its input
275 whether we are dealing with a compilation unit (namespace, class,
276 interface, struct, delegate) declaration or a statement. This
277 allows both declarations and statements to be entered.
279 Set history size by default to 300 lines.
281 Instead of distinguishing based on the parser.InteractiveResult,
282 have only two cases: statements were parsed, or a compilation unit
283 was. Always pull the Using statement additions from the
284 compilation unit parse.
286 * cs-tokenizer.cs: Rename tokens to better describe their intent
287 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
289 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
290 EvalMode is used to trigger the lookup of global variables while
291 StatementMode is used turn variable declarations into static
294 * getline.cs: Allow history size to be set.
296 2008-08-29 Marek Safar <marek.safar@gmail.com>
298 A fix for bug #360755
299 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
301 2008-08-29 Marek Safar <marek.safar@gmail.com>
303 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
305 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
306 member name, it is too confusing
308 * decl.cs, class.cs: Don't report unused fields with attached attribute.
310 * rootcontext.cs: Finally default to warning level 4.
312 2008-08-28 Marek Safar <marek.safar@gmail.com>
314 * class.cs (CheckBase): Ignore overloaded operators.
316 2008-08-28 Marek Safar <marek.safar@gmail.com>
318 A fix for bug #420830
319 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
321 2008-08-28 Marek Safar <marek.safar@gmail.com>
323 A fix for bug #420832
324 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
326 2008-08-28 Marek Safar <marek.safar@gmail.com>
328 A fix for bug #420386
329 * nullables.cs: Fixed logic of nullable user comparison operators involving
332 2008-08-28 Marek Safar <marek.safar@gmail.com>
334 * attribute (IsClsCompliant): Use FALSE value for pointer types.
336 2008-08-27 Miguel de Icaza <miguel@novell.com>
338 * repl.cs: Add support for aborting the running code with C-c.
340 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
342 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
344 2008-08-27 Miguel de Icaza <miguel@novell.com>
346 * cs-parser.jay (interactive_statement_list): A new set of rules
347 for hosting statements that uses the "interactive_" prefix.
349 * repl.cs: Add support for parsing `using' as a statement or as a
350 directive. Deambiguating before passing this to the parser.
352 We need to distinguish statement_expressions that occur at the
353 toplevel vs those that occur embedded into expressions.
355 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
356 that fixes the cursor key handling, and a history bug.
358 2008-08-26 Miguel de Icaza <miguel@novell.com>
360 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
361 limitations in Console, instead the 2.0 bootstrap libraries now
362 include the Console bits.
364 Also, remove the use of Nullables from getline.cs
368 Interactive support for the C# compiler. Use gmcs --shell to
369 enter a read-eval-print loop shell.
371 Docs: http://www.mono-project.com/CsharpRepl
373 * sources: include repl.cs here and getline.cs for gmcs.exe,
374 everything else is getline.cs impaired.
376 * Makefile: when bootstrapping pass a special flag
377 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
378 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
379 This distinguishes those two cases.
381 * repl.cs: Support for a read-eval-print loop. Will be soon
382 refactored into eval support and then REPL on top of it.
384 * ecore.cs: If a simplename lookup fails, before erroring out,
385 if we are in EvalMode to resolve the name to a declaration in the
388 This means that variable declarations that happened in previous
389 classes (as repl puts every statement in a separate class) are
390 made visible in this way.
392 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
393 triggered an error due to the end of file being reached. This is
394 used to do multi-line input, and notify the caller that the user
395 needs to provide more text before a successful parse.
397 Add new grammar rules after the INTERACTIVE_PARSER token is seen
398 to drive the evaluation with a custom wrapper.
400 * driver.cs: Add support for --shell, and refactor some code to be
403 * namespace.cs: Add support for serializing the contents of the
404 namespaces and reloading them.
406 * getline.cs: A managed implementation of ReadLine under
407 X11/Apache2 license terms. Easy to embed in other applications as
410 * namespace.cs: Add some functions to save and restore the
413 * rootcontext.cs: New public field.
415 * cs-tokenizer.cs: Add support for one of the possible characters
416 we introduce into the token stream.
418 This patch does not affect the regular tokenization process, the
419 only performance hit would happen if there is an invalid character
422 * support.cs: Move isatty helper routine here.
424 * codegen.cs: Small cleanup, and add a mechanism to initialize the
425 code generator for in-memory assemblies.
427 2008-08-26 Marek Safar <marek.safar@gmail.com>
429 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
430 parameter cannot be always used as a type.
432 2008-08-21 Marek Safar <marek.safar@gmail.com>
434 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
436 2008-08-21 Marek Safar <marek.safar@gmail.com>
438 * convert.cs: Implement explicit array to IList<T> conversion.
440 2008-08-20 Marek Safar <marek.safar@gmail.com>
442 A fix for bug #362740
443 * cs-tokenizer.cs: Handle UTF-16 surrogates.
445 2008-08-20 Marek Safar <marek.safar@gmail.com>
447 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
448 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
449 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
450 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
451 handling to use just one type of infrastructure and deal with generics
454 2008-07-23 Martin Baulig <martin@ximian.com>
456 *** Merged this from trunk revision 108527 ***
459 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
460 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
463 2008-08-15 Marek Safar <marek.safar@gmail.com>
465 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
468 2008-08-15 Marek Safar <marek.safar@gmail.com>
470 * delegate.cs: Fixed compiler crash when creating delegate using partial
473 * typemanager.cs: MulticastDelegate is not a delegate.
475 2008-08-14 Marek Safar <marek.safar@gmail.com>
477 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
480 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
482 * cs-parser.jay (type): Allow 'var' in mcs too.
483 (local_variable_type): Likewise.
485 2008-08-14 Marek Safar <marek.safar@gmail.com>
487 * driver.cs: Removed broken -noconfig variants.
489 2008-08-14 Marek Safar <marek.safar@gmail.com>
491 A fix for bug #417078
492 * expression.cs: Emit correctly left side pointer operators.
494 2008-08-13 Marek Safar <marek.safar@gmail.com>
496 * generic.cs, lambda.cs: Inflate method generic arguments only.
498 2008-08-12 Marek Safar <marek.safar@gmail.com>
500 * class.cs: Fixed struct layout check regression.
502 2008-08-12 Marek Safar <marek.safar@gmail.com>
504 * cs-parser.jay, enum.cs: Simplified enum parsing.
506 * decl.cs: Check all type parameters conflicts.
508 * expression.cs, statement.cs, attribute.cs: More expression checks.
510 2008-08-11 Marek Safar <marek.safar@gmail.com>
512 * generic.cs: Add type inference types restriction.
514 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
515 anonymous.cs, expression.cs: Allocate less accessor parameters.
517 2008-08-08 Marek Safar <marek.safar@gmail.com>
519 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
522 2008-08-08 Marek Safar <marek.safar@gmail.com>
524 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
526 2008-08-07 Marek Safar <marek.safar@gmail.com>
528 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
529 Also fixes #362146 and #381592.
531 2008-08-07 Marek Safar <marek.safar@gmail.com>
533 * ecore.cs: Reduced constant cannot be used as an attribute value.
535 * cs-parser.jay: Base expression has to be a type.
537 * expression.cs (Conditional): Uses ReducedExpression.
539 2008-08-06 Marek Safar <marek.safar@gmail.com>
541 A fix for bug #376826
542 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
543 address of hoisted local variable or parameter cannot be taken.
545 2008-08-05 Marek Safar <marek.safar@gmail.com>
547 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
548 anonymous method inside checked/unchecked expression.
550 2008-08-05 Marek Safar <marek.safar@gmail.com>
552 * typemanager.cs (IsEqual): Guard against null.
554 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
555 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
556 routine. Fixed few misleading conversion errors.
558 2008-08-04 Marek Safar <marek.safar@gmail.com>
560 * class.cs: Consider generics when checking cycles in struct layout.
562 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
564 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
566 2008-08-04 Marek Safar <marek.safar@gmail.com>
568 A fix for bug #414165
569 * anonymous.cs: Use same anonymous implementation method for all anonymous
572 2008-08-04 Marek Safar <marek.safar@gmail.com>
574 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
577 2008-08-04 Marek Safar <marek.safar@gmail.com>
579 * cs-parser.jay: Typeof argument has to be a type expression.
581 * namespace.cs: Check alias and namespace definitions collisions.
583 * class.cs, pending.cs: Moved explicit interface accessor implementation
586 * delegate.cs, expression.cs: Verify special name invocations.
588 2008-08-01 Marek Safar <marek.safar@gmail.com>
590 * cs-parser.jay: Don't choke on empty generic type arguments.
592 * cs-tokenizer.cs: Handle escaped preprocessor directives.
594 * expression.cs, ecore.cs: Minor expressions bugs.
596 2008-08-01 Marek Safar <marek.safar@gmail.com>
598 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
599 and added more error handling.
601 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
603 * modifiers.cs, enum.cs: Fixed.
605 2008-07-31 Jb Evain <jbevain@novell.com>
607 * driver.cs: remove -pkg ability of smcs.
609 2008-07-30 Marek Safar <marek.safar@gmail.com>
611 * statement.cs (Switch): Correctly set empty default target for single
614 2008-07-30 Marek Safar <marek.safar@gmail.com>
616 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
617 string switch statement implementation to use string dictionary which
618 significantly (2-8x) improves performance of generated code.
620 2008-07-29 Marek Safar <marek.safar@gmail.com>
622 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
623 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
625 2008-07-29 Marek Safar <marek.safar@gmail.com>
627 A fix for bug #412595
628 * typemanager.cs, convert.cs, expression.cs: Some types are never
629 convertible to each other.
631 2008-07-29 Marek Safar <marek.safar@gmail.com>
633 * nullable.cs (CreateNullConstant): An error messages update.
635 2008-07-29 Marek Safar <marek.safar@gmail.com>
637 A fix for bug #412595
638 * cfold.cs: Don't cast undefined bool constant.
640 2008-07-29 Martin Baulig <martin@ximian.com>
643 (SymbolWriter.Reset): New public static method.
646 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
648 2008-07-28 Marek Safar <marek.safar@gmail.com>
650 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
652 * expression.cs (ElementAccess): Exact size allocation.
654 2008-07-26 Marek Safar <marek.safar@gmail.com>
656 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
658 2008-07-25 Marek Safar <marek.safar@gmail.com>
660 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
662 * class.cs: Removed $PRIVATE$ field hack which caused problems during
665 2008-07-25 Marek Safar <marek.safar@gmail.com>
667 A fix for bug #412217
668 * assign.cs: Mutate also assignment type.
670 2008-07-25 Marek Safar <marek.safar@gmail.com>
672 A fix for bug #323644
673 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
676 2008-07-25 Marek Safar <marek.safar@gmail.com>
678 A fix for bug #412134
679 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
680 non-enumerable operands when overloading equality or bitwise operators.
682 2008-07-25 Marek Safar <marek.safar@gmail.com>
684 * anonymous.cs: Cache closed generic anonymous method delegates.
686 2008-07-24 Marek Safar <marek.safar@gmail.com>
688 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
689 anonymous.cs, statement.cs: Always emit anonymous method as static method
690 when is instance free. Use nesting for nested anynomous methods blocks.
692 2008-07-23 Marek Safar <marek.safar@gmail.com>
694 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
697 2008-07-23 Marek Safar <marek.safar@gmail.com>
699 * expression.cs: Removed MakeSimpleCall.
701 2008-07-23 Marek Safar <marek.safar@gmail.com>
703 A fix for bug #323012
704 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
705 Base method implementing interface has to be public.
707 2008-07-23 Marek Safar <marek.safar@gmail.com>
709 * cs-parser.jay: Don't break on missing argument.
711 2008-07-22 Marek Safar <marek.safar@gmail.com>
713 A fix for bug #320993
714 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
715 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
717 2008-07-22 Marek Safar <marek.safar@gmail.com>
719 A fix for bug #320748
720 * convert.cs: Implicit user operators cannot convert to interfaces
722 2008-07-22 Marek Safar <marek.safar@gmail.com>
724 A fix for bug #312686
725 * driver.cs: Ignore empty assembly references.
727 2008-07-22 Marek Safar <marek.safar@gmail.com>
729 A fix for bug #387040
730 * ecore.cs: Skip constrains check for an explicit implementation.
732 2008-07-21 Marek Safar <marek.safar@gmail.com>
734 A fix for bug #409045
735 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
736 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
737 identifiers are file specific unless passed as input arguments.
739 2008-07-21 Marek Safar <marek.safar@gmail.com>
741 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
742 to emit UnmanagedMarshal data under 2.0 profile.
744 2008-07-21 Marek Safar <marek.safar@gmail.com>
746 A fix for bug #410369
747 * parameter.cs: Clone correctly ParamsParameter.
749 2008-07-21 Marek Safar <marek.safar@gmail.com>
751 * expression.cs (Argument): Always report type for type based expressions
754 2008-07-18 Marek Safar <marek.safar@gmail.com>
756 A fix for bug #410666
757 * anonymous.cs: Correctly initialize generic storey reference.
759 2008-07-18 Marek Safar <marek.safar@gmail.com>
761 * convert.cs: Don't box same type arguments.
763 2008-07-18 Marek Safar <marek.safar@gmail.com>
765 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
766 Finished missing generic type mutators.
768 2008-07-18 Marek Safar <marek.safar@gmail.com>
770 * iterators.cs, statement.cs: Finished statements CloneTo.
772 2008-07-18 Marek Safar <marek.safar@gmail.com>
774 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
776 * expression.cs: Emit optimized default value expressions in expression tree
779 2008-07-18 Marek Safar <marek.safar@gmail.com>
781 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
783 2008-07-17 Marek Safar <marek.safar@gmail.com>
785 A fix for bug #367536
786 * cs-parser.jay: Check static constructor of generic types for an access
789 2008-07-17 Marek Safar <marek.safar@gmail.com>
791 A fix for bug #353800
792 * lambda.cs: Emit ret for contextual statements.
794 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
795 up emitting redundant ret for all anonymous methods with return.
797 2008-07-17 Marek Safar <marek.safar@gmail.com>
799 A fix for bug #365188
800 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
801 create anonymous method storey in unreachable block.
803 2008-07-17 Marek Safar <marek.safar@gmail.com>
805 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
806 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
807 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
808 statement.cs: Fixed relevant defects found by Gendarme.
810 2008-07-17 Marek Safar <marek.safar@gmail.com>
812 A fix for bug #325291
813 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
814 statement.cs: Replaced IAnonymousHost with top level block flag.
816 2008-07-17 Marek Safar <marek.safar@gmail.com>
818 * cs-parser.jay: Clean up unused open_parens.
820 2008-07-17 Marek Safar <marek.safar@gmail.com>
822 * ecore.cs: Custom error message for a range variable assignment.
824 2008-07-16 Marek Safar <marek.safar@gmail.com>
826 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
829 2008-07-16 Marek Safar <marek.safar@gmail.com>
831 * literal.cs: Null literal is of object type.
833 2008-07-16 Marek Safar <marek.safar@gmail.com>
835 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
836 expression of nullable equality comparison.
838 2008-07-15 Marek Safar <marek.safar@gmail.com>
840 * expression.cs(PointerArithmetic): Removed redundant assignment.
842 2008-07-15 Marek Safar <marek.safar@gmail.com>
844 * decl.cs (GetSignatureForError): Report full namespace name for containers.
846 2008-07-14 Marek Safar <marek.safar@gmail.com>
848 A fix for bug #408361
849 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
850 they are replaced by GetMethod.
852 2008-07-14 Marek Safar <marek.safar@gmail.com>
854 A fix for bug #408721 by jeremie.laval@gmail.com
855 * expression.cs (Indirection): Implemented CloneTo.
857 2008-07-14 Marek Safar <marek.safar@gmail.com>
859 * statement.cs (AssignableSlots): Temporary disabled variable initialization
862 2008-07-14 Marek Safar <marek.safar@gmail.com>
864 * report.cs (EnableReporting): Don't reinitialize 0-based values.
866 2008-07-11 Marek Safar <marek.safar@gmail.com>
868 * linq.cs: Reset tranparent parameter counter in probing mode.
870 2008-07-11 Marek Safar <marek.safar@gmail.com>
872 * anonymous.cs: Mutate anonymous method type.
874 2008-07-11 Marek Safar <marek.safar@gmail.com>
876 * ecore.cs, anonymous.cs: Mutate field expressions.
878 2008-07-10 Marek Safar <marek.safar@gmail.com>
880 A fix for bug #369670
881 * linq.cs, statement.cs: Use explicit block for query expressions variables.
883 2008-07-10 Marek Safar <marek.safar@gmail.com>
885 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
887 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
890 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
891 only one '>', and finds a '>>', abort the generic lookahead.
893 2008-07-10 Marek Safar <marek.safar@gmail.com>
895 A fix for bug #319902
896 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
898 2008-07-10 Marek Safar <marek.safar@gmail.com>
900 A fix for bug #406371
901 * statement.cs: Moved EmitSymbolInfo to Block.
903 2008-07-09 Marek Safar <marek.safar@gmail.com>
905 * ecore.cs: Report better error for extension method overload failures.
907 2008-07-09 Marek Safar <marek.safar@gmail.com>
909 * expression.cs (Is): No need to box reference values.
911 2008-07-09 Marek Safar <marek.safar@gmail.com>
913 * class.cs: Use event resolve context when initializing CreateEmitContext.
915 2008-07-09 Marek Safar <marek.safar@gmail.com>
917 A fix for bug #394436
918 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
919 method used inside expression trees. Added more LINQ to expression tree
922 2008-07-08 Marek Safar <marek.safar@gmail.com>
924 A fix for bug #378189, #370577
925 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
928 2008-07-08 Marek Safar <marek.safar@gmail.com>
930 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
933 2008-07-08 Marek Safar <marek.safar@gmail.com>
935 A fix for bug #406702
936 * anonymous.cs: Always park anonymous method in the nearest parent storey.
938 2008-07-07 Marek Safar <marek.safar@gmail.com>
940 A fix for bug #406648
941 * cs-parser.jay: Report nullable use in mcs for some cases.
943 2008-07-07 Marek Safar <marek.safar@gmail.com>
945 * ecore.cs: Improved argument mismatch error messages.
947 2008-07-07 Marek Safar <marek.safar@gmail.com>
949 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
951 2008-07-07 Marek Safar <marek.safar@gmail.com>
953 * expression.cs (TypeOf): Mutate type argument.
955 2008-07-04 Marek Safar <marek.safar@gmail.com>
957 * class.cs: Report missing partial modifier for correct type.
959 2008-07-04 Marek Safar <marek.safar@gmail.com>
961 * ecore.cs, expression.cs (VariableReference): Variable property is
964 2008-07-04 Marek Safar <marek.safar@gmail.com>
966 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
968 2008-07-04 Marek Safar <marek.safar@gmail.com>
970 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
973 2008-07-04 Marek Safar <marek.safar@gmail.com>
975 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
976 anonymous method storey to an instance method when only "this" is hoisted.
978 2008-07-03 Marek Safar <marek.safar@gmail.com>
980 A fix for bug #321615
981 * expression.cs: Pointer comparisons use unsigned operator.
983 2008-07-03 Marek Safar <marek.safar@gmail.com>
985 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
987 2008-07-02 Marek Safar <marek.safar@gmail.com>
989 A fix for bug #404905
990 * class.cs: Always initialize local unsafe variables.
992 2008-06-30 Marek Safar <marek.safar@gmail.com>
994 A fix for bug #396987
995 * expression.cs (NewInitialize): Clear local temporary variable for next run
997 2008-06-27 Marek Safar <marek.safar@gmail.com>
999 A fix for bug #401020
1000 * ecore.cs: Both types and modifiers have to match for ref and out arguments
1002 2008-06-27 Marek Safar <marek.safar@gmail.com>
1004 A fix for bug #398319
1005 * cs-parser.jay: Implemented undocumented base access expression inside
1008 2008-06-26 Marek Safar <marek.safar@gmail.com>
1010 A fix for bug #404227
1011 * cs-parser.jay: Parse namespace declaration using qualified identifier.
1013 2008-06-26 Marek Safar <marek.safar@gmail.com>
1015 A fix for bug #404227
1016 * convert.cs: Fixed explicit array to interface cast.
1018 2008-06-26 Marek Safar <marek.safar@gmail.com>
1020 A fix for bug #403894
1021 * delegate.cs: Mutate DelegateInvocation type.
1023 2008-06-26 Marek Safar <marek.safar@gmail.com>
1025 A fix for bug #379348
1026 * delegate.cs: Box a load of generic parameters.
1028 2008-06-26 Marek Safar <marek.safar@gmail.com>
1030 * expression.cs: Add an array creation arguments mutate.
1032 2008-06-26 Marek Safar <marek.safar@gmail.com>
1034 A fix for bug #386068
1035 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1038 2008-06-25 Marek Safar <marek.safar@gmail.com>
1040 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1043 2008-06-25 Marek Safar <marek.safar@gmail.com>
1045 A fix for bug #403518
1046 * delegate.cs: Type correctly anonymous method new invocation.
1048 2008-06-24 Marek Safar <marek.safar@gmail.com>
1050 A fix for bug #394826
1051 * anonymous.cs: Fully qualify members when resolving anonymous type internal
1054 2008-06-24 Marek Safar <marek.safar@gmail.com>
1056 A fix for bug #394826
1057 * anonymous.cs, iterators.cs: Construct generic storey only when is really
1060 2008-06-24 Marek Safar <marek.safar@gmail.com>
1062 * class.cs: Clone indexer parameters for localized capturing.
1064 2008-06-24 Marek Safar <marek.safar@gmail.com>
1066 A fix for bug #402379
1067 * expression.cs: Don't crash when an object initializer resolve fails.
1069 2008-06-24 Marek Safar <marek.safar@gmail.com>
1071 A fix for bug #402888
1072 * expression.cs: Mutate conditional expression.
1074 2008-06-24 Marek Safar <marek.safar@gmail.com>
1076 A fix for bug #401012
1077 * class.cs: Keep StructLayout in shared container.
1079 2008-06-24 Marek Safar <marek.safar@gmail.com>
1081 A fix for bug #400438
1082 * decl.cs, class.cs: Only properties can be automatically implemented.
1084 2008-06-24 Marek Safar <marek.safar@gmail.com>
1086 * statement.cs (ChangeToIterator): Copy also labels.
1088 2008-06-23 Marek Safar <marek.safar@gmail.com>
1090 * ecore.cs: Pass type argument details to parent extension method.
1092 2008-06-23 Marek Safar <marek.safar@gmail.com>
1094 A fix for bug #375966
1095 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1097 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
1099 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1101 2008-06-22 Marek Safar <marek.safar@gmail.com>
1103 A fix for bug #394347
1104 * anonymous.cs: Cache compatible delegates as compatibility check produces
1105 a new method every time.
1107 2008-06-20 Marek Safar <marek.safar@gmail.com>
1109 * anonymous.cs: Propagate storey reference for single references.
1111 2008-06-20 Marek Safar <marek.safar@gmail.com>
1113 A fix for bug #387615
1114 * assign.cs, expression.cs: Correctly clone compound assignment.
1116 2008-06-19 Marek Safar <marek.safar@gmail.com>
1118 A fix for bug #359611, #359604
1119 * anonymous.cs: Mutate all types of hoisted parameters.
1121 2008-06-19 Marek Safar <marek.safar@gmail.com>
1123 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1124 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1125 expression.cs, codegen.cs, statement.cs
1127 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
1128 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
1130 ** Anonymous methods, lambda expressions rewrite **
1132 Anonymous expressions are now resolved when an explicit block is resolved
1133 and they don't require any registration procedure anymore. Further,
1134 anonymous methods are defined when explicit block is emitted which allows
1135 better control of whole process and opens possibilities for more
1136 optimizations as well as alternative to reverse whole process.
1138 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
1139 process consistent and to correctly emit hoisted generic methods when they
1140 have at least 1 hoisted variable.
1142 2008-06-17 Martin Baulig <martin@ximian.com>
1144 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
1146 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
1147 virtual property; check it in Emit().
1148 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
1150 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
1152 (Indexer.Define): Likewise.
1154 2008-06-17 Marek Safar <marek.safar@gmail.com>
1156 * convert.cs: Don't use IsInterface on type arguments.
1158 * delegate.cs: DelegateInvocation uses MethodInfo.
1160 * parameter.cs: Removed IsTypeParameter.
1162 * generic-mcs.cs: More missing stuff.
1164 2008-06-16 Martin Baulig <martin@ximian.com>
1167 (Modifiers.DEBUGGER_HIDDEN): New public const.
1170 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
1173 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
1174 (AbstractPropertyEventMethod): Likewise.
1175 (Constructor.Emit): Likewise.
1176 (SourceMethod.SetCompilerGenerated): Removed.
1178 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
1182 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
1183 if we're an `IteratorHost'.
1184 (AnonymousMethodMethod..ctor): Don't set
1185 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
1188 2008-06-16 Marek Safar <marek.safar@gmail.com>
1190 * statement.cs: Clean-up foreach statements.
1192 2008-06-12 Marek Safar <marek.safar@gmail.com>
1194 * class.cs: Stop using public method which should not exist
1195 (MethodBuilder.SetGenericMethodSignature).
1197 2008-06-11 Martin Baulig <martin@ximian.com>
1200 (Location.LookupFile): Add `CompilationUnit' argument; when given
1201 a relative file name, make it relative to the directory the .cs
1202 file is located in instead of using the current directory.
1204 2008-06-11 Martin Baulig <martin@ximian.com>
1207 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
1208 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
1209 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
1210 (SourceMethod.SetCompilerGenerated): Likewise.
1212 2008-06-11 Marek Safar <marek.safar@gmail.com>
1214 * codegen.cs, driver: Only write symbol file when it's asked for.
1216 2008-06-11 Marek Safar <marek.safar@gmail.com>
1218 * codegen.cs: Don't use assembly writer error handling for symbol writer.
1220 2008-06-10 Martin Baulig <martin@ximian.com>
1222 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
1224 2008-06-09 Marek Safar <marek.safar@gmail.com>
1226 A fix for bug #316290
1227 * expression.cs: Include decimal operators in predefined table.
1229 * parameters.cs: More readonlyness.
1231 2008-06-09 Marek Safar <marek.safar@gmail.com>
1233 A fix for bug #397213
1234 * cs-parser.jay: One more missing current_local_parameters reset.
1236 2008-06-09 Marek Safar <marek.safar@gmail.com>
1238 A fix for bug #396633
1239 * class.cs: Host backing field in partial container.
1241 2008-06-09 Marek Safar <marek.safar@gmail.com>
1243 A fix for bug #397068
1244 * expression.cs: Check both operand types when predefined operator is used.
1246 2008-06-05 Martin Baulig <martin@ximian.com>
1248 Merged the `debugger-kahalo' branch.
1251 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
1252 we're an iterator method.
1253 (SourceMethod): Reflect latest symbol writer changes;
1254 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
1255 now `start_row' and `end_row'.
1256 (Constructor.Emit): Fix the logic whether to emit symbol information.
1258 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
1262 (CompilationUnit): New public class; derives from `SourceFile'.
1263 (SourceFileEntry.DefineSymbolInfo): New public method.
1264 (SourceFileEntry.SetChecksum): New public method.
1265 (Location): Encode hidden line numbers by using `column == 255';
1266 the .ctor now accepts `column == -1' to mark a hidden line number.
1267 (Location.Hidden): New public property.
1268 (Location.CheckPoint): Add `CompilationUnit'.
1269 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
1270 (Location.Push): Add `CompilationUnit compile_unit' argument.
1271 (Location.CompilationUnit): New public property.
1274 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
1276 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
1278 * driver.cs: `SourceFile' -> `CompilationUnit'.
1280 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
1282 * namespace.cs: `SourceFile' -> `CompilationUnit'.
1284 * cs-tokenizer.cs: Add support for `#pragma checksum' and
1288 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
1289 new symbol writer API to also pass the file.
1291 2008-06-05 Marek Safar <marek.safar@gmail.com>
1293 * statement.cs: Emit catch variable assignment using variable expression.
1295 2008-06-05 Marek Safar <marek.safar@gmail.com>
1297 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
1298 with other variable types.
1300 2008-06-04 Marek Safar <marek.safar@gmail.com>
1302 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
1303 GetLength method emit, it breaks resolve rules.
1305 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
1306 Marek Safar <marek.safar@gmail.com>
1308 A fix for bug #395542
1309 * cs-parser.jay: The trailing comma is allowed in anonymous type member
1312 2008-06-02 Marek Safar <marek.safar@gmail.com>
1314 A fix for bug #395287
1315 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
1317 2008-05-31 Marek Safar <marek.safar@gmail.com>
1319 A fix for bug #395845
1320 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
1321 non-nullable parameter type.
1323 2008-05-31 Marek Safar <marek.safar@gmail.com>
1325 * class.cs: Handle contructor initializer as a statement in top-level block.
1327 2008-05-30 Marek Safar <marek.safar@gmail.com>
1329 * attribute.cs: Don't mix old and new corlib types when emitting corlib
1330 security attributes.
1332 2008-05-24 Marek Safar <marek.safar@gmail.com>
1334 * ecore.cs, expression.cs: Small IVariable refactoring.
1336 2008-05-22 Marek Safar <marek.safar@gmail.com>
1338 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
1340 2008-05-21 Marek Safar <marek.safar@gmail.com>
1342 * cs-parser.jay: Removed redundant catch type check.
1344 2008-05-21 Marek Safar <marek.safar@gmail.com>
1346 A fix for bug #390372
1347 * nullable.cs: Set correct return type.
1349 2008-05-21 Marek Safar <marek.safar@gmail.com>
1351 A fix for bug #391062
1352 * typemanager.cs: Fixed crash when comparing null types.
1354 2008-05-21 Marek Safar <marek.safar@gmail.com>
1356 A fix for bug #391871
1357 * cs-parser.jay: Better error handling for invalid catch type.
1359 2008-05-20 Marek Safar <marek.safar@gmail.com>
1361 A fix for bug #392155
1362 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
1364 2008-05-15 Marek Safar <marek.safar@gmail.com>
1366 A fix for bug #390666
1367 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
1370 2008-05-15 Marek Safar <marek.safar@gmail.com>
1372 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
1375 2008-05-13 Marek Safar <marek.safar@gmail.com>
1377 A fix for bug #389625
1378 * delegate.cs, generic.cs: Some progress on method group return type
1381 2008-05-13 Marek Safar <marek.safar@gmail.com>
1383 A fix for bug #378419
1384 * namespace.cs: Inspect also parent namespaces not only namespace entries.
1386 2008-05-12 Marek Safar <marek.safar@gmail.com>
1388 * class.cs (Constructor): Added IsCompilerGenerated.
1390 2008-05-12 Marek Safar <marek.safar@gmail.com>
1392 * expression.cs: Enum binary operators can accept non-enum operand only when
1393 is implicitly convertible to underlying type.
1395 2008-05-12 Marek Safar <marek.safar@gmail.com>
1397 A fix for bug #389272
1398 * support.cs: Workaround System.InvalidOperationException for enums.
1400 2008-05-12 Marek Safar <marek.safar@gmail.com>
1402 A fix for bug #389073
1403 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
1405 2008-05-10 Marek Safar <marek.safar@gmail.com>
1407 * driver.cs: Split Parse.
1409 * location.cs (LookupFile): Uses string.Empty.
1411 2008-05-07 Marek Safar <marek.safar@gmail.com>
1413 * expression.cs, parameter.cs: Small ParameterReference clean up.
1415 2008-05-07 Marek Safar <marek.safar@gmail.com>
1417 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
1418 hack. Fixes #387502.
1420 2008-05-06 Martin Baulig <martin@ximian.com>
1422 * class.cs (Constructor.Emit): Fix the logic whether to emit
1425 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
1428 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
1429 InvalidOperationException when the iterator is before the start or
1432 2008-05-06 Marek Safar <marek.safar@gmail.com>
1434 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
1435 when left is nullable type.
1437 2008-05-06 Marek Safar <marek.safar@gmail.com>
1439 A fix for bug #386628
1440 * expression.cs (LocalVariableReference): Continue in resolving when
1441 variable is not assigned.
1443 2008-05-05 Marek Safar <marek.safar@gmail.com>
1445 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
1446 nullable operations.
1448 2008-05-04 Marek Safar <marek.safar@gmail.com>
1450 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
1451 it saves many redundant temporary variables for nullable operations.
1453 2008-05-03 Marek Safar <marek.safar@gmail.com>
1455 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
1457 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
1460 * nullable.cs: Constant coalescing operator optimizations.
1462 2008-05-03 Marek Safar <marek.safar@gmail.com>
1464 * constant.cs: Use unsigned conversion for values which are unsigned only.
1466 2008-05-03 Marek Safar <marek.safar@gmail.com>
1468 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
1469 coalescing operator as it should be.
1471 2008-05-02 Marek Safar <marek.safar@gmail.com>
1473 A fix for bug #371016
1474 * expression.cs: All predefined delegate operators require implicit method
1477 2008-05-02 Marek Safar <marek.safar@gmail.com>
1479 * constant.cs: Emit long constant as uint when fits the range.
1481 * convert.cs, expression.cs: Fixed few unsafe conversions.
1483 2008-05-02 Marek Safar <marek.safar@gmail.com>
1485 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
1487 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
1490 * convert.cs (ImplicitNumericConversion): Don't modify the type of
1492 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
1494 2008-05-01 Marek Safar <marek.safar@gmail.com>
1496 * constant.cs, literal.cs: IsLiteral property for error reporting.
1498 * ecore.cs, expression.cs: Implemented Property expression.
1500 2008-05-01 Marek Safar <marek.safar@gmail.com>
1502 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
1504 * nullable.cs: Implemented nullable coalescing null operator.
1506 * ecore.cs, expression.cs: Expression trees work.
1508 2008-05-01 Marek Safar <marek.safar@gmail.com>
1510 * ecore.cs: CreateExpressionTree is finally abstract.
1512 * expression.cs, linq.cs: Updated.
1514 2008-05-01 Marek Safar <marek.safar@gmail.com>
1516 * expression.cs, ecore.cs: Block base access expression inside expression
1519 2008-05-01 Marek Safar <marek.safar@gmail.com>
1521 A fix for bug #385058
1522 * expression.cs: User-defined operator implementations always take
1523 precedence over predefined operator implementations.
1525 2008-04-30 Marek Safar <marek.safar@gmail.com>
1527 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
1528 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
1529 expression tree conversions.
1531 2008-04-30 Marek Safar <marek.safar@gmail.com>
1533 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
1534 operators method details to Operator class.
1536 2008-04-30 Marek Safar <marek.safar@gmail.com>
1538 * anonymous.cs: Pass unsafe flags to anonymous container.
1540 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
1541 inside expression tree.
1543 2008-04-29 Martin Baulig <martin@ximian.com>
1545 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
1546 (Tokenizer.PopPosition): Also restore the `line'.
1548 2008-04-29 Marek Safar <marek.safar@gmail.com>
1550 * delegate.cs: Implemented Invoke expression.
1552 2008-04-29 Marek Safar <marek.safar@gmail.com>
1554 * expression.cs: Fixed equality reference comparison regression.
1556 2008-04-29 Marek Safar <marek.safar@gmail.com>
1558 * ecore.cs: Clean up EmptyCast hack.
1560 * expression.cs, nullable.cs: Implemented enum binary and unary operations
1561 using correct conversion rules. Also fixes #383993.
1563 2008-04-28 Martin Baulig <martin@ximian.com>
1565 * class.cs (Constructor.Emit): Don't emit debugging information
1566 for generated default .ctor's.
1568 2008-04-28 Marek Safar <marek.safar@gmail.com>
1570 * convert.cs: Empty-cast ushort to int conversion.
1572 2008-04-28 Marek Safar <marek.safar@gmail.com>
1574 A fix for bug #384191
1575 * ecore.cs, expression.cs: Fixed expression cloning.
1577 2008-04-28 Marek Safar <marek.safar@gmail.com>
1579 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
1581 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
1583 Fix #381559, test-638.cs, test-639.cs
1584 * assign.cs (CompoundAssign.Helper): New wrapper.
1585 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
1587 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
1588 Pass unconverted expressions to the params array creation expression.
1589 (FieldExpr.EmitAssign): Don't special-case StringConcat.
1590 (PropertyExpr.EmitAssign): Likewise.
1591 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
1592 element if it is of kind CompoundAssign.Helper.
1593 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
1594 first before anything else.
1595 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
1596 (ArrayAccess.LoadArrayAndArguments): Simplify.
1598 2008-04-27 Marek Safar <marek.safar@gmail.com>
1600 * expression.cs: Fixed cloning of typeof(void).
1602 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
1604 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
1605 (Assign.Emit): Likewise. Move it to ...
1606 (CompoundAssign.DoResolve): ... here and ...
1607 (CompoundAssign.Emit): ... here.
1608 (EventAddOrRemove): New helper to handle += and -= on events, and
1609 avoid the use of BinaryDelegates.
1610 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
1611 (EventExpr.EmitAddOrRemove): Improve.
1612 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
1614 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
1615 create VarExprs for 'foo.bar.var'.
1616 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
1617 is a highly inappropriate name for its functionality.
1619 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
1621 Simplify handling of multiple assignments
1622 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
1624 (SimpleAssign): New. Class to be used for normal assignments.
1625 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
1626 * expression.cs, parameter.cs, statement.cs: Likewise.
1628 2008-04-25 Marek Safar <marek.safar@gmail.com>
1630 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
1631 for incompatible underlying types, more to come, uff.
1633 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
1636 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
1637 Handle 'leave_copy'.
1639 2008-04-25 Marek Safar <marek.safar@gmail.com>
1641 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
1643 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
1645 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
1646 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
1647 * statement.cs (While, Do, For): Allow test to have side effects.
1648 (For.DoEmit): Always emit InitStatement.
1651 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
1652 Always create SideEffectConstant.
1653 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
1654 of type EnumConstant.
1656 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
1657 Handle 'right' being SideEffectConstant of type 'bool'.
1659 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
1660 Use left.EmitBranchable instead of open coding it, so as to
1661 improve optimization opportunities.
1663 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
1665 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
1667 (Expression.EmitSideEffect): Document.
1669 2008-04-23 Marek Safar <marek.safar@gmail.com>
1671 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
1673 2008-04-23 Marek Safar <marek.safar@gmail.com>
1675 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
1677 2008-04-23 Marek Safar <marek.safar@gmail.com>
1679 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
1680 conversion to expression tree.
1682 2008-04-23 Marek Safar <marek.safar@gmail.com>
1684 * ecore.cs: Removed unused expression.
1686 2008-04-22 Marek Safar <marek.safar@gmail.com>
1688 * expression.cs: Implemented NegateChecked and New expressions.
1690 2008-04-22 Marek Safar <marek.safar@gmail.com>
1692 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
1694 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
1697 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
1698 needing final 'ret' instruction.
1700 2008-04-22 Marek Safar <marek.safar@gmail.com>
1702 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
1704 2008-04-21 Marek Safar <marek.safar@gmail.com>
1706 * expression.cs: Emit ldnull and not null expression as an instance argument
1707 of static method expression calls.
1709 2008-04-21 Marek Safar <marek.safar@gmail.com>
1711 A fix for bug #378200
1712 * expression.cs: Fixed crash when creating parameterless expression tree
1715 2008-04-21 Marek Safar <marek.safar@gmail.com>
1717 A fix for bug #375297
1718 * anonymous.cs: Fixed crash when inferring from null argument anonymous
1721 2008-04-21 Marek Safar <marek.safar@gmail.com>
1723 A fix for bug #377596
1724 * decl.cs, class.cs: Emit delegate type argument attributes.
1726 2008-04-21 Marek Safar <marek.safar@gmail.com>
1728 A fix for bug #365314
1729 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
1731 2008-04-21 Marek Safar <marek.safar@gmail.com>
1733 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
1736 2008-04-21 Marek Safar <marek.safar@gmail.com>
1738 * generic.cs (TypeParameter): Removed redundant location.
1740 2008-04-19 Marek Safar <marek.safar@gmail.com>
1742 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
1743 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
1744 FullNamedExpression in all declaration type expression, statements will come
1747 2008-04-18 Marek Safar <marek.safar@gmail.com>
1749 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
1750 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
1752 2008-04-18 Marek Safar <marek.safar@gmail.com>
1754 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
1757 2008-04-17 Marek Safar <marek.safar@gmail.com>
1759 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
1762 2008-04-17 Marek Safar <marek.safar@gmail.com>
1764 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
1768 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
1770 Hook up 'EmitSideEffect'
1771 * constant.cs (Constant.EmitSideEffect): New.
1772 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
1773 (SideEffectConstant.EmitSideEffect): New.
1774 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
1775 unconditional branch in EmitBranchable.
1776 (FieldExpr.EmitBranchable): New.
1777 * expression.cs (Unary.EmitSideEffect): New.
1778 (Binary.EmitSideEffect): New.
1779 (VariableReference.EmitSideEffect): New. Do nothing.
1781 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
1783 Introduce 'EmitSideEffect'
1784 * ecore.cs (Expression.EmitSideEffect): New.
1785 (TypeCast): Rename from EmptyCast.
1787 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
1788 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
1789 * convert.cs, nullable.cs: Update to changes.
1791 2008-04-16 Marek Safar <marek.safar@gmail.com>
1793 * class.cs, cs-parser.jay: Early check for base types expression.
1795 2008-04-16 Marek Safar <marek.safar@gmail.com>
1797 * decl.cs (MemberName): Declare PrettyName as obsolete.
1799 2008-04-16 Marek Safar <marek.safar@gmail.com>
1801 * namespace.cs: Use MemberName comparison.
1803 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
1806 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
1808 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
1809 (MemberName.FullyQualifiedName): New. Provides the functionality
1810 that users assume FullName would have.
1811 * ecore.cs, namespace.cs: Update to changes.
1813 * statement.cs (Using.assign): Make into ExpressionStatement.
1814 (Using.EmitPreTryBody): Simplify.
1816 2008-04-16 Marek Safar <marek.safar@gmail.com>
1818 * report.cs: ColorFormat is protected.
1820 * rootcontext.cs: Unused fields clean-up.
1822 * namespace.cs: Made UsingEntry name private.
1824 2008-04-16 Marek Safar <marek.safar@gmail.com>
1826 * cs-tokenizer.cs, location.cs: Removed unused field.
1828 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
1829 Raja R Harinath <harinath@hurrynot.org>
1832 * constant.cs (SideEffectConstant.value): Rename from 'left'.
1833 (SideEffectConstant.side_effect): Rename from 'right'.
1834 (SideEffectConstant..ctor): Normalize 'side_effect'.
1835 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
1836 value of this constant.
1837 * cfold.cs: Update to changes.
1839 2008-04-15 Marek Safar <marek.safar@gmail.com>
1841 * cs-paser.jay: Removed unused variable.
1843 * driver.cs: Made Compile instance method.
1845 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
1847 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
1849 2008-04-15 Marek Safar <marek.safar@gmail.com>
1851 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
1853 2008-04-13 Jb Evain <jbevain@novell.com>
1855 * namespace.cs: update the System.Core fullname for 2.1
1856 * driver.cs: update the list of required assemblies for 2.1.
1857 Merged from the Moonlight 2 branch.
1859 2008-04-11 Marek Safar <marek.safar@gmail.com>
1861 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
1862 types and user defined operators. User operators arguments has to be checked
1863 for null value before invocation, which also means no operator is called
1864 when any argument is not convertible to unwrapped nullable type.
1866 2008-04-09 Marek Safar <marek.safar@gmail.com>
1868 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
1869 of Unary expressions to follow operator overloading rules precisely.
1870 Also fixes #321794, #323794
1872 2008-04-08 Marek Safar <marek.safar@gmail.com>
1874 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
1877 2008-04-08 Marek Safar <marek.safar@gmail.com>
1879 * expression.cs, ecore.cs: Implemented MemberInit expression.
1881 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
1883 Fix mono/tests/exception4.cs
1884 * statement.cs (ExceptionStatement, TryCatch): Revert to using
1885 ec.NeedReturnLabel () rather emitting a 'nop'.
1887 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
1889 (TryCatch.SomeCodeFollows): Likewise.
1890 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
1891 for 'break', 'continue' and 'return' statements inside a try.
1892 We're fairly sure that the generated IL stream will have more
1893 instructions textually following the try.
1894 (FlowBranchingTryCatch): Likewise.
1896 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
1897 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
1900 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
1901 wrapper -- forward everything to CollectionForeach.
1902 (CollectionForeach.NonDisposableWrapper): New.
1903 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
1904 instead of a pop + branch to end.
1906 2008-04-07 Marek Safar <marek.safar@gmail.com>
1908 A fix for bug #377485
1909 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
1910 Propagate location for extension method groups. Report conversion failure at
1913 2008-04-07 Marek Safar <marek.safar@gmail.com>
1915 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
1916 ListInit and Field expressions.
1918 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
1920 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
1921 Since $PC is always -1 inside the body of MoveNext, the fault
1923 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
1924 * statement.cs (ExceptionStatement.emit_finally): Likewise.
1925 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
1927 The denouement! Fix #324708
1928 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
1929 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
1930 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
1931 'finally' inside the finally clause.
1933 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
1934 inside an iterator. Don't emit the body of the 'finally' inside
1935 the finally clause yet.
1937 Use the ResumableStatement infrastructure for MoveNext ()
1938 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
1939 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
1940 'old_resume_points'. Move dispatcher upfront.
1941 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
1942 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
1943 in an enumerator. This encodes the main fix in this patch series
1944 -- we can only jump into the first instruction of a try from the
1945 outside, but we want to emit try/finally regions in iterators and
1946 resume in the middle of them.
1948 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
1950 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
1951 of NeedReturnLabel here.
1953 Introduce a common point for emitting try/finally to IL
1954 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
1955 features of the various subclasses, which are now driven by ...
1956 (ExceptionStatement.EmitPreTryBody): ... this and ...
1957 (ExceptionStatement.EmitTryBody): ... this and the original
1959 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
1960 Remove DoEmit and update to follow above protocol.
1962 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
1963 of the dispatcher are the same, skip emitting the 'switch'.
1964 * iterator.cs (Iterator.EmitDispose): Update to changes.
1966 Clean up handling of 'using' statement
1967 * statement.cs (UsingTemporary): New. Carved out of ...
1968 (Using): ... this. Simplify drastically. Handle exactly
1970 * cs-parser.jay (using_statement): Split. Create UsingTemporary
1971 or Using as appropriate. If there are multiple variable declared,
1972 create nested Using statements.
1973 (resource_acquisition): Kill.
1975 * statement.cs (ExceptionStatement.EmitForDispose): Use
1976 EmitFinallyBody, not EmitFinally.
1978 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
1979 * iterator.cs: Update to changes.
1981 Start using the ResumableStatement infrastructure
1982 * statement.cs (ResumeableStatement.PrepareForDispose): New.
1983 (ResumableStatement.EmitForDispose): New.
1984 (ExceptionStatement): Override them.
1985 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
1986 EmitForDispose to create the body of the Dispose method. Don't
1989 * iterator.cs (Iterator.AddResumePoint): Move here from ...
1990 * statement.cs (Toplevel.AddResumePoint): ... here.
1991 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
1992 * flowanalysis.cs (FlowBranchingIterator): New.
1993 * codegen.cs (EmitContext): Update to changes.
1995 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
1996 (Iterator.old_resume_points): Rename from 'resume_points'.
1997 (Iterator.MoveNextStatement): Remove unused class.
1999 New infrastructure for try/finally in iterators (still unused)
2000 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2001 (FlowBranchingToplevel.AddResumePoint): Hook into
2002 ToplevelBlock.AddResumePoint.
2003 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2004 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2005 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
2006 resume points and assign program-counter values.
2007 (ExceptionBlock.AddResumePoint): Collect resume points for
2008 de-muxer at the top of try block.
2009 * iterators.cs (Yield.CheckContext): Simplify.
2010 (Yield.Resolve): Use FlowBranching.AddResumePoint.
2012 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
2014 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2015 argument to an ExitStatement.
2016 (FlowBranchingException): Refactor saved origins code.
2017 * statement.cs (ExitStatement): Update to cahges.
2018 * iterator.cs (YieldBreak): Likewise.
2020 * statement.cs (ResumableStatement): New. Common base class for
2021 YieldReturn and ExceptionStatement.
2022 (ExitStatement): New. Common base class for Return and YieldBreak.
2023 (Return): Update to changes.
2024 * iterator.cs (YieldBreak): Likewise.
2025 * lambda.cs (ContextualReturn): Likewise.
2028 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2029 emit a meaningful error message.
2031 Fix #324765, #319508
2032 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2033 (VariableInfo.SetAssigned): Set it.
2034 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2035 determine if CS0219 or CS0168 is appropriate. Don't use
2036 flow-analysis information.
2037 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2038 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
2039 (EmitContext.EndFlowBranching): ... this.
2041 2008-04-03 Marek Safar <marek.safar@gmail.com>
2043 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2045 2008-04-03 Marek Safar <marek.safar@gmail.com>
2047 A fix for bug #376508
2048 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2049 ImplicitConversionExists.
2051 2008-04-03 Marek Safar <marek.safar@gmail.com>
2053 * expression.cs (Binary): Added remaining binary operators to expression
2056 * nullable.cs: Optimize shift with null argument.
2058 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
2060 Fix minor IL regression
2061 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2062 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2063 * cs-parser.jay (try_statement): Update to changes.
2065 * statement.cs (TryFinally.need_exc_block): Delete.
2066 (TryFinally): Update to changes.
2068 Now all ExceptionStatements are unconditional
2069 * statement.cs (CollectionForeach.DisposableWrapper): New.
2070 Extract out the try/finally code into a new wrapper.
2071 (CollectionForeach.Resolve): Use it to simplify the code.
2073 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
2075 Start at simplifying ExceptionStatement semantics a bit
2076 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2077 * cs-parser.jay (try_statement): Update to changes.
2078 (opt_catch_clauses): Remove.
2079 * flowanalysis.cs: Update to changes.
2080 (FlowBranching.BranchingType.TryCatch): New.
2081 (FlowBranchingTryCatch): New.
2083 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2084 (FlowBranching.CreateBranching): Update to changes.
2085 (FlowBranchingBlock.AddSibling): Add sanity check.
2086 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2089 * iterators.cs (Iterator.MarkFinally): Remove.
2090 * statement.cs (ExceptionStatement): Update to changes.
2092 Add support for skipping over finally blocks at runtime. First
2093 in a series to fix #324708
2094 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2095 (Iterator.EmitMoveNext): Initialize it.
2096 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2097 branch over the body of the 'finally' clause.
2099 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
2101 Avoid lopsided use of Foo/DoFoo names
2102 * statement.cs (ExpressionStatement.EmitFinallyBody):
2103 Rename from EmitFinally.
2104 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2105 * iterator.cs: Update to changes.
2107 2008-04-02 Marek Safar <marek.safar@gmail.com>
2109 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2110 based on UserOperatorCall. More binary nullable operators clean up.
2112 2008-04-02 Martin Baulig <martin@ximian.com>
2114 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2116 2008-04-02 Marek Safar <marek.safar@gmail.com>
2118 * nullable.cs: Merge user and empty conversions when lifting expression
2121 * expression.cs (StringConcat): Implemented expression tree representation.
2123 2008-04-01 Marek Safar <marek.safar@gmail.com>
2125 * nullable.cs: When lifting null literal and a user operator exists, no call
2128 2008-04-01 Marek Safar <marek.safar@gmail.com>
2130 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
2133 2008-04-01 Marek Safar <marek.safar@gmail.com>
2135 * nullable.cs, expression.cs: Use namespace instead heavily nested
2136 monster abstract class.
2138 2008-04-01 Marek Safar <marek.safar@gmail.com>
2140 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
2141 lifting of null literal and user operators. Clean up of some temporary
2144 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
2146 Fix #368224, test-629.cs
2147 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
2148 if it crossed an unwind-protect boundary.
2149 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
2150 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
2151 inside an unwind-protected region.
2152 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
2153 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
2154 'leave' instead of a 'br' if unwind-protected.
2155 (Iterator.EmitYieldBreak): Likewise.
2157 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
2159 * driver.cs: Only define versioninfo resources if no win32 resource
2162 2008-03-28 Marek Safar <marek.safar@gmail.com>
2164 A fix for bug #372375
2165 * convert.cs: Fixed boxing of nullable types.
2167 2008-03-28 Marek Safar <marek.safar@gmail.com>
2169 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
2172 2008-03-28 Marek Safar <marek.safar@gmail.com>
2174 A fix for bug #374619
2175 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
2177 2008-03-27 Marek Safar <marek.safar@gmail.com>
2179 * lambda.cs: Check return type only for invocation.
2181 2008-03-27 Marek Safar <marek.safar@gmail.com>
2183 A fix for bug #374214
2184 * ecore.cs: Correctly report argument type mismatch.
2186 2008-03-27 Marek Safar <marek.safar@gmail.com>
2188 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
2189 and not rely on broken IsEnum.
2191 2008-03-27 Marek Safar <marek.safar@gmail.com>
2193 * nullable.cs: New file, extracted from generic.cs.
2195 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
2197 2008-03-27 Marek Safar <marek.safar@gmail.com>
2199 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
2200 predefined comparison operators and null literals.
2202 * report.cs: New warning ID.
2204 2008-03-25 Marek Safar <marek.safar@gmail.com>
2206 A fix for bug #370577
2207 * lambda.cs: Check return type too.
2209 2008-03-25 Marek Safar <marek.safar@gmail.com>
2211 A fix for bug #372846
2212 * class.cs: Automatic properties can be declared as unsafe.
2214 2008-03-20 Marek Safar <marek.safar@gmail.com>
2216 * location.cs: Use string based concatenation.
2218 * expression.cs: LiftedBinaryOperator is gmcs only.
2220 2008-03-20 Marek Safar <marek.safar@gmail.com>
2222 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
2223 conversions rules and expression trees.
2225 2008-03-19 Marek Safar <marek.safar@gmail.com>
2227 * delegate.cs: Use extension method source as delegate target.
2229 2008-03-19 Marek Safar <marek.safar@gmail.com>
2231 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
2232 binary operations to be purely based on binary operations and optimized
2233 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
2234 and other ET refactoring.
2236 * typemanager.cs: Fixed warning.
2238 2008-03-17 Marek Safar <marek.safar@gmail.com>
2240 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
2242 * symbolwriter.cs: Fixed.
2244 2008-03-17 Marek Safar <marek.safar@gmail.com>
2246 * anonymous.cs, driver.cs: Reset anonymous types counters.
2248 2008-03-17 Marek Safar <marek.safar@gmail.com>
2250 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
2252 * class.cs: Use fullname for all type member definitions.
2254 2008-02-19 Martin Baulig <martin@ximian.com>
2257 (IMethodData.EmitExtraSymbolInfo): New interface method.
2258 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
2259 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
2260 interface method here as an empty public virtual method.
2263 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
2264 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
2265 CodeGen.SymbolWriter.SetRealMethodName().
2267 2008-02-18 Martin Baulig <martin@ximian.com>
2270 (ScopeInfo.EmitType): Override this and emit debugging
2271 information for captured variables.
2272 (RootScopeInfo.EmitType): Override this and emit symbol
2273 information for a captured `this'.
2275 2008-02-15 Martin Baulig <martin@ximian.com>
2277 * iterators.cs: Emit debugging info.
2280 (EmitContext.Flags): Add `OmitDebuggingInfo'.
2281 (EmitContext.OmitDebuggingInfo): New public property.
2284 (While): Override Emit() and don't emit symbol info there; do it
2285 inside DoEmit() instead.
2286 (Block.Emit): Omit symbol information while emitting the scope
2287 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
2289 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
2290 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
2291 .ctor to make `IsIterator' work.
2293 2008-03-14 Martin Baulig <martin@ximian.com>
2295 * symbolwriter.cs: Added the new symbol writer function from the
2296 debugger's `terrania' branch; temporarily enclose them inside
2297 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
2300 2008-03-14 Martin Baulig <martin@ximian.com>
2303 (SymbolWriter): Make this a public static class.
2306 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
2307 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
2309 2008-03-14 Marek Safar <marek.safar@gmail.com>
2311 A fix for bug #370577
2312 * statement.cs, lambda.cs: Added extra limitations when dealing with void
2315 2008-03-14 Marek Safar <marek.safar@gmail.com>
2317 * typemanager.cs (CSharpName): Made 250 times faster.
2319 2008-03-13 Marek Safar <marek.safar@gmail.com>
2321 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
2323 2008-03-12 Marek Safar <marek.safar@gmail.com>
2325 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
2326 crash when predefined field does not exist.
2328 2008-03-12 Marek Safar <marek.safar@gmail.com>
2330 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
2332 2008-03-12 Marek Safar <marek.safar@gmail.com>
2334 * class.cs (FixedField): Don't crash when contructors are missing.
2336 2008-03-11 Marek Safar <marek.safar@gmail.com>
2338 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
2339 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
2340 check internal types accessibility for internal and external types.
2341 Replaced EnumToUnderlying by GetEnumUnderlyingType.
2343 2008-03-11 Marek Safar <marek.safar@gmail.com>
2345 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
2346 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
2347 attribute.cs, statement: Use corect instance of predefined types (work
2348 related to #364674).
2350 2008-03-07 Marek Safar <marek.safar@gmail.com>
2352 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
2354 2008-03-07 Marek Safar <marek.safar@gmail.com>
2356 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
2357 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
2358 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
2359 predefined types clean up, delayed predefined types members initialization
2360 (work related to #364674).
2362 2008-03-05 Marek Safar <marek.safar@gmail.com>
2364 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
2366 2008-03-05 Marek Safar <marek.safar@gmail.com>
2368 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
2369 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
2370 predefined types clean up (work related to #364674).
2372 2008-03-04 Marek Safar <marek.safar@gmail.com>
2374 * ecore.cs: Print an error message instead of throwing exception.
2376 2008-03-04 Marek Safar <marek.safar@gmail.com>
2378 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
2379 expression.cs, statement.cs: Unififed null literal representation.
2381 2008-03-03 Marek Safar <marek.safar@gmail.com>
2383 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
2384 expression.cs: Refactored binary operators resolve phase and improved speed.
2385 The nullable code is still missing and won't work correctly, more fixes
2388 It also fixes #323726, #324312, #324248, and many other unreported issues.
2390 2008-02-29 Zoltan Varga <vargaz@gmail.com>
2392 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
2395 2008-02-27 Marek Safar <marek.safar@gmail.com>
2397 * ecore.cs: Clean-up and split BetterConversion.
2399 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
2402 * enum.cs (EnumMember.Value): Only access 'value' if
2403 ResolveValue says it's ok.
2404 (EnumMember.DoResolveValue): Don't set prev_member.value.
2405 (Enum.GetDefinition): Reverse arguments of Equals --
2406 EnumMember.Value can return 'null'.
2408 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
2410 2008-02-22 Marek Safar <marek.safar@gmail.com>
2412 * generic.cs, expression.cs: More ongoing work on expression trees.
2414 2008-02-21 Marek Safar <marek.safar@gmail.com>
2416 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
2417 handle missing matches when mutiple operators exist.
2419 2008-02-20 Marek Safar <marek.safar@gmail.com>
2421 A fix for bug #363218
2422 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
2425 2008-02-20 Marek Safar <marek.safar@gmail.com>
2427 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
2428 update. This time to deal correctly with SideEffectConstant expression used
2429 as an argument for another constant folding.
2431 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
2433 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
2436 2008-02-19 Marek Safar <marek.safar@gmail.com>
2438 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
2440 2008-02-19 Marek Safar <marek.safar@gmail.com>
2442 A fix for bug #328136
2443 * expression.cs: Do not fold immediately LogicalAnd operators when the left
2444 side is a false constant, because we still need to evaluate the right-hand
2447 * statement.cs (If): Emit two types of boolean constants (simple constant,
2448 side-effect constant).
2450 2008-02-19 Marek Safar <marek.safar@gmail.com>
2452 * constant.cs (SideEffectConstant): Don't emit boolean constant.
2454 * expression.cs: Fold immediately LogicalAnd operators when both sides are
2457 2008-02-18 Marek Safar <marek.safar@gmail.com>
2459 A fix for bug #361457
2460 * ecore.cs (IsApplicable): Params methods have lower priority.
2462 * support.cs: Return correct parameter modifier for params types.
2464 2008-02-18 Marek Safar <marek.safar@gmail.com>
2466 * generic.cs (TypeParameter): Cache attribute target name.
2468 * support.cs: Removed unused variable.
2470 * typemanager.cs: Removed debugging leftover.
2472 * ecore.cs: Use local type instead of a property;
2474 * class.cs (VerifyMembers): Consider also parent to test whether type member
2477 * expression.cs (FullMethodDesc): Removed.
2479 * attribute.cs (IsValidArgumentType): Made static.
2481 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
2483 Cleanup to be more readable.
2484 * Makefile (GMCS_PROFILE): Remove.
2485 (COMPILER_NAME): New helper.
2487 2008-02-15 Miguel de Icaza <miguel@novell.com>
2489 * cs-tokenizer.cs: if a conditional expression happens inside a
2490 (...) this also means that we do not need to de-ambiguate between
2491 an parenthesized expression and a cast.
2495 * constant.cs (SideEffectConstant): a constant value that happens
2496 to have a side effect.
2498 Fixes the build regressions introduced by the fix for #359789
2500 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
2502 * expression.cs (Conditional.Emit): when emitting the ternary
2503 operator, use local variables to generate code verifiable code.
2505 The verifier cannot infer that the type on stack before the
2506 stloc.0 is executed is of type ParentB. This happens because the
2507 stack merge algorithm uses only parent types when deciding which
2508 is the common type. This is described in Part III 1.8.1.3 of ECMA
2511 This code compiled with mcs is not verifiable under MS. The MS
2512 verifier picks the first common interface of Foo and Bar, which is
2513 wrong, but doesn't use a full join type of the 2 interfaces.
2515 CSC uses a clever hack to compile such code in a verifiable
2516 way. It stores the intermediate values in a local variable with
2521 2008-02-14 Miguel de Icaza <miguel@novell.com>
2523 * expression.cs: Do not fold BitwiseAnd operators when the left
2524 side is a false constant, because we still need to evaluate the
2529 * support.cs: Instead of throwing an InternalErrorException when
2530 the position of the stream is outside the boundary of our buffer,
2531 reset the state of the reader, and restart the reading from the
2532 beginning of the file.
2534 2008-02-14 Marek Safar <marek.safar@gmail.com>
2536 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
2538 2008-02-14 Marek Safar <marek.safar@gmail.com>
2540 A fix for bug #361686
2541 * decl.cs: A protected types used inside a private class which parents
2542 derives from the protected class are accessible.
2544 2008-02-13 Marek Safar <marek.safar@gmail.com>
2546 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
2547 the parameterless constructor.
2549 2008-02-13 Marek Safar <marek.safar@gmail.com>
2551 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
2552 lookup methods to use standard member cache when doing member lookup.
2554 2008-02-12 Marek Safar <marek.safar@gmail.com>
2556 * driver.cs: Don't report full path for referenced module as assembly error.
2558 2008-02-12 Marek Safar <marek.safar@gmail.com>
2560 * Makefile: Fixed `qh' target to work on all machines.
2562 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
2563 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
2564 and HasElementType with TypeManager implementation.
2566 2008-02-08 Marek Safar <marek.safar@gmail.com>
2568 A fix for bugs #325134, #359749
2569 * expression.cs, ecore.cs: Try to resolve an extension method even if the
2570 first binds point to non-method member expression.
2572 2008-02-08 Marek Safar <marek.safar@gmail.com>
2574 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
2576 2008-02-08 Marek Safar <marek.safar@gmail.com>
2578 A fix for bugs #321394, #323028
2579 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
2580 Reworked naive IsAccessibleAs implementation to handle nested types.
2582 2008-02-05 Jb Evain <jbevain@novell.com>
2584 * class.cs: use generic type comparison for parameters
2587 2008-02-05 Marek Safar <marek.safar@gmail.com>
2589 A fix for bug #325372
2590 * class.cs: Use generic type comparison when testing method signatures.
2592 2008-02-05 Marek Safar <marek.safar@gmail.com>
2594 A fix for bug #357047
2595 * ecore.cs: Applied C# 3.0 changes to better conversion.
2597 2008-02-05 Marek Safar <marek.safar@gmail.com>
2599 A fix for bug #358374
2600 * cs-parser.jay: Correctly set modifiers for all constructor types.
2602 2008-02-04 Marek Safar <marek.safar@gmail.com>
2604 A fix for bug #355251
2605 * generic.cs: Added base class constraint based type inference.
2607 2008-02-01 Marek Safar <marek.safar@gmail.com>
2609 A fix for bug #357255
2610 * decl.cs: One more missing visibility check.
2612 2008-02-01 Marek Safar <marek.safar@gmail.com>
2614 * support.cs: Fixed broken return.
2616 2008-01-25 Marek Safar <marek.safar@gmail.com>
2618 * report.cs: Correctly reset warnings count after probing.
2620 2008-01-25 Martin Baulig <martin@ximian.com>
2623 (NamespaceEntry.SymbolFileID): Make this work again after
2624 MemberName.ToString() is gone.
2626 2008-01-25 Marek Safar <marek.safar@gmail.com>
2628 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
2631 2008-01-25 Marek Safar <marek.safar@gmail.com>
2633 * generic.cs: Use full implicit conversion for type inference fixing.
2635 2008-01-24 Marek Safar <marek.safar@gmail.com>
2637 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
2638 Fixed user operator conversions.
2640 2008-01-24 Marek Safar <marek.safar@gmail.com>
2642 * generic.cs: Do nullable type to null comparison optimization during
2645 2008-01-24 Marek Safar <marek.safar@gmail.com>
2647 A fix for bug #355163
2648 * generic.cs: Enabled l-value resolve on nullable expressions.
2650 2008-01-24 Marek Safar <marek.safar@gmail.com>
2652 A fix for bug #353986
2653 * class.cs: Ingore static ctors with parameters for any further checks.
2655 2008-01-24 Marek Safar <marek.safar@gmail.com>
2657 A fix for bug #354310
2658 * namespace.cs: Removed redundant check.
2660 2008-01-24 Marek Safar <marek.safar@gmail.com>
2662 A fix for bug #354928
2663 * expression.cs: ElementInitializers can be resolved only once.
2665 2008-01-24 Marek Safar <marek.safar@gmail.com>
2667 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
2668 Condition expressions.
2670 2008-01-23 Marek Safar <marek.safar@gmail.com>
2672 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
2674 2008-01-22 Marek Safar <marek.safar@gmail.com>
2676 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
2679 * generic.cs: Implemented coalesce expression.
2681 2008-01-22 Marek Safar <marek.safar@gmail.com>
2683 A fix for bug #355145
2684 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
2685 expression tree type inference.
2687 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
2690 * expression.cs (Binary.IsUnsignedType): Fix typo.
2692 2008-01-22 Marek Safar <marek.safar@gmail.com>
2694 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
2696 2008-01-22 Marek Safar <marek.safar@gmail.com>
2698 A fix for bug #355161
2699 * ecore.cs, expression.cs: Wider range of extension method supported
2702 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
2704 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
2705 AssemblyBuilder to operate in compiler context. Fixes mcs part of
2708 2008-01-22 Marek Safar <marek.safar@gmail.com>
2710 A fix for bug #355148
2711 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
2713 2008-01-22 Miguel de Icaza <miguel@novell.com>
2715 * expression.cs (CreateExpressionTree): Add support for or and
2716 logical or, and indent following the coding conventions.
2718 * typemanager.cs (LinqExpression): renamed from
2719 ExpressionTreeManager, for a shorter name.
2721 Use TypeManager.CoreLookupType to lookup types from our core
2722 assemblies and turn those into "Type" variables.
2724 Consumers that previously used "Namespace" and "Type" from this
2725 class should instead use the TypeExpression which is a type that
2726 is fully resolved (without involving the regular C# resolution
2729 This typically looks like this:
2731 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
2732 new MemberAccess (texpr, name, type_arguments, loc)
2734 This avoids the problem in: #355178
2736 2008-01-21 Marek Safar <marek.safar@gmail.com>
2738 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
2739 feature in parser only as we do in other cases.
2741 2008-01-21 Marek Safar <marek.safar@gmail.com>
2743 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
2744 typemanager.cs: A refactoring of params arguments to reuse existing
2745 expressions (params -> array initializer) to emit params argument instead
2746 of specialized handling.
2747 It was required by expression tree implementation and it has other benefits
2748 as well, we now apply same optimization for params arguments as we do for
2751 2008-01-18 Marek Safar <marek.safar@gmail.com>
2753 A fix for bug #353526
2754 * generic.cs: A type inference of params arguments may not required any
2755 temporary array creation.
2757 2008-01-18 Marek Safar <marek.safar@gmail.com>
2759 A fix for bug #353534
2760 * generic.cs, ecore.cs, expression.cs: A method group type inference is
2761 supported for delegates only.
2763 2008-01-18 Marek Safar <marek.safar@gmail.com>
2765 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
2766 type for more than 1 candidates.
2768 2008-01-18 Marek Safar <marek.safar@gmail.com>
2770 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
2773 2008-01-16 Marek Safar <marek.safar@gmail.com>
2775 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
2776 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
2777 operator) expressions.
2779 2008-01-16 Zoltan Varga <vargaz@gmail.com>
2781 * statement.cs: Avoid declaring an IL variable for this_variable since it is
2782 not accessed from the generated IL.
2784 2008-01-14 Marek Safar <marek.safar@gmail.com>
2786 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
2787 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
2788 statement.cs: The first expression tree implementation drop, mostly
2789 infrastructure work.
2791 2008-01-14 Marek Safar <marek.safar@gmail.com>
2793 * ecore.cs (IsNestedChild): Refactored.
2795 2008-01-11 Marek Safar <marek.safar@gmail.com>
2797 * lambda.cs: Don't use a cast on unknown expression statement.
2799 2008-01-10 Geoff Norton <gnorton@novell.com>
2801 * cs-tokenizer.cs: One more token to distinguish between method and lambda
2804 2008-01-09 Marek Safar <marek.safar@gmail.com>
2806 * doc.cs: Report better /doc crash details.
2808 2008-01-09 Marek Safar <marek.safar@gmail.com>
2810 A fix for bug #352536
2811 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
2813 2008-01-08 Marek Safar <marek.safar@gmail.com>
2815 A fix for bug #352287
2816 * ecore.cs, expression.cs: Do `this' access checking in all member access
2819 2008-01-08 Marek Safar <marek.safar@gmail.com>
2821 * rootcontext.cs, driver.cs: Switch to linq mode by default.
2823 * report.cs: Reset message stacks.
2825 2008-01-08 Marek Safar <marek.safar@gmail.com>
2827 * generic.cs (InferInPhases): Correctly calculate params position.
2829 2008-01-08 Marek Safar <marek.safar@gmail.com>
2831 * cs-tokenizer.cs: No need to parse full string when parsing lambda
2834 2008-01-07 Marek Safar <marek.safar@gmail.com>
2836 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
2838 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
2840 * driver.cs: Updated --help option.
2842 2008-01-07 Marek Safar <marek.safar@gmail.com>
2844 * generic.cs (InferParamsTypeArguments): Removed.
2845 (InferInPhases): Add params type inference.
2846 (LowerBoundInference): Fixed scoring mechanism.
2848 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
2850 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
2852 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
2853 byte array for unsigned "baked" assemblies.
2855 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
2857 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
2858 array for assemblies that are not strongnamed.
2860 2008-01-04 Marek Safar <marek.safar@gmail.com>
2862 A fix for bug #351481
2863 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
2864 declaring type for nested generic types.
2866 2008-01-04 Marek Safar <marek.safar@gmail.com>
2868 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
2869 instead of ToString.
2871 2008-01-03 Marek Safar <marek.safar@gmail.com>
2873 A fix for bug #351047
2874 * expression.cs (Binary.ResolveOperator): Allow equality operators between
2875 null and structs only when equality and inequality operators are defined
2876 either as an user-operators or predefined operators.
2878 2008-01-03 Marek Safar <marek.safar@gmail.com>
2880 A fix for bug #351047
2881 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
2883 2008-01-03 Marek Safar <marek.safar@gmail.com>
2885 A fix for bug #351257
2886 * cs-tokenizer.cs: Advance line number for '\r' correctly.
2888 2008-01-03 Marek Safar <marek.safar@gmail.com>
2890 A fix for bug #351157
2891 * class.cs (Using): Fixed yet another broken cloning.
2893 (Block): Put back more sensible default value for statements.
2895 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
2897 * codegen.cs: Allow AssemblyVersion with only major version component.
2900 2007-12-29 Marek Safar <marek.safar@gmail.com>
2902 A fix for bug #324654
2903 * class.cs: Use FullName property as member name.
2905 2007-12-28 Marek Safar <marek.safar@gmail.com>
2907 A fix for bug #342117
2908 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
2909 constructor constraint.
2911 2007-12-28 Marek Safar <marek.safar@gmail.com>
2913 A fix for bug #338273
2914 * class.cs (ProbertyBase): Access modifier checks are required for overrides
2917 2007-12-28 Marek Safar <marek.safar@gmail.com>
2919 A fix for bug #350839
2920 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
2922 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
2924 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2927 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
2929 * statement.cs: Changed some Hashtables to use HybridDictionaries
2930 instead. It was observed that some HashTables only contained a few
2931 items in the vast majority of cases. Since HybridDictionary is
2932 more efficient on small sets (<10 elements), "known_variables"
2933 from class ExplicitBlock as well as "labels" and "constants " from
2934 class Block were changed to HybridDictionaries.
2936 Atsai results: (56216kb->54987kb)
2938 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
2941 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
2943 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2946 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
2948 * expression.cs: foreach loop to for loop, saved on allocation of
2949 enumerator (59333kb->59141kb)
2951 * statement.cs. Changed foreach loops to for loops, saved on
2952 allocation of enumerator (59141kb->59006kb)
2954 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
2955 when constructed with no specified capacity. This was causing a
2956 few ArrayLists to allocate more memory than they would potentially
2957 need in the Block class and MemberCache class. Setting the
2958 ArrayLists to construct with a capacity of 1 saves some
2959 memory. (56216kb->55585kb)
2961 2007-12-27 Marek Safar <marek.safar@gmail.com>
2963 A fix for bug #347189 (2nd issue)
2964 * expression.cs (MemberAccess): Nested type can be found in base non-generic
2967 2007-12-27 Miguel de Icaza <miguel@novell.com>
2969 * report.cs: Do not use colors if stdout and stderr are not a
2972 2007-12-27 Marek Safar <marek.safar@gmail.com>
2974 A fix for bug #346998
2975 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
2978 2007-12-27 Marek Safar <marek.safar@gmail.com>
2980 A fix for bug #343465
2981 * class.cs: Explicit method name for nested types uses dots only.
2983 2007-12-27 Marek Safar <marek.safar@gmail.com>
2985 A fix for bug #343707
2986 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
2988 2007-12-27 Marek Safar <marek.safar@gmail.com>
2990 * ecore.cs: Report type inference errors only when arguments count matches
2993 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
2995 * expression.cs, report.cs: New warning.
2997 * typemanager.cs: Catch anonymous method type too.
2999 2007-12-23 Marek Safar <marek.safar@gmail.com>
3001 A fix for bug #346379
3002 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3004 2007-12-23 Marek Safar <marek.safar@gmail.com>
3006 A fix for bug #347359
3007 * expression.cs (Invocation): Don't resolve already resolved expression.
3009 2007-12-23 Marek Safar <marek.safar@gmail.com>
3011 A fix for bug #347189
3012 * class.cs (FixedField): Use non-dependent code only in the define phase.
3014 2007-12-23 Marek Safar <marek.safar@gmail.com>
3016 A fix for bug #348076
3017 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3019 2007-12-22 Marek Safar <marek.safar@gmail.com>
3021 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3022 discovered extension methods.
3024 2007-12-22 Marek Safar <marek.safar@gmail.com>
3026 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3029 2007-12-21 Miguel de Icaza <miguel@novell.com>
3031 * report.cs (ErrorMessage): Add support for using colors on
3032 terminals that support it.
3034 2007-12-21 Marek Safar <marek.safar@gmail.com>
3036 * ecore.cs: Use information about expanded params for error reporting.
3038 2007-12-21 Marek Safar <marek.safar@gmail.com>
3040 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3041 and logic for params overloads.
3043 2007-12-15 Miguel de Icaza <miguel@novell.com>
3045 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3046 as this is also created from the parser. Fixes #349034
3048 2007-12-12 Miguel de Icaza <miguel@novell.com>
3050 * statement.cs (Throw.CloneTo): it is valid to have empty
3051 expressions for throw.
3053 2007-12-03 Marek Safar <marek.safar@gmail.com>
3055 * cs-parser.jay: Set delegate constraint parsing region correctly.
3057 2007-12-03 Marek Safar <marek.safar@gmail.com>
3059 A fix for bug #345467
3060 * typemanager.cs (IsEqual): Compare generic parameters position only.
3062 2007-11-28 Marek Safar <marek.safar@gmail.com>
3064 * expression.cs (BaseAccess): Type arguments can be null.
3066 2007-11-27 Raja R Harinath <harinath@gmail.com>
3068 * statement.cs (Block.Resolve): Ensure flow-branching tree is
3069 consistent even when an error has occured.
3070 (Switch.Resolve): Likewise.
3072 2007-11-22 Marek Safar <marek.safar@gmail.com>
3074 A fix for bug #334505
3075 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3078 2007-11-22 Marek Safar <marek.safar@gmail.com>
3080 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
3081 refactorings required to resolve extension methods correctly when mixing
3082 generics and non-generics members.
3084 2007-11-20 Marek Safar <marek.safar@gmail.com>
3086 A fix for bug #342584
3087 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3090 2007-11-19 Marek Safar <marek.safar@gmail.com>
3092 A fix for bug #342512
3093 * delegate.cs: Use delegate argument expression when is available. Don't
3094 emit virtual call when class is sealed.
3096 2007-11-16 Marek Safar <marek.safar@gmail.com>
3098 A fix for bug #325423
3099 * assign.cs (FieldInitializer): Use resolved expression for emit.
3101 * class.cs: Print less confusing error message.
3103 2007-11-16 Marek Safar <marek.safar@gmail.com>
3105 * cs-tokenizer.cs: Removed GMCS ifdefs.
3107 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3110 * cs-parser.jay: Disabled nullable check.
3112 * generic-mcs: Copied more generic stuff.
3114 2007-11-16 Marek Safar <marek.safar@gmail.com>
3116 * gcs-parser.jay: Merged to cs-parser.jay.
3118 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3119 * *.csproj, *.sources: Updated to use only jay parser file.
3121 2007-11-16 Marek Safar <marek.safar@gmail.com>
3123 * gcs-parser.jay: Added nullable and default expression feature checks.
3125 2007-11-16 Marek Safar <marek.safar@gmail.com>
3127 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
3128 it fixes many TODOs and hidden bugs.
3130 * expression: Removed duplicate error check.
3132 2007-11-15 Marek Safar <marek.safar@gmail.com>
3134 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
3135 implicitly type local variable only when it is used in a declaration.
3137 2007-11-15 Marek Safar <marek.safar@gmail.com>
3139 * attribute.cs: Use CS0612 for empty strings.
3141 2007-11-14 Marek Safar <marek.safar@gmail.com>
3143 * lambda.cs, statement.cs: Contextual return may act as a statement.
3145 2007-11-14 Marek Safar <marek.safar@gmail.com>
3147 A fix for a regression cause by #324222
3148 * class.cs: Don't report unused even when it implements an interface.
3150 2007-11-13 Marek Safar <marek.safar@gmail.com>
3152 A fix for bug #341205
3153 * ecore.cs, expression.cs: Method group expression cannot do static
3154 method access with an instance reference check before overloading takes
3157 2007-11-13 Marek Safar <marek.safar@gmail.com>
3159 A fix for bug #325359
3160 * class.cs: Use predictable name for automatically generated property.
3162 2007-11-12 Marek Safar <marek.safar@gmail.com>
3164 A fix for bug #324996
3165 * expression.cs (Is): Handle case where D is nullable and T is not
3168 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
3170 2007-11-12 Marek Safar <marek.safar@gmail.com>
3172 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
3173 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
3174 Flush small error reporting changes.
3176 2007-11-09 Marek Safar <marek.safar@gmail.com>
3178 A fix for bug #324996
3179 * expression.cs: Rewrote Is expression implementation to work with
3180 generics, nullable types, anonymous method. A const result expression
3181 uses existing infrastructure instead of custom not fully-featured one.
3183 2007-11-08 Marek Safar <marek.safar@gmail.com>
3185 A fix for bug #340202
3186 * class.cs: Consider generics for volatile field.
3188 2007-11-08 Marek Safar <marek.safar@gmail.com>
3190 A fix for bug #335594
3191 * expression.cs: Use conversion rules when handling string addition.
3193 2007-11-07 Marek Safar <marek.safar@gmail.com>
3195 A fix for bug #336651
3196 * expression.cs: Fixed a crash when probing is on.
3198 2007-11-07 Marek Safar <marek.safar@gmail.com>
3200 A fix for bug #324242
3201 * covert.cs: Added a conversion from any nullable-type with an
3202 underlying enum-type to the type System.Enum.
3204 2007-11-07 Marek Safar <marek.safar@gmail.com>
3206 A fix for bug #324222
3207 * class.cs: Report all non-used event fields.
3209 2007-11-07 Marek Safar <marek.safar@gmail.com>
3211 A fix for bug #325161
3212 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
3213 qualifier for generic types.
3215 2007-11-07 Marek Safar <marek.safar@gmail.com>
3217 A fix for bug #322971
3218 * expression.cs, ecore.cs: Added intermediate result value check for
3221 2007-11-07 Marek Safar <marek.safar@gmail.com>
3223 A fix for bug #324754
3224 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
3225 when it was requested.
3227 2007-11-07 Marek Safar <marek.safar@gmail.com>
3229 A fix for bug #325101
3230 * expression.cs: Do type not value comparison for `is' expression.
3232 2007-11-07 Marek Safar <marek.safar@gmail.com>
3234 A fix for bug #320236
3235 * convert.cs: Don't apply user conversion on underlying target type.
3237 2007-11-06 Marek Safar <marek.safar@gmail.com>
3239 * expression.cs: Don't use unresolved expression for error reporting.
3241 2007-11-06 Marek Safar <marek.safar@gmail.com>
3243 A fix for bugs #337712, #324490
3244 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
3245 overloading resolution too.
3247 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
3248 the process consistent and more robust.
3250 * expression.cs, linq.cs, report.cs: Update.
3252 2007-11-02 Marek Safar <marek.safar@gmail.com>
3254 A fix for bug #332909
3255 * attribute.cs: Resolve attributes in correct context using error
3258 * rootcontext.cs: Define Obsolete attribute members as core members.
3260 2007-11-02 Marek Safar <marek.safar@gmail.com>
3262 * statement.cs: Removed unused methods.
3264 2007-10-31 Wade Berrier <wberrier@novell.com>
3266 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
3267 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
3270 2007-10-31 Marek Safar <marek.safar@gmail.com>
3272 A fix for bug #338102
3273 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
3274 methods registered as non-generics.
3276 2007-10-31 Marek Safar <marek.safar@gmail.com>
3278 A fix for bugs #337712, #324490
3279 * delegate.cs: Delegate covariance and contravariance is not allowed for
3282 2007-10-31 Marek Safar <marek.safar@gmail.com>
3284 A fix for bug #337719
3285 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
3288 2007-10-30 Marek Safar <marek.safar@gmail.com>
3290 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
3292 2007-10-29 Marek Safar <marek.safar@gmail.com>
3294 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
3297 2007-10-29 Raja R Harinath <rharinath@novell.com>
3299 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
3301 2007-10-29 Marek Safar <marek.safar@gmail.com>
3303 A fix for bug #334652
3304 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
3305 extension methods when we have not found the best candidate in normal
3308 2007-10-27 Marek Safar <marek.safar@gmail.com>
3310 * AssemblyInfo.cs: Keep up-to-date.
3312 2007-10-27 Marek Safar <marek.safar@gmail.com>
3314 * Makefile: Fixed generics compiler name.
3316 2007-10-27 Marek Safar <marek.safar@gmail.com>
3318 * lambda.test: removed, lambda parsing is done differently.
3320 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
3322 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
3324 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
3326 2007-10-27 Marek Safar <marek.safar@gmail.com>
3328 * Makefile, *.sources : All C# compilers are in mcs folder.
3330 * *.cs: Use existing 2_1 define for smcs.
3332 2007-10-26 Marek Safar <marek.safar@gmail.com>
3334 A fix for bug #335847
3335 * assign.cs, expression.cs: Couple of changes to avoid creating a
3336 temporary variable for each object initializer assignment statement. It
3337 simplifies struct initialization too, otherwise two temporary variables
3339 Implemented optimization of redundant default element initializers.
3341 2007-10-25 Marek Safar <marek.safar@gmail.com>
3343 A fix for bug #336766
3344 * expression.cs (Class.CheckBase): Use generic name when method is
3347 2007-10-25 Marek Safar <marek.safar@gmail.com>
3349 A fix for bug #334737
3350 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
3351 variable and not variable argument for prepared copies.
3353 2007-10-24 Marek Safar <marek.safar@gmail.com>
3355 A fix for bug #325110
3356 * class.cs, expression.cs, attribute.cs: Use open generic method when
3357 checking conditional attribute.
3359 2007-10-24 Marek Safar <marek.safar@gmail.com>
3361 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
3362 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
3363 FeatureIsNotAvailable.
3365 2007-10-24 Marek Safar <marek.safar@gmail.com>
3367 ** C# 3.0 Partial methods
3369 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
3370 methods support. Because of member cache issue with generics only
3371 non-generics partial methods are fully supported.
3373 2007-10-23 Marek Safar <marek.safar@gmail.com>
3375 * class.cs, decl.cs: Rewrote member overloads check to cope with
3376 generics and to use member cache for member checking. It also improves
3377 performance and fixes remaining overloads issues.
3379 2007-10-20 Marek Safar <marek.safar@gmail.com>
3381 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
3382 roottypes.cs, typemanager.cs:
3384 A member cache creation logic changed to add members immediately and
3385 not rely on fallback. The member cache is now only prefered way
3386 how to access and find type declaration members. It saves 5 MB of memory
3387 during MWF compilation and makes code ready for more optimizations and
3388 clean-ups, it's also a pre-requirement for partial methods.
3390 2007-10-18 Raja R Harinath <harinath@gmail.com>
3392 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
3393 handling for generic parameters.
3395 2007-10-15 Marek Safar <marek.safar@gmail.com>
3397 * class.cs (FixedField): Removed redundant volatile check.
3399 2007-10-15 Marek Safar <marek.safar@gmail.com>
3401 * class.cs, decl.cs: Fixed overload members verification to do only one
3402 check per possible collision.
3404 2007-10-13 Marek Safar <marek.safar@gmail.com>
3406 A fix for bug #325478
3407 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
3408 and create only one disposable flags container.
3410 2007-10-12 Marek Safar <marek.safar@gmail.com>
3412 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
3413 * statement.cs (Fixed): Fixed variables cloning.
3415 2007-10-12 Marek Safar <marek.safar@gmail.com>
3417 A fix for bug #333342
3418 * class.cs (EventField): Don't mark value type event as synchronized.
3420 2007-10-12 Marek Safar <marek.safar@gmail.com>
3422 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
3423 inference to identify best candidate method correctly.
3424 (ProperyExpr): A range variable is read only and cannot be modified.
3426 2007-10-11 Marek Safar <marek.safar@gmail.com>
3428 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
3429 logic to identify best candidate method correctly.
3431 2007-10-11 Marek Safar <marek.safar@gmail.com>
3433 * location.cs (Equals, GetHashCode): Removed.
3435 2007-10-11 Marek Safar <marek.safar@gmail.com>
3437 * report.cs: Implemented message recorder. It is used mainly for lambda
3438 expressions to capture otherwise swallowed error messages.
3440 * anonymous.cs, lambda.cs.cs: Do full parameters check.
3442 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
3444 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
3446 * expression.cs (MemberAccess): Always report lookup failure.
3448 * location.cs: Implemented Equals, GetHashCode.
3450 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
3452 2007-10-10 Jb Evain <jbevain@novell.com>
3454 * codegen.cs: re-enable assembly version check.
3456 2007-10-09 Marek Safar <marek.safar@gmail.com>
3458 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
3461 * namespace.cs (UsingAlias): Do correct version check.
3463 2007-10-08 Marek Safar <marek.safar@gmail.com>
3465 * expresison.cs, ecore.cs: Issue extension method error message when
3468 * rootcontext.cs: Added ISO_2 compiler mode option.
3470 2007-10-08 Marek Safar <marek.safar@gmail.com>
3472 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
3475 2007-10-08 Marek Safar <marek.safar@gmail.com>
3477 * attribute.cs (GetString, GetBoolean): Work with both literal and
3480 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
3481 Moved method overload specific methods to MethodGroupExpr.
3483 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
3484 it should be less memory consuming.
3486 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
3488 * codegen.cs: remove the assembly version check until the buildbot is
3491 2007-10-07 Jb Evain <jbevain@novell.com>
3493 * attribute.cs (Attribute.GetString): if the value
3494 expression is a StringConstant, return its string value.
3496 2007-10-07 Jb Evain <jbevain@novell.com>
3498 * typemanager.cs: add `assembly_version_attribute_type`.
3499 * codegen.cs: on attribute emission, check that the
3500 AssemblyVersionAttribute doesn't overflow.
3502 2007-10-05 Marek Safar <marek.safar@gmail.com>
3504 A fix for bug #324677
3505 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
3506 parent container of a scope container with currently resolved one.
3508 2007-10-05 Marek Safar <marek.safar@gmail.com>
3510 A fix for bug #325534
3511 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
3514 2007-10-05 Marek Safar <marek.safar@gmail.com>
3516 A fix for bug #327504
3517 * class.cs (Operator.Define): Refactored implicit and explicit user
3518 operator conversion rules.
3520 2007-10-05 Marek Safar <marek.safar@gmail.com>
3522 A fix for bug #327520
3523 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
3525 2007-10-04 Marek Safar <marek.safar@gmail.com>
3527 A fix for bug #328022
3528 * class.cs (MethodData.Define): Use correct method to check whether
3529 a method implementents an accessor.
3531 2007-10-04 Marek Safar <marek.safar@gmail.com>
3533 A fix for bug #330069
3534 * statement.cs (Fixed.Resolve): Read the first array element only when
3535 an array is instantiated.
3537 2007-10-04 Marek Safar <marek.safar@gmail.com>
3539 * expression.cs, assign.cs, generics.cs: Print correct operator when
3540 compound assignment is used.
3542 2007-10-04 Marek Safar <marek.safar@gmail.com>
3544 A fix for bug #325841
3545 * expression.cs (ArrayAccess): Use full argument cloning only for
3546 string compound concatenation.
3548 2007-10-03 Marek Safar <marek.safar@gmail.com>
3550 A fix for bug #328774
3551 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
3553 (PropertyExpr.EmitAssign): Fixed string concatenation compound
3556 2007-10-03 Raja R Harinath <rharinath@novell.com>
3559 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
3560 Event accessibility checks here. Remove some bogus code that
3561 accidently made GenericMethods work.
3562 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
3564 2007-09-25 Marek Safar <marek.safar@gmail.com>
3566 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
3568 * statement.cs (Block): Refactored AddVariable to allow error handling
3571 * generic.cs: New stub.
3573 2007-09-23 Marek Safar <marek.safar@gmail.com>
3575 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
3578 2007-09-17 Marek Safar <marek.safar@gmail.com>
3580 * class.cs: Use partial container to record whether any partial part
3581 contains static field initializer and therefore default contructor has
3584 2007-09-14 Marek Safar <marek.safar@gmail.com>
3586 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
3587 mono-list when only one of two partial parts has defined accessibility
3590 2007-09-14 Marek Safar <marek.safar@gmail.com>
3592 A fix for bug #82845
3594 * class.cs (TypeContainer): Set correct resolve context for all field
3597 2007-09-13 Marek Safar <marek.safar@gmail.com>
3599 * assign.cs: Fixed a crash when field is resolved twice with an error.
3601 * codegen.cs: Changed InFieldInitializer to be flag.
3603 * anonymous.cs, ecore.cs, expression.cs: Update after
3604 IsInFieldInitializer rename.
3606 * const.cs: Removed unused parameter.
3608 * class.cs: Changed the way how we resolve and emit field initializers.
3609 The field initilizers have to have access to contructor block to emit
3610 compiler generated code.
3612 2007-09-13 Marek Safar <marek.safar@gmail.com>
3614 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
3615 generics use TypeContainer instead.
3617 2007-09-12 Marek Safar <marek.safar@gmail.com>
3619 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
3621 * lambda.cs (ResolveParameters): Use more powerful
3622 InflateGenericArgument.
3624 * parameters.cs: Better exception message.
3626 2007-09-10 Marek Safar <marek.safar@gmail.com>
3628 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
3629 correct expression block type.
3631 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
3633 * expression.cs (Invocation): Extracted method group resolve to
3636 2007-09-07 Marek Safar <marek.safar@gmail.com>
3638 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
3639 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
3641 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
3642 generic extension methods.
3644 2007-09-06 Marek Safar <marek.safar@gmail.com>
3646 A fix for bug #82676 (Do I get it right now?)
3647 * convert.cs (Binary.ResolveOperator): An interface is converted to the
3648 object before a standard conversion is applied.
3650 2007-09-06 Marek Safar <marek.safar@gmail.com>
3652 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
3655 2007-09-05 Marek Safar <marek.safar@gmail.com>
3657 A fix for bug #82676
3658 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
3659 non-generic interface types.
3661 2007-09-05 Marek Safar <marek.safar@gmail.com>
3663 A fix for bug #82690
3664 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
3666 2007-09-05 Marek Safar <marek.safar@gmail.com>
3668 A fix for bug #82571
3669 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
3670 modifier for container based methods.
3672 2007-09-05 Marek Safar <marek.safar@gmail.com>
3674 A fix for bug #82676
3675 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
3676 any interface-type T means to any of interface type T.
3678 2007-09-04 Marek Safar <marek.safar@gmail.com>
3680 * namespace.cs: We have 2 versions of System.Core assembly.
3682 2007-09-04 Marek Safar <marek.safar@gmail.com>
3684 A fix for bug #82652
3685 * class.cs (Class.GetClassBases): Compare types and not expressions.
3687 2007-09-04 Marek Safar <marek.safar@gmail.com>
3689 A fix for bug #82620
3690 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
3691 actually never worked before.
3692 (IndexerAccess): Emit prepared arguments before they are modified.
3694 2007-09-04 Marek Safar <marek.safar@gmail.com>
3696 A fix for bug #82563
3697 * assign.cs: Revert wrong fix.
3699 * expression.cs (VariableReference.EmitAssign): Handle ref reference
3701 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
3702 Instead of ldelema/stdind we have to use temporary variables to handle
3703 cases like String.Concat (params string[]).
3705 2007-08-31 Marek Safar <marek.safar@gmail.com>
3707 * class.cs: EmitAttributes to Emit rename.
3709 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
3711 (MemberCore.HasClsCompliantAttribute): Don't depend on
3712 GetClsCompliantAttributeValue execution.
3714 2007-08-31 Marek Safar <marek.safar@gmail.com>
3716 * anonymous.cs: Use shorter type prefix.
3718 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
3721 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
3722 variables when probing is on.
3724 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
3725 unresolved variables.
3726 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
3727 handle transparent identifiers.
3729 2007-08-26 Marek Safar <marek.safar@gmail.com>
3731 * attribute.cs (IsClsCompliant): Add nullable types test.
3733 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
3735 * doc.cs : catch other types of exception than XmlException to
3736 report CS1570. Fixed bug #82565.
3738 2007-08-23 Marek Safar <marek.safar@gmail.com>
3740 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
3741 The number of delegate parameters has to match.
3742 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
3745 2007-08-21 Marek Safar <marek.safar@gmail.com>
3747 * anonymous.cs (AnonymousMethod): Generate private anonymous method
3748 to fix problem with private arguments.
3750 2007-08-20 Marek Safar <marek.safar@gmail.com>
3752 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
3754 * decl.cs (MemberName): Ignore generic type with no generic arguments.
3756 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
3757 empty. Add cloning suport.
3759 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
3761 2007-08-20 Marek Safar <marek.safar@gmail.com>
3763 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
3764 to create EmptyCast. It handles EmptyConstantCast specialization for
3767 2007-08-18 Marek Safar <marek.safar@gmail.com>
3769 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
3770 (EmitArrayArgument): One routine for array arguments.
3771 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
3773 2007-08-17 Marek Safar <marek.safar@gmail.com>
3775 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
3777 2007-08-17 Marek Safar <marek.safar@gmail.com>
3779 * anonymous.cs: MemberLookupFinal update.
3781 * class.cs (ConstructorInitializer): Is expression based.
3783 * delegate.cs: MethodGroupExpr update.
3785 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
3787 (Error_MemberLookupFailed): Customizable error override.
3788 (MethodGroupExpr): Keep queried type for later usage.
3789 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
3792 * expression.cs: Error_MemberLookupFailed refactoring.
3793 (New.DoResolve): Resolve as much as possible.
3794 (ElementInitializer.Error_MemberLookupFailed): Object initializer
3795 customization for invalid member types.
3797 * statement.cs: MethodGroupExpr update.
3799 2007-08-16 Marek Safar <marek.safar@gmail.com>
3801 * modifier.cs (Check): Check all modifiers and not only accessibility
3804 2007-08-16 Marek Safar <marek.safar@gmail.com>
3806 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
3807 type and not an expression.
3809 2007-08-16 Marek Safar <marek.safar@gmail.com>
3811 * statement.cs (Catch.Clone): Type and variable can be null.
3813 2007-08-16 Marek Safar <marek.safar@gmail.com>
3815 A fix for bug #81979
3816 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
3817 I am really not sure whether this is the best fix.
3819 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
3822 2007-08-14 Marek Safar <marek.safar@gmail.com>
3824 ** C# 3.0 Object and collection initializers (major re-write)
3826 * assign.cs (DoResolve): Initializers are not assign related.
3828 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
3829 used during collection or object initialization.
3831 * expression.cs (Error_InvalidArguments): Add initializers specific
3832 messages. More will come later because it requires some general
3834 (New.DoResolve): Better error handling for unsafe types.
3835 (EmptyExpressionStatement): New class.
3836 (ElementInitializer): An object initializer expression.
3837 (CollectionElementInitializer): A collection initializer expression.
3838 (CollectionOrObjectInitializers): A block of object or collection
3840 (NewInitialize): New expression with element/object initializers.
3842 * statement.cs: Reverted object/collection initializer hacks.
3844 * typemanager.cs (CSharpName): Filter __arglist type.
3846 2007-08-09 Marek Safar <marek.safar@gmail.com>
3848 ** C# 3.0 Anonymous Types (update to the latest standard)
3850 * expression.cs (Binary.ResolveOperator): Threat all null based types
3852 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
3853 (AnonymousTypeParameter): Updated.
3855 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
3856 (AnonymousTypeClass): New anonymous type container.
3858 * class.cs (AddField): Return operation result.
3860 * generic.cs: Another empty TypeArguments overload.
3862 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
3863 are stored at top of normal hierarchy.
3865 * typemanager.cs (CSharpName): Filter anonymous types.
3867 2007-08-09 Marek Safar <marek.safar@gmail.com>
3869 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
3870 as single Concat call. How could we miss that :-(
3872 2007-08-08 Marek Safar <marek.safar@gmail.com>
3874 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
3876 2007-08-07 Miguel de Icaza <miguel@novell.com>
3878 * expression.cs: Fix the previous commit, the creation of the
3879 arguments array list needs also to be conditional on the arguments
3882 * class.cs: Add a little bit of help to help narrow down problems.
3884 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
3885 not try to copy in that case.
3887 * driver.cs: When building SMCS, include a new different set of
3888 default assemblies here. Do this here so we can control whether
3889 to include the default assemblies with /noconfig.
3891 2007-08-03 Marek Safar <marek.safar@gmail.com>
3893 A fix for bug #81979
3894 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
3897 2007-08-03 Marek Safar <marek.safar@gmail.com>
3899 A fix for bug #82300
3901 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
3902 we are in probing scope.
3904 2007-08-03 Marek Safar <marek.safar@gmail.com>
3906 A fix for bug #82301
3908 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
3909 (Statement.CloneTo): Clone and not map children blocks.
3911 2007-08-03 Marek Safar <marek.safar@gmail.com>
3913 A fix for bug #82299
3915 * expression.cs (LocalVariableReference.CloneTo): Remap local info
3918 * statement.cs (Statement.CloneTo): Clone variables before statements
3919 to allow remaping of local variables.
3921 2007-08-03 Marek Safar <marek.safar@gmail.com>
3923 A fix for bug #82296
3926 * report.cs: Log crash details for future clone problems.
3928 * statement.cs (Return.Clone): Don't clone non-existent expression.
3930 2007-08-03 Raja R Harinath <harinath@gmail.com>
3932 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
3933 (Class.AddBasesForPart): Move CS0537 check here from ...
3934 * cs-parser.jay (class_declaration): ... here. Move calling of
3935 'AddBasesForPart' to ...
3936 (class_bases): ... here.
3937 (struct_declaration, interface_declaration): Update to changes.
3939 2007-08-02 Marek Safar <marek.safar@gmail.com>
3941 A fix for bug #81923
3943 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
3944 conversion is allowed.
3946 2007-08-02 Marek Safar <marek.safar@gmail.com>
3948 A fix for bug #81564
3950 * ecore.cs (EventExpr): Add IsBase handling.
3952 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
3955 2007-08-02 Raja R Harinath <harinath@gmail.com>
3957 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
3958 * cs-parser.jay: Some whitespace cleanups.
3959 (current_delegate): New.
3961 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
3962 a dummy code block, and use 'type_name' instead of 'member_name'.
3963 (interface_declaration, class_declaration): Likewise.
3964 (delegate_declaration): Likewise. Rearrange slightly and use
3966 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
3967 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
3969 2007-08-02 Marek Safar <marek.safar@gmail.com>
3971 A fix for bug #82039
3973 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
3976 * typemanager.cs (CSharpName): Split to string overload.
3978 2007-08-02 Marek Safar <marek.safar@gmail.com>
3981 * report.cs: Updated warning CS0472.
3983 2007-08-01 Marek Safar <marek.safar@gmail.com>
3985 A fix for bug #82181
3987 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
3989 2007-08-01 Marek Safar <marek.safar@gmail.com>
3991 A fix for bug #82277
3992 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
3994 2007-08-01 Marek Safar <marek.safar@gmail.com>
3996 ** C# 3.0 Type Inference (major bits are working)
3998 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
3999 (.ImplicitStandardConversionExists): Uses compatible.
4000 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4001 (.InferReturnType): New method.
4002 (.Compatible): Refactored.
4003 (.ResolveParameters): Uses factory to create resolved parameters.
4004 (.CompatibleMethod): Add probing mode support.
4005 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4006 clearly distinguish between 2 different operations.
4007 (LambdaMethod): Moved to lambda.cs.
4008 (AnonymousMethod): Removed unused fields and methods.
4009 (AnonymousDelegate): Simplified.
4011 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4013 * convert. cs (ImplicitConversionStandard): Compatible works differently.
4015 * delegate.cs (Delegate): New mehods to reduce code duplication.
4016 (.GetConstructor): New method.
4017 (.GetInvokeMethod): New method.
4018 (DelegateCreation): Updated.
4020 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4022 (OverloadResolve): Made probing little bit faster.
4024 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4027 * generic.cs (TypeInferenceContext): Dummy implementation.
4029 * iterators.cs: Updated after Resolve/Define rename.
4031 * lambda.cs (LambdaExpression)
4032 (.ResolveParameters): Handles both type of arguments and type inference too.
4034 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4035 (InflateTypes): Updated.
4037 * support.cs (InflateTypes): Changed signature and updated.
4039 * typemanager.cs (LookupMemberCache): Better dynamic type check.
4040 (MemberLookup_FindMembers): More MS tricks.
4041 (GetParameterData): Ditto.
4042 (GetDelegateParameters): Uses quick path for dynamic types.
4044 2007-08-01 Marek Safar <marek.safar@gmail.com>
4046 * class.cs (MethodData.Define): EmitContext is required for generic stuff
4049 2007-07-31 Marek Safar <marek.safar@gmail.com>
4051 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4054 2007-07-26 Jb Evain <jbevain@novell.com>
4056 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4057 which takes a boolean 'report_errors', similar to the GetMethod.
4058 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4059 in .net 2.1, do not report errors here.
4061 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4062 System.Runtime.CompilerServices.RequiredAttributeAttribute and
4063 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4066 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4067 of the type InternalsVisibleToAttribute before the first call
4068 to CoreLookupType which is allowed to fail (third boolean parameter
4069 to true). Because, during the resolution for a type that is not
4070 immediately found, we try to check if the type is not defined in
4071 a friend assembly, and to do so, we need the
4072 InternalVisibleToAttribute.
4074 2007-07-23 Miguel de Icaza <miguel@novell.com>
4076 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4077 feature that allows structs to be compared against null and inline
4078 the result as true or false.
4080 Notice that the same code is not permitted inside a generic block
4081 of code that would do:
4083 class Foo<T> where T : struct {
4090 It is only allowed if the type of T is not bound (no where
4091 clause). In my opinion, this CSC 2 behavior is broken but people
4092 seem to be using it (IronRuby does, a few bug reports on bugzilla
4093 have it and some people have complained about it).
4095 All of the users that depend on this behavior have code that is
4098 * report.cs (Warning, Error): make these take object arguments,
4099 not strings, as that allows us to take advantage of Format.
4101 2007-07-20 William Holmes <billholmes54@gmail.com>
4103 * decl.cs: Changed MemberName.CountTypeArguments to also check the
4104 Left member variable for the Count.
4105 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
4106 MemberName.CountTypeArguments to avoid a NRE.
4108 This code is contributed under the MIT X11 license
4110 2007-07-18 Marek Safar <marek.safar@gmail.com>
4112 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4114 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4116 * doc.cs : generic method arguments are written as ``x while generic
4117 type arguments are `x. Combined with the previous change, fixed bug
4120 2007-07-18 Raja R Harinath <rharinath@novell.com>
4123 * expression.cs (Binary.ResolveOperator): When converting
4124 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4126 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4128 * doc.cs : when T: or whatever x: is specified, it does not really
4129 check the doc comment's syntax correctness. Fixed bug #82006.
4131 2007-07-18 Marek Safar <marek.safar@gmail.com>
4133 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
4134 LambdaExpression better.
4136 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
4138 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
4140 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
4141 as it can be generated.
4143 * expression.cs (Invocation.Error_InvalidArguments): Show correct
4146 * lambda.cs (LambdaExpression): Refactored to share same code with
4147 AnonymousMethodExpression.
4149 2007-07-17 Marek Safar <marek.safar@gmail.com>
4151 * anonymous.cs (MakeName): Include host name for easier debugging.
4152 (LambdaMethod): New class for lambda spcecific stuff.
4154 * attribute.cs: Set EmitContext return type.
4156 * class.cs: Set EmitContext return type.
4158 * codegen.cs (EmitContext): Return type cannot be null to stop messing
4159 with null/void meaning.
4161 * iterators.cs (ContainerType): Implemented.
4163 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
4165 * statement.cs (Return): Updated to lambda expressions.
4166 (Block.CloneTo): Parent can be null.
4168 2007-07-13 Marek Safar <marek.safar@gmail.com>
4170 A fix for bug #81917
4171 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
4173 * class.cs (FixedField): Check whether field is in unsafe scope.
4175 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
4176 (FieldExpr.Emit): Fixed buffers cannot be volatile.
4178 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
4181 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
4183 2007-07-13 Marek Safar <marek.safar@gmail.com>
4185 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
4186 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
4189 2007-07-13 Marek Safar <marek.safar@gmail.com>
4191 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
4193 2007-07-13 Marek Safar <marek.safar@gmail.com>
4195 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
4196 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
4198 * codegen.cs(EmitContext): Add ProbingMode flag.
4200 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
4202 * driver.cs: For now set both warning values.
4204 * ecore.cs (SimpleName): Name is readonly.
4205 (MethodGroup.OverloadResolve): One quick path for probing.
4207 * expression.cs (Unary): Set Oper r/o.
4208 (Binary): Set Oper r/o.
4209 (ParameterReference): Set few instance variables as r/o.
4210 (ParameterReference.DoResolveBase): Don't capture aruments when
4212 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
4213 (Arglist): arguments are private.
4214 (SizeOf): type is private and r/o.
4215 (MemberAccess): arguments are private.
4217 * report.cs: Enhanced reporting on/off capabilities.
4219 * lambda.cs: Uses ec.IsInProbingMode.
4220 (ContextualReturn): Derives from return.
4222 * rootcontext.cs: For now set both warning values.
4224 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
4226 (Return.Resolve): Don't die immediately.
4227 (Block.Resolve): Speed-up probing.
4228 (Block.CloneTo): Clone only child blocks.
4230 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
4232 * iterators.cs: reverted Miguel's latest change (r81925) as it
4233 breaks the build in System.
4235 2007-07-13 Miguel de Icaza <miguel@novell.com>
4237 * iterators.cs (Yield.CheckContext): Check for the iterator type
4238 also here as we can call into Yield even in codepaths that are not
4240 (MethodOrOperator is the only path that was checked).
4242 In addition to the standard check, use a more specific check for
4243 constructors to report a more verbose error.
4245 2007-07-12 Miguel de Icaza <miguel@novell.com>
4247 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
4248 report the warning and continue
4250 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
4251 values on the stack on the call to Emit. Use EmitStatement if
4252 possible, or using Emit + Pop if not possible. Fixes #82064
4254 2007-07-12 Raja R Harinath <rharinath@novell.com>
4256 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
4257 avoid try...finally in some cases.
4259 2007-07-10 Marek Safar <marek.safar@gmail.com>
4261 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
4263 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
4264 instead of method. Re-use standard error handling.
4265 (ConstructorInitializer.Emit): Simplified.
4267 * delegate.cs: Updated after Invocation.EmitCall change.
4269 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
4270 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
4271 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
4272 method and don't permanently changing input arguments.
4273 (MethodGroupExpr): Introduced resolved best_candidate, when method group
4274 is resolved it has one of the candidates is the best one which is later
4275 used to emit. Removed a few unused method.
4276 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
4278 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
4279 (Binary.ResolveOperator): Ditto.
4280 (ConditionalLogicalOperator.DoResolve): Ditto.
4281 (Invocation): Uses method group.
4282 (Invocation.DoResolve): Simplified.
4283 (Invocation.EmitCall): Removed useless is_static.
4284 (Invocation.Emit): Delegate to method group.
4285 (Invocation.EmitStatement): Simplified.
4286 (New): Uses method group.
4287 (MemberAccess.DoResolve): Don't destroy original expression.
4289 * statement.cs (ForEach.Resolve): Use null for no method arguments.
4291 2007-07-04 Marek Safar <marek.safar@gmail.com>
4293 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
4296 * lambda.cs: Add custom error message type.
4298 2007-07-03 Marek Safar <marek.safar@gmail.com>
4300 * lambda.cs: Simplified little bit.
4302 * parameter.cs: Introduced ImplicitLambdaParameter.
4303 (Parameters.CreateFullyResolved): New factory instead of ctor.
4307 * delegate.cs: Updated parameter creation.
4309 2007-07-03 Marek Safar <marek.safar@gmail.com>
4311 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
4314 * generic.cs: Synchronized with gmcs.
4316 2007-07-03 Marek Safar <marek.safar@gmail.com>
4318 * class.cs (Indexer): Check return type as soon as possible.
4320 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
4323 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
4325 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
4327 * parameter.cs (Parameter): Use expression type when it is available.
4329 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
4330 method modifier for the first parameter only.
4332 2007-06-24 Marek Safar <marek.safar@gmail.com>
4334 A fix for bug #81938
4335 * typemanager.cs (ChangeType): Fixed couple of char conversions.
4337 * constant.cs: Tide up an exception message.
4339 2007-06-22 Marek Safar <marek.safar@gmail.com>
4341 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
4342 an uninitialized variable is used.
4344 * expression.cs (LocalVariableReference.DoResolve): Ditto.
4346 2007-06-22 Marek Safar <marek.safar@gmail.com>
4348 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
4349 not found error handling.
4351 * expression.cs (ArrayCreation): Removed redundant fields and little bit
4353 (ArrayCreation.ResolveArrayElement): To be ready to customization.
4354 (ArrayCreation.DoResolve): Simplified.
4355 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
4356 its own resolve process.
4357 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
4359 2007-06-20 Marek Safar <marek.safar@gmail.com>
4361 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
4364 2007-06-20 Marek Safar <marek.safar@gmail.com>
4366 * cs-tokenizer.cs: Removed var related stuff.
4368 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
4369 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
4370 a type and a keyword at same time.
4372 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
4375 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
4376 implicitly typed arrays, more changes will follow.
4378 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
4380 2007-06-19 Marek Safar <marek.safar@gmail.com>
4382 * ecore.cs (VarExpr): Removed Handled field.
4384 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
4385 build-in assign functionality.
4386 (ForEach.Resolve): Removed all implicitly typed local variable code and
4388 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
4389 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
4391 2007-06-18 Marek Safar <marek.safar@gmail.com>
4393 * assign.cs: Removed implicitly typed local variable check.
4395 * expression.cs (LocalVariableReference.DoResolve): Add check for self
4396 referencing implicitly typed local variable.
4397 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
4400 * statement.cs (Fixed): Removed unsupported implicitly typed local
4403 2007-06-15 Marek Safar <marek.safar@gmail.com>
4405 * decl.cs (MemberName): Moved all Unbound stuff to parser.
4407 2007-06-14 Marek Safar <marek.safar@gmail.com>
4409 A fix for bugs #81855 and #76274
4410 * attribute.cs (AttachTo): Always set owner for global attributes to
4413 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
4416 * cs-parser.jay: Assembly and module attributes must precede all other
4417 elements except using clauses and extern alias declarations.
4419 2007-06-13 Marek Safar <marek.safar@gmail.com>
4421 A fix for bug #81748
4423 * expression.cs: More checks for non ISO-1 features.
4425 2007-06-12 Marek Safar <marek.safar@gmail.com>
4427 A fix for bug #81807
4428 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
4429 present inside switch statement and it is required by nullable check.
4431 2007-06-12 Marek Safar <marek.safar@gmail.com>
4433 A fix for bug #81840
4434 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
4435 when type matching fails.
4437 * namespace.cs: Tiny error message change.
4439 2007-06-12 Marek Safar <marek.safar@gmail.com>
4441 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
4442 reporting. Added automatic property check.
4444 * class.cs: Updated after CheckAbstractAndExtern relocation.
4445 (AEventPropertyAccessor.GetSignatureForError): Customized.
4447 2007-06-11 Marek Safar <marek.safar@gmail.com>
4449 * class.cs (DefineBaseTypes): Base type can be undefined.
4451 * ecore.cs (TypeLookup): Minor refactoring.
4452 (DoResolveAsTypeStep): Removed redundant check.
4454 * namespace.cs (Lookup): Removed redundant check.
4456 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
4457 ResolveAsTypeTerminal step.
4458 (BootstrapCorlib_*): Simplified.
4459 (PopulateCoreType): Core types can be now external.
4461 2007-06-07 Marek Safar <marek.safar@gmail.com>
4463 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
4465 (InferTypeArguments): Infers anonymous expression type arguments.
4466 (Compatible): Split to Compatible and InferTypeArguments.
4468 * lambda.cs: Updated.
4470 2007-06-08 Marek Safar <marek.safar@gmail.com>
4472 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
4474 2007-06-07 Raja R Harinath <harinath@gmail.com>
4476 Fix #80477, cs0135-2.cs, cs0135-3.cs
4477 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
4478 names to the "known" variables list.
4479 (Block.CheckInvariantMeaningInBlock): Handle the fact the
4480 parameter names are also "known".
4481 (Block.CheckError136): Remove.
4482 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
4485 2007-06-07 Marek Safar <marek.safar@gmail.com>
4487 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
4489 2007-06-06 Marek Safar <marek.safar@gmail.com>
4491 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
4492 internal error not an user error.
4494 * expression.cs (IsApplicable): Refactored to make debugging easier.
4496 * support.cs: More tricks for non-mono runtimes.
4498 * typemanager.cs (CoreLookupType): Made public.
4499 (InitSystemCore): All linq specific stuff moved to linq.cs
4501 2007-06-05 Marek Safar <marek.safar@gmail.com>
4503 * typemanager.cs (CSharpSignature): One more missing build-in types
4505 More tricks for non-mono runtime.
4507 2007-06-05 Raja R Harinath <harinath@gmail.com>
4509 * statement.cs (Block.CheckError136_InParents): Remove.
4510 (Block.AddVariable): Use GetParameterInfo instead.
4511 (ToplevelBlock.ProcessArguments): Likewise.
4513 2007-06-04 Raja R Harinath <rharinath@novell.com>
4515 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
4517 (ToplevelBlock.GetParameterInfo): Split out of ...
4518 (ToplevelBlock.GetParameterRefernce): ... this.
4519 (ToplevelBlock.ParameterMap): Remove.
4520 * expression.cs (ParameterReference): Update to use
4521 ToplevelParameterInfo.
4523 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
4526 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
4527 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
4529 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
4530 (ToplevelBlock.ProcessParameters) ... here.
4531 (ToplevelBlock..ctor): Invoke it.
4533 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
4536 * statement.cs (IKnownVariable): New interface.
4537 (LocalInfo): Implement it.
4538 (ToplevelParameterInfo): New class.
4539 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
4540 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
4541 GetKnownVariableInfo.
4543 2007-06-03 Raja R Harinath <harinath@gmail.com>
4545 Partly speed up CS0136 error checks.
4546 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
4547 'recurse' parameter.
4548 (Block.DoCheckError136): Only check errors in parameters. Move
4549 local variable checks ...
4550 (Block.AddVariable): ... here, and ...
4551 (ToplevelBlock.ResolveMeta): ... here.
4553 2007-06-02 Raja R Harinath <harinath@gmail.com>
4555 * statement.cs (Block.IsChildOf): Remove.
4557 * statement.cs (Statement.Clone): Move special case code ...
4558 (Block.CloneTo): ... here.
4560 2007-05-29 Raja R Harinath <rharinath@novell.com>
4562 * statement.cs (ToplevelBlock.container): Remove field. It's
4563 redundant with 'Parent'.
4564 (ToplevelBlock.ContainerBlock): Remove accessor.
4565 (ToplevelBlock..ctor): Update to changes. Register anonymous
4566 child with parent here, ...
4567 * cs-parser.jay (end_anonymous): ... not here. Don't modify
4569 (start_anonymous): Don't save current_block.
4570 (top_current_block): Remove.
4572 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
4573 (Block.Resolve): Update to changes.
4574 (Block..ctor): Move setting of "correct" 'Toplevel'
4575 and 'Explicit' fields to ...
4576 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
4578 2007-05-27 Raja R Harinath <harinath@gmail.com>
4581 * statement.cs (Block.Implicit): Remove.
4582 (Block): Update to changes.
4583 * flowanalysis.cs: Likewise.
4585 Mildly speed up CheckInvariantMeaningInBlock
4586 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
4587 Recursively call AddKnownVariable to all enclosing blocks.
4588 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
4589 Remove recursive calls.
4590 (Block): Update to changes.
4592 New ExplicitBlock invariants
4593 * statement.cs (Block.Explicit): New field. It points to the
4594 immediately enclosing non-implicit block.
4595 (Block..ctor): Maintain the invariant.
4596 * cs-parser.jay: Take advantage of invariant.
4598 Introduce ExplicitBlock
4599 * statement.cs (ExplicitBlock): New.
4600 (ToplevelBlock): Derive from it.
4601 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
4603 (Block.Implicit): Update to changes.
4604 * cs-parser.jay: Update to changes.
4607 * codegen.cs (EmitContext.IsLastStatement): Remove.
4608 * statement.cs (Block.DoEmit): Update to changes.
4610 2007-05-25 Raja R Harinath <rharinath@novell.com>
4612 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
4613 modifying current_block directly.
4615 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
4617 * class.cs: Implemented automatic properties (C# 3.0)
4618 Thanks to Marek for the help.
4620 2007-05-23 Raja R Harinath <rharinath@novell.com>
4622 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
4623 variable as assigned, note also that all its components are
4625 (MyBitVector.SetRange): New. Function to set multiple bits to true.
4627 2007-05-19 Marek Safar <marek.safar@gmail.com>
4629 * anonymous.cs, class.cs: Emit Compiler generated attribute when
4630 member is marked as compiler generated.
4632 * decl.cs (MemberCore): Refactored ModFlags into property.
4634 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
4635 (Check): Check only accessibility modifiers.
4637 2007-05-18 Raja R Harinath <rharinath@novell.com>
4639 Track all assignable slots in one bit array
4640 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
4641 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
4642 logic from VariableMap constructor here. Use the same 'offset'
4643 variable that's later used for computing offsets of local
4645 * flowanalysis.cs (UsageVector.parameters): Remove.
4646 (UsageVector): Update to changes.
4647 (VariableMap): Remove.
4649 Avoid creating ParameterMap in every block
4650 * statement.cs (Block.ParameterMap): Move ...
4651 (ToplevelBlock.ParameterMap): ... here.
4652 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
4654 * flowanalysis.cs (FlowBranching.param_map): Remove.
4655 (FlowBranching.UsageVector): Update to changes.
4656 (FlowBranchingToplevel.CheckOutParameters): Likewise.
4658 * statement.cs (Block.CloneTo): Clone Toplevel field too.
4660 * expression.cs (ParameterReference): Distinguish between block
4661 where parameter was referenced and declared.
4663 2007-05-18 Marek Safar <marek.safar@gmail.com>
4665 * flowanalysis.cs, statement.cs: Put back improved error handling.
4667 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
4671 Imporved object and collection initialization (C# 3.0).
4673 2007-05-15 Marek Safar <marek.safar@gmail.com>
4675 A fix for bug #81380
4676 * expression.cs (Is.DoResolve): Only value types have constant `is'
4679 2007-05-15 Raja R Harinath <rharinath@novell.com>
4681 * statement.cs (ToplevelBlock.child): Remove.
4683 2007-05-15 Raja R Harinath <harinath@gmail.com>
4685 Rationalize ResolveMeta: refactoring
4686 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
4687 out constant handling code into ...
4688 (Block.DoResolveConstants): ... this.
4690 Rationalize ResolveMeta: kill local_map
4691 * statement.cs (Block.local_map, Block.LocalMap): Remove.
4692 (Block.AssignableSlots): New.
4693 (Block.ResolveMeta): Make protected. Don't create a VariableMap
4694 for locals -- move code from VariableMap here. Avoid unnecessary
4696 * flowanalysis.cs (FlowBranching.local_map): Remove.
4697 (FlowBranching..ctor): Use Block.AssignableSlots.
4698 (VariableMap): Remove unused constructors.
4700 2007-05-11 Raja R Harinath <rharinath@novell.com>
4702 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
4704 2007-05-11 Marek Safar <marek.safar@gmail.com>
4706 * typemanager.cs (IsFriendAssembly): Should not be called for building
4709 2007-05-09 Marek Safar <marek.safar@gmail.com>
4711 * literal.cs (NullConstant): Print null in all cases.
4713 * expression.cs (Binary.ResolveOperator): Implemented delegate
4714 comparison based on C# 2.0 changes.
4716 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
4718 This code is contributed under the MIT X11 license
4720 The following enables support for several C# 3.0 language features:
4722 * cs-tokenizer.cs: Added support for the "var" keyword.
4724 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
4725 Added VarExpr class to facilitate type inferencing.
4727 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
4728 to support anonymous types.
4730 * assign.cs: Added support for type inferencing and initialization.
4732 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
4734 * expression.cs: Added implicit array support to ArrayCreation.
4735 Added 5 types and 1 interface:
4737 IInitializable Implementing classes can inject initializing
4738 statements after object instantiation.
4740 Initializer Stores data for object initialization.
4742 AnonymousType An expression for anonymous types.
4744 AnonymousTypeParameter Stores data about an anonymous type's field.
4746 NewInitialize An expression for object initialization.
4748 CollectionInitialize An expression for collection initialization.
4750 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
4753 2007-05-06 Marek Safar <marek.safar@gmail.com>
4755 A fix for bug #81500
4756 * cs-tokenizer.cs: Add special handling for coalescing operator.
4758 2007-05-06 Marek Safar <marek.safar@gmail.com>
4760 A fix for bug #81529
4761 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
4762 its value from base class until it is redefined.
4764 2007-05-02 Raja R Harinath <rharinath@novell.com>
4766 Fix regression in cs0631-3.cs
4767 * cs-parser.jay (operator_declarator): Add opt_attributes to error
4768 fallback. Make error fallback catch more cases.
4770 2007-05-01 Miguel de Icaza <miguel@novell.com>
4772 * cs-parser.jay: Allow parameters in operator declarations to have
4775 2007-04-27 Miguel de Icaza <miguel@novell.com>
4777 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
4780 * lambda.cs (ContextualReturn.Resolve): An expression is valid
4781 inside the ContextualReturn, it does not have to be an
4782 ExpressionStatement.
4784 2007-04-24 Miguel de Icaza <miguel@novell.com>
4786 * lambda.cs (ContextualReturn.Resolve): if the return type is not
4789 2007-04-23 Miguel de Icaza <miguel@novell.com>
4791 * anonymous.cs (AnonymousContainer): split the virtual Resolve
4792 method in two methods: ResolveNoDefine and Resolve.
4794 ResolveNoDefine will stop just after ResolveTopBlock has been
4797 Resolve will then continue by creating a method and issuing the
4798 call to method.Define ().
4800 (AnonymousMethod): Split and implement the new Resolve and
4801 ResolveNoDefine as well.
4803 * lambda.cs (LambdaExpression): Split the anonymous method
4804 resolution code into a separate routine (CoreCompatibilityTest)
4805 from DoCompatibleTest.
4807 (LambdaExpression.TryBuild): New method, this method tries to
4808 build the LambdaExpression with the given set of types to be used
4809 as the types for the various parameters of the lambda expression.
4811 If the compilation succeed with the given types, the infered type
4812 of the Anonymous method is returned, otherwise null is returned.
4814 2007-04-23 Marek Safar <marek.safar@gmail.com>
4816 A fix for bug #81414
4817 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
4819 2007-04-22 Miguel de Icaza <miguel@novell.com>
4821 * cs-tokenizer.cs: Change various identifiers here from the
4822 camelCasing to the recommended Linux-like style for instance
4823 variables from the Coding Guidelines.
4825 2007-04-19 Martin Baulig <martin@ximian.com>
4828 (Convert.ImplicitReferenceConversionCore): Allow conversions from
4829 System.Enum to System.ValueType.
4831 2007-04-13 Martin Baulig <martin@ximian.com>
4833 Rewrote implicit reference conversions. We need to distinguish
4834 between implicit reference conversions (13.1.4) and implicit
4835 boxing conversions (13.1.5).
4837 According to the spec, there's an an implicit conversion
4838 "From a one-dimensional array-type S[] to IList<T> and base
4839 interfaces of this interface, provided there is an implicit
4840 reference conversion from S to T." Note that this does not
4841 include boxing conversions.
4844 (Convert.ImplicitTypeParameterBoxingConversion): New method.
4845 (Convert.ImplicitReferenceConversion): Split into
4846 ImplicitReferenceConversionCore() and
4847 ImplicitBoxingConversionExist().
4848 (Convert.ImplicitReferenceConversionExists): Use the new
4849 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
4851 2007-04-12 Martin Baulig <martin@ximian.com>
4853 * convert.cs (Convert.ImplicitReferenceConversion): Move the
4854 `TypeManager.null_type' checks up to the top of the method.
4856 2007-04-11 Marek Safar <marek.safar@gmail.com>
4858 A fix for bug #81350
4859 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
4862 2007-04-11 Martin Baulig <martin@ximian.com>
4864 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
4865 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
4866 to make this work for generic classes; fixes #79561.
4868 2007-04-11 Martin Baulig <martin@ximian.com>
4870 * expression.cs (As): Add support for nullable types; fixes #79371.
4872 2007-04-11 Martin Baulig <martin@ximian.com>
4874 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
4875 `type.FullName' is null; fixes #80243.
4877 2007-04-11 Martin Baulig <martin@ximian.com>
4879 * expression.cs (Invocation.IsApplicable): Don't modify the method
4880 if type inference succeeded, but the method was not applicable.
4883 2007-04-10 Marek Safar <marek.safar@gmail.com>
4885 A fix for bug #81324
4886 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
4887 internal and external namespaces containers.
4889 2007-04-10 Martin Baulig <martin@ximian.com>
4891 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
4892 TypeManager.DropGenericMethodArguments() so we also call
4893 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
4895 2007-04-10 Martin Baulig <martin@ximian.com>
4897 * iterators.cs (Iterator.CreateIterator): Don't crash if
4898 `method.ReturnType' is null. This happens if something went wrong
4899 while resolving that typ (we already reported an error in this case).
4901 2007-04-10 Martin Baulig <martin@ximian.com>
4903 * expression.cs (New.DoResolve): Don't call CheckComImport() on
4904 generic interfaces; report the CS0144 directly.
4906 2007-04-10 Martin Baulig <martin@ximian.com>
4908 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
4909 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
4911 2007-04-10 Martin Baulig <martin@ximian.com>
4913 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
4915 2007-04-09 Raja R Harinath <rharinath@novell.com>
4918 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
4919 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
4922 * statement.cs (For.Resolve): If resolution fails, use
4925 2007-04-08 Marek Safar <marek.safar@gmail.com>
4927 * anonymous.cs (MakeName): Make faster and zero-based.
4928 (VerifyExplicitParameterCompatibility): Back to mode where generic
4929 parameter is ignored.
4930 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
4932 * class.cs (EmitType): Method can emit another new method.
4934 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
4936 * driver.cs: Updated.
4938 * lambda.cs: Reuse predefined empty parameters.
4940 * parameter.cs: Updated
4942 * support.cs: Implemented InflateTypes.
4944 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
4945 (InitSystemCore): Introduced to isolate 3.0 dependencies.
4947 2007-04-03 Martin Baulig <martin@ximian.com>
4951 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
4952 version of TypeManager.IsOverride() which also works with generic
4955 2007-04-03 Martin Baulig <martin@ximian.com>
4960 (Convert.ExplicitReferenceConversion): We need to cast when
4961 converting from IList<T> to S[].
4963 2007-04-01 Marek Safar <marek.safar@gmail.com>
4965 * decl.cs (FindExtensionMethods): Consider all candidates with same name
4968 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
4970 2007-03-31 Marek Safar <marek.safar@gmail.com>
4972 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
4973 argument and return type inferring.
4975 * codegen.cs (InferReturnType): Flag whether return can be inferred.
4976 (ReturnType): Turned to property.
4978 * statement.cs (Return): Implemented return type inferring.
4980 * support.cs (ReflectionParameters): Use local types if possible.
4982 2007-03-30 Raja R Harinath <rharinath@novell.com>
4984 * flowanalysis.cs (FlowBranching.Reachability): Remove.
4985 (FlowBranching.UsageVector): Update to changes.
4987 Prepare to kill 'Reachability'
4988 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
4989 argument of constructor.
4991 2007-03-29 Raja R Harinath <rharinath@novell.com>
4993 Prepare to kill 'Reachability'
4994 * flowanalysis.cs (UsageVector.is_unreachable): New.
4995 (UsageVector): Update to maintain 'is_unreachable' in parallel to
4996 'reachability', and verify they're consistent.
4999 * expression.cs (New.EmitStatement): Handle type parameters here too.
5001 2007-03-29 Martin Baulig <martin@ximian.com>
5006 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5007 CompilerGeneratedClass.
5008 (ScopeInfo.EmitScopeInstance): Make this protected.
5009 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5010 `ec.CurrentAnonymousMethod.Scope == Scope'.
5012 * statement.cs (Block.ScopeInfo): Make this a property.
5014 2007-03-27 Raja R Harinath <harinath@gmail.com>
5016 Prepare to kill 'Reachability'
5017 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5018 (FlowBranching.UsageVector.Reachability): Remove property.
5019 (FlowBranching.UsageVector.IsUnreachable): New property.
5020 (FlowBranching.UsageVector.ResetBarrier): New.
5021 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5022 * codegen.cs, statement.cs: Update to changes.
5024 2007-03-27 Martin Baulig <martin@ximian.com>
5029 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5032 2007-03-26 Raja R Harinath <rharinath@novell.com>
5034 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5035 instead of TriState. Remove all mention of TriState.
5037 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5038 replaced by a boolean. Add boolean 'is_unreachable' field, check
5039 and maintain invariants.
5041 2007-03-25 Marek Safar <marek.safar@gmail.com>
5043 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5045 2007-03-25 Marek Safar <marek.safar@gmail.com>
5047 * expression.cs: Stop using obsolete 2.0 opcodes.
5049 2007-03-25 Marek Safar <marek.safar@gmail.com>
5051 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5052 one of the latests Martin's fixes.
5054 2007-03-23 Miguel de Icaza <miguel@novell.com>
5056 * expression.cs: On BigEndian systems, swap the bytes, temporary
5057 solution until we get a new bitconverter class.
5059 2007-03-23 Martin Baulig <martin@ximian.com>
5063 * decl.cs (MemberCache.AddMembers): Add generic methods both as
5064 "Method" and "Method`1". Normally, a cache lookup is done on the
5065 "Method" form (ie. without the generic arity), but this one makes
5066 lookups on the full form work as well.
5068 2007-03-22 Raja R Harinath <rharinath@novell.com>
5070 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5073 2007-03-20 Bill Holmes <billholmes54@gmail.com>
5075 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5076 ordered_member_list, to TypeBuilder to store members to be defined
5077 in the order they were parsed in.
5078 - ordered_explicit_member_list contains all properties indexers
5079 and methods that are defined as explicit implementation of an
5080 interface or base class.
5081 - ordered_member_list contains all properties indexers and methods
5082 that are not defined as explicit implementation of an interface
5085 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
5086 functionality in these removed classes has been replaced with
5087 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
5088 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5090 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5091 to CheckForDuplications inside GetMethod and SetMethod Define Method
5092 to handle method property and indexer name conflicts.
5096 All code is contributed under the MIT/X11 license.
5098 2007-03-20 Martin Baulig <martin@ximian.com>
5100 * class.cs (TypeContainer.Interfaces): Removed; they're now
5101 included in `TypeContainer.Types'.
5103 2007-03-20 Martin Baulig <martin@ximian.com>
5105 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
5107 * class.cs (TypeContainer.CreateType): New public method. This is
5108 now called before DefineType() to create the TypeBuilders.
5109 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5110 has already been created by CreateType().
5111 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5112 don't resolve our base classes here; this has been moved into
5113 DefineBaseTypes(). We're now called from CreateType().
5114 (TypeContainer.DefineBaseTypes): New private method; resolve our
5115 base classes here. We're now called from DefineType().
5118 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5119 our types first to create all the TypeBuilders. After that, call
5120 TypeContainer.DefineType() on all the types which'll resolve their
5121 base classes and setup the resolve order.
5123 2007-03-20 Martin Baulig <martin@ximian.com>
5125 * class.cs (TypeContainer.Enums): Removed; they're now included in
5126 `TypeContainer.Types'.
5128 2007-03-20 Martin Baulig <martin@ximian.com>
5131 (TypeContainer.DefineType): Don't call ResolveMembers() here.
5132 (TypeContainer.DoResolveMembers): Call DefineType() on our
5133 `compiler_generated' classes; moved here from DefineNestedTypes().
5136 (RootContext.ResolveTree): Call ResolveMembers() on all
5137 TypeContainer's in the `type_container_resolve_order'.
5139 2007-03-19 Marek Safar <marek.safar@gmail.com>
5141 * class.cs: Use corlib to handle InternalMethodImplAttribute.
5143 2007-03-17 Marek Safar <marek.safar@gmail.com>
5145 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
5146 implementation flags.
5148 2007-03-17 Marek Safar <marek.safar@gmail.com>
5150 * class.cs: More optimizations for type parameters.
5152 2007-03-15 Marek Safar <marek.safar@gmail.com>
5154 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
5156 * ecore.cs, parameter.cs: More common code for both corlibs.
5158 * typemanager.cs (IsGenericMethod): Simplified.
5160 2007-03-15 Raja R Harinath <rharinath@novell.com>
5162 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5164 * statement.cs, iterators.cs, lambda.cs: Update to changes.
5166 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
5167 unconditionally. Simplify explanation.
5168 (Try.Resolve, Using.Resolve): Likewise.
5170 2007-03-15 Martin Baulig <martin@ximian.com>
5174 * decl.cs (DeclSpace): If we're a partial class, use our
5175 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
5177 2007-03-15 Raja R Harinath <rharinath@novell.com>
5179 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5181 (FlowBranching.UsageVector): Update to changes.
5182 (FlowBranching.MergeSiblings): Likewise.
5183 * statement.cs: Likewise.
5185 2007-03-15 Martin Baulig <martin@ximian.com>
5190 (MemberCache): Added a special .ctor for type parameters.
5193 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
5196 2007-03-09 Martin Baulig <martin@ximian.com>
5198 * enum.cs (Enum): Make this a TypeContainer.
5199 (EnumMember): Derive from `Const'.
5202 (Const.DoResolveValue): New protected virtual method; move most of
5203 the functionality of ResolveValue() here so we can override it in
5205 (Const.CreateConstantReference): Make this virtual.
5207 * class.cs (Kind): Add `Kind.Enum'.
5208 (TypeContainer.Emit): Don't emit the enums here; they're already
5209 in the `RootContext.typecontainer_resolve_order'.
5211 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
5212 here; they're already in the `typecontainer_resolve_order'.
5214 * ecore.cs (EnumConstant.ConvertImplicitly): Add
5215 TypeManager.DropGenericTypeArguments().
5218 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
5219 (TypeManager.IsEnumType): Likewise.
5220 (TypeManager.EnumToUnderlying): Likewise.
5221 (TypeManager.IsEqual): Add support for enums.
5223 2007-03-12 Raja R Harinath <rharinath@novell.com>
5225 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
5226 DefaultParameterValueAttribute to be undefined, say if System.dll
5229 2007-03-11 Marek Safar <marek.safar@gmail.com>
5231 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
5234 2007-03-10 Marek Safar <marek.safar@gmail.com>
5236 * class.cs, parameter.cs: Unified parameters verification.
5238 2007-03-08 Martin Baulig <martin@ximian.com>
5240 * cs-parser.jay (constructor_header): Pass the location to the
5241 newly created TopLevelBlock.
5243 2007-03-07 Martin Baulig <martin@ximian.com>
5245 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
5247 2007-03-06 Miguel de Icaza <miguel@novell.com>
5249 * convert.cs (ExplicitReferenceConversionExists): Sync this method
5250 with the changes from David, fixes the build.
5252 2007-03-05 David Mitchell <dmitchell@logos.com>
5254 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
5255 and its base interfaces to a one-dimensional array type S[],
5256 provided there is an implicit or explicit reference conversion
5259 2007-03-03 Marek Safar <marek.safar@gmail.com>
5261 * cs-tokenizer.cs: Implemented basic linq grammar.
5263 * driver.cs: Set linq lang version on demand.
5265 2007-02-26 Marek Safar <marek.safar@gmail.com>
5267 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
5269 2007-02-25 Marek Safar <marek.safar@gmail.com>
5271 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
5274 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
5276 Check property and event extern attributes.
5278 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
5281 2007-02-24 Marek Safar <marek.safar@gmail.com>
5283 A fix for bug #80407
5284 * ecore.cs: Don't report ambiguity error when methods have same parent.
5286 2007-02-23 Marek Safar <marek.safar@gmail.com>
5288 A fix for bug #80878
5289 * class.cs, cs-parser.jay: Event property can host anonymous methods.
5291 2007-02-22 Marek Safar <marek.safar@gmail.com>
5293 * attribute.cs: Enable ExtensionAttribute presence test.
5295 2007-02-22 Marek Safar <marek.safar@gmail.com>
5297 * class.cs: Warn about missing GetHashCode only when Equals is override.
5299 * decl.cs: Check accessibility of type arguments.
5301 * typemanager.cs: Correctly report nullable array.
5303 2007-02-20 Marek Safar <marek.safar@gmail.com>
5305 * class.cs, report.cs: Capture more details when things go wrong.
5307 2007-02-20 Marek Safar <marek.safar@gmail.com>
5309 A fix for bug #80650
5310 * cs-parser.jay: Anonymous container starts at constructor declaration
5311 and not at block beginning because it has to be usable in constructor
5314 * statement.cs: Use context location and not block one for error reporting.
5316 2007-02-18 Marek Safar <marek.safar@gmail.com>
5318 A fix for bug #78712
5319 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
5322 2007-02-18 Marek Safar <marek.safar@gmail.com>
5324 A fix for bug #80493 by Atsushi Enomoto
5325 * cs-parser.jay: Ignore invalid attribute target.
5327 2007-02-18 Marek Safar <marek.safar@gmail.com>
5329 * cs-tokenizer.cs: Ignore '\0' as white space character.
5331 2007-02-17 Miguel de Icaza <miguel@novell.com>
5333 * cs-parser.jay: Add support for lambda expressions to the mcs
5336 * lambda.cs: Only clone when we are probing, not on the final call
5337 (Compatible is the final call).
5339 * statement.cs (CloneContext): Introduce class to provide block
5340 remapping during clone.
5342 All statements Clone themselves now.
5344 (Clone): special handling for blocks, when we clone a block, we
5345 register the block inside this routine, as children of the block
5346 might trigger a lookup.
5348 * expression.cs: Add support for CloneContext in all expressions.
5350 2007-02-17 Marek Safar <marek.safar@gmail.com>
5352 A fix for bug #80493
5353 * statement.cs: Report ambiguous warning when interfaces are not related.
5355 2007-02-15 Marek Safar <marek.safar@gmail.com>
5357 C# 3.0 extension methods.
5359 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
5360 cannot be used directly.
5362 * class.cs (Class.Emit): Emit extension attribute if any class method
5363 is extension method.
5364 (Method.Define): Add basic extension method validation conditions.
5365 (Method.Emit): Emit extension attribute for method.
5367 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
5368 extension method exists. Currently we follow same approach as Microsoft
5369 does, emit even if a method or a class are private but this can change
5372 * cs-parser.jay: Add handling of `this' keyword in method parameters
5375 * decl.cs (DeclSpace.IsStaticClass): New property.
5376 (MemberCache.FindExtensionMethods): Looks for extension methods with
5377 defined name and extension type.
5379 * doc.cs: Updated after OverloadResolve changes.
5381 * driver.cs: Add new soft reference to System.Core.dll.
5383 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
5384 (ExtensionMethodGroupExpr): Represents group of extension methods.
5386 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
5387 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
5388 to MethodGroupExpr and made non-static for easier customization.
5389 (Invocation.DoResolve): Add extension method lookup when no standard
5391 (MemberAccess.DoResolve): Try extension methods if no member exists.
5393 * modifiers.cs: Add METHOD_EXTENSION modifier.
5395 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
5396 as well as candidate extension type.
5397 (ComputeNamespaces): When assembly constains extension methods registers
5399 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
5400 extension method lookup.
5401 (Namespace.LookupExtensionMethod): Looks for extension method in this
5403 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
5404 find a method which matches name and extensionType.
5406 * parameter.cs (Parameter): Add This modifer.
5407 (HasExtensionMethodModifier): New property.
5408 (Resolve): Add extension parameter check.
5409 (ModFlags): turned to property to exclude this modifier as it is not real
5411 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
5413 * support.cs (ParameterData): Add ExtensionMethodType.
5414 (ReflectionParameters): Implemented ExtensionMethodType interface property.
5416 * typemanager.cs: Add type and ctor extension attribute type.
5418 2007-02-15 Miguel de Icaza <miguel@novell.com>
5420 * report.cs (DisableErrors, EnableErrors): used to prevent error
5421 output when we are "trying" to compile various methods with
5424 * ecore.cs (Expression): Add Clone method that calls the virtual
5425 CloneTo method. The current CloneTo method in Expression throws
5426 an exception so we can track down all the places where this must
5427 be implemented (not using abstract, because that would be a lot of
5428 up-front-work before we can start testing the implementation
5431 Important: we only need Clone capabilities for expressions created
5432 by the parser, as the expressions we will be cloning are
5433 expressions in the pre-resolved state. This vastly simplifies
5436 (SimpleName): Add CloneTo that does nothing.
5437 (EmptyCast): Add CloneTo.
5439 * expression.cs (Binary): Implement CloneTo.
5440 (Invocation.IsApplicable): Store the current ec in
5441 EmitContext.TempEc and restore it on return. This is used so we
5442 do not have to sprinkle hundres of methods with an extra
5443 EmitContext, we know that the only user is the lambda expression
5444 ImplicitConversionExists code.
5446 (Argument): Add Cloning capabilities.
5447 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
5448 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
5449 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
5450 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
5451 IndexerAccess): Add Clone capability.
5453 (LocalVariableReference, This): TODO: needs cloned Block mapping.
5455 (Argument): Add cloning capability.
5457 * assign.cs (Assign): Implement CloneTo.
5459 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
5461 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
5462 version by calling Convert with the EmitContext (that we are
5463 currently storing in ec, this is not great, but will do for now,
5464 to avoid passing EmitContext parameters to hundreds of functions
5465 that do not need them now).
5467 (SetExpression): Remove, it is not needed.
5469 (ContextualReturn): Implement CloneTo.
5471 * statement.cs (Statement): Implement cloning infrastructure,
5472 similar to expressions.
5474 (Block): Partial implementation of Clone for statements.
5476 (Return): Implement clone.
5478 * constant.cs (Constant.CloneTo): New method, does nothing.
5480 * codegen.cs (TempEc): Add a static EmitContext as a temporary
5481 solution, until we decide how to exactly do this.
5483 2007-02-14 Marek Safar <marek.safar@gmail.com>
5485 A fix for bug #80493
5486 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
5487 a property is override we need to use second accessor.
5489 2007-02-13 Marek Safar <marek.safar@gmail.com>
5491 A fix for bug #80418
5492 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
5495 2007-02-13 Marek Safar <marek.safar@gmail.com>
5497 Another fix for bug #80749
5498 * pending.cs: Abstract class has priority over interfaces.
5500 2007-02-13 Marek Safar <marek.safar@gmail.com>
5502 Another fix for bug #80749
5503 * pending.cs: Abstract class has priority over interfaces.
5505 2007-02-13 Marek Safar <marek.safar@gmail.com>
5507 Another fix for bug #80749
5508 * pending.cs: Abstract class has priority over interfaces.
5510 2007-02-13 Marek Safar <marek.safar@gmail.com>
5512 Another fix for bug #80749
5513 * pending.cs: Abstract class has priority over interfaces.
5515 2007-02-13 Marek Safar <marek.safar@gmail.com>
5517 * class.cs Better error message.
5519 * driver.cs: Add shorter versions of -optimize option.
5521 2007-02-13 Martin Baulig <martin@ximian.com>
5523 * class.cs (Constructor.Emit): Check the return value of
5524 ec.ResolveTopBlock() and return on error.
5526 2007-02-13 Raja R Harinath <rharinath@novell.com>
5528 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
5529 message to fix error message regression.
5531 2007-02-12 Marek Safar <marek.safar@gmail.com>
5533 * delegate.cs: Delegate creation expression cannot be of Nullable type.
5535 2007-02-12 Marek Safar <marek.safar@gmail.com>
5537 A fix for bug #80749
5538 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
5539 its parent container.
5541 * class.cs (DefineFieldInitializers): Each initializer can has different
5544 * const.cs: Updated.
5546 2007-02-11 Miguel de Icaza <miguel@novell.com>
5548 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
5549 now all the heavy lifting to check that embedded statements or
5550 expressions have the right form is done in the ContextualReturn.
5552 (ContextualReturn): New class.
5554 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
5555 method that can be invoked to report 201, so we do not replicate
5558 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
5560 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
5561 treating tabs as spaces.
5563 2007-02-09 Marek Safar <marek.safar@gmail.com>
5565 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
5566 * assign.cs: Use full implicit conversion for right side check.
5568 2007-02-09 Marek Safar <marek.safar@gmail.com>
5570 * statement.cs (Switch): Switch over boolean type is not standardized.
5572 2007-02-08 Marek Safar <marek.safar@gmail.com>
5574 A fix for bug #80755
5575 * decl.cs (FindBaseEvent): Don't use method cache for events.
5577 2007-02-07 Marek Safar <marek.safar@gmail.com>
5579 * cs-parser.jay: Better syntax error handling.
5581 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
5582 instead of underlying type value.
5584 2007-02-06 Marek Safar <marek.safar@gmail.com>
5586 * driver.cs: Check define identifier before is registered.
5588 * namespace.cs: Use existing error message.
5590 * report.cs: New warning.
5592 2007-02-06 Marek Safar <marek.safar@gmail.com>
5594 A fix for bug #80742
5595 * expression.cs: Delegate Invoke method can be called directly.
5597 2007-02-06 Marek Safar <marek.safar@gmail.com>
5599 A fix for bug #80676
5600 * class.cs (IsEntryPoint): The Main method can have params modifier.
5602 2007-02-04 Miguel de Icaza <miguel@novell.com>
5604 * parameter.cs (Parameter, Parameters): Add Clone method.
5606 * anonymous.cs (Compatible): Turn method into virtual method, so
5607 LambdaExpression can implement a different behavior.
5609 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
5610 out the basic checking here, so it can be used by
5613 * lambda.cs: Introduce "Compatible" function that will do the
5616 2007-02-02 Marek Safar <marek.safar@gmail.com>
5618 * attribute.cs: Unified one error message.
5620 * class.cs (Class): Use type attributes and not properties to test static
5622 (IsEntryPoint): Don's pass local variable.
5624 * convert.cs: Removed duplicate check.
5626 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
5628 * driver.cs: Don't crash when soft reference does not exist.
5630 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
5631 (UsingEntry): Removed redundant allocation.
5633 * parameter.cs: Add fast path for type parameters.
5635 * support.cs: Don't allocate attribute when it's not used.
5637 2007-01-30 Miguel de Icaza <miguel@novell.com>
5640 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
5641 this into a virtual method, so we can override it in LambdaExpression.
5643 * driver.cs: Improve diagnostics in case of failure.
5645 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
5646 write a function that is slightly more complex and that parses:
5648 type identifier [, type identifier]* )
5650 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
5653 (canEmpty ? i >= 0 : i > 0)
5655 2007-01-30 Raja R Harinath <rharinath@novell.com>
5657 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
5658 exception on possibly valid code.
5660 2007-01-29 Raja R Harinath <rharinath@novell.com>
5662 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
5664 (parse_opt_type_arguments): Remove. It's almost the same as
5666 (parse_namespace_or_typename): Use parse_less_than.
5668 2007-01-28 Miguel de Icaza <miguel@novell.com>
5670 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
5671 this bug took a few hours to find, because the state saved and
5672 restored by PushPosition and PopPosition was ignoring the state of
5673 parse_generic_less_than.
5675 I can also now remove the handling of OP_LT and OP_GT, this solves
5678 * cs-tokenizer.cs: store the location for the ARROW token, we use
5681 (PushPosition, PopPosition): save/restore also `current_token',
5682 restore `parse_generic_less_than' (was missing).
5684 (parse_opt_type_arguments): use parse_type, not
5685 parse_namespace_or_typename to parse types.
5687 * lambda.cs: Empty new file, will eventually have the lambda
5688 expression implementation.
5690 * lambda.test: used to test the internal tokenizer.
5692 * report.cs (FeatureIsNotISO1): Rename from
5693 FeatureIsNotStandardized, because it was about the language level
5694 (1 vs 2) it was not about standarization.
5696 (FeatureRequiresLINQ): New.
5698 * support.cs (SeekableStreamReader): Only require that the reader
5699 is a TextReader, not a StreamReader, so we can plug StringReader.
5701 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
5702 given position in the input stream the following tokens can be
5703 parsed as a type followed by an identifier.
5705 (is_punct): after a '(' if parse_type_and_parameter returns true,
5706 then return a special token OPEN_PARENS_LAMBDA which is used to
5707 avoid reduce/reduce errors in the grammar for the
5708 lambda_expression rules.
5710 (parse_type): implement a type parser inside the
5711 tokenizer, the parser only returns true or false depending on
5712 whether the input at a given position can be parsed as a type.
5714 (peek_token): new method used during type parsing.
5716 2007-01-28 Raja R Harinath <rharinath@novell.com>
5719 * anonymous.cs (ScopeInfo.InflateParameters): New.
5720 (AnonymousContainer.Resolve): Use it to redirect types of
5721 delegate parameters.
5723 2007-01-27 Raja R Harinath <rharinath@novell.com>
5726 * expression.cs (Error_InvalidArguments): Don't use two different
5727 messages for CS1503. Use ExtraInformation and
5728 SymbolRelatedToPreviousError instead.
5731 * decl.cs (DeclSpace.initialize_type_params): Don't access
5732 'type_params' of a partial class directly.
5734 2007-01-26 Miguel de Icaza <miguel@novell.com>
5736 * constant.cs: Removed a handful of out-of-range checks that were
5739 2007-01-25 Marek Safar <marek.safar@gmail.com>
5741 * expression.cs (CheckUselessComparison): Add additional check for char
5744 * namespace.cs: Fixed typo.
5746 2007-01-23 Miguel de Icaza <miguel@novell.com>
5748 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
5749 gone, instead we inline the test, preventing the needless casts to
5750 longs, ulongs and doubles for the parameters, avoiding calls to
5751 methods that overchecked stuff, and instead inlined things
5754 2007-01-20 Marek Safar <marek.safar@gmail.com>
5756 * cs-parser.jay: Better parameter error handling.
5758 2007-01-17 Marek Safar <marek.safar@gmail.com>
5760 A fix for bug #80368, #80522
5761 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
5762 whether array initializer contains constants only.
5763 (ArrayCreation.Emit): Use better formula to decide when
5764 are array initializers for static initialization.
5765 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
5766 have to emit even constants otherwise they are pre-initialized.
5768 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
5769 Raja R Harinath <rharinath@novell.com>
5771 Fix emit order of 'get' vs. 'set'.
5772 * support.cs (Accessors): New.
5773 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
5774 Note the order in which accessors are declared in the source.
5775 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
5776 Refactored from Property.Define and Indexer.Define.
5777 (PropertyBase.DefineAccessors): New helper that calls the above in
5778 appropriate order as noted by the parser.
5779 (Property.Define, Indexer.Define): Update to changes.
5780 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
5782 2007-01-17 Raja R Harinath <rharinath@novell.com>
5784 Fix cs0029-6.cs and gcs0029-2.cs (regression)
5785 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
5786 there's an implicit conversion from the current type to the target
5787 type before converting the underlying constant.
5789 2007-01-16 Marek Safar <marek.safar@gmail.com>
5791 * const.cs (ResolveValue): Updated after constant conversion was made more
5794 * constant.cs (GetAttributableValue): constant to object conversion is
5795 used for attributes only.
5796 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
5797 constant conversions.
5798 (LongConstant.ConvertImplicitly): Ditto.
5800 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
5801 (ImplicitConversionStandard): Handle constant conversion as extra step.
5802 It solves the issue when constant conversion was called indirectly like
5803 inside array initializer and constant folding was skipped.
5805 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
5808 * statement.cs(ImplicitConversionStandard): Updated after constant
5809 conversion was made more generic.
5811 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
5813 * expression.cs (As.DoResolve): Use GenericConstraints instead of
5814 Constraints, solves the problem where the compiler incorrectly
5815 reported that a type parameter was not constrained to a class (Bug
5818 2007-01-14 Marek Habersack <grendello@gmail.com>
5820 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
5822 2007-01-14 Marek Safar <marek.safar@gmail.com>
5824 A fix for bug #80368
5825 * assign.cs (FieldInitializer): New class implements field
5826 initializer statement.
5828 * attribute.cs: Update after FieldMember rename.
5830 * class.cs (PropertyBasedMember): New common class for property based
5832 (InterfaceMemberBase): New base class for all members which can be used as
5833 an interface members.
5834 (MethodCore): Moved really common code to InterfaceMemberBase.
5835 (Method.Define): Equal and GetHasCode detection is relevant for methods
5837 (MethodData.Define): Don't assume that public event implements an
5838 interface automatically.
5839 (MethodData.DefineMethodBuilder): Issue an error even if only extern
5841 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
5842 (FieldMember): Merged with FieldBase.
5843 (EventProperty.AEventPropertyAccessor): New specialization to check whether
5844 event extern modifier can be used.
5845 (EventField.EventFieldAccessor): Moved event field specific code here.
5846 (Event.AllowedModifiers): Even event can be extern.
5847 (Event.FindOutBaseMethod): New override specific to events.
5848 (Indexer.parameters): Reintroduce parameters because base class holds
5849 only properties common data.
5850 (Indexer.CheckForDuplications): Indexers are threated as methods so we
5851 need do extra parameters check.
5853 * const.cs: Update after FieldMember rename.
5855 * decl.cs (MemberCache.FindBaseEvent): New method.
5857 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
5858 to reflect that indexer is now derived from PropertyBased.
5860 * ecore.cs (GetMemberType): Made public.
5861 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
5864 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
5866 * typemanager.cs (CSharpSignature): Correctly print event accessors.
5867 (RegisterEvent): Removed.
5868 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
5869 (GetPrivateFieldOfEvent): Renamed to GetEventField.
5871 2007-01-11 Raja R Harinath <rharinath@novell.com>
5874 * statement.cs (CollectionForeach.TryType): Prefer generic
5875 GetEnumerator over non-generic variant. Fix code to follow comments.
5877 2007-01-09 Raja R Harinath <rharinath@novell.com>
5880 * support.cs (ReflectionParameter): Don't use an invalid index on
5881 the generic parameter data.
5883 2007-01-08 Miguel de Icaza <miguel@novell.com>
5885 * driver.cs: Just add a tiny bit of infrastructure.
5887 2007-01-02 Marek Safar <marek.safar@gmail.com>
5889 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
5890 where field type is struct from current assembly.
5892 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
5895 2007-01-02 Marek Safar <marek.safar@gmail.com>
5897 A fix for bug #80381
5898 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
5901 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
5903 (Namespace.LookupType): Always use core types from corlib when speficied.
5905 * report.cs: A new warning.
5907 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
5908 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
5909 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
5911 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
5912 (InitCoreTypes): Set expression type of object_type and value_type
5913 immediately after lookup.
5915 2007-01-01 Miguel de Icaza <miguel@novell.com>
5917 * cs-tokenizer.cs: Accept Pc class characters (Connector
5918 Punctuation) as valid identifiers. Fixes #78259
5920 * expression.cs (Invocation.DoResolve): Moved the check for the
5921 use of `this' for doing method calls to the Invocation resolution
5922 step, after overload resolution has taken place instead of doing
5923 the check at the low-level `This.DoResolve' level.
5925 The `This.DoResolve'(appens before overload resolution, so it has
5926 no way of knowing if the method that will be called will be
5927 instace or static, triggering an erroneous report for cs0188 (Bug
5930 We now do the check for instance method invocations after we know
5931 what method will be called.
5933 (This.CheckThisUsage): Move the actual use of this structure
5934 checking into its own method and expose it.
5936 * Everywhere that called Error_ValueCannotBeConverted: pass a new
5939 Exceptions: Null.ConvertImplicitly,
5940 Constant.ImplicitConversionRequired as there are too many call
5941 sites for passing the ec.
5943 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
5944 EmitContext, if the value is null, then we do not try to provide
5945 the extra information from the error (If a userdefined conversion
5946 exists, as UserDefinedConversion requires a non null-EmitContext).
5950 2006-12-30 Raja R Harinath <rharinath@novell.com>
5952 * flowanalysis.cs (MyBitVector): Document some invariants.
5953 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
5954 introduced below, and add a couple of others,
5956 2006-12-30 Marek Safar <marek.safar@gmail.com>
5958 * attribute.cs (GetMethodObsoleteAttribute): Uses new
5959 GetPropertyFromAccessor and GetEventFromAccessor.
5961 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
5962 overrides non-obsolete one.
5963 (Indexer.Define): Error message has been moved to the parser.
5965 * cs-parser.jay: Better syntax errors handling.
5967 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
5968 when an invocation has no arguments.
5970 * ecore.cs: Removed not used caching.
5972 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
5975 * report.cs: Add a new warning.
5977 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
5979 * typemanager.cs (enumeration_type): Removed.
5980 (CSharpSignature): Reuses IsSpecialMethod.
5981 (IsEqual): Hack for MS BCL.
5982 (GetPropertyFromAccessor): New method.
5983 (GetEventFromAccessor): New method.
5984 (IsSpecialMethod): Fixed to handle more cases.
5986 2006-12-30 Marek Safar <marek.safar@gmail.com>
5988 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
5989 Made white spaces array static.
5991 * ecore.cs (RemoveGenericArity): Optimized.
5993 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
5995 (MyBitVector.initialize_vector): Simplified.
5997 2006-12-22 Miguel de Icaza <miguel@novell.com>
5999 * ecore.cs: Am not entirely happy with this hack, but it seems to
6000 address the issue in 80257 (a small test case for
6003 I set the MethodGroupExpr.Type to an internal compiler type
6004 (itself in this case) to force the resolution to take place. Why
6005 it does not take place with a null is beyond me.
6007 2006-12-20 Marek Safar <marek.safar@gmail.com>
6009 A fix for bug #80288
6010 * expression.cs (ResolveOperator): Consider user defined conversion for
6011 logical and operator too.
6012 (EmitBranchable): Optimization for logical and when full constant folding
6013 could not be applied but one operand is constant.
6015 2006-12-19 Marek Safar <marek.safar@gmail.com>
6017 * class.cs (GetClassBases): Write 5 times every day, will never use
6018 FullName for error reporting.
6020 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6022 2006-12-19 Martin Baulig <martin@ximian.com>
6024 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6025 the symbol file info here.
6027 2006-12-18 Marek Safar <marek.safar@gmail.com>
6029 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6030 of `elseif' is taking then following sections are not taking.
6031 Fixes an issue reported on mono mailing list.
6033 2006-12-18 Marek Safar <marek.safar@gmail.com>
6035 A fix for bug #80300
6036 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6037 a caller is not taking.
6039 2006-12-18 Raja R Harinath <rharinath@novell.com>
6041 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6042 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6043 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6044 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6045 * class.cs: Update to changes.
6047 2006-12-17 Marek Safar <marek.safar@gmail.com>
6049 A fix for bug #79934
6050 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6053 * class.cs (ResolveMembers): Register an iterator in current container and
6056 2006-12-16 Raja R Harinath <rharinath@novell.com>
6059 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6060 satisfy a params annotated parameter.
6062 2006-12-16 Marek Safar <marek.safar@gmail.com>
6064 A fix for bug #77014
6065 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6066 paramters correctly and not rely on hacks in Parameters class.
6067 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6069 (Invocation.VerifyArgumentsCompat): Ditto.
6070 (Invocation.EmitArguments): Changed to correctly emit params arguments at
6073 * parameter.cs (HasParams): Don't assume that params is the last one.
6075 * support.cs (ReflectionParameters.ctor): Look for params attribute
6077 (ReflectionParameters.ParameterType): Removed hack when we returned last
6078 parameter for out of range parameters.
6079 (ParameterName, ParameterModifier): Ditto.
6081 2006-12-14 Marek Safar <marek.safar@gmail.com>
6083 A fix for bug #79987
6084 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6085 when assembly is not CLS compliant but type is. I have no idea why is this
6088 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6090 2006-12-13 Miguel de Icaza <miguel@novell.com>
6092 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6093 in struct constructors, they are basically no-ops.
6095 2006-12-12 Marek Safar <marek.safar@gmail.com>
6097 * cs-tokenizer.cs (Position): Save preprocessor status too.
6099 2006-12-12 Marek Safar <marek.safar@gmail.com>
6101 A fix for bug #77794
6102 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6104 2006-12-12 Marek Safar <marek.safar@gmail.com>
6106 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6108 (pp_expr): Report error for an invalid expression.
6109 (handle_preprocessing_directive): Simplified; add more error checking.
6111 2006-12-11 Marek Safar <marek.safar@gmail.com>
6113 A fix for bug #74939
6114 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6115 directives handling.
6117 2006-12-10 Marek Safar <marek.safar@gmail.com>
6119 A fix for bugs #80093, and #75984
6120 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6121 logic, it seems to me as it worked before "by coincidence".
6122 (xtoken): Simplified to use reworked handle_preprocessing_directive.
6123 (cleanup): Enabled endif check.
6125 2006-12-09 Marek Safar <marek.safar@gmail.com>
6127 A fix for bug #80162
6128 * statement.cs (CollectionForeach.TryType): Generics and non-generics
6129 enumerators are never ambiguous.
6131 2006-12-08 Raja R Harinath <rharinath@novell.com>
6134 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
6136 2006-12-06 Marek Safar <marek.safar@gmail.com>
6138 A fix for bug #80144
6139 * class.cs (EventProperty.Define): Explicit implementation means
6140 that an even is used.
6142 2006-12-06 Marek Safar <marek.safar@gmail.com>
6144 Fixes the operators implementation (part II)
6146 * cfold.cs (DoConstantNumericPromotions): Renamed to
6147 DoBinaryNumericPromotions and simplified.
6148 (BinaryFold): Couple of conversion fixes; simplified.
6150 * constant.cs, ecore.cs, literal.cs
6151 (ToType): Renamed to ConvertImplicitly.
6152 (Reduce): Renamed to ConvertExplicitly.
6154 * class.cs, convert.cs: Updated.
6156 * expression.cs: TryReduce doesn't throw an exception.
6158 2006-12-01 Marek Safar <marek.safar@gmail.com>
6160 A fix for bug #80108
6161 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
6164 2006-11-30 Marek Safar <marek.safar@gmail.com>
6166 Fixes unary operators implementation (part I)
6169 * cfold.cs (Error_CompileTimeOverflow): Made internal
6171 * const.cs (IConstant): Changed to use reference to constant and
6172 not constant itself.
6173 Updated IConstant implementations.
6175 * constant.cs (CreateConstant): New factory method.
6176 Updated IConstant implementation.
6178 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
6180 * ecore.cs: Updated to use CreateConstantReference.
6182 * enum.cs: Reflects IConstant changes.
6184 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
6186 * literal.cs (NullConstant): Change to be independently usable.
6188 2006-11-29 Martin Baulig <martin@ximian.com>
6190 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
6191 we need to emit the scope initializer before calling the base .ctor.
6193 * anonymous.cs: Merged back from the new anonymous methods branch.
6194 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
6196 * expression.cs (ParameterReference.DoResolveBase): Create a
6197 "normal" ScopeInfo when capturing parameters rather than using the
6198 root scope; this makes things work with anonymous methods having
6202 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
6204 2006-11-22 Marek Safar <marek.safar@gmail.com>
6206 A fix for bug #79987
6207 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
6208 check to a base class.
6209 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
6210 only when assembly has missing attribute.
6211 * report.cs: Update.
6213 2006-11-21 Marek Safar <marek.safar@gmail.com>
6215 * cs-tokenizer.cs: Merged with gmcs version.
6217 2006-11-20 Marek Safar <marek.safar@gmail.com>
6220 * cs-parser.jay: Better error message when partial keyword is misplaced.
6222 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
6224 A fix for bug #79810
6225 report.cs: CS1058 only applies to 2.0 profile (gmcs).
6226 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
6227 a RuntimeWrappedException by default.
6229 2006-11-18 Marek Safar <marek.safar@gmail.com>
6231 A fix for bug #79843
6232 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
6234 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
6236 2006-11-18 Marek Safar <marek.safar@gmail.com>
6238 * driver.cs, namespace.cs: Uses faster IndexOf version.
6240 2006-11-17 Marek Safar <marek.safar@gmail.com>
6242 A fix for bug #79941
6243 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
6245 (Operator.Define): Implicit/Explicit operator of same type is duplicate
6246 even if internal name is different.
6247 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
6248 (UserDefinedConversion): Simplified as the operators cannot be internal.
6249 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
6251 (MethodLookup): Replaced EmitContext with parentType.
6252 * expression.cs: Updated.
6254 2006-11-09 Raja R Harinath <rharinath@novell.com>
6256 * driver.cs (BadAssembly): Handle all the ugliness of
6257 DefineDynamicAssembly.
6259 2006-11-08 Raja R Harinath <rharinath@novell.com>
6261 Address parts of #58244 -- most of what's left is in the runtime
6262 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
6263 CS1509 error checks, and handle them for all assembly loads, not
6264 just the first invocation.
6265 (LoadModule): Likewise. Move handling of 'adder_method' ...
6266 * codegen.cs (AssemblyClass.AddModule): ... here.
6268 2006-11-02 Marek Safar <marek.safar@gmail.com>
6270 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
6271 IEnumerable<T> is ambiguous.
6273 2006-10-31 Marek Safar <marek.safar@gmail.com>
6275 A fix for bug #67689
6276 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
6277 GetEnumerator is ambiguous.
6279 * report.cs: Add new warning.
6281 2006-10-29 Marek Safar <marek.safar@gmail.com>
6283 A fix for bug #78602
6284 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6285 to protected member can be nested type.
6287 2006-10-28 Marek Safar <marek.safar@gmail.com>
6289 A fix for bug #78965
6290 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6291 to protected member must derive from current type.
6293 2006-10-27 Marek Safar <marek.safar@gmail.com>
6295 assign.cs: Reuses error method.
6297 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
6298 instead of type for constants.
6299 (Expression.Error_ValueAssignment): Common error method.
6301 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
6304 2006-10-27 Marek Safar <marek.safar@gmail.com>
6306 A fix for bug #79081
6307 * expression.cs (MemberAccess.DoResolve): Check nested type
6310 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
6312 * doc.cs : nested delegates were not handled. Fixed bug #79754.
6314 2006-10-26 Marek Safar <marek.safar@gmail.com>
6316 A fix for bug #76591
6317 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
6319 2006-10-26 Marek Safar <marek.safar@gmail.com>
6321 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
6322 type forwarder of the same type multiple times.
6324 2006-10-26 Raja R Harinath <rharinath@novell.com>
6327 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
6328 instance as an rvalue, even when we later resolve as an lvalue.
6330 2006-10-25 Martin Baulig <martin@ximian.com>
6332 * anonymous.cs: Fix #79673.
6334 2006-10-24 Marek Safar <marek.safar@seznam.cz>
6336 A fix for bug #79666
6337 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
6338 ignored when is optimized (= default value) as its value is already set.
6340 2006-10-23 Marek Safar <marek.safar@seznam.cz>
6342 A fix for bug #79724
6343 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
6344 TypeContainer for type lookup.
6346 2006-10-23 Marek Safar <marek.safar@seznam.cz>
6348 A fix for bug #79231
6349 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
6350 * expression.cs (OverloadResolve): Always convert type name for
6352 (ResolveNamespaceOrType): Don't confuse a nested type with any
6355 2006-10-18 Martin Baulig <martin@ximian.com>
6357 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
6359 2006-10-17 Miguel de Icaza <miguel@novell.com>
6361 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
6362 an int32, but requesting an int64 from the conversion
6364 2006-10-12 Martin Baulig <martin@ximian.com>
6367 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
6369 2006-10-12 Martin Baulig <martin@ximian.com>
6372 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
6374 2006-10-11 Miguel de Icaza <miguel@novell.com>
6376 * convert.cs: Remove broken code: I was doing the "Existance"
6377 tests for Implicit conversions.
6379 2006-10-10 Miguel de Icaza <miguel@novell.com>
6381 * convert.cs: Added one missing case in
6382 ImplicitStandardConversionExists uint64 to intptr.
6386 * typemanager.cs (uintptr_type): another core known type.
6388 * ecore.cs (OperatorCast): routine used to do cast operations that
6389 depend on op_Explicit. We could change some of the Decimal
6390 conversions to use this.
6392 This one has a probe mechanism that checks both types for an op_
6393 which it coudl be used to eliminate two classes: CastToDecimal
6394 and CastFromDecimal.
6396 * convert.cs: Implement the conversions documented in #59800
6398 2006-10-10 Martin Baulig <martin@ximian.com>
6400 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
6401 before RootScope.ResolveMembers().
6403 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
6404 `CurrentType' if appropriate.
6406 2006-10-09 Marek Safar <marek.safar@seznam.cz>
6408 A fix for bug #78568
6409 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
6410 when contains binary operators.
6411 * cs-parser.jay: Updated.
6413 2006-10-09 Martin Baulig <martin@ximian.com>
6416 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
6417 moved that into Define() and also do the other type parameter
6418 checks there. Fixes #79094. Added gtest-292.cs.
6421 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
6422 since that doesn't include type parameters; don't use `Ldelema'
6423 for type parameters. Fixes #78980. Added gtest-293.cs.
6425 2006-10-08 Marek Safar <marek.safar@seznam.cz>
6428 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
6429 conversion is allowed.
6431 2006-10-06 Marek Safar <marek.safar@seznam.cz>
6433 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
6434 error reporting when no error occurs.
6436 2006-10-06 Marek Safar <marek.safar@seznam.cz>
6438 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
6441 2006-10-06 Raja R Harinath <rharinath@novell.com>
6444 * class.cs (DefineTypeBuilder): Check circular dependencies before
6445 setting the parent of the TypeBuilder.
6446 (CheckRecursiveDefinition): Don't use 'BaseType', since
6447 it may not be valid until after DefineTypeBuilder. Use
6448 'base_type' instead.
6450 2006-10-04 Martin Baulig <martin@ximian.com>
6452 Merged the Anonymous Methods patch.
6454 * anonymous.cs, iterators.cs: The new anonymous methods code.
6456 * statement.cs (Variable): New public abstract class.
6457 (LocalInfo.Variable): New public property.
6458 (LocalInfo.ResolveVariable): New public method.
6459 (Block.Flags): Add `IsIterator'.
6460 (Block.AddVariable): Improved the CS0136 check.
6461 (Block.AnonymousChildren): New public property.
6462 (Block.AddAnonymousChild): New public method.
6463 (ToplevelBlock): Update to use the new anonymous method framework.
6464 (ToplevelBlock.ctor): `container' is now a `Block' and not a
6465 `ToplevelBlock'; this is required to correctly implement the
6467 (Fixed, Using): Use `TemporaryVariable' instead of directly
6468 creating the `LocalBuilder'.
6470 * parameter.cs (Parameter.ResolveVariable): New public method.
6471 (Parameters.ResolveVariable): Likewise.
6473 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
6475 * class.cs (TypeContainer): Replaced the `iterators' list and
6476 corresponding methods with a list of `CompilerGeneratedClass'es.
6477 (TypeContainer.ResolveMembers): New public method.
6478 (Method): `IIteratorContainer' has been replaced by
6481 * expression.cs (VariableReference): New public abstract base
6482 class for `LocalVariableReference', `ParameterReference' and
6485 * codegen.cs (EmitContext): Removed `capture_context',
6486 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
6487 (EmitContext.EmitThis): Removed.
6489 * cs-parser.jay: Replace `iterator_container' with
6492 2006-10-04 Martin Baulig <martin@ximian.com>
6494 * generic.cs (GenericMethod): Don't make this abstract.
6495 (Constraints.Clone): Added dummy implementation.
6497 2006-10-04 Raja R Harinath <harinath@gmail.com>
6500 * namespace.cs (LookForAnyGenericType): Avoid nullref on
6501 'declspaces'. Avoid allocating arrays willy-nilly.
6504 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
6505 cases out of the switch.
6507 2006-09-28 Marek Safar <marek.safar@seznam.cz>
6509 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
6510 message when non-generic type is used with the type arguments.
6511 * expression.cs: Updated.
6513 2006-09-28 Raja R Harinath <rharinath@novell.com>
6516 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
6517 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6518 Change semantics slightly. Don't insist on having only one
6519 temporary EmptyExpression -- just throttle the creation of new ones.
6522 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
6523 non-interfaces too. If no methods are found, don't try to create
6526 2006-09-28 Marek Safar <marek.safar@seznam.cz>
6528 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
6531 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
6532 us produce better error message.
6534 2006-09-27 Marek Safar <marek.safar@seznam.cz>
6536 * expression.cs (Binary.ResolveOperator): Warn about a side effect
6537 of the `|' operator.
6539 * report.cs: A new warning added.
6541 2006-09-27 Martin Baulig <martin@ximian.com>
6543 * generic.cs (GenericMethod): Don't make this abstract.
6545 2006-09-27 Martin Baulig <martin@ximian.com>
6548 (InternalErrorException): Added overloaded ctor taking a params array.
6550 2006-09-26 Marek Safar <marek.safar@seznam.cz>
6552 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
6553 Fixed the cases when same error was reported twice.
6555 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
6556 now report symbol information.
6558 2006-09-25 Martin Baulig <martin@ximian.com>
6560 * class.cs: Completely unified with the gmcs version.
6562 2006-09-25 Martin Baulig <martin@ximian.com>
6564 * typemanager.cs (TypeManager.IsNullableType): New public function.
6565 (TypeManager.IsNullableTypeOf): Likewise.
6566 (TypeManager.IsNullableValueType): Likewise.
6568 * class.cs (MethodCore): Added the `GenericMethod' argument from
6569 gmcs and also unified all classes derived from `MethodCore' with gmcs.
6571 2006-09-24 Raja R Harinath <harinath@gmail.com>
6573 * convert.cs: Unify with gmcs version.
6575 2006-09-24 Marek Safar <marek.safar@seznam.cz>
6577 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
6578 verify them as well.
6580 * report.cs: New warning.
6582 2006-09-24 Marek Safar <marek.safar@seznam.cz>
6584 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
6585 for anonymous block with out argument.
6587 2006-09-24 Marek Safar <marek.safar@seznam.cz>
6589 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
6590 not used private events only.
6592 2006-09-23 Marek Safar <marek.safar@seznam.cz>
6594 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
6596 * const.cs (Const.Define): Check for constant type.
6597 (Const.IsConstantTypeValid): Looks for valid constant types.
6599 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
6601 * ecore.cs (EmptyConstantCast): New common class for all constant based
6604 * expression.cs (Is.DoResolve): Handle null constant especially.
6605 (New.DoResolve): Check for new void().
6606 (MemberAccess.DoResolve): Cope with all kind of nulls.
6608 * literal.cs (NullConstant): Uses EmptyConstantCast.
6609 (NullDefault): Based on EmptyConstantCast.
6610 (NullLiteral): Uses EmptyConstantCast.
6612 * statement.cs (Block.ResolveMeta): Check for constant type.
6614 2006-09-22 Martin Baulig <martin@ximian.com>
6616 * delegate.cs, attribute.cs: Merged with the gmcs versions.
6618 2006-09-22 Raja R Harinath <rharinath@novell.com>
6620 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
6624 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
6625 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
6628 2006-09-22 Martin Baulig <martin@ximian.com>
6630 * ecore.cs: Merged with the gmcs version.
6632 * generic.cs (ConstructedType): New dummy class.
6633 (TypeArguments): Don't make this abstract.
6636 (TypeManager.IsGenericTypeDefinition): New method.
6637 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
6639 2006-09-22 Raja R Harinath <rharinath@novell.com>
6641 * expression.cs (ComposedCast): Check for arrays of TypedReference
6642 before creating the type, not after.
6644 2006-09-21 Marek Safar <marek.safar@seznam.cz>
6646 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
6647 after ToType change.
6649 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
6650 when constant must be implicitly convertible.
6652 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
6654 * ecore.cs (NullCast): Derives from NullConstant.
6656 * expression.cs (Is.DoResolve): Removed useless variables.
6657 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
6658 (New.Constantify): Add enum support.
6659 (MemberAccess.DoResolve): Add warning when accessing null constant or
6662 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
6665 * literal.cs (NullConstant): New abstract class with common
6666 functionality for all null specializations.
6667 (NullDefault): Represents default(X) when result can be
6669 (NullLiteral): Updated.
6671 * report.cs: Add new warning.
6673 2006-09-21 Martin Baulig <martin@ximian.com>
6675 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
6677 2006-09-21 Martin Baulig <martin@ximian.com>
6679 * generic.cs (GenericConstraints): New dummy class.
6680 (Constraints): Likewise.
6681 (TypeParameter): Likewise.
6682 (TypeParameterName): Likewise.
6683 (GenericMethod): Likewise.
6685 * typemanager.cs (TypeManager.GetGenericArguments): New method.
6687 * decl.cs: Merged with the gmcs version.
6689 2006-09-21 Raja R Harinath <rharinath@novell.com>
6691 * generic.cs (TypeParameter): Implement IMemberContainer.
6692 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
6694 * rootcontext.cs: Unify with gmcs version.
6696 * report.cs: Unify with gmcs version.
6697 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
6698 from gmcs/generics.cs.
6699 * generics.cs (TypeParameter): New dummy class.
6701 * support.cs: Unify with gmcs version.
6703 2006-09-20 Raja R Harinath <rharinath@novell.com>
6705 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
6706 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
6708 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
6709 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
6710 * mcs.exe.sources: Add generic.cs.
6712 * codegen.cs: Unify with gmcs version.
6714 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
6715 (EmitContext): Add GenericDeclContainer implementation.
6716 * decl.cs (MemberCore, DeclSpace): Likewise.
6717 * namespace.cs: Remove #ifdef GMCS_SOURCE.
6719 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
6720 MCS TypeManager has a corresponding dummy method.
6722 2006-09-19 Martin Baulig <martin@ximian.com>
6724 * expression.cs: Completely merged with the gmcs version.
6726 2006-09-19 Martin Baulig <martin@ximian.com>
6728 * expression.cs (Invocation): Merged with the gmcs version.
6729 (ArrayAccess.GetStoreOpcode): Likewise.
6731 2006-09-19 Martin Baulig <martin@ximian.com>
6734 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
6735 (TypeManager.IsGenericMethodDefinition): Likewise.
6737 2006-09-19 Martin Baulig <martin@ximian.com>
6740 (TypeManager.IsEqual): Moved the gmcs implementation here.
6741 (TypeManager.DropGenericTypeArguments): Likewise.
6742 (TypeManager.DropGenericMethodArguments): Likewise.
6743 (TypeManager.GetTypeArguments): Moved here from gmcs.
6744 (TypeManager.HasGenericArguments): Likewise.
6746 2006-09-19 Martin Baulig <martin@ximian.com>
6748 * expression.cs (Binary): Merged with the gmcs version.
6750 2006-09-19 Martin Baulig <martin@ximian.com>
6752 * expression.cs (Probe, As, Is): Merged with the gmcs version.
6754 2006-09-19 Martin Baulig <martin@ximian.com>
6756 * typemanager.cs: Merged with the gmcs version.
6758 2006-09-16 Raja R Harinath <rharinath@novell.com>
6760 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
6761 * driver.cs: Likewise.
6763 2006-09-16 Marek Safar <marek.safar@seznam.cz>
6766 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
6767 only if parent type is class.
6768 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
6771 2006-09-15 Marek Safar <marek.safar@seznam.cz>
6774 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
6776 * typemanager.cs(CSharpName): Converts NullType to null.
6778 2006-09-15 Martin Baulig <martin@ximian.com>
6781 (TypeManager.GetMethodName): Added mcs implementation.
6782 (TypeManager.IsEqual): Likewise.
6785 (SimpleName.RemoveGenericArity): Added dummy implementation.
6787 * pending.cs: Merged with the gmcs version.
6789 2006-09-15 Martin Baulig <martin@ximian.com>
6791 * statement.cs: Merge with the gmcs version.
6793 2006-09-15 Martin Baulig <martin@ximian.com>
6795 * statement.cs (Switch): Merge with the gmcs implementation
6796 (without nullables), which is newer.
6798 2006-09-15 Martin Baulig <martin@ximian.com>
6800 * statement.cs (Block.Variables): Make this public.
6801 (ToplevelBlock.Parameters): Make this a property.
6802 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
6804 2006-09-15 Martin Baulig <martin@ximian.com>
6806 * namespace.cs: Merge with the gmcs version.
6808 2006-09-15 Martin Baulig <martin@ximian.com>
6810 * decl.cs (MemberName): Minor code cleanups.
6812 2006-09-15 Martin Baulig <martin@ximian.com>
6814 * parameter.cs: Merge with the gmcs version.
6816 2006-09-15 Martin Baulig <martin@ximian.com>
6818 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
6819 and an error in mcs.
6821 2006-09-15 Martin Baulig <martin@ximian.com>
6823 * flowanalysis.cs: Merged from GMCS; added the generics code into
6824 a `GMCS_SOURCE' conditional so we can share this file.
6826 2006-09-08 Martin Baulig <martin@ximian.com>
6828 * typemanager.cs (TypeManager.interlocked_type): New public field.
6829 (TypeManager.int_interlocked_compare-exchange): New public field.
6830 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
6831 enumerator types here and call InitGenericCoreTypes().
6832 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
6833 after calling InitEnumUnderlyingTypes().
6836 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
6837 `classes_second_stage'.
6839 2006-09-14 Marek Safar <marek.safar@seznam.cz>
6841 * assign.cs, ecore.cs, expression.cs: Share error message text.
6842 * class.cs (FieldMember.Define): Check for varible of static type.
6843 * driver.cs (LoadAssembly): Uses error output for errors.
6844 * statement.cs: Updated.
6846 2006-09-08 Marek Safar <marek.safar@seznam.cz>
6848 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
6851 2006-09-07 Martin Baulig <martin@ximian.com>
6854 (MainDriver): Revert r62663 from Marek; see #70506 for details.
6856 2006-08-29 Miguel de Icaza <miguel@novell.com>
6858 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
6860 2006-08-17 Miguel de Icaza <miguel@novell.com>
6862 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
6863 #52019 and #79064, the use of the \uXXXX sequence in source code
6864 to represent unicode characters.
6866 2006-08-15 Marek Safar <marek.safar@seznam.cz>
6868 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
6870 * class.cs, ecore.cs, statement.cs: Merged to one error message.
6872 2006-08-13 Miguel de Icaza <miguel@novell.com>
6874 * assign.cs: Catch attempts to assign to a method groups in += and
6877 2006-08-13 Marek Safar <marek.safar@seznam.cz>
6880 * cs-parser.jay: Don't destroy current array type by typeof of array's.
6882 2006-08-12 Marek Safar <marek.safar@seznam.cz>
6884 * class.cs (Method.Define): Issue a warning when generic method looks like
6886 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
6889 2006-08-09 Marek Safar <marek.safar@seznam.cz>
6891 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
6893 * decl.cs (MemberCache.FindMembers): When container is interface we need to
6894 search all base interfaces as a member can be ambiguous.
6895 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
6896 Constructor member type filter.
6897 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
6898 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
6899 reporting for returned memberinfos.
6900 * report.cs: Updated.
6901 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
6902 version to work on all runtimes.
6903 (TypeManager.RealMemberLookup): Removed members filtering.
6905 2006-08-08 Raja R Harinath <rharinath@novell.com>
6907 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
6908 (PropertyExpr.EmitAssign): Likewise.
6909 * expression.cs (Indirection.EmitAssign): Likewise.
6910 (LocalVariableReference.EmitAssign): Likewise.
6911 (ParameterReference.EmitAssign): Likewise.
6912 (Invocation.EmitArguments): Likewise.
6913 (ArrayAccess.EmitAssign): Likewise.
6914 (IndexerAccess.EmitAssign): Likewise.
6915 (This.EmitAssign): Likewise.
6916 (ConditionalLogicalOperator.Emit): Likewise.
6919 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
6920 instead of ArrayList. If the hashtable has a LocalBuilder, don't
6921 leave it in after returning it.
6922 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
6924 2006-08-06 Marek Safar <marek.safar@seznam.cz>
6926 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
6929 2006-08-03 Raja R Harinath <rharinath@novell.com>
6931 Fix cs0146-3.cs and cs0146-4.cs.
6932 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
6933 enclosing types don't depend on the current type.
6935 2006-08-02 Raja R Harinath <rharinath@novell.com>
6938 * class.cs (TypeContainer.DoDefineMembers): Use
6939 FindBaseMemberWithSameName on Parent, since we're interested in
6940 whether we hide inherited members or not.
6941 (FindBaseMemberWithSameName): Make slightly more robust.
6943 Fix the non-generic testcase from #77396
6944 * decl.cs (DeclSpace.DeclContainer): Remove override.
6946 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
6947 declspaces for doppelgangers too.
6948 (UsingEntry): Implement IResolveContext.
6949 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
6950 'this' as the resolve context.
6951 (LocalAliasEntry): Likewise.
6953 Implement parts of #77403
6954 * roottypes.cs (RootDeclSpace): New. Used to represent the
6955 toplevel declaration space. Each namespace declaration introduces
6956 a "partial" root declaretion space.
6957 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
6958 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
6959 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
6960 from 'current_namespace.SlaveDeclSpace'.
6961 (namespace_declaration): Likewise.
6962 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
6963 check. It can't happen now.
6964 * decl.cs (DeclSpace.LookupType): Likewise.
6965 * driver.cs (MainDriver): Sanity check.
6967 2006-08-01 Raja R Harinath <rharinath@novell.com>
6969 * decl.cs (DeclSpace.FindNestedType): Remove.
6970 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
6971 LookupTypeContainer to get the container of the nested type.
6972 * class.cs (TypeContainer.FindNestedType): Make non-override.
6974 2006-07-31 Raja R Harinath <rharinath@novell.com>
6976 * decl.cs (DeclSpace.PartialContainer): Move field from ...
6977 * class.cs (TypeContainer.PartialContainer): ... here.
6978 (TypeContainer.AddBasesForPart): New helper.
6979 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
6981 * cs-parser.jay (current_class): Convert to DeclSpace.
6982 (struct_declaration, interface_declaration, class_declaration):
6983 Use AddBasesForPart instead of .Bases directly.
6984 * const.cs, iterators.cs: Update to changes.
6986 2006-07-28 Raja R Harinath <rharinath@novell.com>
6988 * class.cs (TypeContainer.AddMemberType): Rename from
6990 (TypeContainer.AddMember): Rename from AddToMemberContainer.
6991 (AddTypeContainer): New. Combine AddClassOrStruct and
6993 (AddPartial): Update. Add 'is_partial' argument.
6994 * roottypes.cs: Update to changes.
6995 * cs-parser.jay (push_current_class): New helper for handling
6996 current_container and current_class.
6997 (struct_declaration, interface_declaration, class_declaration):
7000 2006-07-26 Raja R Harinath <rharinath@novell.com>
7002 * roottypes.cs: Rename from tree.cs.
7004 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7005 * tree.cs (Tree, ITreeDump): Remove types.
7006 * rootcontext.cs (tree, Tree): Remove fields.
7007 (root, ToplevelTypes): New.
7008 * *.cs: Update to rename.
7010 * tree.cs (Tree.RecordDecl): Remove.
7011 (RootTypes.AddToTypeContainer): Record the toplevel type in its
7013 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7015 2006-07-23 Raja R Harinath <harinath@gmail.com>
7017 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7018 DoFlowAnalysis and OmitStructFlowAnalysis here.
7019 (ec.With): Rename from WithUnsafe and generalize.
7020 (ec.WithCheckState): Remove. All users can be handled by 'With'.
7021 (ec.WithFlowAnalyis): New.
7022 * ecore.cs, expression.cs, statement.cs: Update.
7024 2006-07-22 Raja R Harinath <harinath@gmail.com>
7026 * statement.cs (Block.ResolveMeta): Simplify slightly.
7028 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
7029 multiple boolean fields. Convert InUnsafe, constant_check_state,
7030 check_state to flags.
7031 (CheckState, ConstantCheckState): Update.
7032 (InUnsafe): New read-only property.
7033 (FlagsHandle): Rename from CheckStateHandle and convert to handle
7035 (WithUnsafe): New helper similar to WithCheckState.
7036 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7037 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7039 2006-07-21 Raja R Harinath <rharinath@novell.com>
7041 Make comparisons use the same IL irrespective of whether they're
7042 in a 'checked' or 'unchecked' context: one of the issues in #78899
7043 * codegen.cs (EmitContext.CheckState): Make read-only property.
7044 (EmitContext.ConstantCheckState): Likewise.
7045 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7046 helper that implement a save/restore stack for CheckState
7047 values. This is the only way to change check-state.
7048 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7049 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7050 (CheckedExpr.EmitBranchable): New forwarding method.
7051 (UnCheckedExpr): Likewise.
7052 * statement.cs (Block.ResolveMeta): Use WithCheckState.
7053 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7054 (Checked.Resolve, checked.DoEmit): Likewise.
7056 2006-07-20 Miguel de Icaza <miguel@novell.com>
7058 * anonymous.cs: Cache the resolved anonymous delegate, and return
7059 this so that the ResolveTopBlock is only triggered once, not
7062 Currently we trigger ResolvetopBlock twice due to a first pass of
7063 argument check compatibility, and a second pass that does the
7066 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7068 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7070 * rootcontext.cs (Reset): Add helper_classes.
7072 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7075 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7078 2006-07-13 Miguel de Icaza <miguel@novell.com>
7080 * statement.cs (Lock): Handle expressions of type
7081 TypeManager.null_type specially. Fixes #78770
7083 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7085 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7088 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7090 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7091 for accessors as well.
7092 * ecore.cs (EventExpr): Add AccessorTable.
7094 2006-07-01 Marek Safar <marek.safar@seznam.cz>
7097 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7098 for CS0122 where appropriate.
7099 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7101 (Filter): Assembly can be null in the case of top level attributes.
7103 2006-06-25 Marek Safar <marek.safar@seznam.cz>
7107 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7108 is done at global level.
7110 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7112 A fix for #77002, Implemented TypeForwarder support.
7114 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7115 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7116 * typemanager.cs (): Add type_forwarder_attr_type.
7118 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7120 * report.cs: Add CS0469 warning.
7122 2006-06-21 Martin Baulig <martin@ximian.com>
7124 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7125 the `try'-block, so we also report CS0016 etc. there.
7127 2006-06-21 Martin Baulig <martin@ximian.com>
7130 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
7132 2006-06-21 Martin Baulig <martin@ximian.com>
7134 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
7135 also report CS1686 for parameters.
7137 2006-06-21 Martin Baulig <martin@ximian.com>
7139 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
7140 instead of an error if the value is not implicitly convertible to
7141 the switch types; fixes #77964.
7143 2006-06-21 Raja R Harinath <rharinath@novell.com>
7146 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
7147 FieldBuilder is null.
7150 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
7151 'left' and 'right' before error-checking.
7153 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
7155 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
7157 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
7158 (FieldExpr.DoResolve): likewise.
7159 (PropertyExpr.InstanceResolve): likewise.
7160 (EventExpr.InstanceResolve): likewise.
7162 2006-06-04 Marek Safar <marek.safar@seznam.cz>
7164 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
7165 attribute applicable tests for attribute argument.
7167 2006-06-02 Raja R Harinath <rharinath@novell.com>
7170 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
7171 (Binary.OverloadResolve_PredefinedIntegral): New.
7172 (Binary.OverloadResolve_PredefinedFloating): New.
7173 (Binary.OverloadResolve_PredefinedString): New.
7174 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
7175 Follow the standard more closely, and treat numeric promotions in
7176 terms of overload resolution.
7177 (Binary.CheckShiftArguments): Simplify.
7179 2006-06-01 Raja R Harinath <rharinath@novell.com>
7181 * flowanalysis.cs (MyBitVector): Simplify representation.
7182 (MyBitVector.Clone): Avoid allocating BitArray.
7183 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
7184 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
7185 (*): Update. Change all references to MyBitVector.And and
7186 MyBitVector.Or to &= and |=.
7188 2006-05-29 Raja R Harinath <rharinath@novell.com>
7191 * cs-parser.jay (formal_parameter_list): Extend the pattern below
7192 to param arguments too.
7194 2006-05-26 Miguel de Icaza <miguel@novell.com>
7196 * cs-parser.jay: Catch another parsing form for arglist being
7197 followed by other arguments. Fixes #78313.
7199 2006-05-24 Raja R Harinath <rharinath@novell.com>
7201 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
7202 checking of out parameters to ...
7203 (FlowBranchingToplevel.Merge): ... here.
7204 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
7205 set, propagate the origin upward, and only complain if there was
7207 (FlowBranchingException.AddContinueOrigin): Likewise.
7208 (FlowBranchingException.AddReturnOrigin): Likewise.
7209 (FlowBranchingException.AddGotoOrigin): Likewise.
7211 2006-05-23 Raja R Harinath <rharinath@novell.com>
7213 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
7214 unreachable, skip it.
7215 (FlowBranchingException.Merge): Always propagate jumps, even if
7216 the finally block renders subsequent code unreachable.
7218 2006-05-18 Raja R Harinath <rharinath@novell.com>
7221 * statement.cs (Goto.Resolve): Move responsibility for resolving
7222 'goto' to FlowBranching.AddGotoOrigin.
7223 (Goto.SetResolvedTarget): New. Callback to set the
7224 LabeledStatement that's the target of the goto.
7225 (Goto.DoEmit): Use Leave instead of Br when crossing an
7226 unwind-protect boundary.
7227 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
7228 LookupLabel and adjust to new semantics.
7229 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
7230 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
7231 Goto.SetResolvedTarget to update target.
7232 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
7233 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
7234 AddBreakOrigin & co. Delay propagation until ...
7235 (FlowBranchingException.Merge): ... this.
7237 * statement.cs (Block.Resolve): Always depend on flow-branching to
7238 determine unreachability. Kill workaround that originally emitted
7239 only one statement after an "unreachable" label (see infloop in
7242 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
7243 This is still "wrong", but anything better would probably need a
7244 multi-pass algorithm.
7245 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
7246 usage vector. Force current usage vector to be reachable, to
7247 optimistically signify backward jumps.
7248 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
7250 (FlowBranchingLabeled.Merge): New. If no backward jump was
7251 detected, return the original salted-away usage vector instead,
7252 updated with appropriate changes. Print unreachable warning if
7254 * statement.cs (Block.Resolve): Don't print unreachable warning on
7255 a labeled statement.
7257 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
7259 * driver.cs: Pass filename without path to AssemblyBuilder's
7260 AddResourceFile. Fixes bug #78407.
7262 2006-05-17 Raja R Harinath <rharinath@novell.com>
7264 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
7265 * flowanalysis.cs (FlowBranchingLabeled): ... here.
7266 (FlowBranching.MergeChild): Overwrite
7267 reachability information from Labeled branchings too.
7269 2006-05-16 Raja R Harinath <rharinath@novell.com>
7271 * statement.cs (Goto.Resolve): Merge jump origins here ...
7272 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
7274 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
7275 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
7276 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
7277 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
7279 * statement.cs (Goto.Resolve): ... not here.
7280 (Goto.Emit): Remove CS1632 check.
7282 2006-05-14 Marek Safar <marek.safar@seznam.cz>
7284 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
7287 2006-05-11 Raja R Harinath <rharinath@novell.com>
7289 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
7290 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
7291 (FlowBranchingException.Label): Likewise.
7293 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
7295 (MyBitVector.Or): Use it to avoid losing information (Count).
7296 (FlowBranching.MergeOrigins): Likewise.
7298 * flowanalysis.cs (UsageVector.IsDirty): Remove.
7299 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
7300 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
7301 (UsageVector.ToString): Simplify.
7302 (UsageVector.MergeSiblings): Move here from ...
7303 (FlowBranching.Merge): ... here.
7304 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
7307 2006-05-10 Raja R Harinath <rharinath@novell.com>
7309 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
7310 null bitvector is treated as all-true.
7312 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
7313 (MyBitVector): Rationalize invariants. 'vector != null' implies
7314 that we have our own copy of the bitvector. Otherwise,
7315 'InheritsFrom == null' implies all inherited bits are true.
7317 2006-05-09 Marek Safar <marek.safar@seznam.cz>
7319 * statement.cs (LocalInfo): Add IsConstant.
7320 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
7321 local variable for constants.
7323 2006-05-09 Raja R Harinath <rharinath@novell.com>
7325 * flowanalysis.cs (MyBitVector.Empty): New.
7326 (MyBitVector): Don't allow InheritedFrom to be null.
7327 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
7328 (UsageVector, FlowBranching): Update to changes.
7330 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
7331 recursion. The 'Parent == null' condition isn't sufficient for
7333 (FlowBranching.AddBreakOrigin): Likewise.
7334 (FlowBranching.AddContinueOrigin): Likewise.
7335 (FlowBranching.AddReturnOrigin): Likewise.
7336 (FlowBranching.StealFinallyClauses): Likewise.
7337 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
7338 (FlowBranching.CheckOutParameters): Likewise.
7339 (FlowBranchingToplevel): Terminate all the above recursions here.
7340 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
7341 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
7343 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
7345 (FlowBranchingToplevel): New. Empty for now.
7346 (FlowBranching.MergeTopBlock): Update.
7347 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
7348 branching for the anonymous delegate.
7349 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
7351 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
7352 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
7353 information at the start of the merge. Reorganize.
7355 2006-05-07 Marek Safar <marek.safar@seznam.cz>
7357 * class.cs (MethodData.Define): Method cannot implement interface accessor.
7359 2006-05-07 Marek Safar <marek.safar@seznam.cz>
7361 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
7362 to newly introduced ctor.
7364 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
7365 message to one place.
7366 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
7369 2006-05-07 Marek Safar <marek.safar@seznam.cz>
7371 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
7373 * ecore.cs (Expression.ResolveAsConstant): Updated.
7375 * statement.cs (ResolveMeta): Updated.
7377 2006-05-06 Marek Safar <marek.safar@seznam.cz>
7379 * cs-parser.jay: __arglist cannot be used in initializer.
7381 2006-05-06 Marek Safar <marek.safar@seznam.cz>
7384 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
7387 2006-05-05 Raja R Harinath <rharinath@novell.com>
7389 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
7390 (LabeledStatement): Add 'name' parameter.
7391 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
7392 (Block.AddLabel): Update to changes.
7393 * cs-parser.jay (labeled_statement): Likewise.
7395 * flowanalysis.cs (BranchingType.Labeled): New.
7396 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
7397 (FlowBranchingLabeled): New. Does nothing for now, but will
7398 eventually handle 'goto' flows.
7399 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
7400 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
7401 that's terminated ...
7402 (Block.Resolve): ... here.
7404 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
7405 (UsageVector.MergeFinallyOrigins): Likewise.
7406 (FlowBranching.InTryOrCatch): Likewise.
7407 (FlowBranching.AddFinallyVector): Likewise.
7408 (FlowBranchingException): Update to changes.
7411 * statement.cs (Return.Resolve): Move error checking to ...
7412 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
7413 (FlowBranchingException): Handle return origins like break and
7415 (FlowBranching.UsageVector.CheckOutParameters): Remove.
7417 2006-05-04 Marek Safar <marek.safar@seznam.cz>
7420 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
7423 2006-05-04 Marek Safar <marek.safar@seznam.cz>
7426 * class.cs (MethodData.Define): Do public accessor check only when method
7427 implements an interface.
7429 2006-05-04 Raja R Harinath <rharinath@novell.com>
7431 Remove special handling of 'break'
7432 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
7433 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
7434 (UsageVector.Break): Remove.
7435 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
7437 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
7439 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
7440 UsageVector.Breaks (). Don't set NeedsReturnLabel.
7442 2006-05-03 Marek Safar <marek.safar@seznam.cz>
7445 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
7446 be the interface member.
7448 2006-05-03 Marek Safar <marek.safar@seznam.cz>
7451 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
7452 for emitting small (int) values.
7454 2006-05-03 Raja R Harinath <rharinath@novell.com>
7457 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
7458 control-flow passes through the 'finally' after merging-in all the
7459 control-flows from 'try' and the 'catch' clauses.
7461 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
7462 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
7463 always true at the only non-recursive entry point.
7464 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
7465 FlowBranchingBreakable.
7466 (FlowBranchingLoop): Remove.
7467 * statement.cs (Return.DoResolve): Update to changes.
7470 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
7471 (FlowBranching.CreateBranching): Handle it: create a
7472 FlowBranchingContinuable.
7473 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
7474 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
7475 except that it handles the 'continue' command.
7476 (FlowBranching.UsageVector.MergeOrigins): Rename from
7478 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
7479 except that it overrides AddContinueOrigin.
7480 (FlowBranchingException): Override AddContinueOrigin, similar to
7482 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
7483 Create a new branching around the embedded statement.
7484 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
7485 control flow after the embedded statement.
7486 (Continue.Resolve): Move all error checking to AddContinueOrigin.
7488 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
7489 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
7490 FlowBranchingBreakable.
7491 (FlowBranchingSwitch): Remove.
7494 * statement.cs (Break.Resolve): Simplify. Move responsibility for
7495 error reporting to ...
7496 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
7497 Rename from 'AddBreakVector'. Add new location argument. Return
7498 a bool indicating whether the 'break' crosses an unwind-protect.
7499 (FlowBranchingException.AddBreakOrigin): Add.
7500 (FlowBranchingException.Merge): Propagate 'break's to surrounding
7501 flowbranching after updating with the effects of the 'finally'
7503 (FlowBranchingBreakable): New common base class for
7504 FlowBranchingLoop and FlowBranchingSwitch.
7506 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
7508 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
7510 2006-05-02 Raja R Harinath <rharinath@novell.com>
7512 * statement.cs (Do.Resolve): If the loop is infinite, set the
7514 (While.Resolve, For.Resolve): Set a barrier after the embedded
7515 statement. There's no direct control flow that goes from the end
7516 of the embedded statement to the end of the loop.
7517 * flowanalysis.cs (FlowBranching.Infinite): Remove.
7518 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
7519 above ensure that the reachability is correctly computed.
7521 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
7522 (UsageVector.MergeBreakOrigins): If the current path is
7523 unreachable, treat it as if all parameters/locals are initialized.
7524 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
7525 infinite loops before merging-in break origins.
7527 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
7528 (Reachability.Reachable): Split part into ...
7529 (Reachability.Unreachable): ... this. Simplify.
7530 (Reachability.IsUnreachable): Use 'Unreachable' instead.
7532 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
7533 (Reachability.SetThrowsSometimes): Likewise.
7534 (FlowBranchingBlock.MergeTopBlock): Don't compare against
7535 TriState.Always, use corresponding property.
7536 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
7537 (Block.Resolve): Likewise. Remove some redundant checks.
7539 2006-05-02 Raja R Harinath <harinath@gmail.com>
7541 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
7542 (Reachability.Meet): Don't bother checking AlwaysThrows --
7543 barrier is always set.
7544 (FlowBranchingBlock.Merge): Likewise.
7546 2006-05-01 Raja R Harinath <harinath@gmail.com>
7548 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
7549 checks for unreachable.
7551 2006-05-01 Marek Safar <marek.safar@seznam.cz>
7554 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
7556 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
7557 whether field is really assigned.
7559 2006-04-30 Raja R Harinath <harinath@gmail.com>
7561 * flowanalysis.cs (Reachability): Make 4-argument constructor
7563 (Reachability.Meet): Rename from 'And'. Remove static variant.
7564 (Reachability.Always): Rename from the highly misleading
7565 'Reachability.Never'.
7566 (FlowBranching.Merge): Update to changes. Mark an impossible
7567 situation with a 'throw'.
7568 (*): Update to changes.
7570 2006-04-29 Raja R Harinath <harinath@gmail.com>
7572 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
7574 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
7575 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
7576 (*): Update to changes.
7577 * statement.cs: Update to changes.
7579 2006-04-28 Marek Safar <marek.safar@seznam.cz>
7582 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
7584 2006-04-28 Raja R Harinath <harinath@gmail.com>
7586 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
7589 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
7590 argument to two arguments: an usage-vector and a bool. Move call
7591 to FlowBranching.Merge () ...
7592 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
7594 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
7595 handling of loop and switch reachability to ...
7596 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
7598 2006-04-27 Raja R Harinath <harinath@gmail.com>
7600 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
7601 handling to FlowBranchingLoop.InLoop.
7602 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
7604 2006-04-26 Marek Safar <marek.safar@seznam.cz>
7607 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
7608 anonymous method is allowed from AnonymousContainer here.
7610 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
7612 2006-04-24 Raja R Harinath <rharinath@novell.com>
7615 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
7617 2006-04-23 Marek Safar <marek.safar@seznam.cz>
7620 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
7621 (DoubleConstant.Reduce): Ditto.
7623 2006-04-23 Raja R Harinath <rharinath@novell.com>
7625 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
7626 Remove 'lvalue_right_side' argument. Move parts to ...
7627 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
7628 (LocalVariable.DoResolveLValue): ... these.
7630 2006-04-21 Raja R Harinath <rharinath@novell.com>
7633 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
7634 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
7635 (LocalVariableReference.DoResolveBase): Use it to implement new
7637 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
7638 (Argument.Resolve): Simplify. Move CS1510 check ...
7639 * ecore.cs (Expression.ResolveLValue): ... here.
7640 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
7641 (PropertyExpr.DoResolveLValue): Likewise.
7642 (FieldExpr.Report_AssignToReadonly): Likewise.
7643 (FieldExpr.DoResolve): Add 'out_access' argument. Use
7644 LValueMemberAccess or LValueMemberOutAccess on instance depending
7646 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
7647 DoResolve as appropriate.
7649 2006-04-20 Raja R Harinath <rharinath@novell.com>
7652 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
7653 implicit conversions on 'out' and 'ref' arguments.
7655 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
7656 improve clarity. Remove dead code.
7659 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
7660 (Catch.Resolve): Resolve VarBlock if it exists.
7662 2006-04-19 Miguel de Icaza <miguel@novell.com>
7664 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
7665 twice, this was some residual code, the enumerator was emitted
7666 properly in the two branche of if later.
7668 2006-04-19 Raja R Harinath <rharinath@novell.com>
7670 * expression.cs (Cast.ResolveLValue): Remove. The result of a
7671 cast is never an lvalue.
7672 (Cast.DoResolve, Cast.ResolveRest): Combine.
7673 (Argument.Emit): Simplify slightly. Move 'Expr is
7674 IMemoryLocation' check ...
7675 (Argument.Resolve): ... here.
7676 (Argument.Error_LValueRequired): Remove. Inline into only user.
7678 Simplifications. Fix cs0191-2.cs
7679 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
7680 CS1649 and CS1651 to ...
7681 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
7682 the actual selection of the error code and message to a lookup
7683 table. Add a dummy return value to simplify callsites.
7684 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
7685 readonly fields of other instances of the same type. Move CS0197
7687 * expression.cs (Argument.Resolve): ... here. Simplify code.
7688 Ensure that ec.InRefOutArgumentResolving is only set during LValue
7689 resolution of an out or ref argument. The code simplification
7690 above uses this invariant.
7692 2006-04-18 Raja R Harinath <rharinath@novell.com>
7694 Possibly fix #77752. Fix cs1690-[4-7].cs.
7695 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
7696 CheckMarshallByRefAccess. Drop parameter.
7697 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
7699 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
7701 * report.cs (AllWarnings): Add CS1690.
7702 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
7704 (LocalVariableReference.DoResolveBase): Update.
7706 2006-04-09 Marek Safar <marek.safar@seznam.cz>
7708 * class.cs (MethodOrOperator): Moved common parts from method class.
7709 detect obsolete attributes.
7710 (Method.Define): Simplified as it reuses code from base.
7711 (Constructor.ValidAttributeTargets): Fixed issue found during
7713 (Destructor.ValidAttributeTargets): Fixed issue found during
7715 (Operator): Finished refactoring set off by #78020. Operator class is now
7716 ordinary method class.
7718 * anonymous.cs: Updated.
7720 * decl.cs (DeclSpace): Add IsGeneric
7722 2006-04-09 Marek Safar <marek.safar@seznam.cz>
7724 * class.cs (Constructor.Emit): Don't emit the attributes twice.
7726 2006-04-09 Marek Safar <marek.safar@seznam.cz>
7728 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
7729 detect obsolete attributes.
7730 (Method.CreateEmitContext): Moved to MethodOrOperator.
7732 2006-04-09 Marek Safar <marek.safar@seznam.cz>
7735 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
7736 customized exception to make crash detection easier.
7737 (MethodOrOperator): Started to work on new base class for methods and
7739 (Method): Derives from MethodOrOperator.
7740 (Constructor.Emit): Emits its own attributes.
7741 (AbstractPropertyEventMethod.Emit): Ditto.
7742 (Operator): Derives from MethodOrOperator, will refactor fully in extra
7744 (Operator.Emit): It's temporary more tricky than should be.
7746 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
7748 * report.cs (InternalErrorException): Add ctor with inner exception.
7750 2006-04-08 Marek Safar <marek.safar@seznam.cz>
7753 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
7756 2006-04-07 Marek Safar <marek.safar@seznam.cz>
7759 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
7762 2006-04-06 Marek Safar <marek.safar@seznam.cz>
7764 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
7765 attribute is present and Guid not.
7766 (Interface.ApplyAttributeBuilder): Ditto.
7768 * attribute.cs: Add error message.
7770 2006-04-06 Marek Safar <marek.safar@seznam.cz>
7774 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
7775 sources (it's composite) so hold them in extra array as they are used in
7776 Emit phase only. It worked in the previous versions by mistake.
7777 (Attribute.Emit): Emit attribute for more owners when exist.
7779 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
7780 it has now different behaviour.
7782 2006-04-04 Marek Safar <marek.safar@seznam.cz>
7784 * constant.cs (Constant.IsDefaultInitializer): New method.
7786 * class.cs: Updated.
7788 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
7789 re-initialize default values. It saves KBs almost for every assembly.
7790 Thanks Zoltan for the idea.
7791 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
7792 (ArrayCreation.DoResolve): Resolve only once.
7793 (ArrayCreation.Emit): Emit static initializer only when it is faster.
7794 (ArrayCreation.GetAttributableValue): Cope with optimized values.
7796 2006-04-03 Zoltan Varga <vargaz@gmail.com>
7798 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
7801 2006-04-01 Marek Safar <marek.safar@seznam.cz>
7803 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
7804 in an embedded statement too.
7806 2006-04-01 Raja R Harinath <rharinath@novell.com>
7809 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
7811 2006-04-01 Marek Safar <marek.safar@seznam.cz>
7815 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
7818 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
7820 2006-03-31 Marek Safar <marek.safar@seznam.cz>
7822 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
7825 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
7826 LocalTemporary change.
7828 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
7830 (ClassOrStruct.DefineFieldInitializers): Implemented static field
7831 initializers optimization.
7832 (ClassOrStruct.TypeAttr): Moved from modifiers.
7833 (Constructor.CheckBase): Don't crash when static ctor has parameters.
7834 (FieldBase.ResolveInitializer): Resolves initializer.
7835 (FieldBase.HasDefaultInitializer): New property.
7837 * cs-parser.jay: Removed message.
7839 * expression.cs (CompilerGeneratedThis): New specialization.
7841 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
7843 2006-03-28 Marek Safar <marek.safar@seznam.cz>
7845 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
7847 2006-03-27 Marek Safar <marek.safar@seznam.cz>
7849 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
7850 be now EnumConstants only.
7852 2006-03-27 Marek Safar <marek.safar@seznam.cz>
7854 * attribute.cs, driver.cs: Reset more caches.
7856 2006-03-26 Marek Safar <marek.safar@seznam.cz>
7858 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
7860 2006-03-26 Marek Safar <marek.safar@seznam.cz>
7862 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
7863 for easier reuse. Updated all overrides.
7864 (IntegralConstant): New base class for all integral constants.
7865 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
7866 of the constant range, report custom error.
7867 (UIntConstant.Reduce): Fixed uint conversion.
7869 * ecore.cs, literal.cs: Reduce updates.
7871 2006-03-26 Marek Safar <marek.safar@seznam.cz>
7875 * class.cs (Constructor.Define): Removed extra if for default ctors.
7876 A patch from Atsushi Enomoto.
7878 2006-03-26 Marek Safar <marek.safar@seznam.cz>
7880 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
7881 GetAttributableValue.
7883 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
7886 * convert.cs (ImplicitConversionRequired): Error message moved to
7889 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
7890 automatic implicit conversion of an output value.
7891 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
7893 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
7895 (TypeOf.GetAttributableValue): Add extra handling for object type.
7897 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
7898 special error message.
7900 2006-03-25 Marek Safar <marek.safar@seznam.cz>
7902 * class.cs (Constructor.Emit): Don't crash when struct ctor is
7904 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
7905 compatible with MS runtime.
7907 2006-03-23 Marek Safar <marek.safar@seznam.cz>
7909 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
7910 attribute arguments here.
7912 * class.cs (Indexer.Define): The check was moved to attribute class.
7914 2006-03-22 Marek Safar <marek.safar@seznam.cz>
7916 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
7917 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
7920 2006-03-22 Raja R Harinath <rharinath@novell.com>
7922 Support ParameterDefaultValueAttribute in gmcs. Also applied to
7923 mcs to keep code differences small.
7924 * attribute.cs (Attribute.GetParameterDefaultValue): New.
7925 * typemanager.cs (parameter_default_value_attribute_type): New.
7926 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
7929 2006-03-21 Marek Safar <marek.safar@seznam.cz>
7931 * expression.cs (StringConcat.Append): Reverted back to no warning state.
7933 2006-03-21 Marek Safar <marek.safar@seznam.cz>
7935 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
7937 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
7940 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
7942 * doc-bootstrap.cs : fix build.
7944 2006-03-20 Marek Safar <marek.safar@seznam.cz>
7946 * expression.cs (StringConcat.Append): Issue a warning when empty string
7949 2006-03-20 Marek Safar <marek.safar@seznam.cz>
7951 * assign.cs (CompoundAssign.ResolveSource): Removed.
7953 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
7956 * class.cs (TypeContainer.FindMethods): Removed.
7957 (TypeContainer.CheckMemberUsage): Made static.
7959 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
7961 * constant.cs (CheckRange): Removed unused type argument.
7962 (CheckUnsigned): Removed unused type argument.
7964 * cs-parser.jay: Updated after MemberAccess clean up.
7965 Uses Length for empty string test.
7967 * cs-tokenizer.cs: Uses Length for empty string test.
7968 (IsCastToken): Made static.
7969 (is_hex): Made static.
7970 (real_type_suffix): Made static.
7972 * decl.cs (SetupCache): Made static.
7973 (OnGenerateDocComment): Removed unused ds argument.
7975 * delegate.cs (VerifyDelegate): Removed unused argument.
7977 * doc.cs: Uses Length for empty string test.
7979 * driver.cs: Uses Length for empty string test.
7981 * enum.cs (IsValidEnumType): Made static
7983 * expression.cs (EnumLiftUp): Removed unused argument.
7984 (ResolveMethodGroup): Ditto.
7985 (BetterConversion): Ditto.
7986 (GetVarargsTypes): Ditto.
7987 (UpdateIndices): Ditto.
7988 (ValidateInitializers): Ditto.
7989 (MemberAccess.ctor): Ditto.
7990 (GetIndexersForType): Ditto.
7992 * flowanalysis.cs: (MergeFinally): Removed unused argument.
7994 * iterators.cs: Updated after MemberAccess clean up.
7996 * location.cs: Uses Length for empty string test.
7998 * namespace.cs: Uses Length for empty string test.
8000 * report.cs (CheckWarningCode): Made static.
8002 * statement.cs (LabeledStatement): Removed unused argument.
8004 * typemanager.cs (FilterNone): Removed.
8006 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8008 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8011 * class.cs: Updated.
8013 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8015 * cs-parser.jay.cs: __arglist is not allowed for delegates.
8017 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8021 * expression.cs (VerifyArgumentsCompat): Reverted to double error
8022 reporting, it's more tricky than I thought.
8024 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8028 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
8030 (AnonymousMethod.ImplicitStandardConversionExists): New method.
8031 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8032 Add more error reporting; Fixed issue with params.
8034 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8036 * cs-parser.jay: AnonymousMethod requires host container.
8038 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8040 2006-03-18 Raja R Harinath <harinath@gmail.com>
8042 * class.cs: Change 'TypeContainer ds' constructor argument to
8043 'DeclSpace parent'. Some classes were missed below due to
8044 different naming convention.
8046 * class.cs (MemberCore.Parent): Delete. This makes the
8047 ParentContainer changes below enforceable by the compiler.
8049 Treat pointers to enclosing declaration space as 'DeclSpace', not
8051 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8052 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8054 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8056 (Block.AddThisVariable): Likewise.
8057 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8058 (AbstractPropertyEventMethod.Emit): Likewise.
8059 (AbstractPropertyEventMethod.EmitMethod): Likewise.
8060 (GetMethod.Define, SetMethod.Define): Likewise.
8061 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8062 (DelegateMethod.EmitMethod): Likewise.
8064 Fix regression test-partial-13.cs.
8065 Rationalize use of PartialContainer. Ensure that the partial
8066 class semantics can be tied to type-correctness, i.e., any
8067 violation will cause a compile error.
8068 * class.cs, const.cs: Access all fields that belong to class
8069 TypeContainer via ParentContainer. Arguments of EmitContexts and
8070 Resolve()-like functions still use 'Parent'.
8072 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8073 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8074 (PropertyMethod.CheckModifiers): Remove unused argument.
8075 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8078 2006-03-17 Raja R Harinath <harinath@gmail.com>
8080 Make semantics of PartialContainer simpler.
8081 * decl.cs (DeclSpace.IsPartial): Remove.
8082 * class.cs (TypeContainer.IsPartial): Likewise.
8083 (TypeContainer..ctor): Set PartialContainer to point to self.
8084 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8085 (TypeContainer.FindNestedType): Likewise.
8086 (MemberCore.ParentContainer): Simplify. Remove deprecation.
8088 2006-03-17 Marek Safar <marek.safar@seznam.cz>
8090 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8092 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8094 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8097 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8099 * class.cs (Operator.Define): An error for base conversion was not
8102 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
8104 * iterator.cs : yield break is allowed in try statement which has
8105 catch clauses. Fixed bug #77767.
8107 2006-03-13 Marek Safar <marek.safar@seznam.cz>
8109 A fix for #77593, #77574.
8111 * class.cs (MethodCore.CheckBase): Another if for operator.
8113 2006-03-09 Marek Safar <marek.safar@seznam.cz>
8115 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8118 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8119 (DelegateCreation.ImplicitStandardConversionExists): New method for just
8122 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8125 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8126 Updated after another emitcontext usage was clean up. It should help us to
8127 synchronize with gmcs easier.
8129 2006-03-04 Marek Safar <marek.safar@seznam.cz>
8133 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
8134 (Event.Define): ditto
8135 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8137 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
8138 Removed redundant code and set NewSlot for Invoke method too.
8140 * parameter.cs (Parameters.ctor): Add custom, type ctor.
8141 (Parameters.MergeGenerated): New method. Use this method when you merge
8142 compiler generated argument with user arguments.
8144 2006-03-03 Marek Safar <marek.safar@seznam.cz>
8146 * attribute.cs (ResolveAsTypeTerminal): Removed.
8148 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
8149 specialization for predefined types; 30% speed up.
8150 Finally placed obsolete check to right place.
8151 (Expression.ResolveType): Removed.
8153 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
8154 Updated after ResolveType was removed.
8156 * expression.cs (Cast.ctor): Check void cast.
8157 (Binary.ResolveAsTypeTerminal): Is never type.
8158 (Conditional.ResolveAsTypeTerminal): Is never type.
8160 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
8162 2006-03-01 Raja R Harinath <rharinath@novell.com>
8165 * expression.cs (ParameterReference.DoResolveBase): Change return
8167 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
8171 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
8174 * typemanager.cs (GetFullNameSignature): Don't nullref on
8175 protected accessors.
8177 2006-02-27 Marek Safar <marek.safar@seznam.cz>
8179 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
8180 these two separated members to simplify the code.
8181 (Attribute.Resolve): Refactored to use new fields and methods.
8182 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
8183 implemented obsolete attribute checking.
8184 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
8185 implemented obsolete checking again. It look line never ending quest ;-)
8186 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
8188 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
8190 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
8192 *class.cs (Property.Define): Add RegisterProperty call.
8194 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
8195 argument groups (only 2).
8197 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
8198 encoding expression to arguments.
8199 (Expression.ExprClassToResolveFlags): Just turned to property.
8201 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
8202 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
8203 optimized as well as implemented support for zero-length attributes.
8205 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
8206 Add caching of PropertyInfo's.
8208 2006-02-25 Marek Safar <marek.safar@seznam.cz>
8210 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
8211 error multiple times.
8213 2006-02-25 Marek Safar <marek.safar@seznam.cz>
8215 New partial class implementation.
8216 A fix for #77027, #77029, #77403
8218 * attribute.cs (Attributable): Made attributes protected.
8220 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
8221 the replacements of ClassPart and PartialContainer.
8222 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
8223 (TypeContainer.AddInterface): Ditto.
8224 (TypeContainer.AddPartial): The main method for partial classes. It checks
8225 for errors and merges ModFlags and attributes. At the end class is added to
8227 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
8229 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
8230 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
8231 from the rest of partial classes.
8232 (TypeContainer.GetClassBases): Simplified.
8233 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
8235 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
8236 (TypeContainer.HasExplicitLayout): Uses Flags now.
8237 (PartialContainer): Removed.
8238 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
8239 (StaticClass): Was merged with Class.
8240 (Class.GetClassBases): class and static class bases are verified here.
8241 (Class.TypeAttr): Added static attributes when class is static.
8242 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
8243 (MemberBase): In some cases we need to call parent container for partial
8244 class. It should be eliminated but it's not easy now.
8246 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
8248 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
8249 partial classed to accumulate class comments.
8250 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
8252 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
8254 * driver.cs (MainDriver): Tree.GetDecl was removed.
8256 * modifiers.cs (Modifiers): Add partial modifier.
8258 * tree.cs (Tree.decl): Removed.
8259 (RootTypes): Started to use this class more often for root types
8262 2006-02-22 Marek Safar <marek.safar@seznam.cz>
8266 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
8267 external interface does not have an attribute.
8269 2006-02-22 Marek Safar <marek.safar@seznam.cz>
8271 Another prerequisites for new partial classs implementation.
8273 * attribute.cs (Attribute.Equal): Implemented.
8274 (Attribute.Emit): Changed as attributes can be applied more than twice.
8275 (Attributes.Emit): Check for duplicate attributes here.
8277 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
8278 as a parameter, clean-up.
8280 2006-02-11 Marek Safar <marek.safar@seznam.cz>
8284 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
8285 contains obsolete attribute check which can in some cases look for base
8286 type of current class which is not initialized yet.
8287 (TypeContainer.BaseType): Replacement of ptype.
8289 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
8291 2006-02-11 Marek Safar <marek.safar@seznam.cz>
8293 First of prerequisites for new partial classs implemention.
8295 * attribute.cs (Attributable): Extended by ResolveContext;
8296 Attributes finally have correct context for resolving in all cases.
8297 (AttachTo): Attribute owner is assigned here.
8299 * codegen.cs (IResolveContext): Introduce new interface to hold
8300 all information needed in resolving phase.
8301 (EmitContext): Implements IResolveContext; more clean-up needed here.
8303 * decl.cs (MemberCore): Implemented IResolveContext.
8305 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
8306 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
8307 parameter.cs, statement.cs, tree.cs, typemanager.cs:
8308 Refactored to use new IResolveContext instead of EmitContext; cleanup
8310 2006-02-06 Miguel de Icaza <miguel@novell.com>
8312 * codegen.cs (EmitScopeInitFromBlock): check here the
8313 capture_context, there is no need to make two calls to the
8316 * anonymous.cs: Add some debugging messages that might help me
8317 track other instances of this problem in the future (the
8318 regression of test 467).
8320 * cs-parser.jay: track the variable block, as we need to initalize
8321 any captured variables declared in this block for the "catch"
8322 portion of the "Try" statement.
8324 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
8325 scope initialization for captured variables.
8327 Also, move the emit for the variables after the block location has
8330 2006-02-06 Marek Safar <marek.safar@seznam.cz>
8332 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
8334 2006-02-02 Miguel de Icaza <miguel@novell.com>
8336 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
8337 commit yesterday, the initialization for the roots is necessary.
8338 What is not necessary is the scope activation.
8340 2006-02-02 Raja R Harinath <rharinath@novell.com>
8342 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
8343 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
8345 (Argument.Resolve): Remove CS0206 checks.
8347 2006-02-01 Miguel de Icaza <miguel@novell.com>
8349 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
8350 scopes for all the roots, the scopes will now be emitted when the
8351 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
8353 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
8354 code. This reduces a lot of existing cruft.
8356 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
8357 that the ScopeInfo is generated as we enter the scope, not at the
8358 time of use, which is what we used to do before.
8360 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
8361 every time a Block is about to be emitted if we have a
8364 2006-02-01 Raja R Harinath <rharinath@novell.com>
8366 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
8368 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
8370 * typemanager.cs (cons_param_array_attribute): Make private.
8371 (Reset): Set it to null.
8372 (InitCoreHelpers): Don't initialize it.
8373 (ConsParamArrayAttribute): New. Initialize it as needed.
8374 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
8376 2006-01-31 Miguel de Icaza <miguel@novell.com>
8378 * expression.cs: There might be errors reported during the
8379 selection of applicable methods. If there are errors, do not
8380 continue execution as it will lead the compiler to crash.
8382 2006-01-30 Miguel de Icaza <miguel@novell.com>
8384 * expression.cs: Member access is not allowed on anonymous
8385 methods. Fixes #77402.
8387 2006-01-30 Raja R Harinath <rharinath@novell.com>
8390 * cs-parser.jay (VariableDeclaration): Don't set
8391 current_array_type to null.
8392 (field_declaration, event_declaration, declaration_statement):
8393 Set it to null here.
8395 2006-01-28 Raja R Harinath <harinath@gmail.com>
8397 * typemanager.cs (GenericParameterPosition): New.
8400 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
8402 * doc.cs : To process "include" elements, first we should create
8403 another list than XmlNodeList, because it could result in node
8404 removal, which could result in that the XmlNodeList gives up
8407 (Also made code identical to gmcs again.)
8409 2006-01-25 Miguel de Icaza <miguel@novell.com>
8411 * ecore.cs: Introduce an error report that we were not catching
8412 before, if not silent, we must report the error. Gonzalo ran into
8415 2006-01-23 Miguel de Icaza <miguel@novell.com>
8417 A fix for bug: #76957
8419 * iterators.cs (MoveNextMethod.CreateMethodHost): call
8420 ComputeMethodHost before creating the method, this is a new
8423 * anonymous.cs (AnonymousContainer): Now we track all the scopes
8424 that this method references (RegisterScope). The actual scope
8425 where the method is hosted is computed with the ComputeMethodHost
8426 before we create the method.
8428 Moved the Deepest routine here.
8430 (AnonymousContainer.ComputeMethodHost): New routine used to
8431 compute the proper ScopeInfo that will host the anonymous method.
8433 (ScopeInfo): Deal with multiple roots. The problem was that we
8434 did not have a unique root where all ScopeInfos could be hanged
8435 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
8438 Remove AdjustMethodScope which is now computed at the end. Remove
8439 LinkScope which did a partial link, instead link all ScopeInfos
8440 before code generation from the new "LinkScopes" routine.
8442 Simplify all the Add* routines as they no longer need to maintain
8443 the tree, they just need to record that they are using variables
8446 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
8447 routines to produce the forest of ScopeInfo trees.
8449 * class.cs (TypeContainer.AppendMethod): This is just like
8450 AddMethod, but ensures that an interface implementation method
8451 (IEnumerable.XXX) is not inserted at the beginning of the queue of
8452 methods, but at the end.
8454 We use this functionality to ensure that the generated MoveNext
8455 method in the iterator class is resolved/emitted before the
8456 enumerator methods created.
8458 This is required because the MoveNext method computes the right
8459 ScopeInfo for the method. And the other methods will eventually
8460 need to resolve and fetch information computed from the anonymous
8463 2006-01-21 Raja R Harinath <harinath@gmail.com>
8464 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8467 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
8469 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
8470 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
8472 2006-01-18 Raja R Harinath <rharinath@novell.com>
8474 Fix #76656, cs0231-2.cs.
8475 * cs-parser.jay (formal_parameter_list): Make error case catch
8477 (parenthesized_expression_0): Add CS1026 check.
8478 (invocation_expression): Remove unused { $$ = lexer.Location }.
8480 2006-01-17 Raja R Harinath <rharinath@novell.com>
8483 * cs-parser.jay (statement_expression): Don't list out the
8484 individual statement-expressions. Convert syntax error into
8487 2006-01-16 Raja R Harinath <rharinath@novell.com>
8490 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
8491 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
8492 CheckIntermediateModification.
8493 (FieldExpr.DoResolve): Add new two-argument version that
8494 allows us to resolve the InstanceExpression as an lvalue.
8495 The one-argument variant is now just a wrapper.
8496 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
8497 Resolve the lhs as an lvalue if the it has a value type.
8498 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
8499 from Assign.DoResolve.
8500 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
8501 resolved as an lvalue.
8502 (PropertyExpr.DoResolve): Update.
8503 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
8504 has a value type. Move CS1612 check here from
8505 CheckIntermediateModification.
8506 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
8507 * expression.cs (EmptyExpression.OutAccess): New. Used as the
8508 'right_side' of a ResolveLValue on an 'out' argument.
8509 (EmptyExpression.LValueMemberAccess): New. Used as the
8510 'right_side' of a propagated ResolveLValue on a value type.
8511 (LocalVariableReference.DoResolveBase): Recognize
8512 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
8514 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
8515 EmptyExpression.Null.
8517 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
8519 * typemanager.cs : added IsGenericParameter(). In mcs it always
8521 * doc.cs : for generic parameters, use GenericParameterPosition,
8524 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
8526 * expression.cs: Fix Console.WriteLine ((this = x).foo);
8528 2006-01-12 Miguel de Icaza <miguel@novell.com>
8530 This fixes the problem where we used ldfld instead of ldflda to
8531 load the "THIS" pointer on captured parameters, when THIS is a
8532 value type. See bug #77205.
8534 * iterators.cs (CapturedThisReference.Emit): Pass false to
8535 EmitThis (we do not need the address).
8537 * codegen.cs (EmitThis): it needs to know whether we need the
8538 address of `this' or not. This is used by value types.
8540 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
8541 every other call passes false.
8543 2006-01-12 Raja R Harinath <rharinath@novell.com>
8546 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
8548 * expression.cs (Invocation.OverloadResolve): Update.
8549 (Invocation.DoResolve): Avoid double resolution of invocation.
8551 2006-01-11 Raja R Harinath <rharinath@novell.com>
8554 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
8555 unary negation of floating point types as 0-expr; negation cannot
8556 overflow in floating point types.
8559 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
8560 on operands of 'void' type.
8563 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
8564 and ExclusiveOr for boolean constants too.
8566 2006-01-09 Raja R Harinath <rharinath@novell.com>
8569 * expression.cs (Invocation.OverloadResolve): Replace reflected
8570 override methods with their base virtual methods, rather than
8572 * typemanager.cs (TypeManager.GetOverride): New.
8574 2006-01-05 Jb Evain <jbevain@gmail.com>
8576 * class.cs (Property.Define, Indexer.Define): do not tag the
8577 properties as SpecialName | RTSpecialName.
8579 2006-01-04 Miguel de Icaza <miguel@novell.com>
8581 * class.cs (MethodCore.IsDuplicateImplementation): This method was
8582 doing a low-level comparission of parameter types. It was lacking
8583 a check for __argslist.
8585 2005-12-30 Miguel de Icaza <miguel@novell.com>
8587 * expression.cs (ParameterReference.DoResolveBase): Allow
8588 reference parameters if they are local to this block.
8590 This allows the ref and out parameters of a delegate to be used in
8591 an anonymous method, for example:
8593 delegate void set (out int x);
8595 set s = delegate (out int x){
8599 This is used by functionality introduced late in the C# language.
8601 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
8602 method that take ref and out parameters.
8604 Fixes #77119 which was a late change in the spec.
8606 2005-12-23 Miguel de Icaza <miguel@novell.com>
8608 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
8609 parent if its the same scope. Fixes #77060.
8611 2005-12-21 Miguel de Icaza <miguel@novell.com>
8613 * driver.cs: Report the case of no source files and no -out:
8616 2005-12-20 Raja R Harinath <rharinath@novell.com>
8619 * expression.cs (ComposedCast.GetSignatureForError): Define.
8621 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8625 * namespace.cs (NamespaceEntry): Add extern_aliases as a
8626 ListDictionary, to contain the ExternAliasEntry entries (in
8627 addition to the NamespaceEntry.aliases hashtable). This field is
8628 shared between the original entry and its doppelganger (bodyless
8630 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
8631 extern_aliases field.
8632 (NamespaceEntry.Lookup): Move the IsImplicit check after the
8633 lookup in extern_aliases.
8635 2005-12-16 Raja R Harinath <rharinath@novell.com>
8638 * class.cs (TypeContainer.Mark_HasEquals): New.
8639 (TypeContainer.Mark_HasGetHashCode): New.
8640 (ClassPart): Override them.
8641 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
8644 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
8645 'parent' argument to the base constructor.
8647 Remove all mention of TypeContainer from decl.cs.
8648 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
8649 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
8650 (DeclSpace.DeclSpace): Likewise.
8651 (DeclSpace.DefineMembers): Remove unused argument.
8652 * cs-parser.jay (pop_current_class): Update to changes. Simplify
8653 debugging check -- we don't care if the debug code throws an
8654 InvalidCastException instead of an InternalErrorException.
8655 * class.cs (TypeContainer.DefineMembers): Update to changes.
8656 (TypeContainer.DoDefineMembers): Likewise.
8657 (TypeContainer.GetMethods): Likewise.
8658 (PropertyMember.Define): Likewise.
8659 (MemberBase.Parent): New property that forwards to
8660 MemberCore.Parent, but ensures that we get a TypeContainer.
8661 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
8662 (RootContext.PopulateTypes): Likewise. Remove special case code
8663 for !RootContext.StdLib: DefineMembers is idempotent.
8665 2005-12-14 Miguel de Icaza <miguel@novell.com>
8667 * convert.cs (ExplicitConversionCore): Check the return value from
8668 ExplicitConversionCore which can return null on failure. Fixes #76914
8670 2005-12-13 Marek Safar <marek.safar@seznam.cz>
8672 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
8674 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
8676 * doc.cs : The search for referenced namespace was insufficient to
8677 get global one as it used to do. Fixed bug #76965.
8679 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
8681 * doc.cs : check name in cref in the last phase that whether it is
8684 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
8686 * cs-tokenizer.cs : reverted the latest change: it somehow broke
8689 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
8691 * doc.cs : so it turned out that we cannot skip override check for
8692 interface members. Fixed bug #76954.
8694 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
8696 * cs-tokenizer.cs : fixed bug #75984:
8697 - #warning and #error should not be handled when the source line
8699 - #line is not checked strictly when the source line is disabled.
8700 - #define and #undef is on the other hand checked strictly at any
8703 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
8705 * cs-tokenizer.cs : missing Location (actually, filename) in one of
8708 2005-12-05 Marek Safar <marek.safar@seznam.cz>
8710 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
8712 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
8714 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
8715 (FieldBase.Initializer): Initializer is now optional.
8716 (EventField.Define): Only event field can have initializer.
8718 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
8720 * const.cs (Const): Reuse initializer.
8722 * cs-parser.jay: Updated after FieldBase changes.
8723 Added current_array_type to simplify array initializers.
8725 * ecore.cs (NullCast.IsDefaultValue): Implemented.
8727 * expression.cs, iterators.cs: Updated.
8729 * namespace.cs (NamespaceEntry): Made UsingFound private.
8731 2005-12-05 Marek Safar <marek.safar@seznam.cz>
8733 * parameterCollection.cs: Obsolete, removed.
8734 * parser.cs: Obsolete, removed.
8736 2005-12-05 Marek Safar <marek.safar@seznam.cz>
8739 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
8741 * enum.cs (Enum.Define): Set obsolete context here.
8743 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
8746 - FindDocumentedMember() now expects 1) paramList as null
8747 when "we don't have to check the number of parameters" and
8748 2) Type.EmptyTypes when "there is no arguments".
8749 - Introduced FoundMember struct to hold the exact type which was
8750 used to find the documented member (the above change broke
8751 test-xml-044; it might be better just to use DeclaringType than
8752 what MS does, like this change does, but it depends on usage.)
8754 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
8756 * doc.cs : documented member might be from DeclaringType for nested
8757 types. Fixed bug #76782.
8759 2005-12-03 Ben Maurer <bmaurer@ximian.com>
8761 * anonymous.cs: Have the param code handle leaving copies on the
8762 stack etc. Allows anonymous params to take part in the assignment
8763 code (++, +=, etc). Fixes bug #76550
8765 * expression.cs: Handle the prepare_for_load/leave_copy by passing
8766 it down to the anon code.
8768 * iterators.cs: Use dummy var here
8770 * codegen.cs: Handle new vars
8772 2005-12-01 Marek Safar <marek.safar@seznam.cz>
8775 * class.cs (MethodData.Define): Set proper Obsolete context.
8777 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
8779 (FieldExpr.DoResolve): Ditto.
8781 2005-12-01 Marek Safar <marek.safar@seznam.cz>
8784 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
8785 parent is not obsolete.
8787 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
8789 * doc.cs : (FindDocumentedMember) find parameterless members first
8790 and get CS0419 in the early stage. Fixed first case of bug #76727.
8792 2005-11-30 Marek Safar <marek.safar@seznam.cz>
8795 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
8796 no error was reported.
8798 *expression.cs (Binary.DoResolve): left can be null.
8800 2005-11-22 Marek Safar <marek.safar@seznam.cz>
8803 * class.cs (MethodData.Emit): Parameters should be labeled first.
8805 2005-11-21 Marek Safar <marek.safar@seznam.cz>
8808 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
8810 2005-11-18 Marek Safar <marek.safar@seznam.cz>
8812 * attribute.cs (AreParametersCompliant): Moved to Parameter.
8814 * class.cs (MethodCore): Parameter clean up.
8815 (IMethodData): Added ParameterInfo.
8816 (MethodData): Parameter clean up.
8817 (Indexer.Define): Parameter clean up.
8829 * typemanager.cs: Parameter clean up.
8831 * delegate.cs (Define): Get rid of duplicated code.
8833 * expression.cs (ParameterReference): Removed useless parameters
8835 (Invocation): Ditto.
8837 * parameter.cs (ParamsParameter): New class, params specialization.
8838 (ArglistParameter): Attemp to separate arglist.
8839 (Parameter): Refactored to be reusable and faster.
8840 (Parameter.Modifier): Made understandable.
8841 (Parameters): Changed to be used as a class for `this' assembly
8842 parameters. Refactored to use new specialized classes.
8844 * support.cs (ParameterData): Added Types property.
8845 (InternalParameters): Deleted.
8847 2005-08-20 Martin Baulig <martin@ximian.com>
8849 Merging this patch from GMCS to fix #75867.
8851 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
8852 scope if we don't already have it.
8854 2005-11-17 Martin Baulig <martin@ximian.com>
8857 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
8858 inherit the scope from our parent. Fixes #76653.
8860 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
8862 * doc.cs : the previous patch does not actually fix the bug.
8863 PropertyInfo override check is now implemented and really fixed it.
8864 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
8866 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
8868 * doc.cs : apply "override filter" also to properties.
8871 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
8873 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
8874 no need to check overrides. For classes, omit those results from
8875 interfaces since they must exist in the class. Fixed bug #76726.
8877 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
8879 * typemanager.cs : (GetFullNameSignature) differentiate indexers
8880 with different parameters. Fixed the second problem in #76685.
8882 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
8884 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
8885 get expected 'protected' access in CheckValidFamilyAccess()).
8888 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
8890 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
8891 Fixed bug #76705. CS1569 was incorrectly commented out.
8893 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
8895 * doc.cs : use Invocation.IsOverride() to do real override check.
8896 * expression.cs : made Invocation.IsOverride() internal.
8898 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
8900 * doc.cs : use TypeManager.FindMembers() instead of (possible)
8901 TypeBuilder.FindMembers() and filter overriden base members out.
8904 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8906 * doc.cs : ref/out parameters are represented as '@' (instead of
8907 '&' in type FullName). Fixed bug #76630 (additionally crefs).
8909 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8911 * doc.cs : when there was no '.' in cref to methods in doc comment,
8912 then parameters were missing in the output. Fixed bug #76691.
8914 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8916 * driver.cs : don't output docs when there is an error.
8919 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8922 Now it should detect indexers. Fixed primary concern in bug #76685.
8923 Fixed CS0419 message to not show the identical member signature in
8926 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
8928 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
8929 instead of Type.FindMembers() since it does not handle events.
8932 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
8934 * codegen.cs: Fixed typo (speficied -> specified).
8936 2005-11-11 Marek Safar <marek.safar@seznam.cz>
8939 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
8941 2005-11-11 Marek Safar <marek.safar@seznam.cz>
8943 * attribute.cs: Changed error message.
8945 * cs-tokenizer.cs: One more check.
8947 2005-11-10 Marek Safar <marek.safar@seznam.cz>
8949 * statement.cs (Block.Resolve): Ignore empty statement.
8951 2005-11-10 Marek Safar <marek.safar@seznam.cz>
8953 * report.cs: Made error/warning methods more strict to avoid
8956 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
8957 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
8958 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
8959 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
8961 2005-11-08 Marek Safar <marek.safar@seznam.cz>
8963 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
8964 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
8966 * class.cs (TypeContainer.IsComImport): New property.
8967 (Constructor.Define): Create proper ctor for ComImport types.
8969 * expression.cs (New.CheckComImport): Fixed.
8971 2005-11-07 Miguel de Icaza <miguel@novell.com>
8973 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
8974 that a parameter has been captured does not mean that we do not
8975 have to do the rest of the processing. This fixes the second part
8976 of #76592. If there was another anonymous method capturing
8977 values in the past, the Scope would never be set for the second
8978 method that captured the same parameter.
8980 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
8981 properly manipulate the stack. Second part of fix for #76592.
8983 * expression.cs (New): Add support for invoking "new" on
8984 interfaces that have been flagged with the ComImport attribute and
8985 the CoClass. Fixes #76637
8987 * statement.cs (Try.DoEmit): When a variable is captured, do not
8988 try to emit the vi.LocalBuilder variable as it has been captured.
8989 Create a temporary variable and store the results on the
8990 FieldBuilder. Fixes #76642
8992 2005-11-07 Marek Safar <marek.safar@seznam.cz>
8994 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
8996 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
8998 * expression.cs (Binary.DoResolve): Added && optimalization.
9000 * typemanager.cs (AddUserType): Removed useless argument.
9002 2005-11-04 Marek Safar <marek.safar@seznam.cz>
9004 * statement.cs (Block.variables): Uses ListDictionary.
9006 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9009 * class.cs (PartialContainer.EmitType): Customized to emit
9010 security attributes.
9011 (ClassPart.ApplyAttributeBuilder): Transform security attribute
9012 for partial classes.
9014 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9017 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9018 access has to be fixed.
9020 * typemanager.cs (IsUnmanagedType): Wrong common field type.
9022 2005-11-01 Marek Safar <marek.safar@seznam.cz>
9025 * ecore.cs (NullCast.Reduce): Implemented.
9027 * expression.cs (ArrayCreation.CheckIndices): Correcly check
9030 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9032 (Foreach.Resolve): Catch null properly.
9034 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9036 * cs-tokenizer.cs: Warning text fix.
9038 * driver.cs: AllWarningNumbers exposed on public interface.
9040 * report.cs (): Reviewed warning numbers.
9041 (IsValidWarning): Use binary search.
9043 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9045 * driver.cs: Implemeted resource visibility.
9046 (Resources): New class for code sharing between /res: and
9049 2005-10-28 Marek Safar <marek.safar@seznam.cz>
9052 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9055 * convert (Convert.ImplicitReferenceConversion): NullCast holds
9058 * ecore.cs (NullCast): Child is contant only.
9060 * literal.cs (NullLiteral.Reduce): null can be converted to any
9063 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
9065 * driver.cs: Use Encoding.Default as default code page instead
9068 2005-10-27 Raja R Harinath <rharinath@novell.com>
9071 * expression.cs (Invocation.Error_InvalidArguments): Handle
9072 __arglist parameters.
9073 (Invocation.VerifyArgumentsCompat): Likewise.
9074 * support.cs (ReflectionParameters.GetSignatureForError): Print
9075 __arglist parameters.
9076 (InternalParamters.GetSignatureForError): Likewise.
9077 * parameter.cs (Parameters.GetSignatureForError): Likewise.
9079 2005-10-26 Marek Safar <marek.safar@seznam.cz>
9081 * attribute.cs (GetPropertyValue): Made public.
9083 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9085 Add new property WrapNonExceptionThrows to handle 2.0 assembly
9087 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9090 * driver.cs: Reflect method name change.
9092 * statement.cs (Try.Resolve): Warn when try has both general
9095 * typemanager.cs: runtime_compatibility_attr_type new predefined
9098 2005-10-26 Raja R Harinath <harinath@gmail.com>
9101 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9102 treat it as an empty parameter list.
9104 2005-10-26 Raja R Harinath <rharinath@novell.com>
9107 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
9108 ResolveAsTypeStep silent.
9109 * statement.cs (Block.AddConstant): Mark block as used.
9110 (Block.ResolveMeta): Avoid piling on error messages
9111 if a constant initializer resolution fails.
9113 2005-10-25 Raja R Harinath <rharinath@novell.com>
9115 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9117 (NamespaceEntry.VerifyAllUsing): New.
9118 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
9119 behaviour. Delegates actual resolution of alias to ...
9120 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
9121 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9123 * driver.cs (Driver.MainDriver): Update.
9125 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9126 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9128 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
9130 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
9131 RootNamespace.DefineNamespacesForAll.
9133 2005-10-24 Raja R Harinath <harinath@gmail.com>
9135 * typemanager.cs (assemblies, external_aliases, modules)
9136 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
9137 (ComputeNamespaces, GetRootNamespace): Remove extra staging
9138 overhead. Move resposibility ...
9139 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
9140 * driver.cs, attribute.cs, codegen.cs: Update to changes.
9142 2005-10-23 Raja R Harinath <harinath@gmail.com>
9144 * namespace.cs (RootNamespace.all_namespaces): Renamed from
9145 cached_namespaces. Improve usage.
9146 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
9147 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
9148 Move from GlobalRootNamespace and simplify.
9149 (RootNamespace.Global): Make instance variable.
9150 (RootNamespace.RootNamespace): Add "alias name" parameter.
9151 (GlobalRootNamespace): Simplify drastically.
9152 (Namespace.Lookup): Don't use GetNamespace.
9153 * typemanager.cs (GetRootNamespace): Rename from
9154 ComputeNamespaceForAlias.
9155 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
9157 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9159 * anonymous.cs (AnonymousContainer): Don't crash when container
9162 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9164 * expression.cs (Binary.DoResolve): Warn when comparing same
9167 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9170 * expression.cs (Binary.DoResolve): It looks like there are no
9171 convetsion rules in enum context.
9173 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9175 Add support for extern alias qualifiers.
9176 * typemanager.cs: Move some LookupTypeReflection code
9177 to namespace.cs, to have cleaner code. Added some methods
9178 to help us keep track of the extern aliased references.
9179 * driver.cs: Add suport for extern alias assemblies on command
9180 line and check for their warnings/errors. Also keep track of the
9181 extern aliased assemblies.
9182 * namespace.cs: Move the global functionality of Namespace
9183 to GlobalRootNamespace/RootNamespace. Now the global namespace
9184 is GlobalRootNamespace.Globa. Also the code moved from
9185 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
9186 Finally added LocalAliasEntry (AliasEntry before) and
9187 ExternAliasEntry, to handle alias statements.
9188 * cs-parser.jay: Add support in the grammar for extern alias
9190 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
9191 Update callings to Namespace (now in GlobalRootNamespace).
9193 2005-10-18 Raja R Harinath <rharinath@novell.com>
9196 * class.cs (TypeContainer.DefineType): Move updating of
9197 topological sort earlier in the code.
9198 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
9200 2005-10-18 Marek Safar <marek.safar@seznam.cz>
9203 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
9205 * constant.cs (Constant.TryReduce): Moved from Cast class.
9206 (Reduce): Made little bit more OO and fixed missing conversions.
9208 * ecore.cs (Reduce): Implemented.
9209 (Binary.EnumLiftUp): New method to upgrade values to enum values.
9211 * literal.cs (Reduce): Implemented.
9213 * class.cs: Reverted Miguel's wrong commit.
9215 2005-10-14 Miguel de Icaza <miguel@novell.com>
9217 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
9219 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
9221 * cs-parser.jay, expression.cs : CS0214 was missing error location
9222 for constants. Fixed bug #76404.
9224 2005-10-11 Marek Safar <marek.safar@seznam.cz>
9227 * convert.cs (ExplicitConversionCore): Fixed object->enum
9230 2005-10-10 Raja R Harinath <rharinath@novell.com>
9232 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
9234 (PropertyExpr.EmitCall): Likewise.
9235 * expression.cs (Invocation.EmitArguments): Handle case where
9237 (Invocation.EmitCall): Avoid allocating temporary variable if
9238 there are no arguments.
9240 2005-10-07 Raja R Harinath <rharinath@novell.com>
9243 * convert.cs (ImplicitConversionStandard): Move conversion of
9244 void* to arbitrary pointer types ...
9245 (ExplicitConversionStandard): .. here.
9246 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
9247 error to always print typenames.
9249 2005-10-07 Raja R Harinath <rharinath@novell.com>
9251 * convert.cs (GetConversionOperator): Rename from
9252 GetConversionOperators. Move operator selection code from ...
9253 (UserDefinedConversion): ... here.
9255 2005-10-06 Marek Safar <marek.safar@seznam.cz>
9257 * convert.cs (ExplicitConversionCore): Removed duplicate enum
9260 2005-10-05 Marek Safar <marek.safar@seznam.cz>
9262 * assign.cs (Assign.DoResolve): Error method changed.
9264 * cfold.cs (DoConstantNumericPromotions): Error method changed.
9266 * const.cs (ResolveValue): Reset in_transit immediately.
9268 * constant.cs: Error method changed.
9270 * convert.cs: Removed useless location parameter.
9271 (ExplicitNumericConversion): Don't do double enum check.
9272 (ExplicitConversionCore): Renamed from ExplicitConversion.
9273 (ExplicitUnsafe): Extracted from ExplicitConversion.
9274 (ExplicitConversion): Uses for error reporting.
9276 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
9278 (ResolveBoolean): Uses common error method.
9279 (CastToDecimal): Get rid of ec.
9280 (CastFromDecimal): Optimized.
9281 (ConvCast): Get rid of ec.
9283 * enum.cs (ResolveValue): Reset in_transit immediately.
9284 (Emit): Return after first error.
9286 * expression.cs: Convert changes.
9288 * literal.cs: Error method changed.
9290 * statement.cs: Error method changed.
9292 2005-10-03 Raja R Harinath <rharinath@novell.com>
9294 * support.cs (SeekableStreamReader.Position): Don't error out when
9295 the requested position is just beyond the end of the current
9298 2005-09-28 Raja R Harinath <rharinath@novell.com>
9300 * support.cs (SeekableStreamReader): Simplify drastically. Don't
9301 try to keep in sync with the byte count of the underlying Stream.
9302 However, this limits us to a window size of 2048 characters: i.e.,
9303 the maximum lookahead of our lexer/parser can be 2048 characters.
9305 2005-09-28 Marek Safar <marek.safar@seznam.cz>
9308 * driver.cs: Fix compilation files with full root path.
9310 2005-09-25 Miguel de Icaza <miguel@novell.com>
9312 * report.cs (SymbolRelatedToPreviousError): Format the output so
9313 it does not use an open parenthesis that is never closed.
9315 * driver.cs: Follow coding guidelines
9317 2005-09-27 Marek Safar <marek.safar@seznam.cz>
9320 * const.cs (Const.ResolveValue): Check for assigning non-null
9321 value to reference type.
9323 2005-09-27 Marek Safar <marek.safar@seznam.cz>
9325 * anonymous.cs: Implemented ExprClassName.
9327 * assign.cs (Assign.DoResolve): Don't chrash when type is not
9330 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
9333 * class.cs (StaticClass.DefineContainerMembers): Report protected
9336 * codegen.cs: if(ed) PRODUCTION.
9338 * convert.cs (Error_CannotImplicitConversion): Better error
9341 * cs-parser.jay: More error checks.
9343 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
9345 * driver.cs (CSCParseOption): Enabled wrong option check.
9347 * ecore.cs (Expression.ExprClassName): Turned to property.
9348 (MemberExpr.CheckIntermediateModification): For checking boxed
9349 value types modification.
9351 * statement.cs (Fixed.Resolve): Expression type must be
9352 convertible to fixed type.
9353 (CollectionForeach.GetEnumeratorFilter,TryType):
9354 Small refactoring for easier error checking.
9356 2005-09-26 Marek Safar <marek.safar@seznam.cz>
9358 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
9361 * class.cs (GeneratedBaseInitializer): New class for customization
9362 compiler generated initializers.
9363 (MemberBase.DoDefine): Check Obsolete attribute here.
9364 (FieldMember.DoDefine): Ditto.
9366 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
9369 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
9370 (MemberCore.GetObsoleteAttribute): Removed argument.
9371 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
9372 (MemberCore.CheckObsoleteType): New helper.
9376 * statement.cs: Updates after MemberCore changes.
9378 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
9379 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
9381 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
9382 obsolete attribute for compiler construct.
9383 (As.DoResolve): Cache result.
9385 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
9387 2005-09-26 Raja R Harinath <rharinath@novell.com>
9390 * expression.cs (This.VerifyFixed): In a value type T, the type of
9391 'this' is T&, iow, 'this' is either an out or ref parameter. In a
9392 value type R, 'this' is treated as a value parameter.
9394 2005-09-22 Miguel de Icaza <miguel@novell.com>
9396 * statement.cs (Lock): Use the TemporaryVariable class instead of
9397 manually using local variables as those do not work when variables
9400 * ecore.cs: Moved the TemporaryVariable class from being a nested
9401 class inside Foreach to be a public class that can be employed in
9404 2005-09-19 Marek Safar <marek.safar@seznam.cz>
9406 * cs-parser.jay: interface_accessors replaced by
9407 accessor_declarations.
9409 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
9412 * statement.cs (GotoCase.Resolve): Convert null constant to
9414 (SwitchLabel.ResolveAndReduce): Ditto.
9415 (SwitchLabel.NullStringCase): Custom null stamp.
9416 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
9418 typemanager.cs (CSharpSignature): Don't skip first argument
9421 2005-09-18 Miguel de Icaza <miguel@novell.com>
9423 * driver.cs: Set InEmacs based on the environment variable EMACS.
9425 * location.cs (InEmacs): in this mode, do not report column
9426 location as it confuses Emacs.
9428 2005-09-16 Marek Safar <marek.safar@seznam.cz>
9430 * cfold.cs, constant.cs, convert.cs, ecore.cs,
9431 expression.cs, iterators.cs, literal.cs: Store constants and
9434 * class.cs (MemberBase.ShortName): Pass location.
9436 * cs-parser.jay: Some location fixes.
9438 * ecore.cs (Expression.Location): Made virtual.
9440 2005-09-05 Miguel de Icaza <miguel@novell.com>
9442 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
9443 if the underlying types are the same, otherwise we need to produce
9444 code that will do the proper cast.
9446 This was exposed by Marek's constant rewrite which produced
9447 invalid code for the call site:
9450 void Method (X v) {}
9454 This fixes test-49.cs
9456 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
9458 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
9459 Type/Object should be allowed as well. Fixed bug #75968.
9461 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
9463 * expression.cs : (Binary.DoResolve): when one is enum constant and
9464 another is constant 0, then return enum one *as enum type*.
9467 2005-09-02 Raja R Harinath <rharinath@novell.com>
9469 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
9473 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
9474 flow-branching for LocalVariableReferences in case we were invoked
9475 from a MemberAccess.
9476 * expression.cs (LocalVariableReference.VerifyAssigned): New.
9478 (LocalVariableReference.DoResolveBase): ... this.
9479 (MemberAccess.Resolve): Do the check that was disabled during
9482 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
9485 (PartialContainer.Create): check abstract/sealed/static strictly
9486 but abstract/sealed can exist only at one side. Fixed bug #75883.
9488 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
9491 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
9492 specified, don't default to UnmanagedType.I4.
9494 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
9496 * expression.cs : conditional operator should check possibly
9497 incorrect assign expression. Fixed bug #75946.
9499 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
9501 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
9502 Reverting the change. gmcs is much complex than mcs on this matter.
9504 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
9506 * cs-tokenizer.cs : To read another token ahead of the actual
9507 consumption, use new SavedToken and cache token instead of moving
9508 back the stream with SeekableStreamReader (it seemed problematic).
9510 driver.cs : Thus use StreamReader directly.
9511 * support.cs : Thus removed SeekableStreamReader.
9513 2005-08-30 Raja R Harinath <rharinath@novell.com>
9516 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
9517 (ScopeInfo.EmitScopeType): Use it to construct field names from
9518 names of captured locals.
9521 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
9522 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
9523 Pass 'target_type' to BoxedCast. Don't default to 'object'.
9524 (ExplicitConversion): Remove enum cases already handled by
9525 implicit conversion. Move implicit conversion check to the beginning.
9526 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
9527 * expression.cs (ArrayCreation.EmitDynamicInitializers):
9528 Don't treat System.Enum as a struct.
9530 2005-08-30 Jb Evain <jbevain@gmail.com>
9532 * attribute.cs: handles as expression in parameters.
9534 2005-08-30 Raja R Harinath <rharinath@novell.com>
9537 * class.cs (TypeContainer.VerifyClsName): Don't use a
9538 PartialContainer when verifying CLS compliance.
9539 (AbstractPropertyEventMethod): Set Parent here, ...
9540 (PropertyMethod): ... not here.
9542 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
9544 * attribute.cs : escaped attribute name should not be allowed to be
9545 resolved (e.g. @class as classAttribute). Fixed bug #75930.
9547 2005-08-29 Raja R Harinath <rharinath@novell.com>
9550 * convert.cs (ImplicitStandardConversionExists): Allow zero also
9551 when converting a long constant to unsigned long.
9552 * expression.cs (Invocation.OverloadResolve): Add sanity check to
9553 detect where IsApplicable and VerifyArgumentsCompat disagree.
9555 2005-08-29 Raja R Harinath <rharinath@novell.com>
9556 and Carlos Alberto Cortez <carlos@unixmexico.org>
9559 * class.cs (TypeContainer.CanElideInitializer): New helper.
9560 (TypeContainer.EmitFieldInitializers): Use it to determine if we
9561 can safely emitting the initializer of a field.
9563 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
9565 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
9566 allowed inside a switch (without loop). Fixed bug #75433.
9568 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
9570 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
9571 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
9573 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
9575 * driver.cs : kinda reverting the default encoding changes (not exact
9576 revert since I noticed that "codepage:reset" might not work fine).
9578 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
9580 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
9581 Location. Now getter and setter store location correctly.
9582 (errors/cs0111-12.cs now reports the expected location.)
9584 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
9586 * driver.cs : Use default encoding on the environment.
9587 Removed (now that) extra parameter for SeekableStreamReader.
9588 * support.cs : (SeekableStreamReader) third .ctor() argument for
9589 StreamReader is not required (always true). preamble size could
9590 be acquired in simpler and safe way.
9592 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
9594 * cs-parser.jay: report CS0642 at warning level 3
9595 and report CS0642 for an if else statement also
9596 fixes bug #74745. Patch by John Luke (and a bit
9598 Removed extra CS0642 warning check for "while",
9600 * statement.cs: In Block.Resolve(), CS0642 check
9601 is reimplemented to check a sequence of an empty
9602 statement and a block.
9604 Both fix bug #66777.
9606 2005-08-24 Marek Safar <marek.safar@seznam.cz>
9608 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
9609 detection until I fix it.
9611 * cs-tokenizer.cs: Changed error message.
9613 * cs-parser.jay: Fixed 2 error locations.
9615 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
9616 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
9619 * enum.cs (GetSignatureForError): Fixed.
9621 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
9625 * typemanager.cs (RegisterProperty): Removed.
9627 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
9629 2005-08-24 Raja R Harinath <rharinath@novell.com>
9632 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
9633 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
9635 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9637 * expression.cs : tiny fix is required for not warning positive ulong.
9640 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9642 * expression.cs : add CS0652 check for constant and integral
9643 expression. Fixed bug #53974.
9645 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9647 * expression.cs : in DoNumericPromotions(), check if there is implicit
9648 conversion overload for string (to check CS0034). Fixed bug #52492.
9650 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9652 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
9654 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9656 * ecore.cs : report location when it is *not* Null.
9658 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9664 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
9665 correctly. Fixed bug #75721.
9667 2005-08-23 Raja R Harinath <rharinath@novell.com>
9669 * support.cs (SeekableStreamReader.Position): Avoid an expensive
9670 loop that performs 'min (pos, char_count)'.
9673 * expression.cs (Unary.ResolveOperator): Don't discard implicit
9674 converted value in Operator.OnesComplement.
9676 2005-08-22 Ben Maurer <bmaurer@ximian.com>
9678 * anonymous.cs: If the anon method is pulled into a helper class,
9679 it needs to be `internal' not `private'. Fixes runtime behavior on
9682 2005-08-20 Martin Baulig <martin@ximian.com>
9684 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9685 scope if we don't already have it.
9687 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
9688 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
9691 2005-08-17 Marek Safar <marek.safar@seznam.cz>
9694 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
9697 2005-08-16 Marek Safar <marek.safar@seznam.cz>
9699 The big constants rewrite
9700 Fix #75746, #75685 and more
9701 As a side effect saved 1MB for MWF ;-)
9703 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
9704 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
9705 enum based for corlib compilation.
9707 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
9710 * class.cs (FixedField.Define): Use ResolveAsConstant.
9712 * const.cs (IConstant): Interface constants and enums.
9713 (Const.ResolveValue): New method for constant resolvning.
9714 (ExternalConstant): Constants from imported assemblies.
9716 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
9717 conversion; like enums.
9718 (Constant.ToType): Converts this constant to different type.
9719 (Constant.Increment): Adds 1.
9721 * convert.cs (ImplicitConversionRequired): Simplified.
9723 * cs-parser.jay: Create EnumMember directly.
9725 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
9727 * doc.cs (GenerateEnumDocComment): Removed.
9729 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
9730 (ConvertIntLiteral): Removed.
9731 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
9733 * enum.cs (EnumMember): Implement IConstant.
9734 (Enum.IsValidEnumConstant): Removed.
9735 (Enum.GetNextDefaultValue): Removed.
9736 (Enum.FindMembers): Updated.
9737 (Enum.GenerateDocComment): Iterate enum members.
9739 * expression.cs (Cast.TryReduce): Handle enums correctly.
9740 (New.Constantify): Made public.
9741 (MemberAccess.DoResolve): Removed contant specific if(s).
9743 * literal.cs (NullLiteral): Implement new abstract methods.
9745 * statement.cs (GotoCase.Resolve): Use new constant methods.
9746 (SwitchLabel.ResolveAndReduce): Use new constant methods.
9748 * typemanager.cs (LookupEnum): Removed.
9749 (IsEnumType): Fixed to work with corlib.
9750 (RegisterConstant): Removed.
9751 (LookupConstant): Removed.
9752 (GetConstant): Changed to work with IConstant.
9754 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
9756 * location.cs : Fixed overflown (>255) column number.
9758 2005-08-03 Raja R Harinath <rharinath@novell.com>
9760 First cut of the qualified-alias-member feature.
9761 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
9763 * cs-parser.jay (DOUBLE_COLON): New token.
9764 (namespace_or_type_name): Add rule for recognizing
9765 qualified-alias-members.
9766 (primary_expression): Likewise.
9767 (element_access): Allow QualifiedAliasMember as a possible
9768 type-bearing expression.
9769 (local_variable_type, local_variable_pointer_type): Likewise.
9770 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
9771 aliases in the current and enclosing namespace declarations.
9772 (NamespaceEntry.UsingAlias): Add CS0440 warning.
9773 * decl.cs (MemberName.is_double_colon): New.
9774 (MemberName.MemberName): Add new constructor for alias-member.
9775 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
9776 * expression.cs (QualifiedAliasMember): New expression type.
9778 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
9780 * location.cs : it borked when no argument was specified.
9782 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
9784 * location.cs : tiny ToString() format fix.
9786 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
9788 * statement.cs : oops, it was missing.
9790 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
9792 A set of fixes for precise line/column location.
9795 "token" field now holds a file/line "delta", a line number offset
9796 from the segment, and a column number. See also:
9797 http://lists.ximian.com/pipermail/mono-devel-list/2004-
9798 December/009508.html
9799 Removed static IsNull. Use instance IsNull property instead.
9801 For some tokens it stores Location. For Identifier it stores
9802 LocatedToken which is a pair of string name and location.
9803 Column numbers are adjusted only at getChar().
9805 Use Location.ToString() for reporting (it now contains column).
9807 Largely modified to use LocatedToken instead of
9808 string (IDENTIFIER), and to acquire Location from some tokens.
9809 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
9810 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
9812 Now MemberName holds Location. DeclSpace.ctor() receives Location
9813 as a parameter. Removed extra parameters to all derived classes.
9814 Replaced Location.IsNull() with instance property.
9815 * assign.cs, expression.cs :
9816 Added .ctor() overload that omits Location.
9818 Added "nameEscaped" flag that indicates the identifier was escaped
9819 in the source file. This fixes bug #57047.
9821 2005-08-02 Marek Safar <marek.safar@seznam.cz>
9823 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
9824 New method, looking for lo-case imported cls type.
9826 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
9829 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
9831 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
9833 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
9835 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
9837 Optimized to save 3.5 MB for SWF compilation.
9839 2005-08-01 Marek Safar <marek.safar@seznam.cz>
9841 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
9842 (PartialContainer.Create): Moved logic AddToContainer.
9843 (PartialContainer.MarkForDuplicationCheck): Shares name.
9845 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
9848 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
9850 (Namespace.GetSignatureForError): New method.
9852 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
9853 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
9855 2005-08-01 Raja R Harinath <rharinath@novell.com>
9858 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
9859 member lookup rather than qualifier_type, since qualifier_type can
9862 2005-08-01 Marek Safar <marek.safar@seznam.cz>
9864 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
9867 2005-07-31 Miguel de Icaza <miguel@novell.com>
9869 * statement.cs: Copy the local exception into the exception
9870 captured local. Fixes 75674
9872 2005-07-31 Raja R Harinath <harinath@gmail.com>
9875 * expression.cs (Invocation.OverloadResolve): Don't report error
9876 CS1501 if error CS1502 has been reported.
9877 (New.DoResolve): Delegate CS1501 reporting to
9878 Invocation.OverloadResolve.
9881 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
9882 invariant-meaning-in-block property in an enclosing block if
9885 2005-07-29 Marek Safar <marek.safar@seznam.cz>
9887 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
9888 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
9889 (Switch.CheckSwitch): Just save 50kb for SWF.
9891 2005-07-27 Martin Baulig <martin@ximian.com>
9893 * anonymous.cs (CaptureContext.AddField): Added
9894 `AnonymousContainer am' argument; compute its toplevel scope if
9895 it's not already computed. Fixes #75649.
9897 2005-07-26 Raja R Harinath <rharinath@novell.com>
9900 * class.cs (Constructor.Emit): Reset block to null if the block
9903 2005-07-25 Marek Safar <marek.safar@seznam.cz>
9905 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
9907 2005-07-25 Marek Safar <marek.safar@seznam.cz>
9909 * class.cs (MethodData.Define): Check whether accessor implementing
9910 interface is public.
9912 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
9914 2005-07-22 Marek Safar <marek.safar@seznam.cz>
9917 * namespace.cs (LookupType): Moved same type check to...
9919 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
9922 2005-07-21 Raja R Harinath <rharinath@novell.com>
9924 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
9925 already found a typebuilder.
9926 * class.cs (MethodCore.IsDuplicateImplementation): Compare
9927 MemberNames, not strings.
9929 * const.cs (Error_ExpressionMustBeConst):
9930 Rename from Error_EpressionMustBeConst.
9931 * const.cs, class.cs, statement.cd: Update.
9933 2005-07-21 Marek Safar <marek.safar@seznam.cz>
9937 * const.cs (Const.LookupConstantValue): Report missing contant expression
9939 (Error_EpressionMustBeConstant): Only one error method.
9941 * class.cs, statement.c: Updated.
9943 2005-07-20 Raja R Harinath <rharinath@novell.com>
9945 * statement.cs (Block.Flags): Add back HasVarargs.
9946 (Block.flags): Make protected.
9947 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
9949 * typemanager.cs (types, typecontainers, user_types): Remove.
9950 (UserTypes, TypeContainers): Likewise.
9951 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
9952 (CleanUp, Reset): Update.
9953 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
9954 (GetNestedType): Use Type.GetNestedType.
9955 (CoreLookupType): Take two arguments, the namespace and the
9956 basename of the type. Update to use the Namespace.Lookup
9958 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
9959 (RealMemberLookup): Use IsNestedChildOf instead of playing with
9960 string concatenation and substring matches.
9961 * class.cs, enum.cs, delegate.cs: Update to changes.
9963 2005-07-20 Marek Safar <marek.safar@seznam.cz>
9965 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
9966 Expression and made virtual.
9968 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
9969 (ImplicitStandardConversionExists): Fixed `byte' typo ?
9971 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
9973 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
9976 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
9979 2005-07-18 Marek Safar <marek.safar@seznam.cz>
9982 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
9983 AssemblyCultureAttribute is not used on executable.
9986 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
9988 2005-07-16 Raja R Harinath <rharinath@novell.com>
9991 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
9992 New. Reports CS0252/CS0253.
9993 Mostly taken from preliminary patch by Duncak Mak.
9994 (Binary.DoResolveOperator): Store results of operator lookup.
9995 Use them to detect if we need to warn about unintended reference
9998 2005-07-15 Raja R Harinath <rharinath@novell.com>
10001 * namespace.cs (Namespace.Lookup): Add back location parameter.
10002 (Namespace.LookupType): Add CS0436 report. Add location parameter.
10003 * delegate.cs, ecore.cs, expression.cs: Update to changes.
10005 * codegen.cs (EmitContext.DeclSpace): Make readonly.
10006 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10007 (Namespace.LookupType): ... this.
10008 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10010 * typemanager.cs (LookupTypeReflection): Remove buggy code that
10011 purported to handle pointers.
10012 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10015 2005-07-15 Marek Safar <marek.safar@seznam.cz>
10017 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10020 2005-07-15 Raja R Harinath <rharinath@novell.com>
10022 * namespace.cs (Namespace.Lookup): Drop location parameter.
10023 (NamespaceEntry.LookupAlias): Remove. Merge into ...
10024 (NamespaceEntry.Lookup): ... this.
10025 (NamespaceEntry.Error_AmbiguousTypeReference):
10026 Move here from DeclSpace.
10027 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10029 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10030 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10031 Move to NamespaceEntry.
10032 * delegate.cs, expression.cs: Update to changes.
10034 2005-07-14 Marek Safar <marek.safar@seznam.cz>
10036 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10037 CheckAttributeType and refactored.
10038 (Attribute.ResolvePossibleAttributeType): Changed to reuse
10039 ResolveAsTypeTerminal error handling.
10040 (ResolveAsTypeTerminal): Introduced because of global attributes extra
10042 (GetSignatureForError): Print errors in same way.
10045 * codegen.cs: Reflect attribute GetSignatureForError change.
10048 * expression.cs: Add silent parameter to ResolveAsTypeStep.
10050 * namespace.cs (UsingEntry): Refactored to make fields private.
10053 statement.cs: Error_UnexpectedKind has extra parameter.
10055 2005-07-14 Raja R Harinath <rharinath@novell.com>
10057 * ecore.cs (IAlias): Remove.
10058 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
10059 that implement the interface.
10060 * namespace.cs (Namespace): Likewise.
10061 (Namespace.declspaces): Renamed from 'defined_names'.
10062 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
10063 DeclSpace instead of an IAlias.
10064 * tree.cs (Tree.AddDecl): Update.
10066 2005-07-12 Raja R Harinath <rharinath@novell.com>
10068 * statement.cs (Block.Flags); Remove HasVarargs.
10069 (Block.HasVarargs): Move to ToplevelBlock.
10070 (Block.ThisVariable, Block.AddThisVariable): Likewise.
10071 (Block.Variables): Make protected. Initialize variable hashtable
10073 (Block.AddVariable): Update.
10074 (Block.Resolve): Update to changes.
10075 (ToplevelBlock.HasVarargs): New boolean.
10076 (ToplevelBlock.ThisVariable): Move here from Block.
10077 (ToplevelBlock.AddThisVariable): Likewise.
10078 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
10079 * expression.cs (This.ResolveBase): Update to changes.
10080 (ArglistAccess.DoResolve): Likewise.
10082 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10085 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10087 * class.cs (TypeContainer.VerifyMembers): Distinguish between
10088 not used and not used & assigned.
10089 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10091 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10094 * expression.cs (Is.DoResolve): null is never provided type.
10096 2005-07-08 Marek Safar <marek.safar@seznam.cz>
10099 * cs-parser.jay: Less strict event error rule to catch more errors.
10101 2005-07-08 Martin Baulig <martin@ximian.com>
10103 Fix test-iter-10.cs - distinguish whether we `yield' in a property
10104 gettter (allowed) or setter (not allowed).
10106 * class.cs (Accessor): Implement IIteratorContainer.
10107 (Accessor.Yields): New public field.
10108 (PropertyBase.PropertyMethod.Define): Handle iterators on a
10109 per-accessor basis.
10112 (get_accessor_declaration, set_accessor_declaration): Set the
10113 `yields' flag on the accessor, not the property.
10114 (property_declaration): Do the iterators check on a per-accessor
10115 basis and not for the whole property.
10117 2005-07-08 Martin Baulig <martin@ximian.com>
10119 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10120 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10122 2005-07-07 Marek Safar <marek.safar@seznam.cz>
10125 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10126 (ExtractSecurityPermissionSet): Cope with self referencing security
10127 attributes properly.
10129 * driver.cs (SetOutputFile): Made public property OutputFile.
10131 2005-07-07 Raja R Harinath <rharinath@novell.com>
10134 * class.cs (TypeContainer.first_nonstatic_field): Rename from
10135 has_nonstatic_fields. Make into a FieldBase pointer.
10136 (TypeContainer.AddField): Add CS0282 check.
10137 (TypeContainer.EmitType): Update.
10139 2005-07-06 Miguel de Icaza <miguel@novell.com>
10141 * cs-tokenizer.cs (consume_identifier): Do not create strings to
10142 compare if they start with __.
10144 2005-07-06 Raja R Harinath <rharinath@novell.com>
10146 * statement.cs (Switch.SwitchGoverningType): Only look at
10147 UserCasts that don't need implicit standard conversions to one of
10148 the allowed switch types (Fixes test-322.cs).
10149 (LocalInfo.Resolve): Re-enable sanity-test.
10151 2005-07-06 Marek Safar <marek.safar@seznam.cz>
10153 * cs-tokenizer.cs (consume_identifier): Detect double undescores
10155 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
10157 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
10159 2005-07-06 Raja R Harinath <rharinath@novell.com>
10162 * ecore.cs (SimpleName.GetSignatureForError): Add.
10163 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
10164 (MemberAccess.GetSignatureForError): Add.
10166 2005-07-05 Marek Safar <marek.safar@seznam.cz>
10168 The big error and warning messages review.
10198 * typemanager.cs: Updated.
10200 * class.cs: (MethodCore.SetYields): Moved here to share.
10201 (PropertyMethod.Define): Moved iterator setup here.
10203 * iterators.cs: Add orig_method to have full access to parent
10206 2005-07-05 Raja R Harinath <rharinath@novell.com>
10208 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
10209 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
10210 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
10211 variable of struct type.
10212 * expression.cs (Unary.ResolveOperator): Update to change.
10213 (Indirection.VerifyFixed): Likewise.
10214 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
10215 (ParameterReference.VerifyFixed): Value parameters are fixed.
10216 (This.VerifyFixed): Treat 'this' as a value parameter.
10217 * statement.cs (LocalInfo.IsFixed): Remove.
10219 2005-07-01 Martin Baulig <martin@ximian.com>
10221 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
10222 `ec.EmitThis ()' to get the correct scope.
10224 2005-07-01 Martin Baulig <martin@ximian.com>
10226 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
10227 instance is a ParameterReference; fixes #75299.
10229 2005-07-01 Martin Baulig <martin@ximian.com>
10231 Reverted Marek's latest patch (r46725):
10232 - it contains structural changes which are neither mentioned in
10233 the ChangeLog nor explained anywhere; for example the additional
10234 argument of EmitContext's and Iterator's .ctor's and the
10235 TypeContainer.DefineMembers() change.
10236 - structural changes like this should go in in seperate patches
10237 and not be hidden in a huge patch which just seems to affect
10238 warnings and errors.
10239 a big and hard to understand patch.
10240 - it breaks iterators and causes regressions, for instance in
10243 2005-06-30 Raja R Harinath <rharinath@novell.com>
10246 * expression.cs (Indexers.map): Remove.
10247 (Indexers.Append): Filter out inaccessible setters and getters.
10248 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
10251 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
10252 Refactored from ...
10253 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
10254 (FieldExpr.Emit, PropertyExpr.Emit): Update.
10255 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
10256 * expression.cs (Invocation.EmitCall): Add CS0120 check.
10258 2005-06-30 Marek Safar <marek.safar@seznam.cz>
10261 * class.cs (FieldBase.GetInitializerExpression): One more field
10264 2005-06-28 Miguel de Icaza <miguel@novell.com>
10266 * pending.cs: Do not define a proxy if the base method is virtual,
10267 it will be picked up by the runtime (bug 75270).
10269 2005-06-08 Martin Baulig <martin@ximian.com>
10271 The big Iterators rewrite :-)
10273 * iterators.cs: Rewrite this to use the anonymous methods framework.
10275 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
10276 before the TypeContainers; see 2test-21.cs.
10279 (TypeContainer.DefineType): Don't create a new EmitContext if we
10280 already have one (this only happens if we're an Iterator).
10281 (TypeContainer.Define): Also call Define() on all our iterators.
10282 (Method.CreateEmitContext): Added support for iterators.
10285 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
10286 (AnonymousContainer.CreateMethodHost): Moved here from
10287 AnonymousMethod and made abstract.
10288 (AnonymousContainer.CreateScopeType): New abstract method.
10289 (AnonymousContainer.IsIterator): New public property.
10290 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
10291 get the ScopeTypeBuilder rather than manually defining it here.
10292 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
10295 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
10296 before RootContext.DefineTypes().
10298 * codegen.cs (EmitContext.RemapToProxy): Removed.
10299 (EmitContext.CurrentAnonymousMethod): Changed type from
10300 AnonymousMethod -> AnonymousContainer.
10301 (EmitContext.ResolveTopBlock): Protect from being called twice.
10302 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
10303 (EmitContext.EmitThis): Removed the iterators hacks; use the
10304 anonymous methods framework for that.
10307 (ToplevelBlock.Container): Make this a property, not a field.
10308 (ToplevelBlock.ReParent): New public method; move the
10309 ToplevelBlock into a new container.
10310 (Foreach.TemporaryVariable): Simplify.
10312 2005-06-05 Martin Baulig <martin@ximian.com>
10314 * statement.cs (LocalInfo.CompilerGenerated): New flag.
10315 (Block.AddTemporaryVariable): New public method; creates a new
10316 `LocalInfo' for a temporary variable.
10317 (Block.EmitMeta): Create the LocalBuilders for all the temporary
10319 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
10320 non-iterator variables.
10322 2005-06-05 Martin Baulig <martin@ximian.com>
10324 * statement.cs (Foreach.TemporaryVariable): Create the
10325 LocalBuilder in the Emit phase and not in Resolve since in some
10326 situations, we don't have an ILGenerator during Resolve; see
10327 2test-19.cs for an example.
10329 2005-06-04 Martin Baulig <martin@ximian.com>
10331 **** Merged r45395 from GCS ****
10333 The big Foreach rewrite - Part II.
10335 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
10336 with `PropertyInfo ienumerator_getcurrent'.
10338 * codegen.cs (VariableStorage): Removed.
10341 (Foreach): Derive from Statement, not ExceptionStatement.
10342 (Foreach.CollectionForeach): New nested class. Moved all the code
10343 dealing with collection foreach here.
10344 (Foreach.ForeachHelperMethods): Removed.
10345 (Foreach.TemporaryVariable): Implement IMemoryLocation.
10347 2005-05-23 Martin Baulig <martin@ximian.com>
10349 * statement.cs (Try.DoResolve): Don't create a `finally' if we
10350 don't need to. Fix #75014.
10352 2005-05-20 Martin Baulig <martin@ximian.com>
10354 Merged r44808 from GMCS.
10356 * class.cs (TypeContainer.CircularDepException): Removed.
10357 (TypeContainer.DefineType): Removed the `InTransit' stuff.
10358 (TypeContainer.CheckRecursiveDefinition): Check for circular class
10359 (CS0146) and interface (CS0529) dependencies here.
10361 2005-06-21 Raja R Harinath <rharinath@novell.com>
10363 * expression.cs (Invocation.EmitCall): Fix initialization
10364 'this_call' to reflect current behaviour. Fix indentation.
10366 * convert.cs (FindMostEncompassedType): Add two trivial special
10367 cases (number_of_types == 0 || number_of_types == 1).
10368 (FindMostEncompasingType): Likewise.
10370 2005-06-17 Raja R Harinath <rharinath@novell.com>
10372 Some cleanups preparing for the fix of #75283.
10373 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
10375 (EventExpr.InstanceResolve): Likewise.
10376 (EventExpr.DoResolve): Remove redundant checks.
10378 2005-06-10 Duncan Mak <duncan@novell.com>
10380 * cs-tokenizer.cs (process_directives): New flag for controlling
10381 the processing of preprocessor directives.
10382 (x_token): After seeing a '#', return Token.NONE instead of going
10383 to handle_preprocessing_directive() when not processing
10384 directives. This avoids unnecessary processing during the token peek in
10389 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
10390 the existing error reporting methods instead of Report.Error.
10392 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
10393 after Raja's rewrite.
10395 2005-06-08 Miguel de Icaza <miguel@novell.com>
10397 * class.cs: Small fix.
10399 2005-06-08 Raja R Harinath <rharinath@novell.com>
10402 * class.cs (GetPartialBases): Fix return value check of
10403 part.GetClassBases.
10405 2005-06-07 Raja R Harinath <rharinath@novell.com>
10407 Ensure that partial classes are registered in their enclosing
10408 namespace. Initial part of fix of #75160.
10409 * tree.cs (Tree.RecordDecl): Add new namespace argument.
10410 Register declspace with namespace here, not in
10411 DeclSpace.RecordDecl.
10412 * cs-parser.jay: Pass namespace to RecordDecl.
10413 * class.cs (PartialContainer.Create): Likewise.
10414 (ClassPart.DefineType): New sanity-check. Throws an exception if
10416 * decl.cs (Declspace.RecordDecl): Remove.
10417 * namespace.cs (NamespaceEntry.DefineName): Remove.
10419 2005-06-06 Marek Safar <marek.safar@seznam.cz>
10421 * rootcontext.cs: Reset TargetExt as well.
10423 2005-06-03 Raja R Harinath <rharinath@novell.com>
10425 * ecore.cs (Expression.Resolve): Emit CS0654 error when
10426 -langversion:ISO-1.
10428 2005-06-02 Raja R Harinath <rharinath@novell.com>
10430 Fix #75080, cs0119.cs.
10431 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
10433 (Expression.Resolve): ... this. Use it. Remove bogus code
10434 allowing ExprClass.Type and ExprClass.Namespace for
10435 ResolveFlags.VariableOrValue.
10436 (Expression.Resolve) [1-argument variant]: Change default resolve
10437 flags based on language version.
10438 (Expression.Error_UnexpectedKind): Use a simple string array
10439 rather than an ArrayList.
10440 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
10441 not ExprClass.Type.
10442 (TypeOfVoid.DoResolve): Likewise.
10443 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
10444 flags argument -- it always has the same value.
10446 2005-05-31 Raja R Harinath <rharinath@novell.com>
10449 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
10450 Use it in the error message.
10451 * assign.cs, expression.cs, statement.cs: Update.
10453 2005-05-30 Raja R Harinath <rharinath@novell.com>
10456 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
10457 the "almostMatchedMember" case too.
10458 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
10459 that failed the accessibility checks to 'almost_match'.
10461 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
10463 * attribute.cs: Use internal MethodBuilder methods to set
10464 ExactSpelling and SetLastError on PInvoke methods, instead
10465 of passing them via charset. Fixes #75060.
10467 2005-05-27 Raja R Harinath <rharinath@novell.com>
10469 * parameter.cs (Parameter): Remove TODO comment.
10470 (Parameter.DefineParameter): Remove Location parameter.
10471 (Parameters.LabelParameters): Likewise.
10472 * class.cs (Constructor.Emit): Update to change.
10473 (MethodData.Emit): Likewise.
10474 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
10475 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
10477 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
10480 Removed Parameters.Location and added Parameter.Location instead.
10481 Removed Location parameter from Emit() and GetSignature().
10488 Modified all related calls.
10490 2005-05-26 Raja R Harinath <rharinath@novell.com>
10492 Improve user-defined conversion handling.
10493 * convert.cs (GetConversionOperators): Rewrite. Return only the
10494 applicable operators.
10495 (AddConversionOperators): New. Helper for GetConversionOperators.
10496 (FindMostEncompassedType, FindMostEncompassingType): Verify that
10497 there is only one most encompassed/encompassing type.
10498 (FindMostSpecificSource, FindMostSpecificTarget): Remove
10499 "applicable operator" handling.
10500 (UserConversion): Move cache here from GetConversionOperators.
10501 Directly cache the chosen operator, rather than the whole
10503 (ExplicitNumericConversion): Fix buggy implementation of Decimal
10504 case. Allow conversion of decimal to sbyte and byte too.
10505 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
10506 New static methods. Used to avoid allocating EmptyExpressions in
10509 2005-05-24 Duncan Mak <duncan@novell.com>
10511 * ecore.cs (CastFromDecimal): New class for casting a decimal to
10512 another class, used in Convert.ExplicitNumericConversion.
10513 (CastToDecimal): New class, similar to above, but casts to
10514 System.Decimal, used in Convert.ImplicitNumericConversion and also
10515 in explicit convesion from double/float to decimal.
10517 * convert.cs (ImplicitNumericConversion): Handle implicit
10518 conversions to System.Decimal.
10519 (ExplicitNumericConversion): handle explicit conversions to
10524 2005-05-20 Miguel de Icaza <miguel@novell.com>
10526 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
10527 know the type at this stage, just break through. Fixes #75008
10529 2005-05-19 Martin Baulig <martin@ximian.com>
10532 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
10533 to disable error reporting.
10535 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
10536 here since we don't want to report an error; see the new test-336.cs.
10538 2005-05-19 Raja R Harinath <rharinath@novell.com>
10540 * statement.cs (ToplevelBlock.GetParameterReference)
10541 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
10542 Move here from class Block.
10543 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
10544 * expression.cs (ParameterReference.DoResolveBase): Likewise.
10546 2005-05-18 Martin Baulig <martin@ximian.com>
10551 (FlowBranching.Reachability): Add non-static public And() and Or()
10553 (FlowBranchingSwitch): New class; do the `break_origins' thing
10554 like in FlowBranchingLoop.
10555 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
10556 reachability, not just locals and parameters.
10557 (FlowBranching.MergeChild): Remove some of the hacks for loop and
10558 switch; MergeBreakOrigins() now takes care of that.
10560 2005-05-18 Martin Baulig <martin@ximian.com>
10562 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10563 a loop and may leave it, reset the barrier; fixes #74974.
10565 2005-05-17 Marek Safar <marek.safar@seznam.cz>
10567 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
10570 * cs-parser.jay: Catch more lexical errors.
10572 * report.cs: Add one more Error method.
10575 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
10577 2005-05-17 Martin Baulig <martin@ximian.com>
10579 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
10582 2005-05-16 Raja R Harinath <rharinath@novell.com>
10584 Fix test-382.cs. Emit values of decimal constants.
10585 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
10587 (TypeContainer.AddField): ... this.
10588 (TypeContainer.EmitFieldInitializers): Allow the list of fields
10589 with initializers to include 'Const's.
10590 (ClassPart.RegisterFieldForInitialization): Forward to
10592 * const.cs (Const.Const): Pass initializer to base class.
10593 (Const.Define): In case of decimal constants, register them for
10594 initialization in a static constructor.
10596 2005-05-14 Martin Baulig <martin@ximian.com>
10598 * statement.cs (Block.Resolve): Correctly handle unreachable code;
10599 do not call ResolveUnreachable() on unreachable statements in
10600 here, see the comment in the source code.
10602 2005-05-13 Raja R Harinath <rharinath@novell.com>
10605 * expression.cs (BinaryResolveOperator): If one of the operands of
10606 an equality comparison is 'null' and the other is a pointer type,
10607 convert the null to a NullPointer.
10608 * convert.cs (ImplicitReferenceConversion): If the expression is a
10609 NullLiteral and the target type is a pointer type, return a
10610 NullPointer instead.
10611 (ImplicitConversionStandard): Likewise.
10613 2005-05-13 Marek Safar <marek.safar@seznam.cz>
10615 * cs-parser.jay: Set readonly context based on special constructs.
10617 * expression.cs (LocalVariableReference.DoResolveBase): Improved
10618 readonly variable error handling.
10620 * rootcontext.cs (EmitCode): Don't verify members when error
10623 * statement.cs (LocalInfo): Add reaodnly context information.
10624 (SetReadOnlyContext, GetReadOnlyContext): New methods.
10626 2005-05-13 Raja R Harinath <rharinath@novell.com>
10628 * statement.cs (Block.Resolve): Revert change below. Modify fix
10629 for #74041 to initialize 'resolved' to false only for explicit
10630 blocks. Fixes #74873.
10632 2005-05-12 Raja R Harinath <harinath@gmail.com>
10635 * typemanager.cs (unmanaged_enclosing_types): New.
10636 (IsUnmanagedType): Avoid infloops by using
10637 'unmanaged_enclosing_types' to talk with recursive invocations.
10639 2005-05-13 Martin Baulig <martin@ximian.com>
10641 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
10642 instance variable, not a local. Fix #74873.
10643 (Block.ResolveUnreachable): Set it to true here.
10645 2005-05-11 Duncan Mak <duncan@novell.com>
10647 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
10648 continuing to process for 'arg'.
10649 (handle_preprocessing_directive): Check the argument of the #endif
10650 directive and report error CS1025 if there are any trailing
10653 According to the C# spec, having even whitespace after the #endif
10654 directive is illegal; however, because we call arg.TrimEnd ()
10655 beforehand, we have the same behavior as csc, allowing whitespace
10656 after the directive.
10660 2005-05-11 Marek Safar <marek.safar@seznam.cz>
10664 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
10665 (Constructor.GetObsoleteAttribute): Implemented correctly.
10667 2005-05-10 Martin Baulig <martin@ximian.com>
10669 * support.cs (ReflectionParameters.ParameterModifier): Use
10670 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
10671 and `ParameterAttributes.In'. Fixes #74884.
10673 2005-05-10 Marek Safar <marek.safar@seznam.cz>
10675 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
10677 * expression.cs (Argument.GetParameterModifier): Turned to property.
10678 (Invocation.Error_InvalidArguments): Add more descriptive errors.
10680 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
10683 2005-05-09 Raja R Harinath <rharinath@novell.com>
10686 * decl.cs (MemberCache.AddMethods): Register override methods,
10687 rather than non-override methods.
10688 * typemanager.cs (RegisterOverride): New.
10689 (IsOverride): Update.
10691 2005-05-09 Marek Safar <marek.safar@seznam.cz>
10695 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
10696 recursive declaration.
10698 * statement.cs (Block.ResolveMeta): Report any error in resolving.
10700 2005-05-06 Marek Safar <marek.safar@seznam.cz>
10702 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
10704 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
10706 2005-05-05 Raja R Harinath <rharinath@novell.com>
10709 * decl.cs (DeclSpace.FamilyAccessible):
10710 Use TypeManager.IsNestedFamilyAccessible.
10712 Fix reopened #64812.
10713 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
10716 2005-05-04 Raja R Harinath <rharinath@novell.com>
10717 Abin Thomas <projectmonokochi@rediffmail.com>
10718 Anoob V E <projectmonokochi@rediffmail.com>
10719 Harilal P R <projectmonokochi@rediffmail.com>
10722 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
10723 allow access to all static members.
10725 2005-05-04 Martin Baulig <martin@ximian.com>
10727 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
10729 2005-05-04 Martin Baulig <martin@ximian.com>
10733 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
10734 section at the end; make things work if `default' is not the last
10737 2005-05-04 Martin Baulig <martin@ximian.com>
10741 * statement.cs (Switch): Replaced the `got_default' field with a
10742 `default_section' one.
10743 (Switch.CheckSwitch): Set `default_section' here.
10744 (Switch.Resolve): If we're a constant switch and the constant is
10745 not found, use the default section.
10747 2005-05-03 Martin Baulig <martin@ximian.com>
10749 * expression.cs (ArrayAccess.EmitGetLength): New public method.
10751 * statement.cs (Foreach.ArrayForeach): New nested class.
10752 (Foreach.TemporaryVariable): New nested class.
10753 (Foreach.EmitArrayForeach): Removed; this is now in the new
10754 ArrayForeach class.
10756 2005-05-03 Raja R Harinath <rharinath@novell.com>
10758 * pending.cs (BaseImplements): Move the #74773 fix here. This is
10760 (VerifyPendingMethods): Revert change below.
10762 * typemanager.cs (IsOverride, RegisterNonOverride): New.
10763 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
10764 that used to trigger warning -28. Remove warning -28.
10765 * expression.cs (Invocation.OverloadResolve): Use
10766 TypeManager.IsOverride to distinguish override methods.
10769 * pending.cs (VerifyPendingMethods): If a base type implements the
10770 requested interface, don't bother checking individual methods of
10771 the base type. As a side-effect, this prevents the creation of
10772 unnecessary proxies.
10774 2005-05-02 Martin Baulig <martin@ximian.com>
10778 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10779 Also `And' the locals if the old vector is null.
10780 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
10781 null; in this case we basically reset all the variables.
10783 2005-05-02 Martin Baulig <martin@ximian.com>
10787 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
10788 Added `FlowBranching branching' argument; always `and' the
10789 variables instead of `or'ing them unless we're an infinite loop.
10791 * statement.cs (While.Resolve): Create a new sibling unless we're
10794 2005-05-02 Martin Baulig <martin@ximian.com>
10798 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
10799 arguments; use it instead of creating a new TopLevelBlock.
10800 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
10801 our ConstructorInitializer.
10804 (TopLevelBlock.TopLevelBranching): New public property.
10805 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
10806 and create our `TopLevelBranching'.
10808 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
10809 anonymous method host, use `block.TopLevelBranching' rather than
10810 creating a new branching.
10812 2005-04-20 Miguel de Icaza <miguel@novell.com>
10814 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
10815 a ScopeInfo, if any of the current children is a child of the new
10816 entry, move those children there.
10818 2005-04-30 Martin Baulig <martin@ximian.com>
10820 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
10821 at the beginning of a SwitchSection. Fix #73335.
10823 2005-04-27 Marek Safar <marek.safar@seznam.cz>
10826 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
10828 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
10829 (FieldExpr.DoResolve): Obsolete members are ignored for field
10832 2005-04-26 Marek Safar <marek.safar@seznam.cz>
10834 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
10835 of arrays detection.
10837 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
10839 (Field.VerifyClsCompliance): Volatile fields are not compliant.
10841 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
10844 2005-04-25 Ben Maurer <bmaurer@ximian.com>
10846 * cs-parser.jay: Use the prefered version of -unsafe in error
10849 2005-04-22 Marek Safar <marek.safar@seznam.cz>
10851 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
10854 2005-04-20 John Luke <john.luke@gmail.com>
10856 * driver.cs: fix typo in error message, --outout to --output
10858 2005-04-20 Marek Safar <marek.safar@seznam.cz>
10860 * codegen.cs (InRefOutArgumentResolving): New field.
10862 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
10863 fields outside contructor.
10865 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
10867 2005-04-19 Miguel de Icaza <miguel@novell.com>
10869 * anonymous.cs (CaptureContext.EmitParameterInstance): The
10870 parameter code was not completed ever, so it was not as up-to-date
10871 as local variables. Must finish it.
10873 The bug fix was to compare the Toplevel of the block, not the
10874 current block. Thanks for Ben for pointing this out.
10876 2005-04-19 Raja R Harinath <rharinath@novell.com>
10878 * decl.cs (AddMethods): Use the declaring type of the problem
10879 method to determine if we want to squash a warning.
10881 2005-04-19 Marek Safar <marek.safar@seznam.cz>
10883 * attribute.cs: Removed debug output.
10885 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
10887 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
10890 2005-04-18 Raja R Harinath <rharinath@novell.com>
10893 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
10894 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
10895 all null comparisons against reference types.
10897 2005-04-18 Marek Safar <marek.safar@seznam.cz>
10900 * class.cs (TypeContainer.CircularDepException) New nested
10902 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
10903 (TypeContainer.DefineType): Removed error, reset InTransit before
10905 (Class.DefineType): Throw exception when is in Transit.
10906 Catch exception and report error.
10907 (Struct.DefineType): Throw exception when is in Transit.
10908 Catch exception and report error.
10909 (Interface.DefineType): Throw exception when is in Transit.
10910 Catch exception and report error.
10912 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
10913 handle nested exception handlers.
10915 * flowanalysis.cs (InTryWithCatch): New method, search for try with
10918 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
10919 InFinally and InCatch storage.
10921 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
10922 (Catch.Resolve): Set and Restore ec.InCatch.
10923 (Try.Resolve): Set and Restore ec.InFinally.
10924 (Try.HasCatch): True when try has catch.
10926 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
10928 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
10929 for the same event member, so exclude such cases from warning 419.
10932 2005-04-16 Miguel de Icaza <miguel@novell.com>
10934 * expression.cs (Binary.ResolveOperator): Apply patch from John
10935 Luke to fix bug 59864: operators &, | and ^ on enumerations
10936 require that the same enum type on both sides.
10938 * driver.cs: Add warnings to old flag usage, this is to assist
10939 people who produce Makefiles and hope that the Makefiles will be
10942 * class.cs (TypeContainer.EmitType): Moved the definition of the
10943 special $PRIVATE$ field from the resolve phase to the Emit phase.
10944 During resolve we do not know if we are a struct with
10945 HasExplicitLayout, we know this only after the attributes for the
10948 Set the FieldOffset to zero on the dummy field that we create for
10949 the class. Fixes 74590.
10951 2005-04-16 Raja R Harinath <rharinath@novell.com>
10954 * ecore.cs (PropertyExpr.resolved): New.
10955 (DoResolve): Use it to handle a case of double resolution here.
10956 Handle a case of identical-name-and-type-name.
10957 * expression.cs (ArrayCreation.CheckIndices): Avoid double
10958 resolution by storing the results of expression resolution back
10959 into the "probes" array.
10961 2005-04-15 Raja R Harinath <rharinath@novell.com>
10963 Fix cs0208-7.cs and cs0208-8.cs.
10964 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
10965 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
10966 error reporting to point out the reason a struct is not unmanaged.
10968 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
10970 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
10971 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
10973 2005-04-13 Raja R Harinath <rharinath@novell.com>
10976 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
10977 IdenticalNameAndTypeName here.
10978 (EventExpr.InstanceResolve): Likewise.
10980 2005-04-13 Marek Safar <marek.safar@seznam.cz>
10982 C# 2.0 DefaultCharSetAttribute implementation
10984 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
10985 which allows us to set GlobalNamespace for every resolve.
10986 (Attribute.ResolveArguments): Cut from Resolve.
10987 (Attribute.GetCharSetValue): Returns CharSet named argument.
10988 (Attribute.DefinePInvokeMethod): Gets default charset from
10990 (GlobalAttribute.ResolveAsTypeStep): Override.
10991 (GlobalAttribute.ResolveArguments): Override.
10993 * class.cs (TypeAttr): Is protected.
10995 * codegen.cs (ModuleClass.DefaultCharSet): New member.
10996 (ModuleClass.DefaultCharSetType): New memeber.
10997 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
10999 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11000 charset from module.
11002 * delegate.cs (TypeAttr): Override.
11003 (Delegate.DefineType): Use this TypeAttr.
11005 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11006 at very early stage (before types are defined) to resolve model
11007 module attributes. It will probably not work with corlib but it
11010 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11011 charset from module.
11013 * typemanager.cs (default_charset_type): New type.
11015 2005-04-13 Raja R Harinath <rharinath@novell.com>
11017 * decl.cs (MemberCache.AddMethods): Don't warn if
11018 System.Object.Finalize has buggy MethodAttributes.
11020 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11023 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11025 * doc.cs : detect ambiguous reference to overloaded members.
11026 Fixed bug #71603. MS 1.1 csc does not detect it.
11028 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11030 * doc.cs : delegates must not be referenced with parameters.
11033 2005-04-12 Miguel de Icaza <miguel@novell.com>
11035 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11037 2005-04-10 Miguel de Icaza <miguel@novell.com>
11039 * driver.cs (MainDriver): Stop processing if the CLS stage found
11042 (CompilerCallableEntryPoint.InvokeCompiler): Always
11043 reset after execution; Take a TextWriter argument for the
11046 * report.cs: Use the error stream instead of hardcoding stderr.
11048 2005-04-09 Miguel de Icaza <miguel@novell.com>
11050 * class.cs: Reduce code paths to test, too small of an
11051 optimization to make it worth the extra testing. Always perform
11054 2005-04-08 Raja R Harinath <rharinath@novell.com>
11057 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11058 operators that had errors reported on them.
11060 2005-04-08 Marek Safar <marek.safar@seznam.cz>
11062 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11064 (Attribute.Resolve): Add named argument type checking.
11066 * class.cs (FixedField.Define): Use IsPrimitiveType
11068 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11070 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11071 unsafe parameter types.
11073 * statement.cs (Using.ResolveExpression): Add better error description.
11075 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11077 2005-04-08 Raja R Harinath <rharinath@novell.com>
11080 * attribute.cs (Attribute.GetAttributeUsage): Resolve
11081 AttributeUsageAttribute in the emitcontext of the attribute class,
11082 not in the emitcontext of the attributable entity it was attached to.
11083 * cs-parser.jay: Use 'current_class', not 'current_container',
11084 when creating a GlobalAttribute.
11086 2005-04-08 Alp Toker <alp@atoker.com>
11088 * pending.cs: The fix to #58413 failed to compile methods implementing
11089 interfaces with/without params modifiers and vice versa, even though
11090 params modifiers aren't part of the signature. Make the modifier check
11091 less strict as in csc.
11093 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
11094 Anoob V E <projectmonokochi@rediffmail.com>
11095 Harilal P R <projectmonokochi@rediffmail.com>
11098 * pending.cs (TypeAndMethods.mods): New. Store the parameter
11099 modifiers of pending methods.
11100 (PendingImplementation.PendingImplementation): Initialize it.
11101 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11102 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11103 with ParameterData. Add check for modifiers.
11104 * class.cs (MethodData.Define): Update to changes.
11106 2005-04-07 Raja R Harinath <rharinath@novell.com>
11108 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11110 2005-04-07 Marek Safar <marek.safar@seznam.cz>
11112 * class.cs (PropertyMethod.Define): Check private accessor in abstract
11115 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11118 * typemanager.cs: Registered RequiredAttributeAttribute.
11120 2005-04-06 Marek Safar <marek.safar@seznam.cz>
11122 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11123 Warning CS0169 is back at level 3.
11124 (IMethodData.SetMemberIsUsed): New method.
11126 * decl.cs (IsUsed): New value; moved from FieldBase.Status
11127 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
11129 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
11131 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
11133 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
11136 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
11139 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
11140 to avoid the problems with nested types.
11142 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
11143 Anoob V.E <projectmonokochi@rediffmail.com>
11144 Harilal P.R <projectmonokochi@rediffmail.com>
11145 Raja R Harinath <rharinath@novell.com>
11148 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
11150 * typemanager (GetConstructor): Make public.
11152 2005-04-05 John Luke <john.luke@gmail.com>
11153 Raja R Harinath <rharinath@novell.com>
11156 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
11157 struct too. Return false quicker in a few cases.
11158 (VerifyUnManaged): Use it.
11160 2005-04-05 Raja R Harinath <rharinath@novell.com>
11163 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
11164 not 'unreachable_seen'.
11166 2005-04-04 Marek Safar <marek.safar@seznam.cz>
11168 * attribute.cs (Attribute.GetValue): Removed unused.
11170 * codegen.cs (CodeGen.TrimExt): Removed unused.
11172 * cs-parser.jay (output): Removed unused.
11174 * cs-tokenizer.cs (hex_digits): Removed unused.
11176 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
11178 * expression.cs (Indirection.LoadExprValue): Removed unused.
11179 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
11181 * iterators.cs (Iterator.param_types): Removed unused.
11183 * statement.cs (Goto.block): Removed unused.
11184 (ToplevelBlock.did): Removed unused.
11185 (Switch.ResolveConstantSwitch): Removed unused.
11187 2005-04-01 Ben Maurer <bmaurer@ximian.com>
11189 * rootcontext.cs: Allow mcs to bootstrap with the compilation
11192 2005-04-01 Raja R Harinath <rharinath@novell.com>
11194 Fix #74232 and cs0208-3.cs.
11195 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
11196 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
11197 unmanaged type. Don't use FieldBuilders when 't' is a
11198 TypeBuilder. Use ModFlags and MemberType fields.
11199 * class.cs (MemberBase.member_type): Rename from MemberType.
11200 (MemberBase.MemberType): New property. Determines member_type on
11202 (MemberBase.DoDefine): Don't initialize MemberType here.
11203 (FieldMember.Define): Likewise.
11205 2005-04-01 Marek Safar <marek.safar@seznam.cz>
11208 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
11209 Attributes are emitted there.
11211 2005-04-01 Raja R Harinath <rharinath@novell.com>
11213 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
11214 keyword in 'partial enum' too.
11215 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
11217 Report from Kamil Skalski <nazgul@omega.pl>.
11220 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
11221 have partial containers too.
11223 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
11224 in block' checks to Block.CheckInvariantMeaningInBlock.
11225 * statement.cs (Block.GetKnownVariableInfo): Make private.
11226 (Block.IsVariableUsedInChildBlock): Remove.
11227 (Block.IsVariableUsedInBlock): Likewise.
11228 (Block.CheckInvariantMeaningInBlock): New. Show location of
11229 conflicting declaration.
11230 (Block.AddVariable): Make error messages less long-winded and more
11231 specific. Show location of conflicting declaration.
11232 * parameter.cs (Parameters.Location): New readonly property.
11234 2005-03-31 Raja R Harinath <rharinath@novell.com>
11236 Clean up semantics of invoking ResolveMemberAccess.
11237 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
11238 can have an instance, ensure that we pass in a non-TypeExpression
11239 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
11240 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
11241 argument. Update to changes and simplify.
11242 (FieldExpr.Emitinstance): Remove CS0120 check.
11243 (PropertyExpr.EmitInstance): Likewise.
11244 * expression.cs (Argument.Resolve): Likewise.
11245 (Invocation.DoResolve): Update to changes in semantics of
11246 InstanceExpression.
11248 2005-03-31 Marek Safar <marek.safar@seznam.cz>
11251 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
11254 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
11256 2005-03-31 Raja R Harinath <rharinath@novell.com>
11258 Fix difference in behaviour with commandline invocation.
11259 * driver.cs (Driver.Reset): New.
11260 (CompilerCallableEntryPoint): Call it.
11262 * statement.cs (If.Resolve): Avoid spurious "uninitialized
11263 variable" warnings if the boolean expression failed to resolve.
11265 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
11267 * attribute.cs: Fix the union of several permissions when some of them
11268 are unrestricted (so the result isn't an unrestricted permission set).
11271 2005-03-30 Raja R Harinath <rharinath@novell.com>
11273 * ecore.cs (MemberExpr): New class. Convert from interface
11275 (MemberExpr.ResolveMemberAccess): Refactor and move here from
11276 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
11278 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
11279 (MethodGroupExpr.IsExplicitImpl): Remove.
11280 (Expression.GetFieldFromEvent): Remove.
11281 (SimpleName.MemberStaticCheck): Remove.
11282 (SimpleName.DoSimpleNameResolve): Update to changes.
11283 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
11284 (MemberAccess.IdenticalNameAndTypeName): Remove.
11285 (MemberAccess.error176): Move to MemberExpr.
11286 (MemberAccess.DoResolve): Update to changes.
11287 (BaseAccess.DoResolve): Likewise.
11289 2005-03-30 Marek Safar <marek.safar@seznam.cz>
11291 C# 2.0 Conditional attribute class implementation
11293 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
11294 Analyzes class whether it has attribute which has ConditionalAttribute
11295 and its condition is not defined.
11297 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
11298 (Class.IsExcluded): New method. Search for at least one defined
11299 condition in ConditionalAttribute of attribute class.
11301 2005-03-30 Raja R Harinath <rharinath@novell.com>
11303 * ecore.cs (PropertyExpr): Derive from Expression, not
11304 ExpressionStatement.
11305 (PropertyExpr.EmitStatement): Remove.
11307 2005-03-29 Raja R Harinath <rharinath@novell.com>
11310 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
11311 internal field "value__" of an enum be private. The examples for
11312 "value__" that I found on MSDN all used FieldAttributes.Private.
11314 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
11315 Don't mention IL method attribute names.
11317 Fix #47991. Remove a TODO.
11318 * statement.cs (Block.Toplevel): Make into a field.
11319 (Block.Parameters): Move into ToplevelBlock.
11320 (Block.known_variables): Rename from child_variable_names.
11321 (Block.Block): Remove variants that take Parameters. Initialize
11322 'Toplevel' with the immediately surrounding toplevel block.
11323 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
11324 LocalInfo parameter.
11325 (Block.GetKnownVariableInfo): New.
11326 (Block.IsVariableNameUsedInChildBlock): Update.
11327 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
11328 the block, even though it may not be in scope.
11329 (Block.AddVariable): Remove Parameters parameter. Use
11330 Toplevel.Parameters instead.
11331 (Block.AddConstant): Remove Parameters parameter.
11332 (Block.GetParameterReference): Update to use Toplevel.Parameters.
11333 (Block.IsParamaterReference): Likewise.
11334 (Block.IsLocalParameter): Likewise. Simplify a lot.
11335 (ToplevelBlock.Parameters): New. Moved from Block.
11336 (ToplevelBlock.ToplevelBlock): Update to changes. Always
11337 initialize Parameters to a non-null value.
11338 * cs-parser.jay: Update to changes.
11339 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
11340 simple names that mean different things in the same block. Use
11341 Block.IsVariableNameUsedInBlock.
11343 2005-03-28 Raja R Harinath <rharinath@novell.com>
11345 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
11346 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
11347 GetTypeHandle. It is possible for a reflected type to derive from
11348 a TypeBuilder (e.g., int[] derives from the TypeBuilder
11349 System.Array during mscorlib compilation).
11350 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
11351 contain a method_hash, don't create one either. Don't create a
11352 deep copy of the base cache's method_hash.
11353 (MemberCache.SetupCache): Rename back from DeepCopy.
11354 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
11355 already initialized. If we see an override function, add its
11356 underlying base virtual function to the member_hash too.
11358 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
11360 2005-03-26 Raja R Harinath <harinath@acm.org>
11363 * assign.cs (Assign.DoResolve): When the RHS of an assignment
11364 fails to resolve, ensure that the LHS is still resolved as an
11367 2005-03-25 Raja R Harinath <harinath@acm.org>
11369 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
11371 (Enum.current_ec): Remove.
11372 (Enum.LookupEnumValue): Remove EmitContext argument.
11373 Just uses the one created during DefineType.
11374 (Enum.FindMembers): Update.
11375 * expression.cs (MemberAccess.DoResolve): Update.
11377 2005-03-22 Marek Safar <marek.safar@seznam.cz>
11379 * assign.cs (Assign.DoResolve): Check for CS1717 when
11380 source and target are same (uses Equals).
11382 * expression.cs (LocalVariableReference, ParameterReference,
11383 This): Implemented Equals, GetHashCode.
11385 * statement.cs (Block.GetParameterReference): Removed useless
11388 2005-03-22 Raja R Harinath <rharinath@novell.com>
11391 * statement.cs (Block.AddVariable): Ensure that we skip implicit
11392 blocks before deciding whether the error is cs0136 or cs0128.
11394 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
11395 (using_alias_directive, using_namespace_directive): Pass
11396 MemberName, not an expression to Namespace.UsingAlias and
11398 (MakeName): Use the MemberName of the namespace.
11399 * namespace.cs (Namespace.MemberName): New.
11400 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
11401 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
11403 * decl.cs (MemberName.Name): Make readonly.
11404 (MemberName.FromDotted): New "constructor".
11405 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
11406 (MemberCore.Name): Compute from MemberName on demand.
11407 (MemberCore.SetMemberName): Provide a way to change the
11409 (MemberCore.AddToContainer): Don't take a fullname parameter.
11410 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
11411 fully qualified name of the container to the member name.
11412 (TypeContainer.AddToTypeContainer): Use a fully qualified name
11413 only if the type is a member of the root container.
11414 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
11415 MemberName.Left rather than searching for an embedded ".".
11416 (PartialContainer.CreatePart): Update to changes in RootContext.
11417 (MemberBase.ShortName): Turn into a property. Use
11418 MemberCore.SetMemberName.
11419 (MemberBase.ExplicitInterfaceName): Remove.
11420 (MemberBase.UpdateMemberName): Remove.
11421 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
11422 (PropertyBase.SetMemberName): New override.
11423 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
11424 (Tree.GetDecl): New.
11425 (Tree.AllDecls): Rename from Decls.
11426 * attribute.cs, enum.cs, report.cs: Update to changes.
11427 * driver.cs (MainDriver): Use MemberName.FromDotted on
11428 RootContext.MainClass.
11430 2005-03-21 Marek Safar <marek.safar@seznam.cz>
11432 * class.cs (FixedField.Define): Check for CS1664 and more sanity
11435 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
11437 2005-03-18 Marek Safar <marek.safar@seznam.cz>
11439 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
11440 property accessor modifiers.
11442 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
11443 fixed buffer attribute (CS1716).
11444 (PropertyMethod.HasCustomAccessModifier): When property accessor
11445 has custom modifier.
11447 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
11449 (PropertyExpr.DoResolveLValue): Add CS0272.
11451 2005-03-17 Miguel de Icaza <miguel@novell.com>
11453 * convert.cs: When converting to a pointer, use the proper Conv.U
11454 or Conv.I depending on the source data type.
11456 * cs-tokenizer.cs: Make the size for large decimal constants,
11459 2005-03-17 Martin Baulig <martin@ximian.com>
11461 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
11462 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
11464 2005-03-17 Martin Baulig <martin@ximian.com>
11466 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
11467 to bool so we can return an error condition.
11468 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
11471 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
11473 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
11476 2005-03-16 Raja R Harinath <rharinath@novell.com>
11478 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
11479 Refactor to avoid traversing the list of assemblies, and to avoid
11480 string concatenation.
11481 * typemanager.cs (guid_attr_type): Remove.
11482 (negative_hits, pointers, references): Remove hashes.
11484 (GetConstructedType): New. Uses type_hash to handle constructed
11485 types (arrays, references, pointers).
11486 (GetReferenceType, GetPointerType): Use it.
11487 (GetNestedType): New. Uses type_hash to handle nested types of
11489 (LookupType, LookupTypeDirect): Remove.
11490 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
11491 'types' hash and LookupTypeReflection directly.
11492 (params_string, params_object): Use GetConstructedType.
11493 * namespace.cs (Namespace.cached_types): New. Cache of reflected
11495 (Namespace.Lookup): Use cached_types.
11496 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
11497 provided by old TypeManager.LookupType.
11498 * rootcontext.cs (MakeFQN): Remove.
11499 * decl.cs (DeclSpace.MakeFQN): Likewise.
11500 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
11501 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11502 TypeManager.GetConstructedType.
11503 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
11505 2005-03-15 Marek Safar <marek.safar@seznam.cz>
11507 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
11510 * cs-parser.jay: Reports CS1527 for any namespace element.
11512 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
11515 * expression.cs (ParameterReference.IsAssigned): Changed error to
11517 (Error_WrongNumArguments): Moved CS0245 detection here.
11519 * statement.cs (Return.Resolve): Add CS1622 report.
11521 2005-03-11 Marek Safar <marek.safar@seznam.cz>
11523 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
11525 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
11527 * attribute.cs expression.cs: Get rid of some allocations.
11529 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
11531 * doc.cs : just eliminate the latest change.
11533 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
11535 * doc.cs : commented out the latest change. It breaks xml-030.cs
11537 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
11539 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
11540 fail. So invoke CreateType() in FindDocumentedType().
11542 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
11544 * cs-tokenizer.cs : added IsKeyword().
11545 * doc.cs : Detect keyword incorrectly used as identifier.
11546 Allow identifiers prefixed by @.
11548 2005-03-10 Marek Safar <marek.safar@seznam.cz>
11550 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
11551 It caused exception in namespace resolving (again!).
11553 * class.cs (Class.ctor): Removed exit.
11554 (PropertyMethod.ctor): ditto.
11556 * codegen.cs (Codegen.Reset): Reset static data.
11557 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
11559 * cs-tokenizer.cs (Cleanup): Removed.
11561 * driver.cs (GetSystemDir): Rewrote to one line command.
11562 It caused problem with unloaded dynamic modules.
11563 (UnixParseOption): Removed Exit.
11564 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
11565 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
11566 Now can be mcs used as library.
11568 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
11571 * location.cs (Reset): Reset static data.
11573 * namespace.cs (Reset): Reset static data.
11575 * report.cs (Report.Reset): Reset static data.
11577 * rootcontext.cs (RootContext.Reset): Reset static data.
11579 * tree.cs (RootTypes.ctor): Use Location.Null
11581 * typemanager.cs (TypeManager.Reset): Reset static data.
11582 (CoreLookupType): Removed Exit.
11583 (TypeHandle.Reset): Reset static data.
11585 2005-03-10 Raja R Harinath <rharinath@novell.com>
11588 * typemanager.cs (ComputeNamespaces): Import namespaces from
11589 referenced modules too.
11591 2005-03-09 Raja R Harinath <rharinath@novell.com>
11593 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
11596 2005-03-09 Raja R Harinath <rharinath@novell.com>
11598 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
11599 enclosing DeclSpace. This ensures that a name-lookup populates
11600 more caches and there are fewer 'TypeExpression's. Carve out
11601 nested type lookup into ...
11602 (LookupNestedTypeInHierarchy): ... this.
11604 2005-03-09 Raja R Harinath <rharinath@novell.com>
11606 Clean up a few partial-class semantics.
11607 Fixes test-357.cs and cs1618-2.cs.
11608 * cs-parser.jay (struct_declaration): Use 'current_class' as
11609 parent of newly-created struct. Remove call to Register ().
11610 Use 'pop_current_class' to complete handing the current struct.
11611 (interface_declaration): Likewise.
11612 (class_declaration): Likewise.
11613 (enum_declaration): Use 'current_class' as parent of newly created
11615 (delegate_declaration): Likewise.
11616 (pop_current_class): New function. This is used to handle closing
11617 up the 'current_class' and 'current_container', and pointing them
11618 to the enclosing class/container.
11619 (CSharpParser): Initialize 'current_class' too.
11620 * decl.cs (MemberCore): Add check for invariant: a partial
11621 container is not a parsed entity, and thus does not enclose any
11623 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
11624 (DeclSpace.BaseTypeExpr): Use it.
11625 (DeclSpace.LookupType): Add check for invariant.
11626 * class.cs (TypeContainer): Add check for invariant: a nested
11627 class should have the same NamespaceEntry as its enclosing class.
11628 (TypeContainer.EmitFieldInitializers): Make virtual.
11629 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
11631 (TypeContainer.Register): Remove.
11632 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
11633 null. Use TypeResolveEmitContext for resolving base types and
11634 interfaces. Move initialization of Parts.TypeBuilder here from
11636 (TypeContainer.DefineNestedTypes): ... here.
11637 (PartialContainer): Take a Namespace not a NamespaceEntry.
11638 (PartialContainer.Create): Don't use Register. Call the
11639 appropriate Add... function directly.
11640 (ClassPart): Take both the PartialContainer and the enclosing
11641 class as constructor arguments.
11642 (ClassPart.EmitFieldInitializers): Override.
11643 (ClassPart.PartFindNestedTypes): Remove.
11644 (FieldBase.GetInitializerExpression): Resolve the initializer
11645 expression in the emit context of the enclosing class.
11646 * tree.cs (RootTypes): Remove Register ().
11648 2005-03-08 Marek Safar <marek.safar@seznam.cz>
11650 * cs-parser.jay: Removed CS0134.
11652 * driver.cs: Removed CS1901.
11654 * expression.cs (SizeOf.DoResolve): Don't report CS0233
11655 for predefined types.
11657 2005-03-07 Duncan Mak <duncan@novell.com>
11659 * codegen.cs (Save): Catch UnauthorizedAccessException as
11660 well. Fixes bug #73454.
11662 2005-03-07 Marek Safar <marek.safar@seznam.cz>
11664 * cs-tokenizer.cs (xtoken): Add CS1035.
11666 * class.cs (MethodData.Define): Add CS0683.
11667 (FieldMember.ctor): Add CS0681.
11669 2005-03-07 Raja R Harinath <rharinath@novell.com>
11671 * ecore.cs (SimpleName.DoResolve): Rename from
11672 SimpleName.DoResolveAllowStatic.
11673 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
11674 Pass 'intermediate' flag to MemberStaticCheck.
11675 (SimpleName.MemberStaticCheck): Skip "static check" only in case
11676 of "intermediate" lookups via MemberAccess.
11677 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
11678 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
11680 2005-03-07 Raja R Harinath <rharinath@novell.com>
11683 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
11684 slipped in because of variable names that are identical to a
11685 builtin type's BCL equivalent ('string String;', 'int Int32;').
11686 (PropertyExpr.EmitInstance): Likewise.
11688 2005-03-04 Marek Safar <marek.safar@seznam.cz>
11690 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
11692 * report.cs (warning_ignore_table): Made public.
11694 2005-03-04 Raja R Harinath <rharinath@novell.com>
11697 * class.cs (MethodData.Emit): Pass 'container' to
11698 container.GetObsoleteAttribute instead of 'container.Parent'.
11700 2005-03-03 Marek Safar <marek.safar@seznam.cz>
11702 * cs-parser.jay: Add 1534 error test.
11704 * iterators.cs (Yield.CheckContext): Add error 1629.
11705 (Iterator.ctor): Save unsafe modifier.
11706 (MoveNextMethod.DoEmit): Restore unsafe context.
11708 * namespace.cs (UsingAlias): Better error message.
11710 2005-03-03 Dan Winship <danw@novell.com>
11712 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
11713 the warning message [#73219]
11715 2005-03-03 Raja R Harinath <rharinath@novell.com>
11717 Fix compile with MCS 1.0.0.0.
11718 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
11719 w_restore to not depend on string constant folding.
11721 2005-03-03 Raja R Harinath <rharinath@novell.com>
11723 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
11724 CS0246 check to users who passed 'silent = false'.
11725 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
11727 (SimpleName.SimpleNameResolve): Update.
11728 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
11729 (MemberAccess.IdenticalNameAndTypeName): Update.
11730 * doc.cs (FindDocumentedTypeNonArray): Update.
11732 2005-03-03 Raja R Harinath <rharinath@novell.com>
11734 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
11735 * parameters.cs (ComputeAndDefineParameters): Remove.
11736 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
11737 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
11738 Use GetParameterInfo.
11740 2005-03-02 Marek Safar <marek.safar@seznam.cz>
11742 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
11744 2005-03-02 Raja R Harinath <rharinath@novell.com>
11746 Unify DeclSpace.LookupType and DeclSpace.FindType.
11747 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
11748 is in charge of defining nested types on demand.
11749 (DeclSpace.LookupType): Use it when the current_type is a
11750 TypeBuilder. Use LookupTypeDirect for reflected types.
11751 (DeclSpace.FindType): Remove.
11752 (DeclSpace.LookupInterfaceOrClass): Likewise.
11753 (DeclSpace.DefineTypeAndParents): Likewise.
11754 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
11755 DeclSpace.LookupType.
11756 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
11757 * typemanager.cs (LookupType): Simplify.
11758 (AddUserType): Remove type from negative_hits.
11759 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
11760 * class.cs (TypeContainer.FindMembers): Move handling of nested
11762 (TypeContainer.FindMembers_NestedTypes): ... here.
11763 (TypeContainer.FindNestedType): Implement override.
11764 (ClassPart.FindNestedType): Delegate to PartialContainer.
11765 (ClassPart.PartFindNestedType): Looks up the nested types of the
11768 2005-03-02 Martin Baulig <martin@ximian.com>
11770 * class.cs (TypeContainer.DoDefineMembers): We also need a default
11771 static constructor in static classes.
11773 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
11775 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
11776 sizeParamIndex is not specified.
11778 2005-03-01 Marek Safar <marek.safar@seznam.cz>
11781 * report.cs (WarningMessage.IsEnabled): Missing null check.
11783 2005-02-28 Marek Safar <marek.safar@seznam.cz>
11785 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
11786 in the fields and not in the properties.
11788 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
11790 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
11793 2005-02-28 Marek Safar <marek.safar@seznam.cz>
11795 * attribute.cs: Small refactoring (improved robustness).
11796 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
11797 (ValidateGuid): Removed.
11798 (Resolve): Removed referenced to above mentioned.
11799 (GetAttributeUsage): Made private and changed to work without
11801 (GetIndexerAttributeValue): Don't crash.
11802 (GetConditionalAttributeValue): Ditto.
11803 (GetClsCompliantAttributeValue): Ditto.
11804 (ExtractSecurityPermissionSet): All attributes exceptions are
11806 (GetPropertyValue): New helper.
11807 (GetMethodImplOptions): New method.
11808 (DefinePInvokeMethod): Reuse common code. Implemented handling of
11809 some missing properties.
11811 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
11812 (Method.ApplyAttributeBuilder): Updated.
11814 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
11817 2005-02-28 Raja R Harinath <rharinath@novell.com>
11820 * report.cs (Report.SymbolRelatedToPreviousError): Handle
11821 non-simple types (array, pointer, reference).
11823 2005-02-28 Marek Safar <marek.safar@seznam.cz>
11825 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
11827 * class.cs (MethodCore.IsDuplicateImplementation): Special error
11829 (Method.CheckBase): Catch wrong destructor here.
11830 (MethodData.Define): Add errors 550, 668.
11832 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
11834 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
11836 * pending.cs (VerifyPendingMethods): Add error 551.
11838 * typemanager.cs (CSharpName): Next error report helper.
11840 2005-02-25 Marek Safar <marek.safar@seznam.cz>
11842 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
11843 attributes. Removed useless attribute double check.
11844 It saves almost 2MBs for corlib.
11846 2005-02-25 Raja R Harinath <rharinath@novell.com>
11849 * statement.cs (ExpressionStatement.Resolve): Make robust to being
11850 called twice in case of error.
11852 2005-02-23 Chris Toshok <toshok@ximian.com>
11854 Fix compiler portions of #72827.
11855 * statement.cs (Block.Emit): call Begin/EndScope on the
11856 EmitContext instead of the ILGenerator.
11858 * codegen.cs (EmitContext.BeginScope): new method, call
11859 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
11861 (EmitContext.BeginScope): same, but EndScope and CloseScope
11863 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
11864 offset and call the superclass's OpenScope(int) with it.
11865 (SymbolWriter.CloseScope): get the current il
11866 offset and call superclass's CloseScope(int) with it.
11868 2005-02-23 Marek Safar <marek.safar@seznam.cz>
11870 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
11871 CS1677 for out and ref as well.
11873 * class.cs (Method.Define): Add error CS1599 detection.
11875 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
11877 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
11879 * delegate.cs (Delegate.Define): Add error CS1599 detection.
11881 * support.cs.cs (ModifierDesc): New helper method.
11883 2005-02-23 Raja R Harinath <rharinath@novell.com>
11884 Abin Thomas <projectmonokochi@rediffmail.com>
11885 Anoob V E <projectmonokochi@rediffmail.com>
11886 Harilal P R <projectmonokochi@rediffmail.com>
11888 Fix #57851, #72718.
11889 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
11890 MemberLookup (used for error reporting) actually returns a result.
11891 Fix error report number (122, not 112).
11893 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
11894 Anoob V E <projectmonokochi@rediffmail.com>
11895 Harilal P R <projectmonokochi@rediffmail.com>
11898 * pending.cs (PendingImplementation.GetAbstractMethods):
11899 Find NonPublic members too.
11901 2005-02-22 Marek Safar <marek.safar@seznam.cz>
11903 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
11906 * class.cs (MethodCore.CheckMethodAgainstBase):
11907 Add error 239 report.
11909 2005-02-21 Raja R Harinath <rharinath@novell.com>
11912 * expression.cs (Invocation.IsApplicable): Make public.
11913 (Invocation.IsParamsMethodApplicable): Likewise.
11914 * delegate.cs (Delegate.VerifyApplicability): Don't use
11915 Invocation.VerifyArgumentCompat for parameter applicability
11916 testing. Use Invocation.IsApplicable and
11917 Invocation.IsParamsMethodApplicable.
11919 2005-02-21 Marek Safar <marek.safar@seznam.cz>
11921 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
11923 * class.cs (Operator.Define): Add error 217 report.
11925 2005-02-21 Raja R Harinath <rharinath@novell.com>
11927 * namespace.cs (UsingEntry.Resolve): Undo change below.
11929 2005-02-21 Raja R Harinath <rharinath@novell.com>
11932 * ecore.cs (Expression.MemberLookupFailed): Add argument to
11933 disable the error message when the extended MemberLookup also
11935 (Expression.MemberLookupFinal): Update.
11936 (SimpleName.DoSimpleNameResolve): Update.
11937 * expression.cs (MemberAccess.ResolveNamespaceOrType):
11938 Don't use MemberLookupFinal.
11939 (New.DoResolve): Update.
11940 (BaseAccess.CommonResolve): Update.
11942 2005-02-21 Raja R Harinath <rharinath@novell.com>
11945 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
11946 occured previously, don't resolve again.
11948 2005-02-21 Marek Safar <marek.safar@seznam.cz>
11951 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
11952 argument. Call ResolveAttributeUsage for unresolved.
11953 when types doesn't match ctor arguments.
11955 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
11956 for nested attribute classes.
11957 (Class.attribute_usage): Removed.
11958 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
11959 for attribute class.
11961 * ecore.cs (IsAttribute): Removed.
11963 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
11965 * rootcontext.cs (RegisterAttribute): Removed, attributes are
11967 (attribute_types): Removed.
11968 (EmitCode): Global attributes are emited as the latest.
11970 2005-02-18 Marek Safar <marek.safar@seznam.cz>
11972 * class.cs (EmitFieldInitializers): Don't emit field initializer
11973 for default values when optimilization is on.
11975 * constant.cs (Constant.IsDefaultValue): New property.
11977 * driver.cs: Add /optimize handling.
11981 * literal.cs: Implement new IsDefaultValue property.
11983 * rootcontext.cs (Optimize): New field, holds /optimize option.
11985 2005-02-18 Raja R Harinath <rharinath@novell.com>
11987 Fix crasher in re-opened #72347.
11988 * namespace.cs (Namespace.Lookup): Return null if
11989 DeclSpace.DefineType returns null.
11992 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
11994 2005-02-18 Raja R Harinath <rharinath@novell.com>
11996 Fix remainder of #63202. Change semantics of DoResolveLValue: it
11997 now returns null if it cannot resolve to an lvalue.
11998 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
11999 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12000 returned null. Remove check for SimpleName.
12001 (EventExpr.DoResolveLValue): New.
12002 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12003 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
12005 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
12006 avoid CS0131 error.
12007 (Unary.ResolveOperator): Move CS0211 check ...
12008 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
12010 (Unary.DoResolveLValue): Simplify.
12011 (AddressOf.DoResolveLValue): New.
12012 (ArrayAccess.DoResolveLValue): New.
12014 2005-02-16 Marek Safar <marek.safar@seznam.cz>
12016 * attribute.cs (Attribute.Resolve): Add arguments casting for
12017 when types doesn't match ctor arguments.
12019 2005-02-16 Raja R Harinath <rharinath@novell.com>
12021 Fix parts of #63202.
12022 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12023 lookup of operator in base type. Ensure that all checks happen
12024 when the operator resolves to an "op_..." method.
12026 2005-02-15 Raja R Harinath <rharinath@novell.com>
12029 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12030 'ignore_cs0104' parameter. Pass it to ...
12031 (NamespaceEntry.Lookup): ... this.
12032 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12033 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12034 (TypeLookupExpression.DoResolveAsTypeStep): Update.
12035 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12036 Update. Request that cs0104 errors be ignored.
12037 (ComposedCast.ResolveAsTypeStep): Update.
12039 2005-02-14 Raja R Harinath <rharinath@novell.com>
12042 * expression.cs (Invocation.BetterFunction): Remove support for
12043 comparing virtual functions and their overrides.
12044 (Invocation.IsOverride): New.
12045 (Invocation.OverloadResolve): Don't consider 'override' functions
12046 during candidate selection. Store them in a lookaside list.
12047 If the selected method is a 'virtual' function, use the list to
12048 find any overrides that are closer to the LHS type.
12050 2005-02-14 Marek Safar <marek.safar@seznam.cz>
12052 * expression.cs (New.DoResolve): Add complex core type reduction.
12053 (New.Constantify): Converts complex core type syntax like 'new int ()'
12054 to simple constant.
12056 2005-02-14 Raja R Harinath <rharinath@novell.com>
12058 * decl.cs (EntryType.EntryType): New constructor to create an
12059 updated copy of a cache entry.
12060 (MemberCache.AddMethods): Use it.
12061 (MemberCache.ClearDeclaredOnly): Remove.
12062 (MemberCache.MemberCache): Update.
12064 2005-02-11 Miguel de Icaza <miguel@novell.com>
12066 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12067 variable. This one is represents the actual low-level declaration
12068 of the method, as opposed to the semantic level `IsStatic'.
12070 An anonymous method which is hosted into a static method might be
12071 actually an instance method. IsStatic would reflect the
12072 container, while MethodIsStatic represents the actual code
12075 * expression.cs (ParameterReference): Use the new MethodIsStatic
12076 instead of IsStatic.
12078 * anonymous.cs (AnonymousMethod.Compatible): Pass the
12079 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12080 set on the current EmitContext.
12082 * expression.cs (Cast): Overload DoResolveLValue so we can pass
12083 resolve our casted expression as an LValue. This triggers the
12084 proper LValue processing that is later required by Assign.
12088 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12090 2005-02-11 Marek Safar <marek.safar@seznam.cz>
12092 C# 2.0 Fixed buffer implementation
12094 * anonymous.cs: Update after RegisterHelperClass renaming.
12096 * attribute.cs (AttributeTester.fixed_buffer_cache):
12097 Cache of external fixed buffers.
12098 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12099 implementation if field is fixed buffer else null.
12102 (TypeContainer.AddField): Accept FieldMember instead of Field.
12103 (FieldBase.IsFieldClsCompliant): Extracted code from
12104 VerifyClsCompliance descendant customization.
12105 (FixedField): New class handles fixed buffer fields.
12106 (FixedFieldExternal): Keeps information about imported fixed
12108 (IFixedField): Make access to internal or external fixed buffer
12111 * cs-parser.jay: Add fixed buffer parsing.
12113 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12116 * expression.cs (Indirection): Extended implementation to accept
12117 fixed buffer field.
12118 (PointerArithmetic.Emit): Get element from fixed buffer as well.
12119 (ElementAccess.MakePointerAccess): Get type as parameter.
12120 (DoResolve): Add fixed buffer field expression conversion.
12121 (DoResolveLValue): Ditto.
12122 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12123 (ArrayPtr): Derives from FixedBufferPtr.
12124 (ArrayPtr.Emit): Add extra emit for array elements.
12126 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12128 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
12129 for compiler generated types.
12130 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
12132 * statement.cs (Fixed): Refactored to be easier add fixed buffer
12133 and consume less memory.
12134 (Fixed.Resolve): Add fixed buffer case.
12136 * typemanager.cs (compiler_generated_attr_ctor,
12137 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
12138 (HasElementType): Add our own implementation to work on every
12141 2005-02-11 Miguel de Icaza <miguel@novell.com>
12143 * anonymous.cs (CaptureContext): Track whether `this' has been
12146 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
12147 only captured `this' if it was implicitly done (instance
12148 methods/variables were used).
12150 * codegen.cs (EmitContext.CaptureThis): New method to flag that
12151 `this' must be captured.
12153 2005-01-30 Miguel de Icaza <miguel@novell.com>
12155 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
12156 is null it means that there has been no need to capture anything,
12157 so we just create a sibling.
12159 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
12161 Just a partial fix. The other half is fairly elusive.
12163 2005-02-10 Raja R Harinath <rharinath@novell.com>
12165 Fix #52586, cs0121-4.cs.
12166 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
12167 and return a hashtable.
12168 (MemberCache.ClearDeclaredOnly): New.
12169 (MemberCache.MemberCache): Update to change. Make a deep copy of
12170 the method_hash of a base type too.
12171 (MemberCache.AddMethods): Adapt to having a deep copy of the base
12172 type methods. Overwrite entries with the same MethodHandle so
12173 that the ReflectedType is correct. The process leaves in base
12174 virtual functions and their overrides as distinct entries.
12175 (CacheEntry): Now a class instead of a struct. It shouldn't alter
12176 matters since it was boxed in a ArrayList before.
12177 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
12179 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
12180 case of a virtual function and its override (choose the overload
12182 (Invocation.OverloadResolve): Avoid 'override' members during
12183 'applicable_type' calculation.
12185 2005-02-09 Raja R Harinath <rharinath@novell.com>
12187 Combine two near-redundant caches.
12188 * typemanager.cs (method_params): Rename from method_internal_params.
12189 (TypeManager.GetParameterData): New. Replace
12190 Invocation.GetParameterData.
12191 (TypeManager.LookupParametersByBuilder): Remove.
12192 * expression.cs (Invocation.method_parameter_cache): Remove.
12193 (Invocation.GetParameterData): Remove.
12195 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
12198 2005-02-08 Raja R Harinath <rharinath@novell.com>
12201 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
12202 TypeManager.multicast_delegate_type is null, resolve it by looking
12203 up "System.MulticastDelegate".
12204 * rootcontext.cs (RootContext.ResolveCore): Simplify.
12206 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
12207 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
12208 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
12211 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
12212 (LabeledStatement.AddReference): New. Set 'referenced'.
12213 (Goto.Resolve): Use it.
12215 2005-02-05 John Luke <john.luke@gmail.com>
12217 * driver.cs: remove duplicate -doc line in Usage ()
12219 2005-02-04 Raja R Harinath <rharinath@novell.com>
12221 * location.cs (Location.AddFile): Fix CS2002 error report.
12223 2005-02-02 Martin Baulig <martin@ximian.com>
12225 * delegate.cs (Delegate.DefineType): Report an internal error if
12226 TypeManager.multicast_delegate_type is null. See bug #72015 for
12229 2005-02-02 Raja R Harinath <rharinath@novell.com>
12231 Fix a crasher in a variant of #31984.
12232 * const.cs (Constant.CheckBase): New override that defers the
12233 new-or-override check in case the base type hasn't been populated
12235 (Constant.Define): Ensure the new-or-override check is performed.
12237 2005-02-01 Duncan Mak <duncan@ximian.com>
12239 * const.cs (LookupConstantValue): Check that `ce' is not null
12240 before calling GetValue ().
12242 2005-02-01 Raja R Harinath <rharinath@novell.com>
12244 Fix test-334.cs (#69519).
12245 * cs-parser.jay (using_alias_directive): Pass in an expression to
12246 NamespaceEntry.UsingAlias.
12247 (using_namespace_directive): Pass in an expression to
12248 NamespaceEntry.Using.
12249 (namespace_name): Don't flatten to a string.
12250 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
12251 (NamespaceEntry.AliasEntry.Resolve): Lookup using
12253 (NamespaceEntry.UsingEntry): Likewise.
12254 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
12256 (NamespaceEntry.LookupForUsing): Remove.
12257 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
12259 (NamespaceEntry.Lookup): Remove support for dotted names.
12261 2005-02-01 Raja R Harinath <rharinath@novell.com>
12263 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
12265 (NamespaceEntry.ImplicitParent): Compute on demand.
12266 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
12267 parallels the current.
12268 (NamespaceEntry.LookupForUsing): Use it.
12269 (NamespaceEntry.Lookup): If the current namespace-entry is
12270 implicit, don't search aliases and using tables.
12272 2005-02-01 Raja R Harinath <rharinath@novell.com>
12275 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
12277 (TypeContainer.BaseCache): Compute on demand.
12278 (TypeContainer.FindMembers): Define constants and types if they're
12279 not already created.
12280 (FieldMember.Define): Move resetting of ec.InUnsafe before error
12282 * const.cs (Constant.Define): Make idempotent.
12284 2005-01-29 Miguel de Icaza <miguel@novell.com>
12286 * pending.cs: Produce better code (no nops produced by using Ldarg
12289 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
12290 i - 1' it should be arg + 1.
12294 2005-01-28 Raja R Harinath <rharinath@novell.com>
12296 * attribute.cs (Attribute.CheckAttributeType): Make private
12298 (Attribute.ResolveType): Make virtual.
12299 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
12300 handling of RootContext.Tree.Types.
12302 2005-01-27 Raja R Harinath <rharinath@novell.com>
12304 Update attribute-handling to use the SimpleName/MemberAccess
12306 * cs-parser.jay (attribute): Pass in an expression to the
12307 constructors of Attribute and GlobalAttribute.
12308 * attribute.cs (Attribute): Take an expression for the name.
12309 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
12310 passed in attribute name expression.
12311 (Attribute.CheckAttributeType): Use it.
12312 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
12313 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
12314 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
12315 argument to prevent error messages if the lookup fails.
12317 2005-01-27 Marek Safar <marek.safar@seznam.cz>
12319 * expression.cs (Indirection): Implemented IVariable interface
12320 to support indirection in AddressOf operator.
12321 (PointerArithmetic.Emit): Add optimalization for case where
12322 result can be precomputed.
12324 2005-01-26 Martin Baulig <martin@ximian.com>
12326 * class.cs (TypeContainer.AttributeTargets): Return the correct
12327 AttributeTargets depending on our `Kind' instead of throwing an
12328 exception; fixes #71632.
12330 2005-01-26 Marek Safar <marek.safar@seznam.cz>
12333 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
12336 2005-01-25 Raja R Harinath <rharinath@novell.com>
12339 * expression.cs (MemberAccess.DoResolve): Don't complain with
12340 cs0572 when the LHS of a member access has identical name and type
12343 2005-01-25 Marek Safar <marek.safar@seznam.cz>
12346 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
12348 Create custom PermissionSet only for PermissionSetAttribute.
12350 2005-01-24 Marek Safar <marek.safar@seznam.cz>
12353 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
12354 delegates in static class.
12356 2005-01-24 Martin Baulig <martin@ximian.com>
12358 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12359 merging an implicit block, just use its reachability.
12361 * statement.cs (Block.Resolve): Make the unreachable code check
12362 work wrt. implicit blocks; see test-337 from #63842.
12364 2005-01-21 Alp Toker <alp@atoker.com>
12366 * cs-parser.jay: destructor_declaration's container is PartialContainer
12367 not Class when partial types are used, so use Kind prop instead of
12370 2005-01-22 Miguel de Icaza <miguel@ximian.com>
12372 * cs-parser.jay: Improve error reporting when an interface
12373 declares new types.
12375 2005-01-20 Dick Porter <dick@ximian.com>
12377 * support.cs: SeekableStreamReader fix from Sandor Dobos
12378 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
12379 chars are read. Fixes bug 70369.
12381 2005-01-20 Raja R Harinath <rharinath@novell.com>
12383 * cs-parser.jay (catch_clause): Simplify current_block handling
12386 2005-01-17 Miguel de Icaza <miguel@ximian.com>
12388 * convert.cs (ImplicitStandardConversionExists): Synchronize the
12389 code with ImplicitStandardConversion to handle the implicit
12390 conversion of method groups into valid delegate invocations.
12392 The problem is that in parameter handling we were using this code
12393 path. Fixes bug #64698
12395 2005-01-19 Raja R Harinath <rharinath@novell.com>
12397 * cs-parser.jay: Fix several infelicities.
12398 - Avoid assigning to the parser value stack. Code like
12399 '$3 = null' is unclean. Synthesize a value for the code block
12401 - Avoid using oob_stack for storing location information. Use ...
12402 (_mark_): ... this. New (empty) rule. Saves the current location
12404 (foreach_statement): Avoid using oob_stack for current_block
12405 handling. Use technique used in for_statement and
12406 using_statement. Synthesize a value for the code block to store
12407 additional intermediate information.
12409 2005-01-13 Miguel de Icaza <miguel@ximian.com>
12411 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
12412 of a different type is only allowed to private fields of a
12413 containing type, not on fields of a base class.
12415 See test-174.cs and error cs0122-9.cs
12417 2005-01-13 Raja R Harinath <rharinath@novell.com>
12419 Fix test-335.cs (bug #58126).
12420 * cs-parser.jay (argument): Split out non-expression parts of the
12421 rule into 'non_simple_argument'.
12422 (invocation_expression): Support parenthesized invocations with
12423 multiple arguments, and with single non-simple arguments.
12425 2005-01-13 Raja R Harinath <rharinath@novell.com>
12427 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
12430 2005-01-12 Raja R Harinath <rharinath@novell.com>
12432 Fix cs0038-1.cs, cs1640-6.cs.
12433 * ecore.cs (Expression.Resolve): Remove special-case for
12434 SimpleName in error-handling.
12435 (Expression.almostMatchedMembers): Relax access permission to
12437 (Expression.MemberLookupFailed): Handle duplicates in
12438 almostMatchedMembers list.
12439 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
12440 * expression.cs (New.DoResolve): Report CS1540 for more cases.
12441 * typemanager.cs (GetFullNameSignature): Use the MethodBase
12442 overload if the passed in MemberInfo is a MethodBase.
12444 2005-01-12 Marek Safar <marek.safar@seznam.cz>
12447 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
12448 for non-CAS & merge permission sets properly.
12450 2005-01-11 Raja R Harinath <rharinath@novell.com>
12452 Improve standard-compliance of simple name and member access
12453 resolution. Fixes bugs #52697, #57200, #67520, #69519.
12454 * ecore.cs (FullNamedExpression): New abstract base class
12455 for Namespaces and TypeExpressions.
12456 (ResolveFlags.SimpleName): Remove.
12457 (SimpleName): Remove support for dotted names.
12458 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
12459 DeclSpace.FindType and DeclSpace.LookupType.
12460 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
12461 (Expression.ExprClassName): Make member function.
12462 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
12463 a namespace. Remove creation of dotted "SimpleName"s.
12464 (MemberAccess.DoResolve): Likewise.
12465 * decl.cs (DeclSpace.Cache): Make private.
12466 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
12467 (DeclSpace.FindType): Update.
12468 (DeclSpace.LookupType): Move here from RootContext. Return a
12469 FullNamedExpression.
12470 * namespace.cs (Namespace): Derive from FullNamedExpression
12471 so that it can be part of expression resolution.
12472 (Namespace.Lookup): Return an FullNamedExpression.
12473 (NamespaceEntry.LookupAlias): Lookup aliases only in current
12475 * rootcontext.cs (NamespaceLookup): Remove.
12476 (LookupType): Move to DeclSpace.
12477 * attribute.cs (CheckAttributeType): Update.
12478 * doc.cs (FindDocumentedType): Remove allowAlias argument.
12479 (FindDocumentedTypeNonArray): Likewise.
12481 2005-01-11 Raja R Harinath <rharinath@novell.com>
12483 Fix cs0509.cs, cs1632.cs.
12484 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
12485 is the same as IsInterface.
12486 (TypeContainer.GetClassBases): Likewise.
12487 * statement.cs (LabeledStatement.ig): New field.
12488 (LabeledStatement.LabelTarget): Save ILGenerator which created the
12490 (LabeledStatement.DoEmit): Check that the label was created with
12491 the same ILGenerator.
12493 2005-01-10 Marek Safar <marek.safar@seznam.cz>
12496 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
12497 accessors to its properties.
12499 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
12500 from accessors to property.
12502 2005-01-10 Marek Safar <marek.safar@seznam.cz>
12505 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
12506 only for overrides.
12508 2005-01-08 Miguel de Icaza <miguel@ximian.com>
12510 * attribute.cs: Check for null and empty strings.
12512 I have lost another battle to Paolo.
12514 2005-01-07 Marek Safar <marek.safar@seznam.cz>
12517 * class.cs (PropertyMethod): Set Parent field in ctors.
12518 (SetMethod.InternalParameters): Add unsafe switch hack.
12519 Override MarkForDuplicationCheck where it is appropriate.
12521 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
12522 It says whether container allows members with the same name.
12523 Base default is no.
12524 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
12525 Removed is_method parameter.
12527 2005-01-06 Duncan Mak <duncan@ximian.com>
12529 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
12530 because the previous change led to incorrect reporting of CS1032
12531 ("Cannot define/undefine preprocessor symbols after first token in
12532 file"). Instead of using `tokens_seen' as the only flag that
12533 triggers CS1040, introduce `comments_seen'. This new flag is used
12534 to signify having seen comments on the current line, so it is
12535 unset after a newline.
12537 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
12539 * doc.cs : When searching for a type, find nested type too.
12540 This fixes bug #71040.
12542 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
12545 - Warn missing member comment on those classes which also does not
12546 have doc comments. Fixed bug #71041.
12547 - Don't warn missing doc comment on default constructor.
12550 2005-01-06 Duncan Mak <duncan@ximian.com>
12552 * cs-tokenizer.cs (xtoken): After handling traditional C-style
12553 comments, set `tokens_seen' to true. This allows us to detect
12554 misplaced preprocessor directives (i.e. not at the beginning of
12555 the a line, nor after whitespaces). In that case, report error
12556 CS1040. This fixes bug #56460.
12558 * cs-parser.jay (interface_member_declaration): Add checks for
12559 IsExplicitImpl, and report CS0541 error if an interface member is
12560 defined as an explicit interface declaration.
12562 2005-01-06 Marek Safar <marek.safar@seznam.cz>
12565 * class.cs (PropertyMethod): Set Parent field in ctors.
12566 (SetMethod.InternalParameters): Add unsafe switch hack.
12568 * decl.cs (MemberCore.Parent): Cannot be readonly.
12570 2005-01-06 Raja R Harinath <rharinath@novell.com>
12572 * decl.cs (DeclSpace.ResolveType): Remove.
12573 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
12574 Merge in code from ...
12575 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
12576 * class.cs, enum.cs: Update to changes.
12578 2005-01-06 Miguel de Icaza <miguel@ximian.com>
12580 * anonymous.cs: Ensure that we init the scope of our parent if it
12581 has not been initialized yet.
12583 2004-12-30 Duncan Mak <duncan@ximian.com>
12585 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
12586 if field.FieldBuilder is null. Fixes #70758.
12588 * convert.cs: Fixed some typos and updated some of the comments.
12589 (ImplicitStandardConversionExists):
12590 (TryImplicitIntConversion): If `target_type' is an interface and
12591 the type of `ic' implements this interface, return true or a new
12592 BoxedCast instead of null. This fixes #70468.
12594 2004-12-29 Duncan Mak <duncan@ximian.com>
12596 * expression.cs (Argument.Emit): Check that Expr is
12597 IMemoryLocation before casting to it, and report CS1510 otherwise.
12601 2004-12-21 Ben Maurer <bmaurer@ximian.com>
12603 * statement.cs (Block.ThisVariable): remove the recursion here, to
12604 make the --profile more sane.
12606 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
12608 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
12609 assembly, by JB Evain.
12611 2004-12-17 Raja R Harinath <rharinath@novell.com>
12613 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
12614 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
12615 "parent" refers to enclosing type/class. "base" refers to superclass.
12617 2004-12-17 Raja R Harinath <rharinath@novell.com>
12619 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
12620 Ensure that we only have GlobalAttributes.
12621 * attribute.cs (Attribute.Emit): Make non-virtual.
12622 (GlobalAttribute.Emit): Remove.
12623 (Attribute.Resolve): Make virtual.
12624 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
12625 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
12626 the argument. Don't create one.
12627 (Attribute.GetObsoleteAttribute): Likewise.
12628 (Attribute.GetClsCompliantAttributeValue): Likewise.
12629 * class.cs, decl.cs: Update to changes.
12631 2004-12-17 Marek Safar <marek.safar@seznam.cz>
12633 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
12635 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
12637 * statement.cs (Foreach.Resolve): Add error 186 report.
12639 2004-12-16 Marek Safar <marek.safar@seznam.cz>
12641 * expression.cs (Conditional.DoResolve): Add warning 429.
12643 * statement.cs (If.Resolve): Add warning 665.
12645 2004-12-16 Raja R Harinath <rharinath@novell.com>
12647 New invariant: RootContext.Tree.Types.NamespaceEntry == null
12648 except when in the parser, and in GlobalAttribute.
12649 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
12650 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
12651 RootContext.Tree.Types.NamespaceEntry once work is done.
12652 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
12653 and resets RootContext.Tree.Types.NamespaceEntry.
12655 2004-12-15 Marek Safar <marek.safar@seznam.cz>
12657 * cs-parser.jay: Don't create a block for every variable.
12659 2004-12-14 Miguel de Icaza <miguel@ximian.com>
12661 * location.cs: Provide extra information.
12663 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
12664 variables from the captured environment, it is the ldarg_0.
12666 2004-12-14 Marek Safar <marek.safar@seznam.cz>
12668 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
12671 * class.cs: Changed warning level for 169 to avoid developer
12672 displeasure from warning flooding. It will be changed back when they
12673 fix most of current BCL warnings.
12675 * RootContext.cs: Pushed default WarningLevel to 3.
12677 * statement.cs: Removed unused variable.
12679 2004-12-14 Marek Safar <marek.safar@seznam.cz>
12681 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
12682 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
12683 Add error 502 report.
12684 (StaticClass.DefineType): Add error 441 report.
12685 (Class.AllowedModifiersProp): New virtual property as temporary
12686 extension to AllowedModifiers.
12687 (Class.DefineType): Add error 418 report. Moved ModFlags check here
12688 to share implementation with StaticClass and don't call virtual
12691 * driver.cs (MainDriver): Add error 1558 test.
12693 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
12694 report. Moved error 36 test here.
12696 * statement.cs (Throw.Resolve): Add error 724 report.
12698 * typemanager.cs: Add out_attribute_type core type.
12700 2004-12-13 Marek Safar <marek.safar@seznam.cz>
12702 * class.cs (TypeContainer.VerifyClsCompliance): Add error
12704 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
12706 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
12709 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
12711 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
12712 Add error 3023 report.
12713 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
12715 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
12718 2004-12-12 John Luke <john.luke@gmail.com>
12720 * driver.cs (AddArgs): take -- into account when
12721 adding arguments, fixes bug 65710
12723 2004-12-12 Martin Baulig <martin@ximian.com>
12725 * expression.cs (Unary.TryReduceNegative): Added support for
12726 SByteConstant and ByteConstant.
12727 (Unary.Reduce): Check error values from TryReduceNegative().
12729 2004-12-10 Marek Safar <marek.safar@seznam.cz>
12731 * attributes.cs (Attribute.Resolve): Avoid multiple error report
12732 and report exception as error 182.
12734 2004-12-10 Raja R Harinath <rharinath@novell.com>
12736 * driver.cs (Main): Fix message when there are warnings.
12738 2004-12-09 Miguel de Icaza <miguel@ximian.com>
12740 * delegate.cs: Fixed my fix from yesterday, sorry about that.
12742 2004-12-09 Marek Safar <marek.safar@seznam.cz>
12744 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
12745 Reduced number of warnings.
12747 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
12749 2004-12-08 Miguel de Icaza <miguel@ximian.com>
12751 * driver.cs: Removed message.
12753 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
12755 2004-12-08 <vargaz@freemail.hu>
12757 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
12759 2004-12-08 Martin Baulig <martin@ximian.com>
12761 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
12762 instead of a CS3002 for properties and indexer.
12764 2004-12-08 Martin Baulig <martin@ximian.com>
12766 * decl.cs (MemberName.ToString): Make this work again.
12768 2004-12-08 Marek Safar <marek.safar@seznam.cz>
12770 * attribute.cs (Resolve): Add error 591 detection.
12772 * class.cs (FieldMember.Define): Add error 1547 detection.
12773 (Indexer.Define): Add error 620 detection.
12774 (Operator.Define): Add error 590 detection.
12776 * ecore.cs: Missing argument for error 79.
12778 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
12781 2004-12-07 Marek Safar <marek.safar@seznam.cz>
12784 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
12787 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
12789 * cs-parser.jay : handle doc comments on implicit/explicit operators.
12790 Some operator comments were suppressed.
12791 * doc.cs : Implicit/explicit operator name in doc comments are like
12792 "op_Explicit(type)~returnType", so added suffix handling.
12794 2004-12-07 Martin Baulig <martin@ximian.com>
12797 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
12798 (MemberCore.GetClsCompliantAttributeValue): Likewise.
12799 (DeclSpace.ec): New protected field; store the EmitContext here.
12800 (DeclSpace.EmitContext): New public property; moved here from
12802 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
12805 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
12806 (Enum.Emit): Don't create a new EmitContext.
12808 * delegate.cs (Delegate.DefineType): Always create the
12811 * iterators.cs (Iterators.DefineIterator): Create a new
12812 EmitContext and store it in `ec'.
12814 2004-08-24 Martin Baulig <martin@ximian.com>
12817 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
12818 this for accessibility checks.
12819 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
12820 IsNestedFamilyAccessible.
12821 (TypeManager.IsSubclassOf): New method, do what the name actually
12824 2004-12-06 Raja R Harinath <rharinath@novell.com>
12826 Fix crash on cs0657-17.cs.
12827 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
12828 Use RootContext.Tree.Types, not 'new RootTypes ()'.
12829 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
12830 the case where the NamespaceEntry gets overwritten.
12832 2004-12-06 Marek Safar <marek.safar@seznam.cz>
12834 Fixed #69195, #56821
12835 * ecore.cs (ResolveBoolean): Tiny refactoring.
12837 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
12838 of right expression resolving when left is false constant and
12839 operator is LogicalAnd OR true constant and operator is LogicalOr.
12841 * statement.cs (ResolveUnreachable): Always reports warning.
12843 2004-12-05 Miguel de Icaza <miguel@ximian.com>
12845 * class.cs: Distinguish between 1721 and 1722 (just a little help
12846 for the programmer).
12848 2004-12-03 Miguel de Icaza <miguel@ximian.com>
12850 * delegate.cs: Only allow this on new versions of the language.
12852 2004-12-02 Duncan Mak <duncan@ximian.com>
12854 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
12856 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
12857 here as a static method. Take an additional bool out parameter
12858 `must_do_cs1540_check' for signaling to InstanceResolve.
12859 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
12860 member field from PropertyExpr class and made it an argument of
12861 the method instead.
12862 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
12863 check for MarshalByRefObject, and report CS0122 instead of CS1540.
12864 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
12865 and `remove_accessor' as well as InstanceResolve: report CS0122
12870 2004-12-03 Raja R Harinath <rharinath@novell.com>
12872 Fix test-327.cs, test-328.cs, and put in early infrastructure
12873 for eventually fixing #52697.
12874 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
12875 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
12876 from other methods.
12877 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
12878 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
12879 (VerifyUsing, error246): Update.
12880 * rootcontext.cs (RootContext.NamespaceLookup): Just use
12881 'NamespaceEntry.LookupNamespaceOrType'.
12883 2004-12-03 Martin Baulig <martin@ximian.com>
12885 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
12886 method as our child, call AnonymousMethod.Compatible() on it.
12888 2004-12-03 Raja R Harinath <rharinath@novell.com>
12890 Disable XML documentation support in 'basic' profile.
12891 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
12892 Redirect XmlElement to System.Object.
12893 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
12894 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
12895 * mcs.exe.sources: Add doc-bootstrap.cs.
12896 * doc-bootstrap.cs: New file. Contains empty stub implementation
12899 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
12901 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
12902 comments are allowed.
12904 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12906 * delegate.cs: Add checks for subtypes in paramaters and return values
12907 in VerifyMethod () to add support for Covariance/Contravariance
12910 2004-12-02 Miguel de Icaza <miguel@ximian.com>
12912 * report.cs: Remove extra closing parenthesis.
12914 * convert.cs (Error_CannotImplicitConversion): If the name of the
12915 types are the same, provide some extra information.
12917 * class.cs (FieldBase): Use an unused bit field from the field to
12918 encode the `has_offset' property from the FieldMember. This saves
12919 a couple of Ks on bootstrap compilation.
12921 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
12922 method as our child, return the AnonymousMethod resolved
12925 * expression.cs (New.DoResolve): Allow return values from
12926 NewDelegate to also include AnonymousMethods.
12930 2004-12-02 Marek Safar <marek.safar@seznam.cz>
12933 * attribute.cs (Resolve): Improved implementation of params
12934 attribute arguments.
12936 * support.cs (ParameterData): Add HasParams to be faster.
12938 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
12940 all things are for /doc support:
12942 * doc.cs: new file that supports XML documentation generation.
12943 * mcs.exe.sources: added doc.cs.
12945 Handle /doc command line option.
12946 Report error 2006 instead of 5 for missing file name for /doc.
12947 Generate XML documentation when required, after type resolution.
12949 Added support for picking up documentation (/// and /** ... */),
12950 including a new XmlCommentState enumeration.
12952 Added lines to fill Documentation element for field, constant,
12953 property, indexer, method, constructor, destructor, operator, event
12954 and class, struct, interface, delegate, enum.
12955 Added lines to warn incorrect comment.
12957 Added Documentation field (passed only when /doc was specified).
12959 Added DocComment, DocCommentHeader, GenerateDocComment() and
12960 OnGenerateDocComment() and some supporting private members for
12961 /doc feature to MemberCore.
12963 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
12965 Added overriden DocCommentHeader.
12967 Added overriden DocCommentHeader and GenerateDocComment().
12969 2004-12-01 Miguel de Icaza <miguel@ximian.com>
12971 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
12972 unwrapping the enumeration values, chain to
12973 DoConstantNumericPromotions again, so we can promote things to the
12974 fundamental types (takes care of enums that are bytes, sbytes).
12978 2004-12-01 Raja R Harinath <rharinath@novell.com>
12980 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
12981 Fix long-standing bug in type-lookup. Use FindType instead of
12982 LookupType when ec.ResolvingTypeTree.
12983 (Attribute.ResolveType, Attribute.Resolve)
12984 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
12986 (Attributes.Search): Remove internal version. Update.
12987 (Attributes.SearchMulti): Update.
12988 (Attributes.GetClsCompliantAttribute): Remove.
12989 (Attributes.GetIndexerNameAttribute): Remove.
12990 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
12991 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
12992 * class.cs (Indexer.Define): Likewise.
12994 2004-12-01 Marek Safar <marek.safar@seznam.cz>
12997 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
12998 MarshallByReference members access.
13000 * expression.cs: Use CheckMarshallByRefAccess;
13001 Better error CS0197 message.
13003 * report.cs: Print whole related error message.
13005 2004-11-30 Raja R Harinath <rharinath@novell.com>
13007 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13008 the current directory to help debugging.
13010 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13012 * class (GetClassBases): Better error 60 report.
13013 (EventProperty): Disabled warning 67 detection.
13015 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13018 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13020 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13023 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13026 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13028 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13030 2004-11-26 Miguel de Icaza <miguel@ximian.com>
13032 * attribute.cs (Attribute.Resolve): Refine error reporting and
13033 report a cs0117 if the identifier does not exist, to distinguish
13034 from 0617 which is a miss-use of the actual identifier.
13036 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13037 between cs0070 and cs0079.
13039 * class.cs (MemberBase.DoDefine): When reporting a wrong
13040 accessibility level, we use MethodCore to compare instead of
13041 Method (this was a regression in some refactoring effort).
13043 So now we correctly report cs0056 again.
13045 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13046 testing the target_type (which was known to be object_type) and
13047 not the source type (which is anonymous_method).
13049 Fixed reporting of error cs1660.
13051 * expression.cs (UserCast.Source): Expose the underlying cast.
13053 * statement.cs (Switch.SwitchGoverningType): Sort the list of
13054 allowed types to find a match to int32 first (most common).
13056 In addition, it ignores any ImplicitUserConversions that did an
13057 internal implicit conversion (as the switch statement allows only
13058 one integral conversion to exist).
13060 * class.cs (PartialContainer.Create): rename `name' to
13061 `member_name' for clarity. Then replace the string calls with a
13062 call to MemberName.GetPartialName, as now using
13063 MemberName.ToString is an error (this is due to the side effects
13064 it had, that were fixed in the past).
13066 This will restore the error reporting on a number of partial class
13067 errors that were missusing this (and getting an exception as a
13068 results, which is now just a plain textual warning, because
13069 yyparse debug output would crash otherwise).
13071 2004-11-26 Raja R Harinath <rharinath@novell.com>
13073 * Makefile (PROGRAM_INSTALL_DIR): Remove.
13075 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13077 * rootcontext.cs (LookupType): Make sure to cache lookups that
13078 don't give us a negative result. This saves about 5% of corlib
13081 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13083 * report.cs (AbstractMessage.Print): messages are sent to stderr
13085 * class.cs (TypeContainer.GetClassBases): It is an error to have a
13086 non-interface in the list of interfaces (at this point, either
13087 parent was properly set, or a base class is being listed in the
13088 interfaces section).
13090 This flags error 1722, and resolves the crash from bug 69259.
13092 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13094 * statement.cs (Using.EmitExpressionFinally): make this work right
13095 for valuetypes. Fixes 69926.
13097 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13099 * const.cs (Const.ChangeType): Cope with the "0 literal can be
13100 converted to an enum" here, before we try to change the underlying
13101 type. This code exists, but it is a different code path than the
13102 one used while encoding constants.
13104 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13105 old bug: when converting from the null literal to a pointer,
13106 return an EmptyCast, not the NullLiteral.
13108 This fixes #69921, the recent null_type changes probably made this
13109 bug more prominent.
13111 (ImplicitReferenceConversionExists): In addition, resynchronized
13112 the code here, so it matches the same code in
13113 ImplicitReferenceConversionExists for the `from any class-type S
13114 to any interface-type T'.
13117 2004-11-25 Marek Safar <marek.safar@seznam.cz>
13119 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13121 2004-11-24 Miguel de Icaza <miguel@ximian.com>
13123 * cs-parser.jay: Use verbosity accordingly.
13125 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13127 * expression.cs (Unary.ResolveOperator): Do not report warning;
13128 AddressOf reads from variable.
13130 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
13132 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13136 * attribute.cs (Attributable): Removed CheckTargets.
13137 (Attributes.Emit): Explicit attribute targets are tested here.
13139 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
13140 not enabled for interfaces.
13142 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
13143 (GetAssemblyName): Ouch next bug there.
13145 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
13147 * expression.cs: Error 275 added.
13149 2004-11-23 Marek Safar <marek.safar@seznam.cz>
13151 Fix bug #69177 (Implemented decimal constant support)
13153 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
13154 (BinaryFold): Add DecimalConstant.
13156 * const.cs (Define): Decimal constant
13158 (ChangeType): Add decimal type handling.
13159 (LookupConstantValue): Don't set value for decimal type but
13160 emit DecimalConstantAttribute. Needed for constant optimization.
13162 * constant.cs (ToDecimal): New method.
13163 (ConvertToDecimal): New method.
13164 (IntConstant): Implemented ConvertToDecimal.
13165 (DecimalConstant.Emit): Emit optimized version for decimals in
13168 * expression.cs (ResolveOperator): Changed order of constant
13169 reduction to work correctly with native types which have
13170 overloaded operators.
13171 (ResolveMemberAccess): Extract constant value from attribute
13174 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
13176 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
13177 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
13178 (ChangeType): Decimal is special.
13179 (TypeToCoreType): Add decimal type.
13181 2004-11-22 Marek Safar <marek.safar@seznam.cz>
13183 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
13186 2004-11-22 Marek Safar <marek.safar@seznam.cz>
13188 * class.cs (EventField.ApplyAttributeBuilder): Fix error
13191 2004-11-19 Marek Safar <marek.safar@seznam.cz>
13193 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
13195 * pending.cs (PendingImplementation): Grab only interfaces.
13197 2004-11-19 Marek Safar <marek.safar@seznam.cz>
13199 * statement.cs (ForeachHelperMethods): Add location member and
13200 error 202 detection.
13202 2004-11-19 Raja R Harinath <rharinath@novell.com>
13204 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
13205 automatically handled by executable.make.
13206 (PROGRAM): Make profile-specific.
13208 2004-11-18 Marek Safar <marek.safar@seznam.cz>
13210 * expression.cs (DoResolveBase): Fixed wrong warning for out
13213 2004-11-18 Martin Baulig <martin@ximian.com>
13215 Merged latest changes into gmcs. Please keep this comment in
13216 here, it makes it easier for me to see what changed in MCS since
13217 the last time I merged.
13219 2004-11-17 Raja R Harinath <rharinath@novell.com>
13221 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
13222 (TypeHandle.GetMemberCache): New.
13223 (TypeHandle.TypeHandle): Update.
13224 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
13225 (TypeManager.LookupParentInterfacesCache):
13226 Rename from LookupInterfaceCache. Optimize slightly.
13227 (TypeManager.MemberLookup_FindMembers): Update.
13228 * decl.cs (MemberCache.MemberCache): Set Container to null in the
13229 multi-type variant.
13230 (AddCacheContents): Rename from AddHashtable.
13231 * class.cs (TypeContainer.parent_container): Remove.
13232 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
13233 (TypeContainer.DoDefineMembers): Don't initialize it.
13234 Update to name changes.
13236 2004-11-17 Miguel de Icaza <miguel@ximian.com>
13238 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
13239 that factors the code to check access modifiers on override.
13241 (PropertyBase): Use the code here.
13243 Patch from Lluis S'anchez, fixes bug #69361.
13245 2004-11-15 Miguel de Icaza <miguel@ximian.com>
13247 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
13248 routine that is used to report the use of a captured variable
13249 whose address has been taken.
13251 There are two checks: one when variables are being captured and
13252 the other check is when the address of a variable is taken.
13254 (because an anonymous methods might be resolved before *or* after
13255 the address has been taken) and
13257 * expression.cs (Conditional.DoResolve): Remove the special
13258 casing that Martin added to trueExpr and falseExpr being both
13259 NullLiteral. We get the right behavior now just by introducing
13260 the null_type into the compiler.
13262 * convert.cs (ExplicitConversion): Change the code to use
13263 null_type instead of testing `expr is NullLiteral'.
13264 (ImplicitConversionStandard): use null_type too.
13265 (ImplicitReferenceConversionExists): use null_type too.
13266 (ImplicitReferenceConversion): use null_type too.
13268 * literal.cs: The type of `NullLiteral' is now null_type instead
13270 (Resolve): Set the type here.
13272 * typemanager.cs: Introduce null_type.
13274 2004-11-17 Martin Baulig <martin@ximian.com>
13276 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
13277 direction, like FindMembers() does. Fixes #69546, testcase is in
13280 2004-11-16 Martin Baulig <martin@ximian.com>
13282 This is based on a patch from Marek Safar, see bug #69082.
13283 Fixes bugs #63705 and #67130.
13285 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
13286 method; create a MemberCache for an interface type and cache the
13289 * decl.cs (IMemberContainer.ParentContainer): Removed.
13290 (IMemberContainer.ParentCache): New property.
13291 (MemberCache.SetupCacheForInterface): Removed.
13292 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
13293 to create a cache for an interface's "parent".
13295 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
13298 2004-11-16 Martin Baulig <martin@ximian.com>
13300 Merged back from gmcs; these changes already went into gmcs a
13301 couple of weeks ago.
13304 (TypeManager.AddUserType): Removed the `ifaces' argument.
13305 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
13307 (TypeManager.AddUserInterface): Removed.
13308 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
13310 (TypeManager.GetInterfaces): Likewise.
13311 (TypeManager.GetExplicitInterfaces): Likewise.
13313 * ecore.cs (TypeExpr.GetInterfaces): Removed.
13315 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
13316 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
13318 2004-11-14 Ben Maurer <bmaurer@ximian.com>
13320 * statement.cs: Avoid adding bools to a hashtable.
13322 2004-11-07 Miguel de Icaza <miguel@ximian.com>
13324 * expression.cs (Invocation.OverloadResolve): Flag error if we are
13325 calling an unsafe method from a safe location.
13327 2004-11-06 Marek Safar <marek.safar@seznam.cz>
13330 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
13332 2004-11-06 Miguel de Icaza <miguel@ximian.com>
13334 * namespace.cs (VerifyUsing): use GetPartialName instead of
13337 2004-11-05 Miguel de Icaza <miguel@ximian.com>
13339 * statement.cs (Return.Resolve): Fix regression in typo: if
13340 `in_exc', we have to request a NeedReturnLabel, this was a typo
13341 introduced in the anonymous method check-in. Fixes #69131.
13343 * Indexers were using the ShortName when defining themselves,
13344 causing a regression in the compiler bootstrap when applying the
13345 patch from 2004-11-02 (first part), now they use their full name
13346 and the bug is gone.
13348 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
13350 * driver.cs: Strip the path from the names of embedded resources. Fixes
13353 2004-11-04 Raja R Harinath <rharinath@novell.com>
13355 Fix error message regression: cs0104-2.cs.
13356 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
13357 (AliasEntry.Resolve): Update.
13358 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
13360 (RootContext.LookupType): Update.
13362 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
13364 * cs-parser.jay: Add support for handling accessor modifiers
13365 * class: Add support port accessor modifiers and error checking,
13366 define PropertyMethod.Define as virtual (not abstract anymore)
13367 * ecore.cs: Add checking for proeprties access with access modifiers
13368 * iterators.cs: Modify Accessor constructor call based in the modified
13370 2004-11-02 Ben Maurer <bmaurer@ximian.com>
13372 * expression.cs (StringConcat): Handle being called twice,
13373 as when we have a concat in a field init with more than two
13376 2004-11-02 Miguel de Icaza <miguel@ximian.com>
13378 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
13379 special case explicit implementations, we should always produce
13380 the .property or .event declaration.
13382 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
13383 since it will not return correct data if people use this
13384 unresolved in the presence of using statements (see test-313).
13386 * class.cs (MethodData.Define): If we are an explicit interface
13387 implementation, set the method name to the full name of the
13388 interface plus the name of the method.
13390 Notice that using the method.MethodName.GetFullName() does not
13391 work, as it will only contain the name as declared on the source
13392 file (it can be a shorthand in the presence of using statements)
13393 and not the fully qualifed type name, for example:
13397 class D : ICloneable {
13398 object ICloneable.Clone () {
13402 Would produce a method called `ICloneable.Clone' instead of
13403 `System.ICloneable.Clone'.
13405 * namespace.cs (Alias.Resolve): Use GetPartialName.
13407 2004-11-01 Marek Safar <marek.safar@seznam.cz>
13409 * cs-parser.jay: Add error 1055 report.
13411 2004-11-01 Miguel de Icaza <miguel@ximian.com>
13413 * assign.cs (Assign.DoResolve): Only do the transform of
13414 assignment into a New if the types are compatible, if not, fall
13415 through and let the implicit code deal with the errors and with
13416 the necessary conversions.
13418 2004-11-01 Marek Safar <marek.safar@seznam.cz>
13420 * cs-parser.jay: Add error 1031 report.
13422 * cs-tokenizer.cs: Add location for error 1038.
13424 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13426 * cs-parser.jay: Add error 1016 report.
13428 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13430 * cs-parser.jay: Add errors 1575,1611 report.
13432 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13434 * cs-parser.jay: Add error 1001 report.
13436 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13439 * attribute.cs (GetMarshal): Add method argument for
13440 caller identification.
13442 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
13443 agument for GetMarshal and RuntimeMissingSupport.
13445 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13447 * attribute.cs (ExtractSecurityPermissionSet): Removed
13448 TypeManager.code_access_permission_type.
13450 * typemanager.cs: Removed TypeManager.code_access_permission_type.
13452 2004-10-27 Miguel de Icaza <miguel@ximian.com>
13454 * expression.cs (LocalVariableReference.DoResolveLValue): Check
13455 for obsolete use of a variable here. Fixes regression on errors
13456 cs0619-25 and cs0619-26.
13458 2004-10-27 Marek Safar <marek.safar@seznam.cz>
13460 Fix #62358, implemented security attribute encoding.
13462 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
13463 Tests permitted SecurityAction for assembly or other types.
13464 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
13465 data from SecurityPermissionAttribute to PermisionSet class.
13467 * class.cs (ApplyAttributeBuilder): Added special handling
13468 for System.Security.Permissions.SecurityAttribute based types.
13470 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
13471 special handling for System.Security.Permissions.SecurityAttribute
13474 * enum.cs (ApplyAttributeBuilder): Added special handling
13475 for System.Security.Permissions.SecurityAttribute based types.
13477 * parameter.cs (ApplyAttributeBuilder): Added special handling
13478 for System.Security.Permissions.SecurityAttribute based types.
13480 * rootcontext.cs: Next 2 core types.
13482 * typemanager.cs (TypeManager.security_permission_attr_type):
13483 Built in type for the SecurityPermission Attribute.
13484 (code_access_permission_type): Build in type.
13486 2004-10-17 Miguel de Icaza <miguel@ximian.com>
13488 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
13489 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
13490 all of this information into
13491 EmitContext.EmitCapturedVariableInstance.
13493 * codegen.cs (EmitCapturedVariableInstance): move here the
13494 funcionality of emitting an ldarg.0 in the presence of a
13495 remapping. This centralizes the instance emit code.
13497 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
13498 then emit a load of this: it means that we have reached the
13499 topmost ScopeInfo: the one that contains the pointer to the
13500 instance of the class hosting the anonymous method.
13502 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
13503 captures to the topmost CaptureContext.
13505 2004-10-12 Miguel de Icaza <miguel@ximian.com>
13507 * expression.cs (LocalVariableReference): Move the knowledge about
13508 the iterators into codegen's EmitCapturedVariableInstance.
13510 2004-10-11 Miguel de Icaza <miguel@ximian.com>
13512 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
13513 all code paths return a value from an anonymous method (it is the
13514 same as the 161 error, but for anonymous methods).
13516 2004-10-08 Miguel de Icaza <miguel@ximian.com>
13518 The introduction of anonymous methods in the compiler changed
13519 various ways of doing things in the compiler. The most
13520 significant one is the hard split between the resolution phase
13521 and the emission phases of the compiler.
13523 For instance, routines that referenced local variables no
13524 longer can safely create temporary variables during the
13525 resolution phase: they must do so from the emission phase,
13526 since the variable might have been "captured", hence access to
13527 it can not be done with the local-variable operations from the runtime.
13531 (Block.Flags): New flag `IsTopLevel' to indicate that this block
13532 is a toplevel block.
13534 (ToplevelBlock): A new kind of Block, these are the blocks that
13535 are created by the parser for all toplevel method bodies. These
13536 include methods, accessors and anonymous methods.
13538 These contain some extra information not found in regular blocks:
13539 A pointer to an optional CaptureContext (for tracking captured
13540 local variables and parameters). A pointer to the parent
13543 (Return.Resolve): Catch missmatches when returning a value from an
13544 anonymous method (error 1662).
13545 Invoke NeedReturnLabel from the Resolve phase instead of the emit
13548 (Break.Resolve): ditto.
13550 (SwitchLabel): instead of defining the labels during the
13551 resolution phase, we now turned the public ILLabel and ILLabelCode
13552 labels into methods called GetILLabelCode() and GetILLabel() that
13553 only define the label during the Emit phase.
13555 (GotoCase): Track the SwitchLabel instead of the computed label
13556 (its contained therein). Emit the code by using
13557 SwitchLabel.GetILLabelCode ().
13559 (LocalInfo.Flags.Captured): A new flag has been introduce to track
13560 whether the Local has been captured or not.
13562 (LocalInfo.IsCaptured): New property, used to tell whether the
13563 local has been captured.
13565 * anonymous.cs: Vastly updated to contain the anonymous method
13568 The main classes here are: CaptureContext which tracks any
13569 captured information for a toplevel block and ScopeInfo used to
13570 track the activation frames for various local variables.
13572 Each toplevel block has an optional capture context associated
13573 with it. When a method contains an anonymous method both the
13574 toplevel method and the anonymous method will create a capture
13575 context. When variables or parameters are captured, they are
13576 recorded on the CaptureContext that owns them, for example:
13580 MyDelegate d = delegate {
13585 Here `a' will be recorded as captured on the toplevel
13586 CapturedContext, the inner captured context will not have anything
13587 (it will only have data if local variables or parameters from it
13588 are captured in a nested anonymous method.
13590 The ScopeInfo is used to track the activation frames for local
13591 variables, for example:
13593 for (int i = 0; i < 10; i++)
13594 for (int j = 0; j < 10; j++){
13595 MyDelegate d = delegate {
13600 At runtime this captures a single captured variable `i', but it
13601 captures 10 different versions of the variable `j'. The variable
13602 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
13603 recorded on a child.
13605 The toplevel ScopeInfo will also track information like the `this'
13606 pointer if instance variables were referenced (this is necessary
13607 as the anonymous method lives inside a nested class in the host
13608 type of the method).
13610 (AnonymousMethod): Expanded to track the Toplevel, implement
13611 `AnonymousMethod.Compatible' to tell whether an anonymous method
13612 can be converted to a target delegate type.
13614 The routine now also produces the anonymous method content
13616 (AnonymousDelegate): A helper class that derives from
13617 DelegateCreation, this is used to generate the code necessary to
13618 produce the delegate for the anonymous method that was created.
13620 * assign.cs: API adjustments for new changes in
13621 Convert.ImplicitStandardConversionExists.
13623 * class.cs: Adjustments to cope with the fact that now toplevel
13624 blocks are of type `ToplevelBlock'.
13626 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
13627 insteda of standard blocks.
13629 Flag errors if params arguments are passed to anonymous methods.
13631 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
13632 `CurrentAnonymousMethod' which points to the current Anonymous
13633 Method. The variable points to the AnonymousMethod class that
13634 holds the code being compiled. It is set in the new EmitContext
13635 created for the anonymous method.
13637 (EmitContext.Phase): Introduce a variable and an enumeration to
13638 assist in enforcing some rules about when and where we are allowed
13639 to invoke certain methods (EmitContext.NeedsReturnLabel is the
13640 only one that enfonces this right now).
13642 (EmitContext.HaveCaptureInfo): new helper method that returns
13643 whether we have a CapturedContext initialized.
13645 (EmitContext.CaptureVariable): New method used to register that a
13646 LocalInfo must be flagged for capturing.
13648 (EmitContext.CapturedParameter): New method used to register that a
13649 parameters must be flagged for capturing.
13651 (EmitContext.CapturedField): New method used to register that a
13652 field must be flagged for capturing.
13654 (EmitContext.HaveCapturedVariables,
13655 EmitContext.HaveCapturedFields): Return whether there are captured
13656 variables or fields.
13658 (EmitContext.EmitMethodHostInstance): This is used to emit the
13659 instance for the anonymous method. The instance might be null
13660 (static methods), this (for anonymous methods that capture nothing
13661 and happen to live side-by-side with the current method body) or a
13662 more complicated expression if the method has a CaptureContext.
13664 (EmitContext.EmitTopBlock): Routine that drives the emission of
13665 code: it will first resolve the top block, then emit any metadata
13666 and then emit the code. The split is done so that we can extract
13667 any anonymous methods and flag any captured variables/parameters.
13669 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
13670 during this phase, the ILGenerator should not be used as labels
13671 and local variables declared here might not be accessible to any
13672 code that is part of an anonymous method.
13674 Exceptions to this include the temporary variables that are
13675 created by some statements internally for holding temporary
13678 (EmitContext.EmitMeta): New routine, in charge of emitting all the
13681 (EmitContext.TemporaryReturn): This method is typically called
13682 from the Emit phase, and its the only place where we allow the
13683 ReturnLabel to be defined other than the EmitMeta. The reason is
13684 that otherwise we would have to duplicate a lot of logic in the
13685 Resolve phases of various methods that today is on the Emit
13688 (EmitContext.NeedReturnLabel): This no longer creates the label,
13689 as the ILGenerator is not valid during the resolve phase.
13691 (EmitContext.EmitThis): Extended the knowledge in this class to
13692 work in anonymous methods in addition to iterators.
13694 (EmitContext.EmitCapturedVariableInstance): This emits whatever
13695 code is necessary on the stack to access the instance to a local
13696 variable (the variable will be accessed as a field).
13698 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
13699 EmitContext.EmitAddressOfParameter): Routines to support
13700 parameters (not completed at this point).
13702 Removals: Removed RemapLocal and RemapLocalLValue. We probably
13703 will also remove the parameters.
13705 * convert.cs (Convert): Define a `ConstantEC' which points to a
13706 null. This is just to prefity some code that uses
13707 ImplicitStandardConversion code and do not have an EmitContext
13710 The idea is to flag explicitly that at that point in time, it is
13711 known that the conversion will not trigger the delegate checking
13712 code in implicit conversions (which requires a valid
13715 Everywhere: pass new EmitContext parameter since
13716 ImplicitStandardConversionExists now requires it to check for
13717 anonymous method conversions.
13719 (Convert.ImplicitStandardConversionExists): If the type of an
13720 expression is the anonymous_method_type, and the type is a
13721 delegate, we invoke the AnonymousMethod.Compatible method to check
13722 whether an implicit conversion is possible.
13724 (Convert.ImplicitConversionStandard): Only do implicit method
13725 group conversions if the language level is not ISO_1.
13727 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
13728 MethodInfo for the Invoke method. used by Delegate and
13731 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
13732 method conversions if the target type is a delegate.
13734 Removed extra debugging nops.
13736 (LocalVariableReference): Turn the `local_info' into a public
13739 Add `prepared' field, the same hack used for FieldExprs to cope
13740 with composed assignments, as Local variables do not necessarily
13741 operate purely on the stack as they used to: they can be captured
13744 Add `temp' for a temporary result, like fields.
13746 Refactor DoResolve and DoResolveLValue into DoResolveBase.
13748 It now copes with Local variables that are captured and emits the
13749 proper instance variable to load it from a field in the captured
13752 (ParameterReference.DoResolveBase): During the resolve phase,
13753 capture parameters if we are in an anonymous method.
13755 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
13756 anonymous method, use the EmitContext helper routines to emit the
13757 parameter reference.
13759 * iterators.cs: Set RemapToProxy to true/false during the
13762 * parameters.cs (GetParameterByName): New helper method.
13764 * typemanager.cs (anonymous_method_type) a new type that
13765 represents an anonyous method. This is always an internal type,
13766 used as a fencepost to test against the anonymous-methodness of an
13769 2004-10-20 Marek Safar <marek.safar@seznam.cz>
13771 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
13773 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
13775 2004-10-18 Martin Baulig <martin@ximian.com>
13777 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
13778 `Type' directly, but call ResolveType() on it.
13779 (Catch.Resolve): Likewise.
13780 (Foreach.Resolve): Likewise.
13782 2004-10-18 Martin Baulig <martin@ximian.com>
13784 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
13785 `Type' directly, but call ResolveType() on it.
13786 (Probe.DoResolve): Likewise.
13787 (ArrayCreation.LookupType): Likewise.
13788 (TypeOf.DoResolve): Likewise.
13789 (SizeOf.DoResolve): Likewise.
13791 2004-10-18 Martin Baulig <martin@ximian.com>
13793 * expression.cs (Invocation.BetterFunction): Put back
13794 TypeManager.TypeToCoreType().
13796 2004-10-18 Raja R Harinath <rharinath@novell.com>
13798 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
13801 2004-10-18 Martin Baulig <martin@ximian.com>
13803 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
13804 `Type' directly, but call ResolveType() on it.
13806 2004-10-18 Martin Baulig <martin@ximian.com>
13808 * class.cs (FieldMember.Define): Don't access the TypeExpr's
13809 `Type' directly, but call ResolveType() on it.
13810 (MemberBase.DoDefine): Likewise.
13812 * expression.cs (New.DoResolve): Don't access the TypeExpr's
13813 `Type' directly, but call ResolveType() on it.
13814 (ComposedCast.DoResolveAsTypeStep): Likewise.
13816 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
13817 `Type' directly, but call ResolveType() on it.
13819 2004-10-17 John Luke <john.luke@gmail.com>
13821 * class.cs (Operator.GetSignatureForError): use CSharpName
13823 * parameter.cs (Parameter.GetSignatureForError): Returns
13824 correct name even if was not defined.
13826 2004-10-13 Raja R Harinath <rharinath@novell.com>
13829 * class.cs (TypeContainer.EmitContext): New property.
13830 (DefineNestedTypes): Create an emitcontext for each part.
13831 (MethodCore.DoDefineParameters): Use container's emitcontext.
13832 Pass type array to InternalParameters.
13833 (MemberBase.DoDefine): Use container's emitcontext.
13834 (FieldMember.Define): Likewise.
13835 (Event.Define): Likewise.
13836 (SetMethod.GetParameterInfo): Change argument to EmitContext.
13837 Pass type array to InternalParameters.
13838 (SetIndexerMethod.GetParameterInfo): Likewise.
13839 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
13840 * delegate.cs (Define): Pass emitcontext to
13841 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
13842 array to InternalParameters.
13843 * expression.cs (ParameterReference.DoResolveBase): Pass
13844 emitcontext to GetParameterInfo.
13845 (ComposedCast.DoResolveAsTypeStep): Remove check on
13846 ec.ResolvingTypeTree.
13847 * parameter.cs (Parameter.Resolve): Change argument to
13848 EmitContext. Use ResolveAsTypeTerminal.
13849 (Parameter.GetSignature): Change argument to EmitContext.
13850 (Parameters.ComputeSignature): Likewise.
13851 (Parameters.ComputeParameterTypes): Likewise.
13852 (Parameters.GetParameterInfo): Likewise.
13853 (Parameters.ComputeAndDefineParameterTypes): Likewise.
13854 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
13855 * support.cs (InternalParameters..ctor): Remove variant that takes
13857 * typemanager.cs (system_intptr_expr): New.
13858 (InitExpressionTypes): Initialize it.
13860 2004-10-12 Chris Toshok <toshok@ximian.com>
13862 * cs-parser.jay: fix location for try_statement and catch_clause.
13864 2004-10-11 Martin Baulig <martin@ximian.com>
13866 * report.cs: Don't make --fatal abort on warnings, we have
13867 -warnaserror for that.
13869 2004-10-07 Raja R Harinath <rharinath@novell.com>
13871 More DeclSpace.ResolveType avoidance.
13872 * decl.cs (MemberCore.InUnsafe): New property.
13873 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
13874 with newly created EmitContext.
13875 (FieldMember.Define): Likewise.
13876 * delegate.cs (Delegate.Define): Likewise.
13877 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
13878 only if normal name-lookup fails.
13879 (TypeExpr.DoResolve): Enable error-checking.
13880 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
13881 (SizeOf.DoResolve): Likewise.
13882 (ComposedCast.DoResolveAsTypeStep): Likewise.
13883 (StackAlloc.DoResolve): Likewise.
13884 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
13885 (Block.Unsafe): New property.
13886 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
13887 (Unsafe): Set 'unsafe' flag of contained block.
13888 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
13889 (Fixed.Resolve): Likewise.
13890 (Catch.Resolve): Likewise.
13891 (Using.ResolveLocalVariableDecls): Likewise.
13892 (Foreach.Resolve): Likewise.
13894 2004-10-05 John Luke <john.luke@gmail.com>
13896 * cs-parser.jay: add location to error CS0175
13898 2004-10-04 Miguel de Icaza <miguel@ximian.com>
13900 * ecore.cs (Expression.Constantity): Add support for turning null
13903 * const.cs (Const.Define): Allow constants to be reference types
13904 as long as the value is Null.
13906 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
13908 * namespace.cs (NamespaceEntry.Using): No matter which warning
13909 level is set, check if this namespace name has already been added.
13911 2004-10-03 Ben Maurer <bmaurer@ximian.com>
13913 * expression.cs: reftype [!=]= null should always use br[true,false].
13916 2004-10-03 Marek Safar <marek.safar@seznam.cz>
13919 * attribute.cs: Enum conversion moved to
13920 GetAttributeArgumentExpression to be applied to the all
13923 2004-10-01 Raja R Harinath <rharinath@novell.com>
13925 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
13926 * class.c (TypeContainer.DefineType): Flag error if
13927 base types aren't accessible due to access permissions.
13928 * decl.cs (DeclSpace.ResolveType): Move logic to
13929 Expression.ResolveAsTypeTerminal.
13930 (DeclSpace.ResolveTypeExpr): Thin layer over
13931 Expression.ResolveAsTypeTerminal.
13932 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
13933 Refactor code into NestedAccess. Use it.
13934 (DeclSpace.NestedAccess): New.
13935 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
13936 argument to silence errors. Check access permissions.
13937 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
13938 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
13939 (Cast.DoResolve): Likewise.
13940 (New.DoResolve): Likewise.
13941 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
13942 (TypeOf.DoResolve): Likewise.
13944 * expression.cs (Invocation.BetterConversion): Return the Type of
13945 the better conversion. Implement section 14.4.2.3 more faithfully.
13946 (Invocation.BetterFunction): Make boolean. Make correspondence to
13947 section 14.4.2.2 explicit.
13948 (Invocation.OverloadResolve): Update.
13949 (Invocation): Remove is_base field.
13950 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
13951 (Invocation.Emit): Likewise.
13953 2004-09-27 Raja R Harinath <rharinath@novell.com>
13955 * README: Update to changes.
13957 2004-09-24 Marek Safar <marek.safar@seznam.cz>
13959 * cs-parser.jay: Reverted 642 warning fix.
13961 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13964 * decl.cs (FindMemberWithSameName): Indexer can have more than
13967 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13969 * expression.cs (LocalVariableReference.DoResolveLValue):
13970 Do not report warning 219 for out values.
13971 (EmptyExpression.Null): New member to avoid extra allocations.
13973 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13975 * cs-parser.jay: Fix wrong warning 642 report.
13977 * cs-tokenizer.cs (CheckNextToken): New helper;
13978 Inspect next character if is same as expected.
13980 2004-09-23 Martin Baulig <martin@ximian.com>
13982 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
13983 (Convert.ImplicitReferenceConversionExists): Likewise.
13985 2004-09-23 Marek Safar <marek.safar@seznam.cz>
13987 * class.cs (Operator.Define): Add error 448 and 559 report.
13989 2004-09-22 Marek Safar <marek.safar@seznam.cz>
13991 * class.cs (MemberBase.IsTypePermitted): New protected
13992 method for checking error CS0610.
13994 2004-09-22 Marek Safar <marek.safar@seznam.cz>
13996 * class.cs (TypeContainer.HasExplicitLayout): New property
13997 Returns whether container has StructLayout attribute set Explicit.
13998 (FieldMember): New abstract class for consts and fields.
13999 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14000 (Field): Reuse FieldMember.
14002 * const.cs (Const): Reuse FieldMember.
14004 * rootcontext.cs: EmitConstants call moved to class.
14006 2004-09-22 Martin Baulig <martin@ximian.com>
14008 Thanks to Peter Sestoft for this bug report.
14010 * expression.cs (Conditional): If both the `trueExpr' and the
14011 `falseExpr' is a NullLiteral, return a NullLiteral.
14013 2004-09-22 Martin Baulig <martin@ximian.com>
14015 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14016 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14017 for the "get_Current" call.
14019 2004-09-22 Martin Baulig <martin@ximian.com>
14021 Marek and me just fixed one of our oldest bugs: #28562 :-)
14023 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14025 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14026 we're an EnumConstant, just return that.
14027 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14028 an EnumConstant. In this case, we need to use GetValueAsEnumType()
14029 to get the value which'll actually be written into the attribute.
14030 However, we have to use GetValue() to access the attribute's value
14033 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14035 * constant.cs (Constant.IsNegative): New abstract property
14038 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14039 (StackAlloc.DoResolve): Reused IsNegative.
14041 2004-09-21 Martin Baulig <martin@ximian.com>
14043 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14044 if we're used in an iterator, we may be called from different
14047 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14048 we actually have an exception block.
14050 2004-09-20 John Luke <jluke@cfl.rr.com>
14052 * class.cs, cs-parser.jay: Improve the error report for 1520:
14053 report the actual line where the error happens, not where the
14054 class was declared.
14056 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14057 Pass location information that was available elsewhere.
14059 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
14061 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14062 runtime to delay sign assemblies.
14064 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14066 * cs-parser.jay: Do not report the stack trace, this is barely
14069 2004-08-22 John Luke <john.luke@gmail.com>
14071 * driver.cs : check that a resource id is not already used
14072 before adding it, report CS1508 if it is, bug #63637
14074 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14076 * ecore.cs: Removed dead code.
14078 2004-09-18 Marek Safar <marek.safar@seznam.cz>
14080 * class.cs: Do not report warning CS0067 on the interfaces.
14082 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14084 * cs-parser.jay: Add error 504 report.
14086 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14088 * rootcontext.cs: WarningLevel is 4 by default now.
14090 * statement.cs (Fixed.Resolve): Do not null
14093 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14096 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14097 deep search when property is not virtual.
14098 (PropertyExpr.ResolveAccessors): Make one call for both
14101 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14104 * statement.cs: Error 152 report constains also location.
14106 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14109 * const.cs: Explicitly set constant as static.
14111 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14114 * cs-parser.jay: Add error 1017 report.
14116 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14118 Fixed bug #59980, #64224
14119 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14121 * typemanager.cs (IsSpecialMethod): Simplified
14123 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14125 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14126 condition with better params.
14128 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14131 * attribute.cs (Resolve): Property has to have both
14134 2004-09-14 Martin Baulig <martin@ximian.com>
14136 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
14138 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14141 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
14142 called and is obsolete then this member suppress message
14143 when call is inside next [Obsolete] method or type.
14145 * expression.cs: Use TestObsoleteMethodUsage member.
14147 2004-09-14 Martin Baulig <martin@ximian.com>
14149 * cs-parser.jay: Sync a bit with the GMCS version.
14151 2004-09-14 Martin Baulig <martin@ximian.com>
14153 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
14154 (CSharpParser.yacc_verbose_flag): New public field.
14156 * genericparser.cs: Removed.
14158 2004-09-14 Raja R Harinath <rharinath@novell.com>
14160 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
14162 2004-09-13 Marek Safar <marek.safar@seznam.cz>
14164 * class.cs (MethodCore.CheckBase): Fix bug #65757.
14166 2004-09-10 Martin Baulig <martin@ximian.com>
14168 Backported my MemberName changes from GMCS into MCS.
14170 - we are now using a special `MemberName' class instead of using
14171 strings; in GMCS, the `MemberName' also contains the type
14174 - changed the grammar rules a bit:
14175 * the old `member_name' is now a `namespace_or_type_name':
14176 The rule is that we use `namespace_or_type_name' everywhere
14177 where we expect either a "member name" (GetEnumerator) or a
14178 "member name" with an explicit interface name
14179 (IEnumerable.GetEnumerator).
14180 In GMCS, the explicit interface name may include type arguments
14181 (IEnumerable<T>.GetEnumerator).
14182 * we use `member_name' instead of just `IDENTIFIER' for
14184 The rule is that we use `member_name' wherever a member may
14185 have type parameters in GMCS.
14187 * decl.cs (MemberName): New public class.
14188 (MemberCore.MemberName): New public readonly field.
14189 (MemberCore.ctor): Take a `MemberName' argument, not a string.
14190 (DeclSpace): Likewise.
14192 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
14193 * enum.cs (Enum.ctor): Likewise.
14195 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
14197 (AliasEntry.ctor): Take a MemberName, not an Expression.
14198 (AliasEntry.UsingAlias): Likewise.
14200 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
14201 (IMethodData.MemberName): Changed type from string to MemberName.
14202 (MemberBase.ExplicitInterfaceName): Likewise.
14203 (AbstractPropertyEventMethod.SetupName): Make this private.
14204 (AbstractPropertyEventMethod.ctor): Added `string prefix'
14205 argument; compute the member name here.
14206 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
14207 on the `member.MemberName' and the `prefix'.
14209 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
14211 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
14212 thus, we get a `MemberName' instead of a `string'. These
14213 declarations may have type parameters in GMCS.
14214 (interface_method_declaration, delegate_declaration): Likewise.
14215 (class_declaration, interface_declaration): Likewise.
14216 (method_header): Use `namespace_or_type_name' instead of
14217 `member_name'. We may be an explicit interface implementation.
14218 (property_declaration, event_declaration): Likewise.
14219 (member_name): This is now just an `IDENTIFIER', not a
14220 `namespace_or_type_name'.
14221 (type_name, interface_type): Removed.
14222 (namespace_or_type_name): Return a MemberName, not an Expression.
14223 (primary_expression): Use `member_name' instead of `IDENTIFIER';
14224 call GetTypeExpression() on the MemberName to get an expression.
14225 (IndexerDeclaration.interface_type): Changed type from string to
14227 (MakeName): Operate on MemberName's instead of string's.
14229 2004-09-13 Raja R Harinath <rharinath@novell.com>
14232 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
14233 (NamespaceEntry.Lookup): Add new argument to flag if we want the
14234 lookup to avoid symbols introduced by 'using'.
14235 * rootcontext.cs (NamespaceLookup): Update.
14237 2004-09-12 Marek Safar <marek.safar@seznam.cz>
14239 * class.cs (TypeContainer.DoDefineMembers): Do not call
14240 DefineDefaultConstructor for static classes.
14242 2004-09-12 Marek Safar <marek.safar@seznam.cz>
14244 * attribute.cs (Attribute.Resolve): Add error 653 report.
14246 * class.cs (Class.ApplyAttributeBuilder): Add error 641
14248 (Method.ApplyAttributeBuilder): Add error 685 report.
14249 (Operator.Define): Add error 564 report.
14251 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
14253 * expression.cs (Invocation.DoResolve): Add error
14254 245 and 250 report.
14256 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
14259 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14261 * class.cs (ConstructorInitializer.Resolve):
14262 Wrong error number (515->516).
14264 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14266 * class.cs (Indexer.Define): Add error 631 report.
14268 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14270 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
14272 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14274 * expression.cs (Probe.DoResolve): Add error CS0241 report.
14276 2004-09-10 Marek Safar <marek.safar@seznam.cz>
14278 * cs-parser.jay: Added error CS0241 report.
14280 2004-09-10 Raja R Harinath <rharinath@novell.com>
14282 * cs-parser.jay (fixed_statement): Introduce a scope for the
14283 declaration in the 'fixed' statement.
14285 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14287 * cs-parser.jay: Added CS0230 error report.
14289 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14291 * cs-parser.jay: Added errors CS0231 and CS0257 report.
14293 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14295 * expression.cs (Argument.Resolve): Added error CS0192 and
14298 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14300 C# 2.0 #pragma warning feature
14302 * cs-tokenizer.cs (PreProcessPragma): New method;
14303 Handles #pragma directive.
14305 * report.cs (WarningRegions): New class; Support
14306 class for #pragma warning directive. It tests whether
14307 warning is enabled for a given line.
14309 2004-09-08 Miguel de Icaza <miguel@ximian.com>
14311 * const.cs: Add more descriptive error report, tahnks to
14314 2004-09-08 Marek Safar <marek.safar@seznam.cz>
14316 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
14318 2004-09-07 Miguel de Icaza <miguel@ximian.com>
14320 * expression.cs: Apply patch from Ben: Remove dead code from
14321 ArrayCreation, and remove the TurnintoConstant call in const.cs,
14322 as that code just threw an exception anwyays.
14324 * const.cs: Remove the call to the turnintoconstant, for details
14327 * literal.cs: The type of the null-literal is the null type; So
14328 we use a placeholder type (literal.cs:System.Null, defined here)
14331 * expression.cs (Conditional.DoResolve): Remove some old code that
14332 is no longer needed, conversions have been fixed.
14334 (ArrayCreationExpression.DoResolve): Return false if we fail to
14335 resolve the inner expression.
14337 2004-09-07 Raja R Harinath <rharinath@novell.com>
14340 * cs-parser.jay (delegate_declaration): Record a delegate
14341 declaration as a type declaration.
14342 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
14344 2004-09-06 Miguel de Icaza <miguel@ximian.com>
14346 * parameter.cs: Do not crash if the type can not be resolved.
14348 * expression.cs: Report errors with unsafe pointers, fixes #64896
14350 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
14352 * expression.cs: Pointer arith always needs to do a conv.i
14353 if the operand is a long. fix 65320
14355 2004-09-04 Marek Safar <marek.safar@seznam.cz>
14357 Fixed cs0619-37.cs, cs0619-38.cs
14359 * enum.cs (GetObsoleteAttribute): Removed.
14361 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
14362 on Enum member is double staged. The first is tested member
14365 2004-09-04 Marek Safar <marek.safar@seznam.cz>
14367 Fixed #56986, #63631, #65231
14369 * class.cs: (TypeContainer.AddToMemberContainer): New method,
14370 adds member to name container.
14371 (TypeContainer.AddToTypeContainer): New method, adds type to
14373 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
14374 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
14375 AddOperator): Simplified by reusing AddToMemberContainer.
14376 (TypeContainer.UserDefinedStaticConstructor): Changed to property
14378 (Method.CheckForDuplications): Fixed implementation to test all
14380 (MemberBase): Detection whether member is explicit interface
14381 implementation is now in constructor.
14382 (MemberBase.UpdateMemberName): Handles IndexerName.
14383 (Accessor): Changed to keep also location information.
14384 (AbstractPropertyEventMethod): Is derived from MemberCore.
14385 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
14386 will be emited or not.
14387 (PropertyBase.AreAccessorsDuplicateImplementation):
14388 Tests whether accessors are not in collision with some method.
14389 (Operator): Is derived from MethodCore to simplify common
14392 * decl.cs (Flags.TestMethodDuplication): Test for duplication
14394 (DeclSpace.AddToContainer): Adds the member to defined_names
14395 table. It tests for duplications and enclosing name conflicts.
14397 * enum.cs (EnumMember): Clean up to reuse the base structures
14399 2004-09-03 Martin Baulig <martin@ximian.com>
14401 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
14402 into TypeContainer, to make partial classes work again.
14404 2004-09-03 Martin Baulig <martin@ximian.com>
14406 * rootcontext.cs (RootContext.V2): Removed.
14408 2004-03-23 Martin Baulig <martin@ximian.com>
14410 * expression.cs (Invocation.OverloadResolve): Added `bool
14411 may_fail' argument and use it instead of the Location.IsNull() hack.
14413 2004-09-03 Martin Baulig <martin@ximian.com>
14415 Merged latest changes into gmcs. Please keep this comment in
14416 here, it makes it easier for me to see what changed in MCS since
14417 the last time I merged.
14419 2004-09-03 Raja R Harinath <rharinath@novell.com>
14422 * expression.cs (BetterConversion): Don't allow either conversion
14423 to be null. Remove redundant implicit conversion test when 'q ==
14424 null' -- when this function is invoked, we already know that the
14425 implicit conversion exists.
14426 (BetterFunction): Assume that 'best' is non-null. Remove
14427 redundant reimplementation of IsApplicable when 'best' is null.
14428 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
14429 number of arguments.
14430 (IsAncestralType): Extract from OverloadResolve.
14431 (OverloadResolve): Make robust to the MethodGroupExpr being
14432 unsorted. Implement all the logic of Section 14.5.5.1, and
14433 support overloading of methods from multiple applicable types.
14434 Clean up logic somewhat. Don't pass null methods to BetterFunction.
14436 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
14437 (RealError, Warning): Append type of report to related symbol.
14439 2004-09-03 Marek Safar <marek.safar@seznam.cz>
14441 * enum.cs: Fixed CLS-Compliance checks for enum members.
14442 Error tests cs3008-8.cs, cs3014-8.cs
14444 2004-09-02 Marek Safar <marek.safar@seznam.cz>
14446 Fixed bug #62342, #63102
14447 * class.cs: ImplementIndexer uses member.IsExplicitImpl
14448 like ImplementMethod.
14450 2004-09-02 Marek Safar <marek.safar@seznam.cz>
14452 * attribute.cs (Attribute.GetAttributeArgumentExpression):
14455 2004-09-02 Martin Baulig <martin@ximian.com>
14457 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
14458 TypeManager.GetArgumentTypes() rather than calling GetParameters()
14461 2004-09-01 Marek Safar <marek.safar@seznam.cz>
14463 C# 2.0 Static classes implemented
14465 * class.cs (TypeContainer): instance_constructors,
14466 initialized_fields, initialized_static_fields,
14467 default_constructor, base_inteface_types are protected to be
14468 accessible from StaticClass.
14469 (TypeContainer.DefineDefaultConstructor): New virtual method
14470 for custom default constructor generating
14471 (StaticClass): New class to handle "Static classes" feature.
14473 * cs-parser.jay: Handle static keyword on class like instance
14476 * driver.cs: Added "/langversion" command line switch with two
14477 options (iso-1, default).
14479 2004-08-31 Marek Safar <marek.safar@seznam.cz>
14481 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
14483 2004-08-31 Miguel de Icaza <miguel@ximian.com>
14485 * delegate.cs: Style.
14487 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
14489 * delegate.cs: Add seperate instance expr field for miguel.
14491 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
14493 * PointerArithmetic (Resolve): make sure we are not doing
14494 pointer arith on void*. Also, make sure we are resolved
14495 by not setting eclass until resolve.
14497 All callers: Make sure that PointerArithmetic gets resolved.
14499 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
14501 * ArrayCreation (LookupType): If the type does not resolve
14502 to an array, give an error.
14504 2004-08-27 Marek Safar <marek.safar@seznam.cz>
14506 * statement.cs (Try.Resolve): Fixed bug #64222
14508 2004-08-27 Martin Baulig <martin@ximian.com>
14511 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
14514 2004-08-26 Marek Safar <marek.safar@seznam.cz>
14516 * ecore.cs (Constantify): Get underlying type via
14517 System.Enum.GetUnderlyingType to avoid StackOverflow on the
14518 Windows in special cases.
14520 2004-08-26 Marek Safar <marek.safar@seznam.cz>
14522 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
14523 for obtaining also private methods.
14524 (GetRemoveMethod): Used GetRemoveMethod (true)
14525 for obtaining also private methods.
14527 2004-08-24 Martin Baulig <martin@ximian.com>
14529 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
14530 MethodAttributes.HideBySig for operators.
14532 2004-08-23 Martin Baulig <martin@ximian.com>
14534 Back to the old error reporting system :-)
14536 * report.cs (Message): Removed.
14537 (Report.MessageData, ErrorData, WarningData): Removed.
14538 (Report.Error, Warning): Back to the old system.
14540 2004-08-23 Martin Baulig <martin@ximian.com>
14542 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
14544 * class.cs (TypeContainer.ParentContainer): New public virtual
14545 method; replaces the explicit interface implementation.
14546 (ClassPart.ParentContainer): Override.
14548 2004-08-23 Martin Baulig <martin@ximian.com>
14550 * statement.cs (Switch): Added support for constant switches; see
14551 #59428 or test-285.cs.
14553 2004-08-22 Marek Safar <marek.safar@seznam.cz>
14556 * statement.cs (GetEnumeratorFilter): Removed useless
14557 logic because C# specs is strict. GetEnumerator must be
14560 2004-08-22 Martin Baulig <martin@ximian.com>
14562 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14563 a switch and may break, reset the barrier. Fixes #59867.
14565 2004-08-22 Marek Safar <marek.safar@seznam.cz>
14567 CLS-Compliance speed up (~5% for corlib)
14569 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
14570 New method. Tests container for CLS-Compliant names
14572 * class.cs (TypeContainer.VerifyClsName): New method.
14573 Checks whether container name is CLS Compliant.
14574 (Constructor): Implements IMethodData.
14576 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
14577 low-case table for CLS Compliance test.
14578 (MemberCache.VerifyClsParameterConflict): New method.
14579 Checks method parameters for CS3006 error.
14581 * enum.cs (EnumMember): Is derived from MemberCore.
14582 (Enum.VerifyClsName): Optimized for better performance.
14584 2004-08-06 Marek Safar <marek.safar@seznam.cz>
14586 * report.cs: Renamed Error_T to Error and changed all
14589 2004-08-06 Marek Safar <marek.safar@seznam.cz>
14591 * class.cs (TypeContainer.IndexerArrayList): New inner class
14592 container for indexers.
14593 (TypeContainer.DefaultIndexerName): New constant for default
14594 indexer name. Replaced all "Item" with this constant.
14595 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
14597 * typemanager.cs (TypeManager.default_member_ctor): Cache here
14598 DefaultMemberAttribute constructor.
14600 2004-08-05 Martin Baulig <martin@ximian.com>
14602 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
14605 2004-08-05 Marek Safar <marek.safar@seznam.cz>
14607 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
14608 multi platforms problem.
14610 * compiler.csproj: Included shared files.
14612 2004-08-04 Marek Safar <marek.safar@seznam.cz>
14614 Fix bug 60333, 55971 in the more general way
14615 * attribute.cs (Attribute.GetAttributeArgumentExpression):
14616 Added arg_type argument for constant conversion.
14617 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
14619 2004-08-04 Marek Safar <marek.safar@seznam.cz>
14622 * class.cs (TypeContainer ): New inner classes MethodArrayList,
14623 OperatorArrayList, MethodCoreArrayList for typecontainer
14624 containers. Changed class member types to these new types.
14625 (MethodArrayList.DefineMembers): Added test for CS0659.
14627 2004-08-04 Miguel de Icaza <miguel@ximian.com>
14629 * cfold.cs: Synchronize the folding with the code in expression.cs
14630 Binary.DoNumericPromotions for uint operands.
14632 * attribute.cs: Revert patch from Raja, it introduced a regression
14633 while building Blam-1.2.1 (hard to isolate a test case).
14635 2004-08-04 Marek Safar <marek.safar@seznam.cz>
14639 (TypeContainer.Define): Renamed to DefineContainerMembers because of
14641 (MethodCore.parent_method): New member. The method we're overriding
14642 if this is an override method.
14643 (MethodCore.CheckBase): Moved from Method class and made common.
14644 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
14646 (MethodCore.CheckForDuplications): New abstract method. For custom
14647 member duplication search in a container
14648 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
14649 method and its return type.
14650 (Event.conflict_symbol): New member. Symbol with same name in the
14654 (MemberCache.FindMemberWithSameName): New method. The method
14655 is looking for conflict with inherited symbols.
14657 2004-08-04 Martin Baulig <martin@ximian.com>
14659 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
14661 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
14663 2004-08-03 Marek Safar <marek.safar@seznam.cz>
14665 * report.cs (Message): New enum for better error, warning reference in
14667 (MessageData): New inner abstract class. It generally handles printing of
14668 error and warning messages.
14669 Removed unused Error, Warning, Message methods.
14671 2004-08-03 Marek Safar <marek.safar@seznam.cz>
14673 Fix for cs0592-8.cs test
14675 (Attributable.ValidAttributeTargets): Made public.
14676 (Attribute.ExplicitTarget): New member for explicit target value.
14677 (Attribute.CheckTargets): Now we translate explicit attribute
14678 target to Target here.
14680 2004-08-03 Ben Maurer <bmaurer@ximian.com>
14682 * ecore.cs (MethodGroupExpr): new IsBase property.
14684 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
14686 * delegate.cs (DelegateCreation): store a MethodGroupExpr
14687 rather than an instance expr.
14689 (DelegateCreation.Emit): Use the method group rather than
14690 the instance expression. Also, if you have base.Foo as the
14691 method for a delegate, make sure to emit ldftn, not ldftnvirt.
14693 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
14695 (NewDelegate.DoResolve): Only check for the existance of Invoke
14696 if the method is going to be needed. Use MethodGroupExpr.
14698 (NewDelegate.Emit): Remove, DelegateCreation implements this.
14700 * expression.cs: For pointer arith., make sure to use
14701 the size of the type, not the size of the pointer to
14704 2004-08-03 Marek Safar <marek.safar@seznam.cz>
14707 * class.cs (Class): Added error CS0502 test.
14709 2004-08-03 John Luke <jluke@cfl.rr.com>
14710 Raja R Harinath <rharinath@novell.com>
14713 * attribute.cs (Attribute.complained_before): New flag.
14714 (Attribute.ResolveType, Attribute.Resolve),
14715 (Attribute.DefinePInvokeMethod): Set it.
14716 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
14718 2004-08-03 Martin Baulig <martin@ximian.com>
14720 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
14721 use a user-defined operator; we still need to do numeric
14722 promotions in case one argument is a builtin type and the other
14723 one has an implicit conversion to that type. Fixes #62322.
14725 2004-08-02 Martin Baulig <martin@ximian.com>
14727 * statement.cs (LocalInfo.Flags): Added `IsThis'.
14728 (LocalInfo.IsThis): New public property.
14729 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
14731 2004-08-01 Martin Baulig <martin@ximian.com>
14733 * class.cs (TypeContainer.GetClassBases): Don't set the default
14734 here since we may get called from GetPartialBases().
14735 (TypeContainer.DefineType): If GetClassBases() didn't return a
14736 parent, use the default one.
14738 2004-07-30 Duncan Mak <duncan@ximian.com>
14740 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
14742 2004-07-30 Martin Baulig <martin@ximian.com>
14744 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
14746 * class.cs (SourceMethod): New public class, derive from the
14747 symbol writer's ISourceMethod.
14748 (Method): Use the new symbol writer API.
14750 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
14751 as argument and use the new symbol writer.
14754 (SourceFile): Implement the symbol writer's ISourceFile.
14755 (Location.SymbolDocument): Removed.
14756 (Location.SourceFile): New public property.
14758 * symbolwriter.cs: Use the new symbol writer API.
14760 2004-07-30 Raja R Harinath <rharinath@novell.com>
14762 * Makefile (install-local): Remove. Functionality moved to
14765 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
14767 * Makefile: Install mcs.exe.config file together with mcs.exe.
14768 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
14769 correct runtime version.
14771 2004-07-25 Martin Baulig <martin@ximian.com>
14774 (TypeContainer.RegisterOrder): Removed, this was unused.
14775 (TypeContainer, interface_order): Removed.
14776 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
14777 TypeContainer as argument since we can also be called with a
14778 `PartialContainer' for a partial class/struct/interface.
14779 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
14780 of checking whether we're an `Interface' - we could be a
14781 `PartialContainer'.
14782 (PartialContainer.Register): Override; call
14783 AddClass()/AddStruct()/AddInterface() on our parent.
14785 * cs-parser.jay (interface_member_declaration): Add things to the
14786 `current_container', not the `current_class'.
14788 * rootcontext.cs (RegisterOrder): The overloaded version which
14789 takes an `Interface' was unused, removed.
14791 * typemanager.cs (TypeManager.LookupInterface): Return a
14792 `TypeContainer', not an `Interface'.
14793 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
14794 contain a `PartialContainer' for an interface, so check it's
14795 `Kind' to figure out what it is.
14797 2004-07-25 Martin Baulig <martin@ximian.com>
14799 * class.cs (Class.DefaultTypeAttributes): New public constant.
14800 (Struct.DefaultTypeAttributes): Likewise.
14801 (Interface.DefaultTypeAttributes): Likewise.
14802 (PartialContainer.TypeAttr): Override this and add the
14803 DefaultTypeAttributes.
14805 2004-07-25 Martin Baulig <martin@ximian.com>
14807 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
14808 we can just use the `Parent' field instead.
14810 2004-07-25 Martin Baulig <martin@ximian.com>
14812 * class.cs (TypeContainer.Emit): Renamed to EmitType().
14814 2004-07-25 Martin Baulig <martin@ximian.com>
14816 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
14817 our parts before defining any methods.
14818 (TypeContainer.VerifyImplements): Make this virtual.
14819 (ClassPart.VerifyImplements): Override and call VerifyImplements()
14820 on our PartialContainer.
14822 2004-07-25 Martin Baulig <martin@ximian.com>
14824 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
14826 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
14827 argument, we can just use the `Parent' field instead.
14830 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
14831 (MemberBase.DoDefine): Likewise.
14833 2004-07-24 Martin Baulig <martin@ximian.com>
14835 * decl.cs (MemberCore.Parent): New public field.
14836 (DeclSpace.Parent): Moved to MemberCore.
14838 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
14839 (MemberBase.ctor): Added TypeContainer argument, pass it to our
14841 (FieldBase, Field, Operator): Likewise.
14842 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
14843 (EventField, Event): Likewise.
14845 2004-07-23 Martin Baulig <martin@ximian.com>
14847 * class.cs (PartialContainer): New public class.
14848 (ClassPart): New public class.
14849 (TypeContainer): Added support for partial classes.
14850 (TypeContainer.GetClassBases): Splitted some of the functionality
14851 out into GetNormalBases() and GetPartialBases().
14853 * cs-tokenizer.cs (Token.PARTIAL): New token.
14854 (Tokenizer.consume_identifier): Added some hacks to recognize
14855 `partial', but only if it's immediately followed by `class',
14856 `struct' or `interface'.
14858 * cs-parser.jay: Added support for partial clases.
14860 2004-07-23 Martin Baulig <martin@ximian.com>
14862 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
14863 a `DeclSpace' and also made it readonly.
14864 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
14865 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
14866 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
14868 * cs-parser.jay: Pass the `current_class', not the
14869 `current_container' (at the moment, this is still the same thing)
14870 to a new Method, Property, Event, Indexer or Constructor.
14872 2004-07-23 Martin Baulig <martin@ximian.com>
14874 * cs-parser.jay (CSharpParser): Added a new `current_class' field
14875 and removed the `current_interface' one.
14876 (struct_declaration, class_declaration, interface_declaration):
14877 Set `current_class' to the newly created class/struct/interface;
14878 set their `Bases' and call Register() before parsing their body.
14880 2004-07-23 Martin Baulig <martin@ximian.com>
14882 * class.cs (Kind): New public enum.
14883 (TypeContainer): Made this class abstract.
14884 (TypeContainer.Kind): New public readonly field.
14885 (TypeContainer.CheckDef): New public method; moved here from
14887 (TypeContainer.Register): New public abstract method.
14888 (TypeContainer.GetPendingImplementations): New public abstract
14890 (TypeContainer.GetClassBases): Removed the `is_class' and
14891 `is_iface' parameters.
14892 (TypeContainer.DefineNestedTypes): Formerly known as
14894 (ClassOrStruct): Made this class abstract.
14896 * tree.cs (RootTypes): New public type.
14898 2004-07-20 Martin Baulig <martin@ximian.com>
14900 * tree.cs (Tree.RecordNamespace): Removed.
14901 (Tree.Namespaces): Removed.
14903 * rootcontext.cs (RootContext.IsNamespace): Removed.
14905 * cs-parser.jay (namespace_declaration): Just create a new
14906 NamespaceEntry here.
14908 2004-07-20 Martin Baulig <martin@ximian.com>
14910 * statement.cs (ExceptionStatement): New abstract class. This is
14911 now used as a base class for everyone who's using `finally'.
14912 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
14913 our local variables before using them.
14915 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
14916 virtual method. This is used by Yield.Resolve() to "steal" an
14917 outer block's `finally' clauses.
14918 (FlowBranchingException): The .ctor now takes an ExceptionStatement
14921 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
14922 version which takes an ExceptionStatement. This version must be
14923 used to create exception branchings.
14926 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
14927 (Iterator.EmitMoveNext): Added exception support; protect the
14928 block with a `fault' clause, properly handle 'finally' clauses.
14929 (Iterator.EmitDispose): Run all the `finally' clauses here.
14931 2004-07-20 Martin Baulig <martin@ximian.com>
14933 * iterator.cs: This is the first of a set of changes in the
14934 iterator code. Match the spec more closely: if we're an
14935 IEnumerable, then GetEnumerator() must be called. The first time
14936 GetEnumerator() is called, it returns the current instance; all
14937 subsequent invocations (if any) must create a copy.
14939 2004-07-19 Miguel de Icaza <miguel@ximian.com>
14941 * expression.cs: Resolve the constant expression before returning
14944 2004-07-19 Martin Baulig <martin@ximian.com>
14946 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
14947 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
14948 the return type of the new EmitContext.
14950 2004-07-18 Martin Baulig <martin@ximian.com>
14952 * class.cs (Property.Define): Fix iterators.
14954 * iterators.cs (Iterator.Define): Moved the
14955 `container.AddInterator (this)' call here from the .ctor; only do
14956 it if we resolved successfully.
14958 2004-07-17 Miguel de Icaza <miguel@ximian.com>
14960 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
14961 `true' for preprocessing directives that we parse. The return
14962 value indicates whether we should return to regular tokenizing or
14963 not, not whether it was parsed successfully.
14965 In the past if we were in: #if false ... #line #endif, we would
14966 resume parsing after `#line'. See bug 61604.
14968 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
14969 building: IsEnumType should return true only for enums, not for
14970 enums or System.Enum itself. This fixes #61593.
14972 Likely what happened is that corlib was wrong: mcs depended on
14973 this bug in some places. The bug got fixed, we had to add the
14974 hack, which caused bug 61593.
14976 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
14977 that was a workaround for the older conditions.
14979 2004-07-16 Ben Maurer <bmaurer@ximian.com>
14981 * assign.cs: IAssignMethod has a new interface, as documented
14982 inline. All assignment code now uses this new api.
14984 * ecore.cs, expression.cs: All classes which implement
14985 IAssignMethod now use the new interface.
14987 * expression.cs (Invocation): add a hack to EmitCall so that
14988 IndexerAccess can be the target of a compound assignment without
14989 evaluating its arguments twice.
14991 * statement.cs: Handle changes in Invocation api.
14993 2004-07-16 Martin Baulig <martin@ximian.com>
14995 * iterators.cs: Rewrote this. We're now using one single Proxy
14996 class for both the IEnumerable and the IEnumerator interface and
14997 `Iterator' derives from Class so we can use the high-level API.
14999 * class.cs (TypeContainer.AddIterator): New method.
15000 (TypeContainer.DoDefineType): New protected virtual method, which
15001 is called from DefineType().
15002 (TypeContainer.DoDefineMembers): Call DefineType() and
15003 DefineMembers() on all our iterators.
15004 (TypeContainer.Emit): Call Emit() on all our iterators.
15005 (TypeContainer.CloseType): Call CloseType() on all our iterators.
15007 * codegen.cs (EmitContext.CurrentIterator): New public field.
15009 2004-07-15 Martin Baulig <martin@ximian.com>
15012 (TypeManager.not_supported_exception_type): New type.
15014 2004-07-14 Martin Baulig <martin@ximian.com>
15016 * iterators.cs: Use real error numbers.
15018 2004-07-14 Martin Baulig <martin@ximian.com>
15020 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15021 requires this to be a System.Collection.IEnumerable and not a
15022 class implementing that interface.
15023 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
15025 2004-07-13 Marek Safar <marek.safar@seznam.cz>
15027 * class.cs: Fixed previous fix, it broke some error tests.
15029 2004-07-12 Martin Baulig <martin@ximian.com>
15031 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15034 2004-07-09 Miguel de Icaza <miguel@ximian.com>
15036 * assign.cs (LocalTemporary): Add new argument: is_address,If
15037 `is_address' is true, then the value that we store is the address
15038 to the real value, and not the value itself.
15040 * ecore.cs (PropertyExpr): use the new local temporary
15041 stuff to allow us to handle X.Y += z (where X is a struct)
15043 2004-07-08 Martin Baulig <martin@ximian.com>
15045 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15046 not always return, just like we're doing in Using.Resolve().
15048 2004-07-07 Miguel de Icaza <miguel@ximian.com>
15050 * cs-parser.jay (fixed_statement): flag this as Pinned.
15052 2004-07-06 Miguel de Icaza <miguel@ximian.com>
15054 * typemanager.cs (TypeManager): Removed MakePinned method, this
15055 mechanism is replaced with the .NET 2.x compatible mechanism of
15056 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15058 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
15059 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15060 `IsFixed' property which has a different meaning.
15062 2004-07-02 Raja R Harinath <rharinath@novell.com>
15064 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15065 visible from inside a nested class, not just the names of the
15066 immediately enclosing class.
15067 Fix for bug #60730.
15069 2004-06-24 Raja R Harinath <rharinath@novell.com>
15071 * expression.cs (BetterConversion): Remove buggy special-case
15072 handling of "implicit constant expression conversions". At this
15073 point, we already know that the conversion is possible -- we're
15074 only checking to see which is better.
15076 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15078 * cs-parser.jay: Added error CS0210 test.
15080 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15082 * cs-parser.jay: Added error CS0134 test.
15084 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15087 * cs-parser.jay: Added error CS0145 test.
15089 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15091 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15093 2004-06-23 Ben Maurer <bmaurer@ximian.com>
15095 * expression.cs (StackAlloc.Resolve): The argument may not
15096 be a constant; deal with this case.
15098 2004-06-23 Marek Safar <marek.safar@seznam.cz>
15100 * attribute.cs (IndexerName_GetIndexerName): Renamed to
15101 GetIndexerAttributeValue.
15102 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15104 * class.cs (Indexer.Define): Added error tests for CS0415,
15107 2004-06-23 Miguel de Icaza <miguel@ximian.com>
15109 * attribute.cs (Attribute.Resolve): Keep field code in sync with
15112 2004-06-23 Martin Baulig <martin@ximian.com>
15114 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15115 neither return nor throw, reset the barrier as well. Fixes #60457.
15117 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
15119 * class.cs : EventAttributes is now set to None by default.
15120 This fixes bug #60459.
15122 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15125 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15126 Don't throw exception but return null (it's sufficient now).
15128 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15130 * typemanager.cs (GetArgumentTypes): Faster implementation.
15132 2004-06-18 Martin Baulig <martin@ximian.com>
15134 * attribute.cs (Attribute.Resolve): Check whether we're an
15135 EmptyCast which a Constant child. Fixes #60333.
15137 2004-06-17 Ben Maurer <bmaurer@ximian.com>
15139 * statement.cs (EmitCollectionForeach): Account for the fact that
15140 not all valuetypes are in areas which we can take the address of.
15141 For these variables, we store to a temporary variable. Also, make
15142 sure that we dont emit a `callvirt' on a valuetype method.
15144 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15146 * expression.cs (StackAlloc.DoReSolve): Added test for
15147 negative parameter (CS0247).
15149 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15152 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
15154 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15157 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
15160 2004-06-14 Marek Safar <marek.safar@seznam.cz>
15162 Fix bug #58254 & cs1555.cs, cs1556.cs
15163 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
15165 2004-06-14 Marek Safar <marek.safar@seznam.cz>
15167 * cs-parser.jay: Added error CS1669 test for indexers.
15169 2004-06-11 Martin Baulig <martin@ximian.com>
15171 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
15172 call this twice: for params and varargs methods.
15174 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15177 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
15179 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15181 * attribute.cs (Attribute.GetValidTargets): Made public.
15184 (AbstractPropertyEventMethod): New class for better code sharing.
15185 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
15187 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
15189 2004-06-11 Raja R Harinath <rharinath@novell.com>
15192 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
15193 that the call to Resolve is part of a MemberAccess.
15194 (Expression.Resolve): Use it for SimpleName resolution.
15195 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
15196 Add 'intermediate' boolean argument.
15197 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
15198 error message when the SimpleName can be resolved ambiguously
15199 between an expression and a type.
15200 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
15202 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
15203 call on the left-side.
15205 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15208 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
15210 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15212 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
15214 2004-06-11 Martin Baulig <martin@ximian.com>
15216 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
15217 varargs methods if applicable.
15219 2004-06-11 Martin Baulig <martin@ximian.com>
15221 * expression.cs (Invocation.EmitCall): Don't use
15222 `method.CallingConvention == CallingConventions.VarArgs' since the
15223 method could also have `CallingConventions.HasThis'.
15225 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15227 * class.cs (Event.GetSignatureForError): Implemented.
15228 Fixed crash in error test cs3010.cs
15230 2004-06-10 Miguel de Icaza <miguel@ximian.com>
15232 * cs-tokenizer.cs: Change the way we track __arglist to be
15233 consistent with the other keywords.
15235 2004-06-09 Miguel de Icaza <miguel@ximian.com>
15237 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
15240 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
15242 * codegen.cs: Check that all referenced assemblies have a strongname
15243 before strongnaming the compiled assembly. If not report error CS1577.
15244 Fix bug #56563. Patch by Jackson Harper.
15245 * typemanager.cs: Added a method to return all referenced assemblies.
15246 Fix bug #56563. Patch by Jackson Harper.
15248 2004-06-08 Marek Safar <marek.safar@seznam.cz>
15251 (Method.ApplyAttributeBuilder): Moved and added conditional
15252 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
15255 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
15257 2004-06-08 Marek Safar <marek.safar@seznam.cz>
15260 * class.cs: (EventField.attribute_targets): Changed default target.
15262 2004-06-08 Martin Baulig <martin@ximian.com>
15264 * expression.cs (Invocation.EmitCall): Enable varargs methods.
15266 2004-06-08 Martin Baulig <martin@ximian.com>
15268 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
15270 2004-06-07 Martin Baulig <martin@ximian.com>
15272 Added support for varargs methods.
15274 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
15277 * cs-parser.jay: Added support for `__arglist'.
15279 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
15281 * expression.cs (Argument.AType): Added `ArgList'.
15282 (Invocation): Added support for varargs methods.
15283 (ArglistAccess): New public class.
15284 (Arglist): New public class.
15286 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
15288 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
15289 a method's top-level block if the method has varargs.
15291 * support.cs (ReflectionParameters, InternalParameters): Added
15292 support for varargs methods.
15294 2004-06-07 Miguel de Icaza <miguel@ximian.com>
15296 * class.cs: Provide location in indexer error report.
15298 * driver.cs: Use standard names.
15300 * namespace.cs: Catch the use of using after a namespace has been
15301 declared also on using aliases.
15303 2004-06-03 Raja R Harinath <rharinath@novell.com>
15306 * typemanager.cs (closure_private_ok, closure_invocation_type)
15307 (closure_qualifier_type, closure_invocation_assembly)
15308 (FilterWithClosure): Move to ...
15309 (Closure): New internal nested class.
15310 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
15311 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
15312 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
15313 (MemberLookup, MemberLookupFailed): Use it.
15314 * expression.cs (New.DoResolve): Treat the lookup for the
15315 constructor as being qualified by the 'new'ed type.
15316 (Indexers.GetIndexersForTypeOrInterface): Update.
15318 2004-06-03 Marek Safar <marek.safar@seznam.cz>
15321 (GetConditionalAttributeValue): New method. Returns
15322 condition of ConditionalAttribute.
15323 (SearchMulti): New method. Returns all attributes of type 't'.
15324 Use it when attribute is AllowMultiple = true.
15325 (IsConditionalMethodExcluded): New method.
15328 (Method.IsExcluded): Implemented. Returns true if method has conditional
15329 attribute and the conditions is not defined (method is excluded).
15330 (IMethodData): Extended interface for ConditionalAttribute support.
15331 (PropertyMethod.IsExcluded): Implemented.
15334 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
15337 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
15340 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
15342 * expression.cs (ArrayCreationExpression): Make this just an
15343 `expression'. It can't be a statement, so the code here was
15346 2004-06-02 Marek Safar <marek.safar@seznam.cz>
15349 * typemanager.cs (GetFullNameSignature): New method for
15352 2004-06-02 Marek Safar <marek.safar@seznam.cz>
15355 * class.cs (MemberBase.GetSignatureForError): New virtual method.
15356 Use this method when MethodBuilder is null.
15357 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
15358 Added test for error CS0626 (MONO reports error for this situation).
15359 (IMethodData.GetSignatureForError): Extended interface.
15361 2004-06-01 Marek Safar <marek.safar@seznam.cz>
15364 (AttributeTester.GetObsoleteAttribute): Returns instance of
15365 ObsoleteAttribute when type is obsolete.
15368 (TypeContainer.VerifyObsoleteAttribute): Override.
15369 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
15370 (MethodCode.VerifyObsoleteAttribute): Override.
15371 (MemberBase.VerifyObsoleteAttribute): Override.
15374 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
15375 and report proper error.
15378 Delegate.VerifyObsoleteAttribute): Override.
15381 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
15382 and report proper error.
15383 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
15386 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
15390 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
15391 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
15392 Added test for ObsoleteAttribute.
15395 (Catch): Derived from Statement.
15397 2004-06-01 Marek Safar <marek.safar@seznam.cz>
15399 Fixed bug #59071 & cs0160.cs
15401 * statement.cs (Try.Resolve): Check here whether order of catch
15402 clauses matches their dependencies.
15404 2004-05-31 Miguel de Icaza <miguel@ximian.com>
15406 * Reverted patch to namespace.cs (Use lookuptypedirect). This
15407 caused a regression: #59343. Referencing nested classes from an
15408 assembly stopped working.
15410 2004-05-31 Martin Baulig <martin@ximian.com>
15412 MCS is now frozen for beta 2.
15414 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15416 * convert.cs: add a trivial cache for overload operator resolution.
15418 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15420 * decl.cs: If possible, use lookuptypedirect here. We can only do
15421 this if there is no `.' after the namespace. Avoids using
15422 LookupType, which does lots of slow processing.
15423 (FindNestedType) New method, does what it says :-).
15424 * namespace.cs: use LookupTypeDirect.
15425 * rootcontext.cs: use membercache, if possible.
15426 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
15428 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15431 According to the spec,
15433 In a member access of the form E.I, if E is a single identifier,
15434 and if the meaning of E as a simple-name (§7.5.2) is a constant,
15435 field, property, localvariable, or parameter with the same type as
15436 the meaning of E as a type-name (§3.8), then both possible
15437 meanings of E are permitted.
15439 We did not check that E as a simple-name had the same type as E as
15442 This trivial check gives us 5-7% on bootstrap time.
15444 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15446 * expression.cs (Invocation.OverloadResolve): Avoid the
15447 use of hashtables and boxing here by allocating on demand.
15449 2004-05-30 Martin Baulig <martin@ximian.com>
15451 * rootcontext.cs (RootContext.LookupType): Don't cache things if
15452 we're doing a silent lookup. Don't try to lookup nested types in
15453 TypeManager.object_type (thanks to Ben Maurer).
15455 2004-05-30 Martin Baulig <martin@ximian.com>
15457 Committing a patch from Ben Maurer.
15459 * rootcontext.cs (RootContext.LookupType): Cache negative results.
15461 2004-05-29 Martin Baulig <martin@ximian.com>
15463 * class.cs (IMethodData.ShouldIgnore): New method.
15465 * typemanager.cs (TypeManager.MethodFlags): Don't take a
15466 `Location' argument, we don't need it anywhere. Use
15467 `IMethodData.ShouldIgnore ()' instead of
15468 `MethodData.GetMethodFlags ()'.
15469 (TypeManager.AddMethod): Removed.
15470 (TypeManager.AddMethod2): Renamed to AddMethod.
15472 2004-05-29 Martin Baulig <martin@ximian.com>
15474 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
15476 * convert.cs (Convert.ImplicitReferenceConversion): If we're
15477 converting from a class type S to an interface type and we already
15478 have an object on the stack, don't box it again. Fixes #52578.
15480 2004-05-29 Martin Baulig <martin@ximian.com>
15482 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15483 Added support for `params' parameters. Fixes #59267.
15485 2004-05-29 Martin Baulig <martin@ximian.com>
15487 * literal.cs (NullPointer): Provide a private .ctor which sets
15488 `type' to TypeManager.object_type. Fixes #59048.
15490 2004-05-29 Martin Baulig <martin@ximian.com>
15492 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
15493 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
15495 * ecore.cs (EventExpr.instance_expr): Make the field private.
15497 2004-05-26 Marek Safar <marek.safar@seznam.cz>
15499 Fixed bug #50080 & cs0214-2.cs
15500 * expression.cs (Cast.DoResolve): Check unsafe context here.
15502 * statement.cs (Resolve.DoResolve): Likewise.
15504 2004-05-26 Martin Baulig <martin@ximian.com>
15506 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
15508 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
15509 (RootContext.LookupType): Pass down the `silent' flag.
15511 2004-05-25 Martin Baulig <martin@ximian.com>
15514 (MethodGroupExpr.IdenticalTypeName): New public property.
15515 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
15516 expression actually refers to a type.
15518 2004-05-25 Martin Baulig <martin@ximian.com>
15520 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
15521 for #56176 and made it actually work.
15523 2004-05-25 Martin Baulig <martin@ximian.com>
15525 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
15526 (FieldExpr, PropertyExpr): Override and implement
15527 CacheTemporaries. Fixes #52279.
15529 2004-05-25 Miguel de Icaza <miguel@ximian.com>
15531 * location.cs: In the new compiler listing a file twice is a
15532 warning, not an error.
15534 2004-05-24 Martin Baulig <martin@ximian.com>
15536 * enum.cs (Enum.DefineType): For the `BaseType' to be a
15537 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
15539 2004-05-24 Martin Baulig <martin@ximian.com>
15541 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
15542 walking the `using' list. Fixes #53921.
15544 2004-05-24 Martin Baulig <martin@ximian.com>
15546 * const.cs (Const.LookupConstantValue): Added support for
15547 EmptyCast's; fixes #55251.
15549 2004-05-24 Martin Baulig <martin@ximian.com>
15551 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
15552 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
15553 which does the CS0135 check. The reason is that we first need to
15554 check whether the variable actually exists.
15556 2004-05-24 Martin Baulig <martin@ximian.com>
15558 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
15559 than RootContext.LookupType() to find the explicit interface
15560 type. Fixes #58584.
15562 2004-05-24 Raja R Harinath <rharinath@novell.com>
15564 * Makefile: Simplify. Use executable.make.
15565 * mcs.exe.sources: New file. List of sources of mcs.exe.
15567 2004-05-24 Anders Carlsson <andersca@gnome.org>
15571 Use the invariant culture when doing String.Compare for CLS case
15574 2004-05-23 Martin Baulig <martin@ximian.com>
15576 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
15577 don't have any dots. Fixes #52622, added cs0246-8.cs.
15579 * namespace.cs (NamespaceEntry.Lookup): Likewise.
15581 2004-05-23 Marek Safar <marek.safar@seznam.cz>
15583 * class.cs (MemberBase.Define): Reuse MemberType member for
15584 resolved type. Other methods can use it too.
15586 2004-05-23 Martin Baulig <martin@ximian.com>
15588 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
15589 the variable also exists in the current block (otherwise, we need
15590 to report a CS0103). Fixes #58670.
15592 2004-05-23 Martin Baulig <martin@ximian.com>
15594 * flowanalysis.cs (Reachability.Reachable): Compute this
15595 on-the-fly rather than storing it as a field.
15597 2004-05-23 Martin Baulig <martin@ximian.com>
15599 * flowanalysis.cs (Reachability.And): Manually compute the
15600 resulting `barrier' from the reachability.
15602 2004-05-23 Marek Safar <marek.safar@seznam.cz>
15605 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
15606 instance of ObsoleteAttribute when symbol is obsolete.
15609 (IMethodData): Extended interface for ObsoleteAttribute support.
15611 2004-05-22 Marek Safar <marek.safar@seznam.cz>
15613 * attribute.cs: Fix bug #55970
15615 2004-05-22 Marek Safar <marek.safar@seznam.cz>
15619 (GetObsoleteAttribute): New method. Creates the instance of
15621 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
15622 ObsoleteAttribute when member is obsolete.
15623 (AttributeTester.Report_ObsoleteMessage): Common method for
15624 Obsolete error/warning reporting.
15627 (TypeContainer.base_classs_type): New member for storing parent type.
15630 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
15631 for this MemberCore.
15633 2004-05-21 Marek Safar <marek.safar@seznam.cz>
15635 * attribute.cs, const.cs: Fix bug #58590
15637 2004-05-21 Martin Baulig <martin@ximian.com>
15639 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
15640 out parameters if the end of the method is unreachable. Fixes
15643 2004-05-21 Marek Safar <marek.safar@seznam.cz>
15645 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
15646 Hari was right, why extra method.
15648 2004-05-21 Marek Safar <marek.safar@seznam.cz>
15650 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
15652 2004-05-20 Martin Baulig <martin@ximian.com>
15654 Merged this back from gmcs to keep the differences to a minumum.
15656 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
15657 instead of a Declspace.
15658 (Attribute.ResolveType): Likewise.
15659 (Attributes.Search): Likewise.
15660 (Attributes.Contains): Likewise.
15661 (Attributes.GetClsCompliantAttribute): Likewise.
15663 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
15665 (MethodData.ApplyAttributes): Take an EmitContext instead of a
15668 2004-05-19 Marek Safar <marek.safar@seznam.cz>
15670 Fix bug #58688 (MCS does not report error when the same attribute
15673 * attribute.cs (Attribute.Emit): Distinction between null and default.
15675 2004-05-19 Raja R Harinath <rharinath@novell.com>
15677 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
15678 of a top-level attribute without an attribute target.
15679 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
15681 (Attribute.Conditional_GetConditionName),
15682 (Attribute.Obsolete_GetObsoleteMessage): Update.
15683 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
15684 part of ScanForIndexerName.
15685 (Attribute.CanIgnoreInvalidAttribute): New function.
15686 (Attribute.ScanForIndexerName): Move to ...
15687 (Attributes.ScanForIndexerName): ... here.
15688 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
15689 (Attributes.Search): New internal variant that can choose not to
15690 complain if types aren't resolved. The original signature now
15692 (Attributes.GetClsCompliantAttribute): Use internal variant, with
15693 complaints suppressed.
15694 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
15695 only if it not useful.
15696 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
15697 top-level for attributes that are shared between the assembly
15698 and a top-level class.
15699 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
15700 * class.cs: Update to reflect changes.
15701 (DefineIndexers): Fuse loops.
15702 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
15703 a couple more variants of attribute names.
15705 2004-05-18 Marek Safar <marek.safar@seznam.cz>
15707 Fix bug #52585 (Implemented explicit attribute declaration)
15710 (Attributable.ValidAttributeTargets): New abstract method. It gets
15711 list of valid attribute targets for explicit target declaration.
15712 (Attribute.Target): It holds target itself.
15713 (AttributeSection): Removed.
15714 (Attribute.CheckTargets): New method. It checks whether attribute
15715 target is valid for the current element.
15718 (EventProperty): New class. For events that are declared like
15719 property (with add and remove accessors).
15720 (EventField): New class. For events that are declared like field.
15723 * cs-parser.jay: Implemented explicit attribute target declaration.
15725 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
15726 Override ValidAttributeTargets.
15729 (ReturnParameter): Class for applying custom attributes on
15731 (ParameterAtribute): New class. Class for applying custom
15732 attributes on the parameter type.
15734 2004-05-17 Miguel de Icaza <miguel@ximian.com>
15736 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
15739 (Method): Allow UNSAFE here.
15741 * modifiers.cs: Support unsafe reporting.
15743 2004-05-17 Marek Safar <marek.safar@seznam.cz>
15745 * decl.cs: Fix bug #58478.
15747 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15749 * statement.cs: When checking for unreachable code on an EmptyStatement,
15750 set the location. Fixes bug #58488.
15752 2004-05-13 Miguel de Icaza <miguel@ximian.com>
15754 * driver.cs: Add -pkg handling.
15756 From Gonzalo: UseShelLExecute=false
15758 2004-05-12 Marek Safar <marek.safar@seznam.cz>
15761 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
15763 (Attribute.IsClsCompliaceRequired): Moved to base for better
15765 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
15766 when attribute is AttributeUsageAttribute.
15767 (Attribute.GetValidTargets): Simplified.
15768 (Attribute.GetAttributeUsage): New method returns AttributeUsage
15769 attribute for this type.
15770 (Attribute.ApplyAttributes): Method renamed to Emit and make
15772 (GlobalAttributeSection): New class for special handling of global
15773 attributes (assembly, module).
15774 (AttributeSection.Emit): New method.
15776 * class.cs: Implemented Attributable abstract methods.
15777 (MethodCore.LabelParameters): Moved to Parameter class.
15778 (Accessor): Is back simple class.
15779 (PropertyMethod): Implemented Attributable abstract class.
15780 (DelegateMethod): Implemented Attributable abstract class.
15781 (Event): New constructor for disctintion between normal Event
15782 and Event with accessors.
15784 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
15786 * codegen.cs, const.cs, decl.cs, delegate.cs:
15787 (CommonAssemblyModulClass): Implemented Attributable abstract class
15790 * enum.cs: Implement IAttributeSupport interface.
15791 (EnumMember): New class for emum members. Implemented Attributable
15795 (ParameterBase): Is abstract.
15796 (ReturnParameter): New class for easier [return:] attribute handling.
15798 * typemanager.cs: Removed builder_to_attr.
15800 2004-05-11 Raja R Harinath <rharinath@novell.com>
15803 * attribute.cs (Attribute.GetPositionalValue): New function.
15804 * class.cs (TypeContainer.VerifyMembers): New function.
15805 (TypeContainer.Emit): Use it.
15806 (ClassOrStruct): New base class for Class and Struct.
15807 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
15808 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
15810 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
15811 then each non-static field should have a FieldOffset attribute.
15812 Otherwise, none of the fields should have a FieldOffset attribute.
15813 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
15814 and FieldOffset attributes.
15815 * typemanager.cs (TypeManager.struct_layout_attribute_type)
15816 (TypeManager.field_offset_attribute_type): New core types.
15817 (TypeManager.InitCoreTypes): Initialize them.
15819 2004-05-11 Michal Moskal <malekith@pld-linux.org>
15821 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
15822 Return correct type.
15825 2004-05-09 Miguel de Icaza <miguel@ximian.com>
15827 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
15828 be implicitly converted to ulong.
15830 * expression.cs: The logic for allowing operator &, | and ^ worked
15831 was wrong, it worked before because we did not report an error in
15832 an else branch. Fixes 57895.
15834 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
15835 allow volatile fields to be reference types.
15837 2004-05-07 Miguel de Icaza <miguel@ximian.com>
15839 * driver.cs: Add support for /debug-
15841 2004-05-07 Raja R Harinath <rharinath@novell.com>
15843 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
15844 Add a 'complain' parameter to silence errors.
15845 (Attribute.Resolve): Update to changes. Put in sanity check to catch
15846 silently overlooked type-resolutions.
15847 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
15848 to reflect changes.
15849 (Attributes.Search): New function.
15850 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
15851 (Attributes.GetAttributeFullName): Remove hack.
15852 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
15853 Update to reflect changes.
15854 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15855 Use Attributes.Search instead of nested loops.
15857 2004-05-07 Marek Safar <marek.safar@seznam.cz>
15860 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
15861 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
15862 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
15864 * report.cs: (Report.Warning): Renamed to Warning_T because of
15865 parameter collision.
15867 2004-05-05 Raja R Harinath <rharinath@novell.com>
15869 * expression.cs (MemberAccess.ResolveMemberAccess):
15870 Exit with non-zero status after Report.Error.
15871 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
15873 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
15875 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
15877 * support.cs: Don't hang when the file is empty.
15879 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
15881 * support.cs: In SeekableStreamReader, compute the preamble size of the
15882 underlying stream. Position changes should take into account that initial
15885 2004-05-03 Todd Berman <tberman@sevenl.net>
15887 * driver.cs: remove unused GetSysVersion function.
15889 2004-05-03 Todd Berman <tberman@sevenl.net>
15891 * driver.cs: Remove the hack from saturday, as well as the hack
15892 from jackson (LoadAssemblyFromGac), also adds the CWD to the
15893 link_paths to get that bit proper.
15895 2004-05-01 Todd Berman <tberman@sevenl.net>
15897 * driver.cs: Try a LoadFrom before a Load, this checks the current
15898 path. This is currently a bug in mono that is be fixed, however, this
15899 provides a workaround for now. This will be removed when the bug
15902 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
15904 * CryptoConvert.cs: Updated to latest version. Fix issue with
15905 incomplete key pairs (#57941).
15907 2004-05-01 Todd Berman <tberman@sevenl.net>
15909 * driver.cs: Remove '.' from path_chars, now System.* loads properly
15912 2004-04-30 Jackson Harper <jackson@ximian.com>
15914 * codegen.cs: Open keys readonly.
15916 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15918 * typemanager.cs: don't report cyclic struct layout when a struct
15919 contains 2 or more fields of the same type. Failed for Pango.AttrShape
15920 which has 2 Pango.Rectangle fields.
15922 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
15924 * expression.cs: Handle IntPtr comparisons with IL code
15925 rather than a method call.
15927 2004-04-29 Martin Baulig <martin@ximian.com>
15929 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
15930 the list of PropertyInfo's in class hierarchy and find the
15931 accessor. Fixes #56013.
15933 2004-04-29 Martin Baulig <martin@ximian.com>
15935 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
15937 2004-04-29 Martin Baulig <martin@ximian.com>
15939 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15941 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
15943 2004-04-29 Martin Baulig <martin@ximian.com>
15945 * class.cs (ConstructorInitializer.Resolve): Check whether the
15946 parent .ctor is accessible. Fixes #52146.
15948 2004-04-29 Martin Baulig <martin@ximian.com>
15950 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15952 * statement.cs (Using.EmitLocalVariableDecls): Use
15953 TypeManager.idisposable_type, not typeof (IDisposable).
15954 (Foreach.EmitCollectionForeach): Added support for valuetypes.
15956 2004-04-29 Martin Baulig <martin@ximian.com>
15958 * class.cs (Event.Define): Don't emit the field and don't set
15959 RTSpecialName and SpecialName for events on interfaces. Fixes
15962 2004-04-29 Raja R Harinath <rharinath@novell.com>
15964 Refactor Attribute.ApplyAttributes.
15965 * attribute.cs (Attributable): New base class for objects that can
15966 have Attributes applied on them.
15967 (Attribute): Make AttributeUsage fields public.
15968 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
15969 (Attribute.IsInternalCall): New property.
15970 (Attribute.UsageAttr): Convert to a public read-only property.
15971 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
15972 (Attribute.ResolveType, Attribute.Resolve)
15973 (Attribute.ScanForIndexerName): Update to reflect changes.
15974 (Attribute.CheckAttributeTarget): Re-format.
15975 (Attribute.ApplyAttributes): Refactor, to various
15976 Attributable.ApplyAttributeBuilder methods.
15977 * decl.cs (MemberCore): Make Attributable.
15978 * class.cs (Accessor): Make Attributable.
15979 (MethodData.ApplyAttributes): Use proper attribute types, not
15981 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
15982 (TypeContainer.ApplyAttributeBuilder)
15983 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
15984 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
15985 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
15986 (Operator.ApplyAttributeBuilder): New factored-out methods.
15987 * const.cs (Const.ApplyAttributeBuilder): Likewise.
15988 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
15989 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
15990 * parameter.cs (ParameterBase): New Attributable base class
15991 that can also represent Return types.
15992 (Parameter): Update to the changes.
15994 2004-04-29 Jackson Harper <jackson@ximian.com>
15996 * driver.cs: Prefer the corlib system version when looking for
15997 assemblies in the GAC. This is still a hack, but its a better hack
16000 2004-04-29 Marek Safar <marek.safar@seznam.cz>
16002 * decl.cs, enum.cs: Improved error 3005 reporting.
16004 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16005 (related_symbols): New private member for list of symbols
16006 related to reported error/warning.
16008 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16010 2004-04-29 Martin Baulig <martin@ximian.com>
16012 * ecore.cs (Expression.Constantify): If we're an enum and
16013 TypeManager.TypeToCoreType() doesn't give us another type, use
16014 t.UnderlyingSystemType. Fixes #56178.
16016 2004-04-29 Martin Baulig <martin@ximian.com>
16018 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16019 interfaces and for each interface, only add members directly
16020 declared in that interface. Fixes #53255.
16022 2004-04-28 Martin Baulig <martin@ximian.com>
16024 * expression.cs (ConditionalLogicalOperator): Use a temporary
16025 variable for `left' to avoid that we evaluate it more than once;
16028 2004-04-28 Martin Baulig <martin@ximian.com>
16030 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16033 2004-04-28 Martin Baulig <martin@ximian.com>
16035 * statement.cs (LocalInfo.Resolve): Check whether the type is not
16038 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16039 whether the type is not void (CS1547).
16041 2004-04-28 Martin Baulig <martin@ximian.com>
16043 * expression.cs (Unary.DoResolveLValue): Override this and report
16044 CS0131 for anything but Operator.Indirection.
16046 2004-04-28 Martin Baulig <martin@ximian.com>
16048 Committing a patch from Ben Maurer; see bug #50820.
16050 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16053 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16056 2004-04-28 Martin Baulig <martin@ximian.com>
16058 Committing a patch from Ben Maurer; see bug #50820.
16060 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16063 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16066 2004-04-28 Martin Baulig <martin@ximian.com>
16068 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16069 (Block.AddLabel): Call DoLookupLabel() to only search in the
16072 2004-04-28 Martin Baulig <martin@ximian.com>
16074 * cfold.cs (ConstantFold.BinaryFold): Added special support for
16075 comparing StringConstants and NullLiterals in Equality and Inequality.
16077 2004-04-28 Jackson Harper <jackson@ximian.com>
16079 * driver.cs: Attempt to load referenced assemblies from the
16080 GAC. This is the quick and dirty version of this method that
16081 doesnt take into account versions and just takes the first
16082 canidate found. Will be good enough for now as we will not have more
16083 then one version installed into the GAC until I update this method.
16085 2004-04-28 Martin Baulig <martin@ximian.com>
16087 * typemanager.cs (TypeManager.CheckStructCycles): New public
16088 static method to check for cycles in the struct layout.
16090 * rootcontext.cs (RootContext.PopulateTypes): Call
16091 TypeManager.CheckStructCycles() for each TypeContainer.
16092 [Note: We only need to visit each type once.]
16094 2004-04-28 Martin Baulig <martin@ximian.com>
16096 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16098 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16099 success and added `out object value'. Use a `bool resolved' field
16100 to check whether we've already been called rather than
16101 `ConstantValue != null' since this breaks for NullLiterals.
16103 2004-04-28 Raja R Harinath <rharinath@novell.com>
16105 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16106 setting of this flag, since the 'set' method may be non-public.
16108 2004-04-28 Raja R Harinath <rharinath@novell.com>
16110 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16111 check on current_vector.Block.
16113 2004-04-27 Martin Baulig <martin@ximian.com>
16115 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16116 a field initializer. Fixes #56459.
16118 2004-04-27 Martin Baulig <martin@ximian.com>
16120 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16121 we're not attempting to use an indexer. Fixes #52154.
16123 2004-04-27 Martin Baulig <martin@ximian.com>
16125 * statement.cs (Return): Don't create a return label if we don't
16126 need it; reverts my change from January 20th. Thanks to Ben
16129 2004-04-27 Martin Baulig <martin@ximian.com>
16131 According to the spec, `goto' can only leave a nested scope, but
16134 * statement.cs (Block.LookupLabel): Only lookup in the current
16135 block, don't recurse into parent or child blocks.
16136 (Block.AddLabel): Check in parent and child blocks, report
16137 CS0140/CS0158 if we find a duplicate.
16138 (Block): Removed this indexer for label lookups.
16139 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
16140 this already does the error reporting for us.
16143 (FlowBranching.UsageVector.Block): New public variable; may be null.
16144 (FlowBranching.CreateSibling): Added `Block' argument.
16145 (FlowBranching.LookupLabel): New public virtual method. Lookup a
16146 label for the target of a `goto' and check whether we're not
16147 leaving a `finally'.
16149 2004-04-27 Martin Baulig <martin@ximian.com>
16151 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16152 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
16155 2004-04-27 Martin Baulig <martin@ximian.com>
16157 * statement.cs (Block.AddLabel): Also check for implicit blocks
16158 and added a CS0158 check.
16160 2004-04-27 Martin Baulig <martin@ximian.com>
16162 * flowanalysis.cs (FlowBranchingLoop): New class.
16163 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
16164 UsageVector's instead of an ArrayList.
16165 (FlowBranching.Label): Likewise.
16166 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
16167 (FlowBranching.AddBreakVector): New method.
16169 2004-04-27 Miguel de Icaza <miguel@ximian.com>
16171 * attribute.cs: Small regression fix: only convert the type if we
16172 the type is different, fixes System.Drawing build.
16174 2004-04-27 Martin Baulig <martin@ximian.com>
16176 * attribute.cs (Attribute.Resolve): If we have a constant value
16177 for a named field or property, implicity convert it to the correct
16180 2004-04-27 Raja R Harinath <rharinath@novell.com>
16182 * statement.cs (Block.Block): Implicit blocks share
16183 'child_variable_names' fields with parent blocks.
16184 (Block.AddChildVariableNames): Remove.
16185 (Block.AddVariable): Mark variable as "used by a child block" in
16186 every surrounding block.
16187 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
16188 been used in a child block, complain about violation of "Invariant
16189 meaning in blocks" rule.
16190 * cs-parser.jay (declare_local_variables): Don't use
16191 AddChildVariableNames.
16192 (foreach_statement): Don't create an implicit block: 'foreach'
16193 introduces a scope.
16195 2004-04-23 Miguel de Icaza <miguel@ximian.com>
16197 * convert.cs (ImplicitNumericConversion): 0 is also positive when
16198 converting from 0L to ulong. Fixes 57522.
16200 2004-04-22 Marek Safar <marek.safar@seznam.cz>
16202 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
16203 derived class hides via 'new' keyword field from base class (test-242.cs).
16204 TODO: Handle this in the more general way.
16206 * class.cs (CheckBase): Ditto.
16208 2004-04-22 Marek Safar <marek.safar@seznam.cz>
16210 * decl.cs (caching_flags): New member for storing cached values
16212 (MemberCore.Flags): New enum where bit flags for caching_flags
16214 (MemberCore.cls_compliance): Moved to caching_flags.
16215 (DeclSpace.Created): Moved to caching_flags.
16217 * class.cs: Use caching_flags instead of DeclSpace.Created
16219 2004-04-21 Miguel de Icaza <miguel@ximian.com>
16221 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
16222 if we are only a derived class, not a nested class.
16224 * typemanager.cs: Same as above, but do this at the MemberLookup
16225 level (used by field and methods, properties are handled in
16226 PropertyExpr). Allow for the qualified access if we are a nested
16229 2004-04-21 Marek Safar <marek.safar@seznam.cz>
16231 * class.cs: Refactoring.
16232 (IMethodData): New inteface; Holds links to parent members
16233 to avoid member duplication (reduced memory allocation).
16234 (Method): Implemented IMethodData interface.
16235 (PropertyBase): New inner classes for get/set methods.
16236 (PropertyBase.PropertyMethod): Implemented IMethodData interface
16237 (Event): New inner classes for add/remove methods.
16238 (Event.DelegateMethod): Implemented IMethodData interface.
16240 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
16241 EmitContext (related to class.cs refactoring).
16243 2004-04-21 Raja R Harinath <rharinath@novell.com>
16245 * delegate.cs (Delegate.VerifyApplicability): If the number of
16246 arguments are the same as the number of parameters, first try to
16247 verify applicability ignoring any 'params' modifier on the last
16251 2004-04-16 Raja R Harinath <rharinath@novell.com>
16253 * class.cs (TypeContainer.AddIndexer): Use
16254 'ExplicitInterfaceName' to determine if interface name was
16255 explicitly specified. 'InterfaceType' is not initialized at this time.
16256 (TypeContainer.DefineIndexers): Remove use of temporary list. The
16257 Indexers array is already in the required order. Initialize
16258 'IndexerName' only if there are normal indexers.
16259 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
16260 (TypeContainer.Emit): Emit DefaultMember attribute only if
16261 IndexerName is initialized.
16264 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
16266 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
16269 2004-04-15 Raja R Harinath <rharinath@novell.com>
16271 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
16275 * attribute.cs (Attribute.Resolve): Check for duplicate named
16279 2004-04-15 Miguel de Icaza <miguel@ximian.com>
16281 * iterators.cs (MarkYield): track whether we are in an exception,
16282 and generate code accordingly. Use a temporary value to store the
16283 result for our state.
16285 I had ignored a bit the interaction of try/catch with iterators
16286 since their behavior was not entirely obvious, but now it is
16287 possible to verify that our behavior is the same as MS .NET 2.0
16291 2004-04-14 Miguel de Icaza <miguel@ximian.com>
16293 * iterators.cs: Avoid creating temporaries if there is no work to
16296 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
16297 Enumerations, use TypeManager.EnumToUnderlying and call
16300 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
16303 (This.Emit): Use EmitContext.EmitThis to emit our
16306 (This.EmitAssign): Ditto.
16308 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
16309 codepaths, we will move all the functionality into
16312 (FieldExpr.EmitAssign): Ditto.
16314 This fixes several hidden bugs that I uncovered while doing a code
16315 review of this today.
16317 * codegen.cs (EmitThis): reworked so the semantics are more clear
16318 and also support value types "this" instances.
16320 * iterators.cs: Changed so that for iterators in value types, we
16321 do not pass the value type as a parameter.
16323 Initialization of the enumerator helpers is now done in the caller
16324 instead of passing the parameters to the constructors and having
16325 the constructor set the fields.
16327 The fields have now `assembly' visibility instead of private.
16329 2004-04-11 Miguel de Icaza <miguel@ximian.com>
16331 * expression.cs (Argument.Resolve): Check if fields passed as ref
16332 or out are contained in a MarshalByRefObject.
16334 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
16335 another compiler type.
16337 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
16339 * class.cs (Indexer.Define): use the new name checking method.
16340 Also, return false on an error.
16341 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
16342 (is_identifier_[start/part]_character): make static.
16344 2004-04-10 Miguel de Icaza <miguel@ximian.com>
16346 * expression.cs (Binary.ResolveOperator): Do no append strings
16347 twice: since we can be invoked more than once (array evaluation)
16348 on the same concatenation, take care of this here. Based on a fix
16349 from Ben (bug #56454)
16351 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
16353 * codegen.cs: Fix another case where CS1548 must be reported (when
16354 delay-sign isn't specified and no private is available #56564). Fix
16355 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
16356 error when MCS is used on the MS runtime and we need to delay-sign
16357 (which seems unsupported by AssemblyBuilder - see #56621).
16359 2004-04-08 Marek Safar <marek.safar@seznam.cz>
16361 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
16362 (TypeManager.ComputeNamespaces): Faster implementation for
16365 * compiler.csproj: Updated AssemblyName to mcs.
16367 2004-04-07 Miguel de Icaza <miguel@ximian.com>
16369 * rootcontext.cs: Add new types to the boot resolution.
16371 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
16372 MulticastDelegate is not allowed.
16374 * typemanager.cs: Add new types to lookup: System.TypedReference
16377 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
16378 check for TypedReference or ArgIterator, they are not allowed.
16380 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
16381 makes us properly catch 1510 in some conditions (see bug 56016 for
16384 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
16386 * CryptoConvert.cs: update from corlib version
16389 2004-04-05 Miguel de Icaza <miguel@ximian.com>
16391 * class.cs (Indexer.Define): Check indexername declaration
16393 2004-04-05 Marek Safar <marek.safar@seznam.cz>
16395 * attribute.cs (IsClsCompliant): Fixed problem with handling
16396 all three states (compliant, not-compliant, undetected).
16398 2004-03-30 Marek Safar <marek.safar@seznam.cz>
16400 * attribute.cs (Attribute): Location is now public.
16401 (Resolve): Store resolved arguments (pos_values) in attribute class.
16402 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
16403 (GetClsCompliantAttributeValue): New method that gets
16404 CLSCompliantAttribute value.
16405 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
16406 if exists else null.
16407 (AttributeTester): New class for CLS-Compliant verification routines.
16409 * class.cs (Emit): Add CLS-Compliant verification.
16410 (Method.GetSignatureForError): Implemented.
16411 (Constructor.GetSignatureForError): Implemented
16412 (Constructor.HasCompliantArgs): Returns if constructor has
16413 CLS-Compliant arguments.
16414 (Constructor.Emit): Override.
16415 (Construcor.IsIdentifierClsCompliant): New method; For constructors
16416 is needed to test only parameters.
16417 (FieldBase.GetSignatureForError): Implemented.
16418 (TypeContainer): New member for storing base interfaces.
16419 (TypeContainer.FindMembers): Search in base interfaces too.
16421 * codegen.cs (GetClsComplianceAttribute): New method that gets
16422 assembly or module CLSCompliantAttribute value.
16423 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
16425 (ModuleClass.Emit): Add error 3012 test.
16427 * const.cs (Emit): Override and call base for CLS-Compliant tests.
16429 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
16430 state for all decl types.
16431 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
16432 if CLS-Compliant tests are required.
16433 (IsClsCompliaceRequired): New method. Analyze whether code
16434 must be CLS-Compliant.
16435 (IsExposedFromAssembly): New method. Returns true when MemberCore
16436 is exposed from assembly.
16437 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
16438 value or gets cached value.
16439 (HasClsCompliantAttribute): New method. Returns true if MemberCore
16440 is explicitly marked with CLSCompliantAttribute.
16441 (IsIdentifierClsCompliant): New abstract method. This method is
16442 used to testing error 3005.
16443 (IsIdentifierAndParamClsCompliant): New method. Common helper method
16444 for identifier and parameters CLS-Compliant testing.
16445 (VerifyClsCompliance): New method. The main virtual method for
16446 CLS-Compliant verifications.
16447 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
16448 null. I don't know why is null (too many public members !).
16449 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
16450 and get value of first CLSCompliantAttribute that found.
16452 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
16453 (VerifyClsCompliance): Override and add extra tests.
16455 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
16456 clscheck- disable CLS-Compliant verification event if assembly is has
16457 CLSCompliantAttribute(true).
16459 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
16460 ApllyAttribute is now called in emit section as in the other cases.
16461 Possible future Emit integration.
16462 (IsIdentifierClsCompliant): New override.
16463 (VerifyClsCompliance): New override.
16464 (GetEnumeratorName): Returns full enum name.
16466 * parameter.cs (GetSignatureForError): Implemented.
16468 * report.cs (WarningData): New struct for Warning message information.
16469 (LocationOfPreviousError): New method.
16470 (Warning): New method. Reports warning based on the warning table.
16471 (Error_T): New method. Reports error based on the error table.
16473 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
16474 verifications are done here.
16476 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
16478 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
16479 CLSCompliantAttribute.
16480 (all_imported_types): New member holds all imported types from other
16482 (LoadAllImportedTypes): New method fills static table with exported types
16483 from all referenced assemblies.
16484 (Modules): New property returns all assembly modules.
16486 2004-03-30 Miguel de Icaza <miguel@ximian.com>
16488 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
16489 throwing a parser error.
16491 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
16492 which removes the hardcoded get_/set_ prefixes for properties, as
16493 IL allows for the properties to be named something else.
16497 * expression.cs: Do not override operand before we know if it is
16498 non-null. Fix 56207
16500 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
16502 * typemanager.cs: support for pinned variables.
16504 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
16506 * decl.cs, typemanager.cs: Avoid using an arraylist
16507 as a buffer if there is only one result set.
16509 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
16511 * expression.cs: Make sure you cant call a static method
16512 with an instance expression, bug #56174.
16514 2004-03-29 Miguel de Icaza <miguel@ximian.com>
16516 * class.cs (IsDuplicateImplementation): Improve error reporting to
16517 flag 663 (method only differs in parameter modifier).
16519 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
16520 in preprocessor directives.
16522 * location.cs (LookupFile): Allow for the empty path.
16524 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
16525 better approach for some of that patch, but its failing with the
16526 CharSet enumeration. For now try/catch will do.
16528 * typemanager.cs: Do not crash if a struct does not have fields.
16531 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
16533 * expression.cs: cs0213, cant fix a fixed expression.
16536 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
16538 * cs-parser.jay: detect invalid embeded statements gracefully.
16541 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
16543 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
16546 the invocation type may not be a subclass of the tye of the item/
16547 The type of the item must be a subclass of the invocation item.
16552 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
16554 * attribute.cs: Added methods to get a string and a bool from an
16555 attribute. Required to information from AssemblyKeyFileAttribute,
16556 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
16557 * codegen.cs: Modified AssemblyName creation to include support for
16558 strongnames. Catch additional exceptions to report them as CS1548.
16559 * compiler.csproj: Updated include CryptoConvert.cs.
16560 * compiler.csproj.user: Removed file - user specific configuration.
16561 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
16562 Mono.Security assembly. The original class is maintained and tested in
16563 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
16564 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
16565 like CSC 8.0 (C# v2) supports.
16566 * Makefile: Added CryptoConvert.cs to mcs sources.
16567 * rootcontext.cs: Added new options for strongnames.
16569 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
16571 * driver.cs: For --expect-error, report error code `2'
16572 if the program compiled with no errors, error code `1' if
16573 it compiled with an error other than the one expected.
16575 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
16577 * compiler.csproj: Updated for Visual Studio .NET 2003.
16578 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
16579 * compiler.sln: Updated for Visual Studio .NET 2003.
16581 2004-03-24 Ravi Pratap M <ravi@ximian.com>
16583 * expression.cs: Fix bug #47234. We basically need to apply the
16584 rule that we prefer the conversion of null to a reference type
16585 when faced with a conversion to 'object' (csc behaviour).
16587 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
16589 * statement.cs: Shorter form for foreach, eliminates
16590 a local variable. r=Martin.
16592 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
16594 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
16595 checks if we can use brtrue/brfalse to test for 0.
16596 * expression.cs: use the above in the test for using brtrue/brfalse.
16597 cleanup code a bit.
16599 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
16601 * expression.cs: Rewrite string concat stuff. Benefits:
16603 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
16604 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
16605 rather than a concat chain.
16607 * typemanager.cs: Add lookups for more concat overloads.
16609 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
16611 * expression.cs: Emit shorter il code for array init.
16628 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
16630 * statement.cs: Before, two switch blocks would be merged if the
16631 total size of the blocks (end_item - begin_item + 1) was less than
16632 two times the combined sizes of the blocks.
16634 Now, it will only merge if after the merge at least half of the
16639 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
16641 * class.cs : csc build fix for GetMethods(). See bug #52503.
16643 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
16645 * expression.cs: Make sure fp comparisons work with NaN.
16646 This fixes bug #54303. Mig approved this patch a long
16647 time ago, but we were not able to test b/c the runtime
16650 2004-03-19 Miguel de Icaza <miguel@ximian.com>
16652 * ecore.cs (TypExpr.GetHashCode): implement this overload.
16654 2004-03-19 Martin Baulig <martin@ximian.com>
16656 * class.cs (MemberCore.IsDuplicateImplementation): Report the
16657 error here and not in our caller.
16659 2004-03-19 Martin Baulig <martin@ximian.com>
16661 * interface.cs: Completely killed this file.
16662 (Interface): We're now a TypeContainer and live in class.cs.
16664 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
16665 argument; we're now also called for interfaces.
16666 (TypeContainer.DefineMembers): Allow this method being called
16668 (TypeContainer.GetMethods): New public method; formerly known as
16669 Interface.GetMethod(). This is used by PendingImplementation.
16670 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
16671 it's now private and non-static.
16672 (Interface): Moved this here; it's now implemented similar to
16674 (Method, Property, Event, Indexer): Added `bool is_interface'
16675 argument to their .ctor's.
16676 (MemberBase.IsInterface): New public field.
16678 * cs-parser.jay: Create normal Method, Property, Event, Indexer
16679 instances instead of InterfaceMethod, InterfaceProperty, etc.
16680 (opt_interface_base): Removed; we now use `opt_class_base' instead.
16681 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
16683 2004-03-19 Martin Baulig <martin@ximian.com>
16685 * class.cs (MethodCore.IsDuplicateImplementation): New private
16686 method which does the CS0111 checking.
16687 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
16688 Use IsDuplicateImplementation().
16690 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
16692 * decl.cs (FindMemberToOverride): New method to find the correct
16693 method or property to override in the base class.
16695 - Make Method/Property use the above method to find the
16696 version in the base class.
16697 - Remove the InheritableMemberSignatureCompare as it is now
16700 This patch makes large code bases much faster to compile, as it is
16701 O(n) rather than O(n^2) to do this validation.
16703 Also, it fixes bug 52458 which is that nested classes are not
16704 taken into account when finding the base class member.
16706 Reviewed/Approved by Martin.
16708 2004-03-17 Marek Safar <marek.safar@seznam.cz>
16710 * interface.cs: In all interface classes removed redundant
16711 member initialization.
16713 2004-03-16 Martin Baulig <martin@ximian.com>
16715 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
16717 2004-03-15 Miguel de Icaza <miguel@ximian.com>
16719 * decl.cs (DefineTypeAndParents): New helper method to define a
16720 type's containers before the type itself is defined; This is a
16721 bug exposed by the recent changes to Windows.Forms when an
16722 implemented interface was defined inside a class that had not been
16725 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
16727 (Check): Loop correctly to report errors modifiers
16728 (UNSAFE was not in the loop, since it was the same as TOP).
16730 * interface.cs: Every interface member now takes a ModFlags,
16731 instead of a "is_new" bool, which we set on the base MemberCore.
16733 Every place where we called "UnsafeOk" in the interface, now we
16734 call the proper member (InterfaceMethod.UnsafeOK) instead to get
16735 the unsafe settings from the member declaration instead of the
16736 container interface.
16738 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
16740 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
16741 `set_indexer_name' to the pending bits (one per type).
16743 We fixed a bug today that was picking the wrong method to
16744 override, since for properties the existing InterfaceMethod code
16745 basically ignored the method name. Now we make sure that the
16746 method name is one of the valid indexer names.
16748 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
16750 * support.cs (SeekableStreamReader): Keep track of stream byte
16751 positions and don't mix them with character offsets to the buffer.
16753 Patch from Gustavo Giráldez
16755 2004-03-15 Marek Safar <marek.safar@seznam.cz>
16757 * interface.cs (InterfaceSetGetBase): Removed double member
16758 initialization, base class does it as well.
16760 2004-03-13 Martin Baulig <martin@ximian.com>
16762 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
16763 when compiling corlib.
16765 2004-03-13 Miguel de Icaza <miguel@ximian.com>
16767 * convert.cs (ExplicitConversion): We were reporting an error on
16768 certain conversions (object_type source to a value type, when the
16769 expression was `null') before we had a chance to pass it through
16770 the user defined conversions.
16772 * driver.cs: Replace / and \ in resource specifications to dots.
16775 * class.cs: Add check for duplicate operators. Fixes 52477
16777 2004-03-11 Miguel de Icaza <miguel@ximian.com>
16779 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
16780 that are in the middle of the statements, not only at the end.
16783 * class.cs (TypeContainer.AddField): No longer set the
16784 `HaveStaticConstructor' flag, now we call it
16785 `UserDefineStaticConstructor' to diferentiate the slightly
16786 semantic difference.
16788 The situation is that we were not adding BeforeFieldInit (from
16789 Modifiers.TypeAttr) to classes that could have it.
16790 BeforeFieldInit should be set to classes that have no static
16795 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
16797 And most importantly Zoltan's comment:
16799 http://bugzilla.ximian.com/show_bug.cgi?id=44229
16801 "I think beforefieldinit means 'it's ok to initialize the type sometime
16802 before its static fields are used', i.e. initialization does not need
16803 to be triggered by the first access to the type. Setting this flag
16804 helps the JIT to compile better code, since it can run the static
16805 constructor at JIT time, and does not need to generate code to call it
16806 (possibly lots of times) at runtime. Unfortunately, mcs does not set
16807 this flag for lots of classes like String.
16809 csc sets this flag if the type does not have an explicit static
16810 constructor. The reasoning seems to be that if there are only static
16811 initalizers for a type, and no static constructor, then the programmer
16812 does not care when this initialization happens, so beforefieldinit
16815 This bug prevents the AOT compiler from being usable, since it
16816 generates so many calls to mono_runtime_class_init that the AOT code
16817 is much slower than the JITted code. The JITted code is faster,
16818 because it does not generate these calls if the vtable is type is
16819 already initialized, which is true in the majority of cases. But the
16820 AOT compiler can't do this."
16822 2004-03-10 Miguel de Icaza <miguel@ximian.com>
16824 * class.cs (MethodData.Emit): Refactor the code so symbolic
16825 information is generated for destructors; For some reasons we
16826 were taking a code path that did not generate symbolic information
16829 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
16831 * class.cs: Create a Constructor.CheckBase method that
16832 takes care of all validation type code. The method
16833 contains some code that was moved from Define.
16835 It also includes new code that checks for duplicate ctors.
16836 This fixes bug #55148.
16838 2004-03-09 Joshua Tauberer <tauberer@for.net>
16840 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
16841 a { ... }-style array creation invokes EmitStaticInitializers
16842 which is not good for reference-type arrays. String, decimal
16843 and now null constants (NullCast) are not counted toward
16844 static initializers.
16846 2004-03-05 Martin Baulig <martin@ximian.com>
16848 * location.cs (SourceFile.HasLineDirective): New public field;
16849 specifies whether the file contains or is referenced by a "#line"
16851 (Location.DefineSymbolDocuments): Ignore source files which
16852 either contain or are referenced by a "#line" directive.
16854 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
16856 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
16857 direct access to our parent, so check the method inline there.
16859 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
16861 * expression.cs (Invocation.EmitCall): Miguel's last commit
16862 caused a regression. If you had:
16867 In Foo the implict this would be null.
16869 2004-02-27 Miguel de Icaza <miguel@ximian.com>
16871 * expression.cs (Invocation.EmitCall): If the method is not
16872 virtual, do not emit a CallVirt to it, use Call.
16874 * typemanager.cs (GetFullNameSignature): Improve the method to
16875 cope with ".ctor" and replace it with the type name.
16877 * class.cs (ConstructorInitializer.Resolve): Now the method takes
16878 as an argument the ConstructorBuilder where it is being defined,
16879 to catch the recursive constructor invocations.
16881 2004-02-26 Miguel de Icaza <miguel@ximian.com>
16883 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
16884 routines to check if a type is an enumerable/enumerator allow
16885 classes that implement the IEnumerable or IEnumerator interfaces.
16887 * class.cs (Property, Operator): Implement IIteratorContainer, and
16888 implement SetYields.
16890 (Property.Define): Do the block swapping for get_methods in the
16891 context of iterators. We need to check if Properties also
16892 include indexers or not.
16894 (Operator): Assign the Block before invoking the
16895 OperatorMethod.Define, so we can trigger the Iterator code
16898 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
16899 Property and Operator classes are not created when we parse the
16900 declarator but until we have the block completed, so we use a
16901 singleton SimpleIteratorContainer.Simple to flag whether the
16902 SetYields has been invoked.
16904 We propagate this setting then to the Property or the Operator to
16905 allow the `yield' to function.
16907 2004-02-25 Marek Safar <marek.safar@seznam.cz>
16909 * codegen.cs: Implemented attribute support for modules.
16910 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
16911 Assembly/Module functionality.
16913 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
16914 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
16915 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
16917 2004-02-16 Marek Safar <marek.safar@seznam.cz>
16919 * interface.cs (FindMembers): The operation is performed on all base
16920 interfaces and not only on the first. It is required for future CLS Compliance patch.
16922 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
16924 * statement.cs, codegen.cs:
16925 This patch deals with patterns such as:
16927 public class List : IEnumerable {
16929 public MyEnumerator GetEnumerator () {
16930 return new MyEnumerator(this);
16933 IEnumerator IEnumerable.GetEnumerator () {
16937 public struct MyEnumerator : IEnumerator {
16942 Before, there were a few things we did wrong:
16943 1) we would emit callvirt on a struct, which is illegal
16944 2) we emited ldarg when we needed to emit ldarga
16945 3) we would mistakenly call the interface methods on an enumerator
16946 type that derived from IEnumerator and was in another assembly. For example:
16948 public class MyEnumerator : IEnumerator
16950 Would have the interface methods called, even if there were public impls of the
16951 method. In a struct, this lead to invalid IL code.
16953 2004-02-11 Marek Safar <marek.safar@seznam.cz>
16955 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
16958 * delegate.cs (Define): Fixed crash when delegate type is undefined.
16960 2004-02-11 Miguel de Icaza <miguel@ximian.com>
16962 * cs-parser.jay: Fix small regression: we were not testing V2
16963 compiler features correctly.
16965 * interface.cs: If the emit context is null, then create one
16967 2004-02-09 Marek Safar <marek.safar@seznam.cz>
16969 * decl.cs (GetSignatureForError): New virtual method to get full name
16970 for error messages.
16972 * attribute.cs (IAttributeSupport): New interface for attribute setting.
16973 Now it is possible to rewrite ApplyAttributes method to be less if/else.
16975 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
16976 Duplicated members and code in these classes has been removed.
16977 Better encapsulation in these classes.
16979 2004-02-07 Miguel de Icaza <miguel@ximian.com>
16981 * assign.cs (Assign.DoResolve): When dealing with compound
16982 assignments, there is a new rule in ECMA C# 2.4 (might have been
16983 there before, but it is documented here) that states that in:
16987 If b is of type int, and the `op' is a shift-operator, then the
16988 above is evaluated as:
16992 * expression.cs (Binary.ResolveOperator): Instead of testing for
16993 int/uint/long/ulong, try to implicitly convert to any of those
16994 types and use that in pointer arithmetic.
16996 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
16997 method to print information for from the type, not from the
16998 null-method we were given.
17000 2004-02-01 Duncan Mak <duncan@ximian.com>
17002 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17003 parsing for cmd, fixes bug #53694.
17005 2004-02-04 Marek Safar <marek.safar@seznam.cz>
17007 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17008 in the member name duplication tests. Property and operator name duplication
17009 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17011 2004-02-03 Marek Safar <marek.safar@seznam.cz>
17013 * interface.cs (PopulateMethod): Fixed crash when interface method
17014 returns not existing type (error test cs0246-3.cs).
17016 2004-02-02 Ravi Pratap M <ravi@ximian.com>
17018 * cs-parser.jay (interface_accessors): Re-write actions to also
17019 store attributes attached to get and set methods. Fix spelling
17022 (inteface_property_declaration): Modify accordingly.
17024 (InterfaceAccessorInfo): New helper class to store information to pass
17025 around between rules that use interface_accessors.
17027 * interface.cs (Emit): Apply attributes on the get and set
17028 accessors of properties and indexers too.
17030 * attribute.cs (ApplyAttributes): Modify accordingly to use the
17031 right MethodBuilder when applying attributes to the get and set accessors.
17033 2004-01-31 Miguel de Icaza <miguel@ximian.com>
17035 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17037 2004-01-26 Miguel de Icaza <miguel@ximian.com>
17039 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17041 2004-01-25 Miguel de Icaza <miguel@ximian.com>
17043 * cs-parser.jay: Remove YIELD token, instead use the new grammar
17044 changes that treat `yield' specially when present before `break'
17045 or `return' tokens.
17047 * cs-tokenizer.cs: yield is no longer a keyword.
17049 2004-01-23 Marek Safar <marek.safar@seznam.cz>
17051 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17052 setting for default constructors.
17053 For default constructors are almost every time set wrong Modifier. The
17054 generated IL code has been alright. But inside mcs this values was
17055 wrong and this was reason why several of my CLS Compliance tests
17058 2004-01-22 Martin Baulig <martin@ximian.com>
17060 * cs-parser.jay (namespace_or_type_name): Return an Expression,
17061 not a QualifiedIdentifier. This is what `type_name_expression'
17062 was previously doing.
17063 (type_name_expression): Removed; the code is now in
17064 `namespace_or_type_name'.
17065 (qualified_identifier): Removed, use `namespace_or_type_name'
17067 (QualifiedIdentifier): Removed this class.
17069 2004-01-22 Martin Baulig <martin@ximian.com>
17071 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17072 not a string as alias name.
17074 2004-01-21 Miguel de Icaza <miguel@ximian.com>
17076 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17077 #52730 bug, and instead compute correctly the need to use a
17078 temporary variable when requesting an address based on the
17079 static/instace modified of the field and the constructor.
17081 2004-01-21 Martin Baulig <martin@ximian.com>
17083 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17084 class and namespace before looking up aliases. Fixes #52517.
17086 2004-01-21 Martin Baulig <martin@ximian.com>
17088 * flowanalysis.cs (UsageVector.Merge): Allow variables being
17089 assinged in a 'try'; fixes exception4.cs.
17091 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17092 * class.cs : Implemented parameter-less constructor for TypeContainer
17094 * decl.cs: Attributes are now stored here. New property OptAttributes
17096 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17098 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17100 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17102 * typemanager.cs (CSharpSignature): Now reports also inner class name.
17103 (CSharpSignature): New method for indexer and property signature.
17105 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17107 * pending.cs (IsVirtualFilter): Faster implementation.
17109 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17111 * typemanager.cs: Avoid inclusion of same assembly more than once.
17113 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17115 * cs-parser.jay: Fixed problem where the last assembly attribute
17116 has been applied also to following declaration (class, struct, etc.)
17118 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17120 * class.cs: Added error CS0538, CS0539 reporting.
17121 Fixed crash on Microsoft runtime when field type is void.
17123 * cs-parser.jay: Added error CS0537 reporting.
17125 * pending.cs: Added error CS0535 reporting.
17126 Improved error report for errors CS0536, CS0534.
17128 2004-01-20 Miguel de Icaza <miguel@ximian.com>
17130 Merge a few bits from the Anonymous Method MCS tree.
17132 * statement.cs (ToplevelBlock): New class for toplevel methods,
17133 will hold anonymous methods, lifted variables.
17135 * cs-parser.jay: Create toplevel blocks for delegates and for
17136 regular blocks of code.
17138 2004-01-20 Martin Baulig <martin@ximian.com>
17140 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
17141 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
17142 and `NeedExplicitReturn'; added `IsLastStatement'.
17143 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
17144 have a `ReturnLabel' or we're not unreachable.
17146 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
17147 child's reachability; don't just override ours with it. Fixes
17148 #58058 (lluis's example).
17149 (FlowBranching): Added public InTryOrCatch(), InCatch(),
17150 InFinally(), InLoop(), InSwitch() and
17151 BreakCrossesTryCatchBoundary() methods.
17153 * statement.cs (Return): Do all error checking in Resolve().
17154 Unless we are the last statement in a top-level block, always
17155 create a return label and jump to it.
17156 (Break, Continue): Do all error checking in Resolve(); also make
17157 sure we aren't leaving a `finally'.
17158 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
17159 statement in a top-level block.
17160 (Block.Flags): Added `IsDestructor'.
17161 (Block.IsDestructor): New public property.
17163 2004-01-20 Martin Baulig <martin@ximian.com>
17165 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
17167 2004-01-20 Martin Baulig <martin@ximian.com>
17169 * statement.cs (Statement.ResolveUnreachable): New public method.
17170 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
17171 (Block.Resolve): Resolve unreachable statements.
17173 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
17175 * expression.cs: We need to fix the case where we do
17176 not have a temp variable here.
17178 * assign.cs: Only expression compound assignments need
17179 temporary variables.
17181 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
17183 * flowanalysis.cs: Reduce memory allocation in a few ways:
17184 - A block with no variables should not allocate a bit
17186 - A method with no out parameters does not need any tracking
17187 for assignment of the parameters, so we need not allocate
17190 public readonly Type[] VariableTypes;
17191 public readonly string[] VariableNames;
17192 Are redundant. The data is already stored in the variable
17193 map, so we need not allocate another array for it.
17194 - We need to add alot of checks for if (params | locals) == null
17195 due to the first two changes.
17197 2004-01-18 Miguel de Icaza <miguel@ximian.com>
17199 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
17200 implement IMemoryLocation, we store a copy on a local variable and
17201 take the address of it. Patch from Benjamin Jemlich
17203 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
17204 to use a special "type_name_expression" rule which reduces the
17205 number of "QualifiedIdentifier" classes created, and instead
17206 directly creates MemberAccess expressions.
17208 2004-01-17 Miguel de Icaza <miguel@ximian.com>
17210 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
17211 that fixes #52853. Null literal assignment to ValueType
17213 * class.cs (MethodData.Emit): Instead of checking the name of the
17214 method to determine if its a destructor, create a new derived
17215 class from Method called Destructor, and test for that.
17217 * cs-parser.jay: Create a Destructor object instead of a Method.
17219 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
17223 2004-01-16 Miguel de Icaza <miguel@ximian.com>
17225 * expression.cs (Binary.ResolveOperator): Perform an implicit
17226 conversion from MethodGroups to their delegate types on the
17227 Addition operation.
17229 * delegate.cs: Introduce a new class DelegateCreation that is the
17230 base class for `NewDelegate' and `ImplicitDelegateCreation',
17231 factor some code in here.
17233 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
17234 conversion from MethodGroups to compatible delegate types.
17236 * ecore.cs (Expression.Resolve): Do not flag error 654
17237 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
17238 we allow conversions from MethodGroups to delegate types now.
17240 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
17241 assignments in v2 either.
17243 2004-01-10 Miguel de Icaza <miguel@ximian.com>
17245 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
17246 static read-only fields in ctors.
17248 Applied patch from Benjamin Jemlich
17250 * expression.cs (UnaryMutator): Avoid leaking local variables.
17252 2004-01-09 Miguel de Icaza <miguel@ximian.com>
17254 * cs-tokenizer.cs (IsCastToken): Allow the various native types
17255 here to return true, as they can be used like this:
17257 (XXX) int.MEMBER ()
17259 Fixed 49836 and all the other dups
17261 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
17263 * driver.cs: Implement /win32res and /win32icon.
17265 2004-01-08 Miguel de Icaza <miguel@ximian.com>
17267 * cs-parser.jay: Add a rule to improve error handling for the
17268 common mistake of placing modifiers after the type.
17270 2004-01-07 Miguel de Icaza <miguel@ximian.com>
17272 * cs-parser.jay (interface_event_declaration): Catch
17273 initialization of events on interfaces, and report cs0068
17275 * cs-parser.jay (interface_event_declaration): Catch
17276 initialization of events.
17278 * ecore.cs: Better report missing constructors.
17280 * expression.cs (Binary.ResolveOperator): My previous bug fix had
17281 the error reporting done in the wrong place. Fix.
17283 * expression.cs (Binary.ResolveOperator): Catch the
17284 operator + (E x, E y) error earlier, and later allow for implicit
17285 conversions in operator +/- (E e, U x) from U to the underlying
17288 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
17289 52596, if the container class is abstract, the default constructor
17290 is protected otherwise its public (before, we were always public).
17292 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
17295 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
17296 Jemlich that fixes bug #52597, MCS was generating invalid code for
17297 idisposable structs. Thanks to Ben for following up with this
17300 2004-01-06 Miguel de Icaza <miguel@ximian.com>
17302 * driver.cs: Allow assemblies without code to be generated, fixes
17305 2004-01-07 Nick Drochak <ndrochak@gol.com>
17307 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
17309 2004-01-05 Miguel de Icaza <miguel@ximian.com>
17311 * cs-parser.jay: Add rules to improve error reporting if fields or
17312 methods are declared at the namespace level (error 116)
17314 * Add rules to catch event add/remove
17316 2004-01-04 David Sheldon <dave-mono@earth.li>
17318 * expression.cs: Added matching ")" to error message for
17321 2004-01-03 Todd Berman <tberman@gentoo.org>
17323 * ecore.cs, attribute.cs:
17324 Applying fix from #52429.
17326 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17328 * ecore.cs, expression.cs, statement.cs:
17329 Total rewrite of how we handle branching. We
17330 now handle complex boolean expressions with fewer
17331 jumps. As well if (x == 0) no longer emits a ceq.
17333 if (x is Foo) is much faster now, because we generate
17336 Overall, we get a pretty big improvement on our benchmark
17337 tests. The code we generate is smaller and more readable.
17339 I did a full two-stage bootstrap. The patch was reviewed
17340 by Martin and Miguel.
17342 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17344 * cs-parser.jay: Make primary_expression not take a QI.
17345 we dont need this because the member_access rule covers
17346 us here. So we replace the rule with just IDENTIFIER.
17348 This has two good effects. First, we remove a s/r conflict.
17349 Second, we allocate many fewer QualifiedIdentifier objects.
17351 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17353 * attribute.cs: Handle MarshalAs attributes as pseudo, and
17354 set the correct information via SRE. This prevents
17355 hanging on the MS runtime. Fixes #29374.
17357 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17359 * convert.cs: correctly handle conversions to value types
17360 from Enum and ValueType as unboxing conversions.
17362 Fixes bug #52569. Patch by Benjamin Jemlich.
17364 2004-01-02 Ravi Pratap <ravi@ximian.com>
17366 * expression.cs (BetterConversion): Prefer int -> uint
17367 over int -> ulong (csc's behaviour). This fixed bug #52046.
17369 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
17371 * decl.cs (MemberCache.FindMembers): now returns a
17374 * typemanager.cs: In general, go with with ^^.
17375 (CopyNewMethods): take an IList.
17376 (RealMemberLookup): Only allocate an arraylist
17377 if we copy from two sets of methods.
17379 This change basically does two things:
17380 1) Fewer array lists allocated due to CopyNewMethods.
17381 2) the explicit cast in MemberList costed ALOT.
17383 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
17385 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
17386 a hashtable to avoid needless string allocations when an identifier is
17387 used more than once (the common case).
17389 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
17391 * pending.cs: MS's TypeBuilder.GetInterfaces ()
17392 is broken, it will not return anything. So, we
17393 have to use the information we have in mcs to
17396 * typemanager.cs: Add a cache for GetInterfaces,
17397 since this will now be used more often (due to ^^)
17399 (GetExplicitInterfaces) New method that gets the
17400 declared, not effective, interfaces on a type
17401 builder (eg, if you have interface IFoo, interface
17402 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
17405 This patch makes MCS able to bootstrap itself on
17408 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
17410 * expression.cs: Remove the Nop's that Miguel put
17413 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
17415 * report.cs, codegen.cs: Give the real stack trace to
17416 the error when an exception is thrown.
17418 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
17420 * decl.cs: only allocate hashtables for ifaces if
17423 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
17425 * expression.cs: fix the error from cs0121-2.cs
17426 (a parent interface has two child interfaces that
17427 have a function with the same name and 0 params
17428 and the function is called through the parent).
17430 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
17432 * class.cs, rootcontext.cs, typmanager.cs: do not
17435 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
17437 * codegen.cs: remove stack for the ec flow branching.
17438 It is already a linked list, so no need.
17440 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
17442 * Makefile: Allow custom profiler here.
17444 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
17446 * typemanager.cs (LookupType):
17447 - Use a static char [], because split takes
17448 a param array for args, so it was allocating
17450 - Do not store true in a hashtable, it boxes.
17452 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
17454 * flowanalysis.cs: bytify common enums.
17456 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
17458 * modifiers.cs: Add a new set of flags for the
17459 flags allowed on explicit interface impls.
17460 * cs-parser.jay: catch the use of modifiers in
17461 interfaces correctly.
17462 * class.cs: catch private void IFoo.Blah ().
17464 All related to bug #50572.
17466 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
17468 * decl.cs: Rewrite the consistant accessability checking.
17469 Accessability is not linear, it must be implemented in
17470 a tableish way. Fixes #49704.
17472 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
17474 * expression.cs: Handle negation in a checked context.
17475 We must use subtraction from zero. Fixes #38674.
17477 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
17479 * class.cs: Ignore static void main in DLLs.
17480 * rootcontext.cs: Handle the target type here,
17481 since we are have to access it from class.cs
17482 * driver.cs: account for the above.
17484 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
17486 * report.cs: Give line numbers and files if available.
17488 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
17490 * driver.cs: Implement /addmodule.
17492 * typemanager.cs: Change 'modules' field so it now contains Modules not
17495 2003-12-20 Martin Baulig <martin@ximian.com>
17497 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
17498 (FieldBase.IsAssigned): Removed this field.
17499 (FieldBase.SetAssigned): New public method.
17500 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
17502 2003-12-20 Martin Baulig <martin@ximian.com>
17504 * expression.cs (LocalVariableReference.DoResolve): Don't set
17505 `vi.Used' if we're called from DoResolveLValue().
17507 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
17508 returns the usage vector it just merged into the current one -
17509 pass this one to UsageWarning().
17510 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
17511 of the `EmitContext', don't call this recursively on our children.
17513 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
17515 * driver.cs: Implement /target:module.
17517 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
17519 * support.cs (CharArrayHashtable): New helper class.
17521 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
17522 char arrays, not strings, so we can avoid creating a string in
17523 consume_identifier if the identifier is a keyword.
17525 2003-12-16 Martin Baulig <martin@ximian.com>
17527 * statement.cs (LocalInfo.Assigned): Removed this property.
17528 (LocalInfo.Flags): Removed `Assigned'.
17529 (LocalInfo.IsAssigned): New public method; takes the EmitContext
17530 and uses flow analysis.
17531 (Block.UsageWarning): Made this method private.
17532 (Block.Resolve): Call UsageWarning() if appropriate.
17534 * expression.cs (LocalVariableReference.DoResolve): Always set
17535 LocalInfo.Used here.
17537 2003-12-13 Martin Baulig <martin@ximian.com>
17539 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
17540 any value here; we're now using flow analysis to figure out
17541 whether a statement/block returns a value.
17543 2003-12-13 Martin Baulig <martin@ximian.com>
17545 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
17547 (FlowBranching.MergeFinally): Don't call
17548 `branching.CheckOutParameters()' here, this is called in
17550 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
17551 when adding the `finally' vector.
17553 2003-12-13 Martin Baulig <martin@ximian.com>
17556 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
17557 actually work and also fix #48962.
17559 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
17561 * decl.cs: Do not check System.Object for nested types,
17562 since we know it does not have any. Big bang for buck:
17565 Run 1: 8.35 seconds
17566 Run 2: 8.32 seconds
17567 corlib: 17.99 seconds
17569 Run 1: 8.17 seconds
17570 Run 2: 8.17 seconds
17571 corlib: 17.39 seconds
17573 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
17575 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
17576 time we are returning 0 members, so we save alot here.
17578 2003-12-11 Martin Baulig <martin@ximian.com>
17580 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
17581 `MergeChild()', also just take the `FlowBranching' as argument;
17582 call Merge() on it and return the result.
17583 (FlowBranching.Merge): We don't need to do anything if we just
17586 2003-12-11 Martin Baulig <martin@ximian.com>
17588 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
17589 them in an `ArrayList' to reduce memory usage. Thanks to Ben
17590 Maurer for this idea.
17592 2003-12-11 Martin Baulig <martin@ximian.com>
17594 * flowanalysis.cs (MergeResult): This class is now gone; we now
17595 use the `UsageVector' for this. The reason for this is that if a
17596 branching just has one sibling, we don't need to "merge" them at
17597 all - that's the next step to do.
17598 (FlowBranching.Merge): We now return a `UsageVector' instead of a
17601 2003-12-11 Martin Baulig <martin@ximian.com>
17603 Reworked flow analyis and made it more precise and bug-free. The
17604 most important change is that we're now using a special `Reachability'
17605 class instead of having "magic" meanings of `FlowReturns'. I'll
17606 do some more cleanups and optimizations and also add some more
17607 documentation this week.
17609 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
17610 largely reworked this class.
17611 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
17612 the new `Reachability' class instead of having "magic" values here.
17613 (FlowBranching): We're now using an instance of `Reachability'
17614 instead of having separate `Returns', `Breaks' etc. fields.
17616 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
17617 based on flow analysis; ignore the return value of block.Emit ().
17619 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
17621 * driver.cs typemanager.cs: Find the mono extensions to corlib even
17622 if they are private.
17624 2003-12-09 Martin Baulig <martin@ximian.com>
17626 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
17627 call them directly on the UsageVector.
17629 2003-12-09 Martin Baulig <martin@ximian.com>
17631 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
17632 Changed return type from `FlowReturns' to `Reachability'.
17634 2003-12-09 Martin Baulig <martin@ximian.com>
17636 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
17637 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
17638 `Reachable' fields with a single `Reachability' one.
17640 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
17642 * class.cs (FindMembers): Remove foreach's.
17647 Run 1: 8.74 seconds
17648 Run 2: 8.71 seconds
17651 Run 1: 8.64 seconds
17652 Run 2: 8.58 seconds
17655 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
17660 This patch does a few things:
17661 1. EmptyStatement is now a singleton, so it is never reallocated.
17662 2. All blah is EmptyStatement constructs have been changed to
17663 blah == EmptyStatement.Value, which is much faster and valid
17664 now that EmptyStatement is a singleton.
17665 3. When resolving a block, rather than allocating a new array for
17666 the non-empty statements, empty statements are replaced with
17667 EmptyStatement.Value
17668 4. Some recursive functions have been made non-recursive.
17669 Mainly the performance impact is from (3), however (1) and (2) are needed for
17670 this to work. (4) does not make a big difference in normal situations, however
17671 it makes the profile look saner.
17676 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
17677 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
17678 Total memory allocated: 56397 KB
17681 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
17682 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
17683 Total memory allocated: 55666 KB
17685 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
17687 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
17688 than the hashtable in a hashtable version
17690 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
17691 we always end up concating a string. This results in a huge perf
17692 loss, because many strings have to be tracked by the GC. In this
17693 patch, we first use a hashtable that works with two keys, so that
17694 the strings do not need to be concat'ed.
17698 Run 1: 8.74 seconds
17699 Run 2: 8.71 seconds
17702 Run 1: 8.65 seconds
17703 Run 2: 8.56 seconds
17705 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
17707 * Makefile: Add a new target `do-time' that does a quick and simple
17708 profile, leaving easy to parse output.
17710 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
17712 * codegen.cs (Init): Create the dynamic assembly with
17713 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
17715 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
17717 * support.cs: Make the PtrHashtable use only one
17718 instance of its comparer.
17720 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
17722 * typemanager.cs: Fix lookup of GetNamespaces.
17724 2003-11-29 Miguel de Icaza <miguel@ximian.com>
17726 * expression.cs: Removed redundant line.
17728 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
17729 ArrayLists, use for loops with bounds.
17731 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
17734 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
17735 arraylists, use for loop with bounds.
17737 The above three changes give us a 0.071 second performance
17738 improvement out of 3.294 seconds down to 3.223. On my machine
17739 the above changes reduced the memory usage by 1,387 KB during
17740 compiler bootstrap.
17742 * cs-parser.jay (QualifiedIdentifier): New class used to represent
17743 QualifiedIdentifiers. Before we created a new string through
17744 concatenation, and mostly later on, the result would be
17745 manipulated by DecomposeQI through string manipulation.
17747 This reduced the compiler memory usage for bootstrapping from
17748 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
17749 compile times in 0.05 seconds.
17751 2003-11-28 Dick Porter <dick@ximian.com>
17753 * support.cs: Do string compares with the Invariant culture.
17761 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
17762 the comparison is done with the Invariant culture.
17764 2003-11-27 Miguel de Icaza <miguel@ximian.com>
17766 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
17767 GetEnumerator method.
17769 (ProbeCollectionType): Iterate starting at the most specific type
17770 upwards looking for a GetEnumerator
17772 * expression.cs: Shift count can be up to 31 for int/uint and 63
17775 2003-11-26 Miguel de Icaza <miguel@ximian.com>
17777 * statement.cs (Block.LookupLabel): Also look for the label on the
17778 children blocks. Use a hash table to keep track of visited
17781 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
17782 we actually did transform the other operand, otherwise fall back
17783 to the common codepath that casts to long.
17785 * cs-tokenizer.cs: Use the same code pattern as the int case.
17786 Maybe I should do the parsing myself, and avoid depending on the
17787 Parse routines to get this done.
17789 2003-11-25 Miguel de Icaza <miguel@ximian.com>
17791 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
17792 which fixes bug 51347. This time test it.
17794 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
17795 attributes for example can not tell the difference between these.
17796 The difference was only a syntax feature of the language.
17798 * attribute.cs: Apply attributes to delegates.
17800 * delegate.cs: Call the apply attributes method.
17802 2003-11-24 Miguel de Icaza <miguel@ximian.com>
17804 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
17805 comparing 0 vs Byte.MinValue, not the value
17807 (ImplicitConversionRequired): When reporting a conversion error,
17808 use error 31 to print out the constant error instead of the
17811 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
17812 which fixes bug 51347.
17814 2003-11-22 Miguel de Icaza <miguel@ximian.com>
17816 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
17817 which fixes the -warnaserror command line option.
17819 2003-11-21 Miguel de Icaza <miguel@ximian.com>
17821 * cfold.cs (DoNumericPromotions): During constant folding of
17822 additions on UIntConstant, special case intconstants with
17823 IntConstants like we do on the expression binary operator.
17825 2003-11-12 Miguel de Icaza <miguel@ximian.com>
17827 * convert.cs (ImplicitReferenceConversion): We were missing a case
17828 (System.Enum are not value types or class types, so we need to
17829 classify them separatedly).
17831 * driver.cs: We do not support error 2007.
17833 2003-11-12 Jackson Harper <jackson@ximian.com>
17835 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
17836 system directory. Also use the full file name so users can
17837 libraries names mscorlib-o-tron.dll in a non system dir.
17839 2003-11-10 Martin Baulig <martin@ximian.com>
17841 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
17842 (TypeManager.InitCoreTypes): Initialize them here, but instead of
17843 calling `ResolveType()' on them, directly assign their `Type'.
17845 2003-11-08 Martin Baulig <martin@ximian.com>
17847 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
17848 return value and the `out parent' parameter.
17849 (TypeContainer.DefineType): Moved the CS0644 check into
17850 GetClassBases(). Don't pass the interface types to the
17851 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
17852 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
17854 * ecore.cs (TypeExpr.IsAttribute): New property.
17855 (TypeExpr.GetInterfaces): New method.
17857 * interface.cs (Interface.GetInterfaceTypeByName): Return a
17858 TypeExpr instead of a Type.
17859 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
17860 (Interface.DefineType): Don't pass the interface types to the
17861 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
17862 them later and then call `TypeBulider.AddInterfaceImplementation()'.
17864 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
17865 instead of a `Type[]'.
17866 (TypeManager.RegisterBuilder): Likewise.
17867 (TypeManager.AddUserInterface): Likewise.
17868 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
17869 `Type[]' and also return a `TypeExpr[]'.
17870 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
17872 2003-11-08 Martin Baulig <martin@ximian.com>
17874 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
17877 2003-11-08 Martin Baulig <martin@ximian.com>
17879 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
17880 TypeManager.ResolveExpressionTypes().
17882 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
17883 instead of an Expression.
17884 (TypeExpr): This is now an abstract base class for `TypeExpression'.
17885 (TypeExpression): New public class; formerly known as `TypeExpr'.
17887 * expression.cs (ComposedCast): Derive from TypeExpr.
17889 * typemanager.cs (TypeManager.system_*_expr): These are now
17890 TypExpr's instead of Expression's.
17891 (TypeManager.ResolveExpressionTypes): New public static function;
17892 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
17895 2003-11-06 Miguel de Icaza <miguel@ximian.com>
17897 * expression.cs (New.DoResolve): Do not dereference value that
17898 might be a null return.
17900 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
17901 sure that the constant value has the right type. Fixes an
17902 unreported bug, similar to 50425.
17904 * const.cs (Const.LookupConstantValue): Call
17905 ImplicitStandardConversionExists before doing a conversion to
17906 avoid havng the TypeManager.ChangeType do conversions.
17908 Reduced the number of casts used
17910 (Const.ChangeType): New routine to enable reuse of the constant
17911 type changing code from statement.
17913 * typemanager.cs (ChangeType): Move common initialization to
17914 static global variables.
17918 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
17919 every value type to go through, even if it was void. Fix that.
17921 * cs-tokenizer.cs: Use is_identifier_start_character on the start
17922 character of the define, and the is_identifier_part_character for
17923 the rest of the string.
17925 2003-11-05 Miguel de Icaza <miguel@ximian.com>
17927 * expression.cs (UnaryMutator.EmitCode): When I updated
17928 LocalVariableReference.DoResolve, I overdid it, and dropped an
17929 optimization done on local variable references.
17931 2003-11-04 Miguel de Icaza <miguel@ximian.com>
17933 * ecore.cs: Convert the return from Ldlen into an int.
17935 2003-10-20 Miguel de Icaza <miguel@ximian.com>
17937 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
17938 the accessibility, this is a special case for toplevel non-public
17939 classes (internal for instance).
17941 2003-10-20 Nick Drochak <ndrochak@gol.com>
17943 * ecore.cs: Fix typo and build. Needed another right paren.
17945 2003-10-19 Miguel de Icaza <miguel@ximian.com>
17947 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
17948 `internal' case regular and protected, but not allowing protected
17949 to be evaluated later. Bug 49840
17951 2003-10-15 Miguel de Icaza <miguel@ximian.com>
17953 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
17954 to kb.Nlast, and not the kb.nFirst to isolate the switch
17957 Extract the underlying type, so enumerations of long/ulong are
17958 treated like long/ulong.
17960 2003-10-14 Miguel de Icaza <miguel@ximian.com>
17962 * expression.cs (New): Overload the meaning of RequestedType to
17963 track the possible creation of the NewDelegate type, since
17964 DoResolve is invoked more than once for new constructors on field
17967 See bugs: #48800 and #37014
17969 * cs-parser.jay (declare_local_constants): Take an arraylist
17970 instead of a single constant.
17972 (local_constant_declaration): It should take a
17973 constant_declarators, not a constant_declarator. Fixes 49487
17975 * convert.cs: Fix error report.
17977 2003-10-13 Jackson Harper <jackson@ximian.com>
17979 * typemanager.cs (TypeToCoreType): Add float and double this fixes
17982 2003-10-09 Martin Baulig <martin@ximian.com>
17984 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
17986 (MethodCore.DoDefineParameters): Removed the TypeContainer
17987 argument; use the DeclSpace which was passed to the .ctor instead.
17988 (MethodCore.CheckParameter): Take a DeclSpace instead of a
17989 TypeContainer; we only need a DeclSpace here.
17991 2003-10-09 Martin Baulig <martin@ximian.com>
17993 * class.cs (MethodData): Added additional `DeclSpace ds' argument
17995 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
17996 EmitContext's .ctor.
17998 2003-10-09 Martin Baulig <martin@ximian.com>
18000 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18001 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18002 AsAccessible(), moved them as well.
18004 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18006 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18008 * cs-parser.jay : Renamed yyName to yyNames related to jay.
18010 2003-10-07 Miguel de Icaza <miguel@ximian.com>
18012 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18013 generation for >=, as spotted by Paolo, bug 48679.
18014 Patch from David Waite.
18016 * cs-tokenizer.cs: Add handling for #pragma.
18018 * cs-parser.jay: Allow for both yield and yield return in the
18019 syntax. The anti-cobolization of C# fight will go on!
18021 * class.cs (TypeBuilder.DefineType): Catch error condition here
18022 (Parent.DefineType erroring out and returning null).
18024 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18025 coping with enumerations variables, we were mistakenly processing
18026 them as a regular value type instead of built-in types. Fixes the
18029 * typemanager.cs (IsBuiltinOrEnum): New method.
18031 2003-09-30 Miguel de Icaza <miguel@ximian.com>
18033 * cs-parser.jay: Upgrade: yield now needs the return clause.
18035 2003-09-19 Martin Baulig <martin@ximian.com>
18037 * decl.cs (MemberCache.SetupCacheForInterface): Take a
18038 `MemberCache parent' argument. Normally, an interface doesn't
18039 have a parent type except System.Object, but we use this in gmcs
18040 for generic type parameters.
18042 2003-09-18 Martin Baulig <martin@ximian.com>
18044 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18045 on `type.IsInterface'; don't check whether the type has a parent
18046 to determine whether it's an interface.
18048 2003-09-15 Martin Baulig <martin@ximian.com>
18050 * class.cs (TypeContainer.DefineType): Added an error flag to
18051 avoid reporting duplicate CS0146's ("class definition is
18054 * driver.cs (Driver.MainDriver): Abort if
18055 RootContext.ResolveTree() reported any errors.
18057 2003-09-07 Martin Baulig <martin@ximian.com>
18059 * report.cs (Error, Warning): Added overloaded versions which take
18060 a `params object[] args' and call String.Format().
18062 2003-09-07 Martin Baulig <martin@ximian.com>
18064 * decl.cs (DeclSpace..ctor): Don't call
18065 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18066 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
18067 (DeclSpace.RecordDecl): New method.
18069 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18071 2003-09-02 Ravi Pratap <ravi@ximian.com>
18073 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18074 value attributes to be applied to ParameterBuilders.
18076 * class.cs (MethodCore.LabelParameters): Make static and more
18077 generic so that it can be used from other places - like interface
18078 methods, for instance.
18080 * interface.cs (Interface.Emit): Call LabelParameters before
18081 emitting attributes on the InterfaceMethod.
18083 2003-08-26 Martin Baulig <martin@ximian.com>
18085 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18086 resolving aliases; fixes #47927.
18088 2003-08-26 Martin Baulig <martin@ximian.com>
18090 * statement.cs (Using.DoResolve): This is internally emitting a
18091 try/finally clause, so we need to set ec.NeedExplicitReturn if we
18092 do not always return. Fixes #47681.
18094 2003-08-26 Martin Baulig <martin@ximian.com>
18096 * decl.cs (MemberCore): Moved WarningNotHiding(),
18097 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18099 (AdditionResult): Make this nested in DeclSpace.
18100 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18101 argument; call NamespaceEntry.Define() unless we're nested in a
18104 * namespace.cs (Namespace.DefineName): New public function. This
18105 is called from DeclSpace's .ctor to add
18106 (Namespace.Lookup): Include DeclSpaces in the lookup.
18108 * class.cs (Operator): Derive from MemberBase, not MemberCore.
18110 * const.cs (Const): Derive from MemberBase, not MemberCore.
18112 2003-08-25 Martin Baulig <martin@ximian.com>
18114 * convert.cs (Convert.ExplicitReferenceConversion): When
18115 converting from an interface type to a class, unbox if the target
18116 type is a struct type. Fixes #47822.
18118 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18120 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18123 2003-08-22 Martin Baulig <martin@ximian.com>
18125 * class.cs (TypeManager.DefineType): When defining a nested type,
18126 call DefineType() on our parent; fixes #47801.
18128 2003-08-22 Martin Baulig <martin@ximian.com>
18130 * class.cs (MethodData.Define): While checking if a method is an
18131 interface implementation, improve the test a bit more to fix #47654.
18133 2003-08-22 Martin Baulig <martin@ximian.com>
18135 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
18136 correctly; fixes #47722.
18138 2003-08-22 Martin Baulig <martin@ximian.com>
18140 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
18141 LocalVariableReference, ensure it's not read-only. Fixes #47536.
18143 * statement.cs (Fixed.DoResolve): Make all variables read-only.
18145 2003-08-22 Martin Baulig <martin@ximian.com>
18147 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
18148 can only be assigned in static constructors. Fixes #47161.
18150 2003-08-22 Martin Baulig <martin@ximian.com>
18152 Rewrote and improved the flow analysis code.
18154 * flowbranching.cs (FlowBranching): Make this class abstract.
18155 (FlowBranching.CreateBranching): New static function to create a
18156 new flow branching.
18157 (FlowBranchingBlock, FlowBranchingException): New classes.
18158 (FlowBranching.UsageVector.Type): New public readonly field.
18159 (FlowBranching.UsageVector.Breaks): Removed the setter.
18160 (FlowBranching.UsageVector.Returns): Removed the setter.
18161 (FlowBranching.UsageVector): Added Break(), Return(),
18162 NeverReachable() and Throw() methods to modify the reachability.
18163 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
18164 done by FlowBranching.Merge().
18165 (FlowBranching.UsageVector.MergeChild): New method; merges the
18166 merge result into the current vector.
18167 (FlowBranching.Merge): New abstract method to merge a branching.
18169 2003-08-12 Martin Baulig <martin@ximian.com>
18171 * expression.cs (Indirection.CacheTemporaries): Create the
18172 LocalTemporary with the pointer type, not its element type.
18174 2003-08-10 Miguel de Icaza <miguel@ximian.com>
18176 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
18177 token was a keyword or not.
18179 Add `error' options where an IDENTIFIER was expected; Provide
18180 CheckToken and CheckIdentifierToken convenience error reporting
18183 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
18185 * decl.cs: Rename `NamespaceEntry Namespace' public field into
18186 NameSpaceEntry NameSpaceEntry.
18188 (LookupInterfaceOrClass): Avoid creating a full qualified name
18189 from namespace and name: avoid doing lookups when we know the
18190 namespace is non-existant. Use new Tree.LookupByNamespace which
18191 looks up DeclSpaces based on their namespace, name pair.
18193 * driver.cs: Provide a new `parser verbose' to display the
18194 exception thrown during parsing. This is turned off by default
18195 now, so the output of a failure from mcs is more graceful.
18197 * namespace.cs: Track all the namespaces defined in a hashtable
18200 (IsNamespace): New method
18202 2003-08-09 Miguel de Icaza <miguel@ximian.com>
18204 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
18205 we know that we need to concatenate (full typename can never be
18210 * statement.cs: Use a bitfield; Do not initialize to null things
18211 which are done by the constructor by default.
18213 * cs-parser.jay: bug fix, parameter was 4, not 3.
18215 * expression.cs: Just use the property;
18217 * statement.cs: No need for GetVariableInfo method.
18219 2003-08-08 Martin Baulig <martin@ximian.com>
18221 * flowanalysis.cs (FlowReturns): This is now nested in the
18222 `FlowBranching' class.
18223 (MyBitVector): Moved this here from statement.cs.
18224 (FlowBranching.SiblingType): New enum type.
18225 (FlowBranching.CreateSibling): Added `SiblingType' argument.
18227 2003-08-07 Martin Baulig <martin@ximian.com>
18229 * flowanalysis.cs (FlowBranchingType): This is now nested in the
18230 `FlowBranching' class and called `BranchingType'.
18232 2003-08-07 Martin Baulig <martin@ximian.com>
18234 * flowanalysis.cs: Moved all the control flow analysis code into
18237 2003-08-07 Martin Baulig <martin@ximian.com>
18239 * assign.cs (Assign.DoResolve): `target' must either be an
18240 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
18243 2003-08-07 Miguel de Icaza <miguel@ximian.com>
18245 * expression.cs (BinaryMethod): This kind of expression is created by the
18246 Binary class if it determines that the operator has to be handled
18249 (BinaryDelegate): This kind of expression is created if we are
18250 dealing with a + or - operator on delegates.
18252 (Binary): remove method, argumetns, and DelegateOperator: when
18253 dealing with methods,
18255 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
18257 * statement.cs (Block): use bitfields for the three extra booleans
18258 we had in use. Remove unused topblock parameter.
18260 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
18262 * assign.cs: Drop extra unneeded tests.
18264 2003-08-06 Miguel de Icaza <miguel@ximian.com>
18266 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
18268 * statement.cs (Foreach): Use VariableStorage instead of
18271 * codegen.cs (VariableStorage): New class used by clients that
18272 require a variable stored: locals or fields for variables that
18273 need to live across yield.
18275 Maybe provide a convenience api for EmitThis+EmitLoad?
18277 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
18280 2003-08-05 Miguel de Icaza <miguel@ximian.com>
18282 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
18283 RemapParameterLValue): New methods that are used to turn a
18284 precomputed FieldInfo into an expression like this:
18288 The idea is to use this instead of making LocalVariableReference
18289 have more than one meaning.
18291 * cs-parser.jay: Add error production to BASE.
18293 * ecore.cs: Deal with TypeManager.GetField returning null, which
18294 is now a valid return value.
18296 (FieldExprNoAddress): New expression for Fields whose address can
18299 * expression.cs (LocalVariableReference): During the resolve
18300 phases, create new expressions if we are in a remapping context.
18301 Remove code that dealt with remapping here.
18303 (ParameterReference): same.
18305 (ProxyInstance): New expression, like the `This' expression, but
18306 it is born fully resolved. We know what we are doing, so remove
18307 the errors that are targeted to user-provided uses of `this'.
18309 * statement.cs (Foreach): our variable is now stored as an
18310 Expression; During resolution, follow the protocol, dont just
18311 assume it will return this.
18313 2003-08-06 Martin Baulig <martin@ximian.com>
18315 * support.cs (SeekableStreamReader.cs): New public class.
18317 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
18318 SeekableStreamReader instead of the normal StreamReader.
18320 2003-08-04 Martin Baulig <martin@ximian.com>
18322 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
18323 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
18324 deambiguate casts and delegate invocations.
18325 (parenthesized_expression): Use the new tokens to ensure this is
18326 not a cast of method invocation.
18328 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
18329 when reading a `)' and Deambiguate_CloseParens () was previously
18332 * expression.cs (ParenthesizedExpression): New class. This is
18333 just used for the CS0075 test.
18334 (Binary.DoResolve): Check for CS0075.
18336 2003-07-29 Ravi Pratap <ravi@ximian.com>
18338 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
18339 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
18340 reference comparison.
18342 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
18343 examine the ReturnType for equality - this is necessary in the
18344 cases of implicit and explicit operators whose signature also
18345 includes the return type.
18347 2003-07-26 Miguel de Icaza <miguel@ximian.com>
18349 * namespace.cs: Cache the result of the namespace computation,
18350 instead of computing it every time.
18352 2003-07-24 Miguel de Icaza <miguel@ximian.com>
18354 * decl.cs: Use a global arraylist that we reuse over invocations
18355 to avoid excesive memory consumption. Reduces memory usage on an
18356 mcs compile by one meg (45 average).
18358 * typemanager.cs (LookupTypeReflection): In .NET pointers are
18359 private, work around that.
18361 2003-07-23 Miguel de Icaza <miguel@ximian.com>
18363 * literal.cs (IntLiteral): Define Zero and One static literals.
18365 * cs-parser.jay (integer_literal): use static literals to reduce
18366 memory usage for the most used literals (0, 1 and -1). 211kb
18367 reduced in memory usage.
18369 Replace all calls to `new ArrayList' with `new
18370 ArrayList(4)' which is a good average number for most allocations,
18371 and also requires only 16 bytes of memory for its buffer by
18374 This reduced MCS memory usage in seven megabytes for the RSS after
18377 2003-07-28 Ravi Pratap <ravi@ximian.com>
18379 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
18380 handle params methods the correct way by forming only one
18381 applicable set with params and normal methods in them. Earlier we
18382 were looking at params methods only if we found no normal methods
18383 which was not the correct thing to do.
18385 (Invocation.BetterFunction): Take separate arguments indicating
18386 when candidate and the best method are params methods in their
18389 This fixes bugs #43367 and #46199.
18391 * attribute.cs: Documentation updates.
18393 (CheckAttribute): Rename to CheckAttributeTarget.
18394 (GetValidPlaces): Rename to GetValidTargets.
18396 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
18397 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
18401 2003-07-28 Martin Baulig <martin@ximian.com>
18403 * class.cs (TypeContainer.DefineMembers): Use the base type's full
18404 name when looking up the base class of a nested class. Fixes #46977.
18406 2003-07-26 Martin Baulig <martin@ximian.com>
18408 * expression.cs (Indexers.Indexer): New nested struct; contains
18409 getter, setter and the indexer's type.
18410 (Indexers.Properties): This is now an ArrayList of
18411 Indexers.Indexer's.
18412 (IndexerAccess.DoResolveLValue): Correctly set the type if the
18413 indexer doesn't have any getters.
18415 * assign.cs (Assign.DoResolve): Also do the implicit conversions
18416 for embedded property and indexer assignments.
18418 2003-07-26 Martin Baulig <martin@ximian.com>
18420 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
18421 preprocessor directive is not the first non-whitespace character
18424 2003-07-26 Martin Baulig <martin@ximian.com>
18426 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
18427 namespace parsing, follow the spec more closely.
18429 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
18430 NamespaceEntry.Lookup().
18432 2003-07-25 Martin Baulig <martin@ximian.com>
18434 * MethodCore.cs (OverridesSomething): New public field; it's set
18435 from TypeContainer.DefineMembers if this method overrides
18436 something (which doesn't need to be a method). Fix #39462.
18438 2003-07-25 Ravi Pratap <ravi@ximian.com>
18440 * typemanager.cs (GetMembers): Ensure that the list of members is
18441 reversed. This keeps things in sync.
18443 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
18444 find an AttributeUsage attribute.
18446 * expression.cs (Invocation.OverloadResolve): Perform the check
18447 which disallows Invoke to be directly called on a Delegate.
18449 (Error_InvokeOnDelegate): Report error cs1533.
18451 2003-07-25 Martin Baulig <martin@ximian.com>
18453 * expression.cs (Indexers.GetIndexersForType): Only look in the
18454 interface hierarchy if the requested type is already an
18455 interface. Fixes #46788 while keeping #46502 fixed.
18457 2003-07-25 Martin Baulig <martin@ximian.com>
18459 * class.cs (TypeContainer.DefineMembers): Check whether all
18460 readonly fields have been assigned and report warning CS0649 if
18463 * statement.cs (LocalInfo.IsFixed): Always return true if this is
18466 2003-07-24 Ravi Pratap <ravi@ximian.com>
18468 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
18469 returned from GetMethods to make things consistent with the
18470 assumptions MCS makes about ordering of methods.
18472 This should comprehensively fix bug #45127 and it does :-)
18474 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
18475 ordering is actually reverse.
18477 * Clean up some debug messages I left lying around.
18479 * interface.cs (Populate*): Get rid of code which emits attributes
18480 since the stage in which we emit attributes is the 'Emit' stage,
18481 not the define stage.
18483 (Emit): Move attribute emission for interface members here.
18485 2003-07-22 Ravi Pratap <ravi@ximian.com>
18487 * expression.cs (Invocation.OverloadResolve): Follow the spec more
18488 closely: we eliminate methods in base types when we have an
18489 applicable method in a top-level type.
18491 Please see section 14.5.5.1 for an exact description of what goes
18494 This fixes bug #45127 and a host of other related to corlib compilation.
18496 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
18497 array is the method corresponding to the top-level type (this is
18498 because of the changes made to icall.c) so we change this
18501 (MethodGroupExpr.Name): This too.
18503 * typemanager.cs (GetElementType): New method which does the right
18504 thing when compiling corlib.
18506 * everywhere: Make use of the above in the relevant places.
18508 2003-07-22 Martin Baulig <martin@ximian.com>
18510 * cs-parser.jay (invocation_expression): Moved
18511 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
18512 `cast_expression', but create a InvocationOrCast which later
18513 resolves to either an Invocation or a Cast.
18515 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
18516 method; call this before EmitStatement() to make sure that this
18517 expression can be used as a statement.
18519 * expression.cs (InvocationOrCast): New class; resolves to either
18520 an Invocation or a Cast.
18522 * statement.cs (StatementExpression): Call ResolveStatement() on
18523 the ExpressionStatement before emitting it.
18525 2003-07-21 Martin Baulig <martin@ximian.com>
18527 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
18528 `ref' and `out' attributes match; fixes #46220.
18529 (MemberAccess.ResolveMemberAccess): You can't reference a type
18530 through an expression; fixes #33180.
18531 (Indexers.GetIndexersForType): Don't return the indexers from
18532 interfaces the class implements; fixes #46502.
18534 2003-07-21 Martin Baulig <martin@ximian.com>
18536 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
18537 CS0661 checks; fixes bug #30442.
18539 2003-07-21 Martin Baulig <martin@ximian.com>
18541 * decl.cs (AdditionResult): Added `Error'.
18543 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
18545 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
18546 makes cs0031.cs actually work.
18548 2003-07-20 Martin Baulig <martin@ximian.com>
18550 * namespace.cs: Fixed that bug which caused a crash when compiling
18551 the debugger's GUI.
18553 2003-07-20 Miguel de Icaza <miguel@ximian.com>
18555 * typemanager.cs (LookupTypeReflection): Never expose types which
18556 are NotPublic, NestedPrivate, NestedAssembly, or
18557 NestedFamANDAssem. We used to return these, and later do a check
18558 that would report a meaningful error, but the problem is that we
18559 would not get the real match, if there was a name override.
18561 2003-07-18 Miguel de Icaza <miguel@ximian.com>
18563 * namespace.cs (Namespace, Name): Do not compute the namespace
18564 name dynamically, compute it in the constructor. This reduced
18565 memory usage by 1697 KB.
18567 * driver.cs: Use --pause to pause at the end.
18569 2003-07-17 Peter Williams <peter@newton.cx>
18571 * Makefile: Change the name of the test target so that it doesn't
18572 conflict with the recursive test target.
18574 2003-07-17 Miguel de Icaza <miguel@ximian.com>
18576 * expression.cs (LocalVariableReference.Emit, EmitAssign,
18577 AddressOf): Do not use EmitThis, that was wrong, use the actual
18580 2003-07-15 Miguel de Icaza <miguel@ximian.com>
18582 * class.cs (MethodData.Define): While checking if a method is an
18583 interface implementation, improve the test: If we are not public
18584 (use new test here: use the computed MethodAttributes directly,
18585 instead of the parsed modifier flags) check if the `implementing'
18586 method comes from an interface or not.
18588 * pending.cs (VerifyPendingMethods): Slightly better error
18591 * makefile: add test target that does the mcs bootstrap.
18593 2003-07-16 Ravi Pratap <ravi@ximian.com>
18595 * interface.cs (Define): Do nothing here since there are no
18596 members to populate etc. Move the attribute emission out of here
18597 since this was just totally the wrong place to put it. Attribute
18598 application happens during the 'Emit' phase, not in the 'Define'
18601 (Emit): Add this method and move the attribute emission here
18603 * rootcontext.cs (EmitCode): Call the Emit method on interface
18606 2003-07-14 Ravi Pratap M <ravi@ximian.com>
18608 * expression.cs (OverloadResolve): Report error only if Location
18609 is not 'Null' which means that there was a probe going on.
18611 2003-07-14 Martin Baulig <martin@ximian.com>
18613 * expression.cs (ConditionalLogicalOperator): New public class to
18614 implement user defined conditional logical operators.
18615 This is section 14.11.2 in the spec and bug #40505.
18617 2003-07-14 Martin Baulig <martin@ximian.com>
18619 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
18621 2003-07-14 Martin Baulig <martin@ximian.com>
18623 * codegen.cs (EmitContext.InFixedInitializer): New public field.
18625 * ecore.cs (IVariable.VerifyFixed): New interface method.
18627 * expression.cs (Unary.ResolveOperator): When resolving the `&'
18628 operator, check whether the variable is actually fixed. Fixes bug
18629 #36055. Set a variable definitely assigned when taking its
18630 address as required by the spec.
18632 * statement.cs (LocalInfo.IsFixed): New field.
18633 (LocalInfo.MakePinned): Set `IsFixed' to true.
18635 2003-07-14 Ravi Pratap M <ravi@ximian.com>
18637 * attribute.cs (Attribute.Resolve): While doing a Member lookup
18638 for .ctors, ensure that we only ask for members declared in the
18639 attribute type (BindingFlags.DeclaredOnly).
18643 * expression.cs (Error_WrongNumArguments): Report error 1501
18644 correctly the way CSC does.
18646 2003-07-13 Martin Baulig <martin@ximian.com>
18648 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
18649 lookup on the fully qualified name, to make things like "X.X" work
18650 where "X.X" is a fully qualified type name, but we also have a
18651 namespace "X" in the using list. Fixes #41975.
18653 2003-07-13 Martin Baulig <martin@ximian.com>
18655 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
18656 function. If we're a CompoundAssign, we need to create an embedded
18657 CompoundAssign, not an embedded Assign.
18658 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
18661 2003-07-13 Martin Baulig <martin@ximian.com>
18663 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
18664 work to fix bug #46088.
18666 2003-07-13 Ravi Pratap <ravi@ximian.com>
18668 * class.cs (Operator.Emit): Do not emit attributes here - it is
18669 taken care of by the Method class that we delegate too. This takes
18670 care of bug #45876.
18672 2003-07-10 Martin Baulig <martin@ximian.com>
18674 * expression.cs (TypeOfVoid): New class.
18675 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
18677 2003-07-10 Martin Baulig <martin@ximian.com>
18679 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
18682 2003-07-10 Martin Baulig <martin@ximian.com>
18684 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
18685 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
18687 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
18689 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
18691 2003-07-10 Martin Baulig <martin@ximian.com>
18693 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
18694 of decimal. Fixes #42850.
18696 NOTE: I also fixed the created byte blob, but this doesn't work on
18697 the MS runtime and csc never produces any byte blobs for decimal
18700 2003-07-10 Martin Baulig <martin@ximian.com>
18702 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
18703 structs; fixes #32068.
18704 (Block.AddChildVariableNames): Fixed #44302.
18706 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18708 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
18710 2003-07-07 Miguel de Icaza <miguel@ximian.com>
18712 * attribute.cs: And this test is onger needed.
18714 2003-07-08 Martin Baulig <martin@ximian.com>
18716 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
18717 inaccessible types. Fixes #36313.
18719 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
18721 * namespace.cs (NamespaceEntry): Create implicit entries for all
18722 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
18723 implicit entries for N1.N2 and N1.
18725 2003-07-08 Martin Baulig <martin@ximian.com>
18727 Rewrote the handling of namespaces to fix a lot of the issues
18728 wrt. `using' aliases etc.
18730 * namespace.cs (Namespace): Splitted this class into a
18731 per-assembly `Namespace' and a per-file `NamespaceEntry'.
18733 * typemanager.cs (TypeManager.IsNamespace): Removed.
18734 (TypeManager.ComputeNamespaces): Only compute namespaces from
18735 loaded assemblies here, not the namespaces from the assembly we're
18736 currently compiling.
18738 2003-07-08 Martin Baulig <martin@ximian.com>
18740 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
18742 2003-07-07 Miguel de Icaza <miguel@ximian.com>
18744 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
18747 I thought about the memory savings here, but LookupTypeReflection
18748 is used under already very constrained scenarios. Compiling
18749 corlib or mcs only exposes one hit, so it would not really reduce
18750 any memory consumption.
18752 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18754 * typemanager.cs: fixes bug #45889 by only adding public types from
18755 other assemblies to the list of known types.
18757 2003-07-07 Miguel de Icaza <miguel@ximian.com>
18759 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
18760 on the type we resolved.
18762 2003-07-05 Martin Baulig <martin@ximian.com>
18764 * pending.cs (PendingImplementation.ParentImplements): Don't
18765 create the proxy if the parent is abstract.
18767 * class.cs (TypeContainer.DefineIndexers): Process explicit
18768 interface implementations first. Fixes #37714.
18770 2003-07-04 Miguel de Icaza <miguel@ximian.com>
18772 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
18773 defined recursively; but since we modify the input parameters
18774 (left is set to `this' temporarily), we reset this value if the
18775 left_is_explicit is false, which gives the original semantics to
18778 * literal.cs (NullPointer): new class used to represent a null
18779 literal in a pointer context.
18781 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
18782 type is a pointer, use a NullPointer object instead of a
18783 NullLiteral. Closes 43687
18785 (ExplicitConversion): Convert pointer values using
18786 the conv opcode to the proper type.
18788 * ecore.cs (New): change ValueTypeVariable property into a method,
18789 that returns whether the valuetype is suitable for being used.
18791 * expression.cs (Binary.DoNumericPromotions): Only return if we
18792 the int constant was a valid uint, and we can return both left and
18793 right as uints. If not, we continue processing, to trigger the
18794 type conversion. This fixes 39018.
18796 * statement.cs (Block.EmitMeta): During constant resolution, set
18797 the CurrentBlock property on the emitcontext, so that we resolve
18798 constants propertly.
18800 2003-07-02 Martin Baulig <martin@ximian.com>
18802 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
18803 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
18805 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
18806 than emitting it here.
18808 * statement.cs: Fixed some more flow analysis bugs.
18810 2003-07-02 Martin Baulig <martin@ximian.com>
18812 * class.cs (MethodData.Define): When implementing interface
18813 methods, set Final unless we're Virtual.
18815 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
18816 check work for interface methods.
18818 2003-07-01 Martin Baulig <martin@ximian.com>
18820 * ecore.cs (EmitContext.This): Replaced this property with a
18821 GetThis() method which takes a Location argument. This ensures
18822 that we get the correct error location for a CS0188.
18824 2003-07-01 Miguel de Icaza <miguel@ximian.com>
18826 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
18827 ImplicitStandardConversion.
18829 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
18831 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
18833 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
18836 2003-06-30 Miguel de Icaza <miguel@ximian.com>
18838 * class.cs (Constructor.Define): Turn off initlocals for unsafe
18841 (MethodData.Define): Turn off initlocals for unsafe methods.
18843 2003-06-29 Miguel de Icaza <miguel@ximian.com>
18845 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
18846 complete; Fixes #37521.
18848 * delegate.cs: Use Modifiers.TypeAttr to compute the
18849 TypeAttributes, instead of rolling our own. This makes the flags
18850 correct for the delegates.
18852 2003-06-28 Miguel de Icaza <miguel@ximian.com>
18854 * class.cs (Constructor.Define): Set the private flag for static
18855 constructors as well.
18857 * cs-parser.jay (statement_expression): Set the return value to
18858 null, to avoid a crash when we catch an error.
18860 2003-06-24 Miguel de Icaza <miguel@ximian.com>
18862 * cs-parser.jay: Applied patch from Jackson that adds support for
18863 extern and unsafe modifiers to destructor declarations.
18865 * expression.cs: Report error 21 if the user is trying to index a
18868 * driver.cs: Add an error message, suggested by the bug report.
18870 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
18871 if we do not have a ": this ()" constructor initializer. Fixes 45149
18873 2003-06-14 Miguel de Icaza <miguel@ximian.com>
18875 * namespace.cs: Add some information to reduce FAQs.
18877 2003-06-13 Miguel de Icaza <miguel@ximian.com>
18879 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
18880 underlying enumeration types. Fixes #43915.
18882 * expression.cs: Treat ushort/short as legal values to be used in
18883 bitwise operations.
18885 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
18887 * delegate.cs: transfer custom attributes for paramenters from
18888 the delegate declaration to Invoke and BeginInvoke.
18890 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
18892 * attribute.cs: handle custom marshalers and emit marshal info
18895 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
18897 * makefile.gnu: Added anonymous.cs to the compiler sources.
18899 2003-05-28 Miguel de Icaza <miguel@ximian.com>
18901 * iterators.cs: Change the name of the proxy class to include two
18904 * cs-parser.jay: Update grammar to include anonymous methods.
18906 * anonymous.cs: new file.
18908 2003-05-27 Miguel de Icaza <miguel@ximian.com>
18910 * class.cs (Field.Define): Add missing test for pointers and
18913 2003-05-27 Ravi Pratap <ravi@ximian.com>
18915 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
18916 we use the stobj opcode.
18918 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
18919 since it wasn't the correct fix.
18921 It still is puzzling that we are required to use stobj for IntPtr
18922 which seems to be a ValueType.
18924 2003-05-26 Miguel de Icaza <miguel@ximian.com>
18926 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
18927 during regular simple name resolution. Now, the trick is that
18928 instead of returning for processing the simplename, we do a
18929 TypeManager.LookupType (ie, a rooted lookup as opposed to a
18930 contextual lookup type). If a match is found, return that, if
18931 not, return for further composition.
18933 This fixes long-standing 30485.
18935 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18936 using the address to initialize an object, do an Stobj instead of
18937 using the regular Stelem.
18939 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
18940 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
18941 Because if we are a BaseIndexerAccess that value will be true.
18944 * statement.cs (GotoCase.Resolve): Return after reporting an
18945 error, do not attempt to continue.
18947 * expression.cs (PointerArithmetic.Emit): If our operand is a
18948 long, convert our constants to match the operand before
18949 multiplying. Convert to I type before adding. Fixes 43670.
18951 2003-05-14 Ravi Pratap <ravi@ximian.com>
18953 * enum.cs (ImplicitConversionExists) : Rename to
18954 ImplicitEnumConversionExists to remove ambiguity.
18956 * ecore.cs (NullCast): New type of cast expression class which
18957 basically is very similar to EmptyCast with the difference being
18958 it still is a constant since it is used only to cast a null to
18960 (eg. (string) null)
18962 * convert.cs (ImplicitReferenceConversion): When casting a null
18963 literal, we return a NullCast.
18965 * literal.cs (NullLiteralTyped): Remove - I don't see why this
18966 should be around anymore.
18968 The renaming (reported was slightly wrong). Corrections:
18970 ConvertImplicitStandard -> ImplicitConversionStandard
18971 ConvertExplicitStandard -> ExplicitConversionStandard
18973 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
18974 before passing them in !
18976 * convert.cs (ImplicitConversionStandard): When comparing for
18977 equal expr and target types, ensure that expr is not a
18980 In general, we must not be checking (expr_type ==
18981 target_type) in the top level conversion methods
18982 (ImplicitConversion, ExplicitConversion etc). This checking is
18983 done in the methods that they delegate to.
18985 2003-05-20 Miguel de Icaza <miguel@ximian.com>
18987 * convert.cs: Move Error_CannotConvertType,
18988 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
18989 ImplicitNumericConversion, ImplicitConversionExists,
18990 ImplicitUserConversionExists, StandardConversionExists,
18991 FindMostEncompassedType, FindMostSpecificSource,
18992 FindMostSpecificTarget, ImplicitUserConversion,
18993 ExplicitUserConversion, GetConversionOperators,
18994 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
18995 TryImplicitIntConversion, Error_CannotConvertImplicit,
18996 ConvertImplicitRequired, ConvertNumericExplicit,
18997 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
18998 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19001 Perform the following renames:
19003 StandardConversionExists -> ImplicitStandardConversionExists
19004 ConvertImplicit -> ImplicitConversion
19005 ConvertImplicitStandard -> ImplicitStandardConversion
19006 TryImplicitIntConversion -> ImplicitIntConversion
19007 ConvertImplicitRequired -> ImplicitConversionRequired
19008 ConvertNumericExplicit -> ExplicitNumericConversion
19009 ConvertReferenceExplicit -> ExplicitReferenceConversion
19010 ConvertExplicit -> ExplicitConversion
19011 ConvertExplicitStandard -> ExplicitStandardConversion
19013 2003-05-19 Martin Baulig <martin@ximian.com>
19015 * statement.cs (TypeInfo.StructInfo): Made this type protected.
19016 (TypeInfo): Added support for structs having structs as fields.
19018 * ecore.cs (FieldExpr): Implement IVariable.
19019 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19020 VariableInfo for the field.
19022 2003-05-18 Martin Baulig <martin@ximian.com>
19024 * expression.cs (This.DoResolve): Report a CS0027 if we're
19025 emitting a field initializer.
19027 2003-05-18 Martin Baulig <martin@ximian.com>
19029 * expression.cs (This.ResolveBase): New public function.
19030 (This.DoResolve): Check for CS0188.
19032 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19035 * ecore.cs (MethodGroupExpr.DoResolve): Set the
19036 `instance_expression' to null if we don't have any non-static
19039 2003-05-18 Martin Baulig <martin@ximian.com>
19041 Reworked the way how local variables and parameters are handled by
19042 the flow analysis code.
19044 * statement.cs (TypeInfo, VariableMap): New public classes.
19045 (VariableInfo): New public class. This is now responsible for
19046 checking whether a variable has been assigned. It is used for
19047 parameters and local variables.
19048 (Block.EmitMeta): Take the InternalParameters as argument; compute
19049 the layout of the flow vectors here.
19050 (Block.LocalMap, Block.ParameterMap): New public properties.
19051 (FlowBranching): The .ctor doesn't get the InternalParameters
19052 anymore since Block.EmitMeta() now computes the layout of the flow
19054 (MyStructInfo): This class is now known as `StructInfo' and nested
19055 in `TypeInfo'; we don't access this directly anymore.
19057 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19058 property and removed IsAssigned(), IsFieldAssigned(),
19059 SetAssigned() and SetFieldAssigned(); we now call them on the
19060 VariableInfo so we don't need to duplicate this code everywhere.
19062 * expression.cs (ParameterReference): Added `Block block' argument
19064 (LocalVariableReference, ParameterReference, This): The new
19065 VariableInfo class is now responsible for all the definite
19068 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19069 IsParameterAssigned, SetParameterAssigned): Removed.
19071 2003-05-18 Martin Baulig <martin@ximian.com>
19073 * typemanager.cs (InitCoreTypes): Try calling
19074 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19075 the 3-args-version. Corlib now also needs our `void_type'.
19076 (GetMethod): Added overloaded version which takes an optional
19077 `bool report_errors' to allow lookups of optional methods.
19079 2003-05-12 Martin Baulig <martin@ximian.com>
19081 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19082 only used for locals and not for parameters.
19084 2003-05-12 Miguel de Icaza <miguel@ximian.com>
19086 * support.cs (InternalParameters.ParameterType): Return the
19087 ExternalType of the parameter.
19089 * parameter.cs (Parameter.ExternalType): drop the two arguments,
19092 2003-05-11 Miguel de Icaza <miguel@ximian.com>
19094 * class.cs (MethodData.Define): Do not set the `newslot' on
19095 interface members, if they are also flagged as "override".
19097 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19098 better code for ++i and i++. This only works for static fields
19099 and local variables.
19101 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19102 want to pull the DeclSpace out of the builder_to_declspace instead
19103 of the TypeBuilder (like in TypeContainer.FindMembers).
19105 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19106 instead of LookupTypeContainer. Fixes the crash on .NET for
19107 looking up interface members.
19109 * const.cs: Create our own emit context during the Definition
19110 stage, so that constants are evaluated in the proper context, when
19111 a recursive definition happens.
19113 2003-05-11 Martin Baulig <martin@ximian.com>
19115 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
19116 new block for a switch section.
19117 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19118 the adding/lookup in the switch block. Fixes #39828.
19120 2003-05-09 Miguel de Icaza <miguel@ximian.com>
19122 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19123 functionality: I needed to convert the data after I had performed
19124 the add/sub operation into the operands type size.
19126 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19127 pass the type for the box operation, otherwise the resulting
19128 object would have been of type object.
19130 (BoxedCast): Add constructor to specify the type to box as.
19132 2003-05-07 Miguel de Icaza <miguel@ximian.com>
19134 * iterators.cs: I was reusing the `count' variable inadvertently,
19135 take steps to not allow this to happen.
19137 2003-05-06 Miguel de Icaza <miguel@ximian.com>
19139 * attribute.cs (Attribute.Resolve): Params attributes are encoded
19140 by creating an array at the point where the params starts and
19141 putting all those arguments there, then adjusting the size of the
19144 2003-05-05 Miguel de Icaza <miguel@ximian.com>
19146 * expression.cs (New.AddressOf): Implement interface
19147 IMemoryLocation. This is used when the `new' operator is used in
19148 the context of an invocation to a method on a value type.
19150 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
19153 * namespace.cs: Also check the using aliases here.
19155 * driver.cs: Move the test for using validity after the types have
19156 been entered, so we do a single pass that also includes the using
19159 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
19160 in the regular case. CreateSiblingForFinally is doing extra
19163 * attribute.cs (GetAttributeArgumentExpression): Store the result
19164 on an out value, and use the return value to indicate failure
19165 instead of using null (which is a valid return for Constant.GetValue).
19167 * statement.cs: Perform the analysis flow for the increment
19168 portion after the statement, because this will be the real flow of
19169 execution. Fixes #42385
19171 * codegen.cs (EmitContext.EmitArgument,
19172 EmitContext.EmitStoreArgument): New helper functions when the
19173 RemapToProxy flag is set.
19175 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
19178 Add support for remapping parameters.
19180 * iterators.cs: Propagate parameter values; Store parameter
19181 values in the proxy classes.
19183 2003-05-04 Miguel de Icaza <miguel@ximian.com>
19185 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
19186 need a proxy reference; I do not know what I was thinking
19188 * cs-parser.jay (constructor_initializer): catch another error,
19189 and display nice message.
19191 (field_declaration): catch void field declaration
19192 to flag a better error.
19194 * class.cs (MemberBase.CheckBase): Report an error instead of a
19195 warning if a new protected member is declared in a struct.
19196 (Field.Define): catch the error of readonly/volatile.
19198 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
19200 (FieldExpr.AddressOf): ditto. Catch error where the address of a
19201 volatile variable is taken
19203 2003-05-02 Miguel de Icaza <miguel@ximian.com>
19205 * statement.cs (Fixed.Resolve): Report an error if we are not in
19208 2003-05-01 Miguel de Icaza <miguel@ximian.com>
19210 * typemanager.cs: reuse the code that handles type clashes for
19211 delegates and enumerations.
19213 * class.cs (Report28): Always report.
19215 * expression.cs (EncodeAsAttribute): Allow nulls here.
19217 2003-04-28 Miguel de Icaza <miguel@ximian.com>
19219 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
19220 the functionality for testing whether an expression is valid for
19221 an attribute here. Also handle the case of arrays of elements
19224 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
19225 encoding a linear array into an array of objects that are suitable
19226 to be passed to an CustomAttributeBuilder.
19228 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
19230 * ecore.cs: (FieldExpr): Handle field remapping here.
19232 * iteratators.cs: Pass the instance variable (if the method is an
19233 instance method) to the constructors, so we can access the field
19234 variables on the class.
19236 TODO: Test this with structs. I think the THIS variable on
19237 structs might have to be a pointer, and not a refenrece
19239 2003-04-27 Miguel de Icaza <miguel@ximian.com>
19241 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
19242 local variables to fields in a proxy class.
19244 * iterators.cs (PopulateProxy): Rename our internal fields to
19246 Create a <THIS> field if we are an instance method, so we can
19247 reference our parent container variables.
19248 (MapVariable): Called back from the EmitContext code to enter a
19249 new variable to field mapping into the proxy class (we just create
19253 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
19254 for using the remapped locals to fields.
19256 I placed the code here, because that gives the same semantics to
19257 local variables, and only changes the Emit code.
19259 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
19260 statements inside iterators.
19261 (VariableInfo): Add a FieldBuilder for the cases when we are
19262 remapping local variables to fields in a proxy class
19264 * ecore.cs (SimpleNameResolve): Avoid testing two times for
19265 current_block != null.
19267 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
19268 not cope with strings, as it has been moved to the
19269 TableSwitchEmit. Fixed bug in switch generation.
19271 * expression.cs (New.DoResolve): Provide more context for the user
19272 when reporting an error.
19274 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
19277 * expression.cs (MemberAccess.DoResolve): When we get a type back,
19278 check the permissions for it. Note than in a type-resolution
19279 context the check was already present in DeclSpace.ResolveType,
19280 but was missing from the MemberAccess.
19282 (ArrayCreation.CheckIndices): warn if the user has
19283 more nested levels of expressions, but there are no more
19284 dimensions specified. Avoids crash on bug 41906.
19286 2003-04-26 Miguel de Icaza <miguel@ximian.com>
19288 * statement.cs (Block): replace Implicit bool, for a generic
19290 New flag: `Unchecked'. This is used during the EmitMeta phase
19291 (which is out-of-line with the regular Resolve/Emit process for a
19292 statement, as this is done ahead of time, but still gets a chance
19293 to call constant resolve).
19295 (Block.Flags): new enum for adding a new flag.
19297 (Block.EmitMeta): track the state of unchecked.
19299 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
19300 to enable constant resolution to work there as well.
19302 2003-04-22 Miguel de Icaza <miguel@ximian.com>
19304 * typemanager.cs (ienumerable_type): Also look up
19305 System.Collections.IEnumerable.
19307 2003-04-21 Miguel de Icaza <miguel@ximian.com>
19309 TODO: Test more than one conditional per method.
19311 * class.cs (Indexer.Define): Report the location where the user is
19312 referencing the unsupported feature.
19314 (MethodData): Overload the use of `conditionals' to
19315 minimize the creation of needless ArrayLists. This saves roughly
19316 212kb on my machine.
19318 (Method): Implement the new IIteratorContainer interface.
19319 (Method.SetYields): Implement the method by setting the ModFlags
19320 to contain METHOD_YIELDS.
19322 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
19323 which just got set to null.
19325 * iterators.cs: New file.
19327 (Yield, YieldBreak): New statements.
19329 * statement.cs (Return.Resolve): Flag an error if we are used in
19330 an iterator method.
19332 * codegen.cs (InIterator): New flag set if the code is being
19333 compiled in an iterator method.
19335 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
19336 internal modifier, and we just use it to avoid adding extra
19337 fields, as this is seldom used.
19339 * cs-parser.jay: Add yield_statement (yield and yield break).
19341 * driver.cs: New flag -v2 to turn on version 2 features.
19343 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
19344 hashtable when v2 is enabled.
19346 2003-04-20 Miguel de Icaza <miguel@ximian.com>
19348 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
19349 there is already a namespace defined with this name.
19351 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
19352 people upgraded their corlibs.
19354 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
19355 always use fully qualified types, no need to use the compiler
19358 (TypeManager.IsNamespace): Use binarysearch.
19360 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
19361 AddDelegate): I did not quite use the new IsValid API properly: I
19362 have to pass the short-name and the fullname. I was passing only
19363 the basename instead of the fullname sometimes.
19365 (TypeContainer.DefineType): call NamespaceClash.
19367 * interface.cs (Interface.DefineType): use NamespaceClash before
19370 * delegate.cs (Delegate.DefineType): use NamespaceClash before
19373 * enum.cs: (Enum.DefineType): use NamespaceClash before
19376 * typemanager.cs (: 3-line patch that gives us some tasty 11%
19377 speed increase. First, use the negative_hits cache when we get a
19378 negative. Second, add the type with its full original name
19379 instead of the new . and + encoded name (reflection uses + to
19380 separate type from a nested type). Use LookupTypeReflection
19381 directly which bypasses the type->name hashtable (that we already
19382 know does not contain the type.
19384 * decl.cs (DeclSpace.ResolveTypeExpr): track the
19385 location/container type.
19387 * driver.cs: When passing utf8, use directly the UTF8Encoding.
19389 2003-04-19 Miguel de Icaza <miguel@ximian.com>
19391 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
19393 * delegate.cs (NewDelegate.Resolve): Test whether an instance
19394 method is being referenced in the method group from a static
19395 context, and report error 120 if so.
19397 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
19400 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
19401 is created, we create the A namespace).
19403 * cs-parser.jay: A namespace also introduces a DeclarationFound.
19406 2003-04-18 Miguel de Icaza <miguel@ximian.com>
19408 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
19409 invocation to ModuleBuilder.GetType with the same values will
19410 return a new type instance, so we need to cache its return
19413 * expression.cs (Binary.ResolveOperator): Only allow the compare
19414 operators on enums if they are of the same type.
19416 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
19417 types of ValueType on their own case. Before we were giving them
19418 the same treatment as objects.
19420 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
19421 fullname. Short name is used to compare against container name.
19422 Fullname is used to check against defined namespace names.
19424 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
19425 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
19427 (Method.CheckBase): Call parent.
19428 (MemberBase.CheckBase): Check for protected members on sealed
19430 (PropertyBase.CheckBase): Call parent.
19431 (Field.Define): Call parent.
19433 * report.cs: Negative error codes are now mapped to 8000 - code,
19434 so that the display is render more nicely.
19436 * typemanager.cs: Do not use try/catch, instead report a regular
19439 (GetPointerType, GetReferenceType): These methods provide
19440 mechanisms to obtain the T* and T& from a T. We had the code
19441 previously scattered around the code base, and it also used
19442 TypeManager.LookupType that would go through plenty of caches.
19443 This one goes directly to the type source.
19445 In some places we did the Type.GetType followed by
19446 ModuleBuilder.GetType, but not in others, so this unifies the
19447 processing as well.
19449 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
19450 statements now that we have namespace information.
19452 * typemanager.cs (IsNamespace): New method, returns whether the
19453 string presented is a namespace or not.
19455 (ComputeNamespaces): New public entry point, computes the list of
19456 available namespaces, using the GetNamespaces API call in Mono, or
19457 the slower version in MS.NET.
19459 Now before we start the semantic analysis phase, we have a
19460 complete list of namespaces including everything that the user has
19463 Deleted old code to cache namespaces in .nsc files.
19465 2003-04-17 Miguel de Icaza <miguel@ximian.com>
19467 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
19468 class/struct location definition Location for the implicit
19469 constructor location.
19471 (Operator.Define): Use the location of the operator for the
19472 implicit Method definition.
19474 (Constructor.Emit): use the constructor location for the implicit
19475 base initializer constructor.
19477 * ecore.cs: Remove ITypeExpression. This interface is now gone,
19478 and the Expression class now contains two new methods:
19480 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
19481 isolate type lookup from the rest of the resolution process.
19483 Since we use Expressions to hold type definitions due to the way
19484 we parse the input we have historically overloaded Resolve to
19485 perform the Type lookups if a special flag is passed. Now this is
19486 eliminated and two methods take their place.
19488 The differences in the two methods between xStep and xTerminal is
19489 that xStep is involved in our current lookup system that uses
19490 SimpleNames to compose a name, while xTerminal is used just to
19491 catch the case where the simplename lookup failed.
19493 2003-04-16 Miguel de Icaza <miguel@ximian.com>
19495 * expression.cs (ResolveMemberAccess): Remove redundant code.
19496 TypeExpr expressions are always born fully resolved.
19498 * interface.cs (PopulateMethod): Do not lookup the types twice.
19499 We were doing it once during SemanticAnalysis and once during
19502 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
19503 in local variable type definitions, were being returned as a
19504 SimpleName (we decomposed everything into a string), that is
19505 because primary_expression was being used instead of a type in the
19506 grammar (reduce/reduce conflicts).
19508 The part that was wrong is that we converted the expression into a
19509 string (an oversimplification in one hand, compounded with primary
19510 expressions doing string concatenation).
19516 Would return "A.B.C[]" as a SimpleName. This stopped things like
19517 using clauses from working on this particular context. And a type
19518 was being matched directly against "A.B.C[]".
19520 We now use the correct approach, and allow for ComposedCast to be
19521 part of the unary expression. So the "A.B.C []" become a composed
19522 cast of "A.B.C" (as a nested group of MemberAccess with a
19523 SimpleName at the end) plus the rank composition "[]".
19527 2003-04-10 Miguel de Icaza <miguel@ximian.com>
19529 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
19530 for the access level checking.
19532 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
19533 `TypeContainer container', because I kept getting confused when I
19534 was debugging this code.
19536 * expression.cs (Indexers): Instead of tracking getters/setters,
19537 we now track them in parallel. We create one arraylist less, but
19538 most importantly it is possible now for the LValue code to find a
19539 matching get for a set.
19541 (IndexerAccess.DoResolveLValue): Update the code.
19542 GetIndexersForType has been modified already to extract all the
19543 indexers from a type. The code assumed it did not.
19545 Also make the code set the correct return type for the indexer.
19546 This was fixed a long time ago for properties, but was missing for
19547 indexers. It used to be void_type.
19549 (Binary.Emit): Test first for doubles instead of
19550 floats, as they are more common.
19552 (Binary.EmitBranchable): Use the .un version of the branch opcodes
19553 when dealing with floats and the <=, >= operators. This fixes bug
19556 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
19557 to load the array value by emitting a load on the foreach variable
19558 type. This was incorrect.
19560 We now emit the code to load an element using the the array
19561 variable type, and then we emit the conversion operator.
19565 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
19567 * attribute.cs: Avoid allocation of ArrayLists in the common case.
19569 2003-04-09 Miguel de Icaza <miguel@ximian.com>
19571 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
19572 test for protection before we test for signatures.
19574 (MethodSignature.ToString): implement.
19576 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
19577 to the case where we reduced into a LongConstant.
19579 * decl.cs (CheckAccessLevel): If the type is an array, we can not
19580 depend on whether the information is acurrate, because the
19581 Microsoft runtime will always claim that the array type is public,
19582 regardless of the real state.
19584 If the type is a pointer, another problem happens: the type is
19585 reported as non-public in Microsoft.
19587 In both cases we have to call CheckAccessLevel recursively with
19588 the underlying type as the argument to be tested.
19590 2003-04-08 Miguel de Icaza <miguel@ximian.com>
19592 * assign.cs (Assign.Emit): If we are dealing with a compound
19593 assignment expression, we should use the code path that stores the
19594 intermediate result in a temporary value. This fixes #40903.
19596 *expression.cs (Indirection.ToString): Provide ToString method for
19599 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
19601 * class.cs: Null out fields holding references to Block objects so
19602 they can be garbage collected.
19604 * expression.cs (OverloadResolve): Remove unused local.
19606 2003-04-07 Martin Baulig <martin@ximian.com>
19608 * codegen.cs (EmitContext.CurrentFile): New public field.
19609 (EmitContext.Mark): Use the CurrentFile to check whether the
19610 location is in the correct file.
19611 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
19613 2003-04-07 Martin Baulig <martin@ximian.com>
19615 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
19617 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
19618 location. [FIXME: The location argument which gets passed to this
19619 method is sometimes wrong!]
19621 2003-04-07 Nick Drochak <ndrochak@gol.com>
19623 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
19625 2003-04-07 Miguel de Icaza <miguel@ximian.com>
19627 * expression.cs (Indirection.EmitAssign): We were using the
19628 temporary, but returning immediately instead of continuing the
19631 2003-04-06 Martin Baulig <martin@ximian.com>
19633 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
19634 if it's a nested child, but also deriving from the outer class.
19637 * typemanager.cs (IsNestedChildOf): Make this work if it's a
19638 nested child, but also deriving from the outer class. See
19640 (FilterWithClosure): We may access private members of the outer
19641 class if we're a nested child and deriving from the outer class.
19642 (RealMemberLookup): Only set `closure_private_ok' if the
19643 `original_bf' contained BindingFlags.NonPublic.
19645 2003-04-05 Martin Baulig <martin@ximian.com>
19647 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
19649 2003-04-02 Miguel de Icaza <miguel@ximian.com>
19651 * class.cs (Event.Define): Do not allow abstract events to have
19654 2003-04-01 Miguel de Icaza <miguel@ximian.com>
19656 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
19657 block in event declarations.
19659 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
19660 value type, get its address.
19662 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
19663 leaving a class on the stack instead of a boolean value (int
19664 0/1). Change the code so we compare against null, and then the
19665 result against zero.
19667 * class.cs (TypeContainer.GetClassBases): We were checking for the
19668 parent class being sealed too late.
19670 * expression.cs (Binary.Emit): For <= and >= when dealing with
19671 floating point values, use cgt.un and clt.un instead of cgt and
19674 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
19676 * statement.cs: Apply the same optimization as MS: skip the
19677 GetEnumerator returning an IEnumerator, and use the one returning a
19678 CharEnumerator instead. This allows us to avoid the try-finally block
19681 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
19683 * cs-parser.jay: Attributes cannot be applied to
19684 namespaces. Fixes #40473
19686 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19689 (Add*): check if the name is valid using the full name for constants,
19690 fields, properties and events.
19692 2003-03-28 Miguel de Icaza <miguel@ximian.com>
19694 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
19695 char constants to be part of the enumeration.
19697 * expression.cs (Conditional.DoResolve): Add support for operator
19698 true. Implements the missing functionality from 14.12
19700 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
19701 operator true/false as required by the spec.
19703 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
19704 implicit conversion to boolean.
19706 * statement.cs (Statement.ResolveBoolean): A boolean expression is
19707 also one where the type implements `operator true'.
19709 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
19710 get an expression that will invoke operator true based on an
19713 (GetConversionOperators): Removed the hack that called op_True
19716 (Expression.ResolveBoolean): Move this from Statement.
19718 2003-03-17 Miguel de Icaza <miguel@ximian.com>
19720 * ecore.cs (FieldExpr): do not allow initialization of initonly
19721 fields on derived classes
19723 2003-03-13 Martin Baulig <martin@ximian.com>
19725 * statement.cs (Block.Emit): Call ig.BeginScope() and
19726 ig.EndScope() when compiling with debugging info; call
19727 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
19729 2003-03-08 Miguel de Icaza <miguel@ximian.com>
19731 * expression.cs (Indexers): Do not construct immediately, allow
19732 for new members to be appended as we go. Fixes 38143
19734 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19736 * expression.cs: save/restore context when resolving an unchecked
19739 2003-03-05 Miguel de Icaza <miguel@ximian.com>
19741 * cfold.cs: Catch division by zero in modulus operator during
19744 2003-03-03 Miguel de Icaza <miguel@ximian.com>
19746 * interface.cs (Interface.DefineMembers): Avoid defining members
19749 2003-02-27 Miguel de Icaza <miguel@ximian.com>
19751 * driver.cs: handle the +/- options for -noconfig
19753 * statement.cs (Unckeched.Resolve): Also track the state of
19754 unchecked in the Resolve phase.
19756 2003-02-27 Martin Baulig <martin@ximian.com>
19758 * ecore.cs (Expression.MemberLookup): Don't create a
19759 MethodGroupExpr for something which is not a method. Fixes #38291.
19761 2003-02-25 Miguel de Icaza <miguel@ximian.com>
19763 * class.cs (MemberBase.CheckParameters): Also check that the type
19764 is unmanaged if it is a pointer.
19766 * expression.cs (SizeOf.Resolve): Add location information.
19768 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
19769 a managed type is declared.
19771 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
19772 parameter modifiers as well. Fixes bug 38606
19774 * class.cs: Very sad. Am backing out the speed up changes
19775 introduced by the ArrayList -> Array in the TypeContainer, as they
19776 were not actually that much faster, and introduced a bug (no error
19777 reports on duplicated methods).
19779 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
19780 source first, this will guarantee that we have a valid expression
19781 before calling in lower levels functions that will require a
19782 resolved object. Then use this original_source in the
19783 target.ResolveLValue instead of the original source that was
19786 Another change. Use target.Resolve instead of LValueResolve.
19787 Although we are resolving for LValues, we will let the Assign code
19788 take care of that (it will be called again from Resolve). This
19789 basically allows code like this:
19791 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
19792 class Y { void A (X x) { x [0] += o; }
19794 The problem was that the indexer was trying to resolve for
19795 set_Item (idx, object o) and never finding one. The real set_Item
19796 was set_Item (idx, X). By delaying the process we get the right
19801 2003-02-23 Martin Baulig <martin@ximian.com>
19803 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
19804 while calling DoEmit ().
19806 * codegen.cs (EmitContext.Mark): Don't mark locations in other
19807 source files; if you use the #line directive inside a method, the
19808 compiler stops emitting line numbers for the debugger until it
19809 reaches the end of the method or another #line directive which
19810 restores the original file.
19812 2003-02-23 Martin Baulig <martin@ximian.com>
19814 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
19816 2003-02-23 Martin Baulig <martin@ximian.com>
19818 * statement.cs (Block.AddChildVariableNames): We need to call this
19819 recursively, not just for our immediate children.
19821 2003-02-23 Martin Baulig <martin@ximian.com>
19823 * class.cs (Event.Define): Always make the field private, like csc does.
19825 * typemanager.cs (TypeManager.RealMemberLookup): Make events
19826 actually work, fixes bug #37521.
19828 2003-02-23 Miguel de Icaza <miguel@ximian.com>
19830 * delegate.cs: When creating the various temporary "Parameters"
19831 classes, make sure that we call the ComputeAndDefineParameterTypes
19832 on those new parameters (just like we do with the formal ones), to
19833 allow them to be resolved in the context of the DeclSpace.
19835 This fixes the bug that Dick observed in Bugzilla #38530.
19837 2003-02-22 Miguel de Icaza <miguel@ximian.com>
19839 * expression.cs (ResolveMemberAccess): When resolving a constant,
19840 do not attempt to pull a constant if the value was not able to
19841 generate a valid constant.
19843 * const.cs (LookupConstantValue): Do not report more errors than required.
19845 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19847 * expression.cs: fixes bug #38328.
19849 2003-02-18 Miguel de Icaza <miguel@ximian.com>
19851 * class.cs: Changed all the various members that can be part of a
19852 class from being an ArrayList to be an Array of the right type.
19853 During the DefineType type_list, interface_list, delegate_list and
19854 enum_list are turned into types, interfaces, delegates and enums
19857 And during the member population, indexer_list, event_list,
19858 constant_list, field_list, instance_constructor_list, method_list,
19859 operator_list and property_list are turned into their real arrays.
19861 Although we could probably perform this operation earlier, for
19862 good error reporting we need to keep the lists and remove the
19863 lists for longer than required.
19865 This optimization was triggered by Paolo profiling the compiler
19866 speed on the output of `gen-sample-program.pl' perl script.
19868 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
19869 not crash in methods like MemberLookupFailed that use this field.
19871 This problem arises when the compiler fails to resolve a type
19872 during interface type definition for example.
19874 2003-02-18 Miguel de Icaza <miguel@ximian.com>
19876 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
19877 inherit from System.Object, so we have to stop at null, not only
19878 when reaching System.Object.
19880 2003-02-17 Miguel de Icaza <miguel@ximian.com>
19882 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
19883 DeclaredOnly because the parent indexer might have had a different
19884 name, but did not loop until the top of the hierarchy was reached.
19886 The problem this one fixes is 35492: when a class implemented an
19887 indexer from an interface, we were getting the interface method
19888 (which was abstract) and we were flagging an error (can not invoke
19891 This also keeps bug 33089 functioning, and test-148 functioning.
19893 * typemanager.cs (IsSpecialMethod): The correct way of figuring
19894 out if a method is special is to see if it is declared in a
19895 property or event, or whether it is one of the predefined operator
19896 names. This should fix correctly #36804.
19898 2003-02-15 Miguel de Icaza <miguel@ximian.com>
19900 The goal here is to remove the dependency on EmptyCast.Peel ().
19901 Killing it completely.
19903 The problem is that currently in a number of places where
19904 constants are expected, we have to "probe" for an EmptyCast, and
19905 Peel, which is not the correct thing to do, as this will be
19906 repetitive and will likely lead to errors.
19908 The idea is to remove any EmptyCasts that are used in casts that
19909 can be reduced to constants, so we only have to cope with
19912 This bug hunt was triggered by Bug 37363 and the desire to remove
19913 the duplicate pattern where we were "peeling" emptycasts to check
19914 whether they were constants. Now constants will always be
19917 * ecore.cs: Use an enumconstant here instead of wrapping with
19920 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
19921 throwing me off. By handling this we can get rid of a few hacks.
19923 * statement.cs (Switch): Removed Peel() code.
19925 2003-02-14 Miguel de Icaza <miguel@ximian.com>
19927 * class.cs: Location information for error 508
19929 * expression.cs (New.DoResolve): Add a guard against double
19930 resolution of an expression.
19932 The New DoResolve might be called twice when initializing field
19933 expressions (see EmitFieldInitializers, the call to
19934 GetInitializerExpression will perform a resolve on the expression,
19935 and later the assign will trigger another resolution
19937 This leads to bugs (#37014)
19939 * delegate.cs: The signature for EndInvoke should contain any ref
19940 or out parameters as well. We were not doing this in the past.
19942 * class.cs (Field.Define): Do not overwrite the type definition
19943 inside the `volatile' group. Turns out that volatile enumerations
19944 were changing the type here to perform a validity test, which
19947 2003-02-12 Miguel de Icaza <miguel@ximian.com>
19949 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
19950 and structs, we do not want to load the instance variable
19952 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
19953 enum_type has to be handled like an object reference (implicit
19954 conversions exists from this to object), but the regular IsClass
19955 and IsValueType tests will never return true for this one.
19957 Also we use TypeManager.IsValueType instead of type.IsValueType,
19958 just for consistency with the rest of the code (this is only
19959 needed if we ever use the construct exposed by test-180.cs inside
19960 corlib, which we dont today).
19962 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
19964 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
19967 2003-02-09 Martin Baulig <martin@ximian.com>
19969 * namespace.cs (Namespace..ctor): Added SourceFile argument.
19970 (Namespace.DefineNamespaces): New static public method; this is
19971 called when we're compiling with debugging to add all namespaces
19972 to the symbol file.
19974 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
19975 pass it to the Namespace's .ctor.
19977 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
19978 and MethodBase arguments; pass the namespace ID to the symwriter;
19979 pass the MethodBase instead of the token to the symwriter.
19980 (SymbolWriter.DefineNamespace): New method to add a namespace to
19983 2003-02-09 Martin Baulig <martin@ximian.com>
19985 * symbolwriter.cs: New file. This is a wrapper around
19986 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
19987 methods here in near future.
19989 2003-02-09 Martin Baulig <martin@ximian.com>
19991 * codegen.cs (EmitContext.Mark): Just pass the arguments to
19992 ILGenerator.MarkSequencePoint() which are actually used by the
19995 2003-02-09 Martin Baulig <martin@ximian.com>
19997 * location.cs (SourceFile): New public sealed class. This
19998 contains the name and an index which is used in the location's token.
19999 (Location): Reserve an appropriate number of bits in the token for
20000 the source file instead of walking over that list, this gives us a
20001 really huge performance improvement when compiling with debugging.
20003 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20004 `SourceFile' argument instead of a string.
20005 (Driver.ProcessFile): Add all the files via Location.AddFile(),
20006 but don't parse/tokenize here, we need to generate the list of all
20007 source files before we do that.
20008 (Driver.ProcessFiles): New static function. Parses/tokenizes all
20011 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20012 instead of a string.
20014 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20017 2003-02-09 Martin Baulig <martin@ximian.com>
20019 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20020 filename on `#line default'.
20022 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20024 * statement.cs: don't clear the pinned var when the fixed statement
20025 returns from the method (fixes bug#37752).
20027 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20029 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
20032 2003-02-07 Martin Baulig <martin@ximian.com>
20034 * driver.cs: Removed the `--debug-args' command line argument.
20036 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20037 automatically by the AsssemblyBuilder.
20038 (CodeGen.InitializeSymbolWriter): We don't need to call any
20039 initialization function on the symbol writer anymore. This method
20040 doesn't take any arguments.
20042 2003-02-03 Miguel de Icaza <miguel@ximian.com>
20044 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20045 from referenced assemblies as well.
20047 2003-02-02 Martin Baulig <martin@ximian.com>
20049 * class.cs (MethodData.Emit): Generate debugging info for external methods.
20051 2003-02-02 Martin Baulig <martin@ximian.com>
20053 * class.cs (Constructor.Emit): Open the symbol writer before
20054 emitting the constructor initializer.
20055 (ConstructorInitializer.Emit): Call ec.Mark() to allow
20056 single-stepping through constructor initializers.
20058 2003-01-30 Miguel de Icaza <miguel@ximian.com>
20060 * class.cs: Handle error 549: do not allow virtual methods in
20063 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20065 * decl.cs: Check access levels when resolving types
20067 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20069 * statement.cs: Add parameters and locals set in catch blocks that might
20070 return to set vector
20072 2003-01-29 Miguel de Icaza <miguel@ximian.com>
20074 * class.cs (Operator): Set the SpecialName flags for operators.
20076 * expression.cs (Invocation.DoResolve): Only block calls to
20077 accessors and operators on SpecialName methods.
20079 (Cast.TryReduce): Handle conversions from char constants.
20082 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20084 * statement.cs: small memory and time optimization in FlowBranching.
20086 2003-01-28 Pedro Mart <yoros@wanadoo.es>
20088 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20089 problem that the last fix but in the other sid (Set).
20091 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20092 access when there is no indexer in the hierarchy.
20094 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20096 * class.cs: Combine some if statements.
20098 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20100 * driver.cs: fixed bug #37187.
20102 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
20104 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20105 any indexer, it's needed to build a list with all the indexers in the
20106 hierarchy (AllGetters), else we have problems. Fixes #35653.
20108 2003-01-23 Miguel de Icaza <miguel@ximian.com>
20110 * class.cs (MethodData.Define): It is wrong for an interface
20111 implementation to be static in both cases: explicit and implicit.
20112 We were only handling this in one case.
20114 Improve the if situation there to not have negations.
20116 * class.cs (Field.Define): Turns out that we do not need to check
20117 the unsafe bit on field definition, only on usage. Remove the test.
20119 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20121 * driver.cs: use assembly.Location instead of Codebase (the latest
20122 patch made mcs fail when using MS assemblies).
20124 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
20126 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20127 get the path to *corlib.dll.
20129 2003-01-21 Nick Drochak <ndrochak@gol.com>
20133 * typemanager.cs: Remove compiler warnings
20135 2003-01-20 Duncan Mak <duncan@ximian.com>
20137 * AssemblyInfo.cs: Bump the version number to 0.19.
20139 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20141 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
20143 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
20145 * class.cs (Constructor::Emit): Emit debugging info for constructors.
20147 2003-01-17 Miguel de Icaza <miguel@ximian.com>
20149 * cs-parser.jay: Small fix: we were not comparing the constructor
20150 name correctly. Thanks to Zoltan for the initial pointer.
20152 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
20154 * cs-tokenizer.cs: Set file name when specified with #line
20156 2003-01-15 Miguel de Icaza <miguel@ximian.com>
20158 * cs-parser.jay: Only perform the constructor checks here if we
20159 are named like the class; This will help provider a better
20160 error. The constructor path is taken when a type definition is
20161 not found, but most likely the user forgot to add the type, so
20162 report that rather than the constructor error.
20164 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
20166 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
20169 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20171 * cs-parser.jay: Add cleanup call.
20173 2003-01-13 Duncan Mak <duncan@ximian.com>
20175 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
20176 consistent with other methods.
20178 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20180 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
20182 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
20184 * attribute.cs: only set GuidAttr to true when we have a
20187 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20191 * typemanager.cs: fixes to allow mcs compile corlib with the new
20192 Type.IsSubclassOf fix.
20194 2003-01-08 Miguel de Icaza <miguel@ximian.com>
20196 * expression.cs (LocalVariableReference.DoResolve): Classify a
20197 constant as a value, not as a variable. Also, set the type for
20200 * cs-parser.jay (fixed_statement): take a type instead of a
20201 pointer_type, so we can produce a better error message later.
20203 * statement.cs (Fixed.Resolve): Flag types that are not pointers
20206 (For.DoEmit): Make inifinite loops have a
20207 non-conditional branch back.
20209 (Fixed.DoEmit): First populate the pinned variables, then emit the
20210 statement, then clear the variables. Before I was emitting the
20211 code once for each fixed piece.
20214 2003-01-08 Martin Baulig <martin@ximian.com>
20216 * statement.cs (FlowBranching.MergeChild): A break in a
20217 SWITCH_SECTION does not leave a loop. Fixes #36155.
20219 2003-01-08 Martin Baulig <martin@ximian.com>
20221 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
20222 lives in the same number space than `param_map'. Fixes #36154.
20224 2003-01-07 Miguel de Icaza <miguel@ximian.com>
20226 * cs-parser.jay (constructor_declaration): Set the
20227 Constructor.ModFlags before probing for it. This makes the
20228 compiler report 514, 515 and 132 (the code was there, but got
20231 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
20232 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
20233 (GotoCase.Resolve): Set `Returns' to ALWAYS.
20235 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
20237 * enum.cs: create the enum static fields using the enum type.
20239 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
20241 * class.cs: don't try to create the ParamBuilder for the return
20242 type if it's not needed (and handle it breaking for the ms runtime
20245 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
20247 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
20249 2002-12-29 Miguel de Icaza <miguel@ximian.com>
20251 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
20252 the command. This showed up while compiling the JANET source
20253 code, which used \r as its only newline separator.
20255 2002-12-28 Miguel de Icaza <miguel@ximian.com>
20257 * class.cs (Method.Define): If we are an operator (because it
20258 reuses our code), then set the SpecialName and HideBySig. #36128
20260 2002-12-22 Miguel de Icaza <miguel@ximian.com>
20262 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
20263 exception, report error 120 `object reference required'.
20265 * driver.cs: Add --pause option, used during to measure the size
20266 of the process as it goes with --timestamp.
20268 * expression.cs (Invocation.DoResolve): Do not allow methods with
20269 SpecialName to be invoked.
20271 2002-12-21 Miguel de Icaza <miguel@ximian.com>
20273 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
20274 number before adding it.
20276 2002-12-21 Ravi Pratap <ravi@ximian.com>
20278 * ecore.cs (StandardImplicitConversion): When in an unsafe
20279 context, we allow conversion between void * to any other pointer
20280 type. This fixes bug #35973.
20282 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
20284 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
20285 is not thrown when extensionless outputs are used
20287 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20289 * rootcontext.cs: fixed compilation of corlib.
20291 2002-12-19 Miguel de Icaza <miguel@ximian.com>
20293 * attribute.cs (Attributes.Contains): Add new method.
20295 * class.cs (MethodCore.LabelParameters): if the parameter is an
20296 `out' parameter, check that no attribute `[In]' has been passed.
20298 * enum.cs: Handle the `value__' name in an enumeration.
20300 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
20302 * decl.cs: Added special case to allow overrides on "protected
20305 2002-12-18 Ravi Pratap <ravi@ximian.com>
20307 * attribute.cs (Attributes.AddAttributeSection): Rename to this
20308 since it makes much more sense.
20310 (Attributes.ctor): Don't require a Location parameter.
20312 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
20314 * attribute.cs (ApplyAttributes): Remove extra Location parameters
20315 since we already have that information per attribute.
20317 * everywhere : make appropriate changes.
20319 * class.cs (LabelParameters): Write the code which actually
20320 applies attributes to the return type. We can't do this on the MS
20321 .NET runtime so we flag a warning in the case an exception is
20324 2002-12-18 Miguel de Icaza <miguel@ximian.com>
20326 * const.cs: Handle implicit null conversions here too.
20328 2002-12-17 Ravi Pratap <ravi@ximian.com>
20330 * class.cs (MethodCore.LabelParameters): Remove the extra
20331 Type [] parameter since it is completely unnecessary. Instead
20332 pass in the method's attributes so that we can extract
20333 the "return" attribute.
20335 2002-12-17 Miguel de Icaza <miguel@ximian.com>
20337 * cs-parser.jay (parse): Use Report.Error to flag errors instead
20338 of ignoring it and letting the compile continue.
20340 * typemanager.cs (ChangeType): use an extra argument to return an
20341 error condition instead of throwing an exception.
20343 2002-12-15 Miguel de Icaza <miguel@ximian.com>
20345 * expression.cs (Unary.TryReduce): mimic the code for the regular
20346 code path. Perform an implicit cast in the cases where we can
20347 implicitly convert to one of the integral types, and then reduce
20348 based on that constant. This fixes bug #35483.
20350 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20352 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
20354 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20356 * namespace.cs: fixed bug #35489.
20358 2002-12-12 Miguel de Icaza <miguel@ximian.com>
20360 * class.cs: Remove some dead code.
20362 * cs-parser.jay: Estimate the number of methods needed
20363 (RootContext.MethodCount);
20365 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
20366 numbers instead of StringBuilders.
20368 * support.cs (PtrHashtable): Add constructor with initial size;
20369 We can now reduce reallocations of the method table.
20371 2002-12-10 Ravi Pratap <ravi@ximian.com>
20373 * attribute.cs (ApplyAttributes): Keep track of the emitted
20374 attributes on a per-target basis. This fixes bug #35413.
20376 2002-12-10 Miguel de Icaza <miguel@ximian.com>
20378 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
20379 default to the Windows 1252 encoding.
20381 (UnixParseOption): Support version, thanks to Alp for the missing
20384 * AssemblyInfo.cs: Add nice assembly information.
20386 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
20389 * cs-parser.jay: Allow a trailing comma before the close bracked
20390 in the attribute_section production.
20392 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
20393 address of the instance was being taken, I will take this out,
20394 because we take the address of the object immediately here.
20396 2002-12-09 Ravi Pratap <ravi@ximian.com>
20398 * typemanager.cs (AreMultipleAllowed): Take care of the most
20399 obvious case where attribute type is not in the current assembly -
20402 2002-12-08 Miguel de Icaza <miguel@ximian.com>
20404 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
20405 definitions, instead of doing that afterwards.
20407 Also we use a nice little hack, depending on the constructor, we
20408 know if we are a "composed" name or a simple name. Hence, we
20409 avoid the IndexOf test, and we avoid
20411 * codegen.cs: Add code to assist in a bug reporter to track down
20412 the source of a compiler crash.
20414 2002-12-07 Ravi Pratap <ravi@ximian.com>
20416 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
20417 types have been emitted for a given element and flag an error
20418 if something which does not have AllowMultiple set is used more
20421 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
20422 attribute types and their corresponding AllowMultiple properties
20424 (AreMultipleAllowed): Check the property for a given type.
20426 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
20427 property in the case we have a TypeContainer.
20429 (Attributes.AddAttribute): Detect duplicates and just skip on
20430 adding them. This trivial fix catches a pretty gross error in our
20431 attribute emission - global attributes were being emitted twice!
20433 Bugzilla bug #33187 is now fixed.
20435 2002-12-06 Miguel de Icaza <miguel@ximian.com>
20437 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
20438 instead of pp_and).
20440 * expression.cs (Binary.ResolveOperator): I can only use the
20441 Concat (string, string, string) and Concat (string, string,
20442 string, string) if the child is actually a concatenation of
20445 2002-12-04 Miguel de Icaza <miguel@ximian.com>
20447 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
20448 context where we need a 2-character lookahead.
20450 * pending.cs (PendingImplementation): Rework so we can keep track
20451 of interface types all the time, and flag those which were
20452 implemented by parents as optional.
20454 2002-12-03 Miguel de Icaza <miguel@ximian.com>
20456 * expression.cs (Binary.ResolveOperator): Use
20457 String.Concat(string,string,string) or
20458 String.Concat(string,string,string,string) when possible.
20460 * typemanager: More helper methods.
20463 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
20465 * pending.cs: remove the bogus return from GetMissingInterfaces()
20466 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
20468 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20470 * namespace.cs: avoid duplicated 'using xxx' being added to
20471 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
20472 when we get more than one 'using' statement for the same namespace.
20473 Report a CS0105 warning for it.
20475 2002-11-30 Miguel de Icaza <miguel@ximian.com>
20477 * cs-tokenizer.cs (consume_identifier): use read directly, instead
20478 of calling getChar/putback, uses internal knowledge of it.
20480 (xtoken): Reorder tokenizer so most common patterns are checked
20481 first. This reduces the compilation time in another 5% (from 8.11s
20482 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
20484 The parsing time is 22% of the compilation in mcs, and from that
20485 64% is spent on the tokenization process.
20487 I tried using a binary search for keywords, but this is slower
20488 than the hashtable. Another option would be to do a couple of
20491 * Not use a StringBuilder, instead use an array of chars,
20492 with a set value. Notice that this way we could catch
20493 the 645 error without having to do it *afterwards*.
20495 * We could write a hand-parser to avoid the hashtable
20496 compares altogether.
20498 The identifier consumption process takes 37% of the tokenization
20499 time. Another 15% is spent on is_number. 56% of the time spent
20500 on is_number is spent on Int64.Parse:
20502 * We could probably choose based on the string length to
20503 use Int32.Parse or Int64.Parse and avoid all the 64-bit
20506 Another 3% is spend on wrapping `xtoken' in the `token' function.
20508 Handle 0xa0 as whitespace (#34752)
20510 2002-11-26 Miguel de Icaza <miguel@ximian.com>
20512 * typemanager.cs (IsCLRType): New routine to tell whether a type
20513 is one of the builtin types.
20515 Maybe it needs to use TypeCodes to be faster. Maybe we could use
20516 typecode in more places instead of doing pointer comparissions.
20517 We could leverage some knowledge about the way the typecodes are
20520 New code to cache namespaces in assemblies, it is currently not
20521 invoked, to be used soon.
20523 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
20525 * expression.cs (Binary.ResolveOperator): specially handle
20526 strings, and do not perform user-defined operator overloading for
20529 2002-11-24 Miguel de Icaza <miguel@ximian.com>
20531 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
20532 internalcall as it is a pretty simple operation; Avoid whenever
20533 possible to call Char.IsLetter.
20535 (consume_identifier): Cut by half the number of
20536 hashtable calls by merging the is_keyword and GetKeyword behavior.
20538 Do not short-circuit, because if we do, we
20539 report errors (ie, #if false && true would produce an invalid
20543 2002-11-24 Martin Baulig <martin@ximian.com>
20545 * expression.cs (Cast.TryReduce): If we're in checked syntax,
20546 check constant ranges and report a CS0221. Fixes #33186.
20548 2002-11-24 Martin Baulig <martin@ximian.com>
20550 * cs-parser.jay: Make this work for uninitialized variable
20551 declarations in the `for' initializer. Fixes #32416.
20553 2002-11-24 Martin Baulig <martin@ximian.com>
20555 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
20556 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
20558 2002-11-24 Martin Baulig <martin@ximian.com>
20560 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
20561 argument; if true, we also check for user-defined conversions.
20562 This is only needed if both arguments are of a user-defined type.
20563 Fixes #30443, added test-175.cs.
20564 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
20566 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
20568 2002-11-24 Martin Baulig <martin@ximian.com>
20570 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
20571 function to get the store opcode.
20572 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
20573 only emit the Ldelema if the store opcode is Stobj. You must run
20574 both test-34 and test-167 to test this. Fixes #34529.
20576 2002-11-23 Martin Baulig <martin@ximian.com>
20578 * ecore.cs (Expression.MemberLookup): Added additional
20579 `qualifier_type' argument which is used when we're being called
20580 from MemberAccess.DoResolve() and null if we're called from a
20582 (Expression.MemberLookupFailed): New method to report errors; this
20583 does the CS1540 check and reports the correct error message.
20585 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
20586 argument for the CS1540 check and redone the way how we're dealing
20587 with private members. See the comment in the source code for details.
20588 (FilterWithClosure): Reverted this back to revision 1.197; renamed
20589 `closure_start_type' to `closure_qualifier_type' and check whether
20590 it's not null. It was not this filter being broken, it was just
20591 being called with the wrong arguments.
20593 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
20594 and pass it the correct `qualifier_type'; this also does the error
20597 2002-11-22 Miguel de Icaza <miguel@ximian.com>
20599 * expression.cs (Invocation.EmitParams): If the we are dealing
20600 with a non-built-in value type, load its address as well.
20602 (ArrayCreation): Use a a pretty constant instead
20603 of the hardcoded value 2. Use 6 instead of 2 for the number of
20604 static initializers.
20606 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
20607 because they are not really value types, just glorified integers.
20609 * driver.cs: Do not append .exe, the CSC compiler does not do it.
20611 * ecore.cs: Remove redundant code for enumerations, make them use
20612 the same code path as everything else, fixes the casting issue
20613 with enumerations in Windows.Forms.
20615 * attribute.cs: Do only cast to string if it is a string, the
20616 validation happens later.
20618 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
20619 people upgrade their corlibs.
20621 * ecore.cs: Oops, enumerations were not following the entire code path
20623 2002-11-21 Miguel de Icaza <miguel@ximian.com>
20625 * typemanager.cs (FilterWithClosure): Commented out the test for
20626 1540 in typemanager.cs, as it has problems when accessing
20627 protected methods from a parent class (see test-174.cs).
20629 * attribute.cs (Attribute.ValidateGuid): new method.
20630 (Attribute.Resolve): Use above.
20632 2002-11-19 Miguel de Icaza <miguel@ximian.com>
20634 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
20636 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
20637 handling for enumerations, as we only needed the TypeContainer
20638 functionality to begin with (this is required for the fix below to
20639 work for enums that reference constants in a container class for
20642 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
20644 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
20645 a valid TypeBuilder to perform lookups on.o
20647 * class.cs (InheritableMemberSignatureCompare): Use true in the
20648 call to GetGetMethod and GetSetMethod, because we are comparing
20649 the signature, and we need to get the methods *even* if they are
20652 (PropertyBase.CheckBase): ditto.
20654 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
20655 GotoCase.Resolve): Use Peel on EmpytCasts.
20657 * ecore.cs (EmptyCast): drop child, add Peel method.
20659 2002-11-17 Martin Baulig <martin@ximian.com>
20661 * ecore.cs (EmptyCast.Child): New public property.
20663 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
20664 label resolved to an EmptyCast. Fixes #34162.
20665 (GotoCase.Resolve): Likewise.
20666 (Block.EmitMeta): Likewise.
20668 2002-11-17 Martin Baulig <martin@ximian.com>
20670 * expression.cs (Invocation.BetterConversion): Prefer int over
20671 uint; short over ushort; long over ulong for integer literals.
20672 Use ImplicitConversionExists instead of StandardConversionExists
20673 since we also need to check for user-defined implicit conversions.
20674 Fixes #34165. Added test-173.cs.
20676 2002-11-16 Martin Baulig <martin@ximian.com>
20678 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
20679 with the `true' and `false' literals. Fixes #33151.
20681 2002-11-16 Martin Baulig <martin@ximian.com>
20683 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
20684 October 22nd; don't do the cs1540 check for static members.
20686 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
20687 now using our own filter here and doing the cs1540 check again.
20689 2002-11-16 Martin Baulig <martin@ximian.com>
20691 * support.cs (InternalParameters): Don't crash if we don't have
20692 any fixed parameters. Fixes #33532.
20694 2002-11-16 Martin Baulig <martin@ximian.com>
20696 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
20697 when looking up static methods to make this work on Windows.
20700 2002-11-16 Martin Baulig <martin@ximian.com>
20702 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
20703 a setter rather than using PropertyInfo.CanWrite.
20705 2002-11-15 Nick Drochak <ndrochak@gol.com>
20707 * class.cs: Allow acces to block member by subclasses. Fixes build
20710 2002-11-14 Martin Baulig <martin@ximian.com>
20712 * class.cs (Constructor.Emit): Added the extern/block check.
20715 2002-11-14 Martin Baulig <martin@ximian.com>
20717 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
20718 iteration while looking for indexers, this is needed because the
20719 indexer may have a different name in our base classes. Fixed the
20720 error reporting (no indexers at all, not get accessor, no
20721 overloaded match). Fixes bug #33089.
20722 (IndexerAccess.DoResolveLValue): Likewise.
20724 2002-11-14 Martin Baulig <martin@ximian.com>
20726 * class.cs (PropertyBase.CheckBase): Make this work for multiple
20727 indexers. Fixes the first part of bug #33089.
20728 (MethodSignature.InheritableMemberSignatureCompare): Added support
20731 2002-11-13 Ravi Pratap <ravi@ximian.com>
20733 * attribute.cs (Attribute.Resolve): Catch the
20734 NullReferenceException and report it since it isn't supposed to
20737 2002-11-12 Miguel de Icaza <miguel@ximian.com>
20739 * expression.cs (Binary.EmitBranchable): Also handle the cases for
20740 LogicalOr and LogicalAnd that can benefit from recursively
20741 handling EmitBranchable. The code now should be nice for Paolo.
20743 2002-11-08 Miguel de Icaza <miguel@ximian.com>
20745 * typemanager.cs (LookupType): Added a negative-hit hashtable for
20746 the Type lookups, as we perform quite a number of lookups on
20747 non-Types. This can be removed once we can deterministically tell
20748 whether we have a type or a namespace in advance.
20750 But this might require special hacks from our corlib.
20754 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
20755 and double which avoids a conversion from an integer to a double.
20757 * expression.cs: tiny optimization, avoid calling IsConstant,
20758 because it effectively performs the lookup twice.
20760 2002-11-06 Miguel de Icaza <miguel@ximian.com>
20762 But a bogus return here to keep the semantics of the old code
20763 until the Mono runtime is fixed.
20765 * pending.cs (GetMissingInterfaces): New method used to remove all
20766 the interfaces that are already implemented by our parent
20767 classes from the list of pending methods.
20769 * interface.cs: Add checks for calls after ResolveTypeExpr.
20771 2002-11-05 Miguel de Icaza <miguel@ximian.com>
20773 * class.cs (Class.Emit): Report warning 67: event not used if the
20774 warning level is beyond 3.
20776 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
20777 being a NullLiteral.
20779 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
20782 * class.cs (TypeContainer.GetClassBases): Cover a missing code
20783 path that might fail if a type can not be resolved.
20785 * expression.cs (Binary.Emit): Emit unsigned versions of the
20788 * driver.cs: use error 5.
20790 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
20792 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
20794 2002-11-01 Miguel de Icaza <miguel@ximian.com>
20796 * cs-parser.jay (switch_section): A beautiful patch from Martin
20797 Baulig that fixed 33094.
20799 2002-10-31 Miguel de Icaza <miguel@ximian.com>
20801 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
20802 Check whether the base is abstract and report an error if so.
20804 * expression.cs (IndexerAccess.DoResolveLValue,
20805 IndexerAccess.DoResolve): ditto.
20807 (Invocation.DoResolve): ditto.
20809 (Invocation.FullMethodDesc): Improve the report string.
20811 * statement.cs (Block): Eliminate IsVariableDefined as it is
20812 basically just a wrapper for GetVariableInfo.
20814 * ecore.cs (SimpleName): Use new
20816 * support.cs (ReflectionParamter.ParameterType): We unwrap the
20817 type, as we return the actual parameter ref/unref state on a
20820 2002-10-30 Miguel de Icaza <miguel@ximian.com>
20822 * support.cs: Return proper flags REF/OUT fixing the previous
20825 * expression.cs: Reverted last patch, that was wrong. Is_ref is
20826 not used to mean `ref' but `ref or out' in ParameterReference
20828 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
20829 full type signature instead of calling TypeManger.CSharpName
20832 * support.cs (InternalParameters.ParameterDesc): Do not compare
20833 directly to the modflags, because REF/OUT will actually be bitsets
20836 * delegate.cs (VerifyMethod): Check also the modifiers.
20838 * cs-tokenizer.cs: Fix bug where floating point values with an
20839 exponent where a sign was missing was ignored.
20841 * driver.cs: Allow multiple assemblies to be specified in a single
20844 2002-10-28 Miguel de Icaza <miguel@ximian.com>
20846 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
20847 because identifiers after a parenthesis would end up in this kind
20848 of production, and we needed to desamiguate it for having casts
20851 (UserDefinedType *) xxx
20853 2002-10-24 Miguel de Icaza <miguel@ximian.com>
20855 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
20856 we should set on the Bindingflags.NonPublic, but not turn on
20857 private_ok. private_ok controls whether a Private member is
20858 returned (this is chekced on the filter routine), while the
20859 BindingFlags.NonPublic just controls whether private/protected
20860 will be allowed. This fixes the problem part of the problem of
20861 private properties being allowed to be used in derived classes.
20863 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
20864 so we can call the children DoResolveLValue method (this will
20865 properly signal errors on lvalue assignments to base properties)
20867 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
20868 getter are null, and we have a property info, we know that this
20869 happened because the lookup failed, so we report an error 122 for
20870 protection level violation.
20872 We also silently return if setter and getter are null in the
20873 resolve functions, this condition only happens if we have flagged
20874 the error before. This is the other half of the problem.
20876 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
20877 not have accessibility information, that is why we were returning
20878 true in the filter function in typemanager.cs.
20880 To properly report 122 (property is inaccessible because of its
20881 protection level) correctly, we report this error in ResolveAccess
20882 by failing if both the setter and the getter are lacking (ie, the
20885 DoResolve and DoLResolve have been modified to check for both
20886 setter/getter being null and returning silently, the reason being
20887 that I did not want to put the knowledge about this error in upper
20890 int old = Report.Errors;
20891 x = new PropertyExpr (...);
20892 if (old != Report.Errors)
20897 So the property expr is returned, but it is invalid, so the error
20898 will be flagged during the resolve process.
20900 * class.cs: Remove InheritablePropertySignatureCompare from the
20901 class, as we no longer depend on the property signature to compute
20902 whether it is possible to implement a method or not.
20904 The reason is that calling PropertyInfo.GetGetMethod will return
20905 null (in .NET, in Mono it works, and we should change this), in
20906 cases where the Get Method does not exist in that particular
20911 class X { public virtual int A { get { return 1; } } }
20913 class Z : Y { public override int A { get { return 2; } } }
20915 Would fail in Z because the parent (Y) would not have the property
20916 defined. So we avoid this completely now (because the alternative
20917 fix was ugly and slow), and we now depend exclusively on the
20920 (PropertyBase.CheckBase): Use a method-base mechanism to find our
20921 reference method, instead of using the property.
20923 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
20924 routines are gone now.
20926 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
20927 names, they were incorrectly named.
20929 * cs-tokenizer.cs: Return are more gentle token on failure.
20931 * pending.cs (PendingImplementation.InterfaceMethod): This routine
20932 had an out-of-sync index variable, which caused it to remove from
20933 the list of pending methods the wrong method sometimes.
20935 2002-10-22 Miguel de Icaza <miguel@ximian.com>
20937 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
20938 CanWrite, because those refer to this particular instance of the
20939 property, and do not take into account the fact that we can
20940 override single members of a property.
20942 Constructor requires an EmitContext. The resolution process does
20943 not happen here, but we need to compute the accessors before,
20944 because the resolution does not always happen for properties.
20946 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
20947 subclass, before we did not update this flag, but we did update
20950 (GetAccessors): Drop this routine, as it did not work in the
20951 presence of partially overwritten set/get methods.
20953 Notice that this broke the cs1540 detection, but that will require
20956 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20960 * driver.cs: issue a warning instead of an error if we don't support
20961 debugging for the platform. Also ignore a couple of errors that may
20962 arise when trying to write the symbols. Undo my previous patch.
20964 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20966 * driver.cs: ignore /debug switch except for Unix platforms.
20968 2002-10-23 Nick Drochak <ndrochak@gol.com>
20970 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
20972 2002-10-21 Miguel de Icaza <miguel@ximian.com>
20974 * driver.cs: Do not make mcs-debug conditional, so we do not break
20975 builds that use it.
20977 * statement.cs (UsageVector.MergeChildren): I would like Martin to
20978 review this patch. But basically after all the children variables
20979 have been merged, the value of "Breaks" was not being set to
20980 new_breaks for Switch blocks. I think that it should be set after
20981 it has executed. Currently I set this to the value of new_breaks,
20982 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
20983 conservative, but I do not understand this code very well.
20985 I did not break anything in the build, so that is good ;-)
20987 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
20989 2002-10-20 Mark Crichton <crichton@gimp.org>
20991 * cfold.cs: Fixed compile blocker. Really fixed it this time.
20993 2002-10-20 Nick Drochak <ndrochak@gol.com>
20995 * cfold.cs: Fixed compile blocker.
20997 2002-10-20 Miguel de Icaza <miguel@ximian.com>
20999 * driver.cs: I was chekcing the key, not the file.
21001 2002-10-19 Ravi Pratap <ravi@ximian.com>
21003 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21004 message that we were generating - we just need to silently return
21007 2002-10-19 Miguel de Icaza <miguel@ximian.com>
21009 * class.cs (Event.Define): Change my previous commit, as this
21010 breaks the debugger. This is a temporary hack, as it seems like
21011 the compiler is generating events incorrectly to begin with.
21013 * expression.cs (Binary.ResolveOperator): Added support for
21014 "U operator - (E x, E y)"
21016 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21019 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21020 init-only variables, but this path did not take into account that
21021 there might be also instance readonly variables. Correct this
21024 This fixes bug 32253
21026 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21029 * driver.cs: Change the extension for modules to `netmodule'
21031 * cs-parser.jay: Improved slightly the location tracking for
21032 the debugger symbols.
21034 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21035 modifiers that were specified instead of the hardcoded value
21036 (FamAndAssem). This was basically ignoring the static modifier,
21037 and others. Fixes 32429.
21039 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21040 fixed a bug in the process (32476)
21042 * expression.cs (ArrayAccess.EmitAssign): Patch from
21043 hwang_rob@yahoo.ca that fixes bug 31834.3
21045 2002-10-18 Miguel de Icaza <miguel@ximian.com>
21047 * driver.cs: Make the module extension .netmodule.
21049 2002-10-16 Miguel de Icaza <miguel@ximian.com>
21051 * driver.cs: Report an error if the resource file is not found
21052 instead of crashing.
21054 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21055 false, like Emit does.
21057 2002-10-16 Nick Drochak <ndrochak@gol.com>
21059 * typemanager.cs: Remove unused private member. Also reported mcs
21060 bug to report this as a warning like csc.
21062 2002-10-15 Martin Baulig <martin@gnome.org>
21064 * statement.cs (Statement.Emit): Made this a virtual method; emits
21065 the line number info and calls DoEmit().
21066 (Statement.DoEmit): New protected abstract method, formerly knows
21067 as Statement.Emit().
21069 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21071 2002-10-11 Miguel de Icaza <miguel@ximian.com>
21073 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21074 have fixed a remaining problem: not every AddXXXX was adding a
21075 fully qualified name.
21077 Now everyone registers a fully qualified name in the DeclSpace as
21078 being defined instead of the partial name.
21080 Downsides: we are slower than we need to be due to the excess
21081 copies and the names being registered this way.
21083 The reason for this is that we currently depend (on the corlib
21084 bootstrap for instance) that types are fully qualified, because
21085 we dump all the types in the namespace, and we should really have
21086 types inserted into the proper namespace, so we can only store the
21087 basenames in the defined_names array.
21089 2002-10-10 Martin Baulig <martin@gnome.org>
21091 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21092 from bug #31834, see the bug report for a testcase which is
21095 2002-10-10 Martin Baulig <martin@gnome.org>
21097 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21098 flow analysis code for this.
21100 * statement.cs (Do, While, For): Tell the flow analysis code about
21102 (FlowBranching.UsageVector): Added support for infinite loops.
21103 (Block.Resolve): Moved the dead code elimination here and use flow
21106 2002-10-09 Miguel de Icaza <miguel@ximian.com>
21108 * class.cs (Field.Define): Catch cycles on struct type
21111 * typemanager.cs (IsUnmanagedtype): Do not recursively check
21112 fields if the fields are static. We only need to check instance
21115 * expression.cs (As.DoResolve): Test for reference type.
21117 * statement.cs (Using.ResolveExpression): Use
21118 ConvertImplicitRequired, not ConvertImplicit which reports an
21120 (Using.ResolveLocalVariableDecls): ditto.
21122 * expression.cs (Binary.ResolveOperator): Report errors in a few
21123 places where we had to.
21125 * typemanager.cs (IsUnmanagedtype): Finish implementation.
21127 2002-10-08 Miguel de Icaza <miguel@ximian.com>
21129 * expression.cs: Use StoreFromPtr instead of extracting the type
21130 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
21132 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
21133 an enumeration value to a System.Enum, but System.Enum is not a
21134 value type, but an class type, so we need to box.
21136 (Expression.ConvertExplicit): One codepath could return
21137 errors but not flag them. Fix this. Fixes #31853
21139 * parameter.cs (Resolve): Do not allow void as a parameter type.
21141 2002-10-06 Martin Baulig <martin@gnome.org>
21143 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
21144 if it's a class type and not a struct. Fixes #31815.
21146 2002-10-06 Martin Baulig <martin@gnome.org>
21148 * statement.cs: Reworked the flow analysis code a bit to make it
21149 usable for dead code elimination.
21151 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21153 * cs-parser.jay: allow empty source files. Fixes bug #31781.
21155 2002-10-04 Miguel de Icaza <miguel@ximian.com>
21157 * expression.cs (ComposedCast.DoResolveType): A quick workaround
21158 to fix the test 165, will investigate deeper.
21160 2002-10-04 Martin Baulig <martin@gnome.org>
21162 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
21163 finally blocks actually work.
21164 (Try.Resolve): We don't need to create a sibling for `finally' if
21165 there is no finally block.
21167 2002-10-04 Martin Baulig <martin@gnome.org>
21169 * class.cs (Constructor.Define): The default accessibility for a
21170 non-default constructor is private, not public.
21172 2002-10-04 Miguel de Icaza <miguel@ximian.com>
21174 * class.cs (Constructor): Make AllowedModifiers public, add
21177 * cs-parser.jay: Perform the modifiers test here, as the
21178 constructor for the Constructor class usually receives a zero
21179 because of the way we create it (first we create, later we
21180 customize, and we were never checking the modifiers).
21182 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
21183 is a version of LookupTypeReflection that includes the type-name
21184 cache. This can be used as a fast path for functions that know
21185 the fully qualified name and are only calling into *.GetType() to
21186 obtain a composed type.
21188 This is also used by TypeManager.LookupType during its type
21191 (LookupType): We now also track the real type name, as sometimes
21192 we can get a quey for the real type name from things like
21193 ComposedCast. This fixes bug 31422.
21195 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
21196 complete type fullname, it does not have to go through the type
21197 resolution system to obtain the composed version of the type (for
21198 obtaining arrays or pointers).
21200 (Conditional.Emit): Use the EmitBoolExpression to
21201 generate nicer code, as requested by Paolo.
21203 (ArrayCreation.CheckIndices): Use the patch from
21204 hwang_rob@yahoo.ca to validate the array initializers.
21206 2002-10-03 Miguel de Icaza <miguel@ximian.com>
21208 * class.cs (ConstructorInitializer.Emit): simplify code by using
21209 Invocation.EmitCall, and at the same time, fix the bugs in calling
21210 parent constructors that took variable arguments.
21212 * ecore.cs (Expression.ConvertNumericExplicit,
21213 Expression.ImplicitNumericConversion): Remove the code that
21214 manually wrapped decimal (InternalTypeConstructor call is now gone
21217 * expression.cs (Cast.TryReduce): Also handle decimal types when
21218 trying to perform a constant fold on the type.
21220 * typemanager.cs (IsUnmanagedtype): Partially implemented.
21222 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
21223 that only turned off an error report, and did nothing else.
21225 2002-10-02 Miguel de Icaza <miguel@ximian.com>
21227 * driver.cs: Handle and ignore /fullpaths
21229 2002-10-01 Miguel de Icaza <miguel@ximian.com>
21231 * expression.cs (Binary.ResolveOperator): Catch the case where
21232 DoNumericPromotions returns true,
21234 (Binary.DoNumericPromotions): Simplify the code, and the tests.
21236 2002-09-27 Miguel de Icaza <miguel@ximian.com>
21238 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
21241 2002-09-26 Miguel de Icaza <miguel@ximian.com>
21243 * ecore.cs (ConvertNumericExplicit): It is not enough that the
21244 conversion exists, but it is also required that the conversion be
21245 performed. This manifested in "(Type64Enum) 2".
21247 * class.cs (TypeManager.AddMethod): The fix is not to change
21248 AddEnum, because that one was using a fully qualified name (every
21249 DeclSpace derivative does), but to change the AddMethod routine
21250 that was using an un-namespaced name. This now correctly reports
21251 the duplicated name.
21253 Revert patch until I can properly fix it. The issue
21254 is that we have a shared Type space across all namespaces
21255 currently, which is wrong.
21257 Options include making the Namespace a DeclSpace, and merge
21258 current_namespace/current_container in the parser.
21260 2002-09-25 Miguel de Icaza <miguel@ximian.com>
21262 * cs-parser.jay: Improve error reporting when we get a different
21263 kind of expression in local_variable_type and
21264 local_variable_pointer_type.
21266 Propagate this to avoid missleading errors being reported.
21268 * ecore.cs (ImplicitReferenceConversion): treat
21269 TypeManager.value_type as a target just like object_type. As
21274 Is valid, and needs to result in the int 1 being boxed before it
21275 is assigned to the value type v.
21277 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
21278 to validate the enumeration name.
21280 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
21281 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
21282 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
21284 * ecore.cs (TryImplicitIntConversion): When doing an
21285 implicit-enumeration-conversion, check if the type is 64-bits and
21286 perform a conversion before passing to EnumConstant.
21288 2002-09-23 Miguel de Icaza <miguel@ximian.com>
21290 * decl.cs (Error_AmbiguousTypeReference); New routine used to
21291 report ambiguous type references. Unlike the MS version, we
21292 report what the ambiguity is. Innovation at work ;-)
21294 (DeclSpace.FindType): Require a location argument to
21295 display when we display an ambiguous error.
21297 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
21299 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
21301 * expression.cs (EmitDynamicInitializers): Apply patch from
21302 hwang_rob@yahoo.ca that fixes the order in which we emit our
21305 2002-09-21 Martin Baulig <martin@gnome.org>
21307 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
21308 delegate takes no arguments.
21310 2002-09-20 Miguel de Icaza <miguel@ximian.com>
21312 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
21315 * expression.cs: Extract the underlying type.
21317 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
21319 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
21321 2002-09-19 Miguel de Icaza <miguel@ximian.com>
21323 * class.cs (TypeContainer.DefineType): We can not use the nice
21324 PackingSize with the size set to 1 DefineType method, because it
21325 will not allow us to define the interfaces that the struct
21328 This completes the fixing of bug 27287
21330 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
21331 means also structs. This fixes part of the problem.
21332 (Expresion.ImplicitReferenceConversionExists): ditto.
21334 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
21335 error if there were no errors reported during the type lookup
21336 process, to avoid duplicates or redundant errors. Without this
21337 you would get an ambiguous errors plus a type not found. We have
21338 beaten the user enough with the first error.
21340 (DeclSparce.FindType): Emit a warning if we have an ambiguous
21343 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
21344 during the resolution process, stop the lookup, this avoids
21345 repeated error reports (same error twice).
21347 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
21349 * typemanager.cs (LookupType): Redo the type lookup code to match
21350 the needs of System.Reflection.
21352 The issue is that System.Reflection requires references to nested
21353 types to begin with a "+" sign instead of a dot. So toplevel
21354 types look like: "NameSpace.TopLevelClass", and nested ones look
21355 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
21358 2002-09-19 Martin Baulig <martin@gnome.org>
21360 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
21361 says that a method always returns or always throws an exception,
21362 don't report the CS0161.
21364 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
21365 set `Returns = new_returns'.
21367 2002-09-19 Martin Baulig <martin@gnome.org>
21369 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
21370 to an enum constant, check for a CS0176.
21372 2002-09-18 Miguel de Icaza <miguel@ximian.com>
21374 * class.cs (TypeContainer.CheckPairedOperators): Now we check
21375 for operators that must be in pairs and report errors.
21377 * ecore.cs (SimpleName.DoResolveType): During the initial type
21378 resolution process, when we define types recursively, we must
21379 check first for types in our current scope before we perform
21380 lookups in the enclosing scopes.
21382 * expression.cs (MakeByteBlob): Handle Decimal blobs.
21384 (Invocation.VerifyArgumentsCompat): Call
21385 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
21386 I thought we were supposed to always call this, but there are a
21387 few places in the code where we dont do it.
21389 2002-09-17 Miguel de Icaza <miguel@ximian.com>
21391 * driver.cs: Add support in -linkres and -resource to specify the
21392 name of the identifier.
21394 2002-09-16 Miguel de Icaza <miguel@ximian.com>
21396 * ecore.cs (StandardConversionExists): Sync with the conversion
21397 code: allow anything-* to void* conversions.
21399 (FindMostSpecificSource): Use an Expression argument
21400 instead of a Type, because we might be handed over a Literal which
21401 gets a few more implicit conversions that plain types do not. So
21402 this information was being lost.
21404 Also, we drop the temporary type-holder expression when not
21407 2002-09-17 Martin Baulig <martin@gnome.org>
21409 * class.cs (PropertyBase.CheckBase): Don't check the base class if
21410 this is an explicit interface implementation.
21412 2002-09-17 Martin Baulig <martin@gnome.org>
21414 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
21415 different `IndexerName' attributes.
21417 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
21418 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
21419 virtual CommonResolve().
21421 2002-09-16 Miguel de Icaza <miguel@ximian.com>
21423 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
21424 and convert that to the UnderlyingType.
21426 * statement.cs (Foreach.Resolve): Indexers are just like variables
21427 or PropertyAccesses.
21429 * cs-tokenizer.cs (consume_string): Track line numbers and columns
21430 inside quoted strings, we were not doing this before.
21432 2002-09-16 Martin Baulig <martin@gnome.org>
21434 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
21435 resolve it. This is needed for the definite assignment check of the
21436 instance expression, fixes bug #29846.
21437 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
21439 2002-09-16 Nick Drochak <ndrochak@gol.com>
21441 * parameter.cs: Fix compile error. Cannot reference static member
21442 from an instance object. Is this an mcs bug?
21444 2002-09-14 Martin Baulig <martin@gnome.org>
21446 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
21447 multiple times. Fixes bug #30295, added test-166.cs.
21449 2002-09-14 Martin Baulig <martin@gnome.org>
21451 * statement.cs (Block.Emit): Don't emit unreachable code.
21452 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
21453 `break' statements.
21454 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
21456 2002-09-14 Martin Baulig <martin@gnome.org>
21458 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
21461 2002-09-14 Martin Baulig <martin@gnome.org>
21463 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
21464 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
21465 be false on the ms runtime.
21467 2002-09-13 Martin Baulig <martin@gnome.org>
21469 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
21470 the CS0038 error message.
21472 2002-09-12 Miguel de Icaza <miguel@ximian.com>
21474 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
21475 constant inside, return it.
21477 2002-09-12 Martin Baulig <martin@gnome.org>
21479 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
21480 implicit conversion can be done between enum types.
21482 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
21483 check whether an implicit conversion to the current enum's UnderlyingType
21484 exists and report an error if not.
21486 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
21487 without debugging support.
21489 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
21490 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
21492 2002-09-12 Martin Baulig <martin@gnome.org>
21494 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
21496 * ecore.cs (IMemberExpr.DeclaringType): New property.
21497 (SimpleName.SimpleNameResolve): Check whether we're accessing a
21498 nonstatic member of an outer type (CS0038).
21500 2002-09-11 Miguel de Icaza <miguel@ximian.com>
21502 * driver.cs: Activate the using-error detector at warning level
21503 4 (at least for MS-compatible APIs).
21505 * namespace.cs (VerifyUsing): Small buglett fix.
21507 * pending.cs (PendingImplementation): pass the container pointer.
21509 * interface.cs (GetMethods): Allow for recursive definition. Long
21510 term, I would like to move every type to support recursive
21511 definitions, not the current ordering mechanism that we have right
21514 The situation is this: Attributes are handled before interfaces,
21515 so we can apply attributes to interfaces. But some attributes
21516 implement interfaces, we will now handle the simple cases
21517 (recursive definitions will just get an error).
21519 * parameter.cs: Only invalidate types at the end if we fail to
21522 2002-09-09 Martin Baulig <martin@gnome.org>
21524 * ecore.cs (PropertyExpr.Emit): Also check for
21525 TypeManager.system_int_array_get_length so this'll also work when
21526 compiling corlib. Fixes #30003.
21528 2002-09-09 Martin Baulig <martin@gnome.org>
21530 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
21531 and throw an exception if we can't get the type's size. Fixed #30040,
21534 2002-09-09 Martin Baulig <martin@gnome.org>
21536 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
21538 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
21539 context. Fixes bug #30027.
21541 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
21542 virtual functions. Fixes bug #30043, added test-164.cs.
21544 2002-09-08 Ravi Pratap <ravi@ximian.com>
21546 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
21548 2002-09-08 Nick Drochak <ndrochak@gol.com>
21550 * driver.cs: Use an object to get the windows codepage since it's not a
21553 2002-09-08 Miguel de Icaza <miguel@ximian.com>
21555 * statement.cs (For.Emit): for infinite loops (test == null)
21556 return whether there is a break inside, not always "true".
21558 * namespace.cs (UsingEntry): New struct to hold the name of the
21559 using definition, the location where it is defined, and whether it
21560 has been used in a successful type lookup.
21562 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
21567 2002-09-06 Ravi Pratap <ravi@ximian.com>
21569 * attribute.cs : Fix incorrect code which relied on catching
21570 a NullReferenceException to detect a null being passed in
21571 where an object was expected.
21573 2002-09-06 Miguel de Icaza <miguel@ximian.com>
21575 * statement.cs (Try): flag the catch variable as assigned
21577 * expression.cs (Cast): Simplified by using ResolveType instead of
21578 manually resolving.
21580 * statement.cs (Catch): Fix bug by using ResolveType.
21582 2002-09-06 Ravi Pratap <ravi@ximian.com>
21584 * expression.cs (BetterConversion): Special case for when we have
21585 a NullLiteral as the argument and we have to choose between string
21586 and object types - we choose string the way csc does.
21588 * attribute.cs (Attribute.Resolve): Catch the
21589 NullReferenceException and report error #182 since the Mono
21590 runtime no more has the bug and having this exception raised means
21591 we tried to select a constructor which takes an object and is
21594 2002-09-05 Ravi Pratap <ravi@ximian.com>
21596 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
21597 message (1502, 1503) when we can't locate a method after overload
21598 resolution. This is much more informative and closes the bug
21601 * interface.cs (PopulateMethod): Return if there are no argument
21602 types. Fixes a NullReferenceException bug.
21604 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
21605 expressions too. Previously we were checking only in one place for
21606 positional arguments leaving out named arguments.
21608 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
21609 type to the enum type is not allowed. Remove code corresponding to
21612 (ConvertNumericExplicit): Allow explicit conversions from
21613 the underlying type to enum type. This precisely follows the spec
21614 and closes a bug filed by Gonzalo.
21616 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21619 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
21621 2002-09-03 Miguel de Icaza <miguel@ximian.com>
21623 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
21624 it was important that we stored the right value after the
21625 reduction in `converted'.
21627 2002-09-04 Martin Baulig <martin@gnome.org>
21629 * location.cs (Location.SymbolDocument): Use full pathnames for the
21632 2002-08-30 Miguel de Icaza <miguel@ximian.com>
21634 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
21635 of the expression resolve mechanism, because that will catch the
21636 SimpleName error failures.
21638 (Conditional): If we can not resolve the
21639 expression, return, do not crash.
21641 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21644 (location): display token name instead of its number.
21646 2002-08-28 Martin Baulig <martin@gnome.org>
21648 * expression.cs (Binary.ResolveOperator): Don't silently return
21649 but return an error if an operator cannot be applied between two
21652 2002-08-28 Martin Baulig <martin@gnome.org>
21654 * class.cs (Constructor.Define): Set the permission attributes
21655 correctly instead of making all constructors public.
21657 2002-08-28 Martin Baulig <martin@gnome.org>
21659 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
21660 for private members before reporting a CS0103; if we find anything,
21663 2002-08-28 Martin Baulig <martin@gnome.org>
21665 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
21666 to check whether `closure_start_type == closure_invocation_type',
21667 we also need to check whether `m.DeclaringType == closure_invocation_type'
21668 before bypassing the permission checks. We might be accessing
21669 protected/private members from the base class.
21670 (TypeManager.RealMemberLookup): Only set private_ok if private
21671 members were requested via BindingFlags.NonPublic.
21673 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
21675 * expression.cs (MemberAccess.ResolveMemberAccess): Set
21676 MethodGroupExpr.IsExplicitImpl if appropriate.
21677 (Invocation.DoResolve): Don't report the CS0120 for explicit
21678 interface implementations.
21680 2002-08-27 Martin Baulig <martin@gnome.org>
21682 * expression.cs (Invocation.DoResolve): If this is a static
21683 method and we don't have an InstanceExpression, we must report
21686 2002-08-25 Martin Baulig <martin@gnome.org>
21688 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
21689 `==' between a valuetype and an object.
21691 2002-08-25 Miguel de Icaza <miguel@ximian.com>
21693 * ecore.cs (TypeExpr): Provide a ToString method.
21695 2002-08-24 Martin Baulig <martin@gnome.org>
21697 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
21698 now called proggie.dbg and it's a binary file.
21700 2002-08-23 Martin Baulig <martin@gnome.org>
21702 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
21704 2002-08-23 Martin Baulig <martin@gnome.org>
21706 * struct.cs (MyStructInfo.ctor): Make this work with empty
21707 structs; it's not allowed to use foreach() on null.
21709 2002-08-23 Martin Baulig <martin@gnome.org>
21711 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
21712 writer the full pathname of the generated assembly.
21714 2002-08-23 Martin Baulig <martin@gnome.org>
21716 * statements.cs (FlowBranching.UsageVector.MergeChildren):
21717 A `finally' block never returns or breaks; improved handling of
21720 2002-08-23 Martin Baulig <martin@gnome.org>
21722 * statement.cs (Throw.Resolve): Allow `throw null'.
21724 2002-08-23 Martin Baulig <martin@gnome.org>
21726 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
21727 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
21728 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
21729 MemberLookup would return a wrong event if this is an explicit
21730 interface implementation and the class has an event with the same
21733 2002-08-23 Martin Baulig <martin@gnome.org>
21735 * statement.cs (Block.AddChildVariableNames): New public method.
21736 (Block.AddChildVariableName): Likewise.
21737 (Block.IsVariableNameUsedInChildBlock): Likewise.
21738 (Block.AddVariable): Check whether a variable name has already
21739 been used in a child block.
21741 * cs-parser.jay (declare_local_variables): Mark all variable names
21742 from the current block as being used in a child block in the
21745 2002-08-23 Martin Baulig <martin@gnome.org>
21747 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
21748 find the symbol writer.
21750 * driver.cs: csc also allows the arguments to /define being
21751 separated by commas, not only by semicolons.
21753 2002-08-23 Martin Baulig <martin@gnome.org>
21755 * interface.cs (Interface.GetMembers): Added static check for events.
21757 2002-08-15 Martin Baulig <martin@gnome.org>
21759 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
21760 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
21762 * ecore.cs (Expression.MemberLookup): Added documentation and explained
21763 why the MethodData.EmitDestructor() change was necessary.
21765 2002-08-20 Martin Baulig <martin@gnome.org>
21767 * class.cs (TypeContainer.FindMembers): Added static check for events.
21769 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
21771 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
21772 use Type.GetEvents(), not Type.FindMembers().
21774 2002-08-20 Martin Baulig <martin@gnome.org>
21776 * decl.cs (MemberCache): Added a special method cache which will
21777 be used for method-only searched. This ensures that a method
21778 search will return a MethodInfo with the correct ReflectedType for
21781 2002-08-20 Martin Baulig <martin@gnome.org>
21783 * decl.cs (DeclSpace.FindMembers): Made this public.
21785 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21787 * delegate.cs: fixed build on windows.
21788 [FIXME: Filed as bug #29150: MCS must report these errors.]
21790 2002-08-19 Ravi Pratap <ravi@ximian.com>
21792 * ecore.cs (StandardConversionExists): Return a false
21793 if we are trying to convert the void type to anything else
21794 since that is not allowed.
21796 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
21797 we flag error 70 in the event an event is trying to be accessed
21798 directly from outside the declaring type.
21800 2002-08-20 Martin Baulig <martin@gnome.org>
21802 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
21803 MemberCache from typemanager.cs to decl.cs.
21805 2002-08-19 Martin Baulig <martin@gnome.org>
21807 * class.cs (TypeContainer): Implement IMemberContainer.
21808 (TypeContainer.DefineMembers): Create the MemberCache.
21809 (TypeContainer.FindMembers): Do better BindingFlags checking; only
21810 return public members if BindingFlags.Public was given, check
21811 whether members are static.
21813 2002-08-16 Martin Baulig <martin@gnome.org>
21815 * decl.cs (DeclSpace.Define): Splitted this in Define and
21816 DefineMembers. DefineMembers is called first and initializes the
21819 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
21820 DefineMembers() on all our DeclSpaces.
21822 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
21823 but call DefineMembers() on all nested interfaces. We call their
21824 Define() in our new Define() function.
21826 * interface.cs (Interface): Implement IMemberContainer.
21827 (Interface.Define): Moved all code except the attribute stuf to
21829 (Interface.DefineMembers): Initialize the member cache.
21831 * typemanager.cs (IMemberFinder): Removed this interface, we don't
21832 need this anymore since we can use MemberCache.FindMembers directly.
21834 2002-08-19 Martin Baulig <martin@gnome.org>
21836 * typemanager.cs (MemberCache): When creating the cache for an
21837 interface type, add all inherited members.
21838 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
21839 to `out bool used_cache' and documented it.
21840 (TypeManager.MemberLookup): If we already used the cache in the first
21841 iteration, we don't need to do the interfaces check.
21843 2002-08-19 Martin Baulig <martin@gnome.org>
21845 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
21846 here from IMemberFinder and don't implement this interface anymore.
21847 (DeclSpace.MemberCache): Moved here from IMemberFinder.
21849 * typemanager.cs (IMemberFinder): This interface is now only used by
21850 classes which actually support the member cache.
21851 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
21852 since we only put DeclSpaces into this Hashtable.
21853 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
21854 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
21856 2002-08-16 Martin Baulig <martin@gnome.org>
21858 * typemanager.cs (ICachingMemberFinder): Removed.
21859 (IMemberFinder.MemberCache): New property.
21860 (TypeManager.FindMembers): Merged this with RealFindMembers().
21861 This function will never be called from TypeManager.MemberLookup()
21862 so we can't use the cache here, just the IMemberFinder.
21863 (TypeManager.MemberLookup_FindMembers): Check whether the
21864 IMemberFinder has a MemberCache and call the cache's FindMembers
21866 (MemberCache): Rewrote larger parts of this yet another time and
21867 cleaned it up a bit.
21869 2002-08-15 Miguel de Icaza <miguel@ximian.com>
21871 * driver.cs (LoadArgs): Support quoting.
21873 (Usage): Show the CSC-like command line arguments.
21875 Improved a few error messages.
21877 2002-08-15 Martin Baulig <martin@gnome.org>
21879 * typemanager.cs (IMemberContainer.Type): New property.
21880 (IMemberContainer.IsInterface): New property.
21882 The following changes are conditional to BROKEN_RUNTIME, which is
21883 defined at the top of the file.
21885 * typemanager.cs (MemberCache.MemberCache): Don't add the base
21886 class'es members, but add all members from TypeHandle.ObjectType
21887 if we're an interface.
21888 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
21889 is the current type.
21890 (MemberCache.CacheEntry.Container): Removed this field.
21891 (TypeHandle.GetMembers): Include inherited members.
21893 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21895 * typemanager.cs: fixed compilation and added a comment on a field that
21898 2002-08-15 Martin Baulig <martin@gnome.org>
21900 * class.cs (ConstructorInitializer.Resolve): In the
21901 Expression.MemberLookup call, use the queried_type as
21904 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
21905 declared' attribute, it's always true.
21906 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
21907 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
21908 temporary wrapper for FindMembers which tells MemberLookup whether
21909 members from the base classes are included in the return value.
21910 This will go away soon.
21911 (TypeManager.MemberLookup): Use this temporary hack here; once the
21912 new MemberCache is completed, we don't need to do the DeclaredOnly
21913 looping here anymore since the MemberCache will take care of this.
21914 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
21915 (MemberCache): When creating the MemberCache for a class, get
21916 members from the current class and all its base classes.
21917 (MemberCache.CacheEntry.Container): New field. This is a
21918 temporary hack until the Mono runtime is fixed to distinguish
21919 between ReflectedType and DeclaringType. It allows us to use MCS
21920 with both the MS runtime and the unfixed Mono runtime without
21921 problems and without accecting performance.
21922 (MemberCache.SearchMembers): The DeclaredOnly looping from
21923 TypeManager.MemberLookup is now done here.
21925 2002-08-14 Martin Baulig <martin@gnome.org>
21927 * statement.cs (MyStructInfo.MyStructInfo): Don't call
21928 Type.GetFields on dynamic types but get the fields from the
21929 corresponding TypeContainer.
21930 (MyStructInfo.GetStructInfo): Added check for enum types.
21932 * typemanager.cs (MemberList.IsSynchronized): Implemented.
21933 (MemberList.SyncRoot): Implemented.
21934 (TypeManager.FilterWithClosure): No need to check permissions if
21935 closure_start_type == closure_invocation_type, don't crash if
21936 closure_invocation_type is null.
21938 2002-08-13 Martin Baulig <martin@gnome.org>
21940 Rewrote TypeContainer.FindMembers to use a member cache. This
21941 gives us a speed increase of about 35% for the self-hosting MCS
21942 build and of about 15-20% for the class libs (both on GNU/Linux).
21944 * report.cs (Timer): New class to get enhanced profiling. This
21945 whole class is "TIMER" conditional since it remarkably slows down
21948 * class.cs (MemberList): New class. This is an IList wrapper
21949 which we're now using instead of passing MemberInfo[]'s around to
21950 avoid copying this array unnecessarily.
21951 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
21952 (ICachingMemberFinder, IMemberContainer): New interface.
21953 (TypeManager.FilterWithClosure): If `criteria' is null, the name
21954 has already been checked, otherwise use it for the name comparision.
21955 (TypeManager.FindMembers): Renamed to RealMemberFinder and
21956 provided wrapper which tries to use ICachingMemberFinder.FindMembers
21957 if possible. Returns a MemberList, not a MemberInfo [].
21958 (TypeHandle): New class, implements IMemberContainer. We create
21959 one instance of this class per type, it contains a MemberCache
21960 which is used to do the member lookups.
21961 (MemberCache): New class. Each instance of this class contains
21962 all members of a type and a name-based hash table.
21963 (MemberCache.FindMembers): This is our new member lookup
21964 function. First, it looks up all members of the requested name in
21965 the hash table. Then, it walks this list and sorts out all
21966 applicable members and returns them.
21968 2002-08-13 Martin Baulig <martin@gnome.org>
21970 In addition to a nice code cleanup, this gives us a performance
21971 increase of about 1.4% on GNU/Linux - not much, but it's already
21972 half a second for the self-hosting MCS compilation.
21974 * typemanager.cs (IMemberFinder): New interface. It is used by
21975 TypeManager.FindMembers to call FindMembers on a TypeContainer,
21976 Enum, Delegate or Interface.
21977 (TypeManager.finder_to_member_finder): New PtrHashtable.
21978 (TypeManager.finder_to_container): Removed.
21979 (TypeManager.finder_to_delegate): Removed.
21980 (TypeManager.finder_to_interface): Removed.
21981 (TypeManager.finder_to_enum): Removed.
21983 * interface.cs (Interface): Implement IMemberFinder.
21985 * delegate.cs (Delegate): Implement IMemberFinder.
21987 * enum.cs (Enum): Implement IMemberFinder.
21989 * class.cs (TypeContainer): Implement IMemberFinder.
21991 2002-08-12 Martin Baulig <martin@gnome.org>
21993 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
21995 2002-08-12 Martin Baulig <martin@gnome.org>
21997 * ecore.cs (ITypeExpression): New interface for expressions which
21999 (TypeExpression): Renamed to TypeLookupExpression.
22000 (Expression.DoResolve): If we're doing a types-only lookup, the
22001 expression must implement the ITypeExpression interface and we
22002 call DoResolveType() on it.
22003 (SimpleName): Implement the new ITypeExpression interface.
22004 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22005 hack, the situation that we're only looking up types can't happen
22006 anymore when this method is called. Moved the type lookup code to
22007 DoResolveType() and call it.
22008 (SimpleName.DoResolveType): This ITypeExpression interface method
22009 is now doing the types-only lookup.
22010 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22011 (ResolveFlags): Added MaskExprClass.
22013 * expression.cs (MemberAccess): Implement the ITypeExpression
22015 (MemberAccess.DoResolve): Added support for a types-only lookup
22016 when we're called via ITypeExpression.DoResolveType().
22017 (ComposedCast): Implement the ITypeExpression interface.
22019 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
22020 Expression.Resolve() with ResolveFlags.Type instead.
22022 2002-08-12 Martin Baulig <martin@gnome.org>
22024 * interface.cs (Interface.Define): Apply attributes.
22026 * attribute.cs (Attribute.ApplyAttributes): Added support for
22027 interface attributes.
22029 2002-08-11 Martin Baulig <martin@gnome.org>
22031 * statement.cs (Block.Emit): Only check the "this" variable if we
22032 do not always throw an exception.
22034 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22035 whether the property has a set accessor.
22037 2002-08-11 Martin Baulig <martin@gnome.org>
22039 Added control flow analysis support for structs.
22041 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22042 with control flow analysis turned off.
22043 (IVariable): New interface.
22044 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22045 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22046 (FieldExpr.DoResolve): Resolve the instance expression with flow
22047 analysis turned off and do the definite assignment check after the
22048 resolving when we know what the expression will resolve to.
22050 * expression.cs (LocalVariableReference, ParameterReference):
22051 Implement the new IVariable interface, only call the flow analysis
22052 code if ec.DoFlowAnalysis is true.
22053 (This): Added constructor which takes a Block argument. Implement
22054 the new IVariable interface.
22055 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22056 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22057 This does the definite assignment checks for struct members.
22059 * class.cs (Constructor.Emit): If this is a non-static `struct'
22060 constructor which doesn't have any initializer, call
22061 Block.AddThisVariable() to tell the flow analysis code that all
22062 struct elements must be initialized before control returns from
22065 * statement.cs (MyStructInfo): New public class.
22066 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22067 argument to this indexer. If non-zero, check an individual struct
22068 member, not the whole struct.
22069 (FlowBranching.CheckOutParameters): Check struct members.
22070 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22071 overloaded versions of these methods which take an additional
22072 `int field_idx' argument to check struct members.
22073 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22074 overloaded versions of these methods which take an additional
22075 `string field_name' argument to check struct member.s
22076 (VariableInfo): Implement the IVariable interface.
22077 (VariableInfo.StructInfo): New public property. Returns the
22078 MyStructInfo instance of the variable if it's a struct or null.
22079 (Block.AddThisVariable): New public method. This is called from
22080 Constructor.Emit() for non-static `struct' constructor which do
22081 not have any initializer. It creates a special variable for the
22082 "this" instance variable which will be checked by the flow
22083 analysis code to ensure that all of the struct's fields are
22084 initialized before control returns from the constructor.
22085 (UsageVector): Added support for struct members. If a
22086 variable/parameter is a struct with N members, we reserve a slot
22087 in the usage vector for each member. A struct is considered fully
22088 initialized if either the struct itself (slot 0) or all its
22089 members are initialized.
22091 2002-08-08 Martin Baulig <martin@gnome.org>
22093 * driver.cs (Driver.MainDriver): Only report an error CS5001
22094 if there were no compilation errors.
22096 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22097 `UnsafeContext' property to determine whether the parent is in
22098 unsafe context rather than checking the parent's ModFlags:
22099 classes nested in an unsafe class are unsafe as well.
22101 2002-08-08 Martin Baulig <martin@gnome.org>
22103 * statement.cs (UsageVector.MergeChildren): Distinguish between
22104 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22105 we return. Added test17() and test18() to test-154.cs.
22107 2002-08-08 Martin Baulig <martin@gnome.org>
22109 * typemanager.cs (TypeManager.FilterWithClosure): If we have
22110 Family access, make sure the invoking type isn't a subclass of the
22111 queried type (that'd be a CS1540).
22113 * ecore.cs (Expression.MemberLookup): Added overloaded version of
22114 this method which takes an additional `Type invocation_type'.
22116 * expression.cs (BaseAccess.DoResolve): Use the base type as
22117 invocation and query type.
22118 (MemberAccess.DoResolve): If the lookup failed and we're about to
22119 report a CS0122, try a lookup with the ec.ContainerType - if this
22120 succeeds, we must report a CS1540.
22122 2002-08-08 Martin Baulig <martin@gnome.org>
22124 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22125 (MethodGroupExpr): Implement the IMemberExpr interface.
22127 * expression (MemberAccess.ResolveMemberAccess): No need to have
22128 any special code for MethodGroupExprs anymore, they're now
22131 2002-08-08 Martin Baulig <martin@gnome.org>
22133 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
22134 Family, FamANDAssem and FamORAssem permissions.
22135 (TypeManager.IsSubclassOrNestedChildOf): New public method.
22137 2002-08-08 Martin Baulig <martin@gnome.org>
22139 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
22140 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
22143 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
22145 * driver.cs: implemented /resource option to embed managed resources.
22147 2002-08-07 Martin Baulig <martin@gnome.org>
22149 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
22150 (FieldBase.HasFieldInitializer): New public property.
22151 (FieldBase.GetInitializerExpression): New public method. Resolves and
22152 returns the field initializer and makes sure it is only resolved once.
22153 (TypeContainer.EmitFieldInitializers): Call
22154 FieldBase.GetInitializerExpression to get the initializer, this ensures
22155 that it isn't resolved multiple times.
22157 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
22158 the resolving process (SimpleName/MemberLookup) that we're currently
22159 emitting a field initializer (which must not access any instance members,
22160 this is an error CS0236).
22162 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
22163 argument, if the `IsFieldInitializer' flag is set, we must report and
22164 error CS0236 and not an error CS0120.
22166 2002-08-07 Martin Baulig <martin@gnome.org>
22168 * ecore.cs (IMemberExpr): New public interface.
22169 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
22170 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
22171 if the expression is an IMemberExpr.
22173 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
22174 to be null, implicitly default to `this' if we're non-static in
22175 this case. Simplified the code a lot by using the new IMemberExpr
22176 interface. Also fixed bug #28176 here.
22178 2002-08-06 Martin Baulig <martin@gnome.org>
22180 * cs-parser.jay (SimpleLookup): Removed. We need to create
22181 ParameterReferences during semantic analysis so that we can do a
22182 type-only search when resolving Cast, TypeOf and SizeOf.
22183 (block): Pass the `current_local_parameters' to the Block's
22186 * class.cs (ConstructorInitializer): Added `Parameters parameters'
22187 argument to the constructor.
22188 (ConstructorInitializer.Resolve): Create a temporary implicit
22189 block with the parameters.
22191 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
22192 references here if we aren't doing a type-only search.
22194 * statement.cs (Block): Added constructor which takes a
22195 `Parameters parameters' argument.
22196 (Block.Parameters): New public property.
22198 * support.cs (InternalParameters.Parameters): Renamed `parameters'
22199 to `Parameters' and made it public readonly.
22201 2002-08-06 Martin Baulig <martin@gnome.org>
22203 * ecore.cs (Expression.Warning): Made this public as well.
22205 * report.cs (Report.Debug): Print the contents of collections.
22207 2002-08-06 Martin Baulig <martin@gnome.org>
22209 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
22210 used to tell Resolve() which kinds of expressions it may return.
22211 (Expression.Resolve): Added overloaded version of this method which
22212 takes a `ResolveFlags flags' argument. This can be used to tell
22213 Resolve() which kinds of expressions it may return. Reports a
22215 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
22216 ResolveFlags.SimpleName.
22217 (Expression.Error118): Added overloaded version of this method which
22218 takes a `ResolveFlags flags' argument. It uses the flags to determine
22219 which kinds of expressions are allowed.
22221 * expression.cs (Argument.ResolveMethodGroup): New public method.
22222 Resolves an argument, but allows a MethodGroup to be returned.
22223 This is used when invoking a delegate.
22225 * TODO: Updated a bit.
22227 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22229 Fixed compilation with csc.
22231 * ecore.cs: Expression.Error made public. Is this correct? Should
22232 Warning be made public too?
22234 * expression.cs: use ea.Location instead of ea.loc.
22235 [FIXME: Filed as bug #28607: MCS must report these errors.]
22237 2002-08-06 Martin Baulig <martin@gnome.org>
22239 * ecore.cs (Expression.loc): Moved the location here instead of
22240 duplicating it in all derived classes.
22241 (Expression.Location): New public property.
22242 (Expression.Error, Expression.Warning): Made them non-static and
22243 removed the location argument.
22244 (Expression.Warning): Added overloaded version which takes an
22245 `int level' argument.
22246 (Expression.Error118): Make this non-static and removed the
22247 expression and location arguments.
22248 (TypeExpr): Added location argument to the constructor.
22250 * expression.cs (StaticCallExpr): Added location argument to
22252 (Indirection, PointerArithmetic): Likewise.
22253 (CheckedExpr, UnCheckedExpr): Likewise.
22254 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
22255 (StringPtr): Likewise.
22258 2002-08-05 Martin Baulig <martin@gnome.org>
22260 * expression.cs (BaseAccess.DoResolve): Actually report errors.
22262 * assign.cs (Assign.DoResolve): Check whether the source
22263 expression is a value or variable.
22265 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
22266 while resolving the corresponding blocks.
22268 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
22269 an error, don't silently return null.
22271 * statement.cs (Block.AddVariable): Do the error reporting here
22272 and distinguish between CS0128 and CS0136.
22273 (Block.DoResolve): Report all unused labels (warning CS0164).
22274 (LabeledStatement): Pass the location to the constructor.
22275 (LabeledStatement.HasBeenReferenced): New property.
22276 (LabeledStatement.Resolve): Set it to true here.
22278 * statement.cs (Return.Emit): Return success even after reporting
22279 a type mismatch error (CS0126 or CS0127), this is what csc does and
22280 it avoids confusing the users with any consecutive errors.
22282 2002-08-05 Martin Baulig <martin@gnome.org>
22284 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
22286 * const.cs (Const.LookupConstantValue): Catch circular definitions.
22288 * expression.cs (MemberAccess.DoResolve): Silently return if an
22289 error has already been reported.
22291 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
22292 error has already been reported.
22294 2002-08-05 Martin Baulig <martin@gnome.org>
22296 * statement.cs (UsageVector): Only initialize the `parameters'
22297 vector if we actually have any "out" parameters.
22299 2002-08-05 Martin Baulig <martin@gnome.org>
22301 * expression.cs (Binary.ResolveOperator): When combining delegates,
22302 they must have the same type.
22304 2002-08-05 Martin Baulig <martin@gnome.org>
22306 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
22307 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
22308 work with the ms runtime and we also don't need it: if we're a
22309 PropertyBuilder and not in the `indexer_arguments' hash, then we
22310 are a property and not an indexer.
22312 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
22313 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
22314 since the latter one doesn't work with the ms runtime.
22316 2002-08-03 Martin Baulig <martin@gnome.org>
22318 Fixed bugs #27998 and #22735.
22320 * class.cs (Method.IsOperator): New public field.
22321 (Method.CheckBase): Report CS0111 if there's already a method
22322 with the same parameters in the current class. Report CS0508 when
22323 attempting to change the return type of an inherited method.
22324 (MethodData.Emit): Report CS0179 if a method doesn't have a body
22325 and it's not marked abstract or extern.
22326 (PropertyBase): New abstract base class for Property and Indexer.
22327 (PropertyBase.CheckBase): Moved here from Property and made it work
22329 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
22330 the same so we can reuse it there.
22331 (Property, Indexer): Derive from PropertyBase.
22332 (MethodSignature.inheritable_property_signature_filter): New delegate
22333 to find properties and indexers.
22335 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
22336 argument and improved error reporting.
22338 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
22339 EmptyReadOnlyParameters and made it a property.
22341 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
22342 version of this method which takes a `PropertyInfo indexer'.
22343 (TypeManager.RegisterIndexer): New method.
22345 * class.cs: Added myself as author of this file :-)
22347 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22349 * class.cs: fixed compilation on windoze.
22351 2002-08-03 Martin Baulig <martin@gnome.org>
22353 * interface.cs (Interface.GetInterfaceBases): Check whether all
22354 base interfaces are at least as accessible than the current one.
22356 * class.cs (TypeContainer.GetClassBases): Check whether base types
22357 are at least as accessible than the current type.
22358 (TypeContainer.AsAccessible): Implemented and made non-static.
22359 (MemberBase.CheckParameters): Report errors if the accessibility
22362 * delegate.cs (Delegate.Delegate): The default visibility is
22363 internal for top-level types and private for nested types.
22364 (Delegate.Define): Report errors if the accessibility checks fail.
22366 * enum.cs (Enum.Enum): The default visibility is internal for
22367 top-level types and private for nested types.
22368 (Enum.DefineType): Compute the correct visibility.
22370 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
22371 function which takes a `bool is_toplevel' instead of a TypeContainer.
22373 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
22376 2002-08-02 Martin Baulig <martin@gnome.org>
22378 * expression.cs (LocalVariableReferenc): Added constructor which
22379 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
22380 (LocalVariableReference.IsReadOnly): New property.
22381 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
22382 variable is readonly, use our own readonly flag to do this; you can
22383 use the new constructor to get a writable reference to a read-only
22386 * cs-parser.jay (foreach_statement, using_statement): Get a writable
22387 reference to the local variable.
22389 2002-08-01 Miguel de Icaza <miguel@ximian.com>
22391 * rootcontext.cs (ResolveCore): Also include System.Exception
22393 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
22394 we reach an EmptyStatement.
22396 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
22399 * expression.cs (Binary.ResolveOperator): Check error result in
22402 use brtrue/brfalse directly and avoid compares to null.
22404 2002-08-02 Martin Baulig <martin@gnome.org>
22406 * class.cs (TypeContainer.Define): Define all nested interfaces here.
22407 Fixes bug #28407, added test-155.cs.
22409 2002-08-01 Martin Baulig <martin@gnome.org>
22411 * class.cs (Event.EmitDefaultMethod): Make this work with static
22412 events. Fixes #28311, added verify-3.cs.
22414 2002-08-01 Martin Baulig <martin@gnome.org>
22416 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
22417 `is_disposable' fields.
22418 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
22419 `hm.is_disposable' if we're using the collection pattern.
22420 (Foreach.EmitCollectionForeach): Use the correct type for the
22421 enumerator's local variable, only emit the try/finally block if
22422 necessary (fixes #27713).
22424 2002-08-01 Martin Baulig <martin@gnome.org>
22426 * ecore.cs (Expression.report118): Renamed to Error118 and made
22429 * statement.cs (Throw.Resolve): Check whether the expression is of
22430 the correct type (CS0118) and whether the type derives from
22431 System.Exception (CS0155).
22432 (Catch.Resolve): New method. Do the type lookup here and check
22433 whether it derives from System.Exception (CS0155).
22434 (Catch.CatchType, Catch.IsGeneral): New public properties.
22436 * typemanager.cs (TypeManager.exception_type): Added.
22438 2002-07-31 Miguel de Icaza <miguel@ximian.com>
22440 * driver.cs: Updated About function.
22442 2002-07-31 Martin Baulig <martin@gnome.org>
22444 Implemented Control Flow Analysis.
22446 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
22447 (EmitContext.CurrentBranching): Added.
22448 (EmitContext.StartFlowBranching): Added.
22449 (EmitContext.EndFlowBranching): Added.
22450 (EmitContext.KillFlowBranching): Added.
22451 (EmitContext.IsVariableAssigned): Added.
22452 (EmitContext.SetVariableAssigned): Added.
22453 (EmitContext.IsParameterAssigned): Added.
22454 (EmitContext.SetParameterAssigned): Added.
22455 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
22456 Added control flow analysis stuff here.
22458 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
22459 resolve the expression as lvalue.
22460 (LocalVariableReference.DoResolve): Check whether the variable has
22461 already been assigned.
22462 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
22463 the parameter as assigned here.
22464 (ParameterReference.DoResolve): Check whether the parameter has already
22466 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
22467 expression as lvalue.
22469 * statement.cs (FlowBranching): New class for the flow analysis code.
22470 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
22471 (LabeledStatement.IsDefined): New public property.
22472 (LabeledStatement.AddUsageVector): New public method to tell flow
22473 analyis that the label may be reached via a forward jump.
22474 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
22476 (VariableInfo.Number): New public field. This is used by flow analysis
22477 to number all locals of a block.
22478 (Block.CountVariables): New public property. This is the number of
22479 local variables in this block (including the locals from all parent
22481 (Block.EmitMeta): Number all the variables.
22483 * statement.cs: Added flow analysis support to all classes.
22485 2002-07-31 Martin Baulig <martin@gnome.org>
22487 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
22488 To get debugging messages, compile mcs with /define:MCS_DEBUG and
22489 then use this argument.
22491 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
22493 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
22494 use this to specify /define options.
22496 2002-07-29 Martin Baulig <martin@gnome.org>
22498 * statement.cs (Fixed): Moved all code that does variable lookups
22499 and resolvings from Emit to Resolve.
22501 * statement.cs (For): Moved all code that does variable lookups
22502 and resolvings from Emit to Resolve.
22504 * statement.cs (Using): Moved all code that does variable lookups
22505 and resolvings from Emit to Resolve.
22507 2002-07-29 Martin Baulig <martin@gnome.org>
22509 * attribute.cs (Attribute.Resolve): Explicitly catch a
22510 System.NullReferenceException when creating the
22511 CustromAttributeBuilder and report a different warning message.
22513 2002-07-29 Martin Baulig <martin@gnome.org>
22515 * support.cs (ParameterData.ParameterName): Added method to
22516 get the name of a parameter.
22518 * typemanager.cs (TypeManager.IsValueType): New public method.
22520 2002-07-29 Martin Baulig <martin@gnome.org>
22522 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
22523 is a flag which specifies that it's either ref or out.
22524 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
22525 the out parameter to `out Parameter.Modifier mod', also set the
22526 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
22528 * support.cs (InternalParameters.ParameterModifier): Distinguish
22529 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
22530 Parameter.Modifier.ISBYREF flag if it's either ref or out.
22532 * expression.cs (Argument.GetParameterModifier): Distinguish
22533 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
22534 Parameter.Modifier.ISBYREF flag if it's either ref or out.
22536 2002-07-29 Martin Baulig <martin@gnome.org>
22538 * expression.cs (ParameterReference.ParameterReference): Added
22539 `Location loc' argument to the constructor.
22541 * cs-parser.jay: Pass location to ParameterReference.
22543 2002-07-28 Miguel de Icaza <miguel@ximian.com>
22545 * statement.cs (Try): Initialize the location.
22547 * cs-parser.jay: pass location to Try.
22549 * expression.cs (Unary.Reduce): Change the prototype to return
22550 whether a constant fold could be performed or not. The result is
22551 returned in an out parameters. In the case of Indirection and
22552 AddressOf, we want to perform the full tests.
22554 2002-07-26 Miguel de Icaza <miguel@ximian.com>
22556 * statement.cs (Statement.Emit): Flag dead code.
22558 2002-07-27 Andrew Birkett <andy@nobugs.org>
22560 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
22562 2002-07-27 Martin Baulig <martin@gnome.org>
22564 * class.cs (MethodData.Define): Put back call to
22565 TypeManager.AddMethod(), accidentally commented this out.
22567 * report.cs (Debug): New public method to print debugging information,
22568 this is `[Conditional ("DEBUG")]'.
22570 2002-07-26 Martin Baulig <martin@gnome.org>
22572 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
22573 (switch_statement): Push the current_block to the switch_stack and
22574 pop it again when we're done with the switch.
22575 (switch_section): The new block is a child of the current_block.
22576 Fixes bug #24007, added test-152.cs.
22578 2002-07-27 Martin Baulig <martin@gnome.org>
22580 * expression.cs (Invocation.EmitArguments): When calling a varargs
22581 function with only its fixed arguments, we need to pass an empty
22584 2002-07-27 Martin Baulig <martin@gnome.org>
22586 Mono 0.13 has been released.
22588 2002-07-25 Miguel de Icaza <miguel@ximian.com>
22590 * driver.cs: Rename --resource to --linkres, because that is what
22591 we do currently, we dont support --resource yet.
22593 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
22595 2002-07-25 Martin Baulig <martin@gnome.org>
22597 * class.cs (MethodData): New public class. This is a `method builder'
22598 class for a method or one accessor of a Property/Indexer/Event.
22599 (MethodData.GetMethodFlags): Moved here from MemberBase.
22600 (MethodData.ApplyAttributes): Likewise.
22601 (MethodData.ApplyObsoleteAttribute): Likewise.
22602 (MethodData.ApplyConditionalAttribute): Likewise.
22603 (MethodData.ApplyDllImportAttribute): Likewise.
22604 (MethodData.CheckAbstractAndExternal): Likewise.
22605 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
22606 (MethodData.Emit): Formerly known as Method.Emit().
22607 (MemberBase): Moved everything which was specific to a single
22608 accessor/method to MethodData.
22609 (Method): Create a new MethodData and call Define() and Emit() on it.
22610 (Property, Indexer, Event): Create a new MethodData objects for each
22611 accessor and call Define() and Emit() on them.
22613 2002-07-25 Martin Baulig <martin@gnome.org>
22615 Made MethodCore derive from MemberBase to reuse the code from there.
22616 MemberBase now also checks for attributes.
22618 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
22619 (MemberBase.GetMethodFlags): Moved here from class Method and marked
22621 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
22622 `CallingConventions cc' and `Attributes opt_attrs' arguments.
22623 (MemberBase.ApplyAttributes): New virtual method; applies the
22624 attributes to a method or accessor.
22625 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
22626 (MemberBase.ApplyConditionalAttribute): Likewise.
22627 (MemberBase.ApplyDllImportAttribute): Likewise.
22628 (MemberBase.CheckAbstractAndExternal): Likewise.
22629 (MethodCore.ParameterTypes): This is now a property instead of a
22630 method, it's initialized from DoDefineParameters().
22631 (MethodCore.ParameterInfo): Removed the set accessor.
22632 (MethodCore.DoDefineParameters): New protected virtual method to
22633 initialize ParameterTypes and ParameterInfo.
22634 (Method.GetReturnType): We can now simply return the MemberType.
22635 (Method.GetMethodFlags): Override the MemberBase version and add
22636 the conditional flags.
22637 (Method.CheckBase): Moved some code from Define() here, call
22638 DoDefineParameters() here.
22639 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
22640 here to avoid some larger code duplication.
22641 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
22642 ensure that abstract and external accessors don't declare a body.
22644 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
22645 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
22646 lookup in the attribute's parent classes, so we need to abort as soon
22647 as we found the first match.
22648 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
22649 the attribute has no arguments.
22651 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
22654 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22656 * cs-parser.jay: reverted previous patch.
22658 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22660 * cs-parser.jay: fixed bug #22119.
22662 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22664 * attribute.cs: fixed compilation. The error was:
22665 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
22666 be assigned to before control leaves the current method."
22667 [FIXME: Filed as bug #28186: MCS must report this error.]
22669 2002-07-25 Martin Baulig <martin@gnome.org>
22671 * attribute.cs (Attribute.Conditional_GetConditionName): New static
22672 method to pull the condition name ouf of a Conditional attribute.
22673 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
22674 the obsolete message and error flag out of an Obsolete attribute.
22676 * class.cs (Method.GetMethodFlags): New public method to get the
22677 TypeManager.MethodFlags for this method.
22678 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
22680 (Method.Define): Get and apply the Obsolete and Conditional attributes;
22681 if we're overriding a virtual function, set the new private variable
22682 `parent_method'; call the new TypeManager.AddMethod().
22684 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
22685 the MethodBuilder and the Method in a PtrHashtable.
22686 (TypeManager.builder_to_method): Added for this purpose.
22687 (TypeManager.MethodFlags): Added IsObsoleteError.
22688 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
22689 Obsolete and Conditional arguments in MethodBuilders. If we discover
22690 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
22691 the message from the attribute.
22693 2002-07-24 Martin Baulig <martin@gnome.org>
22695 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
22696 preprocessor directives, ensure that the argument to #define/#undef is
22697 exactly one identifier and that it's actually an identifier.
22699 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
22702 2002-07-24 Martin Baulig <martin@gnome.org>
22704 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
22705 initialize it to TypeManager.object_type in the constructor.
22706 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
22707 of the `hm.get_current' method if we're using the collection pattern.
22708 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
22709 for the explicit conversion to make it work when we're using the collection
22710 pattern and the `Current' property has a different return type than `object'.
22713 2002-07-24 Martin Baulig <martin@gnome.org>
22715 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
22716 does not match, but don't report any errors. This method is called in
22717 order for all methods in a MethodGroupExpr until a matching method is
22718 found, so we don't want to bail out if the first method doesn't match.
22719 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
22720 matches, report the 123. Fixes #28070.
22722 2002-07-24 Martin Baulig <martin@gnome.org>
22724 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
22725 TypeManager.TypeToCoreType() to the top of the method so the
22726 following equality checks will work. Fixes #28107.
22728 2002-07-24 Martin Baulig <martin@gnome.org>
22730 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
22731 operand is of type uint, and the other operand is of type sbyte,
22732 short or int, the operands are converted to type long." -
22733 Actually do what this comment already told us. Fixes bug #28106,
22736 2002-07-24 Martin Baulig <martin@gnome.org>
22738 * class.cs (MethodBase): New abstract class. This is now a base
22739 class for Property, Indexer and Event to avoid some code duplication
22740 in their Define() and DefineMethods() methods.
22741 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
22742 generic methods for Define() and DefineMethods().
22743 (FieldBase): Derive from MemberBase, not MemberCore.
22744 (Property): Derive from MemberBase, not MemberCore.
22745 (Property.DefineMethod): Moved all the code from this method to the
22746 new MethodBase.DefineAccessor(), just call it with appropriate
22748 (Property.Define): Call the new Property.DoDefine(), this does some
22749 sanity checks and we don't need to duplicate the code everywhere.
22750 (Event): Derive from MemberBase, not MemberCore.
22751 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
22752 accessors, this will also make them work with interface events.
22753 (Indexer): Derive from MemberBase, not MemberCore.
22754 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
22755 (Indexer.Define): Use the new MethodBase functions.
22757 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
22758 argument to the constructor.
22759 (Interface.FindMembers): Added support for interface events.
22760 (Interface.PopluateEvent): Implemented.
22762 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
22764 2002-07-22 Miguel de Icaza <miguel@ximian.com>
22766 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
22767 but this is required to check for a method name being the same as
22768 the containing class.
22772 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22774 * interface.cs: initialize variable.
22776 2002-07-23 Martin Baulig <martin@gnome.org>
22778 Implemented the IndexerName attribute in interfaces.
22780 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
22781 name if this is an explicit interface implementation.
22782 (Indexer.InterfaceIndexerName): New public variable. If we're
22783 implementing an interface indexer, this is the IndexerName in that
22784 interface. Otherwise, it's the IndexerName.
22785 (Indexer.DefineMethod): If we're implementing interface indexer,
22786 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
22787 and Pending.ImplementIndexer methods.
22788 (Indexer.Define): Also define the PropertyBuilder if we're
22789 implementing an interface indexer and this is neither an explicit
22790 interface implementation nor do the IndexerName match the one in
22793 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
22794 If a method is defined here, then we always need to create a proxy
22795 for it. This is used when implementing interface indexers.
22796 (Pending.IsInterfaceIndexer): New public method.
22797 (Pending.ImplementIndexer): New public method.
22798 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
22799 This is used when implementing interface indexers to define a proxy
22801 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
22802 define a proxy if necessary.
22804 * interface.cs (Interface.IndexerName): New public variable.
22805 (Interface.PopulateIndexer): Set the IndexerName.
22806 (Interface.DefineIndexers): New private method. Populate all the
22807 indexers and make sure their IndexerNames match.
22809 * typemanager.cs (IndexerPropertyName): Added support for interface
22812 2002-07-22 Martin Baulig <martin@gnome.org>
22814 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
22815 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
22816 ret if HasReturnLabel.
22817 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
22820 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
22821 and set the ec.LoopBeginTryCatchLevel.
22822 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
22823 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
22824 the current ec.TryCatchLevel, the branch goes out of an exception
22825 block. In this case, we need to use Leave and not Br.
22827 2002-07-22 Martin Baulig <martin@gnome.org>
22829 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
22830 block unless the block does not always return or it is contained in
22831 another try { ... } catch { ... } block. Fixes bug #26506.
22832 Added verify-1.cs to the test suite.
22834 2002-07-22 Martin Baulig <martin@gnome.org>
22836 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
22837 then we do not always return. Fixes bug #24985.
22839 2002-07-22 Martin Baulig <martin@gnome.org>
22841 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
22842 lookup on a per-class level; ie. walk up the class hierarchy until we
22843 found at least one applicable method, then choose the best among them.
22844 Fixes bug #24463 and test-29.cs.
22846 2002-07-22 Martin Baulig <martin@gnome.org>
22848 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
22849 return types of the methods. The return type is not part of the
22850 signature and we must not check it to make the `new' modifier work.
22851 Fixes bug #27999, also added test-147.cs.
22852 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
22854 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
22855 on the method's return type.
22857 2002-07-21 Martin Baulig <martin@gnome.org>
22859 * assign.cs: Make this work if the rightmost source is a constant and
22860 we need to do an implicit type conversion. Also adding a few more tests
22861 to test-38.cs which should have caught this.
22863 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
22864 target in the makefile for this. The makefile.gnu is primarily intended
22865 for end-users who don't want to debug the compiler.
22867 2002-07-21 Martin Baulig <martin@gnome.org>
22869 * assign.cs: Improved the Assign class so it can now handle embedded
22870 assignments (X = Y = Z = something). As a side-effect this'll now also
22871 consume less local variables. test-38.cs now passes with MCS, added
22872 a few new test cases to that test.
22874 2002-07-20 Martin Baulig <martin@gnome.org>
22876 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
22877 instructions. Fixes bug #27977, also added test-146.cs.
22879 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22881 * cs-tokenizer.cs: fixed getHex ().
22883 2002-07-19 Martin Baulig <martin@gnome.org>
22885 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
22886 not Type.GetType() to lookup the array type. This is needed when
22887 we're constructing an array of a user-defined type.
22888 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
22889 single-dimensional arrays, but also for single-dimensial arrays of
22892 2002-07-19 Martin Baulig <martin@gnome.org>
22894 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
22895 this function is called, it's not allowed to share LocalBuilders
22896 among ILGenerators.
22898 2002-07-19 Martin Baulig <martin@gnome.org>
22900 * expression.cs (Argument.Resolve): Report an error 118 when trying
22901 to pass a type as argument.
22903 2002-07-18 Martin Baulig <martin@gnome.org>
22905 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
22906 Conv_R_Un for the signed `long' type.
22908 2002-07-15 Miguel de Icaza <miguel@ximian.com>
22910 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
22911 `expr' for the temporary result, as that will fail if we do
22912 multiple resolves on the same expression.
22914 2002-07-05 Miguel de Icaza <miguel@ximian.com>
22916 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
22917 ec.TypeContainer for looking up aliases.
22919 * class.cs (TypeContainer): Remove LookupAlias from here.
22921 * decl.cs (DeclSpace); Move here.
22923 2002-07-01 Miguel de Icaza <miguel@ximian.com>
22925 * class.cs (FindMembers): Only call filter if the constructor
22926 bulider is not null.
22928 Also handle delegates in `NestedTypes' now. Now we will perform
22929 type lookups using the standard resolution process. This also
22932 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
22933 This uses Expressions (the limited kind that can be parsed by the
22934 tree) instead of strings.
22936 * expression.cs (ComposedCast.ToString): Implement, used to flag
22937 errors since now we have to render expressions.
22939 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
22942 * ecore.cs (SimpleName.ToString): ditto.
22944 * cs-parser.jay: Instead of using strings to assemble types, use
22945 Expressions to assemble the type (using SimpleName, ComposedCast,
22946 MemberAccess). This should fix the type lookups in declarations,
22947 because we were using a different code path for this.
22949 * statement.cs (Block.Resolve): Continue processing statements
22950 even when there is an error.
22952 2002-07-17 Miguel de Icaza <miguel@ximian.com>
22954 * class.cs (Event.Define): Also remove the `remove' method from
22955 the list of pending items.
22957 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
22958 generate more compact code.
22960 2002-07-17 Martin Baulig <martin@gnome.org>
22962 * const.cs (Const.LookupConstantValue): Add support for constant
22963 `unchecked' and `checked' expressions.
22964 Also adding test case test-140.cs for this.
22966 2002-07-17 Martin Baulig <martin@gnome.org>
22968 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
22969 check whether mi.ReturnType implements the IEnumerator interface; the
22970 `==' and the IsAssignableFrom() will fail in this situation.
22972 2002-07-16 Ravi Pratap <ravi@ximian.com>
22974 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
22977 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22979 * expression.cs: fixed bug #27811.
22981 2002-07-14 Miguel de Icaza <miguel@ximian.com>
22983 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
22984 Molaro: when we are a ref, the value already contains a pointer
22985 value, do not take the address of it.
22987 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22988 * removed mb-parser.jay and mb-tokenizer.cs
22990 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22992 * expression.cs: check against the building corlib void type.
22994 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
22996 * ecore.cs: fix for valuetype static readonly fields: when
22997 initializing them, we need their address, not the address of a copy.
22999 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23001 * typemanager.cs: register also enum_type in corlib.
23003 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23005 * class.cs: allow calling this (but not base) initializers in structs.
23007 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23009 * ecore.cs: make sure we compare against the building base types
23012 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23014 * typemanager.cs: fix TypeToCoreType() to handle void and object
23015 (corlib gets no more typerefs after this change).
23017 2002-07-12 Miguel de Icaza <miguel@ximian.com>
23019 * expression.cs (ArrayCreation.EmitArrayArguments): use
23020 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23022 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23023 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
23024 array indexes, the runtime actually forbids them.
23026 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23027 for array arguments here.
23029 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23030 instead of the default for ValueTypes.
23032 (New.DoEmit): Use IsValueType instead of
23033 IsSubclassOf (value_type)
23034 (New.DoResolve): ditto.
23035 (Invocation.EmitCall): ditto.
23037 * assign.cs (Assign): ditto.
23039 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23040 Statements *are* currently doing part of their resolution during
23043 Expressions do always resolve during resolve, but statements are
23044 only required to propagate resolution to their children.
23046 2002-07-11 Miguel de Icaza <miguel@ximian.com>
23048 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23050 (LoadAssembly): Do not add the dll if it is already specified
23052 (MainDriver): Add the System directory to the link path at the end,
23053 after all the other -L arguments.
23055 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23056 wrong opcode for loading bytes and bools (ldelem.i1 instead of
23057 ldelem.u1) and using the opposite for sbytes.
23059 This fixes Digger, and we can finally run it.
23061 * driver.cs (UnixParseOption): Move the option parsing here.
23062 (CSCParseOption): Implement CSC-like parsing of options.
23064 We now support both modes of operation, the old Unix way, and the
23065 new CSC-like way. This should help those who wanted to make cross
23066 platform makefiles.
23068 The only thing broken is that /r:, /reference: and /lib: are not
23069 implemented, because I want to make those have the same semantics
23070 as the CSC compiler has, and kill once and for all the confussion
23071 around this. Will be doing this tomorrow.
23073 * statement.cs (Unsafe.Resolve): The state is checked during
23074 resolve, not emit, so we have to set the flags for IsUnsfe here.
23076 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23078 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23079 not catch the Error_ObjectRefRequired in SimpleName (as it is
23080 possible to have a class/instance variable name that later gets
23081 deambiguated), we have to check this here.
23083 2002-07-10 Ravi Pratap <ravi@ximian.com>
23085 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23086 make static and put into Expression.
23088 (Event.Define): Register the private field of the event with the
23089 TypeManager so that GetFieldFromEvent can get at it.
23091 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23092 keep track of the private field associated with an event which
23095 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23098 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23100 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23102 * expression.cs (Binary.EmitBranchable): this routine emits the
23103 Binary expression in a branchable context. This basically means:
23104 we need to branch somewhere, not just get the value on the stack.
23106 This works together with Statement.EmitBoolExpression.
23108 * statement.cs (Statement.EmitBoolExpression): Use
23111 2002-07-09 Miguel de Icaza <miguel@ximian.com>
23113 * statement.cs (For): Reduce the number of jumps in loops.
23115 (For): Implement loop inversion for the For statement.
23117 (Break): We can be breaking out of a Try/Catch controlled section
23118 (foreach might have an implicit try/catch clause), so we need to
23119 use Leave instead of Br.
23121 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23122 now). If the instace expression supports IMemoryLocation, we use
23123 the AddressOf method from the IMemoryLocation to extract the
23124 address instead of emitting the instance.
23126 This showed up with `This', as we were emitting the instance
23127 always (Emit) instead of the Address of This. Particularly
23128 interesting when This is a value type, as we dont want the Emit
23129 effect (which was to load the object).
23131 2002-07-08 Miguel de Icaza <miguel@ximian.com>
23133 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
23135 * statement.cs (Checked): Set the CheckedState during the resolve
23136 process too, as the ConvCast operations track the checked state on
23137 the resolve process, and not emit.
23139 * cs-parser.jay (namespace_member_declaration): Flag that we have
23140 found a declaration when we do. This is used to flag error 1529
23142 * driver.cs: Report ok when we display the help only.
23144 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
23146 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
23148 2002-07-04 Miguel de Icaza <miguel@ximian.com>
23150 * cs-tokenizer.cs (define): We also have to track locally the
23151 defines. AllDefines is just used for the Conditional Attribute,
23152 but we also need the local defines for the current source code.
23154 2002-07-03 Miguel de Icaza <miguel@ximian.com>
23156 * statement.cs (While, For, Do): These loops can exit through a
23157 Break statement, use this information to tell whether the
23158 statement is the last piece of code.
23160 (Break): Flag that we break.
23162 * codegen.cs (EmitContexts): New `Breaks' state variable.
23164 2002-07-03 Martin Baulig <martin@gnome.org>
23166 * class.cs (TypeContainer.MethodModifiersValid): Allow override
23167 modifiers in method declarations in structs. Otherwise, you won't
23168 be able to override things like Object.Equals().
23170 2002-07-02 Miguel de Icaza <miguel@ximian.com>
23172 * class.cs (Method, Property, Indexer): Do not allow the public
23173 modifier to be used in explicit interface implementations.
23175 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
23176 override modifiers in method declarations in structs
23178 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
23180 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
23181 integer or real overflow, report an error
23183 2002-07-02 Martin Baulig <martin@gnome.org>
23185 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
23186 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
23187 to tell the runtime about our newly created System.Object and
23188 System.ValueType types.
23190 2002-07-02 Miguel de Icaza <miguel@ximian.com>
23192 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
23193 struct instead of Ldarg/Starg.
23195 2002-07-02 Martin Baulig <martin@gnome.org>
23197 * expression.cs (Indirection.Indirection): Call
23198 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
23200 2002-07-02 Martin Baulig <martin@gnome.org>
23202 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
23203 ValueType, call TypeManager.TypeToCoreType() on it.
23204 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
23205 the OpCodes.Newarr argument.
23207 2002-07-02 Martin Baulig <martin@gnome.org>
23209 * expression.cs (Invocation.EmitCall): When compiling corlib,
23210 replace all calls to the system's System.Array type to calls to
23211 the newly created one.
23213 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
23214 System.Array methods.
23215 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
23216 from the system's System.Array type which must be replaced.
23218 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
23220 * typemanager.cs: load unverifiable_code_ctor so we can build
23221 corlib using the correct type. Avoid using GetTypeCode() with
23223 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
23224 TypeManager.object_type to allow building corlib.
23226 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
23228 * ecore.cs: handle System.Enum separately in LoadFromPtr().
23230 2002-07-01 Martin Baulig <martin@gnome.org>
23232 * class.cs: Make the last change actually work, we need to check
23233 whether `ifaces != null' to avoid a crash.
23235 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23237 * class.cs: when we build structs without fields that implement
23238 interfaces, we need to add the interfaces separately, since there is
23239 no API to both set the size and add the interfaces at type creation
23242 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23244 * expression.cs: the dimension arguments to the array constructors
23245 need to be converted if they are a long.
23247 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
23249 * class.cs: don't emit ldarg.0 if there is no parent constructor
23250 (fixes showstopper for corlib).
23252 2002-06-29 Martin Baulig <martin@gnome.org>
23254 MCS now compiles corlib on GNU/Linux :-)
23256 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
23257 ie. check for MethodImplOptions.InternalCall.
23259 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
23260 and TypeManager.attribute_type are null, so we must explicitly check
23261 whether parent is not null to find out whether it's an attribute type.
23262 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
23263 and SetBuilder, not only if the property is neither abstract nor external.
23264 This is necessary to set the MethodImplOptions on the accessor methods.
23265 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
23266 SetBuilder, see Property.Emit().
23268 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
23269 populate "System.Object", "System.ValueType" and "System.Attribute" since
23270 they've already been populated from BootCorlib_PopulateCoreTypes().
23272 2002-06-29 Martin Baulig <martin@gnome.org>
23274 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
23275 is the NullLiteral, we also need to make sure that target_type is not
23278 2002-06-29 Martin Baulig <martin@gnome.org>
23280 * rootcontext.cs (RootContext.ResolveCore): We must initialize
23281 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
23282 before calling BootstrapCorlib_ResolveDelegate ().
23284 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23286 * statement.cs: fixed build-breaker. All tests passed ok.
23288 2002-06-27 Martin Baulig <martin@gnome.org>
23290 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
23291 for System.Decimal when compiling corlib.
23293 2002-06-27 Martin Baulig <martin@gnome.org>
23295 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
23296 switch blocks which contain nothing but a default clause.
23298 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
23300 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
23302 2002-06-27 Martin Baulig <martin@gnome.org>
23304 * ecore.cs (PropertyExpr.PropertyExpr): Call
23305 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
23307 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
23308 is already a TypeBuilder.
23310 2002-06-27 Martin Baulig <martin@gnome.org>
23312 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
23313 `target_type == TypeManager.array_type', not IsAssignableFrom() in
23314 the "from an array-type to System.Array" case. This makes it work
23315 when compiling corlib.
23317 2002-06-27 Martin Baulig <martin@gnome.org>
23319 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
23320 non-static PropertyExpr, set its InstanceExpression. This makes
23321 the `ICollection.Count' property work in System/Array.cs.
23323 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
23325 * driver.cs: Made error handling more consistent. Errors now
23326 tracked by Report class, so many methods which used to return int
23327 now return void. Main() now prints success/failure and
23328 errors/warnings message.
23330 Renamed '--probe' compiler argument to '--expect-error'. Removed
23331 the magic number return values (123 and 124). Now, if the
23332 expected error occurs, the compiler exits with success (exit value
23333 0). If the compilation completes without seeing that particular
23334 error, the compiler exits with failure (exit value 1). The
23335 makefile in mcs/errors has been changed to handle the new behaviour.
23337 * report.cs: Made 'expected error' number a property and renamed
23338 it from 'Probe' to 'ExpectedError'.
23340 * genericparser.cs: Removed error handling support, since it is
23341 now all done by Report class.
23343 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
23344 class, so parse() no longer returns an int.
23346 * namespace.cs: Use Report.Error instead of GenericParser.error
23348 2002-06-22 Miguel de Icaza <miguel@ximian.com>
23350 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
23351 TypeContainer.AddOperator): At the front of the list put the
23352 explicit implementations, so they get resolved/defined first.
23354 2002-06-21 Miguel de Icaza <miguel@ximian.com>
23356 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
23357 interface type is implemented by this TypeContainer. Used during
23358 explicit interface implementation.
23360 (Property.Define, Indexer.Define, Method.Define): Validate that
23361 the given interface in the explicit implementation is one of the
23362 base classes for the containing type.
23364 Also if we are explicitly implementing an interface, but there is
23365 no match in the pending implementation table, report an error.
23367 (Property.Define): Only define the property if we are
23368 not explicitly implementing a property from an interface. Use the
23369 correct name also for those properties (the same CSC uses,
23370 although that is really not needed).
23372 (Property.Emit): Do not emit attributes for explicitly implemented
23373 properties, as there is no TypeBuilder.
23375 (Indexer.Emit): ditto.
23377 Hiding then means that we do not really *implement* a pending
23378 implementation, which makes code fail.
23380 2002-06-22 Martin Baulig <martin@gnome.org>
23382 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
23383 the return value of Object.GetType(). [FIXME: we need to do this whenever
23384 we get a type back from the reflection library].
23386 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
23388 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
23390 2002-06-20 Miguel de Icaza <miguel@ximian.com>
23392 * attribute.cs: Return null if we can not look up the type.
23394 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
23395 the interface types found.
23397 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
23398 interface types found.
23400 * typemanager.cs (GetInterfaces): Make this routine returns alll
23401 the interfaces and work around the lame differences between
23402 System.Type and System.Reflection.Emit.TypeBuilder in the results
23403 result for GetInterfaces.
23405 (ExpandInterfaces): Given an array of interface types, expand and
23406 eliminate repeated ocurrences of an interface. This expands in
23407 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
23410 2002-06-21 Martin Baulig <martin@gnome.org>
23412 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
23415 2002-06-21 Martin Baulig <martin@gnome.org>
23417 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
23418 and called with one of the core types, return the corresponding typebuilder for
23421 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
23424 2002-06-21 Martin Baulig <martin@gnome.org>
23426 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
23427 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
23428 (Expression.ConvertReferenceExplicit): Likewise.
23430 * expression.cs (ElementAccess.DoResolve): Likewise.
23431 (ElementAccess.DoResolveLValue): Likewise.
23433 2002-06-10 Martin Baulig <martin@gnome.org>
23435 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
23436 add the "value" parameter to the parameter list.
23438 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
23441 2002-06-19 Miguel de Icaza <miguel@ximian.com>
23443 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
23444 the argument to an int, uint, long or ulong, per the spec. Also
23445 catch negative constants in array creation.
23447 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
23449 * class.cs: do not allow the same interface to appear twice in
23450 the definition list.
23452 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
23454 * ecore.cs: don't use ldlen with System.Array.
23456 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
23458 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
23460 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
23462 * modifiers.cs: produce correct field attributes for protected
23463 internal. Easy fix so miguel can work on ther harder stuff:-)
23465 2002-06-18 Miguel de Icaza <miguel@ximian.com>
23467 * pending.cs: New file. Move the code from class.cs here.
23468 Support clearning the pending flag for all methods (when not doing
23469 explicit interface implementation).
23471 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
23473 * rootcontext.cs: added a couple more types needed to bootstrap.
23475 2002-06-17 Miguel de Icaza <miguel@ximian.com>
23477 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
23478 constructor in the type, instead of any constructor in the type
23479 hierarchy. Thanks to Paolo for finding this bug (it showed up as
23480 a bug in the Mono runtime when applying the params attribute).
23482 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23483 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
23485 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
23487 * expression.cs (Unary.ResolveOperator): Use TypeManager
23488 to resolve the type.
23490 2002-06-13 Ravi Pratap <ravi@ximian.com>
23492 * cs-parser.jay (enum_member_declaration): Pass in the attributes
23495 * enum.cs (AddEnumMember): Add support to store the attributes associated
23496 with each member too.
23498 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
23499 field builders too - this takes care of the enum member case.
23501 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
23503 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
23504 address-of operator on both value types and pointers.
23506 2002-06-10 Martin Baulig <martin@gnome.org>
23508 * interface.cs (Interface.PopulateIndexer): Add the indexer's
23509 PropertyBuilder to the `property_builders' list.
23511 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
23512 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
23513 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
23514 find any indexers which are inherited from an interface.
23516 2002-06-09 Martin Baulig <martin@gnome.org>
23518 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
23519 the same type as the constant if necessary. There's also a test-130.cs
23522 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
23524 * typemanager.cs (TypeManager.ChangeType): Previously known as
23525 Enum.ChangeEnumType().
23527 2002-06-09 Martin Baulig <martin@gnome.org>
23529 * expression.cs (Cast.TryReduce): Added support for consts.
23531 2002-06-08 Ravi Pratap <ravi@ximian.com>
23533 * class.cs (Accessor): Hold attributes information so we can pass
23536 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
23537 Modify to pass in attributes attached to the methods.
23539 (add_accessor_declaration, remove_accessor_declaration): Ditto.
23541 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
23542 to handle the Accessor kind :-)
23544 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
23546 2002-06-08 Martin Baulig <martin@gnome.org>
23548 * expression.cs (Unary.TryReduceNegative): Added support for
23551 2002-06-08 Martin Baulig <martin@gnome.org>
23553 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
23554 name can't be found in the `defined_names' - the caller will do a
23555 MemberLookup in this case and thus find methods in System.Enum
23556 such as Enum.IsDefined().
23558 2002-06-08 Martin Baulig <martin@gnome.org>
23560 * enum.cs (Enum.ChangeEnumType): This is a custom version of
23561 Convert.ChangeType() which works with TypeBuilder created types.
23562 (Enum.LookupEnumValue, Enum.Define): Use it here.
23564 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
23565 `TypeBuilder.BaseType != null' check.
23566 (TypeContainer.FindMembers): Only lookup parent members if we
23567 actually have a parent.
23568 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
23569 (ConstructorInitializer.Resolve): Likewise.
23571 * interface.cs (Interface.FindMembers): Added
23572 `TypeBuilder.BaseType != null' check.
23574 * rootcontext.cs (RootContext.ResolveCore): Added
23575 "System.Runtime.CompilerServices.IndexerNameAttribute" to
23576 classes_second_stage.
23578 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
23579 debug_type and trace_type when compiling with --nostdlib.
23581 2002-06-07 Martin Baulig <martin@gnome.org>
23583 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
23584 (AddField): Set it to true when adding a non-static field.
23585 (DefineType): Use `have_nonstatic_fields' to find out whether we
23586 have non-static fields, not `Fields != null'.
23588 2002-06-02 Miguel de Icaza <miguel@ximian.com>
23590 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
23591 dereferencing a null on the static-field code path)
23593 2002-05-30 Martin Baulig <martin@gnome.org>
23595 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
23596 to take command line arguments. Use reflection to call the new
23597 custom `Initialize' function on the symbol writer and pass it the
23598 command line arguments.
23600 * driver.cs (--debug-args): New command line argument to pass command
23601 line arguments to the symbol writer.
23603 2002-05-28 Miguel de Icaza <miguel@ximian.com>
23605 * assign.cs (DoResolve): Forgot to do the implicit conversion to
23606 the target type for indexers and properties. Thanks to Joe for
23609 2002-05-27 Miguel de Icaza <miguel@ximian.com>
23611 * typemanager.cs (MethodFlags): returns the method flags
23612 (Obsolete/ShouldIgnore) that control warning emission and whether
23613 the invocation should be made, or ignored.
23615 * expression.cs (Invocation.Emit): Remove previous hack, we should
23616 not do this on matching a base type, we should do this based on an attribute
23618 Only emit calls to System.Diagnostics.Debug and
23619 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
23620 on the command line.
23622 * rootcontext.cs: Global settings for tracing and debugging.
23624 * cs-tokenizer.cs (define): New utility function to track
23625 defines. Set the global settings for TRACE and DEBUG if found.
23627 2002-05-25 Ravi Pratap <ravi@ximian.com>
23629 * interface.cs (Populate*): Pass in the TypeContainer as well as
23630 the DeclSpace as parameters so that we can create EmitContexts and
23631 then use that to apply attributes etc.
23633 (PopulateMethod, PopulateEvent, PopulateProperty)
23634 (PopulateIndexer): Apply attributes everywhere.
23636 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
23639 (ApplyAttributes): Update accordingly.
23641 We now apply interface attributes for all members too.
23643 2002-05-26 Miguel de Icaza <miguel@ximian.com>
23645 * class.cs (Indexer.Define); Correctly check if we are explicit
23646 implementation (instead of checking the Name for a ".", we
23647 directly look up if the InterfaceType was specified).
23649 Delay the creation of the PropertyBuilder.
23651 Only create the PropertyBuilder if we are not an explicit
23652 interface implementation. This means that explicit interface
23653 implementation members do not participate in regular function
23654 lookups, and hence fixes another major ambiguity problem in
23655 overload resolution (that was the visible effect).
23657 (DefineMethod): Return whether we are doing an interface
23660 * typemanager.cs: Temporary hack until we get attributes in
23661 interfaces (Ravi is working on that) and we get IndexerName
23662 support in interfaces.
23664 * interface.cs: Register the indexers as properties.
23666 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
23667 warning, I have verified that this is a bug in the .NET runtime
23668 (JavaScript suffers of the same problem).
23670 * typemanager.cs (MemberLookup): When looking up members for
23671 interfaces, the parent of an interface is the implicit
23672 System.Object (so we succeed in searches of Object methods in an
23673 interface method invocation. Example: IEnumerable x; x.ToString
23676 2002-05-25 Miguel de Icaza <miguel@ximian.com>
23678 * class.cs (Event): Events should also register if they do
23679 implement the methods that an interface requires.
23681 * typemanager.cs (MemberLookup); use the new GetInterfaces
23684 (GetInterfaces): The code used to lookup interfaces for a type is
23685 used in more than one place, factor it here.
23687 * driver.cs: Track the errors at the bottom of the file, we kept
23690 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
23691 instance if the method we are calling is static!
23693 2002-05-24 Miguel de Icaza <miguel@ximian.com>
23695 * attribute.cs (ApplyAttributes): Make this function filter out
23696 the IndexerName attribute (as that attribute in reality is never
23697 applied) and return the string constant for the IndexerName
23700 * class.cs (TypeContainer.Emit): Validate that all the indexers
23701 have the same IndexerName attribute, and if so, set the
23702 DefaultName attribute on the class.
23704 * typemanager.cs: The return value might contain other stuff (not
23705 only methods). For instance, consider a method with an "Item"
23706 property and an Item method.
23708 * class.cs: If there is a problem with the parameter types,
23711 2002-05-24 Ravi Pratap <ravi@ximian.com>
23713 * ecore.cs (ImplicitConversionExists): Wrapper function which also
23714 looks at user defined conversion after making a call to
23715 StandardConversionExists - we need this for overload resolution.
23717 * expression.cs : Update accordingly the various method calls.
23719 This fixes 2 bugs filed against implicit user defined conversions
23721 2002-05-22 Miguel de Icaza <miguel@ximian.com>
23723 * statement.cs: Track the result of the assignment.
23725 2002-05-21 Miguel de Icaza <miguel@ximian.com>
23727 * expression.cs (MemberAccess): Improved error reporting for
23728 inaccessible members.
23730 2002-05-22 Martin Baulig <martin@gnome.org>
23732 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
23733 itself with debugging support.
23735 2002-05-22 Martin Baulig <martin@gnome.org>
23737 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
23738 Removed, this isn't needed anymore.
23740 2002-05-20 Martin Baulig <martin@gnome.org>
23742 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
23743 be underlying type for an enum.
23745 2002-05-20 Miguel de Icaza <miguel@ximian.com>
23747 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
23748 that splits out the loading of just the core types.
23750 * rootcontext.cs (ResolveCore): Split the struct resolution in
23751 two, so we can load the enumeration underlying types before any
23754 * expression.cs (Is): Bandaid until we fix properly Switch (see
23755 bug #24985 for details).
23757 * typemanager.cs (ImplementsInterface): The hashtable will contain
23758 a null if there are no interfaces implemented.
23760 2002-05-18 Miguel de Icaza <miguel@ximian.com>
23762 * cs-parser.jay (indexer_declarator): It is fine to have array
23765 2002-05-17 Miguel de Icaza <miguel@ximian.com>
23767 * typemanager.cs: (RegisterBuilder): New function used to register
23768 TypeBuilders that implement interfaces. Since
23769 TypeBuilder.GetInterfaces (as usual) does not work with lame
23771 (AddUserType): register interfaces.
23773 (ImplementsInterface): Use the builder_to_ifaces hash if we are
23774 dealing with TypeBuilder. Also, arrays are showing up as
23775 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
23776 methods can not be invoked on them!
23778 * ecore.cs (ExplicitReferenceConversionExists): Made public.
23779 (ImplicitReferenceConversionExists): Split out from
23780 StandardConversionExists.
23782 * expression.cs (As): We were only implementing one of the three
23783 cases for the as operator. We now implement them all.
23784 (Is): Implement the various other cases for Is as well.
23786 * typemanager.cs (CACHE): New define used to control if we want or
23787 not the FindMembers cache. Seems to have a negative impact on
23788 performance currently
23790 (MemberLookup): Nested types have full acess to
23791 enclosing type members
23793 Remove code that coped with instance/static returns for events, we
23794 now catch this in RealFindMembers.
23796 (RealFindMembers): only perform static lookup if the instance
23797 lookup did not return a type or an event.
23799 2002-05-17 Miguel de Icaza <miguel@ximian.com>
23801 * assign.cs (CompoundAssign): We pass more semantic information
23802 now to Compound Assignments than we did before: now we have all
23803 the information at hand, and now we resolve the target *before* we
23804 do the expression expansion, which allows the "CacheValue" method
23805 to have the effect we intended (before, a [x] += 1 would generate
23806 two differen ArrayAccess expressions from the ElementAccess,
23807 during the resolution process).
23809 (CompoundAssign.DoResolve): Resolve target and original_source here.
23811 2002-05-16 Miguel de Icaza <miguel@ximian.com>
23813 * expression.cs (ArrayAccess): dropped debugging information.
23815 * typemanager.cs: Small bug fix: I was always returning i_members,
23816 instead of one of i_members or s_members (depending on which had
23819 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
23820 method is invoked before any code generation takes place, and it
23821 is a mechanism to inform that the expression will be invoked more
23822 than once, and that the method should use temporary values to
23823 avoid having side effects
23825 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
23827 * ecore.cs (Expression.CacheTemporaries): Provide empty default
23830 * expression.cs (Indirection, ArrayAccess): Add support for
23831 CacheTemporaries in these two bad boys.
23833 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
23834 ldobj or ldind_ref.
23835 (StoreFromPtr): Handle stobj as well.
23837 * expression.cs (UnaryMutator): Share more code.
23839 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
23840 down: I was not tracking the Filter function as well, which
23841 was affecting the results of the cache.
23843 2002-05-15 Miguel de Icaza <miguel@ximian.com>
23845 * attribute.cs: Remove the hack to handle the CharSet property on
23848 2002-05-14 Miguel de Icaza <miguel@ximian.com>
23850 * attribute.cs (DoResolve): More uglyness, we now only try to
23851 resolve the attribute partially, to extract the CharSet
23852 information (only if we are a StructLayout attribute). Otherwise
23854 (GetExtraTypeInfo): Add some code to conditionally kill in the
23855 future this. I am more and more convinced that the .NET
23856 framework has special code to handle the attribute setting on
23859 * expression.cs (IsParamsMethodApplicable): Revert my previous
23860 foreach change here, it was wrong.
23862 2002-05-13 Miguel de Icaza <miguel@ximian.com>
23864 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
23865 (pp_expr): do not abort on unknown input, just return.
23866 (eval): abort if there are pending chars.
23868 * attribute.cs (Attribute.Resolve): Positional parameters are
23869 optional. Deal with that case.
23871 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
23872 the Ansi/Unicode/Auto information for the type.
23874 (TypeContainer.DefineType): instantiate the EmitContext here, as
23875 we will be using it during the type definition (to resolve
23876 attributes) and during the emit phase.
23878 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
23879 to pull type information out of the attributes
23881 (Attribute.Resolve): track the constructor builder, and allow for
23882 multiple invocations (structs and classes will use this).
23884 * ecore.cs (MemberLookupFinal): new version with all the
23885 parameters customizable.
23887 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
23888 constructors. Return if the result value is null (as the error
23889 would have been flagged already by MemberLookupFinal)
23891 Do not allow instances of abstract classes or interfaces to be
23894 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
23895 We have to compare the assembly property here when dealing with
23896 FamANDAssem and Assembly access modifiers, because we might be
23897 creating an assembly from *modules* (that means that we are not
23898 getting TypeBuilders for types defined in other modules that are
23899 part of this assembly).
23901 (Method.Emit): If the method is marked abstract and has a body,
23904 (TypeContainer.DefineMembers): If both the defined member and the
23905 parent name match are methods, then do not emit any warnings: let
23906 the Method.Define routine take care of flagging warnings. But if
23907 there is a mismatch (method overrides something else, or method is
23908 overriwritten by something, then emit warning).
23910 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
23911 set to null, this means `do not check for the return type on the
23914 (Method.Define): set the return type for the method signature to
23915 null, so that we get methods with the same name and parameters and
23916 different return types. This is used to flag warning 114 (you are
23917 hiding a method, and you probably want to use the new/override
23920 * typemanager.cs (MemberLookup): Implemented proper access
23921 control, closing a long standing set of bug reports. The problem
23922 was that the Framework only has two bits: Public and NonPublic,
23923 and NonPublic includes private and protected methods, but we need
23924 to enforce the FamANDAssem, FamOrAssem and Family.
23926 2002-05-11 Miguel de Icaza <miguel@ximian.com>
23928 * statement.cs (GotoCase): Return true: Ammounts to giving up
23929 knowledge on whether we return or not, and letting the other case
23930 be responsible for it.
23932 2002-05-10 Miguel de Icaza <miguel@ximian.com>
23934 * driver.cs: Do not load directories for each file processed, only
23935 do it if there is a pattern.
23937 * ecore.cs: Report readonly assigns here as well, as we might have
23938 been resolved only by MemberAccess.
23940 (SimpleName.SimpleNameResolve): Also be useful for LValue
23941 resolution. We need this to propagate assign to local readonly variables
23943 * typemanager.cs: Use a ptrhashtable for the criteria, because we
23944 do not want to reuse potential criteria memory.
23946 * class.cs (MyEventBuilder): Set reflected_type;
23948 * ecore.cs (Constantify): Added support for constifying bools.
23950 (RootContext.LookupType): Added a cache for values looked up in
23951 the declaration space.
23953 * typemanager.cs (FindMembers): Now is a front-end to
23954 RealFindMembers, and provides a two-level hashtable-based cache to
23957 15% performance improvement: from 22.5 to 19.2 seconds.
23959 * expression.cs (IsParamsMethodApplicable): use foreach.
23960 (Invocation.DoResolve): ditto.
23961 (New.DoResolve): ditto.
23962 (ArrayCreation.DoResolve): ditto.
23964 * ecore.cs (FindMostEncompassingType): use foreach.
23966 * delegate.cs (NewDelegate.DoResolve): Use foreach
23968 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
23969 (RemoveMethods): use foreach.
23971 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
23972 nested foreach statements instead of for, and also break out of
23973 the inner loop once a match is found.
23975 (Invocation.OverloadResolve): Use foreach, simplify the code.
23977 2002-05-08 Miguel de Icaza <miguel@ximian.com>
23979 * cfold.cs (BinaryFold): During an enumeration evaluation context,
23980 we actually unwrap the expression to allow for extra information
23983 * expression.cs: Use Shr_Un on unsigned operations.
23985 2002-05-08 Ravi Pratap <ravi@ximian.com>
23987 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
23988 applicable operators was not being considered correctly. This closes
23989 the bug Miguel reported.
23991 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
23993 * attribute.cs: check that the type derives from System.Attribute
23994 and report the correct error in that case (moved the duplicate code to
23995 its own method, too).
23997 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
23999 * attribute.cs: lookup attribute type name as the spec says: first the
24000 bare attribute name and then name + "Attribute" (nant compiles with
24001 mcs after this fix).
24003 2002-05-07 Miguel de Icaza <miguel@ximian.com>
24005 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
24006 Because of the way we parse things, we should try to see if a
24007 UIntConstant can fit in an integer.
24009 2002-05-07 Ravi Pratap <ravi@ximian.com>
24011 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24012 when we are in an explicit context.
24014 (ConvertReferenceExplicit): When converting from Iface type S to Class
24015 T make sure the rules are implemented as an OR.
24017 * parameter.cs (ParameterType): Make it a property for now although the
24018 purpose really isn't anything immediate.
24020 * expression.cs (Is*Applicable): Do better checking on the parameter type
24021 of a ref/out parameter. The ones from the system assemblies are already
24022 marked with the correct type so we don't need to do any correction.
24024 * ecore.cs (StandardConversionExists): Conversion from Interface types to
24025 the object type is standard too so include that.
24027 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24029 * ecore.cs (StandardConversionExists): Augment with missing code:
24030 deal with IntConstant, LongConstants and Enumerations.
24032 * assign.cs: Report the error, instead of failing silently
24034 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24035 typecontainer that they are declared, because the
24036 typecontainer/namespace will have the list of using clauses that
24037 need to be applied.
24039 Assembly Attributes were escaping the normal registration
24042 (EmitCode): Apply attributes within an EmitContext that represents
24043 the container they were declared on.
24045 * cs-parser.jay: Track bases for structs. How did I get this wrong?
24047 2002-05-06 Ravi Pratap <ravi@ximian.com>
24049 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24050 Revamp completely - make much cleaner as we now operate only
24053 (FindMostSpecificSource, FindMostSpecificTarget): New methods
24054 to implement the logic detailed in the spec more correctly.
24056 (UserDefinedConversion): Update accordingly.
24058 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24060 * statement.cs: Return flow analysis information up.
24062 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24065 (token): Do not consume an extra character before calling
24068 2002-05-06 Piers Haken <piersh@friskit.com>
24070 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24072 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24074 * class.cs (Constructor.Emit): Set the IsStatic flag in the
24075 EmitContext during the instance constructor initializer
24076 resolution, to stop access to instance variables.
24078 This is mandated by the spec, last paragraph of the `constructor
24079 initializers' section.
24081 2002-05-05 Miguel de Icaza <miguel@ximian.com>
24083 * cs-parser.jay, class.cs (Accessor): new class used to represent
24084 an accessor (get or set). In the past we used `null' to represent
24085 a missing accessor. But this is ambiguous because there was no
24086 way to tell in abstract indexers/properties if one of them was
24089 Now there is a way of addressing that.
24091 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24092 instead of FindMembers.
24094 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24095 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24097 * attribute.cs: Treat indexers and properties as the same in terms
24098 of applying attributes
24100 * ecore.cs (FindMostEncompassedType): Use statically initialized
24101 EmptyExpressions()s like we do elsewhere to avoid creating useless
24102 objects (and we take this out of the tight loop).
24104 (GetConversionOperators): Move the code to extract the actual
24105 operators to a separate routine to clean things up.
24107 2002-05-04 Miguel de Icaza <miguel@ximian.com>
24109 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24110 events are always registered FieldBuilders.
24112 * class.cs (FieldBase): New class shared by Fields
24114 * delegate.cs: If we are a toplevel delegate, use our full name.
24115 If we are a nested delegate, then only use our tail name.
24117 2002-05-02 Ravi Pratap <ravi@ximian.com>
24119 * expression.cs (IsApplicable): Ensure that we add the "&" to
24120 ref/out types before comparing it with the type of the argument.
24122 (IsParamsMethodApplicable): Ditto.
24124 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
24127 * delegate.cs : Handle the case when we have more than one applicable
24128 method. Flag an error only when we finish checking all.
24130 2002-05-02 Miguel de Icaza <miguel@ximian.com>
24132 * expression.cs: Add support for boolean static initializers.
24134 2002-05-01 Miguel de Icaza <miguel@ximian.com>
24136 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
24138 * parameter.cs (ComputeParameterTypes,
24139 ComputeAndDefineParameterTypes): Better error handling: now we
24140 clear the `types' cache if we fail during any of the type lookups.
24141 We also return the status code correctly to our caller
24143 * delegate.cs: If we fail to define a delegate, abort the extra
24146 * expression.cs (Binary.ResolveOperator): for
24147 operator==(object,object) and operator !=(object, object) we also
24148 have to verify that there is an implicit conversion from one to
24151 (ArrayAccess.DoResolve): Array Access can operate on
24154 2002-04-30 Miguel de Icaza <miguel@ximian.com>
24156 * assign.cs (CompoundAssign): A new class used as a "flag" that
24157 the assignment actually is happening as part of a compound
24158 assignment operator.
24160 During compound assignment, a few new rules exist to enable things
24167 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
24168 to the type of x) if y is implicitly convertible to the type of x,
24169 and the operator is a builtin operator and the return type of the
24170 operator is explicitly convertible to the type of x.
24172 * rootcontext.cs: Reset warning level to 2. 4 catches various
24173 "interesting" features in mcs, we must clean this up at some
24174 point, but currently am trying to kill other bugs ;-)
24176 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
24177 in container classes as well.
24179 * expression.cs (Binary.ResolveOperator): Handle string case
24180 before anything else (as operator overloading does emit an error
24181 before doing anything else).
24183 This code could go away when we move to a table driven model, but
24184 i could not come up with a good plan last night.
24186 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
24188 * typemanager.cs (CSharpName): reimplementation using regex.
24189 * class.cs: added null check for fields in Emit
24190 * rootcontext.cs: set warninglevel to 4
24192 2002-04-29 Miguel de Icaza <miguel@ximian.com>
24194 * typemanager.cs (CSharpName): reimplemented with Lupus
24197 2002-04-28 Miguel de Icaza <miguel@ximian.com>
24199 * statement.cs (If): correclty implement Resolve, because we were
24200 not catching sem errors in there. The same process is needed
24202 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
24205 (Statement.Warning_DeadCodeFound): Factorize code.
24206 (While): Report dead code here too.
24208 (Statement): Added Resolve virtual method to allow
24209 for resolution split from the emit code.
24211 2002-04-26 Miguel de Icaza <miguel@ximian.com>
24213 * statement.cs (EmitBoolExpression): No longer try to resolve the
24215 (MakeBoolean): New utility function that resolve, implicitly
24216 converts to boolean and tags the expression.
24219 (If, Do): Implement dead code elimination.
24220 (While): Implement loop inversion
24222 (Do, While, For, If): Resolve the expression prior to calling our
24225 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
24228 - added method Report28 (warning: program has more than one entry point)
24229 - added method IsEntryPoint, implements paragraph 10.1 of the spec
24230 - modified method Method.Define, the part at the end of the method
24232 * rootcontext.cs: added static public Location EntryPointLocation;
24234 * ../errors/cs0028.cs : Add test case for the above warning.
24237 - modified method CSharpName to allow arrays of primitive type to
24238 be printed nicely (e.g. instead of System.Int32[][] it now prints
24240 - added method CSharpSignature: returns the signature of a method
24241 in string format to be used in reporting errors, warnings, etc.
24243 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
24246 2002-04-26 Ravi Pratap <ravi@ximian.com>
24248 * delegate.cs (Define): Fix extremely silly bug where I was
24249 setting the type of the 'object' parameter of the BeginInvoke
24250 method to System.IAsyncResult instead of System.Object ;-)
24252 2002-04-26 Miguel de Icaza <miguel@ximian.com>
24254 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
24257 (Constructor.Emit): return if we fail to initialize the
24258 constructor. Another door closed!
24260 * expression.cs (New.DoResolve): Improve error message (from -6 to
24261 1501). Use DeclaredOnly lookup to find the exact constructor.
24263 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
24264 loop. This is useful.
24266 * cs-parser.jay: Adjust the default parameters so that destructors
24267 have the proper signature.
24269 2002-04-26 Martin Baulig <martin@gnome.org>
24271 * driver.cs (LoadAssembly): If `assembly' contains any characters
24272 which are only valid in path names and not in assembly names
24273 (currently slash, backslash and point), use Assembly.LoadFrom ()
24274 instead of Assembly.Load () on the `assembly' (before iteration
24275 over the link_paths).
24277 2002-04-26 Martin Baulig <martin@gnome.org>
24279 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
24281 2002-04-25 Miguel de Icaza <miguel@ximian.com>
24283 * class.cs (Property): use the new typemanager.MemberLookup
24285 (TypeContainer.MemberLookup): Implement using the
24286 TypeManager.MemberLookup now.
24288 * typemanager.cs: Make MemberLookup a function of the TypeManager,
24289 and return MemberInfos, so that these can be used without an
24290 EmitContext (what we had before).
24292 2002-04-24 Miguel de Icaza <miguel@ximian.com>
24294 * expression.cs: Fix the case where the argument to params if the
24295 type of the params. I omitted handling this before. Fixed
24297 2002-04-22 Miguel de Icaza <miguel@ximian.com>
24299 * driver.cs: Call BootCorlib_PopulateCoreType
24301 * class.cs (Property.CheckBase): Check for properties only, not
24304 * interface.cs: Temporary hack: try/catch around the
24305 CustomAttributeBuilder, because I am getting an exception that I
24308 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
24309 types whose definitions are required to be there (attributes are
24310 defined before standard types).
24312 Compute definitions as we boot the various types, as they are used
24313 immediately (value_type class will need object_type, but if we do
24314 not initialize object_type, we will pass a null, which will let
24315 the runtime pick the System.Object from the existing corlib, which
24316 is not what we want).
24318 2002-04-22 Patrik Torstensson <totte@labs2.com>
24320 * cs-tokenizer.cs: fixed a number of trim() issues.
24322 2002-04-22 Ravi Pratap <ravi@ximian.com>
24324 * expression.cs (Argument.Type): Ensure that we return the correct
24325 type when we have out or ref parameters [in which case we
24328 2002-04-22 Miguel de Icaza <miguel@ximian.com>
24330 * class.cs (Property, Indexer): Allow extern modifier in there.
24332 * typemanager.cs (InitBaseTypes): Initializes object_type and
24333 value_type, since those will be used early on during the bootstrap
24334 process to compile corlib.
24336 (InitCoreTypes): Move code from here to InitBaseTypes.
24338 2002-04-21 Miguel de Icaza <miguel@ximian.com>
24340 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
24341 single-dimension arrays as using the ldlen opcode.
24343 Daniel Lewis discovered this optimization.
24345 * typemanager.cs: Add signature for System.Array::get_Length
24347 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24349 * statement.cs: report the error when the foreach does not apply to an
24350 array nor a collection.
24352 2002-04-19 Miguel de Icaza <miguel@ximian.com>
24354 * expression.cs: Add implicit conversions to the operator ~.
24356 * constant.cs (DecimalConstant.Emit): Emit decimal value.
24358 * typemanager.cs: Locate the decimal constructor.
24360 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24362 * attribute.cs: use the new property of TypeOf.
24363 * expression.cs: added 'get' property around typearg.
24365 These changes fix a build breaker reported by NickD. Is this the
24366 correct way to fix? If not, please, revert my changes and make it
24369 2002-04-17 Miguel de Icaza <miguel@ximian.com>
24371 * attribute.cs: Add support for typeof in attribute invocations.
24372 I am not sure that this is right though.
24374 2002-04-14 Duncan Mak <duncan@ximian.com>
24376 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
24377 Binary.Operator.Division case.
24379 2002-04-13 Ravi Pratap <ravi@ximian.com>
24381 * class.cs (DefineType): Ensure that we do a proper check on
24382 attribute types and also register it with the TypeManager.
24384 (TypeContainer.Targets): The default for attribute types is
24385 AttributeTargets.All.
24387 * attribute.cs (ApplyAttributes): Registering the attribute type
24388 is done elsewhere, not when we discover we have a Usage attribute.
24390 2002-04-12 Ravi Pratap <ravi@ximian.com>
24392 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
24393 and get rid of is_delegate parameter.
24395 * everywhere : update.
24397 2002-04-12 Ravi Pratap <ravi@ximian.com>
24399 * cs-parser.jay (compilation_unit): Revamp completely to use
24400 some new ideas that I got from Rhys' grammar to solve the problems
24401 with assembly level attributes.
24403 (outer_declaration): New grammar production.
24405 (attribute_sections): Add.
24407 (opt_attributes): Base on attribute_sections
24409 (namespace_declaration): Allow opt_attributes to tackle the case
24410 when we have assembly level attributes - we are clever in this
24413 * attribute.cs (ApplyAttributes): Do not worry about assembly
24414 attributes in the non-global context.
24416 * rootcontext.cs (AddGlobalAttributes): Go back to using this
24417 instead of SetGlobalAttributes.
24419 * class.cs, rootcontext.cs : Ensure we define and generate
24420 attribute types before anything else.
24422 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
24423 and flag the new error -20 for the case when the attribute type
24424 does not have valid targets specified. csc does not catch this.
24426 * ../errors/errors.txt : update for error # -20
24428 2002-04-11 Ravi Pratap <ravi@ximian.com>
24430 * support.cs (InternalParameters.ParameterModifier): Do some null
24431 checking and return sane values.
24433 * class.cs (Method.Define): If we are a PInvoke method, ensure
24434 that we are static and extern. Report error # 601
24436 * ../errors/cs0601.cs : Add test case for the above error.
24438 2002-04-07 Ravi Pratap <ravi@ximian.com>
24440 * rootcontext.cs (attribute_types): We need to keep type of
24441 all attribute types separately and emit code for them first.
24443 (RegisterAttribute) : Implement.
24445 * class.cs (DefineType): Check if the current Type is a custom
24446 attribute type and register it accordingly.
24448 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
24449 adding the first attribute twice and rename to
24451 (SetGlobalAttributes): this.
24453 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
24456 * attribute.cs (ApplyAttributes): Take an additional argument telling us
24457 if we are processing global arguments. Hmm, I am unsure of this.
24459 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24461 * expression.cs: added static array of strings to avoid calling
24462 Enum.ToString () for Operator in Binary. Significant recover of
24465 2002-04-10 Miguel de Icaza <miguel@ximian.com>
24467 * class.cs (FindMembers): Allow the Builders of the various
24468 members to be null. If they are skip them. This only happens
24469 during the PInvoke declaration.
24471 2002-04-09 Miguel de Icaza <miguel@ximian.com>
24473 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
24474 failure, so we do not keep going afterwards.
24476 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
24477 wanted to pass `false' as the `is_delegate' argument. If this is
24478 the case, why not use delegate_type == null to mean `is_delegate =
24479 false' and anything else as is_delegate = true.
24481 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
24483 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
24484 code for the section, not the beginning of the tests.
24486 2002-04-08 Miguel de Icaza <miguel@ximian.com>
24488 * cfold.cs: Handle operator + (Enum x, Underlying x)
24490 * expression.cs (Binary): same. Warn about errors where we have
24491 Enum/Enum in operator + as well.
24493 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
24496 - added support for switch(bool)
24497 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
24498 - add TableSwitchEmit() to handle table-based switch statements
24500 2002-04-05 Ravi Pratap <ravi@ximian.com>
24502 * expression.cs (Invocation.OverloadResolve): Factor out code which
24503 does parameter compatibility checking with arguments so that we can
24504 re-use the code even from Delegate.VerifyApplicability
24506 (VerifyArgumentsCompat): Move above code here.
24508 * delegate.cs (VerifyApplicability): Get rid of duplicate code
24509 and instead make a call to the above method.
24511 2002-03-31 Ravi Pratap <ravi@ximian.com>
24513 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
24514 We use it to keep track of classes which are attribute types.
24516 2002-04-02 Miguel de Icaza <miguel@ximian.com>
24518 * delegate.cs (Delegate.Define): Correctly define the types in the
24519 presence of fixed and array parameters.
24521 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
24524 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
24525 include NonPublic after the first iteration.
24527 * class.cs (Indexer.CheckBase): Only check if both parents are
24530 * cs-parser.jay (accessor_body): If empty, set to null.
24532 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
24533 same code path here to resolve constants names that we did have in
24534 MemberAccess.DoResolve. There is too much code duplicated here.
24536 2002-04-01 Miguel de Icaza <miguel@ximian.com>
24538 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
24540 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
24543 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
24544 tokens, numbers and strings.
24546 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
24549 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
24550 asyncronous parameters and the regular parameters.
24552 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
24553 specify the target directory.
24555 * expression.cs: (This.DoResolve): Simplify
24556 (As.Emit): Optimize, do not generate IsInst if the expression is
24557 always of the given type.
24559 (Is.DoResolve): Bug fix, we were reporting both always/never for
24562 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
24563 creating too many unnecessary arrays.
24565 2002-03-31 Miguel de Icaza <miguel@ximian.com>
24567 * class.cs (EmitFieldInitializer): Use Assign expression to assign
24568 fields instead of rolling our own initializer. Takes care of all
24569 implicit conversions, and drops unnecessary static checks/argument.
24571 2002-03-31 Dick Porter <dick@ximian.com>
24573 * driver.cs: use the GetDirectories() return values properly, and
24574 use "/" as path separator.
24576 2002-03-30 Miguel de Icaza <miguel@ximian.com>
24578 * expression.cs (Unary): Optimize - - expr into expr.
24579 (Binary): Optimize a + (-b) into a -b.
24581 * codegen.cs (CodeGen): Made all methods static.
24583 2002-03-29 Miguel de Icaza <miguel@ximian.com>
24587 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
24588 TypeBuilder property.
24590 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
24593 * tree.cs: Removed the various RecordXXXX, and replaced with a
24594 single RecordDecl. Removed all the accessor methods, and just
24595 left a single access point Type
24597 * enum.cs: Rename DefineEnum to DefineType.
24599 * decl.cs: New abstract method `DefineType' used to unify the
24600 Defines for Enumerations, Interfaces, TypeContainers and
24603 (FindType): Moved LookupInterfaceOrClass here. Moved the
24604 LookupBaseClasses method that used to live in class.cs and
24605 interface.cs here, and renamed to FindType.
24607 * delegate.cs: Implement DefineType. Take advantage of the
24608 refactored pattern for locating the parent builder without taking
24609 the parent_builder argument (which we know does not work if we are
24610 nested, and triggering a toplevel definition).
24612 2002-03-28 Miguel de Icaza <miguel@ximian.com>
24614 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
24615 accessibility of a member has changed during override and report
24618 * class.cs (Method.Define, Property.Define): Only complain on
24619 overrides if the method is private, any other accessibility is
24620 fine (and since we just checked the permission is the same, we are
24623 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
24624 and elif are processed always. The other pre-processing
24625 directives are only processed if we are "taking" the path
24627 2002-03-29 Martin Baulig <martin@gnome.org>
24629 * class.cs (Method.Emit): Only emit symbolic debugging info if the
24630 current location is not Null.
24632 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
24633 a separate method so we can profile it.
24635 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
24636 `span.Seconds' are just seconds, but no minutes or hours.
24637 (MainDriver): Profile the CodeGen.SaveSymbols calls.
24639 2002-03-28 Miguel de Icaza <miguel@ximian.com>
24641 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
24642 Remove the gratuitous set of Final:
24644 // If an interface implementation, then we can set Final.
24645 if (((flags & MethodAttributes.Abstract) == 0) &&
24646 implementing.DeclaringType.IsInterface)
24647 flags |= MethodAttributes.Final;
24649 I do not know what I was smoking when I used that.
24652 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
24653 step into fixing the name resolution issues for delegates and
24654 unifying the toplevel name resolution.
24656 2002-03-28 Martin Baulig <martin@gnome.org>
24658 * class.cs (Method.Emit): If we have a symbol writer, call its
24659 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
24660 tell it about the current method.
24662 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
24663 writer that we're going to emit the first byte of IL code for a new
24664 statement (a new source line).
24665 (EmitContext.EmitTopBlock): If we have a symbol writer, call
24666 EmitContext.Mark() before emitting any code.
24668 * location.cs (SymbolDocument): Return null when we're Null.
24670 * statement.cs (Statement): Moved the `Location loc' variable here.
24671 (Statement.EmitBoolExpression): If we have a symbol writer, call
24672 ec.Mark() before emitting any code to tell it that we're at the
24673 beginning of a new statement.
24674 (StatementExpression): Added `Location' argument to the constructor.
24675 (Block): Added public readonly variable `StartLocation' and public
24676 variable `EndLocation'. The latter is to be set using SetEndLocation().
24677 (Block): Added constructor which takes a start and end location.
24678 (Block.SetEndLocation): New method. This sets the end location.
24679 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
24680 local variables we create.
24681 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
24682 each statement and do also mark the begin and end of the block.
24684 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
24685 tell it the current lexer.Location, use Location.Null for the end of the
24687 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
24688 current block, set its end location using SetEndLocation().
24689 (statement_expression): StatementExpression constructor now takes the
24690 lexer.Location as additional argument.
24691 (for_statement, declare_local_variables): Likewise.
24692 (declare_local_variables): When creating a new implicit block, use the
24693 new Block constructor and pass it the lexer.Location.
24695 2002-03-28 Miguel de Icaza <miguel@ximian.com>
24697 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
24698 members also on the parent interfaces recursively.
24700 2002-03-27 Miguel de Icaza <miguel@ximian.com>
24702 * report.cs: Use new formats, since Gonzalo finished the missing
24705 * expression.cs (Binary.ResolveOperator): added missing operator|
24706 operator& and operator^ for bool/bool.
24708 * cs-parser.jay: CheckDef now takes a Location argument that is
24709 used to report errors more precisly (instead of reporting the end
24710 of a definition, we try to track something which is a lot closer
24711 to the source of the problem).
24713 * cs-tokenizer.cs: Track global token use, so we can properly flag
24714 the use of #define/#undef after the first token has been seen.
24716 Also, rename the reportXXXX to Error_DescriptiveName
24718 * decl.cs (DeclSpace.IsTopLevel): Move property here from
24719 TypeContainer, so that Enum and Interface can use this too.
24721 * class.cs (TypeContainer.LookupInterfaceOrClass,
24722 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
24723 `builder' argument. Typically this was used to pass the parent
24724 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
24727 The problem is that a nested class could trigger the definition of
24728 a toplevel class, and the builder would be obviously wrong in that
24731 So we drop this argument, and we compute dynamically the
24732 TypeBuilder/ModuleBuilder (the correct information was available
24733 to us anyways from DeclSpace.Parent)
24735 * interface.cs (Interface.DefineInterface): Drop builder
24736 parameter cleanup like class.cs
24738 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
24741 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
24744 (Try.Emit): Propagate the returns value from the statement.
24746 (Return.Emit): Even if we are leavning
24748 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
24750 * modifiers.cs: Fix the computation of MethodAttributes flags.
24752 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
24754 * driver.cs: allow compilation of files that start with '/'.
24755 Add a default case when checking the argument of --target.
24757 2002-03-25 Miguel de Icaza <miguel@ximian.com>
24759 * interface.cs: Implement the same search algorithm for types in
24760 the interface code.
24762 * delegate.cs: Do not allow multiple definition.
24764 * Recovered ChangeLog that got accidentally amputated
24766 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
24768 * rootcontext.cs: Load manually enum to allow core classes to
24769 contain enumerations.
24771 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
24772 Update to new static methods in TypeManager.
24774 * typemanager.cs (GetMethod, GetConstructor): Use our
24775 implementation of FindMembers to find the members, since during
24776 corlib compilation, the types are TypeBuilders and GetMethod and
24777 GetConstructor do not work.
24779 Make all methods in TypeManager static.
24781 (InitCodeHelpers): Split the functionality from
24782 the InitCodeTypes function.
24784 * driver.cs: Call InitCodeHelpers after we have populated the
24787 * cs-parser.jay (delegate_declaration): we did not used to compute
24788 the delegate name correctly for void delegates.
24790 2002-03-24 Miguel de Icaza <miguel@ximian.com>
24792 * rootcontext.cs (RootContext): Init the interface_resolve_order
24793 and type_container_resolve_order always.
24795 (ResolveCore, BootstrapCorlib_ResolveClass,
24796 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
24797 compiler when compiling with --nostdlib
24799 * class.cs (TypeContainer.DefineType): Check that our parent is
24800 not null. This test is most important when we are bootstraping
24803 * codegen.cs: Split out the symbol writing code.
24805 2002-03-25 Martin Baulig <martin@gnome.org>
24807 * driver.cs (-g): Made -g an alias for --debug.
24809 2002-03-24 Martin Baulig <martin@gnome.org>
24811 * codegen.cs (SymbolWriter): New public variable. Returns the
24812 current symbol writer.
24813 (CodeGen): Added `bool want_debugging_support' argument to the
24814 constructor. If true, tell the ModuleBuild that we want debugging
24815 support and ask it for the ISymbolWriter.
24816 (Save): If we have a symbol writer, call it's Close() method after
24817 saving the assembly.
24819 * driver.c (--debug): New command line argument to create a
24820 debugger information file.
24822 * location.cs (SymbolDocument): New public property. Returns an
24823 ISymbolDocumentWriter object for the current source file or null
24824 if we don't have a symbol writer.
24826 2002-03-21 Miguel de Icaza <miguel@ximian.com>
24828 * driver.cs (LoadAssembly): Correctly return when all the paths
24829 have been tried and not before.
24831 * statement.cs (Switch.Emit): return the actual coverage for this
24832 statement (returns/not-returns)
24834 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
24835 switch of the statement if we are the last switch section. That
24836 kills two problems: try/catch problems (we used to emit an empty
24837 nop at the end) and switch statements where all branches would
24840 2002-03-19 Miguel de Icaza <miguel@ximian.com>
24842 * driver.cs: Add default assemblies (the equivalent to the
24843 Microsoft CSC.RSP file)
24845 * cs-tokenizer.cs: When updating `cols and setting it to zero,
24846 also update tokens_seen and set it to false.
24848 * driver.cs: Implement --recurse for Mike.
24850 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
24851 correctly splitting out the paths.
24853 2002-03-18 Miguel de Icaza <miguel@ximian.com>
24855 * interface.cs (Interface.PopulateProperty): Instead of using
24856 `parent' as the declaration space for the set parameters, use
24859 * support.cs (InternalParameters): InternalParameters constructor
24860 takes a DeclSpace instead of a TypeContainer.
24862 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
24863 types are being initialized, load the address of it before calling
24866 (New): Provide a mechanism to disable the generation of local
24867 value type temporaries when the caller will be providing us with
24868 an address to store it.
24870 (ArrayCreation.EmitDynamicInitializers): Use it.
24872 2002-03-17 Miguel de Icaza <miguel@ximian.com>
24874 * expression.cs (Invocation.EmitArguments): Only probe for array
24875 property if there is more than one argument. Sorry about that.
24877 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
24878 empty param arrays.
24880 * class.cs (Method.LabelParameters): Fix incorrect code path that
24881 prevented the `ParamArrayAttribute' from being applied to the
24884 2002-03-16 Miguel de Icaza <miguel@ximian.com>
24886 * support.cs (ReflectionParameters): Correctly compute whether the
24887 last argument is a params array. Fixes the problem with
24890 * typemanager.cs: Make the assemblies array always be non-null
24891 (empty, but non-null)
24893 * tree.cs (RecordDecl): New function that abstracts the recording
24894 of names. This reports error 101, and provides a pointer to the
24895 previous declaration. Fixes a crash in the compiler.
24897 * cs-parser.jay (constructor_declaration): Update to new grammar,
24898 and provide a constructor_body that can be empty.
24900 2002-03-15 Miguel de Icaza <miguel@ximian.com>
24902 * driver.cs: Add support for --resources.
24904 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
24905 Make all types for the various array helper methods be integer.
24907 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
24908 CheckState to ConvCast.
24910 (ConvCast): Now it takes a `checked' state argument, to avoid
24911 depending on the emit context for the conversion, and just using
24912 the resolve time setting.
24914 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
24915 instead of Invocation.EmitArguments. We do not emit the original
24916 arguments, instead we emit those which have been converted to
24917 unsigned int expressions.
24919 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
24921 * codegen.cs: ditto.
24923 * expression.cs (LocalVariableReference): Drop the use of the
24924 Store function that depended on the variable index.
24926 * statement.cs (VariableInfo): Drop the `Idx' property from this
24927 class, as this is not taking into account the indexes for
24928 temporaries tat we generate during the execution, getting the
24931 * class.cs: First emit class initializers, then call the parent
24934 * expression.cs (Binary): Fix opcode emision.
24935 (UnaryMutator.EmitCode): Support checked code generation
24937 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
24938 matches for events for both the Static and Instance scans,
24939 pointing to the same element. Fix that.
24941 2002-03-14 Miguel de Icaza <miguel@ximian.com>
24943 * rootcontext.cs (ResolveTree): Always set the
24944 interface_resolve_order, because nested interfaces will be calling
24947 * class.cs (GetInterfaceOrClass): Track the same resolution
24948 process used by TypeManager.LookupType. This fixes the nested
24949 type lookups in class declarations (separate path from
24952 (TypeContainer.DefineType): Also define nested interfaces.
24953 (TypeContainer.RegisterOrder): New public function used to
24954 register the order in which child interfaces need to be closed.
24956 Nested interfaces need to be closed after their parents have been
24959 * interface.cs (InterfaceAttr): Put all the logic for computing
24960 the interface attribute here.
24962 (DefineInterface): Register our interface order with the
24963 RootContext or with the TypeContainer depending on the case.
24965 2002-03-12 Miguel de Icaza <miguel@ximian.com>
24967 * cs-parser.jay: rework foreach statement to work with the new
24968 changes to the policy on SimpleNames.
24970 * report.cs: support Stacktrace on warnings as well.
24972 * makefile: drop --unsafe and /unsafe from the compile.
24974 2002-03-13 Ravi Pratap <ravi@ximian.com>
24976 * ecore.cs (StandardConversionExists): Modify to take an Expression
24977 as the first parameter. Ensure we do null -> reference type conversion
24980 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
24981 temporary Expression objects.
24983 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
24985 * interface.cs: workaround bug in method overloading resolution
24986 (there is already a bugzilla bug for it).
24988 2002-03-12 Miguel de Icaza <miguel@ximian.com>
24990 We could also solve this problem by having a separate path for
24991 performing type lookups, instead of DoResolve, we could have a
24992 ResolveType entry point, and only participating pieces of the
24993 production (simplename, deref, array) would implement this.
24995 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
24996 signal SimpleName to only resolve type names and not attempt to
24997 resolve anything else.
24999 * expression.cs (Cast): Set the flag.
25001 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25003 * class.cs: Only report 108 if there is no `new' modifier.
25005 * cs-parser.jay: rework foreach statement to work with the new
25006 changes to the policy on SimpleNames.
25008 * report.cs: support Stacktrace on warnings as well.
25010 * makefile: drop --unsafe and /unsafe from the compile.
25012 2002-03-11 Miguel de Icaza <miguel@ximian.com>
25014 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25015 lookups here, instead of doing that at parse time. This means
25016 that our grammar will not introduce `LocalVariableReferences' as
25017 expressions at this point. That solves the problem of code like
25021 static void Main ()
25025 This is only half the fix. The full fix requires parameters to
25026 also be handled in this way.
25028 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25029 makes the use more obvious of the DeclSpace. The
25030 ec.TypeContainer.TypeBuilder is now only used to pull the
25031 TypeBuilder for it.
25033 My theory is that I can get rid of the TypeBuilder completely from
25034 the EmitContext, and have typecasts where it is used (from
25035 DeclSpace to where it matters).
25037 The only pending problem is that the code that implements Aliases
25038 is on TypeContainer, and probably should go in DeclSpace.
25040 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25041 lookups here, instead of doing that at parse time. This means
25042 that our grammar will not introduce `LocalVariableReferences' as
25043 expressions at this point. That solves the problem of code like
25047 static void Main ()
25051 This is only half the fix. The full fix requires parameters to
25052 also be handled in this way.
25054 * class.cs (Property.DefineMethod): When implementing an interface
25055 method, set newslot, when implementing an abstract method, do not
25056 set the flag (before we tried never setting it, or always setting
25057 it, which is the difference).
25058 (Indexer.DefineMethod): same.
25059 (Method.DefineMethod): same.
25061 * ecore.cs: Only set the status used flag if we get back a Field.
25063 * attribute.cs: Temporary hack, so Paolo can keep working.
25065 2002-03-08 Ravi Pratap <ravi@ximian.com>
25067 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25068 the unmanaged type in the case we have a MarshalAs attribute.
25070 (Resolve): Handle the case when we are parsing the special MarshalAs
25071 attribute [we need to store the unmanaged type to use later]
25073 * typemanager.cs (marshal_as_attr_type): Built in type for the
25074 MarshalAs Attribute.
25076 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
25077 on parameters and accordingly set the marshalling info.
25079 2002-03-09 Miguel de Icaza <miguel@ximian.com>
25081 * class.cs: Optimizing slightly by removing redundant code after
25082 we switched to the `NoTypes' return value.
25083 (Property.DefineMethod): use NoTypes here too.
25085 This fixes the bug I introduced in my last batch of changes.
25087 2002-03-05 Ravi Pratap <ravi@ximian.com>
25089 * tree.cs (RecordEnum): Add. We now keep track of enums too.
25091 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25092 Enums since those are types too.
25094 * cs-parser.jay (enum_declaration): Record enums as we parse them.
25096 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
25097 thanks to a call during the lookup process.
25099 2002-03-07 Miguel de Icaza <miguel@ximian.com>
25101 * statement.cs (Foreach): Lots of work to accomodate a particular
25102 kind of foreach statement that I had not kept in mind. It is
25103 possible to have foreachs on classes that provide a GetEnumerator
25104 method that return objects that implement the "pattern" for using
25105 a foreach, there is no need to support GetEnumerator
25108 This is needed to compile nant.
25110 * decl.cs: Only report 114 if the member is not `Finalize' and if
25111 the warning level is at least 2.
25113 * class.cs: Moved the compare function from Method to
25116 (MethodSignature.InheritableMemberSignatureCompare): Add new
25117 filter function that is used to extract inheritable methods from a
25120 (Method.Define): Use the new `inheritable_method_signature_filter'
25123 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25126 2002-03-06 Miguel de Icaza <miguel@ximian.com>
25128 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
25130 * cs-parser.jay: Add opt_semicolon to the interface declaration.
25132 * expression.cs: Pass location information to
25133 ConvertImplicitStandard.
25135 * class.cs: Added debugging code to track return values from
25138 2002-03-05 Miguel de Icaza <miguel@ximian.com>
25140 * expression.cs (Is.DoResolve): If either side of the `is' is an
25141 interface, do not flag the warning.
25143 * ecore.cs (ImplicitReferenceConversion): We need a separate test
25146 * report.cs: Allow for --fatal to be used with --probe.
25148 * typemanager.cs (NoTypes): Move the definition for the empty Type
25151 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
25153 (TypeContainer.DefineProxy): New function used to proxy to parent
25154 implementations when implementing interfaces.
25155 (TypeContainer.ParentImplements): used to lookup if our parent
25156 implements a public function that is required by an interface.
25157 (TypeContainer.VerifyPendingMethods): Hook this up.
25159 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
25160 `modules' and `assemblies' arraylists into arrays. We only grow
25161 these are the very early start up of the program, so this improves
25162 the speedof LookupType (nicely measured).
25164 * expression.cs (MakeByteBlob): Replaced unsafe code with
25165 BitConverter, as suggested by Paolo.
25167 * cfold.cs (ConstantFold.Binary): Special case: perform constant
25168 folding of string concatenation, but if either side is a string,
25169 and the other is not, then return null, and let the runtime use
25170 the concatenation on the string plus the object (using
25171 `Object.ToString').
25173 2002-03-04 Miguel de Icaza <miguel@ximian.com>
25175 Constant Folding has been implemented now.
25177 * expression.cs (Unary.Reduce): Do not throw an exception, catch
25178 the error instead on types that are not supported in one's
25181 * constant.cs (Constant and all children): New set of functions to
25182 perform implict and explicit conversions.
25184 * ecore.cs (EnumConstant): Implement the new functions to perform
25185 conversion by proxying to the child expression.
25187 * codegen.cs: (ConstantCheckState): Constant evaluation has its
25188 own separate setting that can not be turned off from the command
25189 line using --unchecked or --checked and is only controlled using
25190 the checked/unchecked statements and expressions. This setting is
25191 used by the constant folder to flag errors.
25193 * expression.cs (CheckedExpr, UncheckedExpr): Set the
25194 ConstantCheckState as well.
25196 During Resolve, they also have to flag the state, because the
25197 constant folder runs completely in the Resolve phase.
25199 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
25202 2002-03-01 Miguel de Icaza <miguel@ximian.com>
25204 * cfold.cs: New file, this file contains the constant folder.
25206 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
25207 argument to track whether we are using the resulting address to
25208 load or store a value and provide better error messages.
25210 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
25211 new AddressOf arguments.
25213 * statement.cs (Foreach.EmitCollectionForeach): Update
25215 * expression.cs (Argument.Emit): Call AddressOf with proper
25216 arguments to track usage.
25218 (New.DoEmit): Call AddressOf with new arguments.
25220 (Unary.Emit): Adjust AddressOf call.
25222 2002-03-01 Ravi Pratap <ravi@ximian.com>
25224 * cs-parser.jay (member_access): Change the case for pre-defined types
25225 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
25228 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
25231 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
25232 essentially like methods and apply attributes like MethodImplOptions to them too.
25234 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
25237 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
25238 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
25241 * Update code everywhere accordingly.
25243 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
25245 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
25247 2002-02-28 Ravi Pratap <ravi@ximian.com>
25249 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
25250 try performing lookups against those instead of jumping straight into using
25251 the 'using' clauses.
25253 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
25255 (LookupType): Perform lookups in implicit parents too.
25257 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
25258 sequence as RootContext.LookupType.
25260 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
25261 the various cases of namespace lookups into this method.
25263 2002-03-01 Miguel de Icaza <miguel@ximian.com>
25265 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
25266 in positional arguments)
25268 * class.cs (Operator): Update the AllowedModifiers to contain
25271 * cs-parser.jay: Update operator declaration to allow for the
25272 operator body to be empty.
25274 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
25277 2002-02-27 Miguel de Icaza <miguel@ximian.com>
25279 * class.cs (Method.Emit): Label parameters.
25281 * driver.cs: Return 1 or 0 as the program exit code.
25283 2002-02-26 Miguel de Icaza <miguel@ximian.com>
25285 * expression.cs: Special case the `null' object when trying to
25286 auto-compute the type, as anything can be explicitly converted to
25289 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
25290 spotting this Paolo.
25292 (Expression.ImplicitNumericConversion): Perform comparissions of
25293 the type using the underlying type in the case of an enumeration
25294 rather than using the enumeration type for the compare.
25296 Cope with the underlying == type case, which is not possible to
25299 (Expression.ConvertNumericExplicit): Perform comparissions of
25300 the type using the underlying type in the case of an enumeration
25301 rather than using the enumeration type for the compare.
25303 * driver.cs: If the user does not supply an extension, assume .exe
25305 * cs-parser.jay (if_statement): Rewrote so that we can track the
25306 location for the if statement.
25308 * expression.cs (Binary.ConstantFold): Only concat strings when
25309 the operation is "+", not everything ;-)
25311 * statement.cs (Statement.EmitBoolExpression): Take a location
25313 (If, While, Do): Track location.
25315 * expression.cs (Binary.ResolveOperator): In the object + string
25316 case, I was missing a call to ConvertImplicit
25318 2002-02-25 Ravi Pratap <ravi@ximian.com>
25320 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
25321 Location arguments. Ensure we use RootContext.LookupType to do our work
25322 and not try to do a direct Type.GetType and ModuleBuilder.GetType
25324 * interface.cs (PopulateMethod): Handle the type of the parameter being
25327 * expression.cs (Invocation.BetterFunction): Handle the case when we
25328 have a params method with no fixed arguments and a call is made with no
25331 2002-02-25 Miguel de Icaza <miguel@ximian.com>
25333 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
25334 the verbatim-string-literal
25336 * support.cs (InternalParameters.ParameterModifier): handle null
25338 (InternalParameters.ParameterType): ditto.
25340 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
25341 duplicating the name of the variable parameter.
25342 (GetParameterByName): Fix bug where we were not looking up array
25343 paramters if they were the only present (thanks Paolo!).
25344 (GetParameterInfo): We only have an empty set of types if both
25345 fixed and array are set to null.
25346 (GetParameterInfo-idx): Handle FixedParameter == null
25348 * cs-parser.jay: Handle the case where there is no catch
25349 statements (missing null test).
25351 2002-02-22 Miguel de Icaza <miguel@ximian.com>
25353 * driver.cs (MainDriver): Be conservative on our command line
25356 Catch DirectoryNotFoundException when calling GetFiles.
25358 (SplitPathAndPattern): Used to split the input specification into
25359 a path and a pattern that we can feed to Directory.GetFiles.
25361 2002-02-21 Miguel de Icaza <miguel@ximian.com>
25363 * statement.cs (Fixed): Implement the last case of the Fixed
25364 statement (string handling).
25366 * expression.cs (StringPtr): New class used to return a char * to
25367 a string; Used by the Fixed statement.
25369 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
25371 * expression.cs (Binary.ResolveOperator): Remove redundant
25372 MemberLookup pn parent type.
25373 Optimize union call, we do not need a union if the types are the same.
25374 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
25377 Specialize the use of MemberLookup everywhere, instead of using
25378 the default settings.
25380 (StackAlloc): Implement stackalloc keyword.
25382 * cs-parser.jay: Add rule to parse stackalloc.
25384 * driver.cs: Handle /h, /help, /?
25386 * expression.cs (MakeByteBlob): Removed the hacks we had in place
25387 before we supported unsafe code.
25389 * makefile: add --unsafe to the self compilation of mcs.
25391 2002-02-20 Miguel de Icaza <miguel@ximian.com>
25393 * expression.cs (PointerArithmetic): New class that is used to
25394 perform pointer arithmetic.
25395 (Binary.Resolve): Handle pointer arithmetic
25396 Handle pointer comparission.
25397 (ArrayPtr): Utility expression class that is used to take the
25398 address of an array.
25400 (ElementAccess): Implement array access for pointers
25402 * statement.cs (Fixed): Implement fixed statement for arrays, we
25403 are missing one more case before we are done.
25405 * expression.cs (Indirection): Implement EmitAssign and set the
25406 ExprClass to Variable. This allows pointer dereferences to be
25407 treated as variables, and to have values assigned to them.
25409 * ecore.cs (Expression.StoreFromPtr): New utility function to
25410 store values dereferencing.
25412 2002-02-20 Ravi Pratap <ravi@ximian.com>
25414 * expression.cs (Binary.ResolveOperator): Ensure that we are
25415 not trying to operate on a void type - this fixes the reported
25418 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
25419 the parent implementation is sealed.
25421 * ../errors/cs0239.cs : Add.
25423 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
25425 * typemanager.cs (unverifiable_code_type): Corresponds to
25426 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
25427 which have unsafe code in them.
25429 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
25432 2002-02-19 Miguel de Icaza <miguel@ximian.com>
25434 * cs-tokenizer.cs: Add support for @"litreal strings"
25436 Make tokenizer accept pre-processor directives
25437 on any column (remove the old C-like limitation).
25439 * rootcontext.cs (EmitCode): Emit any global attributes.
25440 (AddGlobalAttributes): Used to keep track of assembly attributes.
25442 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
25444 * cs-parser.jay: Add support for global attributes.
25446 2002-02-17 Miguel de Icaza <miguel@ximian.com>
25448 * expression.cs (Indirection): New helper class. Unary will
25449 create Indirection classes to be able to implement the
25450 IMemoryLocation interface on it.
25452 2002-02-16 Miguel de Icaza <miguel@ximian.com>
25454 * cs-parser.jay (fixed_statement): reference the right statement.
25456 * statement.cs (Fixed.Emit): Finish implementing the fixed
25457 statement for the &x case.
25459 2002-02-14 Miguel de Icaza <miguel@ximian.com>
25461 * class.cs (Property.Define, Method.Define): Remove newslot when
25464 * modifiers.cs: My use of NewSlot when `Abstract' was set was
25465 wrong. NewSlot should only be used if the `new' keyword is present.
25467 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
25468 locating our system dir. Sorry about this.
25470 2002-02-13 Miguel de Icaza <miguel@ximian.com>
25472 * driver.cs (GetSystemDir): Compute correctly the location of our
25473 system assemblies. I was using the compiler directory instead of
25474 the library directory.
25476 2002-02-13 Ravi Pratap <ravi@ximian.com>
25478 * expression.cs (BetterFunction): Put back in what Miguel commented out
25479 since it is the correct fix. The problem is elsewhere ;-)
25481 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
25482 parameters of the parms method are themselves compatible or not !
25484 (StandardConversionExists): Fix very dangerous bug where we were forgetting
25485 to check that a class implements an interface before saying that an implicit
25486 conversion was allowed. Use ImplementsInterface to do the checking.
25488 2002-02-13 Miguel de Icaza <miguel@ximian.com>
25490 * class.cs (Method.Define): Track whether we are an explicit
25491 implementation or not. And only call DefineMethodOverride if we
25492 are an explicit implementation.
25494 (Property.DefineMethod): Ditto.
25496 2002-02-11 Ravi Pratap <ravi@ximian.com>
25498 * expression.cs (BetterFunction): Catch hideous bug which was
25499 preventing us from detecting ambiguous calls due to implicit casts i.e
25502 2002-01-29 Miguel de Icaza <miguel@ximian.com>
25504 * support.cs (Pair): Remove un-needed method. I figured why I was
25505 getting the error in cs-parser.jay, the variable in a foreach loop
25506 is readonly, and the compiler does not really treat this as a variable.
25508 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
25509 instead of EQUALS in grammar.
25511 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
25513 * expression.cs (Unary.DoResolve): Check whether the argument is
25516 2002-01-28 Miguel de Icaza <miguel@ximian.com>
25518 * support.cs: Api for Pair to set a value. Despite the fact that
25519 the variables are public the MS C# compiler refuses to compile
25520 code that accesses the field if the variable is part of a foreach
25523 * statement.cs (Fixed): Begin implementation of the fixed
25526 (Block.AddVariable): Return the VariableInfo on success and null
25527 on failure instead of true/false.
25529 * cs-parser.jay (foreach): Catch errors on variables already
25530 defined (we were ignoring this value before) and properly unwind
25531 the block hierarchy
25533 (fixed_statement): grammar for the fixed statement.
25535 2002-01-25 Miguel de Icaza <miguel@ximian.com>
25537 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
25538 pointer types to be incretemented.
25540 (SizeOf): Implement.
25542 * cs-parser.jay (pointer_member_access): Implement
25543 expr->IDENTIFIER production.
25545 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
25546 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
25549 (Unary): Implement indirection.
25551 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
25552 use in non-unsafe context).
25554 (SimpleName.DoResolve): Check for pointers in field access on safe
25557 (Expression.LoadFromPtr): Factor the load-indirect code in this
25558 function. This was duplicated in UnboxCast and ParameterReference
25560 2002-01-24 Miguel de Icaza <miguel@ximian.com>
25562 * expression.cs (ComposedCast): report an error if a pointer cast
25563 is used in a safe region.
25565 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
25566 pointer type casts in unsafe context.
25568 * codegen.cs (EmitContext): Set up IsUnsafe.
25570 * cs-parser.jay (non_expression_type): Add productions for pointer
25573 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
25574 code. We should not use force into static mode if the method is
25575 not virtual. Fixes bug in MIS
25577 * statement.cs (Do.Emit, While.Emit, For.Emit,
25578 Statement.EmitBoolExpression): Add support to Do and While to
25579 propagate infinite loop as `I do return' semantics.
25581 Improve the For case to also test for boolean constants.
25583 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
25584 to the list of attributes we can add.
25586 Remove `EmitContext' argument.
25588 * class.cs (Method.Define): Apply parameter attributes.
25589 (Constructor.Define): Apply parameter attributes.
25590 (MethodCore.LabelParameters): Move here the core of labeling
25593 * support.cs (ReflectionParameters.ParameterModifier,
25594 InternalParameters.ParameterModifier): Use IsByRef on the type and
25595 only return the OUT bit for these parameters instead of in/out/ref
25598 This is because I miss-understood things. The ParameterInfo.IsIn
25599 and IsOut represent whether the parameter has the [In] and [Out]
25602 2002-01-22 Miguel de Icaza <miguel@ximian.com>
25604 * ecore.cs (FieldExpr.Emit): Release temporaries.
25606 * assign.cs (LocalTemporary.Release): new function.
25608 * codegen.cs (EmitContext.GetTemporaryStorage,
25609 EmitContext.FreeTemporaryStorage): Rework the way we deal with
25610 temporary storage. Now we can "put back" localbuilders when we
25613 2002-01-21 Miguel de Icaza <miguel@ximian.com>
25615 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
25616 need to make a copy of the variable to generate verifiable code.
25618 2002-01-19 Miguel de Icaza <miguel@ximian.com>
25620 * driver.cs: Compute dynamically the system directory.
25622 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
25623 Slower, but more generally useful. Used by the abstract
25624 registering implementation.
25626 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
25627 the rules for the special rule on Type/instances. First check if
25628 we have the same name, and if so, try that special static path
25629 rather than the instance path.
25631 2002-01-18 Miguel de Icaza <miguel@ximian.com>
25633 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
25636 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
25637 Enum, ValueType, Delegate or Array for non-corlib compiles.
25639 * cs-tokenizer.cs: Catch long identifiers (645)
25641 * typemanager.cs (IndexerPropetyName): Ravi never tested this
25644 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
25645 fix, we were returning too early, so we were not registering
25646 pending methods from abstract classes.
25648 Do not register pending methods if the class is abstract.
25650 * expression.cs (Conditional.DoResolve): Report circular implicit
25651 conversions when we neecd to compute it for conditional
25654 (Is.DoResolve): If the expression is always of the provided type,
25655 flag warning 183. If the expression can not ever be of the
25656 provided type flag warning 184.
25658 * class.cs: Catch 169 as well.
25660 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
25663 2002-01-18 Nick Drochak <ndrochak@gol.com>
25665 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
25667 2002-01-17 Miguel de Icaza <miguel@ximian.com>
25669 * interface.cs: (PopulateMethod): Check for pointers being defined
25670 only if the unsafe context is active.
25671 (PopulateProperty): ditto.
25672 (PopulateIndexer): ditto.
25674 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
25675 specified. If pointers are present, make sure that they are
25676 present in an unsafe context.
25677 (Constructor, Constructor.Define): ditto.
25678 (Field, Field.Define): ditto.
25679 (Property, Property.Define): ditto.
25680 (Event, Event.Define): ditto.
25682 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
25683 hashtable if there are classes or structs defined.
25685 * expression.cs (LocalVariableReference.DoResolve): Simplify this
25686 code, as the constant resolution moved.
25688 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
25689 the metadata, so we can flag error 133.
25691 * decl.cs (MemberCore.UnsafeOK): New function to test that a
25692 pointer is being declared in an unsafe context.
25694 2002-01-16 Miguel de Icaza <miguel@ximian.com>
25696 * modifiers.cs (Modifiers.Check): Require a Location argument.
25697 Report error 227 for Unsafe use.
25699 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
25701 * statement.cs (For.Emit): If the test is null, then report that
25702 we do `return', as we wont reach anything afterwards.
25704 (Switch.SwitchGoverningType): Track the expression that matched
25707 * driver.cs: Allow negative numbers as an error code to flag.
25709 * cs-parser.jay: Handle 1551.
25711 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
25713 2002-01-15 Miguel de Icaza <miguel@ximian.com>
25715 * cs-parser.jay: Report 1518 (type declaration can only contain
25716 class, struct, interface, enum or delegate)
25718 (switch_label): Report 1523 (keywords `case' or `default' must
25721 (opt_switch_sections): Report 1522 (empty switch)
25723 * driver.cs: Report 1515 (response file specified multiple times)
25724 Report 1516 (Source file specified multiple times).
25726 * expression.cs (Argument.Resolve): Signal 1510
25728 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
25729 access not allowed in static code)
25731 2002-01-11 Ravi Pratap <ravi@ximian.com>
25733 * typemanager.cs (IsPointerType): Utility method which we are going
25736 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
25737 the object type, so we take care of that.
25739 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
25741 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
25742 added to non-params parameters :-)
25744 * typemanager.cs (CSharpName): Include 'void' type too.
25746 (void_ptr_type): Include in the set of core types.
25748 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
25751 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
25754 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
25755 completely forgotten about it.
25757 2002-01-10 Ravi Pratap <ravi@ximian.com>
25759 * cs-parser.jay (pointer_type): Add. This begins our implementation
25760 of parsing rules for unsafe code.
25762 (unsafe_statement): Implement.
25764 (embedded_statement): Modify to include the above.
25766 * statement.cs (Unsafe): Implement new class for unsafe blocks.
25768 * codegen.cs (EmitContext.InUnsafe): Add. This determines
25769 if the current context is an unsafe one.
25771 * cs-parser.jay (local_variable_pointer_type): Since local variable types
25772 are handled differently, we need separate rules for them.
25774 (local_variable_declaration): Update to use local_variable_pointer_type
25775 to allow variable declarations of unmanaged pointer types.
25777 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
25778 in unsafe contexts.
25780 * ../errors/cs0214.cs : Add.
25782 2002-01-16 Nick Drochak <ndrochak@gol.com>
25784 * makefile: remove 'response' file when cleaning.
25786 2002-01-15 Miguel de Icaza <miguel@ximian.com>
25788 * cs-parser.jay: Report 1524.
25790 2002-01-14 Miguel de Icaza <miguel@ximian.com>
25792 * typemanager.cs (RegisterMethod): drop checking if we have
25793 registered this from here
25795 2002-01-12 Miguel de Icaza <miguel@ximian.com>
25797 * class.cs (Method.EmitDestructor): Implement calling our base
25800 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
25801 value of InFinally.
25803 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
25804 this routine and will wrap the call in a try/catch block. Deal
25807 2002-01-11 Miguel de Icaza <miguel@ximian.com>
25809 * ecore.cs (Expression.MemberLookup): instead of taking a
25810 parameter `same_type' that was used to tell whether we could
25811 access private members we compute our containing type from the
25814 (FieldExpr): Added partial support for volatile fields. This does
25815 not work for volatile fields exposed from assemblies, as I can not
25816 figure out how to extract the modreq from it.
25818 Updated all the source files to use this.
25820 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
25821 because it is referenced by MemberLookup very often.
25823 2002-01-09 Ravi Pratap <ravi@ximian.com>
25825 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
25826 TypeBuilder.GetCustomAttributes to retrieve what we need.
25828 Get rid of redundant default_member_attr_type as this is the same as
25829 default_member_type which already exists.
25831 * interface.cs, attribute.cs : Update accordingly.
25833 2002-01-08 Miguel de Icaza <miguel@ximian.com>
25835 * typemanager.cs: Enable IndexerPropertyName again. It does not
25836 work for TYpeBuilders though. Ravi, can you please fix this?
25838 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
25840 * expression.cs (Argument.Emit): Handle the case of ref objects
25841 being passed to ref functions;
25843 (ParameterReference.EmitLoad): Loads the content of the pointer
25844 without dereferencing.
25846 2002-01-07 Miguel de Icaza <miguel@ximian.com>
25848 * cs-tokenizer.cs: Implemented the pre-processing expressions.
25850 2002-01-08 Ravi Pratap <ravi@ximian.com>
25852 * class.cs (Indexer.DefineMethod): Incorporate the interface
25853 type in the name of the method if we are doing explicit interface
25856 * expression.cs (ConversionExists): Remove as it is completely obsolete.
25858 (BetterConversion): Fix extremely trivial bug where we were referring to
25859 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
25862 * ../errors/bug16.cs : Add although we have fixed it.
25864 2002-01-07 Miguel de Icaza <miguel@ximian.com>
25866 * expression.cs (BaseIndexer): Begin implementation.
25868 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
25870 * cs-parser.jay (indexer_declarator): Use qualified_identifier
25871 production directly to remove a shift/reduce, and implement
25872 explicit interface implementation.
25874 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
25875 after a floating point suffix.
25877 * expression.cs (DoNumericPromotions): Improved the conversion for
25878 uint/uint. If we have a constant, we avoid doing a typecast to a
25881 * class.cs (Indexer): Implement explicit interface implementation
25884 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
25886 * class.cs: make the default instance constructor public and hidebysig.
25888 2001-01-03 Ravi Pratap <ravi@ximian.com>
25890 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
25891 so we can call it from elsewhere.
25893 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
25894 we emit it internally if the class has a defined indexer; otherwise the user
25895 emits it by decorating the class definition with the DefaultMemberAttribute.
25897 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
25898 attribute is not used on a type which defines an indexer.
25900 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
25901 character when we skip whitespace.
25903 * ../errors/cs0646.cs : Add.
25905 2002-01-03 Miguel de Icaza <miguel@ximian.com>
25907 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
25910 * makefile: Add practical target `mcs3.exe' which builds the third
25911 generation compiler.
25913 * expression.cs (New): Fix structures constructor calling.
25915 * class.cs (Property, Method, Indexer): Emit Final flag on the
25916 method if we are an interface implementation and we are not
25919 * ecore.cs (PropertyExpr): New public field `IsBase', tells
25920 whether this property is referencing a `base' method.
25922 * expression.cs (Invocation.EmitCall): take an extra argument:
25923 is_base, this is used to determine whether the `call' or
25924 `callvirt' opcode should be used.
25927 * delegate.cs: update EmitCall.
25929 * class.cs (Method.Define): Set NewSlot for the cases where we are
25930 not implementing an interface method.
25932 (Property.Define): ditto.
25934 2002-01-02 Miguel de Icaza <miguel@ximian.com>
25936 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
25937 'r'. Allows mcs to parse itself fully.
25939 2002-01-02 Ravi Pratap <ravi@ximian.com>
25941 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
25942 of the number of initializers that require the InitializeArray method.
25944 (CheckIndices): Store the Expression in all cases - not the plain value. Also
25945 update the above field where necessary.
25947 (MakeByteBlob): Update accordingly.
25949 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
25952 (EmitDynamicInitializers): Update in accordance with the new optimization.
25954 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
25955 same OpCode applies.
25957 * cs-parser.jay : Fix some glaring errors I introduced.
25959 2002-01-01 Ravi Pratap <ravi@ximian.com>
25961 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
25962 so that we can check for name clashes there too.
25964 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
25965 for interface indexers.
25967 * interfaces.cs (Define): Emit the default member attribute.
25969 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
25970 variable was being referred to while setting the value ;-)
25972 2002-01-01 Miguel de Icaza <miguel@ximian.com>
25974 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
25975 byte-by-byte information when we know the data is zero.
25977 Make the block always a multiple of 4, because
25978 DefineInitializedData has a bug.
25980 * assign.cs: Fix, we should assign from the temporary, not from
25983 * expression.cs (MakeByteBlob): Fix my incorrect code.
25985 2001-12-31 Miguel de Icaza <miguel@ximian.com>
25987 * typemanager.cs (EnumToUnderlying): This function is used to get
25988 the underlying type from an enumeration, because it does not
25991 * constant.cs: Use the I4_S form for values between -128 and 127.
25993 * statement.cs (Block.LookupLabel): Looks up a label.
25994 (Block): Drop support for labeled blocks.
25996 (LabeledStatement): New kind of statement that represents a label
25999 (Goto): Finally implement this bad boy.
26001 * cs-parser.jay: Update to reflect new mechanism to implement
26004 2001-12-30 Miguel de Icaza <miguel@ximian.com>
26006 * codegen.cs (EmitContext.This): a codegen property that keeps the
26007 a single instance of this instead of creating many different this
26010 * delegate.cs (Delegate.DoResolve): Update to use the property;
26012 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26014 * expression.cs (BaseAccess.DoResolve): Ditto.
26016 2001-12-29 Ravi Pratap <ravi@ximian.com>
26018 * typemanager.cs (methodimpl_attr_type): Add to hold the type
26019 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26021 (InitCoreTypes): Update accordingly.
26023 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26024 so we can quickly store the state.
26026 (ApplyAttributes): Set the correct implementation flags
26027 for InternalCall methods.
26029 2001-12-29 Miguel de Icaza <miguel@ximian.com>
26031 * expression.cs (EmitCall): if a method is not virtual, then do
26032 not use callvirt on it.
26034 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26035 user defined stuff) requires the use of stobj, which takes an
26036 address on the stack instead of an array and an index. So emit
26037 the Ldelema operation for it.
26039 (EmitStoreOpcode): Use stobj for valuetypes.
26041 (UnaryMutator.EmitCode): Use the right 1 value depending on
26042 whether we are dealing with int64/uint64, float or doubles.
26044 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26045 constructors that I implemented last night.
26047 (Constructor.IsDefault): Fix to work properly for static
26050 * cs-parser.jay (CheckDef): report method signature errors.
26051 Update error number 103 to be 132.
26053 * decl.cs: New AdditionResult enumeration value: MethodExists.
26054 Although we do this check for methods later on in the semantic
26055 analysis, catching repeated default constructors is so easy that
26056 we catch these here.
26058 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26061 (ParameterReference.EmitAssign, Emit): handle
26064 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26065 (ArrayAccess.EmitStoreOpcode): ditto.
26067 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26069 * expression.cs (MakeByteBlob): Complete all the missing types
26070 (uint, short, ushort, byte, sbyte)
26072 * class.cs: Only init instance field initializers on instance
26075 Rename `constructors' to instance_constructors.
26077 (TypeContainer.AddConstructor): Only add constructors to the list
26078 if it is not static.
26080 Make sure that we handle default_static_constructor independently
26081 everywhere where we handle instance_constructors
26083 2001-12-28 Miguel de Icaza <miguel@ximian.com>
26085 * class.cs: Do not lookup or create a base initializer for a
26086 static constructor.
26088 (ConstructorInitializer.Resolve): use the proper type to lookup
26091 * cs-parser.jay: Report error 1585 (modifiers between type and name).
26093 * enum.cs, interface.cs: Remove CloseType, this is taken care by
26096 * decl.cs: CloseType is now an virtual method, the default
26097 implementation just closes this type.
26099 2001-12-28 Ravi Pratap <ravi@ximian.com>
26101 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26102 to PreserveSig by default. Also emit HideBySig on such methods.
26104 Basically, set the defaults to standard values.
26106 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26107 argument, if candidate is better, it can't be worse than the best !
26109 (Invocation): Re-write bits to differentiate between methods being
26110 applicable in their expanded form and their normal form - for params
26113 Get rid of use_standard everywhere as only standard conversions are allowed
26114 in overload resolution.
26116 More spec conformance.
26118 2001-12-27 Miguel de Icaza <miguel@ximian.com>
26120 * driver.cs: Add --timestamp, to see where the compiler spends
26123 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26124 `this' in static code.
26126 (SimpleName.DoResolve): Implement in terms of a helper function
26127 that allows static-references to be passed upstream to
26130 (Expression.ResolveWithSimpleName): Resolve specially simple
26131 names when called by MemberAccess to implement the special
26134 (Expression.ImplicitReferenceConversion): Handle conversions from
26135 Null to reference types before others, as Null's type is
26138 * expression.cs (Invocation.EmitCall): Handle the special case of
26139 calling methods declared on a reference type from a ValueType
26140 (Base classes System.Object and System.Enum)
26142 (MemberAccess.Resolve): Only perform lookups on Enumerations if
26143 the left hand side is a TypeExpr, not on every enumeration.
26145 (Binary.Resolve): If types are reference types, then do a cast to
26146 object on operators != and == of both arguments.
26148 * typemanager.cs (FindMembers): Extract instance and static
26149 members if requested.
26151 * interface.cs (PopulateProperty): Use void_type instead of null
26152 as the return type for the setter method.
26154 (PopulateIndexer): ditto.
26156 2001-12-27 Ravi Pratap <ravi@ximian.com>
26158 * support.cs (ReflectionParameters): Fix minor bug where we
26159 were examining the wrong parameter for the ParamArray attribute.
26161 Cope with requests for the type of the parameter at position
26162 greater than the params parameter's. We now return the element
26163 type of the params array as that makes more sense.
26165 * expression.cs (Invocation.IsParamsMethodApplicable): Update
26166 accordingly as we no longer have to extract the element type
26169 (Invocation.OverloadResolve): Update.
26171 2001-12-27 Miguel de Icaza <miguel@ximian.com>
26173 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
26174 against IEnumerator, test whether the return value is a descendant
26175 of the IEnumerator interface.
26177 * class.cs (Indexer.Define): Use an auxiliary method to implement
26178 the other bits of the method definition. Begin support for
26179 explicit interface implementation.
26181 (Property.DefineMethod): Use TypeManager.void_type instead of null
26182 for an empty return value.
26184 2001-12-26 Miguel de Icaza <miguel@ximian.com>
26186 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
26187 dealing with a FieldExpr which is composed of a FieldBuilder, in
26188 the code path we did extract the constant, but we should have
26189 obtained the underlying value to be able to cast it (otherwise we
26190 end up in an infinite loop, this is what Ravi was running into).
26192 (ArrayCreation.UpdateIndices): Arrays might be empty.
26194 (MemberAccess.ResolveMemberAccess): Add support for section
26195 14.5.4.1 that deals with the special case of E.I when E is a type
26196 and something else, that I can be a reference to a static member.
26198 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
26199 handle a particular array type to create byte blobs, it is just
26200 something we dont generate byteblobs for.
26202 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
26205 * location.cs (Push): remove the key from the hashtable that we
26206 are about to add. This happens for empty files.
26208 * driver.cs: Dispose files after we have parsed them.
26210 (tokenize): new function that only runs the tokenizer on its
26211 input, for speed testing.
26213 2001-12-26 Ravi Pratap <ravi@ximian.com>
26215 * class.cs (Event.Define): Define the private field only if there
26216 are no accessors defined.
26218 * expression.cs (ResolveMemberAccess): If there is no associated
26219 field with the event, that means we have an event defined with its
26220 own accessors and we should flag error cs0070 since transforming
26221 ourselves into a field is not valid in that case.
26223 * ecore.cs (SimpleName.DoResolve): Same as above.
26225 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
26226 and charset to sane values.
26228 2001-12-25 Ravi Pratap <ravi@ximian.com>
26230 * assign.cs (DoResolve): Perform check on events only if they
26231 are being accessed outside the declaring type.
26233 * cs-parser.jay (event_declarations): Update rules to correctly
26234 set the type of the implicit parameter etc.
26236 (add_accessor, remove_accessor): Set current local parameters.
26238 * expression.cs (Binary): For delegate addition and subtraction,
26239 cast the return value from the method into the appropriate delegate
26242 2001-12-24 Ravi Pratap <ravi@ximian.com>
26244 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
26245 of these as the workaround is unnecessary.
26247 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
26248 delegate data - none of that is needed at all.
26250 Re-write bits to extract the instance expression and the delegate method
26253 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
26256 * attribute.cs (ApplyAttributes): New method to take care of common tasks
26257 of attaching attributes instead of duplicating code everywhere.
26259 * everywhere : Update code to do attribute emission using the above method.
26261 2001-12-23 Miguel de Icaza <miguel@ximian.com>
26263 * expression.cs (IsParamsMethodApplicable): if there are not
26264 parameters, return immediately.
26266 * ecore.cs: The 0 literal can be implicity converted to an enum
26269 (SimpleName.DoResolve): First lookup the type, then lookup the
26272 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
26273 want to get its address. If the InstanceExpression is not
26274 addressable, store the result in a temporary variable, then get
26277 * codegen.cs: Only display 219 errors on warning level or above.
26279 * expression.cs (ArrayAccess): Make it implement the
26280 IMemoryLocation interface.
26282 (Binary.DoResolve): handle the operator == (object a, object b)
26283 and operator != (object a, object b) without incurring into a
26284 BoxedCast (because 5 != o should never be performed).
26286 Handle binary enumerator operators.
26288 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
26289 value type, otherwise use Ldelem_ref.
26291 Use precomputed names;
26293 (AddressOf): Implement address of
26295 * cs-parser.jay (labeled_statement): Fix recursive block
26296 addition by reworking the production.
26298 * expression.cs (New.DoEmit): New has a special case:
26300 If we are dealing with a ValueType, we have a few
26301 situations to deal with:
26303 * The target of New is a ValueType variable, that is
26304 easy, we just pass this as the variable reference
26306 * The target of New is being passed as an argument,
26307 to a boxing operation or a function that takes a
26310 In this case, we need to create a temporary variable
26311 that is the argument of New.
26314 2001-12-23 Ravi Pratap <ravi@ximian.com>
26316 * rootcontext.cs (LookupType): Check that current_type is not null before
26317 going about looking at nested types.
26319 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
26320 not implement the IAssignMethod interface any more.
26322 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
26323 where we tranform them into FieldExprs if they are being resolved from within
26324 the declaring type.
26326 * ecore.cs (SimpleName.DoResolve): Do the same here.
26328 * assign.cs (DoResolve, Emit): Clean up code considerably.
26330 * ../errors/bug10.cs : Add.
26332 * ../errors/cs0070.cs : Add.
26334 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
26336 * assign.cs : Get rid of EventIsLocal everywhere.
26338 2001-12-23 Miguel de Icaza <miguel@ximian.com>
26340 * ecore.cs (ConvertIntLiteral): finished the implementation.
26342 * statement.cs (SwitchLabel): Convert the value we are using as a
26343 key before looking up the table.
26345 2001-12-22 Miguel de Icaza <miguel@ximian.com>
26347 * codegen.cs (EmitTopBlock): Require a Location argument now.
26349 * cs-parser.jay (constructor_declarator): We need to setup
26350 current_local_parameters before we parse the
26351 opt_constructor_initializer, to allow the variables to be bound
26352 to the constructor arguments.
26354 * rootcontext.cs (LookupType): First lookup nested classes in our
26355 class and our parents before we go looking outside our class.
26357 * expression.cs (ConstantFold): Extract/debox the values at the
26360 * rootcontext.cs (EmitCode): Resolve the constants first before we
26361 resolve the types. This is not really needed, but it helps debugging.
26363 * statement.cs: report location.
26365 * cs-parser.jay: pass location to throw statement.
26367 * driver.cs: Small bug fix.
26369 * report.cs: Updated format to be 4-zero filled digits.
26371 2001-12-22 Ravi Pratap <ravi@ximian.com>
26373 * expression.cs (CheckIndices): Fix minor bug where the wrong
26374 variable was being referred to ;-)
26376 (DoEmit): Do not call EmitStaticInitializers when the
26377 underlying type is System.Object.
26379 2001-12-21 Ravi Pratap <ravi@ximian.com>
26381 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
26382 and do the usual workaround for SRE.
26384 * class.cs (MyEventBuilder.EventType): New member to get at the type
26385 of the event, quickly.
26387 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
26389 * assign.cs (Assign.DoResolve): Handle the case when the target
26390 is an EventExpr and perform the necessary checks.
26392 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
26395 (SimpleName.MemberStaticCheck): Include check for EventExpr.
26397 (EventExpr): Set the type in the constructor itself since we
26398 are meant to be born fully resolved.
26400 (EventExpr.Define): Revert code I wrote earlier.
26402 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
26403 instance expression is null. The instance expression is a This in that case
26404 or a null, depending on whether it is a static method or not.
26406 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
26407 refers to more than one method.
26409 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
26410 and accordingly flag errors.
26412 2001-12-21 Miguel de Icaza <miguel@ximian.com>
26414 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
26416 2001-12-22 Miguel de Icaza <miguel@ximian.com>
26418 * location.cs (ToString): Provide useful rutine.
26420 2001-12-21 Miguel de Icaza <miguel@ximian.com>
26422 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
26423 objects, return the actual integral boxed.
26425 * statement.cs (SwitchLabel): define an ILLabel for each
26428 (Switch.CheckSwitch): If the value is a Literal, extract
26429 the underlying literal.
26431 Also in the unused hashtable we had, add the SwitchLabel so we can
26432 quickly look this value up.
26434 * constant.cs: Implement a bunch of new constants. Rewrite
26435 Literal based on this. Made changes everywhere to adapt to this.
26437 * expression.cs (Expression.MakeByteBlob): Optimize routine by
26438 dereferencing array only once, and also copes with enumrations.
26440 bytes are two bytes wide, not one.
26442 (Cast): Perform constant conversions.
26444 * ecore.cs (TryImplicitIntConversion): Return literals instead of
26445 wrappers to the literals here.
26447 * expression.cs (DoNumericPromotions): long literals can converted
26448 to ulong implicity (this is taken care of elsewhere, but I was
26449 missing this spot).
26451 * ecore.cs (Expression.Literalize): Make the return type Literal,
26452 to improve type checking.
26454 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
26456 2001-12-20 Miguel de Icaza <miguel@ximian.com>
26458 * literal.cs: Revert code from ravi that checked the bounds. The
26459 bounds are sane by the definition of the type itself.
26461 * typemanager.cs: Fix implementation of ImplementsInterface. We
26462 need to actually look up in our parent hierarchy for interfaces
26465 * const.cs: Use the underlying type for enumerations
26467 * delegate.cs: Compute the basename for the delegate creation,
26468 that should fix the delegate test case, and restore the correct
26469 Type Lookup semantics in rootcontext
26471 * rootcontext.cs: Revert Ravi's last patch. The correct way of
26472 referencing a nested type with the Reflection API is using the "+"
26475 * cs-parser.jay: Do not require EOF token at the end.
26477 2001-12-20 Ravi Pratap <ravi@ximian.com>
26479 * rootcontext.cs (LookupType): Concatenate type names with
26480 a '.' instead of a '+' The test suite passes again.
26482 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
26483 field of the enumeration.
26485 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
26486 the case when the member is an EventExpr.
26488 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
26489 static has an associated instance expression.
26491 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
26493 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
26495 * class.cs (Event.Define): Register event and perform appropriate checks
26498 We define the Add and Remove methods even if the use provides none because
26499 in that case, we provide default implementations ourselves.
26501 Define a private field of the type of the event. This is done by the CSC compiler
26502 and we should be doing it too ;-)
26504 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
26505 More methods we use in code we generate.
26507 (multicast_delegate_type, delegate_type): Two separate types since the distinction
26510 (InitCoreTypes): Update accordingly for the above.
26512 * class.cs (Event.Emit): Generate code for default accessors that we provide
26514 (EmitDefaultMethod): Do the job in the above.
26516 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
26519 2001-12-20 Miguel de Icaza <miguel@ximian.com>
26521 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
26522 builders even if we were missing one.
26524 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
26525 pass the Basename as our class name instead of the Name. The
26526 basename will be correctly composed for us.
26528 * parameter.cs (Paramters): Now takes a Location argument.
26530 * decl.cs (DeclSpace.LookupType): Removed convenience function and
26531 make all the code call directly LookupType in RootContext and take
26532 this chance to pass the Location information everywhere.
26534 * Everywhere: pass Location information.
26536 2001-12-19 Miguel de Icaza <miguel@ximian.com>
26538 * class.cs (Constructor.Define): Updated way of detecting the
26539 length of the parameters.
26541 (TypeContainer.DefineType): Use basename as the type name for
26544 (TypeContainer.Define): Do not recursively define types here, as
26545 definition is taken care in order by the RootContext.
26547 * tree.cs: Keep track of namespaces in a per-file basis.
26549 * parameter.cs (Parameter.ComputeSignature): Update to use
26552 (Parameters.GetSignature): ditto.
26554 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
26555 instead of a TypeContainer.
26557 (Interface.SemanticAnalysis): Use `this' instead of our parent to
26558 resolve names. Because we need to be resolve in our context, not
26561 * driver.cs: Implement response files.
26563 * class.cs (TypeContainer.DefineType): If we are defined, do not
26564 redefine ourselves.
26566 (Event.Emit): Emit the code for add/remove handlers.
26567 (Event.Define): Save the MethodBuilders for add/remove.
26569 * typemanager.cs: Use pair here too.
26571 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
26572 DictionaryEntry requires the first argument to be non-null.
26574 (enum_declaration): Compute full name for registering the
26577 (delegate_declaration): Instead of using
26578 formal_parameter_list, use opt_formal_parameter_list as the list
26581 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
26582 (EventParsing): New property that controls whether `add' and
26583 `remove' are returned as tokens or identifiers (for events);
26585 2001-12-19 Ravi Pratap <ravi@ximian.com>
26587 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
26588 use MyEventBuilder only and let it wrap the real builder for us.
26590 (MyEventBuilder): Revamp constructor etc.
26592 Implement all operations that we perform on EventBuilder in precisely the same
26595 (FindMembers): Update to use the EventBuilder member.
26597 (Event.Emit): Update accordingly.
26599 2001-12-18 Ravi Pratap <ravi@ximian.com>
26601 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
26602 by calling the appropriate methods.
26604 (GetCustomAttributes): Make stubs as they cannot possibly do anything
26607 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
26609 2001-12-17 Ravi Pratap <ravi@ximian.com>
26611 * delegate.cs (Delegate.Populate): Check that the return type
26612 and various parameters types are indeed accessible.
26614 * class.cs (Constructor.Define): Same here.
26616 (Field.Define): Ditto.
26618 (Event.Define): Ditto.
26620 (Operator.Define): Check that the underlying Method defined itself
26621 correctly - so it's MethodBuilder should not be null.
26623 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
26624 expression happens to be null.
26626 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
26627 members but as of now we don't seem to be able to do anything really useful with it.
26629 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
26630 not the EventBuilder.
26632 2001-12-18 Miguel de Icaza <miguel@ximian.com>
26634 * cs-tokenizer.cs: Add support for defines.
26635 Add support for #if, #elif, #else, #endif
26637 (eval_var): evaluates a variable.
26638 (eval): stubbed for evaluating functions.
26640 * cs-parser.jay: Pass the defines information
26642 * driver.cs: Add --define command line option.
26644 * decl.cs: Move MemberCore here.
26646 Make it the base class for DeclSpace. This allows us to catch and
26647 report 108 and 109 for everything now.
26649 * class.cs (TypeContainer.Define): Extract all the members
26650 before populating and emit the warning 108 (new keyword required
26651 to override) instead of having each member implement this.
26653 (MemberCore.Define): New abstract method, we will be using this in
26654 the warning reporting engine in Populate.
26656 (Operator.Define): Adjust to new MemberCore protocol.
26658 * const.cs (Const): This does not derive from Expression, it is a
26659 temporary object we use to create fields, it is a MemberCore.
26661 * class.cs (Method.Define): Allow the entry point to be in a
26664 * driver.cs: Rewrite the argument handler to clean it up a bit.
26666 * rootcontext.cs: Made it just an auxiliary namespace feature by
26667 making everything static.
26669 * driver.cs: Adapt code to use RootContext type name instead of
26672 * delegate.cs: Remove RootContext argument.
26674 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
26677 * class.cs (Event.Define): The lookup can fail.
26679 * cs-tokenizer.cs: Begin implementation of pre-procesor.
26681 * expression.cs: Resolve the this instance before invoking the code.
26683 2001-12-17 Miguel de Icaza <miguel@ximian.com>
26685 * cs-parser.jay: Add a production in element_access that allows
26686 the thing to become a "type" reference. This way we can parse
26687 things like "(string [])" as a type.
26689 Note that this still does not handle the more complex rules of
26693 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
26695 * ecore.cs: (CopyNewMethods): new utility function used to
26696 assemble the list of methods from running FindMembers.
26698 (MemberLookup): Rework FindMembers so that
26700 2001-12-16 Miguel de Icaza <miguel@ximian.com>
26702 * class.cs (TypeContainer): Remove Delegates who fail to be
26705 * delegate.cs (Populate): Verify that we dont get null return
26706 values. TODO: Check for AsAccessible.
26708 * cs-parser.jay: Use basename to emit error 574 (destructor should
26709 have the same name as container class), not the full name.
26711 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
26712 possible representation.
26714 Also implements integer type suffixes U and L.
26716 2001-12-15 Miguel de Icaza <miguel@ximian.com>
26718 * expression.cs (ArrayCreation.DoResolve): We need to do the
26719 argument resolution *always*.
26721 * decl.cs: Make this hold the namespace. Hold the root context as
26723 (LookupType): Move here.
26725 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
26727 * location.cs (Row, Name): Fixed the code, it was always returning
26728 references to the first file.
26730 * interface.cs: Register properties defined through interfaces.
26732 * driver.cs: Add support for globbing on the command line
26734 * class.cs (Field): Make it derive from MemberCore as well.
26737 2001-12-15 Ravi Pratap <ravi@ximian.com>
26739 * class.cs (Event::Define): Check that the type of the event is a delegate
26740 type else flag error #66.
26742 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
26745 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
26746 values of EntryPoint, CharSet etc etc.
26748 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
26750 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
26751 be null and we should ignore this. I am not sure if this is really clean. Apparently,
26752 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
26753 which needs this to do its work.
26755 * ../errors/cs0066.cs : Add.
26757 2001-12-14 Miguel de Icaza <miguel@ximian.com>
26759 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
26762 * class.cs: (MethodSignature.MethodSignature): Removed hack that
26763 clears out the parameters field.
26764 (MemberSignatureCompare): Cleanup
26766 (MemberCore): New base class used to share code between MethodCore
26769 (RegisterRequiredImplementations) BindingFlags.Public requires
26770 either BindingFlags.Instace or Static. Use instance here.
26772 (Property): Refactored code to cope better with the full spec.
26774 * parameter.cs (GetParameterInfo): Return an empty array instead
26777 * class.cs (Property): Abstract or extern properties have no bodies.
26779 * parameter.cs (GetParameterInfo): return a zero-sized array.
26781 * class.cs (TypeContainer.MethodModifiersValid): Move all the
26782 method modifier validation to the typecontainer so we can reuse
26783 this on properties.
26785 (MethodCore.ParameterTypes): return an empty sized array of types.
26787 (Property.Define): Test property modifier validity.
26789 Add tests for sealed/override too.
26791 (Method.Emit): abstract or extern methods have no bodies.
26793 2001-12-14 Ravi Pratap <ravi@ximian.com>
26795 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
26798 (Method::Define, ::Emit): Modify accordingly.
26800 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
26802 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
26804 * makefile: Pass in /unsafe.
26806 2001-12-13 Miguel de Icaza <miguel@ximian.com>
26808 * class.cs (MakeKey): Kill routine.
26810 * class.cs (TypeContainer.Define): Correctly define explicit
26811 method implementations (they require the full interface name plus
26814 * typemanager.cs: Deply the PtrHashtable here and stop using the
26815 lame keys. Things work so much better.
26817 This of course broke everyone who depended on `RegisterMethod' to
26818 do the `test for existance' test. This has to be done elsewhere.
26820 * support.cs (PtrHashtable): A hashtable that avoid comparing with
26821 the object stupid Equals method (because, that like fails all over
26822 the place). We still do not use it.
26824 * class.cs (TypeContainer.SetRequiredInterface,
26825 TypeContainer.RequireMethods): Killed these two routines and moved
26826 all the functionality to RegisterRequiredImplementations.
26828 (TypeContainer.RegisterRequiredImplementations): This routine now
26829 registers all the implementations required in an array for the
26830 interfaces and abstract methods. We use an array of structures
26831 which can be computed ahead of time to reduce memory usage and we
26832 also assume that lookups are cheap as most classes will not
26833 implement too many interfaces.
26835 We also avoid creating too many MethodSignatures.
26837 (TypeContainer.IsInterfaceMethod): Update and optionally does not
26838 clear the "pending" bit if we find that there are problems with
26841 (TypeContainer.VerifyPendingMethods): Update to report errors of
26842 methods that look like implementations but are not.
26844 (TypeContainer.Define): Add support for explicit interface method
26847 2001-12-12 Miguel de Icaza <miguel@ximian.com>
26849 * typemanager.cs: Keep track of the parameters here instead of
26850 being a feature of the TypeContainer.
26852 * class.cs: Drop the registration of parameters here, as
26853 InterfaceMethods are also interface declarations.
26855 * delegate.cs: Register methods with the TypeManager not only with
26856 the TypeContainer. This code was buggy.
26858 * interface.cs: Full registation here.
26860 2001-12-11 Miguel de Icaza <miguel@ximian.com>
26862 * expression.cs: Remove reducer for binary expressions, it can not
26865 * const.cs: Put here the code that used to go into constant.cs
26867 * constant.cs: Put here the code for constants, this is a new base
26868 class for Literals.
26870 * literal.cs: Make Literal derive from Constant.
26872 2001-12-09 Miguel de Icaza <miguel@ximian.com>
26874 * statement.cs (Return.Emit): Report error 157 if the user
26875 attempts to return from a finally block.
26877 (Return.Emit): Instead of emitting a return, jump to the end of
26880 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
26881 LocalBuilder to store the result of the function. ReturnLabel is
26882 the target where we jump.
26885 2001-12-09 Radek Doulik <rodo@ximian.com>
26887 * cs-parser.jay: remember alias in current namespace
26889 * ecore.cs (SimpleName::DoResolve): use aliases for types or
26892 * class.cs (LookupAlias): lookup alias in my_namespace
26894 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
26896 (LookupAlias): lookup alias in this and if needed in parent
26899 2001-12-08 Miguel de Icaza <miguel@ximian.com>
26903 * rootcontext.cs: (ModuleBuilder) Made static, first step into
26904 making things static. I need this to avoid passing the
26905 TypeContainer when calling ParameterType.
26907 * support.cs (InternalParameters.ParameterType): Remove ugly hack
26908 that did string manipulation to compute the type and then call
26909 GetType. Use Parameter.ParameterType instead.
26911 * cs-tokenizer.cs: Consume the suffix for floating values.
26913 * expression.cs (ParameterReference): figure out whether this is a
26914 reference parameter or not. Kill an extra variable by computing
26915 the arg_idx during emission.
26917 * parameter.cs (Parameters.GetParameterInfo): New overloaded
26918 function that returns whether a parameter is an out/ref value or not.
26920 (Parameter.ParameterType): The type of the parameter (base,
26921 without ref/out applied).
26923 (Parameter.Resolve): Perform resolution here.
26924 (Parameter.ExternalType): The full type (with ref/out applied).
26926 * statement.cs (Using.Emit, Using.EmitExpression): Implement
26927 support for expressions on the using statement.
26929 2001-12-07 Miguel de Icaza <miguel@ximian.com>
26931 * statement.cs (Using.EmitLocalVariableDecls): Split the
26932 localvariable handling of the using statement.
26934 (Block.EmitMeta): Keep track of variable count across blocks. We
26935 were reusing slots on separate branches of blocks.
26937 (Try.Emit): Emit the general code block, we were not emitting it.
26939 Check the type of the declaration to be an IDisposable or
26940 something that can be implicity converted to it.
26942 Emit conversions if required.
26944 * ecore.cs (EmptyExpression): New utility class.
26945 (Expression.ImplicitConversionExists): New utility function.
26947 2001-12-06 Miguel de Icaza <miguel@ximian.com>
26949 * statement.cs (Using): Implement.
26951 * expression.cs (LocalVariableReference): Support read only variables.
26953 * statement.cs: Remove the explicit emit for the Leave opcode.
26954 (VariableInfo): Add a readonly field.
26956 2001-12-05 Miguel de Icaza <miguel@ximian.com>
26958 * ecore.cs (ConvCast): new class used to encapsulate the various
26959 explicit integer conversions that works in both checked and
26960 unchecked contexts.
26962 (Expression.ConvertNumericExplicit): Use new ConvCast class to
26963 properly generate the overflow opcodes.
26965 2001-12-04 Miguel de Icaza <miguel@ximian.com>
26967 * statement.cs: The correct type for the EmptyExpression is the
26968 element_type, not the variable type. Ravi pointed this out.
26970 2001-12-04 Ravi Pratap <ravi@ximian.com>
26972 * class.cs (Method::Define): Handle PInvoke methods specially
26973 by using DefinePInvokeMethod instead of the usual one.
26975 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
26976 above to do the task of extracting information and defining the method.
26978 2001-12-04 Ravi Pratap <ravi@ximian.com>
26980 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
26981 of the condition for string type.
26983 (Emit): Move that here.
26985 (ArrayCreation::CheckIndices): Keep string literals in their expression
26988 (EmitDynamicInitializers): Handle strings appropriately.
26990 2001-12-04 Miguel de Icaza <miguel@ximian.com>
26992 * codegen.cs (EmitContext): Replace multiple variables with a
26993 single pointer to the current Switch statement.
26995 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
26998 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27002 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27005 (Foreach.Emit): Foreach on arrays was not setting
27006 up the loop variables (for break/continue).
27008 (GotoCase): Semi-implented.
27010 2001-12-03 Ravi Pratap <ravi@ximian.com>
27012 * attribute.cs (CheckAttribute): Handle system attributes by using
27013 Attribute.GetAttributes to examine information we need.
27015 (GetValidPlaces): Same here.
27017 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27019 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27021 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27023 (Method::Define): Set appropriate flags if we have a DllImport attribute.
27025 (Method::Emit): Handle the case when we are a PInvoke method.
27027 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27029 * expression.cs: Use ResolveWithSimpleName on compound names.
27031 2001-12-02 Ravi Pratap <ravi@ximian.com>
27033 * constant.cs (EmitConstant): Make sure we resolve the associated expression
27034 before trying to reduce it.
27036 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27038 * constant.cs (LookupConstantValue): Implement.
27040 (EmitConstant): Use the above in emitting the constant.
27042 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27043 that are user-defined by doing a LookupConstantValue on them.
27045 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27048 2001-11-29 Miguel de Icaza <miguel@ximian.com>
27050 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27052 (BaseAccess.DoResolve): Implement.
27054 (MemberAccess.DoResolve): Split this routine into a
27055 ResolveMemberAccess routine that can be used independently
27057 2001-11-28 Miguel de Icaza <miguel@ximian.com>
27059 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27060 As that share bits of the implementation. Is returns a boolean,
27061 while As returns the Type that is being probed.
27063 2001-12-01 Ravi Pratap <ravi@ximian.com>
27065 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27066 instead of a Literal - much easier.
27068 (EnumInTransit): Remove - utterly useless :-)
27070 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27072 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27074 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27075 chain when we have no associated expression.
27077 2001-11-30 Ravi Pratap <ravi@ximian.com>
27079 * constant.cs (Define): Use Location while reporting the errror.
27081 Also emit a warning when 'new' is used and there is no inherited
27084 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
27087 (LookupEnumValue): Implement to lookup an enum member's value and define it
27090 (Populate): Re-write accordingly to use the above routine.
27092 2001-11-27 Miguel de Icaza <miguel@ximian.com>
27094 * expression.cs (This): Fix prototype for DoResolveLValue to
27095 override the base class DoResolveLValue.
27097 * cs-parser.cs: Report errors cs574 and cs575 (destructor
27100 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27101 (we need to load the address of the field here). This fixes
27104 (FieldExpr.DoResolveLValue): Call the DoResolve
27105 function to initialize the Instance expression.
27107 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27108 correctly the GetEnumerator operation on a value type.
27110 * cs-parser.jay: Add more simple parsing error catches.
27112 * statement.cs (Switch): Add support for string switches.
27113 Handle null specially.
27115 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
27117 2001-11-28 Ravi Pratap <ravi@ximian.com>
27119 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27121 (declare_local_constant): New helper function.
27123 * statement.cs (AddConstant): Keep a separate record of constants
27125 (IsConstant): Implement to determine if a variable is a constant.
27127 (GetConstantExpression): Implement.
27129 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
27131 * statement.cs (IsVariableDefined): Re-write.
27133 2001-11-27 Ravi Pratap <ravi@ximian.com>
27135 * class.cs (TypeContainer::FindMembers): Look for constants
27136 in the case when we are looking for MemberTypes.Field
27138 * expression.cs (MemberAccess::DoResolve): Check that in the
27139 case we are a FieldExpr and a Literal, we are not being accessed
27140 by an instance reference.
27142 * cs-parser.jay (local_constant_declaration): Implement.
27144 (declaration_statement): Implement for constant declarations.
27146 2001-11-26 Miguel de Icaza <miguel@ximian.com>
27148 * statement.cs (Switch): Catch double defaults.
27150 (Switch): More work on the switch() statement
27151 implementation. It works for integral values now, need to finish
27155 2001-11-24 Miguel de Icaza <miguel@ximian.com>
27157 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
27158 integer literals into other integer literals. To be used by
27161 2001-11-24 Ravi Pratap <ravi@ximian.com>
27163 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
27166 (EmitDynamicInitializers): Cope with the above since we extract data
27167 directly from ArrayData now.
27169 (ExpectInitializers): Keep track of whether initializers are mandatory
27172 (Bounds): Make it a hashtable to prevent the same dimension being
27173 recorded for every element in that dimension.
27175 (EmitDynamicInitializers): Fix bug which prevented the Set array method
27178 Also fix bug which was causing the indices to be emitted in the reverse
27181 2001-11-24 Miguel de Icaza <miguel@ximian.com>
27183 * expression.cs (ArrayCreation): Implement the bits that Ravi left
27184 unfinished. They do not work, because the underlying code is
27187 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27189 * cs-parser.jay: Remove bogus fixme.
27191 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
27192 on Switch statement.
27194 2001-11-23 Ravi Pratap <ravi@ximian.com>
27196 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
27199 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
27200 parameter. Apparently, any expression is allowed.
27202 (ValidateInitializers): Update accordingly.
27204 (CheckIndices): Fix some tricky bugs thanks to recursion.
27206 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
27207 I was being completely brain-dead.
27209 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
27210 and re-write acordingly.
27212 (DelegateInvocation): Re-write accordingly.
27214 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
27216 (MakeByteBlob): Handle types more correctly.
27218 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
27219 initialization from expressions but it is incomplete because I am a complete
27222 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27224 * statement.cs (If.Emit): Fix a bug that generated incorrect code
27225 on If. Basically, we have to return `true' (ie, we do return to
27226 our caller) only if both branches of the if return.
27228 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
27229 short-circuit operators, handle them as short circuit operators.
27231 (Cast.DoResolve): Resolve type.
27232 (Cast.Cast): Take an expression as the target type.
27234 * cs-parser.jay (cast_expression): Remove old hack that only
27235 allowed a limited set of types to be handled. Now we take a
27236 unary_expression and we resolve to a type during semantic
27239 Use the grammar productions from Rhys to handle casts (this is
27240 not complete like Rhys syntax yet, we fail to handle that corner
27241 case that C# has regarding (-x), but we will get there.
27243 2001-11-22 Ravi Pratap <ravi@ximian.com>
27245 * class.cs (EmitFieldInitializer): Take care of the case when we have a
27246 field which is an array type.
27248 * cs-parser.jay (declare_local_variables): Support array initialization too.
27250 * typemanager.cs (MakeKey): Implement.
27252 (everywhere): Use the above appropriately.
27254 * cs-parser.jay (for_statement): Update for array initialization while
27255 declaring variables.
27257 * ecore.cs : The error message was correct, it's the variable's names that
27258 were misleading ;-) Make the code more readable.
27260 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
27261 the correct type etc.
27263 (ConvertExplicit): Handle Enum types by examining the underlying type.
27265 2001-11-21 Ravi Pratap <ravi@ximian.com>
27267 * parameter.cs (GetCallingConvention): Always return
27268 CallingConventions.Standard for now.
27270 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27272 * expression.cs (Binary.ResolveOperator): Update the values of `l'
27273 and `r' after calling DoNumericPromotions.
27275 * ecore.cs: Fix error message (the types were in the wrong order).
27277 * statement.cs (Foreach.ProbeCollectionType): Need to pass
27278 BindingFlags.Instance as well
27280 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
27281 implicit int literal conversion in an empty cast so that we
27282 propagate the right type upstream.
27284 (UnboxCast): new class used to unbox value types.
27285 (Expression.ConvertExplicit): Add explicit type conversions done
27288 (Expression.ImplicitNumericConversion): Oops, forgot to test for
27289 the target type before applying the implicit LongLiterals to ULong
27292 2001-11-21 Miguel de Icaza <miguel@ximian.com>
27294 * cs-parser.jay (for_statement): Reworked the way For works: now
27295 we declare manually any variables that are introduced in
27296 for_initializer to solve the problem of having out-of-band code
27297 emition (that is what got for broken).
27299 (declaration_statement): Perform the actual variable declaration
27300 that used to be done in local_variable_declaration here.
27302 (local_variable_declaration): Do not declare anything, just pass
27303 the information on a DictionaryEntry
27305 2001-11-20 Ravi Pratap <ravi@ximian.com>
27307 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
27308 re-write of the logic to now make it recursive.
27310 (UpdateIndices): Re-write accordingly.
27312 Store element data in a separate ArrayData list in the above methods.
27314 (MakeByteBlob): Implement to dump the array data into a byte array.
27316 2001-11-19 Ravi Pratap <ravi@ximian.com>
27318 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
27321 * constant.cs (Define): Implement.
27323 (EmitConstant): Re-write fully.
27325 Pass in location info.
27327 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
27330 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
27331 DictionaryEntry since we need location info too.
27333 (constant_declaration): Update accordingly.
27335 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
27336 code into another method : UpdateIndices.
27338 2001-11-18 Ravi Pratap <ravi@ximian.com>
27340 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
27341 some type checking etc.
27343 2001-11-17 Ravi Pratap <ravi@ximian.com>
27345 * expression.cs (ArrayCreation::ValidateInitializers): Implement
27346 bits to provide dimension info if the user skips doing that.
27348 Update second constructor to store the rank correctly.
27350 2001-11-16 Ravi Pratap <ravi@ximian.com>
27352 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
27353 and try to implement.
27355 * ../errors/cs0150.cs : Add.
27357 * ../errors/cs0178.cs : Add.
27359 2001-11-16 Miguel de Icaza <miguel@ximian.com>
27361 * statement.cs: Implement foreach on multi-dimensional arrays.
27363 * parameter.cs (Parameters.GetParameterByName): Also lookup the
27364 name of the params argument.
27366 * expression.cs: Use EmitStoreOpcode to get the right opcode while
27367 initializing the array.
27369 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
27370 we can use this elsewhere.
27372 * statement.cs: Finish implementation of foreach for single
27375 * cs-parser.jay: Use an out-of-band stack to pass information
27376 around, I wonder why I need this.
27378 foreach_block: Make the new foreach_block the current_block.
27380 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
27381 function used to return a static Parameters structure. Used for
27382 empty parameters, as those are created very frequently.
27384 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
27386 2001-11-15 Ravi Pratap <ravi@ximian.com>
27388 * interface.cs : Default modifier is private, not public. The
27389 make verify test passes again.
27391 2001-11-15 Ravi Pratap <ravi@ximian.com>
27393 * support.cs (ReflectionParameters): Fix logic to determine
27394 whether the last parameter is a params one. Test 9 passes again.
27396 * delegate.cs (Populate): Register the builders we define with
27397 RegisterParameterForBuilder. Test 19 passes again.
27399 * cs-parser.jay (property_declaration): Reference $6 instead
27400 of $$ to get at the location.
27402 (indexer_declaration): Similar stuff.
27404 (attribute): Ditto.
27406 * class.cs (Property): Register parameters for the Get and Set methods
27407 if they exist. Test 23 passes again.
27409 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
27410 call to EmitArguments as we are sure there aren't any params arguments.
27411 Test 32 passes again.
27413 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
27414 IndexOutOfRangeException.
27416 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
27417 Test 33 now passes again.
27419 2001-11-15 Miguel de Icaza <miguel@ximian.com>
27421 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
27422 broke a bunch of things. Will have to come up with a better way
27423 of tracking locations.
27425 * statement.cs: Implemented foreach for single dimension arrays.
27427 2001-11-09 Miguel de Icaza <miguel@ximian.com>
27429 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
27430 an error. This removes the lookup from the critical path.
27432 * cs-parser.jay: Removed use of temporary_loc, which is completely
27435 2001-11-14 Miguel de Icaza <miguel@ximian.com>
27437 * support.cs (ReflectionParameters.ParameterModifier): Report
27438 whether the argument is a PARAMS argument or not.
27440 * class.cs: Set the attribute `ParamArrayAttribute' on the
27441 parameter argument.
27443 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
27444 and cons_param_array_attribute (ConstructorInfo for
27445 ParamArrayAttribute).,
27447 * codegen.cs: Emit the return using the `Return' statement, that
27448 way we can report the error correctly for missing return values.
27450 * class.cs (Method.Emit): Clean up.
27452 * expression.cs (Argument.Resolve): Take another argument: the
27453 location where this argument is used. Notice that this is not
27454 part of the "Argument" class as to reduce the size of the
27455 structure (we know the approximate location anyways).
27457 Test if the argument is a variable-reference, if not, then
27458 complain with a 206.
27460 (Argument.Emit): Emit addresses of variables.
27462 (Argument.FullDesc): Simplify.
27464 (Invocation.DoResolve): Update for Argument.Resolve.
27466 (ElementAccess.DoResolve): ditto.
27468 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
27469 method should be virtual, as this method is always virtual.
27471 (NewDelegate.DoResolve): Update for Argument.Resolve.
27473 * class.cs (ConstructorInitializer.DoResolve): ditto.
27475 * attribute.cs (Attribute.Resolve): ditto.
27477 2001-11-13 Miguel de Icaza <miguel@ximian.com>
27479 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
27481 * expression.cs (ParameterReference): Drop IStackStorage and implement
27482 IAssignMethod instead.
27484 (LocalVariableReference): ditto.
27486 * ecore.cs (FieldExpr): Drop IStackStorage and implement
27487 IAssignMethod instead.
27489 2001-11-13 Miguel de Icaza <miguel@ximian.com>
27491 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
27492 enumerations that are used in heavily used structures derive from
27493 byte in a laughable and pathetic attempt to reduce memory usage.
27494 This is the kind of pre-optimzations that you should not do at
27495 home without adult supervision.
27497 * expression.cs (UnaryMutator): New class, used to handle ++ and
27498 -- separatedly from the other unary operators. Cleans up the
27499 code, and kills the ExpressionStatement dependency in Unary.
27501 (Unary): Removed `method' and `Arguments' from this class, making
27502 it smaller, and moving it all to SimpleCall, so I can reuse this
27503 code in other locations and avoid creating a lot of transient data
27504 strucutres when not required.
27506 * cs-parser.jay: Adjust for new changes.
27508 2001-11-11 Miguel de Icaza <miguel@ximian.com>
27510 * enum.cs (Enum.Populate): If there is a failure during
27513 * cs-parser.jay (opt_enum_base): we used to catch type errors
27514 here, but this is really incorrect. The type error should be
27515 catched during semantic analysis.
27517 2001-12-11 Ravi Pratap <ravi@ximian.com>
27519 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
27520 current_local_parameters as expected since I, in my stupidity, had forgotten
27523 * attribute.cs (GetValidPlaces): Fix stupid bug.
27525 * class.cs (Method::Emit): Perform check on applicability of attributes.
27527 (Constructor::Emit): Ditto.
27529 (Field::Emit): Ditto.
27531 (Field.Location): Store location information.
27533 (Property, Event, Indexer, Operator): Ditto.
27535 * cs-parser.jay (field_declaration): Pass in location for each field.
27537 * ../errors/cs0592.cs : Add.
27539 2001-11-12 Ravi Pratap <ravi@ximian.com>
27541 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
27543 (InitCoreTypes): Update accordingly.
27545 (RegisterAttrType, LookupAttr): Implement.
27547 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
27548 info about the same.
27550 (Resolve): Update to populate the above as necessary.
27552 (Error592): Helper.
27554 (GetValidPlaces): Helper to the above.
27556 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
27558 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
27560 2001-11-12 Ravi Pratap <ravi@ximian.com>
27562 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
27564 * ../errors/cs0617.cs : Add.
27566 2001-11-11 Ravi Pratap <ravi@ximian.com>
27568 * enum.cs (Emit): Rename to Populate to be more consistent with what
27569 we expect it to do and when exactly it is called.
27571 * class.cs, rootcontext.cs : Update accordingly.
27573 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
27574 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
27576 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
27578 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
27579 of a fieldinfo using the above, when dealing with a FieldBuilder.
27581 2001-11-10 Ravi Pratap <ravi@ximian.com>
27583 * ../errors/cs0031.cs : Add.
27585 * ../errors/cs1008.cs : Add.
27587 * ../errrors/cs0543.cs : Add.
27589 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
27592 (FindMembers): Implement.
27594 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
27595 enums and delegates too.
27597 (enum_types): Rename to builder_to_enum.
27599 (delegate_types): Rename to builder_to_delegate.
27601 * delegate.cs (FindMembers): Implement.
27603 2001-11-09 Ravi Pratap <ravi@ximian.com>
27605 * typemanager.cs (IsEnumType): Implement.
27607 * enum.cs (Emit): Re-write parts to account for the underlying type
27608 better and perform checking etc.
27610 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
27611 of the underlying type.
27613 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
27616 * enum.cs (error31): Helper to report error #31.
27618 * cs-parser.jay (enum_declaration): Store location of each member too.
27620 * enum.cs (member_to_location): New hashtable.
27622 (AddEnumMember): Update location hashtable.
27624 (Emit): Use the location of each member while reporting errors.
27626 2001-11-09 Miguel de Icaza <miguel@ximian.com>
27628 * cs-parser.jay: A for_initializer if is a
27629 local_variable_declaration really ammount to have an implicit
27630 block with the variable declaration and no initializer for for.
27632 * statement.cs (For.Emit): Cope with null initializers.
27634 This fixes the infinite loop on for initializers.
27636 2001-11-08 Miguel de Icaza <miguel@ximian.com>
27638 * enum.cs: More cleanup.
27640 * ecore.cs: Remove dead code.
27642 * class.cs (Property.Emit): More simplification.
27643 (Event.Emit): ditto.
27645 Reworked to have less levels of indentation.
27647 2001-11-08 Ravi Pratap <ravi@ximian.com>
27649 * class.cs (Property): Emit attributes.
27659 * enum.cs (Emit): Ditto.
27661 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
27664 * class.cs (Field, Event, etc.): Move attribute generation into the
27665 Emit method everywhere.
27667 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
27668 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
27669 as we had no way of defining nested enums !
27671 * rootcontext.cs : Adjust code accordingly.
27673 * typemanager.cs (AddEnumType): To keep track of enum types separately.
27675 2001-11-07 Ravi Pratap <ravi@ximian.com>
27677 * expression.cs (EvalConstantExpression): Move into ecore.cs
27679 * enum.cs (Enum): Rename some members and make them public and readonly
27680 according to our convention.
27682 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
27685 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
27687 (Enum::Emit): Write a simple version for now which doesn't try to compute
27688 expressions. I shall modify this to be more robust in just a while.
27690 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
27692 (TypeContainer::CloseType): Create the Enum types too.
27694 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
27696 * expression.cs (EvalConstantExpression): Get rid of completely.
27698 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
27699 user-defined values and other cases.
27701 (IsValidEnumLiteral): Helper function.
27703 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
27704 out there in the case we had a literal FieldExpr.
27706 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
27708 (Literalize): Revamp a bit to take two arguments.
27710 (EnumLiteral): New class which derives from Literal to wrap enum literals.
27712 2001-11-06 Ravi Pratap <ravi@ximian.com>
27714 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
27716 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
27718 (Resolve): Use the above to ensure we have proper initializers.
27720 2001-11-05 Ravi Pratap <ravi@ximian.com>
27722 * expression.cs (Expression::EvalConstantExpression): New method to
27723 evaluate constant expressions.
27725 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
27727 2001-11-07 Miguel de Icaza <miguel@ximian.com>
27729 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
27732 (Binary.ResolveOperator): Handle operator != (object a, object b)
27733 and operator == (object a, object b);
27735 (Binary.DoNumericPromotions): Indicate whether the numeric
27736 promotion was possible.
27738 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
27741 Made the ArrayAccess implement interface IAssignMethod instead of
27742 IStackStore as the order in which arguments are passed reflects
27745 * assign.cs: Instead of using expr.ExprClass to select the way of
27746 assinging, probe for the IStackStore/IAssignMethod interfaces.
27748 * typemanager.cs: Load InitializeArray definition.
27750 * rootcontext.cs (RootContext.MakeStaticData): Used to define
27751 static data that can be used to initialize arrays.
27753 2001-11-05 Miguel de Icaza <miguel@ximian.com>
27755 * expression.cs: Handle operator== and operator!= for booleans.
27757 (Conditioal.Reduce): Implement reducer for the ?: operator.
27759 (Conditional.Resolve): Implement dead code elimination.
27761 (Binary.Resolve): Catch string literals and return a new
27762 concatenated string.
27764 (Unary.Reduce): Implement reduction of unary expressions.
27766 * ecore.cs: Split out the expression core handling here.
27768 (Expression.Reduce): New method used to perform constant folding
27769 and CSE. This is needed to support constant-expressions.
27771 * statement.cs (Statement.EmitBoolExpression): Pass true and false
27772 targets, and optimize for !x.
27774 2001-11-04 Ravi Pratap <ravi@ximian.com>
27776 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
27777 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
27778 set custom atttributes.
27780 * literal.cs (Literal::GetValue): New abstract method to return the actual
27781 value of the literal, cast as an object.
27783 (*Literal): Implement GetValue method.
27785 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
27786 expressions to the arraylist but objects of type Argument.
27788 * class.cs (TypeContainer::Emit): Emit our attributes too.
27790 (Method::Emit, Constructor::Emit): Ditto.
27792 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
27793 to be ignoring earlier.
27795 2001-11-03 Ravi Pratap <ravi@ximian.com>
27797 * attribute.cs (AttributeSection::Define): Implement to do the business
27798 of constructing a CustomAttributeBuilder.
27800 (Attribute): New trivial class. Increases readability of code.
27802 * cs-parser.jay : Update accordingly.
27804 (positional_argument_list, named_argument_list, named_argument): New rules
27806 (attribute_arguments): Use the above so that we are more correct.
27808 2001-11-02 Ravi Pratap <ravi@ximian.com>
27810 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
27811 to perform all checks for a method with a params parameter.
27813 (Invocation::OverloadResolve): Update to use the above method and therefore
27814 cope correctly with params method invocations.
27816 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
27819 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
27820 constructors in our parent too because we can't afford to miss out on
27823 * attribute.cs (AttributeSection): New name for the class Attribute
27825 Other trivial changes to improve readability.
27827 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
27828 use the new class names.
27830 2001-11-01 Ravi Pratap <ravi@ximian.com>
27832 * class.cs (Method::Define): Complete definition for params types too
27834 (Indexer::Define): Ditto.
27836 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
27837 Cope everywhere with a request for info about the array parameter.
27839 2001-11-01 Ravi Pratap <ravi@ximian.com>
27841 * tree.cs (RecordNamespace): Fix up to check for the correct key.
27843 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
27844 local_variable_type to extract the string corresponding to the type.
27846 (local_variable_type): Fixup the action to use the new helper method.
27848 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
27851 * expression.cs : Clean out code which uses the above.
27853 2001-10-31 Ravi Pratap <ravi@ximian.com>
27855 * typemanager.cs (RegisterMethod): Check if we already have an existing key
27856 and bale out if necessary by returning a false.
27858 (RegisterProperty): Ditto.
27860 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
27861 and print out appropriate error messages.
27863 * interface.cs (everywhere): Ditto.
27865 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
27866 location to constructor.
27868 * class.cs (Property, Event, Indexer): Update accordingly.
27870 * ../errors/cs111.cs : Added.
27872 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
27873 of a method, as laid down by the spec.
27875 (Invocation::OverloadResolve): Use the above method.
27877 2001-10-31 Ravi Pratap <ravi@ximian.com>
27879 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
27880 now take a TypeContainer and a Parameters object.
27882 (ParameterData): Modify return type of ParameterModifier method to be
27883 Parameter.Modifier and not a string.
27885 (ReflectionParameters, InternalParameters): Update accordingly.
27887 * expression.cs (Argument::GetParameterModifier): Same here.
27889 * support.cs (InternalParameters::ParameterType): Find a better way of determining
27890 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
27891 symbol in it at all so maybe this is only for now.
27893 2001-10-30 Ravi Pratap <ravi@ximian.com>
27895 * support.cs (InternalParameters): Constructor now takes an extra argument
27896 which is the actual Parameters class.
27898 (ParameterDesc): Update to provide info on ref/out modifiers.
27900 * class.cs (everywhere): Update call to InternalParameters to pass in
27901 the second argument too.
27903 * support.cs (ParameterData): Add ParameterModifier, which is a method
27904 to return the modifier info [ref/out etc]
27906 (InternalParameters, ReflectionParameters): Implement the above.
27908 * expression.cs (Argument::ParameterModifier): Similar function to return
27909 info about the argument's modifiers.
27911 (Invocation::OverloadResolve): Update to take into account matching modifiers
27914 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
27915 a new SetFormalParameters object which we pass to InternalParameters.
27917 2001-10-30 Ravi Pratap <ravi@ximian.com>
27919 * expression.cs (NewArray): Merge into the ArrayCreation class.
27921 2001-10-29 Ravi Pratap <ravi@ximian.com>
27923 * expression.cs (NewArray): Merge classes NewBuiltinArray and
27924 NewUserdefinedArray into one as there wasn't much of a use in having
27927 * expression.cs (Argument): Change field's name to ArgType from Type.
27929 (Type): New readonly property which returns the proper type, taking into
27930 account ref/out modifiers.
27932 (everywhere): Adjust code accordingly for the above.
27934 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
27935 whether we are emitting for a ref or out parameter.
27937 * expression.cs (Argument::Emit): Use the above field to set the state.
27939 (LocalVariableReference::Emit): Update to honour the flag and emit the
27942 * parameter.cs (Attributes): Set the correct flags for ref parameters.
27944 * expression.cs (Argument::FullDesc): New function to provide a full desc.
27946 * support.cs (ParameterData): Add method ParameterDesc to the interface.
27948 (ReflectionParameters, InternalParameters): Implement the above method.
27950 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
27953 (Invocation::FullMethodDesc): Ditto.
27955 2001-10-29 Miguel de Icaza <miguel@ximian.com>
27957 * cs-parser.jay: Add extra production for the second form of array
27960 * expression.cs (ArrayCreation): Update to reflect the above
27963 * Small changes to prepare for Array initialization.
27965 2001-10-28 Miguel de Icaza <miguel@ximian.com>
27967 * typemanager.cs (ImplementsInterface): interface might be null;
27968 Deal with this problem;
27970 Also, we do store negative hits on the cache (null values), so use
27971 this instead of calling t.GetInterfaces on the type everytime.
27973 2001-10-28 Ravi Pratap <ravi@ximian.com>
27975 * typemanager.cs (IsBuiltinType): New method to help determine the same.
27977 * expression.cs (New::DoResolve): Get rid of array creation code and instead
27978 split functionality out into different classes.
27980 (New::FormArrayType): Move into NewBuiltinArray.
27982 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
27985 (NewBuiltinArray): New class to handle creation of built-in arrays.
27987 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
27988 account creation of one-dimensional arrays.
27990 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
27992 (NewUserdefinedArray::DoResolve): Implement.
27994 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
27996 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
27997 we maintain inside the TypeManager. This is necessary to perform lookups on the
28000 (LookupType): Update to perform GetType on the module builders too.
28002 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28004 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28006 2001-10-23 Ravi Pratap <ravi@ximian.com>
28008 * expression.cs (New::DoResolve): Implement guts of array creation.
28010 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28012 2001-10-27 Miguel de Icaza <miguel@ximian.com>
28014 * expression.cs: Fix bug I introduced lsat night that broke
28017 (Expression.Resolve): Report a 246 error (can not resolve name)
28018 if we find a SimpleName in the stream.
28020 (Expression.ResolveLValue): Ditto.
28022 (Expression.ResolveWithSimpleName): This function is a variant of
28023 ResolveName, this one allows SimpleNames to be returned without a
28024 warning. The only consumer of SimpleNames is MemberAccess
28026 2001-10-26 Miguel de Icaza <miguel@ximian.com>
28028 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28029 might arrive here. I have my doubts that this is correct.
28031 * statement.cs (Lock): Implement lock statement.
28033 * cs-parser.jay: Small fixes to support `lock' and `using'
28035 * cs-tokenizer.cs: Remove extra space
28037 * driver.cs: New flag --checked, allows to turn on integer math
28040 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28041 Threading.Monitor.Exit
28043 2001-10-23 Miguel de Icaza <miguel@ximian.com>
28045 * expression.cs (IndexerAccess::DoResolveLValue): Set the
28046 Expression Class to be IndexerAccess.
28048 Notice that Indexer::DoResolve sets the eclass to Value.
28050 2001-10-22 Miguel de Icaza <miguel@ximian.com>
28052 * class.cs (TypeContainer::Emit): Emit code for indexers.
28054 * assign.cs (IAssignMethod): New interface implemented by Indexers
28055 and Properties for handling assignment.
28057 (Assign::Emit): Simplify and reuse code.
28059 * expression.cs (IndexerAccess, PropertyExpr): Implement
28060 IAssignMethod, clean up old code.
28062 2001-10-22 Ravi Pratap <ravi@ximian.com>
28064 * typemanager.cs (ImplementsInterface): New method to determine if a type
28065 implements a given interface. Provides a nice cache too.
28067 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28070 (ConvertReferenceExplicit): Ditto.
28072 * delegate.cs (Delegate::Populate): Update to define the parameters on the
28073 various methods, with correct names etc.
28075 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
28076 Operator.UnaryNegation.
28078 * cs-parser.jay (operator_declarator): Be a little clever in the case where
28079 we have a unary plus or minus operator.
28081 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
28084 * everywhere : update accordingly.
28086 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28089 * class.cs (Method::Define): For the case where we are implementing a method
28090 inherited from an interface, we need to set the MethodAttributes.Final flag too.
28091 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28093 2001-10-21 Ravi Pratap <ravi@ximian.com>
28095 * interface.cs (FindMembers): Implement to work around S.R.E
28098 * typemanager.cs (IsInterfaceType): Implement.
28100 (FindMembers): Update to handle interface types too.
28102 * expression.cs (ImplicitReferenceConversion): Re-write bits which
28103 use IsAssignableFrom as that is not correct - it doesn't work.
28105 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28106 and accordingly override EmitStatement.
28108 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28109 using the correct logic :-)
28111 2001-10-19 Ravi Pratap <ravi@ximian.com>
28113 * ../errors/cs-11.cs : Add to demonstrate error -11
28115 2001-10-17 Miguel de Icaza <miguel@ximian.com>
28117 * assign.cs (Assign::Resolve): Resolve right hand side first, and
28118 then pass this as a hint to ResolveLValue.
28120 * expression.cs (FieldExpr): Add Location information
28122 (FieldExpr::LValueResolve): Report assignment to readonly
28125 (Expression::ExprClassFromMemberInfo): Pass location information.
28127 (Expression::ResolveLValue): Add new method that resolves an
28130 (Expression::DoResolveLValue): Default invocation calls
28133 (Indexers): New class used to keep track of indexers in a given
28136 (IStackStore): Renamed from LValue, as it did not really describe
28137 what this did. Also ResolveLValue is gone from this interface and
28138 now is part of Expression.
28140 (ElementAccess): Depending on the element access type
28142 * typemanager.cs: Add `indexer_name_type' as a Core type
28143 (System.Runtime.CompilerServices.IndexerNameAttribute)
28145 * statement.cs (Goto): Take a location.
28147 2001-10-18 Ravi Pratap <ravi@ximian.com>
28149 * delegate.cs (Delegate::VerifyDelegate): New method to verify
28150 if two delegates are compatible.
28152 (NewDelegate::DoResolve): Update to take care of the case when
28153 we instantiate a delegate from another delegate.
28155 * typemanager.cs (FindMembers): Don't even try to look up members
28156 of Delegate types for now.
28158 2001-10-18 Ravi Pratap <ravi@ximian.com>
28160 * delegate.cs (NewDelegate): New class to take care of delegate
28163 * expression.cs (New): Split the delegate related code out into
28164 the NewDelegate class.
28166 * delegate.cs (DelegateInvocation): New class to handle delegate
28169 * expression.cs (Invocation): Split out delegate related code into
28170 the DelegateInvocation class.
28172 2001-10-17 Ravi Pratap <ravi@ximian.com>
28174 * expression.cs (New::DoResolve): Implement delegate creation fully
28175 and according to the spec.
28177 (New::DoEmit): Update to handle delegates differently.
28179 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
28180 because of which we were printing out arguments in reverse order !
28182 * delegate.cs (VerifyMethod): Implement to check if the given method
28183 matches the delegate.
28185 (FullDelegateDesc): Implement.
28187 (VerifyApplicability): Implement.
28189 * expression.cs (Invocation::DoResolve): Update to accordingly handle
28190 delegate invocations too.
28192 (Invocation::Emit): Ditto.
28194 * ../errors/cs1593.cs : Added.
28196 * ../errors/cs1594.cs : Added.
28198 * delegate.cs (InstanceExpression, TargetMethod): New properties.
28200 2001-10-16 Ravi Pratap <ravi@ximian.com>
28202 * typemanager.cs (intptr_type): Core type for System.IntPtr
28204 (InitCoreTypes): Update for the same.
28206 (iasyncresult_type, asynccallback_type): Ditto.
28208 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
28211 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
28214 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
28215 the builders for the 4 members of a delegate type :-)
28217 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
28220 * expression.cs (New::DoResolve): Implement guts for delegate creation.
28222 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
28224 2001-10-15 Miguel de Icaza <miguel@ximian.com>
28226 * statement.cs (Break::Emit): Implement.
28227 (Continue::Emit): Implement.
28229 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
28230 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
28231 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
28232 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
28235 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
28236 properties that track the label for the current loop (begin of the
28237 loop and end of the loop).
28239 2001-10-15 Ravi Pratap <ravi@ximian.com>
28241 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
28242 use of emitting anything at all.
28244 * class.cs, rootcontext.cs : Get rid of calls to the same.
28246 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
28248 (Populate): Define the constructor correctly and set the implementation
28251 * typemanager.cs (delegate_types): New hashtable to hold delegates that
28254 (AddDelegateType): Implement.
28256 (IsDelegateType): Implement helper method.
28258 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
28260 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
28261 and accordingly handle it.
28263 * delegate.cs (Populate): Take TypeContainer argument.
28264 Implement bits to define the Invoke method. However, I still haven't figured out
28265 how to take care of the native int bit :-(
28267 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
28268 Qualify the name of the delegate, not its return type !
28270 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
28273 (StandardConversionExists): Checking for array types turns out to be recursive.
28275 (ConvertReferenceExplicit): Implement array conversion.
28277 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
28279 2001-10-12 Ravi Pratap <ravi@ximian.com>
28281 * cs-parser.jay (delegate_declaration): Store the fully qualified
28282 name as it is a type declaration.
28284 * delegate.cs (ReturnType, Name): Rename members to these. Make them
28287 (DefineDelegate): Renamed from Define. Does the same thing essentially,
28288 as TypeContainer::DefineType.
28290 (Populate): Method in which all the definition of the various methods (Invoke)
28293 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
28296 (CloseDelegate): Finally creates the delegate.
28298 * class.cs (TypeContainer::DefineType): Update to define delegates.
28299 (Populate, Emit and CloseType): Do the same thing here too.
28301 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
28302 delegates in all these operations.
28304 2001-10-14 Miguel de Icaza <miguel@ximian.com>
28306 * expression.cs: LocalTemporary: a new expression used to
28307 reference a temporary that has been created.
28309 * assign.cs: Handle PropertyAccess back here, so that we can
28310 provide the proper semantic access to properties.
28312 * expression.cs (Expression::ConvertReferenceExplicit): Implement
28313 a few more explicit conversions.
28315 * modifiers.cs: `NEW' modifier maps to HideBySig.
28317 * expression.cs (PropertyExpr): Make this into an
28318 ExpressionStatement, and support the EmitStatement code path.
28320 Perform get/set error checking, clean up the interface.
28322 * assign.cs: recognize PropertyExprs as targets, and if so, turn
28323 them into toplevel access objects.
28325 2001-10-12 Miguel de Icaza <miguel@ximian.com>
28327 * expression.cs: PropertyExpr::PropertyExpr: use work around the
28330 * typemanager.cs: Keep track here of our PropertyBuilders again to
28331 work around lameness in SRE.
28333 2001-10-11 Miguel de Icaza <miguel@ximian.com>
28335 * expression.cs (LValue::LValueResolve): New method in the
28336 interface, used to perform a second resolution pass for LValues.
28338 (This::DoResolve): Catch the use of this in static methods.
28340 (This::LValueResolve): Implement.
28342 (This::Store): Remove warning, assigning to `this' in structures
28345 (Invocation::Emit): Deal with invocation of
28346 methods on value types. We need to pass the address to structure
28347 methods rather than the object itself. (The equivalent code to
28348 emit "this" for structures leaves the entire structure on the
28349 stack instead of a pointer to it).
28351 (ParameterReference::DoResolve): Compute the real index for the
28352 argument based on whether the method takes or not a `this' pointer
28353 (ie, the method is static).
28355 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
28356 value types returned from functions when we need to invoke a
28357 method on the sturcture.
28360 2001-10-11 Ravi Pratap <ravi@ximian.com>
28362 * class.cs (TypeContainer::DefineType): Method to actually do the business of
28363 defining the type in the Modulebuilder or Typebuilder. This is to take
28364 care of nested types which need to be defined on the TypeBuilder using
28365 DefineNestedMethod.
28367 (TypeContainer::GetClassBases): Implement. Essentially the code from the
28368 methods in RootContext, only ported to be part of TypeContainer.
28370 (TypeContainer::GetInterfaceOrClass): Ditto.
28372 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
28374 * interface.cs (Interface::DefineInterface): New method. Does exactly
28375 what RootContext.CreateInterface did earlier, only it takes care of nested types
28378 (Interface::GetInterfaces): Move from RootContext here and port.
28380 (Interface::GetInterfaceByName): Same here.
28382 * rootcontext.cs (ResolveTree): Re-write.
28384 (PopulateTypes): Re-write.
28386 * class.cs (TypeContainer::Populate): Populate nested types too.
28387 (TypeContainer::Emit): Emit nested members too.
28389 * typemanager.cs (AddUserType): Do not make use of the FullName property,
28390 instead just use the name argument passed in as it is already fully
28393 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
28394 to TypeContainer mapping to see if a type is user-defined.
28396 * class.cs (TypeContainer::CloseType): Implement.
28398 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
28399 the default constructor.
28401 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
28404 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
28406 * interface.cs (CloseType): Create the type here.
28408 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
28411 Remove all the methods which are now in TypeContainer.
28413 2001-10-10 Ravi Pratap <ravi@ximian.com>
28415 * delegate.cs (Define): Re-write bits to define the delegate
28418 2001-10-10 Miguel de Icaza <miguel@ximian.com>
28420 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
28422 * expression.cs (ImplicitReferenceConversion): handle null as well
28423 as a source to convert to any reference type.
28425 * statement.cs (Return): Perform any implicit conversions to
28426 expected return type.
28428 Validate use of return statement.
28430 * codegen.cs (EmitContext): Pass the expected return type here.
28432 * class.cs (Method, Constructor, Property): Pass expected return
28433 type to EmitContext.
28435 2001-10-09 Miguel de Icaza <miguel@ximian.com>
28437 * expression.cs: Make DoResolve take an EmitContext instead of a
28440 Replaced `l' and `location' for `loc', for consistency.
28442 (Error, Warning): Remove unneeded Tc argument.
28444 * assign.cs, literal.cs, constant.cs: Update to new calling
28447 * codegen.cs: EmitContext now contains a flag indicating whether
28448 code is being generated in a static method or not.
28450 * cs-parser.jay: DecomposeQI, new function that replaces the old
28451 QualifiedIdentifier. Now we always decompose the assembled
28452 strings from qualified_identifier productions into a group of
28455 2001-10-08 Miguel de Icaza <miguel@ximian.com>
28457 * rootcontext.cs: Deal with field-less struct types correctly now
28458 by passing the size option to Define Type.
28460 * class.cs: Removed hack that created one static field.
28462 2001-10-07 Miguel de Icaza <miguel@ximian.com>
28464 * statement.cs: Moved most of the code generation here.
28466 2001-10-09 Ravi Pratap <ravi@ximian.com>
28468 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
28471 (ElementAccess): Remove useless bits for now - keep checks as the spec
28474 2001-10-08 Ravi Pratap <ravi@ximian.com>
28476 * expression.cs (ElementAccess::DoResolve): Remove my crap code
28477 and start performing checks according to the spec.
28479 2001-10-07 Ravi Pratap <ravi@ximian.com>
28481 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
28482 rank_specifiers instead.
28484 (rank_specifiers): Change the order in which the rank specifiers are stored
28486 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
28488 * expression.cs (ElementAccess): Implement the LValue interface too.
28490 2001-10-06 Ravi Pratap <ravi@ximian.com>
28492 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
28493 except that user defined conversions are not included.
28495 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
28496 perform the conversion of the return type, if necessary.
28498 (New::DoResolve): Check whether we are creating an array or an object
28499 and accordingly do the needful.
28501 (New::Emit): Same here.
28503 (New::DoResolve): Implement guts of array creation.
28505 (New::FormLookupType): Helper function.
28507 2001-10-07 Miguel de Icaza <miguel@ximian.com>
28509 * codegen.cs: Removed most of the code generation here, and move the
28510 corresponding code generation bits to the statement classes.
28512 Added support for try/catch/finalize and throw.
28514 * cs-parser.jay: Added support for try/catch/finalize.
28516 * class.cs: Catch static methods having the flags override,
28517 virtual or abstract.
28519 * expression.cs (UserCast): This user cast was not really doing
28520 what it was supposed to do. Which is to be born in fully resolved
28521 state. Parts of the resolution were being performed at Emit time!
28525 2001-10-05 Miguel de Icaza <miguel@ximian.com>
28527 * expression.cs: Implicity convert the result from UserCast.
28529 2001-10-05 Ravi Pratap <ravi@ximian.com>
28531 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
28532 prevented it from working correctly.
28534 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
28535 merely ConvertImplicit.
28537 2001-10-05 Miguel de Icaza <miguel@ximian.com>
28539 * typemanager.cs: Make the LookupTypeContainer function static,
28540 and not per-instance.
28542 * class.cs: Make static FindMembers (the one that takes a Type
28545 * codegen.cs: Add EmitForeach here.
28547 * cs-parser.jay: Make foreach a toplevel object instead of the
28548 inline expansion, as we need to perform semantic analysis on it.
28550 2001-10-05 Ravi Pratap <ravi@ximian.com>
28552 * expression.cs (Expression::ImplicitUserConversion): Rename to
28553 UserDefinedConversion.
28555 (Expression::UserDefinedConversion): Take an extra argument specifying
28556 whether we look for explicit user conversions too.
28558 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
28560 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
28562 (ExplicitUserConversion): Make it a call to UserDefinedConversion
28563 with the appropriate arguments.
28565 * cs-parser.jay (cast_expression): Record location too.
28567 * expression.cs (Cast): Record location info.
28569 (Expression::ConvertExplicit): Take location argument.
28571 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
28572 to determine if we are doing explicit conversions.
28574 (UserCast::Emit): Update accordingly.
28576 (Expression::ConvertExplicit): Report an error if everything fails.
28578 * ../errors/cs0030.cs : Add.
28580 2001-10-04 Miguel de Icaza <miguel@ximian.com>
28582 * modifiers.cs: If the ABSTRACT keyword is present, also set the
28583 virtual and newslot bits.
28585 * class.cs (TypeContainer::RegisterRequiredImplementations):
28586 Record methods we need.
28588 (TypeContainer::MakeKey): Helper function to make keys for
28589 MethodBases, since the Methodbase key is useless.
28591 (TypeContainer::Populate): Call RegisterRequiredImplementations
28592 before defining the methods.
28594 Create a mapping for method_builders_to_methods ahead of time
28595 instead of inside a tight loop.
28597 (::RequireMethods): Accept an object as the data to set into the
28598 hashtable so we can report interface vs abstract method mismatch.
28600 2001-10-03 Miguel de Icaza <miguel@ximian.com>
28602 * report.cs: Make all of it static.
28604 * rootcontext.cs: Drop object_type and value_type computations, as
28605 we have those in the TypeManager anyways.
28607 Drop report instance variable too, now it is a global.
28609 * driver.cs: Use try/catch on command line handling.
28611 Add --probe option to debug the error reporting system with a test
28614 * report.cs: Add support for exiting program when a probe
28615 condition is reached.
28617 2001-10-03 Ravi Pratap <ravi@ximian.com>
28619 * expression.cs (Binary::DoNumericPromotions): Fix the case when
28620 we do a forcible conversion regardless of type, to check if
28621 ForceConversion returns a null.
28623 (Binary::error19): Use location to report error.
28625 (Unary::error23): Use location here too.
28627 * ../errors/cs0019.cs : Check in.
28629 * ../errors/cs0023.cs : Check in.
28631 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
28632 case of a non-null MethodInfo object with a length of 0 !
28634 (Binary::ResolveOperator): Flag error if overload resolution fails to find
28635 an applicable member - according to the spec :-)
28636 Also fix logic to find members in base types.
28638 (Unary::ResolveOperator): Same here.
28640 (Unary::report23): Change name to error23 and make first argument a TypeContainer
28641 as I was getting thoroughly confused between this and error19 :-)
28643 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
28644 (::FindMostEncompassedType): Implement.
28645 (::FindMostEncompassingType): Implement.
28646 (::StandardConversionExists): Implement.
28648 (UserImplicitCast): Re-vamp. We now need info about most specific
28649 source and target types so that we can do the necessary conversions.
28651 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
28652 mathematical union with no duplicates.
28654 2001-10-03 Miguel de Icaza <miguel@ximian.com>
28656 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
28657 in order from base classes to child classes, so that we can in
28658 child classes look up in our parent for method names and
28659 attributes (required for handling abstract, virtual, new, override
28660 constructs: we need to instrospect our base class, and if we dont
28661 populate the classes in order, the introspection might be
28662 incorrect. For example, a method could query its parent before
28663 the parent has any methods and would determine that the parent has
28664 no abstract methods (while it could have had them)).
28666 (RootContext::CreateType): Record the order in which we define the
28669 2001-10-02 Miguel de Icaza <miguel@ximian.com>
28671 * class.cs (TypeContainer::Populate): Also method definitions can
28672 fail now, keep track of this.
28674 (TypeContainer::FindMembers): Implement support for
28675 DeclaredOnly/noDeclaredOnly flag.
28677 (Constructor::Emit) Return the ConstructorBuilder.
28679 (Method::Emit) Return the MethodBuilder.
28680 Check for abstract or virtual methods to be public.
28682 * rootcontext.cs (RootContext::CreateType): Register all the
28683 abstract methods required for the class to be complete and the
28684 interface methods that must be implemented.
28686 * cs-parser.jay: Report error 501 (method requires body if it is
28687 not marked abstract or extern).
28689 * expression.cs (TypeOf::Emit): Implement.
28691 * typemanager.cs: runtime_handle_type, new global type.
28693 * class.cs (Property::Emit): Generate code for properties.
28695 2001-10-02 Ravi Pratap <ravi@ximian.com>
28697 * expression.cs (Unary::ResolveOperator): Find operators on base type
28698 too - we now conform exactly to the spec.
28700 (Binary::ResolveOperator): Same here.
28702 * class.cs (Operator::Define): Fix minor quirk in the tests.
28704 * ../errors/cs0215.cs : Added.
28706 * ../errors/cs0556.cs : Added.
28708 * ../errors/cs0555.cs : Added.
28710 2001-10-01 Miguel de Icaza <miguel@ximian.com>
28712 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
28713 single integer which is really efficient
28715 2001-10-01 Ravi Pratap <ravi@ximian.com>
28717 * expression.cs (Expression::ImplicitUserConversion): Use location
28718 even in the case when we are examining True operators.
28720 * class.cs (Operator::Define): Perform extensive checks to conform
28721 with the rules for operator overloading in the spec.
28723 * expression.cs (Expression::ImplicitReferenceConversion): Implement
28724 some of the other conversions mentioned in the spec.
28726 * typemanager.cs (array_type): New static member for the System.Array built-in
28729 (cloneable_interface): For System.ICloneable interface.
28731 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
28732 we start resolving the tree and populating types.
28734 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
28736 2001-10-01 Miguel de Icaza <miguel@ximian.com>
28738 * expression.cs (Expression::ExprClassFromMemberInfo,
28739 Expression::Literalize): Create literal expressions from
28740 FieldInfos which are literals.
28742 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
28743 type casts, because they were wrong. The test suite in tests
28746 (ImplicitNumericConversion): ushort to ulong requires a widening
28749 Int32 constant to long requires widening cast as well.
28751 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
28752 for integers because the type on the stack is not i4.
28754 2001-09-30 Miguel de Icaza <miguel@ximian.com>
28756 * expression.cs (report118): require location argument.
28758 * parameter.cs: Do not dereference potential null value.
28760 * class.cs: Catch methods that lack the `new' keyword when
28761 overriding a name. Report warnings when `new' is used without
28762 anything being there to override.
28764 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
28766 * class.cs: Only add constructor to hashtable if it is non-null
28767 (as now constructors can fail on define).
28769 (TypeManager, Class, Struct): Take location arguments.
28771 Catch field instance initialization in structs as errors.
28773 accepting_filter: a new filter for FindMembers that is static so
28774 that we dont create an instance per invocation.
28776 (Constructor::Define): Catch errors where a struct constructor is
28779 * cs-parser.jay: Pass location information for various new
28782 * delegate.cs (Delegate): take a location argument.
28784 * driver.cs: Do not call EmitCode if there were problesm in the
28785 Definition of the types, as many Builders wont be there.
28787 * decl.cs (Decl::Decl): Require a location argument.
28789 * cs-tokenizer.cs: Handle properly hex constants that can not fit
28790 into integers, and find the most appropiate integer for it.
28792 * literal.cs: Implement ULongLiteral.
28794 * rootcontext.cs: Provide better information about the location of
28795 failure when CreateType fails.
28797 2001-09-29 Miguel de Icaza <miguel@ximian.com>
28799 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
28802 * expression.cs (Binary::CheckShiftArguments): Add missing type
28804 (Binary::ResolveOperator): Add type to the logical and and logical
28805 or, Bitwise And/Or and Exclusive Or code paths, it was missing
28808 (Binary::DoNumericPromotions): In the case where either argument
28809 is ulong (and most signed types combined with ulong cause an
28810 error) perform implicit integer constant conversions as well.
28812 2001-09-28 Miguel de Icaza <miguel@ximian.com>
28814 * expression.cs (UserImplicitCast): Method should always be
28816 (Invocation::BetterConversion): Simplified test for IntLiteral.
28818 (Expression::ImplicitNumericConversion): Split this routine out.
28819 Put the code that performs implicit constant integer conversions
28822 (Expression::Resolve): Become a wrapper around DoResolve so we can
28823 check eclass and type being set after resolve.
28825 (Invocation::Badness): Remove this dead function
28827 (Binary::ResolveOperator): Do not compute the expensive argumnets
28828 unless we have a union for it.
28830 (Probe::Emit): Is needs to do an isinst and then
28831 compare against null.
28833 (::CanConvert): Added Location argument. If the Location argument
28834 is null (Location.Null), then we do not report errors. This is
28835 used by the `probe' mechanism of the Explicit conversion. We do
28836 not want to generate an error for something that the user
28837 explicitly requested to be casted. But the pipeline for an
28838 explicit cast first tests for potential implicit casts.
28840 So for now, if the Location is null, it means `Probe only' to
28841 avoid adding another argument. Might have to revise this
28844 (ClassCast): New class used to type cast objects into arbitrary
28845 classes (used in Explicit Reference Conversions).
28847 Implement `as' as well.
28849 Reverted all the patches from Ravi below: they were broken:
28851 * The use of `level' as a mechanism to stop recursive
28852 invocations is wrong. That was there just to catch the
28853 bug with a strack trace but not as a way of addressing
28856 To fix the problem we have to *understand* what is going
28857 on and the interactions and come up with a plan, not
28858 just get things going.
28860 * The use of the type conversion cache that I proposed
28861 last night had an open topic: How does this work across
28862 protection domains. A user defined conversion might not
28863 be public in the location where we are applying the
28864 conversion, a different conversion might be selected
28865 (ie, private A->B (better) but public B->A (worse),
28866 inside A, A->B applies, but outside it, B->A will
28869 * On top of that (ie, even if the above is solved),
28870 conversions in a cache need to be abstract. Ie, `To
28871 convert from an Int to a Short use an OpcodeCast', not
28872 `To convert from an Int to a Short use the OpcodeCast on
28873 the variable 5' (which is what this patch was doing).
28875 2001-09-28 Ravi Pratap <ravi@ximian.com>
28877 * expression.cs (Invocation::ConversionExists): Re-write to use
28878 the conversion cache
28880 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
28881 cache all conversions done, not just user-defined ones.
28883 (Invocation::BetterConversion): The real culprit. Use ConversionExists
28884 to determine if a conversion exists instead of acutually trying to
28885 perform the conversion. It's faster too.
28887 (Expression::ConvertExplicit): Modify to use ConversionExists to check
28888 and only then attempt the implicit conversion.
28890 2001-09-28 Ravi Pratap <ravi@ximian.com>
28892 * expression.cs (ConvertImplicit): Use a cache for conversions
28893 already found. Check level of recursion and bail out if necessary.
28895 2001-09-28 Miguel de Icaza <miguel@ximian.com>
28897 * typemanager.cs (string_concat_string_string, string_concat_object_object):
28898 Export standard methods that we expect for string operations.
28900 * statement.cs (Block::UsageWarning): Track usage of variables and
28901 report the errors for not used variables.
28903 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
28906 2001-09-27 Miguel de Icaza <miguel@ximian.com>
28908 * codegen.cs: remove unnneded code
28910 * expression.cs: Removed BuiltinTypeAccess class
28912 Fix the order in which implicit conversions are
28915 The previous fixed dropped support for boxed conversions (adding a
28916 test to the test suite now)
28918 (UserImplicitCast::CanConvert): Remove test for source being null,
28919 that code is broken. We should not feed a null to begin with, if
28920 we do, then we should track the bug where the problem originates
28921 and not try to cover it up here.
28923 Return a resolved expression of type UserImplicitCast on success
28924 rather than true/false. Ravi: this is what I was talking about,
28925 the pattern is to use a static method as a "constructor" for
28928 Also, do not create arguments until the very last minute,
28929 otherwise we always create the arguments even for lookups that
28930 will never be performed.
28932 (UserImplicitCast::Resolve): Eliminate, objects of type
28933 UserImplicitCast are born in a fully resolved state.
28935 * typemanager.cs (InitCoreTypes): Init also value_type
28936 (System.ValueType).
28938 * expression.cs (Cast::Resolve): First resolve the child expression.
28940 (LValue): Add new method AddressOf to be used by
28943 Change the argument of Store to take an EmitContext instead of an
28944 ILGenerator, because things like FieldExpr need to be able to call
28945 their children expression to generate the instance code.
28947 (Expression::Error, Expression::Warning): Sugar functions for
28950 (Expression::MemberLookup): Accept a TypeContainer instead of a
28951 Report as the first argument.
28953 (Expression::ResolvePrimary): Killed. I still want to improve
28954 this as currently the code is just not right.
28956 (Expression::ResolveMemberAccess): Simplify, but it is still
28959 (Unary::Resolve): Catch errors in AddressOf operators.
28961 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
28962 index to a byte for the short-version, or the compiler will choose
28963 the wrong Emit call, which generates the wrong data.
28965 (ParameterReference::Emit, ::Store): same.
28967 (FieldExpr::AddressOf): Implement.
28969 * typemanager.cs: TypeManager: made public variable instead of
28972 * driver.cs: document --fatal.
28974 * report.cs (ErrorMessage, WarningMessage): new names for the old
28975 Error and Warning classes.
28977 * cs-parser.jay (member_access): Turn built-in access to types
28978 into a normal simplename
28980 2001-09-27 Ravi Pratap <ravi@ximian.com>
28982 * expression.cs (Invocation::BetterConversion): Fix to cope
28983 with q being null, since this was introducing a bug.
28985 * expression.cs (ConvertImplicit): Do built-in conversions first.
28987 2001-09-27 Ravi Pratap <ravi@ximian.com>
28989 * expression.cs (UserImplicitCast::Resolve): Fix bug.
28991 2001-09-27 Ravi Pratap <ravi@ximian.com>
28993 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
28994 I had introduced long ago (what's new ?).
28996 * expression.cs (UserImplicitCast::CanConvert): Static method to do
28997 the work of all the checking.
28998 (ConvertImplicit): Call CanConvert and only then create object if necessary.
28999 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29001 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29002 that is the right way.
29004 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
29005 overloading resolution. Use everywhere instead of cutting and pasting code.
29007 (Binary::ResolveOperator): Use MakeUnionSet.
29009 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
29010 we have to convert to bool types. Not complete yet.
29012 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29014 * typemanager.cs (TypeManager::CSharpName): support ushort.
29016 * expression.cs (Expression::TryImplicitIntConversion): Attempts
29017 to provide an expression that performsn an implicit constant int
29018 conversion (section 6.1.6).
29019 (Expression::ConvertImplicitRequired): Reworked to include
29020 implicit constant expression conversions.
29022 (Expression::ConvertNumericExplicit): Finished.
29024 (Invocation::Emit): If InstanceExpression is null, then it means
29025 that we perform a call on this.
29027 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29029 * expression.cs (Unary::Emit): Remove some dead code.
29030 (Probe): Implement Resolve and Emit for `is'.
29031 (Expression::ConvertImplicitRequired): Attempt to do constant
29032 expression conversions here. Maybe should be moved to
29033 ConvertImplicit, but I am not sure.
29034 (Expression::ImplicitLongConstantConversionPossible,
29035 Expression::ImplicitIntConstantConversionPossible): New functions
29036 that tell whether is it possible to apply an implicit constant
29037 expression conversion.
29039 (ConvertNumericExplicit): Started work on explicit numeric
29042 * cs-parser.jay: Update operator constants.
29044 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29045 (Parameters::GetSignature): Hook up VerifyArgs here.
29046 (Parameters::VerifyArgs): Verifies that no two arguments have the
29049 * class.cs (Operator): Update the operator names to reflect the
29050 ones that the spec expects (as we are just stringizing the
29053 * expression.cs (Unary::ResolveOperator): Fix bug: Use
29054 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29055 previous usage did only work for our methods.
29056 (Expression::ConvertImplicit): Handle decimal implicit numeric
29057 conversions as well.
29058 (Expression::InternalTypeConstructor): Used to invoke constructors
29059 on internal types for default promotions.
29061 (Unary::Emit): Implement special handling for the pre/post
29062 increment/decrement for overloaded operators, as they need to have
29063 the same semantics as the other operators.
29065 (Binary::ResolveOperator): ditto.
29066 (Invocation::ConversionExists): ditto.
29067 (UserImplicitCast::Resolve): ditto.
29069 2001-09-26 Ravi Pratap <ravi@ximian.com>
29071 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29072 operator, return after emitting body. Regression tests pass again !
29074 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29075 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29076 (Invocation::OverloadResolve): Ditto.
29077 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29079 * everywhere : update calls to the above methods accordingly.
29081 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29083 * assign.cs (Assign): Make it inherit from ExpressionStatement.
29085 * expression.cs (ExpressionStatement): New base class used for
29086 expressions that can appear in statements, so that we can provide
29087 an alternate path to generate expression that do not leave a value
29090 (Expression::Emit, and all the derivatives): We no longer return
29091 whether a value is left on the stack or not. Every expression
29092 after being emitted leaves a single value on the stack.
29094 * codegen.cs (EmitContext::EmitStatementExpression): Use the
29095 facilties of ExpressionStatement if possible.
29097 * cs-parser.jay: Update statement_expression.
29099 2001-09-25 Miguel de Icaza <miguel@ximian.com>
29101 * driver.cs: Change the wording of message
29103 2001-09-25 Ravi Pratap <ravi@ximian.com>
29105 * expression.cs (Binary::ResolveOperator): Had forgottten to set
29106 the type of the expression to the return type of the method if
29107 we have an overloaded operator match ! The regression tests pass again !
29108 (Unary::ResolveOperator): Ditto.
29110 * expression.cs (Invocation::ConversionExists): Correct the member lookup
29111 to find "op_Implicit", not "implicit" ;-)
29112 (UserImplicitCast): New class to take care of user-defined implicit conversions.
29113 (ConvertImplicit, ForceConversion): Take TypeContainer argument
29115 * everywhere : Correct calls to the above accordingly.
29117 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29118 (ConvertImplicit): Do user-defined conversion if it exists.
29120 2001-09-24 Miguel de Icaza <miguel@ximian.com>
29122 * assign.cs: track location.
29123 (Resolve): Use implicit conversions on assignment.
29125 * literal.cs: Oops. Not good, Emit of short access values should
29126 pass (Bytes) or the wrong argument will be selected.
29128 * expression.cs (Unary::Emit): Emit code for -expr.
29130 (Unary::ResolveOperator): Handle `Substract' for non-constants
29131 (substract from zero from the non-constants).
29132 Deal with Doubles as well.
29134 (Expression::ConvertImplicitRequired): New routine that reports an
29135 error if no implicit conversion exists.
29137 (Invocation::OverloadResolve): Store the converted implicit
29138 expressions if we make them
29140 2001-09-24 Ravi Pratap <ravi@ximian.com>
29142 * class.cs (ConstructorInitializer): Take a Location argument.
29143 (ConstructorBaseInitializer): Same here.
29144 (ConstructorThisInitializer): Same here.
29146 * cs-parser.jay : Update all calls accordingly.
29148 * expression.cs (Unary, Binary, New): Take location argument.
29149 Update accordingly everywhere.
29151 * cs-parser.jay : Update all calls to the above to take a location
29154 * class.cs : Ditto.
29156 2001-09-24 Ravi Pratap <ravi@ximian.com>
29158 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
29159 (Invocation::BetterConversion): Same here
29160 (Invocation::ConversionExists): Ditto.
29162 (Invocation::ConversionExists): Implement.
29164 2001-09-22 Ravi Pratap <ravi@ximian.com>
29166 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
29167 Also take an additional TypeContainer argument.
29169 * All over : Pass in TypeContainer as argument to OverloadResolve.
29171 * typemanager.cs (CSharpName): Update to check for the string type and return
29174 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
29177 2001-09-21 Ravi Pratap <ravi@ximian.com>
29179 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
29180 (Invocation::BetterFunction): Implement.
29181 (Invocation::BetterConversion): Implement.
29182 (Invocation::ConversionExists): Skeleton, no implementation yet.
29184 Okay, things work fine !
29186 2001-09-21 Miguel de Icaza <miguel@ximian.com>
29188 * typemanager.cs: declare and load enum_type, delegate_type and
29191 * expression.cs (Expression::Emit): Now emit returns a value that
29192 tells whether a value is left on the stack or not. This strategy
29193 might be reveted tomorrow with a mechanism that would address
29194 multiple assignments.
29195 (Expression::report118): Utility routine to report mismatches on
29198 (Unary::Report23): Report impossible type/operator combination
29201 (Unary::IsIncrementableNumber): Whether the type can be
29202 incremented or decremented with add.
29203 (Unary::ResolveOperator): Also allow enumerations to be bitwise
29205 (Unary::ResolveOperator): Implement ++, !, ~,
29207 (Invocation::Emit): Deal with new Emit convetion.
29209 * All Expression derivatives: Updated their Emit method to return
29210 whether they leave values on the stack or not.
29212 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
29213 stack for expressions that are statements.
29215 2001-09-20 Miguel de Icaza <miguel@ximian.com>
29217 * expression.cs (LValue): New interface. Must be implemented by
29219 (LocalVariableReference, ParameterReference, FieldExpr): Implement
29222 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
29223 interface for generating code, simplifies the code.
29225 2001-09-20 Ravi Pratap <ravi@ximian.com>
29227 * expression.cs (everywhere): Comment out return statements in ::Resolve
29228 methods to avoid the warnings.
29230 2001-09-20 Miguel de Icaza <miguel@ximian.com>
29232 * driver.cs (parse): Report error 2001 if we can not open the
29235 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
29238 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
29241 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
29242 otherwise nested blocks end up with the same index.
29244 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
29246 * expression.cs: Instead of having FIXMEs in the Resolve
29247 functions, throw exceptions so it is obvious that we are facing a
29250 * cs-parser.jay (invocation_expression): Pass Location information.
29252 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
29253 Use a basename for those routines because .NET does not like paths
29256 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
29259 2001-09-19 Miguel de Icaza <miguel@ximian.com>
29261 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
29262 are loading the correct data types (throws an exception if not).
29263 (TypeManager::InitCoreTypes): Use CoreLookupType
29265 * expression.cs (Unary::ResolveOperator): return the child
29266 expression for expressions which are just +expr.
29267 (Unary::ResolveOperator): Return negative literals for -LITERAL
29268 expressions (otherwise they are Unary {Literal}).
29269 (Invocation::Badness): Take into account `Implicit constant
29270 expression conversions'.
29272 * literal.cs (LongLiteral): Implement long literal class.
29273 (IntLiteral): export the `Value' of the intliteral.
29275 2001-09-19 Ravi Pratap <ravi@ximian.com>
29277 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
29279 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
29280 instead of 'Operator'
29282 * expression.cs (Binary::ResolveOperator): Update accordingly.
29283 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
29286 * cs-parser.jay (unary_expression): Update to use the new names.
29288 * gen-treedump.cs (GetUnary): Same here.
29290 * expression.cs (Unary::Resolve): Implement.
29291 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
29292 operators are found instead of making noise ;-)
29293 (Unary::ResolveOperator): New method to do precisely the same thing which
29294 Binary::ResolveOperator does for Binary expressions.
29295 (Unary.method, .Arguments): Add.
29296 (Unary::OperName): Implement.
29297 (Unary::ForceConversion): Copy and Paste !
29299 * class.cs (Operator::Define): Fix a small bug for the case when we have
29302 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
29303 for the inbuilt operators. Only overloading works for now ;-)
29305 2001-09-18 Miguel de Icaza <miguel@ximian.com>
29307 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
29308 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
29310 * expression.cs (This::Emit): Implement.
29311 (This::Resolve): Implement.
29312 (TypeOf:Resolve): Implement.
29313 (Expression::ResolveSimpleName): Add an implicit this to instance
29315 (MemberAccess::Resolve): Deal with Parameters and Fields.
29316 Bind instance variable to Field expressions.
29317 (FieldExpr::Instance): New field used to track the expression that
29318 represents the object instance.
29319 (FieldExpr::Resolve): Track potential errors from MemberLookup not
29321 (FieldExpr::Emit): Implement.
29323 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
29324 the last instruction contains a return opcode to avoid generating
29325 the last `ret' instruction (this generates correct code, and it is
29326 nice to pass the peverify output).
29328 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
29329 initializer for static and instance variables.
29330 (Constructor::Emit): Allow initializer to be null in the case of
29331 static constructors. Only emit initializer for instance
29334 (TypeContainer::FindMembers): Return a null array if there are no
29337 Also fix the code for the MemberTypes.Method branch, as it was not
29338 scanning that for operators (or tried to access null variables before).
29340 * assign.cs (Assign::Emit): Handle instance and static fields.
29344 * driver.cs: Stop compilation if there are parse errors.
29346 * cs-parser.jay (constructor_declaration): Provide default base
29347 initializer for non-static constructors.
29348 (constructor_declarator): Do not provide a default base
29349 initializers if none was specified.
29350 Catch the fact that constructors should not have parameters.
29352 * class.cs: Do not emit parent class initializers for static
29353 constructors, that should be flagged as an error.
29355 2001-09-18 Ravi Pratap <ravi@ximian.com>
29357 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
29358 Move back code into TypeContainer::Populate.
29360 2001-09-18 Ravi Pratap <ravi@ximian.com>
29362 * class.cs (TypeContainer::AddConstructor): Fix the check to
29363 compare against Name, not Basename.
29364 (Operator::OpType): Change Plus and Minus to Add and Subtract.
29366 * cs-parser.jay : Update accordingly.
29368 * class.cs (TypeContainer::FindMembers): For the case where we are searching
29369 for methods, don't forget to look into the operators too.
29370 (RegisterMethodBuilder): Helper method to take care of this for
29371 methods, constructors and operators.
29372 (Operator::Define): Completely revamp.
29373 (Operator.OperatorMethod, MethodName): New fields.
29374 (TypeContainer::Populate): Move the registering of builders into
29375 RegisterMethodBuilder.
29376 (Operator::Emit): Re-write.
29378 * expression.cs (Binary::Emit): Comment out code path to emit method
29379 invocation stuff for the case when we have a user defined operator. I am
29380 just not able to get it right !
29382 2001-09-17 Miguel de Icaza <miguel@ximian.com>
29384 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
29387 (Expression::MemberLookup): Provide a version that allows to
29388 specify the MemberTypes and BindingFlags.
29390 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
29391 so it was not fetching variable information from outer blocks.
29393 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
29394 Beforefieldinit as it was buggy.
29396 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
29397 that Ravi put here.
29399 * class.cs (Constructor::Emit): Only emit if block is not null.
29400 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
29401 deal with this by semantically definining it as if the user had
29404 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
29405 constructors as we now "emit" them at a higher level.
29407 (TypeContainer::DefineDefaultConstructor): Used to define the
29408 default constructors if none was provided.
29410 (ConstructorInitializer): Add methods Resolve and Emit.
29412 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
29414 2001-09-17 Ravi Pratap <ravi@ximian.com>
29416 * class.cs (TypeContainer::EmitDefaultConstructor): Register
29417 the default constructor builder with our hashtable for methodbuilders
29420 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
29421 and argument_count is 0 in which case we have a match.
29422 (Binary::ResolveOperator): More null checking and miscellaneous coding
29425 2001-09-17 Ravi Pratap <ravi@ximian.com>
29427 * rootcontext.cs (IsNameSpace): Compare against null.
29429 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
29431 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
29432 and Unary::Operator.
29434 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
29437 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
29438 we have overloaded operators.
29439 (Binary::ResolveOperator): Implement the part which does the operator overload
29442 * class.cs (Operator::Emit): Implement.
29443 (TypeContainer::Emit): Emit the operators we have too.
29445 * expression.cs (Binary::Emit): Update to emit the appropriate code for
29446 the case when we have a user-defined operator.
29448 2001-09-17 Miguel de Icaza <miguel@ximian.com>
29450 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
29452 2001-09-16 Ravi Pratap <ravi@ximian.com>
29454 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
29455 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
29456 (Constructor::Emit): Implement.
29457 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
29458 if we have no work to do.
29459 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
29462 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
29463 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
29465 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
29468 2001-09-15 Ravi Pratap <ravi@ximian.com>
29470 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
29472 (Tree::RecordNamespace): Method to do what the name says ;-)
29473 (Tree::Namespaces): Property to get at the namespaces hashtable.
29475 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
29478 * rootcontext.cs (IsNamespace): Fixed it :-)
29480 2001-09-14 Miguel de Icaza <miguel@ximian.com>
29482 * class.cs (TypeContainer::FindMembers): Add support for
29484 (MethodCore): New class that encapsulates both the shared aspects
29485 of a Constructor and a Method.
29486 (Method, Constructor): Factored pieces into MethodCore.
29488 * driver.cs: Added --fatal which makes errors throw exceptions.
29489 Load System assembly as well as part of the standard library.
29491 * report.cs: Allow throwing exceptions on errors for debugging.
29493 * modifiers.cs: Do not use `parent', instead use the real type
29494 container to evaluate permission settings.
29496 * class.cs: Put Ravi's patch back in. He is right, and we will
29497 have to cope with the
29499 2001-09-14 Ravi Pratap <ravi@ximian.com>
29501 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
29502 FamORAssem, not FamANDAssem.
29504 2001-09-14 Miguel de Icaza <miguel@ximian.com>
29506 * driver.cs: Added --parse option that only parses its input files
29509 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
29510 incorrect. IsTopLevel is not used to tell whether an object is
29511 root_types or not (that can be achieved by testing this ==
29512 root_types). But to see if this is a top-level *class* (not
29513 necessarly our "toplevel" container).
29515 2001-09-14 Ravi Pratap <ravi@ximian.com>
29517 * enum.cs (Enum::Define): Modify to call the Lookup method on the
29518 parent instead of a direct call to GetType.
29520 2001-09-14 Ravi Pratap <ravi@ximian.com>
29522 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
29523 Modifiers.TypeAttr. This should just be a call to that method.
29525 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
29526 object so that we can determine if we are top-level or not.
29528 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
29531 * enum.cs (Enum::Define): Ditto.
29533 * modifiers.cs (FieldAttr): Re-write.
29535 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
29536 (TypeContainer::HaveStaticConstructor): New property to provide access
29537 to precisely that info.
29539 * modifiers.cs (MethodAttr): Re-write.
29540 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
29542 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
29543 of top-level types as claimed.
29545 2001-09-13 Miguel de Icaza <miguel@ximian.com>
29547 * expression.cs (MemberLookup): Fruitless attempt to lookup
29548 constructors. Maybe I need to emit default constructors? That
29549 might be it (currently .NET emits this for me automatically).
29550 (Invocation::OverloadResolve): Cope with Arguments == null.
29551 (Invocation::EmitArguments): new function, shared by the new
29552 constructor and us.
29553 (Invocation::Emit): Handle static and instance methods. Emit
29554 proper call instruction for virtual or non-virtual invocations.
29555 (New::Emit): Implement.
29556 (New::Resolve): Implement.
29557 (MemberAccess:Resolve): Implement.
29558 (MethodGroupExpr::InstanceExpression): used conforming to the spec
29559 to track instances.
29560 (FieldExpr::Resolve): Set type.
29562 * support.cs: Handle empty arguments.
29564 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
29565 SimpleLookup): Auxiliary routines to help parse a qualifier
29568 Update qualifier_identifier rule.
29570 * codegen.cs: Removed debugging messages.
29572 * class.cs: Make this a global thing, this acts just as a "key" to
29573 objects that we might have around.
29575 (Populate): Only initialize method_builders_to_methods once.
29577 * expression.cs (PropertyExpr): Initialize type from the
29580 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
29581 Resolve pattern. Attempt to implicitly convert value to boolean.
29584 * expression.cs: Set the type for the int32/int32 argument case.
29585 (Binary::ResolveOperator): Set the return type to boolean for
29586 comparission operators
29588 * typemanager.cs: Remove debugging print code.
29590 (Invocation::Resolve): resolve type.
29592 * class.cs: Allocate a MemberInfo of the correct size, as the code
29593 elsewhere depends on the test to reflect the correct contents.
29595 (Method::) Keep track of parameters, due to System.Reflection holes
29597 (TypeContainer::Populate): Keep track of MethodBuilders to Method
29600 (TypeContainer::FindMembers): Use ArrayList and then copy an array
29601 of the exact size and return that.
29603 (Class::LookupMethodByBuilder): New function that maps
29604 MethodBuilders to its methods. Required to locate the information
29605 on methods because System.Reflection bit us again.
29607 * support.cs: New file, contains an interface ParameterData and
29608 two implementations: ReflectionParameters and InternalParameters
29609 used to access Parameter information. We will need to grow this
29612 * expression.cs (Invocation::GetParameterData): implement a cache
29613 and a wrapper around the ParameterData creation for methods.
29614 (Invocation::OverloadResolve): Use new code.
29616 2001-09-13 Ravi Pratap <ravi@ximian.com>
29618 * class.cs (TypeContainer::EmitField): Remove and move into
29619 (Field::Define): here and modify accordingly.
29620 (Field.FieldBuilder): New member.
29621 (TypeContainer::Populate): Update accordingly.
29622 (TypeContainer::FindMembers): Implement.
29624 2001-09-13 Miguel de Icaza <miguel@ximian.com>
29626 * statement.cs: (VariableInfo::VariableType): New field to be
29627 initialized with the full type once it is resolved.
29629 2001-09-12 Miguel de Icaza <miguel@ximian.com>
29631 * parameter.cs (GetParameterInfo): Use a type cache to compute
29632 things only once, and to reuse this information
29634 * expression.cs (LocalVariableReference::Emit): Implement.
29635 (OpcodeCast::Emit): fix.
29637 (ParameterReference::Resolve): Implement.
29638 (ParameterReference::Emit): Implement.
29640 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
29641 that are expressions need to stay as Expressions.
29643 * typemanager.cs (CSharpName): Returns the C# name of a type if
29646 * expression.cs (Expression::ConvertImplicit): New function that
29647 implements implicit type conversions.
29649 (Expression::ImplicitReferenceConversion): Implements implicit
29650 reference conversions.
29652 (EmptyCast): New type for transparent casts.
29654 (OpcodeCast): New type for casts of types that are performed with
29655 a sequence of bytecodes.
29657 (BoxedCast): New type used for casting value types into reference
29658 types. Emits a box opcode.
29660 (Binary::DoNumericPromotions): Implements numeric promotions of
29661 and computation of the Binary::Type.
29663 (Binary::EmitBranchable): Optimization.
29665 (Binary::Emit): Implement code emission for expressions.
29667 * typemanager.cs (TypeManager): Added two new core types: sbyte
29670 2001-09-12 Ravi Pratap <ravi@ximian.com>
29672 * class.cs (TypeContainer::FindMembers): Method which does exactly
29673 what Type.FindMembers does, only we don't have to use reflection. No
29674 implementation yet.
29676 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
29677 typecontainer objects as we need to get at them.
29678 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
29680 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
29681 typecontainer object.
29683 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
29684 of just a Report object.
29686 2001-09-11 Ravi Pratap <ravi@ximian.com>
29688 * class.cs (Event::Define): Go back to using the prefixes "add_" and
29690 (TypeContainer::Populate): Now define the delegates of the type too.
29691 (TypeContainer.Delegates): Property to access the list of delegates defined
29694 * delegates.cs (Delegate::Define): Implement partially.
29696 * modifiers.cs (TypeAttr): Handle more flags.
29698 2001-09-11 Ravi Pratap <ravi@ximian.com>
29700 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
29702 (Operator::Define): Re-write logic to get types by using the LookupType method
29703 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
29704 (Indexer::Define): Ditto.
29705 (Event::Define): Ditto.
29706 (Property::Define): Ditto.
29708 2001-09-10 Ravi Pratap <ravi@ximian.com>
29710 * class.cs (TypeContainer::Populate): Now define operators too.
29711 (TypeContainer.Operators): New property to access the list of operators
29713 (Operator.OperatorMethodBuilder): New member to hold the method builder
29714 for the operator we are defining.
29715 (Operator::Define): Implement.
29717 2001-09-10 Ravi Pratap <ravi@ximian.com>
29719 * class.cs (Event::Define): Make the prefixes of the accessor methods
29720 addOn_ and removeOn_
29722 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
29723 of the location being passed in too. Ideally, this should go later since all
29724 error reporting should be done through the Report object.
29726 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
29727 (Populate): Iterate thru the indexers we have and define them too.
29728 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
29729 for the get and set accessors.
29730 (Indexer::Define): Implement.
29732 2001-09-09 Miguel de Icaza <miguel@ximian.com>
29734 * expression.cs (Binary::Resolve): Beginning of it. I scratched
29735 my previous implementation, did not work.
29737 * typemanager.cs: Add a couple of missing types (the longs).
29739 * literal.cs: Use TypeManager.bool_type instead of getting it.
29741 * expression.cs (EventExpr): New kind of expressions.
29742 (Expressio::ExprClassFromMemberInfo): finish
29744 2001-09-08 Miguel de Icaza <miguel@ximian.com>
29746 * assign.cs: Emit stores to static fields differently.
29748 2001-09-08 Ravi Pratap <ravi@ximian.com>
29750 * Merge in changes and adjust code to tackle conflicts. Backed out my
29751 code in Assign::Resolve ;-)
29753 2001-09-08 Ravi Pratap <ravi@ximian.com>
29755 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
29756 instead Report.Error and also pass in the location.
29757 (CSharpParser::Lexer): New readonly property to return the reference
29758 to the Tokenizer object.
29759 (declare_local_variables): Use Report.Error with location instead of plain
29763 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
29764 (Operator.CheckBinaryOperator): Ditto.
29766 * cs-parser.jay (operator_declarator): Update accordingly.
29768 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
29769 (CheckBinaryOperator): Same here.
29771 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
29772 on the name without any prefixes of namespace names etc. This is because we
29773 already might have something already fully qualified like
29774 'System.Console.WriteLine'
29776 * assign.cs (Resolve): Begin implementation. Stuck ;-)
29778 2001-09-07 Ravi Pratap <ravi@ximian.com>
29780 * cs-tokenizer.cs (location): Return a string which also contains
29783 * expression.cs (ElementAccess): New class for expressions of the
29784 type 'element access.'
29785 (BaseAccess): New class for expressions of the type 'base access.'
29786 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
29789 * cs-parser.jay (element_access): Implement action.
29790 (base_access): Implement actions.
29791 (checked_expression, unchecked_expression): Implement.
29793 * cs-parser.jay (local_variable_type): Correct and implement.
29794 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
29796 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
29798 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
29799 name and the specifiers.
29801 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
29803 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
29804 making them all public ;-)
29806 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
29809 2001-09-07 Miguel de Icaza <miguel@ximian.com>
29811 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
29813 (FieldExpr, PropertyExprs): New resolved expressions.
29814 (SimpleName::MemberStaticCheck): Perform static checks for access
29815 to non-static fields on static methods. Maybe this should be
29816 generalized for MemberAccesses.
29817 (SimpleName::ResolveSimpleName): More work on simple name
29820 * cs-parser.jay (primary_expression/qualified_identifier): track
29821 the parameter index.
29823 * codegen.cs (CodeGen::Save): Catch save exception, report error.
29824 (EmitContext::EmitBoolExpression): Chain to expression generation
29825 instead of temporary hack.
29826 (::EmitStatementExpression): Put generic expression code generation.
29828 * assign.cs (Assign::Emit): Implement variable assignments to
29829 local variables, parameters and fields.
29831 2001-09-06 Miguel de Icaza <miguel@ximian.com>
29833 * statement.cs (Block::GetVariableInfo): New method, returns the
29834 VariableInfo for a variable name in a block.
29835 (Block::GetVariableType): Implement in terms of GetVariableInfo
29837 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
29838 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
29840 2001-09-06 Ravi Pratap <ravi@ximian.com>
29842 * cs-parser.jay (operator_declaration): Continue on my quest : update
29843 to take attributes argument.
29844 (event_declaration): Ditto.
29845 (enum_declaration): Ditto.
29846 (indexer_declaration): Ditto.
29848 * class.cs (Operator::Operator): Update constructor accordingly.
29849 (Event::Event): Ditto.
29851 * delegate.cs (Delegate::Delegate): Same here.
29853 * enum.cs (Enum::Enum): Same here.
29855 2001-09-05 Ravi Pratap <ravi@ximian.com>
29857 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
29859 * ../tests/cs0658.cs : New file to demonstrate error 0658.
29861 * attribute.cs (Attributes): New class to encapsulate all attributes which were
29862 being passed around as an arraylist.
29863 (Attributes::AddAttribute): Method to add attribute sections.
29865 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
29866 (struct_declaration): Update accordingly.
29867 (constant_declaration): Update.
29868 (field_declaration): Update.
29869 (method_header): Update.
29870 (fixed_parameter): Update.
29871 (parameter_array): Ditto.
29872 (property_declaration): Ditto.
29873 (destructor_declaration): Ditto.
29875 * class.cs (Struct::Struct): Update constructors accordingly.
29876 (Class::Class): Ditto.
29877 (Field::Field): Ditto.
29878 (Method::Method): Ditto.
29879 (Property::Property): Ditto.
29880 (TypeContainer::OptAttribute): update property's return type.
29882 * interface.cs (Interface.opt_attributes): New member.
29883 (Interface::Interface): Update to take the extra Attributes argument.
29885 * parameter.cs (Parameter::Parameter): Ditto.
29887 * constant.cs (Constant::Constant): Ditto.
29889 * interface.cs (InterfaceMemberBase): New OptAttributes field.
29890 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
29891 the attributes as a parameter.
29892 (InterfaceProperty): Update constructor call.
29893 (InterfaceEvent): Ditto.
29894 (InterfaceMethod): Ditto.
29895 (InterfaceIndexer): Ditto.
29897 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
29898 pass the attributes too.
29899 (interface_event_declaration): Ditto.
29900 (interface_property_declaration): Ditto.
29901 (interface_method_declaration): Ditto.
29902 (interface_declaration): Ditto.
29904 2001-09-05 Miguel de Icaza <miguel@ximian.com>
29906 * class.cs (Method::Define): Track the "static Main" definition to
29907 create an entry point.
29909 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
29910 EntryPoint if we find it.
29912 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
29913 (EmitContext::ig): Make this variable public.
29915 * driver.cs: Make the default output file be the first file name
29916 with the .exe extension.
29918 Detect empty compilations
29920 Handle various kinds of output targets. Handle --target and
29921 rename -t to --dumper.
29923 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
29924 methods inherited from Expression return now an Expression. This
29925 will is used during the tree rewriting as we resolve them during
29928 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
29929 the spec. Missing entirely is the information about
29930 accessability of elements of it.
29932 (Expression::ExprClassFromMemberInfo): New constructor for
29933 Expressions that creates a fully initialized Expression based on
29934 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
29937 (Invocation::Resolve): Begin implementing resolution of invocations.
29939 * literal.cs (StringLiteral): Implement Emit.
29941 2001-09-05 Ravi Pratap <ravi@ximian.com>
29943 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
29946 2001-09-04 Ravi Pratap <ravi@ximian.com>
29948 * cs-parser.jay (attribute_arguments): Implement actions.
29949 (attribute): Fix bug in production. Implement action.
29950 (attribute_list): Implement.
29951 (attribute_target): Implement.
29952 (attribute_target_specifier, opt_target_specifier): Implement
29953 (CheckAttributeTarget): New method to check if the attribute target
29955 (attribute_section): Implement.
29956 (opt_attributes): Implement.
29958 * attribute.cs : New file to handle attributes.
29959 (Attribute): Class to hold attribute info.
29961 * cs-parser.jay (opt_attribute_target_specifier): Remove production
29962 (attribute_section): Modify production to use 2 different rules to
29963 achieve the same thing. 1 s/r conflict down !
29964 Clean out commented, useless, non-reducing dimension_separator rules.
29966 * class.cs (TypeContainer.attributes): New member to hold list
29967 of attributes for a type.
29968 (Struct::Struct): Modify to take one more argument, the attribute list.
29969 (Class::Class): Ditto.
29970 (Field::Field): Ditto.
29971 (Method::Method): Ditto.
29972 (Property::Property): Ditto.
29974 * cs-parser.jay (struct_declaration): Update constructor call to
29975 pass in the attributes too.
29976 (class_declaration): Ditto.
29977 (constant_declaration): Ditto.
29978 (field_declaration): Ditto.
29979 (method_header): Ditto.
29980 (fixed_parameter): Ditto.
29981 (parameter_array): Ditto.
29982 (property_declaration): Ditto.
29984 * constant.cs (Constant::Constant): Update constructor similarly.
29985 Use System.Collections.
29987 * parameter.cs (Parameter::Parameter): Update as above.
29989 2001-09-02 Ravi Pratap <ravi@ximian.com>
29991 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
29992 (TypeContainer.delegates): New member to hold list of delegates.
29994 * cs-parser.jay (delegate_declaration): Implement the action correctly
29995 this time as I seem to be on crack ;-)
29997 2001-09-02 Miguel de Icaza <miguel@ximian.com>
29999 * rootcontext.cs (RootContext::IsNamespace): new function, used to
30000 tell whether an identifier represents a namespace.
30002 * expression.cs (NamespaceExpr): A namespace expression, used only
30003 temporarly during expression resolution.
30004 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30005 utility functions to resolve names on expressions.
30007 2001-09-01 Miguel de Icaza <miguel@ximian.com>
30009 * codegen.cs: Add hook for StatementExpressions.
30011 * class.cs: Fix inverted test for static flag in methods.
30013 2001-09-02 Ravi Pratap <ravi@ximian.com>
30015 * class.cs (Operator::CheckUnaryOperator): Correct error number used
30016 to make it coincide with MS' number.
30017 (Operator::CheckBinaryOperator): Ditto.
30019 * ../errors/errors.txt : Remove error numbers added earlier.
30021 * ../errors/cs1019.cs : Test case for error # 1019
30023 * ../errros/cs1020.cs : Test case for error # 1020
30025 * cs-parser.jay : Clean out commented cruft.
30026 (dimension_separators, dimension_separator): Comment out. Ostensibly not
30027 used anywhere - non-reducing rule.
30028 (namespace_declarations): Non-reducing rule - comment out.
30030 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30031 with TypeContainer::AddEnum.
30033 * delegate.cs : New file for delegate handling classes.
30034 (Delegate): Class for declaring delegates.
30036 * makefile : Update.
30038 * cs-parser.jay (delegate_declaration): Implement.
30040 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
30042 * class.cs (Event::Define): Implement.
30043 (Event.EventBuilder): New member.
30045 * class.cs (TypeContainer::Populate): Update to define all enums and events
30047 (Events): New property for the events arraylist we hold. Shouldn't we move to using
30048 readonly fields for all these cases ?
30050 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30052 * class.cs (Property): Revamp to use the convention of making fields readonly.
30053 Accordingly modify code elsewhere.
30055 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30056 the Define method of the Property class.
30058 * class.cs : Clean up applied patch and update references to variables etc. Fix
30060 (TypeContainer::Populate): Update to define all the properties we have. Also
30061 define all enumerations.
30063 * enum.cs (Define): Implement.
30065 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30067 * cs-parser.jay (overloadable_operator): The semantic value is an
30068 enum of the Operator class.
30069 (operator_declarator): Implement actions.
30070 (operator_declaration): Implement.
30072 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30073 validity of definitions.
30074 (Operator::CheckBinaryOperator): Static method to check for binary operators
30075 (TypeContainer::AddOperator): New method to add an operator to a type.
30077 * cs-parser.jay (indexer_declaration): Added line to actually call the
30078 AddIndexer method so it gets added ;-)
30080 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
30081 already taken care of by the MS compiler ?
30083 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30085 * class.cs (Operator): New class for operator declarations.
30086 (Operator::OpType): Enum for the various operators.
30088 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30090 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30091 ostensibly handle this in semantic analysis.
30093 * cs-parser.jay (general_catch_clause): Comment out
30094 (specific_catch_clauses, specific_catch_clause): Ditto.
30095 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30096 (catch_args, opt_catch_args): New productions.
30097 (catch_clause): Rewrite to use the new productions above
30098 (catch_clauses): Modify accordingly.
30099 (opt_catch_clauses): New production to use in try_statement
30100 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30101 and re-write the code in the actions to extract the specific and
30102 general catch clauses by being a little smart ;-)
30104 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30105 Hooray, try and catch statements parse fine !
30107 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30109 * statement.cs (Block::GetVariableType): Fix logic to extract the type
30110 string from the hashtable of variables.
30112 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30113 I end up making that mistake ;-)
30114 (catch_clauses): Fixed gross error which made Key and Value of the
30115 DictionaryEntry the same : $1 !!
30117 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30119 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30121 * cs-parser.jay (event_declaration): Correct to remove the semicolon
30122 when the add and remove accessors are specified.
30124 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30126 * cs-parser.jay (IndexerDeclaration): New helper class to hold
30127 information about indexer_declarator.
30128 (indexer_declarator): Implement actions.
30129 (parsing_indexer): New local boolean used to keep track of whether
30130 we are parsing indexers or properties. This is necessary because
30131 implicit_parameters come into picture even for the get accessor in the
30132 case of an indexer.
30133 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
30135 * class.cs (Indexer): New class for indexer declarations.
30136 (TypeContainer::AddIndexer): New method to add an indexer to a type.
30137 (TypeContainer::indexers): New member to hold list of indexers for the
30140 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
30142 * cs-parser.jay (add_accessor_declaration): Implement action.
30143 (remove_accessor_declaration): Implement action.
30144 (event_accessors_declaration): Implement
30145 (variable_declarators): swap statements for first rule - trivial.
30147 * class.cs (Event): New class to hold information about event
30149 (TypeContainer::AddEvent): New method to add an event to a type
30150 (TypeContainer::events): New member to hold list of events.
30152 * cs-parser.jay (event_declaration): Implement actions.
30154 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
30156 * cs-parser.jay (dim_separators): Implement. Make it a string
30157 concatenating all the commas together, just as they appear.
30158 (opt_dim_separators): Modify accordingly
30159 (rank_specifiers): Update accordingly. Basically do the same
30160 thing - instead, collect the brackets here.
30161 (opt_rank_sepcifiers): Modify accordingly.
30162 (array_type): Modify to actually return the complete type string
30163 instead of ignoring the rank_specifiers.
30164 (expression_list): Implement to collect the expressions
30165 (variable_initializer): Implement. We make it a list of expressions
30166 essentially so that we can handle the array_initializer case neatly too.
30167 (variable_initializer_list): Implement.
30168 (array_initializer): Make it a list of variable_initializers
30169 (opt_array_initializer): Modify accordingly.
30171 * expression.cs (New::NType): Add enumeration to help us
30172 keep track of whether we have an object/delegate creation
30173 or an array creation.
30174 (New:NewType, New::Rank, New::Indices, New::Initializers): New
30175 members to hold data about array creation.
30176 (New:New): Modify to update NewType
30177 (New:New): New Overloaded contructor for the array creation
30180 * cs-parser.jay (array_creation_expression): Implement to call
30181 the overloaded New constructor.
30183 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
30185 * class.cs (TypeContainer::Constructors): Return member
30186 constructors instead of returning null.
30188 2001-08-26 Miguel de Icaza <miguel@ximian.com>
30190 * typemanager.cs (InitCoreTypes): Initialize the various core
30191 types after we have populated the type manager with the user
30192 defined types (this distinction will be important later while
30193 compiling corlib.dll)
30195 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
30196 on Expression Classification. Now all expressions have a method
30197 `Resolve' and a method `Emit'.
30199 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
30200 generation from working. Also add some temporary debugging
30203 2001-08-24 Miguel de Icaza <miguel@ximian.com>
30205 * codegen.cs: Lots of code generation pieces. This is only the
30206 beginning, will continue tomorrow with more touches of polish. We
30207 handle the fundamentals of if, while, do, for, return. Others are
30208 trickier and I need to start working on invocations soon.
30210 * gen-treedump.cs: Bug fix, use s.Increment here instead of
30213 * codegen.cs (EmitContext): New struct, used during code
30214 emission to keep a context. Most of the code generation will be
30217 * cs-parser.jay: Add embedded blocks to the list of statements of
30218 this block. So code generation proceeds in a top down fashion.
30220 2001-08-23 Miguel de Icaza <miguel@ximian.com>
30222 * statement.cs: Add support for multiple child blocks.
30224 2001-08-22 Miguel de Icaza <miguel@ximian.com>
30226 * codegen.cs (EmitCode): New function, will emit the code for a
30227 Block of code given a TypeContainer and its ILGenerator.
30229 * statement.cs (Block): Standard public readonly optimization.
30230 (Block::Block constructors): Link children.
30231 (Block::Child): Child Linker.
30232 (Block::EmitVariables): Emits IL variable declarations.
30234 * class.cs: Drop support for MethodGroups here, delay until
30236 (Method::): Applied the same simplification that I did before, and
30237 move from Properties to public readonly fields.
30238 (Method::ParameterTypes): Returns the parameter types for the
30239 function, and implements a cache that will be useful later when I
30240 do error checking and the semantic analysis on the methods is
30242 (Constructor::GetCallingConvention): Renamed from CallingConvetion
30243 and made a method, optional argument tells whether this is a class
30244 or a structure to apply the `has-this' bit.
30245 (Method::GetCallingConvention): Implement, returns the calling
30247 (Method::Define): Defines the type, a second pass is performed
30248 later to populate the methods.
30250 (Constructor::ParameterTypes): implement a cache similar to the
30251 one on Method::ParameterTypes, useful later when we do semantic
30254 (TypeContainer::EmitMethod): New method. Emits methods.
30256 * expression.cs: Removed MethodGroup class from here.
30258 * parameter.cs (Parameters::GetCallingConvention): new method.
30260 2001-08-21 Miguel de Icaza <miguel@ximian.com>
30262 * class.cs (TypeContainer::Populate): Drop RootContext from the
30265 (Constructor::CallingConvention): Returns the calling convention.
30266 (Constructor::ParameterTypes): Returns the constructor parameter
30269 (TypeContainer::AddConstructor): Keep track of default constructor
30270 and the default static constructor.
30272 (Constructor::) Another class that starts using `public readonly'
30273 instead of properties.
30275 (Constructor::IsDefault): Whether this is a default constructor.
30277 (Field::) use readonly public fields instead of properties also.
30279 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
30280 track of static constructors; If none is used, turn on
30281 BeforeFieldInit in the TypeAttributes.
30283 * cs-parser.jay (opt_argument_list): now the return can be null
30284 for the cases where there are no arguments.
30286 (constructor_declarator): If there is no implicit `base' or
30287 `this', then invoke the default parent constructor.
30289 * modifiers.cs (MethodAttr): New static function maps a set of
30290 modifiers flags into a MethodAttributes enum
30291 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
30292 MethodAttr, TypeAttr to represent the various mappings where the
30293 modifiers are used.
30294 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
30296 2001-08-19 Miguel de Icaza <miguel@ximian.com>
30298 * parameter.cs (GetParameterInfo): Fix bug where there would be no
30301 * interface.cs (PopulateIndexer): Implemented the code generator
30302 for interface indexers.
30304 2001-08-17 Miguel de Icaza <miguel@ximian.com>
30306 * interface.cs (InterfaceMemberBase): Now we track the new status
30309 (PopulateProperty): Implement property population. Woohoo! Got
30310 Methods and Properties going today.
30312 Removed all the properties for interfaces, and replaced them with
30313 `public readonly' fields.
30315 2001-08-16 Miguel de Icaza <miguel@ximian.com>
30317 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
30318 initialize their hashtables/arraylists only when they are needed
30319 instead of doing this always.
30321 * parameter.cs: Handle refs and out parameters.
30323 * cs-parser.jay: Use an ArrayList to construct the arguments
30324 instead of the ParameterCollection, and then cast that to a
30327 * parameter.cs: Drop the use of ParameterCollection and use
30328 instead arrays of Parameters.
30330 (GetParameterInfo): Use the Type, not the Name when resolving
30333 2001-08-13 Miguel de Icaza <miguel@ximian.com>
30335 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
30336 and instead use public readonly fields.
30338 * class.cs: Put back walking code for type containers.
30340 2001-08-11 Miguel de Icaza <miguel@ximian.com>
30342 * class.cs (MakeConstant): Code to define constants.
30344 * rootcontext.cs (LookupType): New function. Used to locate types
30347 2001-08-08 Miguel de Icaza <miguel@ximian.com>
30349 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
30350 this System.Reflection code is. Kudos to Microsoft
30352 * typemanager.cs: Implement a type cache and avoid loading all
30353 types at boot time. Wrap in LookupType the internals. This made
30354 the compiler so much faster. Wow. I rule!
30356 * driver.cs: Make sure we always load mscorlib first (for
30357 debugging purposes, nothing really important).
30359 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
30360 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
30362 * rootcontext.cs: Lookup types on their namespace; Lookup types
30363 on namespaces that have been imported using the `using' keyword.
30365 * class.cs (TypeContainer::TypeAttr): Virtualize.
30366 (Class::TypeAttr): Return attributes suitable for this bad boy.
30367 (Struct::TypeAttr): ditto.
30368 Handle nested classes.
30369 (TypeContainer::) Remove all the type visiting code, it is now
30370 replaced with the rootcontext.cs code
30372 * rootcontext.cs (GetClassBases): Added support for structs.
30374 2001-08-06 Miguel de Icaza <miguel@ximian.com>
30376 * interface.cs, statement.cs, class.cs, parameter.cs,
30377 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
30378 Drop use of TypeRefs, and use strings instead.
30380 2001-08-04 Miguel de Icaza <miguel@ximian.com>
30384 * class.cs (Struct::Struct): set the SEALED flags after
30385 checking the modifiers.
30386 (TypeContainer::TypeAttr): new property, returns the
30387 TypeAttributes for a class.
30389 * cs-parser.jay (type_list): Oops, list production was creating a
30390 new list of base types.
30392 * rootcontext.cs (StdLib): New property.
30393 (GetInterfaceTypeByName): returns an interface by type name, and
30394 encapsulates error handling here.
30395 (GetInterfaces): simplified.
30396 (ResolveTree): Encapsulated all the tree resolution here.
30397 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
30400 * driver.cs: Add support for --nostdlib, to avoid loading the
30401 default assemblies.
30402 (Main): Do not put tree resolution here.
30404 * rootcontext.cs: Beginning of the class resolution.
30406 2001-08-03 Miguel de Icaza <miguel@ximian.com>
30408 * rootcontext.cs: Provide better error reporting.
30410 * cs-parser.jay (interface_base): set our $$ to be interfaces.
30412 * rootcontext.cs (CreateInterface): Handle the case where there
30413 are no parent interfaces.
30415 (CloseTypes): Routine to flush types at the end.
30416 (CreateInterface): Track types.
30417 (GetInterfaces): Returns an array of Types from the list of
30418 defined interfaces.
30420 * typemanager.c (AddUserType): Mechanism to track user types (puts
30421 the type on the global type hash, and allows us to close it at the
30424 2001-08-02 Miguel de Icaza <miguel@ximian.com>
30426 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
30427 RecordInterface instead.
30429 * cs-parser.jay: Updated to reflect changes above.
30431 * decl.cs (Definition): Keep track of the TypeBuilder type that
30432 represents this type here. Not sure we will use it in the long
30433 run, but wont hurt for now.
30435 * driver.cs: Smaller changes to accomodate the new code.
30437 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
30440 * rootcontext.cs (CreateInterface): New method, used to create
30441 the System.TypeBuilder type for interfaces.
30442 (ResolveInterfaces): new entry point to resolve the interface
30444 (CodeGen): Property, used to keep track of the code generator.
30446 2001-07-26 Miguel de Icaza <miguel@ximian.com>
30448 * cs-parser.jay: Add a second production for delegate_declaration
30451 (enum_body): Put an opt_comma here instead of putting it on
30452 enum_body or enum_member_declarations so we can handle trailing
30453 commas on enumeration members. Gets rid of a shift/reduce.
30455 (type_list): Need a COMMA in the middle.
30457 (indexer_declaration): Tell tokenizer to recognize get/set
30459 * Remove old targets.
30461 * Re-add the parser target.
30463 2001-07-13 Simon Cozens <simon@simon-cozens.org>
30465 * cs-parser.jay: Add precendence rules for a number of operators
30466 ot reduce the number of shift/reduce conflicts in the grammar.
30468 2001-07-17 Miguel de Icaza <miguel@ximian.com>
30470 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
30473 Get rid of old crufty code.
30475 * rootcontext.cs: Use this to keep track of the parsed
30476 representation and the defined types available to the program.
30478 * gen-treedump.cs: adjust for new convention.
30480 * type.cs: Split out the type manager, and the assembly builder
30483 * typemanager.cs: the type manager will live here now.
30485 * cil-codegen.cs: And the code generator here.
30487 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
30489 * makefile: Fixed up for easy making.
30491 2001-07-13 Simon Cozens <simon@simon-cozens.org>
30493 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
30496 (unary_expression): Expand pre_increment_expression and
30497 post_decrement_expression to reduce a shift/reduce.
30499 2001-07-11 Simon Cozens
30501 * cs-tokenizer.cs: Hex numbers should begin with a 0.
30503 Improve allow_keyword_as_indent name.
30505 2001-06-19 Miguel de Icaza <miguel@ximian.com>
30507 * Adjustments for Beta2.
30509 2001-06-13 Miguel de Icaza <miguel@ximian.com>
30511 * decl.cs: Added `Define' abstract method.
30512 (InTransit): new property, used to catch recursive definitions.
30514 * interface.cs: Implement `Define'.
30516 * modifiers.cs: Map Modifiers.constants to
30517 System.Reflection.TypeAttribute flags.
30519 * class.cs: Keep track of types and user-defined types.
30520 (BuilderInit): New method for creating an assembly
30521 (ResolveType): New function to launch the resolution process, only
30522 used by interfaces for now.
30524 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
30525 that are inserted into the name space.
30527 2001-06-08 Miguel de Icaza <miguel@ximian.com>
30529 * ARGH. I have screwed up my tree so many times due to the use of
30530 rsync rather than using CVS. Going to fix this at once.
30532 * driver.cs: Objetify driver. Load assemblies, use assemblies to
30535 2001-06-07 Miguel de Icaza <miguel@ximian.com>
30537 * Experiment successful: Use System.Type rather that our own
30540 2001-05-25 Miguel de Icaza <miguel@ximian.com>
30542 * cs-parser.jay: Removed nsAliases from here.
30544 Use new namespaces, handle `using XXX;'
30546 * namespace.cs: Reimplemented namespace handling, use a recursive
30547 definition of the class. Now we can keep track of using clauses
30548 and catch invalid using clauses.
30550 2001-05-24 Miguel de Icaza <miguel@ximian.com>
30552 * gen-treedump.cs: Adapted for all the renaming.
30554 * expression.cs (Expression): this class now has a Type property
30555 which returns an expression Type.
30557 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
30558 `Type', as this has a different meaning now in the base
30560 2001-05-22 Miguel de Icaza <miguel@ximian.com>
30562 * interface.cs, class.cs: Removed from all the sources the
30563 references to signature computation, as we can not do method
30564 signature computation during the parsing time, as we are not
30565 trying to solve at that point distinguishing:
30569 void a (NS.Blah x) {}
30572 Which depending on the context might be valid or not, as we do not
30573 know if Blah is the same thing as NS.Blah at that point.
30575 * Redid everything so the code uses TypeRefs now instead of
30576 Types. TypeRefs are just temporary type placeholders, that need
30577 to be resolved. They initially have a pointer to a string and the
30578 current scope in which they are used. This is used later by the
30579 compiler to resolve the reference to an actual Type.
30581 * DeclSpace is no longer a CIR.Type, and neither are
30582 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
30583 are all DeclSpaces, but no Types.
30585 * type.cs (TypeRefManager): This implements the TypeRef manager,
30586 which keeps track of all the types that need to be resolved after
30587 the parsing has finished.
30589 2001-05-13 Miguel de Icaza <miguel@ximian.com>
30591 * ARGH. We are going to have to store `foreach' as a class rather
30592 than resolving it, as we need to verify error 1579 after name
30593 resolution. *OR* we could keep a flag that says `This request to
30594 IEnumerator comes from a foreach statement' which we can then use
30595 to generate the error.
30597 2001-05-10 Miguel de Icaza <miguel@ximian.com>
30599 * class.cs (TypeContainer.AddMethod): we now add methods to the
30600 MethodGroup instead of the method hashtable.
30602 * expression.cs: Add MethodGroup abstraction, which gets us one
30603 step closer to the specification in the way we handle method
30606 * cs-parser.jay (primary_expression): qualified_identifier now
30607 tried to match up an identifier to a local variable reference or
30608 to a parameter reference.
30610 current_local_parameters is now a parser global variable that
30611 points to the current parameters for the block, used during name
30614 (property_declaration): Now creates an implicit `value' argument to
30617 2001-05-09 Miguel de Icaza <miguel@ximian.com>
30619 * parameter.cs: Do not use `param' arguments as part of the
30620 signature, per the spec.
30622 2001-05-08 Miguel de Icaza <miguel@ximian.com>
30624 * decl.cs: Base class for classes, structs and interfaces. This
30625 is the "Declaration Space"
30627 * cs-parser.jay: Use CheckDef for checking declaration errors
30628 instead of having one on each function.
30630 * class.cs: Factor out some code for handling error handling in
30631 accordance to the "Declarations" section in the "Basic Concepts"
30632 chapter in the ECMA C# spec.
30634 * interface.cs: Make all interface member classes derive from
30635 InterfaceMemberBase.
30637 2001-05-07 Miguel de Icaza <miguel@ximian.com>
30639 * Many things: all interfaces are parsed and generated in
30640 gen-treedump. Support for member variables, constructors,
30641 destructors, properties, constants is there.
30643 Beginning of the IL backend, but very little done, just there for
30646 2001-04-29 Miguel de Icaza <miguel@ximian.com>
30648 * cs-parser.jay: Fix labeled statement.
30650 * cs-tokenizer.cs (escape): Escape " and ' always.
30651 ref_line, ref_name: keep track of the line/filename as instructed
30652 by #line by the compiler.
30655 2001-04-27 Miguel de Icaza <miguel@ximian.com>
30657 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
30658 to match the values in System.CodeDOM.
30660 Divid renamed to Divide.
30662 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
30664 (Statements.set): remove.
30666 * System.CodeDOM/CodeCatchClause.cs: always have a valid
30669 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
30670 falseStatements always have valid values.
30672 * cs-parser.jay: Use System.CodeDOM now.