1 2010-06-02 Marek Safar <marek.safar@gmail.com>
4 * nullable.cs, expression.cs, statement.cs, method.cs, ecore.cs:
5 Ignore overrides for base overload resolution as for non-base
6 expressions and convert the best candidate to closest override
9 2010-06-01 Marek Safar <marek.safar@gmail.com>
12 * generic.cs, convert.cs: Recursively check effective base interface
14 2010-06-01 Marek Safar <marek.safar@gmail.com>
16 * statement.cs: Handle nullable types and type parameters in using
17 statement, avoid boxing value types. Also fixes #571010
19 2010-06-01 Marek Safar <marek.safar@gmail.com>
21 * convert.cs, expression.cs: Emit unbox for underlying nullable
24 2010-05-29 Marek Safar <marek.safar@gmail.com>
27 * expression.cs: Don't use branch optimization for types bigger than
30 2010-05-28 Marek Safar <marek.safar@gmail.com>
33 * import.cs: Check private modifier correctly.
35 2010-05-28 Marek Safar <marek.safar@gmail.com>
38 * ecore.cs: Don't ignore override methods when looking for base
41 2010-05-27 Marek Safar <marek.safar@gmail.com>
43 A fix for bugs #608007, #572540, #566130, #476358
45 * generic.cs, linq.cs, expression.cs, statement.cs, cs-parser.jay:
46 More tricky refactoring of implicit linq blocks.
48 2010-05-25 Marek Safar <marek.safar@gmail.com>
50 * linq.cs, cs-parser.jay: Keep location for all linq clauses.
52 2010-05-25 Marek Safar <marek.safar@gmail.com>
54 * context.cs, expression.cs, cs-parser.jay: Don't store current
55 block in This expression (it's too early for linq blocks).
57 2010-05-21 Marek Safar <marek.safar@gmail.com>
59 * expression.cs: Use constrained prefix more broadly to avoid boxing.
61 2010-05-20 Marek Safar <marek.safar@gmail.com>
64 * nullable.cs: Don't double wrap same expression.
66 2010-05-20 Marek Safar <marek.safar@gmail.com>
69 * anonymous.cs: Any issued error in probing mode means no match.
71 2010-05-20 Marek Safar <marek.safar@gmail.com>
73 * expression.cs: Search for base indexer using the closest match
76 2010-05-20 Marek Safar <marek.safar@gmail.com>
79 * method.cs: Set override constraints using unexpanded interface
82 2010-05-20 Marek Safar <marek.safar@gmail.com>
85 * ecore.cs: Include secondary extension method lookup in probing
88 2010-05-19 Marek Safar <marek.safar@gmail.com>
91 * typespec.cs (MayBecomeEqualGenericTypes): Recursively check
94 2010-05-19 Marek Safar <marek.safar@gmail.com>
97 * pending.cs: Advance counter correctly.
99 2010-05-19 Marek Safar <marek.safar@gmail.com>
101 A fix for bug #480139
102 * method.cs, pending.cs: Indexer override uses base name.
104 2010-05-19 Marek Safar <marek.safar@gmail.com>
106 A fix for bug #424064
107 * generic.cs: Replace original with inflated type parameter on
110 2010-05-19 Marek Safar <marek.safar@gmail.com>
112 A fix for bug #359733
113 * parameter.cs: Extension attribute can be defined in each assembly.
115 2010-05-18 Marek Safar <marek.safar@gmail.com>
117 A fix for bug #446507
118 * method.cs: Only one method can implement an interface.
120 2010-05-18 Marek Safar <marek.safar@gmail.com>
122 A fix for bug #594905
123 * convert.cs, constant.cs, expression.cs, literal.cs, ecore.cs:
124 Typed null can be used as a source for expression methods.
126 2010-05-18 Marek Safar <marek.safar@gmail.com>
128 A fix for bug #606551
129 * namespace.cs: Using directive imports only types and not nested
132 2010-05-17 Marek Safar <marek.safar@gmail.com>
134 * typespec.cs, expression.cs, statement.cs, ecore.cs, complete.cs,
135 delegate.cs: Member instance is resolved after member overload
136 definitely resolves static/instance property of member expression.
137 Fixes #545047, #358848, #456605, #460016, #603299
139 2010-05-12 Marek Safar <marek.safar@gmail.com>
141 A fix for bug #604981
142 * generic.cs, decl.cs, anonymous.cs: Reset more type arguments
143 details for nested anonymous methods stories.
145 2010-05-11 Marek Safar <marek.safar@gmail.com>
147 A fix for bug #604735
148 * namespace.cs: Don't report namespace collision.
150 2010-05-11 Marek Safar <marek.safar@gmail.com>
152 A fix for bug #604748
153 * class.cs, typespec.cs: Search full imported attribute hierarchy
156 2010-05-11 Marek Safar <marek.safar@gmail.com>
158 * namespace.cs: Ignore missing dependencies failure at
161 2010-05-11 Marek Safar <marek.safar@gmail.com>
163 A fix for bug #604640
164 * namespace.cs: Don't resolve using constraints too early.
166 2010-05-11 Marek Safar <marek.safar@gmail.com>
168 A fix for bug #604239
169 * generic.cs: Copy partial type constraints to partial container.
171 2010-05-10 Marek Safar <marek.safar@gmail.com>
173 A fix for bug #557210
174 * import.cs: Relax underlying enum field rules.
176 2010-05-10 Marek Safar <marek.safar@gmail.com>
178 A fix for bug #603476
179 * property.cs: Implement IParametersMember for indexer accessors.
181 2010-05-07 Marek Safar <marek.safar@gmail.com>
183 A fix for bug #601141
184 * class.cs: Update all partial modifiers.
186 2010-05-06 Marek Safar <marek.safar@gmail.com>
188 A fix for bug #601708
189 * method.cs, membercache.cs: Destructors cannot be hidden.
191 2010-05-06 Marek Safar <marek.safar@gmail.com>
193 A fix for bug #602551
194 * class.cs: Resursive reference of type definition is allowed.
196 2010-05-06 Marek Safar <marek.safar@gmail.com>
198 * anonymous.cs: Mutate cached storey instance types too.
200 2010-05-06 Marek Safar <marek.safar@gmail.com>
202 A fix for bug #602443
203 * convert.cs: Explicit enum conversion cannot involve user operators
205 2010-05-05 Miguel de Icaza <miguel@novell.com>
207 * class.cs (TypeContainer.DefineBaseTypes)
208 (TypeContainer.CheckRecursiveDefinition): check for the iface not
209 being null, as we could have failed resolution and crashed;
212 * cs-parser.jay: Productions to catch common mistakes when other
213 punctuation operators are used instead of comma. Fixes 571702
215 2010-05-05 Marek Safar <marek.safar@gmail.com>
217 * anonymous.cs: Mutate correct set of constraints.
219 2010-05-05 Marek Safar <marek.safar@gmail.com>
221 A fix for bug #602842
222 * expression.cs: Resolve all array bound arguments.
224 2010-05-05 Marek Safar <marek.safar@gmail.com>
226 * import.cs: Don't import private fields.
228 2010-04-30 Marek Safar <marek.safar@gmail.com>
230 Partially based on patch by <sami.lamti@gmail.com>
232 * eval.cs, ecore.cs: Fixed eval show methods.
234 2010-04-30 Marek Safar <marek.safar@gmail.com>
236 * generic.cs, delegate.cs: Implement output type inference of
237 methodgroup now when the specification was cleared at least little
240 2010-04-29 Marek Safar <marek.safar@gmail.com>
242 A fix for bug #575611
243 * class.cs: Fix recursive unmanaged recursice sruct check.
245 2010-04-29 Marek Safar <marek.safar@gmail.com>
247 A fix for bug #479776
248 * expression.cs: Implement typeof unbounded nested generic types.
250 2010-04-29 Marek Safar <marek.safar@gmail.com>
252 A fix for bug #474953
253 * class.cs: Fix valid recursive base type definition.
255 2010-04-29 Marek Safar <marek.safar@gmail.com>
257 A fix for bug #421737
258 * convert.cs, expression.cs: A boxing conversion exists from a
259 nullable-type to a reference type, if a boxing conversion exists
260 from the underlying non-nullable-value-type to the reference type.
262 2010-04-29 Marek Safar <marek.safar@gmail.com>
264 A fix for bug #376875
265 * import.cs: Import volatile modifier.
267 2010-04-29 Marek Safar <marek.safar@gmail.com>
269 A fix for bug #372412
270 * typespec.cs, expression.cs, codegen.cs: Emit readonly prefix for
273 2010-04-29 Marek Safar <marek.safar@gmail.com>
275 A fix for bug #568955
276 * statements.cs: Handle recursive scope initializers.
278 2010-04-28 Marek Safar <marek.safar@gmail.com>
280 A fix for bug #566511
281 * anonymous.cs: Always get inflated version of hoisted variable
282 on generic type definition.
284 2010-04-28 Marek Safar <marek.safar@gmail.com>
286 * import.cs, membercache.cs: Relax rules for valid properties.
288 2010-04-28 Marek Safar <marek.safar@gmail.com>
290 * import.cs: Intern arrays used in generic arguments.
292 2010-04-28 Marek Safar <marek.safar@gmail.com>
294 A fix for bug #600398
295 * convert.cs: Actually use effective base type for the comparison.
297 2010-04-28 Marek Safar <marek.safar@gmail.com>
299 A fix for bug #600326
300 * ecore.cs: Pass arity to base member lookup.
302 2010-04-28 Marek Safar <marek.safar@gmail.com>
304 A fix for bug #573385
305 * expression.cs: MemberAccess is of generic type based on right
308 2010-05-28 Marek Safar <marek.safar@gmail.com>
310 * cs-tokenizer.cs: Made tab size configurable.
312 2010-05-27 Marek Safar <marek.safar@gmail.com>
314 * attribute.cs: Ensure Obsolete members are defined before doing
317 2010-05-27 Marek Safar <marek.safar@gmail.com>
319 * visit.cs: Add DOM visitor skeleton.
323 2010-05-27 Marek Safar <marek.safar@gmail.com>
325 * attribute.cs, codegen.cs: Drop COMPILER_ACCESS hack.
327 2010-05-27 Marek Safar <marek.safar@gmail.com>
329 * *.cs: Major rewrite of compiler internals to better work with
330 unmodified System.Reflection.Emit. Some of the key changes are
331 - TypeSpec replaces reflection specific System.Type.
332 - All Type(TypeSpec) operations are now done in compiler therefore
333 no dependency on SRE to inflate generic members and types or to
334 query unclosed types.
335 - MemberCache is now the only and full hierarchical topology.
336 - Generic constraints are implemented properly.
337 - And as a bonus compilation is on average 30% faster.
339 2010-04-15 Jb Evain <jbevain@novell.com>
341 * dmcs.exe.config: update the runtime version to .net 4.0 RTM.
343 2010-04-12 Marek Safar <marek.safar@gmail.com>
345 * expression.cs, attribute.cs, parameter.cs: More attribute type
348 2010-04-12 Marek Safar <marek.safar@gmail.com>
350 A fix for bug #593342
352 * generic.cs, parameter.cs, argument.cs, field.cs, property.cs,
353 decl.cs, roottypes.cs, constant.cs, nullable.cs, expression.cs,
354 method.cs, ecore.cs, class.cs, delegate.cs, attribute.cs,
355 codegen.cs: Add custom attribute encoder to deal with unfinished
356 types and easier corlib bootstrap from its own types.
358 2010-03-26 Marek Safar <marek.safar@gmail.com>
360 * cs-parser.jay: Report invalid constraint types.
362 2010-03-16 Jb Evain <jbevain@novell.com>
364 * Makefile: rename the net_2_1 profile to moonlight.
366 2010-03-11 Marek Safar <marek.safar@gmail.com>
368 * statement.cs, cs-parser.jay: Use correct location for empty
371 2010-03-11 Marek Safar <marek.safar@gmail.com>
373 * cs-parser.jay: Disable Location from expression.
375 * generic.cs: Check constraints for overrides in the parser.
377 2010-03-09 Marek Safar <marek.safar@gmail.com>
379 * cs-parser.jay (GetLocation): Use an expression when available.
381 2010-03-04 Marek Safar <marek.safar@gmail.com>
383 A fix for bug #582579
384 * ecore.cs (FieldExpr): Don't optimize cross reference loads.
386 2010-03-04 Marek Safar <marek.safar@gmail.com>
388 A patch by kornelpal@gmail.com
390 * dynamic.cs, anonymous.cs, rootcontext.cs, class.cs: Don't make
391 compiler generated classes sealed by default. Emit and close top
392 level compiler generated classes as well.
394 * support.cs: Use RuntimeHelpers.GetHashCode.
396 2010-03-03 Rolf Bjarne Kvinge <RKvinge@novell.com>
398 * Makefile: We need to use the internal bootstrapping gmcs for
399 net_2_1_bootstrap too now.
401 2010-03-02 Raja R Harinath <harinath@hurrynot.org>
403 * expression.cs (IndexerAccess.ResolveAccessor): Add CS1540 check.
405 2010-03-02 Marek Safar <marek.safar@gmail.com>
407 * cs-tokenizer.cs: Missed few locations in previous fix.
409 2010-03-02 Marek Safar <marek.safar@gmail.com>
411 * cs-tokenizer.cs, argument.cs, dynamic.cs, assign.cs, anonymous.cs,
412 nullable.cs, expression.cs, statement.cs, cs-parser.jay, cfold.cs:
413 Report correct location for operator errors.
415 2010-03-02 Marek Safar <marek.safar@gmail.com>
417 * typemanager.cs (IsDynamicType): Don't check external types when
418 the attribute is not external.
420 2010-02-24 Marek Safar <marek.safar@gmail.com>
422 A fix for bug #582579
423 * decl.cs (IsExposedFromAssembly): Use PartialContainer for parent
426 2010-02-24 Marek Safar <marek.safar@gmail.com>
428 A fix for bug #581804
429 * ecore.cs: Fixed type comparison.
431 2010-02-08 Miguel de Icaza <miguel@novell.com>
433 * namespace.cs (CompletionGetTypesStartingWith): Do not include
434 private types in the completion results.
436 * cs-parser.jay: Bubble completions after "from x in ?" and "from x
439 2010-02-17 Marek Safar <marek.safar@gmail.com>
441 * generic.cs, field.cs, decl.cs, cs-parser.jay: Simplify special
444 2010-02-14 Miguel de Icaza <miguel@novell.com>
446 * eval.cs: Do not do the report printer dance unless the user has
447 set the DescribeTypes feature.
449 2010-02-10 Marek Safar <marek.safar@gmail.com>
451 * argument.cs, dynamic.cs, expression.cs: Track RC API changes.
453 2010-02-08 Marek Safar <marek.safar@gmail.com>
455 A fix for bug #577029
456 * anonymous.cs: Fixed TypeBuilder* check.
458 2010-02-06 Miguel de Icaza <miguel@novell.com>
460 * eval.cs (CompileBlock): Also undo if there are problems during
461 semantic analysis, fixes various cases where invalid C# code would
462 be reported, but the internal changes would not be undone.
464 2010-02-03 Miguel de Icaza <miguel@novell.com>
466 * driver.cs: Change the --fatal flag to allow a number to be
467 passed, this ignores the first N fatal errors. Useful to debug
468 errors that do not happen on the first hit.
470 * cs-parser.jay (invocation_expression): accept both the
471 CLOSE_PARENS and COMPLETE_COMPLETION, this allows completions
472 inside an invocation.
474 * driver.cs: Expose FatalErrors.
476 * eval.cs: Initialize the printer's Fatal property from the
477 Driver's FatalError flag, this allows csharp --fatal to work
480 Add support for calling Describe (typeof (TYPE)) if the expression
483 2010-02-02 Marek Safar <marek.safar@gmail.com>
485 A fix for bug #574991
486 * rootcontext.cs, class.cs, driver.cs: Hide enhanced warnings behind
489 2010-02-02 Marek Safar <marek.safar@gmail.com>
491 A fix for bug #575986
492 * expression.cs: Don't mutate typeof type definitions.
494 2010-01-28 Marek Safar <marek.safar@gmail.com>
496 * decl.cs: Use only one set of modifiers.
498 2010-01-26 Marek Safar <marek.safar@gmail.com>
500 A fix for bug #573329
501 * eval.cs: Don't disable error reporting completely on silent mode.
503 2010-01-25 Marek Safar <marek.safar@gmail.com>
505 A fix for bug #573312
506 * constant.cs, expression.cs, ecore.cs: Emit correct offset for
507 pointer index of unknown size types greater than 2.
509 2010-01-15 Marek Safar <marek.safar@gmail.com>
511 * *.cs: Use only 1 member kind enum.
513 2010-01-15 Marek Safar <marek.safar@gmail.com>
515 * *.cs: Add event specification.
517 2010-01-14 Marek Safar <marek.safar@gmail.com>
519 * membercache.cs: Extracted from decl.cs.
521 * *.cs: Put more infrastructure in place.
523 2010-01-13 Marek Safar <marek.safar@gmail.com>
525 * *.cs: Add property specification, unused yet.
527 2010-01-13 Marek Safar <marek.safar@gmail.com>
529 * property.cs: Move all property based declarations into a new file.
531 2010-01-13 Marek Safar <marek.safar at gmail.com>
533 * expression.cs (Conditional): Resolve reduced expression.
535 2010-01-13 Marek Safar <marek.safar at gmail.com>
537 * *.cs: Introduced non-generic method specification.
539 2010-01-07 Marek Safar <marek.safar@gmail.com>
541 * method.cs: Move all method based declarations into a new file.
543 2010-01-07 Marek Safar <marek.safar@gmail.com>
545 * *.cs: Extract field specification.
547 2009-12-17 Marek Safar <marek.safar@gmail.com>
549 * field.cs: Extracted from class.cs
551 2009-12-15 Marek Safar <marek.safar@gmail.com>
553 * attribute.cs (GetFixedBuffer): Work on field definition only.
555 2009-12-15 Marek Safar <marek.safar@gmail.com>
557 * *.cs: Clean up NET_4_0 conditional where possible.
559 2009-12-14 Rodrigo Kumpera <rkumpera@novell.com>
561 support.cs (DynamicType): Assembly property returns the assembly builder.
562 This is required due to how compiler context works in corlib.
564 2009-12-14 Marek Safar <marek.safar@gmail.com>
566 A fix for bug #564376
567 * assign.cs (LocalTemporary): Removed no longer needed special
570 2009-12-11 Marek Safar <marek.safar@gmail.com>
572 * modifiers.cs, decl.cs, iterators.cs, const.cs, anonymous.cs,
573 class.cs, delegate.cs, cs-parser.jay, enum.cs: Turn modifiers into
574 enum for easier debugging.
576 2009-12-10 Marek Safar <marek.safar@gmail.com>
578 * decl.cs, anonymous.cs, class.cs: Sealed Define it's now main entry
581 * parameter.cs, delegate.cs, dynamic.cs: Don't use builder methods
584 2009-12-10 Marek Safar <marek.safar@gmail.com>
586 * cs-parser.jay, statement.cs: Handle parser error in code
589 2009-12-10 Marek Safar <marek.safar@gmail.com>
591 * ecore.cs: Ignore base imported methods when they are already
594 * eval.cs: Handle non-existent keys.
596 * report.cs, driver.cs: Make fatal work with console printer only.
598 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
600 * typemanager.cs (MakeGenericMethod): Fix stupid mistake.
602 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
604 * typemanager.cs: Add MakeGenericMethod that checks if the method
605 is really the generic method definition.
607 ecore.cs (MethodGroupExpr:IsApplicable): Use new TypeManager function
608 to inflate generic methods.
610 2009-12-08 Marek Safar <marek.safar@gmail.com>
612 A fix for bug #561149
613 * anonymous.cs: Use actual type parameters when checking for generic
616 2009-12-08 Marek Safar <marek.safar@gmail.com>
618 A fix for bug #561369
619 * expression.cs (DoNumericPromotion): Fixed typo.
621 2009-12-08 Marek Safar <marek.safar@gmail.com>
623 *.cs: Moving to generics world.
625 cs-parser.jay: Removed current_array_type.
627 2009-12-07 Marek Safar <marek.safar@gmail.com>
629 *.cs: Moving to generics world.
631 2009-12-04 Marek Safar <marek.safar@gmail.com>
633 *.cs: Moving to generics world (day 2).
635 2009-12-03 Marek Safar <marek.safar@gmail.com>
637 *.cs: Moving to generics world.
639 2009-12-02 Marek Safar <marek.safar@gmail.com>
641 * typemanager.cs, parameter.cs, class.cs, delegate.cs, attribute.cs:
642 Encode dynamic type attribute for elements where attributes cannot
645 2009-12-01 Marek Safar <marek.safar@gmail.com>
647 argument.cs, assign.cs, expression.cs, cs-parser.jay: Named
650 2009-12-01 Marek Safar <marek.safar@gmail.com>
652 A fix for bug #360455
653 * class.cs: Never report a unused warning for generic events to
654 workaround wrong expression type.
656 2009-11-30 Marek Safar <marek.safar@gmail.com>
658 A fix for bug #558305
659 * decl.cs, class.cs: Check partial method definitions using correct
662 2009-11-30 Marek Safar <marek.safar@gmail.com>
664 * argument.cs: Don't cache rarely used dynamic flag.
666 2009-11-27 Marek Safar <marek.safar@gmail.com>
668 * cs-parser.jay: Use jay global stacks (saves over 3MB for corlib).
670 2009-11-27 Marek Safar <marek.safar@gmail.com>
672 * ecore.cs (SimpleName): Removed no longer needed in_transit as
673 Resolve is now non-reentrant (saves ~0.6MB for corlib).
675 2009-11-26 Marek Safar <marek.safar@gmail.com>
677 A fix for bug #545081
678 * decl.cs: Check private nested types of nested types recursively.
680 2009-11-26 Marek Safar <marek.safar@gmail.com>
682 A fix for bug #558305
683 * location.cs: Ignore self referencing #line directive
685 2009-11-26 Marek Safar <marek.safar@gmail.com>
687 A fix for bug #558292
688 * class.cs: Allow single unsafe fixed buffer fields.
690 2009-11-26 Marek Safar <marek.safar@gmail.com>
692 * expression: Optimize few more zero-based operations.
694 2009-11-26 Marek Safar <marek.safar@gmail.com>
696 * cs-tokenizer.cs, cs-parser.jay: Simplify literal parsing, also
697 avoids boxing of literal values.
699 2009-11-26 Marek Safar <marek.safar@gmail.com>
701 * cs-tokenizer.cs, argument.cs, eval.cs, linq.cs, decl.cs,
702 expression.cs, ecore.cs, location.cs, cs-parser.jay, attribute.cs,
703 codegen.cs: LocatedToken redesing to avoid excessive allocation and
704 boxing (saves ~7MB for corlib). Also fixes presise token location.
706 2009-11-25 Marek Safar <marek.safar@gmail.com>
708 * ecore.cs, cs-parser.jay: Keep parser structures local. Share
711 2009-11-24 Marek Safar <marek.safar@gmail.com>
713 * expression.cs: Lower static array initializer barrier.
715 * support.cs, driver.cs: Share reader buffer.
717 2009-11-23 Marek Safar <marek.safar@gmail.com>
719 * cs-tokenizer.cs, support.cs: Some tokenizer optimizations.
721 2009-11-23 Marek Safar <marek.safar@gmail.com>
723 * cs-tokenizer.cs, support.cs: Use Dictionary instead of Hashtable,
724 cleanup some obsolete code.
726 2009-11-20 Marek Safar <marek.safar@gmail.com>
728 * context.cs, expression.cs, ecore.cs, complete.cs: Cleaned up
731 2009-11-20 Marek Safar <marek.safar@gmail.com>
733 * *.cs: Resolved expressions are never resolved again, this helps to
734 uncover some not easy to find bugs and improve the performance.
736 2009-11-19 Marek Safar <marek.safar@gmail.com>
738 * *.cs: Made constant expressions fully compatible with any other
741 2009-11-19 Marek Safar <marek.safar@gmail.com>
743 * *.cs: DoResolve is a worker method and has to be protected.
745 2009-11-18 Marek Safar <marek.safar@gmail.com>
747 * *.cs: More context specific handling.
749 2009-11-17 Marek Safar <marek.safar@gmail.com>
751 * *.cs: More context specific handling.
753 2009-11-16 Marek Safar <marek.safar@gmail.com>
755 * dynamic.cs, class.cs: Removed few fixed user types conversions.
757 * symbolwriter.cs: Uses public ILOffset.
759 2009-11-13 Marek Safar <marek.safar@gmail.com>
761 A fix for bug #553650
762 * generic.cs: Another missing TypeToCoreType, still too many to fix.
764 2009-11-13 Marek Safar <marek.safar@gmail.com>
766 A fix for bug #555170
768 * class.cs, delegate.cs, enum.cs: Constants have to be available
769 for parameters resolve.
771 2009-11-12 Marek Safar <marek.safar@gmail.com>
773 * typemanager.cs, argument.cs, support.cs, delegate.cs: Dynamic
776 2009-11-12 Marek Safar <marek.safar@gmail.com>
778 * argument.cs, context.cs, expression.cs, ecore.cs: Dynamic binding
779 with a statically known candidate set.
781 2009-11-11 Scott Peterson <lunchtimemama@gmail.com>
783 * generic.cs: Made type inflation for generic constraint checks
784 recursive. This fixes BGO #553655.
786 2009-11-11 Marek Safar <marek.safar@gmail.com>
788 * dynamic.cs, decl.cs, expression.cs, ecore.cs: More dynamic type
791 2009-11-10 Marek Safar <marek.safar@gmail.com>
793 * typemanager.cs, generic.cs, parameter.cs, argument.cs, dynamic.cs,
794 linq.cs, rootcontext.cs, ecore.cs, class.cs, delegate.cs,
795 attribute.cs: Add some dynamic error checking.
797 2009-11-07 Marek Safar <marek.safar@gmail.com>
799 A fix for bug #553465
801 * expression.cs: Fixed mixed version of expression tree anonymous
804 2009-11-06 Marek Safar <marek.safar@gmail.com>
806 A fix for bug #553031
808 * linq.cs, expression.cs, class.cs, cs-parser.jay: Initialize
809 expression tree version of anonymous type with members declaration.
811 2009-11-05 Marek Safar <marek.safar@gmail.com>
813 * parameter.cs: Handle nullable parameter default expression.
815 * argument.cs, dynamic.cs, expression.cs, support.cs, ecore.cs,
816 class.cs, attribute.cs: Check for wrong dynamic arguments.
818 2009-11-05 Marek Safar <marek.safar@gmail.com>
820 * statement.cs: Dynamic statements.
822 2009-11-04 Marek Safar <marek.safar@gmail.com>
824 * dynamic.cs, assign.cs, context.cs, expression.cs, ecore.cs:
825 Compound assignments over dynamic type.
827 2009-11-03 Marek Safar <marek.safar@gmail.com>
829 * argument.cs, dynamic.cs, expression.cs, delegate.cs: Dynamic
830 constructor arguments.
832 2009-10-30 Marek Safar <marek.safar@gmail.com>
834 * dynamic.cs, convert.cs, assign.cs, constant.cs, expression.cs,
835 codegen.cs: Unary mutator on dynamic member access expression.
837 2009-10-29 Marek Safar <marek.safar@gmail.com>
839 A fix for bug #550580
840 * convert.cs: Don't eliminate explicit precission casts.
842 2009-10-28 Marek Safar <marek.safar@gmail.com>
844 A fix for bug #550404
846 * parameter.cs, iterators.cs, context.cs, anonymous.cs,
847 expression.cs, statement.cs, ecore.cs: Quote any nested expression
850 2009-10-27 Marek Safar <marek.safar@gmail.com>
852 * constant.cs, nullable.cs: Create nullable-null as LiftedNull
855 * class.cs: Allow nullable binary user operators.
857 2009-10-26 Marek Safar <marek.safar@gmail.com>
859 * expression.cs: Move binary expression optimization at the end of
862 2009-10-23 Marek Safar <marek.safar@gmail.com>
864 * constant.cs, nullable.cs, expression.cs, literal.cs, cfold.cs:
865 Separate NullConstant from NullLiteral.
867 2009-10-23 Marek Safar <marek.safar@gmail.com>
869 * typemanager.cs, eval.cs, decl.cs, roottypes.cs, context.cs,
870 anonymous.cs, expression.cs, rootcontext.cs, ecore.cs, class.cs,
871 flowanalysis.cs, cs-parser.jay, driver.cs, codegen.cs: Split
872 ModuleContainer. Add common unclosed member check routine.
874 2009-10-22 Marek Safar <marek.safar@gmail.com>
876 * argument.cs: Use literal flag for real literals only.
878 * dynamic.cs: Use correct return type for custom delegates.
880 2009-10-22 Marek Safar <marek.safar@gmail.com>
882 * dynamic.cs, expression.cs: Pass logical binary flag to dynamic
885 2009-10-22 Marek Safar <marek.safar@gmail.com>
887 * dynamic.cs, ecore.cs: Dynamic invocation with void return type.
889 2009-10-21 Marek Safar <marek.safar@gmail.com>
891 * dynamic.cs, convert.cs, expression.cs, ecore.cs: Wrap array index
894 2009-10-21 Marek Safar <marek.safar@gmail.com>
896 * typemanager.cs, dynamic.cs, expression.cs: Don't resolve runtime
899 2009-10-20 Marek Safar <marek.safar@gmail.com>
901 * argument.cs, dynamic.cs, expression.cs: Latest API update.
903 2009-10-19 Marek Safar <marek.safar@gmail.com>
905 * typemanager.cs, expression.cs: Dynamic array initializer.
907 2009-10-16 Marek Safar <marek.safar@gmail.com>
909 * typemanager.cs, rootcontext.cs: Clear -nostdlib flag when object
912 2009-10-16 Marek Safar <marek.safar@gmail.com>
914 A fix for bug #493523, #507067
915 * convert.cs, nullable.cs, expression.cs: Do implicit and explicit
916 standard nullable conversion using underlying standard conversion
917 and not full conversion.
919 2009-10-15 Marek Safar <marek.safar@gmail.com>
921 * dynamic.cs, expression.cs, ecore.cs, delegate.cs: Check return
922 type in VerifyArgumentsCompat.
924 2009-10-15 Marek Safar <marek.safar@gmail.com>
926 * nullable.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
927 Reject variable used with type arguments.
929 2009-10-14 Marek Safar <marek.safar@gmail.com>
931 * argument.cs, dynamic.cs, assign.cs, expression.cs, ecore.cs:
932 Implement dynamic expressions assignment.
934 2009-10-14 Marek Safar <marek.safar@gmail.com>
936 * expression.cs: Build underlying expression when resolving unary
939 2009-10-14 Marek Safar <marek.safar@gmail.com>
941 * expression.cs: Emit enum array initializer using binary blob.
943 2009-10-08 Marek Safar <marek.safar@gmail.com>
945 * typemanager.cs, constant.cs: Optimize decimal constants which fit
948 2009-10-07 Marek Safar <marek.safar@gmail.com>
950 * typemanager.cs: Reset object_type.
952 * assign: Made SimpleAssign public.
954 2009-10-06 Marek Safar <marek.safar@gmail.com>
956 * typemanager.cs, decl.cs, namespace.cs, ecore.cs, class.cs: Pass
957 invocation assembly to IsThisOrFriendAssembly.
959 2009-10-05 Marek Safar <marek.safar@gmail.com>
961 * expression.cs: Equality comparison of generic parameter with
964 2009-10-05 Marek Safar <marek.safar@gmail.com>
966 A fix for bug #543570
967 * generic.cs: Import predefined constraints correctly.
969 2009-10-02 Marek Safar <marek.safar@gmail.com>
971 * ecore.cs: Don't crash on overloads with optional paremeters where
972 arguments count overflows.
974 * parameter.cs: Import optional parameter constants using optional
977 2009-10-01 Marek Safar <marek.safar@gmail.com>
979 * Makefile: Default is gmcs compiler.
981 2009-10-01 Marek Safar <marek.safar@gmail.com>
983 * cs-parser.jay: Fixed few NRE.
985 2009-10-01 Marek Safar <marek.safar@gmail.com>
987 * cs-parser.jay, driver.cs: Expose parser exception in verbose mode.
989 2009-09-30 Marek Safar <marek.safar@gmail.com>
991 * linq.cs, convert.cs, assign.cs, expression.cs, ecore.cs: Add
992 ShimExpression, ImplicitCast.
994 2009-09-30 Marek Safar <marek.safar@gmail.com>
996 A fix for bug #542959
997 * delegate.cs: Emit correct delegate instance variable when there
998 are static and non-static overloads.
1000 2009-09-29 Marek Safar <marek.safar@gmail.com>
1002 * dynamic.cs, linq.cs, anonymous.cs, expression.cs, statement.cs,
1003 ecore.cs, cs-parser.jay: Unary expression dynamic compiler.
1005 2009-09-28 Marek Safar <marek.safar@gmail.com>
1007 A fix for bug #542487
1008 * ecore.cs: Resolve extension methods hidden by properties.
1010 2009-09-25 Marek Safar <marek.safar@gmail.com>
1012 * expression.cs, ecore.cs: More dynamic binary expressions.
1014 2009-09-22 Marek Safar <marek.safar@gmail.com>
1016 * nullable.cs, expression.cs: Fixed null lifted conversion for
1017 bitwise enum operations.
1019 2009-09-22 Marek Safar <marek.safar@gmail.com>
1021 * convert.cs, ecore.cs: Fixed explicit unsafe coversion of long
1022 values in checked context.
1024 2009-09-22 Marek Safar <marek.safar@gmail.com>
1026 * expression.cs, ecore.cs: Fixed array index constant conversion.
1028 2009-09-20 Miguel de Icaza <miguel@novell.com>
1030 * expression.cs: Do not crash when MemberLookup returns something
1031 that is not a MemberExpr here. Report error 582 instead.
1035 2009-09-18 Marek Safar <marek.safar@gmail.com>
1037 * decl.cs, class.cs: Check protected property accessors.
1039 2009-09-18 Marek Safar <marek.safar@gmail.com>
1041 * dynamic.cs, assign.cs: Dynamic compound assignment.
1043 2009-09-17 Marek Safar <marek.safar@gmail.com>
1045 * expression.cs: Fixed compound assignment explicit conversion.
1047 2009-09-17 Marek Safar <marek.safar@gmail.com>
1049 * expression.cs, ecore.cs: Cannot infer variables from method group.
1051 2009-09-16 Marek Safar <marek.safar@gmail.com>
1053 * argument.cs, dynamic.cs, convert.cs, context.cs, anonymous.cs,
1054 constant.cs, nullable.cs, expression.cs, literal.cs, ecore.cs,
1055 codegen.cs: Dynamic binary operations scaffolding.
1057 2009-09-15 Marek Safar <marek.safar@gmail.com>
1059 * expression.cs: Fixes nullable promotion for enum type variables.
1061 2009-09-11 Marek Safar <marek.safar@gmail.com>
1063 * driver.cs, dynamic.cs: Reset more static variables.
1065 2009-09-11 Marek Safar <marek.safar@gmail.com>
1067 * dynamic.cs, expression.cs, rootcontext.cs, namespace.cs, ecore.cs,
1068 driver.cs: Introduced Expression::MakeExpression.
1070 2009-09-11 Marek Safar <marek.safar@gmail.com>
1072 * eval.cs: Exposed MessageOutput instead of cleaning up eval API.
1074 2009-09-09 Marek Safar <marek.safar@gmail.com>
1076 * eval.cs, report.cs: Use Console.Out for all eval error or warning
1079 2009-09-09 Marek Safar <marek.safar@gmail.com>
1081 A fix for bug #518707
1082 * expression.cs (Is): Optimize only generic parameter type
1083 expression probing value type generic parameter.
1085 2009-09-09 Marek Safar <marek.safar@gmail.com>
1087 A fix for bug #532571
1088 * ecore.cs: Check for simple name type arguments used with
1091 2009-09-08 Marek Safar <marek.safar@gmail.com>
1093 A fix for bug #497421
1094 * generic.cs (CheckConstraint): Don't use buildin types to check for
1095 parameterless constructor.
1097 2009-09-08 Marek Safar <marek.safar@gmail.com>
1099 A fix for bug #537402
1100 * generic.cs (CheckConstraint): Correctly inflate generic type
1101 arguments when checking generic method.
1103 2009-09-08 Marek Safar <marek.safar@gmail.com>
1105 A fix for bug #536463
1106 * decl.cs (AddToContainer): Don't report collision between explicit
1107 and parameterless non-explicit members.
1109 2009-09-08 Marek Safar <marek.safar@gmail.com>
1111 * eval.cs: Reset more static stuff.
1113 2009-09-07 Marek Safar <marek.safar@gmail.com>
1115 A fix for bug #324625
1116 * expression.cs, ecore.cs: Create nested generic type expression
1117 using declaring and not current type.
1119 2009-09-07 Marek Safar <marek.safar@gmail.com>
1121 * *.cs: Changed Report class to accept various output printers and
1122 be an instance class. An expression resolver can now use different
1123 message reporter for each call and Report.Error can safely throw
1124 an exception. Part of ongoing work to turn mcs into proper library.
1126 2009-09-04 Marek Safar <marek.safar@gmail.com>
1128 * statement.cs, ecore.cs: Removed error reporting from emit code.
1130 2009-09-04 Marek Safar <marek.safar@gmail.com>
1132 * cs-parser.jay, parameter.cs: Moved parser check out of constructor
1134 2009-09-03 Marek Safar <marek.safar@gmail.com>
1136 * anonymous.cs, expression.cs, statement.cs, cs-parser.jay: Moved
1137 parser checks out of constructors.
1139 2009-09-02 Marek Safar <marek.safar@gmail.com>
1141 * expression.cs, statement.cs, ecore.cs: Use common Report.Error.
1143 2009-09-02 Marek Safar <marek.safar@gmail.com>
1145 A fix for bug #535448
1146 * anonymous.cs, class.cs: Copy return label between all contexts.
1148 2009-09-02 Marek Safar <marek.safar@gmail.com>
1150 A fix for bug #535395
1151 * namespace.cs: Resolve context can be null.
1153 2009-08-25 Marek Safar <marek.safar@gmail.com>
1155 A fix for bug #533912
1156 * generic.cs: Use correct context for constraints resolving.
1158 2009-08-25 Marek Safar <marek.safar@gmail.com>
1160 A fix for bug #532630
1161 * driver.cs: Trim conditional symbols.
1163 2009-08-25 Marek Safar <marek.safar@gmail.com>
1165 * context.cs: New file.
1167 * *.exe.sources, *.csproj: Updated.
1169 2009-08-25 Marek Safar <marek.safar@gmail.com>
1171 * generic.cs, parameter.cs, decl.cs, statement.cs, namespace.cs,
1172 class.cs, generic-mcs.cs, codegen.cs: Add GetSignatureForError to
1173 IMembercontext, some small cleanups.
1175 2009-08-24 Marek Safar <marek.safar@gmail.com>
1177 * *.cs: Split ResolveContext and EmitContext.
1179 2009-08-24 Marek Safar <marek.safar@gmail.com>
1181 * *.cs: Only ResolveContext implements IMemberContext.
1183 2009-08-21 Marek Safar <marek.safar@gmail.com>
1185 * *.cs: Renamed IResolveContext to IMemberContext.
1187 2009-08-21 Marek Safar <marek.safar@gmail.com>
1189 * *.cs: Detached ResolveContext from EmitContext.
1191 2009-08-21 Marek Safar <marek.safar@gmail.com>
1193 * codegen.cs: Moved flow-analysis to BlockContext.
1195 2009-08-21 Marek Safar <marek.safar@gmail.com>
1197 * *.cs: Detached BlockContext from EmitContext.
1199 2009-08-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1201 * statement.cs: avoid nullref when the return value of GetEnumerator()
1202 does not contain any MoveNext() method.
1204 2009-08-19 Marek Safar <marek.safar@gmail.com>
1206 * *.cs: Removed IResolveContext::GenericDeclContainer.
1208 2009-08-19 Marek Safar <marek.safar@gmail.com>
1210 * class.cs, delegate.cs: Changed Delegate to be TypeContainer based.
1212 2009-08-19 Marek Safar <marek.safar@gmail.com>
1214 * generic.cs, iterators.cs, expression.cs, statement.cs, ecore.cs,
1215 cs-parser.jay, attribute.cs, codegen.cs: Better error reports.
1217 2009-08-18 Marek Safar <marek.safar@gmail.com>
1219 * *.cs: Removed boolean fields from EmitContext.
1221 2009-08-18 Marek Safar <marek.safar@gmail.com>
1223 * *.cs: Add IResolveContext::IsStatic.
1225 2009-08-18 Marek Safar <marek.safar@gmail.com>
1227 * *.cs: Moved TopBlock's methods from EmitContext to TopBlock.
1229 2009-08-17 Marek Safar <marek.safar@gmail.com>
1231 * *.cs: Removed DeclContainer from EmitContext.
1233 2009-08-17 Marek Safar <marek.safar@gmail.com>
1235 * *.cs: Add IResolveContext::CurrentTypeParameters.
1237 2009-08-14 Marek Safar <marek.safar@gmail.com>
1239 * *.cs: Removed TypeContainer and ContainerType from EmitContext.
1241 2009-08-14 Marek Safar <marek.safar@gmail.com>
1243 * decl.cs, expression.cs, namespace.cs, ecore.cs, class.cs,
1244 codegen.cs: Add IResolveContext::LookupExtensionMethod.
1246 2009-08-13 Marek Safar <marek.safar@gmail.com>
1248 * decl.cs: Look in PartialContainer for parent type parameters.
1250 2009-08-13 Marek Safar <marek.safar@gmail.com>
1252 * decl.cs, namespace.cs, ecore.cs, class.cs, attribute.cs,
1253 codegen.cs: Add IResolveContext::LookupTypeParameter.
1255 2009-08-13 Marek Safar <marek.safar@gmail.com>
1257 * lambda.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
1258 Moved resolved logic from Emit to Resolve.
1260 2009-08-13 Marek Safar <marek.safar@gmail.com>
1262 * parameter.cs, decl.cs, roottypes.cs, class.cs, attribute.cs,
1263 codegen.cs: Reworked atttributes handling of ResolveContext.
1265 2009-08-12 Marek Safar <marek.safar@gmail.com>
1267 * decl.cs, ecore.cs, class.cs, attribute.cs, codegen.cs: Pushed
1268 LookupNamespaceOrType to ResolveContext.
1270 2009-08-12 Marek Safar <marek.safar@gmail.com>
1272 * typemanager.cs, decl.cs, expression.cs, namespace.cs, ecore.cs,
1273 class.cs: Removed unused parameters and methods.
1275 2009-08-11 Marek Safar <marek.safar@gmail.com>
1277 * generic.cs, lambda.cs, anonymous.cs, statement.cs, generic-mcs.cs,
1278 codegen.cs: Finding the best common type of a set of expressions for
1281 2009-08-07 Marek Safar <marek.safar@gmail.com>
1283 * dynamic.cs, expression.cs: More dynamic conversions.
1285 2009-08-06 Miguel de Icaza <miguel@novell.com>
1287 * generic.cs: This loop was incorrect, it was increment ii, but
1288 checking for `i'. This was a change introduced to fix #327497,
1291 * class.cs: Catch another case for cs0533 error, fixes #324782.
1293 2009-08-06 Rodrigo Kumpera <rkumpera@novell.com>
1295 * typemanager.cs (GetGenericArguments): SRE returns null for
1296 generic methods on type builder instances if they are not generic
1297 themselves. For example, for Foo<int>::Bar() it returns null, but
1298 not for Foo<int>::Bar<>() or Foo<int>::Bar<double>().
1300 2009-08-05 Marek Safar <marek.safar@gmail.com>
1302 * argument.cs, dynamic.cs, expression.cs, ecore.cs, class.cs,
1303 delegate.cs: Work on dynamic binding.
1305 2009-08-04 Marek Safar <marek.safar@gmail.com>
1307 A second fix for bug #525342
1308 * class.cs: Attach partial method attributes to method
1311 2009-08-03 Marek Safar <marek.safar@gmail.com>
1313 * typemanager.cs, parameter.cs, support.cs, class.cs: Dynamic type
1316 * rootcontext.cs: Default to langversion v4.
1318 2009-08-03 Marek Safar <marek.safar@gmail.com>
1320 * pending.cs: Check return type before member info is set.
1322 2009-08-03 Marek Safar <marek.safar@gmail.com>
1324 * anonymous.cs: Fully initialize generic hoisted field expression.
1326 2009-08-02 Miguel de Icaza <miguel@novell.com>
1328 * cs-parser.jay: Flag variables declared on the interactive shell
1329 as used to prevent the 168 warning about local variable not being
1332 2009-07-31 Marek Safar <marek.safar@gmail.com>
1334 * parameter.cs, dynamic.cs, support.cs, class.cs, delegate.cs,
1335 attribute.cs: Emit dynamic export attribute.
1337 2009-07-30 Marek Safar <marek.safar@gmail.com>
1339 * expression.cs: More verifier work.
1341 2009-07-29 Marek Safar <marek.safar@gmail.com>
1343 * nullable.cs: Fixed SRE crash during corlib compilation.
1345 2009-07-29 Marek Safar <marek.safar@gmail.com>
1347 * generic.cs, typemanager.cs, decl.cs, iterators.cs, convert.cs,
1348 nullable.cs, expression.cs, ecore.cs, class.cs, attribute.cs:
1349 More TypeManager.TypeToCoreType needed.
1351 2009-07-29 Marek Safar <marek.safar@gmail.com>
1353 * anonymous.cs: Update after recent SRE fixes.
1355 2009-07-28 Marek Safar <marek.safar@gmail.com>
1357 * typemanager.cs, expression.cs, ecore.cs, delegate.cs: Use correct
1358 version of GetFieldHandle for fields of generic types.
1360 2009-07-27 Marek Safar <marek.safar@gmail.com>
1362 * typemanager.cs, argument.cs, convert.cs, assign.cs, expression.cs,
1363 ecore.cs: Add TypeManager.IsDynamicType,
1364 PredefinedAttributes.Dynamic.
1366 2009-07-27 Marek Safar <marek.safar@gmail.com>
1368 A fix for bug #415375
1369 * expression.cs: Fixed object and reference type parameter
1372 2009-07-27 Marek Safar <marek.safar@gmail.com>
1374 A fix for bug #525342
1375 * class.cs: Attach partial method attributes to method
1378 2009-07-24 Marek Safar <marek.safar@gmail.com>
1380 * argument.cs, dynamic.cs, expression.cs, class.cs, attribute.cs:
1383 2009-07-24 Marek Safar <marek.safar@gmail.com>
1385 * anonymous.cs (MutateField): Add imported types handling.
1387 2009-07-23 Marek Safar <marek.safar@gmail.com>
1389 * expression.cs, delegate.cs: Moved arguments resolve into their
1390 counterparts expressions. Removed argument resolve from
1391 CollectionElementInitializer.
1393 2009-07-23 Marek Safar <marek.safar@gmail.com>
1395 A fix for bug #523683
1396 * convert.cs, delegate.cs: Use common overload mechanism for method
1397 group conversion check.
1399 2009-07-22 Marek Safar <marek.safar@gmail.com>
1401 A fix for bug #523899
1402 * generics.cs: Exact type inference with other bound types.
1404 2009-07-22 Raja R Harinath <harinath@hurrynot.org>
1406 Don't complain when the same type is implemented by the output
1407 assembly as well as multiple referenced assemblies
1408 * namespace.cs (RootNamespace.LookupTypeReflection): Add
1409 'must_be_unique' flag.
1410 (GlobalRootNamespace): Update to changes.
1411 (Namespace.LookupType): Pass 'must_be_unique' only when we don't
1412 already have a type in hand.
1414 2009-07-22 Marek Safar <marek.safar@gmail.com>
1416 * expression.cs: More verifier instrumentation.
1418 * statement.cs: Do proper throw expression conversion.
1420 2009-07-22 Marek Safar <marek.safar@gmail.com>
1422 A fix for bug #522789
1423 * expression.cs: Mutate invocation return type.
1425 2009-07-16 Marek Safar <marek.safar@gmail.com>
1427 * anonymous.cs: Split assignable and readonly generated variable
1430 2009-07-16 Marek Safar <marek.safar@gmail.com>
1432 A fix for bug #521671
1433 * statement.cs: Fixed crash when checking missing type.
1435 2009-07-16 Marek Safar <marek.safar@gmail.com>
1437 * typemanager.cs, generic.cs, argument.cs, linq.cs, convert.cs,
1438 assign.cs, expression.cs, statement.cs, support.cs, ecore.cs,
1439 class.cs, driver.cs: Work on dynamic binding.
1441 * dynamic.cs: New file.
1443 * *.sources, *.proj: Updated.
1445 2009-07-15 Marek Safar <marek.safar@gmail.com>
1447 * expression.cs (Conditional): Avoid double Resolve.
1449 2009-07-13 Marcus Griep <marcus@griep.us>
1451 * ecore.cs: Fix obscure bug with resolving members of interfaces
1452 that hide parent interface members. Fixes bug #444388 and corrects
1455 2009-07-13 Marek Safar <marek.safar@gmail.com>
1457 * expression.cs (LocalVariableReference): Bounce resolve.
1459 2009-07-10 Marek Safar <marek.safar@gmail.com>
1461 * typemanager.cs, lambda.cs, parameter.cs, convert.cs, anonymous.cs,
1462 expression.cs, literal.cs, ecore.cs, complete.cs: Moved internal
1465 * support.cs: New dynamic type wrapper.
1467 2009-07-08 Marek Safar <marek.safar@gmail.com>
1469 * ecore.cs, cs-parser.jay: Better error reporting for implicitly
1470 typed local variable.
1472 2009-07-06 Marek Safar <marek.safar@gmail.com>
1474 A fix for bug #519005
1475 * anonymous.cs: Use null_type as no return type placeholder.
1477 2009-07-02 Marek Safar <marek.safar@gmail.com>
1479 * generic.cs: Handle type inference of identical type parameters
1480 with different bounds.
1482 2009-07-01 Marek Safar <marek.safar@gmail.com>
1484 * expression.cs, class.cs: Events variance.
1486 * cs-parser.jay: Interface events error messages.
1488 2009-07-01 Marek Safar <marek.safar@gmail.com>
1490 * generic.cs, argument.cs: Updated type inference logic to C# 4.0.
1492 2009-06-29 Marek Safar <marek.safar@gmail.com>
1494 * parameter.cs, convert.cs, expression.cs, class.cs: Default
1495 parameter expression can be value-type New.
1497 * cs-parser.jay: Clean up too many parameter modifier boolean flags.
1499 2009-06-26 Marek Safar <marek.safar@gmail.com>
1501 * generic.cs, argument.cs, expression.cs, ecore.cs, cs-parser.jay:
1502 Implemented C# 4.0 named arguments.
1504 2009-06-24 Marek Safar <marek.safar@gmail.com>
1506 * typemanager.cs, parameter.cs, iterators.cs, convert.cs,
1507 expression.cs, ecore.cs, delegate.cs: Removed unnecessary ArgList
1508 parameter modifier. Also fixes bug #515497.
1510 2009-06-24 Marek Safar <marek.safar@gmail.com>
1512 * *.cs: Replaced ArrayList with Arguments in need of a nonsequential
1513 arguments expression to be implemented.
1515 *.sources: Add argument.cs
1517 2009-06-23 Marek Safar <marek.safar@gmail.com>
1519 * parameter.cs: Moved GetParameterIndexByName to base class.
1521 * expression.cs, statement.cs, ecore.cs, delegate.cs: Removed
1522 unused AType. Use argument's version of GetExpressionTree.
1524 2009-06-22 Marek Safar <marek.safar@gmail.com>
1526 * expression.cs, cs-parser.jay, attribute.cs, codegen.cs: Named
1529 2009-06-17 Marek Safar <marek.safar@gmail.com>
1531 A fix for bug #514096
1532 * class.cs: Allow IntPtr/UIntPtr fields to be volatile.
1534 2009-06-17 Marek Safar <marek.safar@gmail.com>
1536 * expression.cs: The first multi-dimensional array nested array
1537 initializers was not checked.
1539 * statement.cs (Switch): Fixed error message to reflect 2.0 changes.
1541 2009-06-17 Marek Safar <marek.safar@gmail.com>
1543 A fix for bug #513400
1544 * nullable.cs (EmitEquality): Operands emit could be simplified for
1545 built-in types when we now emit user operators differently.
1547 2009-06-16 Marek Safar <marek.safar@gmail.com>
1549 * ecore.cs: Report inaccessible delegate methods correctly.
1551 2009-06-16 Marek Safar <marek.safar@gmail.com>
1553 * parameter.cs, expression.cs, ecore.cs, class.cs, delegate.cs,
1554 cs-parser.jay: Implemented C# 4.0 optional parameters.
1556 2009-06-16 Marek Safar <marek.safar@gmail.com>
1558 * driver.cs: Removed broken DefineManifestResource.
1560 2009-06-16 Raja R Harinath <harinath@hurrynot.org>
1562 * Makefile [net_2_0_bootstrap]: Don't explicitly mention net_1_1.
1563 Use $(BOOTSTRAP_PROFILE) instead.
1565 2009-06-12 Jb Evain <jbevain@novell.com>
1567 * rootcontext.cs: add a Platform field.
1568 * driver.cs: handle /platform.
1569 * codegen.cs: pass the proper flags according to
1570 the platform when saving the assembly.
1572 2009-06-11 Marek Safar <marek.safar@gmail.com>
1574 * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
1575 Add optional parameters grammar.
1577 2009-06-10 Marek Safar <marek.safar@gmail.com>
1579 * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
1580 driver.cs: Split lang version and metadata version.
1582 2009-06-10 Marek Safar <marek.safar@gmail.com>
1584 * decl.cs: Better overload ctor collision error message.
1586 2009-06-05 Jb Evain <jbevain@novell.com>
1588 * driver.cs (EmbededResource): avoid using an internal method
1589 in gmcs to embed manifest resources.
1591 2009-06-04 Sebastien Pouliot <sebastien@ximian.com>
1593 * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
1594 the compiler from older mono versions (like moon's bots)
1596 2009-06-04 Marek Safar <marek.safar@gmail.com>
1598 * namespace.cs (LookupTypeReflection): Ignore collisions between
1601 2009-06-04 Marek Safar <marek.safar@gmail.com>
1603 * codegen.cs: Enabled generic type forwarders.
1605 2009-06-04 Marek Safar <marek.safar@gmail.com>
1607 * dmcs.*: Add another version of SRE compiler.
1609 2009-06-03 Marek Safar <marek.safar@gmail.com>
1611 * generic.cs, typemanager.cs, parameter.cs, convert.cs,
1612 generic-mcs.cs: Fixed variant type conversions.
1614 2009-06-02 Marek Safar <marek.safar@gmail.com>
1616 A fix for bug #507863
1617 * codegen.cs: Fixes a crash on invalid string value attribute.
1619 2009-06-01 Marek Safar <marek.safar@gmail.com>
1621 A fix for bug #508334
1622 * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
1623 cs-parser.jay: Fully import __arglist modifier.
1625 2009-05-29 Marek Safar <marek.safar@gmail.com>
1627 * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
1628 delegate.cs, generic-mcs.cs: Rewrote type variance checks to
1629 actually work with closed generic types.
1631 2009-05-27 Alan McGovern <amcgovern@novell.com>
1633 * class.cs, decl.cs, delegate.cs, parameter.cs:
1634 Fix the build by replacing the use of 'var' with the actual type.
1636 2009-05-27 Marek Safar <marek.safar@gmail.com>
1638 * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
1639 cs-parser.jay, generic-mcs.cs: Report wrong variant types
1642 * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
1645 2009-05-26 Rodrigo Kumpera <rkumpera@novell.com>
1646 Marek Safar <marek.safar@gmail.com>
1648 A fix for bug #377509
1649 * parameter.cs: Use predefined and not empty name for implicit
1652 2009-05-21 Marek Safar <marek.safar@gmail.com>
1654 * class.cs: Don't report wrong warnings for event fields.
1656 2009-05-21 Marek Safar <marek.safar@gmail.com>
1658 A fix for bug #504667
1659 * class.cs: Check for static class using parent container instead of
1662 2009-05-08 Marek Safar <marek.safar@gmail.com>
1664 A fix for bug #496922
1665 * expression.cs: Always use temporary variable when using object
1668 2009-04-28 Marek Safar <marek.safar@gmail.com>
1670 A fix for bug #495112
1671 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
1674 2009-04-27 Miguel de Icaza <miguel@novell.com>
1676 * driver.cs: Add a flag to work as a replacement for CSC in VS.
1678 2009-04-24 Miguel de Icaza <miguel@novell.com>
1680 * complete.cs: No idea how gonzalo got a null in the list, but
1683 2009-04-24 Miguel de Icaza <miguel@novell.com>
1685 * complete.cs (CompletionElementInitializer): New completion class
1686 to support completing inside a C# 3 element initializer, so this
1687 allows completion for Silverlight situations where it is very
1690 new TextBlock () { Fo<TAB>
1692 (CompletionSimpleName): Expose the prefix that was
1693 passed to the simple name.
1695 * cs-parser.jay (object_or_collection_initializer): Add support
1696 for element_initializers.
1698 * expression.cs (CollectionOrObjectInitializers.DoResolve):
1699 special case completion expressions as this method aggressively
1700 collects data before it operates, and errors were being thrown
1701 earlier than we were able to complete.
1703 2009-04-23 Miguel de Icaza <miguel@novell.com>
1705 * eval.cs: Make getcompletions silent and enable debugging output
1706 if the -v option is passed.
1708 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
1709 Consider looking up the namespace that matches the prefix being
1712 This is part of the support for allowing completions like:
1713 `System.Co<TAB>' to complete to System.Console.
1715 * complete.cs (CompletionSimpleName.AppendResults): Make this
1718 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
1720 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
1721 COMPLETE_COMPLETION as internal.
1723 2009-04-17 Miguel de Icaza <miguel@novell.com>
1725 * complete.cs: Include namespace resolution in simple names as
1726 well as global types and types in the using scope in the
1729 * namespace.cs: Supporting infrastrcture to provide completions
1730 based on the current using scope.
1732 * eval.cs: Introduce an entry point that allows for initialization
1733 to return a list of the files passed on the command line.
1735 2009-04-14 Marek Safar <marek.safar@gmail.com>
1737 A fix for bug #494243
1738 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
1740 2009-04-13 Marek Safar <marek.safar@gmail.com>
1742 A fix for bug #493887
1743 * statement.cs: Don't skip string multi-section with default or
1744 null label when populating string hashtable.
1746 2009-04-06 Marek Safar <marek.safar@gmail.com>
1748 A fix for bug #492329
1749 * expression.cs (New): Load variable when assigning type parameter
1752 2009-04-06 Marek Safar <marek.safar@gmail.com>
1754 A fix for bug #488960
1755 * decl.cs: Compare MVAR types using non-null values.
1757 2009-03-27 Marek Safar <marek.safar@gmail.com>
1759 * typemanager.cs, expression.cs: Removed unused nullable checks.
1761 2009-03-27 Marek Safar <marek.safar@gmail.com>
1763 * *.cs: Removed some gmcs conditionals.
1765 2009-03-26 Marek Safar <marek.safar@gmail.com>
1767 * generic.cs, support.cs: Moved generics stuff out of support.cs
1769 2009-03-24 Marek Safar <marek.safar@gmail.com>
1771 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
1774 2009-03-23 Marek Safar <marek.safar@gmail.com>
1776 * attribute.cs: Consider all members for error reporting when
1777 checking named arguments.
1779 2009-03-23 Marek Safar <marek.safar@gmail.com>
1781 A fix for bug #487625
1782 * namespace.cs: Use a warning for all predefined type conflicts.
1784 2009-03-23 Marek Safar <marek.safar@gmail.com>
1786 A fix for bug #485706
1787 * statement.cs: Explicitly type catch type argument to pass verifier
1790 2009-03-22 Miguel de Icaza <miguel@novell.com>
1792 Initial support to provide code completion facilities to consumers
1793 of the evaluator API.
1795 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
1796 support the completion engine. When we reach the end of the
1797 input stream instead of returning EOF, when this flag is true the
1798 tokenizer instead produces:
1800 One GENERATE_COMPLETION token: this token then must be
1801 handled in the grammar at every point where the user
1802 would likely request a completion.
1804 As many COMPLETE_COMPLETION tokens as necessary. These
1805 tokens are generated to assist the parser in unwinding and
1806 producing a valid parse tree.
1808 The parser rules do not have to be perfect, the parser needs to be
1809 augmented with judicious use of GENERATE_COMPLETION tokens to
1810 improve the areas where we can provide completion and the parser
1811 needs to add support for COMPLETE_COMPLETION tokens in productions
1814 It is common to not have enough support for COMPLETE_COMPLETION
1815 under certain rules and that even if we generated the
1816 GENERATE_COMPLETION token that the resulting tree will be invalid
1817 due to the missing rules that support COMPLETE_COMPLETION.
1819 The final EOF token is produced by having the parser notify the
1820 tokenizer when it reaches the root production that the next token
1823 * support.cs (CompletionResult): New Exception. This exception
1824 is thrown to return the completion results when one of the special
1825 completion expressions is reached.
1827 This exception is thrown by the completing ExpressionStatements
1828 classes that live in complete.cs
1830 * complete.cs (CompletingExpression): a new base class for
1831 completing expressions. This derives from the
1832 ExpressionStatement class and not from Expression as it allows
1833 completion to happen not only where expressions are expected in
1834 the grammar, but also where statements are expected.
1836 (CompletionSimpleName): A new class used to provide completions
1837 for SimpleNames. This currently only resolves to local
1838 variables from the evaluator context (GetVars call).
1840 (CompletionMemberAccess): Implements support for completing member
1843 * cs-parser.jay: Add support for completion in a few places.
1845 * eval.cs (GetCompletions): New public API for the evaluator that
1846 returns a list of possible completions given the input. The
1847 return value is an array of completions
1849 * anonymous.cs (Compatible): If the exception thrown from the
1850 resolved expression is a CompletionResult exception let that one
1851 through instead of printing a diagnostic error in the try/catch.
1853 2009-03-22 Miguel de Icaza <miguel@novell.com>
1857 * driver.cs (Main): Use Environment.Exit to quit quickly and
1858 prevent the compiler from doing the usual wait for helper thread
1861 This is to prevent a slowdown that was reported by Gonzalo on
1864 2009-03-19 Marek Safar <marek.safar@gmail.com>
1866 * ecore.cs: Load build-in types directly instead of accessing
1869 2009-03-18 Marek Safar <marek.safar@gmail.com>
1871 * ecore.cs: Always use unbox.any when available.
1873 2009-03-18 Marek Safar <marek.safar@gmail.com>
1875 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
1877 2009-03-17 Marek Safar <marek.safar@gmail.com>
1879 * generic.cs: Removed obsolete version of type inference.
1881 2009-03-16 Marek Safar <marek.safar@gmail.com>
1883 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
1884 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
1885 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
1886 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
1888 2009-03-11 Marek Safar <marek.safar@gmail.com>
1890 A fix for bug #482996
1891 * anonymous.cs: Make sure we are not infering return type when
1892 checking type compatibility.
1894 2009-03-11 Marek Safar <marek.safar@gmail.com>
1896 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
1897 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
1898 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
1899 attributes in their own structure. Needed when accessing their
1900 properties before they are resolved.
1902 2009-03-09 Marek Safar <marek.safar@gmail.com>
1904 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
1905 hashtable (~10x faster).
1907 * driver.cs: Removed wrong Reset.
1909 2009-03-08 Marek Safar <marek.safar@gmail.com>
1911 * class.cs: Use correct common base type for unmanaged delayed
1914 * rootcontext.cs: Wrap unhandled exception.
1916 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
1918 Make SeekableStreamReader self-tuning and arbitrarily seekable
1919 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
1921 (SeekableStreamReader.Position.set): Use it. Simplify logic
1922 which, as a side-effect, makes it arbitrarily-seekable. Tune the
1923 buffer size when the stream needs to be re-read from the beginning.
1925 2009-03-05 Marek Safar <marek.safar@gmail.com>
1927 A fix for bug #480100
1928 * parameter.cs: A parameter is not hoisted when used directly as ET.
1930 2009-03-04 Marek Safar <marek.safar@gmail.com>
1932 * statement.cs: Fixed an issue when using variable is of interface
1935 2009-03-03 Marek Safar <marek.safar@gmail.com>
1937 A fix for bug #480319
1938 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
1940 2009-03-03 Marek Safar <marek.safar@gmail.com>
1942 A fix for bug #480867
1943 * typemanager.cs, expression.cs, ecore.cs: Changed method group
1944 expression to have no valid type.
1946 2009-03-03 Marek Safar <marek.safar@gmail.com>
1948 A fix for bug #481258
1949 * class.cs: Set extension method flag in partial container.
1951 2009-03-03 Marek Safar <marek.safar@gmail.com>
1953 * statement.cs, typemanager.cs: Use expression for StringEmitter.
1955 * attribute.cs: Add sanity check.
1957 2009-02-27 Marek Safar <marek.safar@gmail.com>
1959 * class.cs: Add external constructor error.
1961 2009-02-26 Marek Safar <marek.safar@gmail.com>
1963 A fix for bug #475354
1964 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
1965 correctly user defined nullable equality operators.
1967 2009-02-25 Marek Safar <marek.safar@gmail.com>
1969 A fix for bug #479532
1970 * expression.cs: Implement NewInitialize::AddressOf.
1972 2009-02-25 Marek Safar <marek.safar@gmail.com>
1974 A fix for bug #413633
1975 * expression.cs: Iterate all base class-constraint types.
1977 2009-02-24 Marek Safar <marek.safar@gmail.com>
1979 A fix for bug #479209
1980 * literal.cs: Mutate null underlying type.
1982 2009-02-24 Marek Safar <marek.safar@gmail.com>
1984 A fix for bug #476295
1985 * convert.cs: Avoid wrapping implicitly convertible reference type.
1987 2009-02-23 Marek Safar <marek.safar@gmail.com>
1989 * iterators.cs: Create MemberName correctly.
1991 2009-02-23 Marek Safar <marek.safar@gmail.com>
1993 A fix for bug #478655
1994 * literal.cs: Check also underlying null type conversion.
1996 2009-02-21 Marek Safar <marek.safar@gmail.com>
1998 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
2000 2009-02-20 Marek Safar <marek.safar@gmail.com>
2002 A fix for bug #477447
2003 * statement.cs: Add reference to correct parent storey when this
2004 is accessible from deep children storey (more than 1 level).
2006 2009-02-19 Marek Safar <marek.safar@gmail.com>
2008 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
2009 * class.cs: Define base type members before setting up member cache.
2011 2009-02-18 Marek Safar <marek.safar@gmail.com>
2013 A fix for bug #477378
2014 * nullable.cs, expression.cs, statement.cs: More precise null type
2017 2009-02-18 Marek Safar <marek.safar@gmail.com>
2019 A fix for bug #472805
2020 * typemanager.cs, namespace.cs: Import only visible extension method
2023 2009-02-18 Marek Safar <marek.safar@gmail.com>
2025 A fix for bug #476895
2026 * attribute.cs: Use correct resolve context for attribute type.
2028 2009-02-18 Marek Safar <marek.safar@gmail.com>
2030 A fix for bug #476266
2031 * anonymous.cs: Mutate multi-dimensional arrays.
2033 2009-02-18 Marek Safar <marek.safar@gmail.com>
2035 A fix for bug #476400
2036 * statement.cs, expression.cs: Removed wrong Dispose optimization.
2038 2009-02-18 Marek Safar <marek.safar@gmail.com>
2040 A fix for bug #476811
2041 * generics.cs: Fixed null-literal check.
2043 2009-02-17 Marek Safar <marek.safar@gmail.com>
2045 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
2046 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
2047 messing with static variables.
2049 2009-02-16 Marek Safar <marek.safar@gmail.com>
2051 A fix for bug #475965
2052 * generics.cs: Check generic parameter type after extracting from
2055 2009-02-16 Marek Safar <marek.safar@gmail.com>
2057 A fix for bug #475823
2058 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
2061 2009-02-14 Marek Safar <marek.safar@gmail.com>
2063 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
2064 Simplified event field definition using backing field and not
2065 field builder directly.
2067 * expression.cs (EmitLdArg): Optimize fast paths.
2069 2009-02-13 Marek Safar <marek.safar@gmail.com>
2071 A fix for bug #475327
2072 * expression.cs (ArrayCreation): Don't mutate values optimized away.
2074 2009-02-13 Marek Safar <marek.safar@gmail.com>
2076 A fix for bug #475342
2077 * cs-parser.jay: Using 'super' instead of 'base' to call base
2078 constructor crashes compiler.
2080 2009-02-13 Marek Safar <marek.safar@gmail.com>
2082 A fix for bug #475354
2083 * expression.cs (Constantify): Add nullable types.
2085 * const.cs (EmitDecimalConstant): Avoid explicit cast.
2087 2009-02-12 Marek Safar <marek.safar@gmail.com>
2089 A fix for bug #475246
2090 * expression.cs: More broken flowanalysis hacking needed.
2092 2009-02-12 Marek Safar <marek.safar@gmail.com>
2094 * attribute.cs: Compare only ref/out array modifiers.
2096 2009-02-11 Marek Safar <marek.safar@gmail.com>
2098 * statement.cs: Use member cache when looking for foreach members.
2100 2009-02-11 Marek Safar <marek.safar@gmail.com>
2102 * expression.cs: Don't expose internal initializer types.
2104 * statement.cs: Check also explicit conversions for goto case.
2106 2009-02-11 Marek Safar <marek.safar@gmail.com>
2108 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
2110 2009-02-10 Marek Safar <marek.safar@gmail.com>
2112 * *.cs: Replace null-type with NullLiteral where appropriate.
2114 2009-02-09 Marek Safar <marek.safar@gmail.com>
2116 * expression.cs: Initializer of reference argument use temporary
2117 variable to be verifiable.
2119 * parameter.cs: Share EmitLdArg.
2121 2009-02-09 Marek Safar <marek.safar@gmail.com>
2123 A fix for bug #473559
2124 * class.cs: Fixed: Not reporting error about nested class with the
2127 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
2129 Contributed under the MIT/X11 license.
2131 * generic.cs: Added VerifyVariantTypeParameters which performs new
2132 variance verification logic. The old logic, based on the spec, was
2133 wrong because the spec is full of LIES!
2135 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
2137 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
2140 * ecore.cs: Added calls to the new variance verification logic.
2143 * delegate.cs: Removed calls to the old variance verification logic.
2145 2009-02-06 Marek Safar <marek.safar@gmail.com>
2147 * delegate.cs: Use cached Invoke method directly.
2149 2009-02-06 Marek Safar <marek.safar@gmail.com>
2151 * expression.cs: Emit expression tree for hoisted variable access.
2153 2009-02-04 Marek Safar <marek.safar@gmail.com>
2155 * namespace.cs: Add better extension class check.
2157 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
2159 * generic.cs: Fixed typeo (TypeParameter.Variacne).
2161 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
2163 This patch adds initial generic variance support to the compiler.
2164 It is contributed under the MIT/X11 license.
2166 * typemanager.cs: Modified ImplementsInterface to check variance.
2167 Added VerifyVariantTypeParameters which checks the specified type to see
2168 if it uses a variant type parameter as a type argument (which is not
2169 allowed). Added IsVariantOf which determins if the first type is a
2170 variant of the second. NOTE: This only supports reference types at
2171 the moment to conform with the current level of VM support. When the
2172 VM supports value types, this will follow step.
2174 * generic.cs: Added the Variance enum. Added a Variance property to
2175 TypeParameter and added variance support to definition phase. Added a
2176 Variance property to TypeParameterName. Also check to make sure that
2177 no variant types appear in generic method parameters.
2179 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
2180 keywords if the langversion supports it.
2182 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
2183 that variant types are only used in legal positions. Also added
2184 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
2187 * decl.cs: Construct TypeParameter with the variance information.
2189 * convert.cs: Checks variance in ImplicitReferenceConversionExists
2190 and ImplicitConversionStandard.
2192 * rootcontext.cs: Added new "Future" language version.
2194 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
2195 type parameters are not used as type arguments in interface inheritance.
2196 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
2197 parameters are not used as method return types. In MemberBase.
2198 ResolveMemberType, ensure that variant type parameters are not used
2199 as type arguments. Also call VerifyNoVariantTypeParameters on every
2200 set of parameters which are resolved.
2202 * delegate.cs: Modified Delegate.Define to ensure that variant
2203 parameters are not used as type arguments and that a contravariant
2204 parameter is not used as the return type. Also call
2205 VerifyNoVariantTypeParameters on the delegate parameters.
2207 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
2208 to specify generic variance.
2210 * driver.cs: Added support for LanguageVersion.Future in the form of
2211 "-langversion:future".
2213 * generic-mcs.cs: Stubbed out new members in generic.cs.
2215 2009-02-03 Marek Safar <marek.safar@gmail.com>
2217 * class.cs, generic.cs: Emit type parameter constraints for nested
2220 2009-02-02 Marek Safar <marek.safar@gmail.com>
2222 A fix for bug #471213
2223 * class.cs: Avoid emitting backing field for abstract event fields.
2225 2009-02-01 Marek Safar <marek.safar@gmail.com>
2227 A fix for bug #359731
2228 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
2231 2009-01-30 Marek Safar <marek.safar@gmail.com>
2233 A fix for bug #470767
2234 * statement.cs: Introduced BlockScopeExpression, needed when
2235 expression tree conversion has to emit scope variables.
2237 2009-01-29 Marek Safar <marek.safar@gmail.com>
2239 * class.cs: Remove duplicate CallingConvention.
2241 2009-01-29 Marek Safar <marek.safar@gmail.com>
2243 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
2244 when I finally found the right naming convention.
2246 2009-01-29 Marek Safar <marek.safar@gmail.com>
2248 * cs-tokenizer.cs: Put back different open parens optimization.
2250 2009-01-28 Marek Safar <marek.safar@gmail.com>
2252 A fix for bug #470227
2253 * cs-tokenizer.cs: Remove too agressive parser optimization.
2255 2009-01-28 Marek Safar <marek.safar@gmail.com>
2257 A fix for bug #324319
2258 * class.cs: Remove too early base type resolve.
2260 2009-01-27 Marek Safar <marek.safar@gmail.com>
2262 A fix for bug #324319
2263 * ecore.cs: Explicitly type null when assigning to type argument to
2264 make pass verifier check.
2266 2009-01-27 Marek Safar <marek.safar@gmail.com>
2268 * anonymous.cs: Fixed recent regression when initializing captured
2271 2009-01-26 Marek Safar <marek.safar@gmail.com>
2273 A fix for bug #469019
2274 * anonymous.cs: Use all parent type parameters when instantiating
2275 nested generic storey.
2277 2009-01-26 Marek Safar <marek.safar@gmail.com>
2279 * expression.cs: Check for null instance methodgroup expression.
2281 2009-01-26 Marek Safar <marek.safar@gmail.com>
2283 A fix for bug #469244
2284 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
2285 instance inside a conditional expression.
2287 2009-01-23 Marek Safar <marek.safar@gmail.com>
2289 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
2290 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
2291 GetElementType and HasElementType. IsValueType clean up.
2293 2009-01-23 Marek Safar <marek.safar@gmail.com>
2295 * nullable.cs: Use common EmitCall.
2297 * expression.cs: Emit constraint. for virtual calls only.
2299 2009-01-23 Marek Safar <marek.safar@gmail.com>
2301 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
2302 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
2303 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
2306 2009-01-22 Jb Evain <jbevain@novell.com>
2308 * anonymous.cs: make anonymous types' ToString implementation
2309 match what csc outputs.
2311 2009-01-21 Marek Safar <marek.safar@gmail.com>
2313 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
2316 2009-01-17 Marek Safar <marek.safar@gmail.com>
2318 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
2321 2009-01-16 Marek Safar <marek.safar@gmail.com>
2323 * nullable.cs (LiftedBinaryOperator): Check for all possible null
2326 2009-01-15 Marek Safar <marek.safar@gmail.com>
2328 A fix for bug #466634
2329 * statement.cs: Add reference for nested storey when only this
2332 2009-01-15 Marek Safar <marek.safar@gmail.com>
2334 A fix for bug #466474
2335 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
2338 2009-01-15 Marek Safar <marek.safar@gmail.com>
2340 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
2341 Fixed nested stories parent referencing process. Also fixes #463985.
2343 2009-01-06 Marek Safar <marek.safar@gmail.com>
2345 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
2346 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
2347 implementation. Also fixes #463108.
2349 2009-01-05 Marek Safar <marek.safar@gmail.com>
2351 A fix for bug #416109
2352 * decl.cs: Issue correct CLSAttribute warning location.
2354 2009-01-05 Marek Safar <marek.safar@gmail.com>
2356 A fix for bug #456775
2357 * attribute.cs: Use attribute owner scope when resolving attribute
2360 2009-01-05 Marek Safar <marek.safar@gmail.com>
2362 A fix for bug #457257
2363 * decl.cs: Fixed incorrect member declaring type comparison.
2365 2009-01-05 Marek Safar <marek.safar@gmail.com>
2367 A fix for bug #460896
2368 * driver.cs: Handle /RES resources as embeddable.
2370 2009-01-05 Marek Safar <marek.safar@gmail.com>
2372 A fix for bug #462515
2373 * ecore.cs: Report inacessible members upwards.
2375 2009-01-05 Marek Safar <marek.safar@gmail.com>
2377 A fix for bug #463190, #463192
2378 * decl.cs, namespace.cs: Also import internal extension classes.
2380 2009-01-04 Marek Safar <marek.safar@gmail.com>
2382 A fix for bug #463415
2383 * generic.cs: Use right index for RemoveDependentTypes.
2385 2009-01-02 Marek Safar <marek.safar@gmail.com>
2387 A fix for bug #463196
2388 * expression.cs: Fixed enum to null comparison.
2390 2009-01-02 Marek Safar <marek.safar@gmail.com>
2392 A fix for bug #463121
2393 * nullable.cs: Fixed nullable user equality operator comparison.
2395 2009-01-02 Marek Safar <marek.safar@gmail.com>
2397 A fix for bug #462950
2398 * class.cs, decl.cs: Use full explicit name when defining automatic
2399 property backing field.
2401 2009-01-02 Marek Safar <marek.safar@gmail.com>
2403 A fix for bug #462592
2404 * pending.cs: Emit type arguments for generic proxy method.
2406 2008-12-30 Marek Safar <marek.safar@gmail.com>
2408 * expression.cs (As): Mutate all type arguments.
2410 2008-12-29 Marek Safar <marek.safar@gmail.com>
2412 A fix for bug #462622
2413 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
2416 2008-12-29 Marek Safar <marek.safar@gmail.com>
2418 A fix for bug #450782
2419 * ecore.cs: Consider more variables of form V.I to be fixed.
2421 2008-12-29 Marek Safar <marek.safar@gmail.com>
2423 A fix for bug #460712
2424 * typemanager.cs: Core types could be imported.
2426 2008-12-28 Marek Safar <marek.safar@gmail.com>
2428 A fix for bugs #460847, #460772, #458049, #457339, #447807
2429 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
2430 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
2431 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
2432 user lambdas used inside query clauses.
2434 2008-12-18 Marek Safar <marek.safar@gmail.com>
2436 A fix for bug #460229
2437 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
2439 2008-12-18 Marek Safar <marek.safar@gmail.com>
2441 A fix for bug #459952
2442 * decl.cs, namespace.cs: Use common CheckAccessLevel.
2444 2008-12-18 Marek Safar <marek.safar@gmail.com>
2446 A fix for bug #459630
2447 * convert.cs: Enum to valuetype conversion is not allowed.
2449 2008-12-18 Marek Safar <marek.safar@gmail.com>
2451 A fix for bug #457087
2452 * generic.cs: Don't crash when constraint comes from type
2455 2008-12-16 Marek Safar <marek.safar@gmail.com>
2457 A fix for bug #459221
2458 * anonymous.cs, statement.cs: Delay only captured this
2461 2008-12-12 Marek Safar <marek.safar@gmail.com>
2463 A fix for bug #457489
2464 * anonymous.cs, statement.cs: Split anonymous storey instantiation
2465 and initialization to capture scope initializers correctly.
2467 2008-12-11 Marek Safar <marek.safar@gmail.com>
2469 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
2470 ParameterReference refactoring.
2472 2008-12-03 Marek Safar <marek.safar@gmail.com>
2474 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
2475 to be imported from any assembly.
2477 2008-12-03 Marek Safar <marek.safar@gmail.com>
2479 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
2480 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
2481 from anonymous method and lambda expression.
2483 2008-12-01 Marek Safar <marek.safar@gmail.com>
2485 A fix for bug #448560
2486 * expression.cs (As): Box any generic type arguments to be
2489 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2491 Add tripwire for implicit conversion bugs
2492 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
2494 (MethodGroupExpr.OverloadResolve): Add sanity check between
2495 IsApplicable and VerifyArgumentsCompat.
2496 (VerifyArgumentsCompat): Report CS1501 where appropriate.
2498 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2500 Fix build break in System.Data_test
2501 * convert.cs (ImplicitConversionExists): Move NullLiteral
2503 (ImplicitStandardConversionExists): ... here.
2505 2008-11-28 Marek Safar <marek.safar@gmail.com>
2507 * literal.cs: Emit correctly explicit null to nullable cast.
2509 2008-11-28 Marek Safar <marek.safar@gmail.com>
2511 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
2514 2008-11-28 Marek Safar <marek.safar@gmail.com>
2516 A fix for bug #449005
2517 * convert.cs, nullable.cs: Use only one implicit nullable
2520 2008-11-27 Marek Safar <marek.safar@gmail.com>
2522 * convert.cs, literal.cs: More Convert cleanup is needed.
2524 2008-11-27 Marek Safar <marek.safar@gmail.com>
2526 * decl.cs, class.cs: Fixed misleading error message.
2528 2008-11-26 Marek Safar <marek.safar@gmail.com>
2530 A fix for bug #449005
2531 * nullable.cs (EmitEquality): Disable optimization for user operator
2534 2008-11-25 Marek Safar <marek.safar@gmail.com>
2536 A fix for bug #447027
2537 * anonymous.cs (HoistedVariable): Cache also outer access to deal
2538 with context variables stored as expression instances.
2540 2008-11-25 Marek Safar <marek.safar@gmail.com>
2542 A fix for bug #447027
2543 * delegate.cs: Fixed delegate VerifyMethod logic.
2545 2008-11-24 Marek Safar <marek.safar@gmail.com>
2547 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
2550 2008-11-21 Marek Safar <marek.safar@gmail.com>
2552 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
2553 member type resolve to follow normal flow, instead of random
2556 2008-11-21 Marek Safar <marek.safar@gmail.com>
2558 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
2561 2008-11-21 Marek Safar <marek.safar@gmail.com>
2563 * const.cs: Emit decimal array constant as literal.
2565 2008-11-20 Marek Safar <marek.safar@gmail.com>
2567 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
2569 2008-11-19 Marek Safar <marek.safar@gmail.com>
2571 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
2572 into real property (saves 8 MB for corlib compilation).
2574 2008-11-19 Marek Safar <marek.safar@gmail.com>
2576 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
2577 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
2578 generic-mcs.cs: Small cleanup of TypeArguments.
2580 2008-11-18 Marek Safar <marek.safar@gmail.com>
2582 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
2583 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
2584 of ConstructedType expression, renamed to GenericTypeExpr.
2586 2008-11-17 Marek Safar <marek.safar@gmail.com>
2588 A fix for bug #445303
2589 * location.cs (IsConditionalDefined): Handle undefined global
2592 2008-11-17 Marek Safar <marek.safar@gmail.com>
2594 A fix for bug #444678
2595 * expression.cs (TryReduceConstant): Always create new constant
2598 2008-11-17 Marek Safar <marek.safar@gmail.com>
2600 A fix for bug #444673
2601 * ecore.cs: Ignore open generic types when used as generic type
2604 2008-11-17 Marek Safar <marek.safar@gmail.com>
2606 A fix for bug #445458
2607 * expression.cs, cs-parser.jay: Don't crash when an expression
2610 2008-11-17 Marek Safar <marek.safar@gmail.com>
2612 A fix for bug #445464
2613 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
2614 inside unbound type.
2616 2008-11-14 Jb Evain <jbevain@novell.com>
2618 * driver.cs: ignore empty -nowarn argument such as
2619 the one in -nowarn:12,13,,.
2621 2008-11-13 Marek Safar <marek.safar@gmail.com>
2623 A fix for bug #444271
2624 * anonymous.cs: Rescan parent storeys when best candidate was
2627 2008-11-13 Marek Safar <marek.safar@gmail.com>
2629 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
2630 useless UnboundTypeExpression.
2632 * attribute.cs: Do check obsolete attribute on generic types.
2634 2008-11-12 Marek Safar <marek.safar@gmail.com>
2636 A fix for bugs #425680, #400139
2637 * ecore.cs, expression.cs: Trying to do some almost_matched_members
2640 2008-11-11 Marek Safar <marek.safar@gmail.com>
2642 A fix for bug #435747
2643 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
2644 compound value types assignment. Few micro optimizations added.
2646 2008-11-10 Marek Safar <marek.safar@gmail.com>
2648 A fix for bug #442610
2649 * anonymous.cs (MutateConstructor): More SRE hacking.
2651 2008-11-10 Marek Safar <marek.safar@gmail.com>
2653 A fix for bug #442579
2654 * ecore.cs: Also initialize expanded form of a method with 1 params
2657 2008-11-06 Marek Safar <marek.safar@gmail.com>
2659 * expression.cs (UnaryMutator): Do early l-side check.
2661 2008-11-05 Miguel de Icaza <miguel@novell.com>
2663 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
2664 Init, otherwise we would crash later on when checking for friend
2667 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
2668 Otherwise we never get any meaningful information as to what
2671 2008-11-05 Marek Safar <marek.safar@gmail.com>
2673 A fix for bug #436318
2674 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
2676 2008-11-05 Miguel de Icaza <miguel@novell.com>
2678 * namespace.cs: Turns out that it was a really bad idea to hide
2679 the errors for namespaces not found here in eval mode.
2681 * eval.cs: When we process using clauses, only enter those into
2682 the list of valid using clauses after they have been validated.
2684 The above change gives the proper semantics: it does not
2685 senselessly report the same errors with broken using statements by
2686 never storing them in the first place when they are invalid.
2688 2008-11-05 Marek Safar <marek.safar@gmail.com>
2690 A fix for bug #421839
2691 * cs-parser.jay: Remove expression from coalesce rule to force lower
2692 priority than the assignment operator.
2694 2008-11-05 Marek Safar <marek.safar@gmail.com>
2696 A fix for bug #437875
2697 * nullable.cs: Compile correctly method group operand used with null
2698 coalescing operator.
2700 2008-11-04 Marek Safar <marek.safar@gmail.com>
2702 A fix for bug #434589
2703 * expression.cs (Binary): Ignore lifted conversions when at least
2704 one operand is of reference type.
2706 2008-11-04 Marek Safar <marek.safar@gmail.com>
2708 * cs-parser.jay: Better syntax error report.
2710 2008-11-03 Marek Safar <marek.safar@gmail.com>
2712 A fix for bug #436792
2713 * cs-parser.jay: Use GetLocation to access location.
2715 2008-11-03 Marek Safar <marek.safar@gmail.com>
2717 A fix for bug #440774
2718 * cs-parser.jay: Also set current_array_type when parsing local
2721 2008-11-03 Marek Safar <marek.safar@gmail.com>
2723 A fix for bug #440785
2724 * expression.cs (As): Don't resolve self modifing expression
2727 2008-11-03 Marek Safar <marek.safar@gmail.com>
2729 A fix for bug #439447
2730 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
2732 2008-11-03 Marek Safar <marek.safar@gmail.com>
2734 A fix for bug #437571
2735 * cs-parser.jay: Fixes internal error for invalid expression
2738 2008-10-17 Marek Safar <marek.safar@gmail.com>
2740 * ecore.cs: Resolve correctly ambiguous params delegate methods.
2742 2008-10-17 Marek Safar <marek.safar@gmail.com>
2744 * generic.cs, anonymous.cs: Simplified GetDeclarations.
2746 2008-10-17 Marek Safar <marek.safar@gmail.com>
2748 * cs-tokenizer.cs: More precise cast parsing.
2750 2008-10-16 Martin Baulig <martin@ximian.com>
2752 * anonymous.cs (AnonymousMethodStorey): Put back the
2753 `hoisted_locals' hashtable and use it in EmitType().
2755 2008-10-15 Marek Safar <marek.safar@gmail.com>
2757 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
2758 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
2761 2008-10-14 Marek Safar <marek.safar@gmail.com>
2763 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
2765 2008-10-14 Marek Safar <marek.safar@gmail.com>
2767 * statement.cs: Mutate scope initializers.
2769 2008-10-14 Marek Safar <marek.safar@gmail.com>
2771 * expression.cs: Use typeless value for This constant.
2773 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
2775 2008-10-14 Marek Safar <marek.safar@gmail.com>
2777 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
2780 2008-10-13 Marek Safar <marek.safar@gmail.com>
2782 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
2785 2008-10-13 Marek Safar <marek.safar@gmail.com>
2787 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
2788 parser and tokenizer. Fixes many ambiguities including #433258.
2790 2008-10-10 Marek Safar <marek.safar@gmail.com>
2792 * cs-parser.jay: Fixed missing accessor recovery.
2794 2008-10-10 Marek Safar <marek.safar@gmail.com>
2796 A fix for bug #433701
2797 * expression.cs: Better error message.
2799 2008-10-10 Marek Safar <marek.safar@gmail.com>
2801 * cs-parser.jay, expression.cs: Start reporting real parser errors.
2803 * Makefile: Disabled unused debug symbols.
2805 Also fixes: #320556, #321097, #321656, #321876, #351316
2807 2008-10-09 Miguel de Icaza <miguel@novell.com>
2809 * eval.cs: rename "<interactive>" to "{interactive}", to work
2810 around a requirement in the compiler that this be a valid
2811 filename, and in Windows it is not (433886).
2813 2008-10-09 Marek Safar <marek.safar@gmail.com>
2815 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
2817 2008-10-08 Marek Safar <marek.safar@gmail.com>
2819 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
2820 cs-parser.jay: Generic type declaration and type arguments cleanup.
2822 2008-10-05 Marek Safar <marek.safar@gmail.com>
2824 * cs-parser.jay: Allow parsing weird array creation construct.
2826 2008-10-05 Marek Safar <marek.safar@gmail.com>
2828 * cs-parser.jay: Conflicts reduction.
2830 2008-10-04 Marek Safar <marek.safar@gmail.com>
2832 * cs-parser.jay: Conflicts reduction.
2834 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
2837 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
2838 property. Add a 'count' hint about the use of the shared vector.
2839 Ensure that we don't leak out dirty bits.
2840 (UsageVector.MergeChild): Throw away information about variables
2842 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
2844 2008-10-03 Marek Safar <marek.safar@gmail.com>
2846 A fix for bug #431746
2847 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
2848 parameters when iterator is created.
2850 2008-10-03 Marek Safar <marek.safar@gmail.com>
2852 A fix for bug #431827
2853 * expression.cs: Fixed right based pointer arithmetic operations
2856 2008-10-03 Marek Safar <marek.safar@gmail.com>
2858 A fix for bug #353779
2859 * assign.cs, expression.cs: Fixed compound assignment conversions.
2861 2008-10-02 Marek Safar <marek.safar@gmail.com>
2863 A fix for bug #375262
2864 * statement.cs: Refactor ArrayForeach to be usable with string
2865 indexer. Optimized single dimentional arrays foreach.
2867 2008-10-02 Marek Safar <marek.safar@gmail.com>
2869 A fix for bug #431255
2870 * anonymous.cs, expression.cs: Removed broken optimization.
2872 2008-10-01 Marek Safar <marek.safar@gmail.com>
2874 * anonymous.cs: Use full type parameters of parent generic
2875 containers. Removed unnecessary AddParentStoreyReference call.
2877 2008-10-01 Marek Safar <marek.safar@gmail.com>
2879 A fix for bug #324702
2880 * class.cs: Use better shorter names for explicit interface member
2883 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
2885 2008-10-01 Marek Safar <marek.safar@gmail.com>
2887 * expression.cs: Use new interface to check fixed expression.
2889 2008-10-01 Marek Safar <marek.safar@gmail.com>
2891 A fix for bug #421101
2892 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
2893 interface to check for fixed fixed-buffers.
2895 2008-10-01 Marek Safar <marek.safar@gmail.com>
2897 A fix for bug #429264
2898 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
2900 * delegate.cs: Removed unnecessary casts.
2902 2008-09-30 Marek Safar <marek.safar@gmail.com>
2904 A fix for bug #352151
2905 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
2906 class.cs: Fixed already defined explicit interface members check.
2908 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
2910 cs-tokenizer.cs: Fix typo.
2912 2008-09-28 Miguel de Icaza <miguel@novell.com>
2914 * eval.cs (InteractiveBase): The quit command now just sets a
2915 flag, instead of calling Environment.Exit(), it is milder on
2918 CompiledMethod is now in Mono.CSharp, not nested inside
2919 the Evaluator, it was inconvenient to use.
2921 2008-09-27 Miguel de Icaza <miguel@novell.com>
2923 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
2924 code to be invoked without having to reparse.
2926 2008-09-27 Miguel de Icaza <miguel@novell.com>
2928 * ecore.cs: The recent changes to FieldExpr broke this as well.
2929 Fixes LINQ queries in the interactive shell.
2931 * Multiple files: indentation fixing for the Mono coding
2932 guidelines for the switch statement.
2934 * eval.cs: Make the Evaluator API thread safe.
2936 2008-09-26 Marek Safar <marek.safar@gmail.com>
2938 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
2939 constructor parsing.
2941 2008-09-26 Marek Safar <marek.safar@gmail.com>
2943 A fix for bug #325326
2944 * statement.cs: Check possible mistaken empty statement using
2945 explicit blocks only.
2947 2008-09-25 Miguel de Icaza <miguel@novell.com>
2949 * eval.cs (LoadAssembly, ReferenceAssembly): Call
2950 RootNamespace.ComputeNamespaces to update the internal list of
2951 namespaces, this is no longer done for us.
2953 (InteractiveBase): Use the Evaluator APIs instead of calling into
2956 2008-09-25 Marek Safar <marek.safar@gmail.com>
2958 A fix for bug #429264
2959 * expression.cs: Missing mutator for access to multidimensional
2962 2008-09-25 Marek Safar <marek.safar@gmail.com>
2964 * class.cs, statement: Emit DebuggerHidden attribute for iterator
2967 * driver.cs: Missing input argument check.
2969 2008-09-25 Marek Safar <marek.safar@gmail.com>
2971 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
2972 expression.cs, statement.cs, rootcontext.cs, class.cs,
2973 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
2976 2008-09-24 Miguel de Icaza <miguel@novell.com>
2978 * ecore.cs (FieldExpr): Only initialize eclass when we return a
2979 fully constructed FieldExpr, fixes the regression introduced in
2982 * ecore.cs, expression.cs: Plug back the eclass initialization as
2983 otherwise it regresses `csharp'.
2985 2008-09-24 Marek Safar <marek.safar@gmail.com>
2987 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
2988 ecore.cs, attribute.cs: Moved obsolete method checks from emit
2989 phase to resolve phase. It resolves problems with expression trees
2990 and fixes bugs #323796, #325156.
2992 2008-09-23 Marek Safar <marek.safar@gmail.com>
2994 * codegen.cs: Report better error when symbol writer is missing.
2996 2008-09-23 Marek Safar <marek.safar@gmail.com>
2998 * codegen.cs: Set .NET symbol writer.
3000 * decl.cs: Guard against null generic arguments.
3002 * report.cs: Don't report exactly same additional details.
3004 2008-09-22 Marek Safar <marek.safar@gmail.com>
3006 A fix for bug #324917
3007 * cs-parser.jay: Add missing multidimensional non-expression type
3010 2008-09-22 Marek Safar <marek.safar@gmail.com>
3012 A fix for bug #428191
3013 * anonymous.cs: Create an outer generic fields also for non-storey
3016 2008-09-22 Marek Safar <marek.safar@gmail.com>
3018 A fix for bug #378294
3019 * class.cs: Make fixed size buffers gmcs feature only.
3021 2008-09-22 Marek Safar <marek.safar@gmail.com>
3023 A fix for bug #355622, #324993
3024 * assign.cs, const.cs, class.cs: Create new EmitContext for each
3027 2008-09-19 Marek Safar <marek.safar@gmail.com>
3029 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
3032 2008-09-19 Marek Safar <marek.safar@gmail.com>
3034 A fix for bug #416110
3035 * generic.cs: Struct constraint results in default ctor and
3036 ValueType base type constraint to be set.
3038 2008-09-19 Marek Safar <marek.safar@gmail.com>
3040 A fix for bug #423791
3041 * generic.cs: Fixed params output type type-inference.
3043 2008-09-19 Marek Safar <marek.safar@gmail.com>
3045 * cs-parser.jay, expression.cs: Fixed few expression crashes.
3047 2008-09-19 Marek Safar <marek.safar@gmail.com>
3049 * cs-tokenizer.cs: Don't break on extra partial modifier.
3051 2008-09-19 Marek Safar <marek.safar@gmail.com>
3053 A fix for bug #427592
3054 * generic.cs: Use common parameter resolve method.
3056 2008-09-18 Marek Safar <marek.safar@gmail.com>
3058 A fix for bug #414758
3059 * expression.cs, ecore.cs: Fixed crash when accessing non-static
3062 2008-09-18 Marek Safar <marek.safar@gmail.com>
3064 * driver.cs, namespace.cs: Read types and namespaces after all
3065 requested assemblies are loaded, fixes issues with System.Core
3066 auto-reference, and #419888.
3068 2008-09-18 Marek Safar <marek.safar@gmail.com>
3070 A fix for bug #417705
3071 * cs-parser.jay: Fixed as/is operator expression split.
3073 2008-09-18 Marek Safar <marek.safar@gmail.com>
3075 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
3076 Fixed expression tree representation of empty new expression and
3077 new initializer expression.
3079 2008-09-18 Miguel de Icaza <miguel@novell.com>
3081 * eval.cs: Remove warning, keep reference to driver around.
3083 * Hide fields that do not need to be public.
3085 2008-09-17 Marek Safar <marek.safar@gmail.com>
3087 A fix for bug #426385
3088 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
3089 conversion for array elements.
3091 2008-09-17 Marek Safar <marek.safar@gmail.com>
3093 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
3094 void parsing conflicts.
3096 2008-09-15 Marek Safar <marek.safar@gmail.com>
3098 A fix for bug #425601
3099 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
3100 System.Core only when there is no custom ExtensionAttribute
3103 2008-09-15 Miguel de Icaza <miguel@novell.com>
3105 * namespace.cs: Do not report CS0246 (name
3107 2008-09-12 Marek Safar <marek.safar@gmail.com>
3109 A fix for bug #425669
3110 * generic.cs: Don't cache generic static anonymous method
3113 2008-09-12 Marek Safar <marek.safar@gmail.com>
3115 * generic.cs, class.cs, delegate.cs: Check recursive inherited
3116 conflicting constraints.
3118 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
3120 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
3123 2008-09-12 Marek Safar <marek.safar@gmail.com>
3125 * literal.cs, convert.cs, expression.cs, statement.cs: More null
3126 to null pointer conversion fixes.
3128 2008-09-11 Marek Safar <marek.safar@gmail.com>
3130 * cs-parser.jay, expression.cs: An implicitly typed local variable
3131 declarator cannot use an array initializer.
3133 2008-09-11 Marek Safar <marek.safar@gmail.com>
3135 * cs-parser.jay: Reduced number of printed tokens, add sorting.
3137 2008-09-11 Marek Safar <marek.safar@gmail.com>
3139 * generic.cs (InflatedConstraints): Don't crash when constraints
3142 * cs-parser.jay: const_declarator is a block.
3144 * constant.cs: Check for not allowed NaN conversions.
3146 2008-09-10 Miguel de Icaza <miguel@novell.com>
3148 * driver.cs: Drop --shell argument, the compiler is no longer a
3151 * eval.cs: Move most of the code that deals with evaluation into
3152 this file and document the public API from repl.cs
3154 * repl.cs: Remove from here.
3156 2008-09-10 Marek Safar <marek.safar@gmail.com>
3158 A fix for bug #424684
3159 * generic.cs: Generic class constraints must come first.
3161 2008-09-09 Miguel de Icaza <miguel@novell.com>
3163 * cs-parser.jay: Improve error reporting for syntax errors in
3164 statements and expressions, we now report the expected tokens
3165 instead of reporting the useless "; expected".
3167 Drop the strings from the token declaration, it turns out that
3168 they did not do what I thought they did. Instead they were adding
3169 two sets of tokens to the tables.
3171 2008-09-09 Marek Safar <marek.safar@gmail.com>
3173 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
3174 delegate.cs: Share special type check.
3176 2008-09-09 Marek Safar <marek.safar@gmail.com>
3178 A fix for bug #423981
3179 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
3181 2008-09-09 Marek Safar <marek.safar@gmail.com>
3183 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
3186 2008-09-09 Marek Safar <marek.safar@gmail.com>
3188 A fix for bugs: #324750, #335946
3189 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
3190 lookup rule to determine ?-based tokens.
3192 2008-09-08 Miguel de Icaza <miguel@novell.com>
3194 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
3195 expressions (like event adding or removing) end up here, so we
3196 need to treat those as statements.
3198 Add LoadAssembly method.
3200 2008-09-04 Miguel de Icaza <miguel@novell.com>
3202 * repl.cs: Add Time method.
3204 2008-09-05 Marek Safar <marek.safar@gmail.com>
3206 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
3208 2008-09-05 Miguel de Icaza <miguel@novell.com>
3210 * repl.cs: Add workaround for old compilers.
3212 2008-09-04 Jb Evain <jbevain@novell.com>
3214 * repl.cs (PrettyPrint): pretty print everything that
3215 implements IDictionary, as well as IEnumerables. Also,
3216 add a quit helper property.
3218 2008-09-04 Marek Safar <marek.safar@gmail.com>
3220 * constant.cs: Better error reporting for decimal literals.
3222 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
3225 2008-09-04 Marek Safar <marek.safar@gmail.com>
3226 Miguel de Icaza <miguel@novell.com>
3228 A fix for bug #422951
3229 * assign.cs (Assign.DoResolve): Perform the type conversions
3230 checks before we attempt to initialize `New' initializers.
3232 2008-09-04 Marek Safar <marek.safar@gmail.com>
3234 A fix for bug #422853
3235 * delegate.cs (DelegateCreation): Add special handling for
3236 EmptyExpression.Null instance expression which is just another
3237 hack for undecided member instance exression.
3239 2008-09-04 Marek Safar <marek.safar@gmail.com>
3241 * expression.cs, ecore.cs: Emit full expression tree for reduced
3244 2008-09-04 Marek Safar <marek.safar@gmail.com>
3246 * expression.cs (This): Guard against multi-resolving.
3248 * ecore.cs, statement.cs (Throw): Simplified.
3250 * flowanalysis.cs: Also verify event fields.
3252 2008-09-04 Miguel de Icaza <miguel@novell.com>
3254 * assign.cs (Assign.DoResolve): Perform the type conversions
3255 checks before we attempt to initialize `New' initializers.
3257 * repl.cs (PrettyPrint): Add Hashtable prettyprint
3259 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
3262 * repl.cs: Update help.
3264 2008-09-03 Miguel de Icaza <miguel@novell.com>
3266 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
3267 handling of the default config handling, including the special
3268 treatment of System.Core assembly.
3270 Fixes the REPL processing for LINQ.
3272 2008-09-03 Marek Safar <marek.safar@gmail.com>
3274 A fix for bug #422507
3275 * expression.cs (UnboxCast): Add missing child expression mutator.
3277 2008-09-03 Marek Safar <marek.safar@gmail.com>
3279 * driver.cs: Don't self reference System.Core assembly.
3281 2008-09-03 Marek Safar <marek.safar@gmail.com>
3283 A fix for bug #422507
3284 * expression.cs (StringConcat): Add missing type mutator.
3286 2008-09-03 Marek Safar <marek.safar@gmail.com>
3288 * generic.cs (TypeInferenceContext): Follow equality rule for
3289 constructed type lower bound type inference.
3291 2008-09-02 Miguel de Icaza <miguel@novell.com>
3293 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
3294 <dblank@cs.brynmawr.edu> which updates the cursor position on
3297 2008-09-02 Marek Safar <marek.safar@gmail.com>
3299 A fix for bug #367145
3300 * driver.cs: Fixed import of extension methods when using -noconfig
3303 2008-09-02 Marek Safar <marek.safar@gmail.com>
3305 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
3306 version from non-generic implementation instead.
3308 2008-09-01 Marek Safar <marek.safar@gmail.com>
3310 A fix for bug #418908
3311 * class.cs: Use AddScopeStatement for field initializers.
3313 2008-09-01 Marek Safar <marek.safar@gmail.com>
3315 A fix for bug #415385
3316 * ecore.cs, convert.cs: Do method group conversion for equal group types.
3318 2008-09-01 Marek Safar <marek.safar@gmail.com>
3320 A fix for bug #421736
3321 * iterators.cs: Don't crash on unreachable iterators.
3323 2008-09-01 Marek Safar <marek.safar@gmail.com>
3325 A fix for bug #421628
3326 * parameter.cs, attribute.cs: Clone also parameter attributes.
3328 2008-08-30 Miguel de Icaza <miguel@novell.com>
3330 * namespace.cs (LookupType): In EvalMode, try to replace
3331 the TypeBuilder from our cache with a Type as Reflection.Emit does
3332 not like to mix code from older assemblies emitted and new
3335 This sounds like a serious Mono bug that prevents multiple
3336 assemblies to be generated and consumed at the same time.
3338 * cs-parser.jay (push_current_class): Do not make interactive
3339 classes internal or private, make them public as we currently
3340 generate each new class in a new assembly.
3342 2008-08-29 Miguel de Icaza <miguel@novell.com>
3344 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
3345 remove types that are entered into the global namespace during
3346 parsing so that we can remove them on failure.
3348 * cs-parser.jay: Parsing: we now keep track of types that are
3349 entered into global variables and queue those in case the parsing
3352 This happens in a few situations: during partial-input, we invoke
3353 the parser repeatedly for example with the string "class X", this
3354 would cause X to be registed, and we need to remove this
3355 registration so that another parse attempt later with say "class X {"
3356 would actually work.
3358 Additionally, if there is an error in the resolution phase, for
3359 example: "class X : NonExistant {}" th
3361 * cs-parser.jay: Be more precise with the errors being raised,
3362 instead of flagging all exceptions during parsing to be attributed
3363 to the parsing process, distinguish those from errors happening in
3364 the actions and hint that using -v would produce the actual
3367 * repl.cs: Do not load all compiler references on each reset,
3368 doing the partial reset takes care of this.
3370 2008-08-28 Miguel de Icaza <miguel@novell.com>
3372 * repl.cs: Add support for loading all the files from
3373 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
3376 Introduce a micro-parser that is able to deambiguate on its input
3377 whether we are dealing with a compilation unit (namespace, class,
3378 interface, struct, delegate) declaration or a statement. This
3379 allows both declarations and statements to be entered.
3381 Set history size by default to 300 lines.
3383 Instead of distinguishing based on the parser.InteractiveResult,
3384 have only two cases: statements were parsed, or a compilation unit
3385 was. Always pull the Using statement additions from the
3386 compilation unit parse.
3388 * cs-tokenizer.cs: Rename tokens to better describe their intent
3389 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
3391 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
3392 EvalMode is used to trigger the lookup of global variables while
3393 StatementMode is used turn variable declarations into static
3396 * getline.cs: Allow history size to be set.
3398 2008-08-29 Marek Safar <marek.safar@gmail.com>
3400 A fix for bug #360755
3401 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
3403 2008-08-29 Marek Safar <marek.safar@gmail.com>
3405 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
3407 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
3408 member name, it is too confusing
3410 * decl.cs, class.cs: Don't report unused fields with attached attribute.
3412 * rootcontext.cs: Finally default to warning level 4.
3414 2008-08-28 Marek Safar <marek.safar@gmail.com>
3416 * class.cs (CheckBase): Ignore overloaded operators.
3418 2008-08-28 Marek Safar <marek.safar@gmail.com>
3420 A fix for bug #420830
3421 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
3423 2008-08-28 Marek Safar <marek.safar@gmail.com>
3425 A fix for bug #420832
3426 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
3428 2008-08-28 Marek Safar <marek.safar@gmail.com>
3430 A fix for bug #420386
3431 * nullables.cs: Fixed logic of nullable user comparison operators involving
3434 2008-08-28 Marek Safar <marek.safar@gmail.com>
3436 * attribute (IsClsCompliant): Use FALSE value for pointer types.
3438 2008-08-27 Miguel de Icaza <miguel@novell.com>
3440 * repl.cs: Add support for aborting the running code with C-c.
3442 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
3444 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
3446 2008-08-27 Miguel de Icaza <miguel@novell.com>
3448 * cs-parser.jay (interactive_statement_list): A new set of rules
3449 for hosting statements that uses the "interactive_" prefix.
3451 * repl.cs: Add support for parsing `using' as a statement or as a
3452 directive. Deambiguating before passing this to the parser.
3454 We need to distinguish statement_expressions that occur at the
3455 toplevel vs those that occur embedded into expressions.
3457 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
3458 that fixes the cursor key handling, and a history bug.
3460 2008-08-26 Miguel de Icaza <miguel@novell.com>
3462 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
3463 limitations in Console, instead the 2.0 bootstrap libraries now
3464 include the Console bits.
3466 Also, remove the use of Nullables from getline.cs
3470 Interactive support for the C# compiler. Use gmcs --shell to
3471 enter a read-eval-print loop shell.
3473 Docs: http://www.mono-project.com/CsharpRepl
3475 * sources: include repl.cs here and getline.cs for gmcs.exe,
3476 everything else is getline.cs impaired.
3478 * Makefile: when bootstrapping pass a special flag
3479 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
3480 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
3481 This distinguishes those two cases.
3483 * repl.cs: Support for a read-eval-print loop. Will be soon
3484 refactored into eval support and then REPL on top of it.
3486 * ecore.cs: If a simplename lookup fails, before erroring out,
3487 if we are in EvalMode to resolve the name to a declaration in the
3490 This means that variable declarations that happened in previous
3491 classes (as repl puts every statement in a separate class) are
3492 made visible in this way.
3494 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
3495 triggered an error due to the end of file being reached. This is
3496 used to do multi-line input, and notify the caller that the user
3497 needs to provide more text before a successful parse.
3499 Add new grammar rules after the INTERACTIVE_PARSER token is seen
3500 to drive the evaluation with a custom wrapper.
3502 * driver.cs: Add support for --shell, and refactor some code to be
3505 * namespace.cs: Add support for serializing the contents of the
3506 namespaces and reloading them.
3508 * getline.cs: A managed implementation of ReadLine under
3509 X11/Apache2 license terms. Easy to embed in other applications as
3512 * namespace.cs: Add some functions to save and restore the
3515 * rootcontext.cs: New public field.
3517 * cs-tokenizer.cs: Add support for one of the possible characters
3518 we introduce into the token stream.
3520 This patch does not affect the regular tokenization process, the
3521 only performance hit would happen if there is an invalid character
3522 on the input string.
3524 * support.cs: Move isatty helper routine here.
3526 * codegen.cs: Small cleanup, and add a mechanism to initialize the
3527 code generator for in-memory assemblies.
3529 2008-08-26 Marek Safar <marek.safar@gmail.com>
3531 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
3532 parameter cannot be always used as a type.
3534 2008-08-21 Marek Safar <marek.safar@gmail.com>
3536 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
3538 2008-08-21 Marek Safar <marek.safar@gmail.com>
3540 * convert.cs: Implement explicit array to IList<T> conversion.
3542 2008-08-20 Marek Safar <marek.safar@gmail.com>
3544 A fix for bug #362740
3545 * cs-tokenizer.cs: Handle UTF-16 surrogates.
3547 2008-08-20 Marek Safar <marek.safar@gmail.com>
3549 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
3550 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
3551 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
3552 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
3553 handling to use just one type of infrastructure and deal with generics
3556 2008-07-23 Martin Baulig <martin@ximian.com>
3558 *** Merged this from trunk revision 108527 ***
3561 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
3562 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
3565 2008-08-15 Marek Safar <marek.safar@gmail.com>
3567 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
3570 2008-08-15 Marek Safar <marek.safar@gmail.com>
3572 * delegate.cs: Fixed compiler crash when creating delegate using partial
3575 * typemanager.cs: MulticastDelegate is not a delegate.
3577 2008-08-14 Marek Safar <marek.safar@gmail.com>
3579 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
3582 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
3584 * cs-parser.jay (type): Allow 'var' in mcs too.
3585 (local_variable_type): Likewise.
3587 2008-08-14 Marek Safar <marek.safar@gmail.com>
3589 * driver.cs: Removed broken -noconfig variants.
3591 2008-08-14 Marek Safar <marek.safar@gmail.com>
3593 A fix for bug #417078
3594 * expression.cs: Emit correctly left side pointer operators.
3596 2008-08-13 Marek Safar <marek.safar@gmail.com>
3598 * generic.cs, lambda.cs: Inflate method generic arguments only.
3600 2008-08-12 Marek Safar <marek.safar@gmail.com>
3602 * class.cs: Fixed struct layout check regression.
3604 2008-08-12 Marek Safar <marek.safar@gmail.com>
3606 * cs-parser.jay, enum.cs: Simplified enum parsing.
3608 * decl.cs: Check all type parameters conflicts.
3610 * expression.cs, statement.cs, attribute.cs: More expression checks.
3612 2008-08-11 Marek Safar <marek.safar@gmail.com>
3614 * generic.cs: Add type inference types restriction.
3616 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
3617 anonymous.cs, expression.cs: Allocate less accessor parameters.
3619 2008-08-08 Marek Safar <marek.safar@gmail.com>
3621 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
3624 2008-08-08 Marek Safar <marek.safar@gmail.com>
3626 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
3628 2008-08-07 Marek Safar <marek.safar@gmail.com>
3630 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
3631 Also fixes #362146 and #381592.
3633 2008-08-07 Marek Safar <marek.safar@gmail.com>
3635 * ecore.cs: Reduced constant cannot be used as an attribute value.
3637 * cs-parser.jay: Base expression has to be a type.
3639 * expression.cs (Conditional): Uses ReducedExpression.
3641 2008-08-06 Marek Safar <marek.safar@gmail.com>
3643 A fix for bug #376826
3644 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
3645 address of hoisted local variable or parameter cannot be taken.
3647 2008-08-05 Marek Safar <marek.safar@gmail.com>
3649 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
3650 anonymous method inside checked/unchecked expression.
3652 2008-08-05 Marek Safar <marek.safar@gmail.com>
3654 * typemanager.cs (IsEqual): Guard against null.
3656 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
3657 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
3658 routine. Fixed few misleading conversion errors.
3660 2008-08-04 Marek Safar <marek.safar@gmail.com>
3662 * class.cs: Consider generics when checking cycles in struct layout.
3664 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
3666 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
3668 2008-08-04 Marek Safar <marek.safar@gmail.com>
3670 A fix for bug #414165
3671 * anonymous.cs: Use same anonymous implementation method for all anonymous
3674 2008-08-04 Marek Safar <marek.safar@gmail.com>
3676 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
3679 2008-08-04 Marek Safar <marek.safar@gmail.com>
3681 * cs-parser.jay: Typeof argument has to be a type expression.
3683 * namespace.cs: Check alias and namespace definitions collisions.
3685 * class.cs, pending.cs: Moved explicit interface accessor implementation
3688 * delegate.cs, expression.cs: Verify special name invocations.
3690 2008-08-01 Marek Safar <marek.safar@gmail.com>
3692 * cs-parser.jay: Don't choke on empty generic type arguments.
3694 * cs-tokenizer.cs: Handle escaped preprocessor directives.
3696 * expression.cs, ecore.cs: Minor expressions bugs.
3698 2008-08-01 Marek Safar <marek.safar@gmail.com>
3700 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
3701 and added more error handling.
3703 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
3705 * modifiers.cs, enum.cs: Fixed.
3707 2008-07-31 Jb Evain <jbevain@novell.com>
3709 * driver.cs: remove -pkg ability of smcs.
3711 2008-07-30 Marek Safar <marek.safar@gmail.com>
3713 * statement.cs (Switch): Correctly set empty default target for single
3716 2008-07-30 Marek Safar <marek.safar@gmail.com>
3718 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
3719 string switch statement implementation to use string dictionary which
3720 significantly (2-8x) improves performance of generated code.
3722 2008-07-29 Marek Safar <marek.safar@gmail.com>
3724 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
3725 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
3727 2008-07-29 Marek Safar <marek.safar@gmail.com>
3729 A fix for bug #412595
3730 * typemanager.cs, convert.cs, expression.cs: Some types are never
3731 convertible to each other.
3733 2008-07-29 Marek Safar <marek.safar@gmail.com>
3735 * nullable.cs (CreateNullConstant): An error messages update.
3737 2008-07-29 Marek Safar <marek.safar@gmail.com>
3739 A fix for bug #412595
3740 * cfold.cs: Don't cast undefined bool constant.
3742 2008-07-29 Martin Baulig <martin@ximian.com>
3745 (SymbolWriter.Reset): New public static method.
3748 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
3750 2008-07-28 Marek Safar <marek.safar@gmail.com>
3752 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
3754 * expression.cs (ElementAccess): Exact size allocation.
3756 2008-07-26 Marek Safar <marek.safar@gmail.com>
3758 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
3760 2008-07-25 Marek Safar <marek.safar@gmail.com>
3762 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
3764 * class.cs: Removed $PRIVATE$ field hack which caused problems during
3767 2008-07-25 Marek Safar <marek.safar@gmail.com>
3769 A fix for bug #412217
3770 * assign.cs: Mutate also assignment type.
3772 2008-07-25 Marek Safar <marek.safar@gmail.com>
3774 A fix for bug #323644
3775 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
3778 2008-07-25 Marek Safar <marek.safar@gmail.com>
3780 A fix for bug #412134
3781 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
3782 non-enumerable operands when overloading equality or bitwise operators.
3784 2008-07-25 Marek Safar <marek.safar@gmail.com>
3786 * anonymous.cs: Cache closed generic anonymous method delegates.
3788 2008-07-24 Marek Safar <marek.safar@gmail.com>
3790 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
3791 anonymous.cs, statement.cs: Always emit anonymous method as static method
3792 when is instance free. Use nesting for nested anynomous methods blocks.
3794 2008-07-23 Marek Safar <marek.safar@gmail.com>
3796 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
3799 2008-07-23 Marek Safar <marek.safar@gmail.com>
3801 * expression.cs: Removed MakeSimpleCall.
3803 2008-07-23 Marek Safar <marek.safar@gmail.com>
3805 A fix for bug #323012
3806 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
3807 Base method implementing interface has to be public.
3809 2008-07-23 Marek Safar <marek.safar@gmail.com>
3811 * cs-parser.jay: Don't break on missing argument.
3813 2008-07-22 Marek Safar <marek.safar@gmail.com>
3815 A fix for bug #320993
3816 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
3817 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
3819 2008-07-22 Marek Safar <marek.safar@gmail.com>
3821 A fix for bug #320748
3822 * convert.cs: Implicit user operators cannot convert to interfaces
3824 2008-07-22 Marek Safar <marek.safar@gmail.com>
3826 A fix for bug #312686
3827 * driver.cs: Ignore empty assembly references.
3829 2008-07-22 Marek Safar <marek.safar@gmail.com>
3831 A fix for bug #387040
3832 * ecore.cs: Skip constrains check for an explicit implementation.
3834 2008-07-21 Marek Safar <marek.safar@gmail.com>
3836 A fix for bug #409045
3837 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
3838 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
3839 identifiers are file specific unless passed as input arguments.
3841 2008-07-21 Marek Safar <marek.safar@gmail.com>
3843 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
3844 to emit UnmanagedMarshal data under 2.0 profile.
3846 2008-07-21 Marek Safar <marek.safar@gmail.com>
3848 A fix for bug #410369
3849 * parameter.cs: Clone correctly ParamsParameter.
3851 2008-07-21 Marek Safar <marek.safar@gmail.com>
3853 * expression.cs (Argument): Always report type for type based expressions
3856 2008-07-18 Marek Safar <marek.safar@gmail.com>
3858 A fix for bug #410666
3859 * anonymous.cs: Correctly initialize generic storey reference.
3861 2008-07-18 Marek Safar <marek.safar@gmail.com>
3863 * convert.cs: Don't box same type arguments.
3865 2008-07-18 Marek Safar <marek.safar@gmail.com>
3867 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
3868 Finished missing generic type mutators.
3870 2008-07-18 Marek Safar <marek.safar@gmail.com>
3872 * iterators.cs, statement.cs: Finished statements CloneTo.
3874 2008-07-18 Marek Safar <marek.safar@gmail.com>
3876 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
3878 * expression.cs: Emit optimized default value expressions in expression tree
3881 2008-07-18 Marek Safar <marek.safar@gmail.com>
3883 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
3885 2008-07-17 Marek Safar <marek.safar@gmail.com>
3887 A fix for bug #367536
3888 * cs-parser.jay: Check static constructor of generic types for an access
3891 2008-07-17 Marek Safar <marek.safar@gmail.com>
3893 A fix for bug #353800
3894 * lambda.cs: Emit ret for contextual statements.
3896 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
3897 up emitting redundant ret for all anonymous methods with return.
3899 2008-07-17 Marek Safar <marek.safar@gmail.com>
3901 A fix for bug #365188
3902 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
3903 create anonymous method storey in unreachable block.
3905 2008-07-17 Marek Safar <marek.safar@gmail.com>
3907 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
3908 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
3909 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
3910 statement.cs: Fixed relevant defects found by Gendarme.
3912 2008-07-17 Marek Safar <marek.safar@gmail.com>
3914 A fix for bug #325291
3915 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
3916 statement.cs: Replaced IAnonymousHost with top level block flag.
3918 2008-07-17 Marek Safar <marek.safar@gmail.com>
3920 * cs-parser.jay: Clean up unused open_parens.
3922 2008-07-17 Marek Safar <marek.safar@gmail.com>
3924 * ecore.cs: Custom error message for a range variable assignment.
3926 2008-07-16 Marek Safar <marek.safar@gmail.com>
3928 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
3931 2008-07-16 Marek Safar <marek.safar@gmail.com>
3933 * literal.cs: Null literal is of object type.
3935 2008-07-16 Marek Safar <marek.safar@gmail.com>
3937 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
3938 expression of nullable equality comparison.
3940 2008-07-15 Marek Safar <marek.safar@gmail.com>
3942 * expression.cs(PointerArithmetic): Removed redundant assignment.
3944 2008-07-15 Marek Safar <marek.safar@gmail.com>
3946 * decl.cs (GetSignatureForError): Report full namespace name for containers.
3948 2008-07-14 Marek Safar <marek.safar@gmail.com>
3950 A fix for bug #408361
3951 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
3952 they are replaced by GetMethod.
3954 2008-07-14 Marek Safar <marek.safar@gmail.com>
3956 A fix for bug #408721 by jeremie.laval@gmail.com
3957 * expression.cs (Indirection): Implemented CloneTo.
3959 2008-07-14 Marek Safar <marek.safar@gmail.com>
3961 * statement.cs (AssignableSlots): Temporary disabled variable initialization
3964 2008-07-14 Marek Safar <marek.safar@gmail.com>
3966 * report.cs (EnableReporting): Don't reinitialize 0-based values.
3968 2008-07-11 Marek Safar <marek.safar@gmail.com>
3970 * linq.cs: Reset tranparent parameter counter in probing mode.
3972 2008-07-11 Marek Safar <marek.safar@gmail.com>
3974 * anonymous.cs: Mutate anonymous method type.
3976 2008-07-11 Marek Safar <marek.safar@gmail.com>
3978 * ecore.cs, anonymous.cs: Mutate field expressions.
3980 2008-07-10 Marek Safar <marek.safar@gmail.com>
3982 A fix for bug #369670
3983 * linq.cs, statement.cs: Use explicit block for query expressions variables.
3985 2008-07-10 Marek Safar <marek.safar@gmail.com>
3987 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
3989 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
3992 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
3993 only one '>', and finds a '>>', abort the generic lookahead.
3995 2008-07-10 Marek Safar <marek.safar@gmail.com>
3997 A fix for bug #319902
3998 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
4000 2008-07-10 Marek Safar <marek.safar@gmail.com>
4002 A fix for bug #406371
4003 * statement.cs: Moved EmitSymbolInfo to Block.
4005 2008-07-09 Marek Safar <marek.safar@gmail.com>
4007 * ecore.cs: Report better error for extension method overload failures.
4009 2008-07-09 Marek Safar <marek.safar@gmail.com>
4011 * expression.cs (Is): No need to box reference values.
4013 2008-07-09 Marek Safar <marek.safar@gmail.com>
4015 * class.cs: Use event resolve context when initializing CreateEmitContext.
4017 2008-07-09 Marek Safar <marek.safar@gmail.com>
4019 A fix for bug #394436
4020 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
4021 method used inside expression trees. Added more LINQ to expression tree
4024 2008-07-08 Marek Safar <marek.safar@gmail.com>
4026 A fix for bug #378189, #370577
4027 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
4030 2008-07-08 Marek Safar <marek.safar@gmail.com>
4032 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
4035 2008-07-08 Marek Safar <marek.safar@gmail.com>
4037 A fix for bug #406702
4038 * anonymous.cs: Always park anonymous method in the nearest parent storey.
4040 2008-07-07 Marek Safar <marek.safar@gmail.com>
4042 A fix for bug #406648
4043 * cs-parser.jay: Report nullable use in mcs for some cases.
4045 2008-07-07 Marek Safar <marek.safar@gmail.com>
4047 * ecore.cs: Improved argument mismatch error messages.
4049 2008-07-07 Marek Safar <marek.safar@gmail.com>
4051 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
4053 2008-07-07 Marek Safar <marek.safar@gmail.com>
4055 * expression.cs (TypeOf): Mutate type argument.
4057 2008-07-04 Marek Safar <marek.safar@gmail.com>
4059 * class.cs: Report missing partial modifier for correct type.
4061 2008-07-04 Marek Safar <marek.safar@gmail.com>
4063 * ecore.cs, expression.cs (VariableReference): Variable property is
4066 2008-07-04 Marek Safar <marek.safar@gmail.com>
4068 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
4070 2008-07-04 Marek Safar <marek.safar@gmail.com>
4072 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
4075 2008-07-04 Marek Safar <marek.safar@gmail.com>
4077 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
4078 anonymous method storey to an instance method when only "this" is hoisted.
4080 2008-07-03 Marek Safar <marek.safar@gmail.com>
4082 A fix for bug #321615
4083 * expression.cs: Pointer comparisons use unsigned operator.
4085 2008-07-03 Marek Safar <marek.safar@gmail.com>
4087 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
4089 2008-07-02 Marek Safar <marek.safar@gmail.com>
4091 A fix for bug #404905
4092 * class.cs: Always initialize local unsafe variables.
4094 2008-06-30 Marek Safar <marek.safar@gmail.com>
4096 A fix for bug #396987
4097 * expression.cs (NewInitialize): Clear local temporary variable for next run
4099 2008-06-27 Marek Safar <marek.safar@gmail.com>
4101 A fix for bug #401020
4102 * ecore.cs: Both types and modifiers have to match for ref and out arguments
4104 2008-06-27 Marek Safar <marek.safar@gmail.com>
4106 A fix for bug #398319
4107 * cs-parser.jay: Implemented undocumented base access expression inside
4110 2008-06-26 Marek Safar <marek.safar@gmail.com>
4112 A fix for bug #404227
4113 * cs-parser.jay: Parse namespace declaration using qualified identifier.
4115 2008-06-26 Marek Safar <marek.safar@gmail.com>
4117 A fix for bug #404227
4118 * convert.cs: Fixed explicit array to interface cast.
4120 2008-06-26 Marek Safar <marek.safar@gmail.com>
4122 A fix for bug #403894
4123 * delegate.cs: Mutate DelegateInvocation type.
4125 2008-06-26 Marek Safar <marek.safar@gmail.com>
4127 A fix for bug #379348
4128 * delegate.cs: Box a load of generic parameters.
4130 2008-06-26 Marek Safar <marek.safar@gmail.com>
4132 * expression.cs: Add an array creation arguments mutate.
4134 2008-06-26 Marek Safar <marek.safar@gmail.com>
4136 A fix for bug #386068
4137 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
4140 2008-06-25 Marek Safar <marek.safar@gmail.com>
4142 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
4145 2008-06-25 Marek Safar <marek.safar@gmail.com>
4147 A fix for bug #403518
4148 * delegate.cs: Type correctly anonymous method new invocation.
4150 2008-06-24 Marek Safar <marek.safar@gmail.com>
4152 A fix for bug #394826
4153 * anonymous.cs: Fully qualify members when resolving anonymous type internal
4156 2008-06-24 Marek Safar <marek.safar@gmail.com>
4158 A fix for bug #394826
4159 * anonymous.cs, iterators.cs: Construct generic storey only when is really
4162 2008-06-24 Marek Safar <marek.safar@gmail.com>
4164 * class.cs: Clone indexer parameters for localized capturing.
4166 2008-06-24 Marek Safar <marek.safar@gmail.com>
4168 A fix for bug #402379
4169 * expression.cs: Don't crash when an object initializer resolve fails.
4171 2008-06-24 Marek Safar <marek.safar@gmail.com>
4173 A fix for bug #402888
4174 * expression.cs: Mutate conditional expression.
4176 2008-06-24 Marek Safar <marek.safar@gmail.com>
4178 A fix for bug #401012
4179 * class.cs: Keep StructLayout in shared container.
4181 2008-06-24 Marek Safar <marek.safar@gmail.com>
4183 A fix for bug #400438
4184 * decl.cs, class.cs: Only properties can be automatically implemented.
4186 2008-06-24 Marek Safar <marek.safar@gmail.com>
4188 * statement.cs (ChangeToIterator): Copy also labels.
4190 2008-06-23 Marek Safar <marek.safar@gmail.com>
4192 * ecore.cs: Pass type argument details to parent extension method.
4194 2008-06-23 Marek Safar <marek.safar@gmail.com>
4196 A fix for bug #375966
4197 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
4199 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
4201 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
4203 2008-06-22 Marek Safar <marek.safar@gmail.com>
4205 A fix for bug #394347
4206 * anonymous.cs: Cache compatible delegates as compatibility check produces
4207 a new method every time.
4209 2008-06-20 Marek Safar <marek.safar@gmail.com>
4211 * anonymous.cs: Propagate storey reference for single references.
4213 2008-06-20 Marek Safar <marek.safar@gmail.com>
4215 A fix for bug #387615
4216 * assign.cs, expression.cs: Correctly clone compound assignment.
4218 2008-06-19 Marek Safar <marek.safar@gmail.com>
4220 A fix for bug #359611, #359604
4221 * anonymous.cs: Mutate all types of hoisted parameters.
4223 2008-06-19 Marek Safar <marek.safar@gmail.com>
4225 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
4226 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
4227 expression.cs, codegen.cs, statement.cs
4229 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
4230 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
4232 ** Anonymous methods, lambda expressions rewrite **
4234 Anonymous expressions are now resolved when an explicit block is resolved
4235 and they don't require any registration procedure anymore. Further,
4236 anonymous methods are defined when explicit block is emitted which allows
4237 better control of whole process and opens possibilities for more
4238 optimizations as well as alternative to reverse whole process.
4240 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
4241 process consistent and to correctly emit hoisted generic methods when they
4242 have at least 1 hoisted variable.
4244 2008-06-17 Martin Baulig <martin@ximian.com>
4246 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
4248 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
4249 virtual property; check it in Emit().
4250 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
4252 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
4254 (Indexer.Define): Likewise.
4256 2008-06-17 Marek Safar <marek.safar@gmail.com>
4258 * convert.cs: Don't use IsInterface on type arguments.
4260 * delegate.cs: DelegateInvocation uses MethodInfo.
4262 * parameter.cs: Removed IsTypeParameter.
4264 * generic-mcs.cs: More missing stuff.
4266 2008-06-16 Martin Baulig <martin@ximian.com>
4269 (Modifiers.DEBUGGER_HIDDEN): New public const.
4272 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
4275 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
4276 (AbstractPropertyEventMethod): Likewise.
4277 (Constructor.Emit): Likewise.
4278 (SourceMethod.SetCompilerGenerated): Removed.
4280 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
4284 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
4285 if we're an `IteratorHost'.
4286 (AnonymousMethodMethod..ctor): Don't set
4287 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
4290 2008-06-16 Marek Safar <marek.safar@gmail.com>
4292 * statement.cs: Clean-up foreach statements.
4294 2008-06-12 Marek Safar <marek.safar@gmail.com>
4296 * class.cs: Stop using public method which should not exist
4297 (MethodBuilder.SetGenericMethodSignature).
4299 2008-06-11 Martin Baulig <martin@ximian.com>
4302 (Location.LookupFile): Add `CompilationUnit' argument; when given
4303 a relative file name, make it relative to the directory the .cs
4304 file is located in instead of using the current directory.
4306 2008-06-11 Martin Baulig <martin@ximian.com>
4309 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
4310 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
4311 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
4312 (SourceMethod.SetCompilerGenerated): Likewise.
4314 2008-06-11 Marek Safar <marek.safar@gmail.com>
4316 * codegen.cs, driver: Only write symbol file when it's asked for.
4318 2008-06-11 Marek Safar <marek.safar@gmail.com>
4320 * codegen.cs: Don't use assembly writer error handling for symbol writer.
4322 2008-06-10 Martin Baulig <martin@ximian.com>
4324 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
4326 2008-06-09 Marek Safar <marek.safar@gmail.com>
4328 A fix for bug #316290
4329 * expression.cs: Include decimal operators in predefined table.
4331 * parameters.cs: More readonlyness.
4333 2008-06-09 Marek Safar <marek.safar@gmail.com>
4335 A fix for bug #397213
4336 * cs-parser.jay: One more missing current_local_parameters reset.
4338 2008-06-09 Marek Safar <marek.safar@gmail.com>
4340 A fix for bug #396633
4341 * class.cs: Host backing field in partial container.
4343 2008-06-09 Marek Safar <marek.safar@gmail.com>
4345 A fix for bug #397068
4346 * expression.cs: Check both operand types when predefined operator is used.
4348 2008-06-05 Martin Baulig <martin@ximian.com>
4350 Merged the `debugger-kahalo' branch.
4353 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
4354 we're an iterator method.
4355 (SourceMethod): Reflect latest symbol writer changes;
4356 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
4357 now `start_row' and `end_row'.
4358 (Constructor.Emit): Fix the logic whether to emit symbol information.
4360 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
4364 (CompilationUnit): New public class; derives from `SourceFile'.
4365 (SourceFileEntry.DefineSymbolInfo): New public method.
4366 (SourceFileEntry.SetChecksum): New public method.
4367 (Location): Encode hidden line numbers by using `column == 255';
4368 the .ctor now accepts `column == -1' to mark a hidden line number.
4369 (Location.Hidden): New public property.
4370 (Location.CheckPoint): Add `CompilationUnit'.
4371 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
4372 (Location.Push): Add `CompilationUnit compile_unit' argument.
4373 (Location.CompilationUnit): New public property.
4376 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
4378 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
4380 * driver.cs: `SourceFile' -> `CompilationUnit'.
4382 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
4384 * namespace.cs: `SourceFile' -> `CompilationUnit'.
4386 * cs-tokenizer.cs: Add support for `#pragma checksum' and
4390 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
4391 new symbol writer API to also pass the file.
4393 2008-06-05 Marek Safar <marek.safar@gmail.com>
4395 * statement.cs: Emit catch variable assignment using variable expression.
4397 2008-06-05 Marek Safar <marek.safar@gmail.com>
4399 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
4400 with other variable types.
4402 2008-06-04 Marek Safar <marek.safar@gmail.com>
4404 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
4405 GetLength method emit, it breaks resolve rules.
4407 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
4408 Marek Safar <marek.safar@gmail.com>
4410 A fix for bug #395542
4411 * cs-parser.jay: The trailing comma is allowed in anonymous type member
4414 2008-06-02 Marek Safar <marek.safar@gmail.com>
4416 A fix for bug #395287
4417 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
4419 2008-05-31 Marek Safar <marek.safar@gmail.com>
4421 A fix for bug #395845
4422 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
4423 non-nullable parameter type.
4425 2008-05-31 Marek Safar <marek.safar@gmail.com>
4427 * class.cs: Handle contructor initializer as a statement in top-level block.
4429 2008-05-30 Marek Safar <marek.safar@gmail.com>
4431 * attribute.cs: Don't mix old and new corlib types when emitting corlib
4432 security attributes.
4434 2008-05-24 Marek Safar <marek.safar@gmail.com>
4436 * ecore.cs, expression.cs: Small IVariable refactoring.
4438 2008-05-22 Marek Safar <marek.safar@gmail.com>
4440 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
4442 2008-05-21 Marek Safar <marek.safar@gmail.com>
4444 * cs-parser.jay: Removed redundant catch type check.
4446 2008-05-21 Marek Safar <marek.safar@gmail.com>
4448 A fix for bug #390372
4449 * nullable.cs: Set correct return type.
4451 2008-05-21 Marek Safar <marek.safar@gmail.com>
4453 A fix for bug #391062
4454 * typemanager.cs: Fixed crash when comparing null types.
4456 2008-05-21 Marek Safar <marek.safar@gmail.com>
4458 A fix for bug #391871
4459 * cs-parser.jay: Better error handling for invalid catch type.
4461 2008-05-20 Marek Safar <marek.safar@gmail.com>
4463 A fix for bug #392155
4464 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
4466 2008-05-15 Marek Safar <marek.safar@gmail.com>
4468 A fix for bug #390666
4469 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
4472 2008-05-15 Marek Safar <marek.safar@gmail.com>
4474 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
4477 2008-05-13 Marek Safar <marek.safar@gmail.com>
4479 A fix for bug #389625
4480 * delegate.cs, generic.cs: Some progress on method group return type
4483 2008-05-13 Marek Safar <marek.safar@gmail.com>
4485 A fix for bug #378419
4486 * namespace.cs: Inspect also parent namespaces not only namespace entries.
4488 2008-05-12 Marek Safar <marek.safar@gmail.com>
4490 * class.cs (Constructor): Added IsCompilerGenerated.
4492 2008-05-12 Marek Safar <marek.safar@gmail.com>
4494 * expression.cs: Enum binary operators can accept non-enum operand only when
4495 is implicitly convertible to underlying type.
4497 2008-05-12 Marek Safar <marek.safar@gmail.com>
4499 A fix for bug #389272
4500 * support.cs: Workaround System.InvalidOperationException for enums.
4502 2008-05-12 Marek Safar <marek.safar@gmail.com>
4504 A fix for bug #389073
4505 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
4507 2008-05-10 Marek Safar <marek.safar@gmail.com>
4509 * driver.cs: Split Parse.
4511 * location.cs (LookupFile): Uses string.Empty.
4513 2008-05-07 Marek Safar <marek.safar@gmail.com>
4515 * expression.cs, parameter.cs: Small ParameterReference clean up.
4517 2008-05-07 Marek Safar <marek.safar@gmail.com>
4519 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
4520 hack. Fixes #387502.
4522 2008-05-06 Martin Baulig <martin@ximian.com>
4524 * class.cs (Constructor.Emit): Fix the logic whether to emit
4527 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
4530 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
4531 InvalidOperationException when the iterator is before the start or
4534 2008-05-06 Marek Safar <marek.safar@gmail.com>
4536 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
4537 when left is nullable type.
4539 2008-05-06 Marek Safar <marek.safar@gmail.com>
4541 A fix for bug #386628
4542 * expression.cs (LocalVariableReference): Continue in resolving when
4543 variable is not assigned.
4545 2008-05-05 Marek Safar <marek.safar@gmail.com>
4547 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
4548 nullable operations.
4550 2008-05-04 Marek Safar <marek.safar@gmail.com>
4552 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
4553 it saves many redundant temporary variables for nullable operations.
4555 2008-05-03 Marek Safar <marek.safar@gmail.com>
4557 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
4559 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
4562 * nullable.cs: Constant coalescing operator optimizations.
4564 2008-05-03 Marek Safar <marek.safar@gmail.com>
4566 * constant.cs: Use unsigned conversion for values which are unsigned only.
4568 2008-05-03 Marek Safar <marek.safar@gmail.com>
4570 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
4571 coalescing operator as it should be.
4573 2008-05-02 Marek Safar <marek.safar@gmail.com>
4575 A fix for bug #371016
4576 * expression.cs: All predefined delegate operators require implicit method
4579 2008-05-02 Marek Safar <marek.safar@gmail.com>
4581 * constant.cs: Emit long constant as uint when fits the range.
4583 * convert.cs, expression.cs: Fixed few unsafe conversions.
4585 2008-05-02 Marek Safar <marek.safar@gmail.com>
4587 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
4589 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
4592 * convert.cs (ImplicitNumericConversion): Don't modify the type of
4594 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
4596 2008-05-01 Marek Safar <marek.safar@gmail.com>
4598 * constant.cs, literal.cs: IsLiteral property for error reporting.
4600 * ecore.cs, expression.cs: Implemented Property expression.
4602 2008-05-01 Marek Safar <marek.safar@gmail.com>
4604 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
4606 * nullable.cs: Implemented nullable coalescing null operator.
4608 * ecore.cs, expression.cs: Expression trees work.
4610 2008-05-01 Marek Safar <marek.safar@gmail.com>
4612 * ecore.cs: CreateExpressionTree is finally abstract.
4614 * expression.cs, linq.cs: Updated.
4616 2008-05-01 Marek Safar <marek.safar@gmail.com>
4618 * expression.cs, ecore.cs: Block base access expression inside expression
4621 2008-05-01 Marek Safar <marek.safar@gmail.com>
4623 A fix for bug #385058
4624 * expression.cs: User-defined operator implementations always take
4625 precedence over predefined operator implementations.
4627 2008-04-30 Marek Safar <marek.safar@gmail.com>
4629 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
4630 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
4631 expression tree conversions.
4633 2008-04-30 Marek Safar <marek.safar@gmail.com>
4635 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
4636 operators method details to Operator class.
4638 2008-04-30 Marek Safar <marek.safar@gmail.com>
4640 * anonymous.cs: Pass unsafe flags to anonymous container.
4642 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
4643 inside expression tree.
4645 2008-04-29 Martin Baulig <martin@ximian.com>
4647 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
4648 (Tokenizer.PopPosition): Also restore the `line'.
4650 2008-04-29 Marek Safar <marek.safar@gmail.com>
4652 * delegate.cs: Implemented Invoke expression.
4654 2008-04-29 Marek Safar <marek.safar@gmail.com>
4656 * expression.cs: Fixed equality reference comparison regression.
4658 2008-04-29 Marek Safar <marek.safar@gmail.com>
4660 * ecore.cs: Clean up EmptyCast hack.
4662 * expression.cs, nullable.cs: Implemented enum binary and unary operations
4663 using correct conversion rules. Also fixes #383993.
4665 2008-04-28 Martin Baulig <martin@ximian.com>
4667 * class.cs (Constructor.Emit): Don't emit debugging information
4668 for generated default .ctor's.
4670 2008-04-28 Marek Safar <marek.safar@gmail.com>
4672 * convert.cs: Empty-cast ushort to int conversion.
4674 2008-04-28 Marek Safar <marek.safar@gmail.com>
4676 A fix for bug #384191
4677 * ecore.cs, expression.cs: Fixed expression cloning.
4679 2008-04-28 Marek Safar <marek.safar@gmail.com>
4681 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
4683 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
4685 Fix #381559, test-638.cs, test-639.cs
4686 * assign.cs (CompoundAssign.Helper): New wrapper.
4687 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
4689 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
4690 Pass unconverted expressions to the params array creation expression.
4691 (FieldExpr.EmitAssign): Don't special-case StringConcat.
4692 (PropertyExpr.EmitAssign): Likewise.
4693 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
4694 element if it is of kind CompoundAssign.Helper.
4695 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
4696 first before anything else.
4697 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
4698 (ArrayAccess.LoadArrayAndArguments): Simplify.
4700 2008-04-27 Marek Safar <marek.safar@gmail.com>
4702 * expression.cs: Fixed cloning of typeof(void).
4704 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
4706 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
4707 (Assign.Emit): Likewise. Move it to ...
4708 (CompoundAssign.DoResolve): ... here and ...
4709 (CompoundAssign.Emit): ... here.
4710 (EventAddOrRemove): New helper to handle += and -= on events, and
4711 avoid the use of BinaryDelegates.
4712 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
4713 (EventExpr.EmitAddOrRemove): Improve.
4714 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
4716 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
4717 create VarExprs for 'foo.bar.var'.
4718 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
4719 is a highly inappropriate name for its functionality.
4721 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4723 Simplify handling of multiple assignments
4724 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
4726 (SimpleAssign): New. Class to be used for normal assignments.
4727 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
4728 * expression.cs, parameter.cs, statement.cs: Likewise.
4730 2008-04-25 Marek Safar <marek.safar@gmail.com>
4732 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
4733 for incompatible underlying types, more to come, uff.
4735 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4738 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
4739 Handle 'leave_copy'.
4741 2008-04-25 Marek Safar <marek.safar@gmail.com>
4743 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
4745 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
4747 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
4748 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
4749 * statement.cs (While, Do, For): Allow test to have side effects.
4750 (For.DoEmit): Always emit InitStatement.
4753 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
4754 Always create SideEffectConstant.
4755 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
4756 of type EnumConstant.
4758 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4759 Handle 'right' being SideEffectConstant of type 'bool'.
4761 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4762 Use left.EmitBranchable instead of open coding it, so as to
4763 improve optimization opportunities.
4765 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
4767 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
4769 (Expression.EmitSideEffect): Document.
4771 2008-04-23 Marek Safar <marek.safar@gmail.com>
4773 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
4775 2008-04-23 Marek Safar <marek.safar@gmail.com>
4777 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
4779 2008-04-23 Marek Safar <marek.safar@gmail.com>
4781 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
4782 conversion to expression tree.
4784 2008-04-23 Marek Safar <marek.safar@gmail.com>
4786 * ecore.cs: Removed unused expression.
4788 2008-04-22 Marek Safar <marek.safar@gmail.com>
4790 * expression.cs: Implemented NegateChecked and New expressions.
4792 2008-04-22 Marek Safar <marek.safar@gmail.com>
4794 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
4796 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
4799 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
4800 needing final 'ret' instruction.
4802 2008-04-22 Marek Safar <marek.safar@gmail.com>
4804 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
4806 2008-04-21 Marek Safar <marek.safar@gmail.com>
4808 * expression.cs: Emit ldnull and not null expression as an instance argument
4809 of static method expression calls.
4811 2008-04-21 Marek Safar <marek.safar@gmail.com>
4813 A fix for bug #378200
4814 * expression.cs: Fixed crash when creating parameterless expression tree
4817 2008-04-21 Marek Safar <marek.safar@gmail.com>
4819 A fix for bug #375297
4820 * anonymous.cs: Fixed crash when inferring from null argument anonymous
4823 2008-04-21 Marek Safar <marek.safar@gmail.com>
4825 A fix for bug #377596
4826 * decl.cs, class.cs: Emit delegate type argument attributes.
4828 2008-04-21 Marek Safar <marek.safar@gmail.com>
4830 A fix for bug #365314
4831 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
4833 2008-04-21 Marek Safar <marek.safar@gmail.com>
4835 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
4838 2008-04-21 Marek Safar <marek.safar@gmail.com>
4840 * generic.cs (TypeParameter): Removed redundant location.
4842 2008-04-19 Marek Safar <marek.safar@gmail.com>
4844 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
4845 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
4846 FullNamedExpression in all declaration type expression, statements will come
4849 2008-04-18 Marek Safar <marek.safar@gmail.com>
4851 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
4852 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
4854 2008-04-18 Marek Safar <marek.safar@gmail.com>
4856 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
4859 2008-04-17 Marek Safar <marek.safar@gmail.com>
4861 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
4864 2008-04-17 Marek Safar <marek.safar@gmail.com>
4866 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
4870 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
4872 Hook up 'EmitSideEffect'
4873 * constant.cs (Constant.EmitSideEffect): New.
4874 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
4875 (SideEffectConstant.EmitSideEffect): New.
4876 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
4877 unconditional branch in EmitBranchable.
4878 (FieldExpr.EmitBranchable): New.
4879 * expression.cs (Unary.EmitSideEffect): New.
4880 (Binary.EmitSideEffect): New.
4881 (VariableReference.EmitSideEffect): New. Do nothing.
4883 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
4885 Introduce 'EmitSideEffect'
4886 * ecore.cs (Expression.EmitSideEffect): New.
4887 (TypeCast): Rename from EmptyCast.
4889 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
4890 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
4891 * convert.cs, nullable.cs: Update to changes.
4893 2008-04-16 Marek Safar <marek.safar@gmail.com>
4895 * class.cs, cs-parser.jay: Early check for base types expression.
4897 2008-04-16 Marek Safar <marek.safar@gmail.com>
4899 * decl.cs (MemberName): Declare PrettyName as obsolete.
4901 2008-04-16 Marek Safar <marek.safar@gmail.com>
4903 * namespace.cs: Use MemberName comparison.
4905 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
4908 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
4910 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
4911 (MemberName.FullyQualifiedName): New. Provides the functionality
4912 that users assume FullName would have.
4913 * ecore.cs, namespace.cs: Update to changes.
4915 * statement.cs (Using.assign): Make into ExpressionStatement.
4916 (Using.EmitPreTryBody): Simplify.
4918 2008-04-16 Marek Safar <marek.safar@gmail.com>
4920 * report.cs: ColorFormat is protected.
4922 * rootcontext.cs: Unused fields clean-up.
4924 * namespace.cs: Made UsingEntry name private.
4926 2008-04-16 Marek Safar <marek.safar@gmail.com>
4928 * cs-tokenizer.cs, location.cs: Removed unused field.
4930 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
4931 Raja R Harinath <harinath@hurrynot.org>
4934 * constant.cs (SideEffectConstant.value): Rename from 'left'.
4935 (SideEffectConstant.side_effect): Rename from 'right'.
4936 (SideEffectConstant..ctor): Normalize 'side_effect'.
4937 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
4938 value of this constant.
4939 * cfold.cs: Update to changes.
4941 2008-04-15 Marek Safar <marek.safar@gmail.com>
4943 * cs-paser.jay: Removed unused variable.
4945 * driver.cs: Made Compile instance method.
4947 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
4949 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
4951 2008-04-15 Marek Safar <marek.safar@gmail.com>
4953 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
4955 2008-04-13 Jb Evain <jbevain@novell.com>
4957 * namespace.cs: update the System.Core fullname for 2.1
4958 * driver.cs: update the list of required assemblies for 2.1.
4959 Merged from the Moonlight 2 branch.
4961 2008-04-11 Marek Safar <marek.safar@gmail.com>
4963 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
4964 types and user defined operators. User operators arguments has to be checked
4965 for null value before invocation, which also means no operator is called
4966 when any argument is not convertible to unwrapped nullable type.
4968 2008-04-09 Marek Safar <marek.safar@gmail.com>
4970 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
4971 of Unary expressions to follow operator overloading rules precisely.
4972 Also fixes #321794, #323794
4974 2008-04-08 Marek Safar <marek.safar@gmail.com>
4976 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
4979 2008-04-08 Marek Safar <marek.safar@gmail.com>
4981 * expression.cs, ecore.cs: Implemented MemberInit expression.
4983 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
4985 Fix mono/tests/exception4.cs
4986 * statement.cs (ExceptionStatement, TryCatch): Revert to using
4987 ec.NeedReturnLabel () rather emitting a 'nop'.
4989 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
4991 (TryCatch.SomeCodeFollows): Likewise.
4992 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
4993 for 'break', 'continue' and 'return' statements inside a try.
4994 We're fairly sure that the generated IL stream will have more
4995 instructions textually following the try.
4996 (FlowBranchingTryCatch): Likewise.
4998 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
4999 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
5002 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
5003 wrapper -- forward everything to CollectionForeach.
5004 (CollectionForeach.NonDisposableWrapper): New.
5005 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
5006 instead of a pop + branch to end.
5008 2008-04-07 Marek Safar <marek.safar@gmail.com>
5010 A fix for bug #377485
5011 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
5012 Propagate location for extension method groups. Report conversion failure at
5015 2008-04-07 Marek Safar <marek.safar@gmail.com>
5017 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
5018 ListInit and Field expressions.
5020 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
5022 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
5023 Since $PC is always -1 inside the body of MoveNext, the fault
5025 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
5026 * statement.cs (ExceptionStatement.emit_finally): Likewise.
5027 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
5029 The denouement! Fix #324708
5030 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
5031 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
5032 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
5033 'finally' inside the finally clause.
5035 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
5036 inside an iterator. Don't emit the body of the 'finally' inside
5037 the finally clause yet.
5039 Use the ResumableStatement infrastructure for MoveNext ()
5040 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
5041 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
5042 'old_resume_points'. Move dispatcher upfront.
5043 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
5044 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
5045 in an enumerator. This encodes the main fix in this patch series
5046 -- we can only jump into the first instruction of a try from the
5047 outside, but we want to emit try/finally regions in iterators and
5048 resume in the middle of them.
5050 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
5052 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
5053 of NeedReturnLabel here.
5055 Introduce a common point for emitting try/finally to IL
5056 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
5057 features of the various subclasses, which are now driven by ...
5058 (ExceptionStatement.EmitPreTryBody): ... this and ...
5059 (ExceptionStatement.EmitTryBody): ... this and the original
5061 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
5062 Remove DoEmit and update to follow above protocol.
5064 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
5065 of the dispatcher are the same, skip emitting the 'switch'.
5066 * iterator.cs (Iterator.EmitDispose): Update to changes.
5068 Clean up handling of 'using' statement
5069 * statement.cs (UsingTemporary): New. Carved out of ...
5070 (Using): ... this. Simplify drastically. Handle exactly
5072 * cs-parser.jay (using_statement): Split. Create UsingTemporary
5073 or Using as appropriate. If there are multiple variable declared,
5074 create nested Using statements.
5075 (resource_acquisition): Kill.
5077 * statement.cs (ExceptionStatement.EmitForDispose): Use
5078 EmitFinallyBody, not EmitFinally.
5080 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
5081 * iterator.cs: Update to changes.
5083 Start using the ResumableStatement infrastructure
5084 * statement.cs (ResumeableStatement.PrepareForDispose): New.
5085 (ResumableStatement.EmitForDispose): New.
5086 (ExceptionStatement): Override them.
5087 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
5088 EmitForDispose to create the body of the Dispose method. Don't
5091 * iterator.cs (Iterator.AddResumePoint): Move here from ...
5092 * statement.cs (Toplevel.AddResumePoint): ... here.
5093 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
5094 * flowanalysis.cs (FlowBranchingIterator): New.
5095 * codegen.cs (EmitContext): Update to changes.
5097 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
5098 (Iterator.old_resume_points): Rename from 'resume_points'.
5099 (Iterator.MoveNextStatement): Remove unused class.
5101 New infrastructure for try/finally in iterators (still unused)
5102 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
5103 (FlowBranchingToplevel.AddResumePoint): Hook into
5104 ToplevelBlock.AddResumePoint.
5105 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
5106 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
5107 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
5108 resume points and assign program-counter values.
5109 (ExceptionBlock.AddResumePoint): Collect resume points for
5110 de-muxer at the top of try block.
5111 * iterators.cs (Yield.CheckContext): Simplify.
5112 (Yield.Resolve): Use FlowBranching.AddResumePoint.
5114 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
5116 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
5117 argument to an ExitStatement.
5118 (FlowBranchingException): Refactor saved origins code.
5119 * statement.cs (ExitStatement): Update to cahges.
5120 * iterator.cs (YieldBreak): Likewise.
5122 * statement.cs (ResumableStatement): New. Common base class for
5123 YieldReturn and ExceptionStatement.
5124 (ExitStatement): New. Common base class for Return and YieldBreak.
5125 (Return): Update to changes.
5126 * iterator.cs (YieldBreak): Likewise.
5127 * lambda.cs (ContextualReturn): Likewise.
5130 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
5131 emit a meaningful error message.
5133 Fix #324765, #319508
5134 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
5135 (VariableInfo.SetAssigned): Set it.
5136 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
5137 determine if CS0219 or CS0168 is appropriate. Don't use
5138 flow-analysis information.
5139 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
5140 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
5141 (EmitContext.EndFlowBranching): ... this.
5143 2008-04-03 Marek Safar <marek.safar@gmail.com>
5145 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
5147 2008-04-03 Marek Safar <marek.safar@gmail.com>
5149 A fix for bug #376508
5150 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
5151 ImplicitConversionExists.
5153 2008-04-03 Marek Safar <marek.safar@gmail.com>
5155 * expression.cs (Binary): Added remaining binary operators to expression
5158 * nullable.cs: Optimize shift with null argument.
5160 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
5162 Fix minor IL regression
5163 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
5164 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
5165 * cs-parser.jay (try_statement): Update to changes.
5167 * statement.cs (TryFinally.need_exc_block): Delete.
5168 (TryFinally): Update to changes.
5170 Now all ExceptionStatements are unconditional
5171 * statement.cs (CollectionForeach.DisposableWrapper): New.
5172 Extract out the try/finally code into a new wrapper.
5173 (CollectionForeach.Resolve): Use it to simplify the code.
5175 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
5177 Start at simplifying ExceptionStatement semantics a bit
5178 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
5179 * cs-parser.jay (try_statement): Update to changes.
5180 (opt_catch_clauses): Remove.
5181 * flowanalysis.cs: Update to changes.
5182 (FlowBranching.BranchingType.TryCatch): New.
5183 (FlowBranchingTryCatch): New.
5185 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
5186 (FlowBranching.CreateBranching): Update to changes.
5187 (FlowBranchingBlock.AddSibling): Add sanity check.
5188 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
5191 * iterators.cs (Iterator.MarkFinally): Remove.
5192 * statement.cs (ExceptionStatement): Update to changes.
5194 Add support for skipping over finally blocks at runtime. First
5195 in a series to fix #324708
5196 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
5197 (Iterator.EmitMoveNext): Initialize it.
5198 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
5199 branch over the body of the 'finally' clause.
5201 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
5203 Avoid lopsided use of Foo/DoFoo names
5204 * statement.cs (ExpressionStatement.EmitFinallyBody):
5205 Rename from EmitFinally.
5206 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
5207 * iterator.cs: Update to changes.
5209 2008-04-02 Marek Safar <marek.safar@gmail.com>
5211 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
5212 based on UserOperatorCall. More binary nullable operators clean up.
5214 2008-04-02 Martin Baulig <martin@ximian.com>
5216 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
5218 2008-04-02 Marek Safar <marek.safar@gmail.com>
5220 * nullable.cs: Merge user and empty conversions when lifting expression
5223 * expression.cs (StringConcat): Implemented expression tree representation.
5225 2008-04-01 Marek Safar <marek.safar@gmail.com>
5227 * nullable.cs: When lifting null literal and a user operator exists, no call
5230 2008-04-01 Marek Safar <marek.safar@gmail.com>
5232 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
5235 2008-04-01 Marek Safar <marek.safar@gmail.com>
5237 * nullable.cs, expression.cs: Use namespace instead heavily nested
5238 monster abstract class.
5240 2008-04-01 Marek Safar <marek.safar@gmail.com>
5242 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
5243 lifting of null literal and user operators. Clean up of some temporary
5246 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
5248 Fix #368224, test-629.cs
5249 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
5250 if it crossed an unwind-protect boundary.
5251 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
5252 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
5253 inside an unwind-protected region.
5254 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
5255 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
5256 'leave' instead of a 'br' if unwind-protected.
5257 (Iterator.EmitYieldBreak): Likewise.
5259 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
5261 * driver.cs: Only define versioninfo resources if no win32 resource
5264 2008-03-28 Marek Safar <marek.safar@gmail.com>
5266 A fix for bug #372375
5267 * convert.cs: Fixed boxing of nullable types.
5269 2008-03-28 Marek Safar <marek.safar@gmail.com>
5271 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
5274 2008-03-28 Marek Safar <marek.safar@gmail.com>
5276 A fix for bug #374619
5277 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
5279 2008-03-27 Marek Safar <marek.safar@gmail.com>
5281 * lambda.cs: Check return type only for invocation.
5283 2008-03-27 Marek Safar <marek.safar@gmail.com>
5285 A fix for bug #374214
5286 * ecore.cs: Correctly report argument type mismatch.
5288 2008-03-27 Marek Safar <marek.safar@gmail.com>
5290 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
5291 and not rely on broken IsEnum.
5293 2008-03-27 Marek Safar <marek.safar@gmail.com>
5295 * nullable.cs: New file, extracted from generic.cs.
5297 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
5299 2008-03-27 Marek Safar <marek.safar@gmail.com>
5301 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
5302 predefined comparison operators and null literals.
5304 * report.cs: New warning ID.
5306 2008-03-25 Marek Safar <marek.safar@gmail.com>
5308 A fix for bug #370577
5309 * lambda.cs: Check return type too.
5311 2008-03-25 Marek Safar <marek.safar@gmail.com>
5313 A fix for bug #372846
5314 * class.cs: Automatic properties can be declared as unsafe.
5316 2008-03-20 Marek Safar <marek.safar@gmail.com>
5318 * location.cs: Use string based concatenation.
5320 * expression.cs: LiftedBinaryOperator is gmcs only.
5322 2008-03-20 Marek Safar <marek.safar@gmail.com>
5324 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
5325 conversions rules and expression trees.
5327 2008-03-19 Marek Safar <marek.safar@gmail.com>
5329 * delegate.cs: Use extension method source as delegate target.
5331 2008-03-19 Marek Safar <marek.safar@gmail.com>
5333 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
5334 binary operations to be purely based on binary operations and optimized
5335 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
5336 and other ET refactoring.
5338 * typemanager.cs: Fixed warning.
5340 2008-03-17 Marek Safar <marek.safar@gmail.com>
5342 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
5344 * symbolwriter.cs: Fixed.
5346 2008-03-17 Marek Safar <marek.safar@gmail.com>
5348 * anonymous.cs, driver.cs: Reset anonymous types counters.
5350 2008-03-17 Marek Safar <marek.safar@gmail.com>
5352 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
5354 * class.cs: Use fullname for all type member definitions.
5356 2008-02-19 Martin Baulig <martin@ximian.com>
5359 (IMethodData.EmitExtraSymbolInfo): New interface method.
5360 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
5361 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
5362 interface method here as an empty public virtual method.
5365 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
5366 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
5367 CodeGen.SymbolWriter.SetRealMethodName().
5369 2008-02-18 Martin Baulig <martin@ximian.com>
5372 (ScopeInfo.EmitType): Override this and emit debugging
5373 information for captured variables.
5374 (RootScopeInfo.EmitType): Override this and emit symbol
5375 information for a captured `this'.
5377 2008-02-15 Martin Baulig <martin@ximian.com>
5379 * iterators.cs: Emit debugging info.
5382 (EmitContext.Flags): Add `OmitDebuggingInfo'.
5383 (EmitContext.OmitDebuggingInfo): New public property.
5386 (While): Override Emit() and don't emit symbol info there; do it
5387 inside DoEmit() instead.
5388 (Block.Emit): Omit symbol information while emitting the scope
5389 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
5391 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
5392 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
5393 .ctor to make `IsIterator' work.
5395 2008-03-14 Martin Baulig <martin@ximian.com>
5397 * symbolwriter.cs: Added the new symbol writer function from the
5398 debugger's `terrania' branch; temporarily enclose them inside
5399 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
5402 2008-03-14 Martin Baulig <martin@ximian.com>
5405 (SymbolWriter): Make this a public static class.
5408 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
5409 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
5411 2008-03-14 Marek Safar <marek.safar@gmail.com>
5413 A fix for bug #370577
5414 * statement.cs, lambda.cs: Added extra limitations when dealing with void
5417 2008-03-14 Marek Safar <marek.safar@gmail.com>
5419 * typemanager.cs (CSharpName): Made 250 times faster.
5421 2008-03-13 Marek Safar <marek.safar@gmail.com>
5423 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
5425 2008-03-12 Marek Safar <marek.safar@gmail.com>
5427 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
5428 crash when predefined field does not exist.
5430 2008-03-12 Marek Safar <marek.safar@gmail.com>
5432 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
5434 2008-03-12 Marek Safar <marek.safar@gmail.com>
5436 * class.cs (FixedField): Don't crash when contructors are missing.
5438 2008-03-11 Marek Safar <marek.safar@gmail.com>
5440 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
5441 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
5442 check internal types accessibility for internal and external types.
5443 Replaced EnumToUnderlying by GetEnumUnderlyingType.
5445 2008-03-11 Marek Safar <marek.safar@gmail.com>
5447 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
5448 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
5449 attribute.cs, statement: Use corect instance of predefined types (work
5450 related to #364674).
5452 2008-03-07 Marek Safar <marek.safar@gmail.com>
5454 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
5456 2008-03-07 Marek Safar <marek.safar@gmail.com>
5458 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
5459 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
5460 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
5461 predefined types clean up, delayed predefined types members initialization
5462 (work related to #364674).
5464 2008-03-05 Marek Safar <marek.safar@gmail.com>
5466 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
5468 2008-03-05 Marek Safar <marek.safar@gmail.com>
5470 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
5471 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
5472 predefined types clean up (work related to #364674).
5474 2008-03-04 Marek Safar <marek.safar@gmail.com>
5476 * ecore.cs: Print an error message instead of throwing exception.
5478 2008-03-04 Marek Safar <marek.safar@gmail.com>
5480 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
5481 expression.cs, statement.cs: Unififed null literal representation.
5483 2008-03-03 Marek Safar <marek.safar@gmail.com>
5485 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
5486 expression.cs: Refactored binary operators resolve phase and improved speed.
5487 The nullable code is still missing and won't work correctly, more fixes
5490 It also fixes #323726, #324312, #324248, and many other unreported issues.
5492 2008-02-29 Zoltan Varga <vargaz@gmail.com>
5494 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
5497 2008-02-27 Marek Safar <marek.safar@gmail.com>
5499 * ecore.cs: Clean-up and split BetterConversion.
5501 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
5504 * enum.cs (EnumMember.Value): Only access 'value' if
5505 ResolveValue says it's ok.
5506 (EnumMember.DoResolveValue): Don't set prev_member.value.
5507 (Enum.GetDefinition): Reverse arguments of Equals --
5508 EnumMember.Value can return 'null'.
5510 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
5512 2008-02-22 Marek Safar <marek.safar@gmail.com>
5514 * generic.cs, expression.cs: More ongoing work on expression trees.
5516 2008-02-21 Marek Safar <marek.safar@gmail.com>
5518 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
5519 handle missing matches when mutiple operators exist.
5521 2008-02-20 Marek Safar <marek.safar@gmail.com>
5523 A fix for bug #363218
5524 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
5527 2008-02-20 Marek Safar <marek.safar@gmail.com>
5529 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
5530 update. This time to deal correctly with SideEffectConstant expression used
5531 as an argument for another constant folding.
5533 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
5535 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
5538 2008-02-19 Marek Safar <marek.safar@gmail.com>
5540 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
5542 2008-02-19 Marek Safar <marek.safar@gmail.com>
5544 A fix for bug #328136
5545 * expression.cs: Do not fold immediately LogicalAnd operators when the left
5546 side is a false constant, because we still need to evaluate the right-hand
5549 * statement.cs (If): Emit two types of boolean constants (simple constant,
5550 side-effect constant).
5552 2008-02-19 Marek Safar <marek.safar@gmail.com>
5554 * constant.cs (SideEffectConstant): Don't emit boolean constant.
5556 * expression.cs: Fold immediately LogicalAnd operators when both sides are
5559 2008-02-18 Marek Safar <marek.safar@gmail.com>
5561 A fix for bug #361457
5562 * ecore.cs (IsApplicable): Params methods have lower priority.
5564 * support.cs: Return correct parameter modifier for params types.
5566 2008-02-18 Marek Safar <marek.safar@gmail.com>
5568 * generic.cs (TypeParameter): Cache attribute target name.
5570 * support.cs: Removed unused variable.
5572 * typemanager.cs: Removed debugging leftover.
5574 * ecore.cs: Use local type instead of a property;
5576 * class.cs (VerifyMembers): Consider also parent to test whether type member
5579 * expression.cs (FullMethodDesc): Removed.
5581 * attribute.cs (IsValidArgumentType): Made static.
5583 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
5585 Cleanup to be more readable.
5586 * Makefile (GMCS_PROFILE): Remove.
5587 (COMPILER_NAME): New helper.
5589 2008-02-15 Miguel de Icaza <miguel@novell.com>
5591 * cs-tokenizer.cs: if a conditional expression happens inside a
5592 (...) this also means that we do not need to de-ambiguate between
5593 an parenthesized expression and a cast.
5597 * constant.cs (SideEffectConstant): a constant value that happens
5598 to have a side effect.
5600 Fixes the build regressions introduced by the fix for #359789
5602 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
5604 * expression.cs (Conditional.Emit): when emitting the ternary
5605 operator, use local variables to generate code verifiable code.
5607 The verifier cannot infer that the type on stack before the
5608 stloc.0 is executed is of type ParentB. This happens because the
5609 stack merge algorithm uses only parent types when deciding which
5610 is the common type. This is described in Part III 1.8.1.3 of ECMA
5613 This code compiled with mcs is not verifiable under MS. The MS
5614 verifier picks the first common interface of Foo and Bar, which is
5615 wrong, but doesn't use a full join type of the 2 interfaces.
5617 CSC uses a clever hack to compile such code in a verifiable
5618 way. It stores the intermediate values in a local variable with
5623 2008-02-14 Miguel de Icaza <miguel@novell.com>
5625 * expression.cs: Do not fold BitwiseAnd operators when the left
5626 side is a false constant, because we still need to evaluate the
5631 * support.cs: Instead of throwing an InternalErrorException when
5632 the position of the stream is outside the boundary of our buffer,
5633 reset the state of the reader, and restart the reading from the
5634 beginning of the file.
5636 2008-02-14 Marek Safar <marek.safar@gmail.com>
5638 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
5640 2008-02-14 Marek Safar <marek.safar@gmail.com>
5642 A fix for bug #361686
5643 * decl.cs: A protected types used inside a private class which parents
5644 derives from the protected class are accessible.
5646 2008-02-13 Marek Safar <marek.safar@gmail.com>
5648 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
5649 the parameterless constructor.
5651 2008-02-13 Marek Safar <marek.safar@gmail.com>
5653 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
5654 lookup methods to use standard member cache when doing member lookup.
5656 2008-02-12 Marek Safar <marek.safar@gmail.com>
5658 * driver.cs: Don't report full path for referenced module as assembly error.
5660 2008-02-12 Marek Safar <marek.safar@gmail.com>
5662 * Makefile: Fixed `qh' target to work on all machines.
5664 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
5665 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
5666 and HasElementType with TypeManager implementation.
5668 2008-02-08 Marek Safar <marek.safar@gmail.com>
5670 A fix for bugs #325134, #359749
5671 * expression.cs, ecore.cs: Try to resolve an extension method even if the
5672 first binds point to non-method member expression.
5674 2008-02-08 Marek Safar <marek.safar@gmail.com>
5676 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
5678 2008-02-08 Marek Safar <marek.safar@gmail.com>
5680 A fix for bugs #321394, #323028
5681 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
5682 Reworked naive IsAccessibleAs implementation to handle nested types.
5684 2008-02-05 Jb Evain <jbevain@novell.com>
5686 * class.cs: use generic type comparison for parameters
5689 2008-02-05 Marek Safar <marek.safar@gmail.com>
5691 A fix for bug #325372
5692 * class.cs: Use generic type comparison when testing method signatures.
5694 2008-02-05 Marek Safar <marek.safar@gmail.com>
5696 A fix for bug #357047
5697 * ecore.cs: Applied C# 3.0 changes to better conversion.
5699 2008-02-05 Marek Safar <marek.safar@gmail.com>
5701 A fix for bug #358374
5702 * cs-parser.jay: Correctly set modifiers for all constructor types.
5704 2008-02-04 Marek Safar <marek.safar@gmail.com>
5706 A fix for bug #355251
5707 * generic.cs: Added base class constraint based type inference.
5709 2008-02-01 Marek Safar <marek.safar@gmail.com>
5711 A fix for bug #357255
5712 * decl.cs: One more missing visibility check.
5714 2008-02-01 Marek Safar <marek.safar@gmail.com>
5716 * support.cs: Fixed broken return.
5718 2008-01-25 Marek Safar <marek.safar@gmail.com>
5720 * report.cs: Correctly reset warnings count after probing.
5722 2008-01-25 Martin Baulig <martin@ximian.com>
5725 (NamespaceEntry.SymbolFileID): Make this work again after
5726 MemberName.ToString() is gone.
5728 2008-01-25 Marek Safar <marek.safar@gmail.com>
5730 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
5733 2008-01-25 Marek Safar <marek.safar@gmail.com>
5735 * generic.cs: Use full implicit conversion for type inference fixing.
5737 2008-01-24 Marek Safar <marek.safar@gmail.com>
5739 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
5740 Fixed user operator conversions.
5742 2008-01-24 Marek Safar <marek.safar@gmail.com>
5744 * generic.cs: Do nullable type to null comparison optimization during
5747 2008-01-24 Marek Safar <marek.safar@gmail.com>
5749 A fix for bug #355163
5750 * generic.cs: Enabled l-value resolve on nullable expressions.
5752 2008-01-24 Marek Safar <marek.safar@gmail.com>
5754 A fix for bug #353986
5755 * class.cs: Ingore static ctors with parameters for any further checks.
5757 2008-01-24 Marek Safar <marek.safar@gmail.com>
5759 A fix for bug #354310
5760 * namespace.cs: Removed redundant check.
5762 2008-01-24 Marek Safar <marek.safar@gmail.com>
5764 A fix for bug #354928
5765 * expression.cs: ElementInitializers can be resolved only once.
5767 2008-01-24 Marek Safar <marek.safar@gmail.com>
5769 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
5770 Condition expressions.
5772 2008-01-23 Marek Safar <marek.safar@gmail.com>
5774 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
5776 2008-01-22 Marek Safar <marek.safar@gmail.com>
5778 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
5781 * generic.cs: Implemented coalesce expression.
5783 2008-01-22 Marek Safar <marek.safar@gmail.com>
5785 A fix for bug #355145
5786 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
5787 expression tree type inference.
5789 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
5792 * expression.cs (Binary.IsUnsignedType): Fix typo.
5794 2008-01-22 Marek Safar <marek.safar@gmail.com>
5796 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
5798 2008-01-22 Marek Safar <marek.safar@gmail.com>
5800 A fix for bug #355161
5801 * ecore.cs, expression.cs: Wider range of extension method supported
5804 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
5806 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
5807 AssemblyBuilder to operate in compiler context. Fixes mcs part of
5810 2008-01-22 Marek Safar <marek.safar@gmail.com>
5812 A fix for bug #355148
5813 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
5815 2008-01-22 Miguel de Icaza <miguel@novell.com>
5817 * expression.cs (CreateExpressionTree): Add support for or and
5818 logical or, and indent following the coding conventions.
5820 * typemanager.cs (LinqExpression): renamed from
5821 ExpressionTreeManager, for a shorter name.
5823 Use TypeManager.CoreLookupType to lookup types from our core
5824 assemblies and turn those into "Type" variables.
5826 Consumers that previously used "Namespace" and "Type" from this
5827 class should instead use the TypeExpression which is a type that
5828 is fully resolved (without involving the regular C# resolution
5831 This typically looks like this:
5833 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
5834 new MemberAccess (texpr, name, type_arguments, loc)
5836 This avoids the problem in: #355178
5838 2008-01-21 Marek Safar <marek.safar@gmail.com>
5840 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
5841 feature in parser only as we do in other cases.
5843 2008-01-21 Marek Safar <marek.safar@gmail.com>
5845 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
5846 typemanager.cs: A refactoring of params arguments to reuse existing
5847 expressions (params -> array initializer) to emit params argument instead
5848 of specialized handling.
5849 It was required by expression tree implementation and it has other benefits
5850 as well, we now apply same optimization for params arguments as we do for
5853 2008-01-18 Marek Safar <marek.safar@gmail.com>
5855 A fix for bug #353526
5856 * generic.cs: A type inference of params arguments may not required any
5857 temporary array creation.
5859 2008-01-18 Marek Safar <marek.safar@gmail.com>
5861 A fix for bug #353534
5862 * generic.cs, ecore.cs, expression.cs: A method group type inference is
5863 supported for delegates only.
5865 2008-01-18 Marek Safar <marek.safar@gmail.com>
5867 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
5868 type for more than 1 candidates.
5870 2008-01-18 Marek Safar <marek.safar@gmail.com>
5872 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
5875 2008-01-16 Marek Safar <marek.safar@gmail.com>
5877 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
5878 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
5879 operator) expressions.
5881 2008-01-16 Zoltan Varga <vargaz@gmail.com>
5883 * statement.cs: Avoid declaring an IL variable for this_variable since it is
5884 not accessed from the generated IL.
5886 2008-01-14 Marek Safar <marek.safar@gmail.com>
5888 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
5889 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
5890 statement.cs: The first expression tree implementation drop, mostly
5891 infrastructure work.
5893 2008-01-14 Marek Safar <marek.safar@gmail.com>
5895 * ecore.cs (IsNestedChild): Refactored.
5897 2008-01-11 Marek Safar <marek.safar@gmail.com>
5899 * lambda.cs: Don't use a cast on unknown expression statement.
5901 2008-01-10 Geoff Norton <gnorton@novell.com>
5903 * cs-tokenizer.cs: One more token to distinguish between method and lambda
5906 2008-01-09 Marek Safar <marek.safar@gmail.com>
5908 * doc.cs: Report better /doc crash details.
5910 2008-01-09 Marek Safar <marek.safar@gmail.com>
5912 A fix for bug #352536
5913 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
5915 2008-01-08 Marek Safar <marek.safar@gmail.com>
5917 A fix for bug #352287
5918 * ecore.cs, expression.cs: Do `this' access checking in all member access
5921 2008-01-08 Marek Safar <marek.safar@gmail.com>
5923 * rootcontext.cs, driver.cs: Switch to linq mode by default.
5925 * report.cs: Reset message stacks.
5927 2008-01-08 Marek Safar <marek.safar@gmail.com>
5929 * generic.cs (InferInPhases): Correctly calculate params position.
5931 2008-01-08 Marek Safar <marek.safar@gmail.com>
5933 * cs-tokenizer.cs: No need to parse full string when parsing lambda
5936 2008-01-07 Marek Safar <marek.safar@gmail.com>
5938 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
5940 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
5942 * driver.cs: Updated --help option.
5944 2008-01-07 Marek Safar <marek.safar@gmail.com>
5946 * generic.cs (InferParamsTypeArguments): Removed.
5947 (InferInPhases): Add params type inference.
5948 (LowerBoundInference): Fixed scoring mechanism.
5950 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
5952 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
5954 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
5955 byte array for unsigned "baked" assemblies.
5957 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
5959 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
5960 array for assemblies that are not strongnamed.
5962 2008-01-04 Marek Safar <marek.safar@gmail.com>
5964 A fix for bug #351481
5965 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
5966 declaring type for nested generic types.
5968 2008-01-04 Marek Safar <marek.safar@gmail.com>
5970 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
5971 instead of ToString.
5973 2008-01-03 Marek Safar <marek.safar@gmail.com>
5975 A fix for bug #351047
5976 * expression.cs (Binary.ResolveOperator): Allow equality operators between
5977 null and structs only when equality and inequality operators are defined
5978 either as an user-operators or predefined operators.
5980 2008-01-03 Marek Safar <marek.safar@gmail.com>
5982 A fix for bug #351047
5983 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
5985 2008-01-03 Marek Safar <marek.safar@gmail.com>
5987 A fix for bug #351257
5988 * cs-tokenizer.cs: Advance line number for '\r' correctly.
5990 2008-01-03 Marek Safar <marek.safar@gmail.com>
5992 A fix for bug #351157
5993 * class.cs (Using): Fixed yet another broken cloning.
5995 (Block): Put back more sensible default value for statements.
5997 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
5999 * codegen.cs: Allow AssemblyVersion with only major version component.
6002 2007-12-29 Marek Safar <marek.safar@gmail.com>
6004 A fix for bug #324654
6005 * class.cs: Use FullName property as member name.
6007 2007-12-28 Marek Safar <marek.safar@gmail.com>
6009 A fix for bug #342117
6010 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
6011 constructor constraint.
6013 2007-12-28 Marek Safar <marek.safar@gmail.com>
6015 A fix for bug #338273
6016 * class.cs (ProbertyBase): Access modifier checks are required for overrides
6019 2007-12-28 Marek Safar <marek.safar@gmail.com>
6021 A fix for bug #350839
6022 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
6024 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
6026 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
6029 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
6031 * statement.cs: Changed some Hashtables to use HybridDictionaries
6032 instead. It was observed that some HashTables only contained a few
6033 items in the vast majority of cases. Since HybridDictionary is
6034 more efficient on small sets (<10 elements), "known_variables"
6035 from class ExplicitBlock as well as "labels" and "constants " from
6036 class Block were changed to HybridDictionaries.
6038 Atsai results: (56216kb->54987kb)
6040 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
6043 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
6045 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
6048 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
6050 * expression.cs: foreach loop to for loop, saved on allocation of
6051 enumerator (59333kb->59141kb)
6053 * statement.cs. Changed foreach loops to for loops, saved on
6054 allocation of enumerator (59141kb->59006kb)
6056 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
6057 when constructed with no specified capacity. This was causing a
6058 few ArrayLists to allocate more memory than they would potentially
6059 need in the Block class and MemberCache class. Setting the
6060 ArrayLists to construct with a capacity of 1 saves some
6061 memory. (56216kb->55585kb)
6063 2007-12-27 Marek Safar <marek.safar@gmail.com>
6065 A fix for bug #347189 (2nd issue)
6066 * expression.cs (MemberAccess): Nested type can be found in base non-generic
6069 2007-12-27 Miguel de Icaza <miguel@novell.com>
6071 * report.cs: Do not use colors if stdout and stderr are not a
6074 2007-12-27 Marek Safar <marek.safar@gmail.com>
6076 A fix for bug #346998
6077 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
6080 2007-12-27 Marek Safar <marek.safar@gmail.com>
6082 A fix for bug #343465
6083 * class.cs: Explicit method name for nested types uses dots only.
6085 2007-12-27 Marek Safar <marek.safar@gmail.com>
6087 A fix for bug #343707
6088 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
6090 2007-12-27 Marek Safar <marek.safar@gmail.com>
6092 * ecore.cs: Report type inference errors only when arguments count matches
6095 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
6097 * expression.cs, report.cs: New warning.
6099 * typemanager.cs: Catch anonymous method type too.
6101 2007-12-23 Marek Safar <marek.safar@gmail.com>
6103 A fix for bug #346379
6104 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
6106 2007-12-23 Marek Safar <marek.safar@gmail.com>
6108 A fix for bug #347359
6109 * expression.cs (Invocation): Don't resolve already resolved expression.
6111 2007-12-23 Marek Safar <marek.safar@gmail.com>
6113 A fix for bug #347189
6114 * class.cs (FixedField): Use non-dependent code only in the define phase.
6116 2007-12-23 Marek Safar <marek.safar@gmail.com>
6118 A fix for bug #348076
6119 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
6121 2007-12-22 Marek Safar <marek.safar@gmail.com>
6123 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
6124 discovered extension methods.
6126 2007-12-22 Marek Safar <marek.safar@gmail.com>
6128 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
6131 2007-12-21 Miguel de Icaza <miguel@novell.com>
6133 * report.cs (ErrorMessage): Add support for using colors on
6134 terminals that support it.
6136 2007-12-21 Marek Safar <marek.safar@gmail.com>
6138 * ecore.cs: Use information about expanded params for error reporting.
6140 2007-12-21 Marek Safar <marek.safar@gmail.com>
6142 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
6143 and logic for params overloads.
6145 2007-12-15 Miguel de Icaza <miguel@novell.com>
6147 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
6148 as this is also created from the parser. Fixes #349034
6150 2007-12-12 Miguel de Icaza <miguel@novell.com>
6152 * statement.cs (Throw.CloneTo): it is valid to have empty
6153 expressions for throw.
6155 2007-12-03 Marek Safar <marek.safar@gmail.com>
6157 * cs-parser.jay: Set delegate constraint parsing region correctly.
6159 2007-12-03 Marek Safar <marek.safar@gmail.com>
6161 A fix for bug #345467
6162 * typemanager.cs (IsEqual): Compare generic parameters position only.
6164 2007-11-28 Marek Safar <marek.safar@gmail.com>
6166 * expression.cs (BaseAccess): Type arguments can be null.
6168 2007-11-27 Raja R Harinath <harinath@gmail.com>
6170 * statement.cs (Block.Resolve): Ensure flow-branching tree is
6171 consistent even when an error has occured.
6172 (Switch.Resolve): Likewise.
6174 2007-11-22 Marek Safar <marek.safar@gmail.com>
6176 A fix for bug #334505
6177 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
6180 2007-11-22 Marek Safar <marek.safar@gmail.com>
6182 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
6183 refactorings required to resolve extension methods correctly when mixing
6184 generics and non-generics members.
6186 2007-11-20 Marek Safar <marek.safar@gmail.com>
6188 A fix for bug #342584
6189 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
6192 2007-11-19 Marek Safar <marek.safar@gmail.com>
6194 A fix for bug #342512
6195 * delegate.cs: Use delegate argument expression when is available. Don't
6196 emit virtual call when class is sealed.
6198 2007-11-16 Marek Safar <marek.safar@gmail.com>
6200 A fix for bug #325423
6201 * assign.cs (FieldInitializer): Use resolved expression for emit.
6203 * class.cs: Print less confusing error message.
6205 2007-11-16 Marek Safar <marek.safar@gmail.com>
6207 * cs-tokenizer.cs: Removed GMCS ifdefs.
6209 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
6212 * cs-parser.jay: Disabled nullable check.
6214 * generic-mcs: Copied more generic stuff.
6216 2007-11-16 Marek Safar <marek.safar@gmail.com>
6218 * gcs-parser.jay: Merged to cs-parser.jay.
6220 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
6221 * *.csproj, *.sources: Updated to use only jay parser file.
6223 2007-11-16 Marek Safar <marek.safar@gmail.com>
6225 * gcs-parser.jay: Added nullable and default expression feature checks.
6227 2007-11-16 Marek Safar <marek.safar@gmail.com>
6229 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
6230 it fixes many TODOs and hidden bugs.
6232 * expression: Removed duplicate error check.
6234 2007-11-15 Marek Safar <marek.safar@gmail.com>
6236 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
6237 implicitly type local variable only when it is used in a declaration.
6239 2007-11-15 Marek Safar <marek.safar@gmail.com>
6241 * attribute.cs: Use CS0612 for empty strings.
6243 2007-11-14 Marek Safar <marek.safar@gmail.com>
6245 * lambda.cs, statement.cs: Contextual return may act as a statement.
6247 2007-11-14 Marek Safar <marek.safar@gmail.com>
6249 A fix for a regression cause by #324222
6250 * class.cs: Don't report unused even when it implements an interface.
6252 2007-11-13 Marek Safar <marek.safar@gmail.com>
6254 A fix for bug #341205
6255 * ecore.cs, expression.cs: Method group expression cannot do static
6256 method access with an instance reference check before overloading takes
6259 2007-11-13 Marek Safar <marek.safar@gmail.com>
6261 A fix for bug #325359
6262 * class.cs: Use predictable name for automatically generated property.
6264 2007-11-12 Marek Safar <marek.safar@gmail.com>
6266 A fix for bug #324996
6267 * expression.cs (Is): Handle case where D is nullable and T is not
6270 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
6272 2007-11-12 Marek Safar <marek.safar@gmail.com>
6274 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
6275 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
6276 Flush small error reporting changes.
6278 2007-11-09 Marek Safar <marek.safar@gmail.com>
6280 A fix for bug #324996
6281 * expression.cs: Rewrote Is expression implementation to work with
6282 generics, nullable types, anonymous method. A const result expression
6283 uses existing infrastructure instead of custom not fully-featured one.
6285 2007-11-08 Marek Safar <marek.safar@gmail.com>
6287 A fix for bug #340202
6288 * class.cs: Consider generics for volatile field.
6290 2007-11-08 Marek Safar <marek.safar@gmail.com>
6292 A fix for bug #335594
6293 * expression.cs: Use conversion rules when handling string addition.
6295 2007-11-07 Marek Safar <marek.safar@gmail.com>
6297 A fix for bug #336651
6298 * expression.cs: Fixed a crash when probing is on.
6300 2007-11-07 Marek Safar <marek.safar@gmail.com>
6302 A fix for bug #324242
6303 * covert.cs: Added a conversion from any nullable-type with an
6304 underlying enum-type to the type System.Enum.
6306 2007-11-07 Marek Safar <marek.safar@gmail.com>
6308 A fix for bug #324222
6309 * class.cs: Report all non-used event fields.
6311 2007-11-07 Marek Safar <marek.safar@gmail.com>
6313 A fix for bug #325161
6314 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
6315 qualifier for generic types.
6317 2007-11-07 Marek Safar <marek.safar@gmail.com>
6319 A fix for bug #322971
6320 * expression.cs, ecore.cs: Added intermediate result value check for
6323 2007-11-07 Marek Safar <marek.safar@gmail.com>
6325 A fix for bug #324754
6326 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
6327 when it was requested.
6329 2007-11-07 Marek Safar <marek.safar@gmail.com>
6331 A fix for bug #325101
6332 * expression.cs: Do type not value comparison for `is' expression.
6334 2007-11-07 Marek Safar <marek.safar@gmail.com>
6336 A fix for bug #320236
6337 * convert.cs: Don't apply user conversion on underlying target type.
6339 2007-11-06 Marek Safar <marek.safar@gmail.com>
6341 * expression.cs: Don't use unresolved expression for error reporting.
6343 2007-11-06 Marek Safar <marek.safar@gmail.com>
6345 A fix for bugs #337712, #324490
6346 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
6347 overloading resolution too.
6349 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
6350 the process consistent and more robust.
6352 * expression.cs, linq.cs, report.cs: Update.
6354 2007-11-02 Marek Safar <marek.safar@gmail.com>
6356 A fix for bug #332909
6357 * attribute.cs: Resolve attributes in correct context using error
6360 * rootcontext.cs: Define Obsolete attribute members as core members.
6362 2007-11-02 Marek Safar <marek.safar@gmail.com>
6364 * statement.cs: Removed unused methods.
6366 2007-10-31 Wade Berrier <wberrier@novell.com>
6368 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
6369 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
6372 2007-10-31 Marek Safar <marek.safar@gmail.com>
6374 A fix for bug #338102
6375 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
6376 methods registered as non-generics.
6378 2007-10-31 Marek Safar <marek.safar@gmail.com>
6380 A fix for bugs #337712, #324490
6381 * delegate.cs: Delegate covariance and contravariance is not allowed for
6384 2007-10-31 Marek Safar <marek.safar@gmail.com>
6386 A fix for bug #337719
6387 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
6390 2007-10-30 Marek Safar <marek.safar@gmail.com>
6392 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
6394 2007-10-29 Marek Safar <marek.safar@gmail.com>
6396 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
6399 2007-10-29 Raja R Harinath <rharinath@novell.com>
6401 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
6403 2007-10-29 Marek Safar <marek.safar@gmail.com>
6405 A fix for bug #334652
6406 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
6407 extension methods when we have not found the best candidate in normal
6410 2007-10-27 Marek Safar <marek.safar@gmail.com>
6412 * AssemblyInfo.cs: Keep up-to-date.
6414 2007-10-27 Marek Safar <marek.safar@gmail.com>
6416 * Makefile: Fixed generics compiler name.
6418 2007-10-27 Marek Safar <marek.safar@gmail.com>
6420 * lambda.test: removed, lambda parsing is done differently.
6422 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
6424 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
6426 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
6428 2007-10-27 Marek Safar <marek.safar@gmail.com>
6430 * Makefile, *.sources : All C# compilers are in mcs folder.
6432 * *.cs: Use existing 2_1 define for smcs.
6434 2007-10-26 Marek Safar <marek.safar@gmail.com>
6436 A fix for bug #335847
6437 * assign.cs, expression.cs: Couple of changes to avoid creating a
6438 temporary variable for each object initializer assignment statement. It
6439 simplifies struct initialization too, otherwise two temporary variables
6441 Implemented optimization of redundant default element initializers.
6443 2007-10-25 Marek Safar <marek.safar@gmail.com>
6445 A fix for bug #336766
6446 * expression.cs (Class.CheckBase): Use generic name when method is
6449 2007-10-25 Marek Safar <marek.safar@gmail.com>
6451 A fix for bug #334737
6452 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
6453 variable and not variable argument for prepared copies.
6455 2007-10-24 Marek Safar <marek.safar@gmail.com>
6457 A fix for bug #325110
6458 * class.cs, expression.cs, attribute.cs: Use open generic method when
6459 checking conditional attribute.
6461 2007-10-24 Marek Safar <marek.safar@gmail.com>
6463 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
6464 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
6465 FeatureIsNotAvailable.
6467 2007-10-24 Marek Safar <marek.safar@gmail.com>
6469 ** C# 3.0 Partial methods
6471 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
6472 methods support. Because of member cache issue with generics only
6473 non-generics partial methods are fully supported.
6475 2007-10-23 Marek Safar <marek.safar@gmail.com>
6477 * class.cs, decl.cs: Rewrote member overloads check to cope with
6478 generics and to use member cache for member checking. It also improves
6479 performance and fixes remaining overloads issues.
6481 2007-10-20 Marek Safar <marek.safar@gmail.com>
6483 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
6484 roottypes.cs, typemanager.cs:
6486 A member cache creation logic changed to add members immediately and
6487 not rely on fallback. The member cache is now only prefered way
6488 how to access and find type declaration members. It saves 5 MB of memory
6489 during MWF compilation and makes code ready for more optimizations and
6490 clean-ups, it's also a pre-requirement for partial methods.
6492 2007-10-18 Raja R Harinath <harinath@gmail.com>
6494 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
6495 handling for generic parameters.
6497 2007-10-15 Marek Safar <marek.safar@gmail.com>
6499 * class.cs (FixedField): Removed redundant volatile check.
6501 2007-10-15 Marek Safar <marek.safar@gmail.com>
6503 * class.cs, decl.cs: Fixed overload members verification to do only one
6504 check per possible collision.
6506 2007-10-13 Marek Safar <marek.safar@gmail.com>
6508 A fix for bug #325478
6509 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
6510 and create only one disposable flags container.
6512 2007-10-12 Marek Safar <marek.safar@gmail.com>
6514 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
6515 * statement.cs (Fixed): Fixed variables cloning.
6517 2007-10-12 Marek Safar <marek.safar@gmail.com>
6519 A fix for bug #333342
6520 * class.cs (EventField): Don't mark value type event as synchronized.
6522 2007-10-12 Marek Safar <marek.safar@gmail.com>
6524 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
6525 inference to identify best candidate method correctly.
6526 (ProperyExpr): A range variable is read only and cannot be modified.
6528 2007-10-11 Marek Safar <marek.safar@gmail.com>
6530 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
6531 logic to identify best candidate method correctly.
6533 2007-10-11 Marek Safar <marek.safar@gmail.com>
6535 * location.cs (Equals, GetHashCode): Removed.
6537 2007-10-11 Marek Safar <marek.safar@gmail.com>
6539 * report.cs: Implemented message recorder. It is used mainly for lambda
6540 expressions to capture otherwise swallowed error messages.
6542 * anonymous.cs, lambda.cs.cs: Do full parameters check.
6544 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
6546 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
6548 * expression.cs (MemberAccess): Always report lookup failure.
6550 * location.cs: Implemented Equals, GetHashCode.
6552 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
6554 2007-10-10 Jb Evain <jbevain@novell.com>
6556 * codegen.cs: re-enable assembly version check.
6558 2007-10-09 Marek Safar <marek.safar@gmail.com>
6560 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
6563 * namespace.cs (UsingAlias): Do correct version check.
6565 2007-10-08 Marek Safar <marek.safar@gmail.com>
6567 * expresison.cs, ecore.cs: Issue extension method error message when
6570 * rootcontext.cs: Added ISO_2 compiler mode option.
6572 2007-10-08 Marek Safar <marek.safar@gmail.com>
6574 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
6577 2007-10-08 Marek Safar <marek.safar@gmail.com>
6579 * attribute.cs (GetString, GetBoolean): Work with both literal and
6582 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
6583 Moved method overload specific methods to MethodGroupExpr.
6585 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
6586 it should be less memory consuming.
6588 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
6590 * codegen.cs: remove the assembly version check until the buildbot is
6593 2007-10-07 Jb Evain <jbevain@novell.com>
6595 * attribute.cs (Attribute.GetString): if the value
6596 expression is a StringConstant, return its string value.
6598 2007-10-07 Jb Evain <jbevain@novell.com>
6600 * typemanager.cs: add `assembly_version_attribute_type`.
6601 * codegen.cs: on attribute emission, check that the
6602 AssemblyVersionAttribute doesn't overflow.
6604 2007-10-05 Marek Safar <marek.safar@gmail.com>
6606 A fix for bug #324677
6607 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
6608 parent container of a scope container with currently resolved one.
6610 2007-10-05 Marek Safar <marek.safar@gmail.com>
6612 A fix for bug #325534
6613 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
6616 2007-10-05 Marek Safar <marek.safar@gmail.com>
6618 A fix for bug #327504
6619 * class.cs (Operator.Define): Refactored implicit and explicit user
6620 operator conversion rules.
6622 2007-10-05 Marek Safar <marek.safar@gmail.com>
6624 A fix for bug #327520
6625 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
6627 2007-10-04 Marek Safar <marek.safar@gmail.com>
6629 A fix for bug #328022
6630 * class.cs (MethodData.Define): Use correct method to check whether
6631 a method implementents an accessor.
6633 2007-10-04 Marek Safar <marek.safar@gmail.com>
6635 A fix for bug #330069
6636 * statement.cs (Fixed.Resolve): Read the first array element only when
6637 an array is instantiated.
6639 2007-10-04 Marek Safar <marek.safar@gmail.com>
6641 * expression.cs, assign.cs, generics.cs: Print correct operator when
6642 compound assignment is used.
6644 2007-10-04 Marek Safar <marek.safar@gmail.com>
6646 A fix for bug #325841
6647 * expression.cs (ArrayAccess): Use full argument cloning only for
6648 string compound concatenation.
6650 2007-10-03 Marek Safar <marek.safar@gmail.com>
6652 A fix for bug #328774
6653 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
6655 (PropertyExpr.EmitAssign): Fixed string concatenation compound
6658 2007-10-03 Raja R Harinath <rharinath@novell.com>
6661 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
6662 Event accessibility checks here. Remove some bogus code that
6663 accidently made GenericMethods work.
6664 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
6666 2007-09-25 Marek Safar <marek.safar@gmail.com>
6668 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
6670 * statement.cs (Block): Refactored AddVariable to allow error handling
6673 * generic.cs: New stub.
6675 2007-09-23 Marek Safar <marek.safar@gmail.com>
6677 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
6680 2007-09-17 Marek Safar <marek.safar@gmail.com>
6682 * class.cs: Use partial container to record whether any partial part
6683 contains static field initializer and therefore default contructor has
6686 2007-09-14 Marek Safar <marek.safar@gmail.com>
6688 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
6689 mono-list when only one of two partial parts has defined accessibility
6692 2007-09-14 Marek Safar <marek.safar@gmail.com>
6694 A fix for bug #82845
6696 * class.cs (TypeContainer): Set correct resolve context for all field
6699 2007-09-13 Marek Safar <marek.safar@gmail.com>
6701 * assign.cs: Fixed a crash when field is resolved twice with an error.
6703 * codegen.cs: Changed InFieldInitializer to be flag.
6705 * anonymous.cs, ecore.cs, expression.cs: Update after
6706 IsInFieldInitializer rename.
6708 * const.cs: Removed unused parameter.
6710 * class.cs: Changed the way how we resolve and emit field initializers.
6711 The field initilizers have to have access to contructor block to emit
6712 compiler generated code.
6714 2007-09-13 Marek Safar <marek.safar@gmail.com>
6716 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
6717 generics use TypeContainer instead.
6719 2007-09-12 Marek Safar <marek.safar@gmail.com>
6721 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
6723 * lambda.cs (ResolveParameters): Use more powerful
6724 InflateGenericArgument.
6726 * parameters.cs: Better exception message.
6728 2007-09-10 Marek Safar <marek.safar@gmail.com>
6730 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
6731 correct expression block type.
6733 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
6735 * expression.cs (Invocation): Extracted method group resolve to
6738 2007-09-07 Marek Safar <marek.safar@gmail.com>
6740 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
6741 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
6743 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
6744 generic extension methods.
6746 2007-09-06 Marek Safar <marek.safar@gmail.com>
6748 A fix for bug #82676 (Do I get it right now?)
6749 * convert.cs (Binary.ResolveOperator): An interface is converted to the
6750 object before a standard conversion is applied.
6752 2007-09-06 Marek Safar <marek.safar@gmail.com>
6754 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
6757 2007-09-05 Marek Safar <marek.safar@gmail.com>
6759 A fix for bug #82676
6760 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
6761 non-generic interface types.
6763 2007-09-05 Marek Safar <marek.safar@gmail.com>
6765 A fix for bug #82690
6766 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
6768 2007-09-05 Marek Safar <marek.safar@gmail.com>
6770 A fix for bug #82571
6771 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
6772 modifier for container based methods.
6774 2007-09-05 Marek Safar <marek.safar@gmail.com>
6776 A fix for bug #82676
6777 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
6778 any interface-type T means to any of interface type T.
6780 2007-09-04 Marek Safar <marek.safar@gmail.com>
6782 * namespace.cs: We have 2 versions of System.Core assembly.
6784 2007-09-04 Marek Safar <marek.safar@gmail.com>
6786 A fix for bug #82652
6787 * class.cs (Class.GetClassBases): Compare types and not expressions.
6789 2007-09-04 Marek Safar <marek.safar@gmail.com>
6791 A fix for bug #82620
6792 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
6793 actually never worked before.
6794 (IndexerAccess): Emit prepared arguments before they are modified.
6796 2007-09-04 Marek Safar <marek.safar@gmail.com>
6798 A fix for bug #82563
6799 * assign.cs: Revert wrong fix.
6801 * expression.cs (VariableReference.EmitAssign): Handle ref reference
6803 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
6804 Instead of ldelema/stdind we have to use temporary variables to handle
6805 cases like String.Concat (params string[]).
6807 2007-08-31 Marek Safar <marek.safar@gmail.com>
6809 * class.cs: EmitAttributes to Emit rename.
6811 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
6813 (MemberCore.HasClsCompliantAttribute): Don't depend on
6814 GetClsCompliantAttributeValue execution.
6816 2007-08-31 Marek Safar <marek.safar@gmail.com>
6818 * anonymous.cs: Use shorter type prefix.
6820 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
6823 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
6824 variables when probing is on.
6826 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
6827 unresolved variables.
6828 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
6829 handle transparent identifiers.
6831 2007-08-26 Marek Safar <marek.safar@gmail.com>
6833 * attribute.cs (IsClsCompliant): Add nullable types test.
6835 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
6837 * doc.cs : catch other types of exception than XmlException to
6838 report CS1570. Fixed bug #82565.
6840 2007-08-23 Marek Safar <marek.safar@gmail.com>
6842 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
6843 The number of delegate parameters has to match.
6844 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
6847 2007-08-21 Marek Safar <marek.safar@gmail.com>
6849 * anonymous.cs (AnonymousMethod): Generate private anonymous method
6850 to fix problem with private arguments.
6852 2007-08-20 Marek Safar <marek.safar@gmail.com>
6854 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
6856 * decl.cs (MemberName): Ignore generic type with no generic arguments.
6858 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
6859 empty. Add cloning suport.
6861 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
6863 2007-08-20 Marek Safar <marek.safar@gmail.com>
6865 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
6866 to create EmptyCast. It handles EmptyConstantCast specialization for
6869 2007-08-18 Marek Safar <marek.safar@gmail.com>
6871 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
6872 (EmitArrayArgument): One routine for array arguments.
6873 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
6875 2007-08-17 Marek Safar <marek.safar@gmail.com>
6877 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
6879 2007-08-17 Marek Safar <marek.safar@gmail.com>
6881 * anonymous.cs: MemberLookupFinal update.
6883 * class.cs (ConstructorInitializer): Is expression based.
6885 * delegate.cs: MethodGroupExpr update.
6887 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
6889 (Error_MemberLookupFailed): Customizable error override.
6890 (MethodGroupExpr): Keep queried type for later usage.
6891 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
6894 * expression.cs: Error_MemberLookupFailed refactoring.
6895 (New.DoResolve): Resolve as much as possible.
6896 (ElementInitializer.Error_MemberLookupFailed): Object initializer
6897 customization for invalid member types.
6899 * statement.cs: MethodGroupExpr update.
6901 2007-08-16 Marek Safar <marek.safar@gmail.com>
6903 * modifier.cs (Check): Check all modifiers and not only accessibility
6906 2007-08-16 Marek Safar <marek.safar@gmail.com>
6908 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
6909 type and not an expression.
6911 2007-08-16 Marek Safar <marek.safar@gmail.com>
6913 * statement.cs (Catch.Clone): Type and variable can be null.
6915 2007-08-16 Marek Safar <marek.safar@gmail.com>
6917 A fix for bug #81979
6918 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
6919 I am really not sure whether this is the best fix.
6921 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
6924 2007-08-14 Marek Safar <marek.safar@gmail.com>
6926 ** C# 3.0 Object and collection initializers (major re-write)
6928 * assign.cs (DoResolve): Initializers are not assign related.
6930 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
6931 used during collection or object initialization.
6933 * expression.cs (Error_InvalidArguments): Add initializers specific
6934 messages. More will come later because it requires some general
6936 (New.DoResolve): Better error handling for unsafe types.
6937 (EmptyExpressionStatement): New class.
6938 (ElementInitializer): An object initializer expression.
6939 (CollectionElementInitializer): A collection initializer expression.
6940 (CollectionOrObjectInitializers): A block of object or collection
6942 (NewInitialize): New expression with element/object initializers.
6944 * statement.cs: Reverted object/collection initializer hacks.
6946 * typemanager.cs (CSharpName): Filter __arglist type.
6948 2007-08-09 Marek Safar <marek.safar@gmail.com>
6950 ** C# 3.0 Anonymous Types (update to the latest standard)
6952 * expression.cs (Binary.ResolveOperator): Threat all null based types
6954 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
6955 (AnonymousTypeParameter): Updated.
6957 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
6958 (AnonymousTypeClass): New anonymous type container.
6960 * class.cs (AddField): Return operation result.
6962 * generic.cs: Another empty TypeArguments overload.
6964 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
6965 are stored at top of normal hierarchy.
6967 * typemanager.cs (CSharpName): Filter anonymous types.
6969 2007-08-09 Marek Safar <marek.safar@gmail.com>
6971 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
6972 as single Concat call. How could we miss that :-(
6974 2007-08-08 Marek Safar <marek.safar@gmail.com>
6976 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
6978 2007-08-07 Miguel de Icaza <miguel@novell.com>
6980 * expression.cs: Fix the previous commit, the creation of the
6981 arguments array list needs also to be conditional on the arguments
6984 * class.cs: Add a little bit of help to help narrow down problems.
6986 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
6987 not try to copy in that case.
6989 * driver.cs: When building SMCS, include a new different set of
6990 default assemblies here. Do this here so we can control whether
6991 to include the default assemblies with /noconfig.
6993 2007-08-03 Marek Safar <marek.safar@gmail.com>
6995 A fix for bug #81979
6996 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
6999 2007-08-03 Marek Safar <marek.safar@gmail.com>
7001 A fix for bug #82300
7003 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
7004 we are in probing scope.
7006 2007-08-03 Marek Safar <marek.safar@gmail.com>
7008 A fix for bug #82301
7010 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
7011 (Statement.CloneTo): Clone and not map children blocks.
7013 2007-08-03 Marek Safar <marek.safar@gmail.com>
7015 A fix for bug #82299
7017 * expression.cs (LocalVariableReference.CloneTo): Remap local info
7020 * statement.cs (Statement.CloneTo): Clone variables before statements
7021 to allow remaping of local variables.
7023 2007-08-03 Marek Safar <marek.safar@gmail.com>
7025 A fix for bug #82296
7028 * report.cs: Log crash details for future clone problems.
7030 * statement.cs (Return.Clone): Don't clone non-existent expression.
7032 2007-08-03 Raja R Harinath <harinath@gmail.com>
7034 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
7035 (Class.AddBasesForPart): Move CS0537 check here from ...
7036 * cs-parser.jay (class_declaration): ... here. Move calling of
7037 'AddBasesForPart' to ...
7038 (class_bases): ... here.
7039 (struct_declaration, interface_declaration): Update to changes.
7041 2007-08-02 Marek Safar <marek.safar@gmail.com>
7043 A fix for bug #81923
7045 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
7046 conversion is allowed.
7048 2007-08-02 Marek Safar <marek.safar@gmail.com>
7050 A fix for bug #81564
7052 * ecore.cs (EventExpr): Add IsBase handling.
7054 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
7057 2007-08-02 Raja R Harinath <harinath@gmail.com>
7059 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
7060 * cs-parser.jay: Some whitespace cleanups.
7061 (current_delegate): New.
7063 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
7064 a dummy code block, and use 'type_name' instead of 'member_name'.
7065 (interface_declaration, class_declaration): Likewise.
7066 (delegate_declaration): Likewise. Rearrange slightly and use
7068 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
7069 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
7071 2007-08-02 Marek Safar <marek.safar@gmail.com>
7073 A fix for bug #82039
7075 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
7078 * typemanager.cs (CSharpName): Split to string overload.
7080 2007-08-02 Marek Safar <marek.safar@gmail.com>
7083 * report.cs: Updated warning CS0472.
7085 2007-08-01 Marek Safar <marek.safar@gmail.com>
7087 A fix for bug #82181
7089 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
7091 2007-08-01 Marek Safar <marek.safar@gmail.com>
7093 A fix for bug #82277
7094 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
7096 2007-08-01 Marek Safar <marek.safar@gmail.com>
7098 ** C# 3.0 Type Inference (major bits are working)
7100 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
7101 (.ImplicitStandardConversionExists): Uses compatible.
7102 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
7103 (.InferReturnType): New method.
7104 (.Compatible): Refactored.
7105 (.ResolveParameters): Uses factory to create resolved parameters.
7106 (.CompatibleMethod): Add probing mode support.
7107 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
7108 clearly distinguish between 2 different operations.
7109 (LambdaMethod): Moved to lambda.cs.
7110 (AnonymousMethod): Removed unused fields and methods.
7111 (AnonymousDelegate): Simplified.
7113 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
7115 * convert. cs (ImplicitConversionStandard): Compatible works differently.
7117 * delegate.cs (Delegate): New mehods to reduce code duplication.
7118 (.GetConstructor): New method.
7119 (.GetInvokeMethod): New method.
7120 (DelegateCreation): Updated.
7122 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
7124 (OverloadResolve): Made probing little bit faster.
7126 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
7129 * generic.cs (TypeInferenceContext): Dummy implementation.
7131 * iterators.cs: Updated after Resolve/Define rename.
7133 * lambda.cs (LambdaExpression)
7134 (.ResolveParameters): Handles both type of arguments and type inference too.
7136 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
7137 (InflateTypes): Updated.
7139 * support.cs (InflateTypes): Changed signature and updated.
7141 * typemanager.cs (LookupMemberCache): Better dynamic type check.
7142 (MemberLookup_FindMembers): More MS tricks.
7143 (GetParameterData): Ditto.
7144 (GetDelegateParameters): Uses quick path for dynamic types.
7146 2007-08-01 Marek Safar <marek.safar@gmail.com>
7148 * class.cs (MethodData.Define): EmitContext is required for generic stuff
7151 2007-07-31 Marek Safar <marek.safar@gmail.com>
7153 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
7156 2007-07-26 Jb Evain <jbevain@novell.com>
7158 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
7159 which takes a boolean 'report_errors', similar to the GetMethod.
7160 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
7161 in .net 2.1, do not report errors here.
7163 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
7164 System.Runtime.CompilerServices.RequiredAttributeAttribute and
7165 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
7168 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
7169 of the type InternalsVisibleToAttribute before the first call
7170 to CoreLookupType which is allowed to fail (third boolean parameter
7171 to true). Because, during the resolution for a type that is not
7172 immediately found, we try to check if the type is not defined in
7173 a friend assembly, and to do so, we need the
7174 InternalVisibleToAttribute.
7176 2007-07-23 Miguel de Icaza <miguel@novell.com>
7178 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
7179 feature that allows structs to be compared against null and inline
7180 the result as true or false.
7182 Notice that the same code is not permitted inside a generic block
7183 of code that would do:
7185 class Foo<T> where T : struct {
7192 It is only allowed if the type of T is not bound (no where
7193 clause). In my opinion, this CSC 2 behavior is broken but people
7194 seem to be using it (IronRuby does, a few bug reports on bugzilla
7195 have it and some people have complained about it).
7197 All of the users that depend on this behavior have code that is
7200 * report.cs (Warning, Error): make these take object arguments,
7201 not strings, as that allows us to take advantage of Format.
7203 2007-07-20 William Holmes <billholmes54@gmail.com>
7205 * decl.cs: Changed MemberName.CountTypeArguments to also check the
7206 Left member variable for the Count.
7207 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
7208 MemberName.CountTypeArguments to avoid a NRE.
7210 This code is contributed under the MIT X11 license
7212 2007-07-18 Marek Safar <marek.safar@gmail.com>
7214 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
7216 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7218 * doc.cs : generic method arguments are written as ``x while generic
7219 type arguments are `x. Combined with the previous change, fixed bug
7222 2007-07-18 Raja R Harinath <rharinath@novell.com>
7225 * expression.cs (Binary.ResolveOperator): When converting
7226 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
7228 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7230 * doc.cs : when T: or whatever x: is specified, it does not really
7231 check the doc comment's syntax correctness. Fixed bug #82006.
7233 2007-07-18 Marek Safar <marek.safar@gmail.com>
7235 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
7236 LambdaExpression better.
7238 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
7240 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
7242 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
7243 as it can be generated.
7245 * expression.cs (Invocation.Error_InvalidArguments): Show correct
7248 * lambda.cs (LambdaExpression): Refactored to share same code with
7249 AnonymousMethodExpression.
7251 2007-07-17 Marek Safar <marek.safar@gmail.com>
7253 * anonymous.cs (MakeName): Include host name for easier debugging.
7254 (LambdaMethod): New class for lambda spcecific stuff.
7256 * attribute.cs: Set EmitContext return type.
7258 * class.cs: Set EmitContext return type.
7260 * codegen.cs (EmitContext): Return type cannot be null to stop messing
7261 with null/void meaning.
7263 * iterators.cs (ContainerType): Implemented.
7265 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
7267 * statement.cs (Return): Updated to lambda expressions.
7268 (Block.CloneTo): Parent can be null.
7270 2007-07-13 Marek Safar <marek.safar@gmail.com>
7272 A fix for bug #81917
7273 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
7275 * class.cs (FixedField): Check whether field is in unsafe scope.
7277 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
7278 (FieldExpr.Emit): Fixed buffers cannot be volatile.
7280 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
7283 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
7285 2007-07-13 Marek Safar <marek.safar@gmail.com>
7287 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
7288 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
7291 2007-07-13 Marek Safar <marek.safar@gmail.com>
7293 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
7295 2007-07-13 Marek Safar <marek.safar@gmail.com>
7297 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
7298 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
7300 * codegen.cs(EmitContext): Add ProbingMode flag.
7302 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
7304 * driver.cs: For now set both warning values.
7306 * ecore.cs (SimpleName): Name is readonly.
7307 (MethodGroup.OverloadResolve): One quick path for probing.
7309 * expression.cs (Unary): Set Oper r/o.
7310 (Binary): Set Oper r/o.
7311 (ParameterReference): Set few instance variables as r/o.
7312 (ParameterReference.DoResolveBase): Don't capture aruments when
7314 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
7315 (Arglist): arguments are private.
7316 (SizeOf): type is private and r/o.
7317 (MemberAccess): arguments are private.
7319 * report.cs: Enhanced reporting on/off capabilities.
7321 * lambda.cs: Uses ec.IsInProbingMode.
7322 (ContextualReturn): Derives from return.
7324 * rootcontext.cs: For now set both warning values.
7326 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
7328 (Return.Resolve): Don't die immediately.
7329 (Block.Resolve): Speed-up probing.
7330 (Block.CloneTo): Clone only child blocks.
7332 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
7334 * iterators.cs: reverted Miguel's latest change (r81925) as it
7335 breaks the build in System.
7337 2007-07-13 Miguel de Icaza <miguel@novell.com>
7339 * iterators.cs (Yield.CheckContext): Check for the iterator type
7340 also here as we can call into Yield even in codepaths that are not
7342 (MethodOrOperator is the only path that was checked).
7344 In addition to the standard check, use a more specific check for
7345 constructors to report a more verbose error.
7347 2007-07-12 Miguel de Icaza <miguel@novell.com>
7349 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
7350 report the warning and continue
7352 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
7353 values on the stack on the call to Emit. Use EmitStatement if
7354 possible, or using Emit + Pop if not possible. Fixes #82064
7356 2007-07-12 Raja R Harinath <rharinath@novell.com>
7358 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
7359 avoid try...finally in some cases.
7361 2007-07-10 Marek Safar <marek.safar@gmail.com>
7363 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
7365 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
7366 instead of method. Re-use standard error handling.
7367 (ConstructorInitializer.Emit): Simplified.
7369 * delegate.cs: Updated after Invocation.EmitCall change.
7371 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
7372 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
7373 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
7374 method and don't permanently changing input arguments.
7375 (MethodGroupExpr): Introduced resolved best_candidate, when method group
7376 is resolved it has one of the candidates is the best one which is later
7377 used to emit. Removed a few unused method.
7378 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
7380 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
7381 (Binary.ResolveOperator): Ditto.
7382 (ConditionalLogicalOperator.DoResolve): Ditto.
7383 (Invocation): Uses method group.
7384 (Invocation.DoResolve): Simplified.
7385 (Invocation.EmitCall): Removed useless is_static.
7386 (Invocation.Emit): Delegate to method group.
7387 (Invocation.EmitStatement): Simplified.
7388 (New): Uses method group.
7389 (MemberAccess.DoResolve): Don't destroy original expression.
7391 * statement.cs (ForEach.Resolve): Use null for no method arguments.
7393 2007-07-04 Marek Safar <marek.safar@gmail.com>
7395 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
7398 * lambda.cs: Add custom error message type.
7400 2007-07-03 Marek Safar <marek.safar@gmail.com>
7402 * lambda.cs: Simplified little bit.
7404 * parameter.cs: Introduced ImplicitLambdaParameter.
7405 (Parameters.CreateFullyResolved): New factory instead of ctor.
7409 * delegate.cs: Updated parameter creation.
7411 2007-07-03 Marek Safar <marek.safar@gmail.com>
7413 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
7416 * generic.cs: Synchronized with gmcs.
7418 2007-07-03 Marek Safar <marek.safar@gmail.com>
7420 * class.cs (Indexer): Check return type as soon as possible.
7422 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
7425 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
7427 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
7429 * parameter.cs (Parameter): Use expression type when it is available.
7431 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
7432 method modifier for the first parameter only.
7434 2007-06-24 Marek Safar <marek.safar@gmail.com>
7436 A fix for bug #81938
7437 * typemanager.cs (ChangeType): Fixed couple of char conversions.
7439 * constant.cs: Tide up an exception message.
7441 2007-06-22 Marek Safar <marek.safar@gmail.com>
7443 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
7444 an uninitialized variable is used.
7446 * expression.cs (LocalVariableReference.DoResolve): Ditto.
7448 2007-06-22 Marek Safar <marek.safar@gmail.com>
7450 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
7451 not found error handling.
7453 * expression.cs (ArrayCreation): Removed redundant fields and little bit
7455 (ArrayCreation.ResolveArrayElement): To be ready to customization.
7456 (ArrayCreation.DoResolve): Simplified.
7457 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
7458 its own resolve process.
7459 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
7461 2007-06-20 Marek Safar <marek.safar@gmail.com>
7463 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
7466 2007-06-20 Marek Safar <marek.safar@gmail.com>
7468 * cs-tokenizer.cs: Removed var related stuff.
7470 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
7471 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
7472 a type and a keyword at same time.
7474 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
7477 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
7478 implicitly typed arrays, more changes will follow.
7480 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
7482 2007-06-19 Marek Safar <marek.safar@gmail.com>
7484 * ecore.cs (VarExpr): Removed Handled field.
7486 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
7487 build-in assign functionality.
7488 (ForEach.Resolve): Removed all implicitly typed local variable code and
7490 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
7491 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
7493 2007-06-18 Marek Safar <marek.safar@gmail.com>
7495 * assign.cs: Removed implicitly typed local variable check.
7497 * expression.cs (LocalVariableReference.DoResolve): Add check for self
7498 referencing implicitly typed local variable.
7499 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
7502 * statement.cs (Fixed): Removed unsupported implicitly typed local
7505 2007-06-15 Marek Safar <marek.safar@gmail.com>
7507 * decl.cs (MemberName): Moved all Unbound stuff to parser.
7509 2007-06-14 Marek Safar <marek.safar@gmail.com>
7511 A fix for bugs #81855 and #76274
7512 * attribute.cs (AttachTo): Always set owner for global attributes to
7515 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
7518 * cs-parser.jay: Assembly and module attributes must precede all other
7519 elements except using clauses and extern alias declarations.
7521 2007-06-13 Marek Safar <marek.safar@gmail.com>
7523 A fix for bug #81748
7525 * expression.cs: More checks for non ISO-1 features.
7527 2007-06-12 Marek Safar <marek.safar@gmail.com>
7529 A fix for bug #81807
7530 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
7531 present inside switch statement and it is required by nullable check.
7533 2007-06-12 Marek Safar <marek.safar@gmail.com>
7535 A fix for bug #81840
7536 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
7537 when type matching fails.
7539 * namespace.cs: Tiny error message change.
7541 2007-06-12 Marek Safar <marek.safar@gmail.com>
7543 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
7544 reporting. Added automatic property check.
7546 * class.cs: Updated after CheckAbstractAndExtern relocation.
7547 (AEventPropertyAccessor.GetSignatureForError): Customized.
7549 2007-06-11 Marek Safar <marek.safar@gmail.com>
7551 * class.cs (DefineBaseTypes): Base type can be undefined.
7553 * ecore.cs (TypeLookup): Minor refactoring.
7554 (DoResolveAsTypeStep): Removed redundant check.
7556 * namespace.cs (Lookup): Removed redundant check.
7558 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
7559 ResolveAsTypeTerminal step.
7560 (BootstrapCorlib_*): Simplified.
7561 (PopulateCoreType): Core types can be now external.
7563 2007-06-07 Marek Safar <marek.safar@gmail.com>
7565 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
7567 (InferTypeArguments): Infers anonymous expression type arguments.
7568 (Compatible): Split to Compatible and InferTypeArguments.
7570 * lambda.cs: Updated.
7572 2007-06-08 Marek Safar <marek.safar@gmail.com>
7574 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
7576 2007-06-07 Raja R Harinath <harinath@gmail.com>
7578 Fix #80477, cs0135-2.cs, cs0135-3.cs
7579 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
7580 names to the "known" variables list.
7581 (Block.CheckInvariantMeaningInBlock): Handle the fact the
7582 parameter names are also "known".
7583 (Block.CheckError136): Remove.
7584 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
7587 2007-06-07 Marek Safar <marek.safar@gmail.com>
7589 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
7591 2007-06-06 Marek Safar <marek.safar@gmail.com>
7593 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
7594 internal error not an user error.
7596 * expression.cs (IsApplicable): Refactored to make debugging easier.
7598 * support.cs: More tricks for non-mono runtimes.
7600 * typemanager.cs (CoreLookupType): Made public.
7601 (InitSystemCore): All linq specific stuff moved to linq.cs
7603 2007-06-05 Marek Safar <marek.safar@gmail.com>
7605 * typemanager.cs (CSharpSignature): One more missing build-in types
7607 More tricks for non-mono runtime.
7609 2007-06-05 Raja R Harinath <harinath@gmail.com>
7611 * statement.cs (Block.CheckError136_InParents): Remove.
7612 (Block.AddVariable): Use GetParameterInfo instead.
7613 (ToplevelBlock.ProcessArguments): Likewise.
7615 2007-06-04 Raja R Harinath <rharinath@novell.com>
7617 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
7619 (ToplevelBlock.GetParameterInfo): Split out of ...
7620 (ToplevelBlock.GetParameterRefernce): ... this.
7621 (ToplevelBlock.ParameterMap): Remove.
7622 * expression.cs (ParameterReference): Update to use
7623 ToplevelParameterInfo.
7625 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
7628 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
7629 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
7631 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
7632 (ToplevelBlock.ProcessParameters) ... here.
7633 (ToplevelBlock..ctor): Invoke it.
7635 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
7638 * statement.cs (IKnownVariable): New interface.
7639 (LocalInfo): Implement it.
7640 (ToplevelParameterInfo): New class.
7641 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
7642 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
7643 GetKnownVariableInfo.
7645 2007-06-03 Raja R Harinath <harinath@gmail.com>
7647 Partly speed up CS0136 error checks.
7648 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
7649 'recurse' parameter.
7650 (Block.DoCheckError136): Only check errors in parameters. Move
7651 local variable checks ...
7652 (Block.AddVariable): ... here, and ...
7653 (ToplevelBlock.ResolveMeta): ... here.
7655 2007-06-02 Raja R Harinath <harinath@gmail.com>
7657 * statement.cs (Block.IsChildOf): Remove.
7659 * statement.cs (Statement.Clone): Move special case code ...
7660 (Block.CloneTo): ... here.
7662 2007-05-29 Raja R Harinath <rharinath@novell.com>
7664 * statement.cs (ToplevelBlock.container): Remove field. It's
7665 redundant with 'Parent'.
7666 (ToplevelBlock.ContainerBlock): Remove accessor.
7667 (ToplevelBlock..ctor): Update to changes. Register anonymous
7668 child with parent here, ...
7669 * cs-parser.jay (end_anonymous): ... not here. Don't modify
7671 (start_anonymous): Don't save current_block.
7672 (top_current_block): Remove.
7674 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
7675 (Block.Resolve): Update to changes.
7676 (Block..ctor): Move setting of "correct" 'Toplevel'
7677 and 'Explicit' fields to ...
7678 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
7680 2007-05-27 Raja R Harinath <harinath@gmail.com>
7683 * statement.cs (Block.Implicit): Remove.
7684 (Block): Update to changes.
7685 * flowanalysis.cs: Likewise.
7687 Mildly speed up CheckInvariantMeaningInBlock
7688 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
7689 Recursively call AddKnownVariable to all enclosing blocks.
7690 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
7691 Remove recursive calls.
7692 (Block): Update to changes.
7694 New ExplicitBlock invariants
7695 * statement.cs (Block.Explicit): New field. It points to the
7696 immediately enclosing non-implicit block.
7697 (Block..ctor): Maintain the invariant.
7698 * cs-parser.jay: Take advantage of invariant.
7700 Introduce ExplicitBlock
7701 * statement.cs (ExplicitBlock): New.
7702 (ToplevelBlock): Derive from it.
7703 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
7705 (Block.Implicit): Update to changes.
7706 * cs-parser.jay: Update to changes.
7709 * codegen.cs (EmitContext.IsLastStatement): Remove.
7710 * statement.cs (Block.DoEmit): Update to changes.
7712 2007-05-25 Raja R Harinath <rharinath@novell.com>
7714 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
7715 modifying current_block directly.
7717 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
7719 * class.cs: Implemented automatic properties (C# 3.0)
7720 Thanks to Marek for the help.
7722 2007-05-23 Raja R Harinath <rharinath@novell.com>
7724 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
7725 variable as assigned, note also that all its components are
7727 (MyBitVector.SetRange): New. Function to set multiple bits to true.
7729 2007-05-19 Marek Safar <marek.safar@gmail.com>
7731 * anonymous.cs, class.cs: Emit Compiler generated attribute when
7732 member is marked as compiler generated.
7734 * decl.cs (MemberCore): Refactored ModFlags into property.
7736 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
7737 (Check): Check only accessibility modifiers.
7739 2007-05-18 Raja R Harinath <rharinath@novell.com>
7741 Track all assignable slots in one bit array
7742 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
7743 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
7744 logic from VariableMap constructor here. Use the same 'offset'
7745 variable that's later used for computing offsets of local
7747 * flowanalysis.cs (UsageVector.parameters): Remove.
7748 (UsageVector): Update to changes.
7749 (VariableMap): Remove.
7751 Avoid creating ParameterMap in every block
7752 * statement.cs (Block.ParameterMap): Move ...
7753 (ToplevelBlock.ParameterMap): ... here.
7754 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
7756 * flowanalysis.cs (FlowBranching.param_map): Remove.
7757 (FlowBranching.UsageVector): Update to changes.
7758 (FlowBranchingToplevel.CheckOutParameters): Likewise.
7760 * statement.cs (Block.CloneTo): Clone Toplevel field too.
7762 * expression.cs (ParameterReference): Distinguish between block
7763 where parameter was referenced and declared.
7765 2007-05-18 Marek Safar <marek.safar@gmail.com>
7767 * flowanalysis.cs, statement.cs: Put back improved error handling.
7769 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
7773 Imporved object and collection initialization (C# 3.0).
7775 2007-05-15 Marek Safar <marek.safar@gmail.com>
7777 A fix for bug #81380
7778 * expression.cs (Is.DoResolve): Only value types have constant `is'
7781 2007-05-15 Raja R Harinath <rharinath@novell.com>
7783 * statement.cs (ToplevelBlock.child): Remove.
7785 2007-05-15 Raja R Harinath <harinath@gmail.com>
7787 Rationalize ResolveMeta: refactoring
7788 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
7789 out constant handling code into ...
7790 (Block.DoResolveConstants): ... this.
7792 Rationalize ResolveMeta: kill local_map
7793 * statement.cs (Block.local_map, Block.LocalMap): Remove.
7794 (Block.AssignableSlots): New.
7795 (Block.ResolveMeta): Make protected. Don't create a VariableMap
7796 for locals -- move code from VariableMap here. Avoid unnecessary
7798 * flowanalysis.cs (FlowBranching.local_map): Remove.
7799 (FlowBranching..ctor): Use Block.AssignableSlots.
7800 (VariableMap): Remove unused constructors.
7802 2007-05-11 Raja R Harinath <rharinath@novell.com>
7804 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
7806 2007-05-11 Marek Safar <marek.safar@gmail.com>
7808 * typemanager.cs (IsFriendAssembly): Should not be called for building
7811 2007-05-09 Marek Safar <marek.safar@gmail.com>
7813 * literal.cs (NullConstant): Print null in all cases.
7815 * expression.cs (Binary.ResolveOperator): Implemented delegate
7816 comparison based on C# 2.0 changes.
7818 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
7820 This code is contributed under the MIT X11 license
7822 The following enables support for several C# 3.0 language features:
7824 * cs-tokenizer.cs: Added support for the "var" keyword.
7826 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
7827 Added VarExpr class to facilitate type inferencing.
7829 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
7830 to support anonymous types.
7832 * assign.cs: Added support for type inferencing and initialization.
7834 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
7836 * expression.cs: Added implicit array support to ArrayCreation.
7837 Added 5 types and 1 interface:
7839 IInitializable Implementing classes can inject initializing
7840 statements after object instantiation.
7842 Initializer Stores data for object initialization.
7844 AnonymousType An expression for anonymous types.
7846 AnonymousTypeParameter Stores data about an anonymous type's field.
7848 NewInitialize An expression for object initialization.
7850 CollectionInitialize An expression for collection initialization.
7852 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
7855 2007-05-06 Marek Safar <marek.safar@gmail.com>
7857 A fix for bug #81500
7858 * cs-tokenizer.cs: Add special handling for coalescing operator.
7860 2007-05-06 Marek Safar <marek.safar@gmail.com>
7862 A fix for bug #81529
7863 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
7864 its value from base class until it is redefined.
7866 2007-05-02 Raja R Harinath <rharinath@novell.com>
7868 Fix regression in cs0631-3.cs
7869 * cs-parser.jay (operator_declarator): Add opt_attributes to error
7870 fallback. Make error fallback catch more cases.
7872 2007-05-01 Miguel de Icaza <miguel@novell.com>
7874 * cs-parser.jay: Allow parameters in operator declarations to have
7877 2007-04-27 Miguel de Icaza <miguel@novell.com>
7879 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
7882 * lambda.cs (ContextualReturn.Resolve): An expression is valid
7883 inside the ContextualReturn, it does not have to be an
7884 ExpressionStatement.
7886 2007-04-24 Miguel de Icaza <miguel@novell.com>
7888 * lambda.cs (ContextualReturn.Resolve): if the return type is not
7891 2007-04-23 Miguel de Icaza <miguel@novell.com>
7893 * anonymous.cs (AnonymousContainer): split the virtual Resolve
7894 method in two methods: ResolveNoDefine and Resolve.
7896 ResolveNoDefine will stop just after ResolveTopBlock has been
7899 Resolve will then continue by creating a method and issuing the
7900 call to method.Define ().
7902 (AnonymousMethod): Split and implement the new Resolve and
7903 ResolveNoDefine as well.
7905 * lambda.cs (LambdaExpression): Split the anonymous method
7906 resolution code into a separate routine (CoreCompatibilityTest)
7907 from DoCompatibleTest.
7909 (LambdaExpression.TryBuild): New method, this method tries to
7910 build the LambdaExpression with the given set of types to be used
7911 as the types for the various parameters of the lambda expression.
7913 If the compilation succeed with the given types, the infered type
7914 of the Anonymous method is returned, otherwise null is returned.
7916 2007-04-23 Marek Safar <marek.safar@gmail.com>
7918 A fix for bug #81414
7919 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
7921 2007-04-22 Miguel de Icaza <miguel@novell.com>
7923 * cs-tokenizer.cs: Change various identifiers here from the
7924 camelCasing to the recommended Linux-like style for instance
7925 variables from the Coding Guidelines.
7927 2007-04-19 Martin Baulig <martin@ximian.com>
7930 (Convert.ImplicitReferenceConversionCore): Allow conversions from
7931 System.Enum to System.ValueType.
7933 2007-04-13 Martin Baulig <martin@ximian.com>
7935 Rewrote implicit reference conversions. We need to distinguish
7936 between implicit reference conversions (13.1.4) and implicit
7937 boxing conversions (13.1.5).
7939 According to the spec, there's an an implicit conversion
7940 "From a one-dimensional array-type S[] to IList<T> and base
7941 interfaces of this interface, provided there is an implicit
7942 reference conversion from S to T." Note that this does not
7943 include boxing conversions.
7946 (Convert.ImplicitTypeParameterBoxingConversion): New method.
7947 (Convert.ImplicitReferenceConversion): Split into
7948 ImplicitReferenceConversionCore() and
7949 ImplicitBoxingConversionExist().
7950 (Convert.ImplicitReferenceConversionExists): Use the new
7951 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
7953 2007-04-12 Martin Baulig <martin@ximian.com>
7955 * convert.cs (Convert.ImplicitReferenceConversion): Move the
7956 `TypeManager.null_type' checks up to the top of the method.
7958 2007-04-11 Marek Safar <marek.safar@gmail.com>
7960 A fix for bug #81350
7961 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
7964 2007-04-11 Martin Baulig <martin@ximian.com>
7966 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
7967 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
7968 to make this work for generic classes; fixes #79561.
7970 2007-04-11 Martin Baulig <martin@ximian.com>
7972 * expression.cs (As): Add support for nullable types; fixes #79371.
7974 2007-04-11 Martin Baulig <martin@ximian.com>
7976 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
7977 `type.FullName' is null; fixes #80243.
7979 2007-04-11 Martin Baulig <martin@ximian.com>
7981 * expression.cs (Invocation.IsApplicable): Don't modify the method
7982 if type inference succeeded, but the method was not applicable.
7985 2007-04-10 Marek Safar <marek.safar@gmail.com>
7987 A fix for bug #81324
7988 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
7989 internal and external namespaces containers.
7991 2007-04-10 Martin Baulig <martin@ximian.com>
7993 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
7994 TypeManager.DropGenericMethodArguments() so we also call
7995 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
7997 2007-04-10 Martin Baulig <martin@ximian.com>
7999 * iterators.cs (Iterator.CreateIterator): Don't crash if
8000 `method.ReturnType' is null. This happens if something went wrong
8001 while resolving that typ (we already reported an error in this case).
8003 2007-04-10 Martin Baulig <martin@ximian.com>
8005 * expression.cs (New.DoResolve): Don't call CheckComImport() on
8006 generic interfaces; report the CS0144 directly.
8008 2007-04-10 Martin Baulig <martin@ximian.com>
8010 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
8011 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
8013 2007-04-10 Martin Baulig <martin@ximian.com>
8015 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
8017 2007-04-09 Raja R Harinath <rharinath@novell.com>
8020 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
8021 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
8024 * statement.cs (For.Resolve): If resolution fails, use
8027 2007-04-08 Marek Safar <marek.safar@gmail.com>
8029 * anonymous.cs (MakeName): Make faster and zero-based.
8030 (VerifyExplicitParameterCompatibility): Back to mode where generic
8031 parameter is ignored.
8032 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
8034 * class.cs (EmitType): Method can emit another new method.
8036 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
8038 * driver.cs: Updated.
8040 * lambda.cs: Reuse predefined empty parameters.
8042 * parameter.cs: Updated
8044 * support.cs: Implemented InflateTypes.
8046 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
8047 (InitSystemCore): Introduced to isolate 3.0 dependencies.
8049 2007-04-03 Martin Baulig <martin@ximian.com>
8053 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
8054 version of TypeManager.IsOverride() which also works with generic
8057 2007-04-03 Martin Baulig <martin@ximian.com>
8062 (Convert.ExplicitReferenceConversion): We need to cast when
8063 converting from IList<T> to S[].
8065 2007-04-01 Marek Safar <marek.safar@gmail.com>
8067 * decl.cs (FindExtensionMethods): Consider all candidates with same name
8070 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
8072 2007-03-31 Marek Safar <marek.safar@gmail.com>
8074 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
8075 argument and return type inferring.
8077 * codegen.cs (InferReturnType): Flag whether return can be inferred.
8078 (ReturnType): Turned to property.
8080 * statement.cs (Return): Implemented return type inferring.
8082 * support.cs (ReflectionParameters): Use local types if possible.
8084 2007-03-30 Raja R Harinath <rharinath@novell.com>
8086 * flowanalysis.cs (FlowBranching.Reachability): Remove.
8087 (FlowBranching.UsageVector): Update to changes.
8089 Prepare to kill 'Reachability'
8090 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
8091 argument of constructor.
8093 2007-03-29 Raja R Harinath <rharinath@novell.com>
8095 Prepare to kill 'Reachability'
8096 * flowanalysis.cs (UsageVector.is_unreachable): New.
8097 (UsageVector): Update to maintain 'is_unreachable' in parallel to
8098 'reachability', and verify they're consistent.
8101 * expression.cs (New.EmitStatement): Handle type parameters here too.
8103 2007-03-29 Martin Baulig <martin@ximian.com>
8108 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
8109 CompilerGeneratedClass.
8110 (ScopeInfo.EmitScopeInstance): Make this protected.
8111 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
8112 `ec.CurrentAnonymousMethod.Scope == Scope'.
8114 * statement.cs (Block.ScopeInfo): Make this a property.
8116 2007-03-27 Raja R Harinath <harinath@gmail.com>
8118 Prepare to kill 'Reachability'
8119 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
8120 (FlowBranching.UsageVector.Reachability): Remove property.
8121 (FlowBranching.UsageVector.IsUnreachable): New property.
8122 (FlowBranching.UsageVector.ResetBarrier): New.
8123 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
8124 * codegen.cs, statement.cs: Update to changes.
8126 2007-03-27 Martin Baulig <martin@ximian.com>
8131 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
8134 2007-03-26 Raja R Harinath <rharinath@novell.com>
8136 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
8137 instead of TriState. Remove all mention of TriState.
8139 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
8140 replaced by a boolean. Add boolean 'is_unreachable' field, check
8141 and maintain invariants.
8143 2007-03-25 Marek Safar <marek.safar@gmail.com>
8145 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
8147 2007-03-25 Marek Safar <marek.safar@gmail.com>
8149 * expression.cs: Stop using obsolete 2.0 opcodes.
8151 2007-03-25 Marek Safar <marek.safar@gmail.com>
8153 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
8154 one of the latests Martin's fixes.
8156 2007-03-23 Miguel de Icaza <miguel@novell.com>
8158 * expression.cs: On BigEndian systems, swap the bytes, temporary
8159 solution until we get a new bitconverter class.
8161 2007-03-23 Martin Baulig <martin@ximian.com>
8165 * decl.cs (MemberCache.AddMembers): Add generic methods both as
8166 "Method" and "Method`1". Normally, a cache lookup is done on the
8167 "Method" form (ie. without the generic arity), but this one makes
8168 lookups on the full form work as well.
8170 2007-03-22 Raja R Harinath <rharinath@novell.com>
8172 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
8175 2007-03-20 Bill Holmes <billholmes54@gmail.com>
8177 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
8178 ordered_member_list, to TypeBuilder to store members to be defined
8179 in the order they were parsed in.
8180 - ordered_explicit_member_list contains all properties indexers
8181 and methods that are defined as explicit implementation of an
8182 interface or base class.
8183 - ordered_member_list contains all properties indexers and methods
8184 that are not defined as explicit implementation of an interface
8187 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
8188 functionality in these removed classes has been replaced with
8189 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
8190 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
8192 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
8193 to CheckForDuplications inside GetMethod and SetMethod Define Method
8194 to handle method property and indexer name conflicts.
8198 All code is contributed under the MIT/X11 license.
8200 2007-03-20 Martin Baulig <martin@ximian.com>
8202 * class.cs (TypeContainer.Interfaces): Removed; they're now
8203 included in `TypeContainer.Types'.
8205 2007-03-20 Martin Baulig <martin@ximian.com>
8207 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
8209 * class.cs (TypeContainer.CreateType): New public method. This is
8210 now called before DefineType() to create the TypeBuilders.
8211 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
8212 has already been created by CreateType().
8213 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
8214 don't resolve our base classes here; this has been moved into
8215 DefineBaseTypes(). We're now called from CreateType().
8216 (TypeContainer.DefineBaseTypes): New private method; resolve our
8217 base classes here. We're now called from DefineType().
8220 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
8221 our types first to create all the TypeBuilders. After that, call
8222 TypeContainer.DefineType() on all the types which'll resolve their
8223 base classes and setup the resolve order.
8225 2007-03-20 Martin Baulig <martin@ximian.com>
8227 * class.cs (TypeContainer.Enums): Removed; they're now included in
8228 `TypeContainer.Types'.
8230 2007-03-20 Martin Baulig <martin@ximian.com>
8233 (TypeContainer.DefineType): Don't call ResolveMembers() here.
8234 (TypeContainer.DoResolveMembers): Call DefineType() on our
8235 `compiler_generated' classes; moved here from DefineNestedTypes().
8238 (RootContext.ResolveTree): Call ResolveMembers() on all
8239 TypeContainer's in the `type_container_resolve_order'.
8241 2007-03-19 Marek Safar <marek.safar@gmail.com>
8243 * class.cs: Use corlib to handle InternalMethodImplAttribute.
8245 2007-03-17 Marek Safar <marek.safar@gmail.com>
8247 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
8248 implementation flags.
8250 2007-03-17 Marek Safar <marek.safar@gmail.com>
8252 * class.cs: More optimizations for type parameters.
8254 2007-03-15 Marek Safar <marek.safar@gmail.com>
8256 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
8258 * ecore.cs, parameter.cs: More common code for both corlibs.
8260 * typemanager.cs (IsGenericMethod): Simplified.
8262 2007-03-15 Raja R Harinath <rharinath@novell.com>
8264 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8266 * statement.cs, iterators.cs, lambda.cs: Update to changes.
8268 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
8269 unconditionally. Simplify explanation.
8270 (Try.Resolve, Using.Resolve): Likewise.
8272 2007-03-15 Martin Baulig <martin@ximian.com>
8276 * decl.cs (DeclSpace): If we're a partial class, use our
8277 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
8279 2007-03-15 Raja R Harinath <rharinath@novell.com>
8281 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8283 (FlowBranching.UsageVector): Update to changes.
8284 (FlowBranching.MergeSiblings): Likewise.
8285 * statement.cs: Likewise.
8287 2007-03-15 Martin Baulig <martin@ximian.com>
8292 (MemberCache): Added a special .ctor for type parameters.
8295 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
8298 2007-03-09 Martin Baulig <martin@ximian.com>
8300 * enum.cs (Enum): Make this a TypeContainer.
8301 (EnumMember): Derive from `Const'.
8304 (Const.DoResolveValue): New protected virtual method; move most of
8305 the functionality of ResolveValue() here so we can override it in
8307 (Const.CreateConstantReference): Make this virtual.
8309 * class.cs (Kind): Add `Kind.Enum'.
8310 (TypeContainer.Emit): Don't emit the enums here; they're already
8311 in the `RootContext.typecontainer_resolve_order'.
8313 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
8314 here; they're already in the `typecontainer_resolve_order'.
8316 * ecore.cs (EnumConstant.ConvertImplicitly): Add
8317 TypeManager.DropGenericTypeArguments().
8320 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
8321 (TypeManager.IsEnumType): Likewise.
8322 (TypeManager.EnumToUnderlying): Likewise.
8323 (TypeManager.IsEqual): Add support for enums.
8325 2007-03-12 Raja R Harinath <rharinath@novell.com>
8327 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
8328 DefaultParameterValueAttribute to be undefined, say if System.dll
8331 2007-03-11 Marek Safar <marek.safar@gmail.com>
8333 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
8336 2007-03-10 Marek Safar <marek.safar@gmail.com>
8338 * class.cs, parameter.cs: Unified parameters verification.
8340 2007-03-08 Martin Baulig <martin@ximian.com>
8342 * cs-parser.jay (constructor_header): Pass the location to the
8343 newly created TopLevelBlock.
8345 2007-03-07 Martin Baulig <martin@ximian.com>
8347 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
8349 2007-03-06 Miguel de Icaza <miguel@novell.com>
8351 * convert.cs (ExplicitReferenceConversionExists): Sync this method
8352 with the changes from David, fixes the build.
8354 2007-03-05 David Mitchell <dmitchell@logos.com>
8356 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
8357 and its base interfaces to a one-dimensional array type S[],
8358 provided there is an implicit or explicit reference conversion
8361 2007-03-03 Marek Safar <marek.safar@gmail.com>
8363 * cs-tokenizer.cs: Implemented basic linq grammar.
8365 * driver.cs: Set linq lang version on demand.
8367 2007-02-26 Marek Safar <marek.safar@gmail.com>
8369 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
8371 2007-02-25 Marek Safar <marek.safar@gmail.com>
8373 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
8376 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
8378 Check property and event extern attributes.
8380 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
8383 2007-02-24 Marek Safar <marek.safar@gmail.com>
8385 A fix for bug #80407
8386 * ecore.cs: Don't report ambiguity error when methods have same parent.
8388 2007-02-23 Marek Safar <marek.safar@gmail.com>
8390 A fix for bug #80878
8391 * class.cs, cs-parser.jay: Event property can host anonymous methods.
8393 2007-02-22 Marek Safar <marek.safar@gmail.com>
8395 * attribute.cs: Enable ExtensionAttribute presence test.
8397 2007-02-22 Marek Safar <marek.safar@gmail.com>
8399 * class.cs: Warn about missing GetHashCode only when Equals is override.
8401 * decl.cs: Check accessibility of type arguments.
8403 * typemanager.cs: Correctly report nullable array.
8405 2007-02-20 Marek Safar <marek.safar@gmail.com>
8407 * class.cs, report.cs: Capture more details when things go wrong.
8409 2007-02-20 Marek Safar <marek.safar@gmail.com>
8411 A fix for bug #80650
8412 * cs-parser.jay: Anonymous container starts at constructor declaration
8413 and not at block beginning because it has to be usable in constructor
8416 * statement.cs: Use context location and not block one for error reporting.
8418 2007-02-18 Marek Safar <marek.safar@gmail.com>
8420 A fix for bug #78712
8421 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
8424 2007-02-18 Marek Safar <marek.safar@gmail.com>
8426 A fix for bug #80493 by Atsushi Enomoto
8427 * cs-parser.jay: Ignore invalid attribute target.
8429 2007-02-18 Marek Safar <marek.safar@gmail.com>
8431 * cs-tokenizer.cs: Ignore '\0' as white space character.
8433 2007-02-17 Miguel de Icaza <miguel@novell.com>
8435 * cs-parser.jay: Add support for lambda expressions to the mcs
8438 * lambda.cs: Only clone when we are probing, not on the final call
8439 (Compatible is the final call).
8441 * statement.cs (CloneContext): Introduce class to provide block
8442 remapping during clone.
8444 All statements Clone themselves now.
8446 (Clone): special handling for blocks, when we clone a block, we
8447 register the block inside this routine, as children of the block
8448 might trigger a lookup.
8450 * expression.cs: Add support for CloneContext in all expressions.
8452 2007-02-17 Marek Safar <marek.safar@gmail.com>
8454 A fix for bug #80493
8455 * statement.cs: Report ambiguous warning when interfaces are not related.
8457 2007-02-15 Marek Safar <marek.safar@gmail.com>
8459 C# 3.0 extension methods.
8461 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
8462 cannot be used directly.
8464 * class.cs (Class.Emit): Emit extension attribute if any class method
8465 is extension method.
8466 (Method.Define): Add basic extension method validation conditions.
8467 (Method.Emit): Emit extension attribute for method.
8469 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
8470 extension method exists. Currently we follow same approach as Microsoft
8471 does, emit even if a method or a class are private but this can change
8474 * cs-parser.jay: Add handling of `this' keyword in method parameters
8477 * decl.cs (DeclSpace.IsStaticClass): New property.
8478 (MemberCache.FindExtensionMethods): Looks for extension methods with
8479 defined name and extension type.
8481 * doc.cs: Updated after OverloadResolve changes.
8483 * driver.cs: Add new soft reference to System.Core.dll.
8485 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
8486 (ExtensionMethodGroupExpr): Represents group of extension methods.
8488 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
8489 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
8490 to MethodGroupExpr and made non-static for easier customization.
8491 (Invocation.DoResolve): Add extension method lookup when no standard
8493 (MemberAccess.DoResolve): Try extension methods if no member exists.
8495 * modifiers.cs: Add METHOD_EXTENSION modifier.
8497 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
8498 as well as candidate extension type.
8499 (ComputeNamespaces): When assembly constains extension methods registers
8501 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
8502 extension method lookup.
8503 (Namespace.LookupExtensionMethod): Looks for extension method in this
8505 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
8506 find a method which matches name and extensionType.
8508 * parameter.cs (Parameter): Add This modifer.
8509 (HasExtensionMethodModifier): New property.
8510 (Resolve): Add extension parameter check.
8511 (ModFlags): turned to property to exclude this modifier as it is not real
8513 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
8515 * support.cs (ParameterData): Add ExtensionMethodType.
8516 (ReflectionParameters): Implemented ExtensionMethodType interface property.
8518 * typemanager.cs: Add type and ctor extension attribute type.
8520 2007-02-15 Miguel de Icaza <miguel@novell.com>
8522 * report.cs (DisableErrors, EnableErrors): used to prevent error
8523 output when we are "trying" to compile various methods with
8526 * ecore.cs (Expression): Add Clone method that calls the virtual
8527 CloneTo method. The current CloneTo method in Expression throws
8528 an exception so we can track down all the places where this must
8529 be implemented (not using abstract, because that would be a lot of
8530 up-front-work before we can start testing the implementation
8533 Important: we only need Clone capabilities for expressions created
8534 by the parser, as the expressions we will be cloning are
8535 expressions in the pre-resolved state. This vastly simplifies
8538 (SimpleName): Add CloneTo that does nothing.
8539 (EmptyCast): Add CloneTo.
8541 * expression.cs (Binary): Implement CloneTo.
8542 (Invocation.IsApplicable): Store the current ec in
8543 EmitContext.TempEc and restore it on return. This is used so we
8544 do not have to sprinkle hundres of methods with an extra
8545 EmitContext, we know that the only user is the lambda expression
8546 ImplicitConversionExists code.
8548 (Argument): Add Cloning capabilities.
8549 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
8550 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
8551 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
8552 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
8553 IndexerAccess): Add Clone capability.
8555 (LocalVariableReference, This): TODO: needs cloned Block mapping.
8557 (Argument): Add cloning capability.
8559 * assign.cs (Assign): Implement CloneTo.
8561 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
8563 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
8564 version by calling Convert with the EmitContext (that we are
8565 currently storing in ec, this is not great, but will do for now,
8566 to avoid passing EmitContext parameters to hundreds of functions
8567 that do not need them now).
8569 (SetExpression): Remove, it is not needed.
8571 (ContextualReturn): Implement CloneTo.
8573 * statement.cs (Statement): Implement cloning infrastructure,
8574 similar to expressions.
8576 (Block): Partial implementation of Clone for statements.
8578 (Return): Implement clone.
8580 * constant.cs (Constant.CloneTo): New method, does nothing.
8582 * codegen.cs (TempEc): Add a static EmitContext as a temporary
8583 solution, until we decide how to exactly do this.
8585 2007-02-14 Marek Safar <marek.safar@gmail.com>
8587 A fix for bug #80493
8588 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
8589 a property is override we need to use second accessor.
8591 2007-02-13 Marek Safar <marek.safar@gmail.com>
8593 A fix for bug #80418
8594 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
8597 2007-02-13 Marek Safar <marek.safar@gmail.com>
8599 Another fix for bug #80749
8600 * pending.cs: Abstract class has priority over interfaces.
8602 2007-02-13 Marek Safar <marek.safar@gmail.com>
8604 Another fix for bug #80749
8605 * pending.cs: Abstract class has priority over interfaces.
8607 2007-02-13 Marek Safar <marek.safar@gmail.com>
8609 Another fix for bug #80749
8610 * pending.cs: Abstract class has priority over interfaces.
8612 2007-02-13 Marek Safar <marek.safar@gmail.com>
8614 Another fix for bug #80749
8615 * pending.cs: Abstract class has priority over interfaces.
8617 2007-02-13 Marek Safar <marek.safar@gmail.com>
8619 * class.cs Better error message.
8621 * driver.cs: Add shorter versions of -optimize option.
8623 2007-02-13 Martin Baulig <martin@ximian.com>
8625 * class.cs (Constructor.Emit): Check the return value of
8626 ec.ResolveTopBlock() and return on error.
8628 2007-02-13 Raja R Harinath <rharinath@novell.com>
8630 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
8631 message to fix error message regression.
8633 2007-02-12 Marek Safar <marek.safar@gmail.com>
8635 * delegate.cs: Delegate creation expression cannot be of Nullable type.
8637 2007-02-12 Marek Safar <marek.safar@gmail.com>
8639 A fix for bug #80749
8640 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
8641 its parent container.
8643 * class.cs (DefineFieldInitializers): Each initializer can has different
8646 * const.cs: Updated.
8648 2007-02-11 Miguel de Icaza <miguel@novell.com>
8650 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
8651 now all the heavy lifting to check that embedded statements or
8652 expressions have the right form is done in the ContextualReturn.
8654 (ContextualReturn): New class.
8656 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
8657 method that can be invoked to report 201, so we do not replicate
8660 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
8662 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
8663 treating tabs as spaces.
8665 2007-02-09 Marek Safar <marek.safar@gmail.com>
8667 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
8668 * assign.cs: Use full implicit conversion for right side check.
8670 2007-02-09 Marek Safar <marek.safar@gmail.com>
8672 * statement.cs (Switch): Switch over boolean type is not standardized.
8674 2007-02-08 Marek Safar <marek.safar@gmail.com>
8676 A fix for bug #80755
8677 * decl.cs (FindBaseEvent): Don't use method cache for events.
8679 2007-02-07 Marek Safar <marek.safar@gmail.com>
8681 * cs-parser.jay: Better syntax error handling.
8683 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
8684 instead of underlying type value.
8686 2007-02-06 Marek Safar <marek.safar@gmail.com>
8688 * driver.cs: Check define identifier before is registered.
8690 * namespace.cs: Use existing error message.
8692 * report.cs: New warning.
8694 2007-02-06 Marek Safar <marek.safar@gmail.com>
8696 A fix for bug #80742
8697 * expression.cs: Delegate Invoke method can be called directly.
8699 2007-02-06 Marek Safar <marek.safar@gmail.com>
8701 A fix for bug #80676
8702 * class.cs (IsEntryPoint): The Main method can have params modifier.
8704 2007-02-04 Miguel de Icaza <miguel@novell.com>
8706 * parameter.cs (Parameter, Parameters): Add Clone method.
8708 * anonymous.cs (Compatible): Turn method into virtual method, so
8709 LambdaExpression can implement a different behavior.
8711 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
8712 out the basic checking here, so it can be used by
8715 * lambda.cs: Introduce "Compatible" function that will do the
8718 2007-02-02 Marek Safar <marek.safar@gmail.com>
8720 * attribute.cs: Unified one error message.
8722 * class.cs (Class): Use type attributes and not properties to test static
8724 (IsEntryPoint): Don's pass local variable.
8726 * convert.cs: Removed duplicate check.
8728 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
8730 * driver.cs: Don't crash when soft reference does not exist.
8732 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
8733 (UsingEntry): Removed redundant allocation.
8735 * parameter.cs: Add fast path for type parameters.
8737 * support.cs: Don't allocate attribute when it's not used.
8739 2007-01-30 Miguel de Icaza <miguel@novell.com>
8742 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
8743 this into a virtual method, so we can override it in LambdaExpression.
8745 * driver.cs: Improve diagnostics in case of failure.
8747 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
8748 write a function that is slightly more complex and that parses:
8750 type identifier [, type identifier]* )
8752 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
8755 (canEmpty ? i >= 0 : i > 0)
8757 2007-01-30 Raja R Harinath <rharinath@novell.com>
8759 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
8760 exception on possibly valid code.
8762 2007-01-29 Raja R Harinath <rharinath@novell.com>
8764 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
8766 (parse_opt_type_arguments): Remove. It's almost the same as
8768 (parse_namespace_or_typename): Use parse_less_than.
8770 2007-01-28 Miguel de Icaza <miguel@novell.com>
8772 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
8773 this bug took a few hours to find, because the state saved and
8774 restored by PushPosition and PopPosition was ignoring the state of
8775 parse_generic_less_than.
8777 I can also now remove the handling of OP_LT and OP_GT, this solves
8780 * cs-tokenizer.cs: store the location for the ARROW token, we use
8783 (PushPosition, PopPosition): save/restore also `current_token',
8784 restore `parse_generic_less_than' (was missing).
8786 (parse_opt_type_arguments): use parse_type, not
8787 parse_namespace_or_typename to parse types.
8789 * lambda.cs: Empty new file, will eventually have the lambda
8790 expression implementation.
8792 * lambda.test: used to test the internal tokenizer.
8794 * report.cs (FeatureIsNotISO1): Rename from
8795 FeatureIsNotStandardized, because it was about the language level
8796 (1 vs 2) it was not about standarization.
8798 (FeatureRequiresLINQ): New.
8800 * support.cs (SeekableStreamReader): Only require that the reader
8801 is a TextReader, not a StreamReader, so we can plug StringReader.
8803 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
8804 given position in the input stream the following tokens can be
8805 parsed as a type followed by an identifier.
8807 (is_punct): after a '(' if parse_type_and_parameter returns true,
8808 then return a special token OPEN_PARENS_LAMBDA which is used to
8809 avoid reduce/reduce errors in the grammar for the
8810 lambda_expression rules.
8812 (parse_type): implement a type parser inside the
8813 tokenizer, the parser only returns true or false depending on
8814 whether the input at a given position can be parsed as a type.
8816 (peek_token): new method used during type parsing.
8818 2007-01-28 Raja R Harinath <rharinath@novell.com>
8821 * anonymous.cs (ScopeInfo.InflateParameters): New.
8822 (AnonymousContainer.Resolve): Use it to redirect types of
8823 delegate parameters.
8825 2007-01-27 Raja R Harinath <rharinath@novell.com>
8828 * expression.cs (Error_InvalidArguments): Don't use two different
8829 messages for CS1503. Use ExtraInformation and
8830 SymbolRelatedToPreviousError instead.
8833 * decl.cs (DeclSpace.initialize_type_params): Don't access
8834 'type_params' of a partial class directly.
8836 2007-01-26 Miguel de Icaza <miguel@novell.com>
8838 * constant.cs: Removed a handful of out-of-range checks that were
8841 2007-01-25 Marek Safar <marek.safar@gmail.com>
8843 * expression.cs (CheckUselessComparison): Add additional check for char
8846 * namespace.cs: Fixed typo.
8848 2007-01-23 Miguel de Icaza <miguel@novell.com>
8850 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
8851 gone, instead we inline the test, preventing the needless casts to
8852 longs, ulongs and doubles for the parameters, avoiding calls to
8853 methods that overchecked stuff, and instead inlined things
8856 2007-01-20 Marek Safar <marek.safar@gmail.com>
8858 * cs-parser.jay: Better parameter error handling.
8860 2007-01-17 Marek Safar <marek.safar@gmail.com>
8862 A fix for bug #80368, #80522
8863 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
8864 whether array initializer contains constants only.
8865 (ArrayCreation.Emit): Use better formula to decide when
8866 are array initializers for static initialization.
8867 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
8868 have to emit even constants otherwise they are pre-initialized.
8870 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
8871 Raja R Harinath <rharinath@novell.com>
8873 Fix emit order of 'get' vs. 'set'.
8874 * support.cs (Accessors): New.
8875 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
8876 Note the order in which accessors are declared in the source.
8877 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
8878 Refactored from Property.Define and Indexer.Define.
8879 (PropertyBase.DefineAccessors): New helper that calls the above in
8880 appropriate order as noted by the parser.
8881 (Property.Define, Indexer.Define): Update to changes.
8882 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
8884 2007-01-17 Raja R Harinath <rharinath@novell.com>
8886 Fix cs0029-6.cs and gcs0029-2.cs (regression)
8887 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
8888 there's an implicit conversion from the current type to the target
8889 type before converting the underlying constant.
8891 2007-01-16 Marek Safar <marek.safar@gmail.com>
8893 * const.cs (ResolveValue): Updated after constant conversion was made more
8896 * constant.cs (GetAttributableValue): constant to object conversion is
8897 used for attributes only.
8898 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
8899 constant conversions.
8900 (LongConstant.ConvertImplicitly): Ditto.
8902 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
8903 (ImplicitConversionStandard): Handle constant conversion as extra step.
8904 It solves the issue when constant conversion was called indirectly like
8905 inside array initializer and constant folding was skipped.
8907 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
8910 * statement.cs(ImplicitConversionStandard): Updated after constant
8911 conversion was made more generic.
8913 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
8915 * expression.cs (As.DoResolve): Use GenericConstraints instead of
8916 Constraints, solves the problem where the compiler incorrectly
8917 reported that a type parameter was not constrained to a class (Bug
8920 2007-01-14 Marek Habersack <grendello@gmail.com>
8922 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
8924 2007-01-14 Marek Safar <marek.safar@gmail.com>
8926 A fix for bug #80368
8927 * assign.cs (FieldInitializer): New class implements field
8928 initializer statement.
8930 * attribute.cs: Update after FieldMember rename.
8932 * class.cs (PropertyBasedMember): New common class for property based
8934 (InterfaceMemberBase): New base class for all members which can be used as
8935 an interface members.
8936 (MethodCore): Moved really common code to InterfaceMemberBase.
8937 (Method.Define): Equal and GetHasCode detection is relevant for methods
8939 (MethodData.Define): Don't assume that public event implements an
8940 interface automatically.
8941 (MethodData.DefineMethodBuilder): Issue an error even if only extern
8943 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
8944 (FieldMember): Merged with FieldBase.
8945 (EventProperty.AEventPropertyAccessor): New specialization to check whether
8946 event extern modifier can be used.
8947 (EventField.EventFieldAccessor): Moved event field specific code here.
8948 (Event.AllowedModifiers): Even event can be extern.
8949 (Event.FindOutBaseMethod): New override specific to events.
8950 (Indexer.parameters): Reintroduce parameters because base class holds
8951 only properties common data.
8952 (Indexer.CheckForDuplications): Indexers are threated as methods so we
8953 need do extra parameters check.
8955 * const.cs: Update after FieldMember rename.
8957 * decl.cs (MemberCache.FindBaseEvent): New method.
8959 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
8960 to reflect that indexer is now derived from PropertyBased.
8962 * ecore.cs (GetMemberType): Made public.
8963 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
8966 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
8968 * typemanager.cs (CSharpSignature): Correctly print event accessors.
8969 (RegisterEvent): Removed.
8970 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
8971 (GetPrivateFieldOfEvent): Renamed to GetEventField.
8973 2007-01-11 Raja R Harinath <rharinath@novell.com>
8976 * statement.cs (CollectionForeach.TryType): Prefer generic
8977 GetEnumerator over non-generic variant. Fix code to follow comments.
8979 2007-01-09 Raja R Harinath <rharinath@novell.com>
8982 * support.cs (ReflectionParameter): Don't use an invalid index on
8983 the generic parameter data.
8985 2007-01-08 Miguel de Icaza <miguel@novell.com>
8987 * driver.cs: Just add a tiny bit of infrastructure.
8989 2007-01-02 Marek Safar <marek.safar@gmail.com>
8991 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
8992 where field type is struct from current assembly.
8994 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
8997 2007-01-02 Marek Safar <marek.safar@gmail.com>
8999 A fix for bug #80381
9000 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
9003 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
9005 (Namespace.LookupType): Always use core types from corlib when speficied.
9007 * report.cs: A new warning.
9009 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
9010 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
9011 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
9013 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
9014 (InitCoreTypes): Set expression type of object_type and value_type
9015 immediately after lookup.
9017 2007-01-01 Miguel de Icaza <miguel@novell.com>
9019 * cs-tokenizer.cs: Accept Pc class characters (Connector
9020 Punctuation) as valid identifiers. Fixes #78259
9022 * expression.cs (Invocation.DoResolve): Moved the check for the
9023 use of `this' for doing method calls to the Invocation resolution
9024 step, after overload resolution has taken place instead of doing
9025 the check at the low-level `This.DoResolve' level.
9027 The `This.DoResolve'(appens before overload resolution, so it has
9028 no way of knowing if the method that will be called will be
9029 instace or static, triggering an erroneous report for cs0188 (Bug
9032 We now do the check for instance method invocations after we know
9033 what method will be called.
9035 (This.CheckThisUsage): Move the actual use of this structure
9036 checking into its own method and expose it.
9038 * Everywhere that called Error_ValueCannotBeConverted: pass a new
9041 Exceptions: Null.ConvertImplicitly,
9042 Constant.ImplicitConversionRequired as there are too many call
9043 sites for passing the ec.
9045 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
9046 EmitContext, if the value is null, then we do not try to provide
9047 the extra information from the error (If a userdefined conversion
9048 exists, as UserDefinedConversion requires a non null-EmitContext).
9052 2006-12-30 Raja R Harinath <rharinath@novell.com>
9054 * flowanalysis.cs (MyBitVector): Document some invariants.
9055 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
9056 introduced below, and add a couple of others,
9058 2006-12-30 Marek Safar <marek.safar@gmail.com>
9060 * attribute.cs (GetMethodObsoleteAttribute): Uses new
9061 GetPropertyFromAccessor and GetEventFromAccessor.
9063 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
9064 overrides non-obsolete one.
9065 (Indexer.Define): Error message has been moved to the parser.
9067 * cs-parser.jay: Better syntax errors handling.
9069 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
9070 when an invocation has no arguments.
9072 * ecore.cs: Removed not used caching.
9074 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
9077 * report.cs: Add a new warning.
9079 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
9081 * typemanager.cs (enumeration_type): Removed.
9082 (CSharpSignature): Reuses IsSpecialMethod.
9083 (IsEqual): Hack for MS BCL.
9084 (GetPropertyFromAccessor): New method.
9085 (GetEventFromAccessor): New method.
9086 (IsSpecialMethod): Fixed to handle more cases.
9088 2006-12-30 Marek Safar <marek.safar@gmail.com>
9090 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
9091 Made white spaces array static.
9093 * ecore.cs (RemoveGenericArity): Optimized.
9095 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
9097 (MyBitVector.initialize_vector): Simplified.
9099 2006-12-22 Miguel de Icaza <miguel@novell.com>
9101 * ecore.cs: Am not entirely happy with this hack, but it seems to
9102 address the issue in 80257 (a small test case for
9105 I set the MethodGroupExpr.Type to an internal compiler type
9106 (itself in this case) to force the resolution to take place. Why
9107 it does not take place with a null is beyond me.
9109 2006-12-20 Marek Safar <marek.safar@gmail.com>
9111 A fix for bug #80288
9112 * expression.cs (ResolveOperator): Consider user defined conversion for
9113 logical and operator too.
9114 (EmitBranchable): Optimization for logical and when full constant folding
9115 could not be applied but one operand is constant.
9117 2006-12-19 Marek Safar <marek.safar@gmail.com>
9119 * class.cs (GetClassBases): Write 5 times every day, will never use
9120 FullName for error reporting.
9122 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
9124 2006-12-19 Martin Baulig <martin@ximian.com>
9126 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
9127 the symbol file info here.
9129 2006-12-18 Marek Safar <marek.safar@gmail.com>
9131 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
9132 of `elseif' is taking then following sections are not taking.
9133 Fixes an issue reported on mono mailing list.
9135 2006-12-18 Marek Safar <marek.safar@gmail.com>
9137 A fix for bug #80300
9138 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
9139 a caller is not taking.
9141 2006-12-18 Raja R Harinath <rharinath@novell.com>
9143 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
9144 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
9145 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
9146 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
9147 * class.cs: Update to changes.
9149 2006-12-17 Marek Safar <marek.safar@gmail.com>
9151 A fix for bug #79934
9152 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
9155 * class.cs (ResolveMembers): Register an iterator in current container and
9158 2006-12-16 Raja R Harinath <rharinath@novell.com>
9161 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
9162 satisfy a params annotated parameter.
9164 2006-12-16 Marek Safar <marek.safar@gmail.com>
9166 A fix for bug #77014
9167 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
9168 paramters correctly and not rely on hacks in Parameters class.
9169 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
9171 (Invocation.VerifyArgumentsCompat): Ditto.
9172 (Invocation.EmitArguments): Changed to correctly emit params arguments at
9175 * parameter.cs (HasParams): Don't assume that params is the last one.
9177 * support.cs (ReflectionParameters.ctor): Look for params attribute
9179 (ReflectionParameters.ParameterType): Removed hack when we returned last
9180 parameter for out of range parameters.
9181 (ParameterName, ParameterModifier): Ditto.
9183 2006-12-14 Marek Safar <marek.safar@gmail.com>
9185 A fix for bug #79987
9186 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
9187 when assembly is not CLS compliant but type is. I have no idea why is this
9190 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
9192 2006-12-13 Miguel de Icaza <miguel@novell.com>
9194 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
9195 in struct constructors, they are basically no-ops.
9197 2006-12-12 Marek Safar <marek.safar@gmail.com>
9199 * cs-tokenizer.cs (Position): Save preprocessor status too.
9201 2006-12-12 Marek Safar <marek.safar@gmail.com>
9203 A fix for bug #77794
9204 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
9206 2006-12-12 Marek Safar <marek.safar@gmail.com>
9208 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
9210 (pp_expr): Report error for an invalid expression.
9211 (handle_preprocessing_directive): Simplified; add more error checking.
9213 2006-12-11 Marek Safar <marek.safar@gmail.com>
9215 A fix for bug #74939
9216 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
9217 directives handling.
9219 2006-12-10 Marek Safar <marek.safar@gmail.com>
9221 A fix for bugs #80093, and #75984
9222 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
9223 logic, it seems to me as it worked before "by coincidence".
9224 (xtoken): Simplified to use reworked handle_preprocessing_directive.
9225 (cleanup): Enabled endif check.
9227 2006-12-09 Marek Safar <marek.safar@gmail.com>
9229 A fix for bug #80162
9230 * statement.cs (CollectionForeach.TryType): Generics and non-generics
9231 enumerators are never ambiguous.
9233 2006-12-08 Raja R Harinath <rharinath@novell.com>
9236 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
9238 2006-12-06 Marek Safar <marek.safar@gmail.com>
9240 A fix for bug #80144
9241 * class.cs (EventProperty.Define): Explicit implementation means
9242 that an even is used.
9244 2006-12-06 Marek Safar <marek.safar@gmail.com>
9246 Fixes the operators implementation (part II)
9248 * cfold.cs (DoConstantNumericPromotions): Renamed to
9249 DoBinaryNumericPromotions and simplified.
9250 (BinaryFold): Couple of conversion fixes; simplified.
9252 * constant.cs, ecore.cs, literal.cs
9253 (ToType): Renamed to ConvertImplicitly.
9254 (Reduce): Renamed to ConvertExplicitly.
9256 * class.cs, convert.cs: Updated.
9258 * expression.cs: TryReduce doesn't throw an exception.
9260 2006-12-01 Marek Safar <marek.safar@gmail.com>
9262 A fix for bug #80108
9263 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
9266 2006-11-30 Marek Safar <marek.safar@gmail.com>
9268 Fixes unary operators implementation (part I)
9271 * cfold.cs (Error_CompileTimeOverflow): Made internal
9273 * const.cs (IConstant): Changed to use reference to constant and
9274 not constant itself.
9275 Updated IConstant implementations.
9277 * constant.cs (CreateConstant): New factory method.
9278 Updated IConstant implementation.
9280 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
9282 * ecore.cs: Updated to use CreateConstantReference.
9284 * enum.cs: Reflects IConstant changes.
9286 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
9288 * literal.cs (NullConstant): Change to be independently usable.
9290 2006-11-29 Martin Baulig <martin@ximian.com>
9292 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
9293 we need to emit the scope initializer before calling the base .ctor.
9295 * anonymous.cs: Merged back from the new anonymous methods branch.
9296 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
9298 * expression.cs (ParameterReference.DoResolveBase): Create a
9299 "normal" ScopeInfo when capturing parameters rather than using the
9300 root scope; this makes things work with anonymous methods having
9304 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
9306 2006-11-22 Marek Safar <marek.safar@gmail.com>
9308 A fix for bug #79987
9309 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
9310 check to a base class.
9311 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
9312 only when assembly has missing attribute.
9313 * report.cs: Update.
9315 2006-11-21 Marek Safar <marek.safar@gmail.com>
9317 * cs-tokenizer.cs: Merged with gmcs version.
9319 2006-11-20 Marek Safar <marek.safar@gmail.com>
9322 * cs-parser.jay: Better error message when partial keyword is misplaced.
9324 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
9326 A fix for bug #79810
9327 report.cs: CS1058 only applies to 2.0 profile (gmcs).
9328 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
9329 a RuntimeWrappedException by default.
9331 2006-11-18 Marek Safar <marek.safar@gmail.com>
9333 A fix for bug #79843
9334 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
9336 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
9338 2006-11-18 Marek Safar <marek.safar@gmail.com>
9340 * driver.cs, namespace.cs: Uses faster IndexOf version.
9342 2006-11-17 Marek Safar <marek.safar@gmail.com>
9344 A fix for bug #79941
9345 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
9347 (Operator.Define): Implicit/Explicit operator of same type is duplicate
9348 even if internal name is different.
9349 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
9350 (UserDefinedConversion): Simplified as the operators cannot be internal.
9351 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
9353 (MethodLookup): Replaced EmitContext with parentType.
9354 * expression.cs: Updated.
9356 2006-11-09 Raja R Harinath <rharinath@novell.com>
9358 * driver.cs (BadAssembly): Handle all the ugliness of
9359 DefineDynamicAssembly.
9361 2006-11-08 Raja R Harinath <rharinath@novell.com>
9363 Address parts of #58244 -- most of what's left is in the runtime
9364 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
9365 CS1509 error checks, and handle them for all assembly loads, not
9366 just the first invocation.
9367 (LoadModule): Likewise. Move handling of 'adder_method' ...
9368 * codegen.cs (AssemblyClass.AddModule): ... here.
9370 2006-11-02 Marek Safar <marek.safar@gmail.com>
9372 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
9373 IEnumerable<T> is ambiguous.
9375 2006-10-31 Marek Safar <marek.safar@gmail.com>
9377 A fix for bug #67689
9378 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
9379 GetEnumerator is ambiguous.
9381 * report.cs: Add new warning.
9383 2006-10-29 Marek Safar <marek.safar@gmail.com>
9385 A fix for bug #78602
9386 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9387 to protected member can be nested type.
9389 2006-10-28 Marek Safar <marek.safar@gmail.com>
9391 A fix for bug #78965
9392 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9393 to protected member must derive from current type.
9395 2006-10-27 Marek Safar <marek.safar@gmail.com>
9397 assign.cs: Reuses error method.
9399 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
9400 instead of type for constants.
9401 (Expression.Error_ValueAssignment): Common error method.
9403 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
9406 2006-10-27 Marek Safar <marek.safar@gmail.com>
9408 A fix for bug #79081
9409 * expression.cs (MemberAccess.DoResolve): Check nested type
9412 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
9414 * doc.cs : nested delegates were not handled. Fixed bug #79754.
9416 2006-10-26 Marek Safar <marek.safar@gmail.com>
9418 A fix for bug #76591
9419 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
9421 2006-10-26 Marek Safar <marek.safar@gmail.com>
9423 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
9424 type forwarder of the same type multiple times.
9426 2006-10-26 Raja R Harinath <rharinath@novell.com>
9429 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
9430 instance as an rvalue, even when we later resolve as an lvalue.
9432 2006-10-25 Martin Baulig <martin@ximian.com>
9434 * anonymous.cs: Fix #79673.
9436 2006-10-24 Marek Safar <marek.safar@seznam.cz>
9438 A fix for bug #79666
9439 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
9440 ignored when is optimized (= default value) as its value is already set.
9442 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9444 A fix for bug #79724
9445 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
9446 TypeContainer for type lookup.
9448 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9450 A fix for bug #79231
9451 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
9452 * expression.cs (OverloadResolve): Always convert type name for
9454 (ResolveNamespaceOrType): Don't confuse a nested type with any
9457 2006-10-18 Martin Baulig <martin@ximian.com>
9459 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
9461 2006-10-17 Miguel de Icaza <miguel@novell.com>
9463 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
9464 an int32, but requesting an int64 from the conversion
9466 2006-10-12 Martin Baulig <martin@ximian.com>
9469 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
9471 2006-10-12 Martin Baulig <martin@ximian.com>
9474 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
9476 2006-10-11 Miguel de Icaza <miguel@novell.com>
9478 * convert.cs: Remove broken code: I was doing the "Existance"
9479 tests for Implicit conversions.
9481 2006-10-10 Miguel de Icaza <miguel@novell.com>
9483 * convert.cs: Added one missing case in
9484 ImplicitStandardConversionExists uint64 to intptr.
9488 * typemanager.cs (uintptr_type): another core known type.
9490 * ecore.cs (OperatorCast): routine used to do cast operations that
9491 depend on op_Explicit. We could change some of the Decimal
9492 conversions to use this.
9494 This one has a probe mechanism that checks both types for an op_
9495 which it coudl be used to eliminate two classes: CastToDecimal
9496 and CastFromDecimal.
9498 * convert.cs: Implement the conversions documented in #59800
9500 2006-10-10 Martin Baulig <martin@ximian.com>
9502 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
9503 before RootScope.ResolveMembers().
9505 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
9506 `CurrentType' if appropriate.
9508 2006-10-09 Marek Safar <marek.safar@seznam.cz>
9510 A fix for bug #78568
9511 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
9512 when contains binary operators.
9513 * cs-parser.jay: Updated.
9515 2006-10-09 Martin Baulig <martin@ximian.com>
9518 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
9519 moved that into Define() and also do the other type parameter
9520 checks there. Fixes #79094. Added gtest-292.cs.
9523 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
9524 since that doesn't include type parameters; don't use `Ldelema'
9525 for type parameters. Fixes #78980. Added gtest-293.cs.
9527 2006-10-08 Marek Safar <marek.safar@seznam.cz>
9530 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
9531 conversion is allowed.
9533 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9535 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
9536 error reporting when no error occurs.
9538 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9540 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
9543 2006-10-06 Raja R Harinath <rharinath@novell.com>
9546 * class.cs (DefineTypeBuilder): Check circular dependencies before
9547 setting the parent of the TypeBuilder.
9548 (CheckRecursiveDefinition): Don't use 'BaseType', since
9549 it may not be valid until after DefineTypeBuilder. Use
9550 'base_type' instead.
9552 2006-10-04 Martin Baulig <martin@ximian.com>
9554 Merged the Anonymous Methods patch.
9556 * anonymous.cs, iterators.cs: The new anonymous methods code.
9558 * statement.cs (Variable): New public abstract class.
9559 (LocalInfo.Variable): New public property.
9560 (LocalInfo.ResolveVariable): New public method.
9561 (Block.Flags): Add `IsIterator'.
9562 (Block.AddVariable): Improved the CS0136 check.
9563 (Block.AnonymousChildren): New public property.
9564 (Block.AddAnonymousChild): New public method.
9565 (ToplevelBlock): Update to use the new anonymous method framework.
9566 (ToplevelBlock.ctor): `container' is now a `Block' and not a
9567 `ToplevelBlock'; this is required to correctly implement the
9569 (Fixed, Using): Use `TemporaryVariable' instead of directly
9570 creating the `LocalBuilder'.
9572 * parameter.cs (Parameter.ResolveVariable): New public method.
9573 (Parameters.ResolveVariable): Likewise.
9575 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
9577 * class.cs (TypeContainer): Replaced the `iterators' list and
9578 corresponding methods with a list of `CompilerGeneratedClass'es.
9579 (TypeContainer.ResolveMembers): New public method.
9580 (Method): `IIteratorContainer' has been replaced by
9583 * expression.cs (VariableReference): New public abstract base
9584 class for `LocalVariableReference', `ParameterReference' and
9587 * codegen.cs (EmitContext): Removed `capture_context',
9588 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
9589 (EmitContext.EmitThis): Removed.
9591 * cs-parser.jay: Replace `iterator_container' with
9594 2006-10-04 Martin Baulig <martin@ximian.com>
9596 * generic.cs (GenericMethod): Don't make this abstract.
9597 (Constraints.Clone): Added dummy implementation.
9599 2006-10-04 Raja R Harinath <harinath@gmail.com>
9602 * namespace.cs (LookForAnyGenericType): Avoid nullref on
9603 'declspaces'. Avoid allocating arrays willy-nilly.
9606 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
9607 cases out of the switch.
9609 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9611 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
9612 message when non-generic type is used with the type arguments.
9613 * expression.cs: Updated.
9615 2006-09-28 Raja R Harinath <rharinath@novell.com>
9618 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
9619 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9620 Change semantics slightly. Don't insist on having only one
9621 temporary EmptyExpression -- just throttle the creation of new ones.
9624 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
9625 non-interfaces too. If no methods are found, don't try to create
9628 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9630 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
9633 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
9634 us produce better error message.
9636 2006-09-27 Marek Safar <marek.safar@seznam.cz>
9638 * expression.cs (Binary.ResolveOperator): Warn about a side effect
9639 of the `|' operator.
9641 * report.cs: A new warning added.
9643 2006-09-27 Martin Baulig <martin@ximian.com>
9645 * generic.cs (GenericMethod): Don't make this abstract.
9647 2006-09-27 Martin Baulig <martin@ximian.com>
9650 (InternalErrorException): Added overloaded ctor taking a params array.
9652 2006-09-26 Marek Safar <marek.safar@seznam.cz>
9654 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
9655 Fixed the cases when same error was reported twice.
9657 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
9658 now report symbol information.
9660 2006-09-25 Martin Baulig <martin@ximian.com>
9662 * class.cs: Completely unified with the gmcs version.
9664 2006-09-25 Martin Baulig <martin@ximian.com>
9666 * typemanager.cs (TypeManager.IsNullableType): New public function.
9667 (TypeManager.IsNullableTypeOf): Likewise.
9668 (TypeManager.IsNullableValueType): Likewise.
9670 * class.cs (MethodCore): Added the `GenericMethod' argument from
9671 gmcs and also unified all classes derived from `MethodCore' with gmcs.
9673 2006-09-24 Raja R Harinath <harinath@gmail.com>
9675 * convert.cs: Unify with gmcs version.
9677 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9679 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
9680 verify them as well.
9682 * report.cs: New warning.
9684 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9686 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
9687 for anonymous block with out argument.
9689 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9691 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
9692 not used private events only.
9694 2006-09-23 Marek Safar <marek.safar@seznam.cz>
9696 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
9698 * const.cs (Const.Define): Check for constant type.
9699 (Const.IsConstantTypeValid): Looks for valid constant types.
9701 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
9703 * ecore.cs (EmptyConstantCast): New common class for all constant based
9706 * expression.cs (Is.DoResolve): Handle null constant especially.
9707 (New.DoResolve): Check for new void().
9708 (MemberAccess.DoResolve): Cope with all kind of nulls.
9710 * literal.cs (NullConstant): Uses EmptyConstantCast.
9711 (NullDefault): Based on EmptyConstantCast.
9712 (NullLiteral): Uses EmptyConstantCast.
9714 * statement.cs (Block.ResolveMeta): Check for constant type.
9716 2006-09-22 Martin Baulig <martin@ximian.com>
9718 * delegate.cs, attribute.cs: Merged with the gmcs versions.
9720 2006-09-22 Raja R Harinath <rharinath@novell.com>
9722 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
9726 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
9727 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
9730 2006-09-22 Martin Baulig <martin@ximian.com>
9732 * ecore.cs: Merged with the gmcs version.
9734 * generic.cs (ConstructedType): New dummy class.
9735 (TypeArguments): Don't make this abstract.
9738 (TypeManager.IsGenericTypeDefinition): New method.
9739 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
9741 2006-09-22 Raja R Harinath <rharinath@novell.com>
9743 * expression.cs (ComposedCast): Check for arrays of TypedReference
9744 before creating the type, not after.
9746 2006-09-21 Marek Safar <marek.safar@seznam.cz>
9748 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
9749 after ToType change.
9751 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
9752 when constant must be implicitly convertible.
9754 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
9756 * ecore.cs (NullCast): Derives from NullConstant.
9758 * expression.cs (Is.DoResolve): Removed useless variables.
9759 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
9760 (New.Constantify): Add enum support.
9761 (MemberAccess.DoResolve): Add warning when accessing null constant or
9764 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
9767 * literal.cs (NullConstant): New abstract class with common
9768 functionality for all null specializations.
9769 (NullDefault): Represents default(X) when result can be
9771 (NullLiteral): Updated.
9773 * report.cs: Add new warning.
9775 2006-09-21 Martin Baulig <martin@ximian.com>
9777 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
9779 2006-09-21 Martin Baulig <martin@ximian.com>
9781 * generic.cs (GenericConstraints): New dummy class.
9782 (Constraints): Likewise.
9783 (TypeParameter): Likewise.
9784 (TypeParameterName): Likewise.
9785 (GenericMethod): Likewise.
9787 * typemanager.cs (TypeManager.GetGenericArguments): New method.
9789 * decl.cs: Merged with the gmcs version.
9791 2006-09-21 Raja R Harinath <rharinath@novell.com>
9793 * generic.cs (TypeParameter): Implement IMemberContainer.
9794 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
9796 * rootcontext.cs: Unify with gmcs version.
9798 * report.cs: Unify with gmcs version.
9799 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
9800 from gmcs/generics.cs.
9801 * generics.cs (TypeParameter): New dummy class.
9803 * support.cs: Unify with gmcs version.
9805 2006-09-20 Raja R Harinath <rharinath@novell.com>
9807 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
9808 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
9810 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
9811 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
9812 * mcs.exe.sources: Add generic.cs.
9814 * codegen.cs: Unify with gmcs version.
9816 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
9817 (EmitContext): Add GenericDeclContainer implementation.
9818 * decl.cs (MemberCore, DeclSpace): Likewise.
9819 * namespace.cs: Remove #ifdef GMCS_SOURCE.
9821 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
9822 MCS TypeManager has a corresponding dummy method.
9824 2006-09-19 Martin Baulig <martin@ximian.com>
9826 * expression.cs: Completely merged with the gmcs version.
9828 2006-09-19 Martin Baulig <martin@ximian.com>
9830 * expression.cs (Invocation): Merged with the gmcs version.
9831 (ArrayAccess.GetStoreOpcode): Likewise.
9833 2006-09-19 Martin Baulig <martin@ximian.com>
9836 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
9837 (TypeManager.IsGenericMethodDefinition): Likewise.
9839 2006-09-19 Martin Baulig <martin@ximian.com>
9842 (TypeManager.IsEqual): Moved the gmcs implementation here.
9843 (TypeManager.DropGenericTypeArguments): Likewise.
9844 (TypeManager.DropGenericMethodArguments): Likewise.
9845 (TypeManager.GetTypeArguments): Moved here from gmcs.
9846 (TypeManager.HasGenericArguments): Likewise.
9848 2006-09-19 Martin Baulig <martin@ximian.com>
9850 * expression.cs (Binary): Merged with the gmcs version.
9852 2006-09-19 Martin Baulig <martin@ximian.com>
9854 * expression.cs (Probe, As, Is): Merged with the gmcs version.
9856 2006-09-19 Martin Baulig <martin@ximian.com>
9858 * typemanager.cs: Merged with the gmcs version.
9860 2006-09-16 Raja R Harinath <rharinath@novell.com>
9862 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
9863 * driver.cs: Likewise.
9865 2006-09-16 Marek Safar <marek.safar@seznam.cz>
9868 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
9869 only if parent type is class.
9870 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
9873 2006-09-15 Marek Safar <marek.safar@seznam.cz>
9876 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
9878 * typemanager.cs(CSharpName): Converts NullType to null.
9880 2006-09-15 Martin Baulig <martin@ximian.com>
9883 (TypeManager.GetMethodName): Added mcs implementation.
9884 (TypeManager.IsEqual): Likewise.
9887 (SimpleName.RemoveGenericArity): Added dummy implementation.
9889 * pending.cs: Merged with the gmcs version.
9891 2006-09-15 Martin Baulig <martin@ximian.com>
9893 * statement.cs: Merge with the gmcs version.
9895 2006-09-15 Martin Baulig <martin@ximian.com>
9897 * statement.cs (Switch): Merge with the gmcs implementation
9898 (without nullables), which is newer.
9900 2006-09-15 Martin Baulig <martin@ximian.com>
9902 * statement.cs (Block.Variables): Make this public.
9903 (ToplevelBlock.Parameters): Make this a property.
9904 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
9906 2006-09-15 Martin Baulig <martin@ximian.com>
9908 * namespace.cs: Merge with the gmcs version.
9910 2006-09-15 Martin Baulig <martin@ximian.com>
9912 * decl.cs (MemberName): Minor code cleanups.
9914 2006-09-15 Martin Baulig <martin@ximian.com>
9916 * parameter.cs: Merge with the gmcs version.
9918 2006-09-15 Martin Baulig <martin@ximian.com>
9920 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
9921 and an error in mcs.
9923 2006-09-15 Martin Baulig <martin@ximian.com>
9925 * flowanalysis.cs: Merged from GMCS; added the generics code into
9926 a `GMCS_SOURCE' conditional so we can share this file.
9928 2006-09-08 Martin Baulig <martin@ximian.com>
9930 * typemanager.cs (TypeManager.interlocked_type): New public field.
9931 (TypeManager.int_interlocked_compare-exchange): New public field.
9932 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
9933 enumerator types here and call InitGenericCoreTypes().
9934 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
9935 after calling InitEnumUnderlyingTypes().
9938 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
9939 `classes_second_stage'.
9941 2006-09-14 Marek Safar <marek.safar@seznam.cz>
9943 * assign.cs, ecore.cs, expression.cs: Share error message text.
9944 * class.cs (FieldMember.Define): Check for varible of static type.
9945 * driver.cs (LoadAssembly): Uses error output for errors.
9946 * statement.cs: Updated.
9948 2006-09-08 Marek Safar <marek.safar@seznam.cz>
9950 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
9953 2006-09-07 Martin Baulig <martin@ximian.com>
9956 (MainDriver): Revert r62663 from Marek; see #70506 for details.
9958 2006-08-29 Miguel de Icaza <miguel@novell.com>
9960 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
9962 2006-08-17 Miguel de Icaza <miguel@novell.com>
9964 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
9965 #52019 and #79064, the use of the \uXXXX sequence in source code
9966 to represent unicode characters.
9968 2006-08-15 Marek Safar <marek.safar@seznam.cz>
9970 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
9972 * class.cs, ecore.cs, statement.cs: Merged to one error message.
9974 2006-08-13 Miguel de Icaza <miguel@novell.com>
9976 * assign.cs: Catch attempts to assign to a method groups in += and
9979 2006-08-13 Marek Safar <marek.safar@seznam.cz>
9982 * cs-parser.jay: Don't destroy current array type by typeof of array's.
9984 2006-08-12 Marek Safar <marek.safar@seznam.cz>
9986 * class.cs (Method.Define): Issue a warning when generic method looks like
9988 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
9991 2006-08-09 Marek Safar <marek.safar@seznam.cz>
9993 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
9995 * decl.cs (MemberCache.FindMembers): When container is interface we need to
9996 search all base interfaces as a member can be ambiguous.
9997 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
9998 Constructor member type filter.
9999 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
10000 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
10001 reporting for returned memberinfos.
10002 * report.cs: Updated.
10003 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
10004 version to work on all runtimes.
10005 (TypeManager.RealMemberLookup): Removed members filtering.
10007 2006-08-08 Raja R Harinath <rharinath@novell.com>
10009 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
10010 (PropertyExpr.EmitAssign): Likewise.
10011 * expression.cs (Indirection.EmitAssign): Likewise.
10012 (LocalVariableReference.EmitAssign): Likewise.
10013 (ParameterReference.EmitAssign): Likewise.
10014 (Invocation.EmitArguments): Likewise.
10015 (ArrayAccess.EmitAssign): Likewise.
10016 (IndexerAccess.EmitAssign): Likewise.
10017 (This.EmitAssign): Likewise.
10018 (ConditionalLogicalOperator.Emit): Likewise.
10021 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
10022 instead of ArrayList. If the hashtable has a LocalBuilder, don't
10023 leave it in after returning it.
10024 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
10026 2006-08-06 Marek Safar <marek.safar@seznam.cz>
10028 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
10031 2006-08-03 Raja R Harinath <rharinath@novell.com>
10033 Fix cs0146-3.cs and cs0146-4.cs.
10034 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
10035 enclosing types don't depend on the current type.
10037 2006-08-02 Raja R Harinath <rharinath@novell.com>
10040 * class.cs (TypeContainer.DoDefineMembers): Use
10041 FindBaseMemberWithSameName on Parent, since we're interested in
10042 whether we hide inherited members or not.
10043 (FindBaseMemberWithSameName): Make slightly more robust.
10045 Fix the non-generic testcase from #77396
10046 * decl.cs (DeclSpace.DeclContainer): Remove override.
10048 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
10049 declspaces for doppelgangers too.
10050 (UsingEntry): Implement IResolveContext.
10051 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
10052 'this' as the resolve context.
10053 (LocalAliasEntry): Likewise.
10055 Implement parts of #77403
10056 * roottypes.cs (RootDeclSpace): New. Used to represent the
10057 toplevel declaration space. Each namespace declaration introduces
10058 a "partial" root declaretion space.
10059 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
10060 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
10061 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
10062 from 'current_namespace.SlaveDeclSpace'.
10063 (namespace_declaration): Likewise.
10064 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
10065 check. It can't happen now.
10066 * decl.cs (DeclSpace.LookupType): Likewise.
10067 * driver.cs (MainDriver): Sanity check.
10069 2006-08-01 Raja R Harinath <rharinath@novell.com>
10071 * decl.cs (DeclSpace.FindNestedType): Remove.
10072 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
10073 LookupTypeContainer to get the container of the nested type.
10074 * class.cs (TypeContainer.FindNestedType): Make non-override.
10076 2006-07-31 Raja R Harinath <rharinath@novell.com>
10078 * decl.cs (DeclSpace.PartialContainer): Move field from ...
10079 * class.cs (TypeContainer.PartialContainer): ... here.
10080 (TypeContainer.AddBasesForPart): New helper.
10081 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
10083 * cs-parser.jay (current_class): Convert to DeclSpace.
10084 (struct_declaration, interface_declaration, class_declaration):
10085 Use AddBasesForPart instead of .Bases directly.
10086 * const.cs, iterators.cs: Update to changes.
10088 2006-07-28 Raja R Harinath <rharinath@novell.com>
10090 * class.cs (TypeContainer.AddMemberType): Rename from
10091 AddToTypeContainer.
10092 (TypeContainer.AddMember): Rename from AddToMemberContainer.
10093 (AddTypeContainer): New. Combine AddClassOrStruct and
10095 (AddPartial): Update. Add 'is_partial' argument.
10096 * roottypes.cs: Update to changes.
10097 * cs-parser.jay (push_current_class): New helper for handling
10098 current_container and current_class.
10099 (struct_declaration, interface_declaration, class_declaration):
10102 2006-07-26 Raja R Harinath <rharinath@novell.com>
10104 * roottypes.cs: Rename from tree.cs.
10106 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
10107 * tree.cs (Tree, ITreeDump): Remove types.
10108 * rootcontext.cs (tree, Tree): Remove fields.
10109 (root, ToplevelTypes): New.
10110 * *.cs: Update to rename.
10112 * tree.cs (Tree.RecordDecl): Remove.
10113 (RootTypes.AddToTypeContainer): Record the toplevel type in its
10115 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
10117 2006-07-23 Raja R Harinath <harinath@gmail.com>
10119 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
10120 DoFlowAnalysis and OmitStructFlowAnalysis here.
10121 (ec.With): Rename from WithUnsafe and generalize.
10122 (ec.WithCheckState): Remove. All users can be handled by 'With'.
10123 (ec.WithFlowAnalyis): New.
10124 * ecore.cs, expression.cs, statement.cs: Update.
10126 2006-07-22 Raja R Harinath <harinath@gmail.com>
10128 * statement.cs (Block.ResolveMeta): Simplify slightly.
10130 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
10131 multiple boolean fields. Convert InUnsafe, constant_check_state,
10132 check_state to flags.
10133 (CheckState, ConstantCheckState): Update.
10134 (InUnsafe): New read-only property.
10135 (FlagsHandle): Rename from CheckStateHandle and convert to handle
10137 (WithUnsafe): New helper similar to WithCheckState.
10138 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
10139 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
10141 2006-07-21 Raja R Harinath <rharinath@novell.com>
10143 Make comparisons use the same IL irrespective of whether they're
10144 in a 'checked' or 'unchecked' context: one of the issues in #78899
10145 * codegen.cs (EmitContext.CheckState): Make read-only property.
10146 (EmitContext.ConstantCheckState): Likewise.
10147 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
10148 helper that implement a save/restore stack for CheckState
10149 values. This is the only way to change check-state.
10150 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
10151 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
10152 (CheckedExpr.EmitBranchable): New forwarding method.
10153 (UnCheckedExpr): Likewise.
10154 * statement.cs (Block.ResolveMeta): Use WithCheckState.
10155 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
10156 (Checked.Resolve, checked.DoEmit): Likewise.
10158 2006-07-20 Miguel de Icaza <miguel@novell.com>
10160 * anonymous.cs: Cache the resolved anonymous delegate, and return
10161 this so that the ResolveTopBlock is only triggered once, not
10164 Currently we trigger ResolvetopBlock twice due to a first pass of
10165 argument check compatibility, and a second pass that does the
10168 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10170 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
10172 * rootcontext.cs (Reset): Add helper_classes.
10174 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10177 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
10180 2006-07-13 Miguel de Icaza <miguel@novell.com>
10182 * statement.cs (Lock): Handle expressions of type
10183 TypeManager.null_type specially. Fixes #78770
10185 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10187 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
10190 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10192 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
10193 for accessors as well.
10194 * ecore.cs (EventExpr): Add AccessorTable.
10196 2006-07-01 Marek Safar <marek.safar@seznam.cz>
10199 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
10200 for CS0122 where appropriate.
10201 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
10203 (Filter): Assembly can be null in the case of top level attributes.
10205 2006-06-25 Marek Safar <marek.safar@seznam.cz>
10209 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
10210 is done at global level.
10212 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10214 A fix for #77002, Implemented TypeForwarder support.
10216 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
10217 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
10218 * typemanager.cs (): Add type_forwarder_attr_type.
10220 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10222 * report.cs: Add CS0469 warning.
10224 2006-06-21 Martin Baulig <martin@ximian.com>
10226 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
10227 the `try'-block, so we also report CS0016 etc. there.
10229 2006-06-21 Martin Baulig <martin@ximian.com>
10232 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
10234 2006-06-21 Martin Baulig <martin@ximian.com>
10236 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
10237 also report CS1686 for parameters.
10239 2006-06-21 Martin Baulig <martin@ximian.com>
10241 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
10242 instead of an error if the value is not implicitly convertible to
10243 the switch types; fixes #77964.
10245 2006-06-21 Raja R Harinath <rharinath@novell.com>
10248 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
10249 FieldBuilder is null.
10252 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
10253 'left' and 'right' before error-checking.
10255 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
10257 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
10259 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
10260 (FieldExpr.DoResolve): likewise.
10261 (PropertyExpr.InstanceResolve): likewise.
10262 (EventExpr.InstanceResolve): likewise.
10264 2006-06-04 Marek Safar <marek.safar@seznam.cz>
10266 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
10267 attribute applicable tests for attribute argument.
10269 2006-06-02 Raja R Harinath <rharinath@novell.com>
10272 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
10273 (Binary.OverloadResolve_PredefinedIntegral): New.
10274 (Binary.OverloadResolve_PredefinedFloating): New.
10275 (Binary.OverloadResolve_PredefinedString): New.
10276 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
10277 Follow the standard more closely, and treat numeric promotions in
10278 terms of overload resolution.
10279 (Binary.CheckShiftArguments): Simplify.
10281 2006-06-01 Raja R Harinath <rharinath@novell.com>
10283 * flowanalysis.cs (MyBitVector): Simplify representation.
10284 (MyBitVector.Clone): Avoid allocating BitArray.
10285 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
10286 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
10287 (*): Update. Change all references to MyBitVector.And and
10288 MyBitVector.Or to &= and |=.
10290 2006-05-29 Raja R Harinath <rharinath@novell.com>
10292 Fix cs0231-[34].cs.
10293 * cs-parser.jay (formal_parameter_list): Extend the pattern below
10294 to param arguments too.
10296 2006-05-26 Miguel de Icaza <miguel@novell.com>
10298 * cs-parser.jay: Catch another parsing form for arglist being
10299 followed by other arguments. Fixes #78313.
10301 2006-05-24 Raja R Harinath <rharinath@novell.com>
10303 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
10304 checking of out parameters to ...
10305 (FlowBranchingToplevel.Merge): ... here.
10306 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
10307 set, propagate the origin upward, and only complain if there was
10309 (FlowBranchingException.AddContinueOrigin): Likewise.
10310 (FlowBranchingException.AddReturnOrigin): Likewise.
10311 (FlowBranchingException.AddGotoOrigin): Likewise.
10313 2006-05-23 Raja R Harinath <rharinath@novell.com>
10315 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
10316 unreachable, skip it.
10317 (FlowBranchingException.Merge): Always propagate jumps, even if
10318 the finally block renders subsequent code unreachable.
10320 2006-05-18 Raja R Harinath <rharinath@novell.com>
10323 * statement.cs (Goto.Resolve): Move responsibility for resolving
10324 'goto' to FlowBranching.AddGotoOrigin.
10325 (Goto.SetResolvedTarget): New. Callback to set the
10326 LabeledStatement that's the target of the goto.
10327 (Goto.DoEmit): Use Leave instead of Br when crossing an
10328 unwind-protect boundary.
10329 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
10330 LookupLabel and adjust to new semantics.
10331 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
10332 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
10333 Goto.SetResolvedTarget to update target.
10334 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
10335 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
10336 AddBreakOrigin & co. Delay propagation until ...
10337 (FlowBranchingException.Merge): ... this.
10339 * statement.cs (Block.Resolve): Always depend on flow-branching to
10340 determine unreachability. Kill workaround that originally emitted
10341 only one statement after an "unreachable" label (see infloop in
10344 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
10345 This is still "wrong", but anything better would probably need a
10346 multi-pass algorithm.
10347 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
10348 usage vector. Force current usage vector to be reachable, to
10349 optimistically signify backward jumps.
10350 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
10352 (FlowBranchingLabeled.Merge): New. If no backward jump was
10353 detected, return the original salted-away usage vector instead,
10354 updated with appropriate changes. Print unreachable warning if
10356 * statement.cs (Block.Resolve): Don't print unreachable warning on
10357 a labeled statement.
10359 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
10361 * driver.cs: Pass filename without path to AssemblyBuilder's
10362 AddResourceFile. Fixes bug #78407.
10364 2006-05-17 Raja R Harinath <rharinath@novell.com>
10366 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
10367 * flowanalysis.cs (FlowBranchingLabeled): ... here.
10368 (FlowBranching.MergeChild): Overwrite
10369 reachability information from Labeled branchings too.
10371 2006-05-16 Raja R Harinath <rharinath@novell.com>
10373 * statement.cs (Goto.Resolve): Merge jump origins here ...
10374 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
10376 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
10377 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
10378 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
10379 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
10381 * statement.cs (Goto.Resolve): ... not here.
10382 (Goto.Emit): Remove CS1632 check.
10384 2006-05-14 Marek Safar <marek.safar@seznam.cz>
10386 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
10389 2006-05-11 Raja R Harinath <rharinath@novell.com>
10391 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
10392 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
10393 (FlowBranchingException.Label): Likewise.
10395 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
10397 (MyBitVector.Or): Use it to avoid losing information (Count).
10398 (FlowBranching.MergeOrigins): Likewise.
10400 * flowanalysis.cs (UsageVector.IsDirty): Remove.
10401 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
10402 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
10403 (UsageVector.ToString): Simplify.
10404 (UsageVector.MergeSiblings): Move here from ...
10405 (FlowBranching.Merge): ... here.
10406 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
10409 2006-05-10 Raja R Harinath <rharinath@novell.com>
10411 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
10412 null bitvector is treated as all-true.
10414 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
10415 (MyBitVector): Rationalize invariants. 'vector != null' implies
10416 that we have our own copy of the bitvector. Otherwise,
10417 'InheritsFrom == null' implies all inherited bits are true.
10419 2006-05-09 Marek Safar <marek.safar@seznam.cz>
10421 * statement.cs (LocalInfo): Add IsConstant.
10422 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
10423 local variable for constants.
10425 2006-05-09 Raja R Harinath <rharinath@novell.com>
10427 * flowanalysis.cs (MyBitVector.Empty): New.
10428 (MyBitVector): Don't allow InheritedFrom to be null.
10429 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
10430 (UsageVector, FlowBranching): Update to changes.
10432 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
10433 recursion. The 'Parent == null' condition isn't sufficient for
10435 (FlowBranching.AddBreakOrigin): Likewise.
10436 (FlowBranching.AddContinueOrigin): Likewise.
10437 (FlowBranching.AddReturnOrigin): Likewise.
10438 (FlowBranching.StealFinallyClauses): Likewise.
10439 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
10440 (FlowBranching.CheckOutParameters): Likewise.
10441 (FlowBranchingToplevel): Terminate all the above recursions here.
10442 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
10443 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
10445 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
10447 (FlowBranchingToplevel): New. Empty for now.
10448 (FlowBranching.MergeTopBlock): Update.
10449 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
10450 branching for the anonymous delegate.
10451 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
10453 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
10454 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
10455 information at the start of the merge. Reorganize.
10457 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10459 * class.cs (MethodData.Define): Method cannot implement interface accessor.
10461 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10463 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
10464 to newly introduced ctor.
10466 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
10467 message to one place.
10468 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
10471 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10473 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
10475 * ecore.cs (Expression.ResolveAsConstant): Updated.
10477 * statement.cs (ResolveMeta): Updated.
10479 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10481 * cs-parser.jay: __arglist cannot be used in initializer.
10483 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10486 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
10489 2006-05-05 Raja R Harinath <rharinath@novell.com>
10491 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
10492 (LabeledStatement): Add 'name' parameter.
10493 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
10494 (Block.AddLabel): Update to changes.
10495 * cs-parser.jay (labeled_statement): Likewise.
10497 * flowanalysis.cs (BranchingType.Labeled): New.
10498 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
10499 (FlowBranchingLabeled): New. Does nothing for now, but will
10500 eventually handle 'goto' flows.
10501 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
10502 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
10503 that's terminated ...
10504 (Block.Resolve): ... here.
10506 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
10507 (UsageVector.MergeFinallyOrigins): Likewise.
10508 (FlowBranching.InTryOrCatch): Likewise.
10509 (FlowBranching.AddFinallyVector): Likewise.
10510 (FlowBranchingException): Update to changes.
10513 * statement.cs (Return.Resolve): Move error checking to ...
10514 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
10515 (FlowBranchingException): Handle return origins like break and
10517 (FlowBranching.UsageVector.CheckOutParameters): Remove.
10519 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10522 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
10525 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10528 * class.cs (MethodData.Define): Do public accessor check only when method
10529 implements an interface.
10531 2006-05-04 Raja R Harinath <rharinath@novell.com>
10533 Remove special handling of 'break'
10534 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
10535 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
10536 (UsageVector.Break): Remove.
10537 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
10539 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
10541 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
10542 UsageVector.Breaks (). Don't set NeedsReturnLabel.
10544 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10547 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
10548 be the interface member.
10550 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10553 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
10554 for emitting small (int) values.
10556 2006-05-03 Raja R Harinath <rharinath@novell.com>
10559 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
10560 control-flow passes through the 'finally' after merging-in all the
10561 control-flows from 'try' and the 'catch' clauses.
10563 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
10564 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
10565 always true at the only non-recursive entry point.
10566 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
10567 FlowBranchingBreakable.
10568 (FlowBranchingLoop): Remove.
10569 * statement.cs (Return.DoResolve): Update to changes.
10572 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
10573 (FlowBranching.CreateBranching): Handle it: create a
10574 FlowBranchingContinuable.
10575 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
10576 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
10577 except that it handles the 'continue' command.
10578 (FlowBranching.UsageVector.MergeOrigins): Rename from
10580 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
10581 except that it overrides AddContinueOrigin.
10582 (FlowBranchingException): Override AddContinueOrigin, similar to
10584 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
10585 Create a new branching around the embedded statement.
10586 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
10587 control flow after the embedded statement.
10588 (Continue.Resolve): Move all error checking to AddContinueOrigin.
10590 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
10591 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
10592 FlowBranchingBreakable.
10593 (FlowBranchingSwitch): Remove.
10596 * statement.cs (Break.Resolve): Simplify. Move responsibility for
10597 error reporting to ...
10598 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
10599 Rename from 'AddBreakVector'. Add new location argument. Return
10600 a bool indicating whether the 'break' crosses an unwind-protect.
10601 (FlowBranchingException.AddBreakOrigin): Add.
10602 (FlowBranchingException.Merge): Propagate 'break's to surrounding
10603 flowbranching after updating with the effects of the 'finally'
10605 (FlowBranchingBreakable): New common base class for
10606 FlowBranchingLoop and FlowBranchingSwitch.
10608 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
10609 embedded statement.
10610 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
10612 2006-05-02 Raja R Harinath <rharinath@novell.com>
10614 * statement.cs (Do.Resolve): If the loop is infinite, set the
10616 (While.Resolve, For.Resolve): Set a barrier after the embedded
10617 statement. There's no direct control flow that goes from the end
10618 of the embedded statement to the end of the loop.
10619 * flowanalysis.cs (FlowBranching.Infinite): Remove.
10620 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
10621 above ensure that the reachability is correctly computed.
10623 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
10624 (UsageVector.MergeBreakOrigins): If the current path is
10625 unreachable, treat it as if all parameters/locals are initialized.
10626 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
10627 infinite loops before merging-in break origins.
10629 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
10630 (Reachability.Reachable): Split part into ...
10631 (Reachability.Unreachable): ... this. Simplify.
10632 (Reachability.IsUnreachable): Use 'Unreachable' instead.
10634 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
10635 (Reachability.SetThrowsSometimes): Likewise.
10636 (FlowBranchingBlock.MergeTopBlock): Don't compare against
10637 TriState.Always, use corresponding property.
10638 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
10639 (Block.Resolve): Likewise. Remove some redundant checks.
10641 2006-05-02 Raja R Harinath <harinath@gmail.com>
10643 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
10644 (Reachability.Meet): Don't bother checking AlwaysThrows --
10645 barrier is always set.
10646 (FlowBranchingBlock.Merge): Likewise.
10648 2006-05-01 Raja R Harinath <harinath@gmail.com>
10650 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
10651 checks for unreachable.
10653 2006-05-01 Marek Safar <marek.safar@seznam.cz>
10656 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
10658 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
10659 whether field is really assigned.
10661 2006-04-30 Raja R Harinath <harinath@gmail.com>
10663 * flowanalysis.cs (Reachability): Make 4-argument constructor
10665 (Reachability.Meet): Rename from 'And'. Remove static variant.
10666 (Reachability.Always): Rename from the highly misleading
10667 'Reachability.Never'.
10668 (FlowBranching.Merge): Update to changes. Mark an impossible
10669 situation with a 'throw'.
10670 (*): Update to changes.
10672 2006-04-29 Raja R Harinath <harinath@gmail.com>
10674 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
10675 Remove 'Undefined'.
10676 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
10677 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
10678 (*): Update to changes.
10679 * statement.cs: Update to changes.
10681 2006-04-28 Marek Safar <marek.safar@seznam.cz>
10684 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
10686 2006-04-28 Raja R Harinath <harinath@gmail.com>
10688 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
10691 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
10692 argument to two arguments: an usage-vector and a bool. Move call
10693 to FlowBranching.Merge () ...
10694 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
10696 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
10697 handling of loop and switch reachability to ...
10698 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
10700 2006-04-27 Raja R Harinath <harinath@gmail.com>
10702 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
10703 handling to FlowBranchingLoop.InLoop.
10704 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
10706 2006-04-26 Marek Safar <marek.safar@seznam.cz>
10709 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
10710 anonymous method is allowed from AnonymousContainer here.
10712 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
10714 2006-04-24 Raja R Harinath <rharinath@novell.com>
10717 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
10719 2006-04-23 Marek Safar <marek.safar@seznam.cz>
10722 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
10723 (DoubleConstant.Reduce): Ditto.
10725 2006-04-23 Raja R Harinath <rharinath@novell.com>
10727 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
10728 Remove 'lvalue_right_side' argument. Move parts to ...
10729 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
10730 (LocalVariable.DoResolveLValue): ... these.
10732 2006-04-21 Raja R Harinath <rharinath@novell.com>
10735 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
10736 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
10737 (LocalVariableReference.DoResolveBase): Use it to implement new
10739 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
10740 (Argument.Resolve): Simplify. Move CS1510 check ...
10741 * ecore.cs (Expression.ResolveLValue): ... here.
10742 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
10743 (PropertyExpr.DoResolveLValue): Likewise.
10744 (FieldExpr.Report_AssignToReadonly): Likewise.
10745 (FieldExpr.DoResolve): Add 'out_access' argument. Use
10746 LValueMemberAccess or LValueMemberOutAccess on instance depending
10748 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
10749 DoResolve as appropriate.
10751 2006-04-20 Raja R Harinath <rharinath@novell.com>
10754 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
10755 implicit conversions on 'out' and 'ref' arguments.
10757 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
10758 improve clarity. Remove dead code.
10761 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
10762 (Catch.Resolve): Resolve VarBlock if it exists.
10764 2006-04-19 Miguel de Icaza <miguel@novell.com>
10766 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
10767 twice, this was some residual code, the enumerator was emitted
10768 properly in the two branche of if later.
10770 2006-04-19 Raja R Harinath <rharinath@novell.com>
10772 * expression.cs (Cast.ResolveLValue): Remove. The result of a
10773 cast is never an lvalue.
10774 (Cast.DoResolve, Cast.ResolveRest): Combine.
10775 (Argument.Emit): Simplify slightly. Move 'Expr is
10776 IMemoryLocation' check ...
10777 (Argument.Resolve): ... here.
10778 (Argument.Error_LValueRequired): Remove. Inline into only user.
10780 Simplifications. Fix cs0191-2.cs
10781 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
10782 CS1649 and CS1651 to ...
10783 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
10784 the actual selection of the error code and message to a lookup
10785 table. Add a dummy return value to simplify callsites.
10786 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
10787 readonly fields of other instances of the same type. Move CS0197
10789 * expression.cs (Argument.Resolve): ... here. Simplify code.
10790 Ensure that ec.InRefOutArgumentResolving is only set during LValue
10791 resolution of an out or ref argument. The code simplification
10792 above uses this invariant.
10794 2006-04-18 Raja R Harinath <rharinath@novell.com>
10796 Possibly fix #77752. Fix cs1690-[4-7].cs.
10797 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
10798 CheckMarshallByRefAccess. Drop parameter.
10799 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
10801 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
10802 InstanceExpression.
10803 * report.cs (AllWarnings): Add CS1690.
10804 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
10805 for ref access too.
10806 (LocalVariableReference.DoResolveBase): Update.
10808 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10810 * class.cs (MethodOrOperator): Moved common parts from method class.
10811 detect obsolete attributes.
10812 (Method.Define): Simplified as it reuses code from base.
10813 (Constructor.ValidAttributeTargets): Fixed issue found during
10815 (Destructor.ValidAttributeTargets): Fixed issue found during
10817 (Operator): Finished refactoring set off by #78020. Operator class is now
10818 ordinary method class.
10820 * anonymous.cs: Updated.
10822 * decl.cs (DeclSpace): Add IsGeneric
10824 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10826 * class.cs (Constructor.Emit): Don't emit the attributes twice.
10828 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10830 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
10831 detect obsolete attributes.
10832 (Method.CreateEmitContext): Moved to MethodOrOperator.
10834 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10837 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
10838 customized exception to make crash detection easier.
10839 (MethodOrOperator): Started to work on new base class for methods and
10841 (Method): Derives from MethodOrOperator.
10842 (Constructor.Emit): Emits its own attributes.
10843 (AbstractPropertyEventMethod.Emit): Ditto.
10844 (Operator): Derives from MethodOrOperator, will refactor fully in extra
10846 (Operator.Emit): It's temporary more tricky than should be.
10848 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
10850 * report.cs (InternalErrorException): Add ctor with inner exception.
10852 2006-04-08 Marek Safar <marek.safar@seznam.cz>
10855 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
10858 2006-04-07 Marek Safar <marek.safar@seznam.cz>
10861 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
10864 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10866 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
10867 attribute is present and Guid not.
10868 (Interface.ApplyAttributeBuilder): Ditto.
10870 * attribute.cs: Add error message.
10872 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10876 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
10877 sources (it's composite) so hold them in extra array as they are used in
10878 Emit phase only. It worked in the previous versions by mistake.
10879 (Attribute.Emit): Emit attribute for more owners when exist.
10881 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
10882 it has now different behaviour.
10884 2006-04-04 Marek Safar <marek.safar@seznam.cz>
10886 * constant.cs (Constant.IsDefaultInitializer): New method.
10888 * class.cs: Updated.
10890 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
10891 re-initialize default values. It saves KBs almost for every assembly.
10892 Thanks Zoltan for the idea.
10893 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
10894 (ArrayCreation.DoResolve): Resolve only once.
10895 (ArrayCreation.Emit): Emit static initializer only when it is faster.
10896 (ArrayCreation.GetAttributableValue): Cope with optimized values.
10898 2006-04-03 Zoltan Varga <vargaz@gmail.com>
10900 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
10903 2006-04-01 Marek Safar <marek.safar@seznam.cz>
10905 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
10906 in an embedded statement too.
10908 2006-04-01 Raja R Harinath <rharinath@novell.com>
10911 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
10913 2006-04-01 Marek Safar <marek.safar@seznam.cz>
10917 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
10920 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
10922 2006-03-31 Marek Safar <marek.safar@seznam.cz>
10924 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
10927 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
10928 LocalTemporary change.
10930 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
10932 (ClassOrStruct.DefineFieldInitializers): Implemented static field
10933 initializers optimization.
10934 (ClassOrStruct.TypeAttr): Moved from modifiers.
10935 (Constructor.CheckBase): Don't crash when static ctor has parameters.
10936 (FieldBase.ResolveInitializer): Resolves initializer.
10937 (FieldBase.HasDefaultInitializer): New property.
10939 * cs-parser.jay: Removed message.
10941 * expression.cs (CompilerGeneratedThis): New specialization.
10943 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
10945 2006-03-28 Marek Safar <marek.safar@seznam.cz>
10947 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
10949 2006-03-27 Marek Safar <marek.safar@seznam.cz>
10951 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
10952 be now EnumConstants only.
10954 2006-03-27 Marek Safar <marek.safar@seznam.cz>
10956 * attribute.cs, driver.cs: Reset more caches.
10958 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10960 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
10962 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10964 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
10965 for easier reuse. Updated all overrides.
10966 (IntegralConstant): New base class for all integral constants.
10967 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
10968 of the constant range, report custom error.
10969 (UIntConstant.Reduce): Fixed uint conversion.
10971 * ecore.cs, literal.cs: Reduce updates.
10973 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10977 * class.cs (Constructor.Define): Removed extra if for default ctors.
10978 A patch from Atsushi Enomoto.
10980 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10982 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
10983 GetAttributableValue.
10985 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
10988 * convert.cs (ImplicitConversionRequired): Error message moved to
10991 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
10992 automatic implicit conversion of an output value.
10993 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
10995 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
10997 (TypeOf.GetAttributableValue): Add extra handling for object type.
10999 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
11000 special error message.
11002 2006-03-25 Marek Safar <marek.safar@seznam.cz>
11004 * class.cs (Constructor.Emit): Don't crash when struct ctor is
11006 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
11007 compatible with MS runtime.
11009 2006-03-23 Marek Safar <marek.safar@seznam.cz>
11011 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
11012 attribute arguments here.
11014 * class.cs (Indexer.Define): The check was moved to attribute class.
11016 2006-03-22 Marek Safar <marek.safar@seznam.cz>
11018 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
11019 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
11022 2006-03-22 Raja R Harinath <rharinath@novell.com>
11024 Support ParameterDefaultValueAttribute in gmcs. Also applied to
11025 mcs to keep code differences small.
11026 * attribute.cs (Attribute.GetParameterDefaultValue): New.
11027 * typemanager.cs (parameter_default_value_attribute_type): New.
11028 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
11031 2006-03-21 Marek Safar <marek.safar@seznam.cz>
11033 * expression.cs (StringConcat.Append): Reverted back to no warning state.
11035 2006-03-21 Marek Safar <marek.safar@seznam.cz>
11037 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
11039 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
11042 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
11044 * doc-bootstrap.cs : fix build.
11046 2006-03-20 Marek Safar <marek.safar@seznam.cz>
11048 * expression.cs (StringConcat.Append): Issue a warning when empty string
11049 is going to append.
11051 2006-03-20 Marek Safar <marek.safar@seznam.cz>
11053 * assign.cs (CompoundAssign.ResolveSource): Removed.
11055 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
11058 * class.cs (TypeContainer.FindMethods): Removed.
11059 (TypeContainer.CheckMemberUsage): Made static.
11061 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
11063 * constant.cs (CheckRange): Removed unused type argument.
11064 (CheckUnsigned): Removed unused type argument.
11066 * cs-parser.jay: Updated after MemberAccess clean up.
11067 Uses Length for empty string test.
11069 * cs-tokenizer.cs: Uses Length for empty string test.
11070 (IsCastToken): Made static.
11071 (is_hex): Made static.
11072 (real_type_suffix): Made static.
11074 * decl.cs (SetupCache): Made static.
11075 (OnGenerateDocComment): Removed unused ds argument.
11077 * delegate.cs (VerifyDelegate): Removed unused argument.
11079 * doc.cs: Uses Length for empty string test.
11081 * driver.cs: Uses Length for empty string test.
11083 * enum.cs (IsValidEnumType): Made static
11085 * expression.cs (EnumLiftUp): Removed unused argument.
11086 (ResolveMethodGroup): Ditto.
11087 (BetterConversion): Ditto.
11088 (GetVarargsTypes): Ditto.
11089 (UpdateIndices): Ditto.
11090 (ValidateInitializers): Ditto.
11091 (MemberAccess.ctor): Ditto.
11092 (GetIndexersForType): Ditto.
11094 * flowanalysis.cs: (MergeFinally): Removed unused argument.
11096 * iterators.cs: Updated after MemberAccess clean up.
11098 * location.cs: Uses Length for empty string test.
11100 * namespace.cs: Uses Length for empty string test.
11102 * report.cs (CheckWarningCode): Made static.
11104 * statement.cs (LabeledStatement): Removed unused argument.
11106 * typemanager.cs (FilterNone): Removed.
11108 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11110 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
11113 * class.cs: Updated.
11115 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11117 * cs-parser.jay.cs: __arglist is not allowed for delegates.
11119 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11123 * expression.cs (VerifyArgumentsCompat): Reverted to double error
11124 reporting, it's more tricky than I thought.
11126 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11130 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
11132 (AnonymousMethod.ImplicitStandardConversionExists): New method.
11133 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
11134 Add more error reporting; Fixed issue with params.
11136 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
11138 * cs-parser.jay: AnonymousMethod requires host container.
11140 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
11142 2006-03-18 Raja R Harinath <harinath@gmail.com>
11144 * class.cs: Change 'TypeContainer ds' constructor argument to
11145 'DeclSpace parent'. Some classes were missed below due to
11146 different naming convention.
11148 * class.cs (MemberCore.Parent): Delete. This makes the
11149 ParentContainer changes below enforceable by the compiler.
11151 Treat pointers to enclosing declaration space as 'DeclSpace', not
11153 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
11154 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
11156 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
11158 (Block.AddThisVariable): Likewise.
11159 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
11160 (AbstractPropertyEventMethod.Emit): Likewise.
11161 (AbstractPropertyEventMethod.EmitMethod): Likewise.
11162 (GetMethod.Define, SetMethod.Define): Likewise.
11163 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
11164 (DelegateMethod.EmitMethod): Likewise.
11166 Fix regression test-partial-13.cs.
11167 Rationalize use of PartialContainer. Ensure that the partial
11168 class semantics can be tied to type-correctness, i.e., any
11169 violation will cause a compile error.
11170 * class.cs, const.cs: Access all fields that belong to class
11171 TypeContainer via ParentContainer. Arguments of EmitContexts and
11172 Resolve()-like functions still use 'Parent'.
11174 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
11175 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
11176 (PropertyMethod.CheckModifiers): Remove unused argument.
11177 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
11180 2006-03-17 Raja R Harinath <harinath@gmail.com>
11182 Make semantics of PartialContainer simpler.
11183 * decl.cs (DeclSpace.IsPartial): Remove.
11184 * class.cs (TypeContainer.IsPartial): Likewise.
11185 (TypeContainer..ctor): Set PartialContainer to point to self.
11186 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
11187 (TypeContainer.FindNestedType): Likewise.
11188 (MemberCore.ParentContainer): Simplify. Remove deprecation.
11190 2006-03-17 Marek Safar <marek.safar@seznam.cz>
11192 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
11194 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11196 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
11199 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11201 * class.cs (Operator.Define): An error for base conversion was not
11202 reported correctly.
11204 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
11206 * iterator.cs : yield break is allowed in try statement which has
11207 catch clauses. Fixed bug #77767.
11209 2006-03-13 Marek Safar <marek.safar@seznam.cz>
11211 A fix for #77593, #77574.
11213 * class.cs (MethodCore.CheckBase): Another if for operator.
11215 2006-03-09 Marek Safar <marek.safar@seznam.cz>
11217 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
11220 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
11221 (DelegateCreation.ImplicitStandardConversionExists): New method for just
11224 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
11227 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
11228 Updated after another emitcontext usage was clean up. It should help us to
11229 synchronize with gmcs easier.
11231 2006-03-04 Marek Safar <marek.safar@seznam.cz>
11235 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
11236 (Event.Define): ditto
11237 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
11239 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
11240 Removed redundant code and set NewSlot for Invoke method too.
11242 * parameter.cs (Parameters.ctor): Add custom, type ctor.
11243 (Parameters.MergeGenerated): New method. Use this method when you merge
11244 compiler generated argument with user arguments.
11246 2006-03-03 Marek Safar <marek.safar@seznam.cz>
11248 * attribute.cs (ResolveAsTypeTerminal): Removed.
11250 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
11251 specialization for predefined types; 30% speed up.
11252 Finally placed obsolete check to right place.
11253 (Expression.ResolveType): Removed.
11255 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
11256 Updated after ResolveType was removed.
11258 * expression.cs (Cast.ctor): Check void cast.
11259 (Binary.ResolveAsTypeTerminal): Is never type.
11260 (Conditional.ResolveAsTypeTerminal): Is never type.
11262 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
11264 2006-03-01 Raja R Harinath <rharinath@novell.com>
11267 * expression.cs (ParameterReference.DoResolveBase): Change return
11269 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
11273 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
11276 * typemanager.cs (GetFullNameSignature): Don't nullref on
11277 protected accessors.
11279 2006-02-27 Marek Safar <marek.safar@seznam.cz>
11281 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
11282 these two separated members to simplify the code.
11283 (Attribute.Resolve): Refactored to use new fields and methods.
11284 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
11285 implemented obsolete attribute checking.
11286 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
11287 implemented obsolete checking again. It look line never ending quest ;-)
11288 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
11290 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
11292 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
11294 *class.cs (Property.Define): Add RegisterProperty call.
11296 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
11297 argument groups (only 2).
11299 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
11300 encoding expression to arguments.
11301 (Expression.ExprClassToResolveFlags): Just turned to property.
11303 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
11304 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
11305 optimized as well as implemented support for zero-length attributes.
11307 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
11308 Add caching of PropertyInfo's.
11310 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11312 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
11313 error multiple times.
11315 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11317 New partial class implementation.
11318 A fix for #77027, #77029, #77403
11320 * attribute.cs (Attributable): Made attributes protected.
11322 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
11323 the replacements of ClassPart and PartialContainer.
11324 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
11325 (TypeContainer.AddInterface): Ditto.
11326 (TypeContainer.AddPartial): The main method for partial classes. It checks
11327 for errors and merges ModFlags and attributes. At the end class is added to
11328 partial_parts list.
11329 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
11331 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
11332 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
11333 from the rest of partial classes.
11334 (TypeContainer.GetClassBases): Simplified.
11335 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
11337 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
11338 (TypeContainer.HasExplicitLayout): Uses Flags now.
11339 (PartialContainer): Removed.
11340 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
11341 (StaticClass): Was merged with Class.
11342 (Class.GetClassBases): class and static class bases are verified here.
11343 (Class.TypeAttr): Added static attributes when class is static.
11344 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
11345 (MemberBase): In some cases we need to call parent container for partial
11346 class. It should be eliminated but it's not easy now.
11348 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
11350 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
11351 partial classed to accumulate class comments.
11352 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
11354 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
11356 * driver.cs (MainDriver): Tree.GetDecl was removed.
11358 * modifiers.cs (Modifiers): Add partial modifier.
11360 * tree.cs (Tree.decl): Removed.
11361 (RootTypes): Started to use this class more often for root types
11364 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11368 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
11369 external interface does not have an attribute.
11371 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11373 Another prerequisites for new partial classs implementation.
11375 * attribute.cs (Attribute.Equal): Implemented.
11376 (Attribute.Emit): Changed as attributes can be applied more than twice.
11377 (Attributes.Emit): Check for duplicate attributes here.
11379 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
11380 as a parameter, clean-up.
11382 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11386 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
11387 contains obsolete attribute check which can in some cases look for base
11388 type of current class which is not initialized yet.
11389 (TypeContainer.BaseType): Replacement of ptype.
11391 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
11393 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11395 First of prerequisites for new partial classs implemention.
11397 * attribute.cs (Attributable): Extended by ResolveContext;
11398 Attributes finally have correct context for resolving in all cases.
11399 (AttachTo): Attribute owner is assigned here.
11401 * codegen.cs (IResolveContext): Introduce new interface to hold
11402 all information needed in resolving phase.
11403 (EmitContext): Implements IResolveContext; more clean-up needed here.
11405 * decl.cs (MemberCore): Implemented IResolveContext.
11407 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
11408 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
11409 parameter.cs, statement.cs, tree.cs, typemanager.cs:
11410 Refactored to use new IResolveContext instead of EmitContext; cleanup
11412 2006-02-06 Miguel de Icaza <miguel@novell.com>
11414 * codegen.cs (EmitScopeInitFromBlock): check here the
11415 capture_context, there is no need to make two calls to the
11418 * anonymous.cs: Add some debugging messages that might help me
11419 track other instances of this problem in the future (the
11420 regression of test 467).
11422 * cs-parser.jay: track the variable block, as we need to initalize
11423 any captured variables declared in this block for the "catch"
11424 portion of the "Try" statement.
11426 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
11427 scope initialization for captured variables.
11429 Also, move the emit for the variables after the block location has
11432 2006-02-06 Marek Safar <marek.safar@seznam.cz>
11434 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
11436 2006-02-02 Miguel de Icaza <miguel@novell.com>
11438 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
11439 commit yesterday, the initialization for the roots is necessary.
11440 What is not necessary is the scope activation.
11442 2006-02-02 Raja R Harinath <rharinath@novell.com>
11444 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
11445 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
11447 (Argument.Resolve): Remove CS0206 checks.
11449 2006-02-01 Miguel de Icaza <miguel@novell.com>
11451 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
11452 scopes for all the roots, the scopes will now be emitted when the
11453 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
11455 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
11456 code. This reduces a lot of existing cruft.
11458 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
11459 that the ScopeInfo is generated as we enter the scope, not at the
11460 time of use, which is what we used to do before.
11462 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
11463 every time a Block is about to be emitted if we have a
11466 2006-02-01 Raja R Harinath <rharinath@novell.com>
11468 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
11470 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
11472 * typemanager.cs (cons_param_array_attribute): Make private.
11473 (Reset): Set it to null.
11474 (InitCoreHelpers): Don't initialize it.
11475 (ConsParamArrayAttribute): New. Initialize it as needed.
11476 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
11478 2006-01-31 Miguel de Icaza <miguel@novell.com>
11480 * expression.cs: There might be errors reported during the
11481 selection of applicable methods. If there are errors, do not
11482 continue execution as it will lead the compiler to crash.
11484 2006-01-30 Miguel de Icaza <miguel@novell.com>
11486 * expression.cs: Member access is not allowed on anonymous
11487 methods. Fixes #77402.
11489 2006-01-30 Raja R Harinath <rharinath@novell.com>
11492 * cs-parser.jay (VariableDeclaration): Don't set
11493 current_array_type to null.
11494 (field_declaration, event_declaration, declaration_statement):
11495 Set it to null here.
11497 2006-01-28 Raja R Harinath <harinath@gmail.com>
11499 * typemanager.cs (GenericParameterPosition): New.
11502 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
11504 * doc.cs : To process "include" elements, first we should create
11505 another list than XmlNodeList, because it could result in node
11506 removal, which could result in that the XmlNodeList gives up
11507 yielding next node.
11509 (Also made code identical to gmcs again.)
11511 2006-01-25 Miguel de Icaza <miguel@novell.com>
11513 * ecore.cs: Introduce an error report that we were not catching
11514 before, if not silent, we must report the error. Gonzalo ran into
11517 2006-01-23 Miguel de Icaza <miguel@novell.com>
11519 A fix for bug: #76957
11521 * iterators.cs (MoveNextMethod.CreateMethodHost): call
11522 ComputeMethodHost before creating the method, this is a new
11525 * anonymous.cs (AnonymousContainer): Now we track all the scopes
11526 that this method references (RegisterScope). The actual scope
11527 where the method is hosted is computed with the ComputeMethodHost
11528 before we create the method.
11530 Moved the Deepest routine here.
11532 (AnonymousContainer.ComputeMethodHost): New routine used to
11533 compute the proper ScopeInfo that will host the anonymous method.
11535 (ScopeInfo): Deal with multiple roots. The problem was that we
11536 did not have a unique root where all ScopeInfos could be hanged
11537 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
11540 Remove AdjustMethodScope which is now computed at the end. Remove
11541 LinkScope which did a partial link, instead link all ScopeInfos
11542 before code generation from the new "LinkScopes" routine.
11544 Simplify all the Add* routines as they no longer need to maintain
11545 the tree, they just need to record that they are using variables
11548 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
11549 routines to produce the forest of ScopeInfo trees.
11551 * class.cs (TypeContainer.AppendMethod): This is just like
11552 AddMethod, but ensures that an interface implementation method
11553 (IEnumerable.XXX) is not inserted at the beginning of the queue of
11554 methods, but at the end.
11556 We use this functionality to ensure that the generated MoveNext
11557 method in the iterator class is resolved/emitted before the
11558 enumerator methods created.
11560 This is required because the MoveNext method computes the right
11561 ScopeInfo for the method. And the other methods will eventually
11562 need to resolve and fetch information computed from the anonymous
11565 2006-01-21 Raja R Harinath <harinath@gmail.com>
11566 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11568 Fix rest of #76995.
11569 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
11570 the 'aliases' hash.
11571 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
11572 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
11574 2006-01-18 Raja R Harinath <rharinath@novell.com>
11576 Fix #76656, cs0231-2.cs.
11577 * cs-parser.jay (formal_parameter_list): Make error case catch
11579 (parenthesized_expression_0): Add CS1026 check.
11580 (invocation_expression): Remove unused { $$ = lexer.Location }.
11582 2006-01-17 Raja R Harinath <rharinath@novell.com>
11585 * cs-parser.jay (statement_expression): Don't list out the
11586 individual statement-expressions. Convert syntax error into
11589 2006-01-16 Raja R Harinath <rharinath@novell.com>
11592 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
11593 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
11594 CheckIntermediateModification.
11595 (FieldExpr.DoResolve): Add new two-argument version that
11596 allows us to resolve the InstanceExpression as an lvalue.
11597 The one-argument variant is now just a wrapper.
11598 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
11599 Resolve the lhs as an lvalue if the it has a value type.
11600 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
11601 from Assign.DoResolve.
11602 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
11603 resolved as an lvalue.
11604 (PropertyExpr.DoResolve): Update.
11605 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
11606 has a value type. Move CS1612 check here from
11607 CheckIntermediateModification.
11608 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
11609 * expression.cs (EmptyExpression.OutAccess): New. Used as the
11610 'right_side' of a ResolveLValue on an 'out' argument.
11611 (EmptyExpression.LValueMemberAccess): New. Used as the
11612 'right_side' of a propagated ResolveLValue on a value type.
11613 (LocalVariableReference.DoResolveBase): Recognize
11614 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
11616 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
11617 EmptyExpression.Null.
11619 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
11621 * typemanager.cs : added IsGenericParameter(). In mcs it always
11623 * doc.cs : for generic parameters, use GenericParameterPosition,
11626 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
11628 * expression.cs: Fix Console.WriteLine ((this = x).foo);
11630 2006-01-12 Miguel de Icaza <miguel@novell.com>
11632 This fixes the problem where we used ldfld instead of ldflda to
11633 load the "THIS" pointer on captured parameters, when THIS is a
11634 value type. See bug #77205.
11636 * iterators.cs (CapturedThisReference.Emit): Pass false to
11637 EmitThis (we do not need the address).
11639 * codegen.cs (EmitThis): it needs to know whether we need the
11640 address of `this' or not. This is used by value types.
11642 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
11643 every other call passes false.
11645 2006-01-12 Raja R Harinath <rharinath@novell.com>
11648 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
11650 * expression.cs (Invocation.OverloadResolve): Update.
11651 (Invocation.DoResolve): Avoid double resolution of invocation.
11653 2006-01-11 Raja R Harinath <rharinath@novell.com>
11656 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
11657 unary negation of floating point types as 0-expr; negation cannot
11658 overflow in floating point types.
11661 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
11662 on operands of 'void' type.
11665 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
11666 and ExclusiveOr for boolean constants too.
11668 2006-01-09 Raja R Harinath <rharinath@novell.com>
11671 * expression.cs (Invocation.OverloadResolve): Replace reflected
11672 override methods with their base virtual methods, rather than
11673 skipping over them.
11674 * typemanager.cs (TypeManager.GetOverride): New.
11676 2006-01-05 Jb Evain <jbevain@gmail.com>
11678 * class.cs (Property.Define, Indexer.Define): do not tag the
11679 properties as SpecialName | RTSpecialName.
11681 2006-01-04 Miguel de Icaza <miguel@novell.com>
11683 * class.cs (MethodCore.IsDuplicateImplementation): This method was
11684 doing a low-level comparission of parameter types. It was lacking
11685 a check for __argslist.
11687 2005-12-30 Miguel de Icaza <miguel@novell.com>
11689 * expression.cs (ParameterReference.DoResolveBase): Allow
11690 reference parameters if they are local to this block.
11692 This allows the ref and out parameters of a delegate to be used in
11693 an anonymous method, for example:
11695 delegate void set (out int x);
11697 set s = delegate (out int x){
11701 This is used by functionality introduced late in the C# language.
11703 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
11704 method that take ref and out parameters.
11706 Fixes #77119 which was a late change in the spec.
11708 2005-12-23 Miguel de Icaza <miguel@novell.com>
11710 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
11711 parent if its the same scope. Fixes #77060.
11713 2005-12-21 Miguel de Icaza <miguel@novell.com>
11715 * driver.cs: Report the case of no source files and no -out:
11718 2005-12-20 Raja R Harinath <rharinath@novell.com>
11721 * expression.cs (ComposedCast.GetSignatureForError): Define.
11723 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11727 * namespace.cs (NamespaceEntry): Add extern_aliases as a
11728 ListDictionary, to contain the ExternAliasEntry entries (in
11729 addition to the NamespaceEntry.aliases hashtable). This field is
11730 shared between the original entry and its doppelganger (bodyless
11732 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
11733 extern_aliases field.
11734 (NamespaceEntry.Lookup): Move the IsImplicit check after the
11735 lookup in extern_aliases.
11737 2005-12-16 Raja R Harinath <rharinath@novell.com>
11740 * class.cs (TypeContainer.Mark_HasEquals): New.
11741 (TypeContainer.Mark_HasGetHashCode): New.
11742 (ClassPart): Override them.
11743 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
11746 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
11747 'parent' argument to the base constructor.
11749 Remove all mention of TypeContainer from decl.cs.
11750 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
11751 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
11752 (DeclSpace.DeclSpace): Likewise.
11753 (DeclSpace.DefineMembers): Remove unused argument.
11754 * cs-parser.jay (pop_current_class): Update to changes. Simplify
11755 debugging check -- we don't care if the debug code throws an
11756 InvalidCastException instead of an InternalErrorException.
11757 * class.cs (TypeContainer.DefineMembers): Update to changes.
11758 (TypeContainer.DoDefineMembers): Likewise.
11759 (TypeContainer.GetMethods): Likewise.
11760 (PropertyMember.Define): Likewise.
11761 (MemberBase.Parent): New property that forwards to
11762 MemberCore.Parent, but ensures that we get a TypeContainer.
11763 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
11764 (RootContext.PopulateTypes): Likewise. Remove special case code
11765 for !RootContext.StdLib: DefineMembers is idempotent.
11767 2005-12-14 Miguel de Icaza <miguel@novell.com>
11769 * convert.cs (ExplicitConversionCore): Check the return value from
11770 ExplicitConversionCore which can return null on failure. Fixes #76914
11772 2005-12-13 Marek Safar <marek.safar@seznam.cz>
11774 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
11776 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
11778 * doc.cs : The search for referenced namespace was insufficient to
11779 get global one as it used to do. Fixed bug #76965.
11781 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
11783 * doc.cs : check name in cref in the last phase that whether it is
11786 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11788 * cs-tokenizer.cs : reverted the latest change: it somehow broke
11791 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11793 * doc.cs : so it turned out that we cannot skip override check for
11794 interface members. Fixed bug #76954.
11796 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11798 * cs-tokenizer.cs : fixed bug #75984:
11799 - #warning and #error should not be handled when the source line
11801 - #line is not checked strictly when the source line is disabled.
11802 - #define and #undef is on the other hand checked strictly at any
11805 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
11807 * cs-tokenizer.cs : missing Location (actually, filename) in one of
11810 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11812 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
11814 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
11815 event initializers.
11816 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
11817 (FieldBase.Initializer): Initializer is now optional.
11818 (EventField.Define): Only event field can have initializer.
11820 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
11822 * const.cs (Const): Reuse initializer.
11824 * cs-parser.jay: Updated after FieldBase changes.
11825 Added current_array_type to simplify array initializers.
11827 * ecore.cs (NullCast.IsDefaultValue): Implemented.
11829 * expression.cs, iterators.cs: Updated.
11831 * namespace.cs (NamespaceEntry): Made UsingFound private.
11833 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11835 * parameterCollection.cs: Obsolete, removed.
11836 * parser.cs: Obsolete, removed.
11838 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11841 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
11843 * enum.cs (Enum.Define): Set obsolete context here.
11845 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11848 - FindDocumentedMember() now expects 1) paramList as null
11849 when "we don't have to check the number of parameters" and
11850 2) Type.EmptyTypes when "there is no arguments".
11851 - Introduced FoundMember struct to hold the exact type which was
11852 used to find the documented member (the above change broke
11853 test-xml-044; it might be better just to use DeclaringType than
11854 what MS does, like this change does, but it depends on usage.)
11856 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11858 * doc.cs : documented member might be from DeclaringType for nested
11859 types. Fixed bug #76782.
11861 2005-12-03 Ben Maurer <bmaurer@ximian.com>
11863 * anonymous.cs: Have the param code handle leaving copies on the
11864 stack etc. Allows anonymous params to take part in the assignment
11865 code (++, +=, etc). Fixes bug #76550
11867 * expression.cs: Handle the prepare_for_load/leave_copy by passing
11868 it down to the anon code.
11870 * iterators.cs: Use dummy var here
11872 * codegen.cs: Handle new vars
11874 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11877 * class.cs (MethodData.Define): Set proper Obsolete context.
11879 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
11881 (FieldExpr.DoResolve): Ditto.
11883 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11886 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
11887 parent is not obsolete.
11889 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
11891 * doc.cs : (FindDocumentedMember) find parameterless members first
11892 and get CS0419 in the early stage. Fixed first case of bug #76727.
11894 2005-11-30 Marek Safar <marek.safar@seznam.cz>
11897 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
11898 no error was reported.
11900 *expression.cs (Binary.DoResolve): left can be null.
11902 2005-11-22 Marek Safar <marek.safar@seznam.cz>
11905 * class.cs (MethodData.Emit): Parameters should be labeled first.
11907 2005-11-21 Marek Safar <marek.safar@seznam.cz>
11910 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
11912 2005-11-18 Marek Safar <marek.safar@seznam.cz>
11914 * attribute.cs (AreParametersCompliant): Moved to Parameter.
11916 * class.cs (MethodCore): Parameter clean up.
11917 (IMethodData): Added ParameterInfo.
11918 (MethodData): Parameter clean up.
11919 (Indexer.Define): Parameter clean up.
11931 * typemanager.cs: Parameter clean up.
11933 * delegate.cs (Define): Get rid of duplicated code.
11935 * expression.cs (ParameterReference): Removed useless parameters
11937 (Invocation): Ditto.
11939 * parameter.cs (ParamsParameter): New class, params specialization.
11940 (ArglistParameter): Attemp to separate arglist.
11941 (Parameter): Refactored to be reusable and faster.
11942 (Parameter.Modifier): Made understandable.
11943 (Parameters): Changed to be used as a class for `this' assembly
11944 parameters. Refactored to use new specialized classes.
11946 * support.cs (ParameterData): Added Types property.
11947 (InternalParameters): Deleted.
11949 2005-08-20 Martin Baulig <martin@ximian.com>
11951 Merging this patch from GMCS to fix #75867.
11953 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11954 scope if we don't already have it.
11956 2005-11-17 Martin Baulig <martin@ximian.com>
11959 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
11960 inherit the scope from our parent. Fixes #76653.
11962 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11964 * doc.cs : the previous patch does not actually fix the bug.
11965 PropertyInfo override check is now implemented and really fixed it.
11966 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
11968 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11970 * doc.cs : apply "override filter" also to properties.
11973 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11975 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
11976 no need to check overrides. For classes, omit those results from
11977 interfaces since they must exist in the class. Fixed bug #76726.
11979 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11981 * typemanager.cs : (GetFullNameSignature) differentiate indexers
11982 with different parameters. Fixed the second problem in #76685.
11984 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11986 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
11987 get expected 'protected' access in CheckValidFamilyAccess()).
11990 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11992 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
11993 Fixed bug #76705. CS1569 was incorrectly commented out.
11995 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
11997 * doc.cs : use Invocation.IsOverride() to do real override check.
11998 * expression.cs : made Invocation.IsOverride() internal.
12000 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
12002 * doc.cs : use TypeManager.FindMembers() instead of (possible)
12003 TypeBuilder.FindMembers() and filter overriden base members out.
12006 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12008 * doc.cs : ref/out parameters are represented as '@' (instead of
12009 '&' in type FullName). Fixed bug #76630 (additionally crefs).
12011 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12013 * doc.cs : when there was no '.' in cref to methods in doc comment,
12014 then parameters were missing in the output. Fixed bug #76691.
12016 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12018 * driver.cs : don't output docs when there is an error.
12021 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12024 Now it should detect indexers. Fixed primary concern in bug #76685.
12025 Fixed CS0419 message to not show the identical member signature in
12028 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12030 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
12031 instead of Type.FindMembers() since it does not handle events.
12034 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
12036 * codegen.cs: Fixed typo (speficied -> specified).
12038 2005-11-11 Marek Safar <marek.safar@seznam.cz>
12041 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
12043 2005-11-11 Marek Safar <marek.safar@seznam.cz>
12045 * attribute.cs: Changed error message.
12047 * cs-tokenizer.cs: One more check.
12049 2005-11-10 Marek Safar <marek.safar@seznam.cz>
12051 * statement.cs (Block.Resolve): Ignore empty statement.
12053 2005-11-10 Marek Safar <marek.safar@seznam.cz>
12055 * report.cs: Made error/warning methods more strict to avoid
12058 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
12059 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
12060 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
12061 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
12063 2005-11-08 Marek Safar <marek.safar@seznam.cz>
12065 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
12066 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
12068 * class.cs (TypeContainer.IsComImport): New property.
12069 (Constructor.Define): Create proper ctor for ComImport types.
12071 * expression.cs (New.CheckComImport): Fixed.
12073 2005-11-07 Miguel de Icaza <miguel@novell.com>
12075 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
12076 that a parameter has been captured does not mean that we do not
12077 have to do the rest of the processing. This fixes the second part
12078 of #76592. If there was another anonymous method capturing
12079 values in the past, the Scope would never be set for the second
12080 method that captured the same parameter.
12082 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
12083 properly manipulate the stack. Second part of fix for #76592.
12085 * expression.cs (New): Add support for invoking "new" on
12086 interfaces that have been flagged with the ComImport attribute and
12087 the CoClass. Fixes #76637
12089 * statement.cs (Try.DoEmit): When a variable is captured, do not
12090 try to emit the vi.LocalBuilder variable as it has been captured.
12091 Create a temporary variable and store the results on the
12092 FieldBuilder. Fixes #76642
12094 2005-11-07 Marek Safar <marek.safar@seznam.cz>
12096 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
12098 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
12100 * expression.cs (Binary.DoResolve): Added && optimalization.
12102 * typemanager.cs (AddUserType): Removed useless argument.
12104 2005-11-04 Marek Safar <marek.safar@seznam.cz>
12106 * statement.cs (Block.variables): Uses ListDictionary.
12108 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12111 * class.cs (PartialContainer.EmitType): Customized to emit
12112 security attributes.
12113 (ClassPart.ApplyAttributeBuilder): Transform security attribute
12114 for partial classes.
12116 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12119 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
12120 access has to be fixed.
12122 * typemanager.cs (IsUnmanagedType): Wrong common field type.
12124 2005-11-01 Marek Safar <marek.safar@seznam.cz>
12127 * ecore.cs (NullCast.Reduce): Implemented.
12129 * expression.cs (ArrayCreation.CheckIndices): Correcly check
12132 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
12134 (Foreach.Resolve): Catch null properly.
12136 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12138 * cs-tokenizer.cs: Warning text fix.
12140 * driver.cs: AllWarningNumbers exposed on public interface.
12142 * report.cs (): Reviewed warning numbers.
12143 (IsValidWarning): Use binary search.
12145 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12147 * driver.cs: Implemeted resource visibility.
12148 (Resources): New class for code sharing between /res: and
12151 2005-10-28 Marek Safar <marek.safar@seznam.cz>
12154 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
12157 * convert (Convert.ImplicitReferenceConversion): NullCast holds
12160 * ecore.cs (NullCast): Child is contant only.
12162 * literal.cs (NullLiteral.Reduce): null can be converted to any
12165 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
12167 * driver.cs: Use Encoding.Default as default code page instead
12170 2005-10-27 Raja R Harinath <rharinath@novell.com>
12173 * expression.cs (Invocation.Error_InvalidArguments): Handle
12174 __arglist parameters.
12175 (Invocation.VerifyArgumentsCompat): Likewise.
12176 * support.cs (ReflectionParameters.GetSignatureForError): Print
12177 __arglist parameters.
12178 (InternalParamters.GetSignatureForError): Likewise.
12179 * parameter.cs (Parameters.GetSignatureForError): Likewise.
12181 2005-10-26 Marek Safar <marek.safar@seznam.cz>
12183 * attribute.cs (GetPropertyValue): Made public.
12185 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
12187 Add new property WrapNonExceptionThrows to handle 2.0 assembly
12189 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
12192 * driver.cs: Reflect method name change.
12194 * statement.cs (Try.Resolve): Warn when try has both general
12195 exception handlers.
12197 * typemanager.cs: runtime_compatibility_attr_type new predefined
12200 2005-10-26 Raja R Harinath <harinath@gmail.com>
12203 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
12204 treat it as an empty parameter list.
12206 2005-10-26 Raja R Harinath <rharinath@novell.com>
12209 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
12210 ResolveAsTypeStep silent.
12211 * statement.cs (Block.AddConstant): Mark block as used.
12212 (Block.ResolveMeta): Avoid piling on error messages
12213 if a constant initializer resolution fails.
12215 2005-10-25 Raja R Harinath <rharinath@novell.com>
12217 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
12219 (NamespaceEntry.VerifyAllUsing): New.
12220 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
12221 behaviour. Delegates actual resolution of alias to ...
12222 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
12223 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
12225 * driver.cs (Driver.MainDriver): Update.
12227 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
12228 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
12230 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
12232 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
12233 RootNamespace.DefineNamespacesForAll.
12235 2005-10-24 Raja R Harinath <harinath@gmail.com>
12237 * typemanager.cs (assemblies, external_aliases, modules)
12238 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
12239 (ComputeNamespaces, GetRootNamespace): Remove extra staging
12240 overhead. Move resposibility ...
12241 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
12242 * driver.cs, attribute.cs, codegen.cs: Update to changes.
12244 2005-10-23 Raja R Harinath <harinath@gmail.com>
12246 * namespace.cs (RootNamespace.all_namespaces): Renamed from
12247 cached_namespaces. Improve usage.
12248 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
12249 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
12250 Move from GlobalRootNamespace and simplify.
12251 (RootNamespace.Global): Make instance variable.
12252 (RootNamespace.RootNamespace): Add "alias name" parameter.
12253 (GlobalRootNamespace): Simplify drastically.
12254 (Namespace.Lookup): Don't use GetNamespace.
12255 * typemanager.cs (GetRootNamespace): Rename from
12256 ComputeNamespaceForAlias.
12257 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
12259 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12261 * anonymous.cs (AnonymousContainer): Don't crash when container
12264 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12266 * expression.cs (Binary.DoResolve): Warn when comparing same
12269 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12272 * expression.cs (Binary.DoResolve): It looks like there are no
12273 convetsion rules in enum context.
12275 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12277 Add support for extern alias qualifiers.
12278 * typemanager.cs: Move some LookupTypeReflection code
12279 to namespace.cs, to have cleaner code. Added some methods
12280 to help us keep track of the extern aliased references.
12281 * driver.cs: Add suport for extern alias assemblies on command
12282 line and check for their warnings/errors. Also keep track of the
12283 extern aliased assemblies.
12284 * namespace.cs: Move the global functionality of Namespace
12285 to GlobalRootNamespace/RootNamespace. Now the global namespace
12286 is GlobalRootNamespace.Globa. Also the code moved from
12287 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
12288 Finally added LocalAliasEntry (AliasEntry before) and
12289 ExternAliasEntry, to handle alias statements.
12290 * cs-parser.jay: Add support in the grammar for extern alias
12292 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
12293 Update callings to Namespace (now in GlobalRootNamespace).
12295 2005-10-18 Raja R Harinath <rharinath@novell.com>
12298 * class.cs (TypeContainer.DefineType): Move updating of
12299 topological sort earlier in the code.
12300 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
12302 2005-10-18 Marek Safar <marek.safar@seznam.cz>
12305 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
12307 * constant.cs (Constant.TryReduce): Moved from Cast class.
12308 (Reduce): Made little bit more OO and fixed missing conversions.
12310 * ecore.cs (Reduce): Implemented.
12311 (Binary.EnumLiftUp): New method to upgrade values to enum values.
12313 * literal.cs (Reduce): Implemented.
12315 * class.cs: Reverted Miguel's wrong commit.
12317 2005-10-14 Miguel de Icaza <miguel@novell.com>
12319 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
12321 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
12323 * cs-parser.jay, expression.cs : CS0214 was missing error location
12324 for constants. Fixed bug #76404.
12326 2005-10-11 Marek Safar <marek.safar@seznam.cz>
12329 * convert.cs (ExplicitConversionCore): Fixed object->enum
12332 2005-10-10 Raja R Harinath <rharinath@novell.com>
12334 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
12335 InstanceExpression.
12336 (PropertyExpr.EmitCall): Likewise.
12337 * expression.cs (Invocation.EmitArguments): Handle case where
12339 (Invocation.EmitCall): Avoid allocating temporary variable if
12340 there are no arguments.
12342 2005-10-07 Raja R Harinath <rharinath@novell.com>
12345 * convert.cs (ImplicitConversionStandard): Move conversion of
12346 void* to arbitrary pointer types ...
12347 (ExplicitConversionStandard): .. here.
12348 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
12349 error to always print typenames.
12351 2005-10-07 Raja R Harinath <rharinath@novell.com>
12353 * convert.cs (GetConversionOperator): Rename from
12354 GetConversionOperators. Move operator selection code from ...
12355 (UserDefinedConversion): ... here.
12357 2005-10-06 Marek Safar <marek.safar@seznam.cz>
12359 * convert.cs (ExplicitConversionCore): Removed duplicate enum
12362 2005-10-05 Marek Safar <marek.safar@seznam.cz>
12364 * assign.cs (Assign.DoResolve): Error method changed.
12366 * cfold.cs (DoConstantNumericPromotions): Error method changed.
12368 * const.cs (ResolveValue): Reset in_transit immediately.
12370 * constant.cs: Error method changed.
12372 * convert.cs: Removed useless location parameter.
12373 (ExplicitNumericConversion): Don't do double enum check.
12374 (ExplicitConversionCore): Renamed from ExplicitConversion.
12375 (ExplicitUnsafe): Extracted from ExplicitConversion.
12376 (ExplicitConversion): Uses for error reporting.
12378 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
12380 (ResolveBoolean): Uses common error method.
12381 (CastToDecimal): Get rid of ec.
12382 (CastFromDecimal): Optimized.
12383 (ConvCast): Get rid of ec.
12385 * enum.cs (ResolveValue): Reset in_transit immediately.
12386 (Emit): Return after first error.
12388 * expression.cs: Convert changes.
12390 * literal.cs: Error method changed.
12392 * statement.cs: Error method changed.
12394 2005-10-03 Raja R Harinath <rharinath@novell.com>
12396 * support.cs (SeekableStreamReader.Position): Don't error out when
12397 the requested position is just beyond the end of the current
12400 2005-09-28 Raja R Harinath <rharinath@novell.com>
12402 * support.cs (SeekableStreamReader): Simplify drastically. Don't
12403 try to keep in sync with the byte count of the underlying Stream.
12404 However, this limits us to a window size of 2048 characters: i.e.,
12405 the maximum lookahead of our lexer/parser can be 2048 characters.
12407 2005-09-28 Marek Safar <marek.safar@seznam.cz>
12410 * driver.cs: Fix compilation files with full root path.
12412 2005-09-25 Miguel de Icaza <miguel@novell.com>
12414 * report.cs (SymbolRelatedToPreviousError): Format the output so
12415 it does not use an open parenthesis that is never closed.
12417 * driver.cs: Follow coding guidelines
12419 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12422 * const.cs (Const.ResolveValue): Check for assigning non-null
12423 value to reference type.
12425 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12427 * anonymous.cs: Implemented ExprClassName.
12429 * assign.cs (Assign.DoResolve): Don't chrash when type is not
12432 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
12435 * class.cs (StaticClass.DefineContainerMembers): Report protected
12438 * codegen.cs: if(ed) PRODUCTION.
12440 * convert.cs (Error_CannotImplicitConversion): Better error
12443 * cs-parser.jay: More error checks.
12445 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
12447 * driver.cs (CSCParseOption): Enabled wrong option check.
12449 * ecore.cs (Expression.ExprClassName): Turned to property.
12450 (MemberExpr.CheckIntermediateModification): For checking boxed
12451 value types modification.
12453 * statement.cs (Fixed.Resolve): Expression type must be
12454 convertible to fixed type.
12455 (CollectionForeach.GetEnumeratorFilter,TryType):
12456 Small refactoring for easier error checking.
12458 2005-09-26 Marek Safar <marek.safar@seznam.cz>
12460 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
12463 * class.cs (GeneratedBaseInitializer): New class for customization
12464 compiler generated initializers.
12465 (MemberBase.DoDefine): Check Obsolete attribute here.
12466 (FieldMember.DoDefine): Ditto.
12468 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
12471 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
12472 (MemberCore.GetObsoleteAttribute): Removed argument.
12473 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
12474 (MemberCore.CheckObsoleteType): New helper.
12478 * statement.cs: Updates after MemberCore changes.
12480 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
12481 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
12483 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
12484 obsolete attribute for compiler construct.
12485 (As.DoResolve): Cache result.
12487 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
12489 2005-09-26 Raja R Harinath <rharinath@novell.com>
12492 * expression.cs (This.VerifyFixed): In a value type T, the type of
12493 'this' is T&, iow, 'this' is either an out or ref parameter. In a
12494 value type R, 'this' is treated as a value parameter.
12496 2005-09-22 Miguel de Icaza <miguel@novell.com>
12498 * statement.cs (Lock): Use the TemporaryVariable class instead of
12499 manually using local variables as those do not work when variables
12502 * ecore.cs: Moved the TemporaryVariable class from being a nested
12503 class inside Foreach to be a public class that can be employed in
12506 2005-09-19 Marek Safar <marek.safar@seznam.cz>
12508 * cs-parser.jay: interface_accessors replaced by
12509 accessor_declarations.
12511 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
12514 * statement.cs (GotoCase.Resolve): Convert null constant to
12516 (SwitchLabel.ResolveAndReduce): Ditto.
12517 (SwitchLabel.NullStringCase): Custom null stamp.
12518 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
12520 typemanager.cs (CSharpSignature): Don't skip first argument
12523 2005-09-18 Miguel de Icaza <miguel@novell.com>
12525 * driver.cs: Set InEmacs based on the environment variable EMACS.
12527 * location.cs (InEmacs): in this mode, do not report column
12528 location as it confuses Emacs.
12530 2005-09-16 Marek Safar <marek.safar@seznam.cz>
12532 * cfold.cs, constant.cs, convert.cs, ecore.cs,
12533 expression.cs, iterators.cs, literal.cs: Store constants and
12536 * class.cs (MemberBase.ShortName): Pass location.
12538 * cs-parser.jay: Some location fixes.
12540 * ecore.cs (Expression.Location): Made virtual.
12542 2005-09-05 Miguel de Icaza <miguel@novell.com>
12544 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
12545 if the underlying types are the same, otherwise we need to produce
12546 code that will do the proper cast.
12548 This was exposed by Marek's constant rewrite which produced
12549 invalid code for the call site:
12551 enum X : long { a }
12552 void Method (X v) {}
12556 This fixes test-49.cs
12558 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12560 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
12561 Type/Object should be allowed as well. Fixed bug #75968.
12563 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12565 * expression.cs : (Binary.DoResolve): when one is enum constant and
12566 another is constant 0, then return enum one *as enum type*.
12569 2005-09-02 Raja R Harinath <rharinath@novell.com>
12571 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
12575 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
12576 flow-branching for LocalVariableReferences in case we were invoked
12577 from a MemberAccess.
12578 * expression.cs (LocalVariableReference.VerifyAssigned): New.
12580 (LocalVariableReference.DoResolveBase): ... this.
12581 (MemberAccess.Resolve): Do the check that was disabled during
12584 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12587 (PartialContainer.Create): check abstract/sealed/static strictly
12588 but abstract/sealed can exist only at one side. Fixed bug #75883.
12590 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
12593 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
12594 specified, don't default to UnmanagedType.I4.
12596 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12598 * expression.cs : conditional operator should check possibly
12599 incorrect assign expression. Fixed bug #75946.
12601 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12603 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
12604 Reverting the change. gmcs is much complex than mcs on this matter.
12606 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12608 * cs-tokenizer.cs : To read another token ahead of the actual
12609 consumption, use new SavedToken and cache token instead of moving
12610 back the stream with SeekableStreamReader (it seemed problematic).
12612 driver.cs : Thus use StreamReader directly.
12613 * support.cs : Thus removed SeekableStreamReader.
12615 2005-08-30 Raja R Harinath <rharinath@novell.com>
12618 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
12619 (ScopeInfo.EmitScopeType): Use it to construct field names from
12620 names of captured locals.
12623 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
12624 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
12625 Pass 'target_type' to BoxedCast. Don't default to 'object'.
12626 (ExplicitConversion): Remove enum cases already handled by
12627 implicit conversion. Move implicit conversion check to the beginning.
12628 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
12629 * expression.cs (ArrayCreation.EmitDynamicInitializers):
12630 Don't treat System.Enum as a struct.
12632 2005-08-30 Jb Evain <jbevain@gmail.com>
12634 * attribute.cs: handles as expression in parameters.
12636 2005-08-30 Raja R Harinath <rharinath@novell.com>
12639 * class.cs (TypeContainer.VerifyClsName): Don't use a
12640 PartialContainer when verifying CLS compliance.
12641 (AbstractPropertyEventMethod): Set Parent here, ...
12642 (PropertyMethod): ... not here.
12644 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
12646 * attribute.cs : escaped attribute name should not be allowed to be
12647 resolved (e.g. @class as classAttribute). Fixed bug #75930.
12649 2005-08-29 Raja R Harinath <rharinath@novell.com>
12652 * convert.cs (ImplicitStandardConversionExists): Allow zero also
12653 when converting a long constant to unsigned long.
12654 * expression.cs (Invocation.OverloadResolve): Add sanity check to
12655 detect where IsApplicable and VerifyArgumentsCompat disagree.
12657 2005-08-29 Raja R Harinath <rharinath@novell.com>
12658 and Carlos Alberto Cortez <carlos@unixmexico.org>
12661 * class.cs (TypeContainer.CanElideInitializer): New helper.
12662 (TypeContainer.EmitFieldInitializers): Use it to determine if we
12663 can safely emitting the initializer of a field.
12665 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12667 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
12668 allowed inside a switch (without loop). Fixed bug #75433.
12670 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
12672 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
12673 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
12675 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12677 * driver.cs : kinda reverting the default encoding changes (not exact
12678 revert since I noticed that "codepage:reset" might not work fine).
12680 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12682 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
12683 Location. Now getter and setter store location correctly.
12684 (errors/cs0111-12.cs now reports the expected location.)
12686 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12688 * driver.cs : Use default encoding on the environment.
12689 Removed (now that) extra parameter for SeekableStreamReader.
12690 * support.cs : (SeekableStreamReader) third .ctor() argument for
12691 StreamReader is not required (always true). preamble size could
12692 be acquired in simpler and safe way.
12694 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
12696 * cs-parser.jay: report CS0642 at warning level 3
12697 and report CS0642 for an if else statement also
12698 fixes bug #74745. Patch by John Luke (and a bit
12700 Removed extra CS0642 warning check for "while",
12702 * statement.cs: In Block.Resolve(), CS0642 check
12703 is reimplemented to check a sequence of an empty
12704 statement and a block.
12706 Both fix bug #66777.
12708 2005-08-24 Marek Safar <marek.safar@seznam.cz>
12710 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
12711 detection until I fix it.
12713 * cs-tokenizer.cs: Changed error message.
12715 * cs-parser.jay: Fixed 2 error locations.
12717 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
12718 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
12721 * enum.cs (GetSignatureForError): Fixed.
12723 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
12727 * typemanager.cs (RegisterProperty): Removed.
12729 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
12731 2005-08-24 Raja R Harinath <rharinath@novell.com>
12734 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
12735 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
12737 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12739 * expression.cs : tiny fix is required for not warning positive ulong.
12742 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12744 * expression.cs : add CS0652 check for constant and integral
12745 expression. Fixed bug #53974.
12747 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12749 * expression.cs : in DoNumericPromotions(), check if there is implicit
12750 conversion overload for string (to check CS0034). Fixed bug #52492.
12752 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12754 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
12756 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12758 * ecore.cs : report location when it is *not* Null.
12760 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12766 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
12767 correctly. Fixed bug #75721.
12769 2005-08-23 Raja R Harinath <rharinath@novell.com>
12771 * support.cs (SeekableStreamReader.Position): Avoid an expensive
12772 loop that performs 'min (pos, char_count)'.
12775 * expression.cs (Unary.ResolveOperator): Don't discard implicit
12776 converted value in Operator.OnesComplement.
12778 2005-08-22 Ben Maurer <bmaurer@ximian.com>
12780 * anonymous.cs: If the anon method is pulled into a helper class,
12781 it needs to be `internal' not `private'. Fixes runtime behavior on
12784 2005-08-20 Martin Baulig <martin@ximian.com>
12786 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
12787 scope if we don't already have it.
12789 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
12790 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
12793 2005-08-17 Marek Safar <marek.safar@seznam.cz>
12796 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
12797 is a partial class.
12799 2005-08-16 Marek Safar <marek.safar@seznam.cz>
12801 The big constants rewrite
12802 Fix #75746, #75685 and more
12803 As a side effect saved 1MB for MWF ;-)
12805 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
12806 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
12807 enum based for corlib compilation.
12809 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
12812 * class.cs (FixedField.Define): Use ResolveAsConstant.
12814 * const.cs (IConstant): Interface constants and enums.
12815 (Const.ResolveValue): New method for constant resolvning.
12816 (ExternalConstant): Constants from imported assemblies.
12818 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
12819 conversion; like enums.
12820 (Constant.ToType): Converts this constant to different type.
12821 (Constant.Increment): Adds 1.
12823 * convert.cs (ImplicitConversionRequired): Simplified.
12825 * cs-parser.jay: Create EnumMember directly.
12827 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
12829 * doc.cs (GenerateEnumDocComment): Removed.
12831 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
12832 (ConvertIntLiteral): Removed.
12833 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
12835 * enum.cs (EnumMember): Implement IConstant.
12836 (Enum.IsValidEnumConstant): Removed.
12837 (Enum.GetNextDefaultValue): Removed.
12838 (Enum.FindMembers): Updated.
12839 (Enum.GenerateDocComment): Iterate enum members.
12841 * expression.cs (Cast.TryReduce): Handle enums correctly.
12842 (New.Constantify): Made public.
12843 (MemberAccess.DoResolve): Removed contant specific if(s).
12845 * literal.cs (NullLiteral): Implement new abstract methods.
12847 * statement.cs (GotoCase.Resolve): Use new constant methods.
12848 (SwitchLabel.ResolveAndReduce): Use new constant methods.
12850 * typemanager.cs (LookupEnum): Removed.
12851 (IsEnumType): Fixed to work with corlib.
12852 (RegisterConstant): Removed.
12853 (LookupConstant): Removed.
12854 (GetConstant): Changed to work with IConstant.
12856 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
12858 * location.cs : Fixed overflown (>255) column number.
12860 2005-08-03 Raja R Harinath <rharinath@novell.com>
12862 First cut of the qualified-alias-member feature.
12863 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
12865 * cs-parser.jay (DOUBLE_COLON): New token.
12866 (namespace_or_type_name): Add rule for recognizing
12867 qualified-alias-members.
12868 (primary_expression): Likewise.
12869 (element_access): Allow QualifiedAliasMember as a possible
12870 type-bearing expression.
12871 (local_variable_type, local_variable_pointer_type): Likewise.
12872 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
12873 aliases in the current and enclosing namespace declarations.
12874 (NamespaceEntry.UsingAlias): Add CS0440 warning.
12875 * decl.cs (MemberName.is_double_colon): New.
12876 (MemberName.MemberName): Add new constructor for alias-member.
12877 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
12878 * expression.cs (QualifiedAliasMember): New expression type.
12880 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12882 * location.cs : it borked when no argument was specified.
12884 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12886 * location.cs : tiny ToString() format fix.
12888 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12890 * statement.cs : oops, it was missing.
12892 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12894 A set of fixes for precise line/column location.
12897 "token" field now holds a file/line "delta", a line number offset
12898 from the segment, and a column number. See also:
12899 http://lists.ximian.com/pipermail/mono-devel-list/2004-
12900 December/009508.html
12901 Removed static IsNull. Use instance IsNull property instead.
12902 * cs-tokenizer.cs :
12903 For some tokens it stores Location. For Identifier it stores
12904 LocatedToken which is a pair of string name and location.
12905 Column numbers are adjusted only at getChar().
12907 Use Location.ToString() for reporting (it now contains column).
12909 Largely modified to use LocatedToken instead of
12910 string (IDENTIFIER), and to acquire Location from some tokens.
12911 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
12912 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
12914 Now MemberName holds Location. DeclSpace.ctor() receives Location
12915 as a parameter. Removed extra parameters to all derived classes.
12916 Replaced Location.IsNull() with instance property.
12917 * assign.cs, expression.cs :
12918 Added .ctor() overload that omits Location.
12920 Added "nameEscaped" flag that indicates the identifier was escaped
12921 in the source file. This fixes bug #57047.
12923 2005-08-02 Marek Safar <marek.safar@seznam.cz>
12925 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
12926 New method, looking for lo-case imported cls type.
12928 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
12931 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
12933 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
12935 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
12936 all_imported_types.
12937 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
12939 Optimized to save 3.5 MB for SWF compilation.
12941 2005-08-01 Marek Safar <marek.safar@seznam.cz>
12943 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
12944 (PartialContainer.Create): Moved logic AddToContainer.
12945 (PartialContainer.MarkForDuplicationCheck): Shares name.
12947 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
12950 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
12952 (Namespace.GetSignatureForError): New method.
12954 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
12955 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
12957 2005-08-01 Raja R Harinath <rharinath@novell.com>
12960 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
12961 member lookup rather than qualifier_type, since qualifier_type can
12964 2005-08-01 Marek Safar <marek.safar@seznam.cz>
12966 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
12969 2005-07-31 Miguel de Icaza <miguel@novell.com>
12971 * statement.cs: Copy the local exception into the exception
12972 captured local. Fixes 75674
12974 2005-07-31 Raja R Harinath <harinath@gmail.com>
12977 * expression.cs (Invocation.OverloadResolve): Don't report error
12978 CS1501 if error CS1502 has been reported.
12979 (New.DoResolve): Delegate CS1501 reporting to
12980 Invocation.OverloadResolve.
12983 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
12984 invariant-meaning-in-block property in an enclosing block if
12987 2005-07-29 Marek Safar <marek.safar@seznam.cz>
12989 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
12990 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
12991 (Switch.CheckSwitch): Just save 50kb for SWF.
12993 2005-07-27 Martin Baulig <martin@ximian.com>
12995 * anonymous.cs (CaptureContext.AddField): Added
12996 `AnonymousContainer am' argument; compute its toplevel scope if
12997 it's not already computed. Fixes #75649.
12999 2005-07-26 Raja R Harinath <rharinath@novell.com>
13002 * class.cs (Constructor.Emit): Reset block to null if the block
13005 2005-07-25 Marek Safar <marek.safar@seznam.cz>
13007 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
13009 2005-07-25 Marek Safar <marek.safar@seznam.cz>
13011 * class.cs (MethodData.Define): Check whether accessor implementing
13012 interface is public.
13014 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
13016 2005-07-22 Marek Safar <marek.safar@seznam.cz>
13019 * namespace.cs (LookupType): Moved same type check to...
13021 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
13022 with the same name.
13024 2005-07-21 Raja R Harinath <rharinath@novell.com>
13026 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
13027 already found a typebuilder.
13028 * class.cs (MethodCore.IsDuplicateImplementation): Compare
13029 MemberNames, not strings.
13031 * const.cs (Error_ExpressionMustBeConst):
13032 Rename from Error_EpressionMustBeConst.
13033 * const.cs, class.cs, statement.cd: Update.
13035 2005-07-21 Marek Safar <marek.safar@seznam.cz>
13039 * const.cs (Const.LookupConstantValue): Report missing contant expression
13041 (Error_EpressionMustBeConstant): Only one error method.
13043 * class.cs, statement.c: Updated.
13045 2005-07-20 Raja R Harinath <rharinath@novell.com>
13047 * statement.cs (Block.Flags): Add back HasVarargs.
13048 (Block.flags): Make protected.
13049 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
13051 * typemanager.cs (types, typecontainers, user_types): Remove.
13052 (UserTypes, TypeContainers): Likewise.
13053 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
13054 (CleanUp, Reset): Update.
13055 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
13056 (GetNestedType): Use Type.GetNestedType.
13057 (CoreLookupType): Take two arguments, the namespace and the
13058 basename of the type. Update to use the Namespace.Lookup
13060 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
13061 (RealMemberLookup): Use IsNestedChildOf instead of playing with
13062 string concatenation and substring matches.
13063 * class.cs, enum.cs, delegate.cs: Update to changes.
13065 2005-07-20 Marek Safar <marek.safar@seznam.cz>
13067 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
13068 Expression and made virtual.
13070 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
13071 (ImplicitStandardConversionExists): Fixed `byte' typo ?
13073 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
13075 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
13078 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
13081 2005-07-18 Marek Safar <marek.safar@seznam.cz>
13084 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
13085 AssemblyCultureAttribute is not used on executable.
13088 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
13090 2005-07-16 Raja R Harinath <rharinath@novell.com>
13093 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
13094 New. Reports CS0252/CS0253.
13095 Mostly taken from preliminary patch by Duncak Mak.
13096 (Binary.DoResolveOperator): Store results of operator lookup.
13097 Use them to detect if we need to warn about unintended reference
13100 2005-07-15 Raja R Harinath <rharinath@novell.com>
13103 * namespace.cs (Namespace.Lookup): Add back location parameter.
13104 (Namespace.LookupType): Add CS0436 report. Add location parameter.
13105 * delegate.cs, ecore.cs, expression.cs: Update to changes.
13107 * codegen.cs (EmitContext.DeclSpace): Make readonly.
13108 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
13109 (Namespace.LookupType): ... this.
13110 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
13112 * typemanager.cs (LookupTypeReflection): Remove buggy code that
13113 purported to handle pointers.
13114 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
13117 2005-07-15 Marek Safar <marek.safar@seznam.cz>
13119 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
13122 2005-07-15 Raja R Harinath <rharinath@novell.com>
13124 * namespace.cs (Namespace.Lookup): Drop location parameter.
13125 (NamespaceEntry.LookupAlias): Remove. Merge into ...
13126 (NamespaceEntry.Lookup): ... this.
13127 (NamespaceEntry.Error_AmbiguousTypeReference):
13128 Move here from DeclSpace.
13129 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
13131 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
13132 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
13133 Move to NamespaceEntry.
13134 * delegate.cs, expression.cs: Update to changes.
13136 2005-07-14 Marek Safar <marek.safar@seznam.cz>
13138 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
13139 CheckAttributeType and refactored.
13140 (Attribute.ResolvePossibleAttributeType): Changed to reuse
13141 ResolveAsTypeTerminal error handling.
13142 (ResolveAsTypeTerminal): Introduced because of global attributes extra
13144 (GetSignatureForError): Print errors in same way.
13147 * codegen.cs: Reflect attribute GetSignatureForError change.
13150 * expression.cs: Add silent parameter to ResolveAsTypeStep.
13152 * namespace.cs (UsingEntry): Refactored to make fields private.
13155 statement.cs: Error_UnexpectedKind has extra parameter.
13157 2005-07-14 Raja R Harinath <rharinath@novell.com>
13159 * ecore.cs (IAlias): Remove.
13160 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
13161 that implement the interface.
13162 * namespace.cs (Namespace): Likewise.
13163 (Namespace.declspaces): Renamed from 'defined_names'.
13164 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
13165 DeclSpace instead of an IAlias.
13166 * tree.cs (Tree.AddDecl): Update.
13168 2005-07-12 Raja R Harinath <rharinath@novell.com>
13170 * statement.cs (Block.Flags); Remove HasVarargs.
13171 (Block.HasVarargs): Move to ToplevelBlock.
13172 (Block.ThisVariable, Block.AddThisVariable): Likewise.
13173 (Block.Variables): Make protected. Initialize variable hashtable
13175 (Block.AddVariable): Update.
13176 (Block.Resolve): Update to changes.
13177 (ToplevelBlock.HasVarargs): New boolean.
13178 (ToplevelBlock.ThisVariable): Move here from Block.
13179 (ToplevelBlock.AddThisVariable): Likewise.
13180 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
13181 * expression.cs (This.ResolveBase): Update to changes.
13182 (ArglistAccess.DoResolve): Likewise.
13184 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13187 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
13189 * class.cs (TypeContainer.VerifyMembers): Distinguish between
13190 not used and not used & assigned.
13191 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
13193 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13196 * expression.cs (Is.DoResolve): null is never provided type.
13198 2005-07-08 Marek Safar <marek.safar@seznam.cz>
13201 * cs-parser.jay: Less strict event error rule to catch more errors.
13203 2005-07-08 Martin Baulig <martin@ximian.com>
13205 Fix test-iter-10.cs - distinguish whether we `yield' in a property
13206 gettter (allowed) or setter (not allowed).
13208 * class.cs (Accessor): Implement IIteratorContainer.
13209 (Accessor.Yields): New public field.
13210 (PropertyBase.PropertyMethod.Define): Handle iterators on a
13211 per-accessor basis.
13214 (get_accessor_declaration, set_accessor_declaration): Set the
13215 `yields' flag on the accessor, not the property.
13216 (property_declaration): Do the iterators check on a per-accessor
13217 basis and not for the whole property.
13219 2005-07-08 Martin Baulig <martin@ximian.com>
13221 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
13222 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
13224 2005-07-07 Marek Safar <marek.safar@seznam.cz>
13227 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
13228 (ExtractSecurityPermissionSet): Cope with self referencing security
13229 attributes properly.
13231 * driver.cs (SetOutputFile): Made public property OutputFile.
13233 2005-07-07 Raja R Harinath <rharinath@novell.com>
13236 * class.cs (TypeContainer.first_nonstatic_field): Rename from
13237 has_nonstatic_fields. Make into a FieldBase pointer.
13238 (TypeContainer.AddField): Add CS0282 check.
13239 (TypeContainer.EmitType): Update.
13241 2005-07-06 Miguel de Icaza <miguel@novell.com>
13243 * cs-tokenizer.cs (consume_identifier): Do not create strings to
13244 compare if they start with __.
13246 2005-07-06 Raja R Harinath <rharinath@novell.com>
13248 * statement.cs (Switch.SwitchGoverningType): Only look at
13249 UserCasts that don't need implicit standard conversions to one of
13250 the allowed switch types (Fixes test-322.cs).
13251 (LocalInfo.Resolve): Re-enable sanity-test.
13253 2005-07-06 Marek Safar <marek.safar@seznam.cz>
13255 * cs-tokenizer.cs (consume_identifier): Detect double undescores
13257 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
13259 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
13261 2005-07-06 Raja R Harinath <rharinath@novell.com>
13264 * ecore.cs (SimpleName.GetSignatureForError): Add.
13265 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
13266 (MemberAccess.GetSignatureForError): Add.
13268 2005-07-05 Marek Safar <marek.safar@seznam.cz>
13270 The big error and warning messages review.
13300 * typemanager.cs: Updated.
13302 * class.cs: (MethodCore.SetYields): Moved here to share.
13303 (PropertyMethod.Define): Moved iterator setup here.
13305 * iterators.cs: Add orig_method to have full access to parent
13308 2005-07-05 Raja R Harinath <rharinath@novell.com>
13310 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
13311 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
13312 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
13313 variable of struct type.
13314 * expression.cs (Unary.ResolveOperator): Update to change.
13315 (Indirection.VerifyFixed): Likewise.
13316 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
13317 (ParameterReference.VerifyFixed): Value parameters are fixed.
13318 (This.VerifyFixed): Treat 'this' as a value parameter.
13319 * statement.cs (LocalInfo.IsFixed): Remove.
13321 2005-07-01 Martin Baulig <martin@ximian.com>
13323 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
13324 `ec.EmitThis ()' to get the correct scope.
13326 2005-07-01 Martin Baulig <martin@ximian.com>
13328 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
13329 instance is a ParameterReference; fixes #75299.
13331 2005-07-01 Martin Baulig <martin@ximian.com>
13333 Reverted Marek's latest patch (r46725):
13334 - it contains structural changes which are neither mentioned in
13335 the ChangeLog nor explained anywhere; for example the additional
13336 argument of EmitContext's and Iterator's .ctor's and the
13337 TypeContainer.DefineMembers() change.
13338 - structural changes like this should go in in seperate patches
13339 and not be hidden in a huge patch which just seems to affect
13340 warnings and errors.
13341 a big and hard to understand patch.
13342 - it breaks iterators and causes regressions, for instance in
13345 2005-06-30 Raja R Harinath <rharinath@novell.com>
13348 * expression.cs (Indexers.map): Remove.
13349 (Indexers.Append): Filter out inaccessible setters and getters.
13350 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
13353 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
13354 Refactored from ...
13355 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
13356 (FieldExpr.Emit, PropertyExpr.Emit): Update.
13357 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
13358 * expression.cs (Invocation.EmitCall): Add CS0120 check.
13360 2005-06-30 Marek Safar <marek.safar@seznam.cz>
13363 * class.cs (FieldBase.GetInitializerExpression): One more field
13366 2005-06-28 Miguel de Icaza <miguel@novell.com>
13368 * pending.cs: Do not define a proxy if the base method is virtual,
13369 it will be picked up by the runtime (bug 75270).
13371 2005-06-08 Martin Baulig <martin@ximian.com>
13373 The big Iterators rewrite :-)
13375 * iterators.cs: Rewrite this to use the anonymous methods framework.
13377 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
13378 before the TypeContainers; see 2test-21.cs.
13381 (TypeContainer.DefineType): Don't create a new EmitContext if we
13382 already have one (this only happens if we're an Iterator).
13383 (TypeContainer.Define): Also call Define() on all our iterators.
13384 (Method.CreateEmitContext): Added support for iterators.
13387 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
13388 (AnonymousContainer.CreateMethodHost): Moved here from
13389 AnonymousMethod and made abstract.
13390 (AnonymousContainer.CreateScopeType): New abstract method.
13391 (AnonymousContainer.IsIterator): New public property.
13392 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
13393 get the ScopeTypeBuilder rather than manually defining it here.
13394 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
13397 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
13398 before RootContext.DefineTypes().
13400 * codegen.cs (EmitContext.RemapToProxy): Removed.
13401 (EmitContext.CurrentAnonymousMethod): Changed type from
13402 AnonymousMethod -> AnonymousContainer.
13403 (EmitContext.ResolveTopBlock): Protect from being called twice.
13404 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
13405 (EmitContext.EmitThis): Removed the iterators hacks; use the
13406 anonymous methods framework for that.
13409 (ToplevelBlock.Container): Make this a property, not a field.
13410 (ToplevelBlock.ReParent): New public method; move the
13411 ToplevelBlock into a new container.
13412 (Foreach.TemporaryVariable): Simplify.
13414 2005-06-05 Martin Baulig <martin@ximian.com>
13416 * statement.cs (LocalInfo.CompilerGenerated): New flag.
13417 (Block.AddTemporaryVariable): New public method; creates a new
13418 `LocalInfo' for a temporary variable.
13419 (Block.EmitMeta): Create the LocalBuilders for all the temporary
13421 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
13422 non-iterator variables.
13424 2005-06-05 Martin Baulig <martin@ximian.com>
13426 * statement.cs (Foreach.TemporaryVariable): Create the
13427 LocalBuilder in the Emit phase and not in Resolve since in some
13428 situations, we don't have an ILGenerator during Resolve; see
13429 2test-19.cs for an example.
13431 2005-06-04 Martin Baulig <martin@ximian.com>
13433 **** Merged r45395 from GCS ****
13435 The big Foreach rewrite - Part II.
13437 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
13438 with `PropertyInfo ienumerator_getcurrent'.
13440 * codegen.cs (VariableStorage): Removed.
13443 (Foreach): Derive from Statement, not ExceptionStatement.
13444 (Foreach.CollectionForeach): New nested class. Moved all the code
13445 dealing with collection foreach here.
13446 (Foreach.ForeachHelperMethods): Removed.
13447 (Foreach.TemporaryVariable): Implement IMemoryLocation.
13449 2005-05-23 Martin Baulig <martin@ximian.com>
13451 * statement.cs (Try.DoResolve): Don't create a `finally' if we
13452 don't need to. Fix #75014.
13454 2005-05-20 Martin Baulig <martin@ximian.com>
13456 Merged r44808 from GMCS.
13458 * class.cs (TypeContainer.CircularDepException): Removed.
13459 (TypeContainer.DefineType): Removed the `InTransit' stuff.
13460 (TypeContainer.CheckRecursiveDefinition): Check for circular class
13461 (CS0146) and interface (CS0529) dependencies here.
13463 2005-06-21 Raja R Harinath <rharinath@novell.com>
13465 * expression.cs (Invocation.EmitCall): Fix initialization
13466 'this_call' to reflect current behaviour. Fix indentation.
13468 * convert.cs (FindMostEncompassedType): Add two trivial special
13469 cases (number_of_types == 0 || number_of_types == 1).
13470 (FindMostEncompasingType): Likewise.
13472 2005-06-17 Raja R Harinath <rharinath@novell.com>
13474 Some cleanups preparing for the fix of #75283.
13475 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
13477 (EventExpr.InstanceResolve): Likewise.
13478 (EventExpr.DoResolve): Remove redundant checks.
13480 2005-06-10 Duncan Mak <duncan@novell.com>
13482 * cs-tokenizer.cs (process_directives): New flag for controlling
13483 the processing of preprocessor directives.
13484 (x_token): After seeing a '#', return Token.NONE instead of going
13485 to handle_preprocessing_directive() when not processing
13486 directives. This avoids unnecessary processing during the token peek in
13491 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
13492 the existing error reporting methods instead of Report.Error.
13494 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
13495 after Raja's rewrite.
13497 2005-06-08 Miguel de Icaza <miguel@novell.com>
13499 * class.cs: Small fix.
13501 2005-06-08 Raja R Harinath <rharinath@novell.com>
13504 * class.cs (GetPartialBases): Fix return value check of
13505 part.GetClassBases.
13507 2005-06-07 Raja R Harinath <rharinath@novell.com>
13509 Ensure that partial classes are registered in their enclosing
13510 namespace. Initial part of fix of #75160.
13511 * tree.cs (Tree.RecordDecl): Add new namespace argument.
13512 Register declspace with namespace here, not in
13513 DeclSpace.RecordDecl.
13514 * cs-parser.jay: Pass namespace to RecordDecl.
13515 * class.cs (PartialContainer.Create): Likewise.
13516 (ClassPart.DefineType): New sanity-check. Throws an exception if
13518 * decl.cs (Declspace.RecordDecl): Remove.
13519 * namespace.cs (NamespaceEntry.DefineName): Remove.
13521 2005-06-06 Marek Safar <marek.safar@seznam.cz>
13523 * rootcontext.cs: Reset TargetExt as well.
13525 2005-06-03 Raja R Harinath <rharinath@novell.com>
13527 * ecore.cs (Expression.Resolve): Emit CS0654 error when
13528 -langversion:ISO-1.
13530 2005-06-02 Raja R Harinath <rharinath@novell.com>
13532 Fix #75080, cs0119.cs.
13533 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
13535 (Expression.Resolve): ... this. Use it. Remove bogus code
13536 allowing ExprClass.Type and ExprClass.Namespace for
13537 ResolveFlags.VariableOrValue.
13538 (Expression.Resolve) [1-argument variant]: Change default resolve
13539 flags based on language version.
13540 (Expression.Error_UnexpectedKind): Use a simple string array
13541 rather than an ArrayList.
13542 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
13543 not ExprClass.Type.
13544 (TypeOfVoid.DoResolve): Likewise.
13545 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
13546 flags argument -- it always has the same value.
13548 2005-05-31 Raja R Harinath <rharinath@novell.com>
13551 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
13552 Use it in the error message.
13553 * assign.cs, expression.cs, statement.cs: Update.
13555 2005-05-30 Raja R Harinath <rharinath@novell.com>
13558 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
13559 the "almostMatchedMember" case too.
13560 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
13561 that failed the accessibility checks to 'almost_match'.
13563 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
13565 * attribute.cs: Use internal MethodBuilder methods to set
13566 ExactSpelling and SetLastError on PInvoke methods, instead
13567 of passing them via charset. Fixes #75060.
13569 2005-05-27 Raja R Harinath <rharinath@novell.com>
13571 * parameter.cs (Parameter): Remove TODO comment.
13572 (Parameter.DefineParameter): Remove Location parameter.
13573 (Parameters.LabelParameters): Likewise.
13574 * class.cs (Constructor.Emit): Update to change.
13575 (MethodData.Emit): Likewise.
13576 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
13577 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
13579 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
13582 Removed Parameters.Location and added Parameter.Location instead.
13583 Removed Location parameter from Emit() and GetSignature().
13590 Modified all related calls.
13592 2005-05-26 Raja R Harinath <rharinath@novell.com>
13594 Improve user-defined conversion handling.
13595 * convert.cs (GetConversionOperators): Rewrite. Return only the
13596 applicable operators.
13597 (AddConversionOperators): New. Helper for GetConversionOperators.
13598 (FindMostEncompassedType, FindMostEncompassingType): Verify that
13599 there is only one most encompassed/encompassing type.
13600 (FindMostSpecificSource, FindMostSpecificTarget): Remove
13601 "applicable operator" handling.
13602 (UserConversion): Move cache here from GetConversionOperators.
13603 Directly cache the chosen operator, rather than the whole
13605 (ExplicitNumericConversion): Fix buggy implementation of Decimal
13606 case. Allow conversion of decimal to sbyte and byte too.
13607 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
13608 New static methods. Used to avoid allocating EmptyExpressions in
13611 2005-05-24 Duncan Mak <duncan@novell.com>
13613 * ecore.cs (CastFromDecimal): New class for casting a decimal to
13614 another class, used in Convert.ExplicitNumericConversion.
13615 (CastToDecimal): New class, similar to above, but casts to
13616 System.Decimal, used in Convert.ImplicitNumericConversion and also
13617 in explicit convesion from double/float to decimal.
13619 * convert.cs (ImplicitNumericConversion): Handle implicit
13620 conversions to System.Decimal.
13621 (ExplicitNumericConversion): handle explicit conversions to
13626 2005-05-20 Miguel de Icaza <miguel@novell.com>
13628 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
13629 know the type at this stage, just break through. Fixes #75008
13631 2005-05-19 Martin Baulig <martin@ximian.com>
13634 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
13635 to disable error reporting.
13637 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
13638 here since we don't want to report an error; see the new test-336.cs.
13640 2005-05-19 Raja R Harinath <rharinath@novell.com>
13642 * statement.cs (ToplevelBlock.GetParameterReference)
13643 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
13644 Move here from class Block.
13645 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
13646 * expression.cs (ParameterReference.DoResolveBase): Likewise.
13648 2005-05-18 Martin Baulig <martin@ximian.com>
13653 (FlowBranching.Reachability): Add non-static public And() and Or()
13655 (FlowBranchingSwitch): New class; do the `break_origins' thing
13656 like in FlowBranchingLoop.
13657 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
13658 reachability, not just locals and parameters.
13659 (FlowBranching.MergeChild): Remove some of the hacks for loop and
13660 switch; MergeBreakOrigins() now takes care of that.
13662 2005-05-18 Martin Baulig <martin@ximian.com>
13664 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13665 a loop and may leave it, reset the barrier; fixes #74974.
13667 2005-05-17 Marek Safar <marek.safar@seznam.cz>
13669 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
13672 * cs-parser.jay: Catch more lexical errors.
13674 * report.cs: Add one more Error method.
13677 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
13679 2005-05-17 Martin Baulig <martin@ximian.com>
13681 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
13684 2005-05-16 Raja R Harinath <rharinath@novell.com>
13686 Fix test-382.cs. Emit values of decimal constants.
13687 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
13689 (TypeContainer.AddField): ... this.
13690 (TypeContainer.EmitFieldInitializers): Allow the list of fields
13691 with initializers to include 'Const's.
13692 (ClassPart.RegisterFieldForInitialization): Forward to
13694 * const.cs (Const.Const): Pass initializer to base class.
13695 (Const.Define): In case of decimal constants, register them for
13696 initialization in a static constructor.
13698 2005-05-14 Martin Baulig <martin@ximian.com>
13700 * statement.cs (Block.Resolve): Correctly handle unreachable code;
13701 do not call ResolveUnreachable() on unreachable statements in
13702 here, see the comment in the source code.
13704 2005-05-13 Raja R Harinath <rharinath@novell.com>
13707 * expression.cs (BinaryResolveOperator): If one of the operands of
13708 an equality comparison is 'null' and the other is a pointer type,
13709 convert the null to a NullPointer.
13710 * convert.cs (ImplicitReferenceConversion): If the expression is a
13711 NullLiteral and the target type is a pointer type, return a
13712 NullPointer instead.
13713 (ImplicitConversionStandard): Likewise.
13715 2005-05-13 Marek Safar <marek.safar@seznam.cz>
13717 * cs-parser.jay: Set readonly context based on special constructs.
13719 * expression.cs (LocalVariableReference.DoResolveBase): Improved
13720 readonly variable error handling.
13722 * rootcontext.cs (EmitCode): Don't verify members when error
13725 * statement.cs (LocalInfo): Add reaodnly context information.
13726 (SetReadOnlyContext, GetReadOnlyContext): New methods.
13728 2005-05-13 Raja R Harinath <rharinath@novell.com>
13730 * statement.cs (Block.Resolve): Revert change below. Modify fix
13731 for #74041 to initialize 'resolved' to false only for explicit
13732 blocks. Fixes #74873.
13734 2005-05-12 Raja R Harinath <harinath@gmail.com>
13737 * typemanager.cs (unmanaged_enclosing_types): New.
13738 (IsUnmanagedType): Avoid infloops by using
13739 'unmanaged_enclosing_types' to talk with recursive invocations.
13741 2005-05-13 Martin Baulig <martin@ximian.com>
13743 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
13744 instance variable, not a local. Fix #74873.
13745 (Block.ResolveUnreachable): Set it to true here.
13747 2005-05-11 Duncan Mak <duncan@novell.com>
13749 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
13750 continuing to process for 'arg'.
13751 (handle_preprocessing_directive): Check the argument of the #endif
13752 directive and report error CS1025 if there are any trailing
13755 According to the C# spec, having even whitespace after the #endif
13756 directive is illegal; however, because we call arg.TrimEnd ()
13757 beforehand, we have the same behavior as csc, allowing whitespace
13758 after the directive.
13762 2005-05-11 Marek Safar <marek.safar@seznam.cz>
13766 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
13767 (Constructor.GetObsoleteAttribute): Implemented correctly.
13769 2005-05-10 Martin Baulig <martin@ximian.com>
13771 * support.cs (ReflectionParameters.ParameterModifier): Use
13772 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
13773 and `ParameterAttributes.In'. Fixes #74884.
13775 2005-05-10 Marek Safar <marek.safar@seznam.cz>
13777 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
13779 * expression.cs (Argument.GetParameterModifier): Turned to property.
13780 (Invocation.Error_InvalidArguments): Add more descriptive errors.
13782 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
13785 2005-05-09 Raja R Harinath <rharinath@novell.com>
13788 * decl.cs (MemberCache.AddMethods): Register override methods,
13789 rather than non-override methods.
13790 * typemanager.cs (RegisterOverride): New.
13791 (IsOverride): Update.
13793 2005-05-09 Marek Safar <marek.safar@seznam.cz>
13797 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
13798 recursive declaration.
13800 * statement.cs (Block.ResolveMeta): Report any error in resolving.
13802 2005-05-06 Marek Safar <marek.safar@seznam.cz>
13804 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
13806 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
13808 2005-05-05 Raja R Harinath <rharinath@novell.com>
13811 * decl.cs (DeclSpace.FamilyAccessible):
13812 Use TypeManager.IsNestedFamilyAccessible.
13814 Fix reopened #64812.
13815 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
13818 2005-05-04 Raja R Harinath <rharinath@novell.com>
13819 Abin Thomas <projectmonokochi@rediffmail.com>
13820 Anoob V E <projectmonokochi@rediffmail.com>
13821 Harilal P R <projectmonokochi@rediffmail.com>
13824 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
13825 allow access to all static members.
13827 2005-05-04 Martin Baulig <martin@ximian.com>
13829 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
13831 2005-05-04 Martin Baulig <martin@ximian.com>
13835 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
13836 section at the end; make things work if `default' is not the last
13839 2005-05-04 Martin Baulig <martin@ximian.com>
13843 * statement.cs (Switch): Replaced the `got_default' field with a
13844 `default_section' one.
13845 (Switch.CheckSwitch): Set `default_section' here.
13846 (Switch.Resolve): If we're a constant switch and the constant is
13847 not found, use the default section.
13849 2005-05-03 Martin Baulig <martin@ximian.com>
13851 * expression.cs (ArrayAccess.EmitGetLength): New public method.
13853 * statement.cs (Foreach.ArrayForeach): New nested class.
13854 (Foreach.TemporaryVariable): New nested class.
13855 (Foreach.EmitArrayForeach): Removed; this is now in the new
13856 ArrayForeach class.
13858 2005-05-03 Raja R Harinath <rharinath@novell.com>
13860 * pending.cs (BaseImplements): Move the #74773 fix here. This is
13862 (VerifyPendingMethods): Revert change below.
13864 * typemanager.cs (IsOverride, RegisterNonOverride): New.
13865 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
13866 that used to trigger warning -28. Remove warning -28.
13867 * expression.cs (Invocation.OverloadResolve): Use
13868 TypeManager.IsOverride to distinguish override methods.
13871 * pending.cs (VerifyPendingMethods): If a base type implements the
13872 requested interface, don't bother checking individual methods of
13873 the base type. As a side-effect, this prevents the creation of
13874 unnecessary proxies.
13876 2005-05-02 Martin Baulig <martin@ximian.com>
13880 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13881 Also `And' the locals if the old vector is null.
13882 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
13883 null; in this case we basically reset all the variables.
13885 2005-05-02 Martin Baulig <martin@ximian.com>
13889 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
13890 Added `FlowBranching branching' argument; always `and' the
13891 variables instead of `or'ing them unless we're an infinite loop.
13893 * statement.cs (While.Resolve): Create a new sibling unless we're
13896 2005-05-02 Martin Baulig <martin@ximian.com>
13900 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
13901 arguments; use it instead of creating a new TopLevelBlock.
13902 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
13903 our ConstructorInitializer.
13906 (TopLevelBlock.TopLevelBranching): New public property.
13907 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
13908 and create our `TopLevelBranching'.
13910 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
13911 anonymous method host, use `block.TopLevelBranching' rather than
13912 creating a new branching.
13914 2005-04-20 Miguel de Icaza <miguel@novell.com>
13916 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
13917 a ScopeInfo, if any of the current children is a child of the new
13918 entry, move those children there.
13920 2005-04-30 Martin Baulig <martin@ximian.com>
13922 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
13923 at the beginning of a SwitchSection. Fix #73335.
13925 2005-04-27 Marek Safar <marek.safar@seznam.cz>
13928 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
13930 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
13931 (FieldExpr.DoResolve): Obsolete members are ignored for field
13934 2005-04-26 Marek Safar <marek.safar@seznam.cz>
13936 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
13937 of arrays detection.
13939 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
13941 (Field.VerifyClsCompliance): Volatile fields are not compliant.
13943 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
13946 2005-04-25 Ben Maurer <bmaurer@ximian.com>
13948 * cs-parser.jay: Use the prefered version of -unsafe in error
13951 2005-04-22 Marek Safar <marek.safar@seznam.cz>
13953 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
13956 2005-04-20 John Luke <john.luke@gmail.com>
13958 * driver.cs: fix typo in error message, --outout to --output
13960 2005-04-20 Marek Safar <marek.safar@seznam.cz>
13962 * codegen.cs (InRefOutArgumentResolving): New field.
13964 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
13965 fields outside contructor.
13967 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
13969 2005-04-19 Miguel de Icaza <miguel@novell.com>
13971 * anonymous.cs (CaptureContext.EmitParameterInstance): The
13972 parameter code was not completed ever, so it was not as up-to-date
13973 as local variables. Must finish it.
13975 The bug fix was to compare the Toplevel of the block, not the
13976 current block. Thanks for Ben for pointing this out.
13978 2005-04-19 Raja R Harinath <rharinath@novell.com>
13980 * decl.cs (AddMethods): Use the declaring type of the problem
13981 method to determine if we want to squash a warning.
13983 2005-04-19 Marek Safar <marek.safar@seznam.cz>
13985 * attribute.cs: Removed debug output.
13987 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
13989 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
13992 2005-04-18 Raja R Harinath <rharinath@novell.com>
13995 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
13996 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
13997 all null comparisons against reference types.
13999 2005-04-18 Marek Safar <marek.safar@seznam.cz>
14002 * class.cs (TypeContainer.CircularDepException) New nested
14004 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
14005 (TypeContainer.DefineType): Removed error, reset InTransit before
14007 (Class.DefineType): Throw exception when is in Transit.
14008 Catch exception and report error.
14009 (Struct.DefineType): Throw exception when is in Transit.
14010 Catch exception and report error.
14011 (Interface.DefineType): Throw exception when is in Transit.
14012 Catch exception and report error.
14014 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
14015 handle nested exception handlers.
14017 * flowanalysis.cs (InTryWithCatch): New method, search for try with
14020 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
14021 InFinally and InCatch storage.
14023 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
14024 (Catch.Resolve): Set and Restore ec.InCatch.
14025 (Try.Resolve): Set and Restore ec.InFinally.
14026 (Try.HasCatch): True when try has catch.
14028 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
14030 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
14031 for the same event member, so exclude such cases from warning 419.
14034 2005-04-16 Miguel de Icaza <miguel@novell.com>
14036 * expression.cs (Binary.ResolveOperator): Apply patch from John
14037 Luke to fix bug 59864: operators &, | and ^ on enumerations
14038 require that the same enum type on both sides.
14040 * driver.cs: Add warnings to old flag usage, this is to assist
14041 people who produce Makefiles and hope that the Makefiles will be
14044 * class.cs (TypeContainer.EmitType): Moved the definition of the
14045 special $PRIVATE$ field from the resolve phase to the Emit phase.
14046 During resolve we do not know if we are a struct with
14047 HasExplicitLayout, we know this only after the attributes for the
14050 Set the FieldOffset to zero on the dummy field that we create for
14051 the class. Fixes 74590.
14053 2005-04-16 Raja R Harinath <rharinath@novell.com>
14056 * ecore.cs (PropertyExpr.resolved): New.
14057 (DoResolve): Use it to handle a case of double resolution here.
14058 Handle a case of identical-name-and-type-name.
14059 * expression.cs (ArrayCreation.CheckIndices): Avoid double
14060 resolution by storing the results of expression resolution back
14061 into the "probes" array.
14063 2005-04-15 Raja R Harinath <rharinath@novell.com>
14065 Fix cs0208-7.cs and cs0208-8.cs.
14066 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
14067 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
14068 error reporting to point out the reason a struct is not unmanaged.
14070 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14072 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
14073 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
14075 2005-04-13 Raja R Harinath <rharinath@novell.com>
14078 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
14079 IdenticalNameAndTypeName here.
14080 (EventExpr.InstanceResolve): Likewise.
14082 2005-04-13 Marek Safar <marek.safar@seznam.cz>
14084 C# 2.0 DefaultCharSetAttribute implementation
14086 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
14087 which allows us to set GlobalNamespace for every resolve.
14088 (Attribute.ResolveArguments): Cut from Resolve.
14089 (Attribute.GetCharSetValue): Returns CharSet named argument.
14090 (Attribute.DefinePInvokeMethod): Gets default charset from
14092 (GlobalAttribute.ResolveAsTypeStep): Override.
14093 (GlobalAttribute.ResolveArguments): Override.
14095 * class.cs (TypeAttr): Is protected.
14097 * codegen.cs (ModuleClass.DefaultCharSet): New member.
14098 (ModuleClass.DefaultCharSetType): New memeber.
14099 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
14101 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
14102 charset from module.
14104 * delegate.cs (TypeAttr): Override.
14105 (Delegate.DefineType): Use this TypeAttr.
14107 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
14108 at very early stage (before types are defined) to resolve model
14109 module attributes. It will probably not work with corlib but it
14112 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
14113 charset from module.
14115 * typemanager.cs (default_charset_type): New type.
14117 2005-04-13 Raja R Harinath <rharinath@novell.com>
14119 * decl.cs (MemberCache.AddMethods): Don't warn if
14120 System.Object.Finalize has buggy MethodAttributes.
14122 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
14125 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14127 * doc.cs : detect ambiguous reference to overloaded members.
14128 Fixed bug #71603. MS 1.1 csc does not detect it.
14130 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14132 * doc.cs : delegates must not be referenced with parameters.
14135 2005-04-12 Miguel de Icaza <miguel@novell.com>
14137 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
14139 2005-04-10 Miguel de Icaza <miguel@novell.com>
14141 * driver.cs (MainDriver): Stop processing if the CLS stage found
14144 (CompilerCallableEntryPoint.InvokeCompiler): Always
14145 reset after execution; Take a TextWriter argument for the
14148 * report.cs: Use the error stream instead of hardcoding stderr.
14150 2005-04-09 Miguel de Icaza <miguel@novell.com>
14152 * class.cs: Reduce code paths to test, too small of an
14153 optimization to make it worth the extra testing. Always perform
14156 2005-04-08 Raja R Harinath <rharinath@novell.com>
14159 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
14160 operators that had errors reported on them.
14162 2005-04-08 Marek Safar <marek.safar@seznam.cz>
14164 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
14166 (Attribute.Resolve): Add named argument type checking.
14168 * class.cs (FixedField.Define): Use IsPrimitiveType
14170 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
14172 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
14173 unsafe parameter types.
14175 * statement.cs (Using.ResolveExpression): Add better error description.
14177 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
14179 2005-04-08 Raja R Harinath <rharinath@novell.com>
14182 * attribute.cs (Attribute.GetAttributeUsage): Resolve
14183 AttributeUsageAttribute in the emitcontext of the attribute class,
14184 not in the emitcontext of the attributable entity it was attached to.
14185 * cs-parser.jay: Use 'current_class', not 'current_container',
14186 when creating a GlobalAttribute.
14188 2005-04-08 Alp Toker <alp@atoker.com>
14190 * pending.cs: The fix to #58413 failed to compile methods implementing
14191 interfaces with/without params modifiers and vice versa, even though
14192 params modifiers aren't part of the signature. Make the modifier check
14193 less strict as in csc.
14195 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
14196 Anoob V E <projectmonokochi@rediffmail.com>
14197 Harilal P R <projectmonokochi@rediffmail.com>
14200 * pending.cs (TypeAndMethods.mods): New. Store the parameter
14201 modifiers of pending methods.
14202 (PendingImplementation.PendingImplementation): Initialize it.
14203 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
14204 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
14205 with ParameterData. Add check for modifiers.
14206 * class.cs (MethodData.Define): Update to changes.
14208 2005-04-07 Raja R Harinath <rharinath@novell.com>
14210 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
14212 2005-04-07 Marek Safar <marek.safar@seznam.cz>
14214 * class.cs (PropertyMethod.Define): Check private accessor in abstract
14217 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
14220 * typemanager.cs: Registered RequiredAttributeAttribute.
14222 2005-04-06 Marek Safar <marek.safar@seznam.cz>
14224 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
14225 Warning CS0169 is back at level 3.
14226 (IMethodData.SetMemberIsUsed): New method.
14228 * decl.cs (IsUsed): New value; moved from FieldBase.Status
14229 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
14231 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
14233 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
14235 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
14238 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
14241 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
14242 to avoid the problems with nested types.
14244 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
14245 Anoob V.E <projectmonokochi@rediffmail.com>
14246 Harilal P.R <projectmonokochi@rediffmail.com>
14247 Raja R Harinath <rharinath@novell.com>
14250 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
14252 * typemanager (GetConstructor): Make public.
14254 2005-04-05 John Luke <john.luke@gmail.com>
14255 Raja R Harinath <rharinath@novell.com>
14258 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
14259 struct too. Return false quicker in a few cases.
14260 (VerifyUnManaged): Use it.
14262 2005-04-05 Raja R Harinath <rharinath@novell.com>
14265 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
14266 not 'unreachable_seen'.
14268 2005-04-04 Marek Safar <marek.safar@seznam.cz>
14270 * attribute.cs (Attribute.GetValue): Removed unused.
14272 * codegen.cs (CodeGen.TrimExt): Removed unused.
14274 * cs-parser.jay (output): Removed unused.
14276 * cs-tokenizer.cs (hex_digits): Removed unused.
14278 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
14280 * expression.cs (Indirection.LoadExprValue): Removed unused.
14281 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
14283 * iterators.cs (Iterator.param_types): Removed unused.
14285 * statement.cs (Goto.block): Removed unused.
14286 (ToplevelBlock.did): Removed unused.
14287 (Switch.ResolveConstantSwitch): Removed unused.
14289 2005-04-01 Ben Maurer <bmaurer@ximian.com>
14291 * rootcontext.cs: Allow mcs to bootstrap with the compilation
14294 2005-04-01 Raja R Harinath <rharinath@novell.com>
14296 Fix #74232 and cs0208-3.cs.
14297 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
14298 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
14299 unmanaged type. Don't use FieldBuilders when 't' is a
14300 TypeBuilder. Use ModFlags and MemberType fields.
14301 * class.cs (MemberBase.member_type): Rename from MemberType.
14302 (MemberBase.MemberType): New property. Determines member_type on
14304 (MemberBase.DoDefine): Don't initialize MemberType here.
14305 (FieldMember.Define): Likewise.
14307 2005-04-01 Marek Safar <marek.safar@seznam.cz>
14310 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
14311 Attributes are emitted there.
14313 2005-04-01 Raja R Harinath <rharinath@novell.com>
14315 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
14316 keyword in 'partial enum' too.
14317 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
14319 Report from Kamil Skalski <nazgul@omega.pl>.
14322 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
14323 have partial containers too.
14325 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
14326 in block' checks to Block.CheckInvariantMeaningInBlock.
14327 * statement.cs (Block.GetKnownVariableInfo): Make private.
14328 (Block.IsVariableUsedInChildBlock): Remove.
14329 (Block.IsVariableUsedInBlock): Likewise.
14330 (Block.CheckInvariantMeaningInBlock): New. Show location of
14331 conflicting declaration.
14332 (Block.AddVariable): Make error messages less long-winded and more
14333 specific. Show location of conflicting declaration.
14334 * parameter.cs (Parameters.Location): New readonly property.
14336 2005-03-31 Raja R Harinath <rharinath@novell.com>
14338 Clean up semantics of invoking ResolveMemberAccess.
14339 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
14340 can have an instance, ensure that we pass in a non-TypeExpression
14341 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
14342 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
14343 argument. Update to changes and simplify.
14344 (FieldExpr.Emitinstance): Remove CS0120 check.
14345 (PropertyExpr.EmitInstance): Likewise.
14346 * expression.cs (Argument.Resolve): Likewise.
14347 (Invocation.DoResolve): Update to changes in semantics of
14348 InstanceExpression.
14350 2005-03-31 Marek Safar <marek.safar@seznam.cz>
14353 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
14356 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
14358 2005-03-31 Raja R Harinath <rharinath@novell.com>
14360 Fix difference in behaviour with commandline invocation.
14361 * driver.cs (Driver.Reset): New.
14362 (CompilerCallableEntryPoint): Call it.
14364 * statement.cs (If.Resolve): Avoid spurious "uninitialized
14365 variable" warnings if the boolean expression failed to resolve.
14367 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
14369 * attribute.cs: Fix the union of several permissions when some of them
14370 are unrestricted (so the result isn't an unrestricted permission set).
14373 2005-03-30 Raja R Harinath <rharinath@novell.com>
14375 * ecore.cs (MemberExpr): New class. Convert from interface
14377 (MemberExpr.ResolveMemberAccess): Refactor and move here from
14378 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
14380 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
14381 (MethodGroupExpr.IsExplicitImpl): Remove.
14382 (Expression.GetFieldFromEvent): Remove.
14383 (SimpleName.MemberStaticCheck): Remove.
14384 (SimpleName.DoSimpleNameResolve): Update to changes.
14385 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
14386 (MemberAccess.IdenticalNameAndTypeName): Remove.
14387 (MemberAccess.error176): Move to MemberExpr.
14388 (MemberAccess.DoResolve): Update to changes.
14389 (BaseAccess.DoResolve): Likewise.
14391 2005-03-30 Marek Safar <marek.safar@seznam.cz>
14393 C# 2.0 Conditional attribute class implementation
14395 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
14396 Analyzes class whether it has attribute which has ConditionalAttribute
14397 and its condition is not defined.
14399 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
14400 (Class.IsExcluded): New method. Search for at least one defined
14401 condition in ConditionalAttribute of attribute class.
14403 2005-03-30 Raja R Harinath <rharinath@novell.com>
14405 * ecore.cs (PropertyExpr): Derive from Expression, not
14406 ExpressionStatement.
14407 (PropertyExpr.EmitStatement): Remove.
14409 2005-03-29 Raja R Harinath <rharinath@novell.com>
14412 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
14413 internal field "value__" of an enum be private. The examples for
14414 "value__" that I found on MSDN all used FieldAttributes.Private.
14416 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
14417 Don't mention IL method attribute names.
14419 Fix #47991. Remove a TODO.
14420 * statement.cs (Block.Toplevel): Make into a field.
14421 (Block.Parameters): Move into ToplevelBlock.
14422 (Block.known_variables): Rename from child_variable_names.
14423 (Block.Block): Remove variants that take Parameters. Initialize
14424 'Toplevel' with the immediately surrounding toplevel block.
14425 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
14426 LocalInfo parameter.
14427 (Block.GetKnownVariableInfo): New.
14428 (Block.IsVariableNameUsedInChildBlock): Update.
14429 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
14430 the block, even though it may not be in scope.
14431 (Block.AddVariable): Remove Parameters parameter. Use
14432 Toplevel.Parameters instead.
14433 (Block.AddConstant): Remove Parameters parameter.
14434 (Block.GetParameterReference): Update to use Toplevel.Parameters.
14435 (Block.IsParamaterReference): Likewise.
14436 (Block.IsLocalParameter): Likewise. Simplify a lot.
14437 (ToplevelBlock.Parameters): New. Moved from Block.
14438 (ToplevelBlock.ToplevelBlock): Update to changes. Always
14439 initialize Parameters to a non-null value.
14440 * cs-parser.jay: Update to changes.
14441 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
14442 simple names that mean different things in the same block. Use
14443 Block.IsVariableNameUsedInBlock.
14445 2005-03-28 Raja R Harinath <rharinath@novell.com>
14447 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
14448 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
14449 GetTypeHandle. It is possible for a reflected type to derive from
14450 a TypeBuilder (e.g., int[] derives from the TypeBuilder
14451 System.Array during mscorlib compilation).
14452 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
14453 contain a method_hash, don't create one either. Don't create a
14454 deep copy of the base cache's method_hash.
14455 (MemberCache.SetupCache): Rename back from DeepCopy.
14456 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
14457 already initialized. If we see an override function, add its
14458 underlying base virtual function to the member_hash too.
14460 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
14462 2005-03-26 Raja R Harinath <harinath@acm.org>
14465 * assign.cs (Assign.DoResolve): When the RHS of an assignment
14466 fails to resolve, ensure that the LHS is still resolved as an
14469 2005-03-25 Raja R Harinath <harinath@acm.org>
14471 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
14473 (Enum.current_ec): Remove.
14474 (Enum.LookupEnumValue): Remove EmitContext argument.
14475 Just uses the one created during DefineType.
14476 (Enum.FindMembers): Update.
14477 * expression.cs (MemberAccess.DoResolve): Update.
14479 2005-03-22 Marek Safar <marek.safar@seznam.cz>
14481 * assign.cs (Assign.DoResolve): Check for CS1717 when
14482 source and target are same (uses Equals).
14484 * expression.cs (LocalVariableReference, ParameterReference,
14485 This): Implemented Equals, GetHashCode.
14487 * statement.cs (Block.GetParameterReference): Removed useless
14490 2005-03-22 Raja R Harinath <rharinath@novell.com>
14493 * statement.cs (Block.AddVariable): Ensure that we skip implicit
14494 blocks before deciding whether the error is cs0136 or cs0128.
14496 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
14497 (using_alias_directive, using_namespace_directive): Pass
14498 MemberName, not an expression to Namespace.UsingAlias and
14500 (MakeName): Use the MemberName of the namespace.
14501 * namespace.cs (Namespace.MemberName): New.
14502 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
14503 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
14505 * decl.cs (MemberName.Name): Make readonly.
14506 (MemberName.FromDotted): New "constructor".
14507 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
14508 (MemberCore.Name): Compute from MemberName on demand.
14509 (MemberCore.SetMemberName): Provide a way to change the
14511 (MemberCore.AddToContainer): Don't take a fullname parameter.
14512 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
14513 fully qualified name of the container to the member name.
14514 (TypeContainer.AddToTypeContainer): Use a fully qualified name
14515 only if the type is a member of the root container.
14516 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
14517 MemberName.Left rather than searching for an embedded ".".
14518 (PartialContainer.CreatePart): Update to changes in RootContext.
14519 (MemberBase.ShortName): Turn into a property. Use
14520 MemberCore.SetMemberName.
14521 (MemberBase.ExplicitInterfaceName): Remove.
14522 (MemberBase.UpdateMemberName): Remove.
14523 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
14524 (PropertyBase.SetMemberName): New override.
14525 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
14526 (Tree.GetDecl): New.
14527 (Tree.AllDecls): Rename from Decls.
14528 * attribute.cs, enum.cs, report.cs: Update to changes.
14529 * driver.cs (MainDriver): Use MemberName.FromDotted on
14530 RootContext.MainClass.
14532 2005-03-21 Marek Safar <marek.safar@seznam.cz>
14534 * class.cs (FixedField.Define): Check for CS1664 and more sanity
14537 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
14539 2005-03-18 Marek Safar <marek.safar@seznam.cz>
14541 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
14542 property accessor modifiers.
14544 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
14545 fixed buffer attribute (CS1716).
14546 (PropertyMethod.HasCustomAccessModifier): When property accessor
14547 has custom modifier.
14549 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
14551 (PropertyExpr.DoResolveLValue): Add CS0272.
14553 2005-03-17 Miguel de Icaza <miguel@novell.com>
14555 * convert.cs: When converting to a pointer, use the proper Conv.U
14556 or Conv.I depending on the source data type.
14558 * cs-tokenizer.cs: Make the size for large decimal constants,
14561 2005-03-17 Martin Baulig <martin@ximian.com>
14563 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
14564 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
14566 2005-03-17 Martin Baulig <martin@ximian.com>
14568 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
14569 to bool so we can return an error condition.
14570 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
14573 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
14575 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
14578 2005-03-16 Raja R Harinath <rharinath@novell.com>
14580 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
14581 Refactor to avoid traversing the list of assemblies, and to avoid
14582 string concatenation.
14583 * typemanager.cs (guid_attr_type): Remove.
14584 (negative_hits, pointers, references): Remove hashes.
14586 (GetConstructedType): New. Uses type_hash to handle constructed
14587 types (arrays, references, pointers).
14588 (GetReferenceType, GetPointerType): Use it.
14589 (GetNestedType): New. Uses type_hash to handle nested types of
14591 (LookupType, LookupTypeDirect): Remove.
14592 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
14593 'types' hash and LookupTypeReflection directly.
14594 (params_string, params_object): Use GetConstructedType.
14595 * namespace.cs (Namespace.cached_types): New. Cache of reflected
14597 (Namespace.Lookup): Use cached_types.
14598 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
14599 provided by old TypeManager.LookupType.
14600 * rootcontext.cs (MakeFQN): Remove.
14601 * decl.cs (DeclSpace.MakeFQN): Likewise.
14602 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
14603 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
14604 TypeManager.GetConstructedType.
14605 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
14607 2005-03-15 Marek Safar <marek.safar@seznam.cz>
14609 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
14612 * cs-parser.jay: Reports CS1527 for any namespace element.
14614 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
14617 * expression.cs (ParameterReference.IsAssigned): Changed error to
14619 (Error_WrongNumArguments): Moved CS0245 detection here.
14621 * statement.cs (Return.Resolve): Add CS1622 report.
14623 2005-03-11 Marek Safar <marek.safar@seznam.cz>
14625 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
14627 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
14629 * attribute.cs expression.cs: Get rid of some allocations.
14631 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
14633 * doc.cs : just eliminate the latest change.
14635 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14637 * doc.cs : commented out the latest change. It breaks xml-030.cs
14639 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14641 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
14642 fail. So invoke CreateType() in FindDocumentedType().
14644 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14646 * cs-tokenizer.cs : added IsKeyword().
14647 * doc.cs : Detect keyword incorrectly used as identifier.
14648 Allow identifiers prefixed by @.
14650 2005-03-10 Marek Safar <marek.safar@seznam.cz>
14652 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
14653 It caused exception in namespace resolving (again!).
14655 * class.cs (Class.ctor): Removed exit.
14656 (PropertyMethod.ctor): ditto.
14658 * codegen.cs (Codegen.Reset): Reset static data.
14659 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
14661 * cs-tokenizer.cs (Cleanup): Removed.
14663 * driver.cs (GetSystemDir): Rewrote to one line command.
14664 It caused problem with unloaded dynamic modules.
14665 (UnixParseOption): Removed Exit.
14666 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
14667 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
14668 Now can be mcs used as library.
14670 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
14673 * location.cs (Reset): Reset static data.
14675 * namespace.cs (Reset): Reset static data.
14677 * report.cs (Report.Reset): Reset static data.
14679 * rootcontext.cs (RootContext.Reset): Reset static data.
14681 * tree.cs (RootTypes.ctor): Use Location.Null
14683 * typemanager.cs (TypeManager.Reset): Reset static data.
14684 (CoreLookupType): Removed Exit.
14685 (TypeHandle.Reset): Reset static data.
14687 2005-03-10 Raja R Harinath <rharinath@novell.com>
14690 * typemanager.cs (ComputeNamespaces): Import namespaces from
14691 referenced modules too.
14693 2005-03-09 Raja R Harinath <rharinath@novell.com>
14695 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
14698 2005-03-09 Raja R Harinath <rharinath@novell.com>
14700 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
14701 enclosing DeclSpace. This ensures that a name-lookup populates
14702 more caches and there are fewer 'TypeExpression's. Carve out
14703 nested type lookup into ...
14704 (LookupNestedTypeInHierarchy): ... this.
14706 2005-03-09 Raja R Harinath <rharinath@novell.com>
14708 Clean up a few partial-class semantics.
14709 Fixes test-357.cs and cs1618-2.cs.
14710 * cs-parser.jay (struct_declaration): Use 'current_class' as
14711 parent of newly-created struct. Remove call to Register ().
14712 Use 'pop_current_class' to complete handing the current struct.
14713 (interface_declaration): Likewise.
14714 (class_declaration): Likewise.
14715 (enum_declaration): Use 'current_class' as parent of newly created
14717 (delegate_declaration): Likewise.
14718 (pop_current_class): New function. This is used to handle closing
14719 up the 'current_class' and 'current_container', and pointing them
14720 to the enclosing class/container.
14721 (CSharpParser): Initialize 'current_class' too.
14722 * decl.cs (MemberCore): Add check for invariant: a partial
14723 container is not a parsed entity, and thus does not enclose any
14725 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
14726 (DeclSpace.BaseTypeExpr): Use it.
14727 (DeclSpace.LookupType): Add check for invariant.
14728 * class.cs (TypeContainer): Add check for invariant: a nested
14729 class should have the same NamespaceEntry as its enclosing class.
14730 (TypeContainer.EmitFieldInitializers): Make virtual.
14731 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
14733 (TypeContainer.Register): Remove.
14734 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
14735 null. Use TypeResolveEmitContext for resolving base types and
14736 interfaces. Move initialization of Parts.TypeBuilder here from
14738 (TypeContainer.DefineNestedTypes): ... here.
14739 (PartialContainer): Take a Namespace not a NamespaceEntry.
14740 (PartialContainer.Create): Don't use Register. Call the
14741 appropriate Add... function directly.
14742 (ClassPart): Take both the PartialContainer and the enclosing
14743 class as constructor arguments.
14744 (ClassPart.EmitFieldInitializers): Override.
14745 (ClassPart.PartFindNestedTypes): Remove.
14746 (FieldBase.GetInitializerExpression): Resolve the initializer
14747 expression in the emit context of the enclosing class.
14748 * tree.cs (RootTypes): Remove Register ().
14750 2005-03-08 Marek Safar <marek.safar@seznam.cz>
14752 * cs-parser.jay: Removed CS0134.
14754 * driver.cs: Removed CS1901.
14756 * expression.cs (SizeOf.DoResolve): Don't report CS0233
14757 for predefined types.
14759 2005-03-07 Duncan Mak <duncan@novell.com>
14761 * codegen.cs (Save): Catch UnauthorizedAccessException as
14762 well. Fixes bug #73454.
14764 2005-03-07 Marek Safar <marek.safar@seznam.cz>
14766 * cs-tokenizer.cs (xtoken): Add CS1035.
14768 * class.cs (MethodData.Define): Add CS0683.
14769 (FieldMember.ctor): Add CS0681.
14771 2005-03-07 Raja R Harinath <rharinath@novell.com>
14773 * ecore.cs (SimpleName.DoResolve): Rename from
14774 SimpleName.DoResolveAllowStatic.
14775 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
14776 Pass 'intermediate' flag to MemberStaticCheck.
14777 (SimpleName.MemberStaticCheck): Skip "static check" only in case
14778 of "intermediate" lookups via MemberAccess.
14779 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
14780 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
14782 2005-03-07 Raja R Harinath <rharinath@novell.com>
14785 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
14786 slipped in because of variable names that are identical to a
14787 builtin type's BCL equivalent ('string String;', 'int Int32;').
14788 (PropertyExpr.EmitInstance): Likewise.
14790 2005-03-04 Marek Safar <marek.safar@seznam.cz>
14792 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
14794 * report.cs (warning_ignore_table): Made public.
14796 2005-03-04 Raja R Harinath <rharinath@novell.com>
14799 * class.cs (MethodData.Emit): Pass 'container' to
14800 container.GetObsoleteAttribute instead of 'container.Parent'.
14802 2005-03-03 Marek Safar <marek.safar@seznam.cz>
14804 * cs-parser.jay: Add 1534 error test.
14806 * iterators.cs (Yield.CheckContext): Add error 1629.
14807 (Iterator.ctor): Save unsafe modifier.
14808 (MoveNextMethod.DoEmit): Restore unsafe context.
14810 * namespace.cs (UsingAlias): Better error message.
14812 2005-03-03 Dan Winship <danw@novell.com>
14814 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
14815 the warning message [#73219]
14817 2005-03-03 Raja R Harinath <rharinath@novell.com>
14819 Fix compile with MCS 1.0.0.0.
14820 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
14821 w_restore to not depend on string constant folding.
14823 2005-03-03 Raja R Harinath <rharinath@novell.com>
14825 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
14826 CS0246 check to users who passed 'silent = false'.
14827 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
14829 (SimpleName.SimpleNameResolve): Update.
14830 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
14831 (MemberAccess.IdenticalNameAndTypeName): Update.
14832 * doc.cs (FindDocumentedTypeNonArray): Update.
14834 2005-03-03 Raja R Harinath <rharinath@novell.com>
14836 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
14837 * parameters.cs (ComputeAndDefineParameters): Remove.
14838 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
14839 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
14840 Use GetParameterInfo.
14842 2005-03-02 Marek Safar <marek.safar@seznam.cz>
14844 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
14846 2005-03-02 Raja R Harinath <rharinath@novell.com>
14848 Unify DeclSpace.LookupType and DeclSpace.FindType.
14849 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
14850 is in charge of defining nested types on demand.
14851 (DeclSpace.LookupType): Use it when the current_type is a
14852 TypeBuilder. Use LookupTypeDirect for reflected types.
14853 (DeclSpace.FindType): Remove.
14854 (DeclSpace.LookupInterfaceOrClass): Likewise.
14855 (DeclSpace.DefineTypeAndParents): Likewise.
14856 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
14857 DeclSpace.LookupType.
14858 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
14859 * typemanager.cs (LookupType): Simplify.
14860 (AddUserType): Remove type from negative_hits.
14861 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
14862 * class.cs (TypeContainer.FindMembers): Move handling of nested
14864 (TypeContainer.FindMembers_NestedTypes): ... here.
14865 (TypeContainer.FindNestedType): Implement override.
14866 (ClassPart.FindNestedType): Delegate to PartialContainer.
14867 (ClassPart.PartFindNestedType): Looks up the nested types of the
14870 2005-03-02 Martin Baulig <martin@ximian.com>
14872 * class.cs (TypeContainer.DoDefineMembers): We also need a default
14873 static constructor in static classes.
14875 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
14877 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
14878 sizeParamIndex is not specified.
14880 2005-03-01 Marek Safar <marek.safar@seznam.cz>
14883 * report.cs (WarningMessage.IsEnabled): Missing null check.
14885 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14887 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
14888 in the fields and not in the properties.
14890 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
14892 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
14895 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14897 * attribute.cs: Small refactoring (improved robustness).
14898 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
14899 (ValidateGuid): Removed.
14900 (Resolve): Removed referenced to above mentioned.
14901 (GetAttributeUsage): Made private and changed to work without
14903 (GetIndexerAttributeValue): Don't crash.
14904 (GetConditionalAttributeValue): Ditto.
14905 (GetClsCompliantAttributeValue): Ditto.
14906 (ExtractSecurityPermissionSet): All attributes exceptions are
14908 (GetPropertyValue): New helper.
14909 (GetMethodImplOptions): New method.
14910 (DefinePInvokeMethod): Reuse common code. Implemented handling of
14911 some missing properties.
14913 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
14914 (Method.ApplyAttributeBuilder): Updated.
14916 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
14919 2005-02-28 Raja R Harinath <rharinath@novell.com>
14922 * report.cs (Report.SymbolRelatedToPreviousError): Handle
14923 non-simple types (array, pointer, reference).
14925 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14927 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
14929 * class.cs (MethodCore.IsDuplicateImplementation): Special error
14931 (Method.CheckBase): Catch wrong destructor here.
14932 (MethodData.Define): Add errors 550, 668.
14934 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
14936 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
14938 * pending.cs (VerifyPendingMethods): Add error 551.
14940 * typemanager.cs (CSharpName): Next error report helper.
14942 2005-02-25 Marek Safar <marek.safar@seznam.cz>
14944 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
14945 attributes. Removed useless attribute double check.
14946 It saves almost 2MBs for corlib.
14948 2005-02-25 Raja R Harinath <rharinath@novell.com>
14951 * statement.cs (ExpressionStatement.Resolve): Make robust to being
14952 called twice in case of error.
14954 2005-02-23 Chris Toshok <toshok@ximian.com>
14956 Fix compiler portions of #72827.
14957 * statement.cs (Block.Emit): call Begin/EndScope on the
14958 EmitContext instead of the ILGenerator.
14960 * codegen.cs (EmitContext.BeginScope): new method, call
14961 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
14963 (EmitContext.BeginScope): same, but EndScope and CloseScope
14965 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
14966 offset and call the superclass's OpenScope(int) with it.
14967 (SymbolWriter.CloseScope): get the current il
14968 offset and call superclass's CloseScope(int) with it.
14970 2005-02-23 Marek Safar <marek.safar@seznam.cz>
14972 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
14973 CS1677 for out and ref as well.
14975 * class.cs (Method.Define): Add error CS1599 detection.
14977 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
14979 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
14981 * delegate.cs (Delegate.Define): Add error CS1599 detection.
14983 * support.cs.cs (ModifierDesc): New helper method.
14985 2005-02-23 Raja R Harinath <rharinath@novell.com>
14986 Abin Thomas <projectmonokochi@rediffmail.com>
14987 Anoob V E <projectmonokochi@rediffmail.com>
14988 Harilal P R <projectmonokochi@rediffmail.com>
14990 Fix #57851, #72718.
14991 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
14992 MemberLookup (used for error reporting) actually returns a result.
14993 Fix error report number (122, not 112).
14995 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
14996 Anoob V E <projectmonokochi@rediffmail.com>
14997 Harilal P R <projectmonokochi@rediffmail.com>
15000 * pending.cs (PendingImplementation.GetAbstractMethods):
15001 Find NonPublic members too.
15003 2005-02-22 Marek Safar <marek.safar@seznam.cz>
15005 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
15008 * class.cs (MethodCore.CheckMethodAgainstBase):
15009 Add error 239 report.
15011 2005-02-21 Raja R Harinath <rharinath@novell.com>
15014 * expression.cs (Invocation.IsApplicable): Make public.
15015 (Invocation.IsParamsMethodApplicable): Likewise.
15016 * delegate.cs (Delegate.VerifyApplicability): Don't use
15017 Invocation.VerifyArgumentCompat for parameter applicability
15018 testing. Use Invocation.IsApplicable and
15019 Invocation.IsParamsMethodApplicable.
15021 2005-02-21 Marek Safar <marek.safar@seznam.cz>
15023 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
15025 * class.cs (Operator.Define): Add error 217 report.
15027 2005-02-21 Raja R Harinath <rharinath@novell.com>
15029 * namespace.cs (UsingEntry.Resolve): Undo change below.
15031 2005-02-21 Raja R Harinath <rharinath@novell.com>
15034 * ecore.cs (Expression.MemberLookupFailed): Add argument to
15035 disable the error message when the extended MemberLookup also
15037 (Expression.MemberLookupFinal): Update.
15038 (SimpleName.DoSimpleNameResolve): Update.
15039 * expression.cs (MemberAccess.ResolveNamespaceOrType):
15040 Don't use MemberLookupFinal.
15041 (New.DoResolve): Update.
15042 (BaseAccess.CommonResolve): Update.
15044 2005-02-21 Raja R Harinath <rharinath@novell.com>
15047 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
15048 occured previously, don't resolve again.
15050 2005-02-21 Marek Safar <marek.safar@seznam.cz>
15053 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
15054 argument. Call ResolveAttributeUsage for unresolved.
15055 when types doesn't match ctor arguments.
15057 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
15058 for nested attribute classes.
15059 (Class.attribute_usage): Removed.
15060 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
15061 for attribute class.
15063 * ecore.cs (IsAttribute): Removed.
15065 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
15067 * rootcontext.cs (RegisterAttribute): Removed, attributes are
15069 (attribute_types): Removed.
15070 (EmitCode): Global attributes are emited as the latest.
15072 2005-02-18 Marek Safar <marek.safar@seznam.cz>
15074 * class.cs (EmitFieldInitializers): Don't emit field initializer
15075 for default values when optimilization is on.
15077 * constant.cs (Constant.IsDefaultValue): New property.
15079 * driver.cs: Add /optimize handling.
15083 * literal.cs: Implement new IsDefaultValue property.
15085 * rootcontext.cs (Optimize): New field, holds /optimize option.
15087 2005-02-18 Raja R Harinath <rharinath@novell.com>
15089 Fix crasher in re-opened #72347.
15090 * namespace.cs (Namespace.Lookup): Return null if
15091 DeclSpace.DefineType returns null.
15094 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
15096 2005-02-18 Raja R Harinath <rharinath@novell.com>
15098 Fix remainder of #63202. Change semantics of DoResolveLValue: it
15099 now returns null if it cannot resolve to an lvalue.
15100 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
15101 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
15102 returned null. Remove check for SimpleName.
15103 (EventExpr.DoResolveLValue): New.
15104 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
15105 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
15107 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
15108 avoid CS0131 error.
15109 (Unary.ResolveOperator): Move CS0211 check ...
15110 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
15112 (Unary.DoResolveLValue): Simplify.
15113 (AddressOf.DoResolveLValue): New.
15114 (ArrayAccess.DoResolveLValue): New.
15116 2005-02-16 Marek Safar <marek.safar@seznam.cz>
15118 * attribute.cs (Attribute.Resolve): Add arguments casting for
15119 when types doesn't match ctor arguments.
15121 2005-02-16 Raja R Harinath <rharinath@novell.com>
15123 Fix parts of #63202.
15124 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
15125 lookup of operator in base type. Ensure that all checks happen
15126 when the operator resolves to an "op_..." method.
15128 2005-02-15 Raja R Harinath <rharinath@novell.com>
15131 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
15132 'ignore_cs0104' parameter. Pass it to ...
15133 (NamespaceEntry.Lookup): ... this.
15134 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
15135 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
15136 (TypeLookupExpression.DoResolveAsTypeStep): Update.
15137 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
15138 Update. Request that cs0104 errors be ignored.
15139 (ComposedCast.ResolveAsTypeStep): Update.
15141 2005-02-14 Raja R Harinath <rharinath@novell.com>
15144 * expression.cs (Invocation.BetterFunction): Remove support for
15145 comparing virtual functions and their overrides.
15146 (Invocation.IsOverride): New.
15147 (Invocation.OverloadResolve): Don't consider 'override' functions
15148 during candidate selection. Store them in a lookaside list.
15149 If the selected method is a 'virtual' function, use the list to
15150 find any overrides that are closer to the LHS type.
15152 2005-02-14 Marek Safar <marek.safar@seznam.cz>
15154 * expression.cs (New.DoResolve): Add complex core type reduction.
15155 (New.Constantify): Converts complex core type syntax like 'new int ()'
15156 to simple constant.
15158 2005-02-14 Raja R Harinath <rharinath@novell.com>
15160 * decl.cs (EntryType.EntryType): New constructor to create an
15161 updated copy of a cache entry.
15162 (MemberCache.AddMethods): Use it.
15163 (MemberCache.ClearDeclaredOnly): Remove.
15164 (MemberCache.MemberCache): Update.
15166 2005-02-11 Miguel de Icaza <miguel@novell.com>
15168 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
15169 variable. This one is represents the actual low-level declaration
15170 of the method, as opposed to the semantic level `IsStatic'.
15172 An anonymous method which is hosted into a static method might be
15173 actually an instance method. IsStatic would reflect the
15174 container, while MethodIsStatic represents the actual code
15177 * expression.cs (ParameterReference): Use the new MethodIsStatic
15178 instead of IsStatic.
15180 * anonymous.cs (AnonymousMethod.Compatible): Pass the
15181 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
15182 set on the current EmitContext.
15184 * expression.cs (Cast): Overload DoResolveLValue so we can pass
15185 resolve our casted expression as an LValue. This triggers the
15186 proper LValue processing that is later required by Assign.
15190 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
15192 2005-02-11 Marek Safar <marek.safar@seznam.cz>
15194 C# 2.0 Fixed buffer implementation
15196 * anonymous.cs: Update after RegisterHelperClass renaming.
15198 * attribute.cs (AttributeTester.fixed_buffer_cache):
15199 Cache of external fixed buffers.
15200 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
15201 implementation if field is fixed buffer else null.
15204 (TypeContainer.AddField): Accept FieldMember instead of Field.
15205 (FieldBase.IsFieldClsCompliant): Extracted code from
15206 VerifyClsCompliance descendant customization.
15207 (FixedField): New class handles fixed buffer fields.
15208 (FixedFieldExternal): Keeps information about imported fixed
15210 (IFixedField): Make access to internal or external fixed buffer
15213 * cs-parser.jay: Add fixed buffer parsing.
15215 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
15218 * expression.cs (Indirection): Extended implementation to accept
15219 fixed buffer field.
15220 (PointerArithmetic.Emit): Get element from fixed buffer as well.
15221 (ElementAccess.MakePointerAccess): Get type as parameter.
15222 (DoResolve): Add fixed buffer field expression conversion.
15223 (DoResolveLValue): Ditto.
15224 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
15225 (ArrayPtr): Derives from FixedBufferPtr.
15226 (ArrayPtr.Emit): Add extra emit for array elements.
15228 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
15230 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
15231 for compiler generated types.
15232 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
15234 * statement.cs (Fixed): Refactored to be easier add fixed buffer
15235 and consume less memory.
15236 (Fixed.Resolve): Add fixed buffer case.
15238 * typemanager.cs (compiler_generated_attr_ctor,
15239 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
15240 (HasElementType): Add our own implementation to work on every
15243 2005-02-11 Miguel de Icaza <miguel@novell.com>
15245 * anonymous.cs (CaptureContext): Track whether `this' has been
15248 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
15249 only captured `this' if it was implicitly done (instance
15250 methods/variables were used).
15252 * codegen.cs (EmitContext.CaptureThis): New method to flag that
15253 `this' must be captured.
15255 2005-01-30 Miguel de Icaza <miguel@novell.com>
15257 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
15258 is null it means that there has been no need to capture anything,
15259 so we just create a sibling.
15261 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
15263 Just a partial fix. The other half is fairly elusive.
15265 2005-02-10 Raja R Harinath <rharinath@novell.com>
15267 Fix #52586, cs0121-4.cs.
15268 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
15269 and return a hashtable.
15270 (MemberCache.ClearDeclaredOnly): New.
15271 (MemberCache.MemberCache): Update to change. Make a deep copy of
15272 the method_hash of a base type too.
15273 (MemberCache.AddMethods): Adapt to having a deep copy of the base
15274 type methods. Overwrite entries with the same MethodHandle so
15275 that the ReflectedType is correct. The process leaves in base
15276 virtual functions and their overrides as distinct entries.
15277 (CacheEntry): Now a class instead of a struct. It shouldn't alter
15278 matters since it was boxed in a ArrayList before.
15279 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
15281 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
15282 case of a virtual function and its override (choose the overload
15284 (Invocation.OverloadResolve): Avoid 'override' members during
15285 'applicable_type' calculation.
15287 2005-02-09 Raja R Harinath <rharinath@novell.com>
15289 Combine two near-redundant caches.
15290 * typemanager.cs (method_params): Rename from method_internal_params.
15291 (TypeManager.GetParameterData): New. Replace
15292 Invocation.GetParameterData.
15293 (TypeManager.LookupParametersByBuilder): Remove.
15294 * expression.cs (Invocation.method_parameter_cache): Remove.
15295 (Invocation.GetParameterData): Remove.
15297 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
15300 2005-02-08 Raja R Harinath <rharinath@novell.com>
15303 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
15304 TypeManager.multicast_delegate_type is null, resolve it by looking
15305 up "System.MulticastDelegate".
15306 * rootcontext.cs (RootContext.ResolveCore): Simplify.
15308 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
15309 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
15310 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
15313 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
15314 (LabeledStatement.AddReference): New. Set 'referenced'.
15315 (Goto.Resolve): Use it.
15317 2005-02-05 John Luke <john.luke@gmail.com>
15319 * driver.cs: remove duplicate -doc line in Usage ()
15321 2005-02-04 Raja R Harinath <rharinath@novell.com>
15323 * location.cs (Location.AddFile): Fix CS2002 error report.
15325 2005-02-02 Martin Baulig <martin@ximian.com>
15327 * delegate.cs (Delegate.DefineType): Report an internal error if
15328 TypeManager.multicast_delegate_type is null. See bug #72015 for
15331 2005-02-02 Raja R Harinath <rharinath@novell.com>
15333 Fix a crasher in a variant of #31984.
15334 * const.cs (Constant.CheckBase): New override that defers the
15335 new-or-override check in case the base type hasn't been populated
15337 (Constant.Define): Ensure the new-or-override check is performed.
15339 2005-02-01 Duncan Mak <duncan@ximian.com>
15341 * const.cs (LookupConstantValue): Check that `ce' is not null
15342 before calling GetValue ().
15344 2005-02-01 Raja R Harinath <rharinath@novell.com>
15346 Fix test-334.cs (#69519).
15347 * cs-parser.jay (using_alias_directive): Pass in an expression to
15348 NamespaceEntry.UsingAlias.
15349 (using_namespace_directive): Pass in an expression to
15350 NamespaceEntry.Using.
15351 (namespace_name): Don't flatten to a string.
15352 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
15353 (NamespaceEntry.AliasEntry.Resolve): Lookup using
15355 (NamespaceEntry.UsingEntry): Likewise.
15356 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
15358 (NamespaceEntry.LookupForUsing): Remove.
15359 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
15361 (NamespaceEntry.Lookup): Remove support for dotted names.
15363 2005-02-01 Raja R Harinath <rharinath@novell.com>
15365 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
15367 (NamespaceEntry.ImplicitParent): Compute on demand.
15368 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
15369 parallels the current.
15370 (NamespaceEntry.LookupForUsing): Use it.
15371 (NamespaceEntry.Lookup): If the current namespace-entry is
15372 implicit, don't search aliases and using tables.
15374 2005-02-01 Raja R Harinath <rharinath@novell.com>
15377 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
15379 (TypeContainer.BaseCache): Compute on demand.
15380 (TypeContainer.FindMembers): Define constants and types if they're
15381 not already created.
15382 (FieldMember.Define): Move resetting of ec.InUnsafe before error
15384 * const.cs (Constant.Define): Make idempotent.
15386 2005-01-29 Miguel de Icaza <miguel@novell.com>
15388 * pending.cs: Produce better code (no nops produced by using Ldarg
15391 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
15392 i - 1' it should be arg + 1.
15396 2005-01-28 Raja R Harinath <rharinath@novell.com>
15398 * attribute.cs (Attribute.CheckAttributeType): Make private
15400 (Attribute.ResolveType): Make virtual.
15401 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
15402 handling of RootContext.Tree.Types.
15404 2005-01-27 Raja R Harinath <rharinath@novell.com>
15406 Update attribute-handling to use the SimpleName/MemberAccess
15408 * cs-parser.jay (attribute): Pass in an expression to the
15409 constructors of Attribute and GlobalAttribute.
15410 * attribute.cs (Attribute): Take an expression for the name.
15411 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
15412 passed in attribute name expression.
15413 (Attribute.CheckAttributeType): Use it.
15414 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
15415 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
15416 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
15417 argument to prevent error messages if the lookup fails.
15419 2005-01-27 Marek Safar <marek.safar@seznam.cz>
15421 * expression.cs (Indirection): Implemented IVariable interface
15422 to support indirection in AddressOf operator.
15423 (PointerArithmetic.Emit): Add optimalization for case where
15424 result can be precomputed.
15426 2005-01-26 Martin Baulig <martin@ximian.com>
15428 * class.cs (TypeContainer.AttributeTargets): Return the correct
15429 AttributeTargets depending on our `Kind' instead of throwing an
15430 exception; fixes #71632.
15432 2005-01-26 Marek Safar <marek.safar@seznam.cz>
15435 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
15438 2005-01-25 Raja R Harinath <rharinath@novell.com>
15441 * expression.cs (MemberAccess.DoResolve): Don't complain with
15442 cs0572 when the LHS of a member access has identical name and type
15445 2005-01-25 Marek Safar <marek.safar@seznam.cz>
15448 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
15450 Create custom PermissionSet only for PermissionSetAttribute.
15452 2005-01-24 Marek Safar <marek.safar@seznam.cz>
15455 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
15456 delegates in static class.
15458 2005-01-24 Martin Baulig <martin@ximian.com>
15460 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15461 merging an implicit block, just use its reachability.
15463 * statement.cs (Block.Resolve): Make the unreachable code check
15464 work wrt. implicit blocks; see test-337 from #63842.
15466 2005-01-21 Alp Toker <alp@atoker.com>
15468 * cs-parser.jay: destructor_declaration's container is PartialContainer
15469 not Class when partial types are used, so use Kind prop instead of
15472 2005-01-22 Miguel de Icaza <miguel@ximian.com>
15474 * cs-parser.jay: Improve error reporting when an interface
15475 declares new types.
15477 2005-01-20 Dick Porter <dick@ximian.com>
15479 * support.cs: SeekableStreamReader fix from Sandor Dobos
15480 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
15481 chars are read. Fixes bug 70369.
15483 2005-01-20 Raja R Harinath <rharinath@novell.com>
15485 * cs-parser.jay (catch_clause): Simplify current_block handling
15488 2005-01-17 Miguel de Icaza <miguel@ximian.com>
15490 * convert.cs (ImplicitStandardConversionExists): Synchronize the
15491 code with ImplicitStandardConversion to handle the implicit
15492 conversion of method groups into valid delegate invocations.
15494 The problem is that in parameter handling we were using this code
15495 path. Fixes bug #64698
15497 2005-01-19 Raja R Harinath <rharinath@novell.com>
15499 * cs-parser.jay: Fix several infelicities.
15500 - Avoid assigning to the parser value stack. Code like
15501 '$3 = null' is unclean. Synthesize a value for the code block
15503 - Avoid using oob_stack for storing location information. Use ...
15504 (_mark_): ... this. New (empty) rule. Saves the current location
15506 (foreach_statement): Avoid using oob_stack for current_block
15507 handling. Use technique used in for_statement and
15508 using_statement. Synthesize a value for the code block to store
15509 additional intermediate information.
15511 2005-01-13 Miguel de Icaza <miguel@ximian.com>
15513 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
15514 of a different type is only allowed to private fields of a
15515 containing type, not on fields of a base class.
15517 See test-174.cs and error cs0122-9.cs
15519 2005-01-13 Raja R Harinath <rharinath@novell.com>
15521 Fix test-335.cs (bug #58126).
15522 * cs-parser.jay (argument): Split out non-expression parts of the
15523 rule into 'non_simple_argument'.
15524 (invocation_expression): Support parenthesized invocations with
15525 multiple arguments, and with single non-simple arguments.
15527 2005-01-13 Raja R Harinath <rharinath@novell.com>
15529 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
15532 2005-01-12 Raja R Harinath <rharinath@novell.com>
15534 Fix cs0038-1.cs, cs1640-6.cs.
15535 * ecore.cs (Expression.Resolve): Remove special-case for
15536 SimpleName in error-handling.
15537 (Expression.almostMatchedMembers): Relax access permission to
15539 (Expression.MemberLookupFailed): Handle duplicates in
15540 almostMatchedMembers list.
15541 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
15542 * expression.cs (New.DoResolve): Report CS1540 for more cases.
15543 * typemanager.cs (GetFullNameSignature): Use the MethodBase
15544 overload if the passed in MemberInfo is a MethodBase.
15546 2005-01-12 Marek Safar <marek.safar@seznam.cz>
15549 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
15550 for non-CAS & merge permission sets properly.
15552 2005-01-11 Raja R Harinath <rharinath@novell.com>
15554 Improve standard-compliance of simple name and member access
15555 resolution. Fixes bugs #52697, #57200, #67520, #69519.
15556 * ecore.cs (FullNamedExpression): New abstract base class
15557 for Namespaces and TypeExpressions.
15558 (ResolveFlags.SimpleName): Remove.
15559 (SimpleName): Remove support for dotted names.
15560 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
15561 DeclSpace.FindType and DeclSpace.LookupType.
15562 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
15563 (Expression.ExprClassName): Make member function.
15564 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
15565 a namespace. Remove creation of dotted "SimpleName"s.
15566 (MemberAccess.DoResolve): Likewise.
15567 * decl.cs (DeclSpace.Cache): Make private.
15568 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
15569 (DeclSpace.FindType): Update.
15570 (DeclSpace.LookupType): Move here from RootContext. Return a
15571 FullNamedExpression.
15572 * namespace.cs (Namespace): Derive from FullNamedExpression
15573 so that it can be part of expression resolution.
15574 (Namespace.Lookup): Return an FullNamedExpression.
15575 (NamespaceEntry.LookupAlias): Lookup aliases only in current
15577 * rootcontext.cs (NamespaceLookup): Remove.
15578 (LookupType): Move to DeclSpace.
15579 * attribute.cs (CheckAttributeType): Update.
15580 * doc.cs (FindDocumentedType): Remove allowAlias argument.
15581 (FindDocumentedTypeNonArray): Likewise.
15583 2005-01-11 Raja R Harinath <rharinath@novell.com>
15585 Fix cs0509.cs, cs1632.cs.
15586 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
15587 is the same as IsInterface.
15588 (TypeContainer.GetClassBases): Likewise.
15589 * statement.cs (LabeledStatement.ig): New field.
15590 (LabeledStatement.LabelTarget): Save ILGenerator which created the
15592 (LabeledStatement.DoEmit): Check that the label was created with
15593 the same ILGenerator.
15595 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15598 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
15599 accessors to its properties.
15601 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
15602 from accessors to property.
15604 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15607 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
15608 only for overrides.
15610 2005-01-08 Miguel de Icaza <miguel@ximian.com>
15612 * attribute.cs: Check for null and empty strings.
15614 I have lost another battle to Paolo.
15616 2005-01-07 Marek Safar <marek.safar@seznam.cz>
15619 * class.cs (PropertyMethod): Set Parent field in ctors.
15620 (SetMethod.InternalParameters): Add unsafe switch hack.
15621 Override MarkForDuplicationCheck where it is appropriate.
15623 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
15624 It says whether container allows members with the same name.
15625 Base default is no.
15626 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
15627 Removed is_method parameter.
15629 2005-01-06 Duncan Mak <duncan@ximian.com>
15631 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
15632 because the previous change led to incorrect reporting of CS1032
15633 ("Cannot define/undefine preprocessor symbols after first token in
15634 file"). Instead of using `tokens_seen' as the only flag that
15635 triggers CS1040, introduce `comments_seen'. This new flag is used
15636 to signify having seen comments on the current line, so it is
15637 unset after a newline.
15639 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15641 * doc.cs : When searching for a type, find nested type too.
15642 This fixes bug #71040.
15644 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15647 - Warn missing member comment on those classes which also does not
15648 have doc comments. Fixed bug #71041.
15649 - Don't warn missing doc comment on default constructor.
15652 2005-01-06 Duncan Mak <duncan@ximian.com>
15654 * cs-tokenizer.cs (xtoken): After handling traditional C-style
15655 comments, set `tokens_seen' to true. This allows us to detect
15656 misplaced preprocessor directives (i.e. not at the beginning of
15657 the a line, nor after whitespaces). In that case, report error
15658 CS1040. This fixes bug #56460.
15660 * cs-parser.jay (interface_member_declaration): Add checks for
15661 IsExplicitImpl, and report CS0541 error if an interface member is
15662 defined as an explicit interface declaration.
15664 2005-01-06 Marek Safar <marek.safar@seznam.cz>
15667 * class.cs (PropertyMethod): Set Parent field in ctors.
15668 (SetMethod.InternalParameters): Add unsafe switch hack.
15670 * decl.cs (MemberCore.Parent): Cannot be readonly.
15672 2005-01-06 Raja R Harinath <rharinath@novell.com>
15674 * decl.cs (DeclSpace.ResolveType): Remove.
15675 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
15676 Merge in code from ...
15677 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
15678 * class.cs, enum.cs: Update to changes.
15680 2005-01-06 Miguel de Icaza <miguel@ximian.com>
15682 * anonymous.cs: Ensure that we init the scope of our parent if it
15683 has not been initialized yet.
15685 2004-12-30 Duncan Mak <duncan@ximian.com>
15687 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
15688 if field.FieldBuilder is null. Fixes #70758.
15690 * convert.cs: Fixed some typos and updated some of the comments.
15691 (ImplicitStandardConversionExists):
15692 (TryImplicitIntConversion): If `target_type' is an interface and
15693 the type of `ic' implements this interface, return true or a new
15694 BoxedCast instead of null. This fixes #70468.
15696 2004-12-29 Duncan Mak <duncan@ximian.com>
15698 * expression.cs (Argument.Emit): Check that Expr is
15699 IMemoryLocation before casting to it, and report CS1510 otherwise.
15703 2004-12-21 Ben Maurer <bmaurer@ximian.com>
15705 * statement.cs (Block.ThisVariable): remove the recursion here, to
15706 make the --profile more sane.
15708 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
15710 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
15711 assembly, by JB Evain.
15713 2004-12-17 Raja R Harinath <rharinath@novell.com>
15715 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
15716 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
15717 "parent" refers to enclosing type/class. "base" refers to superclass.
15719 2004-12-17 Raja R Harinath <rharinath@novell.com>
15721 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15722 Ensure that we only have GlobalAttributes.
15723 * attribute.cs (Attribute.Emit): Make non-virtual.
15724 (GlobalAttribute.Emit): Remove.
15725 (Attribute.Resolve): Make virtual.
15726 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
15727 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
15728 the argument. Don't create one.
15729 (Attribute.GetObsoleteAttribute): Likewise.
15730 (Attribute.GetClsCompliantAttributeValue): Likewise.
15731 * class.cs, decl.cs: Update to changes.
15733 2004-12-17 Marek Safar <marek.safar@seznam.cz>
15735 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
15737 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
15739 * statement.cs (Foreach.Resolve): Add error 186 report.
15741 2004-12-16 Marek Safar <marek.safar@seznam.cz>
15743 * expression.cs (Conditional.DoResolve): Add warning 429.
15745 * statement.cs (If.Resolve): Add warning 665.
15747 2004-12-16 Raja R Harinath <rharinath@novell.com>
15749 New invariant: RootContext.Tree.Types.NamespaceEntry == null
15750 except when in the parser, and in GlobalAttribute.
15751 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
15752 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
15753 RootContext.Tree.Types.NamespaceEntry once work is done.
15754 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
15755 and resets RootContext.Tree.Types.NamespaceEntry.
15757 2004-12-15 Marek Safar <marek.safar@seznam.cz>
15759 * cs-parser.jay: Don't create a block for every variable.
15761 2004-12-14 Miguel de Icaza <miguel@ximian.com>
15763 * location.cs: Provide extra information.
15765 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
15766 variables from the captured environment, it is the ldarg_0.
15768 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15770 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
15773 * class.cs: Changed warning level for 169 to avoid developer
15774 displeasure from warning flooding. It will be changed back when they
15775 fix most of current BCL warnings.
15777 * RootContext.cs: Pushed default WarningLevel to 3.
15779 * statement.cs: Removed unused variable.
15781 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15783 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
15784 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
15785 Add error 502 report.
15786 (StaticClass.DefineType): Add error 441 report.
15787 (Class.AllowedModifiersProp): New virtual property as temporary
15788 extension to AllowedModifiers.
15789 (Class.DefineType): Add error 418 report. Moved ModFlags check here
15790 to share implementation with StaticClass and don't call virtual
15793 * driver.cs (MainDriver): Add error 1558 test.
15795 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
15796 report. Moved error 36 test here.
15798 * statement.cs (Throw.Resolve): Add error 724 report.
15800 * typemanager.cs: Add out_attribute_type core type.
15802 2004-12-13 Marek Safar <marek.safar@seznam.cz>
15804 * class.cs (TypeContainer.VerifyClsCompliance): Add error
15806 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
15808 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
15811 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
15813 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
15814 Add error 3023 report.
15815 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
15817 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
15820 2004-12-12 John Luke <john.luke@gmail.com>
15822 * driver.cs (AddArgs): take -- into account when
15823 adding arguments, fixes bug 65710
15825 2004-12-12 Martin Baulig <martin@ximian.com>
15827 * expression.cs (Unary.TryReduceNegative): Added support for
15828 SByteConstant and ByteConstant.
15829 (Unary.Reduce): Check error values from TryReduceNegative().
15831 2004-12-10 Marek Safar <marek.safar@seznam.cz>
15833 * attributes.cs (Attribute.Resolve): Avoid multiple error report
15834 and report exception as error 182.
15836 2004-12-10 Raja R Harinath <rharinath@novell.com>
15838 * driver.cs (Main): Fix message when there are warnings.
15840 2004-12-09 Miguel de Icaza <miguel@ximian.com>
15842 * delegate.cs: Fixed my fix from yesterday, sorry about that.
15844 2004-12-09 Marek Safar <marek.safar@seznam.cz>
15846 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
15847 Reduced number of warnings.
15849 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
15851 2004-12-08 Miguel de Icaza <miguel@ximian.com>
15853 * driver.cs: Removed message.
15855 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
15857 2004-12-08 <vargaz@freemail.hu>
15859 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
15861 2004-12-08 Martin Baulig <martin@ximian.com>
15863 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
15864 instead of a CS3002 for properties and indexer.
15866 2004-12-08 Martin Baulig <martin@ximian.com>
15868 * decl.cs (MemberName.ToString): Make this work again.
15870 2004-12-08 Marek Safar <marek.safar@seznam.cz>
15872 * attribute.cs (Resolve): Add error 591 detection.
15874 * class.cs (FieldMember.Define): Add error 1547 detection.
15875 (Indexer.Define): Add error 620 detection.
15876 (Operator.Define): Add error 590 detection.
15878 * ecore.cs: Missing argument for error 79.
15880 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
15883 2004-12-07 Marek Safar <marek.safar@seznam.cz>
15886 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
15889 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
15891 * cs-parser.jay : handle doc comments on implicit/explicit operators.
15892 Some operator comments were suppressed.
15893 * doc.cs : Implicit/explicit operator name in doc comments are like
15894 "op_Explicit(type)~returnType", so added suffix handling.
15896 2004-12-07 Martin Baulig <martin@ximian.com>
15899 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
15900 (MemberCore.GetClsCompliantAttributeValue): Likewise.
15901 (DeclSpace.ec): New protected field; store the EmitContext here.
15902 (DeclSpace.EmitContext): New public property; moved here from
15904 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
15907 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
15908 (Enum.Emit): Don't create a new EmitContext.
15910 * delegate.cs (Delegate.DefineType): Always create the
15913 * iterators.cs (Iterators.DefineIterator): Create a new
15914 EmitContext and store it in `ec'.
15916 2004-08-24 Martin Baulig <martin@ximian.com>
15919 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
15920 this for accessibility checks.
15921 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
15922 IsNestedFamilyAccessible.
15923 (TypeManager.IsSubclassOf): New method, do what the name actually
15926 2004-12-06 Raja R Harinath <rharinath@novell.com>
15928 Fix crash on cs0657-17.cs.
15929 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15930 Use RootContext.Tree.Types, not 'new RootTypes ()'.
15931 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
15932 the case where the NamespaceEntry gets overwritten.
15934 2004-12-06 Marek Safar <marek.safar@seznam.cz>
15936 Fixed #69195, #56821
15937 * ecore.cs (ResolveBoolean): Tiny refactoring.
15939 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
15940 of right expression resolving when left is false constant and
15941 operator is LogicalAnd OR true constant and operator is LogicalOr.
15943 * statement.cs (ResolveUnreachable): Always reports warning.
15945 2004-12-05 Miguel de Icaza <miguel@ximian.com>
15947 * class.cs: Distinguish between 1721 and 1722 (just a little help
15948 for the programmer).
15950 2004-12-03 Miguel de Icaza <miguel@ximian.com>
15952 * delegate.cs: Only allow this on new versions of the language.
15954 2004-12-02 Duncan Mak <duncan@ximian.com>
15956 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
15958 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
15959 here as a static method. Take an additional bool out parameter
15960 `must_do_cs1540_check' for signaling to InstanceResolve.
15961 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
15962 member field from PropertyExpr class and made it an argument of
15963 the method instead.
15964 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
15965 check for MarshalByRefObject, and report CS0122 instead of CS1540.
15966 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
15967 and `remove_accessor' as well as InstanceResolve: report CS0122
15972 2004-12-03 Raja R Harinath <rharinath@novell.com>
15974 Fix test-327.cs, test-328.cs, and put in early infrastructure
15975 for eventually fixing #52697.
15976 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
15977 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
15978 from other methods.
15979 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
15980 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
15981 (VerifyUsing, error246): Update.
15982 * rootcontext.cs (RootContext.NamespaceLookup): Just use
15983 'NamespaceEntry.LookupNamespaceOrType'.
15985 2004-12-03 Martin Baulig <martin@ximian.com>
15987 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
15988 method as our child, call AnonymousMethod.Compatible() on it.
15990 2004-12-03 Raja R Harinath <rharinath@novell.com>
15992 Disable XML documentation support in 'basic' profile.
15993 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
15994 Redirect XmlElement to System.Object.
15995 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
15996 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
15997 * mcs.exe.sources: Add doc-bootstrap.cs.
15998 * doc-bootstrap.cs: New file. Contains empty stub implementation
16001 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
16003 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
16004 comments are allowed.
16006 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16008 * delegate.cs: Add checks for subtypes in paramaters and return values
16009 in VerifyMethod () to add support for Covariance/Contravariance
16012 2004-12-02 Miguel de Icaza <miguel@ximian.com>
16014 * report.cs: Remove extra closing parenthesis.
16016 * convert.cs (Error_CannotImplicitConversion): If the name of the
16017 types are the same, provide some extra information.
16019 * class.cs (FieldBase): Use an unused bit field from the field to
16020 encode the `has_offset' property from the FieldMember. This saves
16021 a couple of Ks on bootstrap compilation.
16023 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
16024 method as our child, return the AnonymousMethod resolved
16027 * expression.cs (New.DoResolve): Allow return values from
16028 NewDelegate to also include AnonymousMethods.
16032 2004-12-02 Marek Safar <marek.safar@seznam.cz>
16035 * attribute.cs (Resolve): Improved implementation of params
16036 attribute arguments.
16038 * support.cs (ParameterData): Add HasParams to be faster.
16040 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
16042 all things are for /doc support:
16044 * doc.cs: new file that supports XML documentation generation.
16045 * mcs.exe.sources: added doc.cs.
16047 Handle /doc command line option.
16048 Report error 2006 instead of 5 for missing file name for /doc.
16049 Generate XML documentation when required, after type resolution.
16051 Added support for picking up documentation (/// and /** ... */),
16052 including a new XmlCommentState enumeration.
16054 Added lines to fill Documentation element for field, constant,
16055 property, indexer, method, constructor, destructor, operator, event
16056 and class, struct, interface, delegate, enum.
16057 Added lines to warn incorrect comment.
16059 Added Documentation field (passed only when /doc was specified).
16061 Added DocComment, DocCommentHeader, GenerateDocComment() and
16062 OnGenerateDocComment() and some supporting private members for
16063 /doc feature to MemberCore.
16065 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
16067 Added overriden DocCommentHeader.
16069 Added overriden DocCommentHeader and GenerateDocComment().
16071 2004-12-01 Miguel de Icaza <miguel@ximian.com>
16073 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
16074 unwrapping the enumeration values, chain to
16075 DoConstantNumericPromotions again, so we can promote things to the
16076 fundamental types (takes care of enums that are bytes, sbytes).
16080 2004-12-01 Raja R Harinath <rharinath@novell.com>
16082 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
16083 Fix long-standing bug in type-lookup. Use FindType instead of
16084 LookupType when ec.ResolvingTypeTree.
16085 (Attribute.ResolveType, Attribute.Resolve)
16086 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
16088 (Attributes.Search): Remove internal version. Update.
16089 (Attributes.SearchMulti): Update.
16090 (Attributes.GetClsCompliantAttribute): Remove.
16091 (Attributes.GetIndexerNameAttribute): Remove.
16092 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
16093 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
16094 * class.cs (Indexer.Define): Likewise.
16096 2004-12-01 Marek Safar <marek.safar@seznam.cz>
16099 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
16100 MarshallByReference members access.
16102 * expression.cs: Use CheckMarshallByRefAccess;
16103 Better error CS0197 message.
16105 * report.cs: Print whole related error message.
16107 2004-11-30 Raja R Harinath <rharinath@novell.com>
16109 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
16110 the current directory to help debugging.
16112 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16114 * class (GetClassBases): Better error 60 report.
16115 (EventProperty): Disabled warning 67 detection.
16117 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16120 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
16122 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
16125 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16128 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
16130 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
16132 2004-11-26 Miguel de Icaza <miguel@ximian.com>
16134 * attribute.cs (Attribute.Resolve): Refine error reporting and
16135 report a cs0117 if the identifier does not exist, to distinguish
16136 from 0617 which is a miss-use of the actual identifier.
16138 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
16139 between cs0070 and cs0079.
16141 * class.cs (MemberBase.DoDefine): When reporting a wrong
16142 accessibility level, we use MethodCore to compare instead of
16143 Method (this was a regression in some refactoring effort).
16145 So now we correctly report cs0056 again.
16147 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
16148 testing the target_type (which was known to be object_type) and
16149 not the source type (which is anonymous_method).
16151 Fixed reporting of error cs1660.
16153 * expression.cs (UserCast.Source): Expose the underlying cast.
16155 * statement.cs (Switch.SwitchGoverningType): Sort the list of
16156 allowed types to find a match to int32 first (most common).
16158 In addition, it ignores any ImplicitUserConversions that did an
16159 internal implicit conversion (as the switch statement allows only
16160 one integral conversion to exist).
16162 * class.cs (PartialContainer.Create): rename `name' to
16163 `member_name' for clarity. Then replace the string calls with a
16164 call to MemberName.GetPartialName, as now using
16165 MemberName.ToString is an error (this is due to the side effects
16166 it had, that were fixed in the past).
16168 This will restore the error reporting on a number of partial class
16169 errors that were missusing this (and getting an exception as a
16170 results, which is now just a plain textual warning, because
16171 yyparse debug output would crash otherwise).
16173 2004-11-26 Raja R Harinath <rharinath@novell.com>
16175 * Makefile (PROGRAM_INSTALL_DIR): Remove.
16177 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16179 * rootcontext.cs (LookupType): Make sure to cache lookups that
16180 don't give us a negative result. This saves about 5% of corlib
16183 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16185 * report.cs (AbstractMessage.Print): messages are sent to stderr
16187 * class.cs (TypeContainer.GetClassBases): It is an error to have a
16188 non-interface in the list of interfaces (at this point, either
16189 parent was properly set, or a base class is being listed in the
16190 interfaces section).
16192 This flags error 1722, and resolves the crash from bug 69259.
16194 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16196 * statement.cs (Using.EmitExpressionFinally): make this work right
16197 for valuetypes. Fixes 69926.
16199 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16201 * const.cs (Const.ChangeType): Cope with the "0 literal can be
16202 converted to an enum" here, before we try to change the underlying
16203 type. This code exists, but it is a different code path than the
16204 one used while encoding constants.
16206 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
16207 old bug: when converting from the null literal to a pointer,
16208 return an EmptyCast, not the NullLiteral.
16210 This fixes #69921, the recent null_type changes probably made this
16211 bug more prominent.
16213 (ImplicitReferenceConversionExists): In addition, resynchronized
16214 the code here, so it matches the same code in
16215 ImplicitReferenceConversionExists for the `from any class-type S
16216 to any interface-type T'.
16219 2004-11-25 Marek Safar <marek.safar@seznam.cz>
16221 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
16223 2004-11-24 Miguel de Icaza <miguel@ximian.com>
16225 * cs-parser.jay: Use verbosity accordingly.
16227 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16229 * expression.cs (Unary.ResolveOperator): Do not report warning;
16230 AddressOf reads from variable.
16232 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
16234 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16238 * attribute.cs (Attributable): Removed CheckTargets.
16239 (Attributes.Emit): Explicit attribute targets are tested here.
16241 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
16242 not enabled for interfaces.
16244 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
16245 (GetAssemblyName): Ouch next bug there.
16247 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16249 * expression.cs: Error 275 added.
16251 2004-11-23 Marek Safar <marek.safar@seznam.cz>
16253 Fix bug #69177 (Implemented decimal constant support)
16255 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
16256 (BinaryFold): Add DecimalConstant.
16258 * const.cs (Define): Decimal constant
16260 (ChangeType): Add decimal type handling.
16261 (LookupConstantValue): Don't set value for decimal type but
16262 emit DecimalConstantAttribute. Needed for constant optimization.
16264 * constant.cs (ToDecimal): New method.
16265 (ConvertToDecimal): New method.
16266 (IntConstant): Implemented ConvertToDecimal.
16267 (DecimalConstant.Emit): Emit optimized version for decimals in
16270 * expression.cs (ResolveOperator): Changed order of constant
16271 reduction to work correctly with native types which have
16272 overloaded operators.
16273 (ResolveMemberAccess): Extract constant value from attribute
16276 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
16278 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
16279 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
16280 (ChangeType): Decimal is special.
16281 (TypeToCoreType): Add decimal type.
16283 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16285 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
16288 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16290 * class.cs (EventField.ApplyAttributeBuilder): Fix error
16293 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16295 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
16297 * pending.cs (PendingImplementation): Grab only interfaces.
16299 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16301 * statement.cs (ForeachHelperMethods): Add location member and
16302 error 202 detection.
16304 2004-11-19 Raja R Harinath <rharinath@novell.com>
16306 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
16307 automatically handled by executable.make.
16308 (PROGRAM): Make profile-specific.
16310 2004-11-18 Marek Safar <marek.safar@seznam.cz>
16312 * expression.cs (DoResolveBase): Fixed wrong warning for out
16315 2004-11-18 Martin Baulig <martin@ximian.com>
16317 Merged latest changes into gmcs. Please keep this comment in
16318 here, it makes it easier for me to see what changed in MCS since
16319 the last time I merged.
16321 2004-11-17 Raja R Harinath <rharinath@novell.com>
16323 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
16324 (TypeHandle.GetMemberCache): New.
16325 (TypeHandle.TypeHandle): Update.
16326 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
16327 (TypeManager.LookupParentInterfacesCache):
16328 Rename from LookupInterfaceCache. Optimize slightly.
16329 (TypeManager.MemberLookup_FindMembers): Update.
16330 * decl.cs (MemberCache.MemberCache): Set Container to null in the
16331 multi-type variant.
16332 (AddCacheContents): Rename from AddHashtable.
16333 * class.cs (TypeContainer.parent_container): Remove.
16334 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
16335 (TypeContainer.DoDefineMembers): Don't initialize it.
16336 Update to name changes.
16338 2004-11-17 Miguel de Icaza <miguel@ximian.com>
16340 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
16341 that factors the code to check access modifiers on override.
16343 (PropertyBase): Use the code here.
16345 Patch from Lluis S'anchez, fixes bug #69361.
16347 2004-11-15 Miguel de Icaza <miguel@ximian.com>
16349 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
16350 routine that is used to report the use of a captured variable
16351 whose address has been taken.
16353 There are two checks: one when variables are being captured and
16354 the other check is when the address of a variable is taken.
16356 (because an anonymous methods might be resolved before *or* after
16357 the address has been taken) and
16359 * expression.cs (Conditional.DoResolve): Remove the special
16360 casing that Martin added to trueExpr and falseExpr being both
16361 NullLiteral. We get the right behavior now just by introducing
16362 the null_type into the compiler.
16364 * convert.cs (ExplicitConversion): Change the code to use
16365 null_type instead of testing `expr is NullLiteral'.
16366 (ImplicitConversionStandard): use null_type too.
16367 (ImplicitReferenceConversionExists): use null_type too.
16368 (ImplicitReferenceConversion): use null_type too.
16370 * literal.cs: The type of `NullLiteral' is now null_type instead
16372 (Resolve): Set the type here.
16374 * typemanager.cs: Introduce null_type.
16376 2004-11-17 Martin Baulig <martin@ximian.com>
16378 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
16379 direction, like FindMembers() does. Fixes #69546, testcase is in
16382 2004-11-16 Martin Baulig <martin@ximian.com>
16384 This is based on a patch from Marek Safar, see bug #69082.
16385 Fixes bugs #63705 and #67130.
16387 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
16388 method; create a MemberCache for an interface type and cache the
16391 * decl.cs (IMemberContainer.ParentContainer): Removed.
16392 (IMemberContainer.ParentCache): New property.
16393 (MemberCache.SetupCacheForInterface): Removed.
16394 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
16395 to create a cache for an interface's "parent".
16397 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
16400 2004-11-16 Martin Baulig <martin@ximian.com>
16402 Merged back from gmcs; these changes already went into gmcs a
16403 couple of weeks ago.
16406 (TypeManager.AddUserType): Removed the `ifaces' argument.
16407 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
16409 (TypeManager.AddUserInterface): Removed.
16410 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
16412 (TypeManager.GetInterfaces): Likewise.
16413 (TypeManager.GetExplicitInterfaces): Likewise.
16415 * ecore.cs (TypeExpr.GetInterfaces): Removed.
16417 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
16418 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
16420 2004-11-14 Ben Maurer <bmaurer@ximian.com>
16422 * statement.cs: Avoid adding bools to a hashtable.
16424 2004-11-07 Miguel de Icaza <miguel@ximian.com>
16426 * expression.cs (Invocation.OverloadResolve): Flag error if we are
16427 calling an unsafe method from a safe location.
16429 2004-11-06 Marek Safar <marek.safar@seznam.cz>
16432 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
16434 2004-11-06 Miguel de Icaza <miguel@ximian.com>
16436 * namespace.cs (VerifyUsing): use GetPartialName instead of
16439 2004-11-05 Miguel de Icaza <miguel@ximian.com>
16441 * statement.cs (Return.Resolve): Fix regression in typo: if
16442 `in_exc', we have to request a NeedReturnLabel, this was a typo
16443 introduced in the anonymous method check-in. Fixes #69131.
16445 * Indexers were using the ShortName when defining themselves,
16446 causing a regression in the compiler bootstrap when applying the
16447 patch from 2004-11-02 (first part), now they use their full name
16448 and the bug is gone.
16450 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
16452 * driver.cs: Strip the path from the names of embedded resources. Fixes
16455 2004-11-04 Raja R Harinath <rharinath@novell.com>
16457 Fix error message regression: cs0104-2.cs.
16458 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
16459 (AliasEntry.Resolve): Update.
16460 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
16462 (RootContext.LookupType): Update.
16464 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
16466 * cs-parser.jay: Add support for handling accessor modifiers
16467 * class: Add support port accessor modifiers and error checking,
16468 define PropertyMethod.Define as virtual (not abstract anymore)
16469 * ecore.cs: Add checking for proeprties access with access modifiers
16470 * iterators.cs: Modify Accessor constructor call based in the modified
16472 2004-11-02 Ben Maurer <bmaurer@ximian.com>
16474 * expression.cs (StringConcat): Handle being called twice,
16475 as when we have a concat in a field init with more than two
16478 2004-11-02 Miguel de Icaza <miguel@ximian.com>
16480 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
16481 special case explicit implementations, we should always produce
16482 the .property or .event declaration.
16484 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
16485 since it will not return correct data if people use this
16486 unresolved in the presence of using statements (see test-313).
16488 * class.cs (MethodData.Define): If we are an explicit interface
16489 implementation, set the method name to the full name of the
16490 interface plus the name of the method.
16492 Notice that using the method.MethodName.GetFullName() does not
16493 work, as it will only contain the name as declared on the source
16494 file (it can be a shorthand in the presence of using statements)
16495 and not the fully qualifed type name, for example:
16499 class D : ICloneable {
16500 object ICloneable.Clone () {
16504 Would produce a method called `ICloneable.Clone' instead of
16505 `System.ICloneable.Clone'.
16507 * namespace.cs (Alias.Resolve): Use GetPartialName.
16509 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16511 * cs-parser.jay: Add error 1055 report.
16513 2004-11-01 Miguel de Icaza <miguel@ximian.com>
16515 * assign.cs (Assign.DoResolve): Only do the transform of
16516 assignment into a New if the types are compatible, if not, fall
16517 through and let the implicit code deal with the errors and with
16518 the necessary conversions.
16520 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16522 * cs-parser.jay: Add error 1031 report.
16524 * cs-tokenizer.cs: Add location for error 1038.
16526 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16528 * cs-parser.jay: Add error 1016 report.
16530 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16532 * cs-parser.jay: Add errors 1575,1611 report.
16534 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16536 * cs-parser.jay: Add error 1001 report.
16538 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16541 * attribute.cs (GetMarshal): Add method argument for
16542 caller identification.
16544 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
16545 agument for GetMarshal and RuntimeMissingSupport.
16547 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16549 * attribute.cs (ExtractSecurityPermissionSet): Removed
16550 TypeManager.code_access_permission_type.
16552 * typemanager.cs: Removed TypeManager.code_access_permission_type.
16554 2004-10-27 Miguel de Icaza <miguel@ximian.com>
16556 * expression.cs (LocalVariableReference.DoResolveLValue): Check
16557 for obsolete use of a variable here. Fixes regression on errors
16558 cs0619-25 and cs0619-26.
16560 2004-10-27 Marek Safar <marek.safar@seznam.cz>
16562 Fix #62358, implemented security attribute encoding.
16564 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
16565 Tests permitted SecurityAction for assembly or other types.
16566 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
16567 data from SecurityPermissionAttribute to PermisionSet class.
16569 * class.cs (ApplyAttributeBuilder): Added special handling
16570 for System.Security.Permissions.SecurityAttribute based types.
16572 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
16573 special handling for System.Security.Permissions.SecurityAttribute
16576 * enum.cs (ApplyAttributeBuilder): Added special handling
16577 for System.Security.Permissions.SecurityAttribute based types.
16579 * parameter.cs (ApplyAttributeBuilder): Added special handling
16580 for System.Security.Permissions.SecurityAttribute based types.
16582 * rootcontext.cs: Next 2 core types.
16584 * typemanager.cs (TypeManager.security_permission_attr_type):
16585 Built in type for the SecurityPermission Attribute.
16586 (code_access_permission_type): Build in type.
16588 2004-10-17 Miguel de Icaza <miguel@ximian.com>
16590 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
16591 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
16592 all of this information into
16593 EmitContext.EmitCapturedVariableInstance.
16595 * codegen.cs (EmitCapturedVariableInstance): move here the
16596 funcionality of emitting an ldarg.0 in the presence of a
16597 remapping. This centralizes the instance emit code.
16599 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
16600 then emit a load of this: it means that we have reached the
16601 topmost ScopeInfo: the one that contains the pointer to the
16602 instance of the class hosting the anonymous method.
16604 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
16605 captures to the topmost CaptureContext.
16607 2004-10-12 Miguel de Icaza <miguel@ximian.com>
16609 * expression.cs (LocalVariableReference): Move the knowledge about
16610 the iterators into codegen's EmitCapturedVariableInstance.
16612 2004-10-11 Miguel de Icaza <miguel@ximian.com>
16614 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
16615 all code paths return a value from an anonymous method (it is the
16616 same as the 161 error, but for anonymous methods).
16618 2004-10-08 Miguel de Icaza <miguel@ximian.com>
16620 The introduction of anonymous methods in the compiler changed
16621 various ways of doing things in the compiler. The most
16622 significant one is the hard split between the resolution phase
16623 and the emission phases of the compiler.
16625 For instance, routines that referenced local variables no
16626 longer can safely create temporary variables during the
16627 resolution phase: they must do so from the emission phase,
16628 since the variable might have been "captured", hence access to
16629 it can not be done with the local-variable operations from the runtime.
16633 (Block.Flags): New flag `IsTopLevel' to indicate that this block
16634 is a toplevel block.
16636 (ToplevelBlock): A new kind of Block, these are the blocks that
16637 are created by the parser for all toplevel method bodies. These
16638 include methods, accessors and anonymous methods.
16640 These contain some extra information not found in regular blocks:
16641 A pointer to an optional CaptureContext (for tracking captured
16642 local variables and parameters). A pointer to the parent
16645 (Return.Resolve): Catch missmatches when returning a value from an
16646 anonymous method (error 1662).
16647 Invoke NeedReturnLabel from the Resolve phase instead of the emit
16650 (Break.Resolve): ditto.
16652 (SwitchLabel): instead of defining the labels during the
16653 resolution phase, we now turned the public ILLabel and ILLabelCode
16654 labels into methods called GetILLabelCode() and GetILLabel() that
16655 only define the label during the Emit phase.
16657 (GotoCase): Track the SwitchLabel instead of the computed label
16658 (its contained therein). Emit the code by using
16659 SwitchLabel.GetILLabelCode ().
16661 (LocalInfo.Flags.Captured): A new flag has been introduce to track
16662 whether the Local has been captured or not.
16664 (LocalInfo.IsCaptured): New property, used to tell whether the
16665 local has been captured.
16667 * anonymous.cs: Vastly updated to contain the anonymous method
16670 The main classes here are: CaptureContext which tracks any
16671 captured information for a toplevel block and ScopeInfo used to
16672 track the activation frames for various local variables.
16674 Each toplevel block has an optional capture context associated
16675 with it. When a method contains an anonymous method both the
16676 toplevel method and the anonymous method will create a capture
16677 context. When variables or parameters are captured, they are
16678 recorded on the CaptureContext that owns them, for example:
16682 MyDelegate d = delegate {
16687 Here `a' will be recorded as captured on the toplevel
16688 CapturedContext, the inner captured context will not have anything
16689 (it will only have data if local variables or parameters from it
16690 are captured in a nested anonymous method.
16692 The ScopeInfo is used to track the activation frames for local
16693 variables, for example:
16695 for (int i = 0; i < 10; i++)
16696 for (int j = 0; j < 10; j++){
16697 MyDelegate d = delegate {
16702 At runtime this captures a single captured variable `i', but it
16703 captures 10 different versions of the variable `j'. The variable
16704 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
16705 recorded on a child.
16707 The toplevel ScopeInfo will also track information like the `this'
16708 pointer if instance variables were referenced (this is necessary
16709 as the anonymous method lives inside a nested class in the host
16710 type of the method).
16712 (AnonymousMethod): Expanded to track the Toplevel, implement
16713 `AnonymousMethod.Compatible' to tell whether an anonymous method
16714 can be converted to a target delegate type.
16716 The routine now also produces the anonymous method content
16718 (AnonymousDelegate): A helper class that derives from
16719 DelegateCreation, this is used to generate the code necessary to
16720 produce the delegate for the anonymous method that was created.
16722 * assign.cs: API adjustments for new changes in
16723 Convert.ImplicitStandardConversionExists.
16725 * class.cs: Adjustments to cope with the fact that now toplevel
16726 blocks are of type `ToplevelBlock'.
16728 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
16729 insteda of standard blocks.
16731 Flag errors if params arguments are passed to anonymous methods.
16733 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
16734 `CurrentAnonymousMethod' which points to the current Anonymous
16735 Method. The variable points to the AnonymousMethod class that
16736 holds the code being compiled. It is set in the new EmitContext
16737 created for the anonymous method.
16739 (EmitContext.Phase): Introduce a variable and an enumeration to
16740 assist in enforcing some rules about when and where we are allowed
16741 to invoke certain methods (EmitContext.NeedsReturnLabel is the
16742 only one that enfonces this right now).
16744 (EmitContext.HaveCaptureInfo): new helper method that returns
16745 whether we have a CapturedContext initialized.
16747 (EmitContext.CaptureVariable): New method used to register that a
16748 LocalInfo must be flagged for capturing.
16750 (EmitContext.CapturedParameter): New method used to register that a
16751 parameters must be flagged for capturing.
16753 (EmitContext.CapturedField): New method used to register that a
16754 field must be flagged for capturing.
16756 (EmitContext.HaveCapturedVariables,
16757 EmitContext.HaveCapturedFields): Return whether there are captured
16758 variables or fields.
16760 (EmitContext.EmitMethodHostInstance): This is used to emit the
16761 instance for the anonymous method. The instance might be null
16762 (static methods), this (for anonymous methods that capture nothing
16763 and happen to live side-by-side with the current method body) or a
16764 more complicated expression if the method has a CaptureContext.
16766 (EmitContext.EmitTopBlock): Routine that drives the emission of
16767 code: it will first resolve the top block, then emit any metadata
16768 and then emit the code. The split is done so that we can extract
16769 any anonymous methods and flag any captured variables/parameters.
16771 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
16772 during this phase, the ILGenerator should not be used as labels
16773 and local variables declared here might not be accessible to any
16774 code that is part of an anonymous method.
16776 Exceptions to this include the temporary variables that are
16777 created by some statements internally for holding temporary
16780 (EmitContext.EmitMeta): New routine, in charge of emitting all the
16783 (EmitContext.TemporaryReturn): This method is typically called
16784 from the Emit phase, and its the only place where we allow the
16785 ReturnLabel to be defined other than the EmitMeta. The reason is
16786 that otherwise we would have to duplicate a lot of logic in the
16787 Resolve phases of various methods that today is on the Emit
16790 (EmitContext.NeedReturnLabel): This no longer creates the label,
16791 as the ILGenerator is not valid during the resolve phase.
16793 (EmitContext.EmitThis): Extended the knowledge in this class to
16794 work in anonymous methods in addition to iterators.
16796 (EmitContext.EmitCapturedVariableInstance): This emits whatever
16797 code is necessary on the stack to access the instance to a local
16798 variable (the variable will be accessed as a field).
16800 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
16801 EmitContext.EmitAddressOfParameter): Routines to support
16802 parameters (not completed at this point).
16804 Removals: Removed RemapLocal and RemapLocalLValue. We probably
16805 will also remove the parameters.
16807 * convert.cs (Convert): Define a `ConstantEC' which points to a
16808 null. This is just to prefity some code that uses
16809 ImplicitStandardConversion code and do not have an EmitContext
16812 The idea is to flag explicitly that at that point in time, it is
16813 known that the conversion will not trigger the delegate checking
16814 code in implicit conversions (which requires a valid
16817 Everywhere: pass new EmitContext parameter since
16818 ImplicitStandardConversionExists now requires it to check for
16819 anonymous method conversions.
16821 (Convert.ImplicitStandardConversionExists): If the type of an
16822 expression is the anonymous_method_type, and the type is a
16823 delegate, we invoke the AnonymousMethod.Compatible method to check
16824 whether an implicit conversion is possible.
16826 (Convert.ImplicitConversionStandard): Only do implicit method
16827 group conversions if the language level is not ISO_1.
16829 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
16830 MethodInfo for the Invoke method. used by Delegate and
16833 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
16834 method conversions if the target type is a delegate.
16836 Removed extra debugging nops.
16838 (LocalVariableReference): Turn the `local_info' into a public
16841 Add `prepared' field, the same hack used for FieldExprs to cope
16842 with composed assignments, as Local variables do not necessarily
16843 operate purely on the stack as they used to: they can be captured
16846 Add `temp' for a temporary result, like fields.
16848 Refactor DoResolve and DoResolveLValue into DoResolveBase.
16850 It now copes with Local variables that are captured and emits the
16851 proper instance variable to load it from a field in the captured
16854 (ParameterReference.DoResolveBase): During the resolve phase,
16855 capture parameters if we are in an anonymous method.
16857 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
16858 anonymous method, use the EmitContext helper routines to emit the
16859 parameter reference.
16861 * iterators.cs: Set RemapToProxy to true/false during the
16864 * parameters.cs (GetParameterByName): New helper method.
16866 * typemanager.cs (anonymous_method_type) a new type that
16867 represents an anonyous method. This is always an internal type,
16868 used as a fencepost to test against the anonymous-methodness of an
16871 2004-10-20 Marek Safar <marek.safar@seznam.cz>
16873 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
16875 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
16877 2004-10-18 Martin Baulig <martin@ximian.com>
16879 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
16880 `Type' directly, but call ResolveType() on it.
16881 (Catch.Resolve): Likewise.
16882 (Foreach.Resolve): Likewise.
16884 2004-10-18 Martin Baulig <martin@ximian.com>
16886 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
16887 `Type' directly, but call ResolveType() on it.
16888 (Probe.DoResolve): Likewise.
16889 (ArrayCreation.LookupType): Likewise.
16890 (TypeOf.DoResolve): Likewise.
16891 (SizeOf.DoResolve): Likewise.
16893 2004-10-18 Martin Baulig <martin@ximian.com>
16895 * expression.cs (Invocation.BetterFunction): Put back
16896 TypeManager.TypeToCoreType().
16898 2004-10-18 Raja R Harinath <rharinath@novell.com>
16900 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
16903 2004-10-18 Martin Baulig <martin@ximian.com>
16905 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
16906 `Type' directly, but call ResolveType() on it.
16908 2004-10-18 Martin Baulig <martin@ximian.com>
16910 * class.cs (FieldMember.Define): Don't access the TypeExpr's
16911 `Type' directly, but call ResolveType() on it.
16912 (MemberBase.DoDefine): Likewise.
16914 * expression.cs (New.DoResolve): Don't access the TypeExpr's
16915 `Type' directly, but call ResolveType() on it.
16916 (ComposedCast.DoResolveAsTypeStep): Likewise.
16918 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
16919 `Type' directly, but call ResolveType() on it.
16921 2004-10-17 John Luke <john.luke@gmail.com>
16923 * class.cs (Operator.GetSignatureForError): use CSharpName
16925 * parameter.cs (Parameter.GetSignatureForError): Returns
16926 correct name even if was not defined.
16928 2004-10-13 Raja R Harinath <rharinath@novell.com>
16931 * class.cs (TypeContainer.EmitContext): New property.
16932 (DefineNestedTypes): Create an emitcontext for each part.
16933 (MethodCore.DoDefineParameters): Use container's emitcontext.
16934 Pass type array to InternalParameters.
16935 (MemberBase.DoDefine): Use container's emitcontext.
16936 (FieldMember.Define): Likewise.
16937 (Event.Define): Likewise.
16938 (SetMethod.GetParameterInfo): Change argument to EmitContext.
16939 Pass type array to InternalParameters.
16940 (SetIndexerMethod.GetParameterInfo): Likewise.
16941 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
16942 * delegate.cs (Define): Pass emitcontext to
16943 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
16944 array to InternalParameters.
16945 * expression.cs (ParameterReference.DoResolveBase): Pass
16946 emitcontext to GetParameterInfo.
16947 (ComposedCast.DoResolveAsTypeStep): Remove check on
16948 ec.ResolvingTypeTree.
16949 * parameter.cs (Parameter.Resolve): Change argument to
16950 EmitContext. Use ResolveAsTypeTerminal.
16951 (Parameter.GetSignature): Change argument to EmitContext.
16952 (Parameters.ComputeSignature): Likewise.
16953 (Parameters.ComputeParameterTypes): Likewise.
16954 (Parameters.GetParameterInfo): Likewise.
16955 (Parameters.ComputeAndDefineParameterTypes): Likewise.
16956 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
16957 * support.cs (InternalParameters..ctor): Remove variant that takes
16959 * typemanager.cs (system_intptr_expr): New.
16960 (InitExpressionTypes): Initialize it.
16962 2004-10-12 Chris Toshok <toshok@ximian.com>
16964 * cs-parser.jay: fix location for try_statement and catch_clause.
16966 2004-10-11 Martin Baulig <martin@ximian.com>
16968 * report.cs: Don't make --fatal abort on warnings, we have
16969 -warnaserror for that.
16971 2004-10-07 Raja R Harinath <rharinath@novell.com>
16973 More DeclSpace.ResolveType avoidance.
16974 * decl.cs (MemberCore.InUnsafe): New property.
16975 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
16976 with newly created EmitContext.
16977 (FieldMember.Define): Likewise.
16978 * delegate.cs (Delegate.Define): Likewise.
16979 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
16980 only if normal name-lookup fails.
16981 (TypeExpr.DoResolve): Enable error-checking.
16982 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
16983 (SizeOf.DoResolve): Likewise.
16984 (ComposedCast.DoResolveAsTypeStep): Likewise.
16985 (StackAlloc.DoResolve): Likewise.
16986 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
16987 (Block.Unsafe): New property.
16988 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
16989 (Unsafe): Set 'unsafe' flag of contained block.
16990 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
16991 (Fixed.Resolve): Likewise.
16992 (Catch.Resolve): Likewise.
16993 (Using.ResolveLocalVariableDecls): Likewise.
16994 (Foreach.Resolve): Likewise.
16996 2004-10-05 John Luke <john.luke@gmail.com>
16998 * cs-parser.jay: add location to error CS0175
17000 2004-10-04 Miguel de Icaza <miguel@ximian.com>
17002 * ecore.cs (Expression.Constantity): Add support for turning null
17005 * const.cs (Const.Define): Allow constants to be reference types
17006 as long as the value is Null.
17008 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
17010 * namespace.cs (NamespaceEntry.Using): No matter which warning
17011 level is set, check if this namespace name has already been added.
17013 2004-10-03 Ben Maurer <bmaurer@ximian.com>
17015 * expression.cs: reftype [!=]= null should always use br[true,false].
17018 2004-10-03 Marek Safar <marek.safar@seznam.cz>
17021 * attribute.cs: Enum conversion moved to
17022 GetAttributeArgumentExpression to be applied to the all
17025 2004-10-01 Raja R Harinath <rharinath@novell.com>
17027 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
17028 * class.c (TypeContainer.DefineType): Flag error if
17029 base types aren't accessible due to access permissions.
17030 * decl.cs (DeclSpace.ResolveType): Move logic to
17031 Expression.ResolveAsTypeTerminal.
17032 (DeclSpace.ResolveTypeExpr): Thin layer over
17033 Expression.ResolveAsTypeTerminal.
17034 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
17035 Refactor code into NestedAccess. Use it.
17036 (DeclSpace.NestedAccess): New.
17037 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
17038 argument to silence errors. Check access permissions.
17039 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
17040 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
17041 (Cast.DoResolve): Likewise.
17042 (New.DoResolve): Likewise.
17043 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
17044 (TypeOf.DoResolve): Likewise.
17046 * expression.cs (Invocation.BetterConversion): Return the Type of
17047 the better conversion. Implement section 14.4.2.3 more faithfully.
17048 (Invocation.BetterFunction): Make boolean. Make correspondence to
17049 section 14.4.2.2 explicit.
17050 (Invocation.OverloadResolve): Update.
17051 (Invocation): Remove is_base field.
17052 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
17053 (Invocation.Emit): Likewise.
17055 2004-09-27 Raja R Harinath <rharinath@novell.com>
17057 * README: Update to changes.
17059 2004-09-24 Marek Safar <marek.safar@seznam.cz>
17061 * cs-parser.jay: Reverted 642 warning fix.
17063 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17066 * decl.cs (FindMemberWithSameName): Indexer can have more than
17069 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17071 * expression.cs (LocalVariableReference.DoResolveLValue):
17072 Do not report warning 219 for out values.
17073 (EmptyExpression.Null): New member to avoid extra allocations.
17075 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17077 * cs-parser.jay: Fix wrong warning 642 report.
17079 * cs-tokenizer.cs (CheckNextToken): New helper;
17080 Inspect next character if is same as expected.
17082 2004-09-23 Martin Baulig <martin@ximian.com>
17084 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
17085 (Convert.ImplicitReferenceConversionExists): Likewise.
17087 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17089 * class.cs (Operator.Define): Add error 448 and 559 report.
17091 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17093 * class.cs (MemberBase.IsTypePermitted): New protected
17094 method for checking error CS0610.
17096 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17098 * class.cs (TypeContainer.HasExplicitLayout): New property
17099 Returns whether container has StructLayout attribute set Explicit.
17100 (FieldMember): New abstract class for consts and fields.
17101 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
17102 (Field): Reuse FieldMember.
17104 * const.cs (Const): Reuse FieldMember.
17106 * rootcontext.cs: EmitConstants call moved to class.
17108 2004-09-22 Martin Baulig <martin@ximian.com>
17110 Thanks to Peter Sestoft for this bug report.
17112 * expression.cs (Conditional): If both the `trueExpr' and the
17113 `falseExpr' is a NullLiteral, return a NullLiteral.
17115 2004-09-22 Martin Baulig <martin@ximian.com>
17117 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
17118 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
17119 for the "get_Current" call.
17121 2004-09-22 Martin Baulig <martin@ximian.com>
17123 Marek and me just fixed one of our oldest bugs: #28562 :-)
17125 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
17127 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
17128 we're an EnumConstant, just return that.
17129 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
17130 an EnumConstant. In this case, we need to use GetValueAsEnumType()
17131 to get the value which'll actually be written into the attribute.
17132 However, we have to use GetValue() to access the attribute's value
17135 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17137 * constant.cs (Constant.IsNegative): New abstract property
17140 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
17141 (StackAlloc.DoResolve): Reused IsNegative.
17143 2004-09-21 Martin Baulig <martin@ximian.com>
17145 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
17146 if we're used in an iterator, we may be called from different
17149 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
17150 we actually have an exception block.
17152 2004-09-20 John Luke <jluke@cfl.rr.com>
17154 * class.cs, cs-parser.jay: Improve the error report for 1520:
17155 report the actual line where the error happens, not where the
17156 class was declared.
17158 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
17159 Pass location information that was available elsewhere.
17161 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
17163 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
17164 runtime to delay sign assemblies.
17166 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17168 * cs-parser.jay: Do not report the stack trace, this is barely
17171 2004-08-22 John Luke <john.luke@gmail.com>
17173 * driver.cs : check that a resource id is not already used
17174 before adding it, report CS1508 if it is, bug #63637
17176 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17178 * ecore.cs: Removed dead code.
17180 2004-09-18 Marek Safar <marek.safar@seznam.cz>
17182 * class.cs: Do not report warning CS0067 on the interfaces.
17184 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17186 * cs-parser.jay: Add error 504 report.
17188 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17190 * rootcontext.cs: WarningLevel is 4 by default now.
17192 * statement.cs (Fixed.Resolve): Do not null
17195 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17198 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
17199 deep search when property is not virtual.
17200 (PropertyExpr.ResolveAccessors): Make one call for both
17203 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17206 * statement.cs: Error 152 report constains also location.
17208 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17211 * const.cs: Explicitly set constant as static.
17213 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17216 * cs-parser.jay: Add error 1017 report.
17218 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17220 Fixed bug #59980, #64224
17221 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
17223 * typemanager.cs (IsSpecialMethod): Simplified
17225 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17227 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
17228 condition with better params.
17230 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17233 * attribute.cs (Resolve): Property has to have both
17236 2004-09-14 Martin Baulig <martin@ximian.com>
17238 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
17240 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17243 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
17244 called and is obsolete then this member suppress message
17245 when call is inside next [Obsolete] method or type.
17247 * expression.cs: Use TestObsoleteMethodUsage member.
17249 2004-09-14 Martin Baulig <martin@ximian.com>
17251 * cs-parser.jay: Sync a bit with the GMCS version.
17253 2004-09-14 Martin Baulig <martin@ximian.com>
17255 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
17256 (CSharpParser.yacc_verbose_flag): New public field.
17258 * genericparser.cs: Removed.
17260 2004-09-14 Raja R Harinath <rharinath@novell.com>
17262 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
17264 2004-09-13 Marek Safar <marek.safar@seznam.cz>
17266 * class.cs (MethodCore.CheckBase): Fix bug #65757.
17268 2004-09-10 Martin Baulig <martin@ximian.com>
17270 Backported my MemberName changes from GMCS into MCS.
17272 - we are now using a special `MemberName' class instead of using
17273 strings; in GMCS, the `MemberName' also contains the type
17276 - changed the grammar rules a bit:
17277 * the old `member_name' is now a `namespace_or_type_name':
17278 The rule is that we use `namespace_or_type_name' everywhere
17279 where we expect either a "member name" (GetEnumerator) or a
17280 "member name" with an explicit interface name
17281 (IEnumerable.GetEnumerator).
17282 In GMCS, the explicit interface name may include type arguments
17283 (IEnumerable<T>.GetEnumerator).
17284 * we use `member_name' instead of just `IDENTIFIER' for
17286 The rule is that we use `member_name' wherever a member may
17287 have type parameters in GMCS.
17289 * decl.cs (MemberName): New public class.
17290 (MemberCore.MemberName): New public readonly field.
17291 (MemberCore.ctor): Take a `MemberName' argument, not a string.
17292 (DeclSpace): Likewise.
17294 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
17295 * enum.cs (Enum.ctor): Likewise.
17297 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
17299 (AliasEntry.ctor): Take a MemberName, not an Expression.
17300 (AliasEntry.UsingAlias): Likewise.
17302 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
17303 (IMethodData.MemberName): Changed type from string to MemberName.
17304 (MemberBase.ExplicitInterfaceName): Likewise.
17305 (AbstractPropertyEventMethod.SetupName): Make this private.
17306 (AbstractPropertyEventMethod.ctor): Added `string prefix'
17307 argument; compute the member name here.
17308 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
17309 on the `member.MemberName' and the `prefix'.
17311 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
17313 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
17314 thus, we get a `MemberName' instead of a `string'. These
17315 declarations may have type parameters in GMCS.
17316 (interface_method_declaration, delegate_declaration): Likewise.
17317 (class_declaration, interface_declaration): Likewise.
17318 (method_header): Use `namespace_or_type_name' instead of
17319 `member_name'. We may be an explicit interface implementation.
17320 (property_declaration, event_declaration): Likewise.
17321 (member_name): This is now just an `IDENTIFIER', not a
17322 `namespace_or_type_name'.
17323 (type_name, interface_type): Removed.
17324 (namespace_or_type_name): Return a MemberName, not an Expression.
17325 (primary_expression): Use `member_name' instead of `IDENTIFIER';
17326 call GetTypeExpression() on the MemberName to get an expression.
17327 (IndexerDeclaration.interface_type): Changed type from string to
17329 (MakeName): Operate on MemberName's instead of string's.
17331 2004-09-13 Raja R Harinath <rharinath@novell.com>
17334 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
17335 (NamespaceEntry.Lookup): Add new argument to flag if we want the
17336 lookup to avoid symbols introduced by 'using'.
17337 * rootcontext.cs (NamespaceLookup): Update.
17339 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17341 * class.cs (TypeContainer.DoDefineMembers): Do not call
17342 DefineDefaultConstructor for static classes.
17344 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17346 * attribute.cs (Attribute.Resolve): Add error 653 report.
17348 * class.cs (Class.ApplyAttributeBuilder): Add error 641
17350 (Method.ApplyAttributeBuilder): Add error 685 report.
17351 (Operator.Define): Add error 564 report.
17353 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
17355 * expression.cs (Invocation.DoResolve): Add error
17356 245 and 250 report.
17358 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
17361 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17363 * class.cs (ConstructorInitializer.Resolve):
17364 Wrong error number (515->516).
17366 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17368 * class.cs (Indexer.Define): Add error 631 report.
17370 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17372 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
17374 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17376 * expression.cs (Probe.DoResolve): Add error CS0241 report.
17378 2004-09-10 Marek Safar <marek.safar@seznam.cz>
17380 * cs-parser.jay: Added error CS0241 report.
17382 2004-09-10 Raja R Harinath <rharinath@novell.com>
17384 * cs-parser.jay (fixed_statement): Introduce a scope for the
17385 declaration in the 'fixed' statement.
17387 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17389 * cs-parser.jay: Added CS0230 error report.
17391 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17393 * cs-parser.jay: Added errors CS0231 and CS0257 report.
17395 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17397 * expression.cs (Argument.Resolve): Added error CS0192 and
17400 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17402 C# 2.0 #pragma warning feature
17404 * cs-tokenizer.cs (PreProcessPragma): New method;
17405 Handles #pragma directive.
17407 * report.cs (WarningRegions): New class; Support
17408 class for #pragma warning directive. It tests whether
17409 warning is enabled for a given line.
17411 2004-09-08 Miguel de Icaza <miguel@ximian.com>
17413 * const.cs: Add more descriptive error report, tahnks to
17416 2004-09-08 Marek Safar <marek.safar@seznam.cz>
17418 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
17420 2004-09-07 Miguel de Icaza <miguel@ximian.com>
17422 * expression.cs: Apply patch from Ben: Remove dead code from
17423 ArrayCreation, and remove the TurnintoConstant call in const.cs,
17424 as that code just threw an exception anwyays.
17426 * const.cs: Remove the call to the turnintoconstant, for details
17429 * literal.cs: The type of the null-literal is the null type; So
17430 we use a placeholder type (literal.cs:System.Null, defined here)
17433 * expression.cs (Conditional.DoResolve): Remove some old code that
17434 is no longer needed, conversions have been fixed.
17436 (ArrayCreationExpression.DoResolve): Return false if we fail to
17437 resolve the inner expression.
17439 2004-09-07 Raja R Harinath <rharinath@novell.com>
17442 * cs-parser.jay (delegate_declaration): Record a delegate
17443 declaration as a type declaration.
17444 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
17446 2004-09-06 Miguel de Icaza <miguel@ximian.com>
17448 * parameter.cs: Do not crash if the type can not be resolved.
17450 * expression.cs: Report errors with unsafe pointers, fixes #64896
17452 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
17454 * expression.cs: Pointer arith always needs to do a conv.i
17455 if the operand is a long. fix 65320
17457 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17459 Fixed cs0619-37.cs, cs0619-38.cs
17461 * enum.cs (GetObsoleteAttribute): Removed.
17463 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
17464 on Enum member is double staged. The first is tested member
17467 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17469 Fixed #56986, #63631, #65231
17471 * class.cs: (TypeContainer.AddToMemberContainer): New method,
17472 adds member to name container.
17473 (TypeContainer.AddToTypeContainer): New method, adds type to
17475 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
17476 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
17477 AddOperator): Simplified by reusing AddToMemberContainer.
17478 (TypeContainer.UserDefinedStaticConstructor): Changed to property
17480 (Method.CheckForDuplications): Fixed implementation to test all
17482 (MemberBase): Detection whether member is explicit interface
17483 implementation is now in constructor.
17484 (MemberBase.UpdateMemberName): Handles IndexerName.
17485 (Accessor): Changed to keep also location information.
17486 (AbstractPropertyEventMethod): Is derived from MemberCore.
17487 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
17488 will be emited or not.
17489 (PropertyBase.AreAccessorsDuplicateImplementation):
17490 Tests whether accessors are not in collision with some method.
17491 (Operator): Is derived from MethodCore to simplify common
17494 * decl.cs (Flags.TestMethodDuplication): Test for duplication
17496 (DeclSpace.AddToContainer): Adds the member to defined_names
17497 table. It tests for duplications and enclosing name conflicts.
17499 * enum.cs (EnumMember): Clean up to reuse the base structures
17501 2004-09-03 Martin Baulig <martin@ximian.com>
17503 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
17504 into TypeContainer, to make partial classes work again.
17506 2004-09-03 Martin Baulig <martin@ximian.com>
17508 * rootcontext.cs (RootContext.V2): Removed.
17510 2004-03-23 Martin Baulig <martin@ximian.com>
17512 * expression.cs (Invocation.OverloadResolve): Added `bool
17513 may_fail' argument and use it instead of the Location.IsNull() hack.
17515 2004-09-03 Martin Baulig <martin@ximian.com>
17517 Merged latest changes into gmcs. Please keep this comment in
17518 here, it makes it easier for me to see what changed in MCS since
17519 the last time I merged.
17521 2004-09-03 Raja R Harinath <rharinath@novell.com>
17524 * expression.cs (BetterConversion): Don't allow either conversion
17525 to be null. Remove redundant implicit conversion test when 'q ==
17526 null' -- when this function is invoked, we already know that the
17527 implicit conversion exists.
17528 (BetterFunction): Assume that 'best' is non-null. Remove
17529 redundant reimplementation of IsApplicable when 'best' is null.
17530 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
17531 number of arguments.
17532 (IsAncestralType): Extract from OverloadResolve.
17533 (OverloadResolve): Make robust to the MethodGroupExpr being
17534 unsorted. Implement all the logic of Section 14.5.5.1, and
17535 support overloading of methods from multiple applicable types.
17536 Clean up logic somewhat. Don't pass null methods to BetterFunction.
17538 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
17539 (RealError, Warning): Append type of report to related symbol.
17541 2004-09-03 Marek Safar <marek.safar@seznam.cz>
17543 * enum.cs: Fixed CLS-Compliance checks for enum members.
17544 Error tests cs3008-8.cs, cs3014-8.cs
17546 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17548 Fixed bug #62342, #63102
17549 * class.cs: ImplementIndexer uses member.IsExplicitImpl
17550 like ImplementMethod.
17552 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17554 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17557 2004-09-02 Martin Baulig <martin@ximian.com>
17559 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
17560 TypeManager.GetArgumentTypes() rather than calling GetParameters()
17563 2004-09-01 Marek Safar <marek.safar@seznam.cz>
17565 C# 2.0 Static classes implemented
17567 * class.cs (TypeContainer): instance_constructors,
17568 initialized_fields, initialized_static_fields,
17569 default_constructor, base_inteface_types are protected to be
17570 accessible from StaticClass.
17571 (TypeContainer.DefineDefaultConstructor): New virtual method
17572 for custom default constructor generating
17573 (StaticClass): New class to handle "Static classes" feature.
17575 * cs-parser.jay: Handle static keyword on class like instance
17578 * driver.cs: Added "/langversion" command line switch with two
17579 options (iso-1, default).
17581 2004-08-31 Marek Safar <marek.safar@seznam.cz>
17583 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
17585 2004-08-31 Miguel de Icaza <miguel@ximian.com>
17587 * delegate.cs: Style.
17589 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
17591 * delegate.cs: Add seperate instance expr field for miguel.
17593 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17595 * PointerArithmetic (Resolve): make sure we are not doing
17596 pointer arith on void*. Also, make sure we are resolved
17597 by not setting eclass until resolve.
17599 All callers: Make sure that PointerArithmetic gets resolved.
17601 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17603 * ArrayCreation (LookupType): If the type does not resolve
17604 to an array, give an error.
17606 2004-08-27 Marek Safar <marek.safar@seznam.cz>
17608 * statement.cs (Try.Resolve): Fixed bug #64222
17610 2004-08-27 Martin Baulig <martin@ximian.com>
17613 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
17616 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17618 * ecore.cs (Constantify): Get underlying type via
17619 System.Enum.GetUnderlyingType to avoid StackOverflow on the
17620 Windows in special cases.
17622 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17624 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
17625 for obtaining also private methods.
17626 (GetRemoveMethod): Used GetRemoveMethod (true)
17627 for obtaining also private methods.
17629 2004-08-24 Martin Baulig <martin@ximian.com>
17631 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
17632 MethodAttributes.HideBySig for operators.
17634 2004-08-23 Martin Baulig <martin@ximian.com>
17636 Back to the old error reporting system :-)
17638 * report.cs (Message): Removed.
17639 (Report.MessageData, ErrorData, WarningData): Removed.
17640 (Report.Error, Warning): Back to the old system.
17642 2004-08-23 Martin Baulig <martin@ximian.com>
17644 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
17646 * class.cs (TypeContainer.ParentContainer): New public virtual
17647 method; replaces the explicit interface implementation.
17648 (ClassPart.ParentContainer): Override.
17650 2004-08-23 Martin Baulig <martin@ximian.com>
17652 * statement.cs (Switch): Added support for constant switches; see
17653 #59428 or test-285.cs.
17655 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17658 * statement.cs (GetEnumeratorFilter): Removed useless
17659 logic because C# specs is strict. GetEnumerator must be
17662 2004-08-22 Martin Baulig <martin@ximian.com>
17664 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17665 a switch and may break, reset the barrier. Fixes #59867.
17667 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17669 CLS-Compliance speed up (~5% for corlib)
17671 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
17672 New method. Tests container for CLS-Compliant names
17674 * class.cs (TypeContainer.VerifyClsName): New method.
17675 Checks whether container name is CLS Compliant.
17676 (Constructor): Implements IMethodData.
17678 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
17679 low-case table for CLS Compliance test.
17680 (MemberCache.VerifyClsParameterConflict): New method.
17681 Checks method parameters for CS3006 error.
17683 * enum.cs (EnumMember): Is derived from MemberCore.
17684 (Enum.VerifyClsName): Optimized for better performance.
17686 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17688 * report.cs: Renamed Error_T to Error and changed all
17691 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17693 * class.cs (TypeContainer.IndexerArrayList): New inner class
17694 container for indexers.
17695 (TypeContainer.DefaultIndexerName): New constant for default
17696 indexer name. Replaced all "Item" with this constant.
17697 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
17699 * typemanager.cs (TypeManager.default_member_ctor): Cache here
17700 DefaultMemberAttribute constructor.
17702 2004-08-05 Martin Baulig <martin@ximian.com>
17704 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
17707 2004-08-05 Marek Safar <marek.safar@seznam.cz>
17709 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
17710 multi platforms problem.
17712 * compiler.csproj: Included shared files.
17714 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17716 Fix bug 60333, 55971 in the more general way
17717 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17718 Added arg_type argument for constant conversion.
17719 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
17721 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17724 * class.cs (TypeContainer ): New inner classes MethodArrayList,
17725 OperatorArrayList, MethodCoreArrayList for typecontainer
17726 containers. Changed class member types to these new types.
17727 (MethodArrayList.DefineMembers): Added test for CS0659.
17729 2004-08-04 Miguel de Icaza <miguel@ximian.com>
17731 * cfold.cs: Synchronize the folding with the code in expression.cs
17732 Binary.DoNumericPromotions for uint operands.
17734 * attribute.cs: Revert patch from Raja, it introduced a regression
17735 while building Blam-1.2.1 (hard to isolate a test case).
17737 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17741 (TypeContainer.Define): Renamed to DefineContainerMembers because of
17743 (MethodCore.parent_method): New member. The method we're overriding
17744 if this is an override method.
17745 (MethodCore.CheckBase): Moved from Method class and made common.
17746 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
17748 (MethodCore.CheckForDuplications): New abstract method. For custom
17749 member duplication search in a container
17750 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
17751 method and its return type.
17752 (Event.conflict_symbol): New member. Symbol with same name in the
17756 (MemberCache.FindMemberWithSameName): New method. The method
17757 is looking for conflict with inherited symbols.
17759 2004-08-04 Martin Baulig <martin@ximian.com>
17761 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
17763 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
17765 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17767 * report.cs (Message): New enum for better error, warning reference in
17769 (MessageData): New inner abstract class. It generally handles printing of
17770 error and warning messages.
17771 Removed unused Error, Warning, Message methods.
17773 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17775 Fix for cs0592-8.cs test
17777 (Attributable.ValidAttributeTargets): Made public.
17778 (Attribute.ExplicitTarget): New member for explicit target value.
17779 (Attribute.CheckTargets): Now we translate explicit attribute
17780 target to Target here.
17782 2004-08-03 Ben Maurer <bmaurer@ximian.com>
17784 * ecore.cs (MethodGroupExpr): new IsBase property.
17786 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
17788 * delegate.cs (DelegateCreation): store a MethodGroupExpr
17789 rather than an instance expr.
17791 (DelegateCreation.Emit): Use the method group rather than
17792 the instance expression. Also, if you have base.Foo as the
17793 method for a delegate, make sure to emit ldftn, not ldftnvirt.
17795 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
17797 (NewDelegate.DoResolve): Only check for the existance of Invoke
17798 if the method is going to be needed. Use MethodGroupExpr.
17800 (NewDelegate.Emit): Remove, DelegateCreation implements this.
17802 * expression.cs: For pointer arith., make sure to use
17803 the size of the type, not the size of the pointer to
17806 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17809 * class.cs (Class): Added error CS0502 test.
17811 2004-08-03 John Luke <jluke@cfl.rr.com>
17812 Raja R Harinath <rharinath@novell.com>
17815 * attribute.cs (Attribute.complained_before): New flag.
17816 (Attribute.ResolveType, Attribute.Resolve),
17817 (Attribute.DefinePInvokeMethod): Set it.
17818 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
17820 2004-08-03 Martin Baulig <martin@ximian.com>
17822 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
17823 use a user-defined operator; we still need to do numeric
17824 promotions in case one argument is a builtin type and the other
17825 one has an implicit conversion to that type. Fixes #62322.
17827 2004-08-02 Martin Baulig <martin@ximian.com>
17829 * statement.cs (LocalInfo.Flags): Added `IsThis'.
17830 (LocalInfo.IsThis): New public property.
17831 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
17833 2004-08-01 Martin Baulig <martin@ximian.com>
17835 * class.cs (TypeContainer.GetClassBases): Don't set the default
17836 here since we may get called from GetPartialBases().
17837 (TypeContainer.DefineType): If GetClassBases() didn't return a
17838 parent, use the default one.
17840 2004-07-30 Duncan Mak <duncan@ximian.com>
17842 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
17844 2004-07-30 Martin Baulig <martin@ximian.com>
17846 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
17848 * class.cs (SourceMethod): New public class, derive from the
17849 symbol writer's ISourceMethod.
17850 (Method): Use the new symbol writer API.
17852 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
17853 as argument and use the new symbol writer.
17856 (SourceFile): Implement the symbol writer's ISourceFile.
17857 (Location.SymbolDocument): Removed.
17858 (Location.SourceFile): New public property.
17860 * symbolwriter.cs: Use the new symbol writer API.
17862 2004-07-30 Raja R Harinath <rharinath@novell.com>
17864 * Makefile (install-local): Remove. Functionality moved to
17867 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
17869 * Makefile: Install mcs.exe.config file together with mcs.exe.
17870 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
17871 correct runtime version.
17873 2004-07-25 Martin Baulig <martin@ximian.com>
17876 (TypeContainer.RegisterOrder): Removed, this was unused.
17877 (TypeContainer, interface_order): Removed.
17878 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
17879 TypeContainer as argument since we can also be called with a
17880 `PartialContainer' for a partial class/struct/interface.
17881 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
17882 of checking whether we're an `Interface' - we could be a
17883 `PartialContainer'.
17884 (PartialContainer.Register): Override; call
17885 AddClass()/AddStruct()/AddInterface() on our parent.
17887 * cs-parser.jay (interface_member_declaration): Add things to the
17888 `current_container', not the `current_class'.
17890 * rootcontext.cs (RegisterOrder): The overloaded version which
17891 takes an `Interface' was unused, removed.
17893 * typemanager.cs (TypeManager.LookupInterface): Return a
17894 `TypeContainer', not an `Interface'.
17895 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
17896 contain a `PartialContainer' for an interface, so check it's
17897 `Kind' to figure out what it is.
17899 2004-07-25 Martin Baulig <martin@ximian.com>
17901 * class.cs (Class.DefaultTypeAttributes): New public constant.
17902 (Struct.DefaultTypeAttributes): Likewise.
17903 (Interface.DefaultTypeAttributes): Likewise.
17904 (PartialContainer.TypeAttr): Override this and add the
17905 DefaultTypeAttributes.
17907 2004-07-25 Martin Baulig <martin@ximian.com>
17909 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
17910 we can just use the `Parent' field instead.
17912 2004-07-25 Martin Baulig <martin@ximian.com>
17914 * class.cs (TypeContainer.Emit): Renamed to EmitType().
17916 2004-07-25 Martin Baulig <martin@ximian.com>
17918 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
17919 our parts before defining any methods.
17920 (TypeContainer.VerifyImplements): Make this virtual.
17921 (ClassPart.VerifyImplements): Override and call VerifyImplements()
17922 on our PartialContainer.
17924 2004-07-25 Martin Baulig <martin@ximian.com>
17926 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
17928 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
17929 argument, we can just use the `Parent' field instead.
17932 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
17933 (MemberBase.DoDefine): Likewise.
17935 2004-07-24 Martin Baulig <martin@ximian.com>
17937 * decl.cs (MemberCore.Parent): New public field.
17938 (DeclSpace.Parent): Moved to MemberCore.
17940 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
17941 (MemberBase.ctor): Added TypeContainer argument, pass it to our
17943 (FieldBase, Field, Operator): Likewise.
17944 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
17945 (EventField, Event): Likewise.
17947 2004-07-23 Martin Baulig <martin@ximian.com>
17949 * class.cs (PartialContainer): New public class.
17950 (ClassPart): New public class.
17951 (TypeContainer): Added support for partial classes.
17952 (TypeContainer.GetClassBases): Splitted some of the functionality
17953 out into GetNormalBases() and GetPartialBases().
17955 * cs-tokenizer.cs (Token.PARTIAL): New token.
17956 (Tokenizer.consume_identifier): Added some hacks to recognize
17957 `partial', but only if it's immediately followed by `class',
17958 `struct' or `interface'.
17960 * cs-parser.jay: Added support for partial clases.
17962 2004-07-23 Martin Baulig <martin@ximian.com>
17964 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
17965 a `DeclSpace' and also made it readonly.
17966 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
17967 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
17968 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
17970 * cs-parser.jay: Pass the `current_class', not the
17971 `current_container' (at the moment, this is still the same thing)
17972 to a new Method, Property, Event, Indexer or Constructor.
17974 2004-07-23 Martin Baulig <martin@ximian.com>
17976 * cs-parser.jay (CSharpParser): Added a new `current_class' field
17977 and removed the `current_interface' one.
17978 (struct_declaration, class_declaration, interface_declaration):
17979 Set `current_class' to the newly created class/struct/interface;
17980 set their `Bases' and call Register() before parsing their body.
17982 2004-07-23 Martin Baulig <martin@ximian.com>
17984 * class.cs (Kind): New public enum.
17985 (TypeContainer): Made this class abstract.
17986 (TypeContainer.Kind): New public readonly field.
17987 (TypeContainer.CheckDef): New public method; moved here from
17989 (TypeContainer.Register): New public abstract method.
17990 (TypeContainer.GetPendingImplementations): New public abstract
17992 (TypeContainer.GetClassBases): Removed the `is_class' and
17993 `is_iface' parameters.
17994 (TypeContainer.DefineNestedTypes): Formerly known as
17996 (ClassOrStruct): Made this class abstract.
17998 * tree.cs (RootTypes): New public type.
18000 2004-07-20 Martin Baulig <martin@ximian.com>
18002 * tree.cs (Tree.RecordNamespace): Removed.
18003 (Tree.Namespaces): Removed.
18005 * rootcontext.cs (RootContext.IsNamespace): Removed.
18007 * cs-parser.jay (namespace_declaration): Just create a new
18008 NamespaceEntry here.
18010 2004-07-20 Martin Baulig <martin@ximian.com>
18012 * statement.cs (ExceptionStatement): New abstract class. This is
18013 now used as a base class for everyone who's using `finally'.
18014 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
18015 our local variables before using them.
18017 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
18018 virtual method. This is used by Yield.Resolve() to "steal" an
18019 outer block's `finally' clauses.
18020 (FlowBranchingException): The .ctor now takes an ExceptionStatement
18023 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
18024 version which takes an ExceptionStatement. This version must be
18025 used to create exception branchings.
18028 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
18029 (Iterator.EmitMoveNext): Added exception support; protect the
18030 block with a `fault' clause, properly handle 'finally' clauses.
18031 (Iterator.EmitDispose): Run all the `finally' clauses here.
18033 2004-07-20 Martin Baulig <martin@ximian.com>
18035 * iterator.cs: This is the first of a set of changes in the
18036 iterator code. Match the spec more closely: if we're an
18037 IEnumerable, then GetEnumerator() must be called. The first time
18038 GetEnumerator() is called, it returns the current instance; all
18039 subsequent invocations (if any) must create a copy.
18041 2004-07-19 Miguel de Icaza <miguel@ximian.com>
18043 * expression.cs: Resolve the constant expression before returning
18046 2004-07-19 Martin Baulig <martin@ximian.com>
18048 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
18049 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
18050 the return type of the new EmitContext.
18052 2004-07-18 Martin Baulig <martin@ximian.com>
18054 * class.cs (Property.Define): Fix iterators.
18056 * iterators.cs (Iterator.Define): Moved the
18057 `container.AddInterator (this)' call here from the .ctor; only do
18058 it if we resolved successfully.
18060 2004-07-17 Miguel de Icaza <miguel@ximian.com>
18062 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
18063 `true' for preprocessing directives that we parse. The return
18064 value indicates whether we should return to regular tokenizing or
18065 not, not whether it was parsed successfully.
18067 In the past if we were in: #if false ... #line #endif, we would
18068 resume parsing after `#line'. See bug 61604.
18070 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
18071 building: IsEnumType should return true only for enums, not for
18072 enums or System.Enum itself. This fixes #61593.
18074 Likely what happened is that corlib was wrong: mcs depended on
18075 this bug in some places. The bug got fixed, we had to add the
18076 hack, which caused bug 61593.
18078 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
18079 that was a workaround for the older conditions.
18081 2004-07-16 Ben Maurer <bmaurer@ximian.com>
18083 * assign.cs: IAssignMethod has a new interface, as documented
18084 inline. All assignment code now uses this new api.
18086 * ecore.cs, expression.cs: All classes which implement
18087 IAssignMethod now use the new interface.
18089 * expression.cs (Invocation): add a hack to EmitCall so that
18090 IndexerAccess can be the target of a compound assignment without
18091 evaluating its arguments twice.
18093 * statement.cs: Handle changes in Invocation api.
18095 2004-07-16 Martin Baulig <martin@ximian.com>
18097 * iterators.cs: Rewrote this. We're now using one single Proxy
18098 class for both the IEnumerable and the IEnumerator interface and
18099 `Iterator' derives from Class so we can use the high-level API.
18101 * class.cs (TypeContainer.AddIterator): New method.
18102 (TypeContainer.DoDefineType): New protected virtual method, which
18103 is called from DefineType().
18104 (TypeContainer.DoDefineMembers): Call DefineType() and
18105 DefineMembers() on all our iterators.
18106 (TypeContainer.Emit): Call Emit() on all our iterators.
18107 (TypeContainer.CloseType): Call CloseType() on all our iterators.
18109 * codegen.cs (EmitContext.CurrentIterator): New public field.
18111 2004-07-15 Martin Baulig <martin@ximian.com>
18114 (TypeManager.not_supported_exception_type): New type.
18116 2004-07-14 Martin Baulig <martin@ximian.com>
18118 * iterators.cs: Use real error numbers.
18120 2004-07-14 Martin Baulig <martin@ximian.com>
18122 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
18123 requires this to be a System.Collection.IEnumerable and not a
18124 class implementing that interface.
18125 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
18127 2004-07-13 Marek Safar <marek.safar@seznam.cz>
18129 * class.cs: Fixed previous fix, it broke some error tests.
18131 2004-07-12 Martin Baulig <martin@ximian.com>
18133 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
18136 2004-07-09 Miguel de Icaza <miguel@ximian.com>
18138 * assign.cs (LocalTemporary): Add new argument: is_address,If
18139 `is_address' is true, then the value that we store is the address
18140 to the real value, and not the value itself.
18142 * ecore.cs (PropertyExpr): use the new local temporary
18143 stuff to allow us to handle X.Y += z (where X is a struct)
18145 2004-07-08 Martin Baulig <martin@ximian.com>
18147 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
18148 not always return, just like we're doing in Using.Resolve().
18150 2004-07-07 Miguel de Icaza <miguel@ximian.com>
18152 * cs-parser.jay (fixed_statement): flag this as Pinned.
18154 2004-07-06 Miguel de Icaza <miguel@ximian.com>
18156 * typemanager.cs (TypeManager): Removed MakePinned method, this
18157 mechanism is replaced with the .NET 2.x compatible mechanism of
18158 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
18160 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
18161 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
18162 `IsFixed' property which has a different meaning.
18164 2004-07-02 Raja R Harinath <rharinath@novell.com>
18166 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
18167 visible from inside a nested class, not just the names of the
18168 immediately enclosing class.
18169 Fix for bug #60730.
18171 2004-06-24 Raja R Harinath <rharinath@novell.com>
18173 * expression.cs (BetterConversion): Remove buggy special-case
18174 handling of "implicit constant expression conversions". At this
18175 point, we already know that the conversion is possible -- we're
18176 only checking to see which is better.
18178 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18180 * cs-parser.jay: Added error CS0210 test.
18182 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18184 * cs-parser.jay: Added error CS0134 test.
18186 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18189 * cs-parser.jay: Added error CS0145 test.
18191 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18193 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
18195 2004-06-23 Ben Maurer <bmaurer@ximian.com>
18197 * expression.cs (StackAlloc.Resolve): The argument may not
18198 be a constant; deal with this case.
18200 2004-06-23 Marek Safar <marek.safar@seznam.cz>
18202 * attribute.cs (IndexerName_GetIndexerName): Renamed to
18203 GetIndexerAttributeValue.
18204 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
18206 * class.cs (Indexer.Define): Added error tests for CS0415,
18209 2004-06-23 Miguel de Icaza <miguel@ximian.com>
18211 * attribute.cs (Attribute.Resolve): Keep field code in sync with
18214 2004-06-23 Martin Baulig <martin@ximian.com>
18216 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
18217 neither return nor throw, reset the barrier as well. Fixes #60457.
18219 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
18221 * class.cs : EventAttributes is now set to None by default.
18222 This fixes bug #60459.
18224 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18227 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18228 Don't throw exception but return null (it's sufficient now).
18230 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18232 * typemanager.cs (GetArgumentTypes): Faster implementation.
18234 2004-06-18 Martin Baulig <martin@ximian.com>
18236 * attribute.cs (Attribute.Resolve): Check whether we're an
18237 EmptyCast which a Constant child. Fixes #60333.
18239 2004-06-17 Ben Maurer <bmaurer@ximian.com>
18241 * statement.cs (EmitCollectionForeach): Account for the fact that
18242 not all valuetypes are in areas which we can take the address of.
18243 For these variables, we store to a temporary variable. Also, make
18244 sure that we dont emit a `callvirt' on a valuetype method.
18246 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18248 * expression.cs (StackAlloc.DoReSolve): Added test for
18249 negative parameter (CS0247).
18251 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18254 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
18256 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18259 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
18262 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18264 Fix bug #58254 & cs1555.cs, cs1556.cs
18265 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
18267 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18269 * cs-parser.jay: Added error CS1669 test for indexers.
18271 2004-06-11 Martin Baulig <martin@ximian.com>
18273 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
18274 call this twice: for params and varargs methods.
18276 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18279 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
18281 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18283 * attribute.cs (Attribute.GetValidTargets): Made public.
18286 (AbstractPropertyEventMethod): New class for better code sharing.
18287 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
18289 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
18291 2004-06-11 Raja R Harinath <rharinath@novell.com>
18294 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
18295 that the call to Resolve is part of a MemberAccess.
18296 (Expression.Resolve): Use it for SimpleName resolution.
18297 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
18298 Add 'intermediate' boolean argument.
18299 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
18300 error message when the SimpleName can be resolved ambiguously
18301 between an expression and a type.
18302 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
18304 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
18305 call on the left-side.
18307 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18310 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
18312 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18314 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
18316 2004-06-11 Martin Baulig <martin@ximian.com>
18318 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
18319 varargs methods if applicable.
18321 2004-06-11 Martin Baulig <martin@ximian.com>
18323 * expression.cs (Invocation.EmitCall): Don't use
18324 `method.CallingConvention == CallingConventions.VarArgs' since the
18325 method could also have `CallingConventions.HasThis'.
18327 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18329 * class.cs (Event.GetSignatureForError): Implemented.
18330 Fixed crash in error test cs3010.cs
18332 2004-06-10 Miguel de Icaza <miguel@ximian.com>
18334 * cs-tokenizer.cs: Change the way we track __arglist to be
18335 consistent with the other keywords.
18337 2004-06-09 Miguel de Icaza <miguel@ximian.com>
18339 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
18342 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
18344 * codegen.cs: Check that all referenced assemblies have a strongname
18345 before strongnaming the compiled assembly. If not report error CS1577.
18346 Fix bug #56563. Patch by Jackson Harper.
18347 * typemanager.cs: Added a method to return all referenced assemblies.
18348 Fix bug #56563. Patch by Jackson Harper.
18350 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18353 (Method.ApplyAttributeBuilder): Moved and added conditional
18354 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
18357 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
18359 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18362 * class.cs: (EventField.attribute_targets): Changed default target.
18364 2004-06-08 Martin Baulig <martin@ximian.com>
18366 * expression.cs (Invocation.EmitCall): Enable varargs methods.
18368 2004-06-08 Martin Baulig <martin@ximian.com>
18370 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
18372 2004-06-07 Martin Baulig <martin@ximian.com>
18374 Added support for varargs methods.
18376 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
18379 * cs-parser.jay: Added support for `__arglist'.
18381 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
18383 * expression.cs (Argument.AType): Added `ArgList'.
18384 (Invocation): Added support for varargs methods.
18385 (ArglistAccess): New public class.
18386 (Arglist): New public class.
18388 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
18390 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
18391 a method's top-level block if the method has varargs.
18393 * support.cs (ReflectionParameters, InternalParameters): Added
18394 support for varargs methods.
18396 2004-06-07 Miguel de Icaza <miguel@ximian.com>
18398 * class.cs: Provide location in indexer error report.
18400 * driver.cs: Use standard names.
18402 * namespace.cs: Catch the use of using after a namespace has been
18403 declared also on using aliases.
18405 2004-06-03 Raja R Harinath <rharinath@novell.com>
18408 * typemanager.cs (closure_private_ok, closure_invocation_type)
18409 (closure_qualifier_type, closure_invocation_assembly)
18410 (FilterWithClosure): Move to ...
18411 (Closure): New internal nested class.
18412 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
18413 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
18414 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
18415 (MemberLookup, MemberLookupFailed): Use it.
18416 * expression.cs (New.DoResolve): Treat the lookup for the
18417 constructor as being qualified by the 'new'ed type.
18418 (Indexers.GetIndexersForTypeOrInterface): Update.
18420 2004-06-03 Marek Safar <marek.safar@seznam.cz>
18423 (GetConditionalAttributeValue): New method. Returns
18424 condition of ConditionalAttribute.
18425 (SearchMulti): New method. Returns all attributes of type 't'.
18426 Use it when attribute is AllowMultiple = true.
18427 (IsConditionalMethodExcluded): New method.
18430 (Method.IsExcluded): Implemented. Returns true if method has conditional
18431 attribute and the conditions is not defined (method is excluded).
18432 (IMethodData): Extended interface for ConditionalAttribute support.
18433 (PropertyMethod.IsExcluded): Implemented.
18436 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
18439 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
18442 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
18444 * expression.cs (ArrayCreationExpression): Make this just an
18445 `expression'. It can't be a statement, so the code here was
18448 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18451 * typemanager.cs (GetFullNameSignature): New method for
18454 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18457 * class.cs (MemberBase.GetSignatureForError): New virtual method.
18458 Use this method when MethodBuilder is null.
18459 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
18460 Added test for error CS0626 (MONO reports error for this situation).
18461 (IMethodData.GetSignatureForError): Extended interface.
18463 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18466 (AttributeTester.GetObsoleteAttribute): Returns instance of
18467 ObsoleteAttribute when type is obsolete.
18470 (TypeContainer.VerifyObsoleteAttribute): Override.
18471 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
18472 (MethodCode.VerifyObsoleteAttribute): Override.
18473 (MemberBase.VerifyObsoleteAttribute): Override.
18476 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
18477 and report proper error.
18480 Delegate.VerifyObsoleteAttribute): Override.
18483 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
18484 and report proper error.
18485 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
18488 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
18492 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
18493 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
18494 Added test for ObsoleteAttribute.
18497 (Catch): Derived from Statement.
18499 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18501 Fixed bug #59071 & cs0160.cs
18503 * statement.cs (Try.Resolve): Check here whether order of catch
18504 clauses matches their dependencies.
18506 2004-05-31 Miguel de Icaza <miguel@ximian.com>
18508 * Reverted patch to namespace.cs (Use lookuptypedirect). This
18509 caused a regression: #59343. Referencing nested classes from an
18510 assembly stopped working.
18512 2004-05-31 Martin Baulig <martin@ximian.com>
18514 MCS is now frozen for beta 2.
18516 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18518 * convert.cs: add a trivial cache for overload operator resolution.
18520 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18522 * decl.cs: If possible, use lookuptypedirect here. We can only do
18523 this if there is no `.' after the namespace. Avoids using
18524 LookupType, which does lots of slow processing.
18525 (FindNestedType) New method, does what it says :-).
18526 * namespace.cs: use LookupTypeDirect.
18527 * rootcontext.cs: use membercache, if possible.
18528 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
18530 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18533 According to the spec,
18535 In a member access of the form E.I, if E is a single identifier,
18536 and if the meaning of E as a simple-name (§7.5.2) is a constant,
18537 field, property, localvariable, or parameter with the same type as
18538 the meaning of E as a type-name (§3.8), then both possible
18539 meanings of E are permitted.
18541 We did not check that E as a simple-name had the same type as E as
18544 This trivial check gives us 5-7% on bootstrap time.
18546 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18548 * expression.cs (Invocation.OverloadResolve): Avoid the
18549 use of hashtables and boxing here by allocating on demand.
18551 2004-05-30 Martin Baulig <martin@ximian.com>
18553 * rootcontext.cs (RootContext.LookupType): Don't cache things if
18554 we're doing a silent lookup. Don't try to lookup nested types in
18555 TypeManager.object_type (thanks to Ben Maurer).
18557 2004-05-30 Martin Baulig <martin@ximian.com>
18559 Committing a patch from Ben Maurer.
18561 * rootcontext.cs (RootContext.LookupType): Cache negative results.
18563 2004-05-29 Martin Baulig <martin@ximian.com>
18565 * class.cs (IMethodData.ShouldIgnore): New method.
18567 * typemanager.cs (TypeManager.MethodFlags): Don't take a
18568 `Location' argument, we don't need it anywhere. Use
18569 `IMethodData.ShouldIgnore ()' instead of
18570 `MethodData.GetMethodFlags ()'.
18571 (TypeManager.AddMethod): Removed.
18572 (TypeManager.AddMethod2): Renamed to AddMethod.
18574 2004-05-29 Martin Baulig <martin@ximian.com>
18576 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
18578 * convert.cs (Convert.ImplicitReferenceConversion): If we're
18579 converting from a class type S to an interface type and we already
18580 have an object on the stack, don't box it again. Fixes #52578.
18582 2004-05-29 Martin Baulig <martin@ximian.com>
18584 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18585 Added support for `params' parameters. Fixes #59267.
18587 2004-05-29 Martin Baulig <martin@ximian.com>
18589 * literal.cs (NullPointer): Provide a private .ctor which sets
18590 `type' to TypeManager.object_type. Fixes #59048.
18592 2004-05-29 Martin Baulig <martin@ximian.com>
18594 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
18595 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
18597 * ecore.cs (EventExpr.instance_expr): Make the field private.
18599 2004-05-26 Marek Safar <marek.safar@seznam.cz>
18601 Fixed bug #50080 & cs0214-2.cs
18602 * expression.cs (Cast.DoResolve): Check unsafe context here.
18604 * statement.cs (Resolve.DoResolve): Likewise.
18606 2004-05-26 Martin Baulig <martin@ximian.com>
18608 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
18610 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
18611 (RootContext.LookupType): Pass down the `silent' flag.
18613 2004-05-25 Martin Baulig <martin@ximian.com>
18616 (MethodGroupExpr.IdenticalTypeName): New public property.
18617 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
18618 expression actually refers to a type.
18620 2004-05-25 Martin Baulig <martin@ximian.com>
18622 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
18623 for #56176 and made it actually work.
18625 2004-05-25 Martin Baulig <martin@ximian.com>
18627 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
18628 (FieldExpr, PropertyExpr): Override and implement
18629 CacheTemporaries. Fixes #52279.
18631 2004-05-25 Miguel de Icaza <miguel@ximian.com>
18633 * location.cs: In the new compiler listing a file twice is a
18634 warning, not an error.
18636 2004-05-24 Martin Baulig <martin@ximian.com>
18638 * enum.cs (Enum.DefineType): For the `BaseType' to be a
18639 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
18641 2004-05-24 Martin Baulig <martin@ximian.com>
18643 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
18644 walking the `using' list. Fixes #53921.
18646 2004-05-24 Martin Baulig <martin@ximian.com>
18648 * const.cs (Const.LookupConstantValue): Added support for
18649 EmptyCast's; fixes #55251.
18651 2004-05-24 Martin Baulig <martin@ximian.com>
18653 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
18654 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
18655 which does the CS0135 check. The reason is that we first need to
18656 check whether the variable actually exists.
18658 2004-05-24 Martin Baulig <martin@ximian.com>
18660 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
18661 than RootContext.LookupType() to find the explicit interface
18662 type. Fixes #58584.
18664 2004-05-24 Raja R Harinath <rharinath@novell.com>
18666 * Makefile: Simplify. Use executable.make.
18667 * mcs.exe.sources: New file. List of sources of mcs.exe.
18669 2004-05-24 Anders Carlsson <andersca@gnome.org>
18673 Use the invariant culture when doing String.Compare for CLS case
18676 2004-05-23 Martin Baulig <martin@ximian.com>
18678 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
18679 don't have any dots. Fixes #52622, added cs0246-8.cs.
18681 * namespace.cs (NamespaceEntry.Lookup): Likewise.
18683 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18685 * class.cs (MemberBase.Define): Reuse MemberType member for
18686 resolved type. Other methods can use it too.
18688 2004-05-23 Martin Baulig <martin@ximian.com>
18690 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
18691 the variable also exists in the current block (otherwise, we need
18692 to report a CS0103). Fixes #58670.
18694 2004-05-23 Martin Baulig <martin@ximian.com>
18696 * flowanalysis.cs (Reachability.Reachable): Compute this
18697 on-the-fly rather than storing it as a field.
18699 2004-05-23 Martin Baulig <martin@ximian.com>
18701 * flowanalysis.cs (Reachability.And): Manually compute the
18702 resulting `barrier' from the reachability.
18704 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18707 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
18708 instance of ObsoleteAttribute when symbol is obsolete.
18711 (IMethodData): Extended interface for ObsoleteAttribute support.
18713 2004-05-22 Marek Safar <marek.safar@seznam.cz>
18715 * attribute.cs: Fix bug #55970
18717 2004-05-22 Marek Safar <marek.safar@seznam.cz>
18721 (GetObsoleteAttribute): New method. Creates the instance of
18723 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
18724 ObsoleteAttribute when member is obsolete.
18725 (AttributeTester.Report_ObsoleteMessage): Common method for
18726 Obsolete error/warning reporting.
18729 (TypeContainer.base_classs_type): New member for storing parent type.
18732 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
18733 for this MemberCore.
18735 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18737 * attribute.cs, const.cs: Fix bug #58590
18739 2004-05-21 Martin Baulig <martin@ximian.com>
18741 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
18742 out parameters if the end of the method is unreachable. Fixes
18745 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18747 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
18748 Hari was right, why extra method.
18750 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18752 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
18754 2004-05-20 Martin Baulig <martin@ximian.com>
18756 Merged this back from gmcs to keep the differences to a minumum.
18758 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
18759 instead of a Declspace.
18760 (Attribute.ResolveType): Likewise.
18761 (Attributes.Search): Likewise.
18762 (Attributes.Contains): Likewise.
18763 (Attributes.GetClsCompliantAttribute): Likewise.
18765 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
18767 (MethodData.ApplyAttributes): Take an EmitContext instead of a
18770 2004-05-19 Marek Safar <marek.safar@seznam.cz>
18772 Fix bug #58688 (MCS does not report error when the same attribute
18775 * attribute.cs (Attribute.Emit): Distinction between null and default.
18777 2004-05-19 Raja R Harinath <rharinath@novell.com>
18779 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
18780 of a top-level attribute without an attribute target.
18781 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
18783 (Attribute.Conditional_GetConditionName),
18784 (Attribute.Obsolete_GetObsoleteMessage): Update.
18785 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
18786 part of ScanForIndexerName.
18787 (Attribute.CanIgnoreInvalidAttribute): New function.
18788 (Attribute.ScanForIndexerName): Move to ...
18789 (Attributes.ScanForIndexerName): ... here.
18790 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
18791 (Attributes.Search): New internal variant that can choose not to
18792 complain if types aren't resolved. The original signature now
18794 (Attributes.GetClsCompliantAttribute): Use internal variant, with
18795 complaints suppressed.
18796 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
18797 only if it not useful.
18798 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
18799 top-level for attributes that are shared between the assembly
18800 and a top-level class.
18801 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
18802 * class.cs: Update to reflect changes.
18803 (DefineIndexers): Fuse loops.
18804 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
18805 a couple more variants of attribute names.
18807 2004-05-18 Marek Safar <marek.safar@seznam.cz>
18809 Fix bug #52585 (Implemented explicit attribute declaration)
18812 (Attributable.ValidAttributeTargets): New abstract method. It gets
18813 list of valid attribute targets for explicit target declaration.
18814 (Attribute.Target): It holds target itself.
18815 (AttributeSection): Removed.
18816 (Attribute.CheckTargets): New method. It checks whether attribute
18817 target is valid for the current element.
18820 (EventProperty): New class. For events that are declared like
18821 property (with add and remove accessors).
18822 (EventField): New class. For events that are declared like field.
18825 * cs-parser.jay: Implemented explicit attribute target declaration.
18827 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
18828 Override ValidAttributeTargets.
18831 (ReturnParameter): Class for applying custom attributes on
18833 (ParameterAtribute): New class. Class for applying custom
18834 attributes on the parameter type.
18836 2004-05-17 Miguel de Icaza <miguel@ximian.com>
18838 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
18841 (Method): Allow UNSAFE here.
18843 * modifiers.cs: Support unsafe reporting.
18845 2004-05-17 Marek Safar <marek.safar@seznam.cz>
18847 * decl.cs: Fix bug #58478.
18849 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18851 * statement.cs: When checking for unreachable code on an EmptyStatement,
18852 set the location. Fixes bug #58488.
18854 2004-05-13 Miguel de Icaza <miguel@ximian.com>
18856 * driver.cs: Add -pkg handling.
18858 From Gonzalo: UseShelLExecute=false
18860 2004-05-12 Marek Safar <marek.safar@seznam.cz>
18863 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
18865 (Attribute.IsClsCompliaceRequired): Moved to base for better
18867 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
18868 when attribute is AttributeUsageAttribute.
18869 (Attribute.GetValidTargets): Simplified.
18870 (Attribute.GetAttributeUsage): New method returns AttributeUsage
18871 attribute for this type.
18872 (Attribute.ApplyAttributes): Method renamed to Emit and make
18874 (GlobalAttributeSection): New class for special handling of global
18875 attributes (assembly, module).
18876 (AttributeSection.Emit): New method.
18878 * class.cs: Implemented Attributable abstract methods.
18879 (MethodCore.LabelParameters): Moved to Parameter class.
18880 (Accessor): Is back simple class.
18881 (PropertyMethod): Implemented Attributable abstract class.
18882 (DelegateMethod): Implemented Attributable abstract class.
18883 (Event): New constructor for disctintion between normal Event
18884 and Event with accessors.
18886 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
18888 * codegen.cs, const.cs, decl.cs, delegate.cs:
18889 (CommonAssemblyModulClass): Implemented Attributable abstract class
18892 * enum.cs: Implement IAttributeSupport interface.
18893 (EnumMember): New class for emum members. Implemented Attributable
18897 (ParameterBase): Is abstract.
18898 (ReturnParameter): New class for easier [return:] attribute handling.
18900 * typemanager.cs: Removed builder_to_attr.
18902 2004-05-11 Raja R Harinath <rharinath@novell.com>
18905 * attribute.cs (Attribute.GetPositionalValue): New function.
18906 * class.cs (TypeContainer.VerifyMembers): New function.
18907 (TypeContainer.Emit): Use it.
18908 (ClassOrStruct): New base class for Class and Struct.
18909 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
18910 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
18912 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
18913 then each non-static field should have a FieldOffset attribute.
18914 Otherwise, none of the fields should have a FieldOffset attribute.
18915 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
18916 and FieldOffset attributes.
18917 * typemanager.cs (TypeManager.struct_layout_attribute_type)
18918 (TypeManager.field_offset_attribute_type): New core types.
18919 (TypeManager.InitCoreTypes): Initialize them.
18921 2004-05-11 Michal Moskal <malekith@pld-linux.org>
18923 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
18924 Return correct type.
18927 2004-05-09 Miguel de Icaza <miguel@ximian.com>
18929 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
18930 be implicitly converted to ulong.
18932 * expression.cs: The logic for allowing operator &, | and ^ worked
18933 was wrong, it worked before because we did not report an error in
18934 an else branch. Fixes 57895.
18936 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
18937 allow volatile fields to be reference types.
18939 2004-05-07 Miguel de Icaza <miguel@ximian.com>
18941 * driver.cs: Add support for /debug-
18943 2004-05-07 Raja R Harinath <rharinath@novell.com>
18945 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
18946 Add a 'complain' parameter to silence errors.
18947 (Attribute.Resolve): Update to changes. Put in sanity check to catch
18948 silently overlooked type-resolutions.
18949 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
18950 to reflect changes.
18951 (Attributes.Search): New function.
18952 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
18953 (Attributes.GetAttributeFullName): Remove hack.
18954 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
18955 Update to reflect changes.
18956 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
18957 Use Attributes.Search instead of nested loops.
18959 2004-05-07 Marek Safar <marek.safar@seznam.cz>
18962 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
18963 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
18964 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
18966 * report.cs: (Report.Warning): Renamed to Warning_T because of
18967 parameter collision.
18969 2004-05-05 Raja R Harinath <rharinath@novell.com>
18971 * expression.cs (MemberAccess.ResolveMemberAccess):
18972 Exit with non-zero status after Report.Error.
18973 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
18975 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
18977 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
18979 * support.cs: Don't hang when the file is empty.
18981 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
18983 * support.cs: In SeekableStreamReader, compute the preamble size of the
18984 underlying stream. Position changes should take into account that initial
18987 2004-05-03 Todd Berman <tberman@sevenl.net>
18989 * driver.cs: remove unused GetSysVersion function.
18991 2004-05-03 Todd Berman <tberman@sevenl.net>
18993 * driver.cs: Remove the hack from saturday, as well as the hack
18994 from jackson (LoadAssemblyFromGac), also adds the CWD to the
18995 link_paths to get that bit proper.
18997 2004-05-01 Todd Berman <tberman@sevenl.net>
18999 * driver.cs: Try a LoadFrom before a Load, this checks the current
19000 path. This is currently a bug in mono that is be fixed, however, this
19001 provides a workaround for now. This will be removed when the bug
19004 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
19006 * CryptoConvert.cs: Updated to latest version. Fix issue with
19007 incomplete key pairs (#57941).
19009 2004-05-01 Todd Berman <tberman@sevenl.net>
19011 * driver.cs: Remove '.' from path_chars, now System.* loads properly
19014 2004-04-30 Jackson Harper <jackson@ximian.com>
19016 * codegen.cs: Open keys readonly.
19018 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19020 * typemanager.cs: don't report cyclic struct layout when a struct
19021 contains 2 or more fields of the same type. Failed for Pango.AttrShape
19022 which has 2 Pango.Rectangle fields.
19024 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
19026 * expression.cs: Handle IntPtr comparisons with IL code
19027 rather than a method call.
19029 2004-04-29 Martin Baulig <martin@ximian.com>
19031 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
19032 the list of PropertyInfo's in class hierarchy and find the
19033 accessor. Fixes #56013.
19035 2004-04-29 Martin Baulig <martin@ximian.com>
19037 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
19039 2004-04-29 Martin Baulig <martin@ximian.com>
19041 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
19043 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
19045 2004-04-29 Martin Baulig <martin@ximian.com>
19047 * class.cs (ConstructorInitializer.Resolve): Check whether the
19048 parent .ctor is accessible. Fixes #52146.
19050 2004-04-29 Martin Baulig <martin@ximian.com>
19052 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
19054 * statement.cs (Using.EmitLocalVariableDecls): Use
19055 TypeManager.idisposable_type, not typeof (IDisposable).
19056 (Foreach.EmitCollectionForeach): Added support for valuetypes.
19058 2004-04-29 Martin Baulig <martin@ximian.com>
19060 * class.cs (Event.Define): Don't emit the field and don't set
19061 RTSpecialName and SpecialName for events on interfaces. Fixes
19064 2004-04-29 Raja R Harinath <rharinath@novell.com>
19066 Refactor Attribute.ApplyAttributes.
19067 * attribute.cs (Attributable): New base class for objects that can
19068 have Attributes applied on them.
19069 (Attribute): Make AttributeUsage fields public.
19070 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
19071 (Attribute.IsInternalCall): New property.
19072 (Attribute.UsageAttr): Convert to a public read-only property.
19073 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
19074 (Attribute.ResolveType, Attribute.Resolve)
19075 (Attribute.ScanForIndexerName): Update to reflect changes.
19076 (Attribute.CheckAttributeTarget): Re-format.
19077 (Attribute.ApplyAttributes): Refactor, to various
19078 Attributable.ApplyAttributeBuilder methods.
19079 * decl.cs (MemberCore): Make Attributable.
19080 * class.cs (Accessor): Make Attributable.
19081 (MethodData.ApplyAttributes): Use proper attribute types, not
19083 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
19084 (TypeContainer.ApplyAttributeBuilder)
19085 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
19086 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
19087 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
19088 (Operator.ApplyAttributeBuilder): New factored-out methods.
19089 * const.cs (Const.ApplyAttributeBuilder): Likewise.
19090 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
19091 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
19092 * parameter.cs (ParameterBase): New Attributable base class
19093 that can also represent Return types.
19094 (Parameter): Update to the changes.
19096 2004-04-29 Jackson Harper <jackson@ximian.com>
19098 * driver.cs: Prefer the corlib system version when looking for
19099 assemblies in the GAC. This is still a hack, but its a better hack
19102 2004-04-29 Marek Safar <marek.safar@seznam.cz>
19104 * decl.cs, enum.cs: Improved error 3005 reporting.
19106 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
19107 (related_symbols): New private member for list of symbols
19108 related to reported error/warning.
19110 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
19112 2004-04-29 Martin Baulig <martin@ximian.com>
19114 * ecore.cs (Expression.Constantify): If we're an enum and
19115 TypeManager.TypeToCoreType() doesn't give us another type, use
19116 t.UnderlyingSystemType. Fixes #56178.
19118 2004-04-29 Martin Baulig <martin@ximian.com>
19120 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
19121 interfaces and for each interface, only add members directly
19122 declared in that interface. Fixes #53255.
19124 2004-04-28 Martin Baulig <martin@ximian.com>
19126 * expression.cs (ConditionalLogicalOperator): Use a temporary
19127 variable for `left' to avoid that we evaluate it more than once;
19130 2004-04-28 Martin Baulig <martin@ximian.com>
19132 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
19135 2004-04-28 Martin Baulig <martin@ximian.com>
19137 * statement.cs (LocalInfo.Resolve): Check whether the type is not
19140 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
19141 whether the type is not void (CS1547).
19143 2004-04-28 Martin Baulig <martin@ximian.com>
19145 * expression.cs (Unary.DoResolveLValue): Override this and report
19146 CS0131 for anything but Operator.Indirection.
19148 2004-04-28 Martin Baulig <martin@ximian.com>
19150 Committing a patch from Ben Maurer; see bug #50820.
19152 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19155 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19158 2004-04-28 Martin Baulig <martin@ximian.com>
19160 Committing a patch from Ben Maurer; see bug #50820.
19162 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19165 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19168 2004-04-28 Martin Baulig <martin@ximian.com>
19170 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
19171 (Block.AddLabel): Call DoLookupLabel() to only search in the
19174 2004-04-28 Martin Baulig <martin@ximian.com>
19176 * cfold.cs (ConstantFold.BinaryFold): Added special support for
19177 comparing StringConstants and NullLiterals in Equality and Inequality.
19179 2004-04-28 Jackson Harper <jackson@ximian.com>
19181 * driver.cs: Attempt to load referenced assemblies from the
19182 GAC. This is the quick and dirty version of this method that
19183 doesnt take into account versions and just takes the first
19184 canidate found. Will be good enough for now as we will not have more
19185 then one version installed into the GAC until I update this method.
19187 2004-04-28 Martin Baulig <martin@ximian.com>
19189 * typemanager.cs (TypeManager.CheckStructCycles): New public
19190 static method to check for cycles in the struct layout.
19192 * rootcontext.cs (RootContext.PopulateTypes): Call
19193 TypeManager.CheckStructCycles() for each TypeContainer.
19194 [Note: We only need to visit each type once.]
19196 2004-04-28 Martin Baulig <martin@ximian.com>
19198 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
19200 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
19201 success and added `out object value'. Use a `bool resolved' field
19202 to check whether we've already been called rather than
19203 `ConstantValue != null' since this breaks for NullLiterals.
19205 2004-04-28 Raja R Harinath <rharinath@novell.com>
19207 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
19208 setting of this flag, since the 'set' method may be non-public.
19210 2004-04-28 Raja R Harinath <rharinath@novell.com>
19212 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
19213 check on current_vector.Block.
19215 2004-04-27 Martin Baulig <martin@ximian.com>
19217 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
19218 a field initializer. Fixes #56459.
19220 2004-04-27 Martin Baulig <martin@ximian.com>
19222 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
19223 we're not attempting to use an indexer. Fixes #52154.
19225 2004-04-27 Martin Baulig <martin@ximian.com>
19227 * statement.cs (Return): Don't create a return label if we don't
19228 need it; reverts my change from January 20th. Thanks to Ben
19231 2004-04-27 Martin Baulig <martin@ximian.com>
19233 According to the spec, `goto' can only leave a nested scope, but
19236 * statement.cs (Block.LookupLabel): Only lookup in the current
19237 block, don't recurse into parent or child blocks.
19238 (Block.AddLabel): Check in parent and child blocks, report
19239 CS0140/CS0158 if we find a duplicate.
19240 (Block): Removed this indexer for label lookups.
19241 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
19242 this already does the error reporting for us.
19245 (FlowBranching.UsageVector.Block): New public variable; may be null.
19246 (FlowBranching.CreateSibling): Added `Block' argument.
19247 (FlowBranching.LookupLabel): New public virtual method. Lookup a
19248 label for the target of a `goto' and check whether we're not
19249 leaving a `finally'.
19251 2004-04-27 Martin Baulig <martin@ximian.com>
19253 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
19254 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
19257 2004-04-27 Martin Baulig <martin@ximian.com>
19259 * statement.cs (Block.AddLabel): Also check for implicit blocks
19260 and added a CS0158 check.
19262 2004-04-27 Martin Baulig <martin@ximian.com>
19264 * flowanalysis.cs (FlowBranchingLoop): New class.
19265 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
19266 UsageVector's instead of an ArrayList.
19267 (FlowBranching.Label): Likewise.
19268 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
19269 (FlowBranching.AddBreakVector): New method.
19271 2004-04-27 Miguel de Icaza <miguel@ximian.com>
19273 * attribute.cs: Small regression fix: only convert the type if we
19274 the type is different, fixes System.Drawing build.
19276 2004-04-27 Martin Baulig <martin@ximian.com>
19278 * attribute.cs (Attribute.Resolve): If we have a constant value
19279 for a named field or property, implicity convert it to the correct
19282 2004-04-27 Raja R Harinath <rharinath@novell.com>
19284 * statement.cs (Block.Block): Implicit blocks share
19285 'child_variable_names' fields with parent blocks.
19286 (Block.AddChildVariableNames): Remove.
19287 (Block.AddVariable): Mark variable as "used by a child block" in
19288 every surrounding block.
19289 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
19290 been used in a child block, complain about violation of "Invariant
19291 meaning in blocks" rule.
19292 * cs-parser.jay (declare_local_variables): Don't use
19293 AddChildVariableNames.
19294 (foreach_statement): Don't create an implicit block: 'foreach'
19295 introduces a scope.
19297 2004-04-23 Miguel de Icaza <miguel@ximian.com>
19299 * convert.cs (ImplicitNumericConversion): 0 is also positive when
19300 converting from 0L to ulong. Fixes 57522.
19302 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19304 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
19305 derived class hides via 'new' keyword field from base class (test-242.cs).
19306 TODO: Handle this in the more general way.
19308 * class.cs (CheckBase): Ditto.
19310 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19312 * decl.cs (caching_flags): New member for storing cached values
19314 (MemberCore.Flags): New enum where bit flags for caching_flags
19316 (MemberCore.cls_compliance): Moved to caching_flags.
19317 (DeclSpace.Created): Moved to caching_flags.
19319 * class.cs: Use caching_flags instead of DeclSpace.Created
19321 2004-04-21 Miguel de Icaza <miguel@ximian.com>
19323 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
19324 if we are only a derived class, not a nested class.
19326 * typemanager.cs: Same as above, but do this at the MemberLookup
19327 level (used by field and methods, properties are handled in
19328 PropertyExpr). Allow for the qualified access if we are a nested
19331 2004-04-21 Marek Safar <marek.safar@seznam.cz>
19333 * class.cs: Refactoring.
19334 (IMethodData): New inteface; Holds links to parent members
19335 to avoid member duplication (reduced memory allocation).
19336 (Method): Implemented IMethodData interface.
19337 (PropertyBase): New inner classes for get/set methods.
19338 (PropertyBase.PropertyMethod): Implemented IMethodData interface
19339 (Event): New inner classes for add/remove methods.
19340 (Event.DelegateMethod): Implemented IMethodData interface.
19342 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
19343 EmitContext (related to class.cs refactoring).
19345 2004-04-21 Raja R Harinath <rharinath@novell.com>
19347 * delegate.cs (Delegate.VerifyApplicability): If the number of
19348 arguments are the same as the number of parameters, first try to
19349 verify applicability ignoring any 'params' modifier on the last
19353 2004-04-16 Raja R Harinath <rharinath@novell.com>
19355 * class.cs (TypeContainer.AddIndexer): Use
19356 'ExplicitInterfaceName' to determine if interface name was
19357 explicitly specified. 'InterfaceType' is not initialized at this time.
19358 (TypeContainer.DefineIndexers): Remove use of temporary list. The
19359 Indexers array is already in the required order. Initialize
19360 'IndexerName' only if there are normal indexers.
19361 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
19362 (TypeContainer.Emit): Emit DefaultMember attribute only if
19363 IndexerName is initialized.
19366 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
19368 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
19371 2004-04-15 Raja R Harinath <rharinath@novell.com>
19373 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
19377 * attribute.cs (Attribute.Resolve): Check for duplicate named
19381 2004-04-15 Miguel de Icaza <miguel@ximian.com>
19383 * iterators.cs (MarkYield): track whether we are in an exception,
19384 and generate code accordingly. Use a temporary value to store the
19385 result for our state.
19387 I had ignored a bit the interaction of try/catch with iterators
19388 since their behavior was not entirely obvious, but now it is
19389 possible to verify that our behavior is the same as MS .NET 2.0
19393 2004-04-14 Miguel de Icaza <miguel@ximian.com>
19395 * iterators.cs: Avoid creating temporaries if there is no work to
19398 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
19399 Enumerations, use TypeManager.EnumToUnderlying and call
19402 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
19405 (This.Emit): Use EmitContext.EmitThis to emit our
19408 (This.EmitAssign): Ditto.
19410 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
19411 codepaths, we will move all the functionality into
19414 (FieldExpr.EmitAssign): Ditto.
19416 This fixes several hidden bugs that I uncovered while doing a code
19417 review of this today.
19419 * codegen.cs (EmitThis): reworked so the semantics are more clear
19420 and also support value types "this" instances.
19422 * iterators.cs: Changed so that for iterators in value types, we
19423 do not pass the value type as a parameter.
19425 Initialization of the enumerator helpers is now done in the caller
19426 instead of passing the parameters to the constructors and having
19427 the constructor set the fields.
19429 The fields have now `assembly' visibility instead of private.
19431 2004-04-11 Miguel de Icaza <miguel@ximian.com>
19433 * expression.cs (Argument.Resolve): Check if fields passed as ref
19434 or out are contained in a MarshalByRefObject.
19436 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
19437 another compiler type.
19439 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
19441 * class.cs (Indexer.Define): use the new name checking method.
19442 Also, return false on an error.
19443 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
19444 (is_identifier_[start/part]_character): make static.
19446 2004-04-10 Miguel de Icaza <miguel@ximian.com>
19448 * expression.cs (Binary.ResolveOperator): Do no append strings
19449 twice: since we can be invoked more than once (array evaluation)
19450 on the same concatenation, take care of this here. Based on a fix
19451 from Ben (bug #56454)
19453 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
19455 * codegen.cs: Fix another case where CS1548 must be reported (when
19456 delay-sign isn't specified and no private is available #56564). Fix
19457 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
19458 error when MCS is used on the MS runtime and we need to delay-sign
19459 (which seems unsupported by AssemblyBuilder - see #56621).
19461 2004-04-08 Marek Safar <marek.safar@seznam.cz>
19463 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
19464 (TypeManager.ComputeNamespaces): Faster implementation for
19467 * compiler.csproj: Updated AssemblyName to mcs.
19469 2004-04-07 Miguel de Icaza <miguel@ximian.com>
19471 * rootcontext.cs: Add new types to the boot resolution.
19473 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
19474 MulticastDelegate is not allowed.
19476 * typemanager.cs: Add new types to lookup: System.TypedReference
19479 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
19480 check for TypedReference or ArgIterator, they are not allowed.
19482 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
19483 makes us properly catch 1510 in some conditions (see bug 56016 for
19486 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
19488 * CryptoConvert.cs: update from corlib version
19491 2004-04-05 Miguel de Icaza <miguel@ximian.com>
19493 * class.cs (Indexer.Define): Check indexername declaration
19495 2004-04-05 Marek Safar <marek.safar@seznam.cz>
19497 * attribute.cs (IsClsCompliant): Fixed problem with handling
19498 all three states (compliant, not-compliant, undetected).
19500 2004-03-30 Marek Safar <marek.safar@seznam.cz>
19502 * attribute.cs (Attribute): Location is now public.
19503 (Resolve): Store resolved arguments (pos_values) in attribute class.
19504 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
19505 (GetClsCompliantAttributeValue): New method that gets
19506 CLSCompliantAttribute value.
19507 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
19508 if exists else null.
19509 (AttributeTester): New class for CLS-Compliant verification routines.
19511 * class.cs (Emit): Add CLS-Compliant verification.
19512 (Method.GetSignatureForError): Implemented.
19513 (Constructor.GetSignatureForError): Implemented
19514 (Constructor.HasCompliantArgs): Returns if constructor has
19515 CLS-Compliant arguments.
19516 (Constructor.Emit): Override.
19517 (Construcor.IsIdentifierClsCompliant): New method; For constructors
19518 is needed to test only parameters.
19519 (FieldBase.GetSignatureForError): Implemented.
19520 (TypeContainer): New member for storing base interfaces.
19521 (TypeContainer.FindMembers): Search in base interfaces too.
19523 * codegen.cs (GetClsComplianceAttribute): New method that gets
19524 assembly or module CLSCompliantAttribute value.
19525 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
19527 (ModuleClass.Emit): Add error 3012 test.
19529 * const.cs (Emit): Override and call base for CLS-Compliant tests.
19531 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
19532 state for all decl types.
19533 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
19534 if CLS-Compliant tests are required.
19535 (IsClsCompliaceRequired): New method. Analyze whether code
19536 must be CLS-Compliant.
19537 (IsExposedFromAssembly): New method. Returns true when MemberCore
19538 is exposed from assembly.
19539 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
19540 value or gets cached value.
19541 (HasClsCompliantAttribute): New method. Returns true if MemberCore
19542 is explicitly marked with CLSCompliantAttribute.
19543 (IsIdentifierClsCompliant): New abstract method. This method is
19544 used to testing error 3005.
19545 (IsIdentifierAndParamClsCompliant): New method. Common helper method
19546 for identifier and parameters CLS-Compliant testing.
19547 (VerifyClsCompliance): New method. The main virtual method for
19548 CLS-Compliant verifications.
19549 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
19550 null. I don't know why is null (too many public members !).
19551 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
19552 and get value of first CLSCompliantAttribute that found.
19554 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
19555 (VerifyClsCompliance): Override and add extra tests.
19557 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
19558 clscheck- disable CLS-Compliant verification event if assembly is has
19559 CLSCompliantAttribute(true).
19561 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
19562 ApllyAttribute is now called in emit section as in the other cases.
19563 Possible future Emit integration.
19564 (IsIdentifierClsCompliant): New override.
19565 (VerifyClsCompliance): New override.
19566 (GetEnumeratorName): Returns full enum name.
19568 * parameter.cs (GetSignatureForError): Implemented.
19570 * report.cs (WarningData): New struct for Warning message information.
19571 (LocationOfPreviousError): New method.
19572 (Warning): New method. Reports warning based on the warning table.
19573 (Error_T): New method. Reports error based on the error table.
19575 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
19576 verifications are done here.
19578 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
19580 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
19581 CLSCompliantAttribute.
19582 (all_imported_types): New member holds all imported types from other
19584 (LoadAllImportedTypes): New method fills static table with exported types
19585 from all referenced assemblies.
19586 (Modules): New property returns all assembly modules.
19588 2004-03-30 Miguel de Icaza <miguel@ximian.com>
19590 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
19591 throwing a parser error.
19593 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
19594 which removes the hardcoded get_/set_ prefixes for properties, as
19595 IL allows for the properties to be named something else.
19599 * expression.cs: Do not override operand before we know if it is
19600 non-null. Fix 56207
19602 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19604 * typemanager.cs: support for pinned variables.
19606 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19608 * decl.cs, typemanager.cs: Avoid using an arraylist
19609 as a buffer if there is only one result set.
19611 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19613 * expression.cs: Make sure you cant call a static method
19614 with an instance expression, bug #56174.
19616 2004-03-29 Miguel de Icaza <miguel@ximian.com>
19618 * class.cs (IsDuplicateImplementation): Improve error reporting to
19619 flag 663 (method only differs in parameter modifier).
19621 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
19622 in preprocessor directives.
19624 * location.cs (LookupFile): Allow for the empty path.
19626 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
19627 better approach for some of that patch, but its failing with the
19628 CharSet enumeration. For now try/catch will do.
19630 * typemanager.cs: Do not crash if a struct does not have fields.
19633 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19635 * expression.cs: cs0213, cant fix a fixed expression.
19638 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19640 * cs-parser.jay: detect invalid embeded statements gracefully.
19643 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19645 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
19648 the invocation type may not be a subclass of the tye of the item/
19649 The type of the item must be a subclass of the invocation item.
19654 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
19656 * attribute.cs: Added methods to get a string and a bool from an
19657 attribute. Required to information from AssemblyKeyFileAttribute,
19658 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
19659 * codegen.cs: Modified AssemblyName creation to include support for
19660 strongnames. Catch additional exceptions to report them as CS1548.
19661 * compiler.csproj: Updated include CryptoConvert.cs.
19662 * compiler.csproj.user: Removed file - user specific configuration.
19663 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
19664 Mono.Security assembly. The original class is maintained and tested in
19665 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
19666 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
19667 like CSC 8.0 (C# v2) supports.
19668 * Makefile: Added CryptoConvert.cs to mcs sources.
19669 * rootcontext.cs: Added new options for strongnames.
19671 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
19673 * driver.cs: For --expect-error, report error code `2'
19674 if the program compiled with no errors, error code `1' if
19675 it compiled with an error other than the one expected.
19677 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
19679 * compiler.csproj: Updated for Visual Studio .NET 2003.
19680 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
19681 * compiler.sln: Updated for Visual Studio .NET 2003.
19683 2004-03-24 Ravi Pratap M <ravi@ximian.com>
19685 * expression.cs: Fix bug #47234. We basically need to apply the
19686 rule that we prefer the conversion of null to a reference type
19687 when faced with a conversion to 'object' (csc behaviour).
19689 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19691 * statement.cs: Shorter form for foreach, eliminates
19692 a local variable. r=Martin.
19694 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19696 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
19697 checks if we can use brtrue/brfalse to test for 0.
19698 * expression.cs: use the above in the test for using brtrue/brfalse.
19699 cleanup code a bit.
19701 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19703 * expression.cs: Rewrite string concat stuff. Benefits:
19705 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
19706 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
19707 rather than a concat chain.
19709 * typemanager.cs: Add lookups for more concat overloads.
19711 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19713 * expression.cs: Emit shorter il code for array init.
19730 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
19732 * statement.cs: Before, two switch blocks would be merged if the
19733 total size of the blocks (end_item - begin_item + 1) was less than
19734 two times the combined sizes of the blocks.
19736 Now, it will only merge if after the merge at least half of the
19741 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
19743 * class.cs : csc build fix for GetMethods(). See bug #52503.
19745 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
19747 * expression.cs: Make sure fp comparisons work with NaN.
19748 This fixes bug #54303. Mig approved this patch a long
19749 time ago, but we were not able to test b/c the runtime
19752 2004-03-19 Miguel de Icaza <miguel@ximian.com>
19754 * ecore.cs (TypExpr.GetHashCode): implement this overload.
19756 2004-03-19 Martin Baulig <martin@ximian.com>
19758 * class.cs (MemberCore.IsDuplicateImplementation): Report the
19759 error here and not in our caller.
19761 2004-03-19 Martin Baulig <martin@ximian.com>
19763 * interface.cs: Completely killed this file.
19764 (Interface): We're now a TypeContainer and live in class.cs.
19766 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
19767 argument; we're now also called for interfaces.
19768 (TypeContainer.DefineMembers): Allow this method being called
19770 (TypeContainer.GetMethods): New public method; formerly known as
19771 Interface.GetMethod(). This is used by PendingImplementation.
19772 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
19773 it's now private and non-static.
19774 (Interface): Moved this here; it's now implemented similar to
19776 (Method, Property, Event, Indexer): Added `bool is_interface'
19777 argument to their .ctor's.
19778 (MemberBase.IsInterface): New public field.
19780 * cs-parser.jay: Create normal Method, Property, Event, Indexer
19781 instances instead of InterfaceMethod, InterfaceProperty, etc.
19782 (opt_interface_base): Removed; we now use `opt_class_base' instead.
19783 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
19785 2004-03-19 Martin Baulig <martin@ximian.com>
19787 * class.cs (MethodCore.IsDuplicateImplementation): New private
19788 method which does the CS0111 checking.
19789 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
19790 Use IsDuplicateImplementation().
19792 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
19794 * decl.cs (FindMemberToOverride): New method to find the correct
19795 method or property to override in the base class.
19797 - Make Method/Property use the above method to find the
19798 version in the base class.
19799 - Remove the InheritableMemberSignatureCompare as it is now
19802 This patch makes large code bases much faster to compile, as it is
19803 O(n) rather than O(n^2) to do this validation.
19805 Also, it fixes bug 52458 which is that nested classes are not
19806 taken into account when finding the base class member.
19808 Reviewed/Approved by Martin.
19810 2004-03-17 Marek Safar <marek.safar@seznam.cz>
19812 * interface.cs: In all interface classes removed redundant
19813 member initialization.
19815 2004-03-16 Martin Baulig <martin@ximian.com>
19817 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
19819 2004-03-15 Miguel de Icaza <miguel@ximian.com>
19821 * decl.cs (DefineTypeAndParents): New helper method to define a
19822 type's containers before the type itself is defined; This is a
19823 bug exposed by the recent changes to Windows.Forms when an
19824 implemented interface was defined inside a class that had not been
19827 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
19829 (Check): Loop correctly to report errors modifiers
19830 (UNSAFE was not in the loop, since it was the same as TOP).
19832 * interface.cs: Every interface member now takes a ModFlags,
19833 instead of a "is_new" bool, which we set on the base MemberCore.
19835 Every place where we called "UnsafeOk" in the interface, now we
19836 call the proper member (InterfaceMethod.UnsafeOK) instead to get
19837 the unsafe settings from the member declaration instead of the
19838 container interface.
19840 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
19842 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
19843 `set_indexer_name' to the pending bits (one per type).
19845 We fixed a bug today that was picking the wrong method to
19846 override, since for properties the existing InterfaceMethod code
19847 basically ignored the method name. Now we make sure that the
19848 method name is one of the valid indexer names.
19850 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
19852 * support.cs (SeekableStreamReader): Keep track of stream byte
19853 positions and don't mix them with character offsets to the buffer.
19855 Patch from Gustavo Giráldez
19857 2004-03-15 Marek Safar <marek.safar@seznam.cz>
19859 * interface.cs (InterfaceSetGetBase): Removed double member
19860 initialization, base class does it as well.
19862 2004-03-13 Martin Baulig <martin@ximian.com>
19864 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
19865 when compiling corlib.
19867 2004-03-13 Miguel de Icaza <miguel@ximian.com>
19869 * convert.cs (ExplicitConversion): We were reporting an error on
19870 certain conversions (object_type source to a value type, when the
19871 expression was `null') before we had a chance to pass it through
19872 the user defined conversions.
19874 * driver.cs: Replace / and \ in resource specifications to dots.
19877 * class.cs: Add check for duplicate operators. Fixes 52477
19879 2004-03-11 Miguel de Icaza <miguel@ximian.com>
19881 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
19882 that are in the middle of the statements, not only at the end.
19885 * class.cs (TypeContainer.AddField): No longer set the
19886 `HaveStaticConstructor' flag, now we call it
19887 `UserDefineStaticConstructor' to diferentiate the slightly
19888 semantic difference.
19890 The situation is that we were not adding BeforeFieldInit (from
19891 Modifiers.TypeAttr) to classes that could have it.
19892 BeforeFieldInit should be set to classes that have no static
19897 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
19899 And most importantly Zoltan's comment:
19901 http://bugzilla.ximian.com/show_bug.cgi?id=44229
19903 "I think beforefieldinit means 'it's ok to initialize the type sometime
19904 before its static fields are used', i.e. initialization does not need
19905 to be triggered by the first access to the type. Setting this flag
19906 helps the JIT to compile better code, since it can run the static
19907 constructor at JIT time, and does not need to generate code to call it
19908 (possibly lots of times) at runtime. Unfortunately, mcs does not set
19909 this flag for lots of classes like String.
19911 csc sets this flag if the type does not have an explicit static
19912 constructor. The reasoning seems to be that if there are only static
19913 initalizers for a type, and no static constructor, then the programmer
19914 does not care when this initialization happens, so beforefieldinit
19917 This bug prevents the AOT compiler from being usable, since it
19918 generates so many calls to mono_runtime_class_init that the AOT code
19919 is much slower than the JITted code. The JITted code is faster,
19920 because it does not generate these calls if the vtable is type is
19921 already initialized, which is true in the majority of cases. But the
19922 AOT compiler can't do this."
19924 2004-03-10 Miguel de Icaza <miguel@ximian.com>
19926 * class.cs (MethodData.Emit): Refactor the code so symbolic
19927 information is generated for destructors; For some reasons we
19928 were taking a code path that did not generate symbolic information
19931 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
19933 * class.cs: Create a Constructor.CheckBase method that
19934 takes care of all validation type code. The method
19935 contains some code that was moved from Define.
19937 It also includes new code that checks for duplicate ctors.
19938 This fixes bug #55148.
19940 2004-03-09 Joshua Tauberer <tauberer@for.net>
19942 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
19943 a { ... }-style array creation invokes EmitStaticInitializers
19944 which is not good for reference-type arrays. String, decimal
19945 and now null constants (NullCast) are not counted toward
19946 static initializers.
19948 2004-03-05 Martin Baulig <martin@ximian.com>
19950 * location.cs (SourceFile.HasLineDirective): New public field;
19951 specifies whether the file contains or is referenced by a "#line"
19953 (Location.DefineSymbolDocuments): Ignore source files which
19954 either contain or are referenced by a "#line" directive.
19956 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
19958 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
19959 direct access to our parent, so check the method inline there.
19961 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
19963 * expression.cs (Invocation.EmitCall): Miguel's last commit
19964 caused a regression. If you had:
19969 In Foo the implict this would be null.
19971 2004-02-27 Miguel de Icaza <miguel@ximian.com>
19973 * expression.cs (Invocation.EmitCall): If the method is not
19974 virtual, do not emit a CallVirt to it, use Call.
19976 * typemanager.cs (GetFullNameSignature): Improve the method to
19977 cope with ".ctor" and replace it with the type name.
19979 * class.cs (ConstructorInitializer.Resolve): Now the method takes
19980 as an argument the ConstructorBuilder where it is being defined,
19981 to catch the recursive constructor invocations.
19983 2004-02-26 Miguel de Icaza <miguel@ximian.com>
19985 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
19986 routines to check if a type is an enumerable/enumerator allow
19987 classes that implement the IEnumerable or IEnumerator interfaces.
19989 * class.cs (Property, Operator): Implement IIteratorContainer, and
19990 implement SetYields.
19992 (Property.Define): Do the block swapping for get_methods in the
19993 context of iterators. We need to check if Properties also
19994 include indexers or not.
19996 (Operator): Assign the Block before invoking the
19997 OperatorMethod.Define, so we can trigger the Iterator code
20000 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
20001 Property and Operator classes are not created when we parse the
20002 declarator but until we have the block completed, so we use a
20003 singleton SimpleIteratorContainer.Simple to flag whether the
20004 SetYields has been invoked.
20006 We propagate this setting then to the Property or the Operator to
20007 allow the `yield' to function.
20009 2004-02-25 Marek Safar <marek.safar@seznam.cz>
20011 * codegen.cs: Implemented attribute support for modules.
20012 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
20013 Assembly/Module functionality.
20015 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
20016 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
20017 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
20019 2004-02-16 Marek Safar <marek.safar@seznam.cz>
20021 * interface.cs (FindMembers): The operation is performed on all base
20022 interfaces and not only on the first. It is required for future CLS Compliance patch.
20024 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
20026 * statement.cs, codegen.cs:
20027 This patch deals with patterns such as:
20029 public class List : IEnumerable {
20031 public MyEnumerator GetEnumerator () {
20032 return new MyEnumerator(this);
20035 IEnumerator IEnumerable.GetEnumerator () {
20039 public struct MyEnumerator : IEnumerator {
20044 Before, there were a few things we did wrong:
20045 1) we would emit callvirt on a struct, which is illegal
20046 2) we emited ldarg when we needed to emit ldarga
20047 3) we would mistakenly call the interface methods on an enumerator
20048 type that derived from IEnumerator and was in another assembly. For example:
20050 public class MyEnumerator : IEnumerator
20052 Would have the interface methods called, even if there were public impls of the
20053 method. In a struct, this lead to invalid IL code.
20055 2004-02-11 Marek Safar <marek.safar@seznam.cz>
20057 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
20060 * delegate.cs (Define): Fixed crash when delegate type is undefined.
20062 2004-02-11 Miguel de Icaza <miguel@ximian.com>
20064 * cs-parser.jay: Fix small regression: we were not testing V2
20065 compiler features correctly.
20067 * interface.cs: If the emit context is null, then create one
20069 2004-02-09 Marek Safar <marek.safar@seznam.cz>
20071 * decl.cs (GetSignatureForError): New virtual method to get full name
20072 for error messages.
20074 * attribute.cs (IAttributeSupport): New interface for attribute setting.
20075 Now it is possible to rewrite ApplyAttributes method to be less if/else.
20077 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
20078 Duplicated members and code in these classes has been removed.
20079 Better encapsulation in these classes.
20081 2004-02-07 Miguel de Icaza <miguel@ximian.com>
20083 * assign.cs (Assign.DoResolve): When dealing with compound
20084 assignments, there is a new rule in ECMA C# 2.4 (might have been
20085 there before, but it is documented here) that states that in:
20089 If b is of type int, and the `op' is a shift-operator, then the
20090 above is evaluated as:
20094 * expression.cs (Binary.ResolveOperator): Instead of testing for
20095 int/uint/long/ulong, try to implicitly convert to any of those
20096 types and use that in pointer arithmetic.
20098 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
20099 method to print information for from the type, not from the
20100 null-method we were given.
20102 2004-02-01 Duncan Mak <duncan@ximian.com>
20104 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
20105 parsing for cmd, fixes bug #53694.
20107 2004-02-04 Marek Safar <marek.safar@seznam.cz>
20109 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
20110 in the member name duplication tests. Property and operator name duplication
20111 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
20113 2004-02-03 Marek Safar <marek.safar@seznam.cz>
20115 * interface.cs (PopulateMethod): Fixed crash when interface method
20116 returns not existing type (error test cs0246-3.cs).
20118 2004-02-02 Ravi Pratap M <ravi@ximian.com>
20120 * cs-parser.jay (interface_accessors): Re-write actions to also
20121 store attributes attached to get and set methods. Fix spelling
20124 (inteface_property_declaration): Modify accordingly.
20126 (InterfaceAccessorInfo): New helper class to store information to pass
20127 around between rules that use interface_accessors.
20129 * interface.cs (Emit): Apply attributes on the get and set
20130 accessors of properties and indexers too.
20132 * attribute.cs (ApplyAttributes): Modify accordingly to use the
20133 right MethodBuilder when applying attributes to the get and set accessors.
20135 2004-01-31 Miguel de Icaza <miguel@ximian.com>
20137 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
20139 2004-01-26 Miguel de Icaza <miguel@ximian.com>
20141 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
20143 2004-01-25 Miguel de Icaza <miguel@ximian.com>
20145 * cs-parser.jay: Remove YIELD token, instead use the new grammar
20146 changes that treat `yield' specially when present before `break'
20147 or `return' tokens.
20149 * cs-tokenizer.cs: yield is no longer a keyword.
20151 2004-01-23 Marek Safar <marek.safar@seznam.cz>
20153 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
20154 setting for default constructors.
20155 For default constructors are almost every time set wrong Modifier. The
20156 generated IL code has been alright. But inside mcs this values was
20157 wrong and this was reason why several of my CLS Compliance tests
20160 2004-01-22 Martin Baulig <martin@ximian.com>
20162 * cs-parser.jay (namespace_or_type_name): Return an Expression,
20163 not a QualifiedIdentifier. This is what `type_name_expression'
20164 was previously doing.
20165 (type_name_expression): Removed; the code is now in
20166 `namespace_or_type_name'.
20167 (qualified_identifier): Removed, use `namespace_or_type_name'
20169 (QualifiedIdentifier): Removed this class.
20171 2004-01-22 Martin Baulig <martin@ximian.com>
20173 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
20174 not a string as alias name.
20176 2004-01-21 Miguel de Icaza <miguel@ximian.com>
20178 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
20179 #52730 bug, and instead compute correctly the need to use a
20180 temporary variable when requesting an address based on the
20181 static/instace modified of the field and the constructor.
20183 2004-01-21 Martin Baulig <martin@ximian.com>
20185 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
20186 class and namespace before looking up aliases. Fixes #52517.
20188 2004-01-21 Martin Baulig <martin@ximian.com>
20190 * flowanalysis.cs (UsageVector.Merge): Allow variables being
20191 assinged in a 'try'; fixes exception4.cs.
20193 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20194 * class.cs : Implemented parameter-less constructor for TypeContainer
20196 * decl.cs: Attributes are now stored here. New property OptAttributes
20198 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
20200 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
20202 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20204 * typemanager.cs (CSharpSignature): Now reports also inner class name.
20205 (CSharpSignature): New method for indexer and property signature.
20207 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20209 * pending.cs (IsVirtualFilter): Faster implementation.
20211 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20213 * typemanager.cs: Avoid inclusion of same assembly more than once.
20215 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20217 * cs-parser.jay: Fixed problem where the last assembly attribute
20218 has been applied also to following declaration (class, struct, etc.)
20220 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20222 * class.cs: Added error CS0538, CS0539 reporting.
20223 Fixed crash on Microsoft runtime when field type is void.
20225 * cs-parser.jay: Added error CS0537 reporting.
20227 * pending.cs: Added error CS0535 reporting.
20228 Improved error report for errors CS0536, CS0534.
20230 2004-01-20 Miguel de Icaza <miguel@ximian.com>
20232 Merge a few bits from the Anonymous Method MCS tree.
20234 * statement.cs (ToplevelBlock): New class for toplevel methods,
20235 will hold anonymous methods, lifted variables.
20237 * cs-parser.jay: Create toplevel blocks for delegates and for
20238 regular blocks of code.
20240 2004-01-20 Martin Baulig <martin@ximian.com>
20242 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
20243 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
20244 and `NeedExplicitReturn'; added `IsLastStatement'.
20245 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
20246 have a `ReturnLabel' or we're not unreachable.
20248 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
20249 child's reachability; don't just override ours with it. Fixes
20250 #58058 (lluis's example).
20251 (FlowBranching): Added public InTryOrCatch(), InCatch(),
20252 InFinally(), InLoop(), InSwitch() and
20253 BreakCrossesTryCatchBoundary() methods.
20255 * statement.cs (Return): Do all error checking in Resolve().
20256 Unless we are the last statement in a top-level block, always
20257 create a return label and jump to it.
20258 (Break, Continue): Do all error checking in Resolve(); also make
20259 sure we aren't leaving a `finally'.
20260 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
20261 statement in a top-level block.
20262 (Block.Flags): Added `IsDestructor'.
20263 (Block.IsDestructor): New public property.
20265 2004-01-20 Martin Baulig <martin@ximian.com>
20267 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
20269 2004-01-20 Martin Baulig <martin@ximian.com>
20271 * statement.cs (Statement.ResolveUnreachable): New public method.
20272 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
20273 (Block.Resolve): Resolve unreachable statements.
20275 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20277 * expression.cs: We need to fix the case where we do
20278 not have a temp variable here.
20280 * assign.cs: Only expression compound assignments need
20281 temporary variables.
20283 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20285 * flowanalysis.cs: Reduce memory allocation in a few ways:
20286 - A block with no variables should not allocate a bit
20288 - A method with no out parameters does not need any tracking
20289 for assignment of the parameters, so we need not allocate
20292 public readonly Type[] VariableTypes;
20293 public readonly string[] VariableNames;
20294 Are redundant. The data is already stored in the variable
20295 map, so we need not allocate another array for it.
20296 - We need to add alot of checks for if (params | locals) == null
20297 due to the first two changes.
20299 2004-01-18 Miguel de Icaza <miguel@ximian.com>
20301 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
20302 implement IMemoryLocation, we store a copy on a local variable and
20303 take the address of it. Patch from Benjamin Jemlich
20305 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
20306 to use a special "type_name_expression" rule which reduces the
20307 number of "QualifiedIdentifier" classes created, and instead
20308 directly creates MemberAccess expressions.
20310 2004-01-17 Miguel de Icaza <miguel@ximian.com>
20312 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
20313 that fixes #52853. Null literal assignment to ValueType
20315 * class.cs (MethodData.Emit): Instead of checking the name of the
20316 method to determine if its a destructor, create a new derived
20317 class from Method called Destructor, and test for that.
20319 * cs-parser.jay: Create a Destructor object instead of a Method.
20321 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
20325 2004-01-16 Miguel de Icaza <miguel@ximian.com>
20327 * expression.cs (Binary.ResolveOperator): Perform an implicit
20328 conversion from MethodGroups to their delegate types on the
20329 Addition operation.
20331 * delegate.cs: Introduce a new class DelegateCreation that is the
20332 base class for `NewDelegate' and `ImplicitDelegateCreation',
20333 factor some code in here.
20335 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
20336 conversion from MethodGroups to compatible delegate types.
20338 * ecore.cs (Expression.Resolve): Do not flag error 654
20339 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
20340 we allow conversions from MethodGroups to delegate types now.
20342 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
20343 assignments in v2 either.
20345 2004-01-10 Miguel de Icaza <miguel@ximian.com>
20347 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
20348 static read-only fields in ctors.
20350 Applied patch from Benjamin Jemlich
20352 * expression.cs (UnaryMutator): Avoid leaking local variables.
20354 2004-01-09 Miguel de Icaza <miguel@ximian.com>
20356 * cs-tokenizer.cs (IsCastToken): Allow the various native types
20357 here to return true, as they can be used like this:
20359 (XXX) int.MEMBER ()
20361 Fixed 49836 and all the other dups
20363 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
20365 * driver.cs: Implement /win32res and /win32icon.
20367 2004-01-08 Miguel de Icaza <miguel@ximian.com>
20369 * cs-parser.jay: Add a rule to improve error handling for the
20370 common mistake of placing modifiers after the type.
20372 2004-01-07 Miguel de Icaza <miguel@ximian.com>
20374 * cs-parser.jay (interface_event_declaration): Catch
20375 initialization of events on interfaces, and report cs0068
20377 * cs-parser.jay (interface_event_declaration): Catch
20378 initialization of events.
20380 * ecore.cs: Better report missing constructors.
20382 * expression.cs (Binary.ResolveOperator): My previous bug fix had
20383 the error reporting done in the wrong place. Fix.
20385 * expression.cs (Binary.ResolveOperator): Catch the
20386 operator + (E x, E y) error earlier, and later allow for implicit
20387 conversions in operator +/- (E e, U x) from U to the underlying
20390 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
20391 52596, if the container class is abstract, the default constructor
20392 is protected otherwise its public (before, we were always public).
20394 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
20397 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
20398 Jemlich that fixes bug #52597, MCS was generating invalid code for
20399 idisposable structs. Thanks to Ben for following up with this
20402 2004-01-06 Miguel de Icaza <miguel@ximian.com>
20404 * driver.cs: Allow assemblies without code to be generated, fixes
20407 2004-01-07 Nick Drochak <ndrochak@gol.com>
20409 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
20411 2004-01-05 Miguel de Icaza <miguel@ximian.com>
20413 * cs-parser.jay: Add rules to improve error reporting if fields or
20414 methods are declared at the namespace level (error 116)
20416 * Add rules to catch event add/remove
20418 2004-01-04 David Sheldon <dave-mono@earth.li>
20420 * expression.cs: Added matching ")" to error message for
20423 2004-01-03 Todd Berman <tberman@gentoo.org>
20425 * ecore.cs, attribute.cs:
20426 Applying fix from #52429.
20428 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20430 * ecore.cs, expression.cs, statement.cs:
20431 Total rewrite of how we handle branching. We
20432 now handle complex boolean expressions with fewer
20433 jumps. As well if (x == 0) no longer emits a ceq.
20435 if (x is Foo) is much faster now, because we generate
20438 Overall, we get a pretty big improvement on our benchmark
20439 tests. The code we generate is smaller and more readable.
20441 I did a full two-stage bootstrap. The patch was reviewed
20442 by Martin and Miguel.
20444 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20446 * cs-parser.jay: Make primary_expression not take a QI.
20447 we dont need this because the member_access rule covers
20448 us here. So we replace the rule with just IDENTIFIER.
20450 This has two good effects. First, we remove a s/r conflict.
20451 Second, we allocate many fewer QualifiedIdentifier objects.
20453 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20455 * attribute.cs: Handle MarshalAs attributes as pseudo, and
20456 set the correct information via SRE. This prevents
20457 hanging on the MS runtime. Fixes #29374.
20459 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20461 * convert.cs: correctly handle conversions to value types
20462 from Enum and ValueType as unboxing conversions.
20464 Fixes bug #52569. Patch by Benjamin Jemlich.
20466 2004-01-02 Ravi Pratap <ravi@ximian.com>
20468 * expression.cs (BetterConversion): Prefer int -> uint
20469 over int -> ulong (csc's behaviour). This fixed bug #52046.
20471 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
20473 * decl.cs (MemberCache.FindMembers): now returns a
20476 * typemanager.cs: In general, go with with ^^.
20477 (CopyNewMethods): take an IList.
20478 (RealMemberLookup): Only allocate an arraylist
20479 if we copy from two sets of methods.
20481 This change basically does two things:
20482 1) Fewer array lists allocated due to CopyNewMethods.
20483 2) the explicit cast in MemberList costed ALOT.
20485 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
20487 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
20488 a hashtable to avoid needless string allocations when an identifier is
20489 used more than once (the common case).
20491 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20493 * pending.cs: MS's TypeBuilder.GetInterfaces ()
20494 is broken, it will not return anything. So, we
20495 have to use the information we have in mcs to
20498 * typemanager.cs: Add a cache for GetInterfaces,
20499 since this will now be used more often (due to ^^)
20501 (GetExplicitInterfaces) New method that gets the
20502 declared, not effective, interfaces on a type
20503 builder (eg, if you have interface IFoo, interface
20504 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
20507 This patch makes MCS able to bootstrap itself on
20510 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20512 * expression.cs: Remove the Nop's that Miguel put
20515 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20517 * report.cs, codegen.cs: Give the real stack trace to
20518 the error when an exception is thrown.
20520 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20522 * decl.cs: only allocate hashtables for ifaces if
20525 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20527 * expression.cs: fix the error from cs0121-2.cs
20528 (a parent interface has two child interfaces that
20529 have a function with the same name and 0 params
20530 and the function is called through the parent).
20532 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
20534 * class.cs, rootcontext.cs, typmanager.cs: do not
20537 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
20539 * codegen.cs: remove stack for the ec flow branching.
20540 It is already a linked list, so no need.
20542 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
20544 * Makefile: Allow custom profiler here.
20546 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20548 * typemanager.cs (LookupType):
20549 - Use a static char [], because split takes
20550 a param array for args, so it was allocating
20552 - Do not store true in a hashtable, it boxes.
20554 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20556 * flowanalysis.cs: bytify common enums.
20558 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20560 * modifiers.cs: Add a new set of flags for the
20561 flags allowed on explicit interface impls.
20562 * cs-parser.jay: catch the use of modifiers in
20563 interfaces correctly.
20564 * class.cs: catch private void IFoo.Blah ().
20566 All related to bug #50572.
20568 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20570 * decl.cs: Rewrite the consistant accessability checking.
20571 Accessability is not linear, it must be implemented in
20572 a tableish way. Fixes #49704.
20574 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20576 * expression.cs: Handle negation in a checked context.
20577 We must use subtraction from zero. Fixes #38674.
20579 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20581 * class.cs: Ignore static void main in DLLs.
20582 * rootcontext.cs: Handle the target type here,
20583 since we are have to access it from class.cs
20584 * driver.cs: account for the above.
20586 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20588 * report.cs: Give line numbers and files if available.
20590 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
20592 * driver.cs: Implement /addmodule.
20594 * typemanager.cs: Change 'modules' field so it now contains Modules not
20597 2003-12-20 Martin Baulig <martin@ximian.com>
20599 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
20600 (FieldBase.IsAssigned): Removed this field.
20601 (FieldBase.SetAssigned): New public method.
20602 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
20604 2003-12-20 Martin Baulig <martin@ximian.com>
20606 * expression.cs (LocalVariableReference.DoResolve): Don't set
20607 `vi.Used' if we're called from DoResolveLValue().
20609 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
20610 returns the usage vector it just merged into the current one -
20611 pass this one to UsageWarning().
20612 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
20613 of the `EmitContext', don't call this recursively on our children.
20615 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
20617 * driver.cs: Implement /target:module.
20619 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
20621 * support.cs (CharArrayHashtable): New helper class.
20623 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
20624 char arrays, not strings, so we can avoid creating a string in
20625 consume_identifier if the identifier is a keyword.
20627 2003-12-16 Martin Baulig <martin@ximian.com>
20629 * statement.cs (LocalInfo.Assigned): Removed this property.
20630 (LocalInfo.Flags): Removed `Assigned'.
20631 (LocalInfo.IsAssigned): New public method; takes the EmitContext
20632 and uses flow analysis.
20633 (Block.UsageWarning): Made this method private.
20634 (Block.Resolve): Call UsageWarning() if appropriate.
20636 * expression.cs (LocalVariableReference.DoResolve): Always set
20637 LocalInfo.Used here.
20639 2003-12-13 Martin Baulig <martin@ximian.com>
20641 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
20642 any value here; we're now using flow analysis to figure out
20643 whether a statement/block returns a value.
20645 2003-12-13 Martin Baulig <martin@ximian.com>
20647 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
20649 (FlowBranching.MergeFinally): Don't call
20650 `branching.CheckOutParameters()' here, this is called in
20652 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
20653 when adding the `finally' vector.
20655 2003-12-13 Martin Baulig <martin@ximian.com>
20658 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
20659 actually work and also fix #48962.
20661 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
20663 * decl.cs: Do not check System.Object for nested types,
20664 since we know it does not have any. Big bang for buck:
20667 Run 1: 8.35 seconds
20668 Run 2: 8.32 seconds
20669 corlib: 17.99 seconds
20671 Run 1: 8.17 seconds
20672 Run 2: 8.17 seconds
20673 corlib: 17.39 seconds
20675 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
20677 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
20678 time we are returning 0 members, so we save alot here.
20680 2003-12-11 Martin Baulig <martin@ximian.com>
20682 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
20683 `MergeChild()', also just take the `FlowBranching' as argument;
20684 call Merge() on it and return the result.
20685 (FlowBranching.Merge): We don't need to do anything if we just
20688 2003-12-11 Martin Baulig <martin@ximian.com>
20690 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
20691 them in an `ArrayList' to reduce memory usage. Thanks to Ben
20692 Maurer for this idea.
20694 2003-12-11 Martin Baulig <martin@ximian.com>
20696 * flowanalysis.cs (MergeResult): This class is now gone; we now
20697 use the `UsageVector' for this. The reason for this is that if a
20698 branching just has one sibling, we don't need to "merge" them at
20699 all - that's the next step to do.
20700 (FlowBranching.Merge): We now return a `UsageVector' instead of a
20703 2003-12-11 Martin Baulig <martin@ximian.com>
20705 Reworked flow analyis and made it more precise and bug-free. The
20706 most important change is that we're now using a special `Reachability'
20707 class instead of having "magic" meanings of `FlowReturns'. I'll
20708 do some more cleanups and optimizations and also add some more
20709 documentation this week.
20711 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
20712 largely reworked this class.
20713 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
20714 the new `Reachability' class instead of having "magic" values here.
20715 (FlowBranching): We're now using an instance of `Reachability'
20716 instead of having separate `Returns', `Breaks' etc. fields.
20718 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
20719 based on flow analysis; ignore the return value of block.Emit ().
20721 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
20723 * driver.cs typemanager.cs: Find the mono extensions to corlib even
20724 if they are private.
20726 2003-12-09 Martin Baulig <martin@ximian.com>
20728 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
20729 call them directly on the UsageVector.
20731 2003-12-09 Martin Baulig <martin@ximian.com>
20733 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
20734 Changed return type from `FlowReturns' to `Reachability'.
20736 2003-12-09 Martin Baulig <martin@ximian.com>
20738 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
20739 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
20740 `Reachable' fields with a single `Reachability' one.
20742 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20744 * class.cs (FindMembers): Remove foreach's.
20749 Run 1: 8.74 seconds
20750 Run 2: 8.71 seconds
20753 Run 1: 8.64 seconds
20754 Run 2: 8.58 seconds
20757 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20762 This patch does a few things:
20763 1. EmptyStatement is now a singleton, so it is never reallocated.
20764 2. All blah is EmptyStatement constructs have been changed to
20765 blah == EmptyStatement.Value, which is much faster and valid
20766 now that EmptyStatement is a singleton.
20767 3. When resolving a block, rather than allocating a new array for
20768 the non-empty statements, empty statements are replaced with
20769 EmptyStatement.Value
20770 4. Some recursive functions have been made non-recursive.
20771 Mainly the performance impact is from (3), however (1) and (2) are needed for
20772 this to work. (4) does not make a big difference in normal situations, however
20773 it makes the profile look saner.
20778 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20779 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20780 Total memory allocated: 56397 KB
20783 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
20784 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
20785 Total memory allocated: 55666 KB
20787 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20789 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
20790 than the hashtable in a hashtable version
20792 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
20793 we always end up concating a string. This results in a huge perf
20794 loss, because many strings have to be tracked by the GC. In this
20795 patch, we first use a hashtable that works with two keys, so that
20796 the strings do not need to be concat'ed.
20800 Run 1: 8.74 seconds
20801 Run 2: 8.71 seconds
20804 Run 1: 8.65 seconds
20805 Run 2: 8.56 seconds
20807 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20809 * Makefile: Add a new target `do-time' that does a quick and simple
20810 profile, leaving easy to parse output.
20812 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
20814 * codegen.cs (Init): Create the dynamic assembly with
20815 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
20817 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
20819 * support.cs: Make the PtrHashtable use only one
20820 instance of its comparer.
20822 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
20824 * typemanager.cs: Fix lookup of GetNamespaces.
20826 2003-11-29 Miguel de Icaza <miguel@ximian.com>
20828 * expression.cs: Removed redundant line.
20830 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
20831 ArrayLists, use for loops with bounds.
20833 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
20836 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
20837 arraylists, use for loop with bounds.
20839 The above three changes give us a 0.071 second performance
20840 improvement out of 3.294 seconds down to 3.223. On my machine
20841 the above changes reduced the memory usage by 1,387 KB during
20842 compiler bootstrap.
20844 * cs-parser.jay (QualifiedIdentifier): New class used to represent
20845 QualifiedIdentifiers. Before we created a new string through
20846 concatenation, and mostly later on, the result would be
20847 manipulated by DecomposeQI through string manipulation.
20849 This reduced the compiler memory usage for bootstrapping from
20850 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
20851 compile times in 0.05 seconds.
20853 2003-11-28 Dick Porter <dick@ximian.com>
20855 * support.cs: Do string compares with the Invariant culture.
20863 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
20864 the comparison is done with the Invariant culture.
20866 2003-11-27 Miguel de Icaza <miguel@ximian.com>
20868 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
20869 GetEnumerator method.
20871 (ProbeCollectionType): Iterate starting at the most specific type
20872 upwards looking for a GetEnumerator
20874 * expression.cs: Shift count can be up to 31 for int/uint and 63
20877 2003-11-26 Miguel de Icaza <miguel@ximian.com>
20879 * statement.cs (Block.LookupLabel): Also look for the label on the
20880 children blocks. Use a hash table to keep track of visited
20883 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
20884 we actually did transform the other operand, otherwise fall back
20885 to the common codepath that casts to long.
20887 * cs-tokenizer.cs: Use the same code pattern as the int case.
20888 Maybe I should do the parsing myself, and avoid depending on the
20889 Parse routines to get this done.
20891 2003-11-25 Miguel de Icaza <miguel@ximian.com>
20893 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
20894 which fixes bug 51347. This time test it.
20896 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
20897 attributes for example can not tell the difference between these.
20898 The difference was only a syntax feature of the language.
20900 * attribute.cs: Apply attributes to delegates.
20902 * delegate.cs: Call the apply attributes method.
20904 2003-11-24 Miguel de Icaza <miguel@ximian.com>
20906 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
20907 comparing 0 vs Byte.MinValue, not the value
20909 (ImplicitConversionRequired): When reporting a conversion error,
20910 use error 31 to print out the constant error instead of the
20913 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
20914 which fixes bug 51347.
20916 2003-11-22 Miguel de Icaza <miguel@ximian.com>
20918 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
20919 which fixes the -warnaserror command line option.
20921 2003-11-21 Miguel de Icaza <miguel@ximian.com>
20923 * cfold.cs (DoNumericPromotions): During constant folding of
20924 additions on UIntConstant, special case intconstants with
20925 IntConstants like we do on the expression binary operator.
20927 2003-11-12 Miguel de Icaza <miguel@ximian.com>
20929 * convert.cs (ImplicitReferenceConversion): We were missing a case
20930 (System.Enum are not value types or class types, so we need to
20931 classify them separatedly).
20933 * driver.cs: We do not support error 2007.
20935 2003-11-12 Jackson Harper <jackson@ximian.com>
20937 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
20938 system directory. Also use the full file name so users can
20939 libraries names mscorlib-o-tron.dll in a non system dir.
20941 2003-11-10 Martin Baulig <martin@ximian.com>
20943 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
20944 (TypeManager.InitCoreTypes): Initialize them here, but instead of
20945 calling `ResolveType()' on them, directly assign their `Type'.
20947 2003-11-08 Martin Baulig <martin@ximian.com>
20949 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
20950 return value and the `out parent' parameter.
20951 (TypeContainer.DefineType): Moved the CS0644 check into
20952 GetClassBases(). Don't pass the interface types to the
20953 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
20954 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
20956 * ecore.cs (TypeExpr.IsAttribute): New property.
20957 (TypeExpr.GetInterfaces): New method.
20959 * interface.cs (Interface.GetInterfaceTypeByName): Return a
20960 TypeExpr instead of a Type.
20961 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
20962 (Interface.DefineType): Don't pass the interface types to the
20963 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
20964 them later and then call `TypeBulider.AddInterfaceImplementation()'.
20966 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
20967 instead of a `Type[]'.
20968 (TypeManager.RegisterBuilder): Likewise.
20969 (TypeManager.AddUserInterface): Likewise.
20970 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
20971 `Type[]' and also return a `TypeExpr[]'.
20972 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
20974 2003-11-08 Martin Baulig <martin@ximian.com>
20976 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
20979 2003-11-08 Martin Baulig <martin@ximian.com>
20981 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
20982 TypeManager.ResolveExpressionTypes().
20984 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
20985 instead of an Expression.
20986 (TypeExpr): This is now an abstract base class for `TypeExpression'.
20987 (TypeExpression): New public class; formerly known as `TypeExpr'.
20989 * expression.cs (ComposedCast): Derive from TypeExpr.
20991 * typemanager.cs (TypeManager.system_*_expr): These are now
20992 TypExpr's instead of Expression's.
20993 (TypeManager.ResolveExpressionTypes): New public static function;
20994 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
20997 2003-11-06 Miguel de Icaza <miguel@ximian.com>
20999 * expression.cs (New.DoResolve): Do not dereference value that
21000 might be a null return.
21002 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
21003 sure that the constant value has the right type. Fixes an
21004 unreported bug, similar to 50425.
21006 * const.cs (Const.LookupConstantValue): Call
21007 ImplicitStandardConversionExists before doing a conversion to
21008 avoid havng the TypeManager.ChangeType do conversions.
21010 Reduced the number of casts used
21012 (Const.ChangeType): New routine to enable reuse of the constant
21013 type changing code from statement.
21015 * typemanager.cs (ChangeType): Move common initialization to
21016 static global variables.
21020 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
21021 every value type to go through, even if it was void. Fix that.
21023 * cs-tokenizer.cs: Use is_identifier_start_character on the start
21024 character of the define, and the is_identifier_part_character for
21025 the rest of the string.
21027 2003-11-05 Miguel de Icaza <miguel@ximian.com>
21029 * expression.cs (UnaryMutator.EmitCode): When I updated
21030 LocalVariableReference.DoResolve, I overdid it, and dropped an
21031 optimization done on local variable references.
21033 2003-11-04 Miguel de Icaza <miguel@ximian.com>
21035 * ecore.cs: Convert the return from Ldlen into an int.
21037 2003-10-20 Miguel de Icaza <miguel@ximian.com>
21039 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
21040 the accessibility, this is a special case for toplevel non-public
21041 classes (internal for instance).
21043 2003-10-20 Nick Drochak <ndrochak@gol.com>
21045 * ecore.cs: Fix typo and build. Needed another right paren.
21047 2003-10-19 Miguel de Icaza <miguel@ximian.com>
21049 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
21050 `internal' case regular and protected, but not allowing protected
21051 to be evaluated later. Bug 49840
21053 2003-10-15 Miguel de Icaza <miguel@ximian.com>
21055 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
21056 to kb.Nlast, and not the kb.nFirst to isolate the switch
21059 Extract the underlying type, so enumerations of long/ulong are
21060 treated like long/ulong.
21062 2003-10-14 Miguel de Icaza <miguel@ximian.com>
21064 * expression.cs (New): Overload the meaning of RequestedType to
21065 track the possible creation of the NewDelegate type, since
21066 DoResolve is invoked more than once for new constructors on field
21069 See bugs: #48800 and #37014
21071 * cs-parser.jay (declare_local_constants): Take an arraylist
21072 instead of a single constant.
21074 (local_constant_declaration): It should take a
21075 constant_declarators, not a constant_declarator. Fixes 49487
21077 * convert.cs: Fix error report.
21079 2003-10-13 Jackson Harper <jackson@ximian.com>
21081 * typemanager.cs (TypeToCoreType): Add float and double this fixes
21084 2003-10-09 Martin Baulig <martin@ximian.com>
21086 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
21088 (MethodCore.DoDefineParameters): Removed the TypeContainer
21089 argument; use the DeclSpace which was passed to the .ctor instead.
21090 (MethodCore.CheckParameter): Take a DeclSpace instead of a
21091 TypeContainer; we only need a DeclSpace here.
21093 2003-10-09 Martin Baulig <martin@ximian.com>
21095 * class.cs (MethodData): Added additional `DeclSpace ds' argument
21097 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
21098 EmitContext's .ctor.
21100 2003-10-09 Martin Baulig <martin@ximian.com>
21102 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
21103 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
21104 AsAccessible(), moved them as well.
21106 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
21108 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
21110 * cs-parser.jay : Renamed yyName to yyNames related to jay.
21112 2003-10-07 Miguel de Icaza <miguel@ximian.com>
21114 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
21115 generation for >=, as spotted by Paolo, bug 48679.
21116 Patch from David Waite.
21118 * cs-tokenizer.cs: Add handling for #pragma.
21120 * cs-parser.jay: Allow for both yield and yield return in the
21121 syntax. The anti-cobolization of C# fight will go on!
21123 * class.cs (TypeBuilder.DefineType): Catch error condition here
21124 (Parent.DefineType erroring out and returning null).
21126 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
21127 coping with enumerations variables, we were mistakenly processing
21128 them as a regular value type instead of built-in types. Fixes the
21131 * typemanager.cs (IsBuiltinOrEnum): New method.
21133 2003-09-30 Miguel de Icaza <miguel@ximian.com>
21135 * cs-parser.jay: Upgrade: yield now needs the return clause.
21137 2003-09-19 Martin Baulig <martin@ximian.com>
21139 * decl.cs (MemberCache.SetupCacheForInterface): Take a
21140 `MemberCache parent' argument. Normally, an interface doesn't
21141 have a parent type except System.Object, but we use this in gmcs
21142 for generic type parameters.
21144 2003-09-18 Martin Baulig <martin@ximian.com>
21146 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
21147 on `type.IsInterface'; don't check whether the type has a parent
21148 to determine whether it's an interface.
21150 2003-09-15 Martin Baulig <martin@ximian.com>
21152 * class.cs (TypeContainer.DefineType): Added an error flag to
21153 avoid reporting duplicate CS0146's ("class definition is
21156 * driver.cs (Driver.MainDriver): Abort if
21157 RootContext.ResolveTree() reported any errors.
21159 2003-09-07 Martin Baulig <martin@ximian.com>
21161 * report.cs (Error, Warning): Added overloaded versions which take
21162 a `params object[] args' and call String.Format().
21164 2003-09-07 Martin Baulig <martin@ximian.com>
21166 * decl.cs (DeclSpace..ctor): Don't call
21167 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
21168 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
21169 (DeclSpace.RecordDecl): New method.
21171 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
21173 2003-09-02 Ravi Pratap <ravi@ximian.com>
21175 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
21176 value attributes to be applied to ParameterBuilders.
21178 * class.cs (MethodCore.LabelParameters): Make static and more
21179 generic so that it can be used from other places - like interface
21180 methods, for instance.
21182 * interface.cs (Interface.Emit): Call LabelParameters before
21183 emitting attributes on the InterfaceMethod.
21185 2003-08-26 Martin Baulig <martin@ximian.com>
21187 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
21188 resolving aliases; fixes #47927.
21190 2003-08-26 Martin Baulig <martin@ximian.com>
21192 * statement.cs (Using.DoResolve): This is internally emitting a
21193 try/finally clause, so we need to set ec.NeedExplicitReturn if we
21194 do not always return. Fixes #47681.
21196 2003-08-26 Martin Baulig <martin@ximian.com>
21198 * decl.cs (MemberCore): Moved WarningNotHiding(),
21199 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
21201 (AdditionResult): Make this nested in DeclSpace.
21202 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
21203 argument; call NamespaceEntry.Define() unless we're nested in a
21206 * namespace.cs (Namespace.DefineName): New public function. This
21207 is called from DeclSpace's .ctor to add
21208 (Namespace.Lookup): Include DeclSpaces in the lookup.
21210 * class.cs (Operator): Derive from MemberBase, not MemberCore.
21212 * const.cs (Const): Derive from MemberBase, not MemberCore.
21214 2003-08-25 Martin Baulig <martin@ximian.com>
21216 * convert.cs (Convert.ExplicitReferenceConversion): When
21217 converting from an interface type to a class, unbox if the target
21218 type is a struct type. Fixes #47822.
21220 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21222 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
21225 2003-08-22 Martin Baulig <martin@ximian.com>
21227 * class.cs (TypeManager.DefineType): When defining a nested type,
21228 call DefineType() on our parent; fixes #47801.
21230 2003-08-22 Martin Baulig <martin@ximian.com>
21232 * class.cs (MethodData.Define): While checking if a method is an
21233 interface implementation, improve the test a bit more to fix #47654.
21235 2003-08-22 Martin Baulig <martin@ximian.com>
21237 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
21238 correctly; fixes #47722.
21240 2003-08-22 Martin Baulig <martin@ximian.com>
21242 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
21243 LocalVariableReference, ensure it's not read-only. Fixes #47536.
21245 * statement.cs (Fixed.DoResolve): Make all variables read-only.
21247 2003-08-22 Martin Baulig <martin@ximian.com>
21249 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
21250 can only be assigned in static constructors. Fixes #47161.
21252 2003-08-22 Martin Baulig <martin@ximian.com>
21254 Rewrote and improved the flow analysis code.
21256 * flowbranching.cs (FlowBranching): Make this class abstract.
21257 (FlowBranching.CreateBranching): New static function to create a
21258 new flow branching.
21259 (FlowBranchingBlock, FlowBranchingException): New classes.
21260 (FlowBranching.UsageVector.Type): New public readonly field.
21261 (FlowBranching.UsageVector.Breaks): Removed the setter.
21262 (FlowBranching.UsageVector.Returns): Removed the setter.
21263 (FlowBranching.UsageVector): Added Break(), Return(),
21264 NeverReachable() and Throw() methods to modify the reachability.
21265 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
21266 done by FlowBranching.Merge().
21267 (FlowBranching.UsageVector.MergeChild): New method; merges the
21268 merge result into the current vector.
21269 (FlowBranching.Merge): New abstract method to merge a branching.
21271 2003-08-12 Martin Baulig <martin@ximian.com>
21273 * expression.cs (Indirection.CacheTemporaries): Create the
21274 LocalTemporary with the pointer type, not its element type.
21276 2003-08-10 Miguel de Icaza <miguel@ximian.com>
21278 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
21279 token was a keyword or not.
21281 Add `error' options where an IDENTIFIER was expected; Provide
21282 CheckToken and CheckIdentifierToken convenience error reporting
21285 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
21287 * decl.cs: Rename `NamespaceEntry Namespace' public field into
21288 NameSpaceEntry NameSpaceEntry.
21290 (LookupInterfaceOrClass): Avoid creating a full qualified name
21291 from namespace and name: avoid doing lookups when we know the
21292 namespace is non-existant. Use new Tree.LookupByNamespace which
21293 looks up DeclSpaces based on their namespace, name pair.
21295 * driver.cs: Provide a new `parser verbose' to display the
21296 exception thrown during parsing. This is turned off by default
21297 now, so the output of a failure from mcs is more graceful.
21299 * namespace.cs: Track all the namespaces defined in a hashtable
21302 (IsNamespace): New method
21304 2003-08-09 Miguel de Icaza <miguel@ximian.com>
21306 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
21307 we know that we need to concatenate (full typename can never be
21312 * statement.cs: Use a bitfield; Do not initialize to null things
21313 which are done by the constructor by default.
21315 * cs-parser.jay: bug fix, parameter was 4, not 3.
21317 * expression.cs: Just use the property;
21319 * statement.cs: No need for GetVariableInfo method.
21321 2003-08-08 Martin Baulig <martin@ximian.com>
21323 * flowanalysis.cs (FlowReturns): This is now nested in the
21324 `FlowBranching' class.
21325 (MyBitVector): Moved this here from statement.cs.
21326 (FlowBranching.SiblingType): New enum type.
21327 (FlowBranching.CreateSibling): Added `SiblingType' argument.
21329 2003-08-07 Martin Baulig <martin@ximian.com>
21331 * flowanalysis.cs (FlowBranchingType): This is now nested in the
21332 `FlowBranching' class and called `BranchingType'.
21334 2003-08-07 Martin Baulig <martin@ximian.com>
21336 * flowanalysis.cs: Moved all the control flow analysis code into
21339 2003-08-07 Martin Baulig <martin@ximian.com>
21341 * assign.cs (Assign.DoResolve): `target' must either be an
21342 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
21345 2003-08-07 Miguel de Icaza <miguel@ximian.com>
21347 * expression.cs (BinaryMethod): This kind of expression is created by the
21348 Binary class if it determines that the operator has to be handled
21351 (BinaryDelegate): This kind of expression is created if we are
21352 dealing with a + or - operator on delegates.
21354 (Binary): remove method, argumetns, and DelegateOperator: when
21355 dealing with methods,
21357 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
21359 * statement.cs (Block): use bitfields for the three extra booleans
21360 we had in use. Remove unused topblock parameter.
21362 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
21364 * assign.cs: Drop extra unneeded tests.
21366 2003-08-06 Miguel de Icaza <miguel@ximian.com>
21368 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
21370 * statement.cs (Foreach): Use VariableStorage instead of
21373 * codegen.cs (VariableStorage): New class used by clients that
21374 require a variable stored: locals or fields for variables that
21375 need to live across yield.
21377 Maybe provide a convenience api for EmitThis+EmitLoad?
21379 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
21382 2003-08-05 Miguel de Icaza <miguel@ximian.com>
21384 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
21385 RemapParameterLValue): New methods that are used to turn a
21386 precomputed FieldInfo into an expression like this:
21390 The idea is to use this instead of making LocalVariableReference
21391 have more than one meaning.
21393 * cs-parser.jay: Add error production to BASE.
21395 * ecore.cs: Deal with TypeManager.GetField returning null, which
21396 is now a valid return value.
21398 (FieldExprNoAddress): New expression for Fields whose address can
21401 * expression.cs (LocalVariableReference): During the resolve
21402 phases, create new expressions if we are in a remapping context.
21403 Remove code that dealt with remapping here.
21405 (ParameterReference): same.
21407 (ProxyInstance): New expression, like the `This' expression, but
21408 it is born fully resolved. We know what we are doing, so remove
21409 the errors that are targeted to user-provided uses of `this'.
21411 * statement.cs (Foreach): our variable is now stored as an
21412 Expression; During resolution, follow the protocol, dont just
21413 assume it will return this.
21415 2003-08-06 Martin Baulig <martin@ximian.com>
21417 * support.cs (SeekableStreamReader.cs): New public class.
21419 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
21420 SeekableStreamReader instead of the normal StreamReader.
21422 2003-08-04 Martin Baulig <martin@ximian.com>
21424 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
21425 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
21426 deambiguate casts and delegate invocations.
21427 (parenthesized_expression): Use the new tokens to ensure this is
21428 not a cast of method invocation.
21430 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
21431 when reading a `)' and Deambiguate_CloseParens () was previously
21434 * expression.cs (ParenthesizedExpression): New class. This is
21435 just used for the CS0075 test.
21436 (Binary.DoResolve): Check for CS0075.
21438 2003-07-29 Ravi Pratap <ravi@ximian.com>
21440 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
21441 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
21442 reference comparison.
21444 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
21445 examine the ReturnType for equality - this is necessary in the
21446 cases of implicit and explicit operators whose signature also
21447 includes the return type.
21449 2003-07-26 Miguel de Icaza <miguel@ximian.com>
21451 * namespace.cs: Cache the result of the namespace computation,
21452 instead of computing it every time.
21454 2003-07-24 Miguel de Icaza <miguel@ximian.com>
21456 * decl.cs: Use a global arraylist that we reuse over invocations
21457 to avoid excesive memory consumption. Reduces memory usage on an
21458 mcs compile by one meg (45 average).
21460 * typemanager.cs (LookupTypeReflection): In .NET pointers are
21461 private, work around that.
21463 2003-07-23 Miguel de Icaza <miguel@ximian.com>
21465 * literal.cs (IntLiteral): Define Zero and One static literals.
21467 * cs-parser.jay (integer_literal): use static literals to reduce
21468 memory usage for the most used literals (0, 1 and -1). 211kb
21469 reduced in memory usage.
21471 Replace all calls to `new ArrayList' with `new
21472 ArrayList(4)' which is a good average number for most allocations,
21473 and also requires only 16 bytes of memory for its buffer by
21476 This reduced MCS memory usage in seven megabytes for the RSS after
21479 2003-07-28 Ravi Pratap <ravi@ximian.com>
21481 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
21482 handle params methods the correct way by forming only one
21483 applicable set with params and normal methods in them. Earlier we
21484 were looking at params methods only if we found no normal methods
21485 which was not the correct thing to do.
21487 (Invocation.BetterFunction): Take separate arguments indicating
21488 when candidate and the best method are params methods in their
21491 This fixes bugs #43367 and #46199.
21493 * attribute.cs: Documentation updates.
21495 (CheckAttribute): Rename to CheckAttributeTarget.
21496 (GetValidPlaces): Rename to GetValidTargets.
21498 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
21499 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
21503 2003-07-28 Martin Baulig <martin@ximian.com>
21505 * class.cs (TypeContainer.DefineMembers): Use the base type's full
21506 name when looking up the base class of a nested class. Fixes #46977.
21508 2003-07-26 Martin Baulig <martin@ximian.com>
21510 * expression.cs (Indexers.Indexer): New nested struct; contains
21511 getter, setter and the indexer's type.
21512 (Indexers.Properties): This is now an ArrayList of
21513 Indexers.Indexer's.
21514 (IndexerAccess.DoResolveLValue): Correctly set the type if the
21515 indexer doesn't have any getters.
21517 * assign.cs (Assign.DoResolve): Also do the implicit conversions
21518 for embedded property and indexer assignments.
21520 2003-07-26 Martin Baulig <martin@ximian.com>
21522 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
21523 preprocessor directive is not the first non-whitespace character
21526 2003-07-26 Martin Baulig <martin@ximian.com>
21528 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
21529 namespace parsing, follow the spec more closely.
21531 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
21532 NamespaceEntry.Lookup().
21534 2003-07-25 Martin Baulig <martin@ximian.com>
21536 * MethodCore.cs (OverridesSomething): New public field; it's set
21537 from TypeContainer.DefineMembers if this method overrides
21538 something (which doesn't need to be a method). Fix #39462.
21540 2003-07-25 Ravi Pratap <ravi@ximian.com>
21542 * typemanager.cs (GetMembers): Ensure that the list of members is
21543 reversed. This keeps things in sync.
21545 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
21546 find an AttributeUsage attribute.
21548 * expression.cs (Invocation.OverloadResolve): Perform the check
21549 which disallows Invoke to be directly called on a Delegate.
21551 (Error_InvokeOnDelegate): Report error cs1533.
21553 2003-07-25 Martin Baulig <martin@ximian.com>
21555 * expression.cs (Indexers.GetIndexersForType): Only look in the
21556 interface hierarchy if the requested type is already an
21557 interface. Fixes #46788 while keeping #46502 fixed.
21559 2003-07-25 Martin Baulig <martin@ximian.com>
21561 * class.cs (TypeContainer.DefineMembers): Check whether all
21562 readonly fields have been assigned and report warning CS0649 if
21565 * statement.cs (LocalInfo.IsFixed): Always return true if this is
21568 2003-07-24 Ravi Pratap <ravi@ximian.com>
21570 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
21571 returned from GetMethods to make things consistent with the
21572 assumptions MCS makes about ordering of methods.
21574 This should comprehensively fix bug #45127 and it does :-)
21576 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
21577 ordering is actually reverse.
21579 * Clean up some debug messages I left lying around.
21581 * interface.cs (Populate*): Get rid of code which emits attributes
21582 since the stage in which we emit attributes is the 'Emit' stage,
21583 not the define stage.
21585 (Emit): Move attribute emission for interface members here.
21587 2003-07-22 Ravi Pratap <ravi@ximian.com>
21589 * expression.cs (Invocation.OverloadResolve): Follow the spec more
21590 closely: we eliminate methods in base types when we have an
21591 applicable method in a top-level type.
21593 Please see section 14.5.5.1 for an exact description of what goes
21596 This fixes bug #45127 and a host of other related to corlib compilation.
21598 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
21599 array is the method corresponding to the top-level type (this is
21600 because of the changes made to icall.c) so we change this
21603 (MethodGroupExpr.Name): This too.
21605 * typemanager.cs (GetElementType): New method which does the right
21606 thing when compiling corlib.
21608 * everywhere: Make use of the above in the relevant places.
21610 2003-07-22 Martin Baulig <martin@ximian.com>
21612 * cs-parser.jay (invocation_expression): Moved
21613 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
21614 `cast_expression', but create a InvocationOrCast which later
21615 resolves to either an Invocation or a Cast.
21617 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
21618 method; call this before EmitStatement() to make sure that this
21619 expression can be used as a statement.
21621 * expression.cs (InvocationOrCast): New class; resolves to either
21622 an Invocation or a Cast.
21624 * statement.cs (StatementExpression): Call ResolveStatement() on
21625 the ExpressionStatement before emitting it.
21627 2003-07-21 Martin Baulig <martin@ximian.com>
21629 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
21630 `ref' and `out' attributes match; fixes #46220.
21631 (MemberAccess.ResolveMemberAccess): You can't reference a type
21632 through an expression; fixes #33180.
21633 (Indexers.GetIndexersForType): Don't return the indexers from
21634 interfaces the class implements; fixes #46502.
21636 2003-07-21 Martin Baulig <martin@ximian.com>
21638 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
21639 CS0661 checks; fixes bug #30442.
21641 2003-07-21 Martin Baulig <martin@ximian.com>
21643 * decl.cs (AdditionResult): Added `Error'.
21645 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
21647 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
21648 makes cs0031.cs actually work.
21650 2003-07-20 Martin Baulig <martin@ximian.com>
21652 * namespace.cs: Fixed that bug which caused a crash when compiling
21653 the debugger's GUI.
21655 2003-07-20 Miguel de Icaza <miguel@ximian.com>
21657 * typemanager.cs (LookupTypeReflection): Never expose types which
21658 are NotPublic, NestedPrivate, NestedAssembly, or
21659 NestedFamANDAssem. We used to return these, and later do a check
21660 that would report a meaningful error, but the problem is that we
21661 would not get the real match, if there was a name override.
21663 2003-07-18 Miguel de Icaza <miguel@ximian.com>
21665 * namespace.cs (Namespace, Name): Do not compute the namespace
21666 name dynamically, compute it in the constructor. This reduced
21667 memory usage by 1697 KB.
21669 * driver.cs: Use --pause to pause at the end.
21671 2003-07-17 Peter Williams <peter@newton.cx>
21673 * Makefile: Change the name of the test target so that it doesn't
21674 conflict with the recursive test target.
21676 2003-07-17 Miguel de Icaza <miguel@ximian.com>
21678 * expression.cs (LocalVariableReference.Emit, EmitAssign,
21679 AddressOf): Do not use EmitThis, that was wrong, use the actual
21682 2003-07-15 Miguel de Icaza <miguel@ximian.com>
21684 * class.cs (MethodData.Define): While checking if a method is an
21685 interface implementation, improve the test: If we are not public
21686 (use new test here: use the computed MethodAttributes directly,
21687 instead of the parsed modifier flags) check if the `implementing'
21688 method comes from an interface or not.
21690 * pending.cs (VerifyPendingMethods): Slightly better error
21693 * makefile: add test target that does the mcs bootstrap.
21695 2003-07-16 Ravi Pratap <ravi@ximian.com>
21697 * interface.cs (Define): Do nothing here since there are no
21698 members to populate etc. Move the attribute emission out of here
21699 since this was just totally the wrong place to put it. Attribute
21700 application happens during the 'Emit' phase, not in the 'Define'
21703 (Emit): Add this method and move the attribute emission here
21705 * rootcontext.cs (EmitCode): Call the Emit method on interface
21708 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21710 * expression.cs (OverloadResolve): Report error only if Location
21711 is not 'Null' which means that there was a probe going on.
21713 2003-07-14 Martin Baulig <martin@ximian.com>
21715 * expression.cs (ConditionalLogicalOperator): New public class to
21716 implement user defined conditional logical operators.
21717 This is section 14.11.2 in the spec and bug #40505.
21719 2003-07-14 Martin Baulig <martin@ximian.com>
21721 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
21723 2003-07-14 Martin Baulig <martin@ximian.com>
21725 * codegen.cs (EmitContext.InFixedInitializer): New public field.
21727 * ecore.cs (IVariable.VerifyFixed): New interface method.
21729 * expression.cs (Unary.ResolveOperator): When resolving the `&'
21730 operator, check whether the variable is actually fixed. Fixes bug
21731 #36055. Set a variable definitely assigned when taking its
21732 address as required by the spec.
21734 * statement.cs (LocalInfo.IsFixed): New field.
21735 (LocalInfo.MakePinned): Set `IsFixed' to true.
21737 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21739 * attribute.cs (Attribute.Resolve): While doing a Member lookup
21740 for .ctors, ensure that we only ask for members declared in the
21741 attribute type (BindingFlags.DeclaredOnly).
21745 * expression.cs (Error_WrongNumArguments): Report error 1501
21746 correctly the way CSC does.
21748 2003-07-13 Martin Baulig <martin@ximian.com>
21750 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
21751 lookup on the fully qualified name, to make things like "X.X" work
21752 where "X.X" is a fully qualified type name, but we also have a
21753 namespace "X" in the using list. Fixes #41975.
21755 2003-07-13 Martin Baulig <martin@ximian.com>
21757 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
21758 function. If we're a CompoundAssign, we need to create an embedded
21759 CompoundAssign, not an embedded Assign.
21760 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
21763 2003-07-13 Martin Baulig <martin@ximian.com>
21765 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
21766 work to fix bug #46088.
21768 2003-07-13 Ravi Pratap <ravi@ximian.com>
21770 * class.cs (Operator.Emit): Do not emit attributes here - it is
21771 taken care of by the Method class that we delegate too. This takes
21772 care of bug #45876.
21774 2003-07-10 Martin Baulig <martin@ximian.com>
21776 * expression.cs (TypeOfVoid): New class.
21777 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
21779 2003-07-10 Martin Baulig <martin@ximian.com>
21781 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
21784 2003-07-10 Martin Baulig <martin@ximian.com>
21786 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
21787 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
21789 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
21791 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
21793 2003-07-10 Martin Baulig <martin@ximian.com>
21795 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
21796 of decimal. Fixes #42850.
21798 NOTE: I also fixed the created byte blob, but this doesn't work on
21799 the MS runtime and csc never produces any byte blobs for decimal
21802 2003-07-10 Martin Baulig <martin@ximian.com>
21804 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
21805 structs; fixes #32068.
21806 (Block.AddChildVariableNames): Fixed #44302.
21808 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21810 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
21812 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21814 * attribute.cs: And this test is onger needed.
21816 2003-07-08 Martin Baulig <martin@ximian.com>
21818 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
21819 inaccessible types. Fixes #36313.
21821 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
21823 * namespace.cs (NamespaceEntry): Create implicit entries for all
21824 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
21825 implicit entries for N1.N2 and N1.
21827 2003-07-08 Martin Baulig <martin@ximian.com>
21829 Rewrote the handling of namespaces to fix a lot of the issues
21830 wrt. `using' aliases etc.
21832 * namespace.cs (Namespace): Splitted this class into a
21833 per-assembly `Namespace' and a per-file `NamespaceEntry'.
21835 * typemanager.cs (TypeManager.IsNamespace): Removed.
21836 (TypeManager.ComputeNamespaces): Only compute namespaces from
21837 loaded assemblies here, not the namespaces from the assembly we're
21838 currently compiling.
21840 2003-07-08 Martin Baulig <martin@ximian.com>
21842 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
21844 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21846 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
21849 I thought about the memory savings here, but LookupTypeReflection
21850 is used under already very constrained scenarios. Compiling
21851 corlib or mcs only exposes one hit, so it would not really reduce
21852 any memory consumption.
21854 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21856 * typemanager.cs: fixes bug #45889 by only adding public types from
21857 other assemblies to the list of known types.
21859 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21861 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
21862 on the type we resolved.
21864 2003-07-05 Martin Baulig <martin@ximian.com>
21866 * pending.cs (PendingImplementation.ParentImplements): Don't
21867 create the proxy if the parent is abstract.
21869 * class.cs (TypeContainer.DefineIndexers): Process explicit
21870 interface implementations first. Fixes #37714.
21872 2003-07-04 Miguel de Icaza <miguel@ximian.com>
21874 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
21875 defined recursively; but since we modify the input parameters
21876 (left is set to `this' temporarily), we reset this value if the
21877 left_is_explicit is false, which gives the original semantics to
21880 * literal.cs (NullPointer): new class used to represent a null
21881 literal in a pointer context.
21883 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
21884 type is a pointer, use a NullPointer object instead of a
21885 NullLiteral. Closes 43687
21887 (ExplicitConversion): Convert pointer values using
21888 the conv opcode to the proper type.
21890 * ecore.cs (New): change ValueTypeVariable property into a method,
21891 that returns whether the valuetype is suitable for being used.
21893 * expression.cs (Binary.DoNumericPromotions): Only return if we
21894 the int constant was a valid uint, and we can return both left and
21895 right as uints. If not, we continue processing, to trigger the
21896 type conversion. This fixes 39018.
21898 * statement.cs (Block.EmitMeta): During constant resolution, set
21899 the CurrentBlock property on the emitcontext, so that we resolve
21900 constants propertly.
21902 2003-07-02 Martin Baulig <martin@ximian.com>
21904 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
21905 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
21907 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
21908 than emitting it here.
21910 * statement.cs: Fixed some more flow analysis bugs.
21912 2003-07-02 Martin Baulig <martin@ximian.com>
21914 * class.cs (MethodData.Define): When implementing interface
21915 methods, set Final unless we're Virtual.
21917 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
21918 check work for interface methods.
21920 2003-07-01 Martin Baulig <martin@ximian.com>
21922 * ecore.cs (EmitContext.This): Replaced this property with a
21923 GetThis() method which takes a Location argument. This ensures
21924 that we get the correct error location for a CS0188.
21926 2003-07-01 Miguel de Icaza <miguel@ximian.com>
21928 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
21929 ImplicitStandardConversion.
21931 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
21933 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
21935 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
21938 2003-06-30 Miguel de Icaza <miguel@ximian.com>
21940 * class.cs (Constructor.Define): Turn off initlocals for unsafe
21943 (MethodData.Define): Turn off initlocals for unsafe methods.
21945 2003-06-29 Miguel de Icaza <miguel@ximian.com>
21947 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
21948 complete; Fixes #37521.
21950 * delegate.cs: Use Modifiers.TypeAttr to compute the
21951 TypeAttributes, instead of rolling our own. This makes the flags
21952 correct for the delegates.
21954 2003-06-28 Miguel de Icaza <miguel@ximian.com>
21956 * class.cs (Constructor.Define): Set the private flag for static
21957 constructors as well.
21959 * cs-parser.jay (statement_expression): Set the return value to
21960 null, to avoid a crash when we catch an error.
21962 2003-06-24 Miguel de Icaza <miguel@ximian.com>
21964 * cs-parser.jay: Applied patch from Jackson that adds support for
21965 extern and unsafe modifiers to destructor declarations.
21967 * expression.cs: Report error 21 if the user is trying to index a
21970 * driver.cs: Add an error message, suggested by the bug report.
21972 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
21973 if we do not have a ": this ()" constructor initializer. Fixes 45149
21975 2003-06-14 Miguel de Icaza <miguel@ximian.com>
21977 * namespace.cs: Add some information to reduce FAQs.
21979 2003-06-13 Miguel de Icaza <miguel@ximian.com>
21981 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
21982 underlying enumeration types. Fixes #43915.
21984 * expression.cs: Treat ushort/short as legal values to be used in
21985 bitwise operations.
21987 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
21989 * delegate.cs: transfer custom attributes for paramenters from
21990 the delegate declaration to Invoke and BeginInvoke.
21992 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
21994 * attribute.cs: handle custom marshalers and emit marshal info
21997 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
21999 * makefile.gnu: Added anonymous.cs to the compiler sources.
22001 2003-05-28 Miguel de Icaza <miguel@ximian.com>
22003 * iterators.cs: Change the name of the proxy class to include two
22006 * cs-parser.jay: Update grammar to include anonymous methods.
22008 * anonymous.cs: new file.
22010 2003-05-27 Miguel de Icaza <miguel@ximian.com>
22012 * class.cs (Field.Define): Add missing test for pointers and
22015 2003-05-27 Ravi Pratap <ravi@ximian.com>
22017 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
22018 we use the stobj opcode.
22020 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
22021 since it wasn't the correct fix.
22023 It still is puzzling that we are required to use stobj for IntPtr
22024 which seems to be a ValueType.
22026 2003-05-26 Miguel de Icaza <miguel@ximian.com>
22028 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
22029 during regular simple name resolution. Now, the trick is that
22030 instead of returning for processing the simplename, we do a
22031 TypeManager.LookupType (ie, a rooted lookup as opposed to a
22032 contextual lookup type). If a match is found, return that, if
22033 not, return for further composition.
22035 This fixes long-standing 30485.
22037 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
22038 using the address to initialize an object, do an Stobj instead of
22039 using the regular Stelem.
22041 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
22042 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
22043 Because if we are a BaseIndexerAccess that value will be true.
22046 * statement.cs (GotoCase.Resolve): Return after reporting an
22047 error, do not attempt to continue.
22049 * expression.cs (PointerArithmetic.Emit): If our operand is a
22050 long, convert our constants to match the operand before
22051 multiplying. Convert to I type before adding. Fixes 43670.
22053 2003-05-14 Ravi Pratap <ravi@ximian.com>
22055 * enum.cs (ImplicitConversionExists) : Rename to
22056 ImplicitEnumConversionExists to remove ambiguity.
22058 * ecore.cs (NullCast): New type of cast expression class which
22059 basically is very similar to EmptyCast with the difference being
22060 it still is a constant since it is used only to cast a null to
22062 (eg. (string) null)
22064 * convert.cs (ImplicitReferenceConversion): When casting a null
22065 literal, we return a NullCast.
22067 * literal.cs (NullLiteralTyped): Remove - I don't see why this
22068 should be around anymore.
22070 The renaming (reported was slightly wrong). Corrections:
22072 ConvertImplicitStandard -> ImplicitConversionStandard
22073 ConvertExplicitStandard -> ExplicitConversionStandard
22075 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
22076 before passing them in !
22078 * convert.cs (ImplicitConversionStandard): When comparing for
22079 equal expr and target types, ensure that expr is not a
22082 In general, we must not be checking (expr_type ==
22083 target_type) in the top level conversion methods
22084 (ImplicitConversion, ExplicitConversion etc). This checking is
22085 done in the methods that they delegate to.
22087 2003-05-20 Miguel de Icaza <miguel@ximian.com>
22089 * convert.cs: Move Error_CannotConvertType,
22090 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
22091 ImplicitNumericConversion, ImplicitConversionExists,
22092 ImplicitUserConversionExists, StandardConversionExists,
22093 FindMostEncompassedType, FindMostSpecificSource,
22094 FindMostSpecificTarget, ImplicitUserConversion,
22095 ExplicitUserConversion, GetConversionOperators,
22096 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
22097 TryImplicitIntConversion, Error_CannotConvertImplicit,
22098 ConvertImplicitRequired, ConvertNumericExplicit,
22099 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
22100 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
22103 Perform the following renames:
22105 StandardConversionExists -> ImplicitStandardConversionExists
22106 ConvertImplicit -> ImplicitConversion
22107 ConvertImplicitStandard -> ImplicitStandardConversion
22108 TryImplicitIntConversion -> ImplicitIntConversion
22109 ConvertImplicitRequired -> ImplicitConversionRequired
22110 ConvertNumericExplicit -> ExplicitNumericConversion
22111 ConvertReferenceExplicit -> ExplicitReferenceConversion
22112 ConvertExplicit -> ExplicitConversion
22113 ConvertExplicitStandard -> ExplicitStandardConversion
22115 2003-05-19 Martin Baulig <martin@ximian.com>
22117 * statement.cs (TypeInfo.StructInfo): Made this type protected.
22118 (TypeInfo): Added support for structs having structs as fields.
22120 * ecore.cs (FieldExpr): Implement IVariable.
22121 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
22122 VariableInfo for the field.
22124 2003-05-18 Martin Baulig <martin@ximian.com>
22126 * expression.cs (This.DoResolve): Report a CS0027 if we're
22127 emitting a field initializer.
22129 2003-05-18 Martin Baulig <martin@ximian.com>
22131 * expression.cs (This.ResolveBase): New public function.
22132 (This.DoResolve): Check for CS0188.
22134 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
22137 * ecore.cs (MethodGroupExpr.DoResolve): Set the
22138 `instance_expression' to null if we don't have any non-static
22141 2003-05-18 Martin Baulig <martin@ximian.com>
22143 Reworked the way how local variables and parameters are handled by
22144 the flow analysis code.
22146 * statement.cs (TypeInfo, VariableMap): New public classes.
22147 (VariableInfo): New public class. This is now responsible for
22148 checking whether a variable has been assigned. It is used for
22149 parameters and local variables.
22150 (Block.EmitMeta): Take the InternalParameters as argument; compute
22151 the layout of the flow vectors here.
22152 (Block.LocalMap, Block.ParameterMap): New public properties.
22153 (FlowBranching): The .ctor doesn't get the InternalParameters
22154 anymore since Block.EmitMeta() now computes the layout of the flow
22156 (MyStructInfo): This class is now known as `StructInfo' and nested
22157 in `TypeInfo'; we don't access this directly anymore.
22159 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
22160 property and removed IsAssigned(), IsFieldAssigned(),
22161 SetAssigned() and SetFieldAssigned(); we now call them on the
22162 VariableInfo so we don't need to duplicate this code everywhere.
22164 * expression.cs (ParameterReference): Added `Block block' argument
22166 (LocalVariableReference, ParameterReference, This): The new
22167 VariableInfo class is now responsible for all the definite
22170 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
22171 IsParameterAssigned, SetParameterAssigned): Removed.
22173 2003-05-18 Martin Baulig <martin@ximian.com>
22175 * typemanager.cs (InitCoreTypes): Try calling
22176 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
22177 the 3-args-version. Corlib now also needs our `void_type'.
22178 (GetMethod): Added overloaded version which takes an optional
22179 `bool report_errors' to allow lookups of optional methods.
22181 2003-05-12 Martin Baulig <martin@ximian.com>
22183 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
22184 only used for locals and not for parameters.
22186 2003-05-12 Miguel de Icaza <miguel@ximian.com>
22188 * support.cs (InternalParameters.ParameterType): Return the
22189 ExternalType of the parameter.
22191 * parameter.cs (Parameter.ExternalType): drop the two arguments,
22194 2003-05-11 Miguel de Icaza <miguel@ximian.com>
22196 * class.cs (MethodData.Define): Do not set the `newslot' on
22197 interface members, if they are also flagged as "override".
22199 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
22200 better code for ++i and i++. This only works for static fields
22201 and local variables.
22203 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
22204 want to pull the DeclSpace out of the builder_to_declspace instead
22205 of the TypeBuilder (like in TypeContainer.FindMembers).
22207 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
22208 instead of LookupTypeContainer. Fixes the crash on .NET for
22209 looking up interface members.
22211 * const.cs: Create our own emit context during the Definition
22212 stage, so that constants are evaluated in the proper context, when
22213 a recursive definition happens.
22215 2003-05-11 Martin Baulig <martin@ximian.com>
22217 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
22218 new block for a switch section.
22219 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
22220 the adding/lookup in the switch block. Fixes #39828.
22222 2003-05-09 Miguel de Icaza <miguel@ximian.com>
22224 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
22225 functionality: I needed to convert the data after I had performed
22226 the add/sub operation into the operands type size.
22228 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
22229 pass the type for the box operation, otherwise the resulting
22230 object would have been of type object.
22232 (BoxedCast): Add constructor to specify the type to box as.
22234 2003-05-07 Miguel de Icaza <miguel@ximian.com>
22236 * iterators.cs: I was reusing the `count' variable inadvertently,
22237 take steps to not allow this to happen.
22239 2003-05-06 Miguel de Icaza <miguel@ximian.com>
22241 * attribute.cs (Attribute.Resolve): Params attributes are encoded
22242 by creating an array at the point where the params starts and
22243 putting all those arguments there, then adjusting the size of the
22246 2003-05-05 Miguel de Icaza <miguel@ximian.com>
22248 * expression.cs (New.AddressOf): Implement interface
22249 IMemoryLocation. This is used when the `new' operator is used in
22250 the context of an invocation to a method on a value type.
22252 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
22255 * namespace.cs: Also check the using aliases here.
22257 * driver.cs: Move the test for using validity after the types have
22258 been entered, so we do a single pass that also includes the using
22261 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
22262 in the regular case. CreateSiblingForFinally is doing extra
22265 * attribute.cs (GetAttributeArgumentExpression): Store the result
22266 on an out value, and use the return value to indicate failure
22267 instead of using null (which is a valid return for Constant.GetValue).
22269 * statement.cs: Perform the analysis flow for the increment
22270 portion after the statement, because this will be the real flow of
22271 execution. Fixes #42385
22273 * codegen.cs (EmitContext.EmitArgument,
22274 EmitContext.EmitStoreArgument): New helper functions when the
22275 RemapToProxy flag is set.
22277 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
22280 Add support for remapping parameters.
22282 * iterators.cs: Propagate parameter values; Store parameter
22283 values in the proxy classes.
22285 2003-05-04 Miguel de Icaza <miguel@ximian.com>
22287 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
22288 need a proxy reference; I do not know what I was thinking
22290 * cs-parser.jay (constructor_initializer): catch another error,
22291 and display nice message.
22293 (field_declaration): catch void field declaration
22294 to flag a better error.
22296 * class.cs (MemberBase.CheckBase): Report an error instead of a
22297 warning if a new protected member is declared in a struct.
22298 (Field.Define): catch the error of readonly/volatile.
22300 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
22302 (FieldExpr.AddressOf): ditto. Catch error where the address of a
22303 volatile variable is taken
22305 2003-05-02 Miguel de Icaza <miguel@ximian.com>
22307 * statement.cs (Fixed.Resolve): Report an error if we are not in
22310 2003-05-01 Miguel de Icaza <miguel@ximian.com>
22312 * typemanager.cs: reuse the code that handles type clashes for
22313 delegates and enumerations.
22315 * class.cs (Report28): Always report.
22317 * expression.cs (EncodeAsAttribute): Allow nulls here.
22319 2003-04-28 Miguel de Icaza <miguel@ximian.com>
22321 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
22322 the functionality for testing whether an expression is valid for
22323 an attribute here. Also handle the case of arrays of elements
22326 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
22327 encoding a linear array into an array of objects that are suitable
22328 to be passed to an CustomAttributeBuilder.
22330 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
22332 * ecore.cs: (FieldExpr): Handle field remapping here.
22334 * iteratators.cs: Pass the instance variable (if the method is an
22335 instance method) to the constructors, so we can access the field
22336 variables on the class.
22338 TODO: Test this with structs. I think the THIS variable on
22339 structs might have to be a pointer, and not a refenrece
22341 2003-04-27 Miguel de Icaza <miguel@ximian.com>
22343 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
22344 local variables to fields in a proxy class.
22346 * iterators.cs (PopulateProxy): Rename our internal fields to
22348 Create a <THIS> field if we are an instance method, so we can
22349 reference our parent container variables.
22350 (MapVariable): Called back from the EmitContext code to enter a
22351 new variable to field mapping into the proxy class (we just create
22355 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
22356 for using the remapped locals to fields.
22358 I placed the code here, because that gives the same semantics to
22359 local variables, and only changes the Emit code.
22361 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
22362 statements inside iterators.
22363 (VariableInfo): Add a FieldBuilder for the cases when we are
22364 remapping local variables to fields in a proxy class
22366 * ecore.cs (SimpleNameResolve): Avoid testing two times for
22367 current_block != null.
22369 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
22370 not cope with strings, as it has been moved to the
22371 TableSwitchEmit. Fixed bug in switch generation.
22373 * expression.cs (New.DoResolve): Provide more context for the user
22374 when reporting an error.
22376 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
22379 * expression.cs (MemberAccess.DoResolve): When we get a type back,
22380 check the permissions for it. Note than in a type-resolution
22381 context the check was already present in DeclSpace.ResolveType,
22382 but was missing from the MemberAccess.
22384 (ArrayCreation.CheckIndices): warn if the user has
22385 more nested levels of expressions, but there are no more
22386 dimensions specified. Avoids crash on bug 41906.
22388 2003-04-26 Miguel de Icaza <miguel@ximian.com>
22390 * statement.cs (Block): replace Implicit bool, for a generic
22392 New flag: `Unchecked'. This is used during the EmitMeta phase
22393 (which is out-of-line with the regular Resolve/Emit process for a
22394 statement, as this is done ahead of time, but still gets a chance
22395 to call constant resolve).
22397 (Block.Flags): new enum for adding a new flag.
22399 (Block.EmitMeta): track the state of unchecked.
22401 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
22402 to enable constant resolution to work there as well.
22404 2003-04-22 Miguel de Icaza <miguel@ximian.com>
22406 * typemanager.cs (ienumerable_type): Also look up
22407 System.Collections.IEnumerable.
22409 2003-04-21 Miguel de Icaza <miguel@ximian.com>
22411 TODO: Test more than one conditional per method.
22413 * class.cs (Indexer.Define): Report the location where the user is
22414 referencing the unsupported feature.
22416 (MethodData): Overload the use of `conditionals' to
22417 minimize the creation of needless ArrayLists. This saves roughly
22418 212kb on my machine.
22420 (Method): Implement the new IIteratorContainer interface.
22421 (Method.SetYields): Implement the method by setting the ModFlags
22422 to contain METHOD_YIELDS.
22424 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
22425 which just got set to null.
22427 * iterators.cs: New file.
22429 (Yield, YieldBreak): New statements.
22431 * statement.cs (Return.Resolve): Flag an error if we are used in
22432 an iterator method.
22434 * codegen.cs (InIterator): New flag set if the code is being
22435 compiled in an iterator method.
22437 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
22438 internal modifier, and we just use it to avoid adding extra
22439 fields, as this is seldom used.
22441 * cs-parser.jay: Add yield_statement (yield and yield break).
22443 * driver.cs: New flag -v2 to turn on version 2 features.
22445 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
22446 hashtable when v2 is enabled.
22448 2003-04-20 Miguel de Icaza <miguel@ximian.com>
22450 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
22451 there is already a namespace defined with this name.
22453 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
22454 people upgraded their corlibs.
22456 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
22457 always use fully qualified types, no need to use the compiler
22460 (TypeManager.IsNamespace): Use binarysearch.
22462 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
22463 AddDelegate): I did not quite use the new IsValid API properly: I
22464 have to pass the short-name and the fullname. I was passing only
22465 the basename instead of the fullname sometimes.
22467 (TypeContainer.DefineType): call NamespaceClash.
22469 * interface.cs (Interface.DefineType): use NamespaceClash before
22472 * delegate.cs (Delegate.DefineType): use NamespaceClash before
22475 * enum.cs: (Enum.DefineType): use NamespaceClash before
22478 * typemanager.cs (: 3-line patch that gives us some tasty 11%
22479 speed increase. First, use the negative_hits cache when we get a
22480 negative. Second, add the type with its full original name
22481 instead of the new . and + encoded name (reflection uses + to
22482 separate type from a nested type). Use LookupTypeReflection
22483 directly which bypasses the type->name hashtable (that we already
22484 know does not contain the type.
22486 * decl.cs (DeclSpace.ResolveTypeExpr): track the
22487 location/container type.
22489 * driver.cs: When passing utf8, use directly the UTF8Encoding.
22491 2003-04-19 Miguel de Icaza <miguel@ximian.com>
22493 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
22495 * delegate.cs (NewDelegate.Resolve): Test whether an instance
22496 method is being referenced in the method group from a static
22497 context, and report error 120 if so.
22499 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
22502 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
22503 is created, we create the A namespace).
22505 * cs-parser.jay: A namespace also introduces a DeclarationFound.
22508 2003-04-18 Miguel de Icaza <miguel@ximian.com>
22510 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
22511 invocation to ModuleBuilder.GetType with the same values will
22512 return a new type instance, so we need to cache its return
22515 * expression.cs (Binary.ResolveOperator): Only allow the compare
22516 operators on enums if they are of the same type.
22518 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
22519 types of ValueType on their own case. Before we were giving them
22520 the same treatment as objects.
22522 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
22523 fullname. Short name is used to compare against container name.
22524 Fullname is used to check against defined namespace names.
22526 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
22527 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
22529 (Method.CheckBase): Call parent.
22530 (MemberBase.CheckBase): Check for protected members on sealed
22532 (PropertyBase.CheckBase): Call parent.
22533 (Field.Define): Call parent.
22535 * report.cs: Negative error codes are now mapped to 8000 - code,
22536 so that the display is render more nicely.
22538 * typemanager.cs: Do not use try/catch, instead report a regular
22541 (GetPointerType, GetReferenceType): These methods provide
22542 mechanisms to obtain the T* and T& from a T. We had the code
22543 previously scattered around the code base, and it also used
22544 TypeManager.LookupType that would go through plenty of caches.
22545 This one goes directly to the type source.
22547 In some places we did the Type.GetType followed by
22548 ModuleBuilder.GetType, but not in others, so this unifies the
22549 processing as well.
22551 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
22552 statements now that we have namespace information.
22554 * typemanager.cs (IsNamespace): New method, returns whether the
22555 string presented is a namespace or not.
22557 (ComputeNamespaces): New public entry point, computes the list of
22558 available namespaces, using the GetNamespaces API call in Mono, or
22559 the slower version in MS.NET.
22561 Now before we start the semantic analysis phase, we have a
22562 complete list of namespaces including everything that the user has
22565 Deleted old code to cache namespaces in .nsc files.
22567 2003-04-17 Miguel de Icaza <miguel@ximian.com>
22569 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
22570 class/struct location definition Location for the implicit
22571 constructor location.
22573 (Operator.Define): Use the location of the operator for the
22574 implicit Method definition.
22576 (Constructor.Emit): use the constructor location for the implicit
22577 base initializer constructor.
22579 * ecore.cs: Remove ITypeExpression. This interface is now gone,
22580 and the Expression class now contains two new methods:
22582 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
22583 isolate type lookup from the rest of the resolution process.
22585 Since we use Expressions to hold type definitions due to the way
22586 we parse the input we have historically overloaded Resolve to
22587 perform the Type lookups if a special flag is passed. Now this is
22588 eliminated and two methods take their place.
22590 The differences in the two methods between xStep and xTerminal is
22591 that xStep is involved in our current lookup system that uses
22592 SimpleNames to compose a name, while xTerminal is used just to
22593 catch the case where the simplename lookup failed.
22595 2003-04-16 Miguel de Icaza <miguel@ximian.com>
22597 * expression.cs (ResolveMemberAccess): Remove redundant code.
22598 TypeExpr expressions are always born fully resolved.
22600 * interface.cs (PopulateMethod): Do not lookup the types twice.
22601 We were doing it once during SemanticAnalysis and once during
22604 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
22605 in local variable type definitions, were being returned as a
22606 SimpleName (we decomposed everything into a string), that is
22607 because primary_expression was being used instead of a type in the
22608 grammar (reduce/reduce conflicts).
22610 The part that was wrong is that we converted the expression into a
22611 string (an oversimplification in one hand, compounded with primary
22612 expressions doing string concatenation).
22618 Would return "A.B.C[]" as a SimpleName. This stopped things like
22619 using clauses from working on this particular context. And a type
22620 was being matched directly against "A.B.C[]".
22622 We now use the correct approach, and allow for ComposedCast to be
22623 part of the unary expression. So the "A.B.C []" become a composed
22624 cast of "A.B.C" (as a nested group of MemberAccess with a
22625 SimpleName at the end) plus the rank composition "[]".
22629 2003-04-10 Miguel de Icaza <miguel@ximian.com>
22631 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
22632 for the access level checking.
22634 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
22635 `TypeContainer container', because I kept getting confused when I
22636 was debugging this code.
22638 * expression.cs (Indexers): Instead of tracking getters/setters,
22639 we now track them in parallel. We create one arraylist less, but
22640 most importantly it is possible now for the LValue code to find a
22641 matching get for a set.
22643 (IndexerAccess.DoResolveLValue): Update the code.
22644 GetIndexersForType has been modified already to extract all the
22645 indexers from a type. The code assumed it did not.
22647 Also make the code set the correct return type for the indexer.
22648 This was fixed a long time ago for properties, but was missing for
22649 indexers. It used to be void_type.
22651 (Binary.Emit): Test first for doubles instead of
22652 floats, as they are more common.
22654 (Binary.EmitBranchable): Use the .un version of the branch opcodes
22655 when dealing with floats and the <=, >= operators. This fixes bug
22658 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
22659 to load the array value by emitting a load on the foreach variable
22660 type. This was incorrect.
22662 We now emit the code to load an element using the the array
22663 variable type, and then we emit the conversion operator.
22667 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
22669 * attribute.cs: Avoid allocation of ArrayLists in the common case.
22671 2003-04-09 Miguel de Icaza <miguel@ximian.com>
22673 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
22674 test for protection before we test for signatures.
22676 (MethodSignature.ToString): implement.
22678 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
22679 to the case where we reduced into a LongConstant.
22681 * decl.cs (CheckAccessLevel): If the type is an array, we can not
22682 depend on whether the information is acurrate, because the
22683 Microsoft runtime will always claim that the array type is public,
22684 regardless of the real state.
22686 If the type is a pointer, another problem happens: the type is
22687 reported as non-public in Microsoft.
22689 In both cases we have to call CheckAccessLevel recursively with
22690 the underlying type as the argument to be tested.
22692 2003-04-08 Miguel de Icaza <miguel@ximian.com>
22694 * assign.cs (Assign.Emit): If we are dealing with a compound
22695 assignment expression, we should use the code path that stores the
22696 intermediate result in a temporary value. This fixes #40903.
22698 *expression.cs (Indirection.ToString): Provide ToString method for
22701 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
22703 * class.cs: Null out fields holding references to Block objects so
22704 they can be garbage collected.
22706 * expression.cs (OverloadResolve): Remove unused local.
22708 2003-04-07 Martin Baulig <martin@ximian.com>
22710 * codegen.cs (EmitContext.CurrentFile): New public field.
22711 (EmitContext.Mark): Use the CurrentFile to check whether the
22712 location is in the correct file.
22713 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
22715 2003-04-07 Martin Baulig <martin@ximian.com>
22717 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
22719 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
22720 location. [FIXME: The location argument which gets passed to this
22721 method is sometimes wrong!]
22723 2003-04-07 Nick Drochak <ndrochak@gol.com>
22725 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
22727 2003-04-07 Miguel de Icaza <miguel@ximian.com>
22729 * expression.cs (Indirection.EmitAssign): We were using the
22730 temporary, but returning immediately instead of continuing the
22733 2003-04-06 Martin Baulig <martin@ximian.com>
22735 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
22736 if it's a nested child, but also deriving from the outer class.
22739 * typemanager.cs (IsNestedChildOf): Make this work if it's a
22740 nested child, but also deriving from the outer class. See
22742 (FilterWithClosure): We may access private members of the outer
22743 class if we're a nested child and deriving from the outer class.
22744 (RealMemberLookup): Only set `closure_private_ok' if the
22745 `original_bf' contained BindingFlags.NonPublic.
22747 2003-04-05 Martin Baulig <martin@ximian.com>
22749 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
22751 2003-04-02 Miguel de Icaza <miguel@ximian.com>
22753 * class.cs (Event.Define): Do not allow abstract events to have
22756 2003-04-01 Miguel de Icaza <miguel@ximian.com>
22758 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
22759 block in event declarations.
22761 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
22762 value type, get its address.
22764 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
22765 leaving a class on the stack instead of a boolean value (int
22766 0/1). Change the code so we compare against null, and then the
22767 result against zero.
22769 * class.cs (TypeContainer.GetClassBases): We were checking for the
22770 parent class being sealed too late.
22772 * expression.cs (Binary.Emit): For <= and >= when dealing with
22773 floating point values, use cgt.un and clt.un instead of cgt and
22776 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
22778 * statement.cs: Apply the same optimization as MS: skip the
22779 GetEnumerator returning an IEnumerator, and use the one returning a
22780 CharEnumerator instead. This allows us to avoid the try-finally block
22783 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
22785 * cs-parser.jay: Attributes cannot be applied to
22786 namespaces. Fixes #40473
22788 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22791 (Add*): check if the name is valid using the full name for constants,
22792 fields, properties and events.
22794 2003-03-28 Miguel de Icaza <miguel@ximian.com>
22796 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
22797 char constants to be part of the enumeration.
22799 * expression.cs (Conditional.DoResolve): Add support for operator
22800 true. Implements the missing functionality from 14.12
22802 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
22803 operator true/false as required by the spec.
22805 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
22806 implicit conversion to boolean.
22808 * statement.cs (Statement.ResolveBoolean): A boolean expression is
22809 also one where the type implements `operator true'.
22811 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
22812 get an expression that will invoke operator true based on an
22815 (GetConversionOperators): Removed the hack that called op_True
22818 (Expression.ResolveBoolean): Move this from Statement.
22820 2003-03-17 Miguel de Icaza <miguel@ximian.com>
22822 * ecore.cs (FieldExpr): do not allow initialization of initonly
22823 fields on derived classes
22825 2003-03-13 Martin Baulig <martin@ximian.com>
22827 * statement.cs (Block.Emit): Call ig.BeginScope() and
22828 ig.EndScope() when compiling with debugging info; call
22829 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
22831 2003-03-08 Miguel de Icaza <miguel@ximian.com>
22833 * expression.cs (Indexers): Do not construct immediately, allow
22834 for new members to be appended as we go. Fixes 38143
22836 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22838 * expression.cs: save/restore context when resolving an unchecked
22841 2003-03-05 Miguel de Icaza <miguel@ximian.com>
22843 * cfold.cs: Catch division by zero in modulus operator during
22846 2003-03-03 Miguel de Icaza <miguel@ximian.com>
22848 * interface.cs (Interface.DefineMembers): Avoid defining members
22851 2003-02-27 Miguel de Icaza <miguel@ximian.com>
22853 * driver.cs: handle the +/- options for -noconfig
22855 * statement.cs (Unckeched.Resolve): Also track the state of
22856 unchecked in the Resolve phase.
22858 2003-02-27 Martin Baulig <martin@ximian.com>
22860 * ecore.cs (Expression.MemberLookup): Don't create a
22861 MethodGroupExpr for something which is not a method. Fixes #38291.
22863 2003-02-25 Miguel de Icaza <miguel@ximian.com>
22865 * class.cs (MemberBase.CheckParameters): Also check that the type
22866 is unmanaged if it is a pointer.
22868 * expression.cs (SizeOf.Resolve): Add location information.
22870 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
22871 a managed type is declared.
22873 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
22874 parameter modifiers as well. Fixes bug 38606
22876 * class.cs: Very sad. Am backing out the speed up changes
22877 introduced by the ArrayList -> Array in the TypeContainer, as they
22878 were not actually that much faster, and introduced a bug (no error
22879 reports on duplicated methods).
22881 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
22882 source first, this will guarantee that we have a valid expression
22883 before calling in lower levels functions that will require a
22884 resolved object. Then use this original_source in the
22885 target.ResolveLValue instead of the original source that was
22888 Another change. Use target.Resolve instead of LValueResolve.
22889 Although we are resolving for LValues, we will let the Assign code
22890 take care of that (it will be called again from Resolve). This
22891 basically allows code like this:
22893 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
22894 class Y { void A (X x) { x [0] += o; }
22896 The problem was that the indexer was trying to resolve for
22897 set_Item (idx, object o) and never finding one. The real set_Item
22898 was set_Item (idx, X). By delaying the process we get the right
22903 2003-02-23 Martin Baulig <martin@ximian.com>
22905 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
22906 while calling DoEmit ().
22908 * codegen.cs (EmitContext.Mark): Don't mark locations in other
22909 source files; if you use the #line directive inside a method, the
22910 compiler stops emitting line numbers for the debugger until it
22911 reaches the end of the method or another #line directive which
22912 restores the original file.
22914 2003-02-23 Martin Baulig <martin@ximian.com>
22916 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
22918 2003-02-23 Martin Baulig <martin@ximian.com>
22920 * statement.cs (Block.AddChildVariableNames): We need to call this
22921 recursively, not just for our immediate children.
22923 2003-02-23 Martin Baulig <martin@ximian.com>
22925 * class.cs (Event.Define): Always make the field private, like csc does.
22927 * typemanager.cs (TypeManager.RealMemberLookup): Make events
22928 actually work, fixes bug #37521.
22930 2003-02-23 Miguel de Icaza <miguel@ximian.com>
22932 * delegate.cs: When creating the various temporary "Parameters"
22933 classes, make sure that we call the ComputeAndDefineParameterTypes
22934 on those new parameters (just like we do with the formal ones), to
22935 allow them to be resolved in the context of the DeclSpace.
22937 This fixes the bug that Dick observed in Bugzilla #38530.
22939 2003-02-22 Miguel de Icaza <miguel@ximian.com>
22941 * expression.cs (ResolveMemberAccess): When resolving a constant,
22942 do not attempt to pull a constant if the value was not able to
22943 generate a valid constant.
22945 * const.cs (LookupConstantValue): Do not report more errors than required.
22947 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22949 * expression.cs: fixes bug #38328.
22951 2003-02-18 Miguel de Icaza <miguel@ximian.com>
22953 * class.cs: Changed all the various members that can be part of a
22954 class from being an ArrayList to be an Array of the right type.
22955 During the DefineType type_list, interface_list, delegate_list and
22956 enum_list are turned into types, interfaces, delegates and enums
22959 And during the member population, indexer_list, event_list,
22960 constant_list, field_list, instance_constructor_list, method_list,
22961 operator_list and property_list are turned into their real arrays.
22963 Although we could probably perform this operation earlier, for
22964 good error reporting we need to keep the lists and remove the
22965 lists for longer than required.
22967 This optimization was triggered by Paolo profiling the compiler
22968 speed on the output of `gen-sample-program.pl' perl script.
22970 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
22971 not crash in methods like MemberLookupFailed that use this field.
22973 This problem arises when the compiler fails to resolve a type
22974 during interface type definition for example.
22976 2003-02-18 Miguel de Icaza <miguel@ximian.com>
22978 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
22979 inherit from System.Object, so we have to stop at null, not only
22980 when reaching System.Object.
22982 2003-02-17 Miguel de Icaza <miguel@ximian.com>
22984 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
22985 DeclaredOnly because the parent indexer might have had a different
22986 name, but did not loop until the top of the hierarchy was reached.
22988 The problem this one fixes is 35492: when a class implemented an
22989 indexer from an interface, we were getting the interface method
22990 (which was abstract) and we were flagging an error (can not invoke
22993 This also keeps bug 33089 functioning, and test-148 functioning.
22995 * typemanager.cs (IsSpecialMethod): The correct way of figuring
22996 out if a method is special is to see if it is declared in a
22997 property or event, or whether it is one of the predefined operator
22998 names. This should fix correctly #36804.
23000 2003-02-15 Miguel de Icaza <miguel@ximian.com>
23002 The goal here is to remove the dependency on EmptyCast.Peel ().
23003 Killing it completely.
23005 The problem is that currently in a number of places where
23006 constants are expected, we have to "probe" for an EmptyCast, and
23007 Peel, which is not the correct thing to do, as this will be
23008 repetitive and will likely lead to errors.
23010 The idea is to remove any EmptyCasts that are used in casts that
23011 can be reduced to constants, so we only have to cope with
23014 This bug hunt was triggered by Bug 37363 and the desire to remove
23015 the duplicate pattern where we were "peeling" emptycasts to check
23016 whether they were constants. Now constants will always be
23019 * ecore.cs: Use an enumconstant here instead of wrapping with
23022 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
23023 throwing me off. By handling this we can get rid of a few hacks.
23025 * statement.cs (Switch): Removed Peel() code.
23027 2003-02-14 Miguel de Icaza <miguel@ximian.com>
23029 * class.cs: Location information for error 508
23031 * expression.cs (New.DoResolve): Add a guard against double
23032 resolution of an expression.
23034 The New DoResolve might be called twice when initializing field
23035 expressions (see EmitFieldInitializers, the call to
23036 GetInitializerExpression will perform a resolve on the expression,
23037 and later the assign will trigger another resolution
23039 This leads to bugs (#37014)
23041 * delegate.cs: The signature for EndInvoke should contain any ref
23042 or out parameters as well. We were not doing this in the past.
23044 * class.cs (Field.Define): Do not overwrite the type definition
23045 inside the `volatile' group. Turns out that volatile enumerations
23046 were changing the type here to perform a validity test, which
23049 2003-02-12 Miguel de Icaza <miguel@ximian.com>
23051 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
23052 and structs, we do not want to load the instance variable
23054 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
23055 enum_type has to be handled like an object reference (implicit
23056 conversions exists from this to object), but the regular IsClass
23057 and IsValueType tests will never return true for this one.
23059 Also we use TypeManager.IsValueType instead of type.IsValueType,
23060 just for consistency with the rest of the code (this is only
23061 needed if we ever use the construct exposed by test-180.cs inside
23062 corlib, which we dont today).
23064 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
23066 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
23069 2003-02-09 Martin Baulig <martin@ximian.com>
23071 * namespace.cs (Namespace..ctor): Added SourceFile argument.
23072 (Namespace.DefineNamespaces): New static public method; this is
23073 called when we're compiling with debugging to add all namespaces
23074 to the symbol file.
23076 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
23077 pass it to the Namespace's .ctor.
23079 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
23080 and MethodBase arguments; pass the namespace ID to the symwriter;
23081 pass the MethodBase instead of the token to the symwriter.
23082 (SymbolWriter.DefineNamespace): New method to add a namespace to
23085 2003-02-09 Martin Baulig <martin@ximian.com>
23087 * symbolwriter.cs: New file. This is a wrapper around
23088 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
23089 methods here in near future.
23091 2003-02-09 Martin Baulig <martin@ximian.com>
23093 * codegen.cs (EmitContext.Mark): Just pass the arguments to
23094 ILGenerator.MarkSequencePoint() which are actually used by the
23097 2003-02-09 Martin Baulig <martin@ximian.com>
23099 * location.cs (SourceFile): New public sealed class. This
23100 contains the name and an index which is used in the location's token.
23101 (Location): Reserve an appropriate number of bits in the token for
23102 the source file instead of walking over that list, this gives us a
23103 really huge performance improvement when compiling with debugging.
23105 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
23106 `SourceFile' argument instead of a string.
23107 (Driver.ProcessFile): Add all the files via Location.AddFile(),
23108 but don't parse/tokenize here, we need to generate the list of all
23109 source files before we do that.
23110 (Driver.ProcessFiles): New static function. Parses/tokenizes all
23113 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
23114 instead of a string.
23116 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
23119 2003-02-09 Martin Baulig <martin@ximian.com>
23121 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
23122 filename on `#line default'.
23124 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
23126 * statement.cs: don't clear the pinned var when the fixed statement
23127 returns from the method (fixes bug#37752).
23129 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
23131 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
23134 2003-02-07 Martin Baulig <martin@ximian.com>
23136 * driver.cs: Removed the `--debug-args' command line argument.
23138 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
23139 automatically by the AsssemblyBuilder.
23140 (CodeGen.InitializeSymbolWriter): We don't need to call any
23141 initialization function on the symbol writer anymore. This method
23142 doesn't take any arguments.
23144 2003-02-03 Miguel de Icaza <miguel@ximian.com>
23146 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
23147 from referenced assemblies as well.
23149 2003-02-02 Martin Baulig <martin@ximian.com>
23151 * class.cs (MethodData.Emit): Generate debugging info for external methods.
23153 2003-02-02 Martin Baulig <martin@ximian.com>
23155 * class.cs (Constructor.Emit): Open the symbol writer before
23156 emitting the constructor initializer.
23157 (ConstructorInitializer.Emit): Call ec.Mark() to allow
23158 single-stepping through constructor initializers.
23160 2003-01-30 Miguel de Icaza <miguel@ximian.com>
23162 * class.cs: Handle error 549: do not allow virtual methods in
23165 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
23167 * decl.cs: Check access levels when resolving types
23169 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
23171 * statement.cs: Add parameters and locals set in catch blocks that might
23172 return to set vector
23174 2003-01-29 Miguel de Icaza <miguel@ximian.com>
23176 * class.cs (Operator): Set the SpecialName flags for operators.
23178 * expression.cs (Invocation.DoResolve): Only block calls to
23179 accessors and operators on SpecialName methods.
23181 (Cast.TryReduce): Handle conversions from char constants.
23184 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
23186 * statement.cs: small memory and time optimization in FlowBranching.
23188 2003-01-28 Pedro Mart <yoros@wanadoo.es>
23190 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
23191 problem that the last fix but in the other sid (Set).
23193 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
23194 access when there is no indexer in the hierarchy.
23196 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
23198 * class.cs: Combine some if statements.
23200 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23202 * driver.cs: fixed bug #37187.
23204 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
23206 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
23207 any indexer, it's needed to build a list with all the indexers in the
23208 hierarchy (AllGetters), else we have problems. Fixes #35653.
23210 2003-01-23 Miguel de Icaza <miguel@ximian.com>
23212 * class.cs (MethodData.Define): It is wrong for an interface
23213 implementation to be static in both cases: explicit and implicit.
23214 We were only handling this in one case.
23216 Improve the if situation there to not have negations.
23218 * class.cs (Field.Define): Turns out that we do not need to check
23219 the unsafe bit on field definition, only on usage. Remove the test.
23221 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23223 * driver.cs: use assembly.Location instead of Codebase (the latest
23224 patch made mcs fail when using MS assemblies).
23226 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
23228 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
23229 get the path to *corlib.dll.
23231 2003-01-21 Nick Drochak <ndrochak@gol.com>
23235 * typemanager.cs: Remove compiler warnings
23237 2003-01-20 Duncan Mak <duncan@ximian.com>
23239 * AssemblyInfo.cs: Bump the version number to 0.19.
23241 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23243 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
23245 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
23247 * class.cs (Constructor::Emit): Emit debugging info for constructors.
23249 2003-01-17 Miguel de Icaza <miguel@ximian.com>
23251 * cs-parser.jay: Small fix: we were not comparing the constructor
23252 name correctly. Thanks to Zoltan for the initial pointer.
23254 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
23256 * cs-tokenizer.cs: Set file name when specified with #line
23258 2003-01-15 Miguel de Icaza <miguel@ximian.com>
23260 * cs-parser.jay: Only perform the constructor checks here if we
23261 are named like the class; This will help provider a better
23262 error. The constructor path is taken when a type definition is
23263 not found, but most likely the user forgot to add the type, so
23264 report that rather than the constructor error.
23266 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
23268 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
23271 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23273 * cs-parser.jay: Add cleanup call.
23275 2003-01-13 Duncan Mak <duncan@ximian.com>
23277 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
23278 consistent with other methods.
23280 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23282 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
23284 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
23286 * attribute.cs: only set GuidAttr to true when we have a
23289 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23293 * typemanager.cs: fixes to allow mcs compile corlib with the new
23294 Type.IsSubclassOf fix.
23296 2003-01-08 Miguel de Icaza <miguel@ximian.com>
23298 * expression.cs (LocalVariableReference.DoResolve): Classify a
23299 constant as a value, not as a variable. Also, set the type for
23302 * cs-parser.jay (fixed_statement): take a type instead of a
23303 pointer_type, so we can produce a better error message later.
23305 * statement.cs (Fixed.Resolve): Flag types that are not pointers
23308 (For.DoEmit): Make inifinite loops have a
23309 non-conditional branch back.
23311 (Fixed.DoEmit): First populate the pinned variables, then emit the
23312 statement, then clear the variables. Before I was emitting the
23313 code once for each fixed piece.
23316 2003-01-08 Martin Baulig <martin@ximian.com>
23318 * statement.cs (FlowBranching.MergeChild): A break in a
23319 SWITCH_SECTION does not leave a loop. Fixes #36155.
23321 2003-01-08 Martin Baulig <martin@ximian.com>
23323 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
23324 lives in the same number space than `param_map'. Fixes #36154.
23326 2003-01-07 Miguel de Icaza <miguel@ximian.com>
23328 * cs-parser.jay (constructor_declaration): Set the
23329 Constructor.ModFlags before probing for it. This makes the
23330 compiler report 514, 515 and 132 (the code was there, but got
23333 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
23334 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
23335 (GotoCase.Resolve): Set `Returns' to ALWAYS.
23337 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
23339 * enum.cs: create the enum static fields using the enum type.
23341 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
23343 * class.cs: don't try to create the ParamBuilder for the return
23344 type if it's not needed (and handle it breaking for the ms runtime
23347 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
23349 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
23351 2002-12-29 Miguel de Icaza <miguel@ximian.com>
23353 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
23354 the command. This showed up while compiling the JANET source
23355 code, which used \r as its only newline separator.
23357 2002-12-28 Miguel de Icaza <miguel@ximian.com>
23359 * class.cs (Method.Define): If we are an operator (because it
23360 reuses our code), then set the SpecialName and HideBySig. #36128
23362 2002-12-22 Miguel de Icaza <miguel@ximian.com>
23364 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
23365 exception, report error 120 `object reference required'.
23367 * driver.cs: Add --pause option, used during to measure the size
23368 of the process as it goes with --timestamp.
23370 * expression.cs (Invocation.DoResolve): Do not allow methods with
23371 SpecialName to be invoked.
23373 2002-12-21 Miguel de Icaza <miguel@ximian.com>
23375 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
23376 number before adding it.
23378 2002-12-21 Ravi Pratap <ravi@ximian.com>
23380 * ecore.cs (StandardImplicitConversion): When in an unsafe
23381 context, we allow conversion between void * to any other pointer
23382 type. This fixes bug #35973.
23384 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
23386 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
23387 is not thrown when extensionless outputs are used
23389 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23391 * rootcontext.cs: fixed compilation of corlib.
23393 2002-12-19 Miguel de Icaza <miguel@ximian.com>
23395 * attribute.cs (Attributes.Contains): Add new method.
23397 * class.cs (MethodCore.LabelParameters): if the parameter is an
23398 `out' parameter, check that no attribute `[In]' has been passed.
23400 * enum.cs: Handle the `value__' name in an enumeration.
23402 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
23404 * decl.cs: Added special case to allow overrides on "protected
23407 2002-12-18 Ravi Pratap <ravi@ximian.com>
23409 * attribute.cs (Attributes.AddAttributeSection): Rename to this
23410 since it makes much more sense.
23412 (Attributes.ctor): Don't require a Location parameter.
23414 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
23416 * attribute.cs (ApplyAttributes): Remove extra Location parameters
23417 since we already have that information per attribute.
23419 * everywhere : make appropriate changes.
23421 * class.cs (LabelParameters): Write the code which actually
23422 applies attributes to the return type. We can't do this on the MS
23423 .NET runtime so we flag a warning in the case an exception is
23426 2002-12-18 Miguel de Icaza <miguel@ximian.com>
23428 * const.cs: Handle implicit null conversions here too.
23430 2002-12-17 Ravi Pratap <ravi@ximian.com>
23432 * class.cs (MethodCore.LabelParameters): Remove the extra
23433 Type [] parameter since it is completely unnecessary. Instead
23434 pass in the method's attributes so that we can extract
23435 the "return" attribute.
23437 2002-12-17 Miguel de Icaza <miguel@ximian.com>
23439 * cs-parser.jay (parse): Use Report.Error to flag errors instead
23440 of ignoring it and letting the compile continue.
23442 * typemanager.cs (ChangeType): use an extra argument to return an
23443 error condition instead of throwing an exception.
23445 2002-12-15 Miguel de Icaza <miguel@ximian.com>
23447 * expression.cs (Unary.TryReduce): mimic the code for the regular
23448 code path. Perform an implicit cast in the cases where we can
23449 implicitly convert to one of the integral types, and then reduce
23450 based on that constant. This fixes bug #35483.
23452 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23454 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
23456 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23458 * namespace.cs: fixed bug #35489.
23460 2002-12-12 Miguel de Icaza <miguel@ximian.com>
23462 * class.cs: Remove some dead code.
23464 * cs-parser.jay: Estimate the number of methods needed
23465 (RootContext.MethodCount);
23467 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
23468 numbers instead of StringBuilders.
23470 * support.cs (PtrHashtable): Add constructor with initial size;
23471 We can now reduce reallocations of the method table.
23473 2002-12-10 Ravi Pratap <ravi@ximian.com>
23475 * attribute.cs (ApplyAttributes): Keep track of the emitted
23476 attributes on a per-target basis. This fixes bug #35413.
23478 2002-12-10 Miguel de Icaza <miguel@ximian.com>
23480 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
23481 default to the Windows 1252 encoding.
23483 (UnixParseOption): Support version, thanks to Alp for the missing
23486 * AssemblyInfo.cs: Add nice assembly information.
23488 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
23491 * cs-parser.jay: Allow a trailing comma before the close bracked
23492 in the attribute_section production.
23494 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
23495 address of the instance was being taken, I will take this out,
23496 because we take the address of the object immediately here.
23498 2002-12-09 Ravi Pratap <ravi@ximian.com>
23500 * typemanager.cs (AreMultipleAllowed): Take care of the most
23501 obvious case where attribute type is not in the current assembly -
23504 2002-12-08 Miguel de Icaza <miguel@ximian.com>
23506 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
23507 definitions, instead of doing that afterwards.
23509 Also we use a nice little hack, depending on the constructor, we
23510 know if we are a "composed" name or a simple name. Hence, we
23511 avoid the IndexOf test, and we avoid
23513 * codegen.cs: Add code to assist in a bug reporter to track down
23514 the source of a compiler crash.
23516 2002-12-07 Ravi Pratap <ravi@ximian.com>
23518 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
23519 types have been emitted for a given element and flag an error
23520 if something which does not have AllowMultiple set is used more
23523 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
23524 attribute types and their corresponding AllowMultiple properties
23526 (AreMultipleAllowed): Check the property for a given type.
23528 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
23529 property in the case we have a TypeContainer.
23531 (Attributes.AddAttribute): Detect duplicates and just skip on
23532 adding them. This trivial fix catches a pretty gross error in our
23533 attribute emission - global attributes were being emitted twice!
23535 Bugzilla bug #33187 is now fixed.
23537 2002-12-06 Miguel de Icaza <miguel@ximian.com>
23539 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
23540 instead of pp_and).
23542 * expression.cs (Binary.ResolveOperator): I can only use the
23543 Concat (string, string, string) and Concat (string, string,
23544 string, string) if the child is actually a concatenation of
23547 2002-12-04 Miguel de Icaza <miguel@ximian.com>
23549 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
23550 context where we need a 2-character lookahead.
23552 * pending.cs (PendingImplementation): Rework so we can keep track
23553 of interface types all the time, and flag those which were
23554 implemented by parents as optional.
23556 2002-12-03 Miguel de Icaza <miguel@ximian.com>
23558 * expression.cs (Binary.ResolveOperator): Use
23559 String.Concat(string,string,string) or
23560 String.Concat(string,string,string,string) when possible.
23562 * typemanager: More helper methods.
23565 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
23567 * pending.cs: remove the bogus return from GetMissingInterfaces()
23568 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
23570 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23572 * namespace.cs: avoid duplicated 'using xxx' being added to
23573 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
23574 when we get more than one 'using' statement for the same namespace.
23575 Report a CS0105 warning for it.
23577 2002-11-30 Miguel de Icaza <miguel@ximian.com>
23579 * cs-tokenizer.cs (consume_identifier): use read directly, instead
23580 of calling getChar/putback, uses internal knowledge of it.
23582 (xtoken): Reorder tokenizer so most common patterns are checked
23583 first. This reduces the compilation time in another 5% (from 8.11s
23584 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
23586 The parsing time is 22% of the compilation in mcs, and from that
23587 64% is spent on the tokenization process.
23589 I tried using a binary search for keywords, but this is slower
23590 than the hashtable. Another option would be to do a couple of
23593 * Not use a StringBuilder, instead use an array of chars,
23594 with a set value. Notice that this way we could catch
23595 the 645 error without having to do it *afterwards*.
23597 * We could write a hand-parser to avoid the hashtable
23598 compares altogether.
23600 The identifier consumption process takes 37% of the tokenization
23601 time. Another 15% is spent on is_number. 56% of the time spent
23602 on is_number is spent on Int64.Parse:
23604 * We could probably choose based on the string length to
23605 use Int32.Parse or Int64.Parse and avoid all the 64-bit
23608 Another 3% is spend on wrapping `xtoken' in the `token' function.
23610 Handle 0xa0 as whitespace (#34752)
23612 2002-11-26 Miguel de Icaza <miguel@ximian.com>
23614 * typemanager.cs (IsCLRType): New routine to tell whether a type
23615 is one of the builtin types.
23617 Maybe it needs to use TypeCodes to be faster. Maybe we could use
23618 typecode in more places instead of doing pointer comparissions.
23619 We could leverage some knowledge about the way the typecodes are
23622 New code to cache namespaces in assemblies, it is currently not
23623 invoked, to be used soon.
23625 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
23627 * expression.cs (Binary.ResolveOperator): specially handle
23628 strings, and do not perform user-defined operator overloading for
23631 2002-11-24 Miguel de Icaza <miguel@ximian.com>
23633 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
23634 internalcall as it is a pretty simple operation; Avoid whenever
23635 possible to call Char.IsLetter.
23637 (consume_identifier): Cut by half the number of
23638 hashtable calls by merging the is_keyword and GetKeyword behavior.
23640 Do not short-circuit, because if we do, we
23641 report errors (ie, #if false && true would produce an invalid
23645 2002-11-24 Martin Baulig <martin@ximian.com>
23647 * expression.cs (Cast.TryReduce): If we're in checked syntax,
23648 check constant ranges and report a CS0221. Fixes #33186.
23650 2002-11-24 Martin Baulig <martin@ximian.com>
23652 * cs-parser.jay: Make this work for uninitialized variable
23653 declarations in the `for' initializer. Fixes #32416.
23655 2002-11-24 Martin Baulig <martin@ximian.com>
23657 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
23658 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
23660 2002-11-24 Martin Baulig <martin@ximian.com>
23662 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
23663 argument; if true, we also check for user-defined conversions.
23664 This is only needed if both arguments are of a user-defined type.
23665 Fixes #30443, added test-175.cs.
23666 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
23668 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
23670 2002-11-24 Martin Baulig <martin@ximian.com>
23672 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
23673 function to get the store opcode.
23674 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
23675 only emit the Ldelema if the store opcode is Stobj. You must run
23676 both test-34 and test-167 to test this. Fixes #34529.
23678 2002-11-23 Martin Baulig <martin@ximian.com>
23680 * ecore.cs (Expression.MemberLookup): Added additional
23681 `qualifier_type' argument which is used when we're being called
23682 from MemberAccess.DoResolve() and null if we're called from a
23684 (Expression.MemberLookupFailed): New method to report errors; this
23685 does the CS1540 check and reports the correct error message.
23687 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
23688 argument for the CS1540 check and redone the way how we're dealing
23689 with private members. See the comment in the source code for details.
23690 (FilterWithClosure): Reverted this back to revision 1.197; renamed
23691 `closure_start_type' to `closure_qualifier_type' and check whether
23692 it's not null. It was not this filter being broken, it was just
23693 being called with the wrong arguments.
23695 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
23696 and pass it the correct `qualifier_type'; this also does the error
23699 2002-11-22 Miguel de Icaza <miguel@ximian.com>
23701 * expression.cs (Invocation.EmitParams): If the we are dealing
23702 with a non-built-in value type, load its address as well.
23704 (ArrayCreation): Use a a pretty constant instead
23705 of the hardcoded value 2. Use 6 instead of 2 for the number of
23706 static initializers.
23708 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
23709 because they are not really value types, just glorified integers.
23711 * driver.cs: Do not append .exe, the CSC compiler does not do it.
23713 * ecore.cs: Remove redundant code for enumerations, make them use
23714 the same code path as everything else, fixes the casting issue
23715 with enumerations in Windows.Forms.
23717 * attribute.cs: Do only cast to string if it is a string, the
23718 validation happens later.
23720 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
23721 people upgrade their corlibs.
23723 * ecore.cs: Oops, enumerations were not following the entire code path
23725 2002-11-21 Miguel de Icaza <miguel@ximian.com>
23727 * typemanager.cs (FilterWithClosure): Commented out the test for
23728 1540 in typemanager.cs, as it has problems when accessing
23729 protected methods from a parent class (see test-174.cs).
23731 * attribute.cs (Attribute.ValidateGuid): new method.
23732 (Attribute.Resolve): Use above.
23734 2002-11-19 Miguel de Icaza <miguel@ximian.com>
23736 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
23738 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
23739 handling for enumerations, as we only needed the TypeContainer
23740 functionality to begin with (this is required for the fix below to
23741 work for enums that reference constants in a container class for
23744 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
23746 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
23747 a valid TypeBuilder to perform lookups on.o
23749 * class.cs (InheritableMemberSignatureCompare): Use true in the
23750 call to GetGetMethod and GetSetMethod, because we are comparing
23751 the signature, and we need to get the methods *even* if they are
23754 (PropertyBase.CheckBase): ditto.
23756 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
23757 GotoCase.Resolve): Use Peel on EmpytCasts.
23759 * ecore.cs (EmptyCast): drop child, add Peel method.
23761 2002-11-17 Martin Baulig <martin@ximian.com>
23763 * ecore.cs (EmptyCast.Child): New public property.
23765 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
23766 label resolved to an EmptyCast. Fixes #34162.
23767 (GotoCase.Resolve): Likewise.
23768 (Block.EmitMeta): Likewise.
23770 2002-11-17 Martin Baulig <martin@ximian.com>
23772 * expression.cs (Invocation.BetterConversion): Prefer int over
23773 uint; short over ushort; long over ulong for integer literals.
23774 Use ImplicitConversionExists instead of StandardConversionExists
23775 since we also need to check for user-defined implicit conversions.
23776 Fixes #34165. Added test-173.cs.
23778 2002-11-16 Martin Baulig <martin@ximian.com>
23780 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
23781 with the `true' and `false' literals. Fixes #33151.
23783 2002-11-16 Martin Baulig <martin@ximian.com>
23785 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
23786 October 22nd; don't do the cs1540 check for static members.
23788 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
23789 now using our own filter here and doing the cs1540 check again.
23791 2002-11-16 Martin Baulig <martin@ximian.com>
23793 * support.cs (InternalParameters): Don't crash if we don't have
23794 any fixed parameters. Fixes #33532.
23796 2002-11-16 Martin Baulig <martin@ximian.com>
23798 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
23799 when looking up static methods to make this work on Windows.
23802 2002-11-16 Martin Baulig <martin@ximian.com>
23804 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
23805 a setter rather than using PropertyInfo.CanWrite.
23807 2002-11-15 Nick Drochak <ndrochak@gol.com>
23809 * class.cs: Allow acces to block member by subclasses. Fixes build
23812 2002-11-14 Martin Baulig <martin@ximian.com>
23814 * class.cs (Constructor.Emit): Added the extern/block check.
23817 2002-11-14 Martin Baulig <martin@ximian.com>
23819 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
23820 iteration while looking for indexers, this is needed because the
23821 indexer may have a different name in our base classes. Fixed the
23822 error reporting (no indexers at all, not get accessor, no
23823 overloaded match). Fixes bug #33089.
23824 (IndexerAccess.DoResolveLValue): Likewise.
23826 2002-11-14 Martin Baulig <martin@ximian.com>
23828 * class.cs (PropertyBase.CheckBase): Make this work for multiple
23829 indexers. Fixes the first part of bug #33089.
23830 (MethodSignature.InheritableMemberSignatureCompare): Added support
23833 2002-11-13 Ravi Pratap <ravi@ximian.com>
23835 * attribute.cs (Attribute.Resolve): Catch the
23836 NullReferenceException and report it since it isn't supposed to
23839 2002-11-12 Miguel de Icaza <miguel@ximian.com>
23841 * expression.cs (Binary.EmitBranchable): Also handle the cases for
23842 LogicalOr and LogicalAnd that can benefit from recursively
23843 handling EmitBranchable. The code now should be nice for Paolo.
23845 2002-11-08 Miguel de Icaza <miguel@ximian.com>
23847 * typemanager.cs (LookupType): Added a negative-hit hashtable for
23848 the Type lookups, as we perform quite a number of lookups on
23849 non-Types. This can be removed once we can deterministically tell
23850 whether we have a type or a namespace in advance.
23852 But this might require special hacks from our corlib.
23856 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
23857 and double which avoids a conversion from an integer to a double.
23859 * expression.cs: tiny optimization, avoid calling IsConstant,
23860 because it effectively performs the lookup twice.
23862 2002-11-06 Miguel de Icaza <miguel@ximian.com>
23864 But a bogus return here to keep the semantics of the old code
23865 until the Mono runtime is fixed.
23867 * pending.cs (GetMissingInterfaces): New method used to remove all
23868 the interfaces that are already implemented by our parent
23869 classes from the list of pending methods.
23871 * interface.cs: Add checks for calls after ResolveTypeExpr.
23873 2002-11-05 Miguel de Icaza <miguel@ximian.com>
23875 * class.cs (Class.Emit): Report warning 67: event not used if the
23876 warning level is beyond 3.
23878 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
23879 being a NullLiteral.
23881 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
23884 * class.cs (TypeContainer.GetClassBases): Cover a missing code
23885 path that might fail if a type can not be resolved.
23887 * expression.cs (Binary.Emit): Emit unsigned versions of the
23890 * driver.cs: use error 5.
23892 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
23894 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
23896 2002-11-01 Miguel de Icaza <miguel@ximian.com>
23898 * cs-parser.jay (switch_section): A beautiful patch from Martin
23899 Baulig that fixed 33094.
23901 2002-10-31 Miguel de Icaza <miguel@ximian.com>
23903 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
23904 Check whether the base is abstract and report an error if so.
23906 * expression.cs (IndexerAccess.DoResolveLValue,
23907 IndexerAccess.DoResolve): ditto.
23909 (Invocation.DoResolve): ditto.
23911 (Invocation.FullMethodDesc): Improve the report string.
23913 * statement.cs (Block): Eliminate IsVariableDefined as it is
23914 basically just a wrapper for GetVariableInfo.
23916 * ecore.cs (SimpleName): Use new
23918 * support.cs (ReflectionParamter.ParameterType): We unwrap the
23919 type, as we return the actual parameter ref/unref state on a
23922 2002-10-30 Miguel de Icaza <miguel@ximian.com>
23924 * support.cs: Return proper flags REF/OUT fixing the previous
23927 * expression.cs: Reverted last patch, that was wrong. Is_ref is
23928 not used to mean `ref' but `ref or out' in ParameterReference
23930 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
23931 full type signature instead of calling TypeManger.CSharpName
23934 * support.cs (InternalParameters.ParameterDesc): Do not compare
23935 directly to the modflags, because REF/OUT will actually be bitsets
23938 * delegate.cs (VerifyMethod): Check also the modifiers.
23940 * cs-tokenizer.cs: Fix bug where floating point values with an
23941 exponent where a sign was missing was ignored.
23943 * driver.cs: Allow multiple assemblies to be specified in a single
23946 2002-10-28 Miguel de Icaza <miguel@ximian.com>
23948 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
23949 because identifiers after a parenthesis would end up in this kind
23950 of production, and we needed to desamiguate it for having casts
23953 (UserDefinedType *) xxx
23955 2002-10-24 Miguel de Icaza <miguel@ximian.com>
23957 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
23958 we should set on the Bindingflags.NonPublic, but not turn on
23959 private_ok. private_ok controls whether a Private member is
23960 returned (this is chekced on the filter routine), while the
23961 BindingFlags.NonPublic just controls whether private/protected
23962 will be allowed. This fixes the problem part of the problem of
23963 private properties being allowed to be used in derived classes.
23965 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
23966 so we can call the children DoResolveLValue method (this will
23967 properly signal errors on lvalue assignments to base properties)
23969 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
23970 getter are null, and we have a property info, we know that this
23971 happened because the lookup failed, so we report an error 122 for
23972 protection level violation.
23974 We also silently return if setter and getter are null in the
23975 resolve functions, this condition only happens if we have flagged
23976 the error before. This is the other half of the problem.
23978 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
23979 not have accessibility information, that is why we were returning
23980 true in the filter function in typemanager.cs.
23982 To properly report 122 (property is inaccessible because of its
23983 protection level) correctly, we report this error in ResolveAccess
23984 by failing if both the setter and the getter are lacking (ie, the
23987 DoResolve and DoLResolve have been modified to check for both
23988 setter/getter being null and returning silently, the reason being
23989 that I did not want to put the knowledge about this error in upper
23992 int old = Report.Errors;
23993 x = new PropertyExpr (...);
23994 if (old != Report.Errors)
23999 So the property expr is returned, but it is invalid, so the error
24000 will be flagged during the resolve process.
24002 * class.cs: Remove InheritablePropertySignatureCompare from the
24003 class, as we no longer depend on the property signature to compute
24004 whether it is possible to implement a method or not.
24006 The reason is that calling PropertyInfo.GetGetMethod will return
24007 null (in .NET, in Mono it works, and we should change this), in
24008 cases where the Get Method does not exist in that particular
24013 class X { public virtual int A { get { return 1; } } }
24015 class Z : Y { public override int A { get { return 2; } } }
24017 Would fail in Z because the parent (Y) would not have the property
24018 defined. So we avoid this completely now (because the alternative
24019 fix was ugly and slow), and we now depend exclusively on the
24022 (PropertyBase.CheckBase): Use a method-base mechanism to find our
24023 reference method, instead of using the property.
24025 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
24026 routines are gone now.
24028 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
24029 names, they were incorrectly named.
24031 * cs-tokenizer.cs: Return are more gentle token on failure.
24033 * pending.cs (PendingImplementation.InterfaceMethod): This routine
24034 had an out-of-sync index variable, which caused it to remove from
24035 the list of pending methods the wrong method sometimes.
24037 2002-10-22 Miguel de Icaza <miguel@ximian.com>
24039 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
24040 CanWrite, because those refer to this particular instance of the
24041 property, and do not take into account the fact that we can
24042 override single members of a property.
24044 Constructor requires an EmitContext. The resolution process does
24045 not happen here, but we need to compute the accessors before,
24046 because the resolution does not always happen for properties.
24048 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
24049 subclass, before we did not update this flag, but we did update
24052 (GetAccessors): Drop this routine, as it did not work in the
24053 presence of partially overwritten set/get methods.
24055 Notice that this broke the cs1540 detection, but that will require
24058 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24062 * driver.cs: issue a warning instead of an error if we don't support
24063 debugging for the platform. Also ignore a couple of errors that may
24064 arise when trying to write the symbols. Undo my previous patch.
24066 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24068 * driver.cs: ignore /debug switch except for Unix platforms.
24070 2002-10-23 Nick Drochak <ndrochak@gol.com>
24072 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
24074 2002-10-21 Miguel de Icaza <miguel@ximian.com>
24076 * driver.cs: Do not make mcs-debug conditional, so we do not break
24077 builds that use it.
24079 * statement.cs (UsageVector.MergeChildren): I would like Martin to
24080 review this patch. But basically after all the children variables
24081 have been merged, the value of "Breaks" was not being set to
24082 new_breaks for Switch blocks. I think that it should be set after
24083 it has executed. Currently I set this to the value of new_breaks,
24084 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
24085 conservative, but I do not understand this code very well.
24087 I did not break anything in the build, so that is good ;-)
24089 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
24091 2002-10-20 Mark Crichton <crichton@gimp.org>
24093 * cfold.cs: Fixed compile blocker. Really fixed it this time.
24095 2002-10-20 Nick Drochak <ndrochak@gol.com>
24097 * cfold.cs: Fixed compile blocker.
24099 2002-10-20 Miguel de Icaza <miguel@ximian.com>
24101 * driver.cs: I was chekcing the key, not the file.
24103 2002-10-19 Ravi Pratap <ravi@ximian.com>
24105 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
24106 message that we were generating - we just need to silently return
24109 2002-10-19 Miguel de Icaza <miguel@ximian.com>
24111 * class.cs (Event.Define): Change my previous commit, as this
24112 breaks the debugger. This is a temporary hack, as it seems like
24113 the compiler is generating events incorrectly to begin with.
24115 * expression.cs (Binary.ResolveOperator): Added support for
24116 "U operator - (E x, E y)"
24118 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
24121 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
24122 init-only variables, but this path did not take into account that
24123 there might be also instance readonly variables. Correct this
24126 This fixes bug 32253
24128 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
24131 * driver.cs: Change the extension for modules to `netmodule'
24133 * cs-parser.jay: Improved slightly the location tracking for
24134 the debugger symbols.
24136 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
24137 modifiers that were specified instead of the hardcoded value
24138 (FamAndAssem). This was basically ignoring the static modifier,
24139 and others. Fixes 32429.
24141 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
24142 fixed a bug in the process (32476)
24144 * expression.cs (ArrayAccess.EmitAssign): Patch from
24145 hwang_rob@yahoo.ca that fixes bug 31834.3
24147 2002-10-18 Miguel de Icaza <miguel@ximian.com>
24149 * driver.cs: Make the module extension .netmodule.
24151 2002-10-16 Miguel de Icaza <miguel@ximian.com>
24153 * driver.cs: Report an error if the resource file is not found
24154 instead of crashing.
24156 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
24157 false, like Emit does.
24159 2002-10-16 Nick Drochak <ndrochak@gol.com>
24161 * typemanager.cs: Remove unused private member. Also reported mcs
24162 bug to report this as a warning like csc.
24164 2002-10-15 Martin Baulig <martin@gnome.org>
24166 * statement.cs (Statement.Emit): Made this a virtual method; emits
24167 the line number info and calls DoEmit().
24168 (Statement.DoEmit): New protected abstract method, formerly knows
24169 as Statement.Emit().
24171 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
24173 2002-10-11 Miguel de Icaza <miguel@ximian.com>
24175 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
24176 have fixed a remaining problem: not every AddXXXX was adding a
24177 fully qualified name.
24179 Now everyone registers a fully qualified name in the DeclSpace as
24180 being defined instead of the partial name.
24182 Downsides: we are slower than we need to be due to the excess
24183 copies and the names being registered this way.
24185 The reason for this is that we currently depend (on the corlib
24186 bootstrap for instance) that types are fully qualified, because
24187 we dump all the types in the namespace, and we should really have
24188 types inserted into the proper namespace, so we can only store the
24189 basenames in the defined_names array.
24191 2002-10-10 Martin Baulig <martin@gnome.org>
24193 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
24194 from bug #31834, see the bug report for a testcase which is
24197 2002-10-10 Martin Baulig <martin@gnome.org>
24199 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
24200 flow analysis code for this.
24202 * statement.cs (Do, While, For): Tell the flow analysis code about
24204 (FlowBranching.UsageVector): Added support for infinite loops.
24205 (Block.Resolve): Moved the dead code elimination here and use flow
24208 2002-10-09 Miguel de Icaza <miguel@ximian.com>
24210 * class.cs (Field.Define): Catch cycles on struct type
24213 * typemanager.cs (IsUnmanagedtype): Do not recursively check
24214 fields if the fields are static. We only need to check instance
24217 * expression.cs (As.DoResolve): Test for reference type.
24219 * statement.cs (Using.ResolveExpression): Use
24220 ConvertImplicitRequired, not ConvertImplicit which reports an
24222 (Using.ResolveLocalVariableDecls): ditto.
24224 * expression.cs (Binary.ResolveOperator): Report errors in a few
24225 places where we had to.
24227 * typemanager.cs (IsUnmanagedtype): Finish implementation.
24229 2002-10-08 Miguel de Icaza <miguel@ximian.com>
24231 * expression.cs: Use StoreFromPtr instead of extracting the type
24232 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
24234 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
24235 an enumeration value to a System.Enum, but System.Enum is not a
24236 value type, but an class type, so we need to box.
24238 (Expression.ConvertExplicit): One codepath could return
24239 errors but not flag them. Fix this. Fixes #31853
24241 * parameter.cs (Resolve): Do not allow void as a parameter type.
24243 2002-10-06 Martin Baulig <martin@gnome.org>
24245 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
24246 if it's a class type and not a struct. Fixes #31815.
24248 2002-10-06 Martin Baulig <martin@gnome.org>
24250 * statement.cs: Reworked the flow analysis code a bit to make it
24251 usable for dead code elimination.
24253 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24255 * cs-parser.jay: allow empty source files. Fixes bug #31781.
24257 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24259 * expression.cs (ComposedCast.DoResolveType): A quick workaround
24260 to fix the test 165, will investigate deeper.
24262 2002-10-04 Martin Baulig <martin@gnome.org>
24264 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
24265 finally blocks actually work.
24266 (Try.Resolve): We don't need to create a sibling for `finally' if
24267 there is no finally block.
24269 2002-10-04 Martin Baulig <martin@gnome.org>
24271 * class.cs (Constructor.Define): The default accessibility for a
24272 non-default constructor is private, not public.
24274 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24276 * class.cs (Constructor): Make AllowedModifiers public, add
24279 * cs-parser.jay: Perform the modifiers test here, as the
24280 constructor for the Constructor class usually receives a zero
24281 because of the way we create it (first we create, later we
24282 customize, and we were never checking the modifiers).
24284 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
24285 is a version of LookupTypeReflection that includes the type-name
24286 cache. This can be used as a fast path for functions that know
24287 the fully qualified name and are only calling into *.GetType() to
24288 obtain a composed type.
24290 This is also used by TypeManager.LookupType during its type
24293 (LookupType): We now also track the real type name, as sometimes
24294 we can get a quey for the real type name from things like
24295 ComposedCast. This fixes bug 31422.
24297 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
24298 complete type fullname, it does not have to go through the type
24299 resolution system to obtain the composed version of the type (for
24300 obtaining arrays or pointers).
24302 (Conditional.Emit): Use the EmitBoolExpression to
24303 generate nicer code, as requested by Paolo.
24305 (ArrayCreation.CheckIndices): Use the patch from
24306 hwang_rob@yahoo.ca to validate the array initializers.
24308 2002-10-03 Miguel de Icaza <miguel@ximian.com>
24310 * class.cs (ConstructorInitializer.Emit): simplify code by using
24311 Invocation.EmitCall, and at the same time, fix the bugs in calling
24312 parent constructors that took variable arguments.
24314 * ecore.cs (Expression.ConvertNumericExplicit,
24315 Expression.ImplicitNumericConversion): Remove the code that
24316 manually wrapped decimal (InternalTypeConstructor call is now gone
24319 * expression.cs (Cast.TryReduce): Also handle decimal types when
24320 trying to perform a constant fold on the type.
24322 * typemanager.cs (IsUnmanagedtype): Partially implemented.
24324 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
24325 that only turned off an error report, and did nothing else.
24327 2002-10-02 Miguel de Icaza <miguel@ximian.com>
24329 * driver.cs: Handle and ignore /fullpaths
24331 2002-10-01 Miguel de Icaza <miguel@ximian.com>
24333 * expression.cs (Binary.ResolveOperator): Catch the case where
24334 DoNumericPromotions returns true,
24336 (Binary.DoNumericPromotions): Simplify the code, and the tests.
24338 2002-09-27 Miguel de Icaza <miguel@ximian.com>
24340 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
24343 2002-09-26 Miguel de Icaza <miguel@ximian.com>
24345 * ecore.cs (ConvertNumericExplicit): It is not enough that the
24346 conversion exists, but it is also required that the conversion be
24347 performed. This manifested in "(Type64Enum) 2".
24349 * class.cs (TypeManager.AddMethod): The fix is not to change
24350 AddEnum, because that one was using a fully qualified name (every
24351 DeclSpace derivative does), but to change the AddMethod routine
24352 that was using an un-namespaced name. This now correctly reports
24353 the duplicated name.
24355 Revert patch until I can properly fix it. The issue
24356 is that we have a shared Type space across all namespaces
24357 currently, which is wrong.
24359 Options include making the Namespace a DeclSpace, and merge
24360 current_namespace/current_container in the parser.
24362 2002-09-25 Miguel de Icaza <miguel@ximian.com>
24364 * cs-parser.jay: Improve error reporting when we get a different
24365 kind of expression in local_variable_type and
24366 local_variable_pointer_type.
24368 Propagate this to avoid missleading errors being reported.
24370 * ecore.cs (ImplicitReferenceConversion): treat
24371 TypeManager.value_type as a target just like object_type. As
24376 Is valid, and needs to result in the int 1 being boxed before it
24377 is assigned to the value type v.
24379 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
24380 to validate the enumeration name.
24382 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
24383 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
24384 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
24386 * ecore.cs (TryImplicitIntConversion): When doing an
24387 implicit-enumeration-conversion, check if the type is 64-bits and
24388 perform a conversion before passing to EnumConstant.
24390 2002-09-23 Miguel de Icaza <miguel@ximian.com>
24392 * decl.cs (Error_AmbiguousTypeReference); New routine used to
24393 report ambiguous type references. Unlike the MS version, we
24394 report what the ambiguity is. Innovation at work ;-)
24396 (DeclSpace.FindType): Require a location argument to
24397 display when we display an ambiguous error.
24399 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
24401 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
24403 * expression.cs (EmitDynamicInitializers): Apply patch from
24404 hwang_rob@yahoo.ca that fixes the order in which we emit our
24407 2002-09-21 Martin Baulig <martin@gnome.org>
24409 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
24410 delegate takes no arguments.
24412 2002-09-20 Miguel de Icaza <miguel@ximian.com>
24414 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
24417 * expression.cs: Extract the underlying type.
24419 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
24421 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
24423 2002-09-19 Miguel de Icaza <miguel@ximian.com>
24425 * class.cs (TypeContainer.DefineType): We can not use the nice
24426 PackingSize with the size set to 1 DefineType method, because it
24427 will not allow us to define the interfaces that the struct
24430 This completes the fixing of bug 27287
24432 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
24433 means also structs. This fixes part of the problem.
24434 (Expresion.ImplicitReferenceConversionExists): ditto.
24436 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
24437 error if there were no errors reported during the type lookup
24438 process, to avoid duplicates or redundant errors. Without this
24439 you would get an ambiguous errors plus a type not found. We have
24440 beaten the user enough with the first error.
24442 (DeclSparce.FindType): Emit a warning if we have an ambiguous
24445 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
24446 during the resolution process, stop the lookup, this avoids
24447 repeated error reports (same error twice).
24449 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
24451 * typemanager.cs (LookupType): Redo the type lookup code to match
24452 the needs of System.Reflection.
24454 The issue is that System.Reflection requires references to nested
24455 types to begin with a "+" sign instead of a dot. So toplevel
24456 types look like: "NameSpace.TopLevelClass", and nested ones look
24457 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
24460 2002-09-19 Martin Baulig <martin@gnome.org>
24462 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
24463 says that a method always returns or always throws an exception,
24464 don't report the CS0161.
24466 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
24467 set `Returns = new_returns'.
24469 2002-09-19 Martin Baulig <martin@gnome.org>
24471 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
24472 to an enum constant, check for a CS0176.
24474 2002-09-18 Miguel de Icaza <miguel@ximian.com>
24476 * class.cs (TypeContainer.CheckPairedOperators): Now we check
24477 for operators that must be in pairs and report errors.
24479 * ecore.cs (SimpleName.DoResolveType): During the initial type
24480 resolution process, when we define types recursively, we must
24481 check first for types in our current scope before we perform
24482 lookups in the enclosing scopes.
24484 * expression.cs (MakeByteBlob): Handle Decimal blobs.
24486 (Invocation.VerifyArgumentsCompat): Call
24487 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
24488 I thought we were supposed to always call this, but there are a
24489 few places in the code where we dont do it.
24491 2002-09-17 Miguel de Icaza <miguel@ximian.com>
24493 * driver.cs: Add support in -linkres and -resource to specify the
24494 name of the identifier.
24496 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24498 * ecore.cs (StandardConversionExists): Sync with the conversion
24499 code: allow anything-* to void* conversions.
24501 (FindMostSpecificSource): Use an Expression argument
24502 instead of a Type, because we might be handed over a Literal which
24503 gets a few more implicit conversions that plain types do not. So
24504 this information was being lost.
24506 Also, we drop the temporary type-holder expression when not
24509 2002-09-17 Martin Baulig <martin@gnome.org>
24511 * class.cs (PropertyBase.CheckBase): Don't check the base class if
24512 this is an explicit interface implementation.
24514 2002-09-17 Martin Baulig <martin@gnome.org>
24516 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
24517 different `IndexerName' attributes.
24519 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
24520 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
24521 virtual CommonResolve().
24523 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24525 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
24526 and convert that to the UnderlyingType.
24528 * statement.cs (Foreach.Resolve): Indexers are just like variables
24529 or PropertyAccesses.
24531 * cs-tokenizer.cs (consume_string): Track line numbers and columns
24532 inside quoted strings, we were not doing this before.
24534 2002-09-16 Martin Baulig <martin@gnome.org>
24536 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
24537 resolve it. This is needed for the definite assignment check of the
24538 instance expression, fixes bug #29846.
24539 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
24541 2002-09-16 Nick Drochak <ndrochak@gol.com>
24543 * parameter.cs: Fix compile error. Cannot reference static member
24544 from an instance object. Is this an mcs bug?
24546 2002-09-14 Martin Baulig <martin@gnome.org>
24548 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
24549 multiple times. Fixes bug #30295, added test-166.cs.
24551 2002-09-14 Martin Baulig <martin@gnome.org>
24553 * statement.cs (Block.Emit): Don't emit unreachable code.
24554 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
24555 `break' statements.
24556 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
24558 2002-09-14 Martin Baulig <martin@gnome.org>
24560 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
24563 2002-09-14 Martin Baulig <martin@gnome.org>
24565 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
24566 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
24567 be false on the ms runtime.
24569 2002-09-13 Martin Baulig <martin@gnome.org>
24571 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
24572 the CS0038 error message.
24574 2002-09-12 Miguel de Icaza <miguel@ximian.com>
24576 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
24577 constant inside, return it.
24579 2002-09-12 Martin Baulig <martin@gnome.org>
24581 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
24582 implicit conversion can be done between enum types.
24584 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
24585 check whether an implicit conversion to the current enum's UnderlyingType
24586 exists and report an error if not.
24588 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
24589 without debugging support.
24591 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
24592 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
24594 2002-09-12 Martin Baulig <martin@gnome.org>
24596 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
24598 * ecore.cs (IMemberExpr.DeclaringType): New property.
24599 (SimpleName.SimpleNameResolve): Check whether we're accessing a
24600 nonstatic member of an outer type (CS0038).
24602 2002-09-11 Miguel de Icaza <miguel@ximian.com>
24604 * driver.cs: Activate the using-error detector at warning level
24605 4 (at least for MS-compatible APIs).
24607 * namespace.cs (VerifyUsing): Small buglett fix.
24609 * pending.cs (PendingImplementation): pass the container pointer.
24611 * interface.cs (GetMethods): Allow for recursive definition. Long
24612 term, I would like to move every type to support recursive
24613 definitions, not the current ordering mechanism that we have right
24616 The situation is this: Attributes are handled before interfaces,
24617 so we can apply attributes to interfaces. But some attributes
24618 implement interfaces, we will now handle the simple cases
24619 (recursive definitions will just get an error).
24621 * parameter.cs: Only invalidate types at the end if we fail to
24624 2002-09-09 Martin Baulig <martin@gnome.org>
24626 * ecore.cs (PropertyExpr.Emit): Also check for
24627 TypeManager.system_int_array_get_length so this'll also work when
24628 compiling corlib. Fixes #30003.
24630 2002-09-09 Martin Baulig <martin@gnome.org>
24632 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
24633 and throw an exception if we can't get the type's size. Fixed #30040,
24636 2002-09-09 Martin Baulig <martin@gnome.org>
24638 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
24640 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
24641 context. Fixes bug #30027.
24643 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
24644 virtual functions. Fixes bug #30043, added test-164.cs.
24646 2002-09-08 Ravi Pratap <ravi@ximian.com>
24648 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
24650 2002-09-08 Nick Drochak <ndrochak@gol.com>
24652 * driver.cs: Use an object to get the windows codepage since it's not a
24655 2002-09-08 Miguel de Icaza <miguel@ximian.com>
24657 * statement.cs (For.Emit): for infinite loops (test == null)
24658 return whether there is a break inside, not always "true".
24660 * namespace.cs (UsingEntry): New struct to hold the name of the
24661 using definition, the location where it is defined, and whether it
24662 has been used in a successful type lookup.
24664 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
24669 2002-09-06 Ravi Pratap <ravi@ximian.com>
24671 * attribute.cs : Fix incorrect code which relied on catching
24672 a NullReferenceException to detect a null being passed in
24673 where an object was expected.
24675 2002-09-06 Miguel de Icaza <miguel@ximian.com>
24677 * statement.cs (Try): flag the catch variable as assigned
24679 * expression.cs (Cast): Simplified by using ResolveType instead of
24680 manually resolving.
24682 * statement.cs (Catch): Fix bug by using ResolveType.
24684 2002-09-06 Ravi Pratap <ravi@ximian.com>
24686 * expression.cs (BetterConversion): Special case for when we have
24687 a NullLiteral as the argument and we have to choose between string
24688 and object types - we choose string the way csc does.
24690 * attribute.cs (Attribute.Resolve): Catch the
24691 NullReferenceException and report error #182 since the Mono
24692 runtime no more has the bug and having this exception raised means
24693 we tried to select a constructor which takes an object and is
24696 2002-09-05 Ravi Pratap <ravi@ximian.com>
24698 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
24699 message (1502, 1503) when we can't locate a method after overload
24700 resolution. This is much more informative and closes the bug
24703 * interface.cs (PopulateMethod): Return if there are no argument
24704 types. Fixes a NullReferenceException bug.
24706 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
24707 expressions too. Previously we were checking only in one place for
24708 positional arguments leaving out named arguments.
24710 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
24711 type to the enum type is not allowed. Remove code corresponding to
24714 (ConvertNumericExplicit): Allow explicit conversions from
24715 the underlying type to enum type. This precisely follows the spec
24716 and closes a bug filed by Gonzalo.
24718 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24721 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
24723 2002-09-03 Miguel de Icaza <miguel@ximian.com>
24725 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
24726 it was important that we stored the right value after the
24727 reduction in `converted'.
24729 2002-09-04 Martin Baulig <martin@gnome.org>
24731 * location.cs (Location.SymbolDocument): Use full pathnames for the
24734 2002-08-30 Miguel de Icaza <miguel@ximian.com>
24736 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
24737 of the expression resolve mechanism, because that will catch the
24738 SimpleName error failures.
24740 (Conditional): If we can not resolve the
24741 expression, return, do not crash.
24743 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24746 (location): display token name instead of its number.
24748 2002-08-28 Martin Baulig <martin@gnome.org>
24750 * expression.cs (Binary.ResolveOperator): Don't silently return
24751 but return an error if an operator cannot be applied between two
24754 2002-08-28 Martin Baulig <martin@gnome.org>
24756 * class.cs (Constructor.Define): Set the permission attributes
24757 correctly instead of making all constructors public.
24759 2002-08-28 Martin Baulig <martin@gnome.org>
24761 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
24762 for private members before reporting a CS0103; if we find anything,
24765 2002-08-28 Martin Baulig <martin@gnome.org>
24767 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
24768 to check whether `closure_start_type == closure_invocation_type',
24769 we also need to check whether `m.DeclaringType == closure_invocation_type'
24770 before bypassing the permission checks. We might be accessing
24771 protected/private members from the base class.
24772 (TypeManager.RealMemberLookup): Only set private_ok if private
24773 members were requested via BindingFlags.NonPublic.
24775 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
24777 * expression.cs (MemberAccess.ResolveMemberAccess): Set
24778 MethodGroupExpr.IsExplicitImpl if appropriate.
24779 (Invocation.DoResolve): Don't report the CS0120 for explicit
24780 interface implementations.
24782 2002-08-27 Martin Baulig <martin@gnome.org>
24784 * expression.cs (Invocation.DoResolve): If this is a static
24785 method and we don't have an InstanceExpression, we must report
24788 2002-08-25 Martin Baulig <martin@gnome.org>
24790 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
24791 `==' between a valuetype and an object.
24793 2002-08-25 Miguel de Icaza <miguel@ximian.com>
24795 * ecore.cs (TypeExpr): Provide a ToString method.
24797 2002-08-24 Martin Baulig <martin@gnome.org>
24799 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
24800 now called proggie.dbg and it's a binary file.
24802 2002-08-23 Martin Baulig <martin@gnome.org>
24804 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
24806 2002-08-23 Martin Baulig <martin@gnome.org>
24808 * struct.cs (MyStructInfo.ctor): Make this work with empty
24809 structs; it's not allowed to use foreach() on null.
24811 2002-08-23 Martin Baulig <martin@gnome.org>
24813 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
24814 writer the full pathname of the generated assembly.
24816 2002-08-23 Martin Baulig <martin@gnome.org>
24818 * statements.cs (FlowBranching.UsageVector.MergeChildren):
24819 A `finally' block never returns or breaks; improved handling of
24822 2002-08-23 Martin Baulig <martin@gnome.org>
24824 * statement.cs (Throw.Resolve): Allow `throw null'.
24826 2002-08-23 Martin Baulig <martin@gnome.org>
24828 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
24829 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
24830 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
24831 MemberLookup would return a wrong event if this is an explicit
24832 interface implementation and the class has an event with the same
24835 2002-08-23 Martin Baulig <martin@gnome.org>
24837 * statement.cs (Block.AddChildVariableNames): New public method.
24838 (Block.AddChildVariableName): Likewise.
24839 (Block.IsVariableNameUsedInChildBlock): Likewise.
24840 (Block.AddVariable): Check whether a variable name has already
24841 been used in a child block.
24843 * cs-parser.jay (declare_local_variables): Mark all variable names
24844 from the current block as being used in a child block in the
24847 2002-08-23 Martin Baulig <martin@gnome.org>
24849 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
24850 find the symbol writer.
24852 * driver.cs: csc also allows the arguments to /define being
24853 separated by commas, not only by semicolons.
24855 2002-08-23 Martin Baulig <martin@gnome.org>
24857 * interface.cs (Interface.GetMembers): Added static check for events.
24859 2002-08-15 Martin Baulig <martin@gnome.org>
24861 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
24862 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
24864 * ecore.cs (Expression.MemberLookup): Added documentation and explained
24865 why the MethodData.EmitDestructor() change was necessary.
24867 2002-08-20 Martin Baulig <martin@gnome.org>
24869 * class.cs (TypeContainer.FindMembers): Added static check for events.
24871 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
24873 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
24874 use Type.GetEvents(), not Type.FindMembers().
24876 2002-08-20 Martin Baulig <martin@gnome.org>
24878 * decl.cs (MemberCache): Added a special method cache which will
24879 be used for method-only searched. This ensures that a method
24880 search will return a MethodInfo with the correct ReflectedType for
24883 2002-08-20 Martin Baulig <martin@gnome.org>
24885 * decl.cs (DeclSpace.FindMembers): Made this public.
24887 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24889 * delegate.cs: fixed build on windows.
24890 [FIXME: Filed as bug #29150: MCS must report these errors.]
24892 2002-08-19 Ravi Pratap <ravi@ximian.com>
24894 * ecore.cs (StandardConversionExists): Return a false
24895 if we are trying to convert the void type to anything else
24896 since that is not allowed.
24898 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
24899 we flag error 70 in the event an event is trying to be accessed
24900 directly from outside the declaring type.
24902 2002-08-20 Martin Baulig <martin@gnome.org>
24904 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
24905 MemberCache from typemanager.cs to decl.cs.
24907 2002-08-19 Martin Baulig <martin@gnome.org>
24909 * class.cs (TypeContainer): Implement IMemberContainer.
24910 (TypeContainer.DefineMembers): Create the MemberCache.
24911 (TypeContainer.FindMembers): Do better BindingFlags checking; only
24912 return public members if BindingFlags.Public was given, check
24913 whether members are static.
24915 2002-08-16 Martin Baulig <martin@gnome.org>
24917 * decl.cs (DeclSpace.Define): Splitted this in Define and
24918 DefineMembers. DefineMembers is called first and initializes the
24921 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
24922 DefineMembers() on all our DeclSpaces.
24924 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
24925 but call DefineMembers() on all nested interfaces. We call their
24926 Define() in our new Define() function.
24928 * interface.cs (Interface): Implement IMemberContainer.
24929 (Interface.Define): Moved all code except the attribute stuf to
24931 (Interface.DefineMembers): Initialize the member cache.
24933 * typemanager.cs (IMemberFinder): Removed this interface, we don't
24934 need this anymore since we can use MemberCache.FindMembers directly.
24936 2002-08-19 Martin Baulig <martin@gnome.org>
24938 * typemanager.cs (MemberCache): When creating the cache for an
24939 interface type, add all inherited members.
24940 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
24941 to `out bool used_cache' and documented it.
24942 (TypeManager.MemberLookup): If we already used the cache in the first
24943 iteration, we don't need to do the interfaces check.
24945 2002-08-19 Martin Baulig <martin@gnome.org>
24947 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
24948 here from IMemberFinder and don't implement this interface anymore.
24949 (DeclSpace.MemberCache): Moved here from IMemberFinder.
24951 * typemanager.cs (IMemberFinder): This interface is now only used by
24952 classes which actually support the member cache.
24953 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
24954 since we only put DeclSpaces into this Hashtable.
24955 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
24956 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
24958 2002-08-16 Martin Baulig <martin@gnome.org>
24960 * typemanager.cs (ICachingMemberFinder): Removed.
24961 (IMemberFinder.MemberCache): New property.
24962 (TypeManager.FindMembers): Merged this with RealFindMembers().
24963 This function will never be called from TypeManager.MemberLookup()
24964 so we can't use the cache here, just the IMemberFinder.
24965 (TypeManager.MemberLookup_FindMembers): Check whether the
24966 IMemberFinder has a MemberCache and call the cache's FindMembers
24968 (MemberCache): Rewrote larger parts of this yet another time and
24969 cleaned it up a bit.
24971 2002-08-15 Miguel de Icaza <miguel@ximian.com>
24973 * driver.cs (LoadArgs): Support quoting.
24975 (Usage): Show the CSC-like command line arguments.
24977 Improved a few error messages.
24979 2002-08-15 Martin Baulig <martin@gnome.org>
24981 * typemanager.cs (IMemberContainer.Type): New property.
24982 (IMemberContainer.IsInterface): New property.
24984 The following changes are conditional to BROKEN_RUNTIME, which is
24985 defined at the top of the file.
24987 * typemanager.cs (MemberCache.MemberCache): Don't add the base
24988 class'es members, but add all members from TypeHandle.ObjectType
24989 if we're an interface.
24990 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
24991 is the current type.
24992 (MemberCache.CacheEntry.Container): Removed this field.
24993 (TypeHandle.GetMembers): Include inherited members.
24995 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24997 * typemanager.cs: fixed compilation and added a comment on a field that
25000 2002-08-15 Martin Baulig <martin@gnome.org>
25002 * class.cs (ConstructorInitializer.Resolve): In the
25003 Expression.MemberLookup call, use the queried_type as
25006 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
25007 declared' attribute, it's always true.
25008 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
25009 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
25010 temporary wrapper for FindMembers which tells MemberLookup whether
25011 members from the base classes are included in the return value.
25012 This will go away soon.
25013 (TypeManager.MemberLookup): Use this temporary hack here; once the
25014 new MemberCache is completed, we don't need to do the DeclaredOnly
25015 looping here anymore since the MemberCache will take care of this.
25016 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
25017 (MemberCache): When creating the MemberCache for a class, get
25018 members from the current class and all its base classes.
25019 (MemberCache.CacheEntry.Container): New field. This is a
25020 temporary hack until the Mono runtime is fixed to distinguish
25021 between ReflectedType and DeclaringType. It allows us to use MCS
25022 with both the MS runtime and the unfixed Mono runtime without
25023 problems and without accecting performance.
25024 (MemberCache.SearchMembers): The DeclaredOnly looping from
25025 TypeManager.MemberLookup is now done here.
25027 2002-08-14 Martin Baulig <martin@gnome.org>
25029 * statement.cs (MyStructInfo.MyStructInfo): Don't call
25030 Type.GetFields on dynamic types but get the fields from the
25031 corresponding TypeContainer.
25032 (MyStructInfo.GetStructInfo): Added check for enum types.
25034 * typemanager.cs (MemberList.IsSynchronized): Implemented.
25035 (MemberList.SyncRoot): Implemented.
25036 (TypeManager.FilterWithClosure): No need to check permissions if
25037 closure_start_type == closure_invocation_type, don't crash if
25038 closure_invocation_type is null.
25040 2002-08-13 Martin Baulig <martin@gnome.org>
25042 Rewrote TypeContainer.FindMembers to use a member cache. This
25043 gives us a speed increase of about 35% for the self-hosting MCS
25044 build and of about 15-20% for the class libs (both on GNU/Linux).
25046 * report.cs (Timer): New class to get enhanced profiling. This
25047 whole class is "TIMER" conditional since it remarkably slows down
25050 * class.cs (MemberList): New class. This is an IList wrapper
25051 which we're now using instead of passing MemberInfo[]'s around to
25052 avoid copying this array unnecessarily.
25053 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
25054 (ICachingMemberFinder, IMemberContainer): New interface.
25055 (TypeManager.FilterWithClosure): If `criteria' is null, the name
25056 has already been checked, otherwise use it for the name comparision.
25057 (TypeManager.FindMembers): Renamed to RealMemberFinder and
25058 provided wrapper which tries to use ICachingMemberFinder.FindMembers
25059 if possible. Returns a MemberList, not a MemberInfo [].
25060 (TypeHandle): New class, implements IMemberContainer. We create
25061 one instance of this class per type, it contains a MemberCache
25062 which is used to do the member lookups.
25063 (MemberCache): New class. Each instance of this class contains
25064 all members of a type and a name-based hash table.
25065 (MemberCache.FindMembers): This is our new member lookup
25066 function. First, it looks up all members of the requested name in
25067 the hash table. Then, it walks this list and sorts out all
25068 applicable members and returns them.
25070 2002-08-13 Martin Baulig <martin@gnome.org>
25072 In addition to a nice code cleanup, this gives us a performance
25073 increase of about 1.4% on GNU/Linux - not much, but it's already
25074 half a second for the self-hosting MCS compilation.
25076 * typemanager.cs (IMemberFinder): New interface. It is used by
25077 TypeManager.FindMembers to call FindMembers on a TypeContainer,
25078 Enum, Delegate or Interface.
25079 (TypeManager.finder_to_member_finder): New PtrHashtable.
25080 (TypeManager.finder_to_container): Removed.
25081 (TypeManager.finder_to_delegate): Removed.
25082 (TypeManager.finder_to_interface): Removed.
25083 (TypeManager.finder_to_enum): Removed.
25085 * interface.cs (Interface): Implement IMemberFinder.
25087 * delegate.cs (Delegate): Implement IMemberFinder.
25089 * enum.cs (Enum): Implement IMemberFinder.
25091 * class.cs (TypeContainer): Implement IMemberFinder.
25093 2002-08-12 Martin Baulig <martin@gnome.org>
25095 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
25097 2002-08-12 Martin Baulig <martin@gnome.org>
25099 * ecore.cs (ITypeExpression): New interface for expressions which
25101 (TypeExpression): Renamed to TypeLookupExpression.
25102 (Expression.DoResolve): If we're doing a types-only lookup, the
25103 expression must implement the ITypeExpression interface and we
25104 call DoResolveType() on it.
25105 (SimpleName): Implement the new ITypeExpression interface.
25106 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
25107 hack, the situation that we're only looking up types can't happen
25108 anymore when this method is called. Moved the type lookup code to
25109 DoResolveType() and call it.
25110 (SimpleName.DoResolveType): This ITypeExpression interface method
25111 is now doing the types-only lookup.
25112 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
25113 (ResolveFlags): Added MaskExprClass.
25115 * expression.cs (MemberAccess): Implement the ITypeExpression
25117 (MemberAccess.DoResolve): Added support for a types-only lookup
25118 when we're called via ITypeExpression.DoResolveType().
25119 (ComposedCast): Implement the ITypeExpression interface.
25121 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
25122 Expression.Resolve() with ResolveFlags.Type instead.
25124 2002-08-12 Martin Baulig <martin@gnome.org>
25126 * interface.cs (Interface.Define): Apply attributes.
25128 * attribute.cs (Attribute.ApplyAttributes): Added support for
25129 interface attributes.
25131 2002-08-11 Martin Baulig <martin@gnome.org>
25133 * statement.cs (Block.Emit): Only check the "this" variable if we
25134 do not always throw an exception.
25136 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
25137 whether the property has a set accessor.
25139 2002-08-11 Martin Baulig <martin@gnome.org>
25141 Added control flow analysis support for structs.
25143 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
25144 with control flow analysis turned off.
25145 (IVariable): New interface.
25146 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
25147 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
25148 (FieldExpr.DoResolve): Resolve the instance expression with flow
25149 analysis turned off and do the definite assignment check after the
25150 resolving when we know what the expression will resolve to.
25152 * expression.cs (LocalVariableReference, ParameterReference):
25153 Implement the new IVariable interface, only call the flow analysis
25154 code if ec.DoFlowAnalysis is true.
25155 (This): Added constructor which takes a Block argument. Implement
25156 the new IVariable interface.
25157 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
25158 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
25159 This does the definite assignment checks for struct members.
25161 * class.cs (Constructor.Emit): If this is a non-static `struct'
25162 constructor which doesn't have any initializer, call
25163 Block.AddThisVariable() to tell the flow analysis code that all
25164 struct elements must be initialized before control returns from
25167 * statement.cs (MyStructInfo): New public class.
25168 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
25169 argument to this indexer. If non-zero, check an individual struct
25170 member, not the whole struct.
25171 (FlowBranching.CheckOutParameters): Check struct members.
25172 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
25173 overloaded versions of these methods which take an additional
25174 `int field_idx' argument to check struct members.
25175 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
25176 overloaded versions of these methods which take an additional
25177 `string field_name' argument to check struct member.s
25178 (VariableInfo): Implement the IVariable interface.
25179 (VariableInfo.StructInfo): New public property. Returns the
25180 MyStructInfo instance of the variable if it's a struct or null.
25181 (Block.AddThisVariable): New public method. This is called from
25182 Constructor.Emit() for non-static `struct' constructor which do
25183 not have any initializer. It creates a special variable for the
25184 "this" instance variable which will be checked by the flow
25185 analysis code to ensure that all of the struct's fields are
25186 initialized before control returns from the constructor.
25187 (UsageVector): Added support for struct members. If a
25188 variable/parameter is a struct with N members, we reserve a slot
25189 in the usage vector for each member. A struct is considered fully
25190 initialized if either the struct itself (slot 0) or all its
25191 members are initialized.
25193 2002-08-08 Martin Baulig <martin@gnome.org>
25195 * driver.cs (Driver.MainDriver): Only report an error CS5001
25196 if there were no compilation errors.
25198 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
25199 `UnsafeContext' property to determine whether the parent is in
25200 unsafe context rather than checking the parent's ModFlags:
25201 classes nested in an unsafe class are unsafe as well.
25203 2002-08-08 Martin Baulig <martin@gnome.org>
25205 * statement.cs (UsageVector.MergeChildren): Distinguish between
25206 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
25207 we return. Added test17() and test18() to test-154.cs.
25209 2002-08-08 Martin Baulig <martin@gnome.org>
25211 * typemanager.cs (TypeManager.FilterWithClosure): If we have
25212 Family access, make sure the invoking type isn't a subclass of the
25213 queried type (that'd be a CS1540).
25215 * ecore.cs (Expression.MemberLookup): Added overloaded version of
25216 this method which takes an additional `Type invocation_type'.
25218 * expression.cs (BaseAccess.DoResolve): Use the base type as
25219 invocation and query type.
25220 (MemberAccess.DoResolve): If the lookup failed and we're about to
25221 report a CS0122, try a lookup with the ec.ContainerType - if this
25222 succeeds, we must report a CS1540.
25224 2002-08-08 Martin Baulig <martin@gnome.org>
25226 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
25227 (MethodGroupExpr): Implement the IMemberExpr interface.
25229 * expression (MemberAccess.ResolveMemberAccess): No need to have
25230 any special code for MethodGroupExprs anymore, they're now
25233 2002-08-08 Martin Baulig <martin@gnome.org>
25235 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
25236 Family, FamANDAssem and FamORAssem permissions.
25237 (TypeManager.IsSubclassOrNestedChildOf): New public method.
25239 2002-08-08 Martin Baulig <martin@gnome.org>
25241 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
25242 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
25245 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
25247 * driver.cs: implemented /resource option to embed managed resources.
25249 2002-08-07 Martin Baulig <martin@gnome.org>
25251 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
25252 (FieldBase.HasFieldInitializer): New public property.
25253 (FieldBase.GetInitializerExpression): New public method. Resolves and
25254 returns the field initializer and makes sure it is only resolved once.
25255 (TypeContainer.EmitFieldInitializers): Call
25256 FieldBase.GetInitializerExpression to get the initializer, this ensures
25257 that it isn't resolved multiple times.
25259 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
25260 the resolving process (SimpleName/MemberLookup) that we're currently
25261 emitting a field initializer (which must not access any instance members,
25262 this is an error CS0236).
25264 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
25265 argument, if the `IsFieldInitializer' flag is set, we must report and
25266 error CS0236 and not an error CS0120.
25268 2002-08-07 Martin Baulig <martin@gnome.org>
25270 * ecore.cs (IMemberExpr): New public interface.
25271 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
25272 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
25273 if the expression is an IMemberExpr.
25275 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
25276 to be null, implicitly default to `this' if we're non-static in
25277 this case. Simplified the code a lot by using the new IMemberExpr
25278 interface. Also fixed bug #28176 here.
25280 2002-08-06 Martin Baulig <martin@gnome.org>
25282 * cs-parser.jay (SimpleLookup): Removed. We need to create
25283 ParameterReferences during semantic analysis so that we can do a
25284 type-only search when resolving Cast, TypeOf and SizeOf.
25285 (block): Pass the `current_local_parameters' to the Block's
25288 * class.cs (ConstructorInitializer): Added `Parameters parameters'
25289 argument to the constructor.
25290 (ConstructorInitializer.Resolve): Create a temporary implicit
25291 block with the parameters.
25293 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
25294 references here if we aren't doing a type-only search.
25296 * statement.cs (Block): Added constructor which takes a
25297 `Parameters parameters' argument.
25298 (Block.Parameters): New public property.
25300 * support.cs (InternalParameters.Parameters): Renamed `parameters'
25301 to `Parameters' and made it public readonly.
25303 2002-08-06 Martin Baulig <martin@gnome.org>
25305 * ecore.cs (Expression.Warning): Made this public as well.
25307 * report.cs (Report.Debug): Print the contents of collections.
25309 2002-08-06 Martin Baulig <martin@gnome.org>
25311 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
25312 used to tell Resolve() which kinds of expressions it may return.
25313 (Expression.Resolve): Added overloaded version of this method which
25314 takes a `ResolveFlags flags' argument. This can be used to tell
25315 Resolve() which kinds of expressions it may return. Reports a
25317 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
25318 ResolveFlags.SimpleName.
25319 (Expression.Error118): Added overloaded version of this method which
25320 takes a `ResolveFlags flags' argument. It uses the flags to determine
25321 which kinds of expressions are allowed.
25323 * expression.cs (Argument.ResolveMethodGroup): New public method.
25324 Resolves an argument, but allows a MethodGroup to be returned.
25325 This is used when invoking a delegate.
25327 * TODO: Updated a bit.
25329 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25331 Fixed compilation with csc.
25333 * ecore.cs: Expression.Error made public. Is this correct? Should
25334 Warning be made public too?
25336 * expression.cs: use ea.Location instead of ea.loc.
25337 [FIXME: Filed as bug #28607: MCS must report these errors.]
25339 2002-08-06 Martin Baulig <martin@gnome.org>
25341 * ecore.cs (Expression.loc): Moved the location here instead of
25342 duplicating it in all derived classes.
25343 (Expression.Location): New public property.
25344 (Expression.Error, Expression.Warning): Made them non-static and
25345 removed the location argument.
25346 (Expression.Warning): Added overloaded version which takes an
25347 `int level' argument.
25348 (Expression.Error118): Make this non-static and removed the
25349 expression and location arguments.
25350 (TypeExpr): Added location argument to the constructor.
25352 * expression.cs (StaticCallExpr): Added location argument to
25354 (Indirection, PointerArithmetic): Likewise.
25355 (CheckedExpr, UnCheckedExpr): Likewise.
25356 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
25357 (StringPtr): Likewise.
25360 2002-08-05 Martin Baulig <martin@gnome.org>
25362 * expression.cs (BaseAccess.DoResolve): Actually report errors.
25364 * assign.cs (Assign.DoResolve): Check whether the source
25365 expression is a value or variable.
25367 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
25368 while resolving the corresponding blocks.
25370 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
25371 an error, don't silently return null.
25373 * statement.cs (Block.AddVariable): Do the error reporting here
25374 and distinguish between CS0128 and CS0136.
25375 (Block.DoResolve): Report all unused labels (warning CS0164).
25376 (LabeledStatement): Pass the location to the constructor.
25377 (LabeledStatement.HasBeenReferenced): New property.
25378 (LabeledStatement.Resolve): Set it to true here.
25380 * statement.cs (Return.Emit): Return success even after reporting
25381 a type mismatch error (CS0126 or CS0127), this is what csc does and
25382 it avoids confusing the users with any consecutive errors.
25384 2002-08-05 Martin Baulig <martin@gnome.org>
25386 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
25388 * const.cs (Const.LookupConstantValue): Catch circular definitions.
25390 * expression.cs (MemberAccess.DoResolve): Silently return if an
25391 error has already been reported.
25393 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
25394 error has already been reported.
25396 2002-08-05 Martin Baulig <martin@gnome.org>
25398 * statement.cs (UsageVector): Only initialize the `parameters'
25399 vector if we actually have any "out" parameters.
25401 2002-08-05 Martin Baulig <martin@gnome.org>
25403 * expression.cs (Binary.ResolveOperator): When combining delegates,
25404 they must have the same type.
25406 2002-08-05 Martin Baulig <martin@gnome.org>
25408 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
25409 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
25410 work with the ms runtime and we also don't need it: if we're a
25411 PropertyBuilder and not in the `indexer_arguments' hash, then we
25412 are a property and not an indexer.
25414 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
25415 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
25416 since the latter one doesn't work with the ms runtime.
25418 2002-08-03 Martin Baulig <martin@gnome.org>
25420 Fixed bugs #27998 and #22735.
25422 * class.cs (Method.IsOperator): New public field.
25423 (Method.CheckBase): Report CS0111 if there's already a method
25424 with the same parameters in the current class. Report CS0508 when
25425 attempting to change the return type of an inherited method.
25426 (MethodData.Emit): Report CS0179 if a method doesn't have a body
25427 and it's not marked abstract or extern.
25428 (PropertyBase): New abstract base class for Property and Indexer.
25429 (PropertyBase.CheckBase): Moved here from Property and made it work
25431 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
25432 the same so we can reuse it there.
25433 (Property, Indexer): Derive from PropertyBase.
25434 (MethodSignature.inheritable_property_signature_filter): New delegate
25435 to find properties and indexers.
25437 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
25438 argument and improved error reporting.
25440 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
25441 EmptyReadOnlyParameters and made it a property.
25443 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
25444 version of this method which takes a `PropertyInfo indexer'.
25445 (TypeManager.RegisterIndexer): New method.
25447 * class.cs: Added myself as author of this file :-)
25449 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25451 * class.cs: fixed compilation on windoze.
25453 2002-08-03 Martin Baulig <martin@gnome.org>
25455 * interface.cs (Interface.GetInterfaceBases): Check whether all
25456 base interfaces are at least as accessible than the current one.
25458 * class.cs (TypeContainer.GetClassBases): Check whether base types
25459 are at least as accessible than the current type.
25460 (TypeContainer.AsAccessible): Implemented and made non-static.
25461 (MemberBase.CheckParameters): Report errors if the accessibility
25464 * delegate.cs (Delegate.Delegate): The default visibility is
25465 internal for top-level types and private for nested types.
25466 (Delegate.Define): Report errors if the accessibility checks fail.
25468 * enum.cs (Enum.Enum): The default visibility is internal for
25469 top-level types and private for nested types.
25470 (Enum.DefineType): Compute the correct visibility.
25472 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
25473 function which takes a `bool is_toplevel' instead of a TypeContainer.
25475 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
25478 2002-08-02 Martin Baulig <martin@gnome.org>
25480 * expression.cs (LocalVariableReferenc): Added constructor which
25481 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
25482 (LocalVariableReference.IsReadOnly): New property.
25483 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
25484 variable is readonly, use our own readonly flag to do this; you can
25485 use the new constructor to get a writable reference to a read-only
25488 * cs-parser.jay (foreach_statement, using_statement): Get a writable
25489 reference to the local variable.
25491 2002-08-01 Miguel de Icaza <miguel@ximian.com>
25493 * rootcontext.cs (ResolveCore): Also include System.Exception
25495 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
25496 we reach an EmptyStatement.
25498 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
25501 * expression.cs (Binary.ResolveOperator): Check error result in
25504 use brtrue/brfalse directly and avoid compares to null.
25506 2002-08-02 Martin Baulig <martin@gnome.org>
25508 * class.cs (TypeContainer.Define): Define all nested interfaces here.
25509 Fixes bug #28407, added test-155.cs.
25511 2002-08-01 Martin Baulig <martin@gnome.org>
25513 * class.cs (Event.EmitDefaultMethod): Make this work with static
25514 events. Fixes #28311, added verify-3.cs.
25516 2002-08-01 Martin Baulig <martin@gnome.org>
25518 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
25519 `is_disposable' fields.
25520 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
25521 `hm.is_disposable' if we're using the collection pattern.
25522 (Foreach.EmitCollectionForeach): Use the correct type for the
25523 enumerator's local variable, only emit the try/finally block if
25524 necessary (fixes #27713).
25526 2002-08-01 Martin Baulig <martin@gnome.org>
25528 * ecore.cs (Expression.report118): Renamed to Error118 and made
25531 * statement.cs (Throw.Resolve): Check whether the expression is of
25532 the correct type (CS0118) and whether the type derives from
25533 System.Exception (CS0155).
25534 (Catch.Resolve): New method. Do the type lookup here and check
25535 whether it derives from System.Exception (CS0155).
25536 (Catch.CatchType, Catch.IsGeneral): New public properties.
25538 * typemanager.cs (TypeManager.exception_type): Added.
25540 2002-07-31 Miguel de Icaza <miguel@ximian.com>
25542 * driver.cs: Updated About function.
25544 2002-07-31 Martin Baulig <martin@gnome.org>
25546 Implemented Control Flow Analysis.
25548 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
25549 (EmitContext.CurrentBranching): Added.
25550 (EmitContext.StartFlowBranching): Added.
25551 (EmitContext.EndFlowBranching): Added.
25552 (EmitContext.KillFlowBranching): Added.
25553 (EmitContext.IsVariableAssigned): Added.
25554 (EmitContext.SetVariableAssigned): Added.
25555 (EmitContext.IsParameterAssigned): Added.
25556 (EmitContext.SetParameterAssigned): Added.
25557 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
25558 Added control flow analysis stuff here.
25560 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
25561 resolve the expression as lvalue.
25562 (LocalVariableReference.DoResolve): Check whether the variable has
25563 already been assigned.
25564 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
25565 the parameter as assigned here.
25566 (ParameterReference.DoResolve): Check whether the parameter has already
25568 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
25569 expression as lvalue.
25571 * statement.cs (FlowBranching): New class for the flow analysis code.
25572 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
25573 (LabeledStatement.IsDefined): New public property.
25574 (LabeledStatement.AddUsageVector): New public method to tell flow
25575 analyis that the label may be reached via a forward jump.
25576 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
25578 (VariableInfo.Number): New public field. This is used by flow analysis
25579 to number all locals of a block.
25580 (Block.CountVariables): New public property. This is the number of
25581 local variables in this block (including the locals from all parent
25583 (Block.EmitMeta): Number all the variables.
25585 * statement.cs: Added flow analysis support to all classes.
25587 2002-07-31 Martin Baulig <martin@gnome.org>
25589 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
25590 To get debugging messages, compile mcs with /define:MCS_DEBUG and
25591 then use this argument.
25593 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
25595 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
25596 use this to specify /define options.
25598 2002-07-29 Martin Baulig <martin@gnome.org>
25600 * statement.cs (Fixed): Moved all code that does variable lookups
25601 and resolvings from Emit to Resolve.
25603 * statement.cs (For): Moved all code that does variable lookups
25604 and resolvings from Emit to Resolve.
25606 * statement.cs (Using): Moved all code that does variable lookups
25607 and resolvings from Emit to Resolve.
25609 2002-07-29 Martin Baulig <martin@gnome.org>
25611 * attribute.cs (Attribute.Resolve): Explicitly catch a
25612 System.NullReferenceException when creating the
25613 CustromAttributeBuilder and report a different warning message.
25615 2002-07-29 Martin Baulig <martin@gnome.org>
25617 * support.cs (ParameterData.ParameterName): Added method to
25618 get the name of a parameter.
25620 * typemanager.cs (TypeManager.IsValueType): New public method.
25622 2002-07-29 Martin Baulig <martin@gnome.org>
25624 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
25625 is a flag which specifies that it's either ref or out.
25626 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
25627 the out parameter to `out Parameter.Modifier mod', also set the
25628 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
25630 * support.cs (InternalParameters.ParameterModifier): Distinguish
25631 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25632 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25634 * expression.cs (Argument.GetParameterModifier): Distinguish
25635 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25636 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25638 2002-07-29 Martin Baulig <martin@gnome.org>
25640 * expression.cs (ParameterReference.ParameterReference): Added
25641 `Location loc' argument to the constructor.
25643 * cs-parser.jay: Pass location to ParameterReference.
25645 2002-07-28 Miguel de Icaza <miguel@ximian.com>
25647 * statement.cs (Try): Initialize the location.
25649 * cs-parser.jay: pass location to Try.
25651 * expression.cs (Unary.Reduce): Change the prototype to return
25652 whether a constant fold could be performed or not. The result is
25653 returned in an out parameters. In the case of Indirection and
25654 AddressOf, we want to perform the full tests.
25656 2002-07-26 Miguel de Icaza <miguel@ximian.com>
25658 * statement.cs (Statement.Emit): Flag dead code.
25660 2002-07-27 Andrew Birkett <andy@nobugs.org>
25662 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
25664 2002-07-27 Martin Baulig <martin@gnome.org>
25666 * class.cs (MethodData.Define): Put back call to
25667 TypeManager.AddMethod(), accidentally commented this out.
25669 * report.cs (Debug): New public method to print debugging information,
25670 this is `[Conditional ("DEBUG")]'.
25672 2002-07-26 Martin Baulig <martin@gnome.org>
25674 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
25675 (switch_statement): Push the current_block to the switch_stack and
25676 pop it again when we're done with the switch.
25677 (switch_section): The new block is a child of the current_block.
25678 Fixes bug #24007, added test-152.cs.
25680 2002-07-27 Martin Baulig <martin@gnome.org>
25682 * expression.cs (Invocation.EmitArguments): When calling a varargs
25683 function with only its fixed arguments, we need to pass an empty
25686 2002-07-27 Martin Baulig <martin@gnome.org>
25688 Mono 0.13 has been released.
25690 2002-07-25 Miguel de Icaza <miguel@ximian.com>
25692 * driver.cs: Rename --resource to --linkres, because that is what
25693 we do currently, we dont support --resource yet.
25695 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
25697 2002-07-25 Martin Baulig <martin@gnome.org>
25699 * class.cs (MethodData): New public class. This is a `method builder'
25700 class for a method or one accessor of a Property/Indexer/Event.
25701 (MethodData.GetMethodFlags): Moved here from MemberBase.
25702 (MethodData.ApplyAttributes): Likewise.
25703 (MethodData.ApplyObsoleteAttribute): Likewise.
25704 (MethodData.ApplyConditionalAttribute): Likewise.
25705 (MethodData.ApplyDllImportAttribute): Likewise.
25706 (MethodData.CheckAbstractAndExternal): Likewise.
25707 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
25708 (MethodData.Emit): Formerly known as Method.Emit().
25709 (MemberBase): Moved everything which was specific to a single
25710 accessor/method to MethodData.
25711 (Method): Create a new MethodData and call Define() and Emit() on it.
25712 (Property, Indexer, Event): Create a new MethodData objects for each
25713 accessor and call Define() and Emit() on them.
25715 2002-07-25 Martin Baulig <martin@gnome.org>
25717 Made MethodCore derive from MemberBase to reuse the code from there.
25718 MemberBase now also checks for attributes.
25720 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
25721 (MemberBase.GetMethodFlags): Moved here from class Method and marked
25723 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
25724 `CallingConventions cc' and `Attributes opt_attrs' arguments.
25725 (MemberBase.ApplyAttributes): New virtual method; applies the
25726 attributes to a method or accessor.
25727 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
25728 (MemberBase.ApplyConditionalAttribute): Likewise.
25729 (MemberBase.ApplyDllImportAttribute): Likewise.
25730 (MemberBase.CheckAbstractAndExternal): Likewise.
25731 (MethodCore.ParameterTypes): This is now a property instead of a
25732 method, it's initialized from DoDefineParameters().
25733 (MethodCore.ParameterInfo): Removed the set accessor.
25734 (MethodCore.DoDefineParameters): New protected virtual method to
25735 initialize ParameterTypes and ParameterInfo.
25736 (Method.GetReturnType): We can now simply return the MemberType.
25737 (Method.GetMethodFlags): Override the MemberBase version and add
25738 the conditional flags.
25739 (Method.CheckBase): Moved some code from Define() here, call
25740 DoDefineParameters() here.
25741 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
25742 here to avoid some larger code duplication.
25743 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
25744 ensure that abstract and external accessors don't declare a body.
25746 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
25747 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
25748 lookup in the attribute's parent classes, so we need to abort as soon
25749 as we found the first match.
25750 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
25751 the attribute has no arguments.
25753 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
25756 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25758 * cs-parser.jay: reverted previous patch.
25760 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25762 * cs-parser.jay: fixed bug #22119.
25764 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25766 * attribute.cs: fixed compilation. The error was:
25767 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
25768 be assigned to before control leaves the current method."
25769 [FIXME: Filed as bug #28186: MCS must report this error.]
25771 2002-07-25 Martin Baulig <martin@gnome.org>
25773 * attribute.cs (Attribute.Conditional_GetConditionName): New static
25774 method to pull the condition name ouf of a Conditional attribute.
25775 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
25776 the obsolete message and error flag out of an Obsolete attribute.
25778 * class.cs (Method.GetMethodFlags): New public method to get the
25779 TypeManager.MethodFlags for this method.
25780 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
25782 (Method.Define): Get and apply the Obsolete and Conditional attributes;
25783 if we're overriding a virtual function, set the new private variable
25784 `parent_method'; call the new TypeManager.AddMethod().
25786 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
25787 the MethodBuilder and the Method in a PtrHashtable.
25788 (TypeManager.builder_to_method): Added for this purpose.
25789 (TypeManager.MethodFlags): Added IsObsoleteError.
25790 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
25791 Obsolete and Conditional arguments in MethodBuilders. If we discover
25792 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
25793 the message from the attribute.
25795 2002-07-24 Martin Baulig <martin@gnome.org>
25797 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
25798 preprocessor directives, ensure that the argument to #define/#undef is
25799 exactly one identifier and that it's actually an identifier.
25801 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
25804 2002-07-24 Martin Baulig <martin@gnome.org>
25806 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
25807 initialize it to TypeManager.object_type in the constructor.
25808 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
25809 of the `hm.get_current' method if we're using the collection pattern.
25810 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
25811 for the explicit conversion to make it work when we're using the collection
25812 pattern and the `Current' property has a different return type than `object'.
25815 2002-07-24 Martin Baulig <martin@gnome.org>
25817 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
25818 does not match, but don't report any errors. This method is called in
25819 order for all methods in a MethodGroupExpr until a matching method is
25820 found, so we don't want to bail out if the first method doesn't match.
25821 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
25822 matches, report the 123. Fixes #28070.
25824 2002-07-24 Martin Baulig <martin@gnome.org>
25826 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
25827 TypeManager.TypeToCoreType() to the top of the method so the
25828 following equality checks will work. Fixes #28107.
25830 2002-07-24 Martin Baulig <martin@gnome.org>
25832 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
25833 operand is of type uint, and the other operand is of type sbyte,
25834 short or int, the operands are converted to type long." -
25835 Actually do what this comment already told us. Fixes bug #28106,
25838 2002-07-24 Martin Baulig <martin@gnome.org>
25840 * class.cs (MethodBase): New abstract class. This is now a base
25841 class for Property, Indexer and Event to avoid some code duplication
25842 in their Define() and DefineMethods() methods.
25843 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
25844 generic methods for Define() and DefineMethods().
25845 (FieldBase): Derive from MemberBase, not MemberCore.
25846 (Property): Derive from MemberBase, not MemberCore.
25847 (Property.DefineMethod): Moved all the code from this method to the
25848 new MethodBase.DefineAccessor(), just call it with appropriate
25850 (Property.Define): Call the new Property.DoDefine(), this does some
25851 sanity checks and we don't need to duplicate the code everywhere.
25852 (Event): Derive from MemberBase, not MemberCore.
25853 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
25854 accessors, this will also make them work with interface events.
25855 (Indexer): Derive from MemberBase, not MemberCore.
25856 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
25857 (Indexer.Define): Use the new MethodBase functions.
25859 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
25860 argument to the constructor.
25861 (Interface.FindMembers): Added support for interface events.
25862 (Interface.PopluateEvent): Implemented.
25864 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
25866 2002-07-22 Miguel de Icaza <miguel@ximian.com>
25868 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
25869 but this is required to check for a method name being the same as
25870 the containing class.
25874 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25876 * interface.cs: initialize variable.
25878 2002-07-23 Martin Baulig <martin@gnome.org>
25880 Implemented the IndexerName attribute in interfaces.
25882 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
25883 name if this is an explicit interface implementation.
25884 (Indexer.InterfaceIndexerName): New public variable. If we're
25885 implementing an interface indexer, this is the IndexerName in that
25886 interface. Otherwise, it's the IndexerName.
25887 (Indexer.DefineMethod): If we're implementing interface indexer,
25888 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
25889 and Pending.ImplementIndexer methods.
25890 (Indexer.Define): Also define the PropertyBuilder if we're
25891 implementing an interface indexer and this is neither an explicit
25892 interface implementation nor do the IndexerName match the one in
25895 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
25896 If a method is defined here, then we always need to create a proxy
25897 for it. This is used when implementing interface indexers.
25898 (Pending.IsInterfaceIndexer): New public method.
25899 (Pending.ImplementIndexer): New public method.
25900 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
25901 This is used when implementing interface indexers to define a proxy
25903 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
25904 define a proxy if necessary.
25906 * interface.cs (Interface.IndexerName): New public variable.
25907 (Interface.PopulateIndexer): Set the IndexerName.
25908 (Interface.DefineIndexers): New private method. Populate all the
25909 indexers and make sure their IndexerNames match.
25911 * typemanager.cs (IndexerPropertyName): Added support for interface
25914 2002-07-22 Martin Baulig <martin@gnome.org>
25916 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
25917 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
25918 ret if HasReturnLabel.
25919 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
25922 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
25923 and set the ec.LoopBeginTryCatchLevel.
25924 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
25925 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
25926 the current ec.TryCatchLevel, the branch goes out of an exception
25927 block. In this case, we need to use Leave and not Br.
25929 2002-07-22 Martin Baulig <martin@gnome.org>
25931 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
25932 block unless the block does not always return or it is contained in
25933 another try { ... } catch { ... } block. Fixes bug #26506.
25934 Added verify-1.cs to the test suite.
25936 2002-07-22 Martin Baulig <martin@gnome.org>
25938 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
25939 then we do not always return. Fixes bug #24985.
25941 2002-07-22 Martin Baulig <martin@gnome.org>
25943 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
25944 lookup on a per-class level; ie. walk up the class hierarchy until we
25945 found at least one applicable method, then choose the best among them.
25946 Fixes bug #24463 and test-29.cs.
25948 2002-07-22 Martin Baulig <martin@gnome.org>
25950 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
25951 return types of the methods. The return type is not part of the
25952 signature and we must not check it to make the `new' modifier work.
25953 Fixes bug #27999, also added test-147.cs.
25954 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
25956 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
25957 on the method's return type.
25959 2002-07-21 Martin Baulig <martin@gnome.org>
25961 * assign.cs: Make this work if the rightmost source is a constant and
25962 we need to do an implicit type conversion. Also adding a few more tests
25963 to test-38.cs which should have caught this.
25965 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
25966 target in the makefile for this. The makefile.gnu is primarily intended
25967 for end-users who don't want to debug the compiler.
25969 2002-07-21 Martin Baulig <martin@gnome.org>
25971 * assign.cs: Improved the Assign class so it can now handle embedded
25972 assignments (X = Y = Z = something). As a side-effect this'll now also
25973 consume less local variables. test-38.cs now passes with MCS, added
25974 a few new test cases to that test.
25976 2002-07-20 Martin Baulig <martin@gnome.org>
25978 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
25979 instructions. Fixes bug #27977, also added test-146.cs.
25981 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25983 * cs-tokenizer.cs: fixed getHex ().
25985 2002-07-19 Martin Baulig <martin@gnome.org>
25987 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
25988 not Type.GetType() to lookup the array type. This is needed when
25989 we're constructing an array of a user-defined type.
25990 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
25991 single-dimensional arrays, but also for single-dimensial arrays of
25994 2002-07-19 Martin Baulig <martin@gnome.org>
25996 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
25997 this function is called, it's not allowed to share LocalBuilders
25998 among ILGenerators.
26000 2002-07-19 Martin Baulig <martin@gnome.org>
26002 * expression.cs (Argument.Resolve): Report an error 118 when trying
26003 to pass a type as argument.
26005 2002-07-18 Martin Baulig <martin@gnome.org>
26007 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
26008 Conv_R_Un for the signed `long' type.
26010 2002-07-15 Miguel de Icaza <miguel@ximian.com>
26012 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
26013 `expr' for the temporary result, as that will fail if we do
26014 multiple resolves on the same expression.
26016 2002-07-05 Miguel de Icaza <miguel@ximian.com>
26018 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
26019 ec.TypeContainer for looking up aliases.
26021 * class.cs (TypeContainer): Remove LookupAlias from here.
26023 * decl.cs (DeclSpace); Move here.
26025 2002-07-01 Miguel de Icaza <miguel@ximian.com>
26027 * class.cs (FindMembers): Only call filter if the constructor
26028 bulider is not null.
26030 Also handle delegates in `NestedTypes' now. Now we will perform
26031 type lookups using the standard resolution process. This also
26034 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
26035 This uses Expressions (the limited kind that can be parsed by the
26036 tree) instead of strings.
26038 * expression.cs (ComposedCast.ToString): Implement, used to flag
26039 errors since now we have to render expressions.
26041 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
26044 * ecore.cs (SimpleName.ToString): ditto.
26046 * cs-parser.jay: Instead of using strings to assemble types, use
26047 Expressions to assemble the type (using SimpleName, ComposedCast,
26048 MemberAccess). This should fix the type lookups in declarations,
26049 because we were using a different code path for this.
26051 * statement.cs (Block.Resolve): Continue processing statements
26052 even when there is an error.
26054 2002-07-17 Miguel de Icaza <miguel@ximian.com>
26056 * class.cs (Event.Define): Also remove the `remove' method from
26057 the list of pending items.
26059 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
26060 generate more compact code.
26062 2002-07-17 Martin Baulig <martin@gnome.org>
26064 * const.cs (Const.LookupConstantValue): Add support for constant
26065 `unchecked' and `checked' expressions.
26066 Also adding test case test-140.cs for this.
26068 2002-07-17 Martin Baulig <martin@gnome.org>
26070 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
26071 check whether mi.ReturnType implements the IEnumerator interface; the
26072 `==' and the IsAssignableFrom() will fail in this situation.
26074 2002-07-16 Ravi Pratap <ravi@ximian.com>
26076 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
26079 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26081 * expression.cs: fixed bug #27811.
26083 2002-07-14 Miguel de Icaza <miguel@ximian.com>
26085 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
26086 Molaro: when we are a ref, the value already contains a pointer
26087 value, do not take the address of it.
26089 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26090 * removed mb-parser.jay and mb-tokenizer.cs
26092 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26094 * expression.cs: check against the building corlib void type.
26096 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
26098 * ecore.cs: fix for valuetype static readonly fields: when
26099 initializing them, we need their address, not the address of a copy.
26101 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26103 * typemanager.cs: register also enum_type in corlib.
26105 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26107 * class.cs: allow calling this (but not base) initializers in structs.
26109 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
26111 * ecore.cs: make sure we compare against the building base types
26114 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26116 * typemanager.cs: fix TypeToCoreType() to handle void and object
26117 (corlib gets no more typerefs after this change).
26119 2002-07-12 Miguel de Icaza <miguel@ximian.com>
26121 * expression.cs (ArrayCreation.EmitArrayArguments): use
26122 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
26124 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
26125 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
26126 array indexes, the runtime actually forbids them.
26128 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
26129 for array arguments here.
26131 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
26132 instead of the default for ValueTypes.
26134 (New.DoEmit): Use IsValueType instead of
26135 IsSubclassOf (value_type)
26136 (New.DoResolve): ditto.
26137 (Invocation.EmitCall): ditto.
26139 * assign.cs (Assign): ditto.
26141 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
26142 Statements *are* currently doing part of their resolution during
26145 Expressions do always resolve during resolve, but statements are
26146 only required to propagate resolution to their children.
26148 2002-07-11 Miguel de Icaza <miguel@ximian.com>
26150 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
26152 (LoadAssembly): Do not add the dll if it is already specified
26154 (MainDriver): Add the System directory to the link path at the end,
26155 after all the other -L arguments.
26157 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
26158 wrong opcode for loading bytes and bools (ldelem.i1 instead of
26159 ldelem.u1) and using the opposite for sbytes.
26161 This fixes Digger, and we can finally run it.
26163 * driver.cs (UnixParseOption): Move the option parsing here.
26164 (CSCParseOption): Implement CSC-like parsing of options.
26166 We now support both modes of operation, the old Unix way, and the
26167 new CSC-like way. This should help those who wanted to make cross
26168 platform makefiles.
26170 The only thing broken is that /r:, /reference: and /lib: are not
26171 implemented, because I want to make those have the same semantics
26172 as the CSC compiler has, and kill once and for all the confussion
26173 around this. Will be doing this tomorrow.
26175 * statement.cs (Unsafe.Resolve): The state is checked during
26176 resolve, not emit, so we have to set the flags for IsUnsfe here.
26178 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26180 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
26181 not catch the Error_ObjectRefRequired in SimpleName (as it is
26182 possible to have a class/instance variable name that later gets
26183 deambiguated), we have to check this here.
26185 2002-07-10 Ravi Pratap <ravi@ximian.com>
26187 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
26188 make static and put into Expression.
26190 (Event.Define): Register the private field of the event with the
26191 TypeManager so that GetFieldFromEvent can get at it.
26193 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
26194 keep track of the private field associated with an event which
26197 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
26200 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
26202 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26204 * expression.cs (Binary.EmitBranchable): this routine emits the
26205 Binary expression in a branchable context. This basically means:
26206 we need to branch somewhere, not just get the value on the stack.
26208 This works together with Statement.EmitBoolExpression.
26210 * statement.cs (Statement.EmitBoolExpression): Use
26213 2002-07-09 Miguel de Icaza <miguel@ximian.com>
26215 * statement.cs (For): Reduce the number of jumps in loops.
26217 (For): Implement loop inversion for the For statement.
26219 (Break): We can be breaking out of a Try/Catch controlled section
26220 (foreach might have an implicit try/catch clause), so we need to
26221 use Leave instead of Br.
26223 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
26224 now). If the instace expression supports IMemoryLocation, we use
26225 the AddressOf method from the IMemoryLocation to extract the
26226 address instead of emitting the instance.
26228 This showed up with `This', as we were emitting the instance
26229 always (Emit) instead of the Address of This. Particularly
26230 interesting when This is a value type, as we dont want the Emit
26231 effect (which was to load the object).
26233 2002-07-08 Miguel de Icaza <miguel@ximian.com>
26235 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
26237 * statement.cs (Checked): Set the CheckedState during the resolve
26238 process too, as the ConvCast operations track the checked state on
26239 the resolve process, and not emit.
26241 * cs-parser.jay (namespace_member_declaration): Flag that we have
26242 found a declaration when we do. This is used to flag error 1529
26244 * driver.cs: Report ok when we display the help only.
26246 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
26248 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
26250 2002-07-04 Miguel de Icaza <miguel@ximian.com>
26252 * cs-tokenizer.cs (define): We also have to track locally the
26253 defines. AllDefines is just used for the Conditional Attribute,
26254 but we also need the local defines for the current source code.
26256 2002-07-03 Miguel de Icaza <miguel@ximian.com>
26258 * statement.cs (While, For, Do): These loops can exit through a
26259 Break statement, use this information to tell whether the
26260 statement is the last piece of code.
26262 (Break): Flag that we break.
26264 * codegen.cs (EmitContexts): New `Breaks' state variable.
26266 2002-07-03 Martin Baulig <martin@gnome.org>
26268 * class.cs (TypeContainer.MethodModifiersValid): Allow override
26269 modifiers in method declarations in structs. Otherwise, you won't
26270 be able to override things like Object.Equals().
26272 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26274 * class.cs (Method, Property, Indexer): Do not allow the public
26275 modifier to be used in explicit interface implementations.
26277 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
26278 override modifiers in method declarations in structs
26280 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
26282 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
26283 integer or real overflow, report an error
26285 2002-07-02 Martin Baulig <martin@gnome.org>
26287 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
26288 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
26289 to tell the runtime about our newly created System.Object and
26290 System.ValueType types.
26292 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26294 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
26295 struct instead of Ldarg/Starg.
26297 2002-07-02 Martin Baulig <martin@gnome.org>
26299 * expression.cs (Indirection.Indirection): Call
26300 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
26302 2002-07-02 Martin Baulig <martin@gnome.org>
26304 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
26305 ValueType, call TypeManager.TypeToCoreType() on it.
26306 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
26307 the OpCodes.Newarr argument.
26309 2002-07-02 Martin Baulig <martin@gnome.org>
26311 * expression.cs (Invocation.EmitCall): When compiling corlib,
26312 replace all calls to the system's System.Array type to calls to
26313 the newly created one.
26315 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
26316 System.Array methods.
26317 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
26318 from the system's System.Array type which must be replaced.
26320 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
26322 * typemanager.cs: load unverifiable_code_ctor so we can build
26323 corlib using the correct type. Avoid using GetTypeCode() with
26325 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
26326 TypeManager.object_type to allow building corlib.
26328 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26330 * ecore.cs: handle System.Enum separately in LoadFromPtr().
26332 2002-07-01 Martin Baulig <martin@gnome.org>
26334 * class.cs: Make the last change actually work, we need to check
26335 whether `ifaces != null' to avoid a crash.
26337 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26339 * class.cs: when we build structs without fields that implement
26340 interfaces, we need to add the interfaces separately, since there is
26341 no API to both set the size and add the interfaces at type creation
26344 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26346 * expression.cs: the dimension arguments to the array constructors
26347 need to be converted if they are a long.
26349 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
26351 * class.cs: don't emit ldarg.0 if there is no parent constructor
26352 (fixes showstopper for corlib).
26354 2002-06-29 Martin Baulig <martin@gnome.org>
26356 MCS now compiles corlib on GNU/Linux :-)
26358 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
26359 ie. check for MethodImplOptions.InternalCall.
26361 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
26362 and TypeManager.attribute_type are null, so we must explicitly check
26363 whether parent is not null to find out whether it's an attribute type.
26364 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
26365 and SetBuilder, not only if the property is neither abstract nor external.
26366 This is necessary to set the MethodImplOptions on the accessor methods.
26367 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
26368 SetBuilder, see Property.Emit().
26370 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
26371 populate "System.Object", "System.ValueType" and "System.Attribute" since
26372 they've already been populated from BootCorlib_PopulateCoreTypes().
26374 2002-06-29 Martin Baulig <martin@gnome.org>
26376 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
26377 is the NullLiteral, we also need to make sure that target_type is not
26380 2002-06-29 Martin Baulig <martin@gnome.org>
26382 * rootcontext.cs (RootContext.ResolveCore): We must initialize
26383 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
26384 before calling BootstrapCorlib_ResolveDelegate ().
26386 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26388 * statement.cs: fixed build-breaker. All tests passed ok.
26390 2002-06-27 Martin Baulig <martin@gnome.org>
26392 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
26393 for System.Decimal when compiling corlib.
26395 2002-06-27 Martin Baulig <martin@gnome.org>
26397 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
26398 switch blocks which contain nothing but a default clause.
26400 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
26402 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
26404 2002-06-27 Martin Baulig <martin@gnome.org>
26406 * ecore.cs (PropertyExpr.PropertyExpr): Call
26407 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
26409 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
26410 is already a TypeBuilder.
26412 2002-06-27 Martin Baulig <martin@gnome.org>
26414 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
26415 `target_type == TypeManager.array_type', not IsAssignableFrom() in
26416 the "from an array-type to System.Array" case. This makes it work
26417 when compiling corlib.
26419 2002-06-27 Martin Baulig <martin@gnome.org>
26421 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
26422 non-static PropertyExpr, set its InstanceExpression. This makes
26423 the `ICollection.Count' property work in System/Array.cs.
26425 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
26427 * driver.cs: Made error handling more consistent. Errors now
26428 tracked by Report class, so many methods which used to return int
26429 now return void. Main() now prints success/failure and
26430 errors/warnings message.
26432 Renamed '--probe' compiler argument to '--expect-error'. Removed
26433 the magic number return values (123 and 124). Now, if the
26434 expected error occurs, the compiler exits with success (exit value
26435 0). If the compilation completes without seeing that particular
26436 error, the compiler exits with failure (exit value 1). The
26437 makefile in mcs/errors has been changed to handle the new behaviour.
26439 * report.cs: Made 'expected error' number a property and renamed
26440 it from 'Probe' to 'ExpectedError'.
26442 * genericparser.cs: Removed error handling support, since it is
26443 now all done by Report class.
26445 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
26446 class, so parse() no longer returns an int.
26448 * namespace.cs: Use Report.Error instead of GenericParser.error
26450 2002-06-22 Miguel de Icaza <miguel@ximian.com>
26452 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
26453 TypeContainer.AddOperator): At the front of the list put the
26454 explicit implementations, so they get resolved/defined first.
26456 2002-06-21 Miguel de Icaza <miguel@ximian.com>
26458 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
26459 interface type is implemented by this TypeContainer. Used during
26460 explicit interface implementation.
26462 (Property.Define, Indexer.Define, Method.Define): Validate that
26463 the given interface in the explicit implementation is one of the
26464 base classes for the containing type.
26466 Also if we are explicitly implementing an interface, but there is
26467 no match in the pending implementation table, report an error.
26469 (Property.Define): Only define the property if we are
26470 not explicitly implementing a property from an interface. Use the
26471 correct name also for those properties (the same CSC uses,
26472 although that is really not needed).
26474 (Property.Emit): Do not emit attributes for explicitly implemented
26475 properties, as there is no TypeBuilder.
26477 (Indexer.Emit): ditto.
26479 Hiding then means that we do not really *implement* a pending
26480 implementation, which makes code fail.
26482 2002-06-22 Martin Baulig <martin@gnome.org>
26484 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
26485 the return value of Object.GetType(). [FIXME: we need to do this whenever
26486 we get a type back from the reflection library].
26488 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26490 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
26492 2002-06-20 Miguel de Icaza <miguel@ximian.com>
26494 * attribute.cs: Return null if we can not look up the type.
26496 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
26497 the interface types found.
26499 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
26500 interface types found.
26502 * typemanager.cs (GetInterfaces): Make this routine returns alll
26503 the interfaces and work around the lame differences between
26504 System.Type and System.Reflection.Emit.TypeBuilder in the results
26505 result for GetInterfaces.
26507 (ExpandInterfaces): Given an array of interface types, expand and
26508 eliminate repeated ocurrences of an interface. This expands in
26509 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
26512 2002-06-21 Martin Baulig <martin@gnome.org>
26514 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
26517 2002-06-21 Martin Baulig <martin@gnome.org>
26519 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
26520 and called with one of the core types, return the corresponding typebuilder for
26523 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
26526 2002-06-21 Martin Baulig <martin@gnome.org>
26528 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
26529 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
26530 (Expression.ConvertReferenceExplicit): Likewise.
26532 * expression.cs (ElementAccess.DoResolve): Likewise.
26533 (ElementAccess.DoResolveLValue): Likewise.
26535 2002-06-10 Martin Baulig <martin@gnome.org>
26537 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
26538 add the "value" parameter to the parameter list.
26540 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
26543 2002-06-19 Miguel de Icaza <miguel@ximian.com>
26545 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
26546 the argument to an int, uint, long or ulong, per the spec. Also
26547 catch negative constants in array creation.
26549 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
26551 * class.cs: do not allow the same interface to appear twice in
26552 the definition list.
26554 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26556 * ecore.cs: don't use ldlen with System.Array.
26558 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26560 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
26562 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
26564 * modifiers.cs: produce correct field attributes for protected
26565 internal. Easy fix so miguel can work on ther harder stuff:-)
26567 2002-06-18 Miguel de Icaza <miguel@ximian.com>
26569 * pending.cs: New file. Move the code from class.cs here.
26570 Support clearning the pending flag for all methods (when not doing
26571 explicit interface implementation).
26573 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26575 * rootcontext.cs: added a couple more types needed to bootstrap.
26577 2002-06-17 Miguel de Icaza <miguel@ximian.com>
26579 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
26580 constructor in the type, instead of any constructor in the type
26581 hierarchy. Thanks to Paolo for finding this bug (it showed up as
26582 a bug in the Mono runtime when applying the params attribute).
26584 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26585 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
26587 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
26589 * expression.cs (Unary.ResolveOperator): Use TypeManager
26590 to resolve the type.
26592 2002-06-13 Ravi Pratap <ravi@ximian.com>
26594 * cs-parser.jay (enum_member_declaration): Pass in the attributes
26597 * enum.cs (AddEnumMember): Add support to store the attributes associated
26598 with each member too.
26600 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
26601 field builders too - this takes care of the enum member case.
26603 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
26605 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
26606 address-of operator on both value types and pointers.
26608 2002-06-10 Martin Baulig <martin@gnome.org>
26610 * interface.cs (Interface.PopulateIndexer): Add the indexer's
26611 PropertyBuilder to the `property_builders' list.
26613 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
26614 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
26615 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
26616 find any indexers which are inherited from an interface.
26618 2002-06-09 Martin Baulig <martin@gnome.org>
26620 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
26621 the same type as the constant if necessary. There's also a test-130.cs
26624 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
26626 * typemanager.cs (TypeManager.ChangeType): Previously known as
26627 Enum.ChangeEnumType().
26629 2002-06-09 Martin Baulig <martin@gnome.org>
26631 * expression.cs (Cast.TryReduce): Added support for consts.
26633 2002-06-08 Ravi Pratap <ravi@ximian.com>
26635 * class.cs (Accessor): Hold attributes information so we can pass
26638 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
26639 Modify to pass in attributes attached to the methods.
26641 (add_accessor_declaration, remove_accessor_declaration): Ditto.
26643 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
26644 to handle the Accessor kind :-)
26646 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
26648 2002-06-08 Martin Baulig <martin@gnome.org>
26650 * expression.cs (Unary.TryReduceNegative): Added support for
26653 2002-06-08 Martin Baulig <martin@gnome.org>
26655 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
26656 name can't be found in the `defined_names' - the caller will do a
26657 MemberLookup in this case and thus find methods in System.Enum
26658 such as Enum.IsDefined().
26660 2002-06-08 Martin Baulig <martin@gnome.org>
26662 * enum.cs (Enum.ChangeEnumType): This is a custom version of
26663 Convert.ChangeType() which works with TypeBuilder created types.
26664 (Enum.LookupEnumValue, Enum.Define): Use it here.
26666 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
26667 `TypeBuilder.BaseType != null' check.
26668 (TypeContainer.FindMembers): Only lookup parent members if we
26669 actually have a parent.
26670 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
26671 (ConstructorInitializer.Resolve): Likewise.
26673 * interface.cs (Interface.FindMembers): Added
26674 `TypeBuilder.BaseType != null' check.
26676 * rootcontext.cs (RootContext.ResolveCore): Added
26677 "System.Runtime.CompilerServices.IndexerNameAttribute" to
26678 classes_second_stage.
26680 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
26681 debug_type and trace_type when compiling with --nostdlib.
26683 2002-06-07 Martin Baulig <martin@gnome.org>
26685 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
26686 (AddField): Set it to true when adding a non-static field.
26687 (DefineType): Use `have_nonstatic_fields' to find out whether we
26688 have non-static fields, not `Fields != null'.
26690 2002-06-02 Miguel de Icaza <miguel@ximian.com>
26692 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
26693 dereferencing a null on the static-field code path)
26695 2002-05-30 Martin Baulig <martin@gnome.org>
26697 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
26698 to take command line arguments. Use reflection to call the new
26699 custom `Initialize' function on the symbol writer and pass it the
26700 command line arguments.
26702 * driver.cs (--debug-args): New command line argument to pass command
26703 line arguments to the symbol writer.
26705 2002-05-28 Miguel de Icaza <miguel@ximian.com>
26707 * assign.cs (DoResolve): Forgot to do the implicit conversion to
26708 the target type for indexers and properties. Thanks to Joe for
26711 2002-05-27 Miguel de Icaza <miguel@ximian.com>
26713 * typemanager.cs (MethodFlags): returns the method flags
26714 (Obsolete/ShouldIgnore) that control warning emission and whether
26715 the invocation should be made, or ignored.
26717 * expression.cs (Invocation.Emit): Remove previous hack, we should
26718 not do this on matching a base type, we should do this based on an attribute
26720 Only emit calls to System.Diagnostics.Debug and
26721 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
26722 on the command line.
26724 * rootcontext.cs: Global settings for tracing and debugging.
26726 * cs-tokenizer.cs (define): New utility function to track
26727 defines. Set the global settings for TRACE and DEBUG if found.
26729 2002-05-25 Ravi Pratap <ravi@ximian.com>
26731 * interface.cs (Populate*): Pass in the TypeContainer as well as
26732 the DeclSpace as parameters so that we can create EmitContexts and
26733 then use that to apply attributes etc.
26735 (PopulateMethod, PopulateEvent, PopulateProperty)
26736 (PopulateIndexer): Apply attributes everywhere.
26738 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
26741 (ApplyAttributes): Update accordingly.
26743 We now apply interface attributes for all members too.
26745 2002-05-26 Miguel de Icaza <miguel@ximian.com>
26747 * class.cs (Indexer.Define); Correctly check if we are explicit
26748 implementation (instead of checking the Name for a ".", we
26749 directly look up if the InterfaceType was specified).
26751 Delay the creation of the PropertyBuilder.
26753 Only create the PropertyBuilder if we are not an explicit
26754 interface implementation. This means that explicit interface
26755 implementation members do not participate in regular function
26756 lookups, and hence fixes another major ambiguity problem in
26757 overload resolution (that was the visible effect).
26759 (DefineMethod): Return whether we are doing an interface
26762 * typemanager.cs: Temporary hack until we get attributes in
26763 interfaces (Ravi is working on that) and we get IndexerName
26764 support in interfaces.
26766 * interface.cs: Register the indexers as properties.
26768 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
26769 warning, I have verified that this is a bug in the .NET runtime
26770 (JavaScript suffers of the same problem).
26772 * typemanager.cs (MemberLookup): When looking up members for
26773 interfaces, the parent of an interface is the implicit
26774 System.Object (so we succeed in searches of Object methods in an
26775 interface method invocation. Example: IEnumerable x; x.ToString
26778 2002-05-25 Miguel de Icaza <miguel@ximian.com>
26780 * class.cs (Event): Events should also register if they do
26781 implement the methods that an interface requires.
26783 * typemanager.cs (MemberLookup); use the new GetInterfaces
26786 (GetInterfaces): The code used to lookup interfaces for a type is
26787 used in more than one place, factor it here.
26789 * driver.cs: Track the errors at the bottom of the file, we kept
26792 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
26793 instance if the method we are calling is static!
26795 2002-05-24 Miguel de Icaza <miguel@ximian.com>
26797 * attribute.cs (ApplyAttributes): Make this function filter out
26798 the IndexerName attribute (as that attribute in reality is never
26799 applied) and return the string constant for the IndexerName
26802 * class.cs (TypeContainer.Emit): Validate that all the indexers
26803 have the same IndexerName attribute, and if so, set the
26804 DefaultName attribute on the class.
26806 * typemanager.cs: The return value might contain other stuff (not
26807 only methods). For instance, consider a method with an "Item"
26808 property and an Item method.
26810 * class.cs: If there is a problem with the parameter types,
26813 2002-05-24 Ravi Pratap <ravi@ximian.com>
26815 * ecore.cs (ImplicitConversionExists): Wrapper function which also
26816 looks at user defined conversion after making a call to
26817 StandardConversionExists - we need this for overload resolution.
26819 * expression.cs : Update accordingly the various method calls.
26821 This fixes 2 bugs filed against implicit user defined conversions
26823 2002-05-22 Miguel de Icaza <miguel@ximian.com>
26825 * statement.cs: Track the result of the assignment.
26827 2002-05-21 Miguel de Icaza <miguel@ximian.com>
26829 * expression.cs (MemberAccess): Improved error reporting for
26830 inaccessible members.
26832 2002-05-22 Martin Baulig <martin@gnome.org>
26834 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
26835 itself with debugging support.
26837 2002-05-22 Martin Baulig <martin@gnome.org>
26839 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
26840 Removed, this isn't needed anymore.
26842 2002-05-20 Martin Baulig <martin@gnome.org>
26844 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
26845 be underlying type for an enum.
26847 2002-05-20 Miguel de Icaza <miguel@ximian.com>
26849 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
26850 that splits out the loading of just the core types.
26852 * rootcontext.cs (ResolveCore): Split the struct resolution in
26853 two, so we can load the enumeration underlying types before any
26856 * expression.cs (Is): Bandaid until we fix properly Switch (see
26857 bug #24985 for details).
26859 * typemanager.cs (ImplementsInterface): The hashtable will contain
26860 a null if there are no interfaces implemented.
26862 2002-05-18 Miguel de Icaza <miguel@ximian.com>
26864 * cs-parser.jay (indexer_declarator): It is fine to have array
26867 2002-05-17 Miguel de Icaza <miguel@ximian.com>
26869 * typemanager.cs: (RegisterBuilder): New function used to register
26870 TypeBuilders that implement interfaces. Since
26871 TypeBuilder.GetInterfaces (as usual) does not work with lame
26873 (AddUserType): register interfaces.
26875 (ImplementsInterface): Use the builder_to_ifaces hash if we are
26876 dealing with TypeBuilder. Also, arrays are showing up as
26877 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
26878 methods can not be invoked on them!
26880 * ecore.cs (ExplicitReferenceConversionExists): Made public.
26881 (ImplicitReferenceConversionExists): Split out from
26882 StandardConversionExists.
26884 * expression.cs (As): We were only implementing one of the three
26885 cases for the as operator. We now implement them all.
26886 (Is): Implement the various other cases for Is as well.
26888 * typemanager.cs (CACHE): New define used to control if we want or
26889 not the FindMembers cache. Seems to have a negative impact on
26890 performance currently
26892 (MemberLookup): Nested types have full acess to
26893 enclosing type members
26895 Remove code that coped with instance/static returns for events, we
26896 now catch this in RealFindMembers.
26898 (RealFindMembers): only perform static lookup if the instance
26899 lookup did not return a type or an event.
26901 2002-05-17 Miguel de Icaza <miguel@ximian.com>
26903 * assign.cs (CompoundAssign): We pass more semantic information
26904 now to Compound Assignments than we did before: now we have all
26905 the information at hand, and now we resolve the target *before* we
26906 do the expression expansion, which allows the "CacheValue" method
26907 to have the effect we intended (before, a [x] += 1 would generate
26908 two differen ArrayAccess expressions from the ElementAccess,
26909 during the resolution process).
26911 (CompoundAssign.DoResolve): Resolve target and original_source here.
26913 2002-05-16 Miguel de Icaza <miguel@ximian.com>
26915 * expression.cs (ArrayAccess): dropped debugging information.
26917 * typemanager.cs: Small bug fix: I was always returning i_members,
26918 instead of one of i_members or s_members (depending on which had
26921 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
26922 method is invoked before any code generation takes place, and it
26923 is a mechanism to inform that the expression will be invoked more
26924 than once, and that the method should use temporary values to
26925 avoid having side effects
26927 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
26929 * ecore.cs (Expression.CacheTemporaries): Provide empty default
26932 * expression.cs (Indirection, ArrayAccess): Add support for
26933 CacheTemporaries in these two bad boys.
26935 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
26936 ldobj or ldind_ref.
26937 (StoreFromPtr): Handle stobj as well.
26939 * expression.cs (UnaryMutator): Share more code.
26941 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
26942 down: I was not tracking the Filter function as well, which
26943 was affecting the results of the cache.
26945 2002-05-15 Miguel de Icaza <miguel@ximian.com>
26947 * attribute.cs: Remove the hack to handle the CharSet property on
26950 2002-05-14 Miguel de Icaza <miguel@ximian.com>
26952 * attribute.cs (DoResolve): More uglyness, we now only try to
26953 resolve the attribute partially, to extract the CharSet
26954 information (only if we are a StructLayout attribute). Otherwise
26956 (GetExtraTypeInfo): Add some code to conditionally kill in the
26957 future this. I am more and more convinced that the .NET
26958 framework has special code to handle the attribute setting on
26961 * expression.cs (IsParamsMethodApplicable): Revert my previous
26962 foreach change here, it was wrong.
26964 2002-05-13 Miguel de Icaza <miguel@ximian.com>
26966 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
26967 (pp_expr): do not abort on unknown input, just return.
26968 (eval): abort if there are pending chars.
26970 * attribute.cs (Attribute.Resolve): Positional parameters are
26971 optional. Deal with that case.
26973 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
26974 the Ansi/Unicode/Auto information for the type.
26976 (TypeContainer.DefineType): instantiate the EmitContext here, as
26977 we will be using it during the type definition (to resolve
26978 attributes) and during the emit phase.
26980 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
26981 to pull type information out of the attributes
26983 (Attribute.Resolve): track the constructor builder, and allow for
26984 multiple invocations (structs and classes will use this).
26986 * ecore.cs (MemberLookupFinal): new version with all the
26987 parameters customizable.
26989 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
26990 constructors. Return if the result value is null (as the error
26991 would have been flagged already by MemberLookupFinal)
26993 Do not allow instances of abstract classes or interfaces to be
26996 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
26997 We have to compare the assembly property here when dealing with
26998 FamANDAssem and Assembly access modifiers, because we might be
26999 creating an assembly from *modules* (that means that we are not
27000 getting TypeBuilders for types defined in other modules that are
27001 part of this assembly).
27003 (Method.Emit): If the method is marked abstract and has a body,
27006 (TypeContainer.DefineMembers): If both the defined member and the
27007 parent name match are methods, then do not emit any warnings: let
27008 the Method.Define routine take care of flagging warnings. But if
27009 there is a mismatch (method overrides something else, or method is
27010 overriwritten by something, then emit warning).
27012 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
27013 set to null, this means `do not check for the return type on the
27016 (Method.Define): set the return type for the method signature to
27017 null, so that we get methods with the same name and parameters and
27018 different return types. This is used to flag warning 114 (you are
27019 hiding a method, and you probably want to use the new/override
27022 * typemanager.cs (MemberLookup): Implemented proper access
27023 control, closing a long standing set of bug reports. The problem
27024 was that the Framework only has two bits: Public and NonPublic,
27025 and NonPublic includes private and protected methods, but we need
27026 to enforce the FamANDAssem, FamOrAssem and Family.
27028 2002-05-11 Miguel de Icaza <miguel@ximian.com>
27030 * statement.cs (GotoCase): Return true: Ammounts to giving up
27031 knowledge on whether we return or not, and letting the other case
27032 be responsible for it.
27034 2002-05-10 Miguel de Icaza <miguel@ximian.com>
27036 * driver.cs: Do not load directories for each file processed, only
27037 do it if there is a pattern.
27039 * ecore.cs: Report readonly assigns here as well, as we might have
27040 been resolved only by MemberAccess.
27042 (SimpleName.SimpleNameResolve): Also be useful for LValue
27043 resolution. We need this to propagate assign to local readonly variables
27045 * typemanager.cs: Use a ptrhashtable for the criteria, because we
27046 do not want to reuse potential criteria memory.
27048 * class.cs (MyEventBuilder): Set reflected_type;
27050 * ecore.cs (Constantify): Added support for constifying bools.
27052 (RootContext.LookupType): Added a cache for values looked up in
27053 the declaration space.
27055 * typemanager.cs (FindMembers): Now is a front-end to
27056 RealFindMembers, and provides a two-level hashtable-based cache to
27059 15% performance improvement: from 22.5 to 19.2 seconds.
27061 * expression.cs (IsParamsMethodApplicable): use foreach.
27062 (Invocation.DoResolve): ditto.
27063 (New.DoResolve): ditto.
27064 (ArrayCreation.DoResolve): ditto.
27066 * ecore.cs (FindMostEncompassingType): use foreach.
27068 * delegate.cs (NewDelegate.DoResolve): Use foreach
27070 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
27071 (RemoveMethods): use foreach.
27073 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
27074 nested foreach statements instead of for, and also break out of
27075 the inner loop once a match is found.
27077 (Invocation.OverloadResolve): Use foreach, simplify the code.
27079 2002-05-08 Miguel de Icaza <miguel@ximian.com>
27081 * cfold.cs (BinaryFold): During an enumeration evaluation context,
27082 we actually unwrap the expression to allow for extra information
27085 * expression.cs: Use Shr_Un on unsigned operations.
27087 2002-05-08 Ravi Pratap <ravi@ximian.com>
27089 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
27090 applicable operators was not being considered correctly. This closes
27091 the bug Miguel reported.
27093 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
27095 * attribute.cs: check that the type derives from System.Attribute
27096 and report the correct error in that case (moved the duplicate code to
27097 its own method, too).
27099 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
27101 * attribute.cs: lookup attribute type name as the spec says: first the
27102 bare attribute name and then name + "Attribute" (nant compiles with
27103 mcs after this fix).
27105 2002-05-07 Miguel de Icaza <miguel@ximian.com>
27107 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
27108 Because of the way we parse things, we should try to see if a
27109 UIntConstant can fit in an integer.
27111 2002-05-07 Ravi Pratap <ravi@ximian.com>
27113 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
27114 when we are in an explicit context.
27116 (ConvertReferenceExplicit): When converting from Iface type S to Class
27117 T make sure the rules are implemented as an OR.
27119 * parameter.cs (ParameterType): Make it a property for now although the
27120 purpose really isn't anything immediate.
27122 * expression.cs (Is*Applicable): Do better checking on the parameter type
27123 of a ref/out parameter. The ones from the system assemblies are already
27124 marked with the correct type so we don't need to do any correction.
27126 * ecore.cs (StandardConversionExists): Conversion from Interface types to
27127 the object type is standard too so include that.
27129 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27131 * ecore.cs (StandardConversionExists): Augment with missing code:
27132 deal with IntConstant, LongConstants and Enumerations.
27134 * assign.cs: Report the error, instead of failing silently
27136 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
27137 typecontainer that they are declared, because the
27138 typecontainer/namespace will have the list of using clauses that
27139 need to be applied.
27141 Assembly Attributes were escaping the normal registration
27144 (EmitCode): Apply attributes within an EmitContext that represents
27145 the container they were declared on.
27147 * cs-parser.jay: Track bases for structs. How did I get this wrong?
27149 2002-05-06 Ravi Pratap <ravi@ximian.com>
27151 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
27152 Revamp completely - make much cleaner as we now operate only
27155 (FindMostSpecificSource, FindMostSpecificTarget): New methods
27156 to implement the logic detailed in the spec more correctly.
27158 (UserDefinedConversion): Update accordingly.
27160 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27162 * statement.cs: Return flow analysis information up.
27164 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
27167 (token): Do not consume an extra character before calling
27170 2002-05-06 Piers Haken <piersh@friskit.com>
27172 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
27174 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27176 * class.cs (Constructor.Emit): Set the IsStatic flag in the
27177 EmitContext during the instance constructor initializer
27178 resolution, to stop access to instance variables.
27180 This is mandated by the spec, last paragraph of the `constructor
27181 initializers' section.
27183 2002-05-05 Miguel de Icaza <miguel@ximian.com>
27185 * cs-parser.jay, class.cs (Accessor): new class used to represent
27186 an accessor (get or set). In the past we used `null' to represent
27187 a missing accessor. But this is ambiguous because there was no
27188 way to tell in abstract indexers/properties if one of them was
27191 Now there is a way of addressing that.
27193 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
27194 instead of FindMembers.
27196 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
27197 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
27199 * attribute.cs: Treat indexers and properties as the same in terms
27200 of applying attributes
27202 * ecore.cs (FindMostEncompassedType): Use statically initialized
27203 EmptyExpressions()s like we do elsewhere to avoid creating useless
27204 objects (and we take this out of the tight loop).
27206 (GetConversionOperators): Move the code to extract the actual
27207 operators to a separate routine to clean things up.
27209 2002-05-04 Miguel de Icaza <miguel@ximian.com>
27211 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
27212 events are always registered FieldBuilders.
27214 * class.cs (FieldBase): New class shared by Fields
27216 * delegate.cs: If we are a toplevel delegate, use our full name.
27217 If we are a nested delegate, then only use our tail name.
27219 2002-05-02 Ravi Pratap <ravi@ximian.com>
27221 * expression.cs (IsApplicable): Ensure that we add the "&" to
27222 ref/out types before comparing it with the type of the argument.
27224 (IsParamsMethodApplicable): Ditto.
27226 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
27229 * delegate.cs : Handle the case when we have more than one applicable
27230 method. Flag an error only when we finish checking all.
27232 2002-05-02 Miguel de Icaza <miguel@ximian.com>
27234 * expression.cs: Add support for boolean static initializers.
27236 2002-05-01 Miguel de Icaza <miguel@ximian.com>
27238 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
27240 * parameter.cs (ComputeParameterTypes,
27241 ComputeAndDefineParameterTypes): Better error handling: now we
27242 clear the `types' cache if we fail during any of the type lookups.
27243 We also return the status code correctly to our caller
27245 * delegate.cs: If we fail to define a delegate, abort the extra
27248 * expression.cs (Binary.ResolveOperator): for
27249 operator==(object,object) and operator !=(object, object) we also
27250 have to verify that there is an implicit conversion from one to
27253 (ArrayAccess.DoResolve): Array Access can operate on
27256 2002-04-30 Miguel de Icaza <miguel@ximian.com>
27258 * assign.cs (CompoundAssign): A new class used as a "flag" that
27259 the assignment actually is happening as part of a compound
27260 assignment operator.
27262 During compound assignment, a few new rules exist to enable things
27269 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
27270 to the type of x) if y is implicitly convertible to the type of x,
27271 and the operator is a builtin operator and the return type of the
27272 operator is explicitly convertible to the type of x.
27274 * rootcontext.cs: Reset warning level to 2. 4 catches various
27275 "interesting" features in mcs, we must clean this up at some
27276 point, but currently am trying to kill other bugs ;-)
27278 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
27279 in container classes as well.
27281 * expression.cs (Binary.ResolveOperator): Handle string case
27282 before anything else (as operator overloading does emit an error
27283 before doing anything else).
27285 This code could go away when we move to a table driven model, but
27286 i could not come up with a good plan last night.
27288 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
27290 * typemanager.cs (CSharpName): reimplementation using regex.
27291 * class.cs: added null check for fields in Emit
27292 * rootcontext.cs: set warninglevel to 4
27294 2002-04-29 Miguel de Icaza <miguel@ximian.com>
27296 * typemanager.cs (CSharpName): reimplemented with Lupus
27299 2002-04-28 Miguel de Icaza <miguel@ximian.com>
27301 * statement.cs (If): correclty implement Resolve, because we were
27302 not catching sem errors in there. The same process is needed
27304 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
27307 (Statement.Warning_DeadCodeFound): Factorize code.
27308 (While): Report dead code here too.
27310 (Statement): Added Resolve virtual method to allow
27311 for resolution split from the emit code.
27313 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27315 * statement.cs (EmitBoolExpression): No longer try to resolve the
27317 (MakeBoolean): New utility function that resolve, implicitly
27318 converts to boolean and tags the expression.
27321 (If, Do): Implement dead code elimination.
27322 (While): Implement loop inversion
27324 (Do, While, For, If): Resolve the expression prior to calling our
27327 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
27330 - added method Report28 (warning: program has more than one entry point)
27331 - added method IsEntryPoint, implements paragraph 10.1 of the spec
27332 - modified method Method.Define, the part at the end of the method
27334 * rootcontext.cs: added static public Location EntryPointLocation;
27336 * ../errors/cs0028.cs : Add test case for the above warning.
27339 - modified method CSharpName to allow arrays of primitive type to
27340 be printed nicely (e.g. instead of System.Int32[][] it now prints
27342 - added method CSharpSignature: returns the signature of a method
27343 in string format to be used in reporting errors, warnings, etc.
27345 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
27348 2002-04-26 Ravi Pratap <ravi@ximian.com>
27350 * delegate.cs (Define): Fix extremely silly bug where I was
27351 setting the type of the 'object' parameter of the BeginInvoke
27352 method to System.IAsyncResult instead of System.Object ;-)
27354 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27356 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
27359 (Constructor.Emit): return if we fail to initialize the
27360 constructor. Another door closed!
27362 * expression.cs (New.DoResolve): Improve error message (from -6 to
27363 1501). Use DeclaredOnly lookup to find the exact constructor.
27365 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
27366 loop. This is useful.
27368 * cs-parser.jay: Adjust the default parameters so that destructors
27369 have the proper signature.
27371 2002-04-26 Martin Baulig <martin@gnome.org>
27373 * driver.cs (LoadAssembly): If `assembly' contains any characters
27374 which are only valid in path names and not in assembly names
27375 (currently slash, backslash and point), use Assembly.LoadFrom ()
27376 instead of Assembly.Load () on the `assembly' (before iteration
27377 over the link_paths).
27379 2002-04-26 Martin Baulig <martin@gnome.org>
27381 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
27383 2002-04-25 Miguel de Icaza <miguel@ximian.com>
27385 * class.cs (Property): use the new typemanager.MemberLookup
27387 (TypeContainer.MemberLookup): Implement using the
27388 TypeManager.MemberLookup now.
27390 * typemanager.cs: Make MemberLookup a function of the TypeManager,
27391 and return MemberInfos, so that these can be used without an
27392 EmitContext (what we had before).
27394 2002-04-24 Miguel de Icaza <miguel@ximian.com>
27396 * expression.cs: Fix the case where the argument to params if the
27397 type of the params. I omitted handling this before. Fixed
27399 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27401 * driver.cs: Call BootCorlib_PopulateCoreType
27403 * class.cs (Property.CheckBase): Check for properties only, not
27406 * interface.cs: Temporary hack: try/catch around the
27407 CustomAttributeBuilder, because I am getting an exception that I
27410 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
27411 types whose definitions are required to be there (attributes are
27412 defined before standard types).
27414 Compute definitions as we boot the various types, as they are used
27415 immediately (value_type class will need object_type, but if we do
27416 not initialize object_type, we will pass a null, which will let
27417 the runtime pick the System.Object from the existing corlib, which
27418 is not what we want).
27420 2002-04-22 Patrik Torstensson <totte@labs2.com>
27422 * cs-tokenizer.cs: fixed a number of trim() issues.
27424 2002-04-22 Ravi Pratap <ravi@ximian.com>
27426 * expression.cs (Argument.Type): Ensure that we return the correct
27427 type when we have out or ref parameters [in which case we
27430 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27432 * class.cs (Property, Indexer): Allow extern modifier in there.
27434 * typemanager.cs (InitBaseTypes): Initializes object_type and
27435 value_type, since those will be used early on during the bootstrap
27436 process to compile corlib.
27438 (InitCoreTypes): Move code from here to InitBaseTypes.
27440 2002-04-21 Miguel de Icaza <miguel@ximian.com>
27442 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
27443 single-dimension arrays as using the ldlen opcode.
27445 Daniel Lewis discovered this optimization.
27447 * typemanager.cs: Add signature for System.Array::get_Length
27449 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27451 * statement.cs: report the error when the foreach does not apply to an
27452 array nor a collection.
27454 2002-04-19 Miguel de Icaza <miguel@ximian.com>
27456 * expression.cs: Add implicit conversions to the operator ~.
27458 * constant.cs (DecimalConstant.Emit): Emit decimal value.
27460 * typemanager.cs: Locate the decimal constructor.
27462 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27464 * attribute.cs: use the new property of TypeOf.
27465 * expression.cs: added 'get' property around typearg.
27467 These changes fix a build breaker reported by NickD. Is this the
27468 correct way to fix? If not, please, revert my changes and make it
27471 2002-04-17 Miguel de Icaza <miguel@ximian.com>
27473 * attribute.cs: Add support for typeof in attribute invocations.
27474 I am not sure that this is right though.
27476 2002-04-14 Duncan Mak <duncan@ximian.com>
27478 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
27479 Binary.Operator.Division case.
27481 2002-04-13 Ravi Pratap <ravi@ximian.com>
27483 * class.cs (DefineType): Ensure that we do a proper check on
27484 attribute types and also register it with the TypeManager.
27486 (TypeContainer.Targets): The default for attribute types is
27487 AttributeTargets.All.
27489 * attribute.cs (ApplyAttributes): Registering the attribute type
27490 is done elsewhere, not when we discover we have a Usage attribute.
27492 2002-04-12 Ravi Pratap <ravi@ximian.com>
27494 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
27495 and get rid of is_delegate parameter.
27497 * everywhere : update.
27499 2002-04-12 Ravi Pratap <ravi@ximian.com>
27501 * cs-parser.jay (compilation_unit): Revamp completely to use
27502 some new ideas that I got from Rhys' grammar to solve the problems
27503 with assembly level attributes.
27505 (outer_declaration): New grammar production.
27507 (attribute_sections): Add.
27509 (opt_attributes): Base on attribute_sections
27511 (namespace_declaration): Allow opt_attributes to tackle the case
27512 when we have assembly level attributes - we are clever in this
27515 * attribute.cs (ApplyAttributes): Do not worry about assembly
27516 attributes in the non-global context.
27518 * rootcontext.cs (AddGlobalAttributes): Go back to using this
27519 instead of SetGlobalAttributes.
27521 * class.cs, rootcontext.cs : Ensure we define and generate
27522 attribute types before anything else.
27524 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
27525 and flag the new error -20 for the case when the attribute type
27526 does not have valid targets specified. csc does not catch this.
27528 * ../errors/errors.txt : update for error # -20
27530 2002-04-11 Ravi Pratap <ravi@ximian.com>
27532 * support.cs (InternalParameters.ParameterModifier): Do some null
27533 checking and return sane values.
27535 * class.cs (Method.Define): If we are a PInvoke method, ensure
27536 that we are static and extern. Report error # 601
27538 * ../errors/cs0601.cs : Add test case for the above error.
27540 2002-04-07 Ravi Pratap <ravi@ximian.com>
27542 * rootcontext.cs (attribute_types): We need to keep type of
27543 all attribute types separately and emit code for them first.
27545 (RegisterAttribute) : Implement.
27547 * class.cs (DefineType): Check if the current Type is a custom
27548 attribute type and register it accordingly.
27550 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
27551 adding the first attribute twice and rename to
27553 (SetGlobalAttributes): this.
27555 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
27558 * attribute.cs (ApplyAttributes): Take an additional argument telling us
27559 if we are processing global arguments. Hmm, I am unsure of this.
27561 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27563 * expression.cs: added static array of strings to avoid calling
27564 Enum.ToString () for Operator in Binary. Significant recover of
27567 2002-04-10 Miguel de Icaza <miguel@ximian.com>
27569 * class.cs (FindMembers): Allow the Builders of the various
27570 members to be null. If they are skip them. This only happens
27571 during the PInvoke declaration.
27573 2002-04-09 Miguel de Icaza <miguel@ximian.com>
27575 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
27576 failure, so we do not keep going afterwards.
27578 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
27579 wanted to pass `false' as the `is_delegate' argument. If this is
27580 the case, why not use delegate_type == null to mean `is_delegate =
27581 false' and anything else as is_delegate = true.
27583 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
27585 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
27586 code for the section, not the beginning of the tests.
27588 2002-04-08 Miguel de Icaza <miguel@ximian.com>
27590 * cfold.cs: Handle operator + (Enum x, Underlying x)
27592 * expression.cs (Binary): same. Warn about errors where we have
27593 Enum/Enum in operator + as well.
27595 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
27598 - added support for switch(bool)
27599 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
27600 - add TableSwitchEmit() to handle table-based switch statements
27602 2002-04-05 Ravi Pratap <ravi@ximian.com>
27604 * expression.cs (Invocation.OverloadResolve): Factor out code which
27605 does parameter compatibility checking with arguments so that we can
27606 re-use the code even from Delegate.VerifyApplicability
27608 (VerifyArgumentsCompat): Move above code here.
27610 * delegate.cs (VerifyApplicability): Get rid of duplicate code
27611 and instead make a call to the above method.
27613 2002-03-31 Ravi Pratap <ravi@ximian.com>
27615 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
27616 We use it to keep track of classes which are attribute types.
27618 2002-04-02 Miguel de Icaza <miguel@ximian.com>
27620 * delegate.cs (Delegate.Define): Correctly define the types in the
27621 presence of fixed and array parameters.
27623 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
27626 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
27627 include NonPublic after the first iteration.
27629 * class.cs (Indexer.CheckBase): Only check if both parents are
27632 * cs-parser.jay (accessor_body): If empty, set to null.
27634 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
27635 same code path here to resolve constants names that we did have in
27636 MemberAccess.DoResolve. There is too much code duplicated here.
27638 2002-04-01 Miguel de Icaza <miguel@ximian.com>
27640 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
27642 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
27645 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
27646 tokens, numbers and strings.
27648 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
27651 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
27652 asyncronous parameters and the regular parameters.
27654 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
27655 specify the target directory.
27657 * expression.cs: (This.DoResolve): Simplify
27658 (As.Emit): Optimize, do not generate IsInst if the expression is
27659 always of the given type.
27661 (Is.DoResolve): Bug fix, we were reporting both always/never for
27664 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
27665 creating too many unnecessary arrays.
27667 2002-03-31 Miguel de Icaza <miguel@ximian.com>
27669 * class.cs (EmitFieldInitializer): Use Assign expression to assign
27670 fields instead of rolling our own initializer. Takes care of all
27671 implicit conversions, and drops unnecessary static checks/argument.
27673 2002-03-31 Dick Porter <dick@ximian.com>
27675 * driver.cs: use the GetDirectories() return values properly, and
27676 use "/" as path separator.
27678 2002-03-30 Miguel de Icaza <miguel@ximian.com>
27680 * expression.cs (Unary): Optimize - - expr into expr.
27681 (Binary): Optimize a + (-b) into a -b.
27683 * codegen.cs (CodeGen): Made all methods static.
27685 2002-03-29 Miguel de Icaza <miguel@ximian.com>
27689 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
27690 TypeBuilder property.
27692 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
27695 * tree.cs: Removed the various RecordXXXX, and replaced with a
27696 single RecordDecl. Removed all the accessor methods, and just
27697 left a single access point Type
27699 * enum.cs: Rename DefineEnum to DefineType.
27701 * decl.cs: New abstract method `DefineType' used to unify the
27702 Defines for Enumerations, Interfaces, TypeContainers and
27705 (FindType): Moved LookupInterfaceOrClass here. Moved the
27706 LookupBaseClasses method that used to live in class.cs and
27707 interface.cs here, and renamed to FindType.
27709 * delegate.cs: Implement DefineType. Take advantage of the
27710 refactored pattern for locating the parent builder without taking
27711 the parent_builder argument (which we know does not work if we are
27712 nested, and triggering a toplevel definition).
27714 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27716 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
27717 accessibility of a member has changed during override and report
27720 * class.cs (Method.Define, Property.Define): Only complain on
27721 overrides if the method is private, any other accessibility is
27722 fine (and since we just checked the permission is the same, we are
27725 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
27726 and elif are processed always. The other pre-processing
27727 directives are only processed if we are "taking" the path
27729 2002-03-29 Martin Baulig <martin@gnome.org>
27731 * class.cs (Method.Emit): Only emit symbolic debugging info if the
27732 current location is not Null.
27734 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
27735 a separate method so we can profile it.
27737 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
27738 `span.Seconds' are just seconds, but no minutes or hours.
27739 (MainDriver): Profile the CodeGen.SaveSymbols calls.
27741 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27743 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
27744 Remove the gratuitous set of Final:
27746 // If an interface implementation, then we can set Final.
27747 if (((flags & MethodAttributes.Abstract) == 0) &&
27748 implementing.DeclaringType.IsInterface)
27749 flags |= MethodAttributes.Final;
27751 I do not know what I was smoking when I used that.
27754 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
27755 step into fixing the name resolution issues for delegates and
27756 unifying the toplevel name resolution.
27758 2002-03-28 Martin Baulig <martin@gnome.org>
27760 * class.cs (Method.Emit): If we have a symbol writer, call its
27761 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
27762 tell it about the current method.
27764 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
27765 writer that we're going to emit the first byte of IL code for a new
27766 statement (a new source line).
27767 (EmitContext.EmitTopBlock): If we have a symbol writer, call
27768 EmitContext.Mark() before emitting any code.
27770 * location.cs (SymbolDocument): Return null when we're Null.
27772 * statement.cs (Statement): Moved the `Location loc' variable here.
27773 (Statement.EmitBoolExpression): If we have a symbol writer, call
27774 ec.Mark() before emitting any code to tell it that we're at the
27775 beginning of a new statement.
27776 (StatementExpression): Added `Location' argument to the constructor.
27777 (Block): Added public readonly variable `StartLocation' and public
27778 variable `EndLocation'. The latter is to be set using SetEndLocation().
27779 (Block): Added constructor which takes a start and end location.
27780 (Block.SetEndLocation): New method. This sets the end location.
27781 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
27782 local variables we create.
27783 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
27784 each statement and do also mark the begin and end of the block.
27786 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
27787 tell it the current lexer.Location, use Location.Null for the end of the
27789 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
27790 current block, set its end location using SetEndLocation().
27791 (statement_expression): StatementExpression constructor now takes the
27792 lexer.Location as additional argument.
27793 (for_statement, declare_local_variables): Likewise.
27794 (declare_local_variables): When creating a new implicit block, use the
27795 new Block constructor and pass it the lexer.Location.
27797 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27799 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
27800 members also on the parent interfaces recursively.
27802 2002-03-27 Miguel de Icaza <miguel@ximian.com>
27804 * report.cs: Use new formats, since Gonzalo finished the missing
27807 * expression.cs (Binary.ResolveOperator): added missing operator|
27808 operator& and operator^ for bool/bool.
27810 * cs-parser.jay: CheckDef now takes a Location argument that is
27811 used to report errors more precisly (instead of reporting the end
27812 of a definition, we try to track something which is a lot closer
27813 to the source of the problem).
27815 * cs-tokenizer.cs: Track global token use, so we can properly flag
27816 the use of #define/#undef after the first token has been seen.
27818 Also, rename the reportXXXX to Error_DescriptiveName
27820 * decl.cs (DeclSpace.IsTopLevel): Move property here from
27821 TypeContainer, so that Enum and Interface can use this too.
27823 * class.cs (TypeContainer.LookupInterfaceOrClass,
27824 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
27825 `builder' argument. Typically this was used to pass the parent
27826 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
27829 The problem is that a nested class could trigger the definition of
27830 a toplevel class, and the builder would be obviously wrong in that
27833 So we drop this argument, and we compute dynamically the
27834 TypeBuilder/ModuleBuilder (the correct information was available
27835 to us anyways from DeclSpace.Parent)
27837 * interface.cs (Interface.DefineInterface): Drop builder
27838 parameter cleanup like class.cs
27840 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
27843 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
27846 (Try.Emit): Propagate the returns value from the statement.
27848 (Return.Emit): Even if we are leavning
27850 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
27852 * modifiers.cs: Fix the computation of MethodAttributes flags.
27854 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
27856 * driver.cs: allow compilation of files that start with '/'.
27857 Add a default case when checking the argument of --target.
27859 2002-03-25 Miguel de Icaza <miguel@ximian.com>
27861 * interface.cs: Implement the same search algorithm for types in
27862 the interface code.
27864 * delegate.cs: Do not allow multiple definition.
27866 * Recovered ChangeLog that got accidentally amputated
27868 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
27870 * rootcontext.cs: Load manually enum to allow core classes to
27871 contain enumerations.
27873 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
27874 Update to new static methods in TypeManager.
27876 * typemanager.cs (GetMethod, GetConstructor): Use our
27877 implementation of FindMembers to find the members, since during
27878 corlib compilation, the types are TypeBuilders and GetMethod and
27879 GetConstructor do not work.
27881 Make all methods in TypeManager static.
27883 (InitCodeHelpers): Split the functionality from
27884 the InitCodeTypes function.
27886 * driver.cs: Call InitCodeHelpers after we have populated the
27889 * cs-parser.jay (delegate_declaration): we did not used to compute
27890 the delegate name correctly for void delegates.
27892 2002-03-24 Miguel de Icaza <miguel@ximian.com>
27894 * rootcontext.cs (RootContext): Init the interface_resolve_order
27895 and type_container_resolve_order always.
27897 (ResolveCore, BootstrapCorlib_ResolveClass,
27898 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
27899 compiler when compiling with --nostdlib
27901 * class.cs (TypeContainer.DefineType): Check that our parent is
27902 not null. This test is most important when we are bootstraping
27905 * codegen.cs: Split out the symbol writing code.
27907 2002-03-25 Martin Baulig <martin@gnome.org>
27909 * driver.cs (-g): Made -g an alias for --debug.
27911 2002-03-24 Martin Baulig <martin@gnome.org>
27913 * codegen.cs (SymbolWriter): New public variable. Returns the
27914 current symbol writer.
27915 (CodeGen): Added `bool want_debugging_support' argument to the
27916 constructor. If true, tell the ModuleBuild that we want debugging
27917 support and ask it for the ISymbolWriter.
27918 (Save): If we have a symbol writer, call it's Close() method after
27919 saving the assembly.
27921 * driver.c (--debug): New command line argument to create a
27922 debugger information file.
27924 * location.cs (SymbolDocument): New public property. Returns an
27925 ISymbolDocumentWriter object for the current source file or null
27926 if we don't have a symbol writer.
27928 2002-03-21 Miguel de Icaza <miguel@ximian.com>
27930 * driver.cs (LoadAssembly): Correctly return when all the paths
27931 have been tried and not before.
27933 * statement.cs (Switch.Emit): return the actual coverage for this
27934 statement (returns/not-returns)
27936 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
27937 switch of the statement if we are the last switch section. That
27938 kills two problems: try/catch problems (we used to emit an empty
27939 nop at the end) and switch statements where all branches would
27942 2002-03-19 Miguel de Icaza <miguel@ximian.com>
27944 * driver.cs: Add default assemblies (the equivalent to the
27945 Microsoft CSC.RSP file)
27947 * cs-tokenizer.cs: When updating `cols and setting it to zero,
27948 also update tokens_seen and set it to false.
27950 * driver.cs: Implement --recurse for Mike.
27952 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
27953 correctly splitting out the paths.
27955 2002-03-18 Miguel de Icaza <miguel@ximian.com>
27957 * interface.cs (Interface.PopulateProperty): Instead of using
27958 `parent' as the declaration space for the set parameters, use
27961 * support.cs (InternalParameters): InternalParameters constructor
27962 takes a DeclSpace instead of a TypeContainer.
27964 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
27965 types are being initialized, load the address of it before calling
27968 (New): Provide a mechanism to disable the generation of local
27969 value type temporaries when the caller will be providing us with
27970 an address to store it.
27972 (ArrayCreation.EmitDynamicInitializers): Use it.
27974 2002-03-17 Miguel de Icaza <miguel@ximian.com>
27976 * expression.cs (Invocation.EmitArguments): Only probe for array
27977 property if there is more than one argument. Sorry about that.
27979 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
27980 empty param arrays.
27982 * class.cs (Method.LabelParameters): Fix incorrect code path that
27983 prevented the `ParamArrayAttribute' from being applied to the
27986 2002-03-16 Miguel de Icaza <miguel@ximian.com>
27988 * support.cs (ReflectionParameters): Correctly compute whether the
27989 last argument is a params array. Fixes the problem with
27992 * typemanager.cs: Make the assemblies array always be non-null
27993 (empty, but non-null)
27995 * tree.cs (RecordDecl): New function that abstracts the recording
27996 of names. This reports error 101, and provides a pointer to the
27997 previous declaration. Fixes a crash in the compiler.
27999 * cs-parser.jay (constructor_declaration): Update to new grammar,
28000 and provide a constructor_body that can be empty.
28002 2002-03-15 Miguel de Icaza <miguel@ximian.com>
28004 * driver.cs: Add support for --resources.
28006 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
28007 Make all types for the various array helper methods be integer.
28009 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
28010 CheckState to ConvCast.
28012 (ConvCast): Now it takes a `checked' state argument, to avoid
28013 depending on the emit context for the conversion, and just using
28014 the resolve time setting.
28016 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
28017 instead of Invocation.EmitArguments. We do not emit the original
28018 arguments, instead we emit those which have been converted to
28019 unsigned int expressions.
28021 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
28023 * codegen.cs: ditto.
28025 * expression.cs (LocalVariableReference): Drop the use of the
28026 Store function that depended on the variable index.
28028 * statement.cs (VariableInfo): Drop the `Idx' property from this
28029 class, as this is not taking into account the indexes for
28030 temporaries tat we generate during the execution, getting the
28033 * class.cs: First emit class initializers, then call the parent
28036 * expression.cs (Binary): Fix opcode emision.
28037 (UnaryMutator.EmitCode): Support checked code generation
28039 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
28040 matches for events for both the Static and Instance scans,
28041 pointing to the same element. Fix that.
28043 2002-03-14 Miguel de Icaza <miguel@ximian.com>
28045 * rootcontext.cs (ResolveTree): Always set the
28046 interface_resolve_order, because nested interfaces will be calling
28049 * class.cs (GetInterfaceOrClass): Track the same resolution
28050 process used by TypeManager.LookupType. This fixes the nested
28051 type lookups in class declarations (separate path from
28054 (TypeContainer.DefineType): Also define nested interfaces.
28055 (TypeContainer.RegisterOrder): New public function used to
28056 register the order in which child interfaces need to be closed.
28058 Nested interfaces need to be closed after their parents have been
28061 * interface.cs (InterfaceAttr): Put all the logic for computing
28062 the interface attribute here.
28064 (DefineInterface): Register our interface order with the
28065 RootContext or with the TypeContainer depending on the case.
28067 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28069 * cs-parser.jay: rework foreach statement to work with the new
28070 changes to the policy on SimpleNames.
28072 * report.cs: support Stacktrace on warnings as well.
28074 * makefile: drop --unsafe and /unsafe from the compile.
28076 2002-03-13 Ravi Pratap <ravi@ximian.com>
28078 * ecore.cs (StandardConversionExists): Modify to take an Expression
28079 as the first parameter. Ensure we do null -> reference type conversion
28082 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
28083 temporary Expression objects.
28085 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
28087 * interface.cs: workaround bug in method overloading resolution
28088 (there is already a bugzilla bug for it).
28090 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28092 We could also solve this problem by having a separate path for
28093 performing type lookups, instead of DoResolve, we could have a
28094 ResolveType entry point, and only participating pieces of the
28095 production (simplename, deref, array) would implement this.
28097 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
28098 signal SimpleName to only resolve type names and not attempt to
28099 resolve anything else.
28101 * expression.cs (Cast): Set the flag.
28103 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
28105 * class.cs: Only report 108 if there is no `new' modifier.
28107 * cs-parser.jay: rework foreach statement to work with the new
28108 changes to the policy on SimpleNames.
28110 * report.cs: support Stacktrace on warnings as well.
28112 * makefile: drop --unsafe and /unsafe from the compile.
28114 2002-03-11 Miguel de Icaza <miguel@ximian.com>
28116 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28117 lookups here, instead of doing that at parse time. This means
28118 that our grammar will not introduce `LocalVariableReferences' as
28119 expressions at this point. That solves the problem of code like
28123 static void Main ()
28127 This is only half the fix. The full fix requires parameters to
28128 also be handled in this way.
28130 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
28131 makes the use more obvious of the DeclSpace. The
28132 ec.TypeContainer.TypeBuilder is now only used to pull the
28133 TypeBuilder for it.
28135 My theory is that I can get rid of the TypeBuilder completely from
28136 the EmitContext, and have typecasts where it is used (from
28137 DeclSpace to where it matters).
28139 The only pending problem is that the code that implements Aliases
28140 is on TypeContainer, and probably should go in DeclSpace.
28142 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28143 lookups here, instead of doing that at parse time. This means
28144 that our grammar will not introduce `LocalVariableReferences' as
28145 expressions at this point. That solves the problem of code like
28149 static void Main ()
28153 This is only half the fix. The full fix requires parameters to
28154 also be handled in this way.
28156 * class.cs (Property.DefineMethod): When implementing an interface
28157 method, set newslot, when implementing an abstract method, do not
28158 set the flag (before we tried never setting it, or always setting
28159 it, which is the difference).
28160 (Indexer.DefineMethod): same.
28161 (Method.DefineMethod): same.
28163 * ecore.cs: Only set the status used flag if we get back a Field.
28165 * attribute.cs: Temporary hack, so Paolo can keep working.
28167 2002-03-08 Ravi Pratap <ravi@ximian.com>
28169 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
28170 the unmanaged type in the case we have a MarshalAs attribute.
28172 (Resolve): Handle the case when we are parsing the special MarshalAs
28173 attribute [we need to store the unmanaged type to use later]
28175 * typemanager.cs (marshal_as_attr_type): Built in type for the
28176 MarshalAs Attribute.
28178 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
28179 on parameters and accordingly set the marshalling info.
28181 2002-03-09 Miguel de Icaza <miguel@ximian.com>
28183 * class.cs: Optimizing slightly by removing redundant code after
28184 we switched to the `NoTypes' return value.
28185 (Property.DefineMethod): use NoTypes here too.
28187 This fixes the bug I introduced in my last batch of changes.
28189 2002-03-05 Ravi Pratap <ravi@ximian.com>
28191 * tree.cs (RecordEnum): Add. We now keep track of enums too.
28193 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
28194 Enums since those are types too.
28196 * cs-parser.jay (enum_declaration): Record enums as we parse them.
28198 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
28199 thanks to a call during the lookup process.
28201 2002-03-07 Miguel de Icaza <miguel@ximian.com>
28203 * statement.cs (Foreach): Lots of work to accomodate a particular
28204 kind of foreach statement that I had not kept in mind. It is
28205 possible to have foreachs on classes that provide a GetEnumerator
28206 method that return objects that implement the "pattern" for using
28207 a foreach, there is no need to support GetEnumerator
28210 This is needed to compile nant.
28212 * decl.cs: Only report 114 if the member is not `Finalize' and if
28213 the warning level is at least 2.
28215 * class.cs: Moved the compare function from Method to
28218 (MethodSignature.InheritableMemberSignatureCompare): Add new
28219 filter function that is used to extract inheritable methods from a
28222 (Method.Define): Use the new `inheritable_method_signature_filter'
28225 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
28228 2002-03-06 Miguel de Icaza <miguel@ximian.com>
28230 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
28232 * cs-parser.jay: Add opt_semicolon to the interface declaration.
28234 * expression.cs: Pass location information to
28235 ConvertImplicitStandard.
28237 * class.cs: Added debugging code to track return values from
28240 2002-03-05 Miguel de Icaza <miguel@ximian.com>
28242 * expression.cs (Is.DoResolve): If either side of the `is' is an
28243 interface, do not flag the warning.
28245 * ecore.cs (ImplicitReferenceConversion): We need a separate test
28248 * report.cs: Allow for --fatal to be used with --probe.
28250 * typemanager.cs (NoTypes): Move the definition for the empty Type
28253 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
28255 (TypeContainer.DefineProxy): New function used to proxy to parent
28256 implementations when implementing interfaces.
28257 (TypeContainer.ParentImplements): used to lookup if our parent
28258 implements a public function that is required by an interface.
28259 (TypeContainer.VerifyPendingMethods): Hook this up.
28261 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
28262 `modules' and `assemblies' arraylists into arrays. We only grow
28263 these are the very early start up of the program, so this improves
28264 the speedof LookupType (nicely measured).
28266 * expression.cs (MakeByteBlob): Replaced unsafe code with
28267 BitConverter, as suggested by Paolo.
28269 * cfold.cs (ConstantFold.Binary): Special case: perform constant
28270 folding of string concatenation, but if either side is a string,
28271 and the other is not, then return null, and let the runtime use
28272 the concatenation on the string plus the object (using
28273 `Object.ToString').
28275 2002-03-04 Miguel de Icaza <miguel@ximian.com>
28277 Constant Folding has been implemented now.
28279 * expression.cs (Unary.Reduce): Do not throw an exception, catch
28280 the error instead on types that are not supported in one's
28283 * constant.cs (Constant and all children): New set of functions to
28284 perform implict and explicit conversions.
28286 * ecore.cs (EnumConstant): Implement the new functions to perform
28287 conversion by proxying to the child expression.
28289 * codegen.cs: (ConstantCheckState): Constant evaluation has its
28290 own separate setting that can not be turned off from the command
28291 line using --unchecked or --checked and is only controlled using
28292 the checked/unchecked statements and expressions. This setting is
28293 used by the constant folder to flag errors.
28295 * expression.cs (CheckedExpr, UncheckedExpr): Set the
28296 ConstantCheckState as well.
28298 During Resolve, they also have to flag the state, because the
28299 constant folder runs completely in the Resolve phase.
28301 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
28304 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28306 * cfold.cs: New file, this file contains the constant folder.
28308 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
28309 argument to track whether we are using the resulting address to
28310 load or store a value and provide better error messages.
28312 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
28313 new AddressOf arguments.
28315 * statement.cs (Foreach.EmitCollectionForeach): Update
28317 * expression.cs (Argument.Emit): Call AddressOf with proper
28318 arguments to track usage.
28320 (New.DoEmit): Call AddressOf with new arguments.
28322 (Unary.Emit): Adjust AddressOf call.
28324 2002-03-01 Ravi Pratap <ravi@ximian.com>
28326 * cs-parser.jay (member_access): Change the case for pre-defined types
28327 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
28330 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
28333 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
28334 essentially like methods and apply attributes like MethodImplOptions to them too.
28336 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
28339 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
28340 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
28343 * Update code everywhere accordingly.
28345 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
28347 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
28349 2002-02-28 Ravi Pratap <ravi@ximian.com>
28351 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
28352 try performing lookups against those instead of jumping straight into using
28353 the 'using' clauses.
28355 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
28357 (LookupType): Perform lookups in implicit parents too.
28359 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
28360 sequence as RootContext.LookupType.
28362 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
28363 the various cases of namespace lookups into this method.
28365 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28367 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
28368 in positional arguments)
28370 * class.cs (Operator): Update the AllowedModifiers to contain
28373 * cs-parser.jay: Update operator declaration to allow for the
28374 operator body to be empty.
28376 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
28379 2002-02-27 Miguel de Icaza <miguel@ximian.com>
28381 * class.cs (Method.Emit): Label parameters.
28383 * driver.cs: Return 1 or 0 as the program exit code.
28385 2002-02-26 Miguel de Icaza <miguel@ximian.com>
28387 * expression.cs: Special case the `null' object when trying to
28388 auto-compute the type, as anything can be explicitly converted to
28391 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
28392 spotting this Paolo.
28394 (Expression.ImplicitNumericConversion): Perform comparissions of
28395 the type using the underlying type in the case of an enumeration
28396 rather than using the enumeration type for the compare.
28398 Cope with the underlying == type case, which is not possible to
28401 (Expression.ConvertNumericExplicit): Perform comparissions of
28402 the type using the underlying type in the case of an enumeration
28403 rather than using the enumeration type for the compare.
28405 * driver.cs: If the user does not supply an extension, assume .exe
28407 * cs-parser.jay (if_statement): Rewrote so that we can track the
28408 location for the if statement.
28410 * expression.cs (Binary.ConstantFold): Only concat strings when
28411 the operation is "+", not everything ;-)
28413 * statement.cs (Statement.EmitBoolExpression): Take a location
28415 (If, While, Do): Track location.
28417 * expression.cs (Binary.ResolveOperator): In the object + string
28418 case, I was missing a call to ConvertImplicit
28420 2002-02-25 Ravi Pratap <ravi@ximian.com>
28422 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
28423 Location arguments. Ensure we use RootContext.LookupType to do our work
28424 and not try to do a direct Type.GetType and ModuleBuilder.GetType
28426 * interface.cs (PopulateMethod): Handle the type of the parameter being
28429 * expression.cs (Invocation.BetterFunction): Handle the case when we
28430 have a params method with no fixed arguments and a call is made with no
28433 2002-02-25 Miguel de Icaza <miguel@ximian.com>
28435 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
28436 the verbatim-string-literal
28438 * support.cs (InternalParameters.ParameterModifier): handle null
28440 (InternalParameters.ParameterType): ditto.
28442 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
28443 duplicating the name of the variable parameter.
28444 (GetParameterByName): Fix bug where we were not looking up array
28445 paramters if they were the only present (thanks Paolo!).
28446 (GetParameterInfo): We only have an empty set of types if both
28447 fixed and array are set to null.
28448 (GetParameterInfo-idx): Handle FixedParameter == null
28450 * cs-parser.jay: Handle the case where there is no catch
28451 statements (missing null test).
28453 2002-02-22 Miguel de Icaza <miguel@ximian.com>
28455 * driver.cs (MainDriver): Be conservative on our command line
28458 Catch DirectoryNotFoundException when calling GetFiles.
28460 (SplitPathAndPattern): Used to split the input specification into
28461 a path and a pattern that we can feed to Directory.GetFiles.
28463 2002-02-21 Miguel de Icaza <miguel@ximian.com>
28465 * statement.cs (Fixed): Implement the last case of the Fixed
28466 statement (string handling).
28468 * expression.cs (StringPtr): New class used to return a char * to
28469 a string; Used by the Fixed statement.
28471 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
28473 * expression.cs (Binary.ResolveOperator): Remove redundant
28474 MemberLookup pn parent type.
28475 Optimize union call, we do not need a union if the types are the same.
28476 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
28479 Specialize the use of MemberLookup everywhere, instead of using
28480 the default settings.
28482 (StackAlloc): Implement stackalloc keyword.
28484 * cs-parser.jay: Add rule to parse stackalloc.
28486 * driver.cs: Handle /h, /help, /?
28488 * expression.cs (MakeByteBlob): Removed the hacks we had in place
28489 before we supported unsafe code.
28491 * makefile: add --unsafe to the self compilation of mcs.
28493 2002-02-20 Miguel de Icaza <miguel@ximian.com>
28495 * expression.cs (PointerArithmetic): New class that is used to
28496 perform pointer arithmetic.
28497 (Binary.Resolve): Handle pointer arithmetic
28498 Handle pointer comparission.
28499 (ArrayPtr): Utility expression class that is used to take the
28500 address of an array.
28502 (ElementAccess): Implement array access for pointers
28504 * statement.cs (Fixed): Implement fixed statement for arrays, we
28505 are missing one more case before we are done.
28507 * expression.cs (Indirection): Implement EmitAssign and set the
28508 ExprClass to Variable. This allows pointer dereferences to be
28509 treated as variables, and to have values assigned to them.
28511 * ecore.cs (Expression.StoreFromPtr): New utility function to
28512 store values dereferencing.
28514 2002-02-20 Ravi Pratap <ravi@ximian.com>
28516 * expression.cs (Binary.ResolveOperator): Ensure that we are
28517 not trying to operate on a void type - this fixes the reported
28520 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
28521 the parent implementation is sealed.
28523 * ../errors/cs0239.cs : Add.
28525 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
28527 * typemanager.cs (unverifiable_code_type): Corresponds to
28528 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
28529 which have unsafe code in them.
28531 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
28534 2002-02-19 Miguel de Icaza <miguel@ximian.com>
28536 * cs-tokenizer.cs: Add support for @"litreal strings"
28538 Make tokenizer accept pre-processor directives
28539 on any column (remove the old C-like limitation).
28541 * rootcontext.cs (EmitCode): Emit any global attributes.
28542 (AddGlobalAttributes): Used to keep track of assembly attributes.
28544 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
28546 * cs-parser.jay: Add support for global attributes.
28548 2002-02-17 Miguel de Icaza <miguel@ximian.com>
28550 * expression.cs (Indirection): New helper class. Unary will
28551 create Indirection classes to be able to implement the
28552 IMemoryLocation interface on it.
28554 2002-02-16 Miguel de Icaza <miguel@ximian.com>
28556 * cs-parser.jay (fixed_statement): reference the right statement.
28558 * statement.cs (Fixed.Emit): Finish implementing the fixed
28559 statement for the &x case.
28561 2002-02-14 Miguel de Icaza <miguel@ximian.com>
28563 * class.cs (Property.Define, Method.Define): Remove newslot when
28566 * modifiers.cs: My use of NewSlot when `Abstract' was set was
28567 wrong. NewSlot should only be used if the `new' keyword is present.
28569 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
28570 locating our system dir. Sorry about this.
28572 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28574 * driver.cs (GetSystemDir): Compute correctly the location of our
28575 system assemblies. I was using the compiler directory instead of
28576 the library directory.
28578 2002-02-13 Ravi Pratap <ravi@ximian.com>
28580 * expression.cs (BetterFunction): Put back in what Miguel commented out
28581 since it is the correct fix. The problem is elsewhere ;-)
28583 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
28584 parameters of the parms method are themselves compatible or not !
28586 (StandardConversionExists): Fix very dangerous bug where we were forgetting
28587 to check that a class implements an interface before saying that an implicit
28588 conversion was allowed. Use ImplementsInterface to do the checking.
28590 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28592 * class.cs (Method.Define): Track whether we are an explicit
28593 implementation or not. And only call DefineMethodOverride if we
28594 are an explicit implementation.
28596 (Property.DefineMethod): Ditto.
28598 2002-02-11 Ravi Pratap <ravi@ximian.com>
28600 * expression.cs (BetterFunction): Catch hideous bug which was
28601 preventing us from detecting ambiguous calls due to implicit casts i.e
28604 2002-01-29 Miguel de Icaza <miguel@ximian.com>
28606 * support.cs (Pair): Remove un-needed method. I figured why I was
28607 getting the error in cs-parser.jay, the variable in a foreach loop
28608 is readonly, and the compiler does not really treat this as a variable.
28610 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
28611 instead of EQUALS in grammar.
28613 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
28615 * expression.cs (Unary.DoResolve): Check whether the argument is
28618 2002-01-28 Miguel de Icaza <miguel@ximian.com>
28620 * support.cs: Api for Pair to set a value. Despite the fact that
28621 the variables are public the MS C# compiler refuses to compile
28622 code that accesses the field if the variable is part of a foreach
28625 * statement.cs (Fixed): Begin implementation of the fixed
28628 (Block.AddVariable): Return the VariableInfo on success and null
28629 on failure instead of true/false.
28631 * cs-parser.jay (foreach): Catch errors on variables already
28632 defined (we were ignoring this value before) and properly unwind
28633 the block hierarchy
28635 (fixed_statement): grammar for the fixed statement.
28637 2002-01-25 Miguel de Icaza <miguel@ximian.com>
28639 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
28640 pointer types to be incretemented.
28642 (SizeOf): Implement.
28644 * cs-parser.jay (pointer_member_access): Implement
28645 expr->IDENTIFIER production.
28647 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
28648 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
28651 (Unary): Implement indirection.
28653 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
28654 use in non-unsafe context).
28656 (SimpleName.DoResolve): Check for pointers in field access on safe
28659 (Expression.LoadFromPtr): Factor the load-indirect code in this
28660 function. This was duplicated in UnboxCast and ParameterReference
28662 2002-01-24 Miguel de Icaza <miguel@ximian.com>
28664 * expression.cs (ComposedCast): report an error if a pointer cast
28665 is used in a safe region.
28667 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
28668 pointer type casts in unsafe context.
28670 * codegen.cs (EmitContext): Set up IsUnsafe.
28672 * cs-parser.jay (non_expression_type): Add productions for pointer
28675 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
28676 code. We should not use force into static mode if the method is
28677 not virtual. Fixes bug in MIS
28679 * statement.cs (Do.Emit, While.Emit, For.Emit,
28680 Statement.EmitBoolExpression): Add support to Do and While to
28681 propagate infinite loop as `I do return' semantics.
28683 Improve the For case to also test for boolean constants.
28685 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
28686 to the list of attributes we can add.
28688 Remove `EmitContext' argument.
28690 * class.cs (Method.Define): Apply parameter attributes.
28691 (Constructor.Define): Apply parameter attributes.
28692 (MethodCore.LabelParameters): Move here the core of labeling
28695 * support.cs (ReflectionParameters.ParameterModifier,
28696 InternalParameters.ParameterModifier): Use IsByRef on the type and
28697 only return the OUT bit for these parameters instead of in/out/ref
28700 This is because I miss-understood things. The ParameterInfo.IsIn
28701 and IsOut represent whether the parameter has the [In] and [Out]
28704 2002-01-22 Miguel de Icaza <miguel@ximian.com>
28706 * ecore.cs (FieldExpr.Emit): Release temporaries.
28708 * assign.cs (LocalTemporary.Release): new function.
28710 * codegen.cs (EmitContext.GetTemporaryStorage,
28711 EmitContext.FreeTemporaryStorage): Rework the way we deal with
28712 temporary storage. Now we can "put back" localbuilders when we
28715 2002-01-21 Miguel de Icaza <miguel@ximian.com>
28717 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
28718 need to make a copy of the variable to generate verifiable code.
28720 2002-01-19 Miguel de Icaza <miguel@ximian.com>
28722 * driver.cs: Compute dynamically the system directory.
28724 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
28725 Slower, but more generally useful. Used by the abstract
28726 registering implementation.
28728 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
28729 the rules for the special rule on Type/instances. First check if
28730 we have the same name, and if so, try that special static path
28731 rather than the instance path.
28733 2002-01-18 Miguel de Icaza <miguel@ximian.com>
28735 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
28738 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
28739 Enum, ValueType, Delegate or Array for non-corlib compiles.
28741 * cs-tokenizer.cs: Catch long identifiers (645)
28743 * typemanager.cs (IndexerPropetyName): Ravi never tested this
28746 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
28747 fix, we were returning too early, so we were not registering
28748 pending methods from abstract classes.
28750 Do not register pending methods if the class is abstract.
28752 * expression.cs (Conditional.DoResolve): Report circular implicit
28753 conversions when we neecd to compute it for conditional
28756 (Is.DoResolve): If the expression is always of the provided type,
28757 flag warning 183. If the expression can not ever be of the
28758 provided type flag warning 184.
28760 * class.cs: Catch 169 as well.
28762 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
28765 2002-01-18 Nick Drochak <ndrochak@gol.com>
28767 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
28769 2002-01-17 Miguel de Icaza <miguel@ximian.com>
28771 * interface.cs: (PopulateMethod): Check for pointers being defined
28772 only if the unsafe context is active.
28773 (PopulateProperty): ditto.
28774 (PopulateIndexer): ditto.
28776 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
28777 specified. If pointers are present, make sure that they are
28778 present in an unsafe context.
28779 (Constructor, Constructor.Define): ditto.
28780 (Field, Field.Define): ditto.
28781 (Property, Property.Define): ditto.
28782 (Event, Event.Define): ditto.
28784 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
28785 hashtable if there are classes or structs defined.
28787 * expression.cs (LocalVariableReference.DoResolve): Simplify this
28788 code, as the constant resolution moved.
28790 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
28791 the metadata, so we can flag error 133.
28793 * decl.cs (MemberCore.UnsafeOK): New function to test that a
28794 pointer is being declared in an unsafe context.
28796 2002-01-16 Miguel de Icaza <miguel@ximian.com>
28798 * modifiers.cs (Modifiers.Check): Require a Location argument.
28799 Report error 227 for Unsafe use.
28801 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
28803 * statement.cs (For.Emit): If the test is null, then report that
28804 we do `return', as we wont reach anything afterwards.
28806 (Switch.SwitchGoverningType): Track the expression that matched
28809 * driver.cs: Allow negative numbers as an error code to flag.
28811 * cs-parser.jay: Handle 1551.
28813 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
28815 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28817 * cs-parser.jay: Report 1518 (type declaration can only contain
28818 class, struct, interface, enum or delegate)
28820 (switch_label): Report 1523 (keywords `case' or `default' must
28823 (opt_switch_sections): Report 1522 (empty switch)
28825 * driver.cs: Report 1515 (response file specified multiple times)
28826 Report 1516 (Source file specified multiple times).
28828 * expression.cs (Argument.Resolve): Signal 1510
28830 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
28831 access not allowed in static code)
28833 2002-01-11 Ravi Pratap <ravi@ximian.com>
28835 * typemanager.cs (IsPointerType): Utility method which we are going
28838 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
28839 the object type, so we take care of that.
28841 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
28843 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
28844 added to non-params parameters :-)
28846 * typemanager.cs (CSharpName): Include 'void' type too.
28848 (void_ptr_type): Include in the set of core types.
28850 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
28853 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
28856 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
28857 completely forgotten about it.
28859 2002-01-10 Ravi Pratap <ravi@ximian.com>
28861 * cs-parser.jay (pointer_type): Add. This begins our implementation
28862 of parsing rules for unsafe code.
28864 (unsafe_statement): Implement.
28866 (embedded_statement): Modify to include the above.
28868 * statement.cs (Unsafe): Implement new class for unsafe blocks.
28870 * codegen.cs (EmitContext.InUnsafe): Add. This determines
28871 if the current context is an unsafe one.
28873 * cs-parser.jay (local_variable_pointer_type): Since local variable types
28874 are handled differently, we need separate rules for them.
28876 (local_variable_declaration): Update to use local_variable_pointer_type
28877 to allow variable declarations of unmanaged pointer types.
28879 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
28880 in unsafe contexts.
28882 * ../errors/cs0214.cs : Add.
28884 2002-01-16 Nick Drochak <ndrochak@gol.com>
28886 * makefile: remove 'response' file when cleaning.
28888 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28890 * cs-parser.jay: Report 1524.
28892 2002-01-14 Miguel de Icaza <miguel@ximian.com>
28894 * typemanager.cs (RegisterMethod): drop checking if we have
28895 registered this from here
28897 2002-01-12 Miguel de Icaza <miguel@ximian.com>
28899 * class.cs (Method.EmitDestructor): Implement calling our base
28902 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
28903 value of InFinally.
28905 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
28906 this routine and will wrap the call in a try/catch block. Deal
28909 2002-01-11 Miguel de Icaza <miguel@ximian.com>
28911 * ecore.cs (Expression.MemberLookup): instead of taking a
28912 parameter `same_type' that was used to tell whether we could
28913 access private members we compute our containing type from the
28916 (FieldExpr): Added partial support for volatile fields. This does
28917 not work for volatile fields exposed from assemblies, as I can not
28918 figure out how to extract the modreq from it.
28920 Updated all the source files to use this.
28922 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
28923 because it is referenced by MemberLookup very often.
28925 2002-01-09 Ravi Pratap <ravi@ximian.com>
28927 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
28928 TypeBuilder.GetCustomAttributes to retrieve what we need.
28930 Get rid of redundant default_member_attr_type as this is the same as
28931 default_member_type which already exists.
28933 * interface.cs, attribute.cs : Update accordingly.
28935 2002-01-08 Miguel de Icaza <miguel@ximian.com>
28937 * typemanager.cs: Enable IndexerPropertyName again. It does not
28938 work for TYpeBuilders though. Ravi, can you please fix this?
28940 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
28942 * expression.cs (Argument.Emit): Handle the case of ref objects
28943 being passed to ref functions;
28945 (ParameterReference.EmitLoad): Loads the content of the pointer
28946 without dereferencing.
28948 2002-01-07 Miguel de Icaza <miguel@ximian.com>
28950 * cs-tokenizer.cs: Implemented the pre-processing expressions.
28952 2002-01-08 Ravi Pratap <ravi@ximian.com>
28954 * class.cs (Indexer.DefineMethod): Incorporate the interface
28955 type in the name of the method if we are doing explicit interface
28958 * expression.cs (ConversionExists): Remove as it is completely obsolete.
28960 (BetterConversion): Fix extremely trivial bug where we were referring to
28961 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
28964 * ../errors/bug16.cs : Add although we have fixed it.
28966 2002-01-07 Miguel de Icaza <miguel@ximian.com>
28968 * expression.cs (BaseIndexer): Begin implementation.
28970 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
28972 * cs-parser.jay (indexer_declarator): Use qualified_identifier
28973 production directly to remove a shift/reduce, and implement
28974 explicit interface implementation.
28976 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
28977 after a floating point suffix.
28979 * expression.cs (DoNumericPromotions): Improved the conversion for
28980 uint/uint. If we have a constant, we avoid doing a typecast to a
28983 * class.cs (Indexer): Implement explicit interface implementation
28986 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
28988 * class.cs: make the default instance constructor public and hidebysig.
28990 2001-01-03 Ravi Pratap <ravi@ximian.com>
28992 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
28993 so we can call it from elsewhere.
28995 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
28996 we emit it internally if the class has a defined indexer; otherwise the user
28997 emits it by decorating the class definition with the DefaultMemberAttribute.
28999 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
29000 attribute is not used on a type which defines an indexer.
29002 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
29003 character when we skip whitespace.
29005 * ../errors/cs0646.cs : Add.
29007 2002-01-03 Miguel de Icaza <miguel@ximian.com>
29009 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
29012 * makefile: Add practical target `mcs3.exe' which builds the third
29013 generation compiler.
29015 * expression.cs (New): Fix structures constructor calling.
29017 * class.cs (Property, Method, Indexer): Emit Final flag on the
29018 method if we are an interface implementation and we are not
29021 * ecore.cs (PropertyExpr): New public field `IsBase', tells
29022 whether this property is referencing a `base' method.
29024 * expression.cs (Invocation.EmitCall): take an extra argument:
29025 is_base, this is used to determine whether the `call' or
29026 `callvirt' opcode should be used.
29029 * delegate.cs: update EmitCall.
29031 * class.cs (Method.Define): Set NewSlot for the cases where we are
29032 not implementing an interface method.
29034 (Property.Define): ditto.
29036 2002-01-02 Miguel de Icaza <miguel@ximian.com>
29038 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
29039 'r'. Allows mcs to parse itself fully.
29041 2002-01-02 Ravi Pratap <ravi@ximian.com>
29043 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
29044 of the number of initializers that require the InitializeArray method.
29046 (CheckIndices): Store the Expression in all cases - not the plain value. Also
29047 update the above field where necessary.
29049 (MakeByteBlob): Update accordingly.
29051 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
29054 (EmitDynamicInitializers): Update in accordance with the new optimization.
29056 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
29057 same OpCode applies.
29059 * cs-parser.jay : Fix some glaring errors I introduced.
29061 2002-01-01 Ravi Pratap <ravi@ximian.com>
29063 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
29064 so that we can check for name clashes there too.
29066 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
29067 for interface indexers.
29069 * interfaces.cs (Define): Emit the default member attribute.
29071 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
29072 variable was being referred to while setting the value ;-)
29074 2002-01-01 Miguel de Icaza <miguel@ximian.com>
29076 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
29077 byte-by-byte information when we know the data is zero.
29079 Make the block always a multiple of 4, because
29080 DefineInitializedData has a bug.
29082 * assign.cs: Fix, we should assign from the temporary, not from
29085 * expression.cs (MakeByteBlob): Fix my incorrect code.
29087 2001-12-31 Miguel de Icaza <miguel@ximian.com>
29089 * typemanager.cs (EnumToUnderlying): This function is used to get
29090 the underlying type from an enumeration, because it does not
29093 * constant.cs: Use the I4_S form for values between -128 and 127.
29095 * statement.cs (Block.LookupLabel): Looks up a label.
29096 (Block): Drop support for labeled blocks.
29098 (LabeledStatement): New kind of statement that represents a label
29101 (Goto): Finally implement this bad boy.
29103 * cs-parser.jay: Update to reflect new mechanism to implement
29106 2001-12-30 Miguel de Icaza <miguel@ximian.com>
29108 * codegen.cs (EmitContext.This): a codegen property that keeps the
29109 a single instance of this instead of creating many different this
29112 * delegate.cs (Delegate.DoResolve): Update to use the property;
29114 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
29116 * expression.cs (BaseAccess.DoResolve): Ditto.
29118 2001-12-29 Ravi Pratap <ravi@ximian.com>
29120 * typemanager.cs (methodimpl_attr_type): Add to hold the type
29121 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
29123 (InitCoreTypes): Update accordingly.
29125 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
29126 so we can quickly store the state.
29128 (ApplyAttributes): Set the correct implementation flags
29129 for InternalCall methods.
29131 2001-12-29 Miguel de Icaza <miguel@ximian.com>
29133 * expression.cs (EmitCall): if a method is not virtual, then do
29134 not use callvirt on it.
29136 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
29137 user defined stuff) requires the use of stobj, which takes an
29138 address on the stack instead of an array and an index. So emit
29139 the Ldelema operation for it.
29141 (EmitStoreOpcode): Use stobj for valuetypes.
29143 (UnaryMutator.EmitCode): Use the right 1 value depending on
29144 whether we are dealing with int64/uint64, float or doubles.
29146 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
29147 constructors that I implemented last night.
29149 (Constructor.IsDefault): Fix to work properly for static
29152 * cs-parser.jay (CheckDef): report method signature errors.
29153 Update error number 103 to be 132.
29155 * decl.cs: New AdditionResult enumeration value: MethodExists.
29156 Although we do this check for methods later on in the semantic
29157 analysis, catching repeated default constructors is so easy that
29158 we catch these here.
29160 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
29163 (ParameterReference.EmitAssign, Emit): handle
29166 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
29167 (ArrayAccess.EmitStoreOpcode): ditto.
29169 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
29171 * expression.cs (MakeByteBlob): Complete all the missing types
29172 (uint, short, ushort, byte, sbyte)
29174 * class.cs: Only init instance field initializers on instance
29177 Rename `constructors' to instance_constructors.
29179 (TypeContainer.AddConstructor): Only add constructors to the list
29180 if it is not static.
29182 Make sure that we handle default_static_constructor independently
29183 everywhere where we handle instance_constructors
29185 2001-12-28 Miguel de Icaza <miguel@ximian.com>
29187 * class.cs: Do not lookup or create a base initializer for a
29188 static constructor.
29190 (ConstructorInitializer.Resolve): use the proper type to lookup
29193 * cs-parser.jay: Report error 1585 (modifiers between type and name).
29195 * enum.cs, interface.cs: Remove CloseType, this is taken care by
29198 * decl.cs: CloseType is now an virtual method, the default
29199 implementation just closes this type.
29201 2001-12-28 Ravi Pratap <ravi@ximian.com>
29203 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
29204 to PreserveSig by default. Also emit HideBySig on such methods.
29206 Basically, set the defaults to standard values.
29208 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
29209 argument, if candidate is better, it can't be worse than the best !
29211 (Invocation): Re-write bits to differentiate between methods being
29212 applicable in their expanded form and their normal form - for params
29215 Get rid of use_standard everywhere as only standard conversions are allowed
29216 in overload resolution.
29218 More spec conformance.
29220 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29222 * driver.cs: Add --timestamp, to see where the compiler spends
29225 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
29226 `this' in static code.
29228 (SimpleName.DoResolve): Implement in terms of a helper function
29229 that allows static-references to be passed upstream to
29232 (Expression.ResolveWithSimpleName): Resolve specially simple
29233 names when called by MemberAccess to implement the special
29236 (Expression.ImplicitReferenceConversion): Handle conversions from
29237 Null to reference types before others, as Null's type is
29240 * expression.cs (Invocation.EmitCall): Handle the special case of
29241 calling methods declared on a reference type from a ValueType
29242 (Base classes System.Object and System.Enum)
29244 (MemberAccess.Resolve): Only perform lookups on Enumerations if
29245 the left hand side is a TypeExpr, not on every enumeration.
29247 (Binary.Resolve): If types are reference types, then do a cast to
29248 object on operators != and == of both arguments.
29250 * typemanager.cs (FindMembers): Extract instance and static
29251 members if requested.
29253 * interface.cs (PopulateProperty): Use void_type instead of null
29254 as the return type for the setter method.
29256 (PopulateIndexer): ditto.
29258 2001-12-27 Ravi Pratap <ravi@ximian.com>
29260 * support.cs (ReflectionParameters): Fix minor bug where we
29261 were examining the wrong parameter for the ParamArray attribute.
29263 Cope with requests for the type of the parameter at position
29264 greater than the params parameter's. We now return the element
29265 type of the params array as that makes more sense.
29267 * expression.cs (Invocation.IsParamsMethodApplicable): Update
29268 accordingly as we no longer have to extract the element type
29271 (Invocation.OverloadResolve): Update.
29273 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29275 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
29276 against IEnumerator, test whether the return value is a descendant
29277 of the IEnumerator interface.
29279 * class.cs (Indexer.Define): Use an auxiliary method to implement
29280 the other bits of the method definition. Begin support for
29281 explicit interface implementation.
29283 (Property.DefineMethod): Use TypeManager.void_type instead of null
29284 for an empty return value.
29286 2001-12-26 Miguel de Icaza <miguel@ximian.com>
29288 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
29289 dealing with a FieldExpr which is composed of a FieldBuilder, in
29290 the code path we did extract the constant, but we should have
29291 obtained the underlying value to be able to cast it (otherwise we
29292 end up in an infinite loop, this is what Ravi was running into).
29294 (ArrayCreation.UpdateIndices): Arrays might be empty.
29296 (MemberAccess.ResolveMemberAccess): Add support for section
29297 14.5.4.1 that deals with the special case of E.I when E is a type
29298 and something else, that I can be a reference to a static member.
29300 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
29301 handle a particular array type to create byte blobs, it is just
29302 something we dont generate byteblobs for.
29304 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
29307 * location.cs (Push): remove the key from the hashtable that we
29308 are about to add. This happens for empty files.
29310 * driver.cs: Dispose files after we have parsed them.
29312 (tokenize): new function that only runs the tokenizer on its
29313 input, for speed testing.
29315 2001-12-26 Ravi Pratap <ravi@ximian.com>
29317 * class.cs (Event.Define): Define the private field only if there
29318 are no accessors defined.
29320 * expression.cs (ResolveMemberAccess): If there is no associated
29321 field with the event, that means we have an event defined with its
29322 own accessors and we should flag error cs0070 since transforming
29323 ourselves into a field is not valid in that case.
29325 * ecore.cs (SimpleName.DoResolve): Same as above.
29327 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
29328 and charset to sane values.
29330 2001-12-25 Ravi Pratap <ravi@ximian.com>
29332 * assign.cs (DoResolve): Perform check on events only if they
29333 are being accessed outside the declaring type.
29335 * cs-parser.jay (event_declarations): Update rules to correctly
29336 set the type of the implicit parameter etc.
29338 (add_accessor, remove_accessor): Set current local parameters.
29340 * expression.cs (Binary): For delegate addition and subtraction,
29341 cast the return value from the method into the appropriate delegate
29344 2001-12-24 Ravi Pratap <ravi@ximian.com>
29346 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
29347 of these as the workaround is unnecessary.
29349 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
29350 delegate data - none of that is needed at all.
29352 Re-write bits to extract the instance expression and the delegate method
29355 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
29358 * attribute.cs (ApplyAttributes): New method to take care of common tasks
29359 of attaching attributes instead of duplicating code everywhere.
29361 * everywhere : Update code to do attribute emission using the above method.
29363 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29365 * expression.cs (IsParamsMethodApplicable): if there are not
29366 parameters, return immediately.
29368 * ecore.cs: The 0 literal can be implicity converted to an enum
29371 (SimpleName.DoResolve): First lookup the type, then lookup the
29374 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
29375 want to get its address. If the InstanceExpression is not
29376 addressable, store the result in a temporary variable, then get
29379 * codegen.cs: Only display 219 errors on warning level or above.
29381 * expression.cs (ArrayAccess): Make it implement the
29382 IMemoryLocation interface.
29384 (Binary.DoResolve): handle the operator == (object a, object b)
29385 and operator != (object a, object b) without incurring into a
29386 BoxedCast (because 5 != o should never be performed).
29388 Handle binary enumerator operators.
29390 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
29391 value type, otherwise use Ldelem_ref.
29393 Use precomputed names;
29395 (AddressOf): Implement address of
29397 * cs-parser.jay (labeled_statement): Fix recursive block
29398 addition by reworking the production.
29400 * expression.cs (New.DoEmit): New has a special case:
29402 If we are dealing with a ValueType, we have a few
29403 situations to deal with:
29405 * The target of New is a ValueType variable, that is
29406 easy, we just pass this as the variable reference
29408 * The target of New is being passed as an argument,
29409 to a boxing operation or a function that takes a
29412 In this case, we need to create a temporary variable
29413 that is the argument of New.
29416 2001-12-23 Ravi Pratap <ravi@ximian.com>
29418 * rootcontext.cs (LookupType): Check that current_type is not null before
29419 going about looking at nested types.
29421 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
29422 not implement the IAssignMethod interface any more.
29424 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
29425 where we tranform them into FieldExprs if they are being resolved from within
29426 the declaring type.
29428 * ecore.cs (SimpleName.DoResolve): Do the same here.
29430 * assign.cs (DoResolve, Emit): Clean up code considerably.
29432 * ../errors/bug10.cs : Add.
29434 * ../errors/cs0070.cs : Add.
29436 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
29438 * assign.cs : Get rid of EventIsLocal everywhere.
29440 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29442 * ecore.cs (ConvertIntLiteral): finished the implementation.
29444 * statement.cs (SwitchLabel): Convert the value we are using as a
29445 key before looking up the table.
29447 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29449 * codegen.cs (EmitTopBlock): Require a Location argument now.
29451 * cs-parser.jay (constructor_declarator): We need to setup
29452 current_local_parameters before we parse the
29453 opt_constructor_initializer, to allow the variables to be bound
29454 to the constructor arguments.
29456 * rootcontext.cs (LookupType): First lookup nested classes in our
29457 class and our parents before we go looking outside our class.
29459 * expression.cs (ConstantFold): Extract/debox the values at the
29462 * rootcontext.cs (EmitCode): Resolve the constants first before we
29463 resolve the types. This is not really needed, but it helps debugging.
29465 * statement.cs: report location.
29467 * cs-parser.jay: pass location to throw statement.
29469 * driver.cs: Small bug fix.
29471 * report.cs: Updated format to be 4-zero filled digits.
29473 2001-12-22 Ravi Pratap <ravi@ximian.com>
29475 * expression.cs (CheckIndices): Fix minor bug where the wrong
29476 variable was being referred to ;-)
29478 (DoEmit): Do not call EmitStaticInitializers when the
29479 underlying type is System.Object.
29481 2001-12-21 Ravi Pratap <ravi@ximian.com>
29483 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
29484 and do the usual workaround for SRE.
29486 * class.cs (MyEventBuilder.EventType): New member to get at the type
29487 of the event, quickly.
29489 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
29491 * assign.cs (Assign.DoResolve): Handle the case when the target
29492 is an EventExpr and perform the necessary checks.
29494 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
29497 (SimpleName.MemberStaticCheck): Include check for EventExpr.
29499 (EventExpr): Set the type in the constructor itself since we
29500 are meant to be born fully resolved.
29502 (EventExpr.Define): Revert code I wrote earlier.
29504 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
29505 instance expression is null. The instance expression is a This in that case
29506 or a null, depending on whether it is a static method or not.
29508 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
29509 refers to more than one method.
29511 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
29512 and accordingly flag errors.
29514 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29516 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
29518 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29520 * location.cs (ToString): Provide useful rutine.
29522 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29524 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
29525 objects, return the actual integral boxed.
29527 * statement.cs (SwitchLabel): define an ILLabel for each
29530 (Switch.CheckSwitch): If the value is a Literal, extract
29531 the underlying literal.
29533 Also in the unused hashtable we had, add the SwitchLabel so we can
29534 quickly look this value up.
29536 * constant.cs: Implement a bunch of new constants. Rewrite
29537 Literal based on this. Made changes everywhere to adapt to this.
29539 * expression.cs (Expression.MakeByteBlob): Optimize routine by
29540 dereferencing array only once, and also copes with enumrations.
29542 bytes are two bytes wide, not one.
29544 (Cast): Perform constant conversions.
29546 * ecore.cs (TryImplicitIntConversion): Return literals instead of
29547 wrappers to the literals here.
29549 * expression.cs (DoNumericPromotions): long literals can converted
29550 to ulong implicity (this is taken care of elsewhere, but I was
29551 missing this spot).
29553 * ecore.cs (Expression.Literalize): Make the return type Literal,
29554 to improve type checking.
29556 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
29558 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29560 * literal.cs: Revert code from ravi that checked the bounds. The
29561 bounds are sane by the definition of the type itself.
29563 * typemanager.cs: Fix implementation of ImplementsInterface. We
29564 need to actually look up in our parent hierarchy for interfaces
29567 * const.cs: Use the underlying type for enumerations
29569 * delegate.cs: Compute the basename for the delegate creation,
29570 that should fix the delegate test case, and restore the correct
29571 Type Lookup semantics in rootcontext
29573 * rootcontext.cs: Revert Ravi's last patch. The correct way of
29574 referencing a nested type with the Reflection API is using the "+"
29577 * cs-parser.jay: Do not require EOF token at the end.
29579 2001-12-20 Ravi Pratap <ravi@ximian.com>
29581 * rootcontext.cs (LookupType): Concatenate type names with
29582 a '.' instead of a '+' The test suite passes again.
29584 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
29585 field of the enumeration.
29587 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
29588 the case when the member is an EventExpr.
29590 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
29591 static has an associated instance expression.
29593 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
29595 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
29597 * class.cs (Event.Define): Register event and perform appropriate checks
29600 We define the Add and Remove methods even if the use provides none because
29601 in that case, we provide default implementations ourselves.
29603 Define a private field of the type of the event. This is done by the CSC compiler
29604 and we should be doing it too ;-)
29606 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
29607 More methods we use in code we generate.
29609 (multicast_delegate_type, delegate_type): Two separate types since the distinction
29612 (InitCoreTypes): Update accordingly for the above.
29614 * class.cs (Event.Emit): Generate code for default accessors that we provide
29616 (EmitDefaultMethod): Do the job in the above.
29618 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
29621 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29623 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
29624 builders even if we were missing one.
29626 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
29627 pass the Basename as our class name instead of the Name. The
29628 basename will be correctly composed for us.
29630 * parameter.cs (Paramters): Now takes a Location argument.
29632 * decl.cs (DeclSpace.LookupType): Removed convenience function and
29633 make all the code call directly LookupType in RootContext and take
29634 this chance to pass the Location information everywhere.
29636 * Everywhere: pass Location information.
29638 2001-12-19 Miguel de Icaza <miguel@ximian.com>
29640 * class.cs (Constructor.Define): Updated way of detecting the
29641 length of the parameters.
29643 (TypeContainer.DefineType): Use basename as the type name for
29646 (TypeContainer.Define): Do not recursively define types here, as
29647 definition is taken care in order by the RootContext.
29649 * tree.cs: Keep track of namespaces in a per-file basis.
29651 * parameter.cs (Parameter.ComputeSignature): Update to use
29654 (Parameters.GetSignature): ditto.
29656 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
29657 instead of a TypeContainer.
29659 (Interface.SemanticAnalysis): Use `this' instead of our parent to
29660 resolve names. Because we need to be resolve in our context, not
29663 * driver.cs: Implement response files.
29665 * class.cs (TypeContainer.DefineType): If we are defined, do not
29666 redefine ourselves.
29668 (Event.Emit): Emit the code for add/remove handlers.
29669 (Event.Define): Save the MethodBuilders for add/remove.
29671 * typemanager.cs: Use pair here too.
29673 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
29674 DictionaryEntry requires the first argument to be non-null.
29676 (enum_declaration): Compute full name for registering the
29679 (delegate_declaration): Instead of using
29680 formal_parameter_list, use opt_formal_parameter_list as the list
29683 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
29684 (EventParsing): New property that controls whether `add' and
29685 `remove' are returned as tokens or identifiers (for events);
29687 2001-12-19 Ravi Pratap <ravi@ximian.com>
29689 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
29690 use MyEventBuilder only and let it wrap the real builder for us.
29692 (MyEventBuilder): Revamp constructor etc.
29694 Implement all operations that we perform on EventBuilder in precisely the same
29697 (FindMembers): Update to use the EventBuilder member.
29699 (Event.Emit): Update accordingly.
29701 2001-12-18 Ravi Pratap <ravi@ximian.com>
29703 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
29704 by calling the appropriate methods.
29706 (GetCustomAttributes): Make stubs as they cannot possibly do anything
29709 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
29711 2001-12-17 Ravi Pratap <ravi@ximian.com>
29713 * delegate.cs (Delegate.Populate): Check that the return type
29714 and various parameters types are indeed accessible.
29716 * class.cs (Constructor.Define): Same here.
29718 (Field.Define): Ditto.
29720 (Event.Define): Ditto.
29722 (Operator.Define): Check that the underlying Method defined itself
29723 correctly - so it's MethodBuilder should not be null.
29725 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
29726 expression happens to be null.
29728 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
29729 members but as of now we don't seem to be able to do anything really useful with it.
29731 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
29732 not the EventBuilder.
29734 2001-12-18 Miguel de Icaza <miguel@ximian.com>
29736 * cs-tokenizer.cs: Add support for defines.
29737 Add support for #if, #elif, #else, #endif
29739 (eval_var): evaluates a variable.
29740 (eval): stubbed for evaluating functions.
29742 * cs-parser.jay: Pass the defines information
29744 * driver.cs: Add --define command line option.
29746 * decl.cs: Move MemberCore here.
29748 Make it the base class for DeclSpace. This allows us to catch and
29749 report 108 and 109 for everything now.
29751 * class.cs (TypeContainer.Define): Extract all the members
29752 before populating and emit the warning 108 (new keyword required
29753 to override) instead of having each member implement this.
29755 (MemberCore.Define): New abstract method, we will be using this in
29756 the warning reporting engine in Populate.
29758 (Operator.Define): Adjust to new MemberCore protocol.
29760 * const.cs (Const): This does not derive from Expression, it is a
29761 temporary object we use to create fields, it is a MemberCore.
29763 * class.cs (Method.Define): Allow the entry point to be in a
29766 * driver.cs: Rewrite the argument handler to clean it up a bit.
29768 * rootcontext.cs: Made it just an auxiliary namespace feature by
29769 making everything static.
29771 * driver.cs: Adapt code to use RootContext type name instead of
29774 * delegate.cs: Remove RootContext argument.
29776 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
29779 * class.cs (Event.Define): The lookup can fail.
29781 * cs-tokenizer.cs: Begin implementation of pre-procesor.
29783 * expression.cs: Resolve the this instance before invoking the code.
29785 2001-12-17 Miguel de Icaza <miguel@ximian.com>
29787 * cs-parser.jay: Add a production in element_access that allows
29788 the thing to become a "type" reference. This way we can parse
29789 things like "(string [])" as a type.
29791 Note that this still does not handle the more complex rules of
29795 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
29797 * ecore.cs: (CopyNewMethods): new utility function used to
29798 assemble the list of methods from running FindMembers.
29800 (MemberLookup): Rework FindMembers so that
29802 2001-12-16 Miguel de Icaza <miguel@ximian.com>
29804 * class.cs (TypeContainer): Remove Delegates who fail to be
29807 * delegate.cs (Populate): Verify that we dont get null return
29808 values. TODO: Check for AsAccessible.
29810 * cs-parser.jay: Use basename to emit error 574 (destructor should
29811 have the same name as container class), not the full name.
29813 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
29814 possible representation.
29816 Also implements integer type suffixes U and L.
29818 2001-12-15 Miguel de Icaza <miguel@ximian.com>
29820 * expression.cs (ArrayCreation.DoResolve): We need to do the
29821 argument resolution *always*.
29823 * decl.cs: Make this hold the namespace. Hold the root context as
29825 (LookupType): Move here.
29827 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
29829 * location.cs (Row, Name): Fixed the code, it was always returning
29830 references to the first file.
29832 * interface.cs: Register properties defined through interfaces.
29834 * driver.cs: Add support for globbing on the command line
29836 * class.cs (Field): Make it derive from MemberCore as well.
29839 2001-12-15 Ravi Pratap <ravi@ximian.com>
29841 * class.cs (Event::Define): Check that the type of the event is a delegate
29842 type else flag error #66.
29844 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
29847 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
29848 values of EntryPoint, CharSet etc etc.
29850 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
29852 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
29853 be null and we should ignore this. I am not sure if this is really clean. Apparently,
29854 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
29855 which needs this to do its work.
29857 * ../errors/cs0066.cs : Add.
29859 2001-12-14 Miguel de Icaza <miguel@ximian.com>
29861 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
29864 * class.cs: (MethodSignature.MethodSignature): Removed hack that
29865 clears out the parameters field.
29866 (MemberSignatureCompare): Cleanup
29868 (MemberCore): New base class used to share code between MethodCore
29871 (RegisterRequiredImplementations) BindingFlags.Public requires
29872 either BindingFlags.Instace or Static. Use instance here.
29874 (Property): Refactored code to cope better with the full spec.
29876 * parameter.cs (GetParameterInfo): Return an empty array instead
29879 * class.cs (Property): Abstract or extern properties have no bodies.
29881 * parameter.cs (GetParameterInfo): return a zero-sized array.
29883 * class.cs (TypeContainer.MethodModifiersValid): Move all the
29884 method modifier validation to the typecontainer so we can reuse
29885 this on properties.
29887 (MethodCore.ParameterTypes): return an empty sized array of types.
29889 (Property.Define): Test property modifier validity.
29891 Add tests for sealed/override too.
29893 (Method.Emit): abstract or extern methods have no bodies.
29895 2001-12-14 Ravi Pratap <ravi@ximian.com>
29897 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
29900 (Method::Define, ::Emit): Modify accordingly.
29902 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
29904 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
29906 * makefile: Pass in /unsafe.
29908 2001-12-13 Miguel de Icaza <miguel@ximian.com>
29910 * class.cs (MakeKey): Kill routine.
29912 * class.cs (TypeContainer.Define): Correctly define explicit
29913 method implementations (they require the full interface name plus
29916 * typemanager.cs: Deply the PtrHashtable here and stop using the
29917 lame keys. Things work so much better.
29919 This of course broke everyone who depended on `RegisterMethod' to
29920 do the `test for existance' test. This has to be done elsewhere.
29922 * support.cs (PtrHashtable): A hashtable that avoid comparing with
29923 the object stupid Equals method (because, that like fails all over
29924 the place). We still do not use it.
29926 * class.cs (TypeContainer.SetRequiredInterface,
29927 TypeContainer.RequireMethods): Killed these two routines and moved
29928 all the functionality to RegisterRequiredImplementations.
29930 (TypeContainer.RegisterRequiredImplementations): This routine now
29931 registers all the implementations required in an array for the
29932 interfaces and abstract methods. We use an array of structures
29933 which can be computed ahead of time to reduce memory usage and we
29934 also assume that lookups are cheap as most classes will not
29935 implement too many interfaces.
29937 We also avoid creating too many MethodSignatures.
29939 (TypeContainer.IsInterfaceMethod): Update and optionally does not
29940 clear the "pending" bit if we find that there are problems with
29943 (TypeContainer.VerifyPendingMethods): Update to report errors of
29944 methods that look like implementations but are not.
29946 (TypeContainer.Define): Add support for explicit interface method
29949 2001-12-12 Miguel de Icaza <miguel@ximian.com>
29951 * typemanager.cs: Keep track of the parameters here instead of
29952 being a feature of the TypeContainer.
29954 * class.cs: Drop the registration of parameters here, as
29955 InterfaceMethods are also interface declarations.
29957 * delegate.cs: Register methods with the TypeManager not only with
29958 the TypeContainer. This code was buggy.
29960 * interface.cs: Full registation here.
29962 2001-12-11 Miguel de Icaza <miguel@ximian.com>
29964 * expression.cs: Remove reducer for binary expressions, it can not
29967 * const.cs: Put here the code that used to go into constant.cs
29969 * constant.cs: Put here the code for constants, this is a new base
29970 class for Literals.
29972 * literal.cs: Make Literal derive from Constant.
29974 2001-12-09 Miguel de Icaza <miguel@ximian.com>
29976 * statement.cs (Return.Emit): Report error 157 if the user
29977 attempts to return from a finally block.
29979 (Return.Emit): Instead of emitting a return, jump to the end of
29982 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
29983 LocalBuilder to store the result of the function. ReturnLabel is
29984 the target where we jump.
29987 2001-12-09 Radek Doulik <rodo@ximian.com>
29989 * cs-parser.jay: remember alias in current namespace
29991 * ecore.cs (SimpleName::DoResolve): use aliases for types or
29994 * class.cs (LookupAlias): lookup alias in my_namespace
29996 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
29998 (LookupAlias): lookup alias in this and if needed in parent
30001 2001-12-08 Miguel de Icaza <miguel@ximian.com>
30005 * rootcontext.cs: (ModuleBuilder) Made static, first step into
30006 making things static. I need this to avoid passing the
30007 TypeContainer when calling ParameterType.
30009 * support.cs (InternalParameters.ParameterType): Remove ugly hack
30010 that did string manipulation to compute the type and then call
30011 GetType. Use Parameter.ParameterType instead.
30013 * cs-tokenizer.cs: Consume the suffix for floating values.
30015 * expression.cs (ParameterReference): figure out whether this is a
30016 reference parameter or not. Kill an extra variable by computing
30017 the arg_idx during emission.
30019 * parameter.cs (Parameters.GetParameterInfo): New overloaded
30020 function that returns whether a parameter is an out/ref value or not.
30022 (Parameter.ParameterType): The type of the parameter (base,
30023 without ref/out applied).
30025 (Parameter.Resolve): Perform resolution here.
30026 (Parameter.ExternalType): The full type (with ref/out applied).
30028 * statement.cs (Using.Emit, Using.EmitExpression): Implement
30029 support for expressions on the using statement.
30031 2001-12-07 Miguel de Icaza <miguel@ximian.com>
30033 * statement.cs (Using.EmitLocalVariableDecls): Split the
30034 localvariable handling of the using statement.
30036 (Block.EmitMeta): Keep track of variable count across blocks. We
30037 were reusing slots on separate branches of blocks.
30039 (Try.Emit): Emit the general code block, we were not emitting it.
30041 Check the type of the declaration to be an IDisposable or
30042 something that can be implicity converted to it.
30044 Emit conversions if required.
30046 * ecore.cs (EmptyExpression): New utility class.
30047 (Expression.ImplicitConversionExists): New utility function.
30049 2001-12-06 Miguel de Icaza <miguel@ximian.com>
30051 * statement.cs (Using): Implement.
30053 * expression.cs (LocalVariableReference): Support read only variables.
30055 * statement.cs: Remove the explicit emit for the Leave opcode.
30056 (VariableInfo): Add a readonly field.
30058 2001-12-05 Miguel de Icaza <miguel@ximian.com>
30060 * ecore.cs (ConvCast): new class used to encapsulate the various
30061 explicit integer conversions that works in both checked and
30062 unchecked contexts.
30064 (Expression.ConvertNumericExplicit): Use new ConvCast class to
30065 properly generate the overflow opcodes.
30067 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30069 * statement.cs: The correct type for the EmptyExpression is the
30070 element_type, not the variable type. Ravi pointed this out.
30072 2001-12-04 Ravi Pratap <ravi@ximian.com>
30074 * class.cs (Method::Define): Handle PInvoke methods specially
30075 by using DefinePInvokeMethod instead of the usual one.
30077 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
30078 above to do the task of extracting information and defining the method.
30080 2001-12-04 Ravi Pratap <ravi@ximian.com>
30082 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
30083 of the condition for string type.
30085 (Emit): Move that here.
30087 (ArrayCreation::CheckIndices): Keep string literals in their expression
30090 (EmitDynamicInitializers): Handle strings appropriately.
30092 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30094 * codegen.cs (EmitContext): Replace multiple variables with a
30095 single pointer to the current Switch statement.
30097 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
30100 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30104 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
30107 (Foreach.Emit): Foreach on arrays was not setting
30108 up the loop variables (for break/continue).
30110 (GotoCase): Semi-implented.
30112 2001-12-03 Ravi Pratap <ravi@ximian.com>
30114 * attribute.cs (CheckAttribute): Handle system attributes by using
30115 Attribute.GetAttributes to examine information we need.
30117 (GetValidPlaces): Same here.
30119 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
30121 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
30123 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
30125 (Method::Define): Set appropriate flags if we have a DllImport attribute.
30127 (Method::Emit): Handle the case when we are a PInvoke method.
30129 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30131 * expression.cs: Use ResolveWithSimpleName on compound names.
30133 2001-12-02 Ravi Pratap <ravi@ximian.com>
30135 * constant.cs (EmitConstant): Make sure we resolve the associated expression
30136 before trying to reduce it.
30138 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
30140 * constant.cs (LookupConstantValue): Implement.
30142 (EmitConstant): Use the above in emitting the constant.
30144 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
30145 that are user-defined by doing a LookupConstantValue on them.
30147 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
30150 2001-11-29 Miguel de Icaza <miguel@ximian.com>
30152 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
30154 (BaseAccess.DoResolve): Implement.
30156 (MemberAccess.DoResolve): Split this routine into a
30157 ResolveMemberAccess routine that can be used independently
30159 2001-11-28 Miguel de Icaza <miguel@ximian.com>
30161 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
30162 As that share bits of the implementation. Is returns a boolean,
30163 while As returns the Type that is being probed.
30165 2001-12-01 Ravi Pratap <ravi@ximian.com>
30167 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
30168 instead of a Literal - much easier.
30170 (EnumInTransit): Remove - utterly useless :-)
30172 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
30174 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
30176 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
30177 chain when we have no associated expression.
30179 2001-11-30 Ravi Pratap <ravi@ximian.com>
30181 * constant.cs (Define): Use Location while reporting the errror.
30183 Also emit a warning when 'new' is used and there is no inherited
30186 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
30189 (LookupEnumValue): Implement to lookup an enum member's value and define it
30192 (Populate): Re-write accordingly to use the above routine.
30194 2001-11-27 Miguel de Icaza <miguel@ximian.com>
30196 * expression.cs (This): Fix prototype for DoResolveLValue to
30197 override the base class DoResolveLValue.
30199 * cs-parser.cs: Report errors cs574 and cs575 (destructor
30202 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
30203 (we need to load the address of the field here). This fixes
30206 (FieldExpr.DoResolveLValue): Call the DoResolve
30207 function to initialize the Instance expression.
30209 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
30210 correctly the GetEnumerator operation on a value type.
30212 * cs-parser.jay: Add more simple parsing error catches.
30214 * statement.cs (Switch): Add support for string switches.
30215 Handle null specially.
30217 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
30219 2001-11-28 Ravi Pratap <ravi@ximian.com>
30221 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
30223 (declare_local_constant): New helper function.
30225 * statement.cs (AddConstant): Keep a separate record of constants
30227 (IsConstant): Implement to determine if a variable is a constant.
30229 (GetConstantExpression): Implement.
30231 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
30233 * statement.cs (IsVariableDefined): Re-write.
30235 2001-11-27 Ravi Pratap <ravi@ximian.com>
30237 * class.cs (TypeContainer::FindMembers): Look for constants
30238 in the case when we are looking for MemberTypes.Field
30240 * expression.cs (MemberAccess::DoResolve): Check that in the
30241 case we are a FieldExpr and a Literal, we are not being accessed
30242 by an instance reference.
30244 * cs-parser.jay (local_constant_declaration): Implement.
30246 (declaration_statement): Implement for constant declarations.
30248 2001-11-26 Miguel de Icaza <miguel@ximian.com>
30250 * statement.cs (Switch): Catch double defaults.
30252 (Switch): More work on the switch() statement
30253 implementation. It works for integral values now, need to finish
30257 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30259 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
30260 integer literals into other integer literals. To be used by
30263 2001-11-24 Ravi Pratap <ravi@ximian.com>
30265 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
30268 (EmitDynamicInitializers): Cope with the above since we extract data
30269 directly from ArrayData now.
30271 (ExpectInitializers): Keep track of whether initializers are mandatory
30274 (Bounds): Make it a hashtable to prevent the same dimension being
30275 recorded for every element in that dimension.
30277 (EmitDynamicInitializers): Fix bug which prevented the Set array method
30280 Also fix bug which was causing the indices to be emitted in the reverse
30283 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30285 * expression.cs (ArrayCreation): Implement the bits that Ravi left
30286 unfinished. They do not work, because the underlying code is
30289 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30291 * cs-parser.jay: Remove bogus fixme.
30293 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
30294 on Switch statement.
30296 2001-11-23 Ravi Pratap <ravi@ximian.com>
30298 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
30301 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
30302 parameter. Apparently, any expression is allowed.
30304 (ValidateInitializers): Update accordingly.
30306 (CheckIndices): Fix some tricky bugs thanks to recursion.
30308 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
30309 I was being completely brain-dead.
30311 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
30312 and re-write acordingly.
30314 (DelegateInvocation): Re-write accordingly.
30316 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
30318 (MakeByteBlob): Handle types more correctly.
30320 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
30321 initialization from expressions but it is incomplete because I am a complete
30324 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30326 * statement.cs (If.Emit): Fix a bug that generated incorrect code
30327 on If. Basically, we have to return `true' (ie, we do return to
30328 our caller) only if both branches of the if return.
30330 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
30331 short-circuit operators, handle them as short circuit operators.
30333 (Cast.DoResolve): Resolve type.
30334 (Cast.Cast): Take an expression as the target type.
30336 * cs-parser.jay (cast_expression): Remove old hack that only
30337 allowed a limited set of types to be handled. Now we take a
30338 unary_expression and we resolve to a type during semantic
30341 Use the grammar productions from Rhys to handle casts (this is
30342 not complete like Rhys syntax yet, we fail to handle that corner
30343 case that C# has regarding (-x), but we will get there.
30345 2001-11-22 Ravi Pratap <ravi@ximian.com>
30347 * class.cs (EmitFieldInitializer): Take care of the case when we have a
30348 field which is an array type.
30350 * cs-parser.jay (declare_local_variables): Support array initialization too.
30352 * typemanager.cs (MakeKey): Implement.
30354 (everywhere): Use the above appropriately.
30356 * cs-parser.jay (for_statement): Update for array initialization while
30357 declaring variables.
30359 * ecore.cs : The error message was correct, it's the variable's names that
30360 were misleading ;-) Make the code more readable.
30362 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
30363 the correct type etc.
30365 (ConvertExplicit): Handle Enum types by examining the underlying type.
30367 2001-11-21 Ravi Pratap <ravi@ximian.com>
30369 * parameter.cs (GetCallingConvention): Always return
30370 CallingConventions.Standard for now.
30372 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30374 * expression.cs (Binary.ResolveOperator): Update the values of `l'
30375 and `r' after calling DoNumericPromotions.
30377 * ecore.cs: Fix error message (the types were in the wrong order).
30379 * statement.cs (Foreach.ProbeCollectionType): Need to pass
30380 BindingFlags.Instance as well
30382 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
30383 implicit int literal conversion in an empty cast so that we
30384 propagate the right type upstream.
30386 (UnboxCast): new class used to unbox value types.
30387 (Expression.ConvertExplicit): Add explicit type conversions done
30390 (Expression.ImplicitNumericConversion): Oops, forgot to test for
30391 the target type before applying the implicit LongLiterals to ULong
30394 2001-11-21 Miguel de Icaza <miguel@ximian.com>
30396 * cs-parser.jay (for_statement): Reworked the way For works: now
30397 we declare manually any variables that are introduced in
30398 for_initializer to solve the problem of having out-of-band code
30399 emition (that is what got for broken).
30401 (declaration_statement): Perform the actual variable declaration
30402 that used to be done in local_variable_declaration here.
30404 (local_variable_declaration): Do not declare anything, just pass
30405 the information on a DictionaryEntry
30407 2001-11-20 Ravi Pratap <ravi@ximian.com>
30409 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
30410 re-write of the logic to now make it recursive.
30412 (UpdateIndices): Re-write accordingly.
30414 Store element data in a separate ArrayData list in the above methods.
30416 (MakeByteBlob): Implement to dump the array data into a byte array.
30418 2001-11-19 Ravi Pratap <ravi@ximian.com>
30420 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
30423 * constant.cs (Define): Implement.
30425 (EmitConstant): Re-write fully.
30427 Pass in location info.
30429 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
30432 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
30433 DictionaryEntry since we need location info too.
30435 (constant_declaration): Update accordingly.
30437 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
30438 code into another method : UpdateIndices.
30440 2001-11-18 Ravi Pratap <ravi@ximian.com>
30442 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
30443 some type checking etc.
30445 2001-11-17 Ravi Pratap <ravi@ximian.com>
30447 * expression.cs (ArrayCreation::ValidateInitializers): Implement
30448 bits to provide dimension info if the user skips doing that.
30450 Update second constructor to store the rank correctly.
30452 2001-11-16 Ravi Pratap <ravi@ximian.com>
30454 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
30455 and try to implement.
30457 * ../errors/cs0150.cs : Add.
30459 * ../errors/cs0178.cs : Add.
30461 2001-11-16 Miguel de Icaza <miguel@ximian.com>
30463 * statement.cs: Implement foreach on multi-dimensional arrays.
30465 * parameter.cs (Parameters.GetParameterByName): Also lookup the
30466 name of the params argument.
30468 * expression.cs: Use EmitStoreOpcode to get the right opcode while
30469 initializing the array.
30471 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
30472 we can use this elsewhere.
30474 * statement.cs: Finish implementation of foreach for single
30477 * cs-parser.jay: Use an out-of-band stack to pass information
30478 around, I wonder why I need this.
30480 foreach_block: Make the new foreach_block the current_block.
30482 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
30483 function used to return a static Parameters structure. Used for
30484 empty parameters, as those are created very frequently.
30486 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
30488 2001-11-15 Ravi Pratap <ravi@ximian.com>
30490 * interface.cs : Default modifier is private, not public. The
30491 make verify test passes again.
30493 2001-11-15 Ravi Pratap <ravi@ximian.com>
30495 * support.cs (ReflectionParameters): Fix logic to determine
30496 whether the last parameter is a params one. Test 9 passes again.
30498 * delegate.cs (Populate): Register the builders we define with
30499 RegisterParameterForBuilder. Test 19 passes again.
30501 * cs-parser.jay (property_declaration): Reference $6 instead
30502 of $$ to get at the location.
30504 (indexer_declaration): Similar stuff.
30506 (attribute): Ditto.
30508 * class.cs (Property): Register parameters for the Get and Set methods
30509 if they exist. Test 23 passes again.
30511 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
30512 call to EmitArguments as we are sure there aren't any params arguments.
30513 Test 32 passes again.
30515 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
30516 IndexOutOfRangeException.
30518 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
30519 Test 33 now passes again.
30521 2001-11-15 Miguel de Icaza <miguel@ximian.com>
30523 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
30524 broke a bunch of things. Will have to come up with a better way
30525 of tracking locations.
30527 * statement.cs: Implemented foreach for single dimension arrays.
30529 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30531 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
30532 an error. This removes the lookup from the critical path.
30534 * cs-parser.jay: Removed use of temporary_loc, which is completely
30537 2001-11-14 Miguel de Icaza <miguel@ximian.com>
30539 * support.cs (ReflectionParameters.ParameterModifier): Report
30540 whether the argument is a PARAMS argument or not.
30542 * class.cs: Set the attribute `ParamArrayAttribute' on the
30543 parameter argument.
30545 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
30546 and cons_param_array_attribute (ConstructorInfo for
30547 ParamArrayAttribute).,
30549 * codegen.cs: Emit the return using the `Return' statement, that
30550 way we can report the error correctly for missing return values.
30552 * class.cs (Method.Emit): Clean up.
30554 * expression.cs (Argument.Resolve): Take another argument: the
30555 location where this argument is used. Notice that this is not
30556 part of the "Argument" class as to reduce the size of the
30557 structure (we know the approximate location anyways).
30559 Test if the argument is a variable-reference, if not, then
30560 complain with a 206.
30562 (Argument.Emit): Emit addresses of variables.
30564 (Argument.FullDesc): Simplify.
30566 (Invocation.DoResolve): Update for Argument.Resolve.
30568 (ElementAccess.DoResolve): ditto.
30570 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
30571 method should be virtual, as this method is always virtual.
30573 (NewDelegate.DoResolve): Update for Argument.Resolve.
30575 * class.cs (ConstructorInitializer.DoResolve): ditto.
30577 * attribute.cs (Attribute.Resolve): ditto.
30579 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30581 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
30583 * expression.cs (ParameterReference): Drop IStackStorage and implement
30584 IAssignMethod instead.
30586 (LocalVariableReference): ditto.
30588 * ecore.cs (FieldExpr): Drop IStackStorage and implement
30589 IAssignMethod instead.
30591 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30593 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
30594 enumerations that are used in heavily used structures derive from
30595 byte in a laughable and pathetic attempt to reduce memory usage.
30596 This is the kind of pre-optimzations that you should not do at
30597 home without adult supervision.
30599 * expression.cs (UnaryMutator): New class, used to handle ++ and
30600 -- separatedly from the other unary operators. Cleans up the
30601 code, and kills the ExpressionStatement dependency in Unary.
30603 (Unary): Removed `method' and `Arguments' from this class, making
30604 it smaller, and moving it all to SimpleCall, so I can reuse this
30605 code in other locations and avoid creating a lot of transient data
30606 strucutres when not required.
30608 * cs-parser.jay: Adjust for new changes.
30610 2001-11-11 Miguel de Icaza <miguel@ximian.com>
30612 * enum.cs (Enum.Populate): If there is a failure during
30615 * cs-parser.jay (opt_enum_base): we used to catch type errors
30616 here, but this is really incorrect. The type error should be
30617 catched during semantic analysis.
30619 2001-12-11 Ravi Pratap <ravi@ximian.com>
30621 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
30622 current_local_parameters as expected since I, in my stupidity, had forgotten
30625 * attribute.cs (GetValidPlaces): Fix stupid bug.
30627 * class.cs (Method::Emit): Perform check on applicability of attributes.
30629 (Constructor::Emit): Ditto.
30631 (Field::Emit): Ditto.
30633 (Field.Location): Store location information.
30635 (Property, Event, Indexer, Operator): Ditto.
30637 * cs-parser.jay (field_declaration): Pass in location for each field.
30639 * ../errors/cs0592.cs : Add.
30641 2001-11-12 Ravi Pratap <ravi@ximian.com>
30643 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
30645 (InitCoreTypes): Update accordingly.
30647 (RegisterAttrType, LookupAttr): Implement.
30649 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
30650 info about the same.
30652 (Resolve): Update to populate the above as necessary.
30654 (Error592): Helper.
30656 (GetValidPlaces): Helper to the above.
30658 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
30660 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
30662 2001-11-12 Ravi Pratap <ravi@ximian.com>
30664 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
30666 * ../errors/cs0617.cs : Add.
30668 2001-11-11 Ravi Pratap <ravi@ximian.com>
30670 * enum.cs (Emit): Rename to Populate to be more consistent with what
30671 we expect it to do and when exactly it is called.
30673 * class.cs, rootcontext.cs : Update accordingly.
30675 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
30676 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
30678 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
30680 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
30681 of a fieldinfo using the above, when dealing with a FieldBuilder.
30683 2001-11-10 Ravi Pratap <ravi@ximian.com>
30685 * ../errors/cs0031.cs : Add.
30687 * ../errors/cs1008.cs : Add.
30689 * ../errrors/cs0543.cs : Add.
30691 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
30694 (FindMembers): Implement.
30696 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
30697 enums and delegates too.
30699 (enum_types): Rename to builder_to_enum.
30701 (delegate_types): Rename to builder_to_delegate.
30703 * delegate.cs (FindMembers): Implement.
30705 2001-11-09 Ravi Pratap <ravi@ximian.com>
30707 * typemanager.cs (IsEnumType): Implement.
30709 * enum.cs (Emit): Re-write parts to account for the underlying type
30710 better and perform checking etc.
30712 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
30713 of the underlying type.
30715 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
30718 * enum.cs (error31): Helper to report error #31.
30720 * cs-parser.jay (enum_declaration): Store location of each member too.
30722 * enum.cs (member_to_location): New hashtable.
30724 (AddEnumMember): Update location hashtable.
30726 (Emit): Use the location of each member while reporting errors.
30728 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30730 * cs-parser.jay: A for_initializer if is a
30731 local_variable_declaration really ammount to have an implicit
30732 block with the variable declaration and no initializer for for.
30734 * statement.cs (For.Emit): Cope with null initializers.
30736 This fixes the infinite loop on for initializers.
30738 2001-11-08 Miguel de Icaza <miguel@ximian.com>
30740 * enum.cs: More cleanup.
30742 * ecore.cs: Remove dead code.
30744 * class.cs (Property.Emit): More simplification.
30745 (Event.Emit): ditto.
30747 Reworked to have less levels of indentation.
30749 2001-11-08 Ravi Pratap <ravi@ximian.com>
30751 * class.cs (Property): Emit attributes.
30761 * enum.cs (Emit): Ditto.
30763 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
30766 * class.cs (Field, Event, etc.): Move attribute generation into the
30767 Emit method everywhere.
30769 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
30770 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
30771 as we had no way of defining nested enums !
30773 * rootcontext.cs : Adjust code accordingly.
30775 * typemanager.cs (AddEnumType): To keep track of enum types separately.
30777 2001-11-07 Ravi Pratap <ravi@ximian.com>
30779 * expression.cs (EvalConstantExpression): Move into ecore.cs
30781 * enum.cs (Enum): Rename some members and make them public and readonly
30782 according to our convention.
30784 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
30787 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
30789 (Enum::Emit): Write a simple version for now which doesn't try to compute
30790 expressions. I shall modify this to be more robust in just a while.
30792 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
30794 (TypeContainer::CloseType): Create the Enum types too.
30796 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
30798 * expression.cs (EvalConstantExpression): Get rid of completely.
30800 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
30801 user-defined values and other cases.
30803 (IsValidEnumLiteral): Helper function.
30805 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
30806 out there in the case we had a literal FieldExpr.
30808 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
30810 (Literalize): Revamp a bit to take two arguments.
30812 (EnumLiteral): New class which derives from Literal to wrap enum literals.
30814 2001-11-06 Ravi Pratap <ravi@ximian.com>
30816 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
30818 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
30820 (Resolve): Use the above to ensure we have proper initializers.
30822 2001-11-05 Ravi Pratap <ravi@ximian.com>
30824 * expression.cs (Expression::EvalConstantExpression): New method to
30825 evaluate constant expressions.
30827 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
30829 2001-11-07 Miguel de Icaza <miguel@ximian.com>
30831 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
30834 (Binary.ResolveOperator): Handle operator != (object a, object b)
30835 and operator == (object a, object b);
30837 (Binary.DoNumericPromotions): Indicate whether the numeric
30838 promotion was possible.
30840 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
30843 Made the ArrayAccess implement interface IAssignMethod instead of
30844 IStackStore as the order in which arguments are passed reflects
30847 * assign.cs: Instead of using expr.ExprClass to select the way of
30848 assinging, probe for the IStackStore/IAssignMethod interfaces.
30850 * typemanager.cs: Load InitializeArray definition.
30852 * rootcontext.cs (RootContext.MakeStaticData): Used to define
30853 static data that can be used to initialize arrays.
30855 2001-11-05 Miguel de Icaza <miguel@ximian.com>
30857 * expression.cs: Handle operator== and operator!= for booleans.
30859 (Conditioal.Reduce): Implement reducer for the ?: operator.
30861 (Conditional.Resolve): Implement dead code elimination.
30863 (Binary.Resolve): Catch string literals and return a new
30864 concatenated string.
30866 (Unary.Reduce): Implement reduction of unary expressions.
30868 * ecore.cs: Split out the expression core handling here.
30870 (Expression.Reduce): New method used to perform constant folding
30871 and CSE. This is needed to support constant-expressions.
30873 * statement.cs (Statement.EmitBoolExpression): Pass true and false
30874 targets, and optimize for !x.
30876 2001-11-04 Ravi Pratap <ravi@ximian.com>
30878 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
30879 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
30880 set custom atttributes.
30882 * literal.cs (Literal::GetValue): New abstract method to return the actual
30883 value of the literal, cast as an object.
30885 (*Literal): Implement GetValue method.
30887 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
30888 expressions to the arraylist but objects of type Argument.
30890 * class.cs (TypeContainer::Emit): Emit our attributes too.
30892 (Method::Emit, Constructor::Emit): Ditto.
30894 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
30895 to be ignoring earlier.
30897 2001-11-03 Ravi Pratap <ravi@ximian.com>
30899 * attribute.cs (AttributeSection::Define): Implement to do the business
30900 of constructing a CustomAttributeBuilder.
30902 (Attribute): New trivial class. Increases readability of code.
30904 * cs-parser.jay : Update accordingly.
30906 (positional_argument_list, named_argument_list, named_argument): New rules
30908 (attribute_arguments): Use the above so that we are more correct.
30910 2001-11-02 Ravi Pratap <ravi@ximian.com>
30912 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
30913 to perform all checks for a method with a params parameter.
30915 (Invocation::OverloadResolve): Update to use the above method and therefore
30916 cope correctly with params method invocations.
30918 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
30921 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
30922 constructors in our parent too because we can't afford to miss out on
30925 * attribute.cs (AttributeSection): New name for the class Attribute
30927 Other trivial changes to improve readability.
30929 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
30930 use the new class names.
30932 2001-11-01 Ravi Pratap <ravi@ximian.com>
30934 * class.cs (Method::Define): Complete definition for params types too
30936 (Indexer::Define): Ditto.
30938 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
30939 Cope everywhere with a request for info about the array parameter.
30941 2001-11-01 Ravi Pratap <ravi@ximian.com>
30943 * tree.cs (RecordNamespace): Fix up to check for the correct key.
30945 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
30946 local_variable_type to extract the string corresponding to the type.
30948 (local_variable_type): Fixup the action to use the new helper method.
30950 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
30953 * expression.cs : Clean out code which uses the above.
30955 2001-10-31 Ravi Pratap <ravi@ximian.com>
30957 * typemanager.cs (RegisterMethod): Check if we already have an existing key
30958 and bale out if necessary by returning a false.
30960 (RegisterProperty): Ditto.
30962 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
30963 and print out appropriate error messages.
30965 * interface.cs (everywhere): Ditto.
30967 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
30968 location to constructor.
30970 * class.cs (Property, Event, Indexer): Update accordingly.
30972 * ../errors/cs111.cs : Added.
30974 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
30975 of a method, as laid down by the spec.
30977 (Invocation::OverloadResolve): Use the above method.
30979 2001-10-31 Ravi Pratap <ravi@ximian.com>
30981 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
30982 now take a TypeContainer and a Parameters object.
30984 (ParameterData): Modify return type of ParameterModifier method to be
30985 Parameter.Modifier and not a string.
30987 (ReflectionParameters, InternalParameters): Update accordingly.
30989 * expression.cs (Argument::GetParameterModifier): Same here.
30991 * support.cs (InternalParameters::ParameterType): Find a better way of determining
30992 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
30993 symbol in it at all so maybe this is only for now.
30995 2001-10-30 Ravi Pratap <ravi@ximian.com>
30997 * support.cs (InternalParameters): Constructor now takes an extra argument
30998 which is the actual Parameters class.
31000 (ParameterDesc): Update to provide info on ref/out modifiers.
31002 * class.cs (everywhere): Update call to InternalParameters to pass in
31003 the second argument too.
31005 * support.cs (ParameterData): Add ParameterModifier, which is a method
31006 to return the modifier info [ref/out etc]
31008 (InternalParameters, ReflectionParameters): Implement the above.
31010 * expression.cs (Argument::ParameterModifier): Similar function to return
31011 info about the argument's modifiers.
31013 (Invocation::OverloadResolve): Update to take into account matching modifiers
31016 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
31017 a new SetFormalParameters object which we pass to InternalParameters.
31019 2001-10-30 Ravi Pratap <ravi@ximian.com>
31021 * expression.cs (NewArray): Merge into the ArrayCreation class.
31023 2001-10-29 Ravi Pratap <ravi@ximian.com>
31025 * expression.cs (NewArray): Merge classes NewBuiltinArray and
31026 NewUserdefinedArray into one as there wasn't much of a use in having
31029 * expression.cs (Argument): Change field's name to ArgType from Type.
31031 (Type): New readonly property which returns the proper type, taking into
31032 account ref/out modifiers.
31034 (everywhere): Adjust code accordingly for the above.
31036 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
31037 whether we are emitting for a ref or out parameter.
31039 * expression.cs (Argument::Emit): Use the above field to set the state.
31041 (LocalVariableReference::Emit): Update to honour the flag and emit the
31044 * parameter.cs (Attributes): Set the correct flags for ref parameters.
31046 * expression.cs (Argument::FullDesc): New function to provide a full desc.
31048 * support.cs (ParameterData): Add method ParameterDesc to the interface.
31050 (ReflectionParameters, InternalParameters): Implement the above method.
31052 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
31055 (Invocation::FullMethodDesc): Ditto.
31057 2001-10-29 Miguel de Icaza <miguel@ximian.com>
31059 * cs-parser.jay: Add extra production for the second form of array
31062 * expression.cs (ArrayCreation): Update to reflect the above
31065 * Small changes to prepare for Array initialization.
31067 2001-10-28 Miguel de Icaza <miguel@ximian.com>
31069 * typemanager.cs (ImplementsInterface): interface might be null;
31070 Deal with this problem;
31072 Also, we do store negative hits on the cache (null values), so use
31073 this instead of calling t.GetInterfaces on the type everytime.
31075 2001-10-28 Ravi Pratap <ravi@ximian.com>
31077 * typemanager.cs (IsBuiltinType): New method to help determine the same.
31079 * expression.cs (New::DoResolve): Get rid of array creation code and instead
31080 split functionality out into different classes.
31082 (New::FormArrayType): Move into NewBuiltinArray.
31084 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
31087 (NewBuiltinArray): New class to handle creation of built-in arrays.
31089 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
31090 account creation of one-dimensional arrays.
31092 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
31094 (NewUserdefinedArray::DoResolve): Implement.
31096 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
31098 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
31099 we maintain inside the TypeManager. This is necessary to perform lookups on the
31102 (LookupType): Update to perform GetType on the module builders too.
31104 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
31106 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
31108 2001-10-23 Ravi Pratap <ravi@ximian.com>
31110 * expression.cs (New::DoResolve): Implement guts of array creation.
31112 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
31114 2001-10-27 Miguel de Icaza <miguel@ximian.com>
31116 * expression.cs: Fix bug I introduced lsat night that broke
31119 (Expression.Resolve): Report a 246 error (can not resolve name)
31120 if we find a SimpleName in the stream.
31122 (Expression.ResolveLValue): Ditto.
31124 (Expression.ResolveWithSimpleName): This function is a variant of
31125 ResolveName, this one allows SimpleNames to be returned without a
31126 warning. The only consumer of SimpleNames is MemberAccess
31128 2001-10-26 Miguel de Icaza <miguel@ximian.com>
31130 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
31131 might arrive here. I have my doubts that this is correct.
31133 * statement.cs (Lock): Implement lock statement.
31135 * cs-parser.jay: Small fixes to support `lock' and `using'
31137 * cs-tokenizer.cs: Remove extra space
31139 * driver.cs: New flag --checked, allows to turn on integer math
31142 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
31143 Threading.Monitor.Exit
31145 2001-10-23 Miguel de Icaza <miguel@ximian.com>
31147 * expression.cs (IndexerAccess::DoResolveLValue): Set the
31148 Expression Class to be IndexerAccess.
31150 Notice that Indexer::DoResolve sets the eclass to Value.
31152 2001-10-22 Miguel de Icaza <miguel@ximian.com>
31154 * class.cs (TypeContainer::Emit): Emit code for indexers.
31156 * assign.cs (IAssignMethod): New interface implemented by Indexers
31157 and Properties for handling assignment.
31159 (Assign::Emit): Simplify and reuse code.
31161 * expression.cs (IndexerAccess, PropertyExpr): Implement
31162 IAssignMethod, clean up old code.
31164 2001-10-22 Ravi Pratap <ravi@ximian.com>
31166 * typemanager.cs (ImplementsInterface): New method to determine if a type
31167 implements a given interface. Provides a nice cache too.
31169 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
31172 (ConvertReferenceExplicit): Ditto.
31174 * delegate.cs (Delegate::Populate): Update to define the parameters on the
31175 various methods, with correct names etc.
31177 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
31178 Operator.UnaryNegation.
31180 * cs-parser.jay (operator_declarator): Be a little clever in the case where
31181 we have a unary plus or minus operator.
31183 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
31186 * everywhere : update accordingly.
31188 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
31191 * class.cs (Method::Define): For the case where we are implementing a method
31192 inherited from an interface, we need to set the MethodAttributes.Final flag too.
31193 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
31195 2001-10-21 Ravi Pratap <ravi@ximian.com>
31197 * interface.cs (FindMembers): Implement to work around S.R.E
31200 * typemanager.cs (IsInterfaceType): Implement.
31202 (FindMembers): Update to handle interface types too.
31204 * expression.cs (ImplicitReferenceConversion): Re-write bits which
31205 use IsAssignableFrom as that is not correct - it doesn't work.
31207 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
31208 and accordingly override EmitStatement.
31210 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
31211 using the correct logic :-)
31213 2001-10-19 Ravi Pratap <ravi@ximian.com>
31215 * ../errors/cs-11.cs : Add to demonstrate error -11
31217 2001-10-17 Miguel de Icaza <miguel@ximian.com>
31219 * assign.cs (Assign::Resolve): Resolve right hand side first, and
31220 then pass this as a hint to ResolveLValue.
31222 * expression.cs (FieldExpr): Add Location information
31224 (FieldExpr::LValueResolve): Report assignment to readonly
31227 (Expression::ExprClassFromMemberInfo): Pass location information.
31229 (Expression::ResolveLValue): Add new method that resolves an
31232 (Expression::DoResolveLValue): Default invocation calls
31235 (Indexers): New class used to keep track of indexers in a given
31238 (IStackStore): Renamed from LValue, as it did not really describe
31239 what this did. Also ResolveLValue is gone from this interface and
31240 now is part of Expression.
31242 (ElementAccess): Depending on the element access type
31244 * typemanager.cs: Add `indexer_name_type' as a Core type
31245 (System.Runtime.CompilerServices.IndexerNameAttribute)
31247 * statement.cs (Goto): Take a location.
31249 2001-10-18 Ravi Pratap <ravi@ximian.com>
31251 * delegate.cs (Delegate::VerifyDelegate): New method to verify
31252 if two delegates are compatible.
31254 (NewDelegate::DoResolve): Update to take care of the case when
31255 we instantiate a delegate from another delegate.
31257 * typemanager.cs (FindMembers): Don't even try to look up members
31258 of Delegate types for now.
31260 2001-10-18 Ravi Pratap <ravi@ximian.com>
31262 * delegate.cs (NewDelegate): New class to take care of delegate
31265 * expression.cs (New): Split the delegate related code out into
31266 the NewDelegate class.
31268 * delegate.cs (DelegateInvocation): New class to handle delegate
31271 * expression.cs (Invocation): Split out delegate related code into
31272 the DelegateInvocation class.
31274 2001-10-17 Ravi Pratap <ravi@ximian.com>
31276 * expression.cs (New::DoResolve): Implement delegate creation fully
31277 and according to the spec.
31279 (New::DoEmit): Update to handle delegates differently.
31281 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
31282 because of which we were printing out arguments in reverse order !
31284 * delegate.cs (VerifyMethod): Implement to check if the given method
31285 matches the delegate.
31287 (FullDelegateDesc): Implement.
31289 (VerifyApplicability): Implement.
31291 * expression.cs (Invocation::DoResolve): Update to accordingly handle
31292 delegate invocations too.
31294 (Invocation::Emit): Ditto.
31296 * ../errors/cs1593.cs : Added.
31298 * ../errors/cs1594.cs : Added.
31300 * delegate.cs (InstanceExpression, TargetMethod): New properties.
31302 2001-10-16 Ravi Pratap <ravi@ximian.com>
31304 * typemanager.cs (intptr_type): Core type for System.IntPtr
31306 (InitCoreTypes): Update for the same.
31308 (iasyncresult_type, asynccallback_type): Ditto.
31310 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
31313 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
31316 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
31317 the builders for the 4 members of a delegate type :-)
31319 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
31322 * expression.cs (New::DoResolve): Implement guts for delegate creation.
31324 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
31326 2001-10-15 Miguel de Icaza <miguel@ximian.com>
31328 * statement.cs (Break::Emit): Implement.
31329 (Continue::Emit): Implement.
31331 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
31332 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
31333 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
31334 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
31337 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
31338 properties that track the label for the current loop (begin of the
31339 loop and end of the loop).
31341 2001-10-15 Ravi Pratap <ravi@ximian.com>
31343 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
31344 use of emitting anything at all.
31346 * class.cs, rootcontext.cs : Get rid of calls to the same.
31348 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
31350 (Populate): Define the constructor correctly and set the implementation
31353 * typemanager.cs (delegate_types): New hashtable to hold delegates that
31356 (AddDelegateType): Implement.
31358 (IsDelegateType): Implement helper method.
31360 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
31362 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
31363 and accordingly handle it.
31365 * delegate.cs (Populate): Take TypeContainer argument.
31366 Implement bits to define the Invoke method. However, I still haven't figured out
31367 how to take care of the native int bit :-(
31369 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
31370 Qualify the name of the delegate, not its return type !
31372 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
31375 (StandardConversionExists): Checking for array types turns out to be recursive.
31377 (ConvertReferenceExplicit): Implement array conversion.
31379 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
31381 2001-10-12 Ravi Pratap <ravi@ximian.com>
31383 * cs-parser.jay (delegate_declaration): Store the fully qualified
31384 name as it is a type declaration.
31386 * delegate.cs (ReturnType, Name): Rename members to these. Make them
31389 (DefineDelegate): Renamed from Define. Does the same thing essentially,
31390 as TypeContainer::DefineType.
31392 (Populate): Method in which all the definition of the various methods (Invoke)
31395 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
31398 (CloseDelegate): Finally creates the delegate.
31400 * class.cs (TypeContainer::DefineType): Update to define delegates.
31401 (Populate, Emit and CloseType): Do the same thing here too.
31403 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
31404 delegates in all these operations.
31406 2001-10-14 Miguel de Icaza <miguel@ximian.com>
31408 * expression.cs: LocalTemporary: a new expression used to
31409 reference a temporary that has been created.
31411 * assign.cs: Handle PropertyAccess back here, so that we can
31412 provide the proper semantic access to properties.
31414 * expression.cs (Expression::ConvertReferenceExplicit): Implement
31415 a few more explicit conversions.
31417 * modifiers.cs: `NEW' modifier maps to HideBySig.
31419 * expression.cs (PropertyExpr): Make this into an
31420 ExpressionStatement, and support the EmitStatement code path.
31422 Perform get/set error checking, clean up the interface.
31424 * assign.cs: recognize PropertyExprs as targets, and if so, turn
31425 them into toplevel access objects.
31427 2001-10-12 Miguel de Icaza <miguel@ximian.com>
31429 * expression.cs: PropertyExpr::PropertyExpr: use work around the
31432 * typemanager.cs: Keep track here of our PropertyBuilders again to
31433 work around lameness in SRE.
31435 2001-10-11 Miguel de Icaza <miguel@ximian.com>
31437 * expression.cs (LValue::LValueResolve): New method in the
31438 interface, used to perform a second resolution pass for LValues.
31440 (This::DoResolve): Catch the use of this in static methods.
31442 (This::LValueResolve): Implement.
31444 (This::Store): Remove warning, assigning to `this' in structures
31447 (Invocation::Emit): Deal with invocation of
31448 methods on value types. We need to pass the address to structure
31449 methods rather than the object itself. (The equivalent code to
31450 emit "this" for structures leaves the entire structure on the
31451 stack instead of a pointer to it).
31453 (ParameterReference::DoResolve): Compute the real index for the
31454 argument based on whether the method takes or not a `this' pointer
31455 (ie, the method is static).
31457 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
31458 value types returned from functions when we need to invoke a
31459 method on the sturcture.
31462 2001-10-11 Ravi Pratap <ravi@ximian.com>
31464 * class.cs (TypeContainer::DefineType): Method to actually do the business of
31465 defining the type in the Modulebuilder or Typebuilder. This is to take
31466 care of nested types which need to be defined on the TypeBuilder using
31467 DefineNestedMethod.
31469 (TypeContainer::GetClassBases): Implement. Essentially the code from the
31470 methods in RootContext, only ported to be part of TypeContainer.
31472 (TypeContainer::GetInterfaceOrClass): Ditto.
31474 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
31476 * interface.cs (Interface::DefineInterface): New method. Does exactly
31477 what RootContext.CreateInterface did earlier, only it takes care of nested types
31480 (Interface::GetInterfaces): Move from RootContext here and port.
31482 (Interface::GetInterfaceByName): Same here.
31484 * rootcontext.cs (ResolveTree): Re-write.
31486 (PopulateTypes): Re-write.
31488 * class.cs (TypeContainer::Populate): Populate nested types too.
31489 (TypeContainer::Emit): Emit nested members too.
31491 * typemanager.cs (AddUserType): Do not make use of the FullName property,
31492 instead just use the name argument passed in as it is already fully
31495 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
31496 to TypeContainer mapping to see if a type is user-defined.
31498 * class.cs (TypeContainer::CloseType): Implement.
31500 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
31501 the default constructor.
31503 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
31506 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
31508 * interface.cs (CloseType): Create the type here.
31510 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
31513 Remove all the methods which are now in TypeContainer.
31515 2001-10-10 Ravi Pratap <ravi@ximian.com>
31517 * delegate.cs (Define): Re-write bits to define the delegate
31520 2001-10-10 Miguel de Icaza <miguel@ximian.com>
31522 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
31524 * expression.cs (ImplicitReferenceConversion): handle null as well
31525 as a source to convert to any reference type.
31527 * statement.cs (Return): Perform any implicit conversions to
31528 expected return type.
31530 Validate use of return statement.
31532 * codegen.cs (EmitContext): Pass the expected return type here.
31534 * class.cs (Method, Constructor, Property): Pass expected return
31535 type to EmitContext.
31537 2001-10-09 Miguel de Icaza <miguel@ximian.com>
31539 * expression.cs: Make DoResolve take an EmitContext instead of a
31542 Replaced `l' and `location' for `loc', for consistency.
31544 (Error, Warning): Remove unneeded Tc argument.
31546 * assign.cs, literal.cs, constant.cs: Update to new calling
31549 * codegen.cs: EmitContext now contains a flag indicating whether
31550 code is being generated in a static method or not.
31552 * cs-parser.jay: DecomposeQI, new function that replaces the old
31553 QualifiedIdentifier. Now we always decompose the assembled
31554 strings from qualified_identifier productions into a group of
31557 2001-10-08 Miguel de Icaza <miguel@ximian.com>
31559 * rootcontext.cs: Deal with field-less struct types correctly now
31560 by passing the size option to Define Type.
31562 * class.cs: Removed hack that created one static field.
31564 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31566 * statement.cs: Moved most of the code generation here.
31568 2001-10-09 Ravi Pratap <ravi@ximian.com>
31570 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
31573 (ElementAccess): Remove useless bits for now - keep checks as the spec
31576 2001-10-08 Ravi Pratap <ravi@ximian.com>
31578 * expression.cs (ElementAccess::DoResolve): Remove my crap code
31579 and start performing checks according to the spec.
31581 2001-10-07 Ravi Pratap <ravi@ximian.com>
31583 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
31584 rank_specifiers instead.
31586 (rank_specifiers): Change the order in which the rank specifiers are stored
31588 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
31590 * expression.cs (ElementAccess): Implement the LValue interface too.
31592 2001-10-06 Ravi Pratap <ravi@ximian.com>
31594 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
31595 except that user defined conversions are not included.
31597 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
31598 perform the conversion of the return type, if necessary.
31600 (New::DoResolve): Check whether we are creating an array or an object
31601 and accordingly do the needful.
31603 (New::Emit): Same here.
31605 (New::DoResolve): Implement guts of array creation.
31607 (New::FormLookupType): Helper function.
31609 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31611 * codegen.cs: Removed most of the code generation here, and move the
31612 corresponding code generation bits to the statement classes.
31614 Added support for try/catch/finalize and throw.
31616 * cs-parser.jay: Added support for try/catch/finalize.
31618 * class.cs: Catch static methods having the flags override,
31619 virtual or abstract.
31621 * expression.cs (UserCast): This user cast was not really doing
31622 what it was supposed to do. Which is to be born in fully resolved
31623 state. Parts of the resolution were being performed at Emit time!
31627 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31629 * expression.cs: Implicity convert the result from UserCast.
31631 2001-10-05 Ravi Pratap <ravi@ximian.com>
31633 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
31634 prevented it from working correctly.
31636 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
31637 merely ConvertImplicit.
31639 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31641 * typemanager.cs: Make the LookupTypeContainer function static,
31642 and not per-instance.
31644 * class.cs: Make static FindMembers (the one that takes a Type
31647 * codegen.cs: Add EmitForeach here.
31649 * cs-parser.jay: Make foreach a toplevel object instead of the
31650 inline expansion, as we need to perform semantic analysis on it.
31652 2001-10-05 Ravi Pratap <ravi@ximian.com>
31654 * expression.cs (Expression::ImplicitUserConversion): Rename to
31655 UserDefinedConversion.
31657 (Expression::UserDefinedConversion): Take an extra argument specifying
31658 whether we look for explicit user conversions too.
31660 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
31662 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
31664 (ExplicitUserConversion): Make it a call to UserDefinedConversion
31665 with the appropriate arguments.
31667 * cs-parser.jay (cast_expression): Record location too.
31669 * expression.cs (Cast): Record location info.
31671 (Expression::ConvertExplicit): Take location argument.
31673 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
31674 to determine if we are doing explicit conversions.
31676 (UserCast::Emit): Update accordingly.
31678 (Expression::ConvertExplicit): Report an error if everything fails.
31680 * ../errors/cs0030.cs : Add.
31682 2001-10-04 Miguel de Icaza <miguel@ximian.com>
31684 * modifiers.cs: If the ABSTRACT keyword is present, also set the
31685 virtual and newslot bits.
31687 * class.cs (TypeContainer::RegisterRequiredImplementations):
31688 Record methods we need.
31690 (TypeContainer::MakeKey): Helper function to make keys for
31691 MethodBases, since the Methodbase key is useless.
31693 (TypeContainer::Populate): Call RegisterRequiredImplementations
31694 before defining the methods.
31696 Create a mapping for method_builders_to_methods ahead of time
31697 instead of inside a tight loop.
31699 (::RequireMethods): Accept an object as the data to set into the
31700 hashtable so we can report interface vs abstract method mismatch.
31702 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31704 * report.cs: Make all of it static.
31706 * rootcontext.cs: Drop object_type and value_type computations, as
31707 we have those in the TypeManager anyways.
31709 Drop report instance variable too, now it is a global.
31711 * driver.cs: Use try/catch on command line handling.
31713 Add --probe option to debug the error reporting system with a test
31716 * report.cs: Add support for exiting program when a probe
31717 condition is reached.
31719 2001-10-03 Ravi Pratap <ravi@ximian.com>
31721 * expression.cs (Binary::DoNumericPromotions): Fix the case when
31722 we do a forcible conversion regardless of type, to check if
31723 ForceConversion returns a null.
31725 (Binary::error19): Use location to report error.
31727 (Unary::error23): Use location here too.
31729 * ../errors/cs0019.cs : Check in.
31731 * ../errors/cs0023.cs : Check in.
31733 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
31734 case of a non-null MethodInfo object with a length of 0 !
31736 (Binary::ResolveOperator): Flag error if overload resolution fails to find
31737 an applicable member - according to the spec :-)
31738 Also fix logic to find members in base types.
31740 (Unary::ResolveOperator): Same here.
31742 (Unary::report23): Change name to error23 and make first argument a TypeContainer
31743 as I was getting thoroughly confused between this and error19 :-)
31745 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
31746 (::FindMostEncompassedType): Implement.
31747 (::FindMostEncompassingType): Implement.
31748 (::StandardConversionExists): Implement.
31750 (UserImplicitCast): Re-vamp. We now need info about most specific
31751 source and target types so that we can do the necessary conversions.
31753 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
31754 mathematical union with no duplicates.
31756 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31758 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
31759 in order from base classes to child classes, so that we can in
31760 child classes look up in our parent for method names and
31761 attributes (required for handling abstract, virtual, new, override
31762 constructs: we need to instrospect our base class, and if we dont
31763 populate the classes in order, the introspection might be
31764 incorrect. For example, a method could query its parent before
31765 the parent has any methods and would determine that the parent has
31766 no abstract methods (while it could have had them)).
31768 (RootContext::CreateType): Record the order in which we define the
31771 2001-10-02 Miguel de Icaza <miguel@ximian.com>
31773 * class.cs (TypeContainer::Populate): Also method definitions can
31774 fail now, keep track of this.
31776 (TypeContainer::FindMembers): Implement support for
31777 DeclaredOnly/noDeclaredOnly flag.
31779 (Constructor::Emit) Return the ConstructorBuilder.
31781 (Method::Emit) Return the MethodBuilder.
31782 Check for abstract or virtual methods to be public.
31784 * rootcontext.cs (RootContext::CreateType): Register all the
31785 abstract methods required for the class to be complete and the
31786 interface methods that must be implemented.
31788 * cs-parser.jay: Report error 501 (method requires body if it is
31789 not marked abstract or extern).
31791 * expression.cs (TypeOf::Emit): Implement.
31793 * typemanager.cs: runtime_handle_type, new global type.
31795 * class.cs (Property::Emit): Generate code for properties.
31797 2001-10-02 Ravi Pratap <ravi@ximian.com>
31799 * expression.cs (Unary::ResolveOperator): Find operators on base type
31800 too - we now conform exactly to the spec.
31802 (Binary::ResolveOperator): Same here.
31804 * class.cs (Operator::Define): Fix minor quirk in the tests.
31806 * ../errors/cs0215.cs : Added.
31808 * ../errors/cs0556.cs : Added.
31810 * ../errors/cs0555.cs : Added.
31812 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31814 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
31815 single integer which is really efficient
31817 2001-10-01 Ravi Pratap <ravi@ximian.com>
31819 * expression.cs (Expression::ImplicitUserConversion): Use location
31820 even in the case when we are examining True operators.
31822 * class.cs (Operator::Define): Perform extensive checks to conform
31823 with the rules for operator overloading in the spec.
31825 * expression.cs (Expression::ImplicitReferenceConversion): Implement
31826 some of the other conversions mentioned in the spec.
31828 * typemanager.cs (array_type): New static member for the System.Array built-in
31831 (cloneable_interface): For System.ICloneable interface.
31833 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
31834 we start resolving the tree and populating types.
31836 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
31838 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31840 * expression.cs (Expression::ExprClassFromMemberInfo,
31841 Expression::Literalize): Create literal expressions from
31842 FieldInfos which are literals.
31844 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
31845 type casts, because they were wrong. The test suite in tests
31848 (ImplicitNumericConversion): ushort to ulong requires a widening
31851 Int32 constant to long requires widening cast as well.
31853 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
31854 for integers because the type on the stack is not i4.
31856 2001-09-30 Miguel de Icaza <miguel@ximian.com>
31858 * expression.cs (report118): require location argument.
31860 * parameter.cs: Do not dereference potential null value.
31862 * class.cs: Catch methods that lack the `new' keyword when
31863 overriding a name. Report warnings when `new' is used without
31864 anything being there to override.
31866 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
31868 * class.cs: Only add constructor to hashtable if it is non-null
31869 (as now constructors can fail on define).
31871 (TypeManager, Class, Struct): Take location arguments.
31873 Catch field instance initialization in structs as errors.
31875 accepting_filter: a new filter for FindMembers that is static so
31876 that we dont create an instance per invocation.
31878 (Constructor::Define): Catch errors where a struct constructor is
31881 * cs-parser.jay: Pass location information for various new
31884 * delegate.cs (Delegate): take a location argument.
31886 * driver.cs: Do not call EmitCode if there were problesm in the
31887 Definition of the types, as many Builders wont be there.
31889 * decl.cs (Decl::Decl): Require a location argument.
31891 * cs-tokenizer.cs: Handle properly hex constants that can not fit
31892 into integers, and find the most appropiate integer for it.
31894 * literal.cs: Implement ULongLiteral.
31896 * rootcontext.cs: Provide better information about the location of
31897 failure when CreateType fails.
31899 2001-09-29 Miguel de Icaza <miguel@ximian.com>
31901 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
31904 * expression.cs (Binary::CheckShiftArguments): Add missing type
31906 (Binary::ResolveOperator): Add type to the logical and and logical
31907 or, Bitwise And/Or and Exclusive Or code paths, it was missing
31910 (Binary::DoNumericPromotions): In the case where either argument
31911 is ulong (and most signed types combined with ulong cause an
31912 error) perform implicit integer constant conversions as well.
31914 2001-09-28 Miguel de Icaza <miguel@ximian.com>
31916 * expression.cs (UserImplicitCast): Method should always be
31918 (Invocation::BetterConversion): Simplified test for IntLiteral.
31920 (Expression::ImplicitNumericConversion): Split this routine out.
31921 Put the code that performs implicit constant integer conversions
31924 (Expression::Resolve): Become a wrapper around DoResolve so we can
31925 check eclass and type being set after resolve.
31927 (Invocation::Badness): Remove this dead function
31929 (Binary::ResolveOperator): Do not compute the expensive argumnets
31930 unless we have a union for it.
31932 (Probe::Emit): Is needs to do an isinst and then
31933 compare against null.
31935 (::CanConvert): Added Location argument. If the Location argument
31936 is null (Location.Null), then we do not report errors. This is
31937 used by the `probe' mechanism of the Explicit conversion. We do
31938 not want to generate an error for something that the user
31939 explicitly requested to be casted. But the pipeline for an
31940 explicit cast first tests for potential implicit casts.
31942 So for now, if the Location is null, it means `Probe only' to
31943 avoid adding another argument. Might have to revise this
31946 (ClassCast): New class used to type cast objects into arbitrary
31947 classes (used in Explicit Reference Conversions).
31949 Implement `as' as well.
31951 Reverted all the patches from Ravi below: they were broken:
31953 * The use of `level' as a mechanism to stop recursive
31954 invocations is wrong. That was there just to catch the
31955 bug with a strack trace but not as a way of addressing
31958 To fix the problem we have to *understand* what is going
31959 on and the interactions and come up with a plan, not
31960 just get things going.
31962 * The use of the type conversion cache that I proposed
31963 last night had an open topic: How does this work across
31964 protection domains. A user defined conversion might not
31965 be public in the location where we are applying the
31966 conversion, a different conversion might be selected
31967 (ie, private A->B (better) but public B->A (worse),
31968 inside A, A->B applies, but outside it, B->A will
31971 * On top of that (ie, even if the above is solved),
31972 conversions in a cache need to be abstract. Ie, `To
31973 convert from an Int to a Short use an OpcodeCast', not
31974 `To convert from an Int to a Short use the OpcodeCast on
31975 the variable 5' (which is what this patch was doing).
31977 2001-09-28 Ravi Pratap <ravi@ximian.com>
31979 * expression.cs (Invocation::ConversionExists): Re-write to use
31980 the conversion cache
31982 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
31983 cache all conversions done, not just user-defined ones.
31985 (Invocation::BetterConversion): The real culprit. Use ConversionExists
31986 to determine if a conversion exists instead of acutually trying to
31987 perform the conversion. It's faster too.
31989 (Expression::ConvertExplicit): Modify to use ConversionExists to check
31990 and only then attempt the implicit conversion.
31992 2001-09-28 Ravi Pratap <ravi@ximian.com>
31994 * expression.cs (ConvertImplicit): Use a cache for conversions
31995 already found. Check level of recursion and bail out if necessary.
31997 2001-09-28 Miguel de Icaza <miguel@ximian.com>
31999 * typemanager.cs (string_concat_string_string, string_concat_object_object):
32000 Export standard methods that we expect for string operations.
32002 * statement.cs (Block::UsageWarning): Track usage of variables and
32003 report the errors for not used variables.
32005 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
32008 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32010 * codegen.cs: remove unnneded code
32012 * expression.cs: Removed BuiltinTypeAccess class
32014 Fix the order in which implicit conversions are
32017 The previous fixed dropped support for boxed conversions (adding a
32018 test to the test suite now)
32020 (UserImplicitCast::CanConvert): Remove test for source being null,
32021 that code is broken. We should not feed a null to begin with, if
32022 we do, then we should track the bug where the problem originates
32023 and not try to cover it up here.
32025 Return a resolved expression of type UserImplicitCast on success
32026 rather than true/false. Ravi: this is what I was talking about,
32027 the pattern is to use a static method as a "constructor" for
32030 Also, do not create arguments until the very last minute,
32031 otherwise we always create the arguments even for lookups that
32032 will never be performed.
32034 (UserImplicitCast::Resolve): Eliminate, objects of type
32035 UserImplicitCast are born in a fully resolved state.
32037 * typemanager.cs (InitCoreTypes): Init also value_type
32038 (System.ValueType).
32040 * expression.cs (Cast::Resolve): First resolve the child expression.
32042 (LValue): Add new method AddressOf to be used by
32045 Change the argument of Store to take an EmitContext instead of an
32046 ILGenerator, because things like FieldExpr need to be able to call
32047 their children expression to generate the instance code.
32049 (Expression::Error, Expression::Warning): Sugar functions for
32052 (Expression::MemberLookup): Accept a TypeContainer instead of a
32053 Report as the first argument.
32055 (Expression::ResolvePrimary): Killed. I still want to improve
32056 this as currently the code is just not right.
32058 (Expression::ResolveMemberAccess): Simplify, but it is still
32061 (Unary::Resolve): Catch errors in AddressOf operators.
32063 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
32064 index to a byte for the short-version, or the compiler will choose
32065 the wrong Emit call, which generates the wrong data.
32067 (ParameterReference::Emit, ::Store): same.
32069 (FieldExpr::AddressOf): Implement.
32071 * typemanager.cs: TypeManager: made public variable instead of
32074 * driver.cs: document --fatal.
32076 * report.cs (ErrorMessage, WarningMessage): new names for the old
32077 Error and Warning classes.
32079 * cs-parser.jay (member_access): Turn built-in access to types
32080 into a normal simplename
32082 2001-09-27 Ravi Pratap <ravi@ximian.com>
32084 * expression.cs (Invocation::BetterConversion): Fix to cope
32085 with q being null, since this was introducing a bug.
32087 * expression.cs (ConvertImplicit): Do built-in conversions first.
32089 2001-09-27 Ravi Pratap <ravi@ximian.com>
32091 * expression.cs (UserImplicitCast::Resolve): Fix bug.
32093 2001-09-27 Ravi Pratap <ravi@ximian.com>
32095 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
32096 I had introduced long ago (what's new ?).
32098 * expression.cs (UserImplicitCast::CanConvert): Static method to do
32099 the work of all the checking.
32100 (ConvertImplicit): Call CanConvert and only then create object if necessary.
32101 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
32103 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
32104 that is the right way.
32106 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
32107 overloading resolution. Use everywhere instead of cutting and pasting code.
32109 (Binary::ResolveOperator): Use MakeUnionSet.
32111 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
32112 we have to convert to bool types. Not complete yet.
32114 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32116 * typemanager.cs (TypeManager::CSharpName): support ushort.
32118 * expression.cs (Expression::TryImplicitIntConversion): Attempts
32119 to provide an expression that performsn an implicit constant int
32120 conversion (section 6.1.6).
32121 (Expression::ConvertImplicitRequired): Reworked to include
32122 implicit constant expression conversions.
32124 (Expression::ConvertNumericExplicit): Finished.
32126 (Invocation::Emit): If InstanceExpression is null, then it means
32127 that we perform a call on this.
32129 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32131 * expression.cs (Unary::Emit): Remove some dead code.
32132 (Probe): Implement Resolve and Emit for `is'.
32133 (Expression::ConvertImplicitRequired): Attempt to do constant
32134 expression conversions here. Maybe should be moved to
32135 ConvertImplicit, but I am not sure.
32136 (Expression::ImplicitLongConstantConversionPossible,
32137 Expression::ImplicitIntConstantConversionPossible): New functions
32138 that tell whether is it possible to apply an implicit constant
32139 expression conversion.
32141 (ConvertNumericExplicit): Started work on explicit numeric
32144 * cs-parser.jay: Update operator constants.
32146 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
32147 (Parameters::GetSignature): Hook up VerifyArgs here.
32148 (Parameters::VerifyArgs): Verifies that no two arguments have the
32151 * class.cs (Operator): Update the operator names to reflect the
32152 ones that the spec expects (as we are just stringizing the
32155 * expression.cs (Unary::ResolveOperator): Fix bug: Use
32156 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
32157 previous usage did only work for our methods.
32158 (Expression::ConvertImplicit): Handle decimal implicit numeric
32159 conversions as well.
32160 (Expression::InternalTypeConstructor): Used to invoke constructors
32161 on internal types for default promotions.
32163 (Unary::Emit): Implement special handling for the pre/post
32164 increment/decrement for overloaded operators, as they need to have
32165 the same semantics as the other operators.
32167 (Binary::ResolveOperator): ditto.
32168 (Invocation::ConversionExists): ditto.
32169 (UserImplicitCast::Resolve): ditto.
32171 2001-09-26 Ravi Pratap <ravi@ximian.com>
32173 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
32174 operator, return after emitting body. Regression tests pass again !
32176 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
32177 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
32178 (Invocation::OverloadResolve): Ditto.
32179 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
32181 * everywhere : update calls to the above methods accordingly.
32183 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32185 * assign.cs (Assign): Make it inherit from ExpressionStatement.
32187 * expression.cs (ExpressionStatement): New base class used for
32188 expressions that can appear in statements, so that we can provide
32189 an alternate path to generate expression that do not leave a value
32192 (Expression::Emit, and all the derivatives): We no longer return
32193 whether a value is left on the stack or not. Every expression
32194 after being emitted leaves a single value on the stack.
32196 * codegen.cs (EmitContext::EmitStatementExpression): Use the
32197 facilties of ExpressionStatement if possible.
32199 * cs-parser.jay: Update statement_expression.
32201 2001-09-25 Miguel de Icaza <miguel@ximian.com>
32203 * driver.cs: Change the wording of message
32205 2001-09-25 Ravi Pratap <ravi@ximian.com>
32207 * expression.cs (Binary::ResolveOperator): Had forgottten to set
32208 the type of the expression to the return type of the method if
32209 we have an overloaded operator match ! The regression tests pass again !
32210 (Unary::ResolveOperator): Ditto.
32212 * expression.cs (Invocation::ConversionExists): Correct the member lookup
32213 to find "op_Implicit", not "implicit" ;-)
32214 (UserImplicitCast): New class to take care of user-defined implicit conversions.
32215 (ConvertImplicit, ForceConversion): Take TypeContainer argument
32217 * everywhere : Correct calls to the above accordingly.
32219 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
32220 (ConvertImplicit): Do user-defined conversion if it exists.
32222 2001-09-24 Miguel de Icaza <miguel@ximian.com>
32224 * assign.cs: track location.
32225 (Resolve): Use implicit conversions on assignment.
32227 * literal.cs: Oops. Not good, Emit of short access values should
32228 pass (Bytes) or the wrong argument will be selected.
32230 * expression.cs (Unary::Emit): Emit code for -expr.
32232 (Unary::ResolveOperator): Handle `Substract' for non-constants
32233 (substract from zero from the non-constants).
32234 Deal with Doubles as well.
32236 (Expression::ConvertImplicitRequired): New routine that reports an
32237 error if no implicit conversion exists.
32239 (Invocation::OverloadResolve): Store the converted implicit
32240 expressions if we make them
32242 2001-09-24 Ravi Pratap <ravi@ximian.com>
32244 * class.cs (ConstructorInitializer): Take a Location argument.
32245 (ConstructorBaseInitializer): Same here.
32246 (ConstructorThisInitializer): Same here.
32248 * cs-parser.jay : Update all calls accordingly.
32250 * expression.cs (Unary, Binary, New): Take location argument.
32251 Update accordingly everywhere.
32253 * cs-parser.jay : Update all calls to the above to take a location
32256 * class.cs : Ditto.
32258 2001-09-24 Ravi Pratap <ravi@ximian.com>
32260 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
32261 (Invocation::BetterConversion): Same here
32262 (Invocation::ConversionExists): Ditto.
32264 (Invocation::ConversionExists): Implement.
32266 2001-09-22 Ravi Pratap <ravi@ximian.com>
32268 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
32269 Also take an additional TypeContainer argument.
32271 * All over : Pass in TypeContainer as argument to OverloadResolve.
32273 * typemanager.cs (CSharpName): Update to check for the string type and return
32276 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
32279 2001-09-21 Ravi Pratap <ravi@ximian.com>
32281 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
32282 (Invocation::BetterFunction): Implement.
32283 (Invocation::BetterConversion): Implement.
32284 (Invocation::ConversionExists): Skeleton, no implementation yet.
32286 Okay, things work fine !
32288 2001-09-21 Miguel de Icaza <miguel@ximian.com>
32290 * typemanager.cs: declare and load enum_type, delegate_type and
32293 * expression.cs (Expression::Emit): Now emit returns a value that
32294 tells whether a value is left on the stack or not. This strategy
32295 might be reveted tomorrow with a mechanism that would address
32296 multiple assignments.
32297 (Expression::report118): Utility routine to report mismatches on
32300 (Unary::Report23): Report impossible type/operator combination
32303 (Unary::IsIncrementableNumber): Whether the type can be
32304 incremented or decremented with add.
32305 (Unary::ResolveOperator): Also allow enumerations to be bitwise
32307 (Unary::ResolveOperator): Implement ++, !, ~,
32309 (Invocation::Emit): Deal with new Emit convetion.
32311 * All Expression derivatives: Updated their Emit method to return
32312 whether they leave values on the stack or not.
32314 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
32315 stack for expressions that are statements.
32317 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32319 * expression.cs (LValue): New interface. Must be implemented by
32321 (LocalVariableReference, ParameterReference, FieldExpr): Implement
32324 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
32325 interface for generating code, simplifies the code.
32327 2001-09-20 Ravi Pratap <ravi@ximian.com>
32329 * expression.cs (everywhere): Comment out return statements in ::Resolve
32330 methods to avoid the warnings.
32332 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32334 * driver.cs (parse): Report error 2001 if we can not open the
32337 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
32340 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
32343 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
32344 otherwise nested blocks end up with the same index.
32346 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
32348 * expression.cs: Instead of having FIXMEs in the Resolve
32349 functions, throw exceptions so it is obvious that we are facing a
32352 * cs-parser.jay (invocation_expression): Pass Location information.
32354 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
32355 Use a basename for those routines because .NET does not like paths
32358 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
32361 2001-09-19 Miguel de Icaza <miguel@ximian.com>
32363 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
32364 are loading the correct data types (throws an exception if not).
32365 (TypeManager::InitCoreTypes): Use CoreLookupType
32367 * expression.cs (Unary::ResolveOperator): return the child
32368 expression for expressions which are just +expr.
32369 (Unary::ResolveOperator): Return negative literals for -LITERAL
32370 expressions (otherwise they are Unary {Literal}).
32371 (Invocation::Badness): Take into account `Implicit constant
32372 expression conversions'.
32374 * literal.cs (LongLiteral): Implement long literal class.
32375 (IntLiteral): export the `Value' of the intliteral.
32377 2001-09-19 Ravi Pratap <ravi@ximian.com>
32379 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
32381 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
32382 instead of 'Operator'
32384 * expression.cs (Binary::ResolveOperator): Update accordingly.
32385 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
32388 * cs-parser.jay (unary_expression): Update to use the new names.
32390 * gen-treedump.cs (GetUnary): Same here.
32392 * expression.cs (Unary::Resolve): Implement.
32393 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
32394 operators are found instead of making noise ;-)
32395 (Unary::ResolveOperator): New method to do precisely the same thing which
32396 Binary::ResolveOperator does for Binary expressions.
32397 (Unary.method, .Arguments): Add.
32398 (Unary::OperName): Implement.
32399 (Unary::ForceConversion): Copy and Paste !
32401 * class.cs (Operator::Define): Fix a small bug for the case when we have
32404 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
32405 for the inbuilt operators. Only overloading works for now ;-)
32407 2001-09-18 Miguel de Icaza <miguel@ximian.com>
32409 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
32410 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
32412 * expression.cs (This::Emit): Implement.
32413 (This::Resolve): Implement.
32414 (TypeOf:Resolve): Implement.
32415 (Expression::ResolveSimpleName): Add an implicit this to instance
32417 (MemberAccess::Resolve): Deal with Parameters and Fields.
32418 Bind instance variable to Field expressions.
32419 (FieldExpr::Instance): New field used to track the expression that
32420 represents the object instance.
32421 (FieldExpr::Resolve): Track potential errors from MemberLookup not
32423 (FieldExpr::Emit): Implement.
32425 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
32426 the last instruction contains a return opcode to avoid generating
32427 the last `ret' instruction (this generates correct code, and it is
32428 nice to pass the peverify output).
32430 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
32431 initializer for static and instance variables.
32432 (Constructor::Emit): Allow initializer to be null in the case of
32433 static constructors. Only emit initializer for instance
32436 (TypeContainer::FindMembers): Return a null array if there are no
32439 Also fix the code for the MemberTypes.Method branch, as it was not
32440 scanning that for operators (or tried to access null variables before).
32442 * assign.cs (Assign::Emit): Handle instance and static fields.
32446 * driver.cs: Stop compilation if there are parse errors.
32448 * cs-parser.jay (constructor_declaration): Provide default base
32449 initializer for non-static constructors.
32450 (constructor_declarator): Do not provide a default base
32451 initializers if none was specified.
32452 Catch the fact that constructors should not have parameters.
32454 * class.cs: Do not emit parent class initializers for static
32455 constructors, that should be flagged as an error.
32457 2001-09-18 Ravi Pratap <ravi@ximian.com>
32459 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
32460 Move back code into TypeContainer::Populate.
32462 2001-09-18 Ravi Pratap <ravi@ximian.com>
32464 * class.cs (TypeContainer::AddConstructor): Fix the check to
32465 compare against Name, not Basename.
32466 (Operator::OpType): Change Plus and Minus to Add and Subtract.
32468 * cs-parser.jay : Update accordingly.
32470 * class.cs (TypeContainer::FindMembers): For the case where we are searching
32471 for methods, don't forget to look into the operators too.
32472 (RegisterMethodBuilder): Helper method to take care of this for
32473 methods, constructors and operators.
32474 (Operator::Define): Completely revamp.
32475 (Operator.OperatorMethod, MethodName): New fields.
32476 (TypeContainer::Populate): Move the registering of builders into
32477 RegisterMethodBuilder.
32478 (Operator::Emit): Re-write.
32480 * expression.cs (Binary::Emit): Comment out code path to emit method
32481 invocation stuff for the case when we have a user defined operator. I am
32482 just not able to get it right !
32484 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32486 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
32489 (Expression::MemberLookup): Provide a version that allows to
32490 specify the MemberTypes and BindingFlags.
32492 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
32493 so it was not fetching variable information from outer blocks.
32495 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
32496 Beforefieldinit as it was buggy.
32498 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
32499 that Ravi put here.
32501 * class.cs (Constructor::Emit): Only emit if block is not null.
32502 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
32503 deal with this by semantically definining it as if the user had
32506 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
32507 constructors as we now "emit" them at a higher level.
32509 (TypeContainer::DefineDefaultConstructor): Used to define the
32510 default constructors if none was provided.
32512 (ConstructorInitializer): Add methods Resolve and Emit.
32514 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
32516 2001-09-17 Ravi Pratap <ravi@ximian.com>
32518 * class.cs (TypeContainer::EmitDefaultConstructor): Register
32519 the default constructor builder with our hashtable for methodbuilders
32522 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
32523 and argument_count is 0 in which case we have a match.
32524 (Binary::ResolveOperator): More null checking and miscellaneous coding
32527 2001-09-17 Ravi Pratap <ravi@ximian.com>
32529 * rootcontext.cs (IsNameSpace): Compare against null.
32531 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
32533 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
32534 and Unary::Operator.
32536 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
32539 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
32540 we have overloaded operators.
32541 (Binary::ResolveOperator): Implement the part which does the operator overload
32544 * class.cs (Operator::Emit): Implement.
32545 (TypeContainer::Emit): Emit the operators we have too.
32547 * expression.cs (Binary::Emit): Update to emit the appropriate code for
32548 the case when we have a user-defined operator.
32550 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32552 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
32554 2001-09-16 Ravi Pratap <ravi@ximian.com>
32556 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
32557 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
32558 (Constructor::Emit): Implement.
32559 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
32560 if we have no work to do.
32561 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
32564 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
32565 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
32567 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
32570 2001-09-15 Ravi Pratap <ravi@ximian.com>
32572 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
32574 (Tree::RecordNamespace): Method to do what the name says ;-)
32575 (Tree::Namespaces): Property to get at the namespaces hashtable.
32577 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
32580 * rootcontext.cs (IsNamespace): Fixed it :-)
32582 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32584 * class.cs (TypeContainer::FindMembers): Add support for
32586 (MethodCore): New class that encapsulates both the shared aspects
32587 of a Constructor and a Method.
32588 (Method, Constructor): Factored pieces into MethodCore.
32590 * driver.cs: Added --fatal which makes errors throw exceptions.
32591 Load System assembly as well as part of the standard library.
32593 * report.cs: Allow throwing exceptions on errors for debugging.
32595 * modifiers.cs: Do not use `parent', instead use the real type
32596 container to evaluate permission settings.
32598 * class.cs: Put Ravi's patch back in. He is right, and we will
32599 have to cope with the
32601 2001-09-14 Ravi Pratap <ravi@ximian.com>
32603 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
32604 FamORAssem, not FamANDAssem.
32606 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32608 * driver.cs: Added --parse option that only parses its input files
32611 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
32612 incorrect. IsTopLevel is not used to tell whether an object is
32613 root_types or not (that can be achieved by testing this ==
32614 root_types). But to see if this is a top-level *class* (not
32615 necessarly our "toplevel" container).
32617 2001-09-14 Ravi Pratap <ravi@ximian.com>
32619 * enum.cs (Enum::Define): Modify to call the Lookup method on the
32620 parent instead of a direct call to GetType.
32622 2001-09-14 Ravi Pratap <ravi@ximian.com>
32624 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
32625 Modifiers.TypeAttr. This should just be a call to that method.
32627 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
32628 object so that we can determine if we are top-level or not.
32630 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
32633 * enum.cs (Enum::Define): Ditto.
32635 * modifiers.cs (FieldAttr): Re-write.
32637 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
32638 (TypeContainer::HaveStaticConstructor): New property to provide access
32639 to precisely that info.
32641 * modifiers.cs (MethodAttr): Re-write.
32642 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
32644 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
32645 of top-level types as claimed.
32647 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32649 * expression.cs (MemberLookup): Fruitless attempt to lookup
32650 constructors. Maybe I need to emit default constructors? That
32651 might be it (currently .NET emits this for me automatically).
32652 (Invocation::OverloadResolve): Cope with Arguments == null.
32653 (Invocation::EmitArguments): new function, shared by the new
32654 constructor and us.
32655 (Invocation::Emit): Handle static and instance methods. Emit
32656 proper call instruction for virtual or non-virtual invocations.
32657 (New::Emit): Implement.
32658 (New::Resolve): Implement.
32659 (MemberAccess:Resolve): Implement.
32660 (MethodGroupExpr::InstanceExpression): used conforming to the spec
32661 to track instances.
32662 (FieldExpr::Resolve): Set type.
32664 * support.cs: Handle empty arguments.
32666 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
32667 SimpleLookup): Auxiliary routines to help parse a qualifier
32670 Update qualifier_identifier rule.
32672 * codegen.cs: Removed debugging messages.
32674 * class.cs: Make this a global thing, this acts just as a "key" to
32675 objects that we might have around.
32677 (Populate): Only initialize method_builders_to_methods once.
32679 * expression.cs (PropertyExpr): Initialize type from the
32682 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
32683 Resolve pattern. Attempt to implicitly convert value to boolean.
32686 * expression.cs: Set the type for the int32/int32 argument case.
32687 (Binary::ResolveOperator): Set the return type to boolean for
32688 comparission operators
32690 * typemanager.cs: Remove debugging print code.
32692 (Invocation::Resolve): resolve type.
32694 * class.cs: Allocate a MemberInfo of the correct size, as the code
32695 elsewhere depends on the test to reflect the correct contents.
32697 (Method::) Keep track of parameters, due to System.Reflection holes
32699 (TypeContainer::Populate): Keep track of MethodBuilders to Method
32702 (TypeContainer::FindMembers): Use ArrayList and then copy an array
32703 of the exact size and return that.
32705 (Class::LookupMethodByBuilder): New function that maps
32706 MethodBuilders to its methods. Required to locate the information
32707 on methods because System.Reflection bit us again.
32709 * support.cs: New file, contains an interface ParameterData and
32710 two implementations: ReflectionParameters and InternalParameters
32711 used to access Parameter information. We will need to grow this
32714 * expression.cs (Invocation::GetParameterData): implement a cache
32715 and a wrapper around the ParameterData creation for methods.
32716 (Invocation::OverloadResolve): Use new code.
32718 2001-09-13 Ravi Pratap <ravi@ximian.com>
32720 * class.cs (TypeContainer::EmitField): Remove and move into
32721 (Field::Define): here and modify accordingly.
32722 (Field.FieldBuilder): New member.
32723 (TypeContainer::Populate): Update accordingly.
32724 (TypeContainer::FindMembers): Implement.
32726 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32728 * statement.cs: (VariableInfo::VariableType): New field to be
32729 initialized with the full type once it is resolved.
32731 2001-09-12 Miguel de Icaza <miguel@ximian.com>
32733 * parameter.cs (GetParameterInfo): Use a type cache to compute
32734 things only once, and to reuse this information
32736 * expression.cs (LocalVariableReference::Emit): Implement.
32737 (OpcodeCast::Emit): fix.
32739 (ParameterReference::Resolve): Implement.
32740 (ParameterReference::Emit): Implement.
32742 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
32743 that are expressions need to stay as Expressions.
32745 * typemanager.cs (CSharpName): Returns the C# name of a type if
32748 * expression.cs (Expression::ConvertImplicit): New function that
32749 implements implicit type conversions.
32751 (Expression::ImplicitReferenceConversion): Implements implicit
32752 reference conversions.
32754 (EmptyCast): New type for transparent casts.
32756 (OpcodeCast): New type for casts of types that are performed with
32757 a sequence of bytecodes.
32759 (BoxedCast): New type used for casting value types into reference
32760 types. Emits a box opcode.
32762 (Binary::DoNumericPromotions): Implements numeric promotions of
32763 and computation of the Binary::Type.
32765 (Binary::EmitBranchable): Optimization.
32767 (Binary::Emit): Implement code emission for expressions.
32769 * typemanager.cs (TypeManager): Added two new core types: sbyte
32772 2001-09-12 Ravi Pratap <ravi@ximian.com>
32774 * class.cs (TypeContainer::FindMembers): Method which does exactly
32775 what Type.FindMembers does, only we don't have to use reflection. No
32776 implementation yet.
32778 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
32779 typecontainer objects as we need to get at them.
32780 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
32782 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
32783 typecontainer object.
32785 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
32786 of just a Report object.
32788 2001-09-11 Ravi Pratap <ravi@ximian.com>
32790 * class.cs (Event::Define): Go back to using the prefixes "add_" and
32792 (TypeContainer::Populate): Now define the delegates of the type too.
32793 (TypeContainer.Delegates): Property to access the list of delegates defined
32796 * delegates.cs (Delegate::Define): Implement partially.
32798 * modifiers.cs (TypeAttr): Handle more flags.
32800 2001-09-11 Ravi Pratap <ravi@ximian.com>
32802 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
32804 (Operator::Define): Re-write logic to get types by using the LookupType method
32805 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
32806 (Indexer::Define): Ditto.
32807 (Event::Define): Ditto.
32808 (Property::Define): Ditto.
32810 2001-09-10 Ravi Pratap <ravi@ximian.com>
32812 * class.cs (TypeContainer::Populate): Now define operators too.
32813 (TypeContainer.Operators): New property to access the list of operators
32815 (Operator.OperatorMethodBuilder): New member to hold the method builder
32816 for the operator we are defining.
32817 (Operator::Define): Implement.
32819 2001-09-10 Ravi Pratap <ravi@ximian.com>
32821 * class.cs (Event::Define): Make the prefixes of the accessor methods
32822 addOn_ and removeOn_
32824 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
32825 of the location being passed in too. Ideally, this should go later since all
32826 error reporting should be done through the Report object.
32828 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
32829 (Populate): Iterate thru the indexers we have and define them too.
32830 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
32831 for the get and set accessors.
32832 (Indexer::Define): Implement.
32834 2001-09-09 Miguel de Icaza <miguel@ximian.com>
32836 * expression.cs (Binary::Resolve): Beginning of it. I scratched
32837 my previous implementation, did not work.
32839 * typemanager.cs: Add a couple of missing types (the longs).
32841 * literal.cs: Use TypeManager.bool_type instead of getting it.
32843 * expression.cs (EventExpr): New kind of expressions.
32844 (Expressio::ExprClassFromMemberInfo): finish
32846 2001-09-08 Miguel de Icaza <miguel@ximian.com>
32848 * assign.cs: Emit stores to static fields differently.
32850 2001-09-08 Ravi Pratap <ravi@ximian.com>
32852 * Merge in changes and adjust code to tackle conflicts. Backed out my
32853 code in Assign::Resolve ;-)
32855 2001-09-08 Ravi Pratap <ravi@ximian.com>
32857 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
32858 instead Report.Error and also pass in the location.
32859 (CSharpParser::Lexer): New readonly property to return the reference
32860 to the Tokenizer object.
32861 (declare_local_variables): Use Report.Error with location instead of plain
32865 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
32866 (Operator.CheckBinaryOperator): Ditto.
32868 * cs-parser.jay (operator_declarator): Update accordingly.
32870 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
32871 (CheckBinaryOperator): Same here.
32873 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
32874 on the name without any prefixes of namespace names etc. This is because we
32875 already might have something already fully qualified like
32876 'System.Console.WriteLine'
32878 * assign.cs (Resolve): Begin implementation. Stuck ;-)
32880 2001-09-07 Ravi Pratap <ravi@ximian.com>
32882 * cs-tokenizer.cs (location): Return a string which also contains
32885 * expression.cs (ElementAccess): New class for expressions of the
32886 type 'element access.'
32887 (BaseAccess): New class for expressions of the type 'base access.'
32888 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
32891 * cs-parser.jay (element_access): Implement action.
32892 (base_access): Implement actions.
32893 (checked_expression, unchecked_expression): Implement.
32895 * cs-parser.jay (local_variable_type): Correct and implement.
32896 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
32898 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
32900 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
32901 name and the specifiers.
32903 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
32905 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
32906 making them all public ;-)
32908 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
32911 2001-09-07 Miguel de Icaza <miguel@ximian.com>
32913 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
32915 (FieldExpr, PropertyExprs): New resolved expressions.
32916 (SimpleName::MemberStaticCheck): Perform static checks for access
32917 to non-static fields on static methods. Maybe this should be
32918 generalized for MemberAccesses.
32919 (SimpleName::ResolveSimpleName): More work on simple name
32922 * cs-parser.jay (primary_expression/qualified_identifier): track
32923 the parameter index.
32925 * codegen.cs (CodeGen::Save): Catch save exception, report error.
32926 (EmitContext::EmitBoolExpression): Chain to expression generation
32927 instead of temporary hack.
32928 (::EmitStatementExpression): Put generic expression code generation.
32930 * assign.cs (Assign::Emit): Implement variable assignments to
32931 local variables, parameters and fields.
32933 2001-09-06 Miguel de Icaza <miguel@ximian.com>
32935 * statement.cs (Block::GetVariableInfo): New method, returns the
32936 VariableInfo for a variable name in a block.
32937 (Block::GetVariableType): Implement in terms of GetVariableInfo
32939 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
32940 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
32942 2001-09-06 Ravi Pratap <ravi@ximian.com>
32944 * cs-parser.jay (operator_declaration): Continue on my quest : update
32945 to take attributes argument.
32946 (event_declaration): Ditto.
32947 (enum_declaration): Ditto.
32948 (indexer_declaration): Ditto.
32950 * class.cs (Operator::Operator): Update constructor accordingly.
32951 (Event::Event): Ditto.
32953 * delegate.cs (Delegate::Delegate): Same here.
32955 * enum.cs (Enum::Enum): Same here.
32957 2001-09-05 Ravi Pratap <ravi@ximian.com>
32959 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
32961 * ../tests/cs0658.cs : New file to demonstrate error 0658.
32963 * attribute.cs (Attributes): New class to encapsulate all attributes which were
32964 being passed around as an arraylist.
32965 (Attributes::AddAttribute): Method to add attribute sections.
32967 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
32968 (struct_declaration): Update accordingly.
32969 (constant_declaration): Update.
32970 (field_declaration): Update.
32971 (method_header): Update.
32972 (fixed_parameter): Update.
32973 (parameter_array): Ditto.
32974 (property_declaration): Ditto.
32975 (destructor_declaration): Ditto.
32977 * class.cs (Struct::Struct): Update constructors accordingly.
32978 (Class::Class): Ditto.
32979 (Field::Field): Ditto.
32980 (Method::Method): Ditto.
32981 (Property::Property): Ditto.
32982 (TypeContainer::OptAttribute): update property's return type.
32984 * interface.cs (Interface.opt_attributes): New member.
32985 (Interface::Interface): Update to take the extra Attributes argument.
32987 * parameter.cs (Parameter::Parameter): Ditto.
32989 * constant.cs (Constant::Constant): Ditto.
32991 * interface.cs (InterfaceMemberBase): New OptAttributes field.
32992 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
32993 the attributes as a parameter.
32994 (InterfaceProperty): Update constructor call.
32995 (InterfaceEvent): Ditto.
32996 (InterfaceMethod): Ditto.
32997 (InterfaceIndexer): Ditto.
32999 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
33000 pass the attributes too.
33001 (interface_event_declaration): Ditto.
33002 (interface_property_declaration): Ditto.
33003 (interface_method_declaration): Ditto.
33004 (interface_declaration): Ditto.
33006 2001-09-05 Miguel de Icaza <miguel@ximian.com>
33008 * class.cs (Method::Define): Track the "static Main" definition to
33009 create an entry point.
33011 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
33012 EntryPoint if we find it.
33014 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
33015 (EmitContext::ig): Make this variable public.
33017 * driver.cs: Make the default output file be the first file name
33018 with the .exe extension.
33020 Detect empty compilations
33022 Handle various kinds of output targets. Handle --target and
33023 rename -t to --dumper.
33025 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
33026 methods inherited from Expression return now an Expression. This
33027 will is used during the tree rewriting as we resolve them during
33030 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
33031 the spec. Missing entirely is the information about
33032 accessability of elements of it.
33034 (Expression::ExprClassFromMemberInfo): New constructor for
33035 Expressions that creates a fully initialized Expression based on
33036 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
33039 (Invocation::Resolve): Begin implementing resolution of invocations.
33041 * literal.cs (StringLiteral): Implement Emit.
33043 2001-09-05 Ravi Pratap <ravi@ximian.com>
33045 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
33048 2001-09-04 Ravi Pratap <ravi@ximian.com>
33050 * cs-parser.jay (attribute_arguments): Implement actions.
33051 (attribute): Fix bug in production. Implement action.
33052 (attribute_list): Implement.
33053 (attribute_target): Implement.
33054 (attribute_target_specifier, opt_target_specifier): Implement
33055 (CheckAttributeTarget): New method to check if the attribute target
33057 (attribute_section): Implement.
33058 (opt_attributes): Implement.
33060 * attribute.cs : New file to handle attributes.
33061 (Attribute): Class to hold attribute info.
33063 * cs-parser.jay (opt_attribute_target_specifier): Remove production
33064 (attribute_section): Modify production to use 2 different rules to
33065 achieve the same thing. 1 s/r conflict down !
33066 Clean out commented, useless, non-reducing dimension_separator rules.
33068 * class.cs (TypeContainer.attributes): New member to hold list
33069 of attributes for a type.
33070 (Struct::Struct): Modify to take one more argument, the attribute list.
33071 (Class::Class): Ditto.
33072 (Field::Field): Ditto.
33073 (Method::Method): Ditto.
33074 (Property::Property): Ditto.
33076 * cs-parser.jay (struct_declaration): Update constructor call to
33077 pass in the attributes too.
33078 (class_declaration): Ditto.
33079 (constant_declaration): Ditto.
33080 (field_declaration): Ditto.
33081 (method_header): Ditto.
33082 (fixed_parameter): Ditto.
33083 (parameter_array): Ditto.
33084 (property_declaration): Ditto.
33086 * constant.cs (Constant::Constant): Update constructor similarly.
33087 Use System.Collections.
33089 * parameter.cs (Parameter::Parameter): Update as above.
33091 2001-09-02 Ravi Pratap <ravi@ximian.com>
33093 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
33094 (TypeContainer.delegates): New member to hold list of delegates.
33096 * cs-parser.jay (delegate_declaration): Implement the action correctly
33097 this time as I seem to be on crack ;-)
33099 2001-09-02 Miguel de Icaza <miguel@ximian.com>
33101 * rootcontext.cs (RootContext::IsNamespace): new function, used to
33102 tell whether an identifier represents a namespace.
33104 * expression.cs (NamespaceExpr): A namespace expression, used only
33105 temporarly during expression resolution.
33106 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
33107 utility functions to resolve names on expressions.
33109 2001-09-01 Miguel de Icaza <miguel@ximian.com>
33111 * codegen.cs: Add hook for StatementExpressions.
33113 * class.cs: Fix inverted test for static flag in methods.
33115 2001-09-02 Ravi Pratap <ravi@ximian.com>
33117 * class.cs (Operator::CheckUnaryOperator): Correct error number used
33118 to make it coincide with MS' number.
33119 (Operator::CheckBinaryOperator): Ditto.
33121 * ../errors/errors.txt : Remove error numbers added earlier.
33123 * ../errors/cs1019.cs : Test case for error # 1019
33125 * ../errros/cs1020.cs : Test case for error # 1020
33127 * cs-parser.jay : Clean out commented cruft.
33128 (dimension_separators, dimension_separator): Comment out. Ostensibly not
33129 used anywhere - non-reducing rule.
33130 (namespace_declarations): Non-reducing rule - comment out.
33132 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
33133 with TypeContainer::AddEnum.
33135 * delegate.cs : New file for delegate handling classes.
33136 (Delegate): Class for declaring delegates.
33138 * makefile : Update.
33140 * cs-parser.jay (delegate_declaration): Implement.
33142 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
33144 * class.cs (Event::Define): Implement.
33145 (Event.EventBuilder): New member.
33147 * class.cs (TypeContainer::Populate): Update to define all enums and events
33149 (Events): New property for the events arraylist we hold. Shouldn't we move to using
33150 readonly fields for all these cases ?
33152 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33154 * class.cs (Property): Revamp to use the convention of making fields readonly.
33155 Accordingly modify code elsewhere.
33157 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
33158 the Define method of the Property class.
33160 * class.cs : Clean up applied patch and update references to variables etc. Fix
33162 (TypeContainer::Populate): Update to define all the properties we have. Also
33163 define all enumerations.
33165 * enum.cs (Define): Implement.
33167 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33169 * cs-parser.jay (overloadable_operator): The semantic value is an
33170 enum of the Operator class.
33171 (operator_declarator): Implement actions.
33172 (operator_declaration): Implement.
33174 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
33175 validity of definitions.
33176 (Operator::CheckBinaryOperator): Static method to check for binary operators
33177 (TypeContainer::AddOperator): New method to add an operator to a type.
33179 * cs-parser.jay (indexer_declaration): Added line to actually call the
33180 AddIndexer method so it gets added ;-)
33182 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
33183 already taken care of by the MS compiler ?
33185 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33187 * class.cs (Operator): New class for operator declarations.
33188 (Operator::OpType): Enum for the various operators.
33190 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33192 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
33193 ostensibly handle this in semantic analysis.
33195 * cs-parser.jay (general_catch_clause): Comment out
33196 (specific_catch_clauses, specific_catch_clause): Ditto.
33197 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
33198 (catch_args, opt_catch_args): New productions.
33199 (catch_clause): Rewrite to use the new productions above
33200 (catch_clauses): Modify accordingly.
33201 (opt_catch_clauses): New production to use in try_statement
33202 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
33203 and re-write the code in the actions to extract the specific and
33204 general catch clauses by being a little smart ;-)
33206 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
33207 Hooray, try and catch statements parse fine !
33209 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33211 * statement.cs (Block::GetVariableType): Fix logic to extract the type
33212 string from the hashtable of variables.
33214 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
33215 I end up making that mistake ;-)
33216 (catch_clauses): Fixed gross error which made Key and Value of the
33217 DictionaryEntry the same : $1 !!
33219 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33221 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
33223 * cs-parser.jay (event_declaration): Correct to remove the semicolon
33224 when the add and remove accessors are specified.
33226 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33228 * cs-parser.jay (IndexerDeclaration): New helper class to hold
33229 information about indexer_declarator.
33230 (indexer_declarator): Implement actions.
33231 (parsing_indexer): New local boolean used to keep track of whether
33232 we are parsing indexers or properties. This is necessary because
33233 implicit_parameters come into picture even for the get accessor in the
33234 case of an indexer.
33235 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
33237 * class.cs (Indexer): New class for indexer declarations.
33238 (TypeContainer::AddIndexer): New method to add an indexer to a type.
33239 (TypeContainer::indexers): New member to hold list of indexers for the
33242 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33244 * cs-parser.jay (add_accessor_declaration): Implement action.
33245 (remove_accessor_declaration): Implement action.
33246 (event_accessors_declaration): Implement
33247 (variable_declarators): swap statements for first rule - trivial.
33249 * class.cs (Event): New class to hold information about event
33251 (TypeContainer::AddEvent): New method to add an event to a type
33252 (TypeContainer::events): New member to hold list of events.
33254 * cs-parser.jay (event_declaration): Implement actions.
33256 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33258 * cs-parser.jay (dim_separators): Implement. Make it a string
33259 concatenating all the commas together, just as they appear.
33260 (opt_dim_separators): Modify accordingly
33261 (rank_specifiers): Update accordingly. Basically do the same
33262 thing - instead, collect the brackets here.
33263 (opt_rank_sepcifiers): Modify accordingly.
33264 (array_type): Modify to actually return the complete type string
33265 instead of ignoring the rank_specifiers.
33266 (expression_list): Implement to collect the expressions
33267 (variable_initializer): Implement. We make it a list of expressions
33268 essentially so that we can handle the array_initializer case neatly too.
33269 (variable_initializer_list): Implement.
33270 (array_initializer): Make it a list of variable_initializers
33271 (opt_array_initializer): Modify accordingly.
33273 * expression.cs (New::NType): Add enumeration to help us
33274 keep track of whether we have an object/delegate creation
33275 or an array creation.
33276 (New:NewType, New::Rank, New::Indices, New::Initializers): New
33277 members to hold data about array creation.
33278 (New:New): Modify to update NewType
33279 (New:New): New Overloaded contructor for the array creation
33282 * cs-parser.jay (array_creation_expression): Implement to call
33283 the overloaded New constructor.
33285 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
33287 * class.cs (TypeContainer::Constructors): Return member
33288 constructors instead of returning null.
33290 2001-08-26 Miguel de Icaza <miguel@ximian.com>
33292 * typemanager.cs (InitCoreTypes): Initialize the various core
33293 types after we have populated the type manager with the user
33294 defined types (this distinction will be important later while
33295 compiling corlib.dll)
33297 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
33298 on Expression Classification. Now all expressions have a method
33299 `Resolve' and a method `Emit'.
33301 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
33302 generation from working. Also add some temporary debugging
33305 2001-08-24 Miguel de Icaza <miguel@ximian.com>
33307 * codegen.cs: Lots of code generation pieces. This is only the
33308 beginning, will continue tomorrow with more touches of polish. We
33309 handle the fundamentals of if, while, do, for, return. Others are
33310 trickier and I need to start working on invocations soon.
33312 * gen-treedump.cs: Bug fix, use s.Increment here instead of
33315 * codegen.cs (EmitContext): New struct, used during code
33316 emission to keep a context. Most of the code generation will be
33319 * cs-parser.jay: Add embedded blocks to the list of statements of
33320 this block. So code generation proceeds in a top down fashion.
33322 2001-08-23 Miguel de Icaza <miguel@ximian.com>
33324 * statement.cs: Add support for multiple child blocks.
33326 2001-08-22 Miguel de Icaza <miguel@ximian.com>
33328 * codegen.cs (EmitCode): New function, will emit the code for a
33329 Block of code given a TypeContainer and its ILGenerator.
33331 * statement.cs (Block): Standard public readonly optimization.
33332 (Block::Block constructors): Link children.
33333 (Block::Child): Child Linker.
33334 (Block::EmitVariables): Emits IL variable declarations.
33336 * class.cs: Drop support for MethodGroups here, delay until
33338 (Method::): Applied the same simplification that I did before, and
33339 move from Properties to public readonly fields.
33340 (Method::ParameterTypes): Returns the parameter types for the
33341 function, and implements a cache that will be useful later when I
33342 do error checking and the semantic analysis on the methods is
33344 (Constructor::GetCallingConvention): Renamed from CallingConvetion
33345 and made a method, optional argument tells whether this is a class
33346 or a structure to apply the `has-this' bit.
33347 (Method::GetCallingConvention): Implement, returns the calling
33349 (Method::Define): Defines the type, a second pass is performed
33350 later to populate the methods.
33352 (Constructor::ParameterTypes): implement a cache similar to the
33353 one on Method::ParameterTypes, useful later when we do semantic
33356 (TypeContainer::EmitMethod): New method. Emits methods.
33358 * expression.cs: Removed MethodGroup class from here.
33360 * parameter.cs (Parameters::GetCallingConvention): new method.
33362 2001-08-21 Miguel de Icaza <miguel@ximian.com>
33364 * class.cs (TypeContainer::Populate): Drop RootContext from the
33367 (Constructor::CallingConvention): Returns the calling convention.
33368 (Constructor::ParameterTypes): Returns the constructor parameter
33371 (TypeContainer::AddConstructor): Keep track of default constructor
33372 and the default static constructor.
33374 (Constructor::) Another class that starts using `public readonly'
33375 instead of properties.
33377 (Constructor::IsDefault): Whether this is a default constructor.
33379 (Field::) use readonly public fields instead of properties also.
33381 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
33382 track of static constructors; If none is used, turn on
33383 BeforeFieldInit in the TypeAttributes.
33385 * cs-parser.jay (opt_argument_list): now the return can be null
33386 for the cases where there are no arguments.
33388 (constructor_declarator): If there is no implicit `base' or
33389 `this', then invoke the default parent constructor.
33391 * modifiers.cs (MethodAttr): New static function maps a set of
33392 modifiers flags into a MethodAttributes enum
33393 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
33394 MethodAttr, TypeAttr to represent the various mappings where the
33395 modifiers are used.
33396 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
33398 2001-08-19 Miguel de Icaza <miguel@ximian.com>
33400 * parameter.cs (GetParameterInfo): Fix bug where there would be no
33403 * interface.cs (PopulateIndexer): Implemented the code generator
33404 for interface indexers.
33406 2001-08-17 Miguel de Icaza <miguel@ximian.com>
33408 * interface.cs (InterfaceMemberBase): Now we track the new status
33411 (PopulateProperty): Implement property population. Woohoo! Got
33412 Methods and Properties going today.
33414 Removed all the properties for interfaces, and replaced them with
33415 `public readonly' fields.
33417 2001-08-16 Miguel de Icaza <miguel@ximian.com>
33419 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
33420 initialize their hashtables/arraylists only when they are needed
33421 instead of doing this always.
33423 * parameter.cs: Handle refs and out parameters.
33425 * cs-parser.jay: Use an ArrayList to construct the arguments
33426 instead of the ParameterCollection, and then cast that to a
33429 * parameter.cs: Drop the use of ParameterCollection and use
33430 instead arrays of Parameters.
33432 (GetParameterInfo): Use the Type, not the Name when resolving
33435 2001-08-13 Miguel de Icaza <miguel@ximian.com>
33437 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
33438 and instead use public readonly fields.
33440 * class.cs: Put back walking code for type containers.
33442 2001-08-11 Miguel de Icaza <miguel@ximian.com>
33444 * class.cs (MakeConstant): Code to define constants.
33446 * rootcontext.cs (LookupType): New function. Used to locate types
33449 2001-08-08 Miguel de Icaza <miguel@ximian.com>
33451 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
33452 this System.Reflection code is. Kudos to Microsoft
33454 * typemanager.cs: Implement a type cache and avoid loading all
33455 types at boot time. Wrap in LookupType the internals. This made
33456 the compiler so much faster. Wow. I rule!
33458 * driver.cs: Make sure we always load mscorlib first (for
33459 debugging purposes, nothing really important).
33461 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
33462 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
33464 * rootcontext.cs: Lookup types on their namespace; Lookup types
33465 on namespaces that have been imported using the `using' keyword.
33467 * class.cs (TypeContainer::TypeAttr): Virtualize.
33468 (Class::TypeAttr): Return attributes suitable for this bad boy.
33469 (Struct::TypeAttr): ditto.
33470 Handle nested classes.
33471 (TypeContainer::) Remove all the type visiting code, it is now
33472 replaced with the rootcontext.cs code
33474 * rootcontext.cs (GetClassBases): Added support for structs.
33476 2001-08-06 Miguel de Icaza <miguel@ximian.com>
33478 * interface.cs, statement.cs, class.cs, parameter.cs,
33479 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
33480 Drop use of TypeRefs, and use strings instead.
33482 2001-08-04 Miguel de Icaza <miguel@ximian.com>
33486 * class.cs (Struct::Struct): set the SEALED flags after
33487 checking the modifiers.
33488 (TypeContainer::TypeAttr): new property, returns the
33489 TypeAttributes for a class.
33491 * cs-parser.jay (type_list): Oops, list production was creating a
33492 new list of base types.
33494 * rootcontext.cs (StdLib): New property.
33495 (GetInterfaceTypeByName): returns an interface by type name, and
33496 encapsulates error handling here.
33497 (GetInterfaces): simplified.
33498 (ResolveTree): Encapsulated all the tree resolution here.
33499 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
33502 * driver.cs: Add support for --nostdlib, to avoid loading the
33503 default assemblies.
33504 (Main): Do not put tree resolution here.
33506 * rootcontext.cs: Beginning of the class resolution.
33508 2001-08-03 Miguel de Icaza <miguel@ximian.com>
33510 * rootcontext.cs: Provide better error reporting.
33512 * cs-parser.jay (interface_base): set our $$ to be interfaces.
33514 * rootcontext.cs (CreateInterface): Handle the case where there
33515 are no parent interfaces.
33517 (CloseTypes): Routine to flush types at the end.
33518 (CreateInterface): Track types.
33519 (GetInterfaces): Returns an array of Types from the list of
33520 defined interfaces.
33522 * typemanager.c (AddUserType): Mechanism to track user types (puts
33523 the type on the global type hash, and allows us to close it at the
33526 2001-08-02 Miguel de Icaza <miguel@ximian.com>
33528 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
33529 RecordInterface instead.
33531 * cs-parser.jay: Updated to reflect changes above.
33533 * decl.cs (Definition): Keep track of the TypeBuilder type that
33534 represents this type here. Not sure we will use it in the long
33535 run, but wont hurt for now.
33537 * driver.cs: Smaller changes to accomodate the new code.
33539 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
33542 * rootcontext.cs (CreateInterface): New method, used to create
33543 the System.TypeBuilder type for interfaces.
33544 (ResolveInterfaces): new entry point to resolve the interface
33546 (CodeGen): Property, used to keep track of the code generator.
33548 2001-07-26 Miguel de Icaza <miguel@ximian.com>
33550 * cs-parser.jay: Add a second production for delegate_declaration
33553 (enum_body): Put an opt_comma here instead of putting it on
33554 enum_body or enum_member_declarations so we can handle trailing
33555 commas on enumeration members. Gets rid of a shift/reduce.
33557 (type_list): Need a COMMA in the middle.
33559 (indexer_declaration): Tell tokenizer to recognize get/set
33561 * Remove old targets.
33563 * Re-add the parser target.
33565 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33567 * cs-parser.jay: Add precendence rules for a number of operators
33568 ot reduce the number of shift/reduce conflicts in the grammar.
33570 2001-07-17 Miguel de Icaza <miguel@ximian.com>
33572 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
33575 Get rid of old crufty code.
33577 * rootcontext.cs: Use this to keep track of the parsed
33578 representation and the defined types available to the program.
33580 * gen-treedump.cs: adjust for new convention.
33582 * type.cs: Split out the type manager, and the assembly builder
33585 * typemanager.cs: the type manager will live here now.
33587 * cil-codegen.cs: And the code generator here.
33589 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
33591 * makefile: Fixed up for easy making.
33593 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33595 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
33598 (unary_expression): Expand pre_increment_expression and
33599 post_decrement_expression to reduce a shift/reduce.
33601 2001-07-11 Simon Cozens
33603 * cs-tokenizer.cs: Hex numbers should begin with a 0.
33605 Improve allow_keyword_as_indent name.
33607 2001-06-19 Miguel de Icaza <miguel@ximian.com>
33609 * Adjustments for Beta2.
33611 2001-06-13 Miguel de Icaza <miguel@ximian.com>
33613 * decl.cs: Added `Define' abstract method.
33614 (InTransit): new property, used to catch recursive definitions.
33616 * interface.cs: Implement `Define'.
33618 * modifiers.cs: Map Modifiers.constants to
33619 System.Reflection.TypeAttribute flags.
33621 * class.cs: Keep track of types and user-defined types.
33622 (BuilderInit): New method for creating an assembly
33623 (ResolveType): New function to launch the resolution process, only
33624 used by interfaces for now.
33626 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
33627 that are inserted into the name space.
33629 2001-06-08 Miguel de Icaza <miguel@ximian.com>
33631 * ARGH. I have screwed up my tree so many times due to the use of
33632 rsync rather than using CVS. Going to fix this at once.
33634 * driver.cs: Objetify driver. Load assemblies, use assemblies to
33637 2001-06-07 Miguel de Icaza <miguel@ximian.com>
33639 * Experiment successful: Use System.Type rather that our own
33642 2001-05-25 Miguel de Icaza <miguel@ximian.com>
33644 * cs-parser.jay: Removed nsAliases from here.
33646 Use new namespaces, handle `using XXX;'
33648 * namespace.cs: Reimplemented namespace handling, use a recursive
33649 definition of the class. Now we can keep track of using clauses
33650 and catch invalid using clauses.
33652 2001-05-24 Miguel de Icaza <miguel@ximian.com>
33654 * gen-treedump.cs: Adapted for all the renaming.
33656 * expression.cs (Expression): this class now has a Type property
33657 which returns an expression Type.
33659 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
33660 `Type', as this has a different meaning now in the base
33662 2001-05-22 Miguel de Icaza <miguel@ximian.com>
33664 * interface.cs, class.cs: Removed from all the sources the
33665 references to signature computation, as we can not do method
33666 signature computation during the parsing time, as we are not
33667 trying to solve at that point distinguishing:
33671 void a (NS.Blah x) {}
33674 Which depending on the context might be valid or not, as we do not
33675 know if Blah is the same thing as NS.Blah at that point.
33677 * Redid everything so the code uses TypeRefs now instead of
33678 Types. TypeRefs are just temporary type placeholders, that need
33679 to be resolved. They initially have a pointer to a string and the
33680 current scope in which they are used. This is used later by the
33681 compiler to resolve the reference to an actual Type.
33683 * DeclSpace is no longer a CIR.Type, and neither are
33684 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
33685 are all DeclSpaces, but no Types.
33687 * type.cs (TypeRefManager): This implements the TypeRef manager,
33688 which keeps track of all the types that need to be resolved after
33689 the parsing has finished.
33691 2001-05-13 Miguel de Icaza <miguel@ximian.com>
33693 * ARGH. We are going to have to store `foreach' as a class rather
33694 than resolving it, as we need to verify error 1579 after name
33695 resolution. *OR* we could keep a flag that says `This request to
33696 IEnumerator comes from a foreach statement' which we can then use
33697 to generate the error.
33699 2001-05-10 Miguel de Icaza <miguel@ximian.com>
33701 * class.cs (TypeContainer.AddMethod): we now add methods to the
33702 MethodGroup instead of the method hashtable.
33704 * expression.cs: Add MethodGroup abstraction, which gets us one
33705 step closer to the specification in the way we handle method
33708 * cs-parser.jay (primary_expression): qualified_identifier now
33709 tried to match up an identifier to a local variable reference or
33710 to a parameter reference.
33712 current_local_parameters is now a parser global variable that
33713 points to the current parameters for the block, used during name
33716 (property_declaration): Now creates an implicit `value' argument to
33719 2001-05-09 Miguel de Icaza <miguel@ximian.com>
33721 * parameter.cs: Do not use `param' arguments as part of the
33722 signature, per the spec.
33724 2001-05-08 Miguel de Icaza <miguel@ximian.com>
33726 * decl.cs: Base class for classes, structs and interfaces. This
33727 is the "Declaration Space"
33729 * cs-parser.jay: Use CheckDef for checking declaration errors
33730 instead of having one on each function.
33732 * class.cs: Factor out some code for handling error handling in
33733 accordance to the "Declarations" section in the "Basic Concepts"
33734 chapter in the ECMA C# spec.
33736 * interface.cs: Make all interface member classes derive from
33737 InterfaceMemberBase.
33739 2001-05-07 Miguel de Icaza <miguel@ximian.com>
33741 * Many things: all interfaces are parsed and generated in
33742 gen-treedump. Support for member variables, constructors,
33743 destructors, properties, constants is there.
33745 Beginning of the IL backend, but very little done, just there for
33748 2001-04-29 Miguel de Icaza <miguel@ximian.com>
33750 * cs-parser.jay: Fix labeled statement.
33752 * cs-tokenizer.cs (escape): Escape " and ' always.
33753 ref_line, ref_name: keep track of the line/filename as instructed
33754 by #line by the compiler.
33757 2001-04-27 Miguel de Icaza <miguel@ximian.com>
33759 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
33760 to match the values in System.CodeDOM.
33762 Divid renamed to Divide.
33764 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
33766 (Statements.set): remove.
33768 * System.CodeDOM/CodeCatchClause.cs: always have a valid
33771 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
33772 falseStatements always have valid values.
33774 * cs-parser.jay: Use System.CodeDOM now.