1 2010-06-01 Marek Safar <marek.safar@gmail.com>
4 * generic.cs, convert.cs: Recursively check effective base interface
6 2010-06-01 Marek Safar <marek.safar@gmail.com>
8 * statement.cs: Handle nullable types and type parameters in using
9 statement, avoid boxing value types. Also fixes #571010
11 2010-06-01 Marek Safar <marek.safar@gmail.com>
13 * convert.cs, expression.cs: Emit unbox for underlying nullable
16 2010-05-29 Marek Safar <marek.safar@gmail.com>
19 * expression.cs: Don't use branch optimization for types bigger than
22 2010-05-28 Marek Safar <marek.safar@gmail.com>
25 * import.cs: Check private modifier correctly.
27 2010-05-28 Marek Safar <marek.safar@gmail.com>
30 * ecore.cs: Don't ignore override methods when looking for base
33 2010-05-27 Marek Safar <marek.safar@gmail.com>
35 A fix for bugs #608007, #572540, #566130, #476358
37 * generic.cs, linq.cs, expression.cs, statement.cs, cs-parser.jay:
38 More tricky refactoring of implicit linq blocks.
40 2010-05-25 Marek Safar <marek.safar@gmail.com>
42 * linq.cs, cs-parser.jay: Keep location for all linq clauses.
44 2010-05-25 Marek Safar <marek.safar@gmail.com>
46 * context.cs, expression.cs, cs-parser.jay: Don't store current
47 block in This expression (it's too early for linq blocks).
49 2010-05-21 Marek Safar <marek.safar@gmail.com>
51 * expression.cs: Use constrained prefix more broadly to avoid boxing.
53 2010-05-20 Marek Safar <marek.safar@gmail.com>
56 * nullable.cs: Don't double wrap same expression.
58 2010-05-20 Marek Safar <marek.safar@gmail.com>
61 * anonymous.cs: Any issued error in probing mode means no match.
63 2010-05-20 Marek Safar <marek.safar@gmail.com>
65 * expression.cs: Search for base indexer using the closest match
68 2010-05-20 Marek Safar <marek.safar@gmail.com>
71 * method.cs: Set override constraints using unexpanded interface
74 2010-05-20 Marek Safar <marek.safar@gmail.com>
77 * ecore.cs: Include secondary extension method lookup in probing
80 2010-05-19 Marek Safar <marek.safar@gmail.com>
83 * typespec.cs (MayBecomeEqualGenericTypes): Recursively check
86 2010-05-19 Marek Safar <marek.safar@gmail.com>
89 * pending.cs: Advance counter correctly.
91 2010-05-19 Marek Safar <marek.safar@gmail.com>
94 * method.cs, pending.cs: Indexer override uses base name.
96 2010-05-19 Marek Safar <marek.safar@gmail.com>
99 * generic.cs: Replace original with inflated type parameter on
102 2010-05-19 Marek Safar <marek.safar@gmail.com>
104 A fix for bug #359733
105 * parameter.cs: Extension attribute can be defined in each assembly.
107 2010-05-18 Marek Safar <marek.safar@gmail.com>
109 A fix for bug #446507
110 * method.cs: Only one method can implement an interface.
112 2010-05-18 Marek Safar <marek.safar@gmail.com>
114 A fix for bug #594905
115 * convert.cs, constant.cs, expression.cs, literal.cs, ecore.cs:
116 Typed null can be used as a source for expression methods.
118 2010-05-18 Marek Safar <marek.safar@gmail.com>
120 A fix for bug #606551
121 * namespace.cs: Using directive imports only types and not nested
124 2010-05-17 Marek Safar <marek.safar@gmail.com>
126 * typespec.cs, expression.cs, statement.cs, ecore.cs, complete.cs,
127 delegate.cs: Member instance is resolved after member overload
128 definitely resolves static/instance property of member expression.
129 Fixes #545047, #358848, #456605, #460016, #603299
131 2010-05-12 Marek Safar <marek.safar@gmail.com>
133 A fix for bug #604981
134 * generic.cs, decl.cs, anonymous.cs: Reset more type arguments
135 details for nested anonymous methods stories.
137 2010-05-11 Marek Safar <marek.safar@gmail.com>
139 A fix for bug #604735
140 * namespace.cs: Don't report namespace collision.
142 2010-05-11 Marek Safar <marek.safar@gmail.com>
144 A fix for bug #604748
145 * class.cs, typespec.cs: Search full imported attribute hierarchy
148 2010-05-11 Marek Safar <marek.safar@gmail.com>
150 * namespace.cs: Ignore missing dependencies failure at
153 2010-05-11 Marek Safar <marek.safar@gmail.com>
155 A fix for bug #604640
156 * namespace.cs: Don't resolve using constraints too early.
158 2010-05-11 Marek Safar <marek.safar@gmail.com>
160 A fix for bug #604239
161 * generic.cs: Copy partial type constraints to partial container.
163 2010-05-10 Marek Safar <marek.safar@gmail.com>
165 A fix for bug #557210
166 * import.cs: Relax underlying enum field rules.
168 2010-05-10 Marek Safar <marek.safar@gmail.com>
170 A fix for bug #603476
171 * property.cs: Implement IParametersMember for indexer accessors.
173 2010-05-07 Marek Safar <marek.safar@gmail.com>
175 A fix for bug #601141
176 * class.cs: Update all partial modifiers.
178 2010-05-06 Marek Safar <marek.safar@gmail.com>
180 A fix for bug #601708
181 * method.cs, membercache.cs: Destructors cannot be hidden.
183 2010-05-06 Marek Safar <marek.safar@gmail.com>
185 A fix for bug #602551
186 * class.cs: Resursive reference of type definition is allowed.
188 2010-05-06 Marek Safar <marek.safar@gmail.com>
190 * anonymous.cs: Mutate cached storey instance types too.
192 2010-05-06 Marek Safar <marek.safar@gmail.com>
194 A fix for bug #602443
195 * convert.cs: Explicit enum conversion cannot involve user operators
197 2010-05-05 Miguel de Icaza <miguel@novell.com>
199 * class.cs (TypeContainer.DefineBaseTypes)
200 (TypeContainer.CheckRecursiveDefinition): check for the iface not
201 being null, as we could have failed resolution and crashed;
204 * cs-parser.jay: Productions to catch common mistakes when other
205 punctuation operators are used instead of comma. Fixes 571702
207 2010-05-05 Marek Safar <marek.safar@gmail.com>
209 * anonymous.cs: Mutate correct set of constraints.
211 2010-05-05 Marek Safar <marek.safar@gmail.com>
213 A fix for bug #602842
214 * expression.cs: Resolve all array bound arguments.
216 2010-05-05 Marek Safar <marek.safar@gmail.com>
218 * import.cs: Don't import private fields.
220 2010-04-30 Marek Safar <marek.safar@gmail.com>
222 Partially based on patch by <sami.lamti@gmail.com>
224 * eval.cs, ecore.cs: Fixed eval show methods.
226 2010-04-30 Marek Safar <marek.safar@gmail.com>
228 * generic.cs, delegate.cs: Implement output type inference of
229 methodgroup now when the specification was cleared at least little
232 2010-04-29 Marek Safar <marek.safar@gmail.com>
234 A fix for bug #575611
235 * class.cs: Fix recursive unmanaged recursice sruct check.
237 2010-04-29 Marek Safar <marek.safar@gmail.com>
239 A fix for bug #479776
240 * expression.cs: Implement typeof unbounded nested generic types.
242 2010-04-29 Marek Safar <marek.safar@gmail.com>
244 A fix for bug #474953
245 * class.cs: Fix valid recursive base type definition.
247 2010-04-29 Marek Safar <marek.safar@gmail.com>
249 A fix for bug #421737
250 * convert.cs, expression.cs: A boxing conversion exists from a
251 nullable-type to a reference type, if a boxing conversion exists
252 from the underlying non-nullable-value-type to the reference type.
254 2010-04-29 Marek Safar <marek.safar@gmail.com>
256 A fix for bug #376875
257 * import.cs: Import volatile modifier.
259 2010-04-29 Marek Safar <marek.safar@gmail.com>
261 A fix for bug #372412
262 * typespec.cs, expression.cs, codegen.cs: Emit readonly prefix for
265 2010-04-29 Marek Safar <marek.safar@gmail.com>
267 A fix for bug #568955
268 * statements.cs: Handle recursive scope initializers.
270 2010-04-28 Marek Safar <marek.safar@gmail.com>
272 A fix for bug #566511
273 * anonymous.cs: Always get inflated version of hoisted variable
274 on generic type definition.
276 2010-04-28 Marek Safar <marek.safar@gmail.com>
278 * import.cs, membercache.cs: Relax rules for valid properties.
280 2010-04-28 Marek Safar <marek.safar@gmail.com>
282 * import.cs: Intern arrays used in generic arguments.
284 2010-04-28 Marek Safar <marek.safar@gmail.com>
286 A fix for bug #600398
287 * convert.cs: Actually use effective base type for the comparison.
289 2010-04-28 Marek Safar <marek.safar@gmail.com>
291 A fix for bug #600326
292 * ecore.cs: Pass arity to base member lookup.
294 2010-04-28 Marek Safar <marek.safar@gmail.com>
296 A fix for bug #573385
297 * expression.cs: MemberAccess is of generic type based on right
300 2010-05-28 Marek Safar <marek.safar@gmail.com>
302 * cs-tokenizer.cs: Made tab size configurable.
304 2010-05-27 Marek Safar <marek.safar@gmail.com>
306 * attribute.cs: Ensure Obsolete members are defined before doing
309 2010-05-27 Marek Safar <marek.safar@gmail.com>
311 * visit.cs: Add DOM visitor skeleton.
315 2010-05-27 Marek Safar <marek.safar@gmail.com>
317 * attribute.cs, codegen.cs: Drop COMPILER_ACCESS hack.
319 2010-05-27 Marek Safar <marek.safar@gmail.com>
321 * *.cs: Major rewrite of compiler internals to better work with
322 unmodified System.Reflection.Emit. Some of the key changes are
323 - TypeSpec replaces reflection specific System.Type.
324 - All Type(TypeSpec) operations are now done in compiler therefore
325 no dependency on SRE to inflate generic members and types or to
326 query unclosed types.
327 - MemberCache is now the only and full hierarchical topology.
328 - Generic constraints are implemented properly.
329 - And as a bonus compilation is on average 30% faster.
331 2010-04-15 Jb Evain <jbevain@novell.com>
333 * dmcs.exe.config: update the runtime version to .net 4.0 RTM.
335 2010-04-12 Marek Safar <marek.safar@gmail.com>
337 * expression.cs, attribute.cs, parameter.cs: More attribute type
340 2010-04-12 Marek Safar <marek.safar@gmail.com>
342 A fix for bug #593342
344 * generic.cs, parameter.cs, argument.cs, field.cs, property.cs,
345 decl.cs, roottypes.cs, constant.cs, nullable.cs, expression.cs,
346 method.cs, ecore.cs, class.cs, delegate.cs, attribute.cs,
347 codegen.cs: Add custom attribute encoder to deal with unfinished
348 types and easier corlib bootstrap from its own types.
350 2010-03-26 Marek Safar <marek.safar@gmail.com>
352 * cs-parser.jay: Report invalid constraint types.
354 2010-03-16 Jb Evain <jbevain@novell.com>
356 * Makefile: rename the net_2_1 profile to moonlight.
358 2010-03-11 Marek Safar <marek.safar@gmail.com>
360 * statement.cs, cs-parser.jay: Use correct location for empty
363 2010-03-11 Marek Safar <marek.safar@gmail.com>
365 * cs-parser.jay: Disable Location from expression.
367 * generic.cs: Check constraints for overrides in the parser.
369 2010-03-09 Marek Safar <marek.safar@gmail.com>
371 * cs-parser.jay (GetLocation): Use an expression when available.
373 2010-03-04 Marek Safar <marek.safar@gmail.com>
375 A fix for bug #582579
376 * ecore.cs (FieldExpr): Don't optimize cross reference loads.
378 2010-03-04 Marek Safar <marek.safar@gmail.com>
380 A patch by kornelpal@gmail.com
382 * dynamic.cs, anonymous.cs, rootcontext.cs, class.cs: Don't make
383 compiler generated classes sealed by default. Emit and close top
384 level compiler generated classes as well.
386 * support.cs: Use RuntimeHelpers.GetHashCode.
388 2010-03-03 Rolf Bjarne Kvinge <RKvinge@novell.com>
390 * Makefile: We need to use the internal bootstrapping gmcs for
391 net_2_1_bootstrap too now.
393 2010-03-02 Raja R Harinath <harinath@hurrynot.org>
395 * expression.cs (IndexerAccess.ResolveAccessor): Add CS1540 check.
397 2010-03-02 Marek Safar <marek.safar@gmail.com>
399 * cs-tokenizer.cs: Missed few locations in previous fix.
401 2010-03-02 Marek Safar <marek.safar@gmail.com>
403 * cs-tokenizer.cs, argument.cs, dynamic.cs, assign.cs, anonymous.cs,
404 nullable.cs, expression.cs, statement.cs, cs-parser.jay, cfold.cs:
405 Report correct location for operator errors.
407 2010-03-02 Marek Safar <marek.safar@gmail.com>
409 * typemanager.cs (IsDynamicType): Don't check external types when
410 the attribute is not external.
412 2010-02-24 Marek Safar <marek.safar@gmail.com>
414 A fix for bug #582579
415 * decl.cs (IsExposedFromAssembly): Use PartialContainer for parent
418 2010-02-24 Marek Safar <marek.safar@gmail.com>
420 A fix for bug #581804
421 * ecore.cs: Fixed type comparison.
423 2010-02-08 Miguel de Icaza <miguel@novell.com>
425 * namespace.cs (CompletionGetTypesStartingWith): Do not include
426 private types in the completion results.
428 * cs-parser.jay: Bubble completions after "from x in ?" and "from x
431 2010-02-17 Marek Safar <marek.safar@gmail.com>
433 * generic.cs, field.cs, decl.cs, cs-parser.jay: Simplify special
436 2010-02-14 Miguel de Icaza <miguel@novell.com>
438 * eval.cs: Do not do the report printer dance unless the user has
439 set the DescribeTypes feature.
441 2010-02-10 Marek Safar <marek.safar@gmail.com>
443 * argument.cs, dynamic.cs, expression.cs: Track RC API changes.
445 2010-02-08 Marek Safar <marek.safar@gmail.com>
447 A fix for bug #577029
448 * anonymous.cs: Fixed TypeBuilder* check.
450 2010-02-06 Miguel de Icaza <miguel@novell.com>
452 * eval.cs (CompileBlock): Also undo if there are problems during
453 semantic analysis, fixes various cases where invalid C# code would
454 be reported, but the internal changes would not be undone.
456 2010-02-03 Miguel de Icaza <miguel@novell.com>
458 * driver.cs: Change the --fatal flag to allow a number to be
459 passed, this ignores the first N fatal errors. Useful to debug
460 errors that do not happen on the first hit.
462 * cs-parser.jay (invocation_expression): accept both the
463 CLOSE_PARENS and COMPLETE_COMPLETION, this allows completions
464 inside an invocation.
466 * driver.cs: Expose FatalErrors.
468 * eval.cs: Initialize the printer's Fatal property from the
469 Driver's FatalError flag, this allows csharp --fatal to work
472 Add support for calling Describe (typeof (TYPE)) if the expression
475 2010-02-02 Marek Safar <marek.safar@gmail.com>
477 A fix for bug #574991
478 * rootcontext.cs, class.cs, driver.cs: Hide enhanced warnings behind
481 2010-02-02 Marek Safar <marek.safar@gmail.com>
483 A fix for bug #575986
484 * expression.cs: Don't mutate typeof type definitions.
486 2010-01-28 Marek Safar <marek.safar@gmail.com>
488 * decl.cs: Use only one set of modifiers.
490 2010-01-26 Marek Safar <marek.safar@gmail.com>
492 A fix for bug #573329
493 * eval.cs: Don't disable error reporting completely on silent mode.
495 2010-01-25 Marek Safar <marek.safar@gmail.com>
497 A fix for bug #573312
498 * constant.cs, expression.cs, ecore.cs: Emit correct offset for
499 pointer index of unknown size types greater than 2.
501 2010-01-15 Marek Safar <marek.safar@gmail.com>
503 * *.cs: Use only 1 member kind enum.
505 2010-01-15 Marek Safar <marek.safar@gmail.com>
507 * *.cs: Add event specification.
509 2010-01-14 Marek Safar <marek.safar@gmail.com>
511 * membercache.cs: Extracted from decl.cs.
513 * *.cs: Put more infrastructure in place.
515 2010-01-13 Marek Safar <marek.safar@gmail.com>
517 * *.cs: Add property specification, unused yet.
519 2010-01-13 Marek Safar <marek.safar@gmail.com>
521 * property.cs: Move all property based declarations into a new file.
523 2010-01-13 Marek Safar <marek.safar at gmail.com>
525 * expression.cs (Conditional): Resolve reduced expression.
527 2010-01-13 Marek Safar <marek.safar at gmail.com>
529 * *.cs: Introduced non-generic method specification.
531 2010-01-07 Marek Safar <marek.safar@gmail.com>
533 * method.cs: Move all method based declarations into a new file.
535 2010-01-07 Marek Safar <marek.safar@gmail.com>
537 * *.cs: Extract field specification.
539 2009-12-17 Marek Safar <marek.safar@gmail.com>
541 * field.cs: Extracted from class.cs
543 2009-12-15 Marek Safar <marek.safar@gmail.com>
545 * attribute.cs (GetFixedBuffer): Work on field definition only.
547 2009-12-15 Marek Safar <marek.safar@gmail.com>
549 * *.cs: Clean up NET_4_0 conditional where possible.
551 2009-12-14 Rodrigo Kumpera <rkumpera@novell.com>
553 support.cs (DynamicType): Assembly property returns the assembly builder.
554 This is required due to how compiler context works in corlib.
556 2009-12-14 Marek Safar <marek.safar@gmail.com>
558 A fix for bug #564376
559 * assign.cs (LocalTemporary): Removed no longer needed special
562 2009-12-11 Marek Safar <marek.safar@gmail.com>
564 * modifiers.cs, decl.cs, iterators.cs, const.cs, anonymous.cs,
565 class.cs, delegate.cs, cs-parser.jay, enum.cs: Turn modifiers into
566 enum for easier debugging.
568 2009-12-10 Marek Safar <marek.safar@gmail.com>
570 * decl.cs, anonymous.cs, class.cs: Sealed Define it's now main entry
573 * parameter.cs, delegate.cs, dynamic.cs: Don't use builder methods
576 2009-12-10 Marek Safar <marek.safar@gmail.com>
578 * cs-parser.jay, statement.cs: Handle parser error in code
581 2009-12-10 Marek Safar <marek.safar@gmail.com>
583 * ecore.cs: Ignore base imported methods when they are already
586 * eval.cs: Handle non-existent keys.
588 * report.cs, driver.cs: Make fatal work with console printer only.
590 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
592 * typemanager.cs (MakeGenericMethod): Fix stupid mistake.
594 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
596 * typemanager.cs: Add MakeGenericMethod that checks if the method
597 is really the generic method definition.
599 ecore.cs (MethodGroupExpr:IsApplicable): Use new TypeManager function
600 to inflate generic methods.
602 2009-12-08 Marek Safar <marek.safar@gmail.com>
604 A fix for bug #561149
605 * anonymous.cs: Use actual type parameters when checking for generic
608 2009-12-08 Marek Safar <marek.safar@gmail.com>
610 A fix for bug #561369
611 * expression.cs (DoNumericPromotion): Fixed typo.
613 2009-12-08 Marek Safar <marek.safar@gmail.com>
615 *.cs: Moving to generics world.
617 cs-parser.jay: Removed current_array_type.
619 2009-12-07 Marek Safar <marek.safar@gmail.com>
621 *.cs: Moving to generics world.
623 2009-12-04 Marek Safar <marek.safar@gmail.com>
625 *.cs: Moving to generics world (day 2).
627 2009-12-03 Marek Safar <marek.safar@gmail.com>
629 *.cs: Moving to generics world.
631 2009-12-02 Marek Safar <marek.safar@gmail.com>
633 * typemanager.cs, parameter.cs, class.cs, delegate.cs, attribute.cs:
634 Encode dynamic type attribute for elements where attributes cannot
637 2009-12-01 Marek Safar <marek.safar@gmail.com>
639 argument.cs, assign.cs, expression.cs, cs-parser.jay: Named
642 2009-12-01 Marek Safar <marek.safar@gmail.com>
644 A fix for bug #360455
645 * class.cs: Never report a unused warning for generic events to
646 workaround wrong expression type.
648 2009-11-30 Marek Safar <marek.safar@gmail.com>
650 A fix for bug #558305
651 * decl.cs, class.cs: Check partial method definitions using correct
654 2009-11-30 Marek Safar <marek.safar@gmail.com>
656 * argument.cs: Don't cache rarely used dynamic flag.
658 2009-11-27 Marek Safar <marek.safar@gmail.com>
660 * cs-parser.jay: Use jay global stacks (saves over 3MB for corlib).
662 2009-11-27 Marek Safar <marek.safar@gmail.com>
664 * ecore.cs (SimpleName): Removed no longer needed in_transit as
665 Resolve is now non-reentrant (saves ~0.6MB for corlib).
667 2009-11-26 Marek Safar <marek.safar@gmail.com>
669 A fix for bug #545081
670 * decl.cs: Check private nested types of nested types recursively.
672 2009-11-26 Marek Safar <marek.safar@gmail.com>
674 A fix for bug #558305
675 * location.cs: Ignore self referencing #line directive
677 2009-11-26 Marek Safar <marek.safar@gmail.com>
679 A fix for bug #558292
680 * class.cs: Allow single unsafe fixed buffer fields.
682 2009-11-26 Marek Safar <marek.safar@gmail.com>
684 * expression: Optimize few more zero-based operations.
686 2009-11-26 Marek Safar <marek.safar@gmail.com>
688 * cs-tokenizer.cs, cs-parser.jay: Simplify literal parsing, also
689 avoids boxing of literal values.
691 2009-11-26 Marek Safar <marek.safar@gmail.com>
693 * cs-tokenizer.cs, argument.cs, eval.cs, linq.cs, decl.cs,
694 expression.cs, ecore.cs, location.cs, cs-parser.jay, attribute.cs,
695 codegen.cs: LocatedToken redesing to avoid excessive allocation and
696 boxing (saves ~7MB for corlib). Also fixes presise token location.
698 2009-11-25 Marek Safar <marek.safar@gmail.com>
700 * ecore.cs, cs-parser.jay: Keep parser structures local. Share
703 2009-11-24 Marek Safar <marek.safar@gmail.com>
705 * expression.cs: Lower static array initializer barrier.
707 * support.cs, driver.cs: Share reader buffer.
709 2009-11-23 Marek Safar <marek.safar@gmail.com>
711 * cs-tokenizer.cs, support.cs: Some tokenizer optimizations.
713 2009-11-23 Marek Safar <marek.safar@gmail.com>
715 * cs-tokenizer.cs, support.cs: Use Dictionary instead of Hashtable,
716 cleanup some obsolete code.
718 2009-11-20 Marek Safar <marek.safar@gmail.com>
720 * context.cs, expression.cs, ecore.cs, complete.cs: Cleaned up
723 2009-11-20 Marek Safar <marek.safar@gmail.com>
725 * *.cs: Resolved expressions are never resolved again, this helps to
726 uncover some not easy to find bugs and improve the performance.
728 2009-11-19 Marek Safar <marek.safar@gmail.com>
730 * *.cs: Made constant expressions fully compatible with any other
733 2009-11-19 Marek Safar <marek.safar@gmail.com>
735 * *.cs: DoResolve is a worker method and has to be protected.
737 2009-11-18 Marek Safar <marek.safar@gmail.com>
739 * *.cs: More context specific handling.
741 2009-11-17 Marek Safar <marek.safar@gmail.com>
743 * *.cs: More context specific handling.
745 2009-11-16 Marek Safar <marek.safar@gmail.com>
747 * dynamic.cs, class.cs: Removed few fixed user types conversions.
749 * symbolwriter.cs: Uses public ILOffset.
751 2009-11-13 Marek Safar <marek.safar@gmail.com>
753 A fix for bug #553650
754 * generic.cs: Another missing TypeToCoreType, still too many to fix.
756 2009-11-13 Marek Safar <marek.safar@gmail.com>
758 A fix for bug #555170
760 * class.cs, delegate.cs, enum.cs: Constants have to be available
761 for parameters resolve.
763 2009-11-12 Marek Safar <marek.safar@gmail.com>
765 * typemanager.cs, argument.cs, support.cs, delegate.cs: Dynamic
768 2009-11-12 Marek Safar <marek.safar@gmail.com>
770 * argument.cs, context.cs, expression.cs, ecore.cs: Dynamic binding
771 with a statically known candidate set.
773 2009-11-11 Scott Peterson <lunchtimemama@gmail.com>
775 * generic.cs: Made type inflation for generic constraint checks
776 recursive. This fixes BGO #553655.
778 2009-11-11 Marek Safar <marek.safar@gmail.com>
780 * dynamic.cs, decl.cs, expression.cs, ecore.cs: More dynamic type
783 2009-11-10 Marek Safar <marek.safar@gmail.com>
785 * typemanager.cs, generic.cs, parameter.cs, argument.cs, dynamic.cs,
786 linq.cs, rootcontext.cs, ecore.cs, class.cs, delegate.cs,
787 attribute.cs: Add some dynamic error checking.
789 2009-11-07 Marek Safar <marek.safar@gmail.com>
791 A fix for bug #553465
793 * expression.cs: Fixed mixed version of expression tree anonymous
796 2009-11-06 Marek Safar <marek.safar@gmail.com>
798 A fix for bug #553031
800 * linq.cs, expression.cs, class.cs, cs-parser.jay: Initialize
801 expression tree version of anonymous type with members declaration.
803 2009-11-05 Marek Safar <marek.safar@gmail.com>
805 * parameter.cs: Handle nullable parameter default expression.
807 * argument.cs, dynamic.cs, expression.cs, support.cs, ecore.cs,
808 class.cs, attribute.cs: Check for wrong dynamic arguments.
810 2009-11-05 Marek Safar <marek.safar@gmail.com>
812 * statement.cs: Dynamic statements.
814 2009-11-04 Marek Safar <marek.safar@gmail.com>
816 * dynamic.cs, assign.cs, context.cs, expression.cs, ecore.cs:
817 Compound assignments over dynamic type.
819 2009-11-03 Marek Safar <marek.safar@gmail.com>
821 * argument.cs, dynamic.cs, expression.cs, delegate.cs: Dynamic
822 constructor arguments.
824 2009-10-30 Marek Safar <marek.safar@gmail.com>
826 * dynamic.cs, convert.cs, assign.cs, constant.cs, expression.cs,
827 codegen.cs: Unary mutator on dynamic member access expression.
829 2009-10-29 Marek Safar <marek.safar@gmail.com>
831 A fix for bug #550580
832 * convert.cs: Don't eliminate explicit precission casts.
834 2009-10-28 Marek Safar <marek.safar@gmail.com>
836 A fix for bug #550404
838 * parameter.cs, iterators.cs, context.cs, anonymous.cs,
839 expression.cs, statement.cs, ecore.cs: Quote any nested expression
842 2009-10-27 Marek Safar <marek.safar@gmail.com>
844 * constant.cs, nullable.cs: Create nullable-null as LiftedNull
847 * class.cs: Allow nullable binary user operators.
849 2009-10-26 Marek Safar <marek.safar@gmail.com>
851 * expression.cs: Move binary expression optimization at the end of
854 2009-10-23 Marek Safar <marek.safar@gmail.com>
856 * constant.cs, nullable.cs, expression.cs, literal.cs, cfold.cs:
857 Separate NullConstant from NullLiteral.
859 2009-10-23 Marek Safar <marek.safar@gmail.com>
861 * typemanager.cs, eval.cs, decl.cs, roottypes.cs, context.cs,
862 anonymous.cs, expression.cs, rootcontext.cs, ecore.cs, class.cs,
863 flowanalysis.cs, cs-parser.jay, driver.cs, codegen.cs: Split
864 ModuleContainer. Add common unclosed member check routine.
866 2009-10-22 Marek Safar <marek.safar@gmail.com>
868 * argument.cs: Use literal flag for real literals only.
870 * dynamic.cs: Use correct return type for custom delegates.
872 2009-10-22 Marek Safar <marek.safar@gmail.com>
874 * dynamic.cs, expression.cs: Pass logical binary flag to dynamic
877 2009-10-22 Marek Safar <marek.safar@gmail.com>
879 * dynamic.cs, ecore.cs: Dynamic invocation with void return type.
881 2009-10-21 Marek Safar <marek.safar@gmail.com>
883 * dynamic.cs, convert.cs, expression.cs, ecore.cs: Wrap array index
886 2009-10-21 Marek Safar <marek.safar@gmail.com>
888 * typemanager.cs, dynamic.cs, expression.cs: Don't resolve runtime
891 2009-10-20 Marek Safar <marek.safar@gmail.com>
893 * argument.cs, dynamic.cs, expression.cs: Latest API update.
895 2009-10-19 Marek Safar <marek.safar@gmail.com>
897 * typemanager.cs, expression.cs: Dynamic array initializer.
899 2009-10-16 Marek Safar <marek.safar@gmail.com>
901 * typemanager.cs, rootcontext.cs: Clear -nostdlib flag when object
904 2009-10-16 Marek Safar <marek.safar@gmail.com>
906 A fix for bug #493523, #507067
907 * convert.cs, nullable.cs, expression.cs: Do implicit and explicit
908 standard nullable conversion using underlying standard conversion
909 and not full conversion.
911 2009-10-15 Marek Safar <marek.safar@gmail.com>
913 * dynamic.cs, expression.cs, ecore.cs, delegate.cs: Check return
914 type in VerifyArgumentsCompat.
916 2009-10-15 Marek Safar <marek.safar@gmail.com>
918 * nullable.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
919 Reject variable used with type arguments.
921 2009-10-14 Marek Safar <marek.safar@gmail.com>
923 * argument.cs, dynamic.cs, assign.cs, expression.cs, ecore.cs:
924 Implement dynamic expressions assignment.
926 2009-10-14 Marek Safar <marek.safar@gmail.com>
928 * expression.cs: Build underlying expression when resolving unary
931 2009-10-14 Marek Safar <marek.safar@gmail.com>
933 * expression.cs: Emit enum array initializer using binary blob.
935 2009-10-08 Marek Safar <marek.safar@gmail.com>
937 * typemanager.cs, constant.cs: Optimize decimal constants which fit
940 2009-10-07 Marek Safar <marek.safar@gmail.com>
942 * typemanager.cs: Reset object_type.
944 * assign: Made SimpleAssign public.
946 2009-10-06 Marek Safar <marek.safar@gmail.com>
948 * typemanager.cs, decl.cs, namespace.cs, ecore.cs, class.cs: Pass
949 invocation assembly to IsThisOrFriendAssembly.
951 2009-10-05 Marek Safar <marek.safar@gmail.com>
953 * expression.cs: Equality comparison of generic parameter with
956 2009-10-05 Marek Safar <marek.safar@gmail.com>
958 A fix for bug #543570
959 * generic.cs: Import predefined constraints correctly.
961 2009-10-02 Marek Safar <marek.safar@gmail.com>
963 * ecore.cs: Don't crash on overloads with optional paremeters where
964 arguments count overflows.
966 * parameter.cs: Import optional parameter constants using optional
969 2009-10-01 Marek Safar <marek.safar@gmail.com>
971 * Makefile: Default is gmcs compiler.
973 2009-10-01 Marek Safar <marek.safar@gmail.com>
975 * cs-parser.jay: Fixed few NRE.
977 2009-10-01 Marek Safar <marek.safar@gmail.com>
979 * cs-parser.jay, driver.cs: Expose parser exception in verbose mode.
981 2009-09-30 Marek Safar <marek.safar@gmail.com>
983 * linq.cs, convert.cs, assign.cs, expression.cs, ecore.cs: Add
984 ShimExpression, ImplicitCast.
986 2009-09-30 Marek Safar <marek.safar@gmail.com>
988 A fix for bug #542959
989 * delegate.cs: Emit correct delegate instance variable when there
990 are static and non-static overloads.
992 2009-09-29 Marek Safar <marek.safar@gmail.com>
994 * dynamic.cs, linq.cs, anonymous.cs, expression.cs, statement.cs,
995 ecore.cs, cs-parser.jay: Unary expression dynamic compiler.
997 2009-09-28 Marek Safar <marek.safar@gmail.com>
999 A fix for bug #542487
1000 * ecore.cs: Resolve extension methods hidden by properties.
1002 2009-09-25 Marek Safar <marek.safar@gmail.com>
1004 * expression.cs, ecore.cs: More dynamic binary expressions.
1006 2009-09-22 Marek Safar <marek.safar@gmail.com>
1008 * nullable.cs, expression.cs: Fixed null lifted conversion for
1009 bitwise enum operations.
1011 2009-09-22 Marek Safar <marek.safar@gmail.com>
1013 * convert.cs, ecore.cs: Fixed explicit unsafe coversion of long
1014 values in checked context.
1016 2009-09-22 Marek Safar <marek.safar@gmail.com>
1018 * expression.cs, ecore.cs: Fixed array index constant conversion.
1020 2009-09-20 Miguel de Icaza <miguel@novell.com>
1022 * expression.cs: Do not crash when MemberLookup returns something
1023 that is not a MemberExpr here. Report error 582 instead.
1027 2009-09-18 Marek Safar <marek.safar@gmail.com>
1029 * decl.cs, class.cs: Check protected property accessors.
1031 2009-09-18 Marek Safar <marek.safar@gmail.com>
1033 * dynamic.cs, assign.cs: Dynamic compound assignment.
1035 2009-09-17 Marek Safar <marek.safar@gmail.com>
1037 * expression.cs: Fixed compound assignment explicit conversion.
1039 2009-09-17 Marek Safar <marek.safar@gmail.com>
1041 * expression.cs, ecore.cs: Cannot infer variables from method group.
1043 2009-09-16 Marek Safar <marek.safar@gmail.com>
1045 * argument.cs, dynamic.cs, convert.cs, context.cs, anonymous.cs,
1046 constant.cs, nullable.cs, expression.cs, literal.cs, ecore.cs,
1047 codegen.cs: Dynamic binary operations scaffolding.
1049 2009-09-15 Marek Safar <marek.safar@gmail.com>
1051 * expression.cs: Fixes nullable promotion for enum type variables.
1053 2009-09-11 Marek Safar <marek.safar@gmail.com>
1055 * driver.cs, dynamic.cs: Reset more static variables.
1057 2009-09-11 Marek Safar <marek.safar@gmail.com>
1059 * dynamic.cs, expression.cs, rootcontext.cs, namespace.cs, ecore.cs,
1060 driver.cs: Introduced Expression::MakeExpression.
1062 2009-09-11 Marek Safar <marek.safar@gmail.com>
1064 * eval.cs: Exposed MessageOutput instead of cleaning up eval API.
1066 2009-09-09 Marek Safar <marek.safar@gmail.com>
1068 * eval.cs, report.cs: Use Console.Out for all eval error or warning
1071 2009-09-09 Marek Safar <marek.safar@gmail.com>
1073 A fix for bug #518707
1074 * expression.cs (Is): Optimize only generic parameter type
1075 expression probing value type generic parameter.
1077 2009-09-09 Marek Safar <marek.safar@gmail.com>
1079 A fix for bug #532571
1080 * ecore.cs: Check for simple name type arguments used with
1083 2009-09-08 Marek Safar <marek.safar@gmail.com>
1085 A fix for bug #497421
1086 * generic.cs (CheckConstraint): Don't use buildin types to check for
1087 parameterless constructor.
1089 2009-09-08 Marek Safar <marek.safar@gmail.com>
1091 A fix for bug #537402
1092 * generic.cs (CheckConstraint): Correctly inflate generic type
1093 arguments when checking generic method.
1095 2009-09-08 Marek Safar <marek.safar@gmail.com>
1097 A fix for bug #536463
1098 * decl.cs (AddToContainer): Don't report collision between explicit
1099 and parameterless non-explicit members.
1101 2009-09-08 Marek Safar <marek.safar@gmail.com>
1103 * eval.cs: Reset more static stuff.
1105 2009-09-07 Marek Safar <marek.safar@gmail.com>
1107 A fix for bug #324625
1108 * expression.cs, ecore.cs: Create nested generic type expression
1109 using declaring and not current type.
1111 2009-09-07 Marek Safar <marek.safar@gmail.com>
1113 * *.cs: Changed Report class to accept various output printers and
1114 be an instance class. An expression resolver can now use different
1115 message reporter for each call and Report.Error can safely throw
1116 an exception. Part of ongoing work to turn mcs into proper library.
1118 2009-09-04 Marek Safar <marek.safar@gmail.com>
1120 * statement.cs, ecore.cs: Removed error reporting from emit code.
1122 2009-09-04 Marek Safar <marek.safar@gmail.com>
1124 * cs-parser.jay, parameter.cs: Moved parser check out of constructor
1126 2009-09-03 Marek Safar <marek.safar@gmail.com>
1128 * anonymous.cs, expression.cs, statement.cs, cs-parser.jay: Moved
1129 parser checks out of constructors.
1131 2009-09-02 Marek Safar <marek.safar@gmail.com>
1133 * expression.cs, statement.cs, ecore.cs: Use common Report.Error.
1135 2009-09-02 Marek Safar <marek.safar@gmail.com>
1137 A fix for bug #535448
1138 * anonymous.cs, class.cs: Copy return label between all contexts.
1140 2009-09-02 Marek Safar <marek.safar@gmail.com>
1142 A fix for bug #535395
1143 * namespace.cs: Resolve context can be null.
1145 2009-08-25 Marek Safar <marek.safar@gmail.com>
1147 A fix for bug #533912
1148 * generic.cs: Use correct context for constraints resolving.
1150 2009-08-25 Marek Safar <marek.safar@gmail.com>
1152 A fix for bug #532630
1153 * driver.cs: Trim conditional symbols.
1155 2009-08-25 Marek Safar <marek.safar@gmail.com>
1157 * context.cs: New file.
1159 * *.exe.sources, *.csproj: Updated.
1161 2009-08-25 Marek Safar <marek.safar@gmail.com>
1163 * generic.cs, parameter.cs, decl.cs, statement.cs, namespace.cs,
1164 class.cs, generic-mcs.cs, codegen.cs: Add GetSignatureForError to
1165 IMembercontext, some small cleanups.
1167 2009-08-24 Marek Safar <marek.safar@gmail.com>
1169 * *.cs: Split ResolveContext and EmitContext.
1171 2009-08-24 Marek Safar <marek.safar@gmail.com>
1173 * *.cs: Only ResolveContext implements IMemberContext.
1175 2009-08-21 Marek Safar <marek.safar@gmail.com>
1177 * *.cs: Renamed IResolveContext to IMemberContext.
1179 2009-08-21 Marek Safar <marek.safar@gmail.com>
1181 * *.cs: Detached ResolveContext from EmitContext.
1183 2009-08-21 Marek Safar <marek.safar@gmail.com>
1185 * codegen.cs: Moved flow-analysis to BlockContext.
1187 2009-08-21 Marek Safar <marek.safar@gmail.com>
1189 * *.cs: Detached BlockContext from EmitContext.
1191 2009-08-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1193 * statement.cs: avoid nullref when the return value of GetEnumerator()
1194 does not contain any MoveNext() method.
1196 2009-08-19 Marek Safar <marek.safar@gmail.com>
1198 * *.cs: Removed IResolveContext::GenericDeclContainer.
1200 2009-08-19 Marek Safar <marek.safar@gmail.com>
1202 * class.cs, delegate.cs: Changed Delegate to be TypeContainer based.
1204 2009-08-19 Marek Safar <marek.safar@gmail.com>
1206 * generic.cs, iterators.cs, expression.cs, statement.cs, ecore.cs,
1207 cs-parser.jay, attribute.cs, codegen.cs: Better error reports.
1209 2009-08-18 Marek Safar <marek.safar@gmail.com>
1211 * *.cs: Removed boolean fields from EmitContext.
1213 2009-08-18 Marek Safar <marek.safar@gmail.com>
1215 * *.cs: Add IResolveContext::IsStatic.
1217 2009-08-18 Marek Safar <marek.safar@gmail.com>
1219 * *.cs: Moved TopBlock's methods from EmitContext to TopBlock.
1221 2009-08-17 Marek Safar <marek.safar@gmail.com>
1223 * *.cs: Removed DeclContainer from EmitContext.
1225 2009-08-17 Marek Safar <marek.safar@gmail.com>
1227 * *.cs: Add IResolveContext::CurrentTypeParameters.
1229 2009-08-14 Marek Safar <marek.safar@gmail.com>
1231 * *.cs: Removed TypeContainer and ContainerType from EmitContext.
1233 2009-08-14 Marek Safar <marek.safar@gmail.com>
1235 * decl.cs, expression.cs, namespace.cs, ecore.cs, class.cs,
1236 codegen.cs: Add IResolveContext::LookupExtensionMethod.
1238 2009-08-13 Marek Safar <marek.safar@gmail.com>
1240 * decl.cs: Look in PartialContainer for parent type parameters.
1242 2009-08-13 Marek Safar <marek.safar@gmail.com>
1244 * decl.cs, namespace.cs, ecore.cs, class.cs, attribute.cs,
1245 codegen.cs: Add IResolveContext::LookupTypeParameter.
1247 2009-08-13 Marek Safar <marek.safar@gmail.com>
1249 * lambda.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
1250 Moved resolved logic from Emit to Resolve.
1252 2009-08-13 Marek Safar <marek.safar@gmail.com>
1254 * parameter.cs, decl.cs, roottypes.cs, class.cs, attribute.cs,
1255 codegen.cs: Reworked atttributes handling of ResolveContext.
1257 2009-08-12 Marek Safar <marek.safar@gmail.com>
1259 * decl.cs, ecore.cs, class.cs, attribute.cs, codegen.cs: Pushed
1260 LookupNamespaceOrType to ResolveContext.
1262 2009-08-12 Marek Safar <marek.safar@gmail.com>
1264 * typemanager.cs, decl.cs, expression.cs, namespace.cs, ecore.cs,
1265 class.cs: Removed unused parameters and methods.
1267 2009-08-11 Marek Safar <marek.safar@gmail.com>
1269 * generic.cs, lambda.cs, anonymous.cs, statement.cs, generic-mcs.cs,
1270 codegen.cs: Finding the best common type of a set of expressions for
1273 2009-08-07 Marek Safar <marek.safar@gmail.com>
1275 * dynamic.cs, expression.cs: More dynamic conversions.
1277 2009-08-06 Miguel de Icaza <miguel@novell.com>
1279 * generic.cs: This loop was incorrect, it was increment ii, but
1280 checking for `i'. This was a change introduced to fix #327497,
1283 * class.cs: Catch another case for cs0533 error, fixes #324782.
1285 2009-08-06 Rodrigo Kumpera <rkumpera@novell.com>
1287 * typemanager.cs (GetGenericArguments): SRE returns null for
1288 generic methods on type builder instances if they are not generic
1289 themselves. For example, for Foo<int>::Bar() it returns null, but
1290 not for Foo<int>::Bar<>() or Foo<int>::Bar<double>().
1292 2009-08-05 Marek Safar <marek.safar@gmail.com>
1294 * argument.cs, dynamic.cs, expression.cs, ecore.cs, class.cs,
1295 delegate.cs: Work on dynamic binding.
1297 2009-08-04 Marek Safar <marek.safar@gmail.com>
1299 A second fix for bug #525342
1300 * class.cs: Attach partial method attributes to method
1303 2009-08-03 Marek Safar <marek.safar@gmail.com>
1305 * typemanager.cs, parameter.cs, support.cs, class.cs: Dynamic type
1308 * rootcontext.cs: Default to langversion v4.
1310 2009-08-03 Marek Safar <marek.safar@gmail.com>
1312 * pending.cs: Check return type before member info is set.
1314 2009-08-03 Marek Safar <marek.safar@gmail.com>
1316 * anonymous.cs: Fully initialize generic hoisted field expression.
1318 2009-08-02 Miguel de Icaza <miguel@novell.com>
1320 * cs-parser.jay: Flag variables declared on the interactive shell
1321 as used to prevent the 168 warning about local variable not being
1324 2009-07-31 Marek Safar <marek.safar@gmail.com>
1326 * parameter.cs, dynamic.cs, support.cs, class.cs, delegate.cs,
1327 attribute.cs: Emit dynamic export attribute.
1329 2009-07-30 Marek Safar <marek.safar@gmail.com>
1331 * expression.cs: More verifier work.
1333 2009-07-29 Marek Safar <marek.safar@gmail.com>
1335 * nullable.cs: Fixed SRE crash during corlib compilation.
1337 2009-07-29 Marek Safar <marek.safar@gmail.com>
1339 * generic.cs, typemanager.cs, decl.cs, iterators.cs, convert.cs,
1340 nullable.cs, expression.cs, ecore.cs, class.cs, attribute.cs:
1341 More TypeManager.TypeToCoreType needed.
1343 2009-07-29 Marek Safar <marek.safar@gmail.com>
1345 * anonymous.cs: Update after recent SRE fixes.
1347 2009-07-28 Marek Safar <marek.safar@gmail.com>
1349 * typemanager.cs, expression.cs, ecore.cs, delegate.cs: Use correct
1350 version of GetFieldHandle for fields of generic types.
1352 2009-07-27 Marek Safar <marek.safar@gmail.com>
1354 * typemanager.cs, argument.cs, convert.cs, assign.cs, expression.cs,
1355 ecore.cs: Add TypeManager.IsDynamicType,
1356 PredefinedAttributes.Dynamic.
1358 2009-07-27 Marek Safar <marek.safar@gmail.com>
1360 A fix for bug #415375
1361 * expression.cs: Fixed object and reference type parameter
1364 2009-07-27 Marek Safar <marek.safar@gmail.com>
1366 A fix for bug #525342
1367 * class.cs: Attach partial method attributes to method
1370 2009-07-24 Marek Safar <marek.safar@gmail.com>
1372 * argument.cs, dynamic.cs, expression.cs, class.cs, attribute.cs:
1375 2009-07-24 Marek Safar <marek.safar@gmail.com>
1377 * anonymous.cs (MutateField): Add imported types handling.
1379 2009-07-23 Marek Safar <marek.safar@gmail.com>
1381 * expression.cs, delegate.cs: Moved arguments resolve into their
1382 counterparts expressions. Removed argument resolve from
1383 CollectionElementInitializer.
1385 2009-07-23 Marek Safar <marek.safar@gmail.com>
1387 A fix for bug #523683
1388 * convert.cs, delegate.cs: Use common overload mechanism for method
1389 group conversion check.
1391 2009-07-22 Marek Safar <marek.safar@gmail.com>
1393 A fix for bug #523899
1394 * generics.cs: Exact type inference with other bound types.
1396 2009-07-22 Raja R Harinath <harinath@hurrynot.org>
1398 Don't complain when the same type is implemented by the output
1399 assembly as well as multiple referenced assemblies
1400 * namespace.cs (RootNamespace.LookupTypeReflection): Add
1401 'must_be_unique' flag.
1402 (GlobalRootNamespace): Update to changes.
1403 (Namespace.LookupType): Pass 'must_be_unique' only when we don't
1404 already have a type in hand.
1406 2009-07-22 Marek Safar <marek.safar@gmail.com>
1408 * expression.cs: More verifier instrumentation.
1410 * statement.cs: Do proper throw expression conversion.
1412 2009-07-22 Marek Safar <marek.safar@gmail.com>
1414 A fix for bug #522789
1415 * expression.cs: Mutate invocation return type.
1417 2009-07-16 Marek Safar <marek.safar@gmail.com>
1419 * anonymous.cs: Split assignable and readonly generated variable
1422 2009-07-16 Marek Safar <marek.safar@gmail.com>
1424 A fix for bug #521671
1425 * statement.cs: Fixed crash when checking missing type.
1427 2009-07-16 Marek Safar <marek.safar@gmail.com>
1429 * typemanager.cs, generic.cs, argument.cs, linq.cs, convert.cs,
1430 assign.cs, expression.cs, statement.cs, support.cs, ecore.cs,
1431 class.cs, driver.cs: Work on dynamic binding.
1433 * dynamic.cs: New file.
1435 * *.sources, *.proj: Updated.
1437 2009-07-15 Marek Safar <marek.safar@gmail.com>
1439 * expression.cs (Conditional): Avoid double Resolve.
1441 2009-07-13 Marcus Griep <marcus@griep.us>
1443 * ecore.cs: Fix obscure bug with resolving members of interfaces
1444 that hide parent interface members. Fixes bug #444388 and corrects
1447 2009-07-13 Marek Safar <marek.safar@gmail.com>
1449 * expression.cs (LocalVariableReference): Bounce resolve.
1451 2009-07-10 Marek Safar <marek.safar@gmail.com>
1453 * typemanager.cs, lambda.cs, parameter.cs, convert.cs, anonymous.cs,
1454 expression.cs, literal.cs, ecore.cs, complete.cs: Moved internal
1457 * support.cs: New dynamic type wrapper.
1459 2009-07-08 Marek Safar <marek.safar@gmail.com>
1461 * ecore.cs, cs-parser.jay: Better error reporting for implicitly
1462 typed local variable.
1464 2009-07-06 Marek Safar <marek.safar@gmail.com>
1466 A fix for bug #519005
1467 * anonymous.cs: Use null_type as no return type placeholder.
1469 2009-07-02 Marek Safar <marek.safar@gmail.com>
1471 * generic.cs: Handle type inference of identical type parameters
1472 with different bounds.
1474 2009-07-01 Marek Safar <marek.safar@gmail.com>
1476 * expression.cs, class.cs: Events variance.
1478 * cs-parser.jay: Interface events error messages.
1480 2009-07-01 Marek Safar <marek.safar@gmail.com>
1482 * generic.cs, argument.cs: Updated type inference logic to C# 4.0.
1484 2009-06-29 Marek Safar <marek.safar@gmail.com>
1486 * parameter.cs, convert.cs, expression.cs, class.cs: Default
1487 parameter expression can be value-type New.
1489 * cs-parser.jay: Clean up too many parameter modifier boolean flags.
1491 2009-06-26 Marek Safar <marek.safar@gmail.com>
1493 * generic.cs, argument.cs, expression.cs, ecore.cs, cs-parser.jay:
1494 Implemented C# 4.0 named arguments.
1496 2009-06-24 Marek Safar <marek.safar@gmail.com>
1498 * typemanager.cs, parameter.cs, iterators.cs, convert.cs,
1499 expression.cs, ecore.cs, delegate.cs: Removed unnecessary ArgList
1500 parameter modifier. Also fixes bug #515497.
1502 2009-06-24 Marek Safar <marek.safar@gmail.com>
1504 * *.cs: Replaced ArrayList with Arguments in need of a nonsequential
1505 arguments expression to be implemented.
1507 *.sources: Add argument.cs
1509 2009-06-23 Marek Safar <marek.safar@gmail.com>
1511 * parameter.cs: Moved GetParameterIndexByName to base class.
1513 * expression.cs, statement.cs, ecore.cs, delegate.cs: Removed
1514 unused AType. Use argument's version of GetExpressionTree.
1516 2009-06-22 Marek Safar <marek.safar@gmail.com>
1518 * expression.cs, cs-parser.jay, attribute.cs, codegen.cs: Named
1521 2009-06-17 Marek Safar <marek.safar@gmail.com>
1523 A fix for bug #514096
1524 * class.cs: Allow IntPtr/UIntPtr fields to be volatile.
1526 2009-06-17 Marek Safar <marek.safar@gmail.com>
1528 * expression.cs: The first multi-dimensional array nested array
1529 initializers was not checked.
1531 * statement.cs (Switch): Fixed error message to reflect 2.0 changes.
1533 2009-06-17 Marek Safar <marek.safar@gmail.com>
1535 A fix for bug #513400
1536 * nullable.cs (EmitEquality): Operands emit could be simplified for
1537 built-in types when we now emit user operators differently.
1539 2009-06-16 Marek Safar <marek.safar@gmail.com>
1541 * ecore.cs: Report inaccessible delegate methods correctly.
1543 2009-06-16 Marek Safar <marek.safar@gmail.com>
1545 * parameter.cs, expression.cs, ecore.cs, class.cs, delegate.cs,
1546 cs-parser.jay: Implemented C# 4.0 optional parameters.
1548 2009-06-16 Marek Safar <marek.safar@gmail.com>
1550 * driver.cs: Removed broken DefineManifestResource.
1552 2009-06-16 Raja R Harinath <harinath@hurrynot.org>
1554 * Makefile [net_2_0_bootstrap]: Don't explicitly mention net_1_1.
1555 Use $(BOOTSTRAP_PROFILE) instead.
1557 2009-06-12 Jb Evain <jbevain@novell.com>
1559 * rootcontext.cs: add a Platform field.
1560 * driver.cs: handle /platform.
1561 * codegen.cs: pass the proper flags according to
1562 the platform when saving the assembly.
1564 2009-06-11 Marek Safar <marek.safar@gmail.com>
1566 * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
1567 Add optional parameters grammar.
1569 2009-06-10 Marek Safar <marek.safar@gmail.com>
1571 * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
1572 driver.cs: Split lang version and metadata version.
1574 2009-06-10 Marek Safar <marek.safar@gmail.com>
1576 * decl.cs: Better overload ctor collision error message.
1578 2009-06-05 Jb Evain <jbevain@novell.com>
1580 * driver.cs (EmbededResource): avoid using an internal method
1581 in gmcs to embed manifest resources.
1583 2009-06-04 Sebastien Pouliot <sebastien@ximian.com>
1585 * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
1586 the compiler from older mono versions (like moon's bots)
1588 2009-06-04 Marek Safar <marek.safar@gmail.com>
1590 * namespace.cs (LookupTypeReflection): Ignore collisions between
1593 2009-06-04 Marek Safar <marek.safar@gmail.com>
1595 * codegen.cs: Enabled generic type forwarders.
1597 2009-06-04 Marek Safar <marek.safar@gmail.com>
1599 * dmcs.*: Add another version of SRE compiler.
1601 2009-06-03 Marek Safar <marek.safar@gmail.com>
1603 * generic.cs, typemanager.cs, parameter.cs, convert.cs,
1604 generic-mcs.cs: Fixed variant type conversions.
1606 2009-06-02 Marek Safar <marek.safar@gmail.com>
1608 A fix for bug #507863
1609 * codegen.cs: Fixes a crash on invalid string value attribute.
1611 2009-06-01 Marek Safar <marek.safar@gmail.com>
1613 A fix for bug #508334
1614 * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
1615 cs-parser.jay: Fully import __arglist modifier.
1617 2009-05-29 Marek Safar <marek.safar@gmail.com>
1619 * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
1620 delegate.cs, generic-mcs.cs: Rewrote type variance checks to
1621 actually work with closed generic types.
1623 2009-05-27 Alan McGovern <amcgovern@novell.com>
1625 * class.cs, decl.cs, delegate.cs, parameter.cs:
1626 Fix the build by replacing the use of 'var' with the actual type.
1628 2009-05-27 Marek Safar <marek.safar@gmail.com>
1630 * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
1631 cs-parser.jay, generic-mcs.cs: Report wrong variant types
1634 * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
1637 2009-05-26 Rodrigo Kumpera <rkumpera@novell.com>
1638 Marek Safar <marek.safar@gmail.com>
1640 A fix for bug #377509
1641 * parameter.cs: Use predefined and not empty name for implicit
1644 2009-05-21 Marek Safar <marek.safar@gmail.com>
1646 * class.cs: Don't report wrong warnings for event fields.
1648 2009-05-21 Marek Safar <marek.safar@gmail.com>
1650 A fix for bug #504667
1651 * class.cs: Check for static class using parent container instead of
1654 2009-05-08 Marek Safar <marek.safar@gmail.com>
1656 A fix for bug #496922
1657 * expression.cs: Always use temporary variable when using object
1660 2009-04-28 Marek Safar <marek.safar@gmail.com>
1662 A fix for bug #495112
1663 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
1666 2009-04-27 Miguel de Icaza <miguel@novell.com>
1668 * driver.cs: Add a flag to work as a replacement for CSC in VS.
1670 2009-04-24 Miguel de Icaza <miguel@novell.com>
1672 * complete.cs: No idea how gonzalo got a null in the list, but
1675 2009-04-24 Miguel de Icaza <miguel@novell.com>
1677 * complete.cs (CompletionElementInitializer): New completion class
1678 to support completing inside a C# 3 element initializer, so this
1679 allows completion for Silverlight situations where it is very
1682 new TextBlock () { Fo<TAB>
1684 (CompletionSimpleName): Expose the prefix that was
1685 passed to the simple name.
1687 * cs-parser.jay (object_or_collection_initializer): Add support
1688 for element_initializers.
1690 * expression.cs (CollectionOrObjectInitializers.DoResolve):
1691 special case completion expressions as this method aggressively
1692 collects data before it operates, and errors were being thrown
1693 earlier than we were able to complete.
1695 2009-04-23 Miguel de Icaza <miguel@novell.com>
1697 * eval.cs: Make getcompletions silent and enable debugging output
1698 if the -v option is passed.
1700 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
1701 Consider looking up the namespace that matches the prefix being
1704 This is part of the support for allowing completions like:
1705 `System.Co<TAB>' to complete to System.Console.
1707 * complete.cs (CompletionSimpleName.AppendResults): Make this
1710 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
1712 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
1713 COMPLETE_COMPLETION as internal.
1715 2009-04-17 Miguel de Icaza <miguel@novell.com>
1717 * complete.cs: Include namespace resolution in simple names as
1718 well as global types and types in the using scope in the
1721 * namespace.cs: Supporting infrastrcture to provide completions
1722 based on the current using scope.
1724 * eval.cs: Introduce an entry point that allows for initialization
1725 to return a list of the files passed on the command line.
1727 2009-04-14 Marek Safar <marek.safar@gmail.com>
1729 A fix for bug #494243
1730 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
1732 2009-04-13 Marek Safar <marek.safar@gmail.com>
1734 A fix for bug #493887
1735 * statement.cs: Don't skip string multi-section with default or
1736 null label when populating string hashtable.
1738 2009-04-06 Marek Safar <marek.safar@gmail.com>
1740 A fix for bug #492329
1741 * expression.cs (New): Load variable when assigning type parameter
1744 2009-04-06 Marek Safar <marek.safar@gmail.com>
1746 A fix for bug #488960
1747 * decl.cs: Compare MVAR types using non-null values.
1749 2009-03-27 Marek Safar <marek.safar@gmail.com>
1751 * typemanager.cs, expression.cs: Removed unused nullable checks.
1753 2009-03-27 Marek Safar <marek.safar@gmail.com>
1755 * *.cs: Removed some gmcs conditionals.
1757 2009-03-26 Marek Safar <marek.safar@gmail.com>
1759 * generic.cs, support.cs: Moved generics stuff out of support.cs
1761 2009-03-24 Marek Safar <marek.safar@gmail.com>
1763 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
1766 2009-03-23 Marek Safar <marek.safar@gmail.com>
1768 * attribute.cs: Consider all members for error reporting when
1769 checking named arguments.
1771 2009-03-23 Marek Safar <marek.safar@gmail.com>
1773 A fix for bug #487625
1774 * namespace.cs: Use a warning for all predefined type conflicts.
1776 2009-03-23 Marek Safar <marek.safar@gmail.com>
1778 A fix for bug #485706
1779 * statement.cs: Explicitly type catch type argument to pass verifier
1782 2009-03-22 Miguel de Icaza <miguel@novell.com>
1784 Initial support to provide code completion facilities to consumers
1785 of the evaluator API.
1787 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
1788 support the completion engine. When we reach the end of the
1789 input stream instead of returning EOF, when this flag is true the
1790 tokenizer instead produces:
1792 One GENERATE_COMPLETION token: this token then must be
1793 handled in the grammar at every point where the user
1794 would likely request a completion.
1796 As many COMPLETE_COMPLETION tokens as necessary. These
1797 tokens are generated to assist the parser in unwinding and
1798 producing a valid parse tree.
1800 The parser rules do not have to be perfect, the parser needs to be
1801 augmented with judicious use of GENERATE_COMPLETION tokens to
1802 improve the areas where we can provide completion and the parser
1803 needs to add support for COMPLETE_COMPLETION tokens in productions
1806 It is common to not have enough support for COMPLETE_COMPLETION
1807 under certain rules and that even if we generated the
1808 GENERATE_COMPLETION token that the resulting tree will be invalid
1809 due to the missing rules that support COMPLETE_COMPLETION.
1811 The final EOF token is produced by having the parser notify the
1812 tokenizer when it reaches the root production that the next token
1815 * support.cs (CompletionResult): New Exception. This exception
1816 is thrown to return the completion results when one of the special
1817 completion expressions is reached.
1819 This exception is thrown by the completing ExpressionStatements
1820 classes that live in complete.cs
1822 * complete.cs (CompletingExpression): a new base class for
1823 completing expressions. This derives from the
1824 ExpressionStatement class and not from Expression as it allows
1825 completion to happen not only where expressions are expected in
1826 the grammar, but also where statements are expected.
1828 (CompletionSimpleName): A new class used to provide completions
1829 for SimpleNames. This currently only resolves to local
1830 variables from the evaluator context (GetVars call).
1832 (CompletionMemberAccess): Implements support for completing member
1835 * cs-parser.jay: Add support for completion in a few places.
1837 * eval.cs (GetCompletions): New public API for the evaluator that
1838 returns a list of possible completions given the input. The
1839 return value is an array of completions
1841 * anonymous.cs (Compatible): If the exception thrown from the
1842 resolved expression is a CompletionResult exception let that one
1843 through instead of printing a diagnostic error in the try/catch.
1845 2009-03-22 Miguel de Icaza <miguel@novell.com>
1849 * driver.cs (Main): Use Environment.Exit to quit quickly and
1850 prevent the compiler from doing the usual wait for helper thread
1853 This is to prevent a slowdown that was reported by Gonzalo on
1856 2009-03-19 Marek Safar <marek.safar@gmail.com>
1858 * ecore.cs: Load build-in types directly instead of accessing
1861 2009-03-18 Marek Safar <marek.safar@gmail.com>
1863 * ecore.cs: Always use unbox.any when available.
1865 2009-03-18 Marek Safar <marek.safar@gmail.com>
1867 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
1869 2009-03-17 Marek Safar <marek.safar@gmail.com>
1871 * generic.cs: Removed obsolete version of type inference.
1873 2009-03-16 Marek Safar <marek.safar@gmail.com>
1875 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
1876 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
1877 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
1878 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
1880 2009-03-11 Marek Safar <marek.safar@gmail.com>
1882 A fix for bug #482996
1883 * anonymous.cs: Make sure we are not infering return type when
1884 checking type compatibility.
1886 2009-03-11 Marek Safar <marek.safar@gmail.com>
1888 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
1889 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
1890 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
1891 attributes in their own structure. Needed when accessing their
1892 properties before they are resolved.
1894 2009-03-09 Marek Safar <marek.safar@gmail.com>
1896 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
1897 hashtable (~10x faster).
1899 * driver.cs: Removed wrong Reset.
1901 2009-03-08 Marek Safar <marek.safar@gmail.com>
1903 * class.cs: Use correct common base type for unmanaged delayed
1906 * rootcontext.cs: Wrap unhandled exception.
1908 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
1910 Make SeekableStreamReader self-tuning and arbitrarily seekable
1911 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
1913 (SeekableStreamReader.Position.set): Use it. Simplify logic
1914 which, as a side-effect, makes it arbitrarily-seekable. Tune the
1915 buffer size when the stream needs to be re-read from the beginning.
1917 2009-03-05 Marek Safar <marek.safar@gmail.com>
1919 A fix for bug #480100
1920 * parameter.cs: A parameter is not hoisted when used directly as ET.
1922 2009-03-04 Marek Safar <marek.safar@gmail.com>
1924 * statement.cs: Fixed an issue when using variable is of interface
1927 2009-03-03 Marek Safar <marek.safar@gmail.com>
1929 A fix for bug #480319
1930 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
1932 2009-03-03 Marek Safar <marek.safar@gmail.com>
1934 A fix for bug #480867
1935 * typemanager.cs, expression.cs, ecore.cs: Changed method group
1936 expression to have no valid type.
1938 2009-03-03 Marek Safar <marek.safar@gmail.com>
1940 A fix for bug #481258
1941 * class.cs: Set extension method flag in partial container.
1943 2009-03-03 Marek Safar <marek.safar@gmail.com>
1945 * statement.cs, typemanager.cs: Use expression for StringEmitter.
1947 * attribute.cs: Add sanity check.
1949 2009-02-27 Marek Safar <marek.safar@gmail.com>
1951 * class.cs: Add external constructor error.
1953 2009-02-26 Marek Safar <marek.safar@gmail.com>
1955 A fix for bug #475354
1956 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
1957 correctly user defined nullable equality operators.
1959 2009-02-25 Marek Safar <marek.safar@gmail.com>
1961 A fix for bug #479532
1962 * expression.cs: Implement NewInitialize::AddressOf.
1964 2009-02-25 Marek Safar <marek.safar@gmail.com>
1966 A fix for bug #413633
1967 * expression.cs: Iterate all base class-constraint types.
1969 2009-02-24 Marek Safar <marek.safar@gmail.com>
1971 A fix for bug #479209
1972 * literal.cs: Mutate null underlying type.
1974 2009-02-24 Marek Safar <marek.safar@gmail.com>
1976 A fix for bug #476295
1977 * convert.cs: Avoid wrapping implicitly convertible reference type.
1979 2009-02-23 Marek Safar <marek.safar@gmail.com>
1981 * iterators.cs: Create MemberName correctly.
1983 2009-02-23 Marek Safar <marek.safar@gmail.com>
1985 A fix for bug #478655
1986 * literal.cs: Check also underlying null type conversion.
1988 2009-02-21 Marek Safar <marek.safar@gmail.com>
1990 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
1992 2009-02-20 Marek Safar <marek.safar@gmail.com>
1994 A fix for bug #477447
1995 * statement.cs: Add reference to correct parent storey when this
1996 is accessible from deep children storey (more than 1 level).
1998 2009-02-19 Marek Safar <marek.safar@gmail.com>
2000 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
2001 * class.cs: Define base type members before setting up member cache.
2003 2009-02-18 Marek Safar <marek.safar@gmail.com>
2005 A fix for bug #477378
2006 * nullable.cs, expression.cs, statement.cs: More precise null type
2009 2009-02-18 Marek Safar <marek.safar@gmail.com>
2011 A fix for bug #472805
2012 * typemanager.cs, namespace.cs: Import only visible extension method
2015 2009-02-18 Marek Safar <marek.safar@gmail.com>
2017 A fix for bug #476895
2018 * attribute.cs: Use correct resolve context for attribute type.
2020 2009-02-18 Marek Safar <marek.safar@gmail.com>
2022 A fix for bug #476266
2023 * anonymous.cs: Mutate multi-dimensional arrays.
2025 2009-02-18 Marek Safar <marek.safar@gmail.com>
2027 A fix for bug #476400
2028 * statement.cs, expression.cs: Removed wrong Dispose optimization.
2030 2009-02-18 Marek Safar <marek.safar@gmail.com>
2032 A fix for bug #476811
2033 * generics.cs: Fixed null-literal check.
2035 2009-02-17 Marek Safar <marek.safar@gmail.com>
2037 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
2038 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
2039 messing with static variables.
2041 2009-02-16 Marek Safar <marek.safar@gmail.com>
2043 A fix for bug #475965
2044 * generics.cs: Check generic parameter type after extracting from
2047 2009-02-16 Marek Safar <marek.safar@gmail.com>
2049 A fix for bug #475823
2050 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
2053 2009-02-14 Marek Safar <marek.safar@gmail.com>
2055 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
2056 Simplified event field definition using backing field and not
2057 field builder directly.
2059 * expression.cs (EmitLdArg): Optimize fast paths.
2061 2009-02-13 Marek Safar <marek.safar@gmail.com>
2063 A fix for bug #475327
2064 * expression.cs (ArrayCreation): Don't mutate values optimized away.
2066 2009-02-13 Marek Safar <marek.safar@gmail.com>
2068 A fix for bug #475342
2069 * cs-parser.jay: Using 'super' instead of 'base' to call base
2070 constructor crashes compiler.
2072 2009-02-13 Marek Safar <marek.safar@gmail.com>
2074 A fix for bug #475354
2075 * expression.cs (Constantify): Add nullable types.
2077 * const.cs (EmitDecimalConstant): Avoid explicit cast.
2079 2009-02-12 Marek Safar <marek.safar@gmail.com>
2081 A fix for bug #475246
2082 * expression.cs: More broken flowanalysis hacking needed.
2084 2009-02-12 Marek Safar <marek.safar@gmail.com>
2086 * attribute.cs: Compare only ref/out array modifiers.
2088 2009-02-11 Marek Safar <marek.safar@gmail.com>
2090 * statement.cs: Use member cache when looking for foreach members.
2092 2009-02-11 Marek Safar <marek.safar@gmail.com>
2094 * expression.cs: Don't expose internal initializer types.
2096 * statement.cs: Check also explicit conversions for goto case.
2098 2009-02-11 Marek Safar <marek.safar@gmail.com>
2100 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
2102 2009-02-10 Marek Safar <marek.safar@gmail.com>
2104 * *.cs: Replace null-type with NullLiteral where appropriate.
2106 2009-02-09 Marek Safar <marek.safar@gmail.com>
2108 * expression.cs: Initializer of reference argument use temporary
2109 variable to be verifiable.
2111 * parameter.cs: Share EmitLdArg.
2113 2009-02-09 Marek Safar <marek.safar@gmail.com>
2115 A fix for bug #473559
2116 * class.cs: Fixed: Not reporting error about nested class with the
2119 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
2121 Contributed under the MIT/X11 license.
2123 * generic.cs: Added VerifyVariantTypeParameters which performs new
2124 variance verification logic. The old logic, based on the spec, was
2125 wrong because the spec is full of LIES!
2127 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
2129 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
2132 * ecore.cs: Added calls to the new variance verification logic.
2135 * delegate.cs: Removed calls to the old variance verification logic.
2137 2009-02-06 Marek Safar <marek.safar@gmail.com>
2139 * delegate.cs: Use cached Invoke method directly.
2141 2009-02-06 Marek Safar <marek.safar@gmail.com>
2143 * expression.cs: Emit expression tree for hoisted variable access.
2145 2009-02-04 Marek Safar <marek.safar@gmail.com>
2147 * namespace.cs: Add better extension class check.
2149 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
2151 * generic.cs: Fixed typeo (TypeParameter.Variacne).
2153 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
2155 This patch adds initial generic variance support to the compiler.
2156 It is contributed under the MIT/X11 license.
2158 * typemanager.cs: Modified ImplementsInterface to check variance.
2159 Added VerifyVariantTypeParameters which checks the specified type to see
2160 if it uses a variant type parameter as a type argument (which is not
2161 allowed). Added IsVariantOf which determins if the first type is a
2162 variant of the second. NOTE: This only supports reference types at
2163 the moment to conform with the current level of VM support. When the
2164 VM supports value types, this will follow step.
2166 * generic.cs: Added the Variance enum. Added a Variance property to
2167 TypeParameter and added variance support to definition phase. Added a
2168 Variance property to TypeParameterName. Also check to make sure that
2169 no variant types appear in generic method parameters.
2171 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
2172 keywords if the langversion supports it.
2174 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
2175 that variant types are only used in legal positions. Also added
2176 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
2179 * decl.cs: Construct TypeParameter with the variance information.
2181 * convert.cs: Checks variance in ImplicitReferenceConversionExists
2182 and ImplicitConversionStandard.
2184 * rootcontext.cs: Added new "Future" language version.
2186 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
2187 type parameters are not used as type arguments in interface inheritance.
2188 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
2189 parameters are not used as method return types. In MemberBase.
2190 ResolveMemberType, ensure that variant type parameters are not used
2191 as type arguments. Also call VerifyNoVariantTypeParameters on every
2192 set of parameters which are resolved.
2194 * delegate.cs: Modified Delegate.Define to ensure that variant
2195 parameters are not used as type arguments and that a contravariant
2196 parameter is not used as the return type. Also call
2197 VerifyNoVariantTypeParameters on the delegate parameters.
2199 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
2200 to specify generic variance.
2202 * driver.cs: Added support for LanguageVersion.Future in the form of
2203 "-langversion:future".
2205 * generic-mcs.cs: Stubbed out new members in generic.cs.
2207 2009-02-03 Marek Safar <marek.safar@gmail.com>
2209 * class.cs, generic.cs: Emit type parameter constraints for nested
2212 2009-02-02 Marek Safar <marek.safar@gmail.com>
2214 A fix for bug #471213
2215 * class.cs: Avoid emitting backing field for abstract event fields.
2217 2009-02-01 Marek Safar <marek.safar@gmail.com>
2219 A fix for bug #359731
2220 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
2223 2009-01-30 Marek Safar <marek.safar@gmail.com>
2225 A fix for bug #470767
2226 * statement.cs: Introduced BlockScopeExpression, needed when
2227 expression tree conversion has to emit scope variables.
2229 2009-01-29 Marek Safar <marek.safar@gmail.com>
2231 * class.cs: Remove duplicate CallingConvention.
2233 2009-01-29 Marek Safar <marek.safar@gmail.com>
2235 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
2236 when I finally found the right naming convention.
2238 2009-01-29 Marek Safar <marek.safar@gmail.com>
2240 * cs-tokenizer.cs: Put back different open parens optimization.
2242 2009-01-28 Marek Safar <marek.safar@gmail.com>
2244 A fix for bug #470227
2245 * cs-tokenizer.cs: Remove too agressive parser optimization.
2247 2009-01-28 Marek Safar <marek.safar@gmail.com>
2249 A fix for bug #324319
2250 * class.cs: Remove too early base type resolve.
2252 2009-01-27 Marek Safar <marek.safar@gmail.com>
2254 A fix for bug #324319
2255 * ecore.cs: Explicitly type null when assigning to type argument to
2256 make pass verifier check.
2258 2009-01-27 Marek Safar <marek.safar@gmail.com>
2260 * anonymous.cs: Fixed recent regression when initializing captured
2263 2009-01-26 Marek Safar <marek.safar@gmail.com>
2265 A fix for bug #469019
2266 * anonymous.cs: Use all parent type parameters when instantiating
2267 nested generic storey.
2269 2009-01-26 Marek Safar <marek.safar@gmail.com>
2271 * expression.cs: Check for null instance methodgroup expression.
2273 2009-01-26 Marek Safar <marek.safar@gmail.com>
2275 A fix for bug #469244
2276 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
2277 instance inside a conditional expression.
2279 2009-01-23 Marek Safar <marek.safar@gmail.com>
2281 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
2282 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
2283 GetElementType and HasElementType. IsValueType clean up.
2285 2009-01-23 Marek Safar <marek.safar@gmail.com>
2287 * nullable.cs: Use common EmitCall.
2289 * expression.cs: Emit constraint. for virtual calls only.
2291 2009-01-23 Marek Safar <marek.safar@gmail.com>
2293 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
2294 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
2295 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
2298 2009-01-22 Jb Evain <jbevain@novell.com>
2300 * anonymous.cs: make anonymous types' ToString implementation
2301 match what csc outputs.
2303 2009-01-21 Marek Safar <marek.safar@gmail.com>
2305 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
2308 2009-01-17 Marek Safar <marek.safar@gmail.com>
2310 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
2313 2009-01-16 Marek Safar <marek.safar@gmail.com>
2315 * nullable.cs (LiftedBinaryOperator): Check for all possible null
2318 2009-01-15 Marek Safar <marek.safar@gmail.com>
2320 A fix for bug #466634
2321 * statement.cs: Add reference for nested storey when only this
2324 2009-01-15 Marek Safar <marek.safar@gmail.com>
2326 A fix for bug #466474
2327 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
2330 2009-01-15 Marek Safar <marek.safar@gmail.com>
2332 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
2333 Fixed nested stories parent referencing process. Also fixes #463985.
2335 2009-01-06 Marek Safar <marek.safar@gmail.com>
2337 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
2338 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
2339 implementation. Also fixes #463108.
2341 2009-01-05 Marek Safar <marek.safar@gmail.com>
2343 A fix for bug #416109
2344 * decl.cs: Issue correct CLSAttribute warning location.
2346 2009-01-05 Marek Safar <marek.safar@gmail.com>
2348 A fix for bug #456775
2349 * attribute.cs: Use attribute owner scope when resolving attribute
2352 2009-01-05 Marek Safar <marek.safar@gmail.com>
2354 A fix for bug #457257
2355 * decl.cs: Fixed incorrect member declaring type comparison.
2357 2009-01-05 Marek Safar <marek.safar@gmail.com>
2359 A fix for bug #460896
2360 * driver.cs: Handle /RES resources as embeddable.
2362 2009-01-05 Marek Safar <marek.safar@gmail.com>
2364 A fix for bug #462515
2365 * ecore.cs: Report inacessible members upwards.
2367 2009-01-05 Marek Safar <marek.safar@gmail.com>
2369 A fix for bug #463190, #463192
2370 * decl.cs, namespace.cs: Also import internal extension classes.
2372 2009-01-04 Marek Safar <marek.safar@gmail.com>
2374 A fix for bug #463415
2375 * generic.cs: Use right index for RemoveDependentTypes.
2377 2009-01-02 Marek Safar <marek.safar@gmail.com>
2379 A fix for bug #463196
2380 * expression.cs: Fixed enum to null comparison.
2382 2009-01-02 Marek Safar <marek.safar@gmail.com>
2384 A fix for bug #463121
2385 * nullable.cs: Fixed nullable user equality operator comparison.
2387 2009-01-02 Marek Safar <marek.safar@gmail.com>
2389 A fix for bug #462950
2390 * class.cs, decl.cs: Use full explicit name when defining automatic
2391 property backing field.
2393 2009-01-02 Marek Safar <marek.safar@gmail.com>
2395 A fix for bug #462592
2396 * pending.cs: Emit type arguments for generic proxy method.
2398 2008-12-30 Marek Safar <marek.safar@gmail.com>
2400 * expression.cs (As): Mutate all type arguments.
2402 2008-12-29 Marek Safar <marek.safar@gmail.com>
2404 A fix for bug #462622
2405 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
2408 2008-12-29 Marek Safar <marek.safar@gmail.com>
2410 A fix for bug #450782
2411 * ecore.cs: Consider more variables of form V.I to be fixed.
2413 2008-12-29 Marek Safar <marek.safar@gmail.com>
2415 A fix for bug #460712
2416 * typemanager.cs: Core types could be imported.
2418 2008-12-28 Marek Safar <marek.safar@gmail.com>
2420 A fix for bugs #460847, #460772, #458049, #457339, #447807
2421 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
2422 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
2423 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
2424 user lambdas used inside query clauses.
2426 2008-12-18 Marek Safar <marek.safar@gmail.com>
2428 A fix for bug #460229
2429 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
2431 2008-12-18 Marek Safar <marek.safar@gmail.com>
2433 A fix for bug #459952
2434 * decl.cs, namespace.cs: Use common CheckAccessLevel.
2436 2008-12-18 Marek Safar <marek.safar@gmail.com>
2438 A fix for bug #459630
2439 * convert.cs: Enum to valuetype conversion is not allowed.
2441 2008-12-18 Marek Safar <marek.safar@gmail.com>
2443 A fix for bug #457087
2444 * generic.cs: Don't crash when constraint comes from type
2447 2008-12-16 Marek Safar <marek.safar@gmail.com>
2449 A fix for bug #459221
2450 * anonymous.cs, statement.cs: Delay only captured this
2453 2008-12-12 Marek Safar <marek.safar@gmail.com>
2455 A fix for bug #457489
2456 * anonymous.cs, statement.cs: Split anonymous storey instantiation
2457 and initialization to capture scope initializers correctly.
2459 2008-12-11 Marek Safar <marek.safar@gmail.com>
2461 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
2462 ParameterReference refactoring.
2464 2008-12-03 Marek Safar <marek.safar@gmail.com>
2466 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
2467 to be imported from any assembly.
2469 2008-12-03 Marek Safar <marek.safar@gmail.com>
2471 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
2472 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
2473 from anonymous method and lambda expression.
2475 2008-12-01 Marek Safar <marek.safar@gmail.com>
2477 A fix for bug #448560
2478 * expression.cs (As): Box any generic type arguments to be
2481 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2483 Add tripwire for implicit conversion bugs
2484 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
2486 (MethodGroupExpr.OverloadResolve): Add sanity check between
2487 IsApplicable and VerifyArgumentsCompat.
2488 (VerifyArgumentsCompat): Report CS1501 where appropriate.
2490 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2492 Fix build break in System.Data_test
2493 * convert.cs (ImplicitConversionExists): Move NullLiteral
2495 (ImplicitStandardConversionExists): ... here.
2497 2008-11-28 Marek Safar <marek.safar@gmail.com>
2499 * literal.cs: Emit correctly explicit null to nullable cast.
2501 2008-11-28 Marek Safar <marek.safar@gmail.com>
2503 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
2506 2008-11-28 Marek Safar <marek.safar@gmail.com>
2508 A fix for bug #449005
2509 * convert.cs, nullable.cs: Use only one implicit nullable
2512 2008-11-27 Marek Safar <marek.safar@gmail.com>
2514 * convert.cs, literal.cs: More Convert cleanup is needed.
2516 2008-11-27 Marek Safar <marek.safar@gmail.com>
2518 * decl.cs, class.cs: Fixed misleading error message.
2520 2008-11-26 Marek Safar <marek.safar@gmail.com>
2522 A fix for bug #449005
2523 * nullable.cs (EmitEquality): Disable optimization for user operator
2526 2008-11-25 Marek Safar <marek.safar@gmail.com>
2528 A fix for bug #447027
2529 * anonymous.cs (HoistedVariable): Cache also outer access to deal
2530 with context variables stored as expression instances.
2532 2008-11-25 Marek Safar <marek.safar@gmail.com>
2534 A fix for bug #447027
2535 * delegate.cs: Fixed delegate VerifyMethod logic.
2537 2008-11-24 Marek Safar <marek.safar@gmail.com>
2539 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
2542 2008-11-21 Marek Safar <marek.safar@gmail.com>
2544 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
2545 member type resolve to follow normal flow, instead of random
2548 2008-11-21 Marek Safar <marek.safar@gmail.com>
2550 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
2553 2008-11-21 Marek Safar <marek.safar@gmail.com>
2555 * const.cs: Emit decimal array constant as literal.
2557 2008-11-20 Marek Safar <marek.safar@gmail.com>
2559 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
2561 2008-11-19 Marek Safar <marek.safar@gmail.com>
2563 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
2564 into real property (saves 8 MB for corlib compilation).
2566 2008-11-19 Marek Safar <marek.safar@gmail.com>
2568 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
2569 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
2570 generic-mcs.cs: Small cleanup of TypeArguments.
2572 2008-11-18 Marek Safar <marek.safar@gmail.com>
2574 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
2575 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
2576 of ConstructedType expression, renamed to GenericTypeExpr.
2578 2008-11-17 Marek Safar <marek.safar@gmail.com>
2580 A fix for bug #445303
2581 * location.cs (IsConditionalDefined): Handle undefined global
2584 2008-11-17 Marek Safar <marek.safar@gmail.com>
2586 A fix for bug #444678
2587 * expression.cs (TryReduceConstant): Always create new constant
2590 2008-11-17 Marek Safar <marek.safar@gmail.com>
2592 A fix for bug #444673
2593 * ecore.cs: Ignore open generic types when used as generic type
2596 2008-11-17 Marek Safar <marek.safar@gmail.com>
2598 A fix for bug #445458
2599 * expression.cs, cs-parser.jay: Don't crash when an expression
2602 2008-11-17 Marek Safar <marek.safar@gmail.com>
2604 A fix for bug #445464
2605 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
2606 inside unbound type.
2608 2008-11-14 Jb Evain <jbevain@novell.com>
2610 * driver.cs: ignore empty -nowarn argument such as
2611 the one in -nowarn:12,13,,.
2613 2008-11-13 Marek Safar <marek.safar@gmail.com>
2615 A fix for bug #444271
2616 * anonymous.cs: Rescan parent storeys when best candidate was
2619 2008-11-13 Marek Safar <marek.safar@gmail.com>
2621 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
2622 useless UnboundTypeExpression.
2624 * attribute.cs: Do check obsolete attribute on generic types.
2626 2008-11-12 Marek Safar <marek.safar@gmail.com>
2628 A fix for bugs #425680, #400139
2629 * ecore.cs, expression.cs: Trying to do some almost_matched_members
2632 2008-11-11 Marek Safar <marek.safar@gmail.com>
2634 A fix for bug #435747
2635 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
2636 compound value types assignment. Few micro optimizations added.
2638 2008-11-10 Marek Safar <marek.safar@gmail.com>
2640 A fix for bug #442610
2641 * anonymous.cs (MutateConstructor): More SRE hacking.
2643 2008-11-10 Marek Safar <marek.safar@gmail.com>
2645 A fix for bug #442579
2646 * ecore.cs: Also initialize expanded form of a method with 1 params
2649 2008-11-06 Marek Safar <marek.safar@gmail.com>
2651 * expression.cs (UnaryMutator): Do early l-side check.
2653 2008-11-05 Miguel de Icaza <miguel@novell.com>
2655 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
2656 Init, otherwise we would crash later on when checking for friend
2659 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
2660 Otherwise we never get any meaningful information as to what
2663 2008-11-05 Marek Safar <marek.safar@gmail.com>
2665 A fix for bug #436318
2666 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
2668 2008-11-05 Miguel de Icaza <miguel@novell.com>
2670 * namespace.cs: Turns out that it was a really bad idea to hide
2671 the errors for namespaces not found here in eval mode.
2673 * eval.cs: When we process using clauses, only enter those into
2674 the list of valid using clauses after they have been validated.
2676 The above change gives the proper semantics: it does not
2677 senselessly report the same errors with broken using statements by
2678 never storing them in the first place when they are invalid.
2680 2008-11-05 Marek Safar <marek.safar@gmail.com>
2682 A fix for bug #421839
2683 * cs-parser.jay: Remove expression from coalesce rule to force lower
2684 priority than the assignment operator.
2686 2008-11-05 Marek Safar <marek.safar@gmail.com>
2688 A fix for bug #437875
2689 * nullable.cs: Compile correctly method group operand used with null
2690 coalescing operator.
2692 2008-11-04 Marek Safar <marek.safar@gmail.com>
2694 A fix for bug #434589
2695 * expression.cs (Binary): Ignore lifted conversions when at least
2696 one operand is of reference type.
2698 2008-11-04 Marek Safar <marek.safar@gmail.com>
2700 * cs-parser.jay: Better syntax error report.
2702 2008-11-03 Marek Safar <marek.safar@gmail.com>
2704 A fix for bug #436792
2705 * cs-parser.jay: Use GetLocation to access location.
2707 2008-11-03 Marek Safar <marek.safar@gmail.com>
2709 A fix for bug #440774
2710 * cs-parser.jay: Also set current_array_type when parsing local
2713 2008-11-03 Marek Safar <marek.safar@gmail.com>
2715 A fix for bug #440785
2716 * expression.cs (As): Don't resolve self modifing expression
2719 2008-11-03 Marek Safar <marek.safar@gmail.com>
2721 A fix for bug #439447
2722 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
2724 2008-11-03 Marek Safar <marek.safar@gmail.com>
2726 A fix for bug #437571
2727 * cs-parser.jay: Fixes internal error for invalid expression
2730 2008-10-17 Marek Safar <marek.safar@gmail.com>
2732 * ecore.cs: Resolve correctly ambiguous params delegate methods.
2734 2008-10-17 Marek Safar <marek.safar@gmail.com>
2736 * generic.cs, anonymous.cs: Simplified GetDeclarations.
2738 2008-10-17 Marek Safar <marek.safar@gmail.com>
2740 * cs-tokenizer.cs: More precise cast parsing.
2742 2008-10-16 Martin Baulig <martin@ximian.com>
2744 * anonymous.cs (AnonymousMethodStorey): Put back the
2745 `hoisted_locals' hashtable and use it in EmitType().
2747 2008-10-15 Marek Safar <marek.safar@gmail.com>
2749 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
2750 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
2753 2008-10-14 Marek Safar <marek.safar@gmail.com>
2755 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
2757 2008-10-14 Marek Safar <marek.safar@gmail.com>
2759 * statement.cs: Mutate scope initializers.
2761 2008-10-14 Marek Safar <marek.safar@gmail.com>
2763 * expression.cs: Use typeless value for This constant.
2765 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
2767 2008-10-14 Marek Safar <marek.safar@gmail.com>
2769 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
2772 2008-10-13 Marek Safar <marek.safar@gmail.com>
2774 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
2777 2008-10-13 Marek Safar <marek.safar@gmail.com>
2779 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
2780 parser and tokenizer. Fixes many ambiguities including #433258.
2782 2008-10-10 Marek Safar <marek.safar@gmail.com>
2784 * cs-parser.jay: Fixed missing accessor recovery.
2786 2008-10-10 Marek Safar <marek.safar@gmail.com>
2788 A fix for bug #433701
2789 * expression.cs: Better error message.
2791 2008-10-10 Marek Safar <marek.safar@gmail.com>
2793 * cs-parser.jay, expression.cs: Start reporting real parser errors.
2795 * Makefile: Disabled unused debug symbols.
2797 Also fixes: #320556, #321097, #321656, #321876, #351316
2799 2008-10-09 Miguel de Icaza <miguel@novell.com>
2801 * eval.cs: rename "<interactive>" to "{interactive}", to work
2802 around a requirement in the compiler that this be a valid
2803 filename, and in Windows it is not (433886).
2805 2008-10-09 Marek Safar <marek.safar@gmail.com>
2807 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
2809 2008-10-08 Marek Safar <marek.safar@gmail.com>
2811 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
2812 cs-parser.jay: Generic type declaration and type arguments cleanup.
2814 2008-10-05 Marek Safar <marek.safar@gmail.com>
2816 * cs-parser.jay: Allow parsing weird array creation construct.
2818 2008-10-05 Marek Safar <marek.safar@gmail.com>
2820 * cs-parser.jay: Conflicts reduction.
2822 2008-10-04 Marek Safar <marek.safar@gmail.com>
2824 * cs-parser.jay: Conflicts reduction.
2826 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
2829 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
2830 property. Add a 'count' hint about the use of the shared vector.
2831 Ensure that we don't leak out dirty bits.
2832 (UsageVector.MergeChild): Throw away information about variables
2834 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
2836 2008-10-03 Marek Safar <marek.safar@gmail.com>
2838 A fix for bug #431746
2839 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
2840 parameters when iterator is created.
2842 2008-10-03 Marek Safar <marek.safar@gmail.com>
2844 A fix for bug #431827
2845 * expression.cs: Fixed right based pointer arithmetic operations
2848 2008-10-03 Marek Safar <marek.safar@gmail.com>
2850 A fix for bug #353779
2851 * assign.cs, expression.cs: Fixed compound assignment conversions.
2853 2008-10-02 Marek Safar <marek.safar@gmail.com>
2855 A fix for bug #375262
2856 * statement.cs: Refactor ArrayForeach to be usable with string
2857 indexer. Optimized single dimentional arrays foreach.
2859 2008-10-02 Marek Safar <marek.safar@gmail.com>
2861 A fix for bug #431255
2862 * anonymous.cs, expression.cs: Removed broken optimization.
2864 2008-10-01 Marek Safar <marek.safar@gmail.com>
2866 * anonymous.cs: Use full type parameters of parent generic
2867 containers. Removed unnecessary AddParentStoreyReference call.
2869 2008-10-01 Marek Safar <marek.safar@gmail.com>
2871 A fix for bug #324702
2872 * class.cs: Use better shorter names for explicit interface member
2875 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
2877 2008-10-01 Marek Safar <marek.safar@gmail.com>
2879 * expression.cs: Use new interface to check fixed expression.
2881 2008-10-01 Marek Safar <marek.safar@gmail.com>
2883 A fix for bug #421101
2884 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
2885 interface to check for fixed fixed-buffers.
2887 2008-10-01 Marek Safar <marek.safar@gmail.com>
2889 A fix for bug #429264
2890 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
2892 * delegate.cs: Removed unnecessary casts.
2894 2008-09-30 Marek Safar <marek.safar@gmail.com>
2896 A fix for bug #352151
2897 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
2898 class.cs: Fixed already defined explicit interface members check.
2900 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
2902 cs-tokenizer.cs: Fix typo.
2904 2008-09-28 Miguel de Icaza <miguel@novell.com>
2906 * eval.cs (InteractiveBase): The quit command now just sets a
2907 flag, instead of calling Environment.Exit(), it is milder on
2910 CompiledMethod is now in Mono.CSharp, not nested inside
2911 the Evaluator, it was inconvenient to use.
2913 2008-09-27 Miguel de Icaza <miguel@novell.com>
2915 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
2916 code to be invoked without having to reparse.
2918 2008-09-27 Miguel de Icaza <miguel@novell.com>
2920 * ecore.cs: The recent changes to FieldExpr broke this as well.
2921 Fixes LINQ queries in the interactive shell.
2923 * Multiple files: indentation fixing for the Mono coding
2924 guidelines for the switch statement.
2926 * eval.cs: Make the Evaluator API thread safe.
2928 2008-09-26 Marek Safar <marek.safar@gmail.com>
2930 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
2931 constructor parsing.
2933 2008-09-26 Marek Safar <marek.safar@gmail.com>
2935 A fix for bug #325326
2936 * statement.cs: Check possible mistaken empty statement using
2937 explicit blocks only.
2939 2008-09-25 Miguel de Icaza <miguel@novell.com>
2941 * eval.cs (LoadAssembly, ReferenceAssembly): Call
2942 RootNamespace.ComputeNamespaces to update the internal list of
2943 namespaces, this is no longer done for us.
2945 (InteractiveBase): Use the Evaluator APIs instead of calling into
2948 2008-09-25 Marek Safar <marek.safar@gmail.com>
2950 A fix for bug #429264
2951 * expression.cs: Missing mutator for access to multidimensional
2954 2008-09-25 Marek Safar <marek.safar@gmail.com>
2956 * class.cs, statement: Emit DebuggerHidden attribute for iterator
2959 * driver.cs: Missing input argument check.
2961 2008-09-25 Marek Safar <marek.safar@gmail.com>
2963 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
2964 expression.cs, statement.cs, rootcontext.cs, class.cs,
2965 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
2968 2008-09-24 Miguel de Icaza <miguel@novell.com>
2970 * ecore.cs (FieldExpr): Only initialize eclass when we return a
2971 fully constructed FieldExpr, fixes the regression introduced in
2974 * ecore.cs, expression.cs: Plug back the eclass initialization as
2975 otherwise it regresses `csharp'.
2977 2008-09-24 Marek Safar <marek.safar@gmail.com>
2979 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
2980 ecore.cs, attribute.cs: Moved obsolete method checks from emit
2981 phase to resolve phase. It resolves problems with expression trees
2982 and fixes bugs #323796, #325156.
2984 2008-09-23 Marek Safar <marek.safar@gmail.com>
2986 * codegen.cs: Report better error when symbol writer is missing.
2988 2008-09-23 Marek Safar <marek.safar@gmail.com>
2990 * codegen.cs: Set .NET symbol writer.
2992 * decl.cs: Guard against null generic arguments.
2994 * report.cs: Don't report exactly same additional details.
2996 2008-09-22 Marek Safar <marek.safar@gmail.com>
2998 A fix for bug #324917
2999 * cs-parser.jay: Add missing multidimensional non-expression type
3002 2008-09-22 Marek Safar <marek.safar@gmail.com>
3004 A fix for bug #428191
3005 * anonymous.cs: Create an outer generic fields also for non-storey
3008 2008-09-22 Marek Safar <marek.safar@gmail.com>
3010 A fix for bug #378294
3011 * class.cs: Make fixed size buffers gmcs feature only.
3013 2008-09-22 Marek Safar <marek.safar@gmail.com>
3015 A fix for bug #355622, #324993
3016 * assign.cs, const.cs, class.cs: Create new EmitContext for each
3019 2008-09-19 Marek Safar <marek.safar@gmail.com>
3021 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
3024 2008-09-19 Marek Safar <marek.safar@gmail.com>
3026 A fix for bug #416110
3027 * generic.cs: Struct constraint results in default ctor and
3028 ValueType base type constraint to be set.
3030 2008-09-19 Marek Safar <marek.safar@gmail.com>
3032 A fix for bug #423791
3033 * generic.cs: Fixed params output type type-inference.
3035 2008-09-19 Marek Safar <marek.safar@gmail.com>
3037 * cs-parser.jay, expression.cs: Fixed few expression crashes.
3039 2008-09-19 Marek Safar <marek.safar@gmail.com>
3041 * cs-tokenizer.cs: Don't break on extra partial modifier.
3043 2008-09-19 Marek Safar <marek.safar@gmail.com>
3045 A fix for bug #427592
3046 * generic.cs: Use common parameter resolve method.
3048 2008-09-18 Marek Safar <marek.safar@gmail.com>
3050 A fix for bug #414758
3051 * expression.cs, ecore.cs: Fixed crash when accessing non-static
3054 2008-09-18 Marek Safar <marek.safar@gmail.com>
3056 * driver.cs, namespace.cs: Read types and namespaces after all
3057 requested assemblies are loaded, fixes issues with System.Core
3058 auto-reference, and #419888.
3060 2008-09-18 Marek Safar <marek.safar@gmail.com>
3062 A fix for bug #417705
3063 * cs-parser.jay: Fixed as/is operator expression split.
3065 2008-09-18 Marek Safar <marek.safar@gmail.com>
3067 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
3068 Fixed expression tree representation of empty new expression and
3069 new initializer expression.
3071 2008-09-18 Miguel de Icaza <miguel@novell.com>
3073 * eval.cs: Remove warning, keep reference to driver around.
3075 * Hide fields that do not need to be public.
3077 2008-09-17 Marek Safar <marek.safar@gmail.com>
3079 A fix for bug #426385
3080 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
3081 conversion for array elements.
3083 2008-09-17 Marek Safar <marek.safar@gmail.com>
3085 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
3086 void parsing conflicts.
3088 2008-09-15 Marek Safar <marek.safar@gmail.com>
3090 A fix for bug #425601
3091 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
3092 System.Core only when there is no custom ExtensionAttribute
3095 2008-09-15 Miguel de Icaza <miguel@novell.com>
3097 * namespace.cs: Do not report CS0246 (name
3099 2008-09-12 Marek Safar <marek.safar@gmail.com>
3101 A fix for bug #425669
3102 * generic.cs: Don't cache generic static anonymous method
3105 2008-09-12 Marek Safar <marek.safar@gmail.com>
3107 * generic.cs, class.cs, delegate.cs: Check recursive inherited
3108 conflicting constraints.
3110 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
3112 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
3115 2008-09-12 Marek Safar <marek.safar@gmail.com>
3117 * literal.cs, convert.cs, expression.cs, statement.cs: More null
3118 to null pointer conversion fixes.
3120 2008-09-11 Marek Safar <marek.safar@gmail.com>
3122 * cs-parser.jay, expression.cs: An implicitly typed local variable
3123 declarator cannot use an array initializer.
3125 2008-09-11 Marek Safar <marek.safar@gmail.com>
3127 * cs-parser.jay: Reduced number of printed tokens, add sorting.
3129 2008-09-11 Marek Safar <marek.safar@gmail.com>
3131 * generic.cs (InflatedConstraints): Don't crash when constraints
3134 * cs-parser.jay: const_declarator is a block.
3136 * constant.cs: Check for not allowed NaN conversions.
3138 2008-09-10 Miguel de Icaza <miguel@novell.com>
3140 * driver.cs: Drop --shell argument, the compiler is no longer a
3143 * eval.cs: Move most of the code that deals with evaluation into
3144 this file and document the public API from repl.cs
3146 * repl.cs: Remove from here.
3148 2008-09-10 Marek Safar <marek.safar@gmail.com>
3150 A fix for bug #424684
3151 * generic.cs: Generic class constraints must come first.
3153 2008-09-09 Miguel de Icaza <miguel@novell.com>
3155 * cs-parser.jay: Improve error reporting for syntax errors in
3156 statements and expressions, we now report the expected tokens
3157 instead of reporting the useless "; expected".
3159 Drop the strings from the token declaration, it turns out that
3160 they did not do what I thought they did. Instead they were adding
3161 two sets of tokens to the tables.
3163 2008-09-09 Marek Safar <marek.safar@gmail.com>
3165 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
3166 delegate.cs: Share special type check.
3168 2008-09-09 Marek Safar <marek.safar@gmail.com>
3170 A fix for bug #423981
3171 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
3173 2008-09-09 Marek Safar <marek.safar@gmail.com>
3175 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
3178 2008-09-09 Marek Safar <marek.safar@gmail.com>
3180 A fix for bugs: #324750, #335946
3181 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
3182 lookup rule to determine ?-based tokens.
3184 2008-09-08 Miguel de Icaza <miguel@novell.com>
3186 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
3187 expressions (like event adding or removing) end up here, so we
3188 need to treat those as statements.
3190 Add LoadAssembly method.
3192 2008-09-04 Miguel de Icaza <miguel@novell.com>
3194 * repl.cs: Add Time method.
3196 2008-09-05 Marek Safar <marek.safar@gmail.com>
3198 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
3200 2008-09-05 Miguel de Icaza <miguel@novell.com>
3202 * repl.cs: Add workaround for old compilers.
3204 2008-09-04 Jb Evain <jbevain@novell.com>
3206 * repl.cs (PrettyPrint): pretty print everything that
3207 implements IDictionary, as well as IEnumerables. Also,
3208 add a quit helper property.
3210 2008-09-04 Marek Safar <marek.safar@gmail.com>
3212 * constant.cs: Better error reporting for decimal literals.
3214 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
3217 2008-09-04 Marek Safar <marek.safar@gmail.com>
3218 Miguel de Icaza <miguel@novell.com>
3220 A fix for bug #422951
3221 * assign.cs (Assign.DoResolve): Perform the type conversions
3222 checks before we attempt to initialize `New' initializers.
3224 2008-09-04 Marek Safar <marek.safar@gmail.com>
3226 A fix for bug #422853
3227 * delegate.cs (DelegateCreation): Add special handling for
3228 EmptyExpression.Null instance expression which is just another
3229 hack for undecided member instance exression.
3231 2008-09-04 Marek Safar <marek.safar@gmail.com>
3233 * expression.cs, ecore.cs: Emit full expression tree for reduced
3236 2008-09-04 Marek Safar <marek.safar@gmail.com>
3238 * expression.cs (This): Guard against multi-resolving.
3240 * ecore.cs, statement.cs (Throw): Simplified.
3242 * flowanalysis.cs: Also verify event fields.
3244 2008-09-04 Miguel de Icaza <miguel@novell.com>
3246 * assign.cs (Assign.DoResolve): Perform the type conversions
3247 checks before we attempt to initialize `New' initializers.
3249 * repl.cs (PrettyPrint): Add Hashtable prettyprint
3251 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
3254 * repl.cs: Update help.
3256 2008-09-03 Miguel de Icaza <miguel@novell.com>
3258 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
3259 handling of the default config handling, including the special
3260 treatment of System.Core assembly.
3262 Fixes the REPL processing for LINQ.
3264 2008-09-03 Marek Safar <marek.safar@gmail.com>
3266 A fix for bug #422507
3267 * expression.cs (UnboxCast): Add missing child expression mutator.
3269 2008-09-03 Marek Safar <marek.safar@gmail.com>
3271 * driver.cs: Don't self reference System.Core assembly.
3273 2008-09-03 Marek Safar <marek.safar@gmail.com>
3275 A fix for bug #422507
3276 * expression.cs (StringConcat): Add missing type mutator.
3278 2008-09-03 Marek Safar <marek.safar@gmail.com>
3280 * generic.cs (TypeInferenceContext): Follow equality rule for
3281 constructed type lower bound type inference.
3283 2008-09-02 Miguel de Icaza <miguel@novell.com>
3285 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
3286 <dblank@cs.brynmawr.edu> which updates the cursor position on
3289 2008-09-02 Marek Safar <marek.safar@gmail.com>
3291 A fix for bug #367145
3292 * driver.cs: Fixed import of extension methods when using -noconfig
3295 2008-09-02 Marek Safar <marek.safar@gmail.com>
3297 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
3298 version from non-generic implementation instead.
3300 2008-09-01 Marek Safar <marek.safar@gmail.com>
3302 A fix for bug #418908
3303 * class.cs: Use AddScopeStatement for field initializers.
3305 2008-09-01 Marek Safar <marek.safar@gmail.com>
3307 A fix for bug #415385
3308 * ecore.cs, convert.cs: Do method group conversion for equal group types.
3310 2008-09-01 Marek Safar <marek.safar@gmail.com>
3312 A fix for bug #421736
3313 * iterators.cs: Don't crash on unreachable iterators.
3315 2008-09-01 Marek Safar <marek.safar@gmail.com>
3317 A fix for bug #421628
3318 * parameter.cs, attribute.cs: Clone also parameter attributes.
3320 2008-08-30 Miguel de Icaza <miguel@novell.com>
3322 * namespace.cs (LookupType): In EvalMode, try to replace
3323 the TypeBuilder from our cache with a Type as Reflection.Emit does
3324 not like to mix code from older assemblies emitted and new
3327 This sounds like a serious Mono bug that prevents multiple
3328 assemblies to be generated and consumed at the same time.
3330 * cs-parser.jay (push_current_class): Do not make interactive
3331 classes internal or private, make them public as we currently
3332 generate each new class in a new assembly.
3334 2008-08-29 Miguel de Icaza <miguel@novell.com>
3336 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
3337 remove types that are entered into the global namespace during
3338 parsing so that we can remove them on failure.
3340 * cs-parser.jay: Parsing: we now keep track of types that are
3341 entered into global variables and queue those in case the parsing
3344 This happens in a few situations: during partial-input, we invoke
3345 the parser repeatedly for example with the string "class X", this
3346 would cause X to be registed, and we need to remove this
3347 registration so that another parse attempt later with say "class X {"
3348 would actually work.
3350 Additionally, if there is an error in the resolution phase, for
3351 example: "class X : NonExistant {}" th
3353 * cs-parser.jay: Be more precise with the errors being raised,
3354 instead of flagging all exceptions during parsing to be attributed
3355 to the parsing process, distinguish those from errors happening in
3356 the actions and hint that using -v would produce the actual
3359 * repl.cs: Do not load all compiler references on each reset,
3360 doing the partial reset takes care of this.
3362 2008-08-28 Miguel de Icaza <miguel@novell.com>
3364 * repl.cs: Add support for loading all the files from
3365 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
3368 Introduce a micro-parser that is able to deambiguate on its input
3369 whether we are dealing with a compilation unit (namespace, class,
3370 interface, struct, delegate) declaration or a statement. This
3371 allows both declarations and statements to be entered.
3373 Set history size by default to 300 lines.
3375 Instead of distinguishing based on the parser.InteractiveResult,
3376 have only two cases: statements were parsed, or a compilation unit
3377 was. Always pull the Using statement additions from the
3378 compilation unit parse.
3380 * cs-tokenizer.cs: Rename tokens to better describe their intent
3381 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
3383 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
3384 EvalMode is used to trigger the lookup of global variables while
3385 StatementMode is used turn variable declarations into static
3388 * getline.cs: Allow history size to be set.
3390 2008-08-29 Marek Safar <marek.safar@gmail.com>
3392 A fix for bug #360755
3393 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
3395 2008-08-29 Marek Safar <marek.safar@gmail.com>
3397 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
3399 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
3400 member name, it is too confusing
3402 * decl.cs, class.cs: Don't report unused fields with attached attribute.
3404 * rootcontext.cs: Finally default to warning level 4.
3406 2008-08-28 Marek Safar <marek.safar@gmail.com>
3408 * class.cs (CheckBase): Ignore overloaded operators.
3410 2008-08-28 Marek Safar <marek.safar@gmail.com>
3412 A fix for bug #420830
3413 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
3415 2008-08-28 Marek Safar <marek.safar@gmail.com>
3417 A fix for bug #420832
3418 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
3420 2008-08-28 Marek Safar <marek.safar@gmail.com>
3422 A fix for bug #420386
3423 * nullables.cs: Fixed logic of nullable user comparison operators involving
3426 2008-08-28 Marek Safar <marek.safar@gmail.com>
3428 * attribute (IsClsCompliant): Use FALSE value for pointer types.
3430 2008-08-27 Miguel de Icaza <miguel@novell.com>
3432 * repl.cs: Add support for aborting the running code with C-c.
3434 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
3436 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
3438 2008-08-27 Miguel de Icaza <miguel@novell.com>
3440 * cs-parser.jay (interactive_statement_list): A new set of rules
3441 for hosting statements that uses the "interactive_" prefix.
3443 * repl.cs: Add support for parsing `using' as a statement or as a
3444 directive. Deambiguating before passing this to the parser.
3446 We need to distinguish statement_expressions that occur at the
3447 toplevel vs those that occur embedded into expressions.
3449 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
3450 that fixes the cursor key handling, and a history bug.
3452 2008-08-26 Miguel de Icaza <miguel@novell.com>
3454 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
3455 limitations in Console, instead the 2.0 bootstrap libraries now
3456 include the Console bits.
3458 Also, remove the use of Nullables from getline.cs
3462 Interactive support for the C# compiler. Use gmcs --shell to
3463 enter a read-eval-print loop shell.
3465 Docs: http://www.mono-project.com/CsharpRepl
3467 * sources: include repl.cs here and getline.cs for gmcs.exe,
3468 everything else is getline.cs impaired.
3470 * Makefile: when bootstrapping pass a special flag
3471 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
3472 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
3473 This distinguishes those two cases.
3475 * repl.cs: Support for a read-eval-print loop. Will be soon
3476 refactored into eval support and then REPL on top of it.
3478 * ecore.cs: If a simplename lookup fails, before erroring out,
3479 if we are in EvalMode to resolve the name to a declaration in the
3482 This means that variable declarations that happened in previous
3483 classes (as repl puts every statement in a separate class) are
3484 made visible in this way.
3486 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
3487 triggered an error due to the end of file being reached. This is
3488 used to do multi-line input, and notify the caller that the user
3489 needs to provide more text before a successful parse.
3491 Add new grammar rules after the INTERACTIVE_PARSER token is seen
3492 to drive the evaluation with a custom wrapper.
3494 * driver.cs: Add support for --shell, and refactor some code to be
3497 * namespace.cs: Add support for serializing the contents of the
3498 namespaces and reloading them.
3500 * getline.cs: A managed implementation of ReadLine under
3501 X11/Apache2 license terms. Easy to embed in other applications as
3504 * namespace.cs: Add some functions to save and restore the
3507 * rootcontext.cs: New public field.
3509 * cs-tokenizer.cs: Add support for one of the possible characters
3510 we introduce into the token stream.
3512 This patch does not affect the regular tokenization process, the
3513 only performance hit would happen if there is an invalid character
3514 on the input string.
3516 * support.cs: Move isatty helper routine here.
3518 * codegen.cs: Small cleanup, and add a mechanism to initialize the
3519 code generator for in-memory assemblies.
3521 2008-08-26 Marek Safar <marek.safar@gmail.com>
3523 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
3524 parameter cannot be always used as a type.
3526 2008-08-21 Marek Safar <marek.safar@gmail.com>
3528 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
3530 2008-08-21 Marek Safar <marek.safar@gmail.com>
3532 * convert.cs: Implement explicit array to IList<T> conversion.
3534 2008-08-20 Marek Safar <marek.safar@gmail.com>
3536 A fix for bug #362740
3537 * cs-tokenizer.cs: Handle UTF-16 surrogates.
3539 2008-08-20 Marek Safar <marek.safar@gmail.com>
3541 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
3542 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
3543 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
3544 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
3545 handling to use just one type of infrastructure and deal with generics
3548 2008-07-23 Martin Baulig <martin@ximian.com>
3550 *** Merged this from trunk revision 108527 ***
3553 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
3554 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
3557 2008-08-15 Marek Safar <marek.safar@gmail.com>
3559 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
3562 2008-08-15 Marek Safar <marek.safar@gmail.com>
3564 * delegate.cs: Fixed compiler crash when creating delegate using partial
3567 * typemanager.cs: MulticastDelegate is not a delegate.
3569 2008-08-14 Marek Safar <marek.safar@gmail.com>
3571 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
3574 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
3576 * cs-parser.jay (type): Allow 'var' in mcs too.
3577 (local_variable_type): Likewise.
3579 2008-08-14 Marek Safar <marek.safar@gmail.com>
3581 * driver.cs: Removed broken -noconfig variants.
3583 2008-08-14 Marek Safar <marek.safar@gmail.com>
3585 A fix for bug #417078
3586 * expression.cs: Emit correctly left side pointer operators.
3588 2008-08-13 Marek Safar <marek.safar@gmail.com>
3590 * generic.cs, lambda.cs: Inflate method generic arguments only.
3592 2008-08-12 Marek Safar <marek.safar@gmail.com>
3594 * class.cs: Fixed struct layout check regression.
3596 2008-08-12 Marek Safar <marek.safar@gmail.com>
3598 * cs-parser.jay, enum.cs: Simplified enum parsing.
3600 * decl.cs: Check all type parameters conflicts.
3602 * expression.cs, statement.cs, attribute.cs: More expression checks.
3604 2008-08-11 Marek Safar <marek.safar@gmail.com>
3606 * generic.cs: Add type inference types restriction.
3608 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
3609 anonymous.cs, expression.cs: Allocate less accessor parameters.
3611 2008-08-08 Marek Safar <marek.safar@gmail.com>
3613 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
3616 2008-08-08 Marek Safar <marek.safar@gmail.com>
3618 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
3620 2008-08-07 Marek Safar <marek.safar@gmail.com>
3622 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
3623 Also fixes #362146 and #381592.
3625 2008-08-07 Marek Safar <marek.safar@gmail.com>
3627 * ecore.cs: Reduced constant cannot be used as an attribute value.
3629 * cs-parser.jay: Base expression has to be a type.
3631 * expression.cs (Conditional): Uses ReducedExpression.
3633 2008-08-06 Marek Safar <marek.safar@gmail.com>
3635 A fix for bug #376826
3636 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
3637 address of hoisted local variable or parameter cannot be taken.
3639 2008-08-05 Marek Safar <marek.safar@gmail.com>
3641 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
3642 anonymous method inside checked/unchecked expression.
3644 2008-08-05 Marek Safar <marek.safar@gmail.com>
3646 * typemanager.cs (IsEqual): Guard against null.
3648 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
3649 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
3650 routine. Fixed few misleading conversion errors.
3652 2008-08-04 Marek Safar <marek.safar@gmail.com>
3654 * class.cs: Consider generics when checking cycles in struct layout.
3656 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
3658 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
3660 2008-08-04 Marek Safar <marek.safar@gmail.com>
3662 A fix for bug #414165
3663 * anonymous.cs: Use same anonymous implementation method for all anonymous
3666 2008-08-04 Marek Safar <marek.safar@gmail.com>
3668 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
3671 2008-08-04 Marek Safar <marek.safar@gmail.com>
3673 * cs-parser.jay: Typeof argument has to be a type expression.
3675 * namespace.cs: Check alias and namespace definitions collisions.
3677 * class.cs, pending.cs: Moved explicit interface accessor implementation
3680 * delegate.cs, expression.cs: Verify special name invocations.
3682 2008-08-01 Marek Safar <marek.safar@gmail.com>
3684 * cs-parser.jay: Don't choke on empty generic type arguments.
3686 * cs-tokenizer.cs: Handle escaped preprocessor directives.
3688 * expression.cs, ecore.cs: Minor expressions bugs.
3690 2008-08-01 Marek Safar <marek.safar@gmail.com>
3692 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
3693 and added more error handling.
3695 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
3697 * modifiers.cs, enum.cs: Fixed.
3699 2008-07-31 Jb Evain <jbevain@novell.com>
3701 * driver.cs: remove -pkg ability of smcs.
3703 2008-07-30 Marek Safar <marek.safar@gmail.com>
3705 * statement.cs (Switch): Correctly set empty default target for single
3708 2008-07-30 Marek Safar <marek.safar@gmail.com>
3710 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
3711 string switch statement implementation to use string dictionary which
3712 significantly (2-8x) improves performance of generated code.
3714 2008-07-29 Marek Safar <marek.safar@gmail.com>
3716 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
3717 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
3719 2008-07-29 Marek Safar <marek.safar@gmail.com>
3721 A fix for bug #412595
3722 * typemanager.cs, convert.cs, expression.cs: Some types are never
3723 convertible to each other.
3725 2008-07-29 Marek Safar <marek.safar@gmail.com>
3727 * nullable.cs (CreateNullConstant): An error messages update.
3729 2008-07-29 Marek Safar <marek.safar@gmail.com>
3731 A fix for bug #412595
3732 * cfold.cs: Don't cast undefined bool constant.
3734 2008-07-29 Martin Baulig <martin@ximian.com>
3737 (SymbolWriter.Reset): New public static method.
3740 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
3742 2008-07-28 Marek Safar <marek.safar@gmail.com>
3744 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
3746 * expression.cs (ElementAccess): Exact size allocation.
3748 2008-07-26 Marek Safar <marek.safar@gmail.com>
3750 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
3752 2008-07-25 Marek Safar <marek.safar@gmail.com>
3754 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
3756 * class.cs: Removed $PRIVATE$ field hack which caused problems during
3759 2008-07-25 Marek Safar <marek.safar@gmail.com>
3761 A fix for bug #412217
3762 * assign.cs: Mutate also assignment type.
3764 2008-07-25 Marek Safar <marek.safar@gmail.com>
3766 A fix for bug #323644
3767 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
3770 2008-07-25 Marek Safar <marek.safar@gmail.com>
3772 A fix for bug #412134
3773 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
3774 non-enumerable operands when overloading equality or bitwise operators.
3776 2008-07-25 Marek Safar <marek.safar@gmail.com>
3778 * anonymous.cs: Cache closed generic anonymous method delegates.
3780 2008-07-24 Marek Safar <marek.safar@gmail.com>
3782 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
3783 anonymous.cs, statement.cs: Always emit anonymous method as static method
3784 when is instance free. Use nesting for nested anynomous methods blocks.
3786 2008-07-23 Marek Safar <marek.safar@gmail.com>
3788 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
3791 2008-07-23 Marek Safar <marek.safar@gmail.com>
3793 * expression.cs: Removed MakeSimpleCall.
3795 2008-07-23 Marek Safar <marek.safar@gmail.com>
3797 A fix for bug #323012
3798 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
3799 Base method implementing interface has to be public.
3801 2008-07-23 Marek Safar <marek.safar@gmail.com>
3803 * cs-parser.jay: Don't break on missing argument.
3805 2008-07-22 Marek Safar <marek.safar@gmail.com>
3807 A fix for bug #320993
3808 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
3809 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
3811 2008-07-22 Marek Safar <marek.safar@gmail.com>
3813 A fix for bug #320748
3814 * convert.cs: Implicit user operators cannot convert to interfaces
3816 2008-07-22 Marek Safar <marek.safar@gmail.com>
3818 A fix for bug #312686
3819 * driver.cs: Ignore empty assembly references.
3821 2008-07-22 Marek Safar <marek.safar@gmail.com>
3823 A fix for bug #387040
3824 * ecore.cs: Skip constrains check for an explicit implementation.
3826 2008-07-21 Marek Safar <marek.safar@gmail.com>
3828 A fix for bug #409045
3829 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
3830 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
3831 identifiers are file specific unless passed as input arguments.
3833 2008-07-21 Marek Safar <marek.safar@gmail.com>
3835 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
3836 to emit UnmanagedMarshal data under 2.0 profile.
3838 2008-07-21 Marek Safar <marek.safar@gmail.com>
3840 A fix for bug #410369
3841 * parameter.cs: Clone correctly ParamsParameter.
3843 2008-07-21 Marek Safar <marek.safar@gmail.com>
3845 * expression.cs (Argument): Always report type for type based expressions
3848 2008-07-18 Marek Safar <marek.safar@gmail.com>
3850 A fix for bug #410666
3851 * anonymous.cs: Correctly initialize generic storey reference.
3853 2008-07-18 Marek Safar <marek.safar@gmail.com>
3855 * convert.cs: Don't box same type arguments.
3857 2008-07-18 Marek Safar <marek.safar@gmail.com>
3859 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
3860 Finished missing generic type mutators.
3862 2008-07-18 Marek Safar <marek.safar@gmail.com>
3864 * iterators.cs, statement.cs: Finished statements CloneTo.
3866 2008-07-18 Marek Safar <marek.safar@gmail.com>
3868 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
3870 * expression.cs: Emit optimized default value expressions in expression tree
3873 2008-07-18 Marek Safar <marek.safar@gmail.com>
3875 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
3877 2008-07-17 Marek Safar <marek.safar@gmail.com>
3879 A fix for bug #367536
3880 * cs-parser.jay: Check static constructor of generic types for an access
3883 2008-07-17 Marek Safar <marek.safar@gmail.com>
3885 A fix for bug #353800
3886 * lambda.cs: Emit ret for contextual statements.
3888 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
3889 up emitting redundant ret for all anonymous methods with return.
3891 2008-07-17 Marek Safar <marek.safar@gmail.com>
3893 A fix for bug #365188
3894 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
3895 create anonymous method storey in unreachable block.
3897 2008-07-17 Marek Safar <marek.safar@gmail.com>
3899 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
3900 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
3901 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
3902 statement.cs: Fixed relevant defects found by Gendarme.
3904 2008-07-17 Marek Safar <marek.safar@gmail.com>
3906 A fix for bug #325291
3907 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
3908 statement.cs: Replaced IAnonymousHost with top level block flag.
3910 2008-07-17 Marek Safar <marek.safar@gmail.com>
3912 * cs-parser.jay: Clean up unused open_parens.
3914 2008-07-17 Marek Safar <marek.safar@gmail.com>
3916 * ecore.cs: Custom error message for a range variable assignment.
3918 2008-07-16 Marek Safar <marek.safar@gmail.com>
3920 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
3923 2008-07-16 Marek Safar <marek.safar@gmail.com>
3925 * literal.cs: Null literal is of object type.
3927 2008-07-16 Marek Safar <marek.safar@gmail.com>
3929 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
3930 expression of nullable equality comparison.
3932 2008-07-15 Marek Safar <marek.safar@gmail.com>
3934 * expression.cs(PointerArithmetic): Removed redundant assignment.
3936 2008-07-15 Marek Safar <marek.safar@gmail.com>
3938 * decl.cs (GetSignatureForError): Report full namespace name for containers.
3940 2008-07-14 Marek Safar <marek.safar@gmail.com>
3942 A fix for bug #408361
3943 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
3944 they are replaced by GetMethod.
3946 2008-07-14 Marek Safar <marek.safar@gmail.com>
3948 A fix for bug #408721 by jeremie.laval@gmail.com
3949 * expression.cs (Indirection): Implemented CloneTo.
3951 2008-07-14 Marek Safar <marek.safar@gmail.com>
3953 * statement.cs (AssignableSlots): Temporary disabled variable initialization
3956 2008-07-14 Marek Safar <marek.safar@gmail.com>
3958 * report.cs (EnableReporting): Don't reinitialize 0-based values.
3960 2008-07-11 Marek Safar <marek.safar@gmail.com>
3962 * linq.cs: Reset tranparent parameter counter in probing mode.
3964 2008-07-11 Marek Safar <marek.safar@gmail.com>
3966 * anonymous.cs: Mutate anonymous method type.
3968 2008-07-11 Marek Safar <marek.safar@gmail.com>
3970 * ecore.cs, anonymous.cs: Mutate field expressions.
3972 2008-07-10 Marek Safar <marek.safar@gmail.com>
3974 A fix for bug #369670
3975 * linq.cs, statement.cs: Use explicit block for query expressions variables.
3977 2008-07-10 Marek Safar <marek.safar@gmail.com>
3979 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
3981 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
3984 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
3985 only one '>', and finds a '>>', abort the generic lookahead.
3987 2008-07-10 Marek Safar <marek.safar@gmail.com>
3989 A fix for bug #319902
3990 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
3992 2008-07-10 Marek Safar <marek.safar@gmail.com>
3994 A fix for bug #406371
3995 * statement.cs: Moved EmitSymbolInfo to Block.
3997 2008-07-09 Marek Safar <marek.safar@gmail.com>
3999 * ecore.cs: Report better error for extension method overload failures.
4001 2008-07-09 Marek Safar <marek.safar@gmail.com>
4003 * expression.cs (Is): No need to box reference values.
4005 2008-07-09 Marek Safar <marek.safar@gmail.com>
4007 * class.cs: Use event resolve context when initializing CreateEmitContext.
4009 2008-07-09 Marek Safar <marek.safar@gmail.com>
4011 A fix for bug #394436
4012 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
4013 method used inside expression trees. Added more LINQ to expression tree
4016 2008-07-08 Marek Safar <marek.safar@gmail.com>
4018 A fix for bug #378189, #370577
4019 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
4022 2008-07-08 Marek Safar <marek.safar@gmail.com>
4024 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
4027 2008-07-08 Marek Safar <marek.safar@gmail.com>
4029 A fix for bug #406702
4030 * anonymous.cs: Always park anonymous method in the nearest parent storey.
4032 2008-07-07 Marek Safar <marek.safar@gmail.com>
4034 A fix for bug #406648
4035 * cs-parser.jay: Report nullable use in mcs for some cases.
4037 2008-07-07 Marek Safar <marek.safar@gmail.com>
4039 * ecore.cs: Improved argument mismatch error messages.
4041 2008-07-07 Marek Safar <marek.safar@gmail.com>
4043 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
4045 2008-07-07 Marek Safar <marek.safar@gmail.com>
4047 * expression.cs (TypeOf): Mutate type argument.
4049 2008-07-04 Marek Safar <marek.safar@gmail.com>
4051 * class.cs: Report missing partial modifier for correct type.
4053 2008-07-04 Marek Safar <marek.safar@gmail.com>
4055 * ecore.cs, expression.cs (VariableReference): Variable property is
4058 2008-07-04 Marek Safar <marek.safar@gmail.com>
4060 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
4062 2008-07-04 Marek Safar <marek.safar@gmail.com>
4064 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
4067 2008-07-04 Marek Safar <marek.safar@gmail.com>
4069 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
4070 anonymous method storey to an instance method when only "this" is hoisted.
4072 2008-07-03 Marek Safar <marek.safar@gmail.com>
4074 A fix for bug #321615
4075 * expression.cs: Pointer comparisons use unsigned operator.
4077 2008-07-03 Marek Safar <marek.safar@gmail.com>
4079 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
4081 2008-07-02 Marek Safar <marek.safar@gmail.com>
4083 A fix for bug #404905
4084 * class.cs: Always initialize local unsafe variables.
4086 2008-06-30 Marek Safar <marek.safar@gmail.com>
4088 A fix for bug #396987
4089 * expression.cs (NewInitialize): Clear local temporary variable for next run
4091 2008-06-27 Marek Safar <marek.safar@gmail.com>
4093 A fix for bug #401020
4094 * ecore.cs: Both types and modifiers have to match for ref and out arguments
4096 2008-06-27 Marek Safar <marek.safar@gmail.com>
4098 A fix for bug #398319
4099 * cs-parser.jay: Implemented undocumented base access expression inside
4102 2008-06-26 Marek Safar <marek.safar@gmail.com>
4104 A fix for bug #404227
4105 * cs-parser.jay: Parse namespace declaration using qualified identifier.
4107 2008-06-26 Marek Safar <marek.safar@gmail.com>
4109 A fix for bug #404227
4110 * convert.cs: Fixed explicit array to interface cast.
4112 2008-06-26 Marek Safar <marek.safar@gmail.com>
4114 A fix for bug #403894
4115 * delegate.cs: Mutate DelegateInvocation type.
4117 2008-06-26 Marek Safar <marek.safar@gmail.com>
4119 A fix for bug #379348
4120 * delegate.cs: Box a load of generic parameters.
4122 2008-06-26 Marek Safar <marek.safar@gmail.com>
4124 * expression.cs: Add an array creation arguments mutate.
4126 2008-06-26 Marek Safar <marek.safar@gmail.com>
4128 A fix for bug #386068
4129 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
4132 2008-06-25 Marek Safar <marek.safar@gmail.com>
4134 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
4137 2008-06-25 Marek Safar <marek.safar@gmail.com>
4139 A fix for bug #403518
4140 * delegate.cs: Type correctly anonymous method new invocation.
4142 2008-06-24 Marek Safar <marek.safar@gmail.com>
4144 A fix for bug #394826
4145 * anonymous.cs: Fully qualify members when resolving anonymous type internal
4148 2008-06-24 Marek Safar <marek.safar@gmail.com>
4150 A fix for bug #394826
4151 * anonymous.cs, iterators.cs: Construct generic storey only when is really
4154 2008-06-24 Marek Safar <marek.safar@gmail.com>
4156 * class.cs: Clone indexer parameters for localized capturing.
4158 2008-06-24 Marek Safar <marek.safar@gmail.com>
4160 A fix for bug #402379
4161 * expression.cs: Don't crash when an object initializer resolve fails.
4163 2008-06-24 Marek Safar <marek.safar@gmail.com>
4165 A fix for bug #402888
4166 * expression.cs: Mutate conditional expression.
4168 2008-06-24 Marek Safar <marek.safar@gmail.com>
4170 A fix for bug #401012
4171 * class.cs: Keep StructLayout in shared container.
4173 2008-06-24 Marek Safar <marek.safar@gmail.com>
4175 A fix for bug #400438
4176 * decl.cs, class.cs: Only properties can be automatically implemented.
4178 2008-06-24 Marek Safar <marek.safar@gmail.com>
4180 * statement.cs (ChangeToIterator): Copy also labels.
4182 2008-06-23 Marek Safar <marek.safar@gmail.com>
4184 * ecore.cs: Pass type argument details to parent extension method.
4186 2008-06-23 Marek Safar <marek.safar@gmail.com>
4188 A fix for bug #375966
4189 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
4191 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
4193 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
4195 2008-06-22 Marek Safar <marek.safar@gmail.com>
4197 A fix for bug #394347
4198 * anonymous.cs: Cache compatible delegates as compatibility check produces
4199 a new method every time.
4201 2008-06-20 Marek Safar <marek.safar@gmail.com>
4203 * anonymous.cs: Propagate storey reference for single references.
4205 2008-06-20 Marek Safar <marek.safar@gmail.com>
4207 A fix for bug #387615
4208 * assign.cs, expression.cs: Correctly clone compound assignment.
4210 2008-06-19 Marek Safar <marek.safar@gmail.com>
4212 A fix for bug #359611, #359604
4213 * anonymous.cs: Mutate all types of hoisted parameters.
4215 2008-06-19 Marek Safar <marek.safar@gmail.com>
4217 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
4218 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
4219 expression.cs, codegen.cs, statement.cs
4221 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
4222 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
4224 ** Anonymous methods, lambda expressions rewrite **
4226 Anonymous expressions are now resolved when an explicit block is resolved
4227 and they don't require any registration procedure anymore. Further,
4228 anonymous methods are defined when explicit block is emitted which allows
4229 better control of whole process and opens possibilities for more
4230 optimizations as well as alternative to reverse whole process.
4232 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
4233 process consistent and to correctly emit hoisted generic methods when they
4234 have at least 1 hoisted variable.
4236 2008-06-17 Martin Baulig <martin@ximian.com>
4238 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
4240 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
4241 virtual property; check it in Emit().
4242 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
4244 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
4246 (Indexer.Define): Likewise.
4248 2008-06-17 Marek Safar <marek.safar@gmail.com>
4250 * convert.cs: Don't use IsInterface on type arguments.
4252 * delegate.cs: DelegateInvocation uses MethodInfo.
4254 * parameter.cs: Removed IsTypeParameter.
4256 * generic-mcs.cs: More missing stuff.
4258 2008-06-16 Martin Baulig <martin@ximian.com>
4261 (Modifiers.DEBUGGER_HIDDEN): New public const.
4264 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
4267 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
4268 (AbstractPropertyEventMethod): Likewise.
4269 (Constructor.Emit): Likewise.
4270 (SourceMethod.SetCompilerGenerated): Removed.
4272 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
4276 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
4277 if we're an `IteratorHost'.
4278 (AnonymousMethodMethod..ctor): Don't set
4279 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
4282 2008-06-16 Marek Safar <marek.safar@gmail.com>
4284 * statement.cs: Clean-up foreach statements.
4286 2008-06-12 Marek Safar <marek.safar@gmail.com>
4288 * class.cs: Stop using public method which should not exist
4289 (MethodBuilder.SetGenericMethodSignature).
4291 2008-06-11 Martin Baulig <martin@ximian.com>
4294 (Location.LookupFile): Add `CompilationUnit' argument; when given
4295 a relative file name, make it relative to the directory the .cs
4296 file is located in instead of using the current directory.
4298 2008-06-11 Martin Baulig <martin@ximian.com>
4301 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
4302 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
4303 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
4304 (SourceMethod.SetCompilerGenerated): Likewise.
4306 2008-06-11 Marek Safar <marek.safar@gmail.com>
4308 * codegen.cs, driver: Only write symbol file when it's asked for.
4310 2008-06-11 Marek Safar <marek.safar@gmail.com>
4312 * codegen.cs: Don't use assembly writer error handling for symbol writer.
4314 2008-06-10 Martin Baulig <martin@ximian.com>
4316 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
4318 2008-06-09 Marek Safar <marek.safar@gmail.com>
4320 A fix for bug #316290
4321 * expression.cs: Include decimal operators in predefined table.
4323 * parameters.cs: More readonlyness.
4325 2008-06-09 Marek Safar <marek.safar@gmail.com>
4327 A fix for bug #397213
4328 * cs-parser.jay: One more missing current_local_parameters reset.
4330 2008-06-09 Marek Safar <marek.safar@gmail.com>
4332 A fix for bug #396633
4333 * class.cs: Host backing field in partial container.
4335 2008-06-09 Marek Safar <marek.safar@gmail.com>
4337 A fix for bug #397068
4338 * expression.cs: Check both operand types when predefined operator is used.
4340 2008-06-05 Martin Baulig <martin@ximian.com>
4342 Merged the `debugger-kahalo' branch.
4345 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
4346 we're an iterator method.
4347 (SourceMethod): Reflect latest symbol writer changes;
4348 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
4349 now `start_row' and `end_row'.
4350 (Constructor.Emit): Fix the logic whether to emit symbol information.
4352 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
4356 (CompilationUnit): New public class; derives from `SourceFile'.
4357 (SourceFileEntry.DefineSymbolInfo): New public method.
4358 (SourceFileEntry.SetChecksum): New public method.
4359 (Location): Encode hidden line numbers by using `column == 255';
4360 the .ctor now accepts `column == -1' to mark a hidden line number.
4361 (Location.Hidden): New public property.
4362 (Location.CheckPoint): Add `CompilationUnit'.
4363 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
4364 (Location.Push): Add `CompilationUnit compile_unit' argument.
4365 (Location.CompilationUnit): New public property.
4368 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
4370 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
4372 * driver.cs: `SourceFile' -> `CompilationUnit'.
4374 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
4376 * namespace.cs: `SourceFile' -> `CompilationUnit'.
4378 * cs-tokenizer.cs: Add support for `#pragma checksum' and
4382 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
4383 new symbol writer API to also pass the file.
4385 2008-06-05 Marek Safar <marek.safar@gmail.com>
4387 * statement.cs: Emit catch variable assignment using variable expression.
4389 2008-06-05 Marek Safar <marek.safar@gmail.com>
4391 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
4392 with other variable types.
4394 2008-06-04 Marek Safar <marek.safar@gmail.com>
4396 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
4397 GetLength method emit, it breaks resolve rules.
4399 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
4400 Marek Safar <marek.safar@gmail.com>
4402 A fix for bug #395542
4403 * cs-parser.jay: The trailing comma is allowed in anonymous type member
4406 2008-06-02 Marek Safar <marek.safar@gmail.com>
4408 A fix for bug #395287
4409 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
4411 2008-05-31 Marek Safar <marek.safar@gmail.com>
4413 A fix for bug #395845
4414 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
4415 non-nullable parameter type.
4417 2008-05-31 Marek Safar <marek.safar@gmail.com>
4419 * class.cs: Handle contructor initializer as a statement in top-level block.
4421 2008-05-30 Marek Safar <marek.safar@gmail.com>
4423 * attribute.cs: Don't mix old and new corlib types when emitting corlib
4424 security attributes.
4426 2008-05-24 Marek Safar <marek.safar@gmail.com>
4428 * ecore.cs, expression.cs: Small IVariable refactoring.
4430 2008-05-22 Marek Safar <marek.safar@gmail.com>
4432 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
4434 2008-05-21 Marek Safar <marek.safar@gmail.com>
4436 * cs-parser.jay: Removed redundant catch type check.
4438 2008-05-21 Marek Safar <marek.safar@gmail.com>
4440 A fix for bug #390372
4441 * nullable.cs: Set correct return type.
4443 2008-05-21 Marek Safar <marek.safar@gmail.com>
4445 A fix for bug #391062
4446 * typemanager.cs: Fixed crash when comparing null types.
4448 2008-05-21 Marek Safar <marek.safar@gmail.com>
4450 A fix for bug #391871
4451 * cs-parser.jay: Better error handling for invalid catch type.
4453 2008-05-20 Marek Safar <marek.safar@gmail.com>
4455 A fix for bug #392155
4456 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
4458 2008-05-15 Marek Safar <marek.safar@gmail.com>
4460 A fix for bug #390666
4461 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
4464 2008-05-15 Marek Safar <marek.safar@gmail.com>
4466 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
4469 2008-05-13 Marek Safar <marek.safar@gmail.com>
4471 A fix for bug #389625
4472 * delegate.cs, generic.cs: Some progress on method group return type
4475 2008-05-13 Marek Safar <marek.safar@gmail.com>
4477 A fix for bug #378419
4478 * namespace.cs: Inspect also parent namespaces not only namespace entries.
4480 2008-05-12 Marek Safar <marek.safar@gmail.com>
4482 * class.cs (Constructor): Added IsCompilerGenerated.
4484 2008-05-12 Marek Safar <marek.safar@gmail.com>
4486 * expression.cs: Enum binary operators can accept non-enum operand only when
4487 is implicitly convertible to underlying type.
4489 2008-05-12 Marek Safar <marek.safar@gmail.com>
4491 A fix for bug #389272
4492 * support.cs: Workaround System.InvalidOperationException for enums.
4494 2008-05-12 Marek Safar <marek.safar@gmail.com>
4496 A fix for bug #389073
4497 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
4499 2008-05-10 Marek Safar <marek.safar@gmail.com>
4501 * driver.cs: Split Parse.
4503 * location.cs (LookupFile): Uses string.Empty.
4505 2008-05-07 Marek Safar <marek.safar@gmail.com>
4507 * expression.cs, parameter.cs: Small ParameterReference clean up.
4509 2008-05-07 Marek Safar <marek.safar@gmail.com>
4511 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
4512 hack. Fixes #387502.
4514 2008-05-06 Martin Baulig <martin@ximian.com>
4516 * class.cs (Constructor.Emit): Fix the logic whether to emit
4519 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
4522 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
4523 InvalidOperationException when the iterator is before the start or
4526 2008-05-06 Marek Safar <marek.safar@gmail.com>
4528 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
4529 when left is nullable type.
4531 2008-05-06 Marek Safar <marek.safar@gmail.com>
4533 A fix for bug #386628
4534 * expression.cs (LocalVariableReference): Continue in resolving when
4535 variable is not assigned.
4537 2008-05-05 Marek Safar <marek.safar@gmail.com>
4539 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
4540 nullable operations.
4542 2008-05-04 Marek Safar <marek.safar@gmail.com>
4544 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
4545 it saves many redundant temporary variables for nullable operations.
4547 2008-05-03 Marek Safar <marek.safar@gmail.com>
4549 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
4551 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
4554 * nullable.cs: Constant coalescing operator optimizations.
4556 2008-05-03 Marek Safar <marek.safar@gmail.com>
4558 * constant.cs: Use unsigned conversion for values which are unsigned only.
4560 2008-05-03 Marek Safar <marek.safar@gmail.com>
4562 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
4563 coalescing operator as it should be.
4565 2008-05-02 Marek Safar <marek.safar@gmail.com>
4567 A fix for bug #371016
4568 * expression.cs: All predefined delegate operators require implicit method
4571 2008-05-02 Marek Safar <marek.safar@gmail.com>
4573 * constant.cs: Emit long constant as uint when fits the range.
4575 * convert.cs, expression.cs: Fixed few unsafe conversions.
4577 2008-05-02 Marek Safar <marek.safar@gmail.com>
4579 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
4581 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
4584 * convert.cs (ImplicitNumericConversion): Don't modify the type of
4586 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
4588 2008-05-01 Marek Safar <marek.safar@gmail.com>
4590 * constant.cs, literal.cs: IsLiteral property for error reporting.
4592 * ecore.cs, expression.cs: Implemented Property expression.
4594 2008-05-01 Marek Safar <marek.safar@gmail.com>
4596 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
4598 * nullable.cs: Implemented nullable coalescing null operator.
4600 * ecore.cs, expression.cs: Expression trees work.
4602 2008-05-01 Marek Safar <marek.safar@gmail.com>
4604 * ecore.cs: CreateExpressionTree is finally abstract.
4606 * expression.cs, linq.cs: Updated.
4608 2008-05-01 Marek Safar <marek.safar@gmail.com>
4610 * expression.cs, ecore.cs: Block base access expression inside expression
4613 2008-05-01 Marek Safar <marek.safar@gmail.com>
4615 A fix for bug #385058
4616 * expression.cs: User-defined operator implementations always take
4617 precedence over predefined operator implementations.
4619 2008-04-30 Marek Safar <marek.safar@gmail.com>
4621 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
4622 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
4623 expression tree conversions.
4625 2008-04-30 Marek Safar <marek.safar@gmail.com>
4627 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
4628 operators method details to Operator class.
4630 2008-04-30 Marek Safar <marek.safar@gmail.com>
4632 * anonymous.cs: Pass unsafe flags to anonymous container.
4634 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
4635 inside expression tree.
4637 2008-04-29 Martin Baulig <martin@ximian.com>
4639 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
4640 (Tokenizer.PopPosition): Also restore the `line'.
4642 2008-04-29 Marek Safar <marek.safar@gmail.com>
4644 * delegate.cs: Implemented Invoke expression.
4646 2008-04-29 Marek Safar <marek.safar@gmail.com>
4648 * expression.cs: Fixed equality reference comparison regression.
4650 2008-04-29 Marek Safar <marek.safar@gmail.com>
4652 * ecore.cs: Clean up EmptyCast hack.
4654 * expression.cs, nullable.cs: Implemented enum binary and unary operations
4655 using correct conversion rules. Also fixes #383993.
4657 2008-04-28 Martin Baulig <martin@ximian.com>
4659 * class.cs (Constructor.Emit): Don't emit debugging information
4660 for generated default .ctor's.
4662 2008-04-28 Marek Safar <marek.safar@gmail.com>
4664 * convert.cs: Empty-cast ushort to int conversion.
4666 2008-04-28 Marek Safar <marek.safar@gmail.com>
4668 A fix for bug #384191
4669 * ecore.cs, expression.cs: Fixed expression cloning.
4671 2008-04-28 Marek Safar <marek.safar@gmail.com>
4673 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
4675 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
4677 Fix #381559, test-638.cs, test-639.cs
4678 * assign.cs (CompoundAssign.Helper): New wrapper.
4679 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
4681 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
4682 Pass unconverted expressions to the params array creation expression.
4683 (FieldExpr.EmitAssign): Don't special-case StringConcat.
4684 (PropertyExpr.EmitAssign): Likewise.
4685 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
4686 element if it is of kind CompoundAssign.Helper.
4687 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
4688 first before anything else.
4689 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
4690 (ArrayAccess.LoadArrayAndArguments): Simplify.
4692 2008-04-27 Marek Safar <marek.safar@gmail.com>
4694 * expression.cs: Fixed cloning of typeof(void).
4696 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
4698 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
4699 (Assign.Emit): Likewise. Move it to ...
4700 (CompoundAssign.DoResolve): ... here and ...
4701 (CompoundAssign.Emit): ... here.
4702 (EventAddOrRemove): New helper to handle += and -= on events, and
4703 avoid the use of BinaryDelegates.
4704 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
4705 (EventExpr.EmitAddOrRemove): Improve.
4706 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
4708 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
4709 create VarExprs for 'foo.bar.var'.
4710 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
4711 is a highly inappropriate name for its functionality.
4713 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4715 Simplify handling of multiple assignments
4716 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
4718 (SimpleAssign): New. Class to be used for normal assignments.
4719 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
4720 * expression.cs, parameter.cs, statement.cs: Likewise.
4722 2008-04-25 Marek Safar <marek.safar@gmail.com>
4724 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
4725 for incompatible underlying types, more to come, uff.
4727 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4730 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
4731 Handle 'leave_copy'.
4733 2008-04-25 Marek Safar <marek.safar@gmail.com>
4735 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
4737 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
4739 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
4740 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
4741 * statement.cs (While, Do, For): Allow test to have side effects.
4742 (For.DoEmit): Always emit InitStatement.
4745 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
4746 Always create SideEffectConstant.
4747 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
4748 of type EnumConstant.
4750 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4751 Handle 'right' being SideEffectConstant of type 'bool'.
4753 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4754 Use left.EmitBranchable instead of open coding it, so as to
4755 improve optimization opportunities.
4757 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
4759 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
4761 (Expression.EmitSideEffect): Document.
4763 2008-04-23 Marek Safar <marek.safar@gmail.com>
4765 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
4767 2008-04-23 Marek Safar <marek.safar@gmail.com>
4769 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
4771 2008-04-23 Marek Safar <marek.safar@gmail.com>
4773 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
4774 conversion to expression tree.
4776 2008-04-23 Marek Safar <marek.safar@gmail.com>
4778 * ecore.cs: Removed unused expression.
4780 2008-04-22 Marek Safar <marek.safar@gmail.com>
4782 * expression.cs: Implemented NegateChecked and New expressions.
4784 2008-04-22 Marek Safar <marek.safar@gmail.com>
4786 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
4788 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
4791 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
4792 needing final 'ret' instruction.
4794 2008-04-22 Marek Safar <marek.safar@gmail.com>
4796 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
4798 2008-04-21 Marek Safar <marek.safar@gmail.com>
4800 * expression.cs: Emit ldnull and not null expression as an instance argument
4801 of static method expression calls.
4803 2008-04-21 Marek Safar <marek.safar@gmail.com>
4805 A fix for bug #378200
4806 * expression.cs: Fixed crash when creating parameterless expression tree
4809 2008-04-21 Marek Safar <marek.safar@gmail.com>
4811 A fix for bug #375297
4812 * anonymous.cs: Fixed crash when inferring from null argument anonymous
4815 2008-04-21 Marek Safar <marek.safar@gmail.com>
4817 A fix for bug #377596
4818 * decl.cs, class.cs: Emit delegate type argument attributes.
4820 2008-04-21 Marek Safar <marek.safar@gmail.com>
4822 A fix for bug #365314
4823 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
4825 2008-04-21 Marek Safar <marek.safar@gmail.com>
4827 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
4830 2008-04-21 Marek Safar <marek.safar@gmail.com>
4832 * generic.cs (TypeParameter): Removed redundant location.
4834 2008-04-19 Marek Safar <marek.safar@gmail.com>
4836 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
4837 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
4838 FullNamedExpression in all declaration type expression, statements will come
4841 2008-04-18 Marek Safar <marek.safar@gmail.com>
4843 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
4844 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
4846 2008-04-18 Marek Safar <marek.safar@gmail.com>
4848 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
4851 2008-04-17 Marek Safar <marek.safar@gmail.com>
4853 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
4856 2008-04-17 Marek Safar <marek.safar@gmail.com>
4858 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
4862 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
4864 Hook up 'EmitSideEffect'
4865 * constant.cs (Constant.EmitSideEffect): New.
4866 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
4867 (SideEffectConstant.EmitSideEffect): New.
4868 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
4869 unconditional branch in EmitBranchable.
4870 (FieldExpr.EmitBranchable): New.
4871 * expression.cs (Unary.EmitSideEffect): New.
4872 (Binary.EmitSideEffect): New.
4873 (VariableReference.EmitSideEffect): New. Do nothing.
4875 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
4877 Introduce 'EmitSideEffect'
4878 * ecore.cs (Expression.EmitSideEffect): New.
4879 (TypeCast): Rename from EmptyCast.
4881 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
4882 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
4883 * convert.cs, nullable.cs: Update to changes.
4885 2008-04-16 Marek Safar <marek.safar@gmail.com>
4887 * class.cs, cs-parser.jay: Early check for base types expression.
4889 2008-04-16 Marek Safar <marek.safar@gmail.com>
4891 * decl.cs (MemberName): Declare PrettyName as obsolete.
4893 2008-04-16 Marek Safar <marek.safar@gmail.com>
4895 * namespace.cs: Use MemberName comparison.
4897 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
4900 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
4902 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
4903 (MemberName.FullyQualifiedName): New. Provides the functionality
4904 that users assume FullName would have.
4905 * ecore.cs, namespace.cs: Update to changes.
4907 * statement.cs (Using.assign): Make into ExpressionStatement.
4908 (Using.EmitPreTryBody): Simplify.
4910 2008-04-16 Marek Safar <marek.safar@gmail.com>
4912 * report.cs: ColorFormat is protected.
4914 * rootcontext.cs: Unused fields clean-up.
4916 * namespace.cs: Made UsingEntry name private.
4918 2008-04-16 Marek Safar <marek.safar@gmail.com>
4920 * cs-tokenizer.cs, location.cs: Removed unused field.
4922 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
4923 Raja R Harinath <harinath@hurrynot.org>
4926 * constant.cs (SideEffectConstant.value): Rename from 'left'.
4927 (SideEffectConstant.side_effect): Rename from 'right'.
4928 (SideEffectConstant..ctor): Normalize 'side_effect'.
4929 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
4930 value of this constant.
4931 * cfold.cs: Update to changes.
4933 2008-04-15 Marek Safar <marek.safar@gmail.com>
4935 * cs-paser.jay: Removed unused variable.
4937 * driver.cs: Made Compile instance method.
4939 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
4941 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
4943 2008-04-15 Marek Safar <marek.safar@gmail.com>
4945 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
4947 2008-04-13 Jb Evain <jbevain@novell.com>
4949 * namespace.cs: update the System.Core fullname for 2.1
4950 * driver.cs: update the list of required assemblies for 2.1.
4951 Merged from the Moonlight 2 branch.
4953 2008-04-11 Marek Safar <marek.safar@gmail.com>
4955 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
4956 types and user defined operators. User operators arguments has to be checked
4957 for null value before invocation, which also means no operator is called
4958 when any argument is not convertible to unwrapped nullable type.
4960 2008-04-09 Marek Safar <marek.safar@gmail.com>
4962 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
4963 of Unary expressions to follow operator overloading rules precisely.
4964 Also fixes #321794, #323794
4966 2008-04-08 Marek Safar <marek.safar@gmail.com>
4968 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
4971 2008-04-08 Marek Safar <marek.safar@gmail.com>
4973 * expression.cs, ecore.cs: Implemented MemberInit expression.
4975 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
4977 Fix mono/tests/exception4.cs
4978 * statement.cs (ExceptionStatement, TryCatch): Revert to using
4979 ec.NeedReturnLabel () rather emitting a 'nop'.
4981 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
4983 (TryCatch.SomeCodeFollows): Likewise.
4984 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
4985 for 'break', 'continue' and 'return' statements inside a try.
4986 We're fairly sure that the generated IL stream will have more
4987 instructions textually following the try.
4988 (FlowBranchingTryCatch): Likewise.
4990 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
4991 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
4994 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
4995 wrapper -- forward everything to CollectionForeach.
4996 (CollectionForeach.NonDisposableWrapper): New.
4997 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
4998 instead of a pop + branch to end.
5000 2008-04-07 Marek Safar <marek.safar@gmail.com>
5002 A fix for bug #377485
5003 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
5004 Propagate location for extension method groups. Report conversion failure at
5007 2008-04-07 Marek Safar <marek.safar@gmail.com>
5009 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
5010 ListInit and Field expressions.
5012 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
5014 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
5015 Since $PC is always -1 inside the body of MoveNext, the fault
5017 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
5018 * statement.cs (ExceptionStatement.emit_finally): Likewise.
5019 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
5021 The denouement! Fix #324708
5022 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
5023 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
5024 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
5025 'finally' inside the finally clause.
5027 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
5028 inside an iterator. Don't emit the body of the 'finally' inside
5029 the finally clause yet.
5031 Use the ResumableStatement infrastructure for MoveNext ()
5032 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
5033 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
5034 'old_resume_points'. Move dispatcher upfront.
5035 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
5036 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
5037 in an enumerator. This encodes the main fix in this patch series
5038 -- we can only jump into the first instruction of a try from the
5039 outside, but we want to emit try/finally regions in iterators and
5040 resume in the middle of them.
5042 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
5044 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
5045 of NeedReturnLabel here.
5047 Introduce a common point for emitting try/finally to IL
5048 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
5049 features of the various subclasses, which are now driven by ...
5050 (ExceptionStatement.EmitPreTryBody): ... this and ...
5051 (ExceptionStatement.EmitTryBody): ... this and the original
5053 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
5054 Remove DoEmit and update to follow above protocol.
5056 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
5057 of the dispatcher are the same, skip emitting the 'switch'.
5058 * iterator.cs (Iterator.EmitDispose): Update to changes.
5060 Clean up handling of 'using' statement
5061 * statement.cs (UsingTemporary): New. Carved out of ...
5062 (Using): ... this. Simplify drastically. Handle exactly
5064 * cs-parser.jay (using_statement): Split. Create UsingTemporary
5065 or Using as appropriate. If there are multiple variable declared,
5066 create nested Using statements.
5067 (resource_acquisition): Kill.
5069 * statement.cs (ExceptionStatement.EmitForDispose): Use
5070 EmitFinallyBody, not EmitFinally.
5072 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
5073 * iterator.cs: Update to changes.
5075 Start using the ResumableStatement infrastructure
5076 * statement.cs (ResumeableStatement.PrepareForDispose): New.
5077 (ResumableStatement.EmitForDispose): New.
5078 (ExceptionStatement): Override them.
5079 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
5080 EmitForDispose to create the body of the Dispose method. Don't
5083 * iterator.cs (Iterator.AddResumePoint): Move here from ...
5084 * statement.cs (Toplevel.AddResumePoint): ... here.
5085 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
5086 * flowanalysis.cs (FlowBranchingIterator): New.
5087 * codegen.cs (EmitContext): Update to changes.
5089 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
5090 (Iterator.old_resume_points): Rename from 'resume_points'.
5091 (Iterator.MoveNextStatement): Remove unused class.
5093 New infrastructure for try/finally in iterators (still unused)
5094 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
5095 (FlowBranchingToplevel.AddResumePoint): Hook into
5096 ToplevelBlock.AddResumePoint.
5097 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
5098 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
5099 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
5100 resume points and assign program-counter values.
5101 (ExceptionBlock.AddResumePoint): Collect resume points for
5102 de-muxer at the top of try block.
5103 * iterators.cs (Yield.CheckContext): Simplify.
5104 (Yield.Resolve): Use FlowBranching.AddResumePoint.
5106 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
5108 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
5109 argument to an ExitStatement.
5110 (FlowBranchingException): Refactor saved origins code.
5111 * statement.cs (ExitStatement): Update to cahges.
5112 * iterator.cs (YieldBreak): Likewise.
5114 * statement.cs (ResumableStatement): New. Common base class for
5115 YieldReturn and ExceptionStatement.
5116 (ExitStatement): New. Common base class for Return and YieldBreak.
5117 (Return): Update to changes.
5118 * iterator.cs (YieldBreak): Likewise.
5119 * lambda.cs (ContextualReturn): Likewise.
5122 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
5123 emit a meaningful error message.
5125 Fix #324765, #319508
5126 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
5127 (VariableInfo.SetAssigned): Set it.
5128 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
5129 determine if CS0219 or CS0168 is appropriate. Don't use
5130 flow-analysis information.
5131 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
5132 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
5133 (EmitContext.EndFlowBranching): ... this.
5135 2008-04-03 Marek Safar <marek.safar@gmail.com>
5137 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
5139 2008-04-03 Marek Safar <marek.safar@gmail.com>
5141 A fix for bug #376508
5142 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
5143 ImplicitConversionExists.
5145 2008-04-03 Marek Safar <marek.safar@gmail.com>
5147 * expression.cs (Binary): Added remaining binary operators to expression
5150 * nullable.cs: Optimize shift with null argument.
5152 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
5154 Fix minor IL regression
5155 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
5156 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
5157 * cs-parser.jay (try_statement): Update to changes.
5159 * statement.cs (TryFinally.need_exc_block): Delete.
5160 (TryFinally): Update to changes.
5162 Now all ExceptionStatements are unconditional
5163 * statement.cs (CollectionForeach.DisposableWrapper): New.
5164 Extract out the try/finally code into a new wrapper.
5165 (CollectionForeach.Resolve): Use it to simplify the code.
5167 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
5169 Start at simplifying ExceptionStatement semantics a bit
5170 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
5171 * cs-parser.jay (try_statement): Update to changes.
5172 (opt_catch_clauses): Remove.
5173 * flowanalysis.cs: Update to changes.
5174 (FlowBranching.BranchingType.TryCatch): New.
5175 (FlowBranchingTryCatch): New.
5177 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
5178 (FlowBranching.CreateBranching): Update to changes.
5179 (FlowBranchingBlock.AddSibling): Add sanity check.
5180 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
5183 * iterators.cs (Iterator.MarkFinally): Remove.
5184 * statement.cs (ExceptionStatement): Update to changes.
5186 Add support for skipping over finally blocks at runtime. First
5187 in a series to fix #324708
5188 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
5189 (Iterator.EmitMoveNext): Initialize it.
5190 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
5191 branch over the body of the 'finally' clause.
5193 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
5195 Avoid lopsided use of Foo/DoFoo names
5196 * statement.cs (ExpressionStatement.EmitFinallyBody):
5197 Rename from EmitFinally.
5198 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
5199 * iterator.cs: Update to changes.
5201 2008-04-02 Marek Safar <marek.safar@gmail.com>
5203 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
5204 based on UserOperatorCall. More binary nullable operators clean up.
5206 2008-04-02 Martin Baulig <martin@ximian.com>
5208 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
5210 2008-04-02 Marek Safar <marek.safar@gmail.com>
5212 * nullable.cs: Merge user and empty conversions when lifting expression
5215 * expression.cs (StringConcat): Implemented expression tree representation.
5217 2008-04-01 Marek Safar <marek.safar@gmail.com>
5219 * nullable.cs: When lifting null literal and a user operator exists, no call
5222 2008-04-01 Marek Safar <marek.safar@gmail.com>
5224 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
5227 2008-04-01 Marek Safar <marek.safar@gmail.com>
5229 * nullable.cs, expression.cs: Use namespace instead heavily nested
5230 monster abstract class.
5232 2008-04-01 Marek Safar <marek.safar@gmail.com>
5234 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
5235 lifting of null literal and user operators. Clean up of some temporary
5238 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
5240 Fix #368224, test-629.cs
5241 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
5242 if it crossed an unwind-protect boundary.
5243 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
5244 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
5245 inside an unwind-protected region.
5246 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
5247 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
5248 'leave' instead of a 'br' if unwind-protected.
5249 (Iterator.EmitYieldBreak): Likewise.
5251 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
5253 * driver.cs: Only define versioninfo resources if no win32 resource
5256 2008-03-28 Marek Safar <marek.safar@gmail.com>
5258 A fix for bug #372375
5259 * convert.cs: Fixed boxing of nullable types.
5261 2008-03-28 Marek Safar <marek.safar@gmail.com>
5263 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
5266 2008-03-28 Marek Safar <marek.safar@gmail.com>
5268 A fix for bug #374619
5269 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
5271 2008-03-27 Marek Safar <marek.safar@gmail.com>
5273 * lambda.cs: Check return type only for invocation.
5275 2008-03-27 Marek Safar <marek.safar@gmail.com>
5277 A fix for bug #374214
5278 * ecore.cs: Correctly report argument type mismatch.
5280 2008-03-27 Marek Safar <marek.safar@gmail.com>
5282 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
5283 and not rely on broken IsEnum.
5285 2008-03-27 Marek Safar <marek.safar@gmail.com>
5287 * nullable.cs: New file, extracted from generic.cs.
5289 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
5291 2008-03-27 Marek Safar <marek.safar@gmail.com>
5293 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
5294 predefined comparison operators and null literals.
5296 * report.cs: New warning ID.
5298 2008-03-25 Marek Safar <marek.safar@gmail.com>
5300 A fix for bug #370577
5301 * lambda.cs: Check return type too.
5303 2008-03-25 Marek Safar <marek.safar@gmail.com>
5305 A fix for bug #372846
5306 * class.cs: Automatic properties can be declared as unsafe.
5308 2008-03-20 Marek Safar <marek.safar@gmail.com>
5310 * location.cs: Use string based concatenation.
5312 * expression.cs: LiftedBinaryOperator is gmcs only.
5314 2008-03-20 Marek Safar <marek.safar@gmail.com>
5316 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
5317 conversions rules and expression trees.
5319 2008-03-19 Marek Safar <marek.safar@gmail.com>
5321 * delegate.cs: Use extension method source as delegate target.
5323 2008-03-19 Marek Safar <marek.safar@gmail.com>
5325 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
5326 binary operations to be purely based on binary operations and optimized
5327 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
5328 and other ET refactoring.
5330 * typemanager.cs: Fixed warning.
5332 2008-03-17 Marek Safar <marek.safar@gmail.com>
5334 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
5336 * symbolwriter.cs: Fixed.
5338 2008-03-17 Marek Safar <marek.safar@gmail.com>
5340 * anonymous.cs, driver.cs: Reset anonymous types counters.
5342 2008-03-17 Marek Safar <marek.safar@gmail.com>
5344 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
5346 * class.cs: Use fullname for all type member definitions.
5348 2008-02-19 Martin Baulig <martin@ximian.com>
5351 (IMethodData.EmitExtraSymbolInfo): New interface method.
5352 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
5353 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
5354 interface method here as an empty public virtual method.
5357 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
5358 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
5359 CodeGen.SymbolWriter.SetRealMethodName().
5361 2008-02-18 Martin Baulig <martin@ximian.com>
5364 (ScopeInfo.EmitType): Override this and emit debugging
5365 information for captured variables.
5366 (RootScopeInfo.EmitType): Override this and emit symbol
5367 information for a captured `this'.
5369 2008-02-15 Martin Baulig <martin@ximian.com>
5371 * iterators.cs: Emit debugging info.
5374 (EmitContext.Flags): Add `OmitDebuggingInfo'.
5375 (EmitContext.OmitDebuggingInfo): New public property.
5378 (While): Override Emit() and don't emit symbol info there; do it
5379 inside DoEmit() instead.
5380 (Block.Emit): Omit symbol information while emitting the scope
5381 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
5383 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
5384 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
5385 .ctor to make `IsIterator' work.
5387 2008-03-14 Martin Baulig <martin@ximian.com>
5389 * symbolwriter.cs: Added the new symbol writer function from the
5390 debugger's `terrania' branch; temporarily enclose them inside
5391 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
5394 2008-03-14 Martin Baulig <martin@ximian.com>
5397 (SymbolWriter): Make this a public static class.
5400 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
5401 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
5403 2008-03-14 Marek Safar <marek.safar@gmail.com>
5405 A fix for bug #370577
5406 * statement.cs, lambda.cs: Added extra limitations when dealing with void
5409 2008-03-14 Marek Safar <marek.safar@gmail.com>
5411 * typemanager.cs (CSharpName): Made 250 times faster.
5413 2008-03-13 Marek Safar <marek.safar@gmail.com>
5415 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
5417 2008-03-12 Marek Safar <marek.safar@gmail.com>
5419 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
5420 crash when predefined field does not exist.
5422 2008-03-12 Marek Safar <marek.safar@gmail.com>
5424 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
5426 2008-03-12 Marek Safar <marek.safar@gmail.com>
5428 * class.cs (FixedField): Don't crash when contructors are missing.
5430 2008-03-11 Marek Safar <marek.safar@gmail.com>
5432 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
5433 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
5434 check internal types accessibility for internal and external types.
5435 Replaced EnumToUnderlying by GetEnumUnderlyingType.
5437 2008-03-11 Marek Safar <marek.safar@gmail.com>
5439 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
5440 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
5441 attribute.cs, statement: Use corect instance of predefined types (work
5442 related to #364674).
5444 2008-03-07 Marek Safar <marek.safar@gmail.com>
5446 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
5448 2008-03-07 Marek Safar <marek.safar@gmail.com>
5450 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
5451 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
5452 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
5453 predefined types clean up, delayed predefined types members initialization
5454 (work related to #364674).
5456 2008-03-05 Marek Safar <marek.safar@gmail.com>
5458 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
5460 2008-03-05 Marek Safar <marek.safar@gmail.com>
5462 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
5463 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
5464 predefined types clean up (work related to #364674).
5466 2008-03-04 Marek Safar <marek.safar@gmail.com>
5468 * ecore.cs: Print an error message instead of throwing exception.
5470 2008-03-04 Marek Safar <marek.safar@gmail.com>
5472 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
5473 expression.cs, statement.cs: Unififed null literal representation.
5475 2008-03-03 Marek Safar <marek.safar@gmail.com>
5477 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
5478 expression.cs: Refactored binary operators resolve phase and improved speed.
5479 The nullable code is still missing and won't work correctly, more fixes
5482 It also fixes #323726, #324312, #324248, and many other unreported issues.
5484 2008-02-29 Zoltan Varga <vargaz@gmail.com>
5486 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
5489 2008-02-27 Marek Safar <marek.safar@gmail.com>
5491 * ecore.cs: Clean-up and split BetterConversion.
5493 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
5496 * enum.cs (EnumMember.Value): Only access 'value' if
5497 ResolveValue says it's ok.
5498 (EnumMember.DoResolveValue): Don't set prev_member.value.
5499 (Enum.GetDefinition): Reverse arguments of Equals --
5500 EnumMember.Value can return 'null'.
5502 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
5504 2008-02-22 Marek Safar <marek.safar@gmail.com>
5506 * generic.cs, expression.cs: More ongoing work on expression trees.
5508 2008-02-21 Marek Safar <marek.safar@gmail.com>
5510 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
5511 handle missing matches when mutiple operators exist.
5513 2008-02-20 Marek Safar <marek.safar@gmail.com>
5515 A fix for bug #363218
5516 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
5519 2008-02-20 Marek Safar <marek.safar@gmail.com>
5521 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
5522 update. This time to deal correctly with SideEffectConstant expression used
5523 as an argument for another constant folding.
5525 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
5527 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
5530 2008-02-19 Marek Safar <marek.safar@gmail.com>
5532 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
5534 2008-02-19 Marek Safar <marek.safar@gmail.com>
5536 A fix for bug #328136
5537 * expression.cs: Do not fold immediately LogicalAnd operators when the left
5538 side is a false constant, because we still need to evaluate the right-hand
5541 * statement.cs (If): Emit two types of boolean constants (simple constant,
5542 side-effect constant).
5544 2008-02-19 Marek Safar <marek.safar@gmail.com>
5546 * constant.cs (SideEffectConstant): Don't emit boolean constant.
5548 * expression.cs: Fold immediately LogicalAnd operators when both sides are
5551 2008-02-18 Marek Safar <marek.safar@gmail.com>
5553 A fix for bug #361457
5554 * ecore.cs (IsApplicable): Params methods have lower priority.
5556 * support.cs: Return correct parameter modifier for params types.
5558 2008-02-18 Marek Safar <marek.safar@gmail.com>
5560 * generic.cs (TypeParameter): Cache attribute target name.
5562 * support.cs: Removed unused variable.
5564 * typemanager.cs: Removed debugging leftover.
5566 * ecore.cs: Use local type instead of a property;
5568 * class.cs (VerifyMembers): Consider also parent to test whether type member
5571 * expression.cs (FullMethodDesc): Removed.
5573 * attribute.cs (IsValidArgumentType): Made static.
5575 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
5577 Cleanup to be more readable.
5578 * Makefile (GMCS_PROFILE): Remove.
5579 (COMPILER_NAME): New helper.
5581 2008-02-15 Miguel de Icaza <miguel@novell.com>
5583 * cs-tokenizer.cs: if a conditional expression happens inside a
5584 (...) this also means that we do not need to de-ambiguate between
5585 an parenthesized expression and a cast.
5589 * constant.cs (SideEffectConstant): a constant value that happens
5590 to have a side effect.
5592 Fixes the build regressions introduced by the fix for #359789
5594 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
5596 * expression.cs (Conditional.Emit): when emitting the ternary
5597 operator, use local variables to generate code verifiable code.
5599 The verifier cannot infer that the type on stack before the
5600 stloc.0 is executed is of type ParentB. This happens because the
5601 stack merge algorithm uses only parent types when deciding which
5602 is the common type. This is described in Part III 1.8.1.3 of ECMA
5605 This code compiled with mcs is not verifiable under MS. The MS
5606 verifier picks the first common interface of Foo and Bar, which is
5607 wrong, but doesn't use a full join type of the 2 interfaces.
5609 CSC uses a clever hack to compile such code in a verifiable
5610 way. It stores the intermediate values in a local variable with
5615 2008-02-14 Miguel de Icaza <miguel@novell.com>
5617 * expression.cs: Do not fold BitwiseAnd operators when the left
5618 side is a false constant, because we still need to evaluate the
5623 * support.cs: Instead of throwing an InternalErrorException when
5624 the position of the stream is outside the boundary of our buffer,
5625 reset the state of the reader, and restart the reading from the
5626 beginning of the file.
5628 2008-02-14 Marek Safar <marek.safar@gmail.com>
5630 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
5632 2008-02-14 Marek Safar <marek.safar@gmail.com>
5634 A fix for bug #361686
5635 * decl.cs: A protected types used inside a private class which parents
5636 derives from the protected class are accessible.
5638 2008-02-13 Marek Safar <marek.safar@gmail.com>
5640 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
5641 the parameterless constructor.
5643 2008-02-13 Marek Safar <marek.safar@gmail.com>
5645 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
5646 lookup methods to use standard member cache when doing member lookup.
5648 2008-02-12 Marek Safar <marek.safar@gmail.com>
5650 * driver.cs: Don't report full path for referenced module as assembly error.
5652 2008-02-12 Marek Safar <marek.safar@gmail.com>
5654 * Makefile: Fixed `qh' target to work on all machines.
5656 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
5657 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
5658 and HasElementType with TypeManager implementation.
5660 2008-02-08 Marek Safar <marek.safar@gmail.com>
5662 A fix for bugs #325134, #359749
5663 * expression.cs, ecore.cs: Try to resolve an extension method even if the
5664 first binds point to non-method member expression.
5666 2008-02-08 Marek Safar <marek.safar@gmail.com>
5668 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
5670 2008-02-08 Marek Safar <marek.safar@gmail.com>
5672 A fix for bugs #321394, #323028
5673 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
5674 Reworked naive IsAccessibleAs implementation to handle nested types.
5676 2008-02-05 Jb Evain <jbevain@novell.com>
5678 * class.cs: use generic type comparison for parameters
5681 2008-02-05 Marek Safar <marek.safar@gmail.com>
5683 A fix for bug #325372
5684 * class.cs: Use generic type comparison when testing method signatures.
5686 2008-02-05 Marek Safar <marek.safar@gmail.com>
5688 A fix for bug #357047
5689 * ecore.cs: Applied C# 3.0 changes to better conversion.
5691 2008-02-05 Marek Safar <marek.safar@gmail.com>
5693 A fix for bug #358374
5694 * cs-parser.jay: Correctly set modifiers for all constructor types.
5696 2008-02-04 Marek Safar <marek.safar@gmail.com>
5698 A fix for bug #355251
5699 * generic.cs: Added base class constraint based type inference.
5701 2008-02-01 Marek Safar <marek.safar@gmail.com>
5703 A fix for bug #357255
5704 * decl.cs: One more missing visibility check.
5706 2008-02-01 Marek Safar <marek.safar@gmail.com>
5708 * support.cs: Fixed broken return.
5710 2008-01-25 Marek Safar <marek.safar@gmail.com>
5712 * report.cs: Correctly reset warnings count after probing.
5714 2008-01-25 Martin Baulig <martin@ximian.com>
5717 (NamespaceEntry.SymbolFileID): Make this work again after
5718 MemberName.ToString() is gone.
5720 2008-01-25 Marek Safar <marek.safar@gmail.com>
5722 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
5725 2008-01-25 Marek Safar <marek.safar@gmail.com>
5727 * generic.cs: Use full implicit conversion for type inference fixing.
5729 2008-01-24 Marek Safar <marek.safar@gmail.com>
5731 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
5732 Fixed user operator conversions.
5734 2008-01-24 Marek Safar <marek.safar@gmail.com>
5736 * generic.cs: Do nullable type to null comparison optimization during
5739 2008-01-24 Marek Safar <marek.safar@gmail.com>
5741 A fix for bug #355163
5742 * generic.cs: Enabled l-value resolve on nullable expressions.
5744 2008-01-24 Marek Safar <marek.safar@gmail.com>
5746 A fix for bug #353986
5747 * class.cs: Ingore static ctors with parameters for any further checks.
5749 2008-01-24 Marek Safar <marek.safar@gmail.com>
5751 A fix for bug #354310
5752 * namespace.cs: Removed redundant check.
5754 2008-01-24 Marek Safar <marek.safar@gmail.com>
5756 A fix for bug #354928
5757 * expression.cs: ElementInitializers can be resolved only once.
5759 2008-01-24 Marek Safar <marek.safar@gmail.com>
5761 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
5762 Condition expressions.
5764 2008-01-23 Marek Safar <marek.safar@gmail.com>
5766 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
5768 2008-01-22 Marek Safar <marek.safar@gmail.com>
5770 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
5773 * generic.cs: Implemented coalesce expression.
5775 2008-01-22 Marek Safar <marek.safar@gmail.com>
5777 A fix for bug #355145
5778 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
5779 expression tree type inference.
5781 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
5784 * expression.cs (Binary.IsUnsignedType): Fix typo.
5786 2008-01-22 Marek Safar <marek.safar@gmail.com>
5788 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
5790 2008-01-22 Marek Safar <marek.safar@gmail.com>
5792 A fix for bug #355161
5793 * ecore.cs, expression.cs: Wider range of extension method supported
5796 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
5798 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
5799 AssemblyBuilder to operate in compiler context. Fixes mcs part of
5802 2008-01-22 Marek Safar <marek.safar@gmail.com>
5804 A fix for bug #355148
5805 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
5807 2008-01-22 Miguel de Icaza <miguel@novell.com>
5809 * expression.cs (CreateExpressionTree): Add support for or and
5810 logical or, and indent following the coding conventions.
5812 * typemanager.cs (LinqExpression): renamed from
5813 ExpressionTreeManager, for a shorter name.
5815 Use TypeManager.CoreLookupType to lookup types from our core
5816 assemblies and turn those into "Type" variables.
5818 Consumers that previously used "Namespace" and "Type" from this
5819 class should instead use the TypeExpression which is a type that
5820 is fully resolved (without involving the regular C# resolution
5823 This typically looks like this:
5825 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
5826 new MemberAccess (texpr, name, type_arguments, loc)
5828 This avoids the problem in: #355178
5830 2008-01-21 Marek Safar <marek.safar@gmail.com>
5832 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
5833 feature in parser only as we do in other cases.
5835 2008-01-21 Marek Safar <marek.safar@gmail.com>
5837 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
5838 typemanager.cs: A refactoring of params arguments to reuse existing
5839 expressions (params -> array initializer) to emit params argument instead
5840 of specialized handling.
5841 It was required by expression tree implementation and it has other benefits
5842 as well, we now apply same optimization for params arguments as we do for
5845 2008-01-18 Marek Safar <marek.safar@gmail.com>
5847 A fix for bug #353526
5848 * generic.cs: A type inference of params arguments may not required any
5849 temporary array creation.
5851 2008-01-18 Marek Safar <marek.safar@gmail.com>
5853 A fix for bug #353534
5854 * generic.cs, ecore.cs, expression.cs: A method group type inference is
5855 supported for delegates only.
5857 2008-01-18 Marek Safar <marek.safar@gmail.com>
5859 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
5860 type for more than 1 candidates.
5862 2008-01-18 Marek Safar <marek.safar@gmail.com>
5864 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
5867 2008-01-16 Marek Safar <marek.safar@gmail.com>
5869 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
5870 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
5871 operator) expressions.
5873 2008-01-16 Zoltan Varga <vargaz@gmail.com>
5875 * statement.cs: Avoid declaring an IL variable for this_variable since it is
5876 not accessed from the generated IL.
5878 2008-01-14 Marek Safar <marek.safar@gmail.com>
5880 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
5881 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
5882 statement.cs: The first expression tree implementation drop, mostly
5883 infrastructure work.
5885 2008-01-14 Marek Safar <marek.safar@gmail.com>
5887 * ecore.cs (IsNestedChild): Refactored.
5889 2008-01-11 Marek Safar <marek.safar@gmail.com>
5891 * lambda.cs: Don't use a cast on unknown expression statement.
5893 2008-01-10 Geoff Norton <gnorton@novell.com>
5895 * cs-tokenizer.cs: One more token to distinguish between method and lambda
5898 2008-01-09 Marek Safar <marek.safar@gmail.com>
5900 * doc.cs: Report better /doc crash details.
5902 2008-01-09 Marek Safar <marek.safar@gmail.com>
5904 A fix for bug #352536
5905 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
5907 2008-01-08 Marek Safar <marek.safar@gmail.com>
5909 A fix for bug #352287
5910 * ecore.cs, expression.cs: Do `this' access checking in all member access
5913 2008-01-08 Marek Safar <marek.safar@gmail.com>
5915 * rootcontext.cs, driver.cs: Switch to linq mode by default.
5917 * report.cs: Reset message stacks.
5919 2008-01-08 Marek Safar <marek.safar@gmail.com>
5921 * generic.cs (InferInPhases): Correctly calculate params position.
5923 2008-01-08 Marek Safar <marek.safar@gmail.com>
5925 * cs-tokenizer.cs: No need to parse full string when parsing lambda
5928 2008-01-07 Marek Safar <marek.safar@gmail.com>
5930 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
5932 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
5934 * driver.cs: Updated --help option.
5936 2008-01-07 Marek Safar <marek.safar@gmail.com>
5938 * generic.cs (InferParamsTypeArguments): Removed.
5939 (InferInPhases): Add params type inference.
5940 (LowerBoundInference): Fixed scoring mechanism.
5942 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
5944 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
5946 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
5947 byte array for unsigned "baked" assemblies.
5949 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
5951 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
5952 array for assemblies that are not strongnamed.
5954 2008-01-04 Marek Safar <marek.safar@gmail.com>
5956 A fix for bug #351481
5957 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
5958 declaring type for nested generic types.
5960 2008-01-04 Marek Safar <marek.safar@gmail.com>
5962 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
5963 instead of ToString.
5965 2008-01-03 Marek Safar <marek.safar@gmail.com>
5967 A fix for bug #351047
5968 * expression.cs (Binary.ResolveOperator): Allow equality operators between
5969 null and structs only when equality and inequality operators are defined
5970 either as an user-operators or predefined operators.
5972 2008-01-03 Marek Safar <marek.safar@gmail.com>
5974 A fix for bug #351047
5975 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
5977 2008-01-03 Marek Safar <marek.safar@gmail.com>
5979 A fix for bug #351257
5980 * cs-tokenizer.cs: Advance line number for '\r' correctly.
5982 2008-01-03 Marek Safar <marek.safar@gmail.com>
5984 A fix for bug #351157
5985 * class.cs (Using): Fixed yet another broken cloning.
5987 (Block): Put back more sensible default value for statements.
5989 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
5991 * codegen.cs: Allow AssemblyVersion with only major version component.
5994 2007-12-29 Marek Safar <marek.safar@gmail.com>
5996 A fix for bug #324654
5997 * class.cs: Use FullName property as member name.
5999 2007-12-28 Marek Safar <marek.safar@gmail.com>
6001 A fix for bug #342117
6002 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
6003 constructor constraint.
6005 2007-12-28 Marek Safar <marek.safar@gmail.com>
6007 A fix for bug #338273
6008 * class.cs (ProbertyBase): Access modifier checks are required for overrides
6011 2007-12-28 Marek Safar <marek.safar@gmail.com>
6013 A fix for bug #350839
6014 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
6016 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
6018 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
6021 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
6023 * statement.cs: Changed some Hashtables to use HybridDictionaries
6024 instead. It was observed that some HashTables only contained a few
6025 items in the vast majority of cases. Since HybridDictionary is
6026 more efficient on small sets (<10 elements), "known_variables"
6027 from class ExplicitBlock as well as "labels" and "constants " from
6028 class Block were changed to HybridDictionaries.
6030 Atsai results: (56216kb->54987kb)
6032 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
6035 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
6037 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
6040 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
6042 * expression.cs: foreach loop to for loop, saved on allocation of
6043 enumerator (59333kb->59141kb)
6045 * statement.cs. Changed foreach loops to for loops, saved on
6046 allocation of enumerator (59141kb->59006kb)
6048 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
6049 when constructed with no specified capacity. This was causing a
6050 few ArrayLists to allocate more memory than they would potentially
6051 need in the Block class and MemberCache class. Setting the
6052 ArrayLists to construct with a capacity of 1 saves some
6053 memory. (56216kb->55585kb)
6055 2007-12-27 Marek Safar <marek.safar@gmail.com>
6057 A fix for bug #347189 (2nd issue)
6058 * expression.cs (MemberAccess): Nested type can be found in base non-generic
6061 2007-12-27 Miguel de Icaza <miguel@novell.com>
6063 * report.cs: Do not use colors if stdout and stderr are not a
6066 2007-12-27 Marek Safar <marek.safar@gmail.com>
6068 A fix for bug #346998
6069 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
6072 2007-12-27 Marek Safar <marek.safar@gmail.com>
6074 A fix for bug #343465
6075 * class.cs: Explicit method name for nested types uses dots only.
6077 2007-12-27 Marek Safar <marek.safar@gmail.com>
6079 A fix for bug #343707
6080 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
6082 2007-12-27 Marek Safar <marek.safar@gmail.com>
6084 * ecore.cs: Report type inference errors only when arguments count matches
6087 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
6089 * expression.cs, report.cs: New warning.
6091 * typemanager.cs: Catch anonymous method type too.
6093 2007-12-23 Marek Safar <marek.safar@gmail.com>
6095 A fix for bug #346379
6096 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
6098 2007-12-23 Marek Safar <marek.safar@gmail.com>
6100 A fix for bug #347359
6101 * expression.cs (Invocation): Don't resolve already resolved expression.
6103 2007-12-23 Marek Safar <marek.safar@gmail.com>
6105 A fix for bug #347189
6106 * class.cs (FixedField): Use non-dependent code only in the define phase.
6108 2007-12-23 Marek Safar <marek.safar@gmail.com>
6110 A fix for bug #348076
6111 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
6113 2007-12-22 Marek Safar <marek.safar@gmail.com>
6115 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
6116 discovered extension methods.
6118 2007-12-22 Marek Safar <marek.safar@gmail.com>
6120 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
6123 2007-12-21 Miguel de Icaza <miguel@novell.com>
6125 * report.cs (ErrorMessage): Add support for using colors on
6126 terminals that support it.
6128 2007-12-21 Marek Safar <marek.safar@gmail.com>
6130 * ecore.cs: Use information about expanded params for error reporting.
6132 2007-12-21 Marek Safar <marek.safar@gmail.com>
6134 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
6135 and logic for params overloads.
6137 2007-12-15 Miguel de Icaza <miguel@novell.com>
6139 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
6140 as this is also created from the parser. Fixes #349034
6142 2007-12-12 Miguel de Icaza <miguel@novell.com>
6144 * statement.cs (Throw.CloneTo): it is valid to have empty
6145 expressions for throw.
6147 2007-12-03 Marek Safar <marek.safar@gmail.com>
6149 * cs-parser.jay: Set delegate constraint parsing region correctly.
6151 2007-12-03 Marek Safar <marek.safar@gmail.com>
6153 A fix for bug #345467
6154 * typemanager.cs (IsEqual): Compare generic parameters position only.
6156 2007-11-28 Marek Safar <marek.safar@gmail.com>
6158 * expression.cs (BaseAccess): Type arguments can be null.
6160 2007-11-27 Raja R Harinath <harinath@gmail.com>
6162 * statement.cs (Block.Resolve): Ensure flow-branching tree is
6163 consistent even when an error has occured.
6164 (Switch.Resolve): Likewise.
6166 2007-11-22 Marek Safar <marek.safar@gmail.com>
6168 A fix for bug #334505
6169 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
6172 2007-11-22 Marek Safar <marek.safar@gmail.com>
6174 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
6175 refactorings required to resolve extension methods correctly when mixing
6176 generics and non-generics members.
6178 2007-11-20 Marek Safar <marek.safar@gmail.com>
6180 A fix for bug #342584
6181 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
6184 2007-11-19 Marek Safar <marek.safar@gmail.com>
6186 A fix for bug #342512
6187 * delegate.cs: Use delegate argument expression when is available. Don't
6188 emit virtual call when class is sealed.
6190 2007-11-16 Marek Safar <marek.safar@gmail.com>
6192 A fix for bug #325423
6193 * assign.cs (FieldInitializer): Use resolved expression for emit.
6195 * class.cs: Print less confusing error message.
6197 2007-11-16 Marek Safar <marek.safar@gmail.com>
6199 * cs-tokenizer.cs: Removed GMCS ifdefs.
6201 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
6204 * cs-parser.jay: Disabled nullable check.
6206 * generic-mcs: Copied more generic stuff.
6208 2007-11-16 Marek Safar <marek.safar@gmail.com>
6210 * gcs-parser.jay: Merged to cs-parser.jay.
6212 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
6213 * *.csproj, *.sources: Updated to use only jay parser file.
6215 2007-11-16 Marek Safar <marek.safar@gmail.com>
6217 * gcs-parser.jay: Added nullable and default expression feature checks.
6219 2007-11-16 Marek Safar <marek.safar@gmail.com>
6221 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
6222 it fixes many TODOs and hidden bugs.
6224 * expression: Removed duplicate error check.
6226 2007-11-15 Marek Safar <marek.safar@gmail.com>
6228 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
6229 implicitly type local variable only when it is used in a declaration.
6231 2007-11-15 Marek Safar <marek.safar@gmail.com>
6233 * attribute.cs: Use CS0612 for empty strings.
6235 2007-11-14 Marek Safar <marek.safar@gmail.com>
6237 * lambda.cs, statement.cs: Contextual return may act as a statement.
6239 2007-11-14 Marek Safar <marek.safar@gmail.com>
6241 A fix for a regression cause by #324222
6242 * class.cs: Don't report unused even when it implements an interface.
6244 2007-11-13 Marek Safar <marek.safar@gmail.com>
6246 A fix for bug #341205
6247 * ecore.cs, expression.cs: Method group expression cannot do static
6248 method access with an instance reference check before overloading takes
6251 2007-11-13 Marek Safar <marek.safar@gmail.com>
6253 A fix for bug #325359
6254 * class.cs: Use predictable name for automatically generated property.
6256 2007-11-12 Marek Safar <marek.safar@gmail.com>
6258 A fix for bug #324996
6259 * expression.cs (Is): Handle case where D is nullable and T is not
6262 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
6264 2007-11-12 Marek Safar <marek.safar@gmail.com>
6266 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
6267 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
6268 Flush small error reporting changes.
6270 2007-11-09 Marek Safar <marek.safar@gmail.com>
6272 A fix for bug #324996
6273 * expression.cs: Rewrote Is expression implementation to work with
6274 generics, nullable types, anonymous method. A const result expression
6275 uses existing infrastructure instead of custom not fully-featured one.
6277 2007-11-08 Marek Safar <marek.safar@gmail.com>
6279 A fix for bug #340202
6280 * class.cs: Consider generics for volatile field.
6282 2007-11-08 Marek Safar <marek.safar@gmail.com>
6284 A fix for bug #335594
6285 * expression.cs: Use conversion rules when handling string addition.
6287 2007-11-07 Marek Safar <marek.safar@gmail.com>
6289 A fix for bug #336651
6290 * expression.cs: Fixed a crash when probing is on.
6292 2007-11-07 Marek Safar <marek.safar@gmail.com>
6294 A fix for bug #324242
6295 * covert.cs: Added a conversion from any nullable-type with an
6296 underlying enum-type to the type System.Enum.
6298 2007-11-07 Marek Safar <marek.safar@gmail.com>
6300 A fix for bug #324222
6301 * class.cs: Report all non-used event fields.
6303 2007-11-07 Marek Safar <marek.safar@gmail.com>
6305 A fix for bug #325161
6306 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
6307 qualifier for generic types.
6309 2007-11-07 Marek Safar <marek.safar@gmail.com>
6311 A fix for bug #322971
6312 * expression.cs, ecore.cs: Added intermediate result value check for
6315 2007-11-07 Marek Safar <marek.safar@gmail.com>
6317 A fix for bug #324754
6318 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
6319 when it was requested.
6321 2007-11-07 Marek Safar <marek.safar@gmail.com>
6323 A fix for bug #325101
6324 * expression.cs: Do type not value comparison for `is' expression.
6326 2007-11-07 Marek Safar <marek.safar@gmail.com>
6328 A fix for bug #320236
6329 * convert.cs: Don't apply user conversion on underlying target type.
6331 2007-11-06 Marek Safar <marek.safar@gmail.com>
6333 * expression.cs: Don't use unresolved expression for error reporting.
6335 2007-11-06 Marek Safar <marek.safar@gmail.com>
6337 A fix for bugs #337712, #324490
6338 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
6339 overloading resolution too.
6341 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
6342 the process consistent and more robust.
6344 * expression.cs, linq.cs, report.cs: Update.
6346 2007-11-02 Marek Safar <marek.safar@gmail.com>
6348 A fix for bug #332909
6349 * attribute.cs: Resolve attributes in correct context using error
6352 * rootcontext.cs: Define Obsolete attribute members as core members.
6354 2007-11-02 Marek Safar <marek.safar@gmail.com>
6356 * statement.cs: Removed unused methods.
6358 2007-10-31 Wade Berrier <wberrier@novell.com>
6360 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
6361 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
6364 2007-10-31 Marek Safar <marek.safar@gmail.com>
6366 A fix for bug #338102
6367 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
6368 methods registered as non-generics.
6370 2007-10-31 Marek Safar <marek.safar@gmail.com>
6372 A fix for bugs #337712, #324490
6373 * delegate.cs: Delegate covariance and contravariance is not allowed for
6376 2007-10-31 Marek Safar <marek.safar@gmail.com>
6378 A fix for bug #337719
6379 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
6382 2007-10-30 Marek Safar <marek.safar@gmail.com>
6384 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
6386 2007-10-29 Marek Safar <marek.safar@gmail.com>
6388 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
6391 2007-10-29 Raja R Harinath <rharinath@novell.com>
6393 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
6395 2007-10-29 Marek Safar <marek.safar@gmail.com>
6397 A fix for bug #334652
6398 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
6399 extension methods when we have not found the best candidate in normal
6402 2007-10-27 Marek Safar <marek.safar@gmail.com>
6404 * AssemblyInfo.cs: Keep up-to-date.
6406 2007-10-27 Marek Safar <marek.safar@gmail.com>
6408 * Makefile: Fixed generics compiler name.
6410 2007-10-27 Marek Safar <marek.safar@gmail.com>
6412 * lambda.test: removed, lambda parsing is done differently.
6414 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
6416 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
6418 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
6420 2007-10-27 Marek Safar <marek.safar@gmail.com>
6422 * Makefile, *.sources : All C# compilers are in mcs folder.
6424 * *.cs: Use existing 2_1 define for smcs.
6426 2007-10-26 Marek Safar <marek.safar@gmail.com>
6428 A fix for bug #335847
6429 * assign.cs, expression.cs: Couple of changes to avoid creating a
6430 temporary variable for each object initializer assignment statement. It
6431 simplifies struct initialization too, otherwise two temporary variables
6433 Implemented optimization of redundant default element initializers.
6435 2007-10-25 Marek Safar <marek.safar@gmail.com>
6437 A fix for bug #336766
6438 * expression.cs (Class.CheckBase): Use generic name when method is
6441 2007-10-25 Marek Safar <marek.safar@gmail.com>
6443 A fix for bug #334737
6444 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
6445 variable and not variable argument for prepared copies.
6447 2007-10-24 Marek Safar <marek.safar@gmail.com>
6449 A fix for bug #325110
6450 * class.cs, expression.cs, attribute.cs: Use open generic method when
6451 checking conditional attribute.
6453 2007-10-24 Marek Safar <marek.safar@gmail.com>
6455 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
6456 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
6457 FeatureIsNotAvailable.
6459 2007-10-24 Marek Safar <marek.safar@gmail.com>
6461 ** C# 3.0 Partial methods
6463 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
6464 methods support. Because of member cache issue with generics only
6465 non-generics partial methods are fully supported.
6467 2007-10-23 Marek Safar <marek.safar@gmail.com>
6469 * class.cs, decl.cs: Rewrote member overloads check to cope with
6470 generics and to use member cache for member checking. It also improves
6471 performance and fixes remaining overloads issues.
6473 2007-10-20 Marek Safar <marek.safar@gmail.com>
6475 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
6476 roottypes.cs, typemanager.cs:
6478 A member cache creation logic changed to add members immediately and
6479 not rely on fallback. The member cache is now only prefered way
6480 how to access and find type declaration members. It saves 5 MB of memory
6481 during MWF compilation and makes code ready for more optimizations and
6482 clean-ups, it's also a pre-requirement for partial methods.
6484 2007-10-18 Raja R Harinath <harinath@gmail.com>
6486 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
6487 handling for generic parameters.
6489 2007-10-15 Marek Safar <marek.safar@gmail.com>
6491 * class.cs (FixedField): Removed redundant volatile check.
6493 2007-10-15 Marek Safar <marek.safar@gmail.com>
6495 * class.cs, decl.cs: Fixed overload members verification to do only one
6496 check per possible collision.
6498 2007-10-13 Marek Safar <marek.safar@gmail.com>
6500 A fix for bug #325478
6501 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
6502 and create only one disposable flags container.
6504 2007-10-12 Marek Safar <marek.safar@gmail.com>
6506 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
6507 * statement.cs (Fixed): Fixed variables cloning.
6509 2007-10-12 Marek Safar <marek.safar@gmail.com>
6511 A fix for bug #333342
6512 * class.cs (EventField): Don't mark value type event as synchronized.
6514 2007-10-12 Marek Safar <marek.safar@gmail.com>
6516 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
6517 inference to identify best candidate method correctly.
6518 (ProperyExpr): A range variable is read only and cannot be modified.
6520 2007-10-11 Marek Safar <marek.safar@gmail.com>
6522 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
6523 logic to identify best candidate method correctly.
6525 2007-10-11 Marek Safar <marek.safar@gmail.com>
6527 * location.cs (Equals, GetHashCode): Removed.
6529 2007-10-11 Marek Safar <marek.safar@gmail.com>
6531 * report.cs: Implemented message recorder. It is used mainly for lambda
6532 expressions to capture otherwise swallowed error messages.
6534 * anonymous.cs, lambda.cs.cs: Do full parameters check.
6536 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
6538 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
6540 * expression.cs (MemberAccess): Always report lookup failure.
6542 * location.cs: Implemented Equals, GetHashCode.
6544 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
6546 2007-10-10 Jb Evain <jbevain@novell.com>
6548 * codegen.cs: re-enable assembly version check.
6550 2007-10-09 Marek Safar <marek.safar@gmail.com>
6552 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
6555 * namespace.cs (UsingAlias): Do correct version check.
6557 2007-10-08 Marek Safar <marek.safar@gmail.com>
6559 * expresison.cs, ecore.cs: Issue extension method error message when
6562 * rootcontext.cs: Added ISO_2 compiler mode option.
6564 2007-10-08 Marek Safar <marek.safar@gmail.com>
6566 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
6569 2007-10-08 Marek Safar <marek.safar@gmail.com>
6571 * attribute.cs (GetString, GetBoolean): Work with both literal and
6574 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
6575 Moved method overload specific methods to MethodGroupExpr.
6577 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
6578 it should be less memory consuming.
6580 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
6582 * codegen.cs: remove the assembly version check until the buildbot is
6585 2007-10-07 Jb Evain <jbevain@novell.com>
6587 * attribute.cs (Attribute.GetString): if the value
6588 expression is a StringConstant, return its string value.
6590 2007-10-07 Jb Evain <jbevain@novell.com>
6592 * typemanager.cs: add `assembly_version_attribute_type`.
6593 * codegen.cs: on attribute emission, check that the
6594 AssemblyVersionAttribute doesn't overflow.
6596 2007-10-05 Marek Safar <marek.safar@gmail.com>
6598 A fix for bug #324677
6599 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
6600 parent container of a scope container with currently resolved one.
6602 2007-10-05 Marek Safar <marek.safar@gmail.com>
6604 A fix for bug #325534
6605 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
6608 2007-10-05 Marek Safar <marek.safar@gmail.com>
6610 A fix for bug #327504
6611 * class.cs (Operator.Define): Refactored implicit and explicit user
6612 operator conversion rules.
6614 2007-10-05 Marek Safar <marek.safar@gmail.com>
6616 A fix for bug #327520
6617 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
6619 2007-10-04 Marek Safar <marek.safar@gmail.com>
6621 A fix for bug #328022
6622 * class.cs (MethodData.Define): Use correct method to check whether
6623 a method implementents an accessor.
6625 2007-10-04 Marek Safar <marek.safar@gmail.com>
6627 A fix for bug #330069
6628 * statement.cs (Fixed.Resolve): Read the first array element only when
6629 an array is instantiated.
6631 2007-10-04 Marek Safar <marek.safar@gmail.com>
6633 * expression.cs, assign.cs, generics.cs: Print correct operator when
6634 compound assignment is used.
6636 2007-10-04 Marek Safar <marek.safar@gmail.com>
6638 A fix for bug #325841
6639 * expression.cs (ArrayAccess): Use full argument cloning only for
6640 string compound concatenation.
6642 2007-10-03 Marek Safar <marek.safar@gmail.com>
6644 A fix for bug #328774
6645 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
6647 (PropertyExpr.EmitAssign): Fixed string concatenation compound
6650 2007-10-03 Raja R Harinath <rharinath@novell.com>
6653 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
6654 Event accessibility checks here. Remove some bogus code that
6655 accidently made GenericMethods work.
6656 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
6658 2007-09-25 Marek Safar <marek.safar@gmail.com>
6660 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
6662 * statement.cs (Block): Refactored AddVariable to allow error handling
6665 * generic.cs: New stub.
6667 2007-09-23 Marek Safar <marek.safar@gmail.com>
6669 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
6672 2007-09-17 Marek Safar <marek.safar@gmail.com>
6674 * class.cs: Use partial container to record whether any partial part
6675 contains static field initializer and therefore default contructor has
6678 2007-09-14 Marek Safar <marek.safar@gmail.com>
6680 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
6681 mono-list when only one of two partial parts has defined accessibility
6684 2007-09-14 Marek Safar <marek.safar@gmail.com>
6686 A fix for bug #82845
6688 * class.cs (TypeContainer): Set correct resolve context for all field
6691 2007-09-13 Marek Safar <marek.safar@gmail.com>
6693 * assign.cs: Fixed a crash when field is resolved twice with an error.
6695 * codegen.cs: Changed InFieldInitializer to be flag.
6697 * anonymous.cs, ecore.cs, expression.cs: Update after
6698 IsInFieldInitializer rename.
6700 * const.cs: Removed unused parameter.
6702 * class.cs: Changed the way how we resolve and emit field initializers.
6703 The field initilizers have to have access to contructor block to emit
6704 compiler generated code.
6706 2007-09-13 Marek Safar <marek.safar@gmail.com>
6708 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
6709 generics use TypeContainer instead.
6711 2007-09-12 Marek Safar <marek.safar@gmail.com>
6713 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
6715 * lambda.cs (ResolveParameters): Use more powerful
6716 InflateGenericArgument.
6718 * parameters.cs: Better exception message.
6720 2007-09-10 Marek Safar <marek.safar@gmail.com>
6722 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
6723 correct expression block type.
6725 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
6727 * expression.cs (Invocation): Extracted method group resolve to
6730 2007-09-07 Marek Safar <marek.safar@gmail.com>
6732 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
6733 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
6735 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
6736 generic extension methods.
6738 2007-09-06 Marek Safar <marek.safar@gmail.com>
6740 A fix for bug #82676 (Do I get it right now?)
6741 * convert.cs (Binary.ResolveOperator): An interface is converted to the
6742 object before a standard conversion is applied.
6744 2007-09-06 Marek Safar <marek.safar@gmail.com>
6746 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
6749 2007-09-05 Marek Safar <marek.safar@gmail.com>
6751 A fix for bug #82676
6752 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
6753 non-generic interface types.
6755 2007-09-05 Marek Safar <marek.safar@gmail.com>
6757 A fix for bug #82690
6758 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
6760 2007-09-05 Marek Safar <marek.safar@gmail.com>
6762 A fix for bug #82571
6763 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
6764 modifier for container based methods.
6766 2007-09-05 Marek Safar <marek.safar@gmail.com>
6768 A fix for bug #82676
6769 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
6770 any interface-type T means to any of interface type T.
6772 2007-09-04 Marek Safar <marek.safar@gmail.com>
6774 * namespace.cs: We have 2 versions of System.Core assembly.
6776 2007-09-04 Marek Safar <marek.safar@gmail.com>
6778 A fix for bug #82652
6779 * class.cs (Class.GetClassBases): Compare types and not expressions.
6781 2007-09-04 Marek Safar <marek.safar@gmail.com>
6783 A fix for bug #82620
6784 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
6785 actually never worked before.
6786 (IndexerAccess): Emit prepared arguments before they are modified.
6788 2007-09-04 Marek Safar <marek.safar@gmail.com>
6790 A fix for bug #82563
6791 * assign.cs: Revert wrong fix.
6793 * expression.cs (VariableReference.EmitAssign): Handle ref reference
6795 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
6796 Instead of ldelema/stdind we have to use temporary variables to handle
6797 cases like String.Concat (params string[]).
6799 2007-08-31 Marek Safar <marek.safar@gmail.com>
6801 * class.cs: EmitAttributes to Emit rename.
6803 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
6805 (MemberCore.HasClsCompliantAttribute): Don't depend on
6806 GetClsCompliantAttributeValue execution.
6808 2007-08-31 Marek Safar <marek.safar@gmail.com>
6810 * anonymous.cs: Use shorter type prefix.
6812 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
6815 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
6816 variables when probing is on.
6818 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
6819 unresolved variables.
6820 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
6821 handle transparent identifiers.
6823 2007-08-26 Marek Safar <marek.safar@gmail.com>
6825 * attribute.cs (IsClsCompliant): Add nullable types test.
6827 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
6829 * doc.cs : catch other types of exception than XmlException to
6830 report CS1570. Fixed bug #82565.
6832 2007-08-23 Marek Safar <marek.safar@gmail.com>
6834 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
6835 The number of delegate parameters has to match.
6836 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
6839 2007-08-21 Marek Safar <marek.safar@gmail.com>
6841 * anonymous.cs (AnonymousMethod): Generate private anonymous method
6842 to fix problem with private arguments.
6844 2007-08-20 Marek Safar <marek.safar@gmail.com>
6846 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
6848 * decl.cs (MemberName): Ignore generic type with no generic arguments.
6850 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
6851 empty. Add cloning suport.
6853 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
6855 2007-08-20 Marek Safar <marek.safar@gmail.com>
6857 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
6858 to create EmptyCast. It handles EmptyConstantCast specialization for
6861 2007-08-18 Marek Safar <marek.safar@gmail.com>
6863 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
6864 (EmitArrayArgument): One routine for array arguments.
6865 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
6867 2007-08-17 Marek Safar <marek.safar@gmail.com>
6869 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
6871 2007-08-17 Marek Safar <marek.safar@gmail.com>
6873 * anonymous.cs: MemberLookupFinal update.
6875 * class.cs (ConstructorInitializer): Is expression based.
6877 * delegate.cs: MethodGroupExpr update.
6879 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
6881 (Error_MemberLookupFailed): Customizable error override.
6882 (MethodGroupExpr): Keep queried type for later usage.
6883 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
6886 * expression.cs: Error_MemberLookupFailed refactoring.
6887 (New.DoResolve): Resolve as much as possible.
6888 (ElementInitializer.Error_MemberLookupFailed): Object initializer
6889 customization for invalid member types.
6891 * statement.cs: MethodGroupExpr update.
6893 2007-08-16 Marek Safar <marek.safar@gmail.com>
6895 * modifier.cs (Check): Check all modifiers and not only accessibility
6898 2007-08-16 Marek Safar <marek.safar@gmail.com>
6900 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
6901 type and not an expression.
6903 2007-08-16 Marek Safar <marek.safar@gmail.com>
6905 * statement.cs (Catch.Clone): Type and variable can be null.
6907 2007-08-16 Marek Safar <marek.safar@gmail.com>
6909 A fix for bug #81979
6910 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
6911 I am really not sure whether this is the best fix.
6913 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
6916 2007-08-14 Marek Safar <marek.safar@gmail.com>
6918 ** C# 3.0 Object and collection initializers (major re-write)
6920 * assign.cs (DoResolve): Initializers are not assign related.
6922 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
6923 used during collection or object initialization.
6925 * expression.cs (Error_InvalidArguments): Add initializers specific
6926 messages. More will come later because it requires some general
6928 (New.DoResolve): Better error handling for unsafe types.
6929 (EmptyExpressionStatement): New class.
6930 (ElementInitializer): An object initializer expression.
6931 (CollectionElementInitializer): A collection initializer expression.
6932 (CollectionOrObjectInitializers): A block of object or collection
6934 (NewInitialize): New expression with element/object initializers.
6936 * statement.cs: Reverted object/collection initializer hacks.
6938 * typemanager.cs (CSharpName): Filter __arglist type.
6940 2007-08-09 Marek Safar <marek.safar@gmail.com>
6942 ** C# 3.0 Anonymous Types (update to the latest standard)
6944 * expression.cs (Binary.ResolveOperator): Threat all null based types
6946 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
6947 (AnonymousTypeParameter): Updated.
6949 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
6950 (AnonymousTypeClass): New anonymous type container.
6952 * class.cs (AddField): Return operation result.
6954 * generic.cs: Another empty TypeArguments overload.
6956 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
6957 are stored at top of normal hierarchy.
6959 * typemanager.cs (CSharpName): Filter anonymous types.
6961 2007-08-09 Marek Safar <marek.safar@gmail.com>
6963 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
6964 as single Concat call. How could we miss that :-(
6966 2007-08-08 Marek Safar <marek.safar@gmail.com>
6968 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
6970 2007-08-07 Miguel de Icaza <miguel@novell.com>
6972 * expression.cs: Fix the previous commit, the creation of the
6973 arguments array list needs also to be conditional on the arguments
6976 * class.cs: Add a little bit of help to help narrow down problems.
6978 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
6979 not try to copy in that case.
6981 * driver.cs: When building SMCS, include a new different set of
6982 default assemblies here. Do this here so we can control whether
6983 to include the default assemblies with /noconfig.
6985 2007-08-03 Marek Safar <marek.safar@gmail.com>
6987 A fix for bug #81979
6988 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
6991 2007-08-03 Marek Safar <marek.safar@gmail.com>
6993 A fix for bug #82300
6995 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
6996 we are in probing scope.
6998 2007-08-03 Marek Safar <marek.safar@gmail.com>
7000 A fix for bug #82301
7002 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
7003 (Statement.CloneTo): Clone and not map children blocks.
7005 2007-08-03 Marek Safar <marek.safar@gmail.com>
7007 A fix for bug #82299
7009 * expression.cs (LocalVariableReference.CloneTo): Remap local info
7012 * statement.cs (Statement.CloneTo): Clone variables before statements
7013 to allow remaping of local variables.
7015 2007-08-03 Marek Safar <marek.safar@gmail.com>
7017 A fix for bug #82296
7020 * report.cs: Log crash details for future clone problems.
7022 * statement.cs (Return.Clone): Don't clone non-existent expression.
7024 2007-08-03 Raja R Harinath <harinath@gmail.com>
7026 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
7027 (Class.AddBasesForPart): Move CS0537 check here from ...
7028 * cs-parser.jay (class_declaration): ... here. Move calling of
7029 'AddBasesForPart' to ...
7030 (class_bases): ... here.
7031 (struct_declaration, interface_declaration): Update to changes.
7033 2007-08-02 Marek Safar <marek.safar@gmail.com>
7035 A fix for bug #81923
7037 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
7038 conversion is allowed.
7040 2007-08-02 Marek Safar <marek.safar@gmail.com>
7042 A fix for bug #81564
7044 * ecore.cs (EventExpr): Add IsBase handling.
7046 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
7049 2007-08-02 Raja R Harinath <harinath@gmail.com>
7051 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
7052 * cs-parser.jay: Some whitespace cleanups.
7053 (current_delegate): New.
7055 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
7056 a dummy code block, and use 'type_name' instead of 'member_name'.
7057 (interface_declaration, class_declaration): Likewise.
7058 (delegate_declaration): Likewise. Rearrange slightly and use
7060 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
7061 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
7063 2007-08-02 Marek Safar <marek.safar@gmail.com>
7065 A fix for bug #82039
7067 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
7070 * typemanager.cs (CSharpName): Split to string overload.
7072 2007-08-02 Marek Safar <marek.safar@gmail.com>
7075 * report.cs: Updated warning CS0472.
7077 2007-08-01 Marek Safar <marek.safar@gmail.com>
7079 A fix for bug #82181
7081 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
7083 2007-08-01 Marek Safar <marek.safar@gmail.com>
7085 A fix for bug #82277
7086 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
7088 2007-08-01 Marek Safar <marek.safar@gmail.com>
7090 ** C# 3.0 Type Inference (major bits are working)
7092 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
7093 (.ImplicitStandardConversionExists): Uses compatible.
7094 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
7095 (.InferReturnType): New method.
7096 (.Compatible): Refactored.
7097 (.ResolveParameters): Uses factory to create resolved parameters.
7098 (.CompatibleMethod): Add probing mode support.
7099 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
7100 clearly distinguish between 2 different operations.
7101 (LambdaMethod): Moved to lambda.cs.
7102 (AnonymousMethod): Removed unused fields and methods.
7103 (AnonymousDelegate): Simplified.
7105 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
7107 * convert. cs (ImplicitConversionStandard): Compatible works differently.
7109 * delegate.cs (Delegate): New mehods to reduce code duplication.
7110 (.GetConstructor): New method.
7111 (.GetInvokeMethod): New method.
7112 (DelegateCreation): Updated.
7114 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
7116 (OverloadResolve): Made probing little bit faster.
7118 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
7121 * generic.cs (TypeInferenceContext): Dummy implementation.
7123 * iterators.cs: Updated after Resolve/Define rename.
7125 * lambda.cs (LambdaExpression)
7126 (.ResolveParameters): Handles both type of arguments and type inference too.
7128 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
7129 (InflateTypes): Updated.
7131 * support.cs (InflateTypes): Changed signature and updated.
7133 * typemanager.cs (LookupMemberCache): Better dynamic type check.
7134 (MemberLookup_FindMembers): More MS tricks.
7135 (GetParameterData): Ditto.
7136 (GetDelegateParameters): Uses quick path for dynamic types.
7138 2007-08-01 Marek Safar <marek.safar@gmail.com>
7140 * class.cs (MethodData.Define): EmitContext is required for generic stuff
7143 2007-07-31 Marek Safar <marek.safar@gmail.com>
7145 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
7148 2007-07-26 Jb Evain <jbevain@novell.com>
7150 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
7151 which takes a boolean 'report_errors', similar to the GetMethod.
7152 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
7153 in .net 2.1, do not report errors here.
7155 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
7156 System.Runtime.CompilerServices.RequiredAttributeAttribute and
7157 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
7160 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
7161 of the type InternalsVisibleToAttribute before the first call
7162 to CoreLookupType which is allowed to fail (third boolean parameter
7163 to true). Because, during the resolution for a type that is not
7164 immediately found, we try to check if the type is not defined in
7165 a friend assembly, and to do so, we need the
7166 InternalVisibleToAttribute.
7168 2007-07-23 Miguel de Icaza <miguel@novell.com>
7170 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
7171 feature that allows structs to be compared against null and inline
7172 the result as true or false.
7174 Notice that the same code is not permitted inside a generic block
7175 of code that would do:
7177 class Foo<T> where T : struct {
7184 It is only allowed if the type of T is not bound (no where
7185 clause). In my opinion, this CSC 2 behavior is broken but people
7186 seem to be using it (IronRuby does, a few bug reports on bugzilla
7187 have it and some people have complained about it).
7189 All of the users that depend on this behavior have code that is
7192 * report.cs (Warning, Error): make these take object arguments,
7193 not strings, as that allows us to take advantage of Format.
7195 2007-07-20 William Holmes <billholmes54@gmail.com>
7197 * decl.cs: Changed MemberName.CountTypeArguments to also check the
7198 Left member variable for the Count.
7199 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
7200 MemberName.CountTypeArguments to avoid a NRE.
7202 This code is contributed under the MIT X11 license
7204 2007-07-18 Marek Safar <marek.safar@gmail.com>
7206 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
7208 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7210 * doc.cs : generic method arguments are written as ``x while generic
7211 type arguments are `x. Combined with the previous change, fixed bug
7214 2007-07-18 Raja R Harinath <rharinath@novell.com>
7217 * expression.cs (Binary.ResolveOperator): When converting
7218 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
7220 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7222 * doc.cs : when T: or whatever x: is specified, it does not really
7223 check the doc comment's syntax correctness. Fixed bug #82006.
7225 2007-07-18 Marek Safar <marek.safar@gmail.com>
7227 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
7228 LambdaExpression better.
7230 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
7232 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
7234 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
7235 as it can be generated.
7237 * expression.cs (Invocation.Error_InvalidArguments): Show correct
7240 * lambda.cs (LambdaExpression): Refactored to share same code with
7241 AnonymousMethodExpression.
7243 2007-07-17 Marek Safar <marek.safar@gmail.com>
7245 * anonymous.cs (MakeName): Include host name for easier debugging.
7246 (LambdaMethod): New class for lambda spcecific stuff.
7248 * attribute.cs: Set EmitContext return type.
7250 * class.cs: Set EmitContext return type.
7252 * codegen.cs (EmitContext): Return type cannot be null to stop messing
7253 with null/void meaning.
7255 * iterators.cs (ContainerType): Implemented.
7257 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
7259 * statement.cs (Return): Updated to lambda expressions.
7260 (Block.CloneTo): Parent can be null.
7262 2007-07-13 Marek Safar <marek.safar@gmail.com>
7264 A fix for bug #81917
7265 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
7267 * class.cs (FixedField): Check whether field is in unsafe scope.
7269 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
7270 (FieldExpr.Emit): Fixed buffers cannot be volatile.
7272 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
7275 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
7277 2007-07-13 Marek Safar <marek.safar@gmail.com>
7279 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
7280 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
7283 2007-07-13 Marek Safar <marek.safar@gmail.com>
7285 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
7287 2007-07-13 Marek Safar <marek.safar@gmail.com>
7289 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
7290 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
7292 * codegen.cs(EmitContext): Add ProbingMode flag.
7294 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
7296 * driver.cs: For now set both warning values.
7298 * ecore.cs (SimpleName): Name is readonly.
7299 (MethodGroup.OverloadResolve): One quick path for probing.
7301 * expression.cs (Unary): Set Oper r/o.
7302 (Binary): Set Oper r/o.
7303 (ParameterReference): Set few instance variables as r/o.
7304 (ParameterReference.DoResolveBase): Don't capture aruments when
7306 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
7307 (Arglist): arguments are private.
7308 (SizeOf): type is private and r/o.
7309 (MemberAccess): arguments are private.
7311 * report.cs: Enhanced reporting on/off capabilities.
7313 * lambda.cs: Uses ec.IsInProbingMode.
7314 (ContextualReturn): Derives from return.
7316 * rootcontext.cs: For now set both warning values.
7318 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
7320 (Return.Resolve): Don't die immediately.
7321 (Block.Resolve): Speed-up probing.
7322 (Block.CloneTo): Clone only child blocks.
7324 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
7326 * iterators.cs: reverted Miguel's latest change (r81925) as it
7327 breaks the build in System.
7329 2007-07-13 Miguel de Icaza <miguel@novell.com>
7331 * iterators.cs (Yield.CheckContext): Check for the iterator type
7332 also here as we can call into Yield even in codepaths that are not
7334 (MethodOrOperator is the only path that was checked).
7336 In addition to the standard check, use a more specific check for
7337 constructors to report a more verbose error.
7339 2007-07-12 Miguel de Icaza <miguel@novell.com>
7341 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
7342 report the warning and continue
7344 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
7345 values on the stack on the call to Emit. Use EmitStatement if
7346 possible, or using Emit + Pop if not possible. Fixes #82064
7348 2007-07-12 Raja R Harinath <rharinath@novell.com>
7350 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
7351 avoid try...finally in some cases.
7353 2007-07-10 Marek Safar <marek.safar@gmail.com>
7355 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
7357 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
7358 instead of method. Re-use standard error handling.
7359 (ConstructorInitializer.Emit): Simplified.
7361 * delegate.cs: Updated after Invocation.EmitCall change.
7363 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
7364 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
7365 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
7366 method and don't permanently changing input arguments.
7367 (MethodGroupExpr): Introduced resolved best_candidate, when method group
7368 is resolved it has one of the candidates is the best one which is later
7369 used to emit. Removed a few unused method.
7370 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
7372 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
7373 (Binary.ResolveOperator): Ditto.
7374 (ConditionalLogicalOperator.DoResolve): Ditto.
7375 (Invocation): Uses method group.
7376 (Invocation.DoResolve): Simplified.
7377 (Invocation.EmitCall): Removed useless is_static.
7378 (Invocation.Emit): Delegate to method group.
7379 (Invocation.EmitStatement): Simplified.
7380 (New): Uses method group.
7381 (MemberAccess.DoResolve): Don't destroy original expression.
7383 * statement.cs (ForEach.Resolve): Use null for no method arguments.
7385 2007-07-04 Marek Safar <marek.safar@gmail.com>
7387 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
7390 * lambda.cs: Add custom error message type.
7392 2007-07-03 Marek Safar <marek.safar@gmail.com>
7394 * lambda.cs: Simplified little bit.
7396 * parameter.cs: Introduced ImplicitLambdaParameter.
7397 (Parameters.CreateFullyResolved): New factory instead of ctor.
7401 * delegate.cs: Updated parameter creation.
7403 2007-07-03 Marek Safar <marek.safar@gmail.com>
7405 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
7408 * generic.cs: Synchronized with gmcs.
7410 2007-07-03 Marek Safar <marek.safar@gmail.com>
7412 * class.cs (Indexer): Check return type as soon as possible.
7414 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
7417 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
7419 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
7421 * parameter.cs (Parameter): Use expression type when it is available.
7423 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
7424 method modifier for the first parameter only.
7426 2007-06-24 Marek Safar <marek.safar@gmail.com>
7428 A fix for bug #81938
7429 * typemanager.cs (ChangeType): Fixed couple of char conversions.
7431 * constant.cs: Tide up an exception message.
7433 2007-06-22 Marek Safar <marek.safar@gmail.com>
7435 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
7436 an uninitialized variable is used.
7438 * expression.cs (LocalVariableReference.DoResolve): Ditto.
7440 2007-06-22 Marek Safar <marek.safar@gmail.com>
7442 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
7443 not found error handling.
7445 * expression.cs (ArrayCreation): Removed redundant fields and little bit
7447 (ArrayCreation.ResolveArrayElement): To be ready to customization.
7448 (ArrayCreation.DoResolve): Simplified.
7449 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
7450 its own resolve process.
7451 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
7453 2007-06-20 Marek Safar <marek.safar@gmail.com>
7455 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
7458 2007-06-20 Marek Safar <marek.safar@gmail.com>
7460 * cs-tokenizer.cs: Removed var related stuff.
7462 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
7463 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
7464 a type and a keyword at same time.
7466 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
7469 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
7470 implicitly typed arrays, more changes will follow.
7472 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
7474 2007-06-19 Marek Safar <marek.safar@gmail.com>
7476 * ecore.cs (VarExpr): Removed Handled field.
7478 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
7479 build-in assign functionality.
7480 (ForEach.Resolve): Removed all implicitly typed local variable code and
7482 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
7483 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
7485 2007-06-18 Marek Safar <marek.safar@gmail.com>
7487 * assign.cs: Removed implicitly typed local variable check.
7489 * expression.cs (LocalVariableReference.DoResolve): Add check for self
7490 referencing implicitly typed local variable.
7491 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
7494 * statement.cs (Fixed): Removed unsupported implicitly typed local
7497 2007-06-15 Marek Safar <marek.safar@gmail.com>
7499 * decl.cs (MemberName): Moved all Unbound stuff to parser.
7501 2007-06-14 Marek Safar <marek.safar@gmail.com>
7503 A fix for bugs #81855 and #76274
7504 * attribute.cs (AttachTo): Always set owner for global attributes to
7507 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
7510 * cs-parser.jay: Assembly and module attributes must precede all other
7511 elements except using clauses and extern alias declarations.
7513 2007-06-13 Marek Safar <marek.safar@gmail.com>
7515 A fix for bug #81748
7517 * expression.cs: More checks for non ISO-1 features.
7519 2007-06-12 Marek Safar <marek.safar@gmail.com>
7521 A fix for bug #81807
7522 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
7523 present inside switch statement and it is required by nullable check.
7525 2007-06-12 Marek Safar <marek.safar@gmail.com>
7527 A fix for bug #81840
7528 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
7529 when type matching fails.
7531 * namespace.cs: Tiny error message change.
7533 2007-06-12 Marek Safar <marek.safar@gmail.com>
7535 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
7536 reporting. Added automatic property check.
7538 * class.cs: Updated after CheckAbstractAndExtern relocation.
7539 (AEventPropertyAccessor.GetSignatureForError): Customized.
7541 2007-06-11 Marek Safar <marek.safar@gmail.com>
7543 * class.cs (DefineBaseTypes): Base type can be undefined.
7545 * ecore.cs (TypeLookup): Minor refactoring.
7546 (DoResolveAsTypeStep): Removed redundant check.
7548 * namespace.cs (Lookup): Removed redundant check.
7550 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
7551 ResolveAsTypeTerminal step.
7552 (BootstrapCorlib_*): Simplified.
7553 (PopulateCoreType): Core types can be now external.
7555 2007-06-07 Marek Safar <marek.safar@gmail.com>
7557 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
7559 (InferTypeArguments): Infers anonymous expression type arguments.
7560 (Compatible): Split to Compatible and InferTypeArguments.
7562 * lambda.cs: Updated.
7564 2007-06-08 Marek Safar <marek.safar@gmail.com>
7566 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
7568 2007-06-07 Raja R Harinath <harinath@gmail.com>
7570 Fix #80477, cs0135-2.cs, cs0135-3.cs
7571 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
7572 names to the "known" variables list.
7573 (Block.CheckInvariantMeaningInBlock): Handle the fact the
7574 parameter names are also "known".
7575 (Block.CheckError136): Remove.
7576 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
7579 2007-06-07 Marek Safar <marek.safar@gmail.com>
7581 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
7583 2007-06-06 Marek Safar <marek.safar@gmail.com>
7585 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
7586 internal error not an user error.
7588 * expression.cs (IsApplicable): Refactored to make debugging easier.
7590 * support.cs: More tricks for non-mono runtimes.
7592 * typemanager.cs (CoreLookupType): Made public.
7593 (InitSystemCore): All linq specific stuff moved to linq.cs
7595 2007-06-05 Marek Safar <marek.safar@gmail.com>
7597 * typemanager.cs (CSharpSignature): One more missing build-in types
7599 More tricks for non-mono runtime.
7601 2007-06-05 Raja R Harinath <harinath@gmail.com>
7603 * statement.cs (Block.CheckError136_InParents): Remove.
7604 (Block.AddVariable): Use GetParameterInfo instead.
7605 (ToplevelBlock.ProcessArguments): Likewise.
7607 2007-06-04 Raja R Harinath <rharinath@novell.com>
7609 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
7611 (ToplevelBlock.GetParameterInfo): Split out of ...
7612 (ToplevelBlock.GetParameterRefernce): ... this.
7613 (ToplevelBlock.ParameterMap): Remove.
7614 * expression.cs (ParameterReference): Update to use
7615 ToplevelParameterInfo.
7617 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
7620 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
7621 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
7623 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
7624 (ToplevelBlock.ProcessParameters) ... here.
7625 (ToplevelBlock..ctor): Invoke it.
7627 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
7630 * statement.cs (IKnownVariable): New interface.
7631 (LocalInfo): Implement it.
7632 (ToplevelParameterInfo): New class.
7633 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
7634 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
7635 GetKnownVariableInfo.
7637 2007-06-03 Raja R Harinath <harinath@gmail.com>
7639 Partly speed up CS0136 error checks.
7640 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
7641 'recurse' parameter.
7642 (Block.DoCheckError136): Only check errors in parameters. Move
7643 local variable checks ...
7644 (Block.AddVariable): ... here, and ...
7645 (ToplevelBlock.ResolveMeta): ... here.
7647 2007-06-02 Raja R Harinath <harinath@gmail.com>
7649 * statement.cs (Block.IsChildOf): Remove.
7651 * statement.cs (Statement.Clone): Move special case code ...
7652 (Block.CloneTo): ... here.
7654 2007-05-29 Raja R Harinath <rharinath@novell.com>
7656 * statement.cs (ToplevelBlock.container): Remove field. It's
7657 redundant with 'Parent'.
7658 (ToplevelBlock.ContainerBlock): Remove accessor.
7659 (ToplevelBlock..ctor): Update to changes. Register anonymous
7660 child with parent here, ...
7661 * cs-parser.jay (end_anonymous): ... not here. Don't modify
7663 (start_anonymous): Don't save current_block.
7664 (top_current_block): Remove.
7666 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
7667 (Block.Resolve): Update to changes.
7668 (Block..ctor): Move setting of "correct" 'Toplevel'
7669 and 'Explicit' fields to ...
7670 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
7672 2007-05-27 Raja R Harinath <harinath@gmail.com>
7675 * statement.cs (Block.Implicit): Remove.
7676 (Block): Update to changes.
7677 * flowanalysis.cs: Likewise.
7679 Mildly speed up CheckInvariantMeaningInBlock
7680 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
7681 Recursively call AddKnownVariable to all enclosing blocks.
7682 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
7683 Remove recursive calls.
7684 (Block): Update to changes.
7686 New ExplicitBlock invariants
7687 * statement.cs (Block.Explicit): New field. It points to the
7688 immediately enclosing non-implicit block.
7689 (Block..ctor): Maintain the invariant.
7690 * cs-parser.jay: Take advantage of invariant.
7692 Introduce ExplicitBlock
7693 * statement.cs (ExplicitBlock): New.
7694 (ToplevelBlock): Derive from it.
7695 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
7697 (Block.Implicit): Update to changes.
7698 * cs-parser.jay: Update to changes.
7701 * codegen.cs (EmitContext.IsLastStatement): Remove.
7702 * statement.cs (Block.DoEmit): Update to changes.
7704 2007-05-25 Raja R Harinath <rharinath@novell.com>
7706 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
7707 modifying current_block directly.
7709 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
7711 * class.cs: Implemented automatic properties (C# 3.0)
7712 Thanks to Marek for the help.
7714 2007-05-23 Raja R Harinath <rharinath@novell.com>
7716 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
7717 variable as assigned, note also that all its components are
7719 (MyBitVector.SetRange): New. Function to set multiple bits to true.
7721 2007-05-19 Marek Safar <marek.safar@gmail.com>
7723 * anonymous.cs, class.cs: Emit Compiler generated attribute when
7724 member is marked as compiler generated.
7726 * decl.cs (MemberCore): Refactored ModFlags into property.
7728 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
7729 (Check): Check only accessibility modifiers.
7731 2007-05-18 Raja R Harinath <rharinath@novell.com>
7733 Track all assignable slots in one bit array
7734 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
7735 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
7736 logic from VariableMap constructor here. Use the same 'offset'
7737 variable that's later used for computing offsets of local
7739 * flowanalysis.cs (UsageVector.parameters): Remove.
7740 (UsageVector): Update to changes.
7741 (VariableMap): Remove.
7743 Avoid creating ParameterMap in every block
7744 * statement.cs (Block.ParameterMap): Move ...
7745 (ToplevelBlock.ParameterMap): ... here.
7746 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
7748 * flowanalysis.cs (FlowBranching.param_map): Remove.
7749 (FlowBranching.UsageVector): Update to changes.
7750 (FlowBranchingToplevel.CheckOutParameters): Likewise.
7752 * statement.cs (Block.CloneTo): Clone Toplevel field too.
7754 * expression.cs (ParameterReference): Distinguish between block
7755 where parameter was referenced and declared.
7757 2007-05-18 Marek Safar <marek.safar@gmail.com>
7759 * flowanalysis.cs, statement.cs: Put back improved error handling.
7761 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
7765 Imporved object and collection initialization (C# 3.0).
7767 2007-05-15 Marek Safar <marek.safar@gmail.com>
7769 A fix for bug #81380
7770 * expression.cs (Is.DoResolve): Only value types have constant `is'
7773 2007-05-15 Raja R Harinath <rharinath@novell.com>
7775 * statement.cs (ToplevelBlock.child): Remove.
7777 2007-05-15 Raja R Harinath <harinath@gmail.com>
7779 Rationalize ResolveMeta: refactoring
7780 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
7781 out constant handling code into ...
7782 (Block.DoResolveConstants): ... this.
7784 Rationalize ResolveMeta: kill local_map
7785 * statement.cs (Block.local_map, Block.LocalMap): Remove.
7786 (Block.AssignableSlots): New.
7787 (Block.ResolveMeta): Make protected. Don't create a VariableMap
7788 for locals -- move code from VariableMap here. Avoid unnecessary
7790 * flowanalysis.cs (FlowBranching.local_map): Remove.
7791 (FlowBranching..ctor): Use Block.AssignableSlots.
7792 (VariableMap): Remove unused constructors.
7794 2007-05-11 Raja R Harinath <rharinath@novell.com>
7796 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
7798 2007-05-11 Marek Safar <marek.safar@gmail.com>
7800 * typemanager.cs (IsFriendAssembly): Should not be called for building
7803 2007-05-09 Marek Safar <marek.safar@gmail.com>
7805 * literal.cs (NullConstant): Print null in all cases.
7807 * expression.cs (Binary.ResolveOperator): Implemented delegate
7808 comparison based on C# 2.0 changes.
7810 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
7812 This code is contributed under the MIT X11 license
7814 The following enables support for several C# 3.0 language features:
7816 * cs-tokenizer.cs: Added support for the "var" keyword.
7818 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
7819 Added VarExpr class to facilitate type inferencing.
7821 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
7822 to support anonymous types.
7824 * assign.cs: Added support for type inferencing and initialization.
7826 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
7828 * expression.cs: Added implicit array support to ArrayCreation.
7829 Added 5 types and 1 interface:
7831 IInitializable Implementing classes can inject initializing
7832 statements after object instantiation.
7834 Initializer Stores data for object initialization.
7836 AnonymousType An expression for anonymous types.
7838 AnonymousTypeParameter Stores data about an anonymous type's field.
7840 NewInitialize An expression for object initialization.
7842 CollectionInitialize An expression for collection initialization.
7844 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
7847 2007-05-06 Marek Safar <marek.safar@gmail.com>
7849 A fix for bug #81500
7850 * cs-tokenizer.cs: Add special handling for coalescing operator.
7852 2007-05-06 Marek Safar <marek.safar@gmail.com>
7854 A fix for bug #81529
7855 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
7856 its value from base class until it is redefined.
7858 2007-05-02 Raja R Harinath <rharinath@novell.com>
7860 Fix regression in cs0631-3.cs
7861 * cs-parser.jay (operator_declarator): Add opt_attributes to error
7862 fallback. Make error fallback catch more cases.
7864 2007-05-01 Miguel de Icaza <miguel@novell.com>
7866 * cs-parser.jay: Allow parameters in operator declarations to have
7869 2007-04-27 Miguel de Icaza <miguel@novell.com>
7871 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
7874 * lambda.cs (ContextualReturn.Resolve): An expression is valid
7875 inside the ContextualReturn, it does not have to be an
7876 ExpressionStatement.
7878 2007-04-24 Miguel de Icaza <miguel@novell.com>
7880 * lambda.cs (ContextualReturn.Resolve): if the return type is not
7883 2007-04-23 Miguel de Icaza <miguel@novell.com>
7885 * anonymous.cs (AnonymousContainer): split the virtual Resolve
7886 method in two methods: ResolveNoDefine and Resolve.
7888 ResolveNoDefine will stop just after ResolveTopBlock has been
7891 Resolve will then continue by creating a method and issuing the
7892 call to method.Define ().
7894 (AnonymousMethod): Split and implement the new Resolve and
7895 ResolveNoDefine as well.
7897 * lambda.cs (LambdaExpression): Split the anonymous method
7898 resolution code into a separate routine (CoreCompatibilityTest)
7899 from DoCompatibleTest.
7901 (LambdaExpression.TryBuild): New method, this method tries to
7902 build the LambdaExpression with the given set of types to be used
7903 as the types for the various parameters of the lambda expression.
7905 If the compilation succeed with the given types, the infered type
7906 of the Anonymous method is returned, otherwise null is returned.
7908 2007-04-23 Marek Safar <marek.safar@gmail.com>
7910 A fix for bug #81414
7911 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
7913 2007-04-22 Miguel de Icaza <miguel@novell.com>
7915 * cs-tokenizer.cs: Change various identifiers here from the
7916 camelCasing to the recommended Linux-like style for instance
7917 variables from the Coding Guidelines.
7919 2007-04-19 Martin Baulig <martin@ximian.com>
7922 (Convert.ImplicitReferenceConversionCore): Allow conversions from
7923 System.Enum to System.ValueType.
7925 2007-04-13 Martin Baulig <martin@ximian.com>
7927 Rewrote implicit reference conversions. We need to distinguish
7928 between implicit reference conversions (13.1.4) and implicit
7929 boxing conversions (13.1.5).
7931 According to the spec, there's an an implicit conversion
7932 "From a one-dimensional array-type S[] to IList<T> and base
7933 interfaces of this interface, provided there is an implicit
7934 reference conversion from S to T." Note that this does not
7935 include boxing conversions.
7938 (Convert.ImplicitTypeParameterBoxingConversion): New method.
7939 (Convert.ImplicitReferenceConversion): Split into
7940 ImplicitReferenceConversionCore() and
7941 ImplicitBoxingConversionExist().
7942 (Convert.ImplicitReferenceConversionExists): Use the new
7943 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
7945 2007-04-12 Martin Baulig <martin@ximian.com>
7947 * convert.cs (Convert.ImplicitReferenceConversion): Move the
7948 `TypeManager.null_type' checks up to the top of the method.
7950 2007-04-11 Marek Safar <marek.safar@gmail.com>
7952 A fix for bug #81350
7953 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
7956 2007-04-11 Martin Baulig <martin@ximian.com>
7958 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
7959 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
7960 to make this work for generic classes; fixes #79561.
7962 2007-04-11 Martin Baulig <martin@ximian.com>
7964 * expression.cs (As): Add support for nullable types; fixes #79371.
7966 2007-04-11 Martin Baulig <martin@ximian.com>
7968 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
7969 `type.FullName' is null; fixes #80243.
7971 2007-04-11 Martin Baulig <martin@ximian.com>
7973 * expression.cs (Invocation.IsApplicable): Don't modify the method
7974 if type inference succeeded, but the method was not applicable.
7977 2007-04-10 Marek Safar <marek.safar@gmail.com>
7979 A fix for bug #81324
7980 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
7981 internal and external namespaces containers.
7983 2007-04-10 Martin Baulig <martin@ximian.com>
7985 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
7986 TypeManager.DropGenericMethodArguments() so we also call
7987 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
7989 2007-04-10 Martin Baulig <martin@ximian.com>
7991 * iterators.cs (Iterator.CreateIterator): Don't crash if
7992 `method.ReturnType' is null. This happens if something went wrong
7993 while resolving that typ (we already reported an error in this case).
7995 2007-04-10 Martin Baulig <martin@ximian.com>
7997 * expression.cs (New.DoResolve): Don't call CheckComImport() on
7998 generic interfaces; report the CS0144 directly.
8000 2007-04-10 Martin Baulig <martin@ximian.com>
8002 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
8003 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
8005 2007-04-10 Martin Baulig <martin@ximian.com>
8007 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
8009 2007-04-09 Raja R Harinath <rharinath@novell.com>
8012 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
8013 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
8016 * statement.cs (For.Resolve): If resolution fails, use
8019 2007-04-08 Marek Safar <marek.safar@gmail.com>
8021 * anonymous.cs (MakeName): Make faster and zero-based.
8022 (VerifyExplicitParameterCompatibility): Back to mode where generic
8023 parameter is ignored.
8024 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
8026 * class.cs (EmitType): Method can emit another new method.
8028 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
8030 * driver.cs: Updated.
8032 * lambda.cs: Reuse predefined empty parameters.
8034 * parameter.cs: Updated
8036 * support.cs: Implemented InflateTypes.
8038 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
8039 (InitSystemCore): Introduced to isolate 3.0 dependencies.
8041 2007-04-03 Martin Baulig <martin@ximian.com>
8045 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
8046 version of TypeManager.IsOverride() which also works with generic
8049 2007-04-03 Martin Baulig <martin@ximian.com>
8054 (Convert.ExplicitReferenceConversion): We need to cast when
8055 converting from IList<T> to S[].
8057 2007-04-01 Marek Safar <marek.safar@gmail.com>
8059 * decl.cs (FindExtensionMethods): Consider all candidates with same name
8062 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
8064 2007-03-31 Marek Safar <marek.safar@gmail.com>
8066 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
8067 argument and return type inferring.
8069 * codegen.cs (InferReturnType): Flag whether return can be inferred.
8070 (ReturnType): Turned to property.
8072 * statement.cs (Return): Implemented return type inferring.
8074 * support.cs (ReflectionParameters): Use local types if possible.
8076 2007-03-30 Raja R Harinath <rharinath@novell.com>
8078 * flowanalysis.cs (FlowBranching.Reachability): Remove.
8079 (FlowBranching.UsageVector): Update to changes.
8081 Prepare to kill 'Reachability'
8082 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
8083 argument of constructor.
8085 2007-03-29 Raja R Harinath <rharinath@novell.com>
8087 Prepare to kill 'Reachability'
8088 * flowanalysis.cs (UsageVector.is_unreachable): New.
8089 (UsageVector): Update to maintain 'is_unreachable' in parallel to
8090 'reachability', and verify they're consistent.
8093 * expression.cs (New.EmitStatement): Handle type parameters here too.
8095 2007-03-29 Martin Baulig <martin@ximian.com>
8100 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
8101 CompilerGeneratedClass.
8102 (ScopeInfo.EmitScopeInstance): Make this protected.
8103 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
8104 `ec.CurrentAnonymousMethod.Scope == Scope'.
8106 * statement.cs (Block.ScopeInfo): Make this a property.
8108 2007-03-27 Raja R Harinath <harinath@gmail.com>
8110 Prepare to kill 'Reachability'
8111 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
8112 (FlowBranching.UsageVector.Reachability): Remove property.
8113 (FlowBranching.UsageVector.IsUnreachable): New property.
8114 (FlowBranching.UsageVector.ResetBarrier): New.
8115 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
8116 * codegen.cs, statement.cs: Update to changes.
8118 2007-03-27 Martin Baulig <martin@ximian.com>
8123 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
8126 2007-03-26 Raja R Harinath <rharinath@novell.com>
8128 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
8129 instead of TriState. Remove all mention of TriState.
8131 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
8132 replaced by a boolean. Add boolean 'is_unreachable' field, check
8133 and maintain invariants.
8135 2007-03-25 Marek Safar <marek.safar@gmail.com>
8137 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
8139 2007-03-25 Marek Safar <marek.safar@gmail.com>
8141 * expression.cs: Stop using obsolete 2.0 opcodes.
8143 2007-03-25 Marek Safar <marek.safar@gmail.com>
8145 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
8146 one of the latests Martin's fixes.
8148 2007-03-23 Miguel de Icaza <miguel@novell.com>
8150 * expression.cs: On BigEndian systems, swap the bytes, temporary
8151 solution until we get a new bitconverter class.
8153 2007-03-23 Martin Baulig <martin@ximian.com>
8157 * decl.cs (MemberCache.AddMembers): Add generic methods both as
8158 "Method" and "Method`1". Normally, a cache lookup is done on the
8159 "Method" form (ie. without the generic arity), but this one makes
8160 lookups on the full form work as well.
8162 2007-03-22 Raja R Harinath <rharinath@novell.com>
8164 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
8167 2007-03-20 Bill Holmes <billholmes54@gmail.com>
8169 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
8170 ordered_member_list, to TypeBuilder to store members to be defined
8171 in the order they were parsed in.
8172 - ordered_explicit_member_list contains all properties indexers
8173 and methods that are defined as explicit implementation of an
8174 interface or base class.
8175 - ordered_member_list contains all properties indexers and methods
8176 that are not defined as explicit implementation of an interface
8179 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
8180 functionality in these removed classes has been replaced with
8181 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
8182 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
8184 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
8185 to CheckForDuplications inside GetMethod and SetMethod Define Method
8186 to handle method property and indexer name conflicts.
8190 All code is contributed under the MIT/X11 license.
8192 2007-03-20 Martin Baulig <martin@ximian.com>
8194 * class.cs (TypeContainer.Interfaces): Removed; they're now
8195 included in `TypeContainer.Types'.
8197 2007-03-20 Martin Baulig <martin@ximian.com>
8199 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
8201 * class.cs (TypeContainer.CreateType): New public method. This is
8202 now called before DefineType() to create the TypeBuilders.
8203 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
8204 has already been created by CreateType().
8205 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
8206 don't resolve our base classes here; this has been moved into
8207 DefineBaseTypes(). We're now called from CreateType().
8208 (TypeContainer.DefineBaseTypes): New private method; resolve our
8209 base classes here. We're now called from DefineType().
8212 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
8213 our types first to create all the TypeBuilders. After that, call
8214 TypeContainer.DefineType() on all the types which'll resolve their
8215 base classes and setup the resolve order.
8217 2007-03-20 Martin Baulig <martin@ximian.com>
8219 * class.cs (TypeContainer.Enums): Removed; they're now included in
8220 `TypeContainer.Types'.
8222 2007-03-20 Martin Baulig <martin@ximian.com>
8225 (TypeContainer.DefineType): Don't call ResolveMembers() here.
8226 (TypeContainer.DoResolveMembers): Call DefineType() on our
8227 `compiler_generated' classes; moved here from DefineNestedTypes().
8230 (RootContext.ResolveTree): Call ResolveMembers() on all
8231 TypeContainer's in the `type_container_resolve_order'.
8233 2007-03-19 Marek Safar <marek.safar@gmail.com>
8235 * class.cs: Use corlib to handle InternalMethodImplAttribute.
8237 2007-03-17 Marek Safar <marek.safar@gmail.com>
8239 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
8240 implementation flags.
8242 2007-03-17 Marek Safar <marek.safar@gmail.com>
8244 * class.cs: More optimizations for type parameters.
8246 2007-03-15 Marek Safar <marek.safar@gmail.com>
8248 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
8250 * ecore.cs, parameter.cs: More common code for both corlibs.
8252 * typemanager.cs (IsGenericMethod): Simplified.
8254 2007-03-15 Raja R Harinath <rharinath@novell.com>
8256 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8258 * statement.cs, iterators.cs, lambda.cs: Update to changes.
8260 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
8261 unconditionally. Simplify explanation.
8262 (Try.Resolve, Using.Resolve): Likewise.
8264 2007-03-15 Martin Baulig <martin@ximian.com>
8268 * decl.cs (DeclSpace): If we're a partial class, use our
8269 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
8271 2007-03-15 Raja R Harinath <rharinath@novell.com>
8273 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8275 (FlowBranching.UsageVector): Update to changes.
8276 (FlowBranching.MergeSiblings): Likewise.
8277 * statement.cs: Likewise.
8279 2007-03-15 Martin Baulig <martin@ximian.com>
8284 (MemberCache): Added a special .ctor for type parameters.
8287 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
8290 2007-03-09 Martin Baulig <martin@ximian.com>
8292 * enum.cs (Enum): Make this a TypeContainer.
8293 (EnumMember): Derive from `Const'.
8296 (Const.DoResolveValue): New protected virtual method; move most of
8297 the functionality of ResolveValue() here so we can override it in
8299 (Const.CreateConstantReference): Make this virtual.
8301 * class.cs (Kind): Add `Kind.Enum'.
8302 (TypeContainer.Emit): Don't emit the enums here; they're already
8303 in the `RootContext.typecontainer_resolve_order'.
8305 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
8306 here; they're already in the `typecontainer_resolve_order'.
8308 * ecore.cs (EnumConstant.ConvertImplicitly): Add
8309 TypeManager.DropGenericTypeArguments().
8312 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
8313 (TypeManager.IsEnumType): Likewise.
8314 (TypeManager.EnumToUnderlying): Likewise.
8315 (TypeManager.IsEqual): Add support for enums.
8317 2007-03-12 Raja R Harinath <rharinath@novell.com>
8319 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
8320 DefaultParameterValueAttribute to be undefined, say if System.dll
8323 2007-03-11 Marek Safar <marek.safar@gmail.com>
8325 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
8328 2007-03-10 Marek Safar <marek.safar@gmail.com>
8330 * class.cs, parameter.cs: Unified parameters verification.
8332 2007-03-08 Martin Baulig <martin@ximian.com>
8334 * cs-parser.jay (constructor_header): Pass the location to the
8335 newly created TopLevelBlock.
8337 2007-03-07 Martin Baulig <martin@ximian.com>
8339 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
8341 2007-03-06 Miguel de Icaza <miguel@novell.com>
8343 * convert.cs (ExplicitReferenceConversionExists): Sync this method
8344 with the changes from David, fixes the build.
8346 2007-03-05 David Mitchell <dmitchell@logos.com>
8348 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
8349 and its base interfaces to a one-dimensional array type S[],
8350 provided there is an implicit or explicit reference conversion
8353 2007-03-03 Marek Safar <marek.safar@gmail.com>
8355 * cs-tokenizer.cs: Implemented basic linq grammar.
8357 * driver.cs: Set linq lang version on demand.
8359 2007-02-26 Marek Safar <marek.safar@gmail.com>
8361 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
8363 2007-02-25 Marek Safar <marek.safar@gmail.com>
8365 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
8368 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
8370 Check property and event extern attributes.
8372 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
8375 2007-02-24 Marek Safar <marek.safar@gmail.com>
8377 A fix for bug #80407
8378 * ecore.cs: Don't report ambiguity error when methods have same parent.
8380 2007-02-23 Marek Safar <marek.safar@gmail.com>
8382 A fix for bug #80878
8383 * class.cs, cs-parser.jay: Event property can host anonymous methods.
8385 2007-02-22 Marek Safar <marek.safar@gmail.com>
8387 * attribute.cs: Enable ExtensionAttribute presence test.
8389 2007-02-22 Marek Safar <marek.safar@gmail.com>
8391 * class.cs: Warn about missing GetHashCode only when Equals is override.
8393 * decl.cs: Check accessibility of type arguments.
8395 * typemanager.cs: Correctly report nullable array.
8397 2007-02-20 Marek Safar <marek.safar@gmail.com>
8399 * class.cs, report.cs: Capture more details when things go wrong.
8401 2007-02-20 Marek Safar <marek.safar@gmail.com>
8403 A fix for bug #80650
8404 * cs-parser.jay: Anonymous container starts at constructor declaration
8405 and not at block beginning because it has to be usable in constructor
8408 * statement.cs: Use context location and not block one for error reporting.
8410 2007-02-18 Marek Safar <marek.safar@gmail.com>
8412 A fix for bug #78712
8413 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
8416 2007-02-18 Marek Safar <marek.safar@gmail.com>
8418 A fix for bug #80493 by Atsushi Enomoto
8419 * cs-parser.jay: Ignore invalid attribute target.
8421 2007-02-18 Marek Safar <marek.safar@gmail.com>
8423 * cs-tokenizer.cs: Ignore '\0' as white space character.
8425 2007-02-17 Miguel de Icaza <miguel@novell.com>
8427 * cs-parser.jay: Add support for lambda expressions to the mcs
8430 * lambda.cs: Only clone when we are probing, not on the final call
8431 (Compatible is the final call).
8433 * statement.cs (CloneContext): Introduce class to provide block
8434 remapping during clone.
8436 All statements Clone themselves now.
8438 (Clone): special handling for blocks, when we clone a block, we
8439 register the block inside this routine, as children of the block
8440 might trigger a lookup.
8442 * expression.cs: Add support for CloneContext in all expressions.
8444 2007-02-17 Marek Safar <marek.safar@gmail.com>
8446 A fix for bug #80493
8447 * statement.cs: Report ambiguous warning when interfaces are not related.
8449 2007-02-15 Marek Safar <marek.safar@gmail.com>
8451 C# 3.0 extension methods.
8453 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
8454 cannot be used directly.
8456 * class.cs (Class.Emit): Emit extension attribute if any class method
8457 is extension method.
8458 (Method.Define): Add basic extension method validation conditions.
8459 (Method.Emit): Emit extension attribute for method.
8461 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
8462 extension method exists. Currently we follow same approach as Microsoft
8463 does, emit even if a method or a class are private but this can change
8466 * cs-parser.jay: Add handling of `this' keyword in method parameters
8469 * decl.cs (DeclSpace.IsStaticClass): New property.
8470 (MemberCache.FindExtensionMethods): Looks for extension methods with
8471 defined name and extension type.
8473 * doc.cs: Updated after OverloadResolve changes.
8475 * driver.cs: Add new soft reference to System.Core.dll.
8477 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
8478 (ExtensionMethodGroupExpr): Represents group of extension methods.
8480 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
8481 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
8482 to MethodGroupExpr and made non-static for easier customization.
8483 (Invocation.DoResolve): Add extension method lookup when no standard
8485 (MemberAccess.DoResolve): Try extension methods if no member exists.
8487 * modifiers.cs: Add METHOD_EXTENSION modifier.
8489 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
8490 as well as candidate extension type.
8491 (ComputeNamespaces): When assembly constains extension methods registers
8493 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
8494 extension method lookup.
8495 (Namespace.LookupExtensionMethod): Looks for extension method in this
8497 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
8498 find a method which matches name and extensionType.
8500 * parameter.cs (Parameter): Add This modifer.
8501 (HasExtensionMethodModifier): New property.
8502 (Resolve): Add extension parameter check.
8503 (ModFlags): turned to property to exclude this modifier as it is not real
8505 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
8507 * support.cs (ParameterData): Add ExtensionMethodType.
8508 (ReflectionParameters): Implemented ExtensionMethodType interface property.
8510 * typemanager.cs: Add type and ctor extension attribute type.
8512 2007-02-15 Miguel de Icaza <miguel@novell.com>
8514 * report.cs (DisableErrors, EnableErrors): used to prevent error
8515 output when we are "trying" to compile various methods with
8518 * ecore.cs (Expression): Add Clone method that calls the virtual
8519 CloneTo method. The current CloneTo method in Expression throws
8520 an exception so we can track down all the places where this must
8521 be implemented (not using abstract, because that would be a lot of
8522 up-front-work before we can start testing the implementation
8525 Important: we only need Clone capabilities for expressions created
8526 by the parser, as the expressions we will be cloning are
8527 expressions in the pre-resolved state. This vastly simplifies
8530 (SimpleName): Add CloneTo that does nothing.
8531 (EmptyCast): Add CloneTo.
8533 * expression.cs (Binary): Implement CloneTo.
8534 (Invocation.IsApplicable): Store the current ec in
8535 EmitContext.TempEc and restore it on return. This is used so we
8536 do not have to sprinkle hundres of methods with an extra
8537 EmitContext, we know that the only user is the lambda expression
8538 ImplicitConversionExists code.
8540 (Argument): Add Cloning capabilities.
8541 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
8542 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
8543 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
8544 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
8545 IndexerAccess): Add Clone capability.
8547 (LocalVariableReference, This): TODO: needs cloned Block mapping.
8549 (Argument): Add cloning capability.
8551 * assign.cs (Assign): Implement CloneTo.
8553 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
8555 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
8556 version by calling Convert with the EmitContext (that we are
8557 currently storing in ec, this is not great, but will do for now,
8558 to avoid passing EmitContext parameters to hundreds of functions
8559 that do not need them now).
8561 (SetExpression): Remove, it is not needed.
8563 (ContextualReturn): Implement CloneTo.
8565 * statement.cs (Statement): Implement cloning infrastructure,
8566 similar to expressions.
8568 (Block): Partial implementation of Clone for statements.
8570 (Return): Implement clone.
8572 * constant.cs (Constant.CloneTo): New method, does nothing.
8574 * codegen.cs (TempEc): Add a static EmitContext as a temporary
8575 solution, until we decide how to exactly do this.
8577 2007-02-14 Marek Safar <marek.safar@gmail.com>
8579 A fix for bug #80493
8580 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
8581 a property is override we need to use second accessor.
8583 2007-02-13 Marek Safar <marek.safar@gmail.com>
8585 A fix for bug #80418
8586 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
8589 2007-02-13 Marek Safar <marek.safar@gmail.com>
8591 Another fix for bug #80749
8592 * pending.cs: Abstract class has priority over interfaces.
8594 2007-02-13 Marek Safar <marek.safar@gmail.com>
8596 Another fix for bug #80749
8597 * pending.cs: Abstract class has priority over interfaces.
8599 2007-02-13 Marek Safar <marek.safar@gmail.com>
8601 Another fix for bug #80749
8602 * pending.cs: Abstract class has priority over interfaces.
8604 2007-02-13 Marek Safar <marek.safar@gmail.com>
8606 Another fix for bug #80749
8607 * pending.cs: Abstract class has priority over interfaces.
8609 2007-02-13 Marek Safar <marek.safar@gmail.com>
8611 * class.cs Better error message.
8613 * driver.cs: Add shorter versions of -optimize option.
8615 2007-02-13 Martin Baulig <martin@ximian.com>
8617 * class.cs (Constructor.Emit): Check the return value of
8618 ec.ResolveTopBlock() and return on error.
8620 2007-02-13 Raja R Harinath <rharinath@novell.com>
8622 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
8623 message to fix error message regression.
8625 2007-02-12 Marek Safar <marek.safar@gmail.com>
8627 * delegate.cs: Delegate creation expression cannot be of Nullable type.
8629 2007-02-12 Marek Safar <marek.safar@gmail.com>
8631 A fix for bug #80749
8632 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
8633 its parent container.
8635 * class.cs (DefineFieldInitializers): Each initializer can has different
8638 * const.cs: Updated.
8640 2007-02-11 Miguel de Icaza <miguel@novell.com>
8642 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
8643 now all the heavy lifting to check that embedded statements or
8644 expressions have the right form is done in the ContextualReturn.
8646 (ContextualReturn): New class.
8648 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
8649 method that can be invoked to report 201, so we do not replicate
8652 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
8654 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
8655 treating tabs as spaces.
8657 2007-02-09 Marek Safar <marek.safar@gmail.com>
8659 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
8660 * assign.cs: Use full implicit conversion for right side check.
8662 2007-02-09 Marek Safar <marek.safar@gmail.com>
8664 * statement.cs (Switch): Switch over boolean type is not standardized.
8666 2007-02-08 Marek Safar <marek.safar@gmail.com>
8668 A fix for bug #80755
8669 * decl.cs (FindBaseEvent): Don't use method cache for events.
8671 2007-02-07 Marek Safar <marek.safar@gmail.com>
8673 * cs-parser.jay: Better syntax error handling.
8675 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
8676 instead of underlying type value.
8678 2007-02-06 Marek Safar <marek.safar@gmail.com>
8680 * driver.cs: Check define identifier before is registered.
8682 * namespace.cs: Use existing error message.
8684 * report.cs: New warning.
8686 2007-02-06 Marek Safar <marek.safar@gmail.com>
8688 A fix for bug #80742
8689 * expression.cs: Delegate Invoke method can be called directly.
8691 2007-02-06 Marek Safar <marek.safar@gmail.com>
8693 A fix for bug #80676
8694 * class.cs (IsEntryPoint): The Main method can have params modifier.
8696 2007-02-04 Miguel de Icaza <miguel@novell.com>
8698 * parameter.cs (Parameter, Parameters): Add Clone method.
8700 * anonymous.cs (Compatible): Turn method into virtual method, so
8701 LambdaExpression can implement a different behavior.
8703 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
8704 out the basic checking here, so it can be used by
8707 * lambda.cs: Introduce "Compatible" function that will do the
8710 2007-02-02 Marek Safar <marek.safar@gmail.com>
8712 * attribute.cs: Unified one error message.
8714 * class.cs (Class): Use type attributes and not properties to test static
8716 (IsEntryPoint): Don's pass local variable.
8718 * convert.cs: Removed duplicate check.
8720 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
8722 * driver.cs: Don't crash when soft reference does not exist.
8724 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
8725 (UsingEntry): Removed redundant allocation.
8727 * parameter.cs: Add fast path for type parameters.
8729 * support.cs: Don't allocate attribute when it's not used.
8731 2007-01-30 Miguel de Icaza <miguel@novell.com>
8734 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
8735 this into a virtual method, so we can override it in LambdaExpression.
8737 * driver.cs: Improve diagnostics in case of failure.
8739 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
8740 write a function that is slightly more complex and that parses:
8742 type identifier [, type identifier]* )
8744 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
8747 (canEmpty ? i >= 0 : i > 0)
8749 2007-01-30 Raja R Harinath <rharinath@novell.com>
8751 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
8752 exception on possibly valid code.
8754 2007-01-29 Raja R Harinath <rharinath@novell.com>
8756 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
8758 (parse_opt_type_arguments): Remove. It's almost the same as
8760 (parse_namespace_or_typename): Use parse_less_than.
8762 2007-01-28 Miguel de Icaza <miguel@novell.com>
8764 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
8765 this bug took a few hours to find, because the state saved and
8766 restored by PushPosition and PopPosition was ignoring the state of
8767 parse_generic_less_than.
8769 I can also now remove the handling of OP_LT and OP_GT, this solves
8772 * cs-tokenizer.cs: store the location for the ARROW token, we use
8775 (PushPosition, PopPosition): save/restore also `current_token',
8776 restore `parse_generic_less_than' (was missing).
8778 (parse_opt_type_arguments): use parse_type, not
8779 parse_namespace_or_typename to parse types.
8781 * lambda.cs: Empty new file, will eventually have the lambda
8782 expression implementation.
8784 * lambda.test: used to test the internal tokenizer.
8786 * report.cs (FeatureIsNotISO1): Rename from
8787 FeatureIsNotStandardized, because it was about the language level
8788 (1 vs 2) it was not about standarization.
8790 (FeatureRequiresLINQ): New.
8792 * support.cs (SeekableStreamReader): Only require that the reader
8793 is a TextReader, not a StreamReader, so we can plug StringReader.
8795 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
8796 given position in the input stream the following tokens can be
8797 parsed as a type followed by an identifier.
8799 (is_punct): after a '(' if parse_type_and_parameter returns true,
8800 then return a special token OPEN_PARENS_LAMBDA which is used to
8801 avoid reduce/reduce errors in the grammar for the
8802 lambda_expression rules.
8804 (parse_type): implement a type parser inside the
8805 tokenizer, the parser only returns true or false depending on
8806 whether the input at a given position can be parsed as a type.
8808 (peek_token): new method used during type parsing.
8810 2007-01-28 Raja R Harinath <rharinath@novell.com>
8813 * anonymous.cs (ScopeInfo.InflateParameters): New.
8814 (AnonymousContainer.Resolve): Use it to redirect types of
8815 delegate parameters.
8817 2007-01-27 Raja R Harinath <rharinath@novell.com>
8820 * expression.cs (Error_InvalidArguments): Don't use two different
8821 messages for CS1503. Use ExtraInformation and
8822 SymbolRelatedToPreviousError instead.
8825 * decl.cs (DeclSpace.initialize_type_params): Don't access
8826 'type_params' of a partial class directly.
8828 2007-01-26 Miguel de Icaza <miguel@novell.com>
8830 * constant.cs: Removed a handful of out-of-range checks that were
8833 2007-01-25 Marek Safar <marek.safar@gmail.com>
8835 * expression.cs (CheckUselessComparison): Add additional check for char
8838 * namespace.cs: Fixed typo.
8840 2007-01-23 Miguel de Icaza <miguel@novell.com>
8842 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
8843 gone, instead we inline the test, preventing the needless casts to
8844 longs, ulongs and doubles for the parameters, avoiding calls to
8845 methods that overchecked stuff, and instead inlined things
8848 2007-01-20 Marek Safar <marek.safar@gmail.com>
8850 * cs-parser.jay: Better parameter error handling.
8852 2007-01-17 Marek Safar <marek.safar@gmail.com>
8854 A fix for bug #80368, #80522
8855 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
8856 whether array initializer contains constants only.
8857 (ArrayCreation.Emit): Use better formula to decide when
8858 are array initializers for static initialization.
8859 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
8860 have to emit even constants otherwise they are pre-initialized.
8862 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
8863 Raja R Harinath <rharinath@novell.com>
8865 Fix emit order of 'get' vs. 'set'.
8866 * support.cs (Accessors): New.
8867 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
8868 Note the order in which accessors are declared in the source.
8869 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
8870 Refactored from Property.Define and Indexer.Define.
8871 (PropertyBase.DefineAccessors): New helper that calls the above in
8872 appropriate order as noted by the parser.
8873 (Property.Define, Indexer.Define): Update to changes.
8874 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
8876 2007-01-17 Raja R Harinath <rharinath@novell.com>
8878 Fix cs0029-6.cs and gcs0029-2.cs (regression)
8879 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
8880 there's an implicit conversion from the current type to the target
8881 type before converting the underlying constant.
8883 2007-01-16 Marek Safar <marek.safar@gmail.com>
8885 * const.cs (ResolveValue): Updated after constant conversion was made more
8888 * constant.cs (GetAttributableValue): constant to object conversion is
8889 used for attributes only.
8890 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
8891 constant conversions.
8892 (LongConstant.ConvertImplicitly): Ditto.
8894 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
8895 (ImplicitConversionStandard): Handle constant conversion as extra step.
8896 It solves the issue when constant conversion was called indirectly like
8897 inside array initializer and constant folding was skipped.
8899 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
8902 * statement.cs(ImplicitConversionStandard): Updated after constant
8903 conversion was made more generic.
8905 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
8907 * expression.cs (As.DoResolve): Use GenericConstraints instead of
8908 Constraints, solves the problem where the compiler incorrectly
8909 reported that a type parameter was not constrained to a class (Bug
8912 2007-01-14 Marek Habersack <grendello@gmail.com>
8914 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
8916 2007-01-14 Marek Safar <marek.safar@gmail.com>
8918 A fix for bug #80368
8919 * assign.cs (FieldInitializer): New class implements field
8920 initializer statement.
8922 * attribute.cs: Update after FieldMember rename.
8924 * class.cs (PropertyBasedMember): New common class for property based
8926 (InterfaceMemberBase): New base class for all members which can be used as
8927 an interface members.
8928 (MethodCore): Moved really common code to InterfaceMemberBase.
8929 (Method.Define): Equal and GetHasCode detection is relevant for methods
8931 (MethodData.Define): Don't assume that public event implements an
8932 interface automatically.
8933 (MethodData.DefineMethodBuilder): Issue an error even if only extern
8935 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
8936 (FieldMember): Merged with FieldBase.
8937 (EventProperty.AEventPropertyAccessor): New specialization to check whether
8938 event extern modifier can be used.
8939 (EventField.EventFieldAccessor): Moved event field specific code here.
8940 (Event.AllowedModifiers): Even event can be extern.
8941 (Event.FindOutBaseMethod): New override specific to events.
8942 (Indexer.parameters): Reintroduce parameters because base class holds
8943 only properties common data.
8944 (Indexer.CheckForDuplications): Indexers are threated as methods so we
8945 need do extra parameters check.
8947 * const.cs: Update after FieldMember rename.
8949 * decl.cs (MemberCache.FindBaseEvent): New method.
8951 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
8952 to reflect that indexer is now derived from PropertyBased.
8954 * ecore.cs (GetMemberType): Made public.
8955 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
8958 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
8960 * typemanager.cs (CSharpSignature): Correctly print event accessors.
8961 (RegisterEvent): Removed.
8962 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
8963 (GetPrivateFieldOfEvent): Renamed to GetEventField.
8965 2007-01-11 Raja R Harinath <rharinath@novell.com>
8968 * statement.cs (CollectionForeach.TryType): Prefer generic
8969 GetEnumerator over non-generic variant. Fix code to follow comments.
8971 2007-01-09 Raja R Harinath <rharinath@novell.com>
8974 * support.cs (ReflectionParameter): Don't use an invalid index on
8975 the generic parameter data.
8977 2007-01-08 Miguel de Icaza <miguel@novell.com>
8979 * driver.cs: Just add a tiny bit of infrastructure.
8981 2007-01-02 Marek Safar <marek.safar@gmail.com>
8983 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
8984 where field type is struct from current assembly.
8986 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
8989 2007-01-02 Marek Safar <marek.safar@gmail.com>
8991 A fix for bug #80381
8992 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
8995 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
8997 (Namespace.LookupType): Always use core types from corlib when speficied.
8999 * report.cs: A new warning.
9001 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
9002 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
9003 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
9005 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
9006 (InitCoreTypes): Set expression type of object_type and value_type
9007 immediately after lookup.
9009 2007-01-01 Miguel de Icaza <miguel@novell.com>
9011 * cs-tokenizer.cs: Accept Pc class characters (Connector
9012 Punctuation) as valid identifiers. Fixes #78259
9014 * expression.cs (Invocation.DoResolve): Moved the check for the
9015 use of `this' for doing method calls to the Invocation resolution
9016 step, after overload resolution has taken place instead of doing
9017 the check at the low-level `This.DoResolve' level.
9019 The `This.DoResolve'(appens before overload resolution, so it has
9020 no way of knowing if the method that will be called will be
9021 instace or static, triggering an erroneous report for cs0188 (Bug
9024 We now do the check for instance method invocations after we know
9025 what method will be called.
9027 (This.CheckThisUsage): Move the actual use of this structure
9028 checking into its own method and expose it.
9030 * Everywhere that called Error_ValueCannotBeConverted: pass a new
9033 Exceptions: Null.ConvertImplicitly,
9034 Constant.ImplicitConversionRequired as there are too many call
9035 sites for passing the ec.
9037 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
9038 EmitContext, if the value is null, then we do not try to provide
9039 the extra information from the error (If a userdefined conversion
9040 exists, as UserDefinedConversion requires a non null-EmitContext).
9044 2006-12-30 Raja R Harinath <rharinath@novell.com>
9046 * flowanalysis.cs (MyBitVector): Document some invariants.
9047 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
9048 introduced below, and add a couple of others,
9050 2006-12-30 Marek Safar <marek.safar@gmail.com>
9052 * attribute.cs (GetMethodObsoleteAttribute): Uses new
9053 GetPropertyFromAccessor and GetEventFromAccessor.
9055 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
9056 overrides non-obsolete one.
9057 (Indexer.Define): Error message has been moved to the parser.
9059 * cs-parser.jay: Better syntax errors handling.
9061 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
9062 when an invocation has no arguments.
9064 * ecore.cs: Removed not used caching.
9066 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
9069 * report.cs: Add a new warning.
9071 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
9073 * typemanager.cs (enumeration_type): Removed.
9074 (CSharpSignature): Reuses IsSpecialMethod.
9075 (IsEqual): Hack for MS BCL.
9076 (GetPropertyFromAccessor): New method.
9077 (GetEventFromAccessor): New method.
9078 (IsSpecialMethod): Fixed to handle more cases.
9080 2006-12-30 Marek Safar <marek.safar@gmail.com>
9082 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
9083 Made white spaces array static.
9085 * ecore.cs (RemoveGenericArity): Optimized.
9087 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
9089 (MyBitVector.initialize_vector): Simplified.
9091 2006-12-22 Miguel de Icaza <miguel@novell.com>
9093 * ecore.cs: Am not entirely happy with this hack, but it seems to
9094 address the issue in 80257 (a small test case for
9097 I set the MethodGroupExpr.Type to an internal compiler type
9098 (itself in this case) to force the resolution to take place. Why
9099 it does not take place with a null is beyond me.
9101 2006-12-20 Marek Safar <marek.safar@gmail.com>
9103 A fix for bug #80288
9104 * expression.cs (ResolveOperator): Consider user defined conversion for
9105 logical and operator too.
9106 (EmitBranchable): Optimization for logical and when full constant folding
9107 could not be applied but one operand is constant.
9109 2006-12-19 Marek Safar <marek.safar@gmail.com>
9111 * class.cs (GetClassBases): Write 5 times every day, will never use
9112 FullName for error reporting.
9114 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
9116 2006-12-19 Martin Baulig <martin@ximian.com>
9118 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
9119 the symbol file info here.
9121 2006-12-18 Marek Safar <marek.safar@gmail.com>
9123 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
9124 of `elseif' is taking then following sections are not taking.
9125 Fixes an issue reported on mono mailing list.
9127 2006-12-18 Marek Safar <marek.safar@gmail.com>
9129 A fix for bug #80300
9130 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
9131 a caller is not taking.
9133 2006-12-18 Raja R Harinath <rharinath@novell.com>
9135 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
9136 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
9137 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
9138 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
9139 * class.cs: Update to changes.
9141 2006-12-17 Marek Safar <marek.safar@gmail.com>
9143 A fix for bug #79934
9144 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
9147 * class.cs (ResolveMembers): Register an iterator in current container and
9150 2006-12-16 Raja R Harinath <rharinath@novell.com>
9153 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
9154 satisfy a params annotated parameter.
9156 2006-12-16 Marek Safar <marek.safar@gmail.com>
9158 A fix for bug #77014
9159 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
9160 paramters correctly and not rely on hacks in Parameters class.
9161 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
9163 (Invocation.VerifyArgumentsCompat): Ditto.
9164 (Invocation.EmitArguments): Changed to correctly emit params arguments at
9167 * parameter.cs (HasParams): Don't assume that params is the last one.
9169 * support.cs (ReflectionParameters.ctor): Look for params attribute
9171 (ReflectionParameters.ParameterType): Removed hack when we returned last
9172 parameter for out of range parameters.
9173 (ParameterName, ParameterModifier): Ditto.
9175 2006-12-14 Marek Safar <marek.safar@gmail.com>
9177 A fix for bug #79987
9178 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
9179 when assembly is not CLS compliant but type is. I have no idea why is this
9182 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
9184 2006-12-13 Miguel de Icaza <miguel@novell.com>
9186 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
9187 in struct constructors, they are basically no-ops.
9189 2006-12-12 Marek Safar <marek.safar@gmail.com>
9191 * cs-tokenizer.cs (Position): Save preprocessor status too.
9193 2006-12-12 Marek Safar <marek.safar@gmail.com>
9195 A fix for bug #77794
9196 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
9198 2006-12-12 Marek Safar <marek.safar@gmail.com>
9200 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
9202 (pp_expr): Report error for an invalid expression.
9203 (handle_preprocessing_directive): Simplified; add more error checking.
9205 2006-12-11 Marek Safar <marek.safar@gmail.com>
9207 A fix for bug #74939
9208 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
9209 directives handling.
9211 2006-12-10 Marek Safar <marek.safar@gmail.com>
9213 A fix for bugs #80093, and #75984
9214 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
9215 logic, it seems to me as it worked before "by coincidence".
9216 (xtoken): Simplified to use reworked handle_preprocessing_directive.
9217 (cleanup): Enabled endif check.
9219 2006-12-09 Marek Safar <marek.safar@gmail.com>
9221 A fix for bug #80162
9222 * statement.cs (CollectionForeach.TryType): Generics and non-generics
9223 enumerators are never ambiguous.
9225 2006-12-08 Raja R Harinath <rharinath@novell.com>
9228 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
9230 2006-12-06 Marek Safar <marek.safar@gmail.com>
9232 A fix for bug #80144
9233 * class.cs (EventProperty.Define): Explicit implementation means
9234 that an even is used.
9236 2006-12-06 Marek Safar <marek.safar@gmail.com>
9238 Fixes the operators implementation (part II)
9240 * cfold.cs (DoConstantNumericPromotions): Renamed to
9241 DoBinaryNumericPromotions and simplified.
9242 (BinaryFold): Couple of conversion fixes; simplified.
9244 * constant.cs, ecore.cs, literal.cs
9245 (ToType): Renamed to ConvertImplicitly.
9246 (Reduce): Renamed to ConvertExplicitly.
9248 * class.cs, convert.cs: Updated.
9250 * expression.cs: TryReduce doesn't throw an exception.
9252 2006-12-01 Marek Safar <marek.safar@gmail.com>
9254 A fix for bug #80108
9255 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
9258 2006-11-30 Marek Safar <marek.safar@gmail.com>
9260 Fixes unary operators implementation (part I)
9263 * cfold.cs (Error_CompileTimeOverflow): Made internal
9265 * const.cs (IConstant): Changed to use reference to constant and
9266 not constant itself.
9267 Updated IConstant implementations.
9269 * constant.cs (CreateConstant): New factory method.
9270 Updated IConstant implementation.
9272 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
9274 * ecore.cs: Updated to use CreateConstantReference.
9276 * enum.cs: Reflects IConstant changes.
9278 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
9280 * literal.cs (NullConstant): Change to be independently usable.
9282 2006-11-29 Martin Baulig <martin@ximian.com>
9284 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
9285 we need to emit the scope initializer before calling the base .ctor.
9287 * anonymous.cs: Merged back from the new anonymous methods branch.
9288 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
9290 * expression.cs (ParameterReference.DoResolveBase): Create a
9291 "normal" ScopeInfo when capturing parameters rather than using the
9292 root scope; this makes things work with anonymous methods having
9296 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
9298 2006-11-22 Marek Safar <marek.safar@gmail.com>
9300 A fix for bug #79987
9301 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
9302 check to a base class.
9303 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
9304 only when assembly has missing attribute.
9305 * report.cs: Update.
9307 2006-11-21 Marek Safar <marek.safar@gmail.com>
9309 * cs-tokenizer.cs: Merged with gmcs version.
9311 2006-11-20 Marek Safar <marek.safar@gmail.com>
9314 * cs-parser.jay: Better error message when partial keyword is misplaced.
9316 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
9318 A fix for bug #79810
9319 report.cs: CS1058 only applies to 2.0 profile (gmcs).
9320 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
9321 a RuntimeWrappedException by default.
9323 2006-11-18 Marek Safar <marek.safar@gmail.com>
9325 A fix for bug #79843
9326 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
9328 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
9330 2006-11-18 Marek Safar <marek.safar@gmail.com>
9332 * driver.cs, namespace.cs: Uses faster IndexOf version.
9334 2006-11-17 Marek Safar <marek.safar@gmail.com>
9336 A fix for bug #79941
9337 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
9339 (Operator.Define): Implicit/Explicit operator of same type is duplicate
9340 even if internal name is different.
9341 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
9342 (UserDefinedConversion): Simplified as the operators cannot be internal.
9343 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
9345 (MethodLookup): Replaced EmitContext with parentType.
9346 * expression.cs: Updated.
9348 2006-11-09 Raja R Harinath <rharinath@novell.com>
9350 * driver.cs (BadAssembly): Handle all the ugliness of
9351 DefineDynamicAssembly.
9353 2006-11-08 Raja R Harinath <rharinath@novell.com>
9355 Address parts of #58244 -- most of what's left is in the runtime
9356 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
9357 CS1509 error checks, and handle them for all assembly loads, not
9358 just the first invocation.
9359 (LoadModule): Likewise. Move handling of 'adder_method' ...
9360 * codegen.cs (AssemblyClass.AddModule): ... here.
9362 2006-11-02 Marek Safar <marek.safar@gmail.com>
9364 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
9365 IEnumerable<T> is ambiguous.
9367 2006-10-31 Marek Safar <marek.safar@gmail.com>
9369 A fix for bug #67689
9370 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
9371 GetEnumerator is ambiguous.
9373 * report.cs: Add new warning.
9375 2006-10-29 Marek Safar <marek.safar@gmail.com>
9377 A fix for bug #78602
9378 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9379 to protected member can be nested type.
9381 2006-10-28 Marek Safar <marek.safar@gmail.com>
9383 A fix for bug #78965
9384 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9385 to protected member must derive from current type.
9387 2006-10-27 Marek Safar <marek.safar@gmail.com>
9389 assign.cs: Reuses error method.
9391 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
9392 instead of type for constants.
9393 (Expression.Error_ValueAssignment): Common error method.
9395 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
9398 2006-10-27 Marek Safar <marek.safar@gmail.com>
9400 A fix for bug #79081
9401 * expression.cs (MemberAccess.DoResolve): Check nested type
9404 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
9406 * doc.cs : nested delegates were not handled. Fixed bug #79754.
9408 2006-10-26 Marek Safar <marek.safar@gmail.com>
9410 A fix for bug #76591
9411 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
9413 2006-10-26 Marek Safar <marek.safar@gmail.com>
9415 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
9416 type forwarder of the same type multiple times.
9418 2006-10-26 Raja R Harinath <rharinath@novell.com>
9421 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
9422 instance as an rvalue, even when we later resolve as an lvalue.
9424 2006-10-25 Martin Baulig <martin@ximian.com>
9426 * anonymous.cs: Fix #79673.
9428 2006-10-24 Marek Safar <marek.safar@seznam.cz>
9430 A fix for bug #79666
9431 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
9432 ignored when is optimized (= default value) as its value is already set.
9434 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9436 A fix for bug #79724
9437 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
9438 TypeContainer for type lookup.
9440 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9442 A fix for bug #79231
9443 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
9444 * expression.cs (OverloadResolve): Always convert type name for
9446 (ResolveNamespaceOrType): Don't confuse a nested type with any
9449 2006-10-18 Martin Baulig <martin@ximian.com>
9451 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
9453 2006-10-17 Miguel de Icaza <miguel@novell.com>
9455 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
9456 an int32, but requesting an int64 from the conversion
9458 2006-10-12 Martin Baulig <martin@ximian.com>
9461 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
9463 2006-10-12 Martin Baulig <martin@ximian.com>
9466 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
9468 2006-10-11 Miguel de Icaza <miguel@novell.com>
9470 * convert.cs: Remove broken code: I was doing the "Existance"
9471 tests for Implicit conversions.
9473 2006-10-10 Miguel de Icaza <miguel@novell.com>
9475 * convert.cs: Added one missing case in
9476 ImplicitStandardConversionExists uint64 to intptr.
9480 * typemanager.cs (uintptr_type): another core known type.
9482 * ecore.cs (OperatorCast): routine used to do cast operations that
9483 depend on op_Explicit. We could change some of the Decimal
9484 conversions to use this.
9486 This one has a probe mechanism that checks both types for an op_
9487 which it coudl be used to eliminate two classes: CastToDecimal
9488 and CastFromDecimal.
9490 * convert.cs: Implement the conversions documented in #59800
9492 2006-10-10 Martin Baulig <martin@ximian.com>
9494 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
9495 before RootScope.ResolveMembers().
9497 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
9498 `CurrentType' if appropriate.
9500 2006-10-09 Marek Safar <marek.safar@seznam.cz>
9502 A fix for bug #78568
9503 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
9504 when contains binary operators.
9505 * cs-parser.jay: Updated.
9507 2006-10-09 Martin Baulig <martin@ximian.com>
9510 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
9511 moved that into Define() and also do the other type parameter
9512 checks there. Fixes #79094. Added gtest-292.cs.
9515 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
9516 since that doesn't include type parameters; don't use `Ldelema'
9517 for type parameters. Fixes #78980. Added gtest-293.cs.
9519 2006-10-08 Marek Safar <marek.safar@seznam.cz>
9522 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
9523 conversion is allowed.
9525 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9527 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
9528 error reporting when no error occurs.
9530 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9532 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
9535 2006-10-06 Raja R Harinath <rharinath@novell.com>
9538 * class.cs (DefineTypeBuilder): Check circular dependencies before
9539 setting the parent of the TypeBuilder.
9540 (CheckRecursiveDefinition): Don't use 'BaseType', since
9541 it may not be valid until after DefineTypeBuilder. Use
9542 'base_type' instead.
9544 2006-10-04 Martin Baulig <martin@ximian.com>
9546 Merged the Anonymous Methods patch.
9548 * anonymous.cs, iterators.cs: The new anonymous methods code.
9550 * statement.cs (Variable): New public abstract class.
9551 (LocalInfo.Variable): New public property.
9552 (LocalInfo.ResolveVariable): New public method.
9553 (Block.Flags): Add `IsIterator'.
9554 (Block.AddVariable): Improved the CS0136 check.
9555 (Block.AnonymousChildren): New public property.
9556 (Block.AddAnonymousChild): New public method.
9557 (ToplevelBlock): Update to use the new anonymous method framework.
9558 (ToplevelBlock.ctor): `container' is now a `Block' and not a
9559 `ToplevelBlock'; this is required to correctly implement the
9561 (Fixed, Using): Use `TemporaryVariable' instead of directly
9562 creating the `LocalBuilder'.
9564 * parameter.cs (Parameter.ResolveVariable): New public method.
9565 (Parameters.ResolveVariable): Likewise.
9567 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
9569 * class.cs (TypeContainer): Replaced the `iterators' list and
9570 corresponding methods with a list of `CompilerGeneratedClass'es.
9571 (TypeContainer.ResolveMembers): New public method.
9572 (Method): `IIteratorContainer' has been replaced by
9575 * expression.cs (VariableReference): New public abstract base
9576 class for `LocalVariableReference', `ParameterReference' and
9579 * codegen.cs (EmitContext): Removed `capture_context',
9580 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
9581 (EmitContext.EmitThis): Removed.
9583 * cs-parser.jay: Replace `iterator_container' with
9586 2006-10-04 Martin Baulig <martin@ximian.com>
9588 * generic.cs (GenericMethod): Don't make this abstract.
9589 (Constraints.Clone): Added dummy implementation.
9591 2006-10-04 Raja R Harinath <harinath@gmail.com>
9594 * namespace.cs (LookForAnyGenericType): Avoid nullref on
9595 'declspaces'. Avoid allocating arrays willy-nilly.
9598 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
9599 cases out of the switch.
9601 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9603 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
9604 message when non-generic type is used with the type arguments.
9605 * expression.cs: Updated.
9607 2006-09-28 Raja R Harinath <rharinath@novell.com>
9610 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
9611 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9612 Change semantics slightly. Don't insist on having only one
9613 temporary EmptyExpression -- just throttle the creation of new ones.
9616 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
9617 non-interfaces too. If no methods are found, don't try to create
9620 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9622 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
9625 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
9626 us produce better error message.
9628 2006-09-27 Marek Safar <marek.safar@seznam.cz>
9630 * expression.cs (Binary.ResolveOperator): Warn about a side effect
9631 of the `|' operator.
9633 * report.cs: A new warning added.
9635 2006-09-27 Martin Baulig <martin@ximian.com>
9637 * generic.cs (GenericMethod): Don't make this abstract.
9639 2006-09-27 Martin Baulig <martin@ximian.com>
9642 (InternalErrorException): Added overloaded ctor taking a params array.
9644 2006-09-26 Marek Safar <marek.safar@seznam.cz>
9646 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
9647 Fixed the cases when same error was reported twice.
9649 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
9650 now report symbol information.
9652 2006-09-25 Martin Baulig <martin@ximian.com>
9654 * class.cs: Completely unified with the gmcs version.
9656 2006-09-25 Martin Baulig <martin@ximian.com>
9658 * typemanager.cs (TypeManager.IsNullableType): New public function.
9659 (TypeManager.IsNullableTypeOf): Likewise.
9660 (TypeManager.IsNullableValueType): Likewise.
9662 * class.cs (MethodCore): Added the `GenericMethod' argument from
9663 gmcs and also unified all classes derived from `MethodCore' with gmcs.
9665 2006-09-24 Raja R Harinath <harinath@gmail.com>
9667 * convert.cs: Unify with gmcs version.
9669 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9671 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
9672 verify them as well.
9674 * report.cs: New warning.
9676 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9678 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
9679 for anonymous block with out argument.
9681 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9683 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
9684 not used private events only.
9686 2006-09-23 Marek Safar <marek.safar@seznam.cz>
9688 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
9690 * const.cs (Const.Define): Check for constant type.
9691 (Const.IsConstantTypeValid): Looks for valid constant types.
9693 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
9695 * ecore.cs (EmptyConstantCast): New common class for all constant based
9698 * expression.cs (Is.DoResolve): Handle null constant especially.
9699 (New.DoResolve): Check for new void().
9700 (MemberAccess.DoResolve): Cope with all kind of nulls.
9702 * literal.cs (NullConstant): Uses EmptyConstantCast.
9703 (NullDefault): Based on EmptyConstantCast.
9704 (NullLiteral): Uses EmptyConstantCast.
9706 * statement.cs (Block.ResolveMeta): Check for constant type.
9708 2006-09-22 Martin Baulig <martin@ximian.com>
9710 * delegate.cs, attribute.cs: Merged with the gmcs versions.
9712 2006-09-22 Raja R Harinath <rharinath@novell.com>
9714 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
9718 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
9719 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
9722 2006-09-22 Martin Baulig <martin@ximian.com>
9724 * ecore.cs: Merged with the gmcs version.
9726 * generic.cs (ConstructedType): New dummy class.
9727 (TypeArguments): Don't make this abstract.
9730 (TypeManager.IsGenericTypeDefinition): New method.
9731 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
9733 2006-09-22 Raja R Harinath <rharinath@novell.com>
9735 * expression.cs (ComposedCast): Check for arrays of TypedReference
9736 before creating the type, not after.
9738 2006-09-21 Marek Safar <marek.safar@seznam.cz>
9740 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
9741 after ToType change.
9743 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
9744 when constant must be implicitly convertible.
9746 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
9748 * ecore.cs (NullCast): Derives from NullConstant.
9750 * expression.cs (Is.DoResolve): Removed useless variables.
9751 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
9752 (New.Constantify): Add enum support.
9753 (MemberAccess.DoResolve): Add warning when accessing null constant or
9756 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
9759 * literal.cs (NullConstant): New abstract class with common
9760 functionality for all null specializations.
9761 (NullDefault): Represents default(X) when result can be
9763 (NullLiteral): Updated.
9765 * report.cs: Add new warning.
9767 2006-09-21 Martin Baulig <martin@ximian.com>
9769 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
9771 2006-09-21 Martin Baulig <martin@ximian.com>
9773 * generic.cs (GenericConstraints): New dummy class.
9774 (Constraints): Likewise.
9775 (TypeParameter): Likewise.
9776 (TypeParameterName): Likewise.
9777 (GenericMethod): Likewise.
9779 * typemanager.cs (TypeManager.GetGenericArguments): New method.
9781 * decl.cs: Merged with the gmcs version.
9783 2006-09-21 Raja R Harinath <rharinath@novell.com>
9785 * generic.cs (TypeParameter): Implement IMemberContainer.
9786 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
9788 * rootcontext.cs: Unify with gmcs version.
9790 * report.cs: Unify with gmcs version.
9791 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
9792 from gmcs/generics.cs.
9793 * generics.cs (TypeParameter): New dummy class.
9795 * support.cs: Unify with gmcs version.
9797 2006-09-20 Raja R Harinath <rharinath@novell.com>
9799 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
9800 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
9802 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
9803 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
9804 * mcs.exe.sources: Add generic.cs.
9806 * codegen.cs: Unify with gmcs version.
9808 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
9809 (EmitContext): Add GenericDeclContainer implementation.
9810 * decl.cs (MemberCore, DeclSpace): Likewise.
9811 * namespace.cs: Remove #ifdef GMCS_SOURCE.
9813 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
9814 MCS TypeManager has a corresponding dummy method.
9816 2006-09-19 Martin Baulig <martin@ximian.com>
9818 * expression.cs: Completely merged with the gmcs version.
9820 2006-09-19 Martin Baulig <martin@ximian.com>
9822 * expression.cs (Invocation): Merged with the gmcs version.
9823 (ArrayAccess.GetStoreOpcode): Likewise.
9825 2006-09-19 Martin Baulig <martin@ximian.com>
9828 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
9829 (TypeManager.IsGenericMethodDefinition): Likewise.
9831 2006-09-19 Martin Baulig <martin@ximian.com>
9834 (TypeManager.IsEqual): Moved the gmcs implementation here.
9835 (TypeManager.DropGenericTypeArguments): Likewise.
9836 (TypeManager.DropGenericMethodArguments): Likewise.
9837 (TypeManager.GetTypeArguments): Moved here from gmcs.
9838 (TypeManager.HasGenericArguments): Likewise.
9840 2006-09-19 Martin Baulig <martin@ximian.com>
9842 * expression.cs (Binary): Merged with the gmcs version.
9844 2006-09-19 Martin Baulig <martin@ximian.com>
9846 * expression.cs (Probe, As, Is): Merged with the gmcs version.
9848 2006-09-19 Martin Baulig <martin@ximian.com>
9850 * typemanager.cs: Merged with the gmcs version.
9852 2006-09-16 Raja R Harinath <rharinath@novell.com>
9854 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
9855 * driver.cs: Likewise.
9857 2006-09-16 Marek Safar <marek.safar@seznam.cz>
9860 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
9861 only if parent type is class.
9862 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
9865 2006-09-15 Marek Safar <marek.safar@seznam.cz>
9868 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
9870 * typemanager.cs(CSharpName): Converts NullType to null.
9872 2006-09-15 Martin Baulig <martin@ximian.com>
9875 (TypeManager.GetMethodName): Added mcs implementation.
9876 (TypeManager.IsEqual): Likewise.
9879 (SimpleName.RemoveGenericArity): Added dummy implementation.
9881 * pending.cs: Merged with the gmcs version.
9883 2006-09-15 Martin Baulig <martin@ximian.com>
9885 * statement.cs: Merge with the gmcs version.
9887 2006-09-15 Martin Baulig <martin@ximian.com>
9889 * statement.cs (Switch): Merge with the gmcs implementation
9890 (without nullables), which is newer.
9892 2006-09-15 Martin Baulig <martin@ximian.com>
9894 * statement.cs (Block.Variables): Make this public.
9895 (ToplevelBlock.Parameters): Make this a property.
9896 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
9898 2006-09-15 Martin Baulig <martin@ximian.com>
9900 * namespace.cs: Merge with the gmcs version.
9902 2006-09-15 Martin Baulig <martin@ximian.com>
9904 * decl.cs (MemberName): Minor code cleanups.
9906 2006-09-15 Martin Baulig <martin@ximian.com>
9908 * parameter.cs: Merge with the gmcs version.
9910 2006-09-15 Martin Baulig <martin@ximian.com>
9912 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
9913 and an error in mcs.
9915 2006-09-15 Martin Baulig <martin@ximian.com>
9917 * flowanalysis.cs: Merged from GMCS; added the generics code into
9918 a `GMCS_SOURCE' conditional so we can share this file.
9920 2006-09-08 Martin Baulig <martin@ximian.com>
9922 * typemanager.cs (TypeManager.interlocked_type): New public field.
9923 (TypeManager.int_interlocked_compare-exchange): New public field.
9924 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
9925 enumerator types here and call InitGenericCoreTypes().
9926 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
9927 after calling InitEnumUnderlyingTypes().
9930 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
9931 `classes_second_stage'.
9933 2006-09-14 Marek Safar <marek.safar@seznam.cz>
9935 * assign.cs, ecore.cs, expression.cs: Share error message text.
9936 * class.cs (FieldMember.Define): Check for varible of static type.
9937 * driver.cs (LoadAssembly): Uses error output for errors.
9938 * statement.cs: Updated.
9940 2006-09-08 Marek Safar <marek.safar@seznam.cz>
9942 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
9945 2006-09-07 Martin Baulig <martin@ximian.com>
9948 (MainDriver): Revert r62663 from Marek; see #70506 for details.
9950 2006-08-29 Miguel de Icaza <miguel@novell.com>
9952 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
9954 2006-08-17 Miguel de Icaza <miguel@novell.com>
9956 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
9957 #52019 and #79064, the use of the \uXXXX sequence in source code
9958 to represent unicode characters.
9960 2006-08-15 Marek Safar <marek.safar@seznam.cz>
9962 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
9964 * class.cs, ecore.cs, statement.cs: Merged to one error message.
9966 2006-08-13 Miguel de Icaza <miguel@novell.com>
9968 * assign.cs: Catch attempts to assign to a method groups in += and
9971 2006-08-13 Marek Safar <marek.safar@seznam.cz>
9974 * cs-parser.jay: Don't destroy current array type by typeof of array's.
9976 2006-08-12 Marek Safar <marek.safar@seznam.cz>
9978 * class.cs (Method.Define): Issue a warning when generic method looks like
9980 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
9983 2006-08-09 Marek Safar <marek.safar@seznam.cz>
9985 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
9987 * decl.cs (MemberCache.FindMembers): When container is interface we need to
9988 search all base interfaces as a member can be ambiguous.
9989 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
9990 Constructor member type filter.
9991 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
9992 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
9993 reporting for returned memberinfos.
9994 * report.cs: Updated.
9995 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
9996 version to work on all runtimes.
9997 (TypeManager.RealMemberLookup): Removed members filtering.
9999 2006-08-08 Raja R Harinath <rharinath@novell.com>
10001 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
10002 (PropertyExpr.EmitAssign): Likewise.
10003 * expression.cs (Indirection.EmitAssign): Likewise.
10004 (LocalVariableReference.EmitAssign): Likewise.
10005 (ParameterReference.EmitAssign): Likewise.
10006 (Invocation.EmitArguments): Likewise.
10007 (ArrayAccess.EmitAssign): Likewise.
10008 (IndexerAccess.EmitAssign): Likewise.
10009 (This.EmitAssign): Likewise.
10010 (ConditionalLogicalOperator.Emit): Likewise.
10013 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
10014 instead of ArrayList. If the hashtable has a LocalBuilder, don't
10015 leave it in after returning it.
10016 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
10018 2006-08-06 Marek Safar <marek.safar@seznam.cz>
10020 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
10023 2006-08-03 Raja R Harinath <rharinath@novell.com>
10025 Fix cs0146-3.cs and cs0146-4.cs.
10026 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
10027 enclosing types don't depend on the current type.
10029 2006-08-02 Raja R Harinath <rharinath@novell.com>
10032 * class.cs (TypeContainer.DoDefineMembers): Use
10033 FindBaseMemberWithSameName on Parent, since we're interested in
10034 whether we hide inherited members or not.
10035 (FindBaseMemberWithSameName): Make slightly more robust.
10037 Fix the non-generic testcase from #77396
10038 * decl.cs (DeclSpace.DeclContainer): Remove override.
10040 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
10041 declspaces for doppelgangers too.
10042 (UsingEntry): Implement IResolveContext.
10043 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
10044 'this' as the resolve context.
10045 (LocalAliasEntry): Likewise.
10047 Implement parts of #77403
10048 * roottypes.cs (RootDeclSpace): New. Used to represent the
10049 toplevel declaration space. Each namespace declaration introduces
10050 a "partial" root declaretion space.
10051 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
10052 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
10053 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
10054 from 'current_namespace.SlaveDeclSpace'.
10055 (namespace_declaration): Likewise.
10056 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
10057 check. It can't happen now.
10058 * decl.cs (DeclSpace.LookupType): Likewise.
10059 * driver.cs (MainDriver): Sanity check.
10061 2006-08-01 Raja R Harinath <rharinath@novell.com>
10063 * decl.cs (DeclSpace.FindNestedType): Remove.
10064 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
10065 LookupTypeContainer to get the container of the nested type.
10066 * class.cs (TypeContainer.FindNestedType): Make non-override.
10068 2006-07-31 Raja R Harinath <rharinath@novell.com>
10070 * decl.cs (DeclSpace.PartialContainer): Move field from ...
10071 * class.cs (TypeContainer.PartialContainer): ... here.
10072 (TypeContainer.AddBasesForPart): New helper.
10073 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
10075 * cs-parser.jay (current_class): Convert to DeclSpace.
10076 (struct_declaration, interface_declaration, class_declaration):
10077 Use AddBasesForPart instead of .Bases directly.
10078 * const.cs, iterators.cs: Update to changes.
10080 2006-07-28 Raja R Harinath <rharinath@novell.com>
10082 * class.cs (TypeContainer.AddMemberType): Rename from
10083 AddToTypeContainer.
10084 (TypeContainer.AddMember): Rename from AddToMemberContainer.
10085 (AddTypeContainer): New. Combine AddClassOrStruct and
10087 (AddPartial): Update. Add 'is_partial' argument.
10088 * roottypes.cs: Update to changes.
10089 * cs-parser.jay (push_current_class): New helper for handling
10090 current_container and current_class.
10091 (struct_declaration, interface_declaration, class_declaration):
10094 2006-07-26 Raja R Harinath <rharinath@novell.com>
10096 * roottypes.cs: Rename from tree.cs.
10098 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
10099 * tree.cs (Tree, ITreeDump): Remove types.
10100 * rootcontext.cs (tree, Tree): Remove fields.
10101 (root, ToplevelTypes): New.
10102 * *.cs: Update to rename.
10104 * tree.cs (Tree.RecordDecl): Remove.
10105 (RootTypes.AddToTypeContainer): Record the toplevel type in its
10107 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
10109 2006-07-23 Raja R Harinath <harinath@gmail.com>
10111 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
10112 DoFlowAnalysis and OmitStructFlowAnalysis here.
10113 (ec.With): Rename from WithUnsafe and generalize.
10114 (ec.WithCheckState): Remove. All users can be handled by 'With'.
10115 (ec.WithFlowAnalyis): New.
10116 * ecore.cs, expression.cs, statement.cs: Update.
10118 2006-07-22 Raja R Harinath <harinath@gmail.com>
10120 * statement.cs (Block.ResolveMeta): Simplify slightly.
10122 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
10123 multiple boolean fields. Convert InUnsafe, constant_check_state,
10124 check_state to flags.
10125 (CheckState, ConstantCheckState): Update.
10126 (InUnsafe): New read-only property.
10127 (FlagsHandle): Rename from CheckStateHandle and convert to handle
10129 (WithUnsafe): New helper similar to WithCheckState.
10130 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
10131 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
10133 2006-07-21 Raja R Harinath <rharinath@novell.com>
10135 Make comparisons use the same IL irrespective of whether they're
10136 in a 'checked' or 'unchecked' context: one of the issues in #78899
10137 * codegen.cs (EmitContext.CheckState): Make read-only property.
10138 (EmitContext.ConstantCheckState): Likewise.
10139 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
10140 helper that implement a save/restore stack for CheckState
10141 values. This is the only way to change check-state.
10142 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
10143 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
10144 (CheckedExpr.EmitBranchable): New forwarding method.
10145 (UnCheckedExpr): Likewise.
10146 * statement.cs (Block.ResolveMeta): Use WithCheckState.
10147 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
10148 (Checked.Resolve, checked.DoEmit): Likewise.
10150 2006-07-20 Miguel de Icaza <miguel@novell.com>
10152 * anonymous.cs: Cache the resolved anonymous delegate, and return
10153 this so that the ResolveTopBlock is only triggered once, not
10156 Currently we trigger ResolvetopBlock twice due to a first pass of
10157 argument check compatibility, and a second pass that does the
10160 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10162 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
10164 * rootcontext.cs (Reset): Add helper_classes.
10166 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10169 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
10172 2006-07-13 Miguel de Icaza <miguel@novell.com>
10174 * statement.cs (Lock): Handle expressions of type
10175 TypeManager.null_type specially. Fixes #78770
10177 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10179 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
10182 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10184 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
10185 for accessors as well.
10186 * ecore.cs (EventExpr): Add AccessorTable.
10188 2006-07-01 Marek Safar <marek.safar@seznam.cz>
10191 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
10192 for CS0122 where appropriate.
10193 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
10195 (Filter): Assembly can be null in the case of top level attributes.
10197 2006-06-25 Marek Safar <marek.safar@seznam.cz>
10201 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
10202 is done at global level.
10204 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10206 A fix for #77002, Implemented TypeForwarder support.
10208 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
10209 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
10210 * typemanager.cs (): Add type_forwarder_attr_type.
10212 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10214 * report.cs: Add CS0469 warning.
10216 2006-06-21 Martin Baulig <martin@ximian.com>
10218 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
10219 the `try'-block, so we also report CS0016 etc. there.
10221 2006-06-21 Martin Baulig <martin@ximian.com>
10224 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
10226 2006-06-21 Martin Baulig <martin@ximian.com>
10228 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
10229 also report CS1686 for parameters.
10231 2006-06-21 Martin Baulig <martin@ximian.com>
10233 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
10234 instead of an error if the value is not implicitly convertible to
10235 the switch types; fixes #77964.
10237 2006-06-21 Raja R Harinath <rharinath@novell.com>
10240 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
10241 FieldBuilder is null.
10244 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
10245 'left' and 'right' before error-checking.
10247 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
10249 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
10251 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
10252 (FieldExpr.DoResolve): likewise.
10253 (PropertyExpr.InstanceResolve): likewise.
10254 (EventExpr.InstanceResolve): likewise.
10256 2006-06-04 Marek Safar <marek.safar@seznam.cz>
10258 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
10259 attribute applicable tests for attribute argument.
10261 2006-06-02 Raja R Harinath <rharinath@novell.com>
10264 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
10265 (Binary.OverloadResolve_PredefinedIntegral): New.
10266 (Binary.OverloadResolve_PredefinedFloating): New.
10267 (Binary.OverloadResolve_PredefinedString): New.
10268 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
10269 Follow the standard more closely, and treat numeric promotions in
10270 terms of overload resolution.
10271 (Binary.CheckShiftArguments): Simplify.
10273 2006-06-01 Raja R Harinath <rharinath@novell.com>
10275 * flowanalysis.cs (MyBitVector): Simplify representation.
10276 (MyBitVector.Clone): Avoid allocating BitArray.
10277 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
10278 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
10279 (*): Update. Change all references to MyBitVector.And and
10280 MyBitVector.Or to &= and |=.
10282 2006-05-29 Raja R Harinath <rharinath@novell.com>
10284 Fix cs0231-[34].cs.
10285 * cs-parser.jay (formal_parameter_list): Extend the pattern below
10286 to param arguments too.
10288 2006-05-26 Miguel de Icaza <miguel@novell.com>
10290 * cs-parser.jay: Catch another parsing form for arglist being
10291 followed by other arguments. Fixes #78313.
10293 2006-05-24 Raja R Harinath <rharinath@novell.com>
10295 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
10296 checking of out parameters to ...
10297 (FlowBranchingToplevel.Merge): ... here.
10298 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
10299 set, propagate the origin upward, and only complain if there was
10301 (FlowBranchingException.AddContinueOrigin): Likewise.
10302 (FlowBranchingException.AddReturnOrigin): Likewise.
10303 (FlowBranchingException.AddGotoOrigin): Likewise.
10305 2006-05-23 Raja R Harinath <rharinath@novell.com>
10307 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
10308 unreachable, skip it.
10309 (FlowBranchingException.Merge): Always propagate jumps, even if
10310 the finally block renders subsequent code unreachable.
10312 2006-05-18 Raja R Harinath <rharinath@novell.com>
10315 * statement.cs (Goto.Resolve): Move responsibility for resolving
10316 'goto' to FlowBranching.AddGotoOrigin.
10317 (Goto.SetResolvedTarget): New. Callback to set the
10318 LabeledStatement that's the target of the goto.
10319 (Goto.DoEmit): Use Leave instead of Br when crossing an
10320 unwind-protect boundary.
10321 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
10322 LookupLabel and adjust to new semantics.
10323 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
10324 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
10325 Goto.SetResolvedTarget to update target.
10326 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
10327 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
10328 AddBreakOrigin & co. Delay propagation until ...
10329 (FlowBranchingException.Merge): ... this.
10331 * statement.cs (Block.Resolve): Always depend on flow-branching to
10332 determine unreachability. Kill workaround that originally emitted
10333 only one statement after an "unreachable" label (see infloop in
10336 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
10337 This is still "wrong", but anything better would probably need a
10338 multi-pass algorithm.
10339 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
10340 usage vector. Force current usage vector to be reachable, to
10341 optimistically signify backward jumps.
10342 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
10344 (FlowBranchingLabeled.Merge): New. If no backward jump was
10345 detected, return the original salted-away usage vector instead,
10346 updated with appropriate changes. Print unreachable warning if
10348 * statement.cs (Block.Resolve): Don't print unreachable warning on
10349 a labeled statement.
10351 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
10353 * driver.cs: Pass filename without path to AssemblyBuilder's
10354 AddResourceFile. Fixes bug #78407.
10356 2006-05-17 Raja R Harinath <rharinath@novell.com>
10358 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
10359 * flowanalysis.cs (FlowBranchingLabeled): ... here.
10360 (FlowBranching.MergeChild): Overwrite
10361 reachability information from Labeled branchings too.
10363 2006-05-16 Raja R Harinath <rharinath@novell.com>
10365 * statement.cs (Goto.Resolve): Merge jump origins here ...
10366 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
10368 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
10369 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
10370 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
10371 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
10373 * statement.cs (Goto.Resolve): ... not here.
10374 (Goto.Emit): Remove CS1632 check.
10376 2006-05-14 Marek Safar <marek.safar@seznam.cz>
10378 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
10381 2006-05-11 Raja R Harinath <rharinath@novell.com>
10383 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
10384 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
10385 (FlowBranchingException.Label): Likewise.
10387 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
10389 (MyBitVector.Or): Use it to avoid losing information (Count).
10390 (FlowBranching.MergeOrigins): Likewise.
10392 * flowanalysis.cs (UsageVector.IsDirty): Remove.
10393 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
10394 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
10395 (UsageVector.ToString): Simplify.
10396 (UsageVector.MergeSiblings): Move here from ...
10397 (FlowBranching.Merge): ... here.
10398 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
10401 2006-05-10 Raja R Harinath <rharinath@novell.com>
10403 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
10404 null bitvector is treated as all-true.
10406 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
10407 (MyBitVector): Rationalize invariants. 'vector != null' implies
10408 that we have our own copy of the bitvector. Otherwise,
10409 'InheritsFrom == null' implies all inherited bits are true.
10411 2006-05-09 Marek Safar <marek.safar@seznam.cz>
10413 * statement.cs (LocalInfo): Add IsConstant.
10414 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
10415 local variable for constants.
10417 2006-05-09 Raja R Harinath <rharinath@novell.com>
10419 * flowanalysis.cs (MyBitVector.Empty): New.
10420 (MyBitVector): Don't allow InheritedFrom to be null.
10421 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
10422 (UsageVector, FlowBranching): Update to changes.
10424 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
10425 recursion. The 'Parent == null' condition isn't sufficient for
10427 (FlowBranching.AddBreakOrigin): Likewise.
10428 (FlowBranching.AddContinueOrigin): Likewise.
10429 (FlowBranching.AddReturnOrigin): Likewise.
10430 (FlowBranching.StealFinallyClauses): Likewise.
10431 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
10432 (FlowBranching.CheckOutParameters): Likewise.
10433 (FlowBranchingToplevel): Terminate all the above recursions here.
10434 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
10435 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
10437 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
10439 (FlowBranchingToplevel): New. Empty for now.
10440 (FlowBranching.MergeTopBlock): Update.
10441 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
10442 branching for the anonymous delegate.
10443 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
10445 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
10446 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
10447 information at the start of the merge. Reorganize.
10449 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10451 * class.cs (MethodData.Define): Method cannot implement interface accessor.
10453 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10455 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
10456 to newly introduced ctor.
10458 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
10459 message to one place.
10460 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
10463 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10465 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
10467 * ecore.cs (Expression.ResolveAsConstant): Updated.
10469 * statement.cs (ResolveMeta): Updated.
10471 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10473 * cs-parser.jay: __arglist cannot be used in initializer.
10475 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10478 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
10481 2006-05-05 Raja R Harinath <rharinath@novell.com>
10483 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
10484 (LabeledStatement): Add 'name' parameter.
10485 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
10486 (Block.AddLabel): Update to changes.
10487 * cs-parser.jay (labeled_statement): Likewise.
10489 * flowanalysis.cs (BranchingType.Labeled): New.
10490 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
10491 (FlowBranchingLabeled): New. Does nothing for now, but will
10492 eventually handle 'goto' flows.
10493 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
10494 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
10495 that's terminated ...
10496 (Block.Resolve): ... here.
10498 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
10499 (UsageVector.MergeFinallyOrigins): Likewise.
10500 (FlowBranching.InTryOrCatch): Likewise.
10501 (FlowBranching.AddFinallyVector): Likewise.
10502 (FlowBranchingException): Update to changes.
10505 * statement.cs (Return.Resolve): Move error checking to ...
10506 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
10507 (FlowBranchingException): Handle return origins like break and
10509 (FlowBranching.UsageVector.CheckOutParameters): Remove.
10511 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10514 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
10517 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10520 * class.cs (MethodData.Define): Do public accessor check only when method
10521 implements an interface.
10523 2006-05-04 Raja R Harinath <rharinath@novell.com>
10525 Remove special handling of 'break'
10526 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
10527 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
10528 (UsageVector.Break): Remove.
10529 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
10531 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
10533 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
10534 UsageVector.Breaks (). Don't set NeedsReturnLabel.
10536 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10539 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
10540 be the interface member.
10542 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10545 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
10546 for emitting small (int) values.
10548 2006-05-03 Raja R Harinath <rharinath@novell.com>
10551 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
10552 control-flow passes through the 'finally' after merging-in all the
10553 control-flows from 'try' and the 'catch' clauses.
10555 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
10556 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
10557 always true at the only non-recursive entry point.
10558 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
10559 FlowBranchingBreakable.
10560 (FlowBranchingLoop): Remove.
10561 * statement.cs (Return.DoResolve): Update to changes.
10564 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
10565 (FlowBranching.CreateBranching): Handle it: create a
10566 FlowBranchingContinuable.
10567 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
10568 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
10569 except that it handles the 'continue' command.
10570 (FlowBranching.UsageVector.MergeOrigins): Rename from
10572 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
10573 except that it overrides AddContinueOrigin.
10574 (FlowBranchingException): Override AddContinueOrigin, similar to
10576 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
10577 Create a new branching around the embedded statement.
10578 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
10579 control flow after the embedded statement.
10580 (Continue.Resolve): Move all error checking to AddContinueOrigin.
10582 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
10583 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
10584 FlowBranchingBreakable.
10585 (FlowBranchingSwitch): Remove.
10588 * statement.cs (Break.Resolve): Simplify. Move responsibility for
10589 error reporting to ...
10590 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
10591 Rename from 'AddBreakVector'. Add new location argument. Return
10592 a bool indicating whether the 'break' crosses an unwind-protect.
10593 (FlowBranchingException.AddBreakOrigin): Add.
10594 (FlowBranchingException.Merge): Propagate 'break's to surrounding
10595 flowbranching after updating with the effects of the 'finally'
10597 (FlowBranchingBreakable): New common base class for
10598 FlowBranchingLoop and FlowBranchingSwitch.
10600 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
10601 embedded statement.
10602 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
10604 2006-05-02 Raja R Harinath <rharinath@novell.com>
10606 * statement.cs (Do.Resolve): If the loop is infinite, set the
10608 (While.Resolve, For.Resolve): Set a barrier after the embedded
10609 statement. There's no direct control flow that goes from the end
10610 of the embedded statement to the end of the loop.
10611 * flowanalysis.cs (FlowBranching.Infinite): Remove.
10612 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
10613 above ensure that the reachability is correctly computed.
10615 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
10616 (UsageVector.MergeBreakOrigins): If the current path is
10617 unreachable, treat it as if all parameters/locals are initialized.
10618 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
10619 infinite loops before merging-in break origins.
10621 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
10622 (Reachability.Reachable): Split part into ...
10623 (Reachability.Unreachable): ... this. Simplify.
10624 (Reachability.IsUnreachable): Use 'Unreachable' instead.
10626 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
10627 (Reachability.SetThrowsSometimes): Likewise.
10628 (FlowBranchingBlock.MergeTopBlock): Don't compare against
10629 TriState.Always, use corresponding property.
10630 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
10631 (Block.Resolve): Likewise. Remove some redundant checks.
10633 2006-05-02 Raja R Harinath <harinath@gmail.com>
10635 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
10636 (Reachability.Meet): Don't bother checking AlwaysThrows --
10637 barrier is always set.
10638 (FlowBranchingBlock.Merge): Likewise.
10640 2006-05-01 Raja R Harinath <harinath@gmail.com>
10642 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
10643 checks for unreachable.
10645 2006-05-01 Marek Safar <marek.safar@seznam.cz>
10648 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
10650 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
10651 whether field is really assigned.
10653 2006-04-30 Raja R Harinath <harinath@gmail.com>
10655 * flowanalysis.cs (Reachability): Make 4-argument constructor
10657 (Reachability.Meet): Rename from 'And'. Remove static variant.
10658 (Reachability.Always): Rename from the highly misleading
10659 'Reachability.Never'.
10660 (FlowBranching.Merge): Update to changes. Mark an impossible
10661 situation with a 'throw'.
10662 (*): Update to changes.
10664 2006-04-29 Raja R Harinath <harinath@gmail.com>
10666 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
10667 Remove 'Undefined'.
10668 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
10669 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
10670 (*): Update to changes.
10671 * statement.cs: Update to changes.
10673 2006-04-28 Marek Safar <marek.safar@seznam.cz>
10676 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
10678 2006-04-28 Raja R Harinath <harinath@gmail.com>
10680 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
10683 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
10684 argument to two arguments: an usage-vector and a bool. Move call
10685 to FlowBranching.Merge () ...
10686 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
10688 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
10689 handling of loop and switch reachability to ...
10690 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
10692 2006-04-27 Raja R Harinath <harinath@gmail.com>
10694 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
10695 handling to FlowBranchingLoop.InLoop.
10696 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
10698 2006-04-26 Marek Safar <marek.safar@seznam.cz>
10701 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
10702 anonymous method is allowed from AnonymousContainer here.
10704 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
10706 2006-04-24 Raja R Harinath <rharinath@novell.com>
10709 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
10711 2006-04-23 Marek Safar <marek.safar@seznam.cz>
10714 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
10715 (DoubleConstant.Reduce): Ditto.
10717 2006-04-23 Raja R Harinath <rharinath@novell.com>
10719 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
10720 Remove 'lvalue_right_side' argument. Move parts to ...
10721 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
10722 (LocalVariable.DoResolveLValue): ... these.
10724 2006-04-21 Raja R Harinath <rharinath@novell.com>
10727 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
10728 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
10729 (LocalVariableReference.DoResolveBase): Use it to implement new
10731 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
10732 (Argument.Resolve): Simplify. Move CS1510 check ...
10733 * ecore.cs (Expression.ResolveLValue): ... here.
10734 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
10735 (PropertyExpr.DoResolveLValue): Likewise.
10736 (FieldExpr.Report_AssignToReadonly): Likewise.
10737 (FieldExpr.DoResolve): Add 'out_access' argument. Use
10738 LValueMemberAccess or LValueMemberOutAccess on instance depending
10740 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
10741 DoResolve as appropriate.
10743 2006-04-20 Raja R Harinath <rharinath@novell.com>
10746 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
10747 implicit conversions on 'out' and 'ref' arguments.
10749 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
10750 improve clarity. Remove dead code.
10753 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
10754 (Catch.Resolve): Resolve VarBlock if it exists.
10756 2006-04-19 Miguel de Icaza <miguel@novell.com>
10758 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
10759 twice, this was some residual code, the enumerator was emitted
10760 properly in the two branche of if later.
10762 2006-04-19 Raja R Harinath <rharinath@novell.com>
10764 * expression.cs (Cast.ResolveLValue): Remove. The result of a
10765 cast is never an lvalue.
10766 (Cast.DoResolve, Cast.ResolveRest): Combine.
10767 (Argument.Emit): Simplify slightly. Move 'Expr is
10768 IMemoryLocation' check ...
10769 (Argument.Resolve): ... here.
10770 (Argument.Error_LValueRequired): Remove. Inline into only user.
10772 Simplifications. Fix cs0191-2.cs
10773 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
10774 CS1649 and CS1651 to ...
10775 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
10776 the actual selection of the error code and message to a lookup
10777 table. Add a dummy return value to simplify callsites.
10778 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
10779 readonly fields of other instances of the same type. Move CS0197
10781 * expression.cs (Argument.Resolve): ... here. Simplify code.
10782 Ensure that ec.InRefOutArgumentResolving is only set during LValue
10783 resolution of an out or ref argument. The code simplification
10784 above uses this invariant.
10786 2006-04-18 Raja R Harinath <rharinath@novell.com>
10788 Possibly fix #77752. Fix cs1690-[4-7].cs.
10789 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
10790 CheckMarshallByRefAccess. Drop parameter.
10791 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
10793 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
10794 InstanceExpression.
10795 * report.cs (AllWarnings): Add CS1690.
10796 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
10797 for ref access too.
10798 (LocalVariableReference.DoResolveBase): Update.
10800 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10802 * class.cs (MethodOrOperator): Moved common parts from method class.
10803 detect obsolete attributes.
10804 (Method.Define): Simplified as it reuses code from base.
10805 (Constructor.ValidAttributeTargets): Fixed issue found during
10807 (Destructor.ValidAttributeTargets): Fixed issue found during
10809 (Operator): Finished refactoring set off by #78020. Operator class is now
10810 ordinary method class.
10812 * anonymous.cs: Updated.
10814 * decl.cs (DeclSpace): Add IsGeneric
10816 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10818 * class.cs (Constructor.Emit): Don't emit the attributes twice.
10820 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10822 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
10823 detect obsolete attributes.
10824 (Method.CreateEmitContext): Moved to MethodOrOperator.
10826 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10829 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
10830 customized exception to make crash detection easier.
10831 (MethodOrOperator): Started to work on new base class for methods and
10833 (Method): Derives from MethodOrOperator.
10834 (Constructor.Emit): Emits its own attributes.
10835 (AbstractPropertyEventMethod.Emit): Ditto.
10836 (Operator): Derives from MethodOrOperator, will refactor fully in extra
10838 (Operator.Emit): It's temporary more tricky than should be.
10840 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
10842 * report.cs (InternalErrorException): Add ctor with inner exception.
10844 2006-04-08 Marek Safar <marek.safar@seznam.cz>
10847 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
10850 2006-04-07 Marek Safar <marek.safar@seznam.cz>
10853 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
10856 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10858 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
10859 attribute is present and Guid not.
10860 (Interface.ApplyAttributeBuilder): Ditto.
10862 * attribute.cs: Add error message.
10864 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10868 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
10869 sources (it's composite) so hold them in extra array as they are used in
10870 Emit phase only. It worked in the previous versions by mistake.
10871 (Attribute.Emit): Emit attribute for more owners when exist.
10873 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
10874 it has now different behaviour.
10876 2006-04-04 Marek Safar <marek.safar@seznam.cz>
10878 * constant.cs (Constant.IsDefaultInitializer): New method.
10880 * class.cs: Updated.
10882 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
10883 re-initialize default values. It saves KBs almost for every assembly.
10884 Thanks Zoltan for the idea.
10885 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
10886 (ArrayCreation.DoResolve): Resolve only once.
10887 (ArrayCreation.Emit): Emit static initializer only when it is faster.
10888 (ArrayCreation.GetAttributableValue): Cope with optimized values.
10890 2006-04-03 Zoltan Varga <vargaz@gmail.com>
10892 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
10895 2006-04-01 Marek Safar <marek.safar@seznam.cz>
10897 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
10898 in an embedded statement too.
10900 2006-04-01 Raja R Harinath <rharinath@novell.com>
10903 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
10905 2006-04-01 Marek Safar <marek.safar@seznam.cz>
10909 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
10912 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
10914 2006-03-31 Marek Safar <marek.safar@seznam.cz>
10916 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
10919 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
10920 LocalTemporary change.
10922 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
10924 (ClassOrStruct.DefineFieldInitializers): Implemented static field
10925 initializers optimization.
10926 (ClassOrStruct.TypeAttr): Moved from modifiers.
10927 (Constructor.CheckBase): Don't crash when static ctor has parameters.
10928 (FieldBase.ResolveInitializer): Resolves initializer.
10929 (FieldBase.HasDefaultInitializer): New property.
10931 * cs-parser.jay: Removed message.
10933 * expression.cs (CompilerGeneratedThis): New specialization.
10935 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
10937 2006-03-28 Marek Safar <marek.safar@seznam.cz>
10939 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
10941 2006-03-27 Marek Safar <marek.safar@seznam.cz>
10943 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
10944 be now EnumConstants only.
10946 2006-03-27 Marek Safar <marek.safar@seznam.cz>
10948 * attribute.cs, driver.cs: Reset more caches.
10950 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10952 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
10954 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10956 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
10957 for easier reuse. Updated all overrides.
10958 (IntegralConstant): New base class for all integral constants.
10959 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
10960 of the constant range, report custom error.
10961 (UIntConstant.Reduce): Fixed uint conversion.
10963 * ecore.cs, literal.cs: Reduce updates.
10965 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10969 * class.cs (Constructor.Define): Removed extra if for default ctors.
10970 A patch from Atsushi Enomoto.
10972 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10974 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
10975 GetAttributableValue.
10977 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
10980 * convert.cs (ImplicitConversionRequired): Error message moved to
10983 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
10984 automatic implicit conversion of an output value.
10985 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
10987 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
10989 (TypeOf.GetAttributableValue): Add extra handling for object type.
10991 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
10992 special error message.
10994 2006-03-25 Marek Safar <marek.safar@seznam.cz>
10996 * class.cs (Constructor.Emit): Don't crash when struct ctor is
10998 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
10999 compatible with MS runtime.
11001 2006-03-23 Marek Safar <marek.safar@seznam.cz>
11003 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
11004 attribute arguments here.
11006 * class.cs (Indexer.Define): The check was moved to attribute class.
11008 2006-03-22 Marek Safar <marek.safar@seznam.cz>
11010 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
11011 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
11014 2006-03-22 Raja R Harinath <rharinath@novell.com>
11016 Support ParameterDefaultValueAttribute in gmcs. Also applied to
11017 mcs to keep code differences small.
11018 * attribute.cs (Attribute.GetParameterDefaultValue): New.
11019 * typemanager.cs (parameter_default_value_attribute_type): New.
11020 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
11023 2006-03-21 Marek Safar <marek.safar@seznam.cz>
11025 * expression.cs (StringConcat.Append): Reverted back to no warning state.
11027 2006-03-21 Marek Safar <marek.safar@seznam.cz>
11029 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
11031 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
11034 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
11036 * doc-bootstrap.cs : fix build.
11038 2006-03-20 Marek Safar <marek.safar@seznam.cz>
11040 * expression.cs (StringConcat.Append): Issue a warning when empty string
11041 is going to append.
11043 2006-03-20 Marek Safar <marek.safar@seznam.cz>
11045 * assign.cs (CompoundAssign.ResolveSource): Removed.
11047 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
11050 * class.cs (TypeContainer.FindMethods): Removed.
11051 (TypeContainer.CheckMemberUsage): Made static.
11053 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
11055 * constant.cs (CheckRange): Removed unused type argument.
11056 (CheckUnsigned): Removed unused type argument.
11058 * cs-parser.jay: Updated after MemberAccess clean up.
11059 Uses Length for empty string test.
11061 * cs-tokenizer.cs: Uses Length for empty string test.
11062 (IsCastToken): Made static.
11063 (is_hex): Made static.
11064 (real_type_suffix): Made static.
11066 * decl.cs (SetupCache): Made static.
11067 (OnGenerateDocComment): Removed unused ds argument.
11069 * delegate.cs (VerifyDelegate): Removed unused argument.
11071 * doc.cs: Uses Length for empty string test.
11073 * driver.cs: Uses Length for empty string test.
11075 * enum.cs (IsValidEnumType): Made static
11077 * expression.cs (EnumLiftUp): Removed unused argument.
11078 (ResolveMethodGroup): Ditto.
11079 (BetterConversion): Ditto.
11080 (GetVarargsTypes): Ditto.
11081 (UpdateIndices): Ditto.
11082 (ValidateInitializers): Ditto.
11083 (MemberAccess.ctor): Ditto.
11084 (GetIndexersForType): Ditto.
11086 * flowanalysis.cs: (MergeFinally): Removed unused argument.
11088 * iterators.cs: Updated after MemberAccess clean up.
11090 * location.cs: Uses Length for empty string test.
11092 * namespace.cs: Uses Length for empty string test.
11094 * report.cs (CheckWarningCode): Made static.
11096 * statement.cs (LabeledStatement): Removed unused argument.
11098 * typemanager.cs (FilterNone): Removed.
11100 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11102 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
11105 * class.cs: Updated.
11107 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11109 * cs-parser.jay.cs: __arglist is not allowed for delegates.
11111 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11115 * expression.cs (VerifyArgumentsCompat): Reverted to double error
11116 reporting, it's more tricky than I thought.
11118 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11122 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
11124 (AnonymousMethod.ImplicitStandardConversionExists): New method.
11125 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
11126 Add more error reporting; Fixed issue with params.
11128 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
11130 * cs-parser.jay: AnonymousMethod requires host container.
11132 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
11134 2006-03-18 Raja R Harinath <harinath@gmail.com>
11136 * class.cs: Change 'TypeContainer ds' constructor argument to
11137 'DeclSpace parent'. Some classes were missed below due to
11138 different naming convention.
11140 * class.cs (MemberCore.Parent): Delete. This makes the
11141 ParentContainer changes below enforceable by the compiler.
11143 Treat pointers to enclosing declaration space as 'DeclSpace', not
11145 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
11146 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
11148 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
11150 (Block.AddThisVariable): Likewise.
11151 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
11152 (AbstractPropertyEventMethod.Emit): Likewise.
11153 (AbstractPropertyEventMethod.EmitMethod): Likewise.
11154 (GetMethod.Define, SetMethod.Define): Likewise.
11155 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
11156 (DelegateMethod.EmitMethod): Likewise.
11158 Fix regression test-partial-13.cs.
11159 Rationalize use of PartialContainer. Ensure that the partial
11160 class semantics can be tied to type-correctness, i.e., any
11161 violation will cause a compile error.
11162 * class.cs, const.cs: Access all fields that belong to class
11163 TypeContainer via ParentContainer. Arguments of EmitContexts and
11164 Resolve()-like functions still use 'Parent'.
11166 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
11167 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
11168 (PropertyMethod.CheckModifiers): Remove unused argument.
11169 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
11172 2006-03-17 Raja R Harinath <harinath@gmail.com>
11174 Make semantics of PartialContainer simpler.
11175 * decl.cs (DeclSpace.IsPartial): Remove.
11176 * class.cs (TypeContainer.IsPartial): Likewise.
11177 (TypeContainer..ctor): Set PartialContainer to point to self.
11178 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
11179 (TypeContainer.FindNestedType): Likewise.
11180 (MemberCore.ParentContainer): Simplify. Remove deprecation.
11182 2006-03-17 Marek Safar <marek.safar@seznam.cz>
11184 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
11186 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11188 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
11191 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11193 * class.cs (Operator.Define): An error for base conversion was not
11194 reported correctly.
11196 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
11198 * iterator.cs : yield break is allowed in try statement which has
11199 catch clauses. Fixed bug #77767.
11201 2006-03-13 Marek Safar <marek.safar@seznam.cz>
11203 A fix for #77593, #77574.
11205 * class.cs (MethodCore.CheckBase): Another if for operator.
11207 2006-03-09 Marek Safar <marek.safar@seznam.cz>
11209 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
11212 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
11213 (DelegateCreation.ImplicitStandardConversionExists): New method for just
11216 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
11219 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
11220 Updated after another emitcontext usage was clean up. It should help us to
11221 synchronize with gmcs easier.
11223 2006-03-04 Marek Safar <marek.safar@seznam.cz>
11227 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
11228 (Event.Define): ditto
11229 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
11231 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
11232 Removed redundant code and set NewSlot for Invoke method too.
11234 * parameter.cs (Parameters.ctor): Add custom, type ctor.
11235 (Parameters.MergeGenerated): New method. Use this method when you merge
11236 compiler generated argument with user arguments.
11238 2006-03-03 Marek Safar <marek.safar@seznam.cz>
11240 * attribute.cs (ResolveAsTypeTerminal): Removed.
11242 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
11243 specialization for predefined types; 30% speed up.
11244 Finally placed obsolete check to right place.
11245 (Expression.ResolveType): Removed.
11247 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
11248 Updated after ResolveType was removed.
11250 * expression.cs (Cast.ctor): Check void cast.
11251 (Binary.ResolveAsTypeTerminal): Is never type.
11252 (Conditional.ResolveAsTypeTerminal): Is never type.
11254 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
11256 2006-03-01 Raja R Harinath <rharinath@novell.com>
11259 * expression.cs (ParameterReference.DoResolveBase): Change return
11261 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
11265 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
11268 * typemanager.cs (GetFullNameSignature): Don't nullref on
11269 protected accessors.
11271 2006-02-27 Marek Safar <marek.safar@seznam.cz>
11273 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
11274 these two separated members to simplify the code.
11275 (Attribute.Resolve): Refactored to use new fields and methods.
11276 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
11277 implemented obsolete attribute checking.
11278 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
11279 implemented obsolete checking again. It look line never ending quest ;-)
11280 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
11282 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
11284 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
11286 *class.cs (Property.Define): Add RegisterProperty call.
11288 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
11289 argument groups (only 2).
11291 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
11292 encoding expression to arguments.
11293 (Expression.ExprClassToResolveFlags): Just turned to property.
11295 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
11296 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
11297 optimized as well as implemented support for zero-length attributes.
11299 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
11300 Add caching of PropertyInfo's.
11302 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11304 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
11305 error multiple times.
11307 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11309 New partial class implementation.
11310 A fix for #77027, #77029, #77403
11312 * attribute.cs (Attributable): Made attributes protected.
11314 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
11315 the replacements of ClassPart and PartialContainer.
11316 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
11317 (TypeContainer.AddInterface): Ditto.
11318 (TypeContainer.AddPartial): The main method for partial classes. It checks
11319 for errors and merges ModFlags and attributes. At the end class is added to
11320 partial_parts list.
11321 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
11323 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
11324 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
11325 from the rest of partial classes.
11326 (TypeContainer.GetClassBases): Simplified.
11327 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
11329 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
11330 (TypeContainer.HasExplicitLayout): Uses Flags now.
11331 (PartialContainer): Removed.
11332 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
11333 (StaticClass): Was merged with Class.
11334 (Class.GetClassBases): class and static class bases are verified here.
11335 (Class.TypeAttr): Added static attributes when class is static.
11336 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
11337 (MemberBase): In some cases we need to call parent container for partial
11338 class. It should be eliminated but it's not easy now.
11340 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
11342 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
11343 partial classed to accumulate class comments.
11344 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
11346 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
11348 * driver.cs (MainDriver): Tree.GetDecl was removed.
11350 * modifiers.cs (Modifiers): Add partial modifier.
11352 * tree.cs (Tree.decl): Removed.
11353 (RootTypes): Started to use this class more often for root types
11356 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11360 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
11361 external interface does not have an attribute.
11363 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11365 Another prerequisites for new partial classs implementation.
11367 * attribute.cs (Attribute.Equal): Implemented.
11368 (Attribute.Emit): Changed as attributes can be applied more than twice.
11369 (Attributes.Emit): Check for duplicate attributes here.
11371 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
11372 as a parameter, clean-up.
11374 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11378 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
11379 contains obsolete attribute check which can in some cases look for base
11380 type of current class which is not initialized yet.
11381 (TypeContainer.BaseType): Replacement of ptype.
11383 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
11385 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11387 First of prerequisites for new partial classs implemention.
11389 * attribute.cs (Attributable): Extended by ResolveContext;
11390 Attributes finally have correct context for resolving in all cases.
11391 (AttachTo): Attribute owner is assigned here.
11393 * codegen.cs (IResolveContext): Introduce new interface to hold
11394 all information needed in resolving phase.
11395 (EmitContext): Implements IResolveContext; more clean-up needed here.
11397 * decl.cs (MemberCore): Implemented IResolveContext.
11399 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
11400 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
11401 parameter.cs, statement.cs, tree.cs, typemanager.cs:
11402 Refactored to use new IResolveContext instead of EmitContext; cleanup
11404 2006-02-06 Miguel de Icaza <miguel@novell.com>
11406 * codegen.cs (EmitScopeInitFromBlock): check here the
11407 capture_context, there is no need to make two calls to the
11410 * anonymous.cs: Add some debugging messages that might help me
11411 track other instances of this problem in the future (the
11412 regression of test 467).
11414 * cs-parser.jay: track the variable block, as we need to initalize
11415 any captured variables declared in this block for the "catch"
11416 portion of the "Try" statement.
11418 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
11419 scope initialization for captured variables.
11421 Also, move the emit for the variables after the block location has
11424 2006-02-06 Marek Safar <marek.safar@seznam.cz>
11426 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
11428 2006-02-02 Miguel de Icaza <miguel@novell.com>
11430 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
11431 commit yesterday, the initialization for the roots is necessary.
11432 What is not necessary is the scope activation.
11434 2006-02-02 Raja R Harinath <rharinath@novell.com>
11436 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
11437 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
11439 (Argument.Resolve): Remove CS0206 checks.
11441 2006-02-01 Miguel de Icaza <miguel@novell.com>
11443 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
11444 scopes for all the roots, the scopes will now be emitted when the
11445 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
11447 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
11448 code. This reduces a lot of existing cruft.
11450 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
11451 that the ScopeInfo is generated as we enter the scope, not at the
11452 time of use, which is what we used to do before.
11454 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
11455 every time a Block is about to be emitted if we have a
11458 2006-02-01 Raja R Harinath <rharinath@novell.com>
11460 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
11462 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
11464 * typemanager.cs (cons_param_array_attribute): Make private.
11465 (Reset): Set it to null.
11466 (InitCoreHelpers): Don't initialize it.
11467 (ConsParamArrayAttribute): New. Initialize it as needed.
11468 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
11470 2006-01-31 Miguel de Icaza <miguel@novell.com>
11472 * expression.cs: There might be errors reported during the
11473 selection of applicable methods. If there are errors, do not
11474 continue execution as it will lead the compiler to crash.
11476 2006-01-30 Miguel de Icaza <miguel@novell.com>
11478 * expression.cs: Member access is not allowed on anonymous
11479 methods. Fixes #77402.
11481 2006-01-30 Raja R Harinath <rharinath@novell.com>
11484 * cs-parser.jay (VariableDeclaration): Don't set
11485 current_array_type to null.
11486 (field_declaration, event_declaration, declaration_statement):
11487 Set it to null here.
11489 2006-01-28 Raja R Harinath <harinath@gmail.com>
11491 * typemanager.cs (GenericParameterPosition): New.
11494 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
11496 * doc.cs : To process "include" elements, first we should create
11497 another list than XmlNodeList, because it could result in node
11498 removal, which could result in that the XmlNodeList gives up
11499 yielding next node.
11501 (Also made code identical to gmcs again.)
11503 2006-01-25 Miguel de Icaza <miguel@novell.com>
11505 * ecore.cs: Introduce an error report that we were not catching
11506 before, if not silent, we must report the error. Gonzalo ran into
11509 2006-01-23 Miguel de Icaza <miguel@novell.com>
11511 A fix for bug: #76957
11513 * iterators.cs (MoveNextMethod.CreateMethodHost): call
11514 ComputeMethodHost before creating the method, this is a new
11517 * anonymous.cs (AnonymousContainer): Now we track all the scopes
11518 that this method references (RegisterScope). The actual scope
11519 where the method is hosted is computed with the ComputeMethodHost
11520 before we create the method.
11522 Moved the Deepest routine here.
11524 (AnonymousContainer.ComputeMethodHost): New routine used to
11525 compute the proper ScopeInfo that will host the anonymous method.
11527 (ScopeInfo): Deal with multiple roots. The problem was that we
11528 did not have a unique root where all ScopeInfos could be hanged
11529 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
11532 Remove AdjustMethodScope which is now computed at the end. Remove
11533 LinkScope which did a partial link, instead link all ScopeInfos
11534 before code generation from the new "LinkScopes" routine.
11536 Simplify all the Add* routines as they no longer need to maintain
11537 the tree, they just need to record that they are using variables
11540 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
11541 routines to produce the forest of ScopeInfo trees.
11543 * class.cs (TypeContainer.AppendMethod): This is just like
11544 AddMethod, but ensures that an interface implementation method
11545 (IEnumerable.XXX) is not inserted at the beginning of the queue of
11546 methods, but at the end.
11548 We use this functionality to ensure that the generated MoveNext
11549 method in the iterator class is resolved/emitted before the
11550 enumerator methods created.
11552 This is required because the MoveNext method computes the right
11553 ScopeInfo for the method. And the other methods will eventually
11554 need to resolve and fetch information computed from the anonymous
11557 2006-01-21 Raja R Harinath <harinath@gmail.com>
11558 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11560 Fix rest of #76995.
11561 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
11562 the 'aliases' hash.
11563 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
11564 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
11566 2006-01-18 Raja R Harinath <rharinath@novell.com>
11568 Fix #76656, cs0231-2.cs.
11569 * cs-parser.jay (formal_parameter_list): Make error case catch
11571 (parenthesized_expression_0): Add CS1026 check.
11572 (invocation_expression): Remove unused { $$ = lexer.Location }.
11574 2006-01-17 Raja R Harinath <rharinath@novell.com>
11577 * cs-parser.jay (statement_expression): Don't list out the
11578 individual statement-expressions. Convert syntax error into
11581 2006-01-16 Raja R Harinath <rharinath@novell.com>
11584 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
11585 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
11586 CheckIntermediateModification.
11587 (FieldExpr.DoResolve): Add new two-argument version that
11588 allows us to resolve the InstanceExpression as an lvalue.
11589 The one-argument variant is now just a wrapper.
11590 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
11591 Resolve the lhs as an lvalue if the it has a value type.
11592 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
11593 from Assign.DoResolve.
11594 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
11595 resolved as an lvalue.
11596 (PropertyExpr.DoResolve): Update.
11597 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
11598 has a value type. Move CS1612 check here from
11599 CheckIntermediateModification.
11600 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
11601 * expression.cs (EmptyExpression.OutAccess): New. Used as the
11602 'right_side' of a ResolveLValue on an 'out' argument.
11603 (EmptyExpression.LValueMemberAccess): New. Used as the
11604 'right_side' of a propagated ResolveLValue on a value type.
11605 (LocalVariableReference.DoResolveBase): Recognize
11606 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
11608 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
11609 EmptyExpression.Null.
11611 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
11613 * typemanager.cs : added IsGenericParameter(). In mcs it always
11615 * doc.cs : for generic parameters, use GenericParameterPosition,
11618 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
11620 * expression.cs: Fix Console.WriteLine ((this = x).foo);
11622 2006-01-12 Miguel de Icaza <miguel@novell.com>
11624 This fixes the problem where we used ldfld instead of ldflda to
11625 load the "THIS" pointer on captured parameters, when THIS is a
11626 value type. See bug #77205.
11628 * iterators.cs (CapturedThisReference.Emit): Pass false to
11629 EmitThis (we do not need the address).
11631 * codegen.cs (EmitThis): it needs to know whether we need the
11632 address of `this' or not. This is used by value types.
11634 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
11635 every other call passes false.
11637 2006-01-12 Raja R Harinath <rharinath@novell.com>
11640 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
11642 * expression.cs (Invocation.OverloadResolve): Update.
11643 (Invocation.DoResolve): Avoid double resolution of invocation.
11645 2006-01-11 Raja R Harinath <rharinath@novell.com>
11648 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
11649 unary negation of floating point types as 0-expr; negation cannot
11650 overflow in floating point types.
11653 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
11654 on operands of 'void' type.
11657 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
11658 and ExclusiveOr for boolean constants too.
11660 2006-01-09 Raja R Harinath <rharinath@novell.com>
11663 * expression.cs (Invocation.OverloadResolve): Replace reflected
11664 override methods with their base virtual methods, rather than
11665 skipping over them.
11666 * typemanager.cs (TypeManager.GetOverride): New.
11668 2006-01-05 Jb Evain <jbevain@gmail.com>
11670 * class.cs (Property.Define, Indexer.Define): do not tag the
11671 properties as SpecialName | RTSpecialName.
11673 2006-01-04 Miguel de Icaza <miguel@novell.com>
11675 * class.cs (MethodCore.IsDuplicateImplementation): This method was
11676 doing a low-level comparission of parameter types. It was lacking
11677 a check for __argslist.
11679 2005-12-30 Miguel de Icaza <miguel@novell.com>
11681 * expression.cs (ParameterReference.DoResolveBase): Allow
11682 reference parameters if they are local to this block.
11684 This allows the ref and out parameters of a delegate to be used in
11685 an anonymous method, for example:
11687 delegate void set (out int x);
11689 set s = delegate (out int x){
11693 This is used by functionality introduced late in the C# language.
11695 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
11696 method that take ref and out parameters.
11698 Fixes #77119 which was a late change in the spec.
11700 2005-12-23 Miguel de Icaza <miguel@novell.com>
11702 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
11703 parent if its the same scope. Fixes #77060.
11705 2005-12-21 Miguel de Icaza <miguel@novell.com>
11707 * driver.cs: Report the case of no source files and no -out:
11710 2005-12-20 Raja R Harinath <rharinath@novell.com>
11713 * expression.cs (ComposedCast.GetSignatureForError): Define.
11715 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11719 * namespace.cs (NamespaceEntry): Add extern_aliases as a
11720 ListDictionary, to contain the ExternAliasEntry entries (in
11721 addition to the NamespaceEntry.aliases hashtable). This field is
11722 shared between the original entry and its doppelganger (bodyless
11724 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
11725 extern_aliases field.
11726 (NamespaceEntry.Lookup): Move the IsImplicit check after the
11727 lookup in extern_aliases.
11729 2005-12-16 Raja R Harinath <rharinath@novell.com>
11732 * class.cs (TypeContainer.Mark_HasEquals): New.
11733 (TypeContainer.Mark_HasGetHashCode): New.
11734 (ClassPart): Override them.
11735 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
11738 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
11739 'parent' argument to the base constructor.
11741 Remove all mention of TypeContainer from decl.cs.
11742 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
11743 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
11744 (DeclSpace.DeclSpace): Likewise.
11745 (DeclSpace.DefineMembers): Remove unused argument.
11746 * cs-parser.jay (pop_current_class): Update to changes. Simplify
11747 debugging check -- we don't care if the debug code throws an
11748 InvalidCastException instead of an InternalErrorException.
11749 * class.cs (TypeContainer.DefineMembers): Update to changes.
11750 (TypeContainer.DoDefineMembers): Likewise.
11751 (TypeContainer.GetMethods): Likewise.
11752 (PropertyMember.Define): Likewise.
11753 (MemberBase.Parent): New property that forwards to
11754 MemberCore.Parent, but ensures that we get a TypeContainer.
11755 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
11756 (RootContext.PopulateTypes): Likewise. Remove special case code
11757 for !RootContext.StdLib: DefineMembers is idempotent.
11759 2005-12-14 Miguel de Icaza <miguel@novell.com>
11761 * convert.cs (ExplicitConversionCore): Check the return value from
11762 ExplicitConversionCore which can return null on failure. Fixes #76914
11764 2005-12-13 Marek Safar <marek.safar@seznam.cz>
11766 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
11768 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
11770 * doc.cs : The search for referenced namespace was insufficient to
11771 get global one as it used to do. Fixed bug #76965.
11773 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
11775 * doc.cs : check name in cref in the last phase that whether it is
11778 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11780 * cs-tokenizer.cs : reverted the latest change: it somehow broke
11783 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11785 * doc.cs : so it turned out that we cannot skip override check for
11786 interface members. Fixed bug #76954.
11788 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11790 * cs-tokenizer.cs : fixed bug #75984:
11791 - #warning and #error should not be handled when the source line
11793 - #line is not checked strictly when the source line is disabled.
11794 - #define and #undef is on the other hand checked strictly at any
11797 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
11799 * cs-tokenizer.cs : missing Location (actually, filename) in one of
11802 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11804 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
11806 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
11807 event initializers.
11808 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
11809 (FieldBase.Initializer): Initializer is now optional.
11810 (EventField.Define): Only event field can have initializer.
11812 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
11814 * const.cs (Const): Reuse initializer.
11816 * cs-parser.jay: Updated after FieldBase changes.
11817 Added current_array_type to simplify array initializers.
11819 * ecore.cs (NullCast.IsDefaultValue): Implemented.
11821 * expression.cs, iterators.cs: Updated.
11823 * namespace.cs (NamespaceEntry): Made UsingFound private.
11825 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11827 * parameterCollection.cs: Obsolete, removed.
11828 * parser.cs: Obsolete, removed.
11830 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11833 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
11835 * enum.cs (Enum.Define): Set obsolete context here.
11837 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11840 - FindDocumentedMember() now expects 1) paramList as null
11841 when "we don't have to check the number of parameters" and
11842 2) Type.EmptyTypes when "there is no arguments".
11843 - Introduced FoundMember struct to hold the exact type which was
11844 used to find the documented member (the above change broke
11845 test-xml-044; it might be better just to use DeclaringType than
11846 what MS does, like this change does, but it depends on usage.)
11848 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11850 * doc.cs : documented member might be from DeclaringType for nested
11851 types. Fixed bug #76782.
11853 2005-12-03 Ben Maurer <bmaurer@ximian.com>
11855 * anonymous.cs: Have the param code handle leaving copies on the
11856 stack etc. Allows anonymous params to take part in the assignment
11857 code (++, +=, etc). Fixes bug #76550
11859 * expression.cs: Handle the prepare_for_load/leave_copy by passing
11860 it down to the anon code.
11862 * iterators.cs: Use dummy var here
11864 * codegen.cs: Handle new vars
11866 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11869 * class.cs (MethodData.Define): Set proper Obsolete context.
11871 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
11873 (FieldExpr.DoResolve): Ditto.
11875 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11878 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
11879 parent is not obsolete.
11881 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
11883 * doc.cs : (FindDocumentedMember) find parameterless members first
11884 and get CS0419 in the early stage. Fixed first case of bug #76727.
11886 2005-11-30 Marek Safar <marek.safar@seznam.cz>
11889 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
11890 no error was reported.
11892 *expression.cs (Binary.DoResolve): left can be null.
11894 2005-11-22 Marek Safar <marek.safar@seznam.cz>
11897 * class.cs (MethodData.Emit): Parameters should be labeled first.
11899 2005-11-21 Marek Safar <marek.safar@seznam.cz>
11902 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
11904 2005-11-18 Marek Safar <marek.safar@seznam.cz>
11906 * attribute.cs (AreParametersCompliant): Moved to Parameter.
11908 * class.cs (MethodCore): Parameter clean up.
11909 (IMethodData): Added ParameterInfo.
11910 (MethodData): Parameter clean up.
11911 (Indexer.Define): Parameter clean up.
11923 * typemanager.cs: Parameter clean up.
11925 * delegate.cs (Define): Get rid of duplicated code.
11927 * expression.cs (ParameterReference): Removed useless parameters
11929 (Invocation): Ditto.
11931 * parameter.cs (ParamsParameter): New class, params specialization.
11932 (ArglistParameter): Attemp to separate arglist.
11933 (Parameter): Refactored to be reusable and faster.
11934 (Parameter.Modifier): Made understandable.
11935 (Parameters): Changed to be used as a class for `this' assembly
11936 parameters. Refactored to use new specialized classes.
11938 * support.cs (ParameterData): Added Types property.
11939 (InternalParameters): Deleted.
11941 2005-08-20 Martin Baulig <martin@ximian.com>
11943 Merging this patch from GMCS to fix #75867.
11945 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11946 scope if we don't already have it.
11948 2005-11-17 Martin Baulig <martin@ximian.com>
11951 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
11952 inherit the scope from our parent. Fixes #76653.
11954 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11956 * doc.cs : the previous patch does not actually fix the bug.
11957 PropertyInfo override check is now implemented and really fixed it.
11958 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
11960 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11962 * doc.cs : apply "override filter" also to properties.
11965 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11967 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
11968 no need to check overrides. For classes, omit those results from
11969 interfaces since they must exist in the class. Fixed bug #76726.
11971 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11973 * typemanager.cs : (GetFullNameSignature) differentiate indexers
11974 with different parameters. Fixed the second problem in #76685.
11976 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11978 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
11979 get expected 'protected' access in CheckValidFamilyAccess()).
11982 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11984 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
11985 Fixed bug #76705. CS1569 was incorrectly commented out.
11987 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
11989 * doc.cs : use Invocation.IsOverride() to do real override check.
11990 * expression.cs : made Invocation.IsOverride() internal.
11992 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
11994 * doc.cs : use TypeManager.FindMembers() instead of (possible)
11995 TypeBuilder.FindMembers() and filter overriden base members out.
11998 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12000 * doc.cs : ref/out parameters are represented as '@' (instead of
12001 '&' in type FullName). Fixed bug #76630 (additionally crefs).
12003 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12005 * doc.cs : when there was no '.' in cref to methods in doc comment,
12006 then parameters were missing in the output. Fixed bug #76691.
12008 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12010 * driver.cs : don't output docs when there is an error.
12013 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12016 Now it should detect indexers. Fixed primary concern in bug #76685.
12017 Fixed CS0419 message to not show the identical member signature in
12020 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12022 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
12023 instead of Type.FindMembers() since it does not handle events.
12026 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
12028 * codegen.cs: Fixed typo (speficied -> specified).
12030 2005-11-11 Marek Safar <marek.safar@seznam.cz>
12033 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
12035 2005-11-11 Marek Safar <marek.safar@seznam.cz>
12037 * attribute.cs: Changed error message.
12039 * cs-tokenizer.cs: One more check.
12041 2005-11-10 Marek Safar <marek.safar@seznam.cz>
12043 * statement.cs (Block.Resolve): Ignore empty statement.
12045 2005-11-10 Marek Safar <marek.safar@seznam.cz>
12047 * report.cs: Made error/warning methods more strict to avoid
12050 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
12051 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
12052 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
12053 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
12055 2005-11-08 Marek Safar <marek.safar@seznam.cz>
12057 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
12058 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
12060 * class.cs (TypeContainer.IsComImport): New property.
12061 (Constructor.Define): Create proper ctor for ComImport types.
12063 * expression.cs (New.CheckComImport): Fixed.
12065 2005-11-07 Miguel de Icaza <miguel@novell.com>
12067 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
12068 that a parameter has been captured does not mean that we do not
12069 have to do the rest of the processing. This fixes the second part
12070 of #76592. If there was another anonymous method capturing
12071 values in the past, the Scope would never be set for the second
12072 method that captured the same parameter.
12074 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
12075 properly manipulate the stack. Second part of fix for #76592.
12077 * expression.cs (New): Add support for invoking "new" on
12078 interfaces that have been flagged with the ComImport attribute and
12079 the CoClass. Fixes #76637
12081 * statement.cs (Try.DoEmit): When a variable is captured, do not
12082 try to emit the vi.LocalBuilder variable as it has been captured.
12083 Create a temporary variable and store the results on the
12084 FieldBuilder. Fixes #76642
12086 2005-11-07 Marek Safar <marek.safar@seznam.cz>
12088 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
12090 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
12092 * expression.cs (Binary.DoResolve): Added && optimalization.
12094 * typemanager.cs (AddUserType): Removed useless argument.
12096 2005-11-04 Marek Safar <marek.safar@seznam.cz>
12098 * statement.cs (Block.variables): Uses ListDictionary.
12100 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12103 * class.cs (PartialContainer.EmitType): Customized to emit
12104 security attributes.
12105 (ClassPart.ApplyAttributeBuilder): Transform security attribute
12106 for partial classes.
12108 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12111 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
12112 access has to be fixed.
12114 * typemanager.cs (IsUnmanagedType): Wrong common field type.
12116 2005-11-01 Marek Safar <marek.safar@seznam.cz>
12119 * ecore.cs (NullCast.Reduce): Implemented.
12121 * expression.cs (ArrayCreation.CheckIndices): Correcly check
12124 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
12126 (Foreach.Resolve): Catch null properly.
12128 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12130 * cs-tokenizer.cs: Warning text fix.
12132 * driver.cs: AllWarningNumbers exposed on public interface.
12134 * report.cs (): Reviewed warning numbers.
12135 (IsValidWarning): Use binary search.
12137 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12139 * driver.cs: Implemeted resource visibility.
12140 (Resources): New class for code sharing between /res: and
12143 2005-10-28 Marek Safar <marek.safar@seznam.cz>
12146 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
12149 * convert (Convert.ImplicitReferenceConversion): NullCast holds
12152 * ecore.cs (NullCast): Child is contant only.
12154 * literal.cs (NullLiteral.Reduce): null can be converted to any
12157 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
12159 * driver.cs: Use Encoding.Default as default code page instead
12162 2005-10-27 Raja R Harinath <rharinath@novell.com>
12165 * expression.cs (Invocation.Error_InvalidArguments): Handle
12166 __arglist parameters.
12167 (Invocation.VerifyArgumentsCompat): Likewise.
12168 * support.cs (ReflectionParameters.GetSignatureForError): Print
12169 __arglist parameters.
12170 (InternalParamters.GetSignatureForError): Likewise.
12171 * parameter.cs (Parameters.GetSignatureForError): Likewise.
12173 2005-10-26 Marek Safar <marek.safar@seznam.cz>
12175 * attribute.cs (GetPropertyValue): Made public.
12177 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
12179 Add new property WrapNonExceptionThrows to handle 2.0 assembly
12181 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
12184 * driver.cs: Reflect method name change.
12186 * statement.cs (Try.Resolve): Warn when try has both general
12187 exception handlers.
12189 * typemanager.cs: runtime_compatibility_attr_type new predefined
12192 2005-10-26 Raja R Harinath <harinath@gmail.com>
12195 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
12196 treat it as an empty parameter list.
12198 2005-10-26 Raja R Harinath <rharinath@novell.com>
12201 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
12202 ResolveAsTypeStep silent.
12203 * statement.cs (Block.AddConstant): Mark block as used.
12204 (Block.ResolveMeta): Avoid piling on error messages
12205 if a constant initializer resolution fails.
12207 2005-10-25 Raja R Harinath <rharinath@novell.com>
12209 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
12211 (NamespaceEntry.VerifyAllUsing): New.
12212 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
12213 behaviour. Delegates actual resolution of alias to ...
12214 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
12215 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
12217 * driver.cs (Driver.MainDriver): Update.
12219 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
12220 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
12222 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
12224 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
12225 RootNamespace.DefineNamespacesForAll.
12227 2005-10-24 Raja R Harinath <harinath@gmail.com>
12229 * typemanager.cs (assemblies, external_aliases, modules)
12230 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
12231 (ComputeNamespaces, GetRootNamespace): Remove extra staging
12232 overhead. Move resposibility ...
12233 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
12234 * driver.cs, attribute.cs, codegen.cs: Update to changes.
12236 2005-10-23 Raja R Harinath <harinath@gmail.com>
12238 * namespace.cs (RootNamespace.all_namespaces): Renamed from
12239 cached_namespaces. Improve usage.
12240 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
12241 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
12242 Move from GlobalRootNamespace and simplify.
12243 (RootNamespace.Global): Make instance variable.
12244 (RootNamespace.RootNamespace): Add "alias name" parameter.
12245 (GlobalRootNamespace): Simplify drastically.
12246 (Namespace.Lookup): Don't use GetNamespace.
12247 * typemanager.cs (GetRootNamespace): Rename from
12248 ComputeNamespaceForAlias.
12249 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
12251 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12253 * anonymous.cs (AnonymousContainer): Don't crash when container
12256 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12258 * expression.cs (Binary.DoResolve): Warn when comparing same
12261 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12264 * expression.cs (Binary.DoResolve): It looks like there are no
12265 convetsion rules in enum context.
12267 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12269 Add support for extern alias qualifiers.
12270 * typemanager.cs: Move some LookupTypeReflection code
12271 to namespace.cs, to have cleaner code. Added some methods
12272 to help us keep track of the extern aliased references.
12273 * driver.cs: Add suport for extern alias assemblies on command
12274 line and check for their warnings/errors. Also keep track of the
12275 extern aliased assemblies.
12276 * namespace.cs: Move the global functionality of Namespace
12277 to GlobalRootNamespace/RootNamespace. Now the global namespace
12278 is GlobalRootNamespace.Globa. Also the code moved from
12279 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
12280 Finally added LocalAliasEntry (AliasEntry before) and
12281 ExternAliasEntry, to handle alias statements.
12282 * cs-parser.jay: Add support in the grammar for extern alias
12284 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
12285 Update callings to Namespace (now in GlobalRootNamespace).
12287 2005-10-18 Raja R Harinath <rharinath@novell.com>
12290 * class.cs (TypeContainer.DefineType): Move updating of
12291 topological sort earlier in the code.
12292 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
12294 2005-10-18 Marek Safar <marek.safar@seznam.cz>
12297 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
12299 * constant.cs (Constant.TryReduce): Moved from Cast class.
12300 (Reduce): Made little bit more OO and fixed missing conversions.
12302 * ecore.cs (Reduce): Implemented.
12303 (Binary.EnumLiftUp): New method to upgrade values to enum values.
12305 * literal.cs (Reduce): Implemented.
12307 * class.cs: Reverted Miguel's wrong commit.
12309 2005-10-14 Miguel de Icaza <miguel@novell.com>
12311 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
12313 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
12315 * cs-parser.jay, expression.cs : CS0214 was missing error location
12316 for constants. Fixed bug #76404.
12318 2005-10-11 Marek Safar <marek.safar@seznam.cz>
12321 * convert.cs (ExplicitConversionCore): Fixed object->enum
12324 2005-10-10 Raja R Harinath <rharinath@novell.com>
12326 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
12327 InstanceExpression.
12328 (PropertyExpr.EmitCall): Likewise.
12329 * expression.cs (Invocation.EmitArguments): Handle case where
12331 (Invocation.EmitCall): Avoid allocating temporary variable if
12332 there are no arguments.
12334 2005-10-07 Raja R Harinath <rharinath@novell.com>
12337 * convert.cs (ImplicitConversionStandard): Move conversion of
12338 void* to arbitrary pointer types ...
12339 (ExplicitConversionStandard): .. here.
12340 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
12341 error to always print typenames.
12343 2005-10-07 Raja R Harinath <rharinath@novell.com>
12345 * convert.cs (GetConversionOperator): Rename from
12346 GetConversionOperators. Move operator selection code from ...
12347 (UserDefinedConversion): ... here.
12349 2005-10-06 Marek Safar <marek.safar@seznam.cz>
12351 * convert.cs (ExplicitConversionCore): Removed duplicate enum
12354 2005-10-05 Marek Safar <marek.safar@seznam.cz>
12356 * assign.cs (Assign.DoResolve): Error method changed.
12358 * cfold.cs (DoConstantNumericPromotions): Error method changed.
12360 * const.cs (ResolveValue): Reset in_transit immediately.
12362 * constant.cs: Error method changed.
12364 * convert.cs: Removed useless location parameter.
12365 (ExplicitNumericConversion): Don't do double enum check.
12366 (ExplicitConversionCore): Renamed from ExplicitConversion.
12367 (ExplicitUnsafe): Extracted from ExplicitConversion.
12368 (ExplicitConversion): Uses for error reporting.
12370 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
12372 (ResolveBoolean): Uses common error method.
12373 (CastToDecimal): Get rid of ec.
12374 (CastFromDecimal): Optimized.
12375 (ConvCast): Get rid of ec.
12377 * enum.cs (ResolveValue): Reset in_transit immediately.
12378 (Emit): Return after first error.
12380 * expression.cs: Convert changes.
12382 * literal.cs: Error method changed.
12384 * statement.cs: Error method changed.
12386 2005-10-03 Raja R Harinath <rharinath@novell.com>
12388 * support.cs (SeekableStreamReader.Position): Don't error out when
12389 the requested position is just beyond the end of the current
12392 2005-09-28 Raja R Harinath <rharinath@novell.com>
12394 * support.cs (SeekableStreamReader): Simplify drastically. Don't
12395 try to keep in sync with the byte count of the underlying Stream.
12396 However, this limits us to a window size of 2048 characters: i.e.,
12397 the maximum lookahead of our lexer/parser can be 2048 characters.
12399 2005-09-28 Marek Safar <marek.safar@seznam.cz>
12402 * driver.cs: Fix compilation files with full root path.
12404 2005-09-25 Miguel de Icaza <miguel@novell.com>
12406 * report.cs (SymbolRelatedToPreviousError): Format the output so
12407 it does not use an open parenthesis that is never closed.
12409 * driver.cs: Follow coding guidelines
12411 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12414 * const.cs (Const.ResolveValue): Check for assigning non-null
12415 value to reference type.
12417 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12419 * anonymous.cs: Implemented ExprClassName.
12421 * assign.cs (Assign.DoResolve): Don't chrash when type is not
12424 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
12427 * class.cs (StaticClass.DefineContainerMembers): Report protected
12430 * codegen.cs: if(ed) PRODUCTION.
12432 * convert.cs (Error_CannotImplicitConversion): Better error
12435 * cs-parser.jay: More error checks.
12437 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
12439 * driver.cs (CSCParseOption): Enabled wrong option check.
12441 * ecore.cs (Expression.ExprClassName): Turned to property.
12442 (MemberExpr.CheckIntermediateModification): For checking boxed
12443 value types modification.
12445 * statement.cs (Fixed.Resolve): Expression type must be
12446 convertible to fixed type.
12447 (CollectionForeach.GetEnumeratorFilter,TryType):
12448 Small refactoring for easier error checking.
12450 2005-09-26 Marek Safar <marek.safar@seznam.cz>
12452 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
12455 * class.cs (GeneratedBaseInitializer): New class for customization
12456 compiler generated initializers.
12457 (MemberBase.DoDefine): Check Obsolete attribute here.
12458 (FieldMember.DoDefine): Ditto.
12460 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
12463 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
12464 (MemberCore.GetObsoleteAttribute): Removed argument.
12465 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
12466 (MemberCore.CheckObsoleteType): New helper.
12470 * statement.cs: Updates after MemberCore changes.
12472 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
12473 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
12475 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
12476 obsolete attribute for compiler construct.
12477 (As.DoResolve): Cache result.
12479 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
12481 2005-09-26 Raja R Harinath <rharinath@novell.com>
12484 * expression.cs (This.VerifyFixed): In a value type T, the type of
12485 'this' is T&, iow, 'this' is either an out or ref parameter. In a
12486 value type R, 'this' is treated as a value parameter.
12488 2005-09-22 Miguel de Icaza <miguel@novell.com>
12490 * statement.cs (Lock): Use the TemporaryVariable class instead of
12491 manually using local variables as those do not work when variables
12494 * ecore.cs: Moved the TemporaryVariable class from being a nested
12495 class inside Foreach to be a public class that can be employed in
12498 2005-09-19 Marek Safar <marek.safar@seznam.cz>
12500 * cs-parser.jay: interface_accessors replaced by
12501 accessor_declarations.
12503 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
12506 * statement.cs (GotoCase.Resolve): Convert null constant to
12508 (SwitchLabel.ResolveAndReduce): Ditto.
12509 (SwitchLabel.NullStringCase): Custom null stamp.
12510 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
12512 typemanager.cs (CSharpSignature): Don't skip first argument
12515 2005-09-18 Miguel de Icaza <miguel@novell.com>
12517 * driver.cs: Set InEmacs based on the environment variable EMACS.
12519 * location.cs (InEmacs): in this mode, do not report column
12520 location as it confuses Emacs.
12522 2005-09-16 Marek Safar <marek.safar@seznam.cz>
12524 * cfold.cs, constant.cs, convert.cs, ecore.cs,
12525 expression.cs, iterators.cs, literal.cs: Store constants and
12528 * class.cs (MemberBase.ShortName): Pass location.
12530 * cs-parser.jay: Some location fixes.
12532 * ecore.cs (Expression.Location): Made virtual.
12534 2005-09-05 Miguel de Icaza <miguel@novell.com>
12536 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
12537 if the underlying types are the same, otherwise we need to produce
12538 code that will do the proper cast.
12540 This was exposed by Marek's constant rewrite which produced
12541 invalid code for the call site:
12543 enum X : long { a }
12544 void Method (X v) {}
12548 This fixes test-49.cs
12550 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12552 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
12553 Type/Object should be allowed as well. Fixed bug #75968.
12555 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12557 * expression.cs : (Binary.DoResolve): when one is enum constant and
12558 another is constant 0, then return enum one *as enum type*.
12561 2005-09-02 Raja R Harinath <rharinath@novell.com>
12563 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
12567 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
12568 flow-branching for LocalVariableReferences in case we were invoked
12569 from a MemberAccess.
12570 * expression.cs (LocalVariableReference.VerifyAssigned): New.
12572 (LocalVariableReference.DoResolveBase): ... this.
12573 (MemberAccess.Resolve): Do the check that was disabled during
12576 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12579 (PartialContainer.Create): check abstract/sealed/static strictly
12580 but abstract/sealed can exist only at one side. Fixed bug #75883.
12582 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
12585 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
12586 specified, don't default to UnmanagedType.I4.
12588 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12590 * expression.cs : conditional operator should check possibly
12591 incorrect assign expression. Fixed bug #75946.
12593 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12595 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
12596 Reverting the change. gmcs is much complex than mcs on this matter.
12598 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12600 * cs-tokenizer.cs : To read another token ahead of the actual
12601 consumption, use new SavedToken and cache token instead of moving
12602 back the stream with SeekableStreamReader (it seemed problematic).
12604 driver.cs : Thus use StreamReader directly.
12605 * support.cs : Thus removed SeekableStreamReader.
12607 2005-08-30 Raja R Harinath <rharinath@novell.com>
12610 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
12611 (ScopeInfo.EmitScopeType): Use it to construct field names from
12612 names of captured locals.
12615 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
12616 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
12617 Pass 'target_type' to BoxedCast. Don't default to 'object'.
12618 (ExplicitConversion): Remove enum cases already handled by
12619 implicit conversion. Move implicit conversion check to the beginning.
12620 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
12621 * expression.cs (ArrayCreation.EmitDynamicInitializers):
12622 Don't treat System.Enum as a struct.
12624 2005-08-30 Jb Evain <jbevain@gmail.com>
12626 * attribute.cs: handles as expression in parameters.
12628 2005-08-30 Raja R Harinath <rharinath@novell.com>
12631 * class.cs (TypeContainer.VerifyClsName): Don't use a
12632 PartialContainer when verifying CLS compliance.
12633 (AbstractPropertyEventMethod): Set Parent here, ...
12634 (PropertyMethod): ... not here.
12636 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
12638 * attribute.cs : escaped attribute name should not be allowed to be
12639 resolved (e.g. @class as classAttribute). Fixed bug #75930.
12641 2005-08-29 Raja R Harinath <rharinath@novell.com>
12644 * convert.cs (ImplicitStandardConversionExists): Allow zero also
12645 when converting a long constant to unsigned long.
12646 * expression.cs (Invocation.OverloadResolve): Add sanity check to
12647 detect where IsApplicable and VerifyArgumentsCompat disagree.
12649 2005-08-29 Raja R Harinath <rharinath@novell.com>
12650 and Carlos Alberto Cortez <carlos@unixmexico.org>
12653 * class.cs (TypeContainer.CanElideInitializer): New helper.
12654 (TypeContainer.EmitFieldInitializers): Use it to determine if we
12655 can safely emitting the initializer of a field.
12657 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12659 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
12660 allowed inside a switch (without loop). Fixed bug #75433.
12662 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
12664 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
12665 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
12667 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12669 * driver.cs : kinda reverting the default encoding changes (not exact
12670 revert since I noticed that "codepage:reset" might not work fine).
12672 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12674 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
12675 Location. Now getter and setter store location correctly.
12676 (errors/cs0111-12.cs now reports the expected location.)
12678 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12680 * driver.cs : Use default encoding on the environment.
12681 Removed (now that) extra parameter for SeekableStreamReader.
12682 * support.cs : (SeekableStreamReader) third .ctor() argument for
12683 StreamReader is not required (always true). preamble size could
12684 be acquired in simpler and safe way.
12686 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
12688 * cs-parser.jay: report CS0642 at warning level 3
12689 and report CS0642 for an if else statement also
12690 fixes bug #74745. Patch by John Luke (and a bit
12692 Removed extra CS0642 warning check for "while",
12694 * statement.cs: In Block.Resolve(), CS0642 check
12695 is reimplemented to check a sequence of an empty
12696 statement and a block.
12698 Both fix bug #66777.
12700 2005-08-24 Marek Safar <marek.safar@seznam.cz>
12702 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
12703 detection until I fix it.
12705 * cs-tokenizer.cs: Changed error message.
12707 * cs-parser.jay: Fixed 2 error locations.
12709 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
12710 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
12713 * enum.cs (GetSignatureForError): Fixed.
12715 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
12719 * typemanager.cs (RegisterProperty): Removed.
12721 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
12723 2005-08-24 Raja R Harinath <rharinath@novell.com>
12726 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
12727 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
12729 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12731 * expression.cs : tiny fix is required for not warning positive ulong.
12734 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12736 * expression.cs : add CS0652 check for constant and integral
12737 expression. Fixed bug #53974.
12739 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12741 * expression.cs : in DoNumericPromotions(), check if there is implicit
12742 conversion overload for string (to check CS0034). Fixed bug #52492.
12744 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12746 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
12748 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12750 * ecore.cs : report location when it is *not* Null.
12752 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12758 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
12759 correctly. Fixed bug #75721.
12761 2005-08-23 Raja R Harinath <rharinath@novell.com>
12763 * support.cs (SeekableStreamReader.Position): Avoid an expensive
12764 loop that performs 'min (pos, char_count)'.
12767 * expression.cs (Unary.ResolveOperator): Don't discard implicit
12768 converted value in Operator.OnesComplement.
12770 2005-08-22 Ben Maurer <bmaurer@ximian.com>
12772 * anonymous.cs: If the anon method is pulled into a helper class,
12773 it needs to be `internal' not `private'. Fixes runtime behavior on
12776 2005-08-20 Martin Baulig <martin@ximian.com>
12778 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
12779 scope if we don't already have it.
12781 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
12782 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
12785 2005-08-17 Marek Safar <marek.safar@seznam.cz>
12788 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
12789 is a partial class.
12791 2005-08-16 Marek Safar <marek.safar@seznam.cz>
12793 The big constants rewrite
12794 Fix #75746, #75685 and more
12795 As a side effect saved 1MB for MWF ;-)
12797 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
12798 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
12799 enum based for corlib compilation.
12801 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
12804 * class.cs (FixedField.Define): Use ResolveAsConstant.
12806 * const.cs (IConstant): Interface constants and enums.
12807 (Const.ResolveValue): New method for constant resolvning.
12808 (ExternalConstant): Constants from imported assemblies.
12810 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
12811 conversion; like enums.
12812 (Constant.ToType): Converts this constant to different type.
12813 (Constant.Increment): Adds 1.
12815 * convert.cs (ImplicitConversionRequired): Simplified.
12817 * cs-parser.jay: Create EnumMember directly.
12819 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
12821 * doc.cs (GenerateEnumDocComment): Removed.
12823 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
12824 (ConvertIntLiteral): Removed.
12825 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
12827 * enum.cs (EnumMember): Implement IConstant.
12828 (Enum.IsValidEnumConstant): Removed.
12829 (Enum.GetNextDefaultValue): Removed.
12830 (Enum.FindMembers): Updated.
12831 (Enum.GenerateDocComment): Iterate enum members.
12833 * expression.cs (Cast.TryReduce): Handle enums correctly.
12834 (New.Constantify): Made public.
12835 (MemberAccess.DoResolve): Removed contant specific if(s).
12837 * literal.cs (NullLiteral): Implement new abstract methods.
12839 * statement.cs (GotoCase.Resolve): Use new constant methods.
12840 (SwitchLabel.ResolveAndReduce): Use new constant methods.
12842 * typemanager.cs (LookupEnum): Removed.
12843 (IsEnumType): Fixed to work with corlib.
12844 (RegisterConstant): Removed.
12845 (LookupConstant): Removed.
12846 (GetConstant): Changed to work with IConstant.
12848 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
12850 * location.cs : Fixed overflown (>255) column number.
12852 2005-08-03 Raja R Harinath <rharinath@novell.com>
12854 First cut of the qualified-alias-member feature.
12855 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
12857 * cs-parser.jay (DOUBLE_COLON): New token.
12858 (namespace_or_type_name): Add rule for recognizing
12859 qualified-alias-members.
12860 (primary_expression): Likewise.
12861 (element_access): Allow QualifiedAliasMember as a possible
12862 type-bearing expression.
12863 (local_variable_type, local_variable_pointer_type): Likewise.
12864 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
12865 aliases in the current and enclosing namespace declarations.
12866 (NamespaceEntry.UsingAlias): Add CS0440 warning.
12867 * decl.cs (MemberName.is_double_colon): New.
12868 (MemberName.MemberName): Add new constructor for alias-member.
12869 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
12870 * expression.cs (QualifiedAliasMember): New expression type.
12872 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12874 * location.cs : it borked when no argument was specified.
12876 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12878 * location.cs : tiny ToString() format fix.
12880 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12882 * statement.cs : oops, it was missing.
12884 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12886 A set of fixes for precise line/column location.
12889 "token" field now holds a file/line "delta", a line number offset
12890 from the segment, and a column number. See also:
12891 http://lists.ximian.com/pipermail/mono-devel-list/2004-
12892 December/009508.html
12893 Removed static IsNull. Use instance IsNull property instead.
12894 * cs-tokenizer.cs :
12895 For some tokens it stores Location. For Identifier it stores
12896 LocatedToken which is a pair of string name and location.
12897 Column numbers are adjusted only at getChar().
12899 Use Location.ToString() for reporting (it now contains column).
12901 Largely modified to use LocatedToken instead of
12902 string (IDENTIFIER), and to acquire Location from some tokens.
12903 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
12904 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
12906 Now MemberName holds Location. DeclSpace.ctor() receives Location
12907 as a parameter. Removed extra parameters to all derived classes.
12908 Replaced Location.IsNull() with instance property.
12909 * assign.cs, expression.cs :
12910 Added .ctor() overload that omits Location.
12912 Added "nameEscaped" flag that indicates the identifier was escaped
12913 in the source file. This fixes bug #57047.
12915 2005-08-02 Marek Safar <marek.safar@seznam.cz>
12917 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
12918 New method, looking for lo-case imported cls type.
12920 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
12923 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
12925 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
12927 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
12928 all_imported_types.
12929 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
12931 Optimized to save 3.5 MB for SWF compilation.
12933 2005-08-01 Marek Safar <marek.safar@seznam.cz>
12935 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
12936 (PartialContainer.Create): Moved logic AddToContainer.
12937 (PartialContainer.MarkForDuplicationCheck): Shares name.
12939 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
12942 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
12944 (Namespace.GetSignatureForError): New method.
12946 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
12947 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
12949 2005-08-01 Raja R Harinath <rharinath@novell.com>
12952 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
12953 member lookup rather than qualifier_type, since qualifier_type can
12956 2005-08-01 Marek Safar <marek.safar@seznam.cz>
12958 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
12961 2005-07-31 Miguel de Icaza <miguel@novell.com>
12963 * statement.cs: Copy the local exception into the exception
12964 captured local. Fixes 75674
12966 2005-07-31 Raja R Harinath <harinath@gmail.com>
12969 * expression.cs (Invocation.OverloadResolve): Don't report error
12970 CS1501 if error CS1502 has been reported.
12971 (New.DoResolve): Delegate CS1501 reporting to
12972 Invocation.OverloadResolve.
12975 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
12976 invariant-meaning-in-block property in an enclosing block if
12979 2005-07-29 Marek Safar <marek.safar@seznam.cz>
12981 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
12982 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
12983 (Switch.CheckSwitch): Just save 50kb for SWF.
12985 2005-07-27 Martin Baulig <martin@ximian.com>
12987 * anonymous.cs (CaptureContext.AddField): Added
12988 `AnonymousContainer am' argument; compute its toplevel scope if
12989 it's not already computed. Fixes #75649.
12991 2005-07-26 Raja R Harinath <rharinath@novell.com>
12994 * class.cs (Constructor.Emit): Reset block to null if the block
12997 2005-07-25 Marek Safar <marek.safar@seznam.cz>
12999 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
13001 2005-07-25 Marek Safar <marek.safar@seznam.cz>
13003 * class.cs (MethodData.Define): Check whether accessor implementing
13004 interface is public.
13006 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
13008 2005-07-22 Marek Safar <marek.safar@seznam.cz>
13011 * namespace.cs (LookupType): Moved same type check to...
13013 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
13014 with the same name.
13016 2005-07-21 Raja R Harinath <rharinath@novell.com>
13018 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
13019 already found a typebuilder.
13020 * class.cs (MethodCore.IsDuplicateImplementation): Compare
13021 MemberNames, not strings.
13023 * const.cs (Error_ExpressionMustBeConst):
13024 Rename from Error_EpressionMustBeConst.
13025 * const.cs, class.cs, statement.cd: Update.
13027 2005-07-21 Marek Safar <marek.safar@seznam.cz>
13031 * const.cs (Const.LookupConstantValue): Report missing contant expression
13033 (Error_EpressionMustBeConstant): Only one error method.
13035 * class.cs, statement.c: Updated.
13037 2005-07-20 Raja R Harinath <rharinath@novell.com>
13039 * statement.cs (Block.Flags): Add back HasVarargs.
13040 (Block.flags): Make protected.
13041 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
13043 * typemanager.cs (types, typecontainers, user_types): Remove.
13044 (UserTypes, TypeContainers): Likewise.
13045 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
13046 (CleanUp, Reset): Update.
13047 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
13048 (GetNestedType): Use Type.GetNestedType.
13049 (CoreLookupType): Take two arguments, the namespace and the
13050 basename of the type. Update to use the Namespace.Lookup
13052 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
13053 (RealMemberLookup): Use IsNestedChildOf instead of playing with
13054 string concatenation and substring matches.
13055 * class.cs, enum.cs, delegate.cs: Update to changes.
13057 2005-07-20 Marek Safar <marek.safar@seznam.cz>
13059 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
13060 Expression and made virtual.
13062 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
13063 (ImplicitStandardConversionExists): Fixed `byte' typo ?
13065 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
13067 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
13070 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
13073 2005-07-18 Marek Safar <marek.safar@seznam.cz>
13076 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
13077 AssemblyCultureAttribute is not used on executable.
13080 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
13082 2005-07-16 Raja R Harinath <rharinath@novell.com>
13085 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
13086 New. Reports CS0252/CS0253.
13087 Mostly taken from preliminary patch by Duncak Mak.
13088 (Binary.DoResolveOperator): Store results of operator lookup.
13089 Use them to detect if we need to warn about unintended reference
13092 2005-07-15 Raja R Harinath <rharinath@novell.com>
13095 * namespace.cs (Namespace.Lookup): Add back location parameter.
13096 (Namespace.LookupType): Add CS0436 report. Add location parameter.
13097 * delegate.cs, ecore.cs, expression.cs: Update to changes.
13099 * codegen.cs (EmitContext.DeclSpace): Make readonly.
13100 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
13101 (Namespace.LookupType): ... this.
13102 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
13104 * typemanager.cs (LookupTypeReflection): Remove buggy code that
13105 purported to handle pointers.
13106 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
13109 2005-07-15 Marek Safar <marek.safar@seznam.cz>
13111 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
13114 2005-07-15 Raja R Harinath <rharinath@novell.com>
13116 * namespace.cs (Namespace.Lookup): Drop location parameter.
13117 (NamespaceEntry.LookupAlias): Remove. Merge into ...
13118 (NamespaceEntry.Lookup): ... this.
13119 (NamespaceEntry.Error_AmbiguousTypeReference):
13120 Move here from DeclSpace.
13121 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
13123 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
13124 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
13125 Move to NamespaceEntry.
13126 * delegate.cs, expression.cs: Update to changes.
13128 2005-07-14 Marek Safar <marek.safar@seznam.cz>
13130 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
13131 CheckAttributeType and refactored.
13132 (Attribute.ResolvePossibleAttributeType): Changed to reuse
13133 ResolveAsTypeTerminal error handling.
13134 (ResolveAsTypeTerminal): Introduced because of global attributes extra
13136 (GetSignatureForError): Print errors in same way.
13139 * codegen.cs: Reflect attribute GetSignatureForError change.
13142 * expression.cs: Add silent parameter to ResolveAsTypeStep.
13144 * namespace.cs (UsingEntry): Refactored to make fields private.
13147 statement.cs: Error_UnexpectedKind has extra parameter.
13149 2005-07-14 Raja R Harinath <rharinath@novell.com>
13151 * ecore.cs (IAlias): Remove.
13152 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
13153 that implement the interface.
13154 * namespace.cs (Namespace): Likewise.
13155 (Namespace.declspaces): Renamed from 'defined_names'.
13156 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
13157 DeclSpace instead of an IAlias.
13158 * tree.cs (Tree.AddDecl): Update.
13160 2005-07-12 Raja R Harinath <rharinath@novell.com>
13162 * statement.cs (Block.Flags); Remove HasVarargs.
13163 (Block.HasVarargs): Move to ToplevelBlock.
13164 (Block.ThisVariable, Block.AddThisVariable): Likewise.
13165 (Block.Variables): Make protected. Initialize variable hashtable
13167 (Block.AddVariable): Update.
13168 (Block.Resolve): Update to changes.
13169 (ToplevelBlock.HasVarargs): New boolean.
13170 (ToplevelBlock.ThisVariable): Move here from Block.
13171 (ToplevelBlock.AddThisVariable): Likewise.
13172 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
13173 * expression.cs (This.ResolveBase): Update to changes.
13174 (ArglistAccess.DoResolve): Likewise.
13176 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13179 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
13181 * class.cs (TypeContainer.VerifyMembers): Distinguish between
13182 not used and not used & assigned.
13183 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
13185 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13188 * expression.cs (Is.DoResolve): null is never provided type.
13190 2005-07-08 Marek Safar <marek.safar@seznam.cz>
13193 * cs-parser.jay: Less strict event error rule to catch more errors.
13195 2005-07-08 Martin Baulig <martin@ximian.com>
13197 Fix test-iter-10.cs - distinguish whether we `yield' in a property
13198 gettter (allowed) or setter (not allowed).
13200 * class.cs (Accessor): Implement IIteratorContainer.
13201 (Accessor.Yields): New public field.
13202 (PropertyBase.PropertyMethod.Define): Handle iterators on a
13203 per-accessor basis.
13206 (get_accessor_declaration, set_accessor_declaration): Set the
13207 `yields' flag on the accessor, not the property.
13208 (property_declaration): Do the iterators check on a per-accessor
13209 basis and not for the whole property.
13211 2005-07-08 Martin Baulig <martin@ximian.com>
13213 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
13214 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
13216 2005-07-07 Marek Safar <marek.safar@seznam.cz>
13219 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
13220 (ExtractSecurityPermissionSet): Cope with self referencing security
13221 attributes properly.
13223 * driver.cs (SetOutputFile): Made public property OutputFile.
13225 2005-07-07 Raja R Harinath <rharinath@novell.com>
13228 * class.cs (TypeContainer.first_nonstatic_field): Rename from
13229 has_nonstatic_fields. Make into a FieldBase pointer.
13230 (TypeContainer.AddField): Add CS0282 check.
13231 (TypeContainer.EmitType): Update.
13233 2005-07-06 Miguel de Icaza <miguel@novell.com>
13235 * cs-tokenizer.cs (consume_identifier): Do not create strings to
13236 compare if they start with __.
13238 2005-07-06 Raja R Harinath <rharinath@novell.com>
13240 * statement.cs (Switch.SwitchGoverningType): Only look at
13241 UserCasts that don't need implicit standard conversions to one of
13242 the allowed switch types (Fixes test-322.cs).
13243 (LocalInfo.Resolve): Re-enable sanity-test.
13245 2005-07-06 Marek Safar <marek.safar@seznam.cz>
13247 * cs-tokenizer.cs (consume_identifier): Detect double undescores
13249 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
13251 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
13253 2005-07-06 Raja R Harinath <rharinath@novell.com>
13256 * ecore.cs (SimpleName.GetSignatureForError): Add.
13257 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
13258 (MemberAccess.GetSignatureForError): Add.
13260 2005-07-05 Marek Safar <marek.safar@seznam.cz>
13262 The big error and warning messages review.
13292 * typemanager.cs: Updated.
13294 * class.cs: (MethodCore.SetYields): Moved here to share.
13295 (PropertyMethod.Define): Moved iterator setup here.
13297 * iterators.cs: Add orig_method to have full access to parent
13300 2005-07-05 Raja R Harinath <rharinath@novell.com>
13302 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
13303 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
13304 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
13305 variable of struct type.
13306 * expression.cs (Unary.ResolveOperator): Update to change.
13307 (Indirection.VerifyFixed): Likewise.
13308 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
13309 (ParameterReference.VerifyFixed): Value parameters are fixed.
13310 (This.VerifyFixed): Treat 'this' as a value parameter.
13311 * statement.cs (LocalInfo.IsFixed): Remove.
13313 2005-07-01 Martin Baulig <martin@ximian.com>
13315 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
13316 `ec.EmitThis ()' to get the correct scope.
13318 2005-07-01 Martin Baulig <martin@ximian.com>
13320 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
13321 instance is a ParameterReference; fixes #75299.
13323 2005-07-01 Martin Baulig <martin@ximian.com>
13325 Reverted Marek's latest patch (r46725):
13326 - it contains structural changes which are neither mentioned in
13327 the ChangeLog nor explained anywhere; for example the additional
13328 argument of EmitContext's and Iterator's .ctor's and the
13329 TypeContainer.DefineMembers() change.
13330 - structural changes like this should go in in seperate patches
13331 and not be hidden in a huge patch which just seems to affect
13332 warnings and errors.
13333 a big and hard to understand patch.
13334 - it breaks iterators and causes regressions, for instance in
13337 2005-06-30 Raja R Harinath <rharinath@novell.com>
13340 * expression.cs (Indexers.map): Remove.
13341 (Indexers.Append): Filter out inaccessible setters and getters.
13342 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
13345 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
13346 Refactored from ...
13347 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
13348 (FieldExpr.Emit, PropertyExpr.Emit): Update.
13349 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
13350 * expression.cs (Invocation.EmitCall): Add CS0120 check.
13352 2005-06-30 Marek Safar <marek.safar@seznam.cz>
13355 * class.cs (FieldBase.GetInitializerExpression): One more field
13358 2005-06-28 Miguel de Icaza <miguel@novell.com>
13360 * pending.cs: Do not define a proxy if the base method is virtual,
13361 it will be picked up by the runtime (bug 75270).
13363 2005-06-08 Martin Baulig <martin@ximian.com>
13365 The big Iterators rewrite :-)
13367 * iterators.cs: Rewrite this to use the anonymous methods framework.
13369 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
13370 before the TypeContainers; see 2test-21.cs.
13373 (TypeContainer.DefineType): Don't create a new EmitContext if we
13374 already have one (this only happens if we're an Iterator).
13375 (TypeContainer.Define): Also call Define() on all our iterators.
13376 (Method.CreateEmitContext): Added support for iterators.
13379 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
13380 (AnonymousContainer.CreateMethodHost): Moved here from
13381 AnonymousMethod and made abstract.
13382 (AnonymousContainer.CreateScopeType): New abstract method.
13383 (AnonymousContainer.IsIterator): New public property.
13384 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
13385 get the ScopeTypeBuilder rather than manually defining it here.
13386 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
13389 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
13390 before RootContext.DefineTypes().
13392 * codegen.cs (EmitContext.RemapToProxy): Removed.
13393 (EmitContext.CurrentAnonymousMethod): Changed type from
13394 AnonymousMethod -> AnonymousContainer.
13395 (EmitContext.ResolveTopBlock): Protect from being called twice.
13396 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
13397 (EmitContext.EmitThis): Removed the iterators hacks; use the
13398 anonymous methods framework for that.
13401 (ToplevelBlock.Container): Make this a property, not a field.
13402 (ToplevelBlock.ReParent): New public method; move the
13403 ToplevelBlock into a new container.
13404 (Foreach.TemporaryVariable): Simplify.
13406 2005-06-05 Martin Baulig <martin@ximian.com>
13408 * statement.cs (LocalInfo.CompilerGenerated): New flag.
13409 (Block.AddTemporaryVariable): New public method; creates a new
13410 `LocalInfo' for a temporary variable.
13411 (Block.EmitMeta): Create the LocalBuilders for all the temporary
13413 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
13414 non-iterator variables.
13416 2005-06-05 Martin Baulig <martin@ximian.com>
13418 * statement.cs (Foreach.TemporaryVariable): Create the
13419 LocalBuilder in the Emit phase and not in Resolve since in some
13420 situations, we don't have an ILGenerator during Resolve; see
13421 2test-19.cs for an example.
13423 2005-06-04 Martin Baulig <martin@ximian.com>
13425 **** Merged r45395 from GCS ****
13427 The big Foreach rewrite - Part II.
13429 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
13430 with `PropertyInfo ienumerator_getcurrent'.
13432 * codegen.cs (VariableStorage): Removed.
13435 (Foreach): Derive from Statement, not ExceptionStatement.
13436 (Foreach.CollectionForeach): New nested class. Moved all the code
13437 dealing with collection foreach here.
13438 (Foreach.ForeachHelperMethods): Removed.
13439 (Foreach.TemporaryVariable): Implement IMemoryLocation.
13441 2005-05-23 Martin Baulig <martin@ximian.com>
13443 * statement.cs (Try.DoResolve): Don't create a `finally' if we
13444 don't need to. Fix #75014.
13446 2005-05-20 Martin Baulig <martin@ximian.com>
13448 Merged r44808 from GMCS.
13450 * class.cs (TypeContainer.CircularDepException): Removed.
13451 (TypeContainer.DefineType): Removed the `InTransit' stuff.
13452 (TypeContainer.CheckRecursiveDefinition): Check for circular class
13453 (CS0146) and interface (CS0529) dependencies here.
13455 2005-06-21 Raja R Harinath <rharinath@novell.com>
13457 * expression.cs (Invocation.EmitCall): Fix initialization
13458 'this_call' to reflect current behaviour. Fix indentation.
13460 * convert.cs (FindMostEncompassedType): Add two trivial special
13461 cases (number_of_types == 0 || number_of_types == 1).
13462 (FindMostEncompasingType): Likewise.
13464 2005-06-17 Raja R Harinath <rharinath@novell.com>
13466 Some cleanups preparing for the fix of #75283.
13467 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
13469 (EventExpr.InstanceResolve): Likewise.
13470 (EventExpr.DoResolve): Remove redundant checks.
13472 2005-06-10 Duncan Mak <duncan@novell.com>
13474 * cs-tokenizer.cs (process_directives): New flag for controlling
13475 the processing of preprocessor directives.
13476 (x_token): After seeing a '#', return Token.NONE instead of going
13477 to handle_preprocessing_directive() when not processing
13478 directives. This avoids unnecessary processing during the token peek in
13483 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
13484 the existing error reporting methods instead of Report.Error.
13486 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
13487 after Raja's rewrite.
13489 2005-06-08 Miguel de Icaza <miguel@novell.com>
13491 * class.cs: Small fix.
13493 2005-06-08 Raja R Harinath <rharinath@novell.com>
13496 * class.cs (GetPartialBases): Fix return value check of
13497 part.GetClassBases.
13499 2005-06-07 Raja R Harinath <rharinath@novell.com>
13501 Ensure that partial classes are registered in their enclosing
13502 namespace. Initial part of fix of #75160.
13503 * tree.cs (Tree.RecordDecl): Add new namespace argument.
13504 Register declspace with namespace here, not in
13505 DeclSpace.RecordDecl.
13506 * cs-parser.jay: Pass namespace to RecordDecl.
13507 * class.cs (PartialContainer.Create): Likewise.
13508 (ClassPart.DefineType): New sanity-check. Throws an exception if
13510 * decl.cs (Declspace.RecordDecl): Remove.
13511 * namespace.cs (NamespaceEntry.DefineName): Remove.
13513 2005-06-06 Marek Safar <marek.safar@seznam.cz>
13515 * rootcontext.cs: Reset TargetExt as well.
13517 2005-06-03 Raja R Harinath <rharinath@novell.com>
13519 * ecore.cs (Expression.Resolve): Emit CS0654 error when
13520 -langversion:ISO-1.
13522 2005-06-02 Raja R Harinath <rharinath@novell.com>
13524 Fix #75080, cs0119.cs.
13525 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
13527 (Expression.Resolve): ... this. Use it. Remove bogus code
13528 allowing ExprClass.Type and ExprClass.Namespace for
13529 ResolveFlags.VariableOrValue.
13530 (Expression.Resolve) [1-argument variant]: Change default resolve
13531 flags based on language version.
13532 (Expression.Error_UnexpectedKind): Use a simple string array
13533 rather than an ArrayList.
13534 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
13535 not ExprClass.Type.
13536 (TypeOfVoid.DoResolve): Likewise.
13537 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
13538 flags argument -- it always has the same value.
13540 2005-05-31 Raja R Harinath <rharinath@novell.com>
13543 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
13544 Use it in the error message.
13545 * assign.cs, expression.cs, statement.cs: Update.
13547 2005-05-30 Raja R Harinath <rharinath@novell.com>
13550 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
13551 the "almostMatchedMember" case too.
13552 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
13553 that failed the accessibility checks to 'almost_match'.
13555 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
13557 * attribute.cs: Use internal MethodBuilder methods to set
13558 ExactSpelling and SetLastError on PInvoke methods, instead
13559 of passing them via charset. Fixes #75060.
13561 2005-05-27 Raja R Harinath <rharinath@novell.com>
13563 * parameter.cs (Parameter): Remove TODO comment.
13564 (Parameter.DefineParameter): Remove Location parameter.
13565 (Parameters.LabelParameters): Likewise.
13566 * class.cs (Constructor.Emit): Update to change.
13567 (MethodData.Emit): Likewise.
13568 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
13569 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
13571 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
13574 Removed Parameters.Location and added Parameter.Location instead.
13575 Removed Location parameter from Emit() and GetSignature().
13582 Modified all related calls.
13584 2005-05-26 Raja R Harinath <rharinath@novell.com>
13586 Improve user-defined conversion handling.
13587 * convert.cs (GetConversionOperators): Rewrite. Return only the
13588 applicable operators.
13589 (AddConversionOperators): New. Helper for GetConversionOperators.
13590 (FindMostEncompassedType, FindMostEncompassingType): Verify that
13591 there is only one most encompassed/encompassing type.
13592 (FindMostSpecificSource, FindMostSpecificTarget): Remove
13593 "applicable operator" handling.
13594 (UserConversion): Move cache here from GetConversionOperators.
13595 Directly cache the chosen operator, rather than the whole
13597 (ExplicitNumericConversion): Fix buggy implementation of Decimal
13598 case. Allow conversion of decimal to sbyte and byte too.
13599 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
13600 New static methods. Used to avoid allocating EmptyExpressions in
13603 2005-05-24 Duncan Mak <duncan@novell.com>
13605 * ecore.cs (CastFromDecimal): New class for casting a decimal to
13606 another class, used in Convert.ExplicitNumericConversion.
13607 (CastToDecimal): New class, similar to above, but casts to
13608 System.Decimal, used in Convert.ImplicitNumericConversion and also
13609 in explicit convesion from double/float to decimal.
13611 * convert.cs (ImplicitNumericConversion): Handle implicit
13612 conversions to System.Decimal.
13613 (ExplicitNumericConversion): handle explicit conversions to
13618 2005-05-20 Miguel de Icaza <miguel@novell.com>
13620 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
13621 know the type at this stage, just break through. Fixes #75008
13623 2005-05-19 Martin Baulig <martin@ximian.com>
13626 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
13627 to disable error reporting.
13629 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
13630 here since we don't want to report an error; see the new test-336.cs.
13632 2005-05-19 Raja R Harinath <rharinath@novell.com>
13634 * statement.cs (ToplevelBlock.GetParameterReference)
13635 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
13636 Move here from class Block.
13637 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
13638 * expression.cs (ParameterReference.DoResolveBase): Likewise.
13640 2005-05-18 Martin Baulig <martin@ximian.com>
13645 (FlowBranching.Reachability): Add non-static public And() and Or()
13647 (FlowBranchingSwitch): New class; do the `break_origins' thing
13648 like in FlowBranchingLoop.
13649 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
13650 reachability, not just locals and parameters.
13651 (FlowBranching.MergeChild): Remove some of the hacks for loop and
13652 switch; MergeBreakOrigins() now takes care of that.
13654 2005-05-18 Martin Baulig <martin@ximian.com>
13656 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13657 a loop and may leave it, reset the barrier; fixes #74974.
13659 2005-05-17 Marek Safar <marek.safar@seznam.cz>
13661 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
13664 * cs-parser.jay: Catch more lexical errors.
13666 * report.cs: Add one more Error method.
13669 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
13671 2005-05-17 Martin Baulig <martin@ximian.com>
13673 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
13676 2005-05-16 Raja R Harinath <rharinath@novell.com>
13678 Fix test-382.cs. Emit values of decimal constants.
13679 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
13681 (TypeContainer.AddField): ... this.
13682 (TypeContainer.EmitFieldInitializers): Allow the list of fields
13683 with initializers to include 'Const's.
13684 (ClassPart.RegisterFieldForInitialization): Forward to
13686 * const.cs (Const.Const): Pass initializer to base class.
13687 (Const.Define): In case of decimal constants, register them for
13688 initialization in a static constructor.
13690 2005-05-14 Martin Baulig <martin@ximian.com>
13692 * statement.cs (Block.Resolve): Correctly handle unreachable code;
13693 do not call ResolveUnreachable() on unreachable statements in
13694 here, see the comment in the source code.
13696 2005-05-13 Raja R Harinath <rharinath@novell.com>
13699 * expression.cs (BinaryResolveOperator): If one of the operands of
13700 an equality comparison is 'null' and the other is a pointer type,
13701 convert the null to a NullPointer.
13702 * convert.cs (ImplicitReferenceConversion): If the expression is a
13703 NullLiteral and the target type is a pointer type, return a
13704 NullPointer instead.
13705 (ImplicitConversionStandard): Likewise.
13707 2005-05-13 Marek Safar <marek.safar@seznam.cz>
13709 * cs-parser.jay: Set readonly context based on special constructs.
13711 * expression.cs (LocalVariableReference.DoResolveBase): Improved
13712 readonly variable error handling.
13714 * rootcontext.cs (EmitCode): Don't verify members when error
13717 * statement.cs (LocalInfo): Add reaodnly context information.
13718 (SetReadOnlyContext, GetReadOnlyContext): New methods.
13720 2005-05-13 Raja R Harinath <rharinath@novell.com>
13722 * statement.cs (Block.Resolve): Revert change below. Modify fix
13723 for #74041 to initialize 'resolved' to false only for explicit
13724 blocks. Fixes #74873.
13726 2005-05-12 Raja R Harinath <harinath@gmail.com>
13729 * typemanager.cs (unmanaged_enclosing_types): New.
13730 (IsUnmanagedType): Avoid infloops by using
13731 'unmanaged_enclosing_types' to talk with recursive invocations.
13733 2005-05-13 Martin Baulig <martin@ximian.com>
13735 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
13736 instance variable, not a local. Fix #74873.
13737 (Block.ResolveUnreachable): Set it to true here.
13739 2005-05-11 Duncan Mak <duncan@novell.com>
13741 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
13742 continuing to process for 'arg'.
13743 (handle_preprocessing_directive): Check the argument of the #endif
13744 directive and report error CS1025 if there are any trailing
13747 According to the C# spec, having even whitespace after the #endif
13748 directive is illegal; however, because we call arg.TrimEnd ()
13749 beforehand, we have the same behavior as csc, allowing whitespace
13750 after the directive.
13754 2005-05-11 Marek Safar <marek.safar@seznam.cz>
13758 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
13759 (Constructor.GetObsoleteAttribute): Implemented correctly.
13761 2005-05-10 Martin Baulig <martin@ximian.com>
13763 * support.cs (ReflectionParameters.ParameterModifier): Use
13764 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
13765 and `ParameterAttributes.In'. Fixes #74884.
13767 2005-05-10 Marek Safar <marek.safar@seznam.cz>
13769 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
13771 * expression.cs (Argument.GetParameterModifier): Turned to property.
13772 (Invocation.Error_InvalidArguments): Add more descriptive errors.
13774 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
13777 2005-05-09 Raja R Harinath <rharinath@novell.com>
13780 * decl.cs (MemberCache.AddMethods): Register override methods,
13781 rather than non-override methods.
13782 * typemanager.cs (RegisterOverride): New.
13783 (IsOverride): Update.
13785 2005-05-09 Marek Safar <marek.safar@seznam.cz>
13789 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
13790 recursive declaration.
13792 * statement.cs (Block.ResolveMeta): Report any error in resolving.
13794 2005-05-06 Marek Safar <marek.safar@seznam.cz>
13796 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
13798 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
13800 2005-05-05 Raja R Harinath <rharinath@novell.com>
13803 * decl.cs (DeclSpace.FamilyAccessible):
13804 Use TypeManager.IsNestedFamilyAccessible.
13806 Fix reopened #64812.
13807 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
13810 2005-05-04 Raja R Harinath <rharinath@novell.com>
13811 Abin Thomas <projectmonokochi@rediffmail.com>
13812 Anoob V E <projectmonokochi@rediffmail.com>
13813 Harilal P R <projectmonokochi@rediffmail.com>
13816 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
13817 allow access to all static members.
13819 2005-05-04 Martin Baulig <martin@ximian.com>
13821 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
13823 2005-05-04 Martin Baulig <martin@ximian.com>
13827 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
13828 section at the end; make things work if `default' is not the last
13831 2005-05-04 Martin Baulig <martin@ximian.com>
13835 * statement.cs (Switch): Replaced the `got_default' field with a
13836 `default_section' one.
13837 (Switch.CheckSwitch): Set `default_section' here.
13838 (Switch.Resolve): If we're a constant switch and the constant is
13839 not found, use the default section.
13841 2005-05-03 Martin Baulig <martin@ximian.com>
13843 * expression.cs (ArrayAccess.EmitGetLength): New public method.
13845 * statement.cs (Foreach.ArrayForeach): New nested class.
13846 (Foreach.TemporaryVariable): New nested class.
13847 (Foreach.EmitArrayForeach): Removed; this is now in the new
13848 ArrayForeach class.
13850 2005-05-03 Raja R Harinath <rharinath@novell.com>
13852 * pending.cs (BaseImplements): Move the #74773 fix here. This is
13854 (VerifyPendingMethods): Revert change below.
13856 * typemanager.cs (IsOverride, RegisterNonOverride): New.
13857 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
13858 that used to trigger warning -28. Remove warning -28.
13859 * expression.cs (Invocation.OverloadResolve): Use
13860 TypeManager.IsOverride to distinguish override methods.
13863 * pending.cs (VerifyPendingMethods): If a base type implements the
13864 requested interface, don't bother checking individual methods of
13865 the base type. As a side-effect, this prevents the creation of
13866 unnecessary proxies.
13868 2005-05-02 Martin Baulig <martin@ximian.com>
13872 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13873 Also `And' the locals if the old vector is null.
13874 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
13875 null; in this case we basically reset all the variables.
13877 2005-05-02 Martin Baulig <martin@ximian.com>
13881 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
13882 Added `FlowBranching branching' argument; always `and' the
13883 variables instead of `or'ing them unless we're an infinite loop.
13885 * statement.cs (While.Resolve): Create a new sibling unless we're
13888 2005-05-02 Martin Baulig <martin@ximian.com>
13892 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
13893 arguments; use it instead of creating a new TopLevelBlock.
13894 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
13895 our ConstructorInitializer.
13898 (TopLevelBlock.TopLevelBranching): New public property.
13899 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
13900 and create our `TopLevelBranching'.
13902 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
13903 anonymous method host, use `block.TopLevelBranching' rather than
13904 creating a new branching.
13906 2005-04-20 Miguel de Icaza <miguel@novell.com>
13908 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
13909 a ScopeInfo, if any of the current children is a child of the new
13910 entry, move those children there.
13912 2005-04-30 Martin Baulig <martin@ximian.com>
13914 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
13915 at the beginning of a SwitchSection. Fix #73335.
13917 2005-04-27 Marek Safar <marek.safar@seznam.cz>
13920 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
13922 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
13923 (FieldExpr.DoResolve): Obsolete members are ignored for field
13926 2005-04-26 Marek Safar <marek.safar@seznam.cz>
13928 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
13929 of arrays detection.
13931 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
13933 (Field.VerifyClsCompliance): Volatile fields are not compliant.
13935 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
13938 2005-04-25 Ben Maurer <bmaurer@ximian.com>
13940 * cs-parser.jay: Use the prefered version of -unsafe in error
13943 2005-04-22 Marek Safar <marek.safar@seznam.cz>
13945 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
13948 2005-04-20 John Luke <john.luke@gmail.com>
13950 * driver.cs: fix typo in error message, --outout to --output
13952 2005-04-20 Marek Safar <marek.safar@seznam.cz>
13954 * codegen.cs (InRefOutArgumentResolving): New field.
13956 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
13957 fields outside contructor.
13959 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
13961 2005-04-19 Miguel de Icaza <miguel@novell.com>
13963 * anonymous.cs (CaptureContext.EmitParameterInstance): The
13964 parameter code was not completed ever, so it was not as up-to-date
13965 as local variables. Must finish it.
13967 The bug fix was to compare the Toplevel of the block, not the
13968 current block. Thanks for Ben for pointing this out.
13970 2005-04-19 Raja R Harinath <rharinath@novell.com>
13972 * decl.cs (AddMethods): Use the declaring type of the problem
13973 method to determine if we want to squash a warning.
13975 2005-04-19 Marek Safar <marek.safar@seznam.cz>
13977 * attribute.cs: Removed debug output.
13979 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
13981 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
13984 2005-04-18 Raja R Harinath <rharinath@novell.com>
13987 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
13988 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
13989 all null comparisons against reference types.
13991 2005-04-18 Marek Safar <marek.safar@seznam.cz>
13994 * class.cs (TypeContainer.CircularDepException) New nested
13996 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
13997 (TypeContainer.DefineType): Removed error, reset InTransit before
13999 (Class.DefineType): Throw exception when is in Transit.
14000 Catch exception and report error.
14001 (Struct.DefineType): Throw exception when is in Transit.
14002 Catch exception and report error.
14003 (Interface.DefineType): Throw exception when is in Transit.
14004 Catch exception and report error.
14006 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
14007 handle nested exception handlers.
14009 * flowanalysis.cs (InTryWithCatch): New method, search for try with
14012 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
14013 InFinally and InCatch storage.
14015 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
14016 (Catch.Resolve): Set and Restore ec.InCatch.
14017 (Try.Resolve): Set and Restore ec.InFinally.
14018 (Try.HasCatch): True when try has catch.
14020 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
14022 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
14023 for the same event member, so exclude such cases from warning 419.
14026 2005-04-16 Miguel de Icaza <miguel@novell.com>
14028 * expression.cs (Binary.ResolveOperator): Apply patch from John
14029 Luke to fix bug 59864: operators &, | and ^ on enumerations
14030 require that the same enum type on both sides.
14032 * driver.cs: Add warnings to old flag usage, this is to assist
14033 people who produce Makefiles and hope that the Makefiles will be
14036 * class.cs (TypeContainer.EmitType): Moved the definition of the
14037 special $PRIVATE$ field from the resolve phase to the Emit phase.
14038 During resolve we do not know if we are a struct with
14039 HasExplicitLayout, we know this only after the attributes for the
14042 Set the FieldOffset to zero on the dummy field that we create for
14043 the class. Fixes 74590.
14045 2005-04-16 Raja R Harinath <rharinath@novell.com>
14048 * ecore.cs (PropertyExpr.resolved): New.
14049 (DoResolve): Use it to handle a case of double resolution here.
14050 Handle a case of identical-name-and-type-name.
14051 * expression.cs (ArrayCreation.CheckIndices): Avoid double
14052 resolution by storing the results of expression resolution back
14053 into the "probes" array.
14055 2005-04-15 Raja R Harinath <rharinath@novell.com>
14057 Fix cs0208-7.cs and cs0208-8.cs.
14058 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
14059 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
14060 error reporting to point out the reason a struct is not unmanaged.
14062 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14064 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
14065 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
14067 2005-04-13 Raja R Harinath <rharinath@novell.com>
14070 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
14071 IdenticalNameAndTypeName here.
14072 (EventExpr.InstanceResolve): Likewise.
14074 2005-04-13 Marek Safar <marek.safar@seznam.cz>
14076 C# 2.0 DefaultCharSetAttribute implementation
14078 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
14079 which allows us to set GlobalNamespace for every resolve.
14080 (Attribute.ResolveArguments): Cut from Resolve.
14081 (Attribute.GetCharSetValue): Returns CharSet named argument.
14082 (Attribute.DefinePInvokeMethod): Gets default charset from
14084 (GlobalAttribute.ResolveAsTypeStep): Override.
14085 (GlobalAttribute.ResolveArguments): Override.
14087 * class.cs (TypeAttr): Is protected.
14089 * codegen.cs (ModuleClass.DefaultCharSet): New member.
14090 (ModuleClass.DefaultCharSetType): New memeber.
14091 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
14093 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
14094 charset from module.
14096 * delegate.cs (TypeAttr): Override.
14097 (Delegate.DefineType): Use this TypeAttr.
14099 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
14100 at very early stage (before types are defined) to resolve model
14101 module attributes. It will probably not work with corlib but it
14104 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
14105 charset from module.
14107 * typemanager.cs (default_charset_type): New type.
14109 2005-04-13 Raja R Harinath <rharinath@novell.com>
14111 * decl.cs (MemberCache.AddMethods): Don't warn if
14112 System.Object.Finalize has buggy MethodAttributes.
14114 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
14117 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14119 * doc.cs : detect ambiguous reference to overloaded members.
14120 Fixed bug #71603. MS 1.1 csc does not detect it.
14122 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14124 * doc.cs : delegates must not be referenced with parameters.
14127 2005-04-12 Miguel de Icaza <miguel@novell.com>
14129 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
14131 2005-04-10 Miguel de Icaza <miguel@novell.com>
14133 * driver.cs (MainDriver): Stop processing if the CLS stage found
14136 (CompilerCallableEntryPoint.InvokeCompiler): Always
14137 reset after execution; Take a TextWriter argument for the
14140 * report.cs: Use the error stream instead of hardcoding stderr.
14142 2005-04-09 Miguel de Icaza <miguel@novell.com>
14144 * class.cs: Reduce code paths to test, too small of an
14145 optimization to make it worth the extra testing. Always perform
14148 2005-04-08 Raja R Harinath <rharinath@novell.com>
14151 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
14152 operators that had errors reported on them.
14154 2005-04-08 Marek Safar <marek.safar@seznam.cz>
14156 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
14158 (Attribute.Resolve): Add named argument type checking.
14160 * class.cs (FixedField.Define): Use IsPrimitiveType
14162 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
14164 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
14165 unsafe parameter types.
14167 * statement.cs (Using.ResolveExpression): Add better error description.
14169 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
14171 2005-04-08 Raja R Harinath <rharinath@novell.com>
14174 * attribute.cs (Attribute.GetAttributeUsage): Resolve
14175 AttributeUsageAttribute in the emitcontext of the attribute class,
14176 not in the emitcontext of the attributable entity it was attached to.
14177 * cs-parser.jay: Use 'current_class', not 'current_container',
14178 when creating a GlobalAttribute.
14180 2005-04-08 Alp Toker <alp@atoker.com>
14182 * pending.cs: The fix to #58413 failed to compile methods implementing
14183 interfaces with/without params modifiers and vice versa, even though
14184 params modifiers aren't part of the signature. Make the modifier check
14185 less strict as in csc.
14187 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
14188 Anoob V E <projectmonokochi@rediffmail.com>
14189 Harilal P R <projectmonokochi@rediffmail.com>
14192 * pending.cs (TypeAndMethods.mods): New. Store the parameter
14193 modifiers of pending methods.
14194 (PendingImplementation.PendingImplementation): Initialize it.
14195 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
14196 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
14197 with ParameterData. Add check for modifiers.
14198 * class.cs (MethodData.Define): Update to changes.
14200 2005-04-07 Raja R Harinath <rharinath@novell.com>
14202 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
14204 2005-04-07 Marek Safar <marek.safar@seznam.cz>
14206 * class.cs (PropertyMethod.Define): Check private accessor in abstract
14209 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
14212 * typemanager.cs: Registered RequiredAttributeAttribute.
14214 2005-04-06 Marek Safar <marek.safar@seznam.cz>
14216 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
14217 Warning CS0169 is back at level 3.
14218 (IMethodData.SetMemberIsUsed): New method.
14220 * decl.cs (IsUsed): New value; moved from FieldBase.Status
14221 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
14223 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
14225 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
14227 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
14230 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
14233 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
14234 to avoid the problems with nested types.
14236 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
14237 Anoob V.E <projectmonokochi@rediffmail.com>
14238 Harilal P.R <projectmonokochi@rediffmail.com>
14239 Raja R Harinath <rharinath@novell.com>
14242 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
14244 * typemanager (GetConstructor): Make public.
14246 2005-04-05 John Luke <john.luke@gmail.com>
14247 Raja R Harinath <rharinath@novell.com>
14250 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
14251 struct too. Return false quicker in a few cases.
14252 (VerifyUnManaged): Use it.
14254 2005-04-05 Raja R Harinath <rharinath@novell.com>
14257 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
14258 not 'unreachable_seen'.
14260 2005-04-04 Marek Safar <marek.safar@seznam.cz>
14262 * attribute.cs (Attribute.GetValue): Removed unused.
14264 * codegen.cs (CodeGen.TrimExt): Removed unused.
14266 * cs-parser.jay (output): Removed unused.
14268 * cs-tokenizer.cs (hex_digits): Removed unused.
14270 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
14272 * expression.cs (Indirection.LoadExprValue): Removed unused.
14273 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
14275 * iterators.cs (Iterator.param_types): Removed unused.
14277 * statement.cs (Goto.block): Removed unused.
14278 (ToplevelBlock.did): Removed unused.
14279 (Switch.ResolveConstantSwitch): Removed unused.
14281 2005-04-01 Ben Maurer <bmaurer@ximian.com>
14283 * rootcontext.cs: Allow mcs to bootstrap with the compilation
14286 2005-04-01 Raja R Harinath <rharinath@novell.com>
14288 Fix #74232 and cs0208-3.cs.
14289 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
14290 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
14291 unmanaged type. Don't use FieldBuilders when 't' is a
14292 TypeBuilder. Use ModFlags and MemberType fields.
14293 * class.cs (MemberBase.member_type): Rename from MemberType.
14294 (MemberBase.MemberType): New property. Determines member_type on
14296 (MemberBase.DoDefine): Don't initialize MemberType here.
14297 (FieldMember.Define): Likewise.
14299 2005-04-01 Marek Safar <marek.safar@seznam.cz>
14302 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
14303 Attributes are emitted there.
14305 2005-04-01 Raja R Harinath <rharinath@novell.com>
14307 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
14308 keyword in 'partial enum' too.
14309 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
14311 Report from Kamil Skalski <nazgul@omega.pl>.
14314 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
14315 have partial containers too.
14317 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
14318 in block' checks to Block.CheckInvariantMeaningInBlock.
14319 * statement.cs (Block.GetKnownVariableInfo): Make private.
14320 (Block.IsVariableUsedInChildBlock): Remove.
14321 (Block.IsVariableUsedInBlock): Likewise.
14322 (Block.CheckInvariantMeaningInBlock): New. Show location of
14323 conflicting declaration.
14324 (Block.AddVariable): Make error messages less long-winded and more
14325 specific. Show location of conflicting declaration.
14326 * parameter.cs (Parameters.Location): New readonly property.
14328 2005-03-31 Raja R Harinath <rharinath@novell.com>
14330 Clean up semantics of invoking ResolveMemberAccess.
14331 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
14332 can have an instance, ensure that we pass in a non-TypeExpression
14333 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
14334 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
14335 argument. Update to changes and simplify.
14336 (FieldExpr.Emitinstance): Remove CS0120 check.
14337 (PropertyExpr.EmitInstance): Likewise.
14338 * expression.cs (Argument.Resolve): Likewise.
14339 (Invocation.DoResolve): Update to changes in semantics of
14340 InstanceExpression.
14342 2005-03-31 Marek Safar <marek.safar@seznam.cz>
14345 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
14348 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
14350 2005-03-31 Raja R Harinath <rharinath@novell.com>
14352 Fix difference in behaviour with commandline invocation.
14353 * driver.cs (Driver.Reset): New.
14354 (CompilerCallableEntryPoint): Call it.
14356 * statement.cs (If.Resolve): Avoid spurious "uninitialized
14357 variable" warnings if the boolean expression failed to resolve.
14359 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
14361 * attribute.cs: Fix the union of several permissions when some of them
14362 are unrestricted (so the result isn't an unrestricted permission set).
14365 2005-03-30 Raja R Harinath <rharinath@novell.com>
14367 * ecore.cs (MemberExpr): New class. Convert from interface
14369 (MemberExpr.ResolveMemberAccess): Refactor and move here from
14370 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
14372 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
14373 (MethodGroupExpr.IsExplicitImpl): Remove.
14374 (Expression.GetFieldFromEvent): Remove.
14375 (SimpleName.MemberStaticCheck): Remove.
14376 (SimpleName.DoSimpleNameResolve): Update to changes.
14377 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
14378 (MemberAccess.IdenticalNameAndTypeName): Remove.
14379 (MemberAccess.error176): Move to MemberExpr.
14380 (MemberAccess.DoResolve): Update to changes.
14381 (BaseAccess.DoResolve): Likewise.
14383 2005-03-30 Marek Safar <marek.safar@seznam.cz>
14385 C# 2.0 Conditional attribute class implementation
14387 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
14388 Analyzes class whether it has attribute which has ConditionalAttribute
14389 and its condition is not defined.
14391 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
14392 (Class.IsExcluded): New method. Search for at least one defined
14393 condition in ConditionalAttribute of attribute class.
14395 2005-03-30 Raja R Harinath <rharinath@novell.com>
14397 * ecore.cs (PropertyExpr): Derive from Expression, not
14398 ExpressionStatement.
14399 (PropertyExpr.EmitStatement): Remove.
14401 2005-03-29 Raja R Harinath <rharinath@novell.com>
14404 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
14405 internal field "value__" of an enum be private. The examples for
14406 "value__" that I found on MSDN all used FieldAttributes.Private.
14408 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
14409 Don't mention IL method attribute names.
14411 Fix #47991. Remove a TODO.
14412 * statement.cs (Block.Toplevel): Make into a field.
14413 (Block.Parameters): Move into ToplevelBlock.
14414 (Block.known_variables): Rename from child_variable_names.
14415 (Block.Block): Remove variants that take Parameters. Initialize
14416 'Toplevel' with the immediately surrounding toplevel block.
14417 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
14418 LocalInfo parameter.
14419 (Block.GetKnownVariableInfo): New.
14420 (Block.IsVariableNameUsedInChildBlock): Update.
14421 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
14422 the block, even though it may not be in scope.
14423 (Block.AddVariable): Remove Parameters parameter. Use
14424 Toplevel.Parameters instead.
14425 (Block.AddConstant): Remove Parameters parameter.
14426 (Block.GetParameterReference): Update to use Toplevel.Parameters.
14427 (Block.IsParamaterReference): Likewise.
14428 (Block.IsLocalParameter): Likewise. Simplify a lot.
14429 (ToplevelBlock.Parameters): New. Moved from Block.
14430 (ToplevelBlock.ToplevelBlock): Update to changes. Always
14431 initialize Parameters to a non-null value.
14432 * cs-parser.jay: Update to changes.
14433 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
14434 simple names that mean different things in the same block. Use
14435 Block.IsVariableNameUsedInBlock.
14437 2005-03-28 Raja R Harinath <rharinath@novell.com>
14439 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
14440 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
14441 GetTypeHandle. It is possible for a reflected type to derive from
14442 a TypeBuilder (e.g., int[] derives from the TypeBuilder
14443 System.Array during mscorlib compilation).
14444 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
14445 contain a method_hash, don't create one either. Don't create a
14446 deep copy of the base cache's method_hash.
14447 (MemberCache.SetupCache): Rename back from DeepCopy.
14448 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
14449 already initialized. If we see an override function, add its
14450 underlying base virtual function to the member_hash too.
14452 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
14454 2005-03-26 Raja R Harinath <harinath@acm.org>
14457 * assign.cs (Assign.DoResolve): When the RHS of an assignment
14458 fails to resolve, ensure that the LHS is still resolved as an
14461 2005-03-25 Raja R Harinath <harinath@acm.org>
14463 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
14465 (Enum.current_ec): Remove.
14466 (Enum.LookupEnumValue): Remove EmitContext argument.
14467 Just uses the one created during DefineType.
14468 (Enum.FindMembers): Update.
14469 * expression.cs (MemberAccess.DoResolve): Update.
14471 2005-03-22 Marek Safar <marek.safar@seznam.cz>
14473 * assign.cs (Assign.DoResolve): Check for CS1717 when
14474 source and target are same (uses Equals).
14476 * expression.cs (LocalVariableReference, ParameterReference,
14477 This): Implemented Equals, GetHashCode.
14479 * statement.cs (Block.GetParameterReference): Removed useless
14482 2005-03-22 Raja R Harinath <rharinath@novell.com>
14485 * statement.cs (Block.AddVariable): Ensure that we skip implicit
14486 blocks before deciding whether the error is cs0136 or cs0128.
14488 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
14489 (using_alias_directive, using_namespace_directive): Pass
14490 MemberName, not an expression to Namespace.UsingAlias and
14492 (MakeName): Use the MemberName of the namespace.
14493 * namespace.cs (Namespace.MemberName): New.
14494 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
14495 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
14497 * decl.cs (MemberName.Name): Make readonly.
14498 (MemberName.FromDotted): New "constructor".
14499 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
14500 (MemberCore.Name): Compute from MemberName on demand.
14501 (MemberCore.SetMemberName): Provide a way to change the
14503 (MemberCore.AddToContainer): Don't take a fullname parameter.
14504 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
14505 fully qualified name of the container to the member name.
14506 (TypeContainer.AddToTypeContainer): Use a fully qualified name
14507 only if the type is a member of the root container.
14508 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
14509 MemberName.Left rather than searching for an embedded ".".
14510 (PartialContainer.CreatePart): Update to changes in RootContext.
14511 (MemberBase.ShortName): Turn into a property. Use
14512 MemberCore.SetMemberName.
14513 (MemberBase.ExplicitInterfaceName): Remove.
14514 (MemberBase.UpdateMemberName): Remove.
14515 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
14516 (PropertyBase.SetMemberName): New override.
14517 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
14518 (Tree.GetDecl): New.
14519 (Tree.AllDecls): Rename from Decls.
14520 * attribute.cs, enum.cs, report.cs: Update to changes.
14521 * driver.cs (MainDriver): Use MemberName.FromDotted on
14522 RootContext.MainClass.
14524 2005-03-21 Marek Safar <marek.safar@seznam.cz>
14526 * class.cs (FixedField.Define): Check for CS1664 and more sanity
14529 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
14531 2005-03-18 Marek Safar <marek.safar@seznam.cz>
14533 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
14534 property accessor modifiers.
14536 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
14537 fixed buffer attribute (CS1716).
14538 (PropertyMethod.HasCustomAccessModifier): When property accessor
14539 has custom modifier.
14541 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
14543 (PropertyExpr.DoResolveLValue): Add CS0272.
14545 2005-03-17 Miguel de Icaza <miguel@novell.com>
14547 * convert.cs: When converting to a pointer, use the proper Conv.U
14548 or Conv.I depending on the source data type.
14550 * cs-tokenizer.cs: Make the size for large decimal constants,
14553 2005-03-17 Martin Baulig <martin@ximian.com>
14555 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
14556 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
14558 2005-03-17 Martin Baulig <martin@ximian.com>
14560 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
14561 to bool so we can return an error condition.
14562 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
14565 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
14567 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
14570 2005-03-16 Raja R Harinath <rharinath@novell.com>
14572 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
14573 Refactor to avoid traversing the list of assemblies, and to avoid
14574 string concatenation.
14575 * typemanager.cs (guid_attr_type): Remove.
14576 (negative_hits, pointers, references): Remove hashes.
14578 (GetConstructedType): New. Uses type_hash to handle constructed
14579 types (arrays, references, pointers).
14580 (GetReferenceType, GetPointerType): Use it.
14581 (GetNestedType): New. Uses type_hash to handle nested types of
14583 (LookupType, LookupTypeDirect): Remove.
14584 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
14585 'types' hash and LookupTypeReflection directly.
14586 (params_string, params_object): Use GetConstructedType.
14587 * namespace.cs (Namespace.cached_types): New. Cache of reflected
14589 (Namespace.Lookup): Use cached_types.
14590 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
14591 provided by old TypeManager.LookupType.
14592 * rootcontext.cs (MakeFQN): Remove.
14593 * decl.cs (DeclSpace.MakeFQN): Likewise.
14594 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
14595 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
14596 TypeManager.GetConstructedType.
14597 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
14599 2005-03-15 Marek Safar <marek.safar@seznam.cz>
14601 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
14604 * cs-parser.jay: Reports CS1527 for any namespace element.
14606 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
14609 * expression.cs (ParameterReference.IsAssigned): Changed error to
14611 (Error_WrongNumArguments): Moved CS0245 detection here.
14613 * statement.cs (Return.Resolve): Add CS1622 report.
14615 2005-03-11 Marek Safar <marek.safar@seznam.cz>
14617 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
14619 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
14621 * attribute.cs expression.cs: Get rid of some allocations.
14623 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
14625 * doc.cs : just eliminate the latest change.
14627 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14629 * doc.cs : commented out the latest change. It breaks xml-030.cs
14631 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14633 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
14634 fail. So invoke CreateType() in FindDocumentedType().
14636 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14638 * cs-tokenizer.cs : added IsKeyword().
14639 * doc.cs : Detect keyword incorrectly used as identifier.
14640 Allow identifiers prefixed by @.
14642 2005-03-10 Marek Safar <marek.safar@seznam.cz>
14644 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
14645 It caused exception in namespace resolving (again!).
14647 * class.cs (Class.ctor): Removed exit.
14648 (PropertyMethod.ctor): ditto.
14650 * codegen.cs (Codegen.Reset): Reset static data.
14651 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
14653 * cs-tokenizer.cs (Cleanup): Removed.
14655 * driver.cs (GetSystemDir): Rewrote to one line command.
14656 It caused problem with unloaded dynamic modules.
14657 (UnixParseOption): Removed Exit.
14658 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
14659 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
14660 Now can be mcs used as library.
14662 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
14665 * location.cs (Reset): Reset static data.
14667 * namespace.cs (Reset): Reset static data.
14669 * report.cs (Report.Reset): Reset static data.
14671 * rootcontext.cs (RootContext.Reset): Reset static data.
14673 * tree.cs (RootTypes.ctor): Use Location.Null
14675 * typemanager.cs (TypeManager.Reset): Reset static data.
14676 (CoreLookupType): Removed Exit.
14677 (TypeHandle.Reset): Reset static data.
14679 2005-03-10 Raja R Harinath <rharinath@novell.com>
14682 * typemanager.cs (ComputeNamespaces): Import namespaces from
14683 referenced modules too.
14685 2005-03-09 Raja R Harinath <rharinath@novell.com>
14687 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
14690 2005-03-09 Raja R Harinath <rharinath@novell.com>
14692 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
14693 enclosing DeclSpace. This ensures that a name-lookup populates
14694 more caches and there are fewer 'TypeExpression's. Carve out
14695 nested type lookup into ...
14696 (LookupNestedTypeInHierarchy): ... this.
14698 2005-03-09 Raja R Harinath <rharinath@novell.com>
14700 Clean up a few partial-class semantics.
14701 Fixes test-357.cs and cs1618-2.cs.
14702 * cs-parser.jay (struct_declaration): Use 'current_class' as
14703 parent of newly-created struct. Remove call to Register ().
14704 Use 'pop_current_class' to complete handing the current struct.
14705 (interface_declaration): Likewise.
14706 (class_declaration): Likewise.
14707 (enum_declaration): Use 'current_class' as parent of newly created
14709 (delegate_declaration): Likewise.
14710 (pop_current_class): New function. This is used to handle closing
14711 up the 'current_class' and 'current_container', and pointing them
14712 to the enclosing class/container.
14713 (CSharpParser): Initialize 'current_class' too.
14714 * decl.cs (MemberCore): Add check for invariant: a partial
14715 container is not a parsed entity, and thus does not enclose any
14717 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
14718 (DeclSpace.BaseTypeExpr): Use it.
14719 (DeclSpace.LookupType): Add check for invariant.
14720 * class.cs (TypeContainer): Add check for invariant: a nested
14721 class should have the same NamespaceEntry as its enclosing class.
14722 (TypeContainer.EmitFieldInitializers): Make virtual.
14723 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
14725 (TypeContainer.Register): Remove.
14726 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
14727 null. Use TypeResolveEmitContext for resolving base types and
14728 interfaces. Move initialization of Parts.TypeBuilder here from
14730 (TypeContainer.DefineNestedTypes): ... here.
14731 (PartialContainer): Take a Namespace not a NamespaceEntry.
14732 (PartialContainer.Create): Don't use Register. Call the
14733 appropriate Add... function directly.
14734 (ClassPart): Take both the PartialContainer and the enclosing
14735 class as constructor arguments.
14736 (ClassPart.EmitFieldInitializers): Override.
14737 (ClassPart.PartFindNestedTypes): Remove.
14738 (FieldBase.GetInitializerExpression): Resolve the initializer
14739 expression in the emit context of the enclosing class.
14740 * tree.cs (RootTypes): Remove Register ().
14742 2005-03-08 Marek Safar <marek.safar@seznam.cz>
14744 * cs-parser.jay: Removed CS0134.
14746 * driver.cs: Removed CS1901.
14748 * expression.cs (SizeOf.DoResolve): Don't report CS0233
14749 for predefined types.
14751 2005-03-07 Duncan Mak <duncan@novell.com>
14753 * codegen.cs (Save): Catch UnauthorizedAccessException as
14754 well. Fixes bug #73454.
14756 2005-03-07 Marek Safar <marek.safar@seznam.cz>
14758 * cs-tokenizer.cs (xtoken): Add CS1035.
14760 * class.cs (MethodData.Define): Add CS0683.
14761 (FieldMember.ctor): Add CS0681.
14763 2005-03-07 Raja R Harinath <rharinath@novell.com>
14765 * ecore.cs (SimpleName.DoResolve): Rename from
14766 SimpleName.DoResolveAllowStatic.
14767 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
14768 Pass 'intermediate' flag to MemberStaticCheck.
14769 (SimpleName.MemberStaticCheck): Skip "static check" only in case
14770 of "intermediate" lookups via MemberAccess.
14771 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
14772 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
14774 2005-03-07 Raja R Harinath <rharinath@novell.com>
14777 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
14778 slipped in because of variable names that are identical to a
14779 builtin type's BCL equivalent ('string String;', 'int Int32;').
14780 (PropertyExpr.EmitInstance): Likewise.
14782 2005-03-04 Marek Safar <marek.safar@seznam.cz>
14784 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
14786 * report.cs (warning_ignore_table): Made public.
14788 2005-03-04 Raja R Harinath <rharinath@novell.com>
14791 * class.cs (MethodData.Emit): Pass 'container' to
14792 container.GetObsoleteAttribute instead of 'container.Parent'.
14794 2005-03-03 Marek Safar <marek.safar@seznam.cz>
14796 * cs-parser.jay: Add 1534 error test.
14798 * iterators.cs (Yield.CheckContext): Add error 1629.
14799 (Iterator.ctor): Save unsafe modifier.
14800 (MoveNextMethod.DoEmit): Restore unsafe context.
14802 * namespace.cs (UsingAlias): Better error message.
14804 2005-03-03 Dan Winship <danw@novell.com>
14806 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
14807 the warning message [#73219]
14809 2005-03-03 Raja R Harinath <rharinath@novell.com>
14811 Fix compile with MCS 1.0.0.0.
14812 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
14813 w_restore to not depend on string constant folding.
14815 2005-03-03 Raja R Harinath <rharinath@novell.com>
14817 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
14818 CS0246 check to users who passed 'silent = false'.
14819 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
14821 (SimpleName.SimpleNameResolve): Update.
14822 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
14823 (MemberAccess.IdenticalNameAndTypeName): Update.
14824 * doc.cs (FindDocumentedTypeNonArray): Update.
14826 2005-03-03 Raja R Harinath <rharinath@novell.com>
14828 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
14829 * parameters.cs (ComputeAndDefineParameters): Remove.
14830 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
14831 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
14832 Use GetParameterInfo.
14834 2005-03-02 Marek Safar <marek.safar@seznam.cz>
14836 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
14838 2005-03-02 Raja R Harinath <rharinath@novell.com>
14840 Unify DeclSpace.LookupType and DeclSpace.FindType.
14841 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
14842 is in charge of defining nested types on demand.
14843 (DeclSpace.LookupType): Use it when the current_type is a
14844 TypeBuilder. Use LookupTypeDirect for reflected types.
14845 (DeclSpace.FindType): Remove.
14846 (DeclSpace.LookupInterfaceOrClass): Likewise.
14847 (DeclSpace.DefineTypeAndParents): Likewise.
14848 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
14849 DeclSpace.LookupType.
14850 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
14851 * typemanager.cs (LookupType): Simplify.
14852 (AddUserType): Remove type from negative_hits.
14853 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
14854 * class.cs (TypeContainer.FindMembers): Move handling of nested
14856 (TypeContainer.FindMembers_NestedTypes): ... here.
14857 (TypeContainer.FindNestedType): Implement override.
14858 (ClassPart.FindNestedType): Delegate to PartialContainer.
14859 (ClassPart.PartFindNestedType): Looks up the nested types of the
14862 2005-03-02 Martin Baulig <martin@ximian.com>
14864 * class.cs (TypeContainer.DoDefineMembers): We also need a default
14865 static constructor in static classes.
14867 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
14869 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
14870 sizeParamIndex is not specified.
14872 2005-03-01 Marek Safar <marek.safar@seznam.cz>
14875 * report.cs (WarningMessage.IsEnabled): Missing null check.
14877 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14879 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
14880 in the fields and not in the properties.
14882 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
14884 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
14887 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14889 * attribute.cs: Small refactoring (improved robustness).
14890 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
14891 (ValidateGuid): Removed.
14892 (Resolve): Removed referenced to above mentioned.
14893 (GetAttributeUsage): Made private and changed to work without
14895 (GetIndexerAttributeValue): Don't crash.
14896 (GetConditionalAttributeValue): Ditto.
14897 (GetClsCompliantAttributeValue): Ditto.
14898 (ExtractSecurityPermissionSet): All attributes exceptions are
14900 (GetPropertyValue): New helper.
14901 (GetMethodImplOptions): New method.
14902 (DefinePInvokeMethod): Reuse common code. Implemented handling of
14903 some missing properties.
14905 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
14906 (Method.ApplyAttributeBuilder): Updated.
14908 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
14911 2005-02-28 Raja R Harinath <rharinath@novell.com>
14914 * report.cs (Report.SymbolRelatedToPreviousError): Handle
14915 non-simple types (array, pointer, reference).
14917 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14919 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
14921 * class.cs (MethodCore.IsDuplicateImplementation): Special error
14923 (Method.CheckBase): Catch wrong destructor here.
14924 (MethodData.Define): Add errors 550, 668.
14926 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
14928 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
14930 * pending.cs (VerifyPendingMethods): Add error 551.
14932 * typemanager.cs (CSharpName): Next error report helper.
14934 2005-02-25 Marek Safar <marek.safar@seznam.cz>
14936 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
14937 attributes. Removed useless attribute double check.
14938 It saves almost 2MBs for corlib.
14940 2005-02-25 Raja R Harinath <rharinath@novell.com>
14943 * statement.cs (ExpressionStatement.Resolve): Make robust to being
14944 called twice in case of error.
14946 2005-02-23 Chris Toshok <toshok@ximian.com>
14948 Fix compiler portions of #72827.
14949 * statement.cs (Block.Emit): call Begin/EndScope on the
14950 EmitContext instead of the ILGenerator.
14952 * codegen.cs (EmitContext.BeginScope): new method, call
14953 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
14955 (EmitContext.BeginScope): same, but EndScope and CloseScope
14957 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
14958 offset and call the superclass's OpenScope(int) with it.
14959 (SymbolWriter.CloseScope): get the current il
14960 offset and call superclass's CloseScope(int) with it.
14962 2005-02-23 Marek Safar <marek.safar@seznam.cz>
14964 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
14965 CS1677 for out and ref as well.
14967 * class.cs (Method.Define): Add error CS1599 detection.
14969 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
14971 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
14973 * delegate.cs (Delegate.Define): Add error CS1599 detection.
14975 * support.cs.cs (ModifierDesc): New helper method.
14977 2005-02-23 Raja R Harinath <rharinath@novell.com>
14978 Abin Thomas <projectmonokochi@rediffmail.com>
14979 Anoob V E <projectmonokochi@rediffmail.com>
14980 Harilal P R <projectmonokochi@rediffmail.com>
14982 Fix #57851, #72718.
14983 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
14984 MemberLookup (used for error reporting) actually returns a result.
14985 Fix error report number (122, not 112).
14987 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
14988 Anoob V E <projectmonokochi@rediffmail.com>
14989 Harilal P R <projectmonokochi@rediffmail.com>
14992 * pending.cs (PendingImplementation.GetAbstractMethods):
14993 Find NonPublic members too.
14995 2005-02-22 Marek Safar <marek.safar@seznam.cz>
14997 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
15000 * class.cs (MethodCore.CheckMethodAgainstBase):
15001 Add error 239 report.
15003 2005-02-21 Raja R Harinath <rharinath@novell.com>
15006 * expression.cs (Invocation.IsApplicable): Make public.
15007 (Invocation.IsParamsMethodApplicable): Likewise.
15008 * delegate.cs (Delegate.VerifyApplicability): Don't use
15009 Invocation.VerifyArgumentCompat for parameter applicability
15010 testing. Use Invocation.IsApplicable and
15011 Invocation.IsParamsMethodApplicable.
15013 2005-02-21 Marek Safar <marek.safar@seznam.cz>
15015 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
15017 * class.cs (Operator.Define): Add error 217 report.
15019 2005-02-21 Raja R Harinath <rharinath@novell.com>
15021 * namespace.cs (UsingEntry.Resolve): Undo change below.
15023 2005-02-21 Raja R Harinath <rharinath@novell.com>
15026 * ecore.cs (Expression.MemberLookupFailed): Add argument to
15027 disable the error message when the extended MemberLookup also
15029 (Expression.MemberLookupFinal): Update.
15030 (SimpleName.DoSimpleNameResolve): Update.
15031 * expression.cs (MemberAccess.ResolveNamespaceOrType):
15032 Don't use MemberLookupFinal.
15033 (New.DoResolve): Update.
15034 (BaseAccess.CommonResolve): Update.
15036 2005-02-21 Raja R Harinath <rharinath@novell.com>
15039 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
15040 occured previously, don't resolve again.
15042 2005-02-21 Marek Safar <marek.safar@seznam.cz>
15045 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
15046 argument. Call ResolveAttributeUsage for unresolved.
15047 when types doesn't match ctor arguments.
15049 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
15050 for nested attribute classes.
15051 (Class.attribute_usage): Removed.
15052 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
15053 for attribute class.
15055 * ecore.cs (IsAttribute): Removed.
15057 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
15059 * rootcontext.cs (RegisterAttribute): Removed, attributes are
15061 (attribute_types): Removed.
15062 (EmitCode): Global attributes are emited as the latest.
15064 2005-02-18 Marek Safar <marek.safar@seznam.cz>
15066 * class.cs (EmitFieldInitializers): Don't emit field initializer
15067 for default values when optimilization is on.
15069 * constant.cs (Constant.IsDefaultValue): New property.
15071 * driver.cs: Add /optimize handling.
15075 * literal.cs: Implement new IsDefaultValue property.
15077 * rootcontext.cs (Optimize): New field, holds /optimize option.
15079 2005-02-18 Raja R Harinath <rharinath@novell.com>
15081 Fix crasher in re-opened #72347.
15082 * namespace.cs (Namespace.Lookup): Return null if
15083 DeclSpace.DefineType returns null.
15086 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
15088 2005-02-18 Raja R Harinath <rharinath@novell.com>
15090 Fix remainder of #63202. Change semantics of DoResolveLValue: it
15091 now returns null if it cannot resolve to an lvalue.
15092 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
15093 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
15094 returned null. Remove check for SimpleName.
15095 (EventExpr.DoResolveLValue): New.
15096 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
15097 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
15099 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
15100 avoid CS0131 error.
15101 (Unary.ResolveOperator): Move CS0211 check ...
15102 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
15104 (Unary.DoResolveLValue): Simplify.
15105 (AddressOf.DoResolveLValue): New.
15106 (ArrayAccess.DoResolveLValue): New.
15108 2005-02-16 Marek Safar <marek.safar@seznam.cz>
15110 * attribute.cs (Attribute.Resolve): Add arguments casting for
15111 when types doesn't match ctor arguments.
15113 2005-02-16 Raja R Harinath <rharinath@novell.com>
15115 Fix parts of #63202.
15116 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
15117 lookup of operator in base type. Ensure that all checks happen
15118 when the operator resolves to an "op_..." method.
15120 2005-02-15 Raja R Harinath <rharinath@novell.com>
15123 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
15124 'ignore_cs0104' parameter. Pass it to ...
15125 (NamespaceEntry.Lookup): ... this.
15126 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
15127 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
15128 (TypeLookupExpression.DoResolveAsTypeStep): Update.
15129 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
15130 Update. Request that cs0104 errors be ignored.
15131 (ComposedCast.ResolveAsTypeStep): Update.
15133 2005-02-14 Raja R Harinath <rharinath@novell.com>
15136 * expression.cs (Invocation.BetterFunction): Remove support for
15137 comparing virtual functions and their overrides.
15138 (Invocation.IsOverride): New.
15139 (Invocation.OverloadResolve): Don't consider 'override' functions
15140 during candidate selection. Store them in a lookaside list.
15141 If the selected method is a 'virtual' function, use the list to
15142 find any overrides that are closer to the LHS type.
15144 2005-02-14 Marek Safar <marek.safar@seznam.cz>
15146 * expression.cs (New.DoResolve): Add complex core type reduction.
15147 (New.Constantify): Converts complex core type syntax like 'new int ()'
15148 to simple constant.
15150 2005-02-14 Raja R Harinath <rharinath@novell.com>
15152 * decl.cs (EntryType.EntryType): New constructor to create an
15153 updated copy of a cache entry.
15154 (MemberCache.AddMethods): Use it.
15155 (MemberCache.ClearDeclaredOnly): Remove.
15156 (MemberCache.MemberCache): Update.
15158 2005-02-11 Miguel de Icaza <miguel@novell.com>
15160 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
15161 variable. This one is represents the actual low-level declaration
15162 of the method, as opposed to the semantic level `IsStatic'.
15164 An anonymous method which is hosted into a static method might be
15165 actually an instance method. IsStatic would reflect the
15166 container, while MethodIsStatic represents the actual code
15169 * expression.cs (ParameterReference): Use the new MethodIsStatic
15170 instead of IsStatic.
15172 * anonymous.cs (AnonymousMethod.Compatible): Pass the
15173 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
15174 set on the current EmitContext.
15176 * expression.cs (Cast): Overload DoResolveLValue so we can pass
15177 resolve our casted expression as an LValue. This triggers the
15178 proper LValue processing that is later required by Assign.
15182 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
15184 2005-02-11 Marek Safar <marek.safar@seznam.cz>
15186 C# 2.0 Fixed buffer implementation
15188 * anonymous.cs: Update after RegisterHelperClass renaming.
15190 * attribute.cs (AttributeTester.fixed_buffer_cache):
15191 Cache of external fixed buffers.
15192 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
15193 implementation if field is fixed buffer else null.
15196 (TypeContainer.AddField): Accept FieldMember instead of Field.
15197 (FieldBase.IsFieldClsCompliant): Extracted code from
15198 VerifyClsCompliance descendant customization.
15199 (FixedField): New class handles fixed buffer fields.
15200 (FixedFieldExternal): Keeps information about imported fixed
15202 (IFixedField): Make access to internal or external fixed buffer
15205 * cs-parser.jay: Add fixed buffer parsing.
15207 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
15210 * expression.cs (Indirection): Extended implementation to accept
15211 fixed buffer field.
15212 (PointerArithmetic.Emit): Get element from fixed buffer as well.
15213 (ElementAccess.MakePointerAccess): Get type as parameter.
15214 (DoResolve): Add fixed buffer field expression conversion.
15215 (DoResolveLValue): Ditto.
15216 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
15217 (ArrayPtr): Derives from FixedBufferPtr.
15218 (ArrayPtr.Emit): Add extra emit for array elements.
15220 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
15222 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
15223 for compiler generated types.
15224 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
15226 * statement.cs (Fixed): Refactored to be easier add fixed buffer
15227 and consume less memory.
15228 (Fixed.Resolve): Add fixed buffer case.
15230 * typemanager.cs (compiler_generated_attr_ctor,
15231 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
15232 (HasElementType): Add our own implementation to work on every
15235 2005-02-11 Miguel de Icaza <miguel@novell.com>
15237 * anonymous.cs (CaptureContext): Track whether `this' has been
15240 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
15241 only captured `this' if it was implicitly done (instance
15242 methods/variables were used).
15244 * codegen.cs (EmitContext.CaptureThis): New method to flag that
15245 `this' must be captured.
15247 2005-01-30 Miguel de Icaza <miguel@novell.com>
15249 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
15250 is null it means that there has been no need to capture anything,
15251 so we just create a sibling.
15253 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
15255 Just a partial fix. The other half is fairly elusive.
15257 2005-02-10 Raja R Harinath <rharinath@novell.com>
15259 Fix #52586, cs0121-4.cs.
15260 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
15261 and return a hashtable.
15262 (MemberCache.ClearDeclaredOnly): New.
15263 (MemberCache.MemberCache): Update to change. Make a deep copy of
15264 the method_hash of a base type too.
15265 (MemberCache.AddMethods): Adapt to having a deep copy of the base
15266 type methods. Overwrite entries with the same MethodHandle so
15267 that the ReflectedType is correct. The process leaves in base
15268 virtual functions and their overrides as distinct entries.
15269 (CacheEntry): Now a class instead of a struct. It shouldn't alter
15270 matters since it was boxed in a ArrayList before.
15271 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
15273 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
15274 case of a virtual function and its override (choose the overload
15276 (Invocation.OverloadResolve): Avoid 'override' members during
15277 'applicable_type' calculation.
15279 2005-02-09 Raja R Harinath <rharinath@novell.com>
15281 Combine two near-redundant caches.
15282 * typemanager.cs (method_params): Rename from method_internal_params.
15283 (TypeManager.GetParameterData): New. Replace
15284 Invocation.GetParameterData.
15285 (TypeManager.LookupParametersByBuilder): Remove.
15286 * expression.cs (Invocation.method_parameter_cache): Remove.
15287 (Invocation.GetParameterData): Remove.
15289 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
15292 2005-02-08 Raja R Harinath <rharinath@novell.com>
15295 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
15296 TypeManager.multicast_delegate_type is null, resolve it by looking
15297 up "System.MulticastDelegate".
15298 * rootcontext.cs (RootContext.ResolveCore): Simplify.
15300 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
15301 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
15302 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
15305 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
15306 (LabeledStatement.AddReference): New. Set 'referenced'.
15307 (Goto.Resolve): Use it.
15309 2005-02-05 John Luke <john.luke@gmail.com>
15311 * driver.cs: remove duplicate -doc line in Usage ()
15313 2005-02-04 Raja R Harinath <rharinath@novell.com>
15315 * location.cs (Location.AddFile): Fix CS2002 error report.
15317 2005-02-02 Martin Baulig <martin@ximian.com>
15319 * delegate.cs (Delegate.DefineType): Report an internal error if
15320 TypeManager.multicast_delegate_type is null. See bug #72015 for
15323 2005-02-02 Raja R Harinath <rharinath@novell.com>
15325 Fix a crasher in a variant of #31984.
15326 * const.cs (Constant.CheckBase): New override that defers the
15327 new-or-override check in case the base type hasn't been populated
15329 (Constant.Define): Ensure the new-or-override check is performed.
15331 2005-02-01 Duncan Mak <duncan@ximian.com>
15333 * const.cs (LookupConstantValue): Check that `ce' is not null
15334 before calling GetValue ().
15336 2005-02-01 Raja R Harinath <rharinath@novell.com>
15338 Fix test-334.cs (#69519).
15339 * cs-parser.jay (using_alias_directive): Pass in an expression to
15340 NamespaceEntry.UsingAlias.
15341 (using_namespace_directive): Pass in an expression to
15342 NamespaceEntry.Using.
15343 (namespace_name): Don't flatten to a string.
15344 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
15345 (NamespaceEntry.AliasEntry.Resolve): Lookup using
15347 (NamespaceEntry.UsingEntry): Likewise.
15348 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
15350 (NamespaceEntry.LookupForUsing): Remove.
15351 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
15353 (NamespaceEntry.Lookup): Remove support for dotted names.
15355 2005-02-01 Raja R Harinath <rharinath@novell.com>
15357 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
15359 (NamespaceEntry.ImplicitParent): Compute on demand.
15360 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
15361 parallels the current.
15362 (NamespaceEntry.LookupForUsing): Use it.
15363 (NamespaceEntry.Lookup): If the current namespace-entry is
15364 implicit, don't search aliases and using tables.
15366 2005-02-01 Raja R Harinath <rharinath@novell.com>
15369 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
15371 (TypeContainer.BaseCache): Compute on demand.
15372 (TypeContainer.FindMembers): Define constants and types if they're
15373 not already created.
15374 (FieldMember.Define): Move resetting of ec.InUnsafe before error
15376 * const.cs (Constant.Define): Make idempotent.
15378 2005-01-29 Miguel de Icaza <miguel@novell.com>
15380 * pending.cs: Produce better code (no nops produced by using Ldarg
15383 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
15384 i - 1' it should be arg + 1.
15388 2005-01-28 Raja R Harinath <rharinath@novell.com>
15390 * attribute.cs (Attribute.CheckAttributeType): Make private
15392 (Attribute.ResolveType): Make virtual.
15393 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
15394 handling of RootContext.Tree.Types.
15396 2005-01-27 Raja R Harinath <rharinath@novell.com>
15398 Update attribute-handling to use the SimpleName/MemberAccess
15400 * cs-parser.jay (attribute): Pass in an expression to the
15401 constructors of Attribute and GlobalAttribute.
15402 * attribute.cs (Attribute): Take an expression for the name.
15403 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
15404 passed in attribute name expression.
15405 (Attribute.CheckAttributeType): Use it.
15406 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
15407 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
15408 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
15409 argument to prevent error messages if the lookup fails.
15411 2005-01-27 Marek Safar <marek.safar@seznam.cz>
15413 * expression.cs (Indirection): Implemented IVariable interface
15414 to support indirection in AddressOf operator.
15415 (PointerArithmetic.Emit): Add optimalization for case where
15416 result can be precomputed.
15418 2005-01-26 Martin Baulig <martin@ximian.com>
15420 * class.cs (TypeContainer.AttributeTargets): Return the correct
15421 AttributeTargets depending on our `Kind' instead of throwing an
15422 exception; fixes #71632.
15424 2005-01-26 Marek Safar <marek.safar@seznam.cz>
15427 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
15430 2005-01-25 Raja R Harinath <rharinath@novell.com>
15433 * expression.cs (MemberAccess.DoResolve): Don't complain with
15434 cs0572 when the LHS of a member access has identical name and type
15437 2005-01-25 Marek Safar <marek.safar@seznam.cz>
15440 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
15442 Create custom PermissionSet only for PermissionSetAttribute.
15444 2005-01-24 Marek Safar <marek.safar@seznam.cz>
15447 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
15448 delegates in static class.
15450 2005-01-24 Martin Baulig <martin@ximian.com>
15452 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15453 merging an implicit block, just use its reachability.
15455 * statement.cs (Block.Resolve): Make the unreachable code check
15456 work wrt. implicit blocks; see test-337 from #63842.
15458 2005-01-21 Alp Toker <alp@atoker.com>
15460 * cs-parser.jay: destructor_declaration's container is PartialContainer
15461 not Class when partial types are used, so use Kind prop instead of
15464 2005-01-22 Miguel de Icaza <miguel@ximian.com>
15466 * cs-parser.jay: Improve error reporting when an interface
15467 declares new types.
15469 2005-01-20 Dick Porter <dick@ximian.com>
15471 * support.cs: SeekableStreamReader fix from Sandor Dobos
15472 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
15473 chars are read. Fixes bug 70369.
15475 2005-01-20 Raja R Harinath <rharinath@novell.com>
15477 * cs-parser.jay (catch_clause): Simplify current_block handling
15480 2005-01-17 Miguel de Icaza <miguel@ximian.com>
15482 * convert.cs (ImplicitStandardConversionExists): Synchronize the
15483 code with ImplicitStandardConversion to handle the implicit
15484 conversion of method groups into valid delegate invocations.
15486 The problem is that in parameter handling we were using this code
15487 path. Fixes bug #64698
15489 2005-01-19 Raja R Harinath <rharinath@novell.com>
15491 * cs-parser.jay: Fix several infelicities.
15492 - Avoid assigning to the parser value stack. Code like
15493 '$3 = null' is unclean. Synthesize a value for the code block
15495 - Avoid using oob_stack for storing location information. Use ...
15496 (_mark_): ... this. New (empty) rule. Saves the current location
15498 (foreach_statement): Avoid using oob_stack for current_block
15499 handling. Use technique used in for_statement and
15500 using_statement. Synthesize a value for the code block to store
15501 additional intermediate information.
15503 2005-01-13 Miguel de Icaza <miguel@ximian.com>
15505 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
15506 of a different type is only allowed to private fields of a
15507 containing type, not on fields of a base class.
15509 See test-174.cs and error cs0122-9.cs
15511 2005-01-13 Raja R Harinath <rharinath@novell.com>
15513 Fix test-335.cs (bug #58126).
15514 * cs-parser.jay (argument): Split out non-expression parts of the
15515 rule into 'non_simple_argument'.
15516 (invocation_expression): Support parenthesized invocations with
15517 multiple arguments, and with single non-simple arguments.
15519 2005-01-13 Raja R Harinath <rharinath@novell.com>
15521 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
15524 2005-01-12 Raja R Harinath <rharinath@novell.com>
15526 Fix cs0038-1.cs, cs1640-6.cs.
15527 * ecore.cs (Expression.Resolve): Remove special-case for
15528 SimpleName in error-handling.
15529 (Expression.almostMatchedMembers): Relax access permission to
15531 (Expression.MemberLookupFailed): Handle duplicates in
15532 almostMatchedMembers list.
15533 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
15534 * expression.cs (New.DoResolve): Report CS1540 for more cases.
15535 * typemanager.cs (GetFullNameSignature): Use the MethodBase
15536 overload if the passed in MemberInfo is a MethodBase.
15538 2005-01-12 Marek Safar <marek.safar@seznam.cz>
15541 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
15542 for non-CAS & merge permission sets properly.
15544 2005-01-11 Raja R Harinath <rharinath@novell.com>
15546 Improve standard-compliance of simple name and member access
15547 resolution. Fixes bugs #52697, #57200, #67520, #69519.
15548 * ecore.cs (FullNamedExpression): New abstract base class
15549 for Namespaces and TypeExpressions.
15550 (ResolveFlags.SimpleName): Remove.
15551 (SimpleName): Remove support for dotted names.
15552 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
15553 DeclSpace.FindType and DeclSpace.LookupType.
15554 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
15555 (Expression.ExprClassName): Make member function.
15556 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
15557 a namespace. Remove creation of dotted "SimpleName"s.
15558 (MemberAccess.DoResolve): Likewise.
15559 * decl.cs (DeclSpace.Cache): Make private.
15560 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
15561 (DeclSpace.FindType): Update.
15562 (DeclSpace.LookupType): Move here from RootContext. Return a
15563 FullNamedExpression.
15564 * namespace.cs (Namespace): Derive from FullNamedExpression
15565 so that it can be part of expression resolution.
15566 (Namespace.Lookup): Return an FullNamedExpression.
15567 (NamespaceEntry.LookupAlias): Lookup aliases only in current
15569 * rootcontext.cs (NamespaceLookup): Remove.
15570 (LookupType): Move to DeclSpace.
15571 * attribute.cs (CheckAttributeType): Update.
15572 * doc.cs (FindDocumentedType): Remove allowAlias argument.
15573 (FindDocumentedTypeNonArray): Likewise.
15575 2005-01-11 Raja R Harinath <rharinath@novell.com>
15577 Fix cs0509.cs, cs1632.cs.
15578 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
15579 is the same as IsInterface.
15580 (TypeContainer.GetClassBases): Likewise.
15581 * statement.cs (LabeledStatement.ig): New field.
15582 (LabeledStatement.LabelTarget): Save ILGenerator which created the
15584 (LabeledStatement.DoEmit): Check that the label was created with
15585 the same ILGenerator.
15587 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15590 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
15591 accessors to its properties.
15593 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
15594 from accessors to property.
15596 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15599 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
15600 only for overrides.
15602 2005-01-08 Miguel de Icaza <miguel@ximian.com>
15604 * attribute.cs: Check for null and empty strings.
15606 I have lost another battle to Paolo.
15608 2005-01-07 Marek Safar <marek.safar@seznam.cz>
15611 * class.cs (PropertyMethod): Set Parent field in ctors.
15612 (SetMethod.InternalParameters): Add unsafe switch hack.
15613 Override MarkForDuplicationCheck where it is appropriate.
15615 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
15616 It says whether container allows members with the same name.
15617 Base default is no.
15618 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
15619 Removed is_method parameter.
15621 2005-01-06 Duncan Mak <duncan@ximian.com>
15623 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
15624 because the previous change led to incorrect reporting of CS1032
15625 ("Cannot define/undefine preprocessor symbols after first token in
15626 file"). Instead of using `tokens_seen' as the only flag that
15627 triggers CS1040, introduce `comments_seen'. This new flag is used
15628 to signify having seen comments on the current line, so it is
15629 unset after a newline.
15631 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15633 * doc.cs : When searching for a type, find nested type too.
15634 This fixes bug #71040.
15636 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15639 - Warn missing member comment on those classes which also does not
15640 have doc comments. Fixed bug #71041.
15641 - Don't warn missing doc comment on default constructor.
15644 2005-01-06 Duncan Mak <duncan@ximian.com>
15646 * cs-tokenizer.cs (xtoken): After handling traditional C-style
15647 comments, set `tokens_seen' to true. This allows us to detect
15648 misplaced preprocessor directives (i.e. not at the beginning of
15649 the a line, nor after whitespaces). In that case, report error
15650 CS1040. This fixes bug #56460.
15652 * cs-parser.jay (interface_member_declaration): Add checks for
15653 IsExplicitImpl, and report CS0541 error if an interface member is
15654 defined as an explicit interface declaration.
15656 2005-01-06 Marek Safar <marek.safar@seznam.cz>
15659 * class.cs (PropertyMethod): Set Parent field in ctors.
15660 (SetMethod.InternalParameters): Add unsafe switch hack.
15662 * decl.cs (MemberCore.Parent): Cannot be readonly.
15664 2005-01-06 Raja R Harinath <rharinath@novell.com>
15666 * decl.cs (DeclSpace.ResolveType): Remove.
15667 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
15668 Merge in code from ...
15669 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
15670 * class.cs, enum.cs: Update to changes.
15672 2005-01-06 Miguel de Icaza <miguel@ximian.com>
15674 * anonymous.cs: Ensure that we init the scope of our parent if it
15675 has not been initialized yet.
15677 2004-12-30 Duncan Mak <duncan@ximian.com>
15679 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
15680 if field.FieldBuilder is null. Fixes #70758.
15682 * convert.cs: Fixed some typos and updated some of the comments.
15683 (ImplicitStandardConversionExists):
15684 (TryImplicitIntConversion): If `target_type' is an interface and
15685 the type of `ic' implements this interface, return true or a new
15686 BoxedCast instead of null. This fixes #70468.
15688 2004-12-29 Duncan Mak <duncan@ximian.com>
15690 * expression.cs (Argument.Emit): Check that Expr is
15691 IMemoryLocation before casting to it, and report CS1510 otherwise.
15695 2004-12-21 Ben Maurer <bmaurer@ximian.com>
15697 * statement.cs (Block.ThisVariable): remove the recursion here, to
15698 make the --profile more sane.
15700 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
15702 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
15703 assembly, by JB Evain.
15705 2004-12-17 Raja R Harinath <rharinath@novell.com>
15707 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
15708 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
15709 "parent" refers to enclosing type/class. "base" refers to superclass.
15711 2004-12-17 Raja R Harinath <rharinath@novell.com>
15713 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15714 Ensure that we only have GlobalAttributes.
15715 * attribute.cs (Attribute.Emit): Make non-virtual.
15716 (GlobalAttribute.Emit): Remove.
15717 (Attribute.Resolve): Make virtual.
15718 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
15719 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
15720 the argument. Don't create one.
15721 (Attribute.GetObsoleteAttribute): Likewise.
15722 (Attribute.GetClsCompliantAttributeValue): Likewise.
15723 * class.cs, decl.cs: Update to changes.
15725 2004-12-17 Marek Safar <marek.safar@seznam.cz>
15727 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
15729 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
15731 * statement.cs (Foreach.Resolve): Add error 186 report.
15733 2004-12-16 Marek Safar <marek.safar@seznam.cz>
15735 * expression.cs (Conditional.DoResolve): Add warning 429.
15737 * statement.cs (If.Resolve): Add warning 665.
15739 2004-12-16 Raja R Harinath <rharinath@novell.com>
15741 New invariant: RootContext.Tree.Types.NamespaceEntry == null
15742 except when in the parser, and in GlobalAttribute.
15743 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
15744 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
15745 RootContext.Tree.Types.NamespaceEntry once work is done.
15746 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
15747 and resets RootContext.Tree.Types.NamespaceEntry.
15749 2004-12-15 Marek Safar <marek.safar@seznam.cz>
15751 * cs-parser.jay: Don't create a block for every variable.
15753 2004-12-14 Miguel de Icaza <miguel@ximian.com>
15755 * location.cs: Provide extra information.
15757 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
15758 variables from the captured environment, it is the ldarg_0.
15760 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15762 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
15765 * class.cs: Changed warning level for 169 to avoid developer
15766 displeasure from warning flooding. It will be changed back when they
15767 fix most of current BCL warnings.
15769 * RootContext.cs: Pushed default WarningLevel to 3.
15771 * statement.cs: Removed unused variable.
15773 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15775 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
15776 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
15777 Add error 502 report.
15778 (StaticClass.DefineType): Add error 441 report.
15779 (Class.AllowedModifiersProp): New virtual property as temporary
15780 extension to AllowedModifiers.
15781 (Class.DefineType): Add error 418 report. Moved ModFlags check here
15782 to share implementation with StaticClass and don't call virtual
15785 * driver.cs (MainDriver): Add error 1558 test.
15787 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
15788 report. Moved error 36 test here.
15790 * statement.cs (Throw.Resolve): Add error 724 report.
15792 * typemanager.cs: Add out_attribute_type core type.
15794 2004-12-13 Marek Safar <marek.safar@seznam.cz>
15796 * class.cs (TypeContainer.VerifyClsCompliance): Add error
15798 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
15800 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
15803 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
15805 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
15806 Add error 3023 report.
15807 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
15809 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
15812 2004-12-12 John Luke <john.luke@gmail.com>
15814 * driver.cs (AddArgs): take -- into account when
15815 adding arguments, fixes bug 65710
15817 2004-12-12 Martin Baulig <martin@ximian.com>
15819 * expression.cs (Unary.TryReduceNegative): Added support for
15820 SByteConstant and ByteConstant.
15821 (Unary.Reduce): Check error values from TryReduceNegative().
15823 2004-12-10 Marek Safar <marek.safar@seznam.cz>
15825 * attributes.cs (Attribute.Resolve): Avoid multiple error report
15826 and report exception as error 182.
15828 2004-12-10 Raja R Harinath <rharinath@novell.com>
15830 * driver.cs (Main): Fix message when there are warnings.
15832 2004-12-09 Miguel de Icaza <miguel@ximian.com>
15834 * delegate.cs: Fixed my fix from yesterday, sorry about that.
15836 2004-12-09 Marek Safar <marek.safar@seznam.cz>
15838 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
15839 Reduced number of warnings.
15841 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
15843 2004-12-08 Miguel de Icaza <miguel@ximian.com>
15845 * driver.cs: Removed message.
15847 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
15849 2004-12-08 <vargaz@freemail.hu>
15851 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
15853 2004-12-08 Martin Baulig <martin@ximian.com>
15855 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
15856 instead of a CS3002 for properties and indexer.
15858 2004-12-08 Martin Baulig <martin@ximian.com>
15860 * decl.cs (MemberName.ToString): Make this work again.
15862 2004-12-08 Marek Safar <marek.safar@seznam.cz>
15864 * attribute.cs (Resolve): Add error 591 detection.
15866 * class.cs (FieldMember.Define): Add error 1547 detection.
15867 (Indexer.Define): Add error 620 detection.
15868 (Operator.Define): Add error 590 detection.
15870 * ecore.cs: Missing argument for error 79.
15872 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
15875 2004-12-07 Marek Safar <marek.safar@seznam.cz>
15878 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
15881 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
15883 * cs-parser.jay : handle doc comments on implicit/explicit operators.
15884 Some operator comments were suppressed.
15885 * doc.cs : Implicit/explicit operator name in doc comments are like
15886 "op_Explicit(type)~returnType", so added suffix handling.
15888 2004-12-07 Martin Baulig <martin@ximian.com>
15891 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
15892 (MemberCore.GetClsCompliantAttributeValue): Likewise.
15893 (DeclSpace.ec): New protected field; store the EmitContext here.
15894 (DeclSpace.EmitContext): New public property; moved here from
15896 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
15899 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
15900 (Enum.Emit): Don't create a new EmitContext.
15902 * delegate.cs (Delegate.DefineType): Always create the
15905 * iterators.cs (Iterators.DefineIterator): Create a new
15906 EmitContext and store it in `ec'.
15908 2004-08-24 Martin Baulig <martin@ximian.com>
15911 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
15912 this for accessibility checks.
15913 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
15914 IsNestedFamilyAccessible.
15915 (TypeManager.IsSubclassOf): New method, do what the name actually
15918 2004-12-06 Raja R Harinath <rharinath@novell.com>
15920 Fix crash on cs0657-17.cs.
15921 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15922 Use RootContext.Tree.Types, not 'new RootTypes ()'.
15923 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
15924 the case where the NamespaceEntry gets overwritten.
15926 2004-12-06 Marek Safar <marek.safar@seznam.cz>
15928 Fixed #69195, #56821
15929 * ecore.cs (ResolveBoolean): Tiny refactoring.
15931 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
15932 of right expression resolving when left is false constant and
15933 operator is LogicalAnd OR true constant and operator is LogicalOr.
15935 * statement.cs (ResolveUnreachable): Always reports warning.
15937 2004-12-05 Miguel de Icaza <miguel@ximian.com>
15939 * class.cs: Distinguish between 1721 and 1722 (just a little help
15940 for the programmer).
15942 2004-12-03 Miguel de Icaza <miguel@ximian.com>
15944 * delegate.cs: Only allow this on new versions of the language.
15946 2004-12-02 Duncan Mak <duncan@ximian.com>
15948 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
15950 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
15951 here as a static method. Take an additional bool out parameter
15952 `must_do_cs1540_check' for signaling to InstanceResolve.
15953 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
15954 member field from PropertyExpr class and made it an argument of
15955 the method instead.
15956 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
15957 check for MarshalByRefObject, and report CS0122 instead of CS1540.
15958 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
15959 and `remove_accessor' as well as InstanceResolve: report CS0122
15964 2004-12-03 Raja R Harinath <rharinath@novell.com>
15966 Fix test-327.cs, test-328.cs, and put in early infrastructure
15967 for eventually fixing #52697.
15968 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
15969 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
15970 from other methods.
15971 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
15972 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
15973 (VerifyUsing, error246): Update.
15974 * rootcontext.cs (RootContext.NamespaceLookup): Just use
15975 'NamespaceEntry.LookupNamespaceOrType'.
15977 2004-12-03 Martin Baulig <martin@ximian.com>
15979 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
15980 method as our child, call AnonymousMethod.Compatible() on it.
15982 2004-12-03 Raja R Harinath <rharinath@novell.com>
15984 Disable XML documentation support in 'basic' profile.
15985 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
15986 Redirect XmlElement to System.Object.
15987 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
15988 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
15989 * mcs.exe.sources: Add doc-bootstrap.cs.
15990 * doc-bootstrap.cs: New file. Contains empty stub implementation
15993 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
15995 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
15996 comments are allowed.
15998 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16000 * delegate.cs: Add checks for subtypes in paramaters and return values
16001 in VerifyMethod () to add support for Covariance/Contravariance
16004 2004-12-02 Miguel de Icaza <miguel@ximian.com>
16006 * report.cs: Remove extra closing parenthesis.
16008 * convert.cs (Error_CannotImplicitConversion): If the name of the
16009 types are the same, provide some extra information.
16011 * class.cs (FieldBase): Use an unused bit field from the field to
16012 encode the `has_offset' property from the FieldMember. This saves
16013 a couple of Ks on bootstrap compilation.
16015 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
16016 method as our child, return the AnonymousMethod resolved
16019 * expression.cs (New.DoResolve): Allow return values from
16020 NewDelegate to also include AnonymousMethods.
16024 2004-12-02 Marek Safar <marek.safar@seznam.cz>
16027 * attribute.cs (Resolve): Improved implementation of params
16028 attribute arguments.
16030 * support.cs (ParameterData): Add HasParams to be faster.
16032 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
16034 all things are for /doc support:
16036 * doc.cs: new file that supports XML documentation generation.
16037 * mcs.exe.sources: added doc.cs.
16039 Handle /doc command line option.
16040 Report error 2006 instead of 5 for missing file name for /doc.
16041 Generate XML documentation when required, after type resolution.
16043 Added support for picking up documentation (/// and /** ... */),
16044 including a new XmlCommentState enumeration.
16046 Added lines to fill Documentation element for field, constant,
16047 property, indexer, method, constructor, destructor, operator, event
16048 and class, struct, interface, delegate, enum.
16049 Added lines to warn incorrect comment.
16051 Added Documentation field (passed only when /doc was specified).
16053 Added DocComment, DocCommentHeader, GenerateDocComment() and
16054 OnGenerateDocComment() and some supporting private members for
16055 /doc feature to MemberCore.
16057 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
16059 Added overriden DocCommentHeader.
16061 Added overriden DocCommentHeader and GenerateDocComment().
16063 2004-12-01 Miguel de Icaza <miguel@ximian.com>
16065 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
16066 unwrapping the enumeration values, chain to
16067 DoConstantNumericPromotions again, so we can promote things to the
16068 fundamental types (takes care of enums that are bytes, sbytes).
16072 2004-12-01 Raja R Harinath <rharinath@novell.com>
16074 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
16075 Fix long-standing bug in type-lookup. Use FindType instead of
16076 LookupType when ec.ResolvingTypeTree.
16077 (Attribute.ResolveType, Attribute.Resolve)
16078 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
16080 (Attributes.Search): Remove internal version. Update.
16081 (Attributes.SearchMulti): Update.
16082 (Attributes.GetClsCompliantAttribute): Remove.
16083 (Attributes.GetIndexerNameAttribute): Remove.
16084 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
16085 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
16086 * class.cs (Indexer.Define): Likewise.
16088 2004-12-01 Marek Safar <marek.safar@seznam.cz>
16091 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
16092 MarshallByReference members access.
16094 * expression.cs: Use CheckMarshallByRefAccess;
16095 Better error CS0197 message.
16097 * report.cs: Print whole related error message.
16099 2004-11-30 Raja R Harinath <rharinath@novell.com>
16101 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
16102 the current directory to help debugging.
16104 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16106 * class (GetClassBases): Better error 60 report.
16107 (EventProperty): Disabled warning 67 detection.
16109 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16112 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
16114 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
16117 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16120 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
16122 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
16124 2004-11-26 Miguel de Icaza <miguel@ximian.com>
16126 * attribute.cs (Attribute.Resolve): Refine error reporting and
16127 report a cs0117 if the identifier does not exist, to distinguish
16128 from 0617 which is a miss-use of the actual identifier.
16130 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
16131 between cs0070 and cs0079.
16133 * class.cs (MemberBase.DoDefine): When reporting a wrong
16134 accessibility level, we use MethodCore to compare instead of
16135 Method (this was a regression in some refactoring effort).
16137 So now we correctly report cs0056 again.
16139 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
16140 testing the target_type (which was known to be object_type) and
16141 not the source type (which is anonymous_method).
16143 Fixed reporting of error cs1660.
16145 * expression.cs (UserCast.Source): Expose the underlying cast.
16147 * statement.cs (Switch.SwitchGoverningType): Sort the list of
16148 allowed types to find a match to int32 first (most common).
16150 In addition, it ignores any ImplicitUserConversions that did an
16151 internal implicit conversion (as the switch statement allows only
16152 one integral conversion to exist).
16154 * class.cs (PartialContainer.Create): rename `name' to
16155 `member_name' for clarity. Then replace the string calls with a
16156 call to MemberName.GetPartialName, as now using
16157 MemberName.ToString is an error (this is due to the side effects
16158 it had, that were fixed in the past).
16160 This will restore the error reporting on a number of partial class
16161 errors that were missusing this (and getting an exception as a
16162 results, which is now just a plain textual warning, because
16163 yyparse debug output would crash otherwise).
16165 2004-11-26 Raja R Harinath <rharinath@novell.com>
16167 * Makefile (PROGRAM_INSTALL_DIR): Remove.
16169 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16171 * rootcontext.cs (LookupType): Make sure to cache lookups that
16172 don't give us a negative result. This saves about 5% of corlib
16175 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16177 * report.cs (AbstractMessage.Print): messages are sent to stderr
16179 * class.cs (TypeContainer.GetClassBases): It is an error to have a
16180 non-interface in the list of interfaces (at this point, either
16181 parent was properly set, or a base class is being listed in the
16182 interfaces section).
16184 This flags error 1722, and resolves the crash from bug 69259.
16186 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16188 * statement.cs (Using.EmitExpressionFinally): make this work right
16189 for valuetypes. Fixes 69926.
16191 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16193 * const.cs (Const.ChangeType): Cope with the "0 literal can be
16194 converted to an enum" here, before we try to change the underlying
16195 type. This code exists, but it is a different code path than the
16196 one used while encoding constants.
16198 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
16199 old bug: when converting from the null literal to a pointer,
16200 return an EmptyCast, not the NullLiteral.
16202 This fixes #69921, the recent null_type changes probably made this
16203 bug more prominent.
16205 (ImplicitReferenceConversionExists): In addition, resynchronized
16206 the code here, so it matches the same code in
16207 ImplicitReferenceConversionExists for the `from any class-type S
16208 to any interface-type T'.
16211 2004-11-25 Marek Safar <marek.safar@seznam.cz>
16213 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
16215 2004-11-24 Miguel de Icaza <miguel@ximian.com>
16217 * cs-parser.jay: Use verbosity accordingly.
16219 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16221 * expression.cs (Unary.ResolveOperator): Do not report warning;
16222 AddressOf reads from variable.
16224 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
16226 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16230 * attribute.cs (Attributable): Removed CheckTargets.
16231 (Attributes.Emit): Explicit attribute targets are tested here.
16233 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
16234 not enabled for interfaces.
16236 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
16237 (GetAssemblyName): Ouch next bug there.
16239 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16241 * expression.cs: Error 275 added.
16243 2004-11-23 Marek Safar <marek.safar@seznam.cz>
16245 Fix bug #69177 (Implemented decimal constant support)
16247 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
16248 (BinaryFold): Add DecimalConstant.
16250 * const.cs (Define): Decimal constant
16252 (ChangeType): Add decimal type handling.
16253 (LookupConstantValue): Don't set value for decimal type but
16254 emit DecimalConstantAttribute. Needed for constant optimization.
16256 * constant.cs (ToDecimal): New method.
16257 (ConvertToDecimal): New method.
16258 (IntConstant): Implemented ConvertToDecimal.
16259 (DecimalConstant.Emit): Emit optimized version for decimals in
16262 * expression.cs (ResolveOperator): Changed order of constant
16263 reduction to work correctly with native types which have
16264 overloaded operators.
16265 (ResolveMemberAccess): Extract constant value from attribute
16268 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
16270 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
16271 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
16272 (ChangeType): Decimal is special.
16273 (TypeToCoreType): Add decimal type.
16275 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16277 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
16280 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16282 * class.cs (EventField.ApplyAttributeBuilder): Fix error
16285 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16287 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
16289 * pending.cs (PendingImplementation): Grab only interfaces.
16291 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16293 * statement.cs (ForeachHelperMethods): Add location member and
16294 error 202 detection.
16296 2004-11-19 Raja R Harinath <rharinath@novell.com>
16298 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
16299 automatically handled by executable.make.
16300 (PROGRAM): Make profile-specific.
16302 2004-11-18 Marek Safar <marek.safar@seznam.cz>
16304 * expression.cs (DoResolveBase): Fixed wrong warning for out
16307 2004-11-18 Martin Baulig <martin@ximian.com>
16309 Merged latest changes into gmcs. Please keep this comment in
16310 here, it makes it easier for me to see what changed in MCS since
16311 the last time I merged.
16313 2004-11-17 Raja R Harinath <rharinath@novell.com>
16315 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
16316 (TypeHandle.GetMemberCache): New.
16317 (TypeHandle.TypeHandle): Update.
16318 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
16319 (TypeManager.LookupParentInterfacesCache):
16320 Rename from LookupInterfaceCache. Optimize slightly.
16321 (TypeManager.MemberLookup_FindMembers): Update.
16322 * decl.cs (MemberCache.MemberCache): Set Container to null in the
16323 multi-type variant.
16324 (AddCacheContents): Rename from AddHashtable.
16325 * class.cs (TypeContainer.parent_container): Remove.
16326 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
16327 (TypeContainer.DoDefineMembers): Don't initialize it.
16328 Update to name changes.
16330 2004-11-17 Miguel de Icaza <miguel@ximian.com>
16332 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
16333 that factors the code to check access modifiers on override.
16335 (PropertyBase): Use the code here.
16337 Patch from Lluis S'anchez, fixes bug #69361.
16339 2004-11-15 Miguel de Icaza <miguel@ximian.com>
16341 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
16342 routine that is used to report the use of a captured variable
16343 whose address has been taken.
16345 There are two checks: one when variables are being captured and
16346 the other check is when the address of a variable is taken.
16348 (because an anonymous methods might be resolved before *or* after
16349 the address has been taken) and
16351 * expression.cs (Conditional.DoResolve): Remove the special
16352 casing that Martin added to trueExpr and falseExpr being both
16353 NullLiteral. We get the right behavior now just by introducing
16354 the null_type into the compiler.
16356 * convert.cs (ExplicitConversion): Change the code to use
16357 null_type instead of testing `expr is NullLiteral'.
16358 (ImplicitConversionStandard): use null_type too.
16359 (ImplicitReferenceConversionExists): use null_type too.
16360 (ImplicitReferenceConversion): use null_type too.
16362 * literal.cs: The type of `NullLiteral' is now null_type instead
16364 (Resolve): Set the type here.
16366 * typemanager.cs: Introduce null_type.
16368 2004-11-17 Martin Baulig <martin@ximian.com>
16370 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
16371 direction, like FindMembers() does. Fixes #69546, testcase is in
16374 2004-11-16 Martin Baulig <martin@ximian.com>
16376 This is based on a patch from Marek Safar, see bug #69082.
16377 Fixes bugs #63705 and #67130.
16379 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
16380 method; create a MemberCache for an interface type and cache the
16383 * decl.cs (IMemberContainer.ParentContainer): Removed.
16384 (IMemberContainer.ParentCache): New property.
16385 (MemberCache.SetupCacheForInterface): Removed.
16386 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
16387 to create a cache for an interface's "parent".
16389 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
16392 2004-11-16 Martin Baulig <martin@ximian.com>
16394 Merged back from gmcs; these changes already went into gmcs a
16395 couple of weeks ago.
16398 (TypeManager.AddUserType): Removed the `ifaces' argument.
16399 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
16401 (TypeManager.AddUserInterface): Removed.
16402 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
16404 (TypeManager.GetInterfaces): Likewise.
16405 (TypeManager.GetExplicitInterfaces): Likewise.
16407 * ecore.cs (TypeExpr.GetInterfaces): Removed.
16409 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
16410 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
16412 2004-11-14 Ben Maurer <bmaurer@ximian.com>
16414 * statement.cs: Avoid adding bools to a hashtable.
16416 2004-11-07 Miguel de Icaza <miguel@ximian.com>
16418 * expression.cs (Invocation.OverloadResolve): Flag error if we are
16419 calling an unsafe method from a safe location.
16421 2004-11-06 Marek Safar <marek.safar@seznam.cz>
16424 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
16426 2004-11-06 Miguel de Icaza <miguel@ximian.com>
16428 * namespace.cs (VerifyUsing): use GetPartialName instead of
16431 2004-11-05 Miguel de Icaza <miguel@ximian.com>
16433 * statement.cs (Return.Resolve): Fix regression in typo: if
16434 `in_exc', we have to request a NeedReturnLabel, this was a typo
16435 introduced in the anonymous method check-in. Fixes #69131.
16437 * Indexers were using the ShortName when defining themselves,
16438 causing a regression in the compiler bootstrap when applying the
16439 patch from 2004-11-02 (first part), now they use their full name
16440 and the bug is gone.
16442 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
16444 * driver.cs: Strip the path from the names of embedded resources. Fixes
16447 2004-11-04 Raja R Harinath <rharinath@novell.com>
16449 Fix error message regression: cs0104-2.cs.
16450 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
16451 (AliasEntry.Resolve): Update.
16452 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
16454 (RootContext.LookupType): Update.
16456 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
16458 * cs-parser.jay: Add support for handling accessor modifiers
16459 * class: Add support port accessor modifiers and error checking,
16460 define PropertyMethod.Define as virtual (not abstract anymore)
16461 * ecore.cs: Add checking for proeprties access with access modifiers
16462 * iterators.cs: Modify Accessor constructor call based in the modified
16464 2004-11-02 Ben Maurer <bmaurer@ximian.com>
16466 * expression.cs (StringConcat): Handle being called twice,
16467 as when we have a concat in a field init with more than two
16470 2004-11-02 Miguel de Icaza <miguel@ximian.com>
16472 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
16473 special case explicit implementations, we should always produce
16474 the .property or .event declaration.
16476 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
16477 since it will not return correct data if people use this
16478 unresolved in the presence of using statements (see test-313).
16480 * class.cs (MethodData.Define): If we are an explicit interface
16481 implementation, set the method name to the full name of the
16482 interface plus the name of the method.
16484 Notice that using the method.MethodName.GetFullName() does not
16485 work, as it will only contain the name as declared on the source
16486 file (it can be a shorthand in the presence of using statements)
16487 and not the fully qualifed type name, for example:
16491 class D : ICloneable {
16492 object ICloneable.Clone () {
16496 Would produce a method called `ICloneable.Clone' instead of
16497 `System.ICloneable.Clone'.
16499 * namespace.cs (Alias.Resolve): Use GetPartialName.
16501 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16503 * cs-parser.jay: Add error 1055 report.
16505 2004-11-01 Miguel de Icaza <miguel@ximian.com>
16507 * assign.cs (Assign.DoResolve): Only do the transform of
16508 assignment into a New if the types are compatible, if not, fall
16509 through and let the implicit code deal with the errors and with
16510 the necessary conversions.
16512 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16514 * cs-parser.jay: Add error 1031 report.
16516 * cs-tokenizer.cs: Add location for error 1038.
16518 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16520 * cs-parser.jay: Add error 1016 report.
16522 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16524 * cs-parser.jay: Add errors 1575,1611 report.
16526 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16528 * cs-parser.jay: Add error 1001 report.
16530 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16533 * attribute.cs (GetMarshal): Add method argument for
16534 caller identification.
16536 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
16537 agument for GetMarshal and RuntimeMissingSupport.
16539 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16541 * attribute.cs (ExtractSecurityPermissionSet): Removed
16542 TypeManager.code_access_permission_type.
16544 * typemanager.cs: Removed TypeManager.code_access_permission_type.
16546 2004-10-27 Miguel de Icaza <miguel@ximian.com>
16548 * expression.cs (LocalVariableReference.DoResolveLValue): Check
16549 for obsolete use of a variable here. Fixes regression on errors
16550 cs0619-25 and cs0619-26.
16552 2004-10-27 Marek Safar <marek.safar@seznam.cz>
16554 Fix #62358, implemented security attribute encoding.
16556 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
16557 Tests permitted SecurityAction for assembly or other types.
16558 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
16559 data from SecurityPermissionAttribute to PermisionSet class.
16561 * class.cs (ApplyAttributeBuilder): Added special handling
16562 for System.Security.Permissions.SecurityAttribute based types.
16564 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
16565 special handling for System.Security.Permissions.SecurityAttribute
16568 * enum.cs (ApplyAttributeBuilder): Added special handling
16569 for System.Security.Permissions.SecurityAttribute based types.
16571 * parameter.cs (ApplyAttributeBuilder): Added special handling
16572 for System.Security.Permissions.SecurityAttribute based types.
16574 * rootcontext.cs: Next 2 core types.
16576 * typemanager.cs (TypeManager.security_permission_attr_type):
16577 Built in type for the SecurityPermission Attribute.
16578 (code_access_permission_type): Build in type.
16580 2004-10-17 Miguel de Icaza <miguel@ximian.com>
16582 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
16583 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
16584 all of this information into
16585 EmitContext.EmitCapturedVariableInstance.
16587 * codegen.cs (EmitCapturedVariableInstance): move here the
16588 funcionality of emitting an ldarg.0 in the presence of a
16589 remapping. This centralizes the instance emit code.
16591 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
16592 then emit a load of this: it means that we have reached the
16593 topmost ScopeInfo: the one that contains the pointer to the
16594 instance of the class hosting the anonymous method.
16596 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
16597 captures to the topmost CaptureContext.
16599 2004-10-12 Miguel de Icaza <miguel@ximian.com>
16601 * expression.cs (LocalVariableReference): Move the knowledge about
16602 the iterators into codegen's EmitCapturedVariableInstance.
16604 2004-10-11 Miguel de Icaza <miguel@ximian.com>
16606 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
16607 all code paths return a value from an anonymous method (it is the
16608 same as the 161 error, but for anonymous methods).
16610 2004-10-08 Miguel de Icaza <miguel@ximian.com>
16612 The introduction of anonymous methods in the compiler changed
16613 various ways of doing things in the compiler. The most
16614 significant one is the hard split between the resolution phase
16615 and the emission phases of the compiler.
16617 For instance, routines that referenced local variables no
16618 longer can safely create temporary variables during the
16619 resolution phase: they must do so from the emission phase,
16620 since the variable might have been "captured", hence access to
16621 it can not be done with the local-variable operations from the runtime.
16625 (Block.Flags): New flag `IsTopLevel' to indicate that this block
16626 is a toplevel block.
16628 (ToplevelBlock): A new kind of Block, these are the blocks that
16629 are created by the parser for all toplevel method bodies. These
16630 include methods, accessors and anonymous methods.
16632 These contain some extra information not found in regular blocks:
16633 A pointer to an optional CaptureContext (for tracking captured
16634 local variables and parameters). A pointer to the parent
16637 (Return.Resolve): Catch missmatches when returning a value from an
16638 anonymous method (error 1662).
16639 Invoke NeedReturnLabel from the Resolve phase instead of the emit
16642 (Break.Resolve): ditto.
16644 (SwitchLabel): instead of defining the labels during the
16645 resolution phase, we now turned the public ILLabel and ILLabelCode
16646 labels into methods called GetILLabelCode() and GetILLabel() that
16647 only define the label during the Emit phase.
16649 (GotoCase): Track the SwitchLabel instead of the computed label
16650 (its contained therein). Emit the code by using
16651 SwitchLabel.GetILLabelCode ().
16653 (LocalInfo.Flags.Captured): A new flag has been introduce to track
16654 whether the Local has been captured or not.
16656 (LocalInfo.IsCaptured): New property, used to tell whether the
16657 local has been captured.
16659 * anonymous.cs: Vastly updated to contain the anonymous method
16662 The main classes here are: CaptureContext which tracks any
16663 captured information for a toplevel block and ScopeInfo used to
16664 track the activation frames for various local variables.
16666 Each toplevel block has an optional capture context associated
16667 with it. When a method contains an anonymous method both the
16668 toplevel method and the anonymous method will create a capture
16669 context. When variables or parameters are captured, they are
16670 recorded on the CaptureContext that owns them, for example:
16674 MyDelegate d = delegate {
16679 Here `a' will be recorded as captured on the toplevel
16680 CapturedContext, the inner captured context will not have anything
16681 (it will only have data if local variables or parameters from it
16682 are captured in a nested anonymous method.
16684 The ScopeInfo is used to track the activation frames for local
16685 variables, for example:
16687 for (int i = 0; i < 10; i++)
16688 for (int j = 0; j < 10; j++){
16689 MyDelegate d = delegate {
16694 At runtime this captures a single captured variable `i', but it
16695 captures 10 different versions of the variable `j'. The variable
16696 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
16697 recorded on a child.
16699 The toplevel ScopeInfo will also track information like the `this'
16700 pointer if instance variables were referenced (this is necessary
16701 as the anonymous method lives inside a nested class in the host
16702 type of the method).
16704 (AnonymousMethod): Expanded to track the Toplevel, implement
16705 `AnonymousMethod.Compatible' to tell whether an anonymous method
16706 can be converted to a target delegate type.
16708 The routine now also produces the anonymous method content
16710 (AnonymousDelegate): A helper class that derives from
16711 DelegateCreation, this is used to generate the code necessary to
16712 produce the delegate for the anonymous method that was created.
16714 * assign.cs: API adjustments for new changes in
16715 Convert.ImplicitStandardConversionExists.
16717 * class.cs: Adjustments to cope with the fact that now toplevel
16718 blocks are of type `ToplevelBlock'.
16720 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
16721 insteda of standard blocks.
16723 Flag errors if params arguments are passed to anonymous methods.
16725 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
16726 `CurrentAnonymousMethod' which points to the current Anonymous
16727 Method. The variable points to the AnonymousMethod class that
16728 holds the code being compiled. It is set in the new EmitContext
16729 created for the anonymous method.
16731 (EmitContext.Phase): Introduce a variable and an enumeration to
16732 assist in enforcing some rules about when and where we are allowed
16733 to invoke certain methods (EmitContext.NeedsReturnLabel is the
16734 only one that enfonces this right now).
16736 (EmitContext.HaveCaptureInfo): new helper method that returns
16737 whether we have a CapturedContext initialized.
16739 (EmitContext.CaptureVariable): New method used to register that a
16740 LocalInfo must be flagged for capturing.
16742 (EmitContext.CapturedParameter): New method used to register that a
16743 parameters must be flagged for capturing.
16745 (EmitContext.CapturedField): New method used to register that a
16746 field must be flagged for capturing.
16748 (EmitContext.HaveCapturedVariables,
16749 EmitContext.HaveCapturedFields): Return whether there are captured
16750 variables or fields.
16752 (EmitContext.EmitMethodHostInstance): This is used to emit the
16753 instance for the anonymous method. The instance might be null
16754 (static methods), this (for anonymous methods that capture nothing
16755 and happen to live side-by-side with the current method body) or a
16756 more complicated expression if the method has a CaptureContext.
16758 (EmitContext.EmitTopBlock): Routine that drives the emission of
16759 code: it will first resolve the top block, then emit any metadata
16760 and then emit the code. The split is done so that we can extract
16761 any anonymous methods and flag any captured variables/parameters.
16763 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
16764 during this phase, the ILGenerator should not be used as labels
16765 and local variables declared here might not be accessible to any
16766 code that is part of an anonymous method.
16768 Exceptions to this include the temporary variables that are
16769 created by some statements internally for holding temporary
16772 (EmitContext.EmitMeta): New routine, in charge of emitting all the
16775 (EmitContext.TemporaryReturn): This method is typically called
16776 from the Emit phase, and its the only place where we allow the
16777 ReturnLabel to be defined other than the EmitMeta. The reason is
16778 that otherwise we would have to duplicate a lot of logic in the
16779 Resolve phases of various methods that today is on the Emit
16782 (EmitContext.NeedReturnLabel): This no longer creates the label,
16783 as the ILGenerator is not valid during the resolve phase.
16785 (EmitContext.EmitThis): Extended the knowledge in this class to
16786 work in anonymous methods in addition to iterators.
16788 (EmitContext.EmitCapturedVariableInstance): This emits whatever
16789 code is necessary on the stack to access the instance to a local
16790 variable (the variable will be accessed as a field).
16792 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
16793 EmitContext.EmitAddressOfParameter): Routines to support
16794 parameters (not completed at this point).
16796 Removals: Removed RemapLocal and RemapLocalLValue. We probably
16797 will also remove the parameters.
16799 * convert.cs (Convert): Define a `ConstantEC' which points to a
16800 null. This is just to prefity some code that uses
16801 ImplicitStandardConversion code and do not have an EmitContext
16804 The idea is to flag explicitly that at that point in time, it is
16805 known that the conversion will not trigger the delegate checking
16806 code in implicit conversions (which requires a valid
16809 Everywhere: pass new EmitContext parameter since
16810 ImplicitStandardConversionExists now requires it to check for
16811 anonymous method conversions.
16813 (Convert.ImplicitStandardConversionExists): If the type of an
16814 expression is the anonymous_method_type, and the type is a
16815 delegate, we invoke the AnonymousMethod.Compatible method to check
16816 whether an implicit conversion is possible.
16818 (Convert.ImplicitConversionStandard): Only do implicit method
16819 group conversions if the language level is not ISO_1.
16821 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
16822 MethodInfo for the Invoke method. used by Delegate and
16825 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
16826 method conversions if the target type is a delegate.
16828 Removed extra debugging nops.
16830 (LocalVariableReference): Turn the `local_info' into a public
16833 Add `prepared' field, the same hack used for FieldExprs to cope
16834 with composed assignments, as Local variables do not necessarily
16835 operate purely on the stack as they used to: they can be captured
16838 Add `temp' for a temporary result, like fields.
16840 Refactor DoResolve and DoResolveLValue into DoResolveBase.
16842 It now copes with Local variables that are captured and emits the
16843 proper instance variable to load it from a field in the captured
16846 (ParameterReference.DoResolveBase): During the resolve phase,
16847 capture parameters if we are in an anonymous method.
16849 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
16850 anonymous method, use the EmitContext helper routines to emit the
16851 parameter reference.
16853 * iterators.cs: Set RemapToProxy to true/false during the
16856 * parameters.cs (GetParameterByName): New helper method.
16858 * typemanager.cs (anonymous_method_type) a new type that
16859 represents an anonyous method. This is always an internal type,
16860 used as a fencepost to test against the anonymous-methodness of an
16863 2004-10-20 Marek Safar <marek.safar@seznam.cz>
16865 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
16867 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
16869 2004-10-18 Martin Baulig <martin@ximian.com>
16871 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
16872 `Type' directly, but call ResolveType() on it.
16873 (Catch.Resolve): Likewise.
16874 (Foreach.Resolve): Likewise.
16876 2004-10-18 Martin Baulig <martin@ximian.com>
16878 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
16879 `Type' directly, but call ResolveType() on it.
16880 (Probe.DoResolve): Likewise.
16881 (ArrayCreation.LookupType): Likewise.
16882 (TypeOf.DoResolve): Likewise.
16883 (SizeOf.DoResolve): Likewise.
16885 2004-10-18 Martin Baulig <martin@ximian.com>
16887 * expression.cs (Invocation.BetterFunction): Put back
16888 TypeManager.TypeToCoreType().
16890 2004-10-18 Raja R Harinath <rharinath@novell.com>
16892 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
16895 2004-10-18 Martin Baulig <martin@ximian.com>
16897 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
16898 `Type' directly, but call ResolveType() on it.
16900 2004-10-18 Martin Baulig <martin@ximian.com>
16902 * class.cs (FieldMember.Define): Don't access the TypeExpr's
16903 `Type' directly, but call ResolveType() on it.
16904 (MemberBase.DoDefine): Likewise.
16906 * expression.cs (New.DoResolve): Don't access the TypeExpr's
16907 `Type' directly, but call ResolveType() on it.
16908 (ComposedCast.DoResolveAsTypeStep): Likewise.
16910 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
16911 `Type' directly, but call ResolveType() on it.
16913 2004-10-17 John Luke <john.luke@gmail.com>
16915 * class.cs (Operator.GetSignatureForError): use CSharpName
16917 * parameter.cs (Parameter.GetSignatureForError): Returns
16918 correct name even if was not defined.
16920 2004-10-13 Raja R Harinath <rharinath@novell.com>
16923 * class.cs (TypeContainer.EmitContext): New property.
16924 (DefineNestedTypes): Create an emitcontext for each part.
16925 (MethodCore.DoDefineParameters): Use container's emitcontext.
16926 Pass type array to InternalParameters.
16927 (MemberBase.DoDefine): Use container's emitcontext.
16928 (FieldMember.Define): Likewise.
16929 (Event.Define): Likewise.
16930 (SetMethod.GetParameterInfo): Change argument to EmitContext.
16931 Pass type array to InternalParameters.
16932 (SetIndexerMethod.GetParameterInfo): Likewise.
16933 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
16934 * delegate.cs (Define): Pass emitcontext to
16935 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
16936 array to InternalParameters.
16937 * expression.cs (ParameterReference.DoResolveBase): Pass
16938 emitcontext to GetParameterInfo.
16939 (ComposedCast.DoResolveAsTypeStep): Remove check on
16940 ec.ResolvingTypeTree.
16941 * parameter.cs (Parameter.Resolve): Change argument to
16942 EmitContext. Use ResolveAsTypeTerminal.
16943 (Parameter.GetSignature): Change argument to EmitContext.
16944 (Parameters.ComputeSignature): Likewise.
16945 (Parameters.ComputeParameterTypes): Likewise.
16946 (Parameters.GetParameterInfo): Likewise.
16947 (Parameters.ComputeAndDefineParameterTypes): Likewise.
16948 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
16949 * support.cs (InternalParameters..ctor): Remove variant that takes
16951 * typemanager.cs (system_intptr_expr): New.
16952 (InitExpressionTypes): Initialize it.
16954 2004-10-12 Chris Toshok <toshok@ximian.com>
16956 * cs-parser.jay: fix location for try_statement and catch_clause.
16958 2004-10-11 Martin Baulig <martin@ximian.com>
16960 * report.cs: Don't make --fatal abort on warnings, we have
16961 -warnaserror for that.
16963 2004-10-07 Raja R Harinath <rharinath@novell.com>
16965 More DeclSpace.ResolveType avoidance.
16966 * decl.cs (MemberCore.InUnsafe): New property.
16967 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
16968 with newly created EmitContext.
16969 (FieldMember.Define): Likewise.
16970 * delegate.cs (Delegate.Define): Likewise.
16971 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
16972 only if normal name-lookup fails.
16973 (TypeExpr.DoResolve): Enable error-checking.
16974 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
16975 (SizeOf.DoResolve): Likewise.
16976 (ComposedCast.DoResolveAsTypeStep): Likewise.
16977 (StackAlloc.DoResolve): Likewise.
16978 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
16979 (Block.Unsafe): New property.
16980 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
16981 (Unsafe): Set 'unsafe' flag of contained block.
16982 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
16983 (Fixed.Resolve): Likewise.
16984 (Catch.Resolve): Likewise.
16985 (Using.ResolveLocalVariableDecls): Likewise.
16986 (Foreach.Resolve): Likewise.
16988 2004-10-05 John Luke <john.luke@gmail.com>
16990 * cs-parser.jay: add location to error CS0175
16992 2004-10-04 Miguel de Icaza <miguel@ximian.com>
16994 * ecore.cs (Expression.Constantity): Add support for turning null
16997 * const.cs (Const.Define): Allow constants to be reference types
16998 as long as the value is Null.
17000 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
17002 * namespace.cs (NamespaceEntry.Using): No matter which warning
17003 level is set, check if this namespace name has already been added.
17005 2004-10-03 Ben Maurer <bmaurer@ximian.com>
17007 * expression.cs: reftype [!=]= null should always use br[true,false].
17010 2004-10-03 Marek Safar <marek.safar@seznam.cz>
17013 * attribute.cs: Enum conversion moved to
17014 GetAttributeArgumentExpression to be applied to the all
17017 2004-10-01 Raja R Harinath <rharinath@novell.com>
17019 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
17020 * class.c (TypeContainer.DefineType): Flag error if
17021 base types aren't accessible due to access permissions.
17022 * decl.cs (DeclSpace.ResolveType): Move logic to
17023 Expression.ResolveAsTypeTerminal.
17024 (DeclSpace.ResolveTypeExpr): Thin layer over
17025 Expression.ResolveAsTypeTerminal.
17026 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
17027 Refactor code into NestedAccess. Use it.
17028 (DeclSpace.NestedAccess): New.
17029 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
17030 argument to silence errors. Check access permissions.
17031 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
17032 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
17033 (Cast.DoResolve): Likewise.
17034 (New.DoResolve): Likewise.
17035 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
17036 (TypeOf.DoResolve): Likewise.
17038 * expression.cs (Invocation.BetterConversion): Return the Type of
17039 the better conversion. Implement section 14.4.2.3 more faithfully.
17040 (Invocation.BetterFunction): Make boolean. Make correspondence to
17041 section 14.4.2.2 explicit.
17042 (Invocation.OverloadResolve): Update.
17043 (Invocation): Remove is_base field.
17044 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
17045 (Invocation.Emit): Likewise.
17047 2004-09-27 Raja R Harinath <rharinath@novell.com>
17049 * README: Update to changes.
17051 2004-09-24 Marek Safar <marek.safar@seznam.cz>
17053 * cs-parser.jay: Reverted 642 warning fix.
17055 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17058 * decl.cs (FindMemberWithSameName): Indexer can have more than
17061 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17063 * expression.cs (LocalVariableReference.DoResolveLValue):
17064 Do not report warning 219 for out values.
17065 (EmptyExpression.Null): New member to avoid extra allocations.
17067 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17069 * cs-parser.jay: Fix wrong warning 642 report.
17071 * cs-tokenizer.cs (CheckNextToken): New helper;
17072 Inspect next character if is same as expected.
17074 2004-09-23 Martin Baulig <martin@ximian.com>
17076 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
17077 (Convert.ImplicitReferenceConversionExists): Likewise.
17079 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17081 * class.cs (Operator.Define): Add error 448 and 559 report.
17083 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17085 * class.cs (MemberBase.IsTypePermitted): New protected
17086 method for checking error CS0610.
17088 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17090 * class.cs (TypeContainer.HasExplicitLayout): New property
17091 Returns whether container has StructLayout attribute set Explicit.
17092 (FieldMember): New abstract class for consts and fields.
17093 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
17094 (Field): Reuse FieldMember.
17096 * const.cs (Const): Reuse FieldMember.
17098 * rootcontext.cs: EmitConstants call moved to class.
17100 2004-09-22 Martin Baulig <martin@ximian.com>
17102 Thanks to Peter Sestoft for this bug report.
17104 * expression.cs (Conditional): If both the `trueExpr' and the
17105 `falseExpr' is a NullLiteral, return a NullLiteral.
17107 2004-09-22 Martin Baulig <martin@ximian.com>
17109 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
17110 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
17111 for the "get_Current" call.
17113 2004-09-22 Martin Baulig <martin@ximian.com>
17115 Marek and me just fixed one of our oldest bugs: #28562 :-)
17117 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
17119 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
17120 we're an EnumConstant, just return that.
17121 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
17122 an EnumConstant. In this case, we need to use GetValueAsEnumType()
17123 to get the value which'll actually be written into the attribute.
17124 However, we have to use GetValue() to access the attribute's value
17127 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17129 * constant.cs (Constant.IsNegative): New abstract property
17132 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
17133 (StackAlloc.DoResolve): Reused IsNegative.
17135 2004-09-21 Martin Baulig <martin@ximian.com>
17137 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
17138 if we're used in an iterator, we may be called from different
17141 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
17142 we actually have an exception block.
17144 2004-09-20 John Luke <jluke@cfl.rr.com>
17146 * class.cs, cs-parser.jay: Improve the error report for 1520:
17147 report the actual line where the error happens, not where the
17148 class was declared.
17150 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
17151 Pass location information that was available elsewhere.
17153 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
17155 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
17156 runtime to delay sign assemblies.
17158 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17160 * cs-parser.jay: Do not report the stack trace, this is barely
17163 2004-08-22 John Luke <john.luke@gmail.com>
17165 * driver.cs : check that a resource id is not already used
17166 before adding it, report CS1508 if it is, bug #63637
17168 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17170 * ecore.cs: Removed dead code.
17172 2004-09-18 Marek Safar <marek.safar@seznam.cz>
17174 * class.cs: Do not report warning CS0067 on the interfaces.
17176 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17178 * cs-parser.jay: Add error 504 report.
17180 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17182 * rootcontext.cs: WarningLevel is 4 by default now.
17184 * statement.cs (Fixed.Resolve): Do not null
17187 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17190 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
17191 deep search when property is not virtual.
17192 (PropertyExpr.ResolveAccessors): Make one call for both
17195 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17198 * statement.cs: Error 152 report constains also location.
17200 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17203 * const.cs: Explicitly set constant as static.
17205 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17208 * cs-parser.jay: Add error 1017 report.
17210 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17212 Fixed bug #59980, #64224
17213 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
17215 * typemanager.cs (IsSpecialMethod): Simplified
17217 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17219 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
17220 condition with better params.
17222 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17225 * attribute.cs (Resolve): Property has to have both
17228 2004-09-14 Martin Baulig <martin@ximian.com>
17230 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
17232 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17235 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
17236 called and is obsolete then this member suppress message
17237 when call is inside next [Obsolete] method or type.
17239 * expression.cs: Use TestObsoleteMethodUsage member.
17241 2004-09-14 Martin Baulig <martin@ximian.com>
17243 * cs-parser.jay: Sync a bit with the GMCS version.
17245 2004-09-14 Martin Baulig <martin@ximian.com>
17247 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
17248 (CSharpParser.yacc_verbose_flag): New public field.
17250 * genericparser.cs: Removed.
17252 2004-09-14 Raja R Harinath <rharinath@novell.com>
17254 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
17256 2004-09-13 Marek Safar <marek.safar@seznam.cz>
17258 * class.cs (MethodCore.CheckBase): Fix bug #65757.
17260 2004-09-10 Martin Baulig <martin@ximian.com>
17262 Backported my MemberName changes from GMCS into MCS.
17264 - we are now using a special `MemberName' class instead of using
17265 strings; in GMCS, the `MemberName' also contains the type
17268 - changed the grammar rules a bit:
17269 * the old `member_name' is now a `namespace_or_type_name':
17270 The rule is that we use `namespace_or_type_name' everywhere
17271 where we expect either a "member name" (GetEnumerator) or a
17272 "member name" with an explicit interface name
17273 (IEnumerable.GetEnumerator).
17274 In GMCS, the explicit interface name may include type arguments
17275 (IEnumerable<T>.GetEnumerator).
17276 * we use `member_name' instead of just `IDENTIFIER' for
17278 The rule is that we use `member_name' wherever a member may
17279 have type parameters in GMCS.
17281 * decl.cs (MemberName): New public class.
17282 (MemberCore.MemberName): New public readonly field.
17283 (MemberCore.ctor): Take a `MemberName' argument, not a string.
17284 (DeclSpace): Likewise.
17286 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
17287 * enum.cs (Enum.ctor): Likewise.
17289 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
17291 (AliasEntry.ctor): Take a MemberName, not an Expression.
17292 (AliasEntry.UsingAlias): Likewise.
17294 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
17295 (IMethodData.MemberName): Changed type from string to MemberName.
17296 (MemberBase.ExplicitInterfaceName): Likewise.
17297 (AbstractPropertyEventMethod.SetupName): Make this private.
17298 (AbstractPropertyEventMethod.ctor): Added `string prefix'
17299 argument; compute the member name here.
17300 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
17301 on the `member.MemberName' and the `prefix'.
17303 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
17305 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
17306 thus, we get a `MemberName' instead of a `string'. These
17307 declarations may have type parameters in GMCS.
17308 (interface_method_declaration, delegate_declaration): Likewise.
17309 (class_declaration, interface_declaration): Likewise.
17310 (method_header): Use `namespace_or_type_name' instead of
17311 `member_name'. We may be an explicit interface implementation.
17312 (property_declaration, event_declaration): Likewise.
17313 (member_name): This is now just an `IDENTIFIER', not a
17314 `namespace_or_type_name'.
17315 (type_name, interface_type): Removed.
17316 (namespace_or_type_name): Return a MemberName, not an Expression.
17317 (primary_expression): Use `member_name' instead of `IDENTIFIER';
17318 call GetTypeExpression() on the MemberName to get an expression.
17319 (IndexerDeclaration.interface_type): Changed type from string to
17321 (MakeName): Operate on MemberName's instead of string's.
17323 2004-09-13 Raja R Harinath <rharinath@novell.com>
17326 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
17327 (NamespaceEntry.Lookup): Add new argument to flag if we want the
17328 lookup to avoid symbols introduced by 'using'.
17329 * rootcontext.cs (NamespaceLookup): Update.
17331 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17333 * class.cs (TypeContainer.DoDefineMembers): Do not call
17334 DefineDefaultConstructor for static classes.
17336 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17338 * attribute.cs (Attribute.Resolve): Add error 653 report.
17340 * class.cs (Class.ApplyAttributeBuilder): Add error 641
17342 (Method.ApplyAttributeBuilder): Add error 685 report.
17343 (Operator.Define): Add error 564 report.
17345 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
17347 * expression.cs (Invocation.DoResolve): Add error
17348 245 and 250 report.
17350 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
17353 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17355 * class.cs (ConstructorInitializer.Resolve):
17356 Wrong error number (515->516).
17358 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17360 * class.cs (Indexer.Define): Add error 631 report.
17362 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17364 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
17366 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17368 * expression.cs (Probe.DoResolve): Add error CS0241 report.
17370 2004-09-10 Marek Safar <marek.safar@seznam.cz>
17372 * cs-parser.jay: Added error CS0241 report.
17374 2004-09-10 Raja R Harinath <rharinath@novell.com>
17376 * cs-parser.jay (fixed_statement): Introduce a scope for the
17377 declaration in the 'fixed' statement.
17379 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17381 * cs-parser.jay: Added CS0230 error report.
17383 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17385 * cs-parser.jay: Added errors CS0231 and CS0257 report.
17387 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17389 * expression.cs (Argument.Resolve): Added error CS0192 and
17392 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17394 C# 2.0 #pragma warning feature
17396 * cs-tokenizer.cs (PreProcessPragma): New method;
17397 Handles #pragma directive.
17399 * report.cs (WarningRegions): New class; Support
17400 class for #pragma warning directive. It tests whether
17401 warning is enabled for a given line.
17403 2004-09-08 Miguel de Icaza <miguel@ximian.com>
17405 * const.cs: Add more descriptive error report, tahnks to
17408 2004-09-08 Marek Safar <marek.safar@seznam.cz>
17410 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
17412 2004-09-07 Miguel de Icaza <miguel@ximian.com>
17414 * expression.cs: Apply patch from Ben: Remove dead code from
17415 ArrayCreation, and remove the TurnintoConstant call in const.cs,
17416 as that code just threw an exception anwyays.
17418 * const.cs: Remove the call to the turnintoconstant, for details
17421 * literal.cs: The type of the null-literal is the null type; So
17422 we use a placeholder type (literal.cs:System.Null, defined here)
17425 * expression.cs (Conditional.DoResolve): Remove some old code that
17426 is no longer needed, conversions have been fixed.
17428 (ArrayCreationExpression.DoResolve): Return false if we fail to
17429 resolve the inner expression.
17431 2004-09-07 Raja R Harinath <rharinath@novell.com>
17434 * cs-parser.jay (delegate_declaration): Record a delegate
17435 declaration as a type declaration.
17436 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
17438 2004-09-06 Miguel de Icaza <miguel@ximian.com>
17440 * parameter.cs: Do not crash if the type can not be resolved.
17442 * expression.cs: Report errors with unsafe pointers, fixes #64896
17444 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
17446 * expression.cs: Pointer arith always needs to do a conv.i
17447 if the operand is a long. fix 65320
17449 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17451 Fixed cs0619-37.cs, cs0619-38.cs
17453 * enum.cs (GetObsoleteAttribute): Removed.
17455 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
17456 on Enum member is double staged. The first is tested member
17459 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17461 Fixed #56986, #63631, #65231
17463 * class.cs: (TypeContainer.AddToMemberContainer): New method,
17464 adds member to name container.
17465 (TypeContainer.AddToTypeContainer): New method, adds type to
17467 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
17468 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
17469 AddOperator): Simplified by reusing AddToMemberContainer.
17470 (TypeContainer.UserDefinedStaticConstructor): Changed to property
17472 (Method.CheckForDuplications): Fixed implementation to test all
17474 (MemberBase): Detection whether member is explicit interface
17475 implementation is now in constructor.
17476 (MemberBase.UpdateMemberName): Handles IndexerName.
17477 (Accessor): Changed to keep also location information.
17478 (AbstractPropertyEventMethod): Is derived from MemberCore.
17479 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
17480 will be emited or not.
17481 (PropertyBase.AreAccessorsDuplicateImplementation):
17482 Tests whether accessors are not in collision with some method.
17483 (Operator): Is derived from MethodCore to simplify common
17486 * decl.cs (Flags.TestMethodDuplication): Test for duplication
17488 (DeclSpace.AddToContainer): Adds the member to defined_names
17489 table. It tests for duplications and enclosing name conflicts.
17491 * enum.cs (EnumMember): Clean up to reuse the base structures
17493 2004-09-03 Martin Baulig <martin@ximian.com>
17495 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
17496 into TypeContainer, to make partial classes work again.
17498 2004-09-03 Martin Baulig <martin@ximian.com>
17500 * rootcontext.cs (RootContext.V2): Removed.
17502 2004-03-23 Martin Baulig <martin@ximian.com>
17504 * expression.cs (Invocation.OverloadResolve): Added `bool
17505 may_fail' argument and use it instead of the Location.IsNull() hack.
17507 2004-09-03 Martin Baulig <martin@ximian.com>
17509 Merged latest changes into gmcs. Please keep this comment in
17510 here, it makes it easier for me to see what changed in MCS since
17511 the last time I merged.
17513 2004-09-03 Raja R Harinath <rharinath@novell.com>
17516 * expression.cs (BetterConversion): Don't allow either conversion
17517 to be null. Remove redundant implicit conversion test when 'q ==
17518 null' -- when this function is invoked, we already know that the
17519 implicit conversion exists.
17520 (BetterFunction): Assume that 'best' is non-null. Remove
17521 redundant reimplementation of IsApplicable when 'best' is null.
17522 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
17523 number of arguments.
17524 (IsAncestralType): Extract from OverloadResolve.
17525 (OverloadResolve): Make robust to the MethodGroupExpr being
17526 unsorted. Implement all the logic of Section 14.5.5.1, and
17527 support overloading of methods from multiple applicable types.
17528 Clean up logic somewhat. Don't pass null methods to BetterFunction.
17530 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
17531 (RealError, Warning): Append type of report to related symbol.
17533 2004-09-03 Marek Safar <marek.safar@seznam.cz>
17535 * enum.cs: Fixed CLS-Compliance checks for enum members.
17536 Error tests cs3008-8.cs, cs3014-8.cs
17538 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17540 Fixed bug #62342, #63102
17541 * class.cs: ImplementIndexer uses member.IsExplicitImpl
17542 like ImplementMethod.
17544 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17546 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17549 2004-09-02 Martin Baulig <martin@ximian.com>
17551 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
17552 TypeManager.GetArgumentTypes() rather than calling GetParameters()
17555 2004-09-01 Marek Safar <marek.safar@seznam.cz>
17557 C# 2.0 Static classes implemented
17559 * class.cs (TypeContainer): instance_constructors,
17560 initialized_fields, initialized_static_fields,
17561 default_constructor, base_inteface_types are protected to be
17562 accessible from StaticClass.
17563 (TypeContainer.DefineDefaultConstructor): New virtual method
17564 for custom default constructor generating
17565 (StaticClass): New class to handle "Static classes" feature.
17567 * cs-parser.jay: Handle static keyword on class like instance
17570 * driver.cs: Added "/langversion" command line switch with two
17571 options (iso-1, default).
17573 2004-08-31 Marek Safar <marek.safar@seznam.cz>
17575 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
17577 2004-08-31 Miguel de Icaza <miguel@ximian.com>
17579 * delegate.cs: Style.
17581 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
17583 * delegate.cs: Add seperate instance expr field for miguel.
17585 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17587 * PointerArithmetic (Resolve): make sure we are not doing
17588 pointer arith on void*. Also, make sure we are resolved
17589 by not setting eclass until resolve.
17591 All callers: Make sure that PointerArithmetic gets resolved.
17593 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17595 * ArrayCreation (LookupType): If the type does not resolve
17596 to an array, give an error.
17598 2004-08-27 Marek Safar <marek.safar@seznam.cz>
17600 * statement.cs (Try.Resolve): Fixed bug #64222
17602 2004-08-27 Martin Baulig <martin@ximian.com>
17605 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
17608 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17610 * ecore.cs (Constantify): Get underlying type via
17611 System.Enum.GetUnderlyingType to avoid StackOverflow on the
17612 Windows in special cases.
17614 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17616 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
17617 for obtaining also private methods.
17618 (GetRemoveMethod): Used GetRemoveMethod (true)
17619 for obtaining also private methods.
17621 2004-08-24 Martin Baulig <martin@ximian.com>
17623 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
17624 MethodAttributes.HideBySig for operators.
17626 2004-08-23 Martin Baulig <martin@ximian.com>
17628 Back to the old error reporting system :-)
17630 * report.cs (Message): Removed.
17631 (Report.MessageData, ErrorData, WarningData): Removed.
17632 (Report.Error, Warning): Back to the old system.
17634 2004-08-23 Martin Baulig <martin@ximian.com>
17636 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
17638 * class.cs (TypeContainer.ParentContainer): New public virtual
17639 method; replaces the explicit interface implementation.
17640 (ClassPart.ParentContainer): Override.
17642 2004-08-23 Martin Baulig <martin@ximian.com>
17644 * statement.cs (Switch): Added support for constant switches; see
17645 #59428 or test-285.cs.
17647 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17650 * statement.cs (GetEnumeratorFilter): Removed useless
17651 logic because C# specs is strict. GetEnumerator must be
17654 2004-08-22 Martin Baulig <martin@ximian.com>
17656 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17657 a switch and may break, reset the barrier. Fixes #59867.
17659 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17661 CLS-Compliance speed up (~5% for corlib)
17663 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
17664 New method. Tests container for CLS-Compliant names
17666 * class.cs (TypeContainer.VerifyClsName): New method.
17667 Checks whether container name is CLS Compliant.
17668 (Constructor): Implements IMethodData.
17670 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
17671 low-case table for CLS Compliance test.
17672 (MemberCache.VerifyClsParameterConflict): New method.
17673 Checks method parameters for CS3006 error.
17675 * enum.cs (EnumMember): Is derived from MemberCore.
17676 (Enum.VerifyClsName): Optimized for better performance.
17678 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17680 * report.cs: Renamed Error_T to Error and changed all
17683 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17685 * class.cs (TypeContainer.IndexerArrayList): New inner class
17686 container for indexers.
17687 (TypeContainer.DefaultIndexerName): New constant for default
17688 indexer name. Replaced all "Item" with this constant.
17689 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
17691 * typemanager.cs (TypeManager.default_member_ctor): Cache here
17692 DefaultMemberAttribute constructor.
17694 2004-08-05 Martin Baulig <martin@ximian.com>
17696 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
17699 2004-08-05 Marek Safar <marek.safar@seznam.cz>
17701 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
17702 multi platforms problem.
17704 * compiler.csproj: Included shared files.
17706 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17708 Fix bug 60333, 55971 in the more general way
17709 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17710 Added arg_type argument for constant conversion.
17711 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
17713 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17716 * class.cs (TypeContainer ): New inner classes MethodArrayList,
17717 OperatorArrayList, MethodCoreArrayList for typecontainer
17718 containers. Changed class member types to these new types.
17719 (MethodArrayList.DefineMembers): Added test for CS0659.
17721 2004-08-04 Miguel de Icaza <miguel@ximian.com>
17723 * cfold.cs: Synchronize the folding with the code in expression.cs
17724 Binary.DoNumericPromotions for uint operands.
17726 * attribute.cs: Revert patch from Raja, it introduced a regression
17727 while building Blam-1.2.1 (hard to isolate a test case).
17729 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17733 (TypeContainer.Define): Renamed to DefineContainerMembers because of
17735 (MethodCore.parent_method): New member. The method we're overriding
17736 if this is an override method.
17737 (MethodCore.CheckBase): Moved from Method class and made common.
17738 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
17740 (MethodCore.CheckForDuplications): New abstract method. For custom
17741 member duplication search in a container
17742 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
17743 method and its return type.
17744 (Event.conflict_symbol): New member. Symbol with same name in the
17748 (MemberCache.FindMemberWithSameName): New method. The method
17749 is looking for conflict with inherited symbols.
17751 2004-08-04 Martin Baulig <martin@ximian.com>
17753 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
17755 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
17757 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17759 * report.cs (Message): New enum for better error, warning reference in
17761 (MessageData): New inner abstract class. It generally handles printing of
17762 error and warning messages.
17763 Removed unused Error, Warning, Message methods.
17765 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17767 Fix for cs0592-8.cs test
17769 (Attributable.ValidAttributeTargets): Made public.
17770 (Attribute.ExplicitTarget): New member for explicit target value.
17771 (Attribute.CheckTargets): Now we translate explicit attribute
17772 target to Target here.
17774 2004-08-03 Ben Maurer <bmaurer@ximian.com>
17776 * ecore.cs (MethodGroupExpr): new IsBase property.
17778 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
17780 * delegate.cs (DelegateCreation): store a MethodGroupExpr
17781 rather than an instance expr.
17783 (DelegateCreation.Emit): Use the method group rather than
17784 the instance expression. Also, if you have base.Foo as the
17785 method for a delegate, make sure to emit ldftn, not ldftnvirt.
17787 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
17789 (NewDelegate.DoResolve): Only check for the existance of Invoke
17790 if the method is going to be needed. Use MethodGroupExpr.
17792 (NewDelegate.Emit): Remove, DelegateCreation implements this.
17794 * expression.cs: For pointer arith., make sure to use
17795 the size of the type, not the size of the pointer to
17798 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17801 * class.cs (Class): Added error CS0502 test.
17803 2004-08-03 John Luke <jluke@cfl.rr.com>
17804 Raja R Harinath <rharinath@novell.com>
17807 * attribute.cs (Attribute.complained_before): New flag.
17808 (Attribute.ResolveType, Attribute.Resolve),
17809 (Attribute.DefinePInvokeMethod): Set it.
17810 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
17812 2004-08-03 Martin Baulig <martin@ximian.com>
17814 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
17815 use a user-defined operator; we still need to do numeric
17816 promotions in case one argument is a builtin type and the other
17817 one has an implicit conversion to that type. Fixes #62322.
17819 2004-08-02 Martin Baulig <martin@ximian.com>
17821 * statement.cs (LocalInfo.Flags): Added `IsThis'.
17822 (LocalInfo.IsThis): New public property.
17823 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
17825 2004-08-01 Martin Baulig <martin@ximian.com>
17827 * class.cs (TypeContainer.GetClassBases): Don't set the default
17828 here since we may get called from GetPartialBases().
17829 (TypeContainer.DefineType): If GetClassBases() didn't return a
17830 parent, use the default one.
17832 2004-07-30 Duncan Mak <duncan@ximian.com>
17834 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
17836 2004-07-30 Martin Baulig <martin@ximian.com>
17838 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
17840 * class.cs (SourceMethod): New public class, derive from the
17841 symbol writer's ISourceMethod.
17842 (Method): Use the new symbol writer API.
17844 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
17845 as argument and use the new symbol writer.
17848 (SourceFile): Implement the symbol writer's ISourceFile.
17849 (Location.SymbolDocument): Removed.
17850 (Location.SourceFile): New public property.
17852 * symbolwriter.cs: Use the new symbol writer API.
17854 2004-07-30 Raja R Harinath <rharinath@novell.com>
17856 * Makefile (install-local): Remove. Functionality moved to
17859 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
17861 * Makefile: Install mcs.exe.config file together with mcs.exe.
17862 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
17863 correct runtime version.
17865 2004-07-25 Martin Baulig <martin@ximian.com>
17868 (TypeContainer.RegisterOrder): Removed, this was unused.
17869 (TypeContainer, interface_order): Removed.
17870 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
17871 TypeContainer as argument since we can also be called with a
17872 `PartialContainer' for a partial class/struct/interface.
17873 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
17874 of checking whether we're an `Interface' - we could be a
17875 `PartialContainer'.
17876 (PartialContainer.Register): Override; call
17877 AddClass()/AddStruct()/AddInterface() on our parent.
17879 * cs-parser.jay (interface_member_declaration): Add things to the
17880 `current_container', not the `current_class'.
17882 * rootcontext.cs (RegisterOrder): The overloaded version which
17883 takes an `Interface' was unused, removed.
17885 * typemanager.cs (TypeManager.LookupInterface): Return a
17886 `TypeContainer', not an `Interface'.
17887 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
17888 contain a `PartialContainer' for an interface, so check it's
17889 `Kind' to figure out what it is.
17891 2004-07-25 Martin Baulig <martin@ximian.com>
17893 * class.cs (Class.DefaultTypeAttributes): New public constant.
17894 (Struct.DefaultTypeAttributes): Likewise.
17895 (Interface.DefaultTypeAttributes): Likewise.
17896 (PartialContainer.TypeAttr): Override this and add the
17897 DefaultTypeAttributes.
17899 2004-07-25 Martin Baulig <martin@ximian.com>
17901 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
17902 we can just use the `Parent' field instead.
17904 2004-07-25 Martin Baulig <martin@ximian.com>
17906 * class.cs (TypeContainer.Emit): Renamed to EmitType().
17908 2004-07-25 Martin Baulig <martin@ximian.com>
17910 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
17911 our parts before defining any methods.
17912 (TypeContainer.VerifyImplements): Make this virtual.
17913 (ClassPart.VerifyImplements): Override and call VerifyImplements()
17914 on our PartialContainer.
17916 2004-07-25 Martin Baulig <martin@ximian.com>
17918 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
17920 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
17921 argument, we can just use the `Parent' field instead.
17924 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
17925 (MemberBase.DoDefine): Likewise.
17927 2004-07-24 Martin Baulig <martin@ximian.com>
17929 * decl.cs (MemberCore.Parent): New public field.
17930 (DeclSpace.Parent): Moved to MemberCore.
17932 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
17933 (MemberBase.ctor): Added TypeContainer argument, pass it to our
17935 (FieldBase, Field, Operator): Likewise.
17936 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
17937 (EventField, Event): Likewise.
17939 2004-07-23 Martin Baulig <martin@ximian.com>
17941 * class.cs (PartialContainer): New public class.
17942 (ClassPart): New public class.
17943 (TypeContainer): Added support for partial classes.
17944 (TypeContainer.GetClassBases): Splitted some of the functionality
17945 out into GetNormalBases() and GetPartialBases().
17947 * cs-tokenizer.cs (Token.PARTIAL): New token.
17948 (Tokenizer.consume_identifier): Added some hacks to recognize
17949 `partial', but only if it's immediately followed by `class',
17950 `struct' or `interface'.
17952 * cs-parser.jay: Added support for partial clases.
17954 2004-07-23 Martin Baulig <martin@ximian.com>
17956 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
17957 a `DeclSpace' and also made it readonly.
17958 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
17959 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
17960 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
17962 * cs-parser.jay: Pass the `current_class', not the
17963 `current_container' (at the moment, this is still the same thing)
17964 to a new Method, Property, Event, Indexer or Constructor.
17966 2004-07-23 Martin Baulig <martin@ximian.com>
17968 * cs-parser.jay (CSharpParser): Added a new `current_class' field
17969 and removed the `current_interface' one.
17970 (struct_declaration, class_declaration, interface_declaration):
17971 Set `current_class' to the newly created class/struct/interface;
17972 set their `Bases' and call Register() before parsing their body.
17974 2004-07-23 Martin Baulig <martin@ximian.com>
17976 * class.cs (Kind): New public enum.
17977 (TypeContainer): Made this class abstract.
17978 (TypeContainer.Kind): New public readonly field.
17979 (TypeContainer.CheckDef): New public method; moved here from
17981 (TypeContainer.Register): New public abstract method.
17982 (TypeContainer.GetPendingImplementations): New public abstract
17984 (TypeContainer.GetClassBases): Removed the `is_class' and
17985 `is_iface' parameters.
17986 (TypeContainer.DefineNestedTypes): Formerly known as
17988 (ClassOrStruct): Made this class abstract.
17990 * tree.cs (RootTypes): New public type.
17992 2004-07-20 Martin Baulig <martin@ximian.com>
17994 * tree.cs (Tree.RecordNamespace): Removed.
17995 (Tree.Namespaces): Removed.
17997 * rootcontext.cs (RootContext.IsNamespace): Removed.
17999 * cs-parser.jay (namespace_declaration): Just create a new
18000 NamespaceEntry here.
18002 2004-07-20 Martin Baulig <martin@ximian.com>
18004 * statement.cs (ExceptionStatement): New abstract class. This is
18005 now used as a base class for everyone who's using `finally'.
18006 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
18007 our local variables before using them.
18009 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
18010 virtual method. This is used by Yield.Resolve() to "steal" an
18011 outer block's `finally' clauses.
18012 (FlowBranchingException): The .ctor now takes an ExceptionStatement
18015 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
18016 version which takes an ExceptionStatement. This version must be
18017 used to create exception branchings.
18020 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
18021 (Iterator.EmitMoveNext): Added exception support; protect the
18022 block with a `fault' clause, properly handle 'finally' clauses.
18023 (Iterator.EmitDispose): Run all the `finally' clauses here.
18025 2004-07-20 Martin Baulig <martin@ximian.com>
18027 * iterator.cs: This is the first of a set of changes in the
18028 iterator code. Match the spec more closely: if we're an
18029 IEnumerable, then GetEnumerator() must be called. The first time
18030 GetEnumerator() is called, it returns the current instance; all
18031 subsequent invocations (if any) must create a copy.
18033 2004-07-19 Miguel de Icaza <miguel@ximian.com>
18035 * expression.cs: Resolve the constant expression before returning
18038 2004-07-19 Martin Baulig <martin@ximian.com>
18040 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
18041 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
18042 the return type of the new EmitContext.
18044 2004-07-18 Martin Baulig <martin@ximian.com>
18046 * class.cs (Property.Define): Fix iterators.
18048 * iterators.cs (Iterator.Define): Moved the
18049 `container.AddInterator (this)' call here from the .ctor; only do
18050 it if we resolved successfully.
18052 2004-07-17 Miguel de Icaza <miguel@ximian.com>
18054 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
18055 `true' for preprocessing directives that we parse. The return
18056 value indicates whether we should return to regular tokenizing or
18057 not, not whether it was parsed successfully.
18059 In the past if we were in: #if false ... #line #endif, we would
18060 resume parsing after `#line'. See bug 61604.
18062 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
18063 building: IsEnumType should return true only for enums, not for
18064 enums or System.Enum itself. This fixes #61593.
18066 Likely what happened is that corlib was wrong: mcs depended on
18067 this bug in some places. The bug got fixed, we had to add the
18068 hack, which caused bug 61593.
18070 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
18071 that was a workaround for the older conditions.
18073 2004-07-16 Ben Maurer <bmaurer@ximian.com>
18075 * assign.cs: IAssignMethod has a new interface, as documented
18076 inline. All assignment code now uses this new api.
18078 * ecore.cs, expression.cs: All classes which implement
18079 IAssignMethod now use the new interface.
18081 * expression.cs (Invocation): add a hack to EmitCall so that
18082 IndexerAccess can be the target of a compound assignment without
18083 evaluating its arguments twice.
18085 * statement.cs: Handle changes in Invocation api.
18087 2004-07-16 Martin Baulig <martin@ximian.com>
18089 * iterators.cs: Rewrote this. We're now using one single Proxy
18090 class for both the IEnumerable and the IEnumerator interface and
18091 `Iterator' derives from Class so we can use the high-level API.
18093 * class.cs (TypeContainer.AddIterator): New method.
18094 (TypeContainer.DoDefineType): New protected virtual method, which
18095 is called from DefineType().
18096 (TypeContainer.DoDefineMembers): Call DefineType() and
18097 DefineMembers() on all our iterators.
18098 (TypeContainer.Emit): Call Emit() on all our iterators.
18099 (TypeContainer.CloseType): Call CloseType() on all our iterators.
18101 * codegen.cs (EmitContext.CurrentIterator): New public field.
18103 2004-07-15 Martin Baulig <martin@ximian.com>
18106 (TypeManager.not_supported_exception_type): New type.
18108 2004-07-14 Martin Baulig <martin@ximian.com>
18110 * iterators.cs: Use real error numbers.
18112 2004-07-14 Martin Baulig <martin@ximian.com>
18114 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
18115 requires this to be a System.Collection.IEnumerable and not a
18116 class implementing that interface.
18117 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
18119 2004-07-13 Marek Safar <marek.safar@seznam.cz>
18121 * class.cs: Fixed previous fix, it broke some error tests.
18123 2004-07-12 Martin Baulig <martin@ximian.com>
18125 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
18128 2004-07-09 Miguel de Icaza <miguel@ximian.com>
18130 * assign.cs (LocalTemporary): Add new argument: is_address,If
18131 `is_address' is true, then the value that we store is the address
18132 to the real value, and not the value itself.
18134 * ecore.cs (PropertyExpr): use the new local temporary
18135 stuff to allow us to handle X.Y += z (where X is a struct)
18137 2004-07-08 Martin Baulig <martin@ximian.com>
18139 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
18140 not always return, just like we're doing in Using.Resolve().
18142 2004-07-07 Miguel de Icaza <miguel@ximian.com>
18144 * cs-parser.jay (fixed_statement): flag this as Pinned.
18146 2004-07-06 Miguel de Icaza <miguel@ximian.com>
18148 * typemanager.cs (TypeManager): Removed MakePinned method, this
18149 mechanism is replaced with the .NET 2.x compatible mechanism of
18150 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
18152 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
18153 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
18154 `IsFixed' property which has a different meaning.
18156 2004-07-02 Raja R Harinath <rharinath@novell.com>
18158 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
18159 visible from inside a nested class, not just the names of the
18160 immediately enclosing class.
18161 Fix for bug #60730.
18163 2004-06-24 Raja R Harinath <rharinath@novell.com>
18165 * expression.cs (BetterConversion): Remove buggy special-case
18166 handling of "implicit constant expression conversions". At this
18167 point, we already know that the conversion is possible -- we're
18168 only checking to see which is better.
18170 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18172 * cs-parser.jay: Added error CS0210 test.
18174 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18176 * cs-parser.jay: Added error CS0134 test.
18178 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18181 * cs-parser.jay: Added error CS0145 test.
18183 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18185 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
18187 2004-06-23 Ben Maurer <bmaurer@ximian.com>
18189 * expression.cs (StackAlloc.Resolve): The argument may not
18190 be a constant; deal with this case.
18192 2004-06-23 Marek Safar <marek.safar@seznam.cz>
18194 * attribute.cs (IndexerName_GetIndexerName): Renamed to
18195 GetIndexerAttributeValue.
18196 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
18198 * class.cs (Indexer.Define): Added error tests for CS0415,
18201 2004-06-23 Miguel de Icaza <miguel@ximian.com>
18203 * attribute.cs (Attribute.Resolve): Keep field code in sync with
18206 2004-06-23 Martin Baulig <martin@ximian.com>
18208 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
18209 neither return nor throw, reset the barrier as well. Fixes #60457.
18211 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
18213 * class.cs : EventAttributes is now set to None by default.
18214 This fixes bug #60459.
18216 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18219 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18220 Don't throw exception but return null (it's sufficient now).
18222 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18224 * typemanager.cs (GetArgumentTypes): Faster implementation.
18226 2004-06-18 Martin Baulig <martin@ximian.com>
18228 * attribute.cs (Attribute.Resolve): Check whether we're an
18229 EmptyCast which a Constant child. Fixes #60333.
18231 2004-06-17 Ben Maurer <bmaurer@ximian.com>
18233 * statement.cs (EmitCollectionForeach): Account for the fact that
18234 not all valuetypes are in areas which we can take the address of.
18235 For these variables, we store to a temporary variable. Also, make
18236 sure that we dont emit a `callvirt' on a valuetype method.
18238 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18240 * expression.cs (StackAlloc.DoReSolve): Added test for
18241 negative parameter (CS0247).
18243 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18246 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
18248 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18251 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
18254 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18256 Fix bug #58254 & cs1555.cs, cs1556.cs
18257 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
18259 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18261 * cs-parser.jay: Added error CS1669 test for indexers.
18263 2004-06-11 Martin Baulig <martin@ximian.com>
18265 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
18266 call this twice: for params and varargs methods.
18268 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18271 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
18273 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18275 * attribute.cs (Attribute.GetValidTargets): Made public.
18278 (AbstractPropertyEventMethod): New class for better code sharing.
18279 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
18281 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
18283 2004-06-11 Raja R Harinath <rharinath@novell.com>
18286 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
18287 that the call to Resolve is part of a MemberAccess.
18288 (Expression.Resolve): Use it for SimpleName resolution.
18289 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
18290 Add 'intermediate' boolean argument.
18291 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
18292 error message when the SimpleName can be resolved ambiguously
18293 between an expression and a type.
18294 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
18296 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
18297 call on the left-side.
18299 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18302 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
18304 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18306 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
18308 2004-06-11 Martin Baulig <martin@ximian.com>
18310 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
18311 varargs methods if applicable.
18313 2004-06-11 Martin Baulig <martin@ximian.com>
18315 * expression.cs (Invocation.EmitCall): Don't use
18316 `method.CallingConvention == CallingConventions.VarArgs' since the
18317 method could also have `CallingConventions.HasThis'.
18319 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18321 * class.cs (Event.GetSignatureForError): Implemented.
18322 Fixed crash in error test cs3010.cs
18324 2004-06-10 Miguel de Icaza <miguel@ximian.com>
18326 * cs-tokenizer.cs: Change the way we track __arglist to be
18327 consistent with the other keywords.
18329 2004-06-09 Miguel de Icaza <miguel@ximian.com>
18331 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
18334 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
18336 * codegen.cs: Check that all referenced assemblies have a strongname
18337 before strongnaming the compiled assembly. If not report error CS1577.
18338 Fix bug #56563. Patch by Jackson Harper.
18339 * typemanager.cs: Added a method to return all referenced assemblies.
18340 Fix bug #56563. Patch by Jackson Harper.
18342 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18345 (Method.ApplyAttributeBuilder): Moved and added conditional
18346 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
18349 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
18351 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18354 * class.cs: (EventField.attribute_targets): Changed default target.
18356 2004-06-08 Martin Baulig <martin@ximian.com>
18358 * expression.cs (Invocation.EmitCall): Enable varargs methods.
18360 2004-06-08 Martin Baulig <martin@ximian.com>
18362 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
18364 2004-06-07 Martin Baulig <martin@ximian.com>
18366 Added support for varargs methods.
18368 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
18371 * cs-parser.jay: Added support for `__arglist'.
18373 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
18375 * expression.cs (Argument.AType): Added `ArgList'.
18376 (Invocation): Added support for varargs methods.
18377 (ArglistAccess): New public class.
18378 (Arglist): New public class.
18380 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
18382 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
18383 a method's top-level block if the method has varargs.
18385 * support.cs (ReflectionParameters, InternalParameters): Added
18386 support for varargs methods.
18388 2004-06-07 Miguel de Icaza <miguel@ximian.com>
18390 * class.cs: Provide location in indexer error report.
18392 * driver.cs: Use standard names.
18394 * namespace.cs: Catch the use of using after a namespace has been
18395 declared also on using aliases.
18397 2004-06-03 Raja R Harinath <rharinath@novell.com>
18400 * typemanager.cs (closure_private_ok, closure_invocation_type)
18401 (closure_qualifier_type, closure_invocation_assembly)
18402 (FilterWithClosure): Move to ...
18403 (Closure): New internal nested class.
18404 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
18405 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
18406 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
18407 (MemberLookup, MemberLookupFailed): Use it.
18408 * expression.cs (New.DoResolve): Treat the lookup for the
18409 constructor as being qualified by the 'new'ed type.
18410 (Indexers.GetIndexersForTypeOrInterface): Update.
18412 2004-06-03 Marek Safar <marek.safar@seznam.cz>
18415 (GetConditionalAttributeValue): New method. Returns
18416 condition of ConditionalAttribute.
18417 (SearchMulti): New method. Returns all attributes of type 't'.
18418 Use it when attribute is AllowMultiple = true.
18419 (IsConditionalMethodExcluded): New method.
18422 (Method.IsExcluded): Implemented. Returns true if method has conditional
18423 attribute and the conditions is not defined (method is excluded).
18424 (IMethodData): Extended interface for ConditionalAttribute support.
18425 (PropertyMethod.IsExcluded): Implemented.
18428 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
18431 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
18434 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
18436 * expression.cs (ArrayCreationExpression): Make this just an
18437 `expression'. It can't be a statement, so the code here was
18440 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18443 * typemanager.cs (GetFullNameSignature): New method for
18446 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18449 * class.cs (MemberBase.GetSignatureForError): New virtual method.
18450 Use this method when MethodBuilder is null.
18451 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
18452 Added test for error CS0626 (MONO reports error for this situation).
18453 (IMethodData.GetSignatureForError): Extended interface.
18455 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18458 (AttributeTester.GetObsoleteAttribute): Returns instance of
18459 ObsoleteAttribute when type is obsolete.
18462 (TypeContainer.VerifyObsoleteAttribute): Override.
18463 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
18464 (MethodCode.VerifyObsoleteAttribute): Override.
18465 (MemberBase.VerifyObsoleteAttribute): Override.
18468 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
18469 and report proper error.
18472 Delegate.VerifyObsoleteAttribute): Override.
18475 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
18476 and report proper error.
18477 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
18480 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
18484 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
18485 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
18486 Added test for ObsoleteAttribute.
18489 (Catch): Derived from Statement.
18491 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18493 Fixed bug #59071 & cs0160.cs
18495 * statement.cs (Try.Resolve): Check here whether order of catch
18496 clauses matches their dependencies.
18498 2004-05-31 Miguel de Icaza <miguel@ximian.com>
18500 * Reverted patch to namespace.cs (Use lookuptypedirect). This
18501 caused a regression: #59343. Referencing nested classes from an
18502 assembly stopped working.
18504 2004-05-31 Martin Baulig <martin@ximian.com>
18506 MCS is now frozen for beta 2.
18508 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18510 * convert.cs: add a trivial cache for overload operator resolution.
18512 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18514 * decl.cs: If possible, use lookuptypedirect here. We can only do
18515 this if there is no `.' after the namespace. Avoids using
18516 LookupType, which does lots of slow processing.
18517 (FindNestedType) New method, does what it says :-).
18518 * namespace.cs: use LookupTypeDirect.
18519 * rootcontext.cs: use membercache, if possible.
18520 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
18522 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18525 According to the spec,
18527 In a member access of the form E.I, if E is a single identifier,
18528 and if the meaning of E as a simple-name (§7.5.2) is a constant,
18529 field, property, localvariable, or parameter with the same type as
18530 the meaning of E as a type-name (§3.8), then both possible
18531 meanings of E are permitted.
18533 We did not check that E as a simple-name had the same type as E as
18536 This trivial check gives us 5-7% on bootstrap time.
18538 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18540 * expression.cs (Invocation.OverloadResolve): Avoid the
18541 use of hashtables and boxing here by allocating on demand.
18543 2004-05-30 Martin Baulig <martin@ximian.com>
18545 * rootcontext.cs (RootContext.LookupType): Don't cache things if
18546 we're doing a silent lookup. Don't try to lookup nested types in
18547 TypeManager.object_type (thanks to Ben Maurer).
18549 2004-05-30 Martin Baulig <martin@ximian.com>
18551 Committing a patch from Ben Maurer.
18553 * rootcontext.cs (RootContext.LookupType): Cache negative results.
18555 2004-05-29 Martin Baulig <martin@ximian.com>
18557 * class.cs (IMethodData.ShouldIgnore): New method.
18559 * typemanager.cs (TypeManager.MethodFlags): Don't take a
18560 `Location' argument, we don't need it anywhere. Use
18561 `IMethodData.ShouldIgnore ()' instead of
18562 `MethodData.GetMethodFlags ()'.
18563 (TypeManager.AddMethod): Removed.
18564 (TypeManager.AddMethod2): Renamed to AddMethod.
18566 2004-05-29 Martin Baulig <martin@ximian.com>
18568 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
18570 * convert.cs (Convert.ImplicitReferenceConversion): If we're
18571 converting from a class type S to an interface type and we already
18572 have an object on the stack, don't box it again. Fixes #52578.
18574 2004-05-29 Martin Baulig <martin@ximian.com>
18576 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18577 Added support for `params' parameters. Fixes #59267.
18579 2004-05-29 Martin Baulig <martin@ximian.com>
18581 * literal.cs (NullPointer): Provide a private .ctor which sets
18582 `type' to TypeManager.object_type. Fixes #59048.
18584 2004-05-29 Martin Baulig <martin@ximian.com>
18586 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
18587 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
18589 * ecore.cs (EventExpr.instance_expr): Make the field private.
18591 2004-05-26 Marek Safar <marek.safar@seznam.cz>
18593 Fixed bug #50080 & cs0214-2.cs
18594 * expression.cs (Cast.DoResolve): Check unsafe context here.
18596 * statement.cs (Resolve.DoResolve): Likewise.
18598 2004-05-26 Martin Baulig <martin@ximian.com>
18600 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
18602 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
18603 (RootContext.LookupType): Pass down the `silent' flag.
18605 2004-05-25 Martin Baulig <martin@ximian.com>
18608 (MethodGroupExpr.IdenticalTypeName): New public property.
18609 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
18610 expression actually refers to a type.
18612 2004-05-25 Martin Baulig <martin@ximian.com>
18614 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
18615 for #56176 and made it actually work.
18617 2004-05-25 Martin Baulig <martin@ximian.com>
18619 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
18620 (FieldExpr, PropertyExpr): Override and implement
18621 CacheTemporaries. Fixes #52279.
18623 2004-05-25 Miguel de Icaza <miguel@ximian.com>
18625 * location.cs: In the new compiler listing a file twice is a
18626 warning, not an error.
18628 2004-05-24 Martin Baulig <martin@ximian.com>
18630 * enum.cs (Enum.DefineType): For the `BaseType' to be a
18631 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
18633 2004-05-24 Martin Baulig <martin@ximian.com>
18635 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
18636 walking the `using' list. Fixes #53921.
18638 2004-05-24 Martin Baulig <martin@ximian.com>
18640 * const.cs (Const.LookupConstantValue): Added support for
18641 EmptyCast's; fixes #55251.
18643 2004-05-24 Martin Baulig <martin@ximian.com>
18645 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
18646 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
18647 which does the CS0135 check. The reason is that we first need to
18648 check whether the variable actually exists.
18650 2004-05-24 Martin Baulig <martin@ximian.com>
18652 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
18653 than RootContext.LookupType() to find the explicit interface
18654 type. Fixes #58584.
18656 2004-05-24 Raja R Harinath <rharinath@novell.com>
18658 * Makefile: Simplify. Use executable.make.
18659 * mcs.exe.sources: New file. List of sources of mcs.exe.
18661 2004-05-24 Anders Carlsson <andersca@gnome.org>
18665 Use the invariant culture when doing String.Compare for CLS case
18668 2004-05-23 Martin Baulig <martin@ximian.com>
18670 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
18671 don't have any dots. Fixes #52622, added cs0246-8.cs.
18673 * namespace.cs (NamespaceEntry.Lookup): Likewise.
18675 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18677 * class.cs (MemberBase.Define): Reuse MemberType member for
18678 resolved type. Other methods can use it too.
18680 2004-05-23 Martin Baulig <martin@ximian.com>
18682 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
18683 the variable also exists in the current block (otherwise, we need
18684 to report a CS0103). Fixes #58670.
18686 2004-05-23 Martin Baulig <martin@ximian.com>
18688 * flowanalysis.cs (Reachability.Reachable): Compute this
18689 on-the-fly rather than storing it as a field.
18691 2004-05-23 Martin Baulig <martin@ximian.com>
18693 * flowanalysis.cs (Reachability.And): Manually compute the
18694 resulting `barrier' from the reachability.
18696 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18699 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
18700 instance of ObsoleteAttribute when symbol is obsolete.
18703 (IMethodData): Extended interface for ObsoleteAttribute support.
18705 2004-05-22 Marek Safar <marek.safar@seznam.cz>
18707 * attribute.cs: Fix bug #55970
18709 2004-05-22 Marek Safar <marek.safar@seznam.cz>
18713 (GetObsoleteAttribute): New method. Creates the instance of
18715 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
18716 ObsoleteAttribute when member is obsolete.
18717 (AttributeTester.Report_ObsoleteMessage): Common method for
18718 Obsolete error/warning reporting.
18721 (TypeContainer.base_classs_type): New member for storing parent type.
18724 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
18725 for this MemberCore.
18727 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18729 * attribute.cs, const.cs: Fix bug #58590
18731 2004-05-21 Martin Baulig <martin@ximian.com>
18733 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
18734 out parameters if the end of the method is unreachable. Fixes
18737 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18739 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
18740 Hari was right, why extra method.
18742 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18744 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
18746 2004-05-20 Martin Baulig <martin@ximian.com>
18748 Merged this back from gmcs to keep the differences to a minumum.
18750 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
18751 instead of a Declspace.
18752 (Attribute.ResolveType): Likewise.
18753 (Attributes.Search): Likewise.
18754 (Attributes.Contains): Likewise.
18755 (Attributes.GetClsCompliantAttribute): Likewise.
18757 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
18759 (MethodData.ApplyAttributes): Take an EmitContext instead of a
18762 2004-05-19 Marek Safar <marek.safar@seznam.cz>
18764 Fix bug #58688 (MCS does not report error when the same attribute
18767 * attribute.cs (Attribute.Emit): Distinction between null and default.
18769 2004-05-19 Raja R Harinath <rharinath@novell.com>
18771 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
18772 of a top-level attribute without an attribute target.
18773 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
18775 (Attribute.Conditional_GetConditionName),
18776 (Attribute.Obsolete_GetObsoleteMessage): Update.
18777 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
18778 part of ScanForIndexerName.
18779 (Attribute.CanIgnoreInvalidAttribute): New function.
18780 (Attribute.ScanForIndexerName): Move to ...
18781 (Attributes.ScanForIndexerName): ... here.
18782 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
18783 (Attributes.Search): New internal variant that can choose not to
18784 complain if types aren't resolved. The original signature now
18786 (Attributes.GetClsCompliantAttribute): Use internal variant, with
18787 complaints suppressed.
18788 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
18789 only if it not useful.
18790 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
18791 top-level for attributes that are shared between the assembly
18792 and a top-level class.
18793 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
18794 * class.cs: Update to reflect changes.
18795 (DefineIndexers): Fuse loops.
18796 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
18797 a couple more variants of attribute names.
18799 2004-05-18 Marek Safar <marek.safar@seznam.cz>
18801 Fix bug #52585 (Implemented explicit attribute declaration)
18804 (Attributable.ValidAttributeTargets): New abstract method. It gets
18805 list of valid attribute targets for explicit target declaration.
18806 (Attribute.Target): It holds target itself.
18807 (AttributeSection): Removed.
18808 (Attribute.CheckTargets): New method. It checks whether attribute
18809 target is valid for the current element.
18812 (EventProperty): New class. For events that are declared like
18813 property (with add and remove accessors).
18814 (EventField): New class. For events that are declared like field.
18817 * cs-parser.jay: Implemented explicit attribute target declaration.
18819 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
18820 Override ValidAttributeTargets.
18823 (ReturnParameter): Class for applying custom attributes on
18825 (ParameterAtribute): New class. Class for applying custom
18826 attributes on the parameter type.
18828 2004-05-17 Miguel de Icaza <miguel@ximian.com>
18830 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
18833 (Method): Allow UNSAFE here.
18835 * modifiers.cs: Support unsafe reporting.
18837 2004-05-17 Marek Safar <marek.safar@seznam.cz>
18839 * decl.cs: Fix bug #58478.
18841 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18843 * statement.cs: When checking for unreachable code on an EmptyStatement,
18844 set the location. Fixes bug #58488.
18846 2004-05-13 Miguel de Icaza <miguel@ximian.com>
18848 * driver.cs: Add -pkg handling.
18850 From Gonzalo: UseShelLExecute=false
18852 2004-05-12 Marek Safar <marek.safar@seznam.cz>
18855 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
18857 (Attribute.IsClsCompliaceRequired): Moved to base for better
18859 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
18860 when attribute is AttributeUsageAttribute.
18861 (Attribute.GetValidTargets): Simplified.
18862 (Attribute.GetAttributeUsage): New method returns AttributeUsage
18863 attribute for this type.
18864 (Attribute.ApplyAttributes): Method renamed to Emit and make
18866 (GlobalAttributeSection): New class for special handling of global
18867 attributes (assembly, module).
18868 (AttributeSection.Emit): New method.
18870 * class.cs: Implemented Attributable abstract methods.
18871 (MethodCore.LabelParameters): Moved to Parameter class.
18872 (Accessor): Is back simple class.
18873 (PropertyMethod): Implemented Attributable abstract class.
18874 (DelegateMethod): Implemented Attributable abstract class.
18875 (Event): New constructor for disctintion between normal Event
18876 and Event with accessors.
18878 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
18880 * codegen.cs, const.cs, decl.cs, delegate.cs:
18881 (CommonAssemblyModulClass): Implemented Attributable abstract class
18884 * enum.cs: Implement IAttributeSupport interface.
18885 (EnumMember): New class for emum members. Implemented Attributable
18889 (ParameterBase): Is abstract.
18890 (ReturnParameter): New class for easier [return:] attribute handling.
18892 * typemanager.cs: Removed builder_to_attr.
18894 2004-05-11 Raja R Harinath <rharinath@novell.com>
18897 * attribute.cs (Attribute.GetPositionalValue): New function.
18898 * class.cs (TypeContainer.VerifyMembers): New function.
18899 (TypeContainer.Emit): Use it.
18900 (ClassOrStruct): New base class for Class and Struct.
18901 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
18902 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
18904 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
18905 then each non-static field should have a FieldOffset attribute.
18906 Otherwise, none of the fields should have a FieldOffset attribute.
18907 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
18908 and FieldOffset attributes.
18909 * typemanager.cs (TypeManager.struct_layout_attribute_type)
18910 (TypeManager.field_offset_attribute_type): New core types.
18911 (TypeManager.InitCoreTypes): Initialize them.
18913 2004-05-11 Michal Moskal <malekith@pld-linux.org>
18915 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
18916 Return correct type.
18919 2004-05-09 Miguel de Icaza <miguel@ximian.com>
18921 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
18922 be implicitly converted to ulong.
18924 * expression.cs: The logic for allowing operator &, | and ^ worked
18925 was wrong, it worked before because we did not report an error in
18926 an else branch. Fixes 57895.
18928 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
18929 allow volatile fields to be reference types.
18931 2004-05-07 Miguel de Icaza <miguel@ximian.com>
18933 * driver.cs: Add support for /debug-
18935 2004-05-07 Raja R Harinath <rharinath@novell.com>
18937 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
18938 Add a 'complain' parameter to silence errors.
18939 (Attribute.Resolve): Update to changes. Put in sanity check to catch
18940 silently overlooked type-resolutions.
18941 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
18942 to reflect changes.
18943 (Attributes.Search): New function.
18944 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
18945 (Attributes.GetAttributeFullName): Remove hack.
18946 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
18947 Update to reflect changes.
18948 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
18949 Use Attributes.Search instead of nested loops.
18951 2004-05-07 Marek Safar <marek.safar@seznam.cz>
18954 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
18955 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
18956 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
18958 * report.cs: (Report.Warning): Renamed to Warning_T because of
18959 parameter collision.
18961 2004-05-05 Raja R Harinath <rharinath@novell.com>
18963 * expression.cs (MemberAccess.ResolveMemberAccess):
18964 Exit with non-zero status after Report.Error.
18965 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
18967 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
18969 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
18971 * support.cs: Don't hang when the file is empty.
18973 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
18975 * support.cs: In SeekableStreamReader, compute the preamble size of the
18976 underlying stream. Position changes should take into account that initial
18979 2004-05-03 Todd Berman <tberman@sevenl.net>
18981 * driver.cs: remove unused GetSysVersion function.
18983 2004-05-03 Todd Berman <tberman@sevenl.net>
18985 * driver.cs: Remove the hack from saturday, as well as the hack
18986 from jackson (LoadAssemblyFromGac), also adds the CWD to the
18987 link_paths to get that bit proper.
18989 2004-05-01 Todd Berman <tberman@sevenl.net>
18991 * driver.cs: Try a LoadFrom before a Load, this checks the current
18992 path. This is currently a bug in mono that is be fixed, however, this
18993 provides a workaround for now. This will be removed when the bug
18996 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
18998 * CryptoConvert.cs: Updated to latest version. Fix issue with
18999 incomplete key pairs (#57941).
19001 2004-05-01 Todd Berman <tberman@sevenl.net>
19003 * driver.cs: Remove '.' from path_chars, now System.* loads properly
19006 2004-04-30 Jackson Harper <jackson@ximian.com>
19008 * codegen.cs: Open keys readonly.
19010 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19012 * typemanager.cs: don't report cyclic struct layout when a struct
19013 contains 2 or more fields of the same type. Failed for Pango.AttrShape
19014 which has 2 Pango.Rectangle fields.
19016 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
19018 * expression.cs: Handle IntPtr comparisons with IL code
19019 rather than a method call.
19021 2004-04-29 Martin Baulig <martin@ximian.com>
19023 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
19024 the list of PropertyInfo's in class hierarchy and find the
19025 accessor. Fixes #56013.
19027 2004-04-29 Martin Baulig <martin@ximian.com>
19029 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
19031 2004-04-29 Martin Baulig <martin@ximian.com>
19033 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
19035 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
19037 2004-04-29 Martin Baulig <martin@ximian.com>
19039 * class.cs (ConstructorInitializer.Resolve): Check whether the
19040 parent .ctor is accessible. Fixes #52146.
19042 2004-04-29 Martin Baulig <martin@ximian.com>
19044 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
19046 * statement.cs (Using.EmitLocalVariableDecls): Use
19047 TypeManager.idisposable_type, not typeof (IDisposable).
19048 (Foreach.EmitCollectionForeach): Added support for valuetypes.
19050 2004-04-29 Martin Baulig <martin@ximian.com>
19052 * class.cs (Event.Define): Don't emit the field and don't set
19053 RTSpecialName and SpecialName for events on interfaces. Fixes
19056 2004-04-29 Raja R Harinath <rharinath@novell.com>
19058 Refactor Attribute.ApplyAttributes.
19059 * attribute.cs (Attributable): New base class for objects that can
19060 have Attributes applied on them.
19061 (Attribute): Make AttributeUsage fields public.
19062 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
19063 (Attribute.IsInternalCall): New property.
19064 (Attribute.UsageAttr): Convert to a public read-only property.
19065 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
19066 (Attribute.ResolveType, Attribute.Resolve)
19067 (Attribute.ScanForIndexerName): Update to reflect changes.
19068 (Attribute.CheckAttributeTarget): Re-format.
19069 (Attribute.ApplyAttributes): Refactor, to various
19070 Attributable.ApplyAttributeBuilder methods.
19071 * decl.cs (MemberCore): Make Attributable.
19072 * class.cs (Accessor): Make Attributable.
19073 (MethodData.ApplyAttributes): Use proper attribute types, not
19075 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
19076 (TypeContainer.ApplyAttributeBuilder)
19077 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
19078 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
19079 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
19080 (Operator.ApplyAttributeBuilder): New factored-out methods.
19081 * const.cs (Const.ApplyAttributeBuilder): Likewise.
19082 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
19083 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
19084 * parameter.cs (ParameterBase): New Attributable base class
19085 that can also represent Return types.
19086 (Parameter): Update to the changes.
19088 2004-04-29 Jackson Harper <jackson@ximian.com>
19090 * driver.cs: Prefer the corlib system version when looking for
19091 assemblies in the GAC. This is still a hack, but its a better hack
19094 2004-04-29 Marek Safar <marek.safar@seznam.cz>
19096 * decl.cs, enum.cs: Improved error 3005 reporting.
19098 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
19099 (related_symbols): New private member for list of symbols
19100 related to reported error/warning.
19102 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
19104 2004-04-29 Martin Baulig <martin@ximian.com>
19106 * ecore.cs (Expression.Constantify): If we're an enum and
19107 TypeManager.TypeToCoreType() doesn't give us another type, use
19108 t.UnderlyingSystemType. Fixes #56178.
19110 2004-04-29 Martin Baulig <martin@ximian.com>
19112 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
19113 interfaces and for each interface, only add members directly
19114 declared in that interface. Fixes #53255.
19116 2004-04-28 Martin Baulig <martin@ximian.com>
19118 * expression.cs (ConditionalLogicalOperator): Use a temporary
19119 variable for `left' to avoid that we evaluate it more than once;
19122 2004-04-28 Martin Baulig <martin@ximian.com>
19124 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
19127 2004-04-28 Martin Baulig <martin@ximian.com>
19129 * statement.cs (LocalInfo.Resolve): Check whether the type is not
19132 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
19133 whether the type is not void (CS1547).
19135 2004-04-28 Martin Baulig <martin@ximian.com>
19137 * expression.cs (Unary.DoResolveLValue): Override this and report
19138 CS0131 for anything but Operator.Indirection.
19140 2004-04-28 Martin Baulig <martin@ximian.com>
19142 Committing a patch from Ben Maurer; see bug #50820.
19144 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19147 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19150 2004-04-28 Martin Baulig <martin@ximian.com>
19152 Committing a patch from Ben Maurer; see bug #50820.
19154 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19157 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19160 2004-04-28 Martin Baulig <martin@ximian.com>
19162 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
19163 (Block.AddLabel): Call DoLookupLabel() to only search in the
19166 2004-04-28 Martin Baulig <martin@ximian.com>
19168 * cfold.cs (ConstantFold.BinaryFold): Added special support for
19169 comparing StringConstants and NullLiterals in Equality and Inequality.
19171 2004-04-28 Jackson Harper <jackson@ximian.com>
19173 * driver.cs: Attempt to load referenced assemblies from the
19174 GAC. This is the quick and dirty version of this method that
19175 doesnt take into account versions and just takes the first
19176 canidate found. Will be good enough for now as we will not have more
19177 then one version installed into the GAC until I update this method.
19179 2004-04-28 Martin Baulig <martin@ximian.com>
19181 * typemanager.cs (TypeManager.CheckStructCycles): New public
19182 static method to check for cycles in the struct layout.
19184 * rootcontext.cs (RootContext.PopulateTypes): Call
19185 TypeManager.CheckStructCycles() for each TypeContainer.
19186 [Note: We only need to visit each type once.]
19188 2004-04-28 Martin Baulig <martin@ximian.com>
19190 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
19192 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
19193 success and added `out object value'. Use a `bool resolved' field
19194 to check whether we've already been called rather than
19195 `ConstantValue != null' since this breaks for NullLiterals.
19197 2004-04-28 Raja R Harinath <rharinath@novell.com>
19199 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
19200 setting of this flag, since the 'set' method may be non-public.
19202 2004-04-28 Raja R Harinath <rharinath@novell.com>
19204 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
19205 check on current_vector.Block.
19207 2004-04-27 Martin Baulig <martin@ximian.com>
19209 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
19210 a field initializer. Fixes #56459.
19212 2004-04-27 Martin Baulig <martin@ximian.com>
19214 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
19215 we're not attempting to use an indexer. Fixes #52154.
19217 2004-04-27 Martin Baulig <martin@ximian.com>
19219 * statement.cs (Return): Don't create a return label if we don't
19220 need it; reverts my change from January 20th. Thanks to Ben
19223 2004-04-27 Martin Baulig <martin@ximian.com>
19225 According to the spec, `goto' can only leave a nested scope, but
19228 * statement.cs (Block.LookupLabel): Only lookup in the current
19229 block, don't recurse into parent or child blocks.
19230 (Block.AddLabel): Check in parent and child blocks, report
19231 CS0140/CS0158 if we find a duplicate.
19232 (Block): Removed this indexer for label lookups.
19233 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
19234 this already does the error reporting for us.
19237 (FlowBranching.UsageVector.Block): New public variable; may be null.
19238 (FlowBranching.CreateSibling): Added `Block' argument.
19239 (FlowBranching.LookupLabel): New public virtual method. Lookup a
19240 label for the target of a `goto' and check whether we're not
19241 leaving a `finally'.
19243 2004-04-27 Martin Baulig <martin@ximian.com>
19245 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
19246 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
19249 2004-04-27 Martin Baulig <martin@ximian.com>
19251 * statement.cs (Block.AddLabel): Also check for implicit blocks
19252 and added a CS0158 check.
19254 2004-04-27 Martin Baulig <martin@ximian.com>
19256 * flowanalysis.cs (FlowBranchingLoop): New class.
19257 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
19258 UsageVector's instead of an ArrayList.
19259 (FlowBranching.Label): Likewise.
19260 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
19261 (FlowBranching.AddBreakVector): New method.
19263 2004-04-27 Miguel de Icaza <miguel@ximian.com>
19265 * attribute.cs: Small regression fix: only convert the type if we
19266 the type is different, fixes System.Drawing build.
19268 2004-04-27 Martin Baulig <martin@ximian.com>
19270 * attribute.cs (Attribute.Resolve): If we have a constant value
19271 for a named field or property, implicity convert it to the correct
19274 2004-04-27 Raja R Harinath <rharinath@novell.com>
19276 * statement.cs (Block.Block): Implicit blocks share
19277 'child_variable_names' fields with parent blocks.
19278 (Block.AddChildVariableNames): Remove.
19279 (Block.AddVariable): Mark variable as "used by a child block" in
19280 every surrounding block.
19281 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
19282 been used in a child block, complain about violation of "Invariant
19283 meaning in blocks" rule.
19284 * cs-parser.jay (declare_local_variables): Don't use
19285 AddChildVariableNames.
19286 (foreach_statement): Don't create an implicit block: 'foreach'
19287 introduces a scope.
19289 2004-04-23 Miguel de Icaza <miguel@ximian.com>
19291 * convert.cs (ImplicitNumericConversion): 0 is also positive when
19292 converting from 0L to ulong. Fixes 57522.
19294 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19296 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
19297 derived class hides via 'new' keyword field from base class (test-242.cs).
19298 TODO: Handle this in the more general way.
19300 * class.cs (CheckBase): Ditto.
19302 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19304 * decl.cs (caching_flags): New member for storing cached values
19306 (MemberCore.Flags): New enum where bit flags for caching_flags
19308 (MemberCore.cls_compliance): Moved to caching_flags.
19309 (DeclSpace.Created): Moved to caching_flags.
19311 * class.cs: Use caching_flags instead of DeclSpace.Created
19313 2004-04-21 Miguel de Icaza <miguel@ximian.com>
19315 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
19316 if we are only a derived class, not a nested class.
19318 * typemanager.cs: Same as above, but do this at the MemberLookup
19319 level (used by field and methods, properties are handled in
19320 PropertyExpr). Allow for the qualified access if we are a nested
19323 2004-04-21 Marek Safar <marek.safar@seznam.cz>
19325 * class.cs: Refactoring.
19326 (IMethodData): New inteface; Holds links to parent members
19327 to avoid member duplication (reduced memory allocation).
19328 (Method): Implemented IMethodData interface.
19329 (PropertyBase): New inner classes for get/set methods.
19330 (PropertyBase.PropertyMethod): Implemented IMethodData interface
19331 (Event): New inner classes for add/remove methods.
19332 (Event.DelegateMethod): Implemented IMethodData interface.
19334 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
19335 EmitContext (related to class.cs refactoring).
19337 2004-04-21 Raja R Harinath <rharinath@novell.com>
19339 * delegate.cs (Delegate.VerifyApplicability): If the number of
19340 arguments are the same as the number of parameters, first try to
19341 verify applicability ignoring any 'params' modifier on the last
19345 2004-04-16 Raja R Harinath <rharinath@novell.com>
19347 * class.cs (TypeContainer.AddIndexer): Use
19348 'ExplicitInterfaceName' to determine if interface name was
19349 explicitly specified. 'InterfaceType' is not initialized at this time.
19350 (TypeContainer.DefineIndexers): Remove use of temporary list. The
19351 Indexers array is already in the required order. Initialize
19352 'IndexerName' only if there are normal indexers.
19353 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
19354 (TypeContainer.Emit): Emit DefaultMember attribute only if
19355 IndexerName is initialized.
19358 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
19360 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
19363 2004-04-15 Raja R Harinath <rharinath@novell.com>
19365 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
19369 * attribute.cs (Attribute.Resolve): Check for duplicate named
19373 2004-04-15 Miguel de Icaza <miguel@ximian.com>
19375 * iterators.cs (MarkYield): track whether we are in an exception,
19376 and generate code accordingly. Use a temporary value to store the
19377 result for our state.
19379 I had ignored a bit the interaction of try/catch with iterators
19380 since their behavior was not entirely obvious, but now it is
19381 possible to verify that our behavior is the same as MS .NET 2.0
19385 2004-04-14 Miguel de Icaza <miguel@ximian.com>
19387 * iterators.cs: Avoid creating temporaries if there is no work to
19390 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
19391 Enumerations, use TypeManager.EnumToUnderlying and call
19394 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
19397 (This.Emit): Use EmitContext.EmitThis to emit our
19400 (This.EmitAssign): Ditto.
19402 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
19403 codepaths, we will move all the functionality into
19406 (FieldExpr.EmitAssign): Ditto.
19408 This fixes several hidden bugs that I uncovered while doing a code
19409 review of this today.
19411 * codegen.cs (EmitThis): reworked so the semantics are more clear
19412 and also support value types "this" instances.
19414 * iterators.cs: Changed so that for iterators in value types, we
19415 do not pass the value type as a parameter.
19417 Initialization of the enumerator helpers is now done in the caller
19418 instead of passing the parameters to the constructors and having
19419 the constructor set the fields.
19421 The fields have now `assembly' visibility instead of private.
19423 2004-04-11 Miguel de Icaza <miguel@ximian.com>
19425 * expression.cs (Argument.Resolve): Check if fields passed as ref
19426 or out are contained in a MarshalByRefObject.
19428 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
19429 another compiler type.
19431 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
19433 * class.cs (Indexer.Define): use the new name checking method.
19434 Also, return false on an error.
19435 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
19436 (is_identifier_[start/part]_character): make static.
19438 2004-04-10 Miguel de Icaza <miguel@ximian.com>
19440 * expression.cs (Binary.ResolveOperator): Do no append strings
19441 twice: since we can be invoked more than once (array evaluation)
19442 on the same concatenation, take care of this here. Based on a fix
19443 from Ben (bug #56454)
19445 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
19447 * codegen.cs: Fix another case where CS1548 must be reported (when
19448 delay-sign isn't specified and no private is available #56564). Fix
19449 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
19450 error when MCS is used on the MS runtime and we need to delay-sign
19451 (which seems unsupported by AssemblyBuilder - see #56621).
19453 2004-04-08 Marek Safar <marek.safar@seznam.cz>
19455 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
19456 (TypeManager.ComputeNamespaces): Faster implementation for
19459 * compiler.csproj: Updated AssemblyName to mcs.
19461 2004-04-07 Miguel de Icaza <miguel@ximian.com>
19463 * rootcontext.cs: Add new types to the boot resolution.
19465 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
19466 MulticastDelegate is not allowed.
19468 * typemanager.cs: Add new types to lookup: System.TypedReference
19471 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
19472 check for TypedReference or ArgIterator, they are not allowed.
19474 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
19475 makes us properly catch 1510 in some conditions (see bug 56016 for
19478 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
19480 * CryptoConvert.cs: update from corlib version
19483 2004-04-05 Miguel de Icaza <miguel@ximian.com>
19485 * class.cs (Indexer.Define): Check indexername declaration
19487 2004-04-05 Marek Safar <marek.safar@seznam.cz>
19489 * attribute.cs (IsClsCompliant): Fixed problem with handling
19490 all three states (compliant, not-compliant, undetected).
19492 2004-03-30 Marek Safar <marek.safar@seznam.cz>
19494 * attribute.cs (Attribute): Location is now public.
19495 (Resolve): Store resolved arguments (pos_values) in attribute class.
19496 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
19497 (GetClsCompliantAttributeValue): New method that gets
19498 CLSCompliantAttribute value.
19499 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
19500 if exists else null.
19501 (AttributeTester): New class for CLS-Compliant verification routines.
19503 * class.cs (Emit): Add CLS-Compliant verification.
19504 (Method.GetSignatureForError): Implemented.
19505 (Constructor.GetSignatureForError): Implemented
19506 (Constructor.HasCompliantArgs): Returns if constructor has
19507 CLS-Compliant arguments.
19508 (Constructor.Emit): Override.
19509 (Construcor.IsIdentifierClsCompliant): New method; For constructors
19510 is needed to test only parameters.
19511 (FieldBase.GetSignatureForError): Implemented.
19512 (TypeContainer): New member for storing base interfaces.
19513 (TypeContainer.FindMembers): Search in base interfaces too.
19515 * codegen.cs (GetClsComplianceAttribute): New method that gets
19516 assembly or module CLSCompliantAttribute value.
19517 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
19519 (ModuleClass.Emit): Add error 3012 test.
19521 * const.cs (Emit): Override and call base for CLS-Compliant tests.
19523 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
19524 state for all decl types.
19525 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
19526 if CLS-Compliant tests are required.
19527 (IsClsCompliaceRequired): New method. Analyze whether code
19528 must be CLS-Compliant.
19529 (IsExposedFromAssembly): New method. Returns true when MemberCore
19530 is exposed from assembly.
19531 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
19532 value or gets cached value.
19533 (HasClsCompliantAttribute): New method. Returns true if MemberCore
19534 is explicitly marked with CLSCompliantAttribute.
19535 (IsIdentifierClsCompliant): New abstract method. This method is
19536 used to testing error 3005.
19537 (IsIdentifierAndParamClsCompliant): New method. Common helper method
19538 for identifier and parameters CLS-Compliant testing.
19539 (VerifyClsCompliance): New method. The main virtual method for
19540 CLS-Compliant verifications.
19541 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
19542 null. I don't know why is null (too many public members !).
19543 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
19544 and get value of first CLSCompliantAttribute that found.
19546 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
19547 (VerifyClsCompliance): Override and add extra tests.
19549 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
19550 clscheck- disable CLS-Compliant verification event if assembly is has
19551 CLSCompliantAttribute(true).
19553 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
19554 ApllyAttribute is now called in emit section as in the other cases.
19555 Possible future Emit integration.
19556 (IsIdentifierClsCompliant): New override.
19557 (VerifyClsCompliance): New override.
19558 (GetEnumeratorName): Returns full enum name.
19560 * parameter.cs (GetSignatureForError): Implemented.
19562 * report.cs (WarningData): New struct for Warning message information.
19563 (LocationOfPreviousError): New method.
19564 (Warning): New method. Reports warning based on the warning table.
19565 (Error_T): New method. Reports error based on the error table.
19567 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
19568 verifications are done here.
19570 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
19572 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
19573 CLSCompliantAttribute.
19574 (all_imported_types): New member holds all imported types from other
19576 (LoadAllImportedTypes): New method fills static table with exported types
19577 from all referenced assemblies.
19578 (Modules): New property returns all assembly modules.
19580 2004-03-30 Miguel de Icaza <miguel@ximian.com>
19582 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
19583 throwing a parser error.
19585 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
19586 which removes the hardcoded get_/set_ prefixes for properties, as
19587 IL allows for the properties to be named something else.
19591 * expression.cs: Do not override operand before we know if it is
19592 non-null. Fix 56207
19594 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19596 * typemanager.cs: support for pinned variables.
19598 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19600 * decl.cs, typemanager.cs: Avoid using an arraylist
19601 as a buffer if there is only one result set.
19603 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19605 * expression.cs: Make sure you cant call a static method
19606 with an instance expression, bug #56174.
19608 2004-03-29 Miguel de Icaza <miguel@ximian.com>
19610 * class.cs (IsDuplicateImplementation): Improve error reporting to
19611 flag 663 (method only differs in parameter modifier).
19613 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
19614 in preprocessor directives.
19616 * location.cs (LookupFile): Allow for the empty path.
19618 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
19619 better approach for some of that patch, but its failing with the
19620 CharSet enumeration. For now try/catch will do.
19622 * typemanager.cs: Do not crash if a struct does not have fields.
19625 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19627 * expression.cs: cs0213, cant fix a fixed expression.
19630 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19632 * cs-parser.jay: detect invalid embeded statements gracefully.
19635 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19637 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
19640 the invocation type may not be a subclass of the tye of the item/
19641 The type of the item must be a subclass of the invocation item.
19646 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
19648 * attribute.cs: Added methods to get a string and a bool from an
19649 attribute. Required to information from AssemblyKeyFileAttribute,
19650 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
19651 * codegen.cs: Modified AssemblyName creation to include support for
19652 strongnames. Catch additional exceptions to report them as CS1548.
19653 * compiler.csproj: Updated include CryptoConvert.cs.
19654 * compiler.csproj.user: Removed file - user specific configuration.
19655 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
19656 Mono.Security assembly. The original class is maintained and tested in
19657 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
19658 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
19659 like CSC 8.0 (C# v2) supports.
19660 * Makefile: Added CryptoConvert.cs to mcs sources.
19661 * rootcontext.cs: Added new options for strongnames.
19663 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
19665 * driver.cs: For --expect-error, report error code `2'
19666 if the program compiled with no errors, error code `1' if
19667 it compiled with an error other than the one expected.
19669 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
19671 * compiler.csproj: Updated for Visual Studio .NET 2003.
19672 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
19673 * compiler.sln: Updated for Visual Studio .NET 2003.
19675 2004-03-24 Ravi Pratap M <ravi@ximian.com>
19677 * expression.cs: Fix bug #47234. We basically need to apply the
19678 rule that we prefer the conversion of null to a reference type
19679 when faced with a conversion to 'object' (csc behaviour).
19681 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19683 * statement.cs: Shorter form for foreach, eliminates
19684 a local variable. r=Martin.
19686 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19688 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
19689 checks if we can use brtrue/brfalse to test for 0.
19690 * expression.cs: use the above in the test for using brtrue/brfalse.
19691 cleanup code a bit.
19693 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19695 * expression.cs: Rewrite string concat stuff. Benefits:
19697 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
19698 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
19699 rather than a concat chain.
19701 * typemanager.cs: Add lookups for more concat overloads.
19703 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19705 * expression.cs: Emit shorter il code for array init.
19722 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
19724 * statement.cs: Before, two switch blocks would be merged if the
19725 total size of the blocks (end_item - begin_item + 1) was less than
19726 two times the combined sizes of the blocks.
19728 Now, it will only merge if after the merge at least half of the
19733 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
19735 * class.cs : csc build fix for GetMethods(). See bug #52503.
19737 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
19739 * expression.cs: Make sure fp comparisons work with NaN.
19740 This fixes bug #54303. Mig approved this patch a long
19741 time ago, but we were not able to test b/c the runtime
19744 2004-03-19 Miguel de Icaza <miguel@ximian.com>
19746 * ecore.cs (TypExpr.GetHashCode): implement this overload.
19748 2004-03-19 Martin Baulig <martin@ximian.com>
19750 * class.cs (MemberCore.IsDuplicateImplementation): Report the
19751 error here and not in our caller.
19753 2004-03-19 Martin Baulig <martin@ximian.com>
19755 * interface.cs: Completely killed this file.
19756 (Interface): We're now a TypeContainer and live in class.cs.
19758 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
19759 argument; we're now also called for interfaces.
19760 (TypeContainer.DefineMembers): Allow this method being called
19762 (TypeContainer.GetMethods): New public method; formerly known as
19763 Interface.GetMethod(). This is used by PendingImplementation.
19764 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
19765 it's now private and non-static.
19766 (Interface): Moved this here; it's now implemented similar to
19768 (Method, Property, Event, Indexer): Added `bool is_interface'
19769 argument to their .ctor's.
19770 (MemberBase.IsInterface): New public field.
19772 * cs-parser.jay: Create normal Method, Property, Event, Indexer
19773 instances instead of InterfaceMethod, InterfaceProperty, etc.
19774 (opt_interface_base): Removed; we now use `opt_class_base' instead.
19775 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
19777 2004-03-19 Martin Baulig <martin@ximian.com>
19779 * class.cs (MethodCore.IsDuplicateImplementation): New private
19780 method which does the CS0111 checking.
19781 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
19782 Use IsDuplicateImplementation().
19784 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
19786 * decl.cs (FindMemberToOverride): New method to find the correct
19787 method or property to override in the base class.
19789 - Make Method/Property use the above method to find the
19790 version in the base class.
19791 - Remove the InheritableMemberSignatureCompare as it is now
19794 This patch makes large code bases much faster to compile, as it is
19795 O(n) rather than O(n^2) to do this validation.
19797 Also, it fixes bug 52458 which is that nested classes are not
19798 taken into account when finding the base class member.
19800 Reviewed/Approved by Martin.
19802 2004-03-17 Marek Safar <marek.safar@seznam.cz>
19804 * interface.cs: In all interface classes removed redundant
19805 member initialization.
19807 2004-03-16 Martin Baulig <martin@ximian.com>
19809 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
19811 2004-03-15 Miguel de Icaza <miguel@ximian.com>
19813 * decl.cs (DefineTypeAndParents): New helper method to define a
19814 type's containers before the type itself is defined; This is a
19815 bug exposed by the recent changes to Windows.Forms when an
19816 implemented interface was defined inside a class that had not been
19819 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
19821 (Check): Loop correctly to report errors modifiers
19822 (UNSAFE was not in the loop, since it was the same as TOP).
19824 * interface.cs: Every interface member now takes a ModFlags,
19825 instead of a "is_new" bool, which we set on the base MemberCore.
19827 Every place where we called "UnsafeOk" in the interface, now we
19828 call the proper member (InterfaceMethod.UnsafeOK) instead to get
19829 the unsafe settings from the member declaration instead of the
19830 container interface.
19832 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
19834 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
19835 `set_indexer_name' to the pending bits (one per type).
19837 We fixed a bug today that was picking the wrong method to
19838 override, since for properties the existing InterfaceMethod code
19839 basically ignored the method name. Now we make sure that the
19840 method name is one of the valid indexer names.
19842 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
19844 * support.cs (SeekableStreamReader): Keep track of stream byte
19845 positions and don't mix them with character offsets to the buffer.
19847 Patch from Gustavo Giráldez
19849 2004-03-15 Marek Safar <marek.safar@seznam.cz>
19851 * interface.cs (InterfaceSetGetBase): Removed double member
19852 initialization, base class does it as well.
19854 2004-03-13 Martin Baulig <martin@ximian.com>
19856 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
19857 when compiling corlib.
19859 2004-03-13 Miguel de Icaza <miguel@ximian.com>
19861 * convert.cs (ExplicitConversion): We were reporting an error on
19862 certain conversions (object_type source to a value type, when the
19863 expression was `null') before we had a chance to pass it through
19864 the user defined conversions.
19866 * driver.cs: Replace / and \ in resource specifications to dots.
19869 * class.cs: Add check for duplicate operators. Fixes 52477
19871 2004-03-11 Miguel de Icaza <miguel@ximian.com>
19873 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
19874 that are in the middle of the statements, not only at the end.
19877 * class.cs (TypeContainer.AddField): No longer set the
19878 `HaveStaticConstructor' flag, now we call it
19879 `UserDefineStaticConstructor' to diferentiate the slightly
19880 semantic difference.
19882 The situation is that we were not adding BeforeFieldInit (from
19883 Modifiers.TypeAttr) to classes that could have it.
19884 BeforeFieldInit should be set to classes that have no static
19889 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
19891 And most importantly Zoltan's comment:
19893 http://bugzilla.ximian.com/show_bug.cgi?id=44229
19895 "I think beforefieldinit means 'it's ok to initialize the type sometime
19896 before its static fields are used', i.e. initialization does not need
19897 to be triggered by the first access to the type. Setting this flag
19898 helps the JIT to compile better code, since it can run the static
19899 constructor at JIT time, and does not need to generate code to call it
19900 (possibly lots of times) at runtime. Unfortunately, mcs does not set
19901 this flag for lots of classes like String.
19903 csc sets this flag if the type does not have an explicit static
19904 constructor. The reasoning seems to be that if there are only static
19905 initalizers for a type, and no static constructor, then the programmer
19906 does not care when this initialization happens, so beforefieldinit
19909 This bug prevents the AOT compiler from being usable, since it
19910 generates so many calls to mono_runtime_class_init that the AOT code
19911 is much slower than the JITted code. The JITted code is faster,
19912 because it does not generate these calls if the vtable is type is
19913 already initialized, which is true in the majority of cases. But the
19914 AOT compiler can't do this."
19916 2004-03-10 Miguel de Icaza <miguel@ximian.com>
19918 * class.cs (MethodData.Emit): Refactor the code so symbolic
19919 information is generated for destructors; For some reasons we
19920 were taking a code path that did not generate symbolic information
19923 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
19925 * class.cs: Create a Constructor.CheckBase method that
19926 takes care of all validation type code. The method
19927 contains some code that was moved from Define.
19929 It also includes new code that checks for duplicate ctors.
19930 This fixes bug #55148.
19932 2004-03-09 Joshua Tauberer <tauberer@for.net>
19934 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
19935 a { ... }-style array creation invokes EmitStaticInitializers
19936 which is not good for reference-type arrays. String, decimal
19937 and now null constants (NullCast) are not counted toward
19938 static initializers.
19940 2004-03-05 Martin Baulig <martin@ximian.com>
19942 * location.cs (SourceFile.HasLineDirective): New public field;
19943 specifies whether the file contains or is referenced by a "#line"
19945 (Location.DefineSymbolDocuments): Ignore source files which
19946 either contain or are referenced by a "#line" directive.
19948 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
19950 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
19951 direct access to our parent, so check the method inline there.
19953 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
19955 * expression.cs (Invocation.EmitCall): Miguel's last commit
19956 caused a regression. If you had:
19961 In Foo the implict this would be null.
19963 2004-02-27 Miguel de Icaza <miguel@ximian.com>
19965 * expression.cs (Invocation.EmitCall): If the method is not
19966 virtual, do not emit a CallVirt to it, use Call.
19968 * typemanager.cs (GetFullNameSignature): Improve the method to
19969 cope with ".ctor" and replace it with the type name.
19971 * class.cs (ConstructorInitializer.Resolve): Now the method takes
19972 as an argument the ConstructorBuilder where it is being defined,
19973 to catch the recursive constructor invocations.
19975 2004-02-26 Miguel de Icaza <miguel@ximian.com>
19977 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
19978 routines to check if a type is an enumerable/enumerator allow
19979 classes that implement the IEnumerable or IEnumerator interfaces.
19981 * class.cs (Property, Operator): Implement IIteratorContainer, and
19982 implement SetYields.
19984 (Property.Define): Do the block swapping for get_methods in the
19985 context of iterators. We need to check if Properties also
19986 include indexers or not.
19988 (Operator): Assign the Block before invoking the
19989 OperatorMethod.Define, so we can trigger the Iterator code
19992 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
19993 Property and Operator classes are not created when we parse the
19994 declarator but until we have the block completed, so we use a
19995 singleton SimpleIteratorContainer.Simple to flag whether the
19996 SetYields has been invoked.
19998 We propagate this setting then to the Property or the Operator to
19999 allow the `yield' to function.
20001 2004-02-25 Marek Safar <marek.safar@seznam.cz>
20003 * codegen.cs: Implemented attribute support for modules.
20004 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
20005 Assembly/Module functionality.
20007 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
20008 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
20009 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
20011 2004-02-16 Marek Safar <marek.safar@seznam.cz>
20013 * interface.cs (FindMembers): The operation is performed on all base
20014 interfaces and not only on the first. It is required for future CLS Compliance patch.
20016 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
20018 * statement.cs, codegen.cs:
20019 This patch deals with patterns such as:
20021 public class List : IEnumerable {
20023 public MyEnumerator GetEnumerator () {
20024 return new MyEnumerator(this);
20027 IEnumerator IEnumerable.GetEnumerator () {
20031 public struct MyEnumerator : IEnumerator {
20036 Before, there were a few things we did wrong:
20037 1) we would emit callvirt on a struct, which is illegal
20038 2) we emited ldarg when we needed to emit ldarga
20039 3) we would mistakenly call the interface methods on an enumerator
20040 type that derived from IEnumerator and was in another assembly. For example:
20042 public class MyEnumerator : IEnumerator
20044 Would have the interface methods called, even if there were public impls of the
20045 method. In a struct, this lead to invalid IL code.
20047 2004-02-11 Marek Safar <marek.safar@seznam.cz>
20049 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
20052 * delegate.cs (Define): Fixed crash when delegate type is undefined.
20054 2004-02-11 Miguel de Icaza <miguel@ximian.com>
20056 * cs-parser.jay: Fix small regression: we were not testing V2
20057 compiler features correctly.
20059 * interface.cs: If the emit context is null, then create one
20061 2004-02-09 Marek Safar <marek.safar@seznam.cz>
20063 * decl.cs (GetSignatureForError): New virtual method to get full name
20064 for error messages.
20066 * attribute.cs (IAttributeSupport): New interface for attribute setting.
20067 Now it is possible to rewrite ApplyAttributes method to be less if/else.
20069 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
20070 Duplicated members and code in these classes has been removed.
20071 Better encapsulation in these classes.
20073 2004-02-07 Miguel de Icaza <miguel@ximian.com>
20075 * assign.cs (Assign.DoResolve): When dealing with compound
20076 assignments, there is a new rule in ECMA C# 2.4 (might have been
20077 there before, but it is documented here) that states that in:
20081 If b is of type int, and the `op' is a shift-operator, then the
20082 above is evaluated as:
20086 * expression.cs (Binary.ResolveOperator): Instead of testing for
20087 int/uint/long/ulong, try to implicitly convert to any of those
20088 types and use that in pointer arithmetic.
20090 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
20091 method to print information for from the type, not from the
20092 null-method we were given.
20094 2004-02-01 Duncan Mak <duncan@ximian.com>
20096 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
20097 parsing for cmd, fixes bug #53694.
20099 2004-02-04 Marek Safar <marek.safar@seznam.cz>
20101 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
20102 in the member name duplication tests. Property and operator name duplication
20103 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
20105 2004-02-03 Marek Safar <marek.safar@seznam.cz>
20107 * interface.cs (PopulateMethod): Fixed crash when interface method
20108 returns not existing type (error test cs0246-3.cs).
20110 2004-02-02 Ravi Pratap M <ravi@ximian.com>
20112 * cs-parser.jay (interface_accessors): Re-write actions to also
20113 store attributes attached to get and set methods. Fix spelling
20116 (inteface_property_declaration): Modify accordingly.
20118 (InterfaceAccessorInfo): New helper class to store information to pass
20119 around between rules that use interface_accessors.
20121 * interface.cs (Emit): Apply attributes on the get and set
20122 accessors of properties and indexers too.
20124 * attribute.cs (ApplyAttributes): Modify accordingly to use the
20125 right MethodBuilder when applying attributes to the get and set accessors.
20127 2004-01-31 Miguel de Icaza <miguel@ximian.com>
20129 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
20131 2004-01-26 Miguel de Icaza <miguel@ximian.com>
20133 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
20135 2004-01-25 Miguel de Icaza <miguel@ximian.com>
20137 * cs-parser.jay: Remove YIELD token, instead use the new grammar
20138 changes that treat `yield' specially when present before `break'
20139 or `return' tokens.
20141 * cs-tokenizer.cs: yield is no longer a keyword.
20143 2004-01-23 Marek Safar <marek.safar@seznam.cz>
20145 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
20146 setting for default constructors.
20147 For default constructors are almost every time set wrong Modifier. The
20148 generated IL code has been alright. But inside mcs this values was
20149 wrong and this was reason why several of my CLS Compliance tests
20152 2004-01-22 Martin Baulig <martin@ximian.com>
20154 * cs-parser.jay (namespace_or_type_name): Return an Expression,
20155 not a QualifiedIdentifier. This is what `type_name_expression'
20156 was previously doing.
20157 (type_name_expression): Removed; the code is now in
20158 `namespace_or_type_name'.
20159 (qualified_identifier): Removed, use `namespace_or_type_name'
20161 (QualifiedIdentifier): Removed this class.
20163 2004-01-22 Martin Baulig <martin@ximian.com>
20165 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
20166 not a string as alias name.
20168 2004-01-21 Miguel de Icaza <miguel@ximian.com>
20170 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
20171 #52730 bug, and instead compute correctly the need to use a
20172 temporary variable when requesting an address based on the
20173 static/instace modified of the field and the constructor.
20175 2004-01-21 Martin Baulig <martin@ximian.com>
20177 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
20178 class and namespace before looking up aliases. Fixes #52517.
20180 2004-01-21 Martin Baulig <martin@ximian.com>
20182 * flowanalysis.cs (UsageVector.Merge): Allow variables being
20183 assinged in a 'try'; fixes exception4.cs.
20185 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20186 * class.cs : Implemented parameter-less constructor for TypeContainer
20188 * decl.cs: Attributes are now stored here. New property OptAttributes
20190 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
20192 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
20194 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20196 * typemanager.cs (CSharpSignature): Now reports also inner class name.
20197 (CSharpSignature): New method for indexer and property signature.
20199 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20201 * pending.cs (IsVirtualFilter): Faster implementation.
20203 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20205 * typemanager.cs: Avoid inclusion of same assembly more than once.
20207 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20209 * cs-parser.jay: Fixed problem where the last assembly attribute
20210 has been applied also to following declaration (class, struct, etc.)
20212 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20214 * class.cs: Added error CS0538, CS0539 reporting.
20215 Fixed crash on Microsoft runtime when field type is void.
20217 * cs-parser.jay: Added error CS0537 reporting.
20219 * pending.cs: Added error CS0535 reporting.
20220 Improved error report for errors CS0536, CS0534.
20222 2004-01-20 Miguel de Icaza <miguel@ximian.com>
20224 Merge a few bits from the Anonymous Method MCS tree.
20226 * statement.cs (ToplevelBlock): New class for toplevel methods,
20227 will hold anonymous methods, lifted variables.
20229 * cs-parser.jay: Create toplevel blocks for delegates and for
20230 regular blocks of code.
20232 2004-01-20 Martin Baulig <martin@ximian.com>
20234 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
20235 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
20236 and `NeedExplicitReturn'; added `IsLastStatement'.
20237 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
20238 have a `ReturnLabel' or we're not unreachable.
20240 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
20241 child's reachability; don't just override ours with it. Fixes
20242 #58058 (lluis's example).
20243 (FlowBranching): Added public InTryOrCatch(), InCatch(),
20244 InFinally(), InLoop(), InSwitch() and
20245 BreakCrossesTryCatchBoundary() methods.
20247 * statement.cs (Return): Do all error checking in Resolve().
20248 Unless we are the last statement in a top-level block, always
20249 create a return label and jump to it.
20250 (Break, Continue): Do all error checking in Resolve(); also make
20251 sure we aren't leaving a `finally'.
20252 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
20253 statement in a top-level block.
20254 (Block.Flags): Added `IsDestructor'.
20255 (Block.IsDestructor): New public property.
20257 2004-01-20 Martin Baulig <martin@ximian.com>
20259 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
20261 2004-01-20 Martin Baulig <martin@ximian.com>
20263 * statement.cs (Statement.ResolveUnreachable): New public method.
20264 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
20265 (Block.Resolve): Resolve unreachable statements.
20267 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20269 * expression.cs: We need to fix the case where we do
20270 not have a temp variable here.
20272 * assign.cs: Only expression compound assignments need
20273 temporary variables.
20275 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20277 * flowanalysis.cs: Reduce memory allocation in a few ways:
20278 - A block with no variables should not allocate a bit
20280 - A method with no out parameters does not need any tracking
20281 for assignment of the parameters, so we need not allocate
20284 public readonly Type[] VariableTypes;
20285 public readonly string[] VariableNames;
20286 Are redundant. The data is already stored in the variable
20287 map, so we need not allocate another array for it.
20288 - We need to add alot of checks for if (params | locals) == null
20289 due to the first two changes.
20291 2004-01-18 Miguel de Icaza <miguel@ximian.com>
20293 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
20294 implement IMemoryLocation, we store a copy on a local variable and
20295 take the address of it. Patch from Benjamin Jemlich
20297 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
20298 to use a special "type_name_expression" rule which reduces the
20299 number of "QualifiedIdentifier" classes created, and instead
20300 directly creates MemberAccess expressions.
20302 2004-01-17 Miguel de Icaza <miguel@ximian.com>
20304 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
20305 that fixes #52853. Null literal assignment to ValueType
20307 * class.cs (MethodData.Emit): Instead of checking the name of the
20308 method to determine if its a destructor, create a new derived
20309 class from Method called Destructor, and test for that.
20311 * cs-parser.jay: Create a Destructor object instead of a Method.
20313 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
20317 2004-01-16 Miguel de Icaza <miguel@ximian.com>
20319 * expression.cs (Binary.ResolveOperator): Perform an implicit
20320 conversion from MethodGroups to their delegate types on the
20321 Addition operation.
20323 * delegate.cs: Introduce a new class DelegateCreation that is the
20324 base class for `NewDelegate' and `ImplicitDelegateCreation',
20325 factor some code in here.
20327 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
20328 conversion from MethodGroups to compatible delegate types.
20330 * ecore.cs (Expression.Resolve): Do not flag error 654
20331 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
20332 we allow conversions from MethodGroups to delegate types now.
20334 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
20335 assignments in v2 either.
20337 2004-01-10 Miguel de Icaza <miguel@ximian.com>
20339 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
20340 static read-only fields in ctors.
20342 Applied patch from Benjamin Jemlich
20344 * expression.cs (UnaryMutator): Avoid leaking local variables.
20346 2004-01-09 Miguel de Icaza <miguel@ximian.com>
20348 * cs-tokenizer.cs (IsCastToken): Allow the various native types
20349 here to return true, as they can be used like this:
20351 (XXX) int.MEMBER ()
20353 Fixed 49836 and all the other dups
20355 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
20357 * driver.cs: Implement /win32res and /win32icon.
20359 2004-01-08 Miguel de Icaza <miguel@ximian.com>
20361 * cs-parser.jay: Add a rule to improve error handling for the
20362 common mistake of placing modifiers after the type.
20364 2004-01-07 Miguel de Icaza <miguel@ximian.com>
20366 * cs-parser.jay (interface_event_declaration): Catch
20367 initialization of events on interfaces, and report cs0068
20369 * cs-parser.jay (interface_event_declaration): Catch
20370 initialization of events.
20372 * ecore.cs: Better report missing constructors.
20374 * expression.cs (Binary.ResolveOperator): My previous bug fix had
20375 the error reporting done in the wrong place. Fix.
20377 * expression.cs (Binary.ResolveOperator): Catch the
20378 operator + (E x, E y) error earlier, and later allow for implicit
20379 conversions in operator +/- (E e, U x) from U to the underlying
20382 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
20383 52596, if the container class is abstract, the default constructor
20384 is protected otherwise its public (before, we were always public).
20386 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
20389 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
20390 Jemlich that fixes bug #52597, MCS was generating invalid code for
20391 idisposable structs. Thanks to Ben for following up with this
20394 2004-01-06 Miguel de Icaza <miguel@ximian.com>
20396 * driver.cs: Allow assemblies without code to be generated, fixes
20399 2004-01-07 Nick Drochak <ndrochak@gol.com>
20401 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
20403 2004-01-05 Miguel de Icaza <miguel@ximian.com>
20405 * cs-parser.jay: Add rules to improve error reporting if fields or
20406 methods are declared at the namespace level (error 116)
20408 * Add rules to catch event add/remove
20410 2004-01-04 David Sheldon <dave-mono@earth.li>
20412 * expression.cs: Added matching ")" to error message for
20415 2004-01-03 Todd Berman <tberman@gentoo.org>
20417 * ecore.cs, attribute.cs:
20418 Applying fix from #52429.
20420 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20422 * ecore.cs, expression.cs, statement.cs:
20423 Total rewrite of how we handle branching. We
20424 now handle complex boolean expressions with fewer
20425 jumps. As well if (x == 0) no longer emits a ceq.
20427 if (x is Foo) is much faster now, because we generate
20430 Overall, we get a pretty big improvement on our benchmark
20431 tests. The code we generate is smaller and more readable.
20433 I did a full two-stage bootstrap. The patch was reviewed
20434 by Martin and Miguel.
20436 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20438 * cs-parser.jay: Make primary_expression not take a QI.
20439 we dont need this because the member_access rule covers
20440 us here. So we replace the rule with just IDENTIFIER.
20442 This has two good effects. First, we remove a s/r conflict.
20443 Second, we allocate many fewer QualifiedIdentifier objects.
20445 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20447 * attribute.cs: Handle MarshalAs attributes as pseudo, and
20448 set the correct information via SRE. This prevents
20449 hanging on the MS runtime. Fixes #29374.
20451 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20453 * convert.cs: correctly handle conversions to value types
20454 from Enum and ValueType as unboxing conversions.
20456 Fixes bug #52569. Patch by Benjamin Jemlich.
20458 2004-01-02 Ravi Pratap <ravi@ximian.com>
20460 * expression.cs (BetterConversion): Prefer int -> uint
20461 over int -> ulong (csc's behaviour). This fixed bug #52046.
20463 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
20465 * decl.cs (MemberCache.FindMembers): now returns a
20468 * typemanager.cs: In general, go with with ^^.
20469 (CopyNewMethods): take an IList.
20470 (RealMemberLookup): Only allocate an arraylist
20471 if we copy from two sets of methods.
20473 This change basically does two things:
20474 1) Fewer array lists allocated due to CopyNewMethods.
20475 2) the explicit cast in MemberList costed ALOT.
20477 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
20479 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
20480 a hashtable to avoid needless string allocations when an identifier is
20481 used more than once (the common case).
20483 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20485 * pending.cs: MS's TypeBuilder.GetInterfaces ()
20486 is broken, it will not return anything. So, we
20487 have to use the information we have in mcs to
20490 * typemanager.cs: Add a cache for GetInterfaces,
20491 since this will now be used more often (due to ^^)
20493 (GetExplicitInterfaces) New method that gets the
20494 declared, not effective, interfaces on a type
20495 builder (eg, if you have interface IFoo, interface
20496 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
20499 This patch makes MCS able to bootstrap itself on
20502 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20504 * expression.cs: Remove the Nop's that Miguel put
20507 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20509 * report.cs, codegen.cs: Give the real stack trace to
20510 the error when an exception is thrown.
20512 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20514 * decl.cs: only allocate hashtables for ifaces if
20517 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20519 * expression.cs: fix the error from cs0121-2.cs
20520 (a parent interface has two child interfaces that
20521 have a function with the same name and 0 params
20522 and the function is called through the parent).
20524 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
20526 * class.cs, rootcontext.cs, typmanager.cs: do not
20529 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
20531 * codegen.cs: remove stack for the ec flow branching.
20532 It is already a linked list, so no need.
20534 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
20536 * Makefile: Allow custom profiler here.
20538 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20540 * typemanager.cs (LookupType):
20541 - Use a static char [], because split takes
20542 a param array for args, so it was allocating
20544 - Do not store true in a hashtable, it boxes.
20546 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20548 * flowanalysis.cs: bytify common enums.
20550 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20552 * modifiers.cs: Add a new set of flags for the
20553 flags allowed on explicit interface impls.
20554 * cs-parser.jay: catch the use of modifiers in
20555 interfaces correctly.
20556 * class.cs: catch private void IFoo.Blah ().
20558 All related to bug #50572.
20560 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20562 * decl.cs: Rewrite the consistant accessability checking.
20563 Accessability is not linear, it must be implemented in
20564 a tableish way. Fixes #49704.
20566 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20568 * expression.cs: Handle negation in a checked context.
20569 We must use subtraction from zero. Fixes #38674.
20571 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20573 * class.cs: Ignore static void main in DLLs.
20574 * rootcontext.cs: Handle the target type here,
20575 since we are have to access it from class.cs
20576 * driver.cs: account for the above.
20578 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20580 * report.cs: Give line numbers and files if available.
20582 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
20584 * driver.cs: Implement /addmodule.
20586 * typemanager.cs: Change 'modules' field so it now contains Modules not
20589 2003-12-20 Martin Baulig <martin@ximian.com>
20591 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
20592 (FieldBase.IsAssigned): Removed this field.
20593 (FieldBase.SetAssigned): New public method.
20594 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
20596 2003-12-20 Martin Baulig <martin@ximian.com>
20598 * expression.cs (LocalVariableReference.DoResolve): Don't set
20599 `vi.Used' if we're called from DoResolveLValue().
20601 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
20602 returns the usage vector it just merged into the current one -
20603 pass this one to UsageWarning().
20604 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
20605 of the `EmitContext', don't call this recursively on our children.
20607 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
20609 * driver.cs: Implement /target:module.
20611 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
20613 * support.cs (CharArrayHashtable): New helper class.
20615 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
20616 char arrays, not strings, so we can avoid creating a string in
20617 consume_identifier if the identifier is a keyword.
20619 2003-12-16 Martin Baulig <martin@ximian.com>
20621 * statement.cs (LocalInfo.Assigned): Removed this property.
20622 (LocalInfo.Flags): Removed `Assigned'.
20623 (LocalInfo.IsAssigned): New public method; takes the EmitContext
20624 and uses flow analysis.
20625 (Block.UsageWarning): Made this method private.
20626 (Block.Resolve): Call UsageWarning() if appropriate.
20628 * expression.cs (LocalVariableReference.DoResolve): Always set
20629 LocalInfo.Used here.
20631 2003-12-13 Martin Baulig <martin@ximian.com>
20633 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
20634 any value here; we're now using flow analysis to figure out
20635 whether a statement/block returns a value.
20637 2003-12-13 Martin Baulig <martin@ximian.com>
20639 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
20641 (FlowBranching.MergeFinally): Don't call
20642 `branching.CheckOutParameters()' here, this is called in
20644 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
20645 when adding the `finally' vector.
20647 2003-12-13 Martin Baulig <martin@ximian.com>
20650 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
20651 actually work and also fix #48962.
20653 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
20655 * decl.cs: Do not check System.Object for nested types,
20656 since we know it does not have any. Big bang for buck:
20659 Run 1: 8.35 seconds
20660 Run 2: 8.32 seconds
20661 corlib: 17.99 seconds
20663 Run 1: 8.17 seconds
20664 Run 2: 8.17 seconds
20665 corlib: 17.39 seconds
20667 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
20669 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
20670 time we are returning 0 members, so we save alot here.
20672 2003-12-11 Martin Baulig <martin@ximian.com>
20674 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
20675 `MergeChild()', also just take the `FlowBranching' as argument;
20676 call Merge() on it and return the result.
20677 (FlowBranching.Merge): We don't need to do anything if we just
20680 2003-12-11 Martin Baulig <martin@ximian.com>
20682 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
20683 them in an `ArrayList' to reduce memory usage. Thanks to Ben
20684 Maurer for this idea.
20686 2003-12-11 Martin Baulig <martin@ximian.com>
20688 * flowanalysis.cs (MergeResult): This class is now gone; we now
20689 use the `UsageVector' for this. The reason for this is that if a
20690 branching just has one sibling, we don't need to "merge" them at
20691 all - that's the next step to do.
20692 (FlowBranching.Merge): We now return a `UsageVector' instead of a
20695 2003-12-11 Martin Baulig <martin@ximian.com>
20697 Reworked flow analyis and made it more precise and bug-free. The
20698 most important change is that we're now using a special `Reachability'
20699 class instead of having "magic" meanings of `FlowReturns'. I'll
20700 do some more cleanups and optimizations and also add some more
20701 documentation this week.
20703 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
20704 largely reworked this class.
20705 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
20706 the new `Reachability' class instead of having "magic" values here.
20707 (FlowBranching): We're now using an instance of `Reachability'
20708 instead of having separate `Returns', `Breaks' etc. fields.
20710 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
20711 based on flow analysis; ignore the return value of block.Emit ().
20713 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
20715 * driver.cs typemanager.cs: Find the mono extensions to corlib even
20716 if they are private.
20718 2003-12-09 Martin Baulig <martin@ximian.com>
20720 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
20721 call them directly on the UsageVector.
20723 2003-12-09 Martin Baulig <martin@ximian.com>
20725 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
20726 Changed return type from `FlowReturns' to `Reachability'.
20728 2003-12-09 Martin Baulig <martin@ximian.com>
20730 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
20731 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
20732 `Reachable' fields with a single `Reachability' one.
20734 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20736 * class.cs (FindMembers): Remove foreach's.
20741 Run 1: 8.74 seconds
20742 Run 2: 8.71 seconds
20745 Run 1: 8.64 seconds
20746 Run 2: 8.58 seconds
20749 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20754 This patch does a few things:
20755 1. EmptyStatement is now a singleton, so it is never reallocated.
20756 2. All blah is EmptyStatement constructs have been changed to
20757 blah == EmptyStatement.Value, which is much faster and valid
20758 now that EmptyStatement is a singleton.
20759 3. When resolving a block, rather than allocating a new array for
20760 the non-empty statements, empty statements are replaced with
20761 EmptyStatement.Value
20762 4. Some recursive functions have been made non-recursive.
20763 Mainly the performance impact is from (3), however (1) and (2) are needed for
20764 this to work. (4) does not make a big difference in normal situations, however
20765 it makes the profile look saner.
20770 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20771 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20772 Total memory allocated: 56397 KB
20775 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
20776 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
20777 Total memory allocated: 55666 KB
20779 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20781 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
20782 than the hashtable in a hashtable version
20784 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
20785 we always end up concating a string. This results in a huge perf
20786 loss, because many strings have to be tracked by the GC. In this
20787 patch, we first use a hashtable that works with two keys, so that
20788 the strings do not need to be concat'ed.
20792 Run 1: 8.74 seconds
20793 Run 2: 8.71 seconds
20796 Run 1: 8.65 seconds
20797 Run 2: 8.56 seconds
20799 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20801 * Makefile: Add a new target `do-time' that does a quick and simple
20802 profile, leaving easy to parse output.
20804 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
20806 * codegen.cs (Init): Create the dynamic assembly with
20807 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
20809 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
20811 * support.cs: Make the PtrHashtable use only one
20812 instance of its comparer.
20814 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
20816 * typemanager.cs: Fix lookup of GetNamespaces.
20818 2003-11-29 Miguel de Icaza <miguel@ximian.com>
20820 * expression.cs: Removed redundant line.
20822 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
20823 ArrayLists, use for loops with bounds.
20825 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
20828 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
20829 arraylists, use for loop with bounds.
20831 The above three changes give us a 0.071 second performance
20832 improvement out of 3.294 seconds down to 3.223. On my machine
20833 the above changes reduced the memory usage by 1,387 KB during
20834 compiler bootstrap.
20836 * cs-parser.jay (QualifiedIdentifier): New class used to represent
20837 QualifiedIdentifiers. Before we created a new string through
20838 concatenation, and mostly later on, the result would be
20839 manipulated by DecomposeQI through string manipulation.
20841 This reduced the compiler memory usage for bootstrapping from
20842 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
20843 compile times in 0.05 seconds.
20845 2003-11-28 Dick Porter <dick@ximian.com>
20847 * support.cs: Do string compares with the Invariant culture.
20855 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
20856 the comparison is done with the Invariant culture.
20858 2003-11-27 Miguel de Icaza <miguel@ximian.com>
20860 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
20861 GetEnumerator method.
20863 (ProbeCollectionType): Iterate starting at the most specific type
20864 upwards looking for a GetEnumerator
20866 * expression.cs: Shift count can be up to 31 for int/uint and 63
20869 2003-11-26 Miguel de Icaza <miguel@ximian.com>
20871 * statement.cs (Block.LookupLabel): Also look for the label on the
20872 children blocks. Use a hash table to keep track of visited
20875 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
20876 we actually did transform the other operand, otherwise fall back
20877 to the common codepath that casts to long.
20879 * cs-tokenizer.cs: Use the same code pattern as the int case.
20880 Maybe I should do the parsing myself, and avoid depending on the
20881 Parse routines to get this done.
20883 2003-11-25 Miguel de Icaza <miguel@ximian.com>
20885 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
20886 which fixes bug 51347. This time test it.
20888 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
20889 attributes for example can not tell the difference between these.
20890 The difference was only a syntax feature of the language.
20892 * attribute.cs: Apply attributes to delegates.
20894 * delegate.cs: Call the apply attributes method.
20896 2003-11-24 Miguel de Icaza <miguel@ximian.com>
20898 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
20899 comparing 0 vs Byte.MinValue, not the value
20901 (ImplicitConversionRequired): When reporting a conversion error,
20902 use error 31 to print out the constant error instead of the
20905 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
20906 which fixes bug 51347.
20908 2003-11-22 Miguel de Icaza <miguel@ximian.com>
20910 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
20911 which fixes the -warnaserror command line option.
20913 2003-11-21 Miguel de Icaza <miguel@ximian.com>
20915 * cfold.cs (DoNumericPromotions): During constant folding of
20916 additions on UIntConstant, special case intconstants with
20917 IntConstants like we do on the expression binary operator.
20919 2003-11-12 Miguel de Icaza <miguel@ximian.com>
20921 * convert.cs (ImplicitReferenceConversion): We were missing a case
20922 (System.Enum are not value types or class types, so we need to
20923 classify them separatedly).
20925 * driver.cs: We do not support error 2007.
20927 2003-11-12 Jackson Harper <jackson@ximian.com>
20929 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
20930 system directory. Also use the full file name so users can
20931 libraries names mscorlib-o-tron.dll in a non system dir.
20933 2003-11-10 Martin Baulig <martin@ximian.com>
20935 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
20936 (TypeManager.InitCoreTypes): Initialize them here, but instead of
20937 calling `ResolveType()' on them, directly assign their `Type'.
20939 2003-11-08 Martin Baulig <martin@ximian.com>
20941 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
20942 return value and the `out parent' parameter.
20943 (TypeContainer.DefineType): Moved the CS0644 check into
20944 GetClassBases(). Don't pass the interface types to the
20945 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
20946 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
20948 * ecore.cs (TypeExpr.IsAttribute): New property.
20949 (TypeExpr.GetInterfaces): New method.
20951 * interface.cs (Interface.GetInterfaceTypeByName): Return a
20952 TypeExpr instead of a Type.
20953 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
20954 (Interface.DefineType): Don't pass the interface types to the
20955 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
20956 them later and then call `TypeBulider.AddInterfaceImplementation()'.
20958 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
20959 instead of a `Type[]'.
20960 (TypeManager.RegisterBuilder): Likewise.
20961 (TypeManager.AddUserInterface): Likewise.
20962 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
20963 `Type[]' and also return a `TypeExpr[]'.
20964 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
20966 2003-11-08 Martin Baulig <martin@ximian.com>
20968 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
20971 2003-11-08 Martin Baulig <martin@ximian.com>
20973 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
20974 TypeManager.ResolveExpressionTypes().
20976 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
20977 instead of an Expression.
20978 (TypeExpr): This is now an abstract base class for `TypeExpression'.
20979 (TypeExpression): New public class; formerly known as `TypeExpr'.
20981 * expression.cs (ComposedCast): Derive from TypeExpr.
20983 * typemanager.cs (TypeManager.system_*_expr): These are now
20984 TypExpr's instead of Expression's.
20985 (TypeManager.ResolveExpressionTypes): New public static function;
20986 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
20989 2003-11-06 Miguel de Icaza <miguel@ximian.com>
20991 * expression.cs (New.DoResolve): Do not dereference value that
20992 might be a null return.
20994 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
20995 sure that the constant value has the right type. Fixes an
20996 unreported bug, similar to 50425.
20998 * const.cs (Const.LookupConstantValue): Call
20999 ImplicitStandardConversionExists before doing a conversion to
21000 avoid havng the TypeManager.ChangeType do conversions.
21002 Reduced the number of casts used
21004 (Const.ChangeType): New routine to enable reuse of the constant
21005 type changing code from statement.
21007 * typemanager.cs (ChangeType): Move common initialization to
21008 static global variables.
21012 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
21013 every value type to go through, even if it was void. Fix that.
21015 * cs-tokenizer.cs: Use is_identifier_start_character on the start
21016 character of the define, and the is_identifier_part_character for
21017 the rest of the string.
21019 2003-11-05 Miguel de Icaza <miguel@ximian.com>
21021 * expression.cs (UnaryMutator.EmitCode): When I updated
21022 LocalVariableReference.DoResolve, I overdid it, and dropped an
21023 optimization done on local variable references.
21025 2003-11-04 Miguel de Icaza <miguel@ximian.com>
21027 * ecore.cs: Convert the return from Ldlen into an int.
21029 2003-10-20 Miguel de Icaza <miguel@ximian.com>
21031 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
21032 the accessibility, this is a special case for toplevel non-public
21033 classes (internal for instance).
21035 2003-10-20 Nick Drochak <ndrochak@gol.com>
21037 * ecore.cs: Fix typo and build. Needed another right paren.
21039 2003-10-19 Miguel de Icaza <miguel@ximian.com>
21041 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
21042 `internal' case regular and protected, but not allowing protected
21043 to be evaluated later. Bug 49840
21045 2003-10-15 Miguel de Icaza <miguel@ximian.com>
21047 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
21048 to kb.Nlast, and not the kb.nFirst to isolate the switch
21051 Extract the underlying type, so enumerations of long/ulong are
21052 treated like long/ulong.
21054 2003-10-14 Miguel de Icaza <miguel@ximian.com>
21056 * expression.cs (New): Overload the meaning of RequestedType to
21057 track the possible creation of the NewDelegate type, since
21058 DoResolve is invoked more than once for new constructors on field
21061 See bugs: #48800 and #37014
21063 * cs-parser.jay (declare_local_constants): Take an arraylist
21064 instead of a single constant.
21066 (local_constant_declaration): It should take a
21067 constant_declarators, not a constant_declarator. Fixes 49487
21069 * convert.cs: Fix error report.
21071 2003-10-13 Jackson Harper <jackson@ximian.com>
21073 * typemanager.cs (TypeToCoreType): Add float and double this fixes
21076 2003-10-09 Martin Baulig <martin@ximian.com>
21078 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
21080 (MethodCore.DoDefineParameters): Removed the TypeContainer
21081 argument; use the DeclSpace which was passed to the .ctor instead.
21082 (MethodCore.CheckParameter): Take a DeclSpace instead of a
21083 TypeContainer; we only need a DeclSpace here.
21085 2003-10-09 Martin Baulig <martin@ximian.com>
21087 * class.cs (MethodData): Added additional `DeclSpace ds' argument
21089 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
21090 EmitContext's .ctor.
21092 2003-10-09 Martin Baulig <martin@ximian.com>
21094 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
21095 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
21096 AsAccessible(), moved them as well.
21098 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
21100 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
21102 * cs-parser.jay : Renamed yyName to yyNames related to jay.
21104 2003-10-07 Miguel de Icaza <miguel@ximian.com>
21106 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
21107 generation for >=, as spotted by Paolo, bug 48679.
21108 Patch from David Waite.
21110 * cs-tokenizer.cs: Add handling for #pragma.
21112 * cs-parser.jay: Allow for both yield and yield return in the
21113 syntax. The anti-cobolization of C# fight will go on!
21115 * class.cs (TypeBuilder.DefineType): Catch error condition here
21116 (Parent.DefineType erroring out and returning null).
21118 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
21119 coping with enumerations variables, we were mistakenly processing
21120 them as a regular value type instead of built-in types. Fixes the
21123 * typemanager.cs (IsBuiltinOrEnum): New method.
21125 2003-09-30 Miguel de Icaza <miguel@ximian.com>
21127 * cs-parser.jay: Upgrade: yield now needs the return clause.
21129 2003-09-19 Martin Baulig <martin@ximian.com>
21131 * decl.cs (MemberCache.SetupCacheForInterface): Take a
21132 `MemberCache parent' argument. Normally, an interface doesn't
21133 have a parent type except System.Object, but we use this in gmcs
21134 for generic type parameters.
21136 2003-09-18 Martin Baulig <martin@ximian.com>
21138 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
21139 on `type.IsInterface'; don't check whether the type has a parent
21140 to determine whether it's an interface.
21142 2003-09-15 Martin Baulig <martin@ximian.com>
21144 * class.cs (TypeContainer.DefineType): Added an error flag to
21145 avoid reporting duplicate CS0146's ("class definition is
21148 * driver.cs (Driver.MainDriver): Abort if
21149 RootContext.ResolveTree() reported any errors.
21151 2003-09-07 Martin Baulig <martin@ximian.com>
21153 * report.cs (Error, Warning): Added overloaded versions which take
21154 a `params object[] args' and call String.Format().
21156 2003-09-07 Martin Baulig <martin@ximian.com>
21158 * decl.cs (DeclSpace..ctor): Don't call
21159 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
21160 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
21161 (DeclSpace.RecordDecl): New method.
21163 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
21165 2003-09-02 Ravi Pratap <ravi@ximian.com>
21167 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
21168 value attributes to be applied to ParameterBuilders.
21170 * class.cs (MethodCore.LabelParameters): Make static and more
21171 generic so that it can be used from other places - like interface
21172 methods, for instance.
21174 * interface.cs (Interface.Emit): Call LabelParameters before
21175 emitting attributes on the InterfaceMethod.
21177 2003-08-26 Martin Baulig <martin@ximian.com>
21179 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
21180 resolving aliases; fixes #47927.
21182 2003-08-26 Martin Baulig <martin@ximian.com>
21184 * statement.cs (Using.DoResolve): This is internally emitting a
21185 try/finally clause, so we need to set ec.NeedExplicitReturn if we
21186 do not always return. Fixes #47681.
21188 2003-08-26 Martin Baulig <martin@ximian.com>
21190 * decl.cs (MemberCore): Moved WarningNotHiding(),
21191 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
21193 (AdditionResult): Make this nested in DeclSpace.
21194 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
21195 argument; call NamespaceEntry.Define() unless we're nested in a
21198 * namespace.cs (Namespace.DefineName): New public function. This
21199 is called from DeclSpace's .ctor to add
21200 (Namespace.Lookup): Include DeclSpaces in the lookup.
21202 * class.cs (Operator): Derive from MemberBase, not MemberCore.
21204 * const.cs (Const): Derive from MemberBase, not MemberCore.
21206 2003-08-25 Martin Baulig <martin@ximian.com>
21208 * convert.cs (Convert.ExplicitReferenceConversion): When
21209 converting from an interface type to a class, unbox if the target
21210 type is a struct type. Fixes #47822.
21212 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21214 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
21217 2003-08-22 Martin Baulig <martin@ximian.com>
21219 * class.cs (TypeManager.DefineType): When defining a nested type,
21220 call DefineType() on our parent; fixes #47801.
21222 2003-08-22 Martin Baulig <martin@ximian.com>
21224 * class.cs (MethodData.Define): While checking if a method is an
21225 interface implementation, improve the test a bit more to fix #47654.
21227 2003-08-22 Martin Baulig <martin@ximian.com>
21229 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
21230 correctly; fixes #47722.
21232 2003-08-22 Martin Baulig <martin@ximian.com>
21234 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
21235 LocalVariableReference, ensure it's not read-only. Fixes #47536.
21237 * statement.cs (Fixed.DoResolve): Make all variables read-only.
21239 2003-08-22 Martin Baulig <martin@ximian.com>
21241 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
21242 can only be assigned in static constructors. Fixes #47161.
21244 2003-08-22 Martin Baulig <martin@ximian.com>
21246 Rewrote and improved the flow analysis code.
21248 * flowbranching.cs (FlowBranching): Make this class abstract.
21249 (FlowBranching.CreateBranching): New static function to create a
21250 new flow branching.
21251 (FlowBranchingBlock, FlowBranchingException): New classes.
21252 (FlowBranching.UsageVector.Type): New public readonly field.
21253 (FlowBranching.UsageVector.Breaks): Removed the setter.
21254 (FlowBranching.UsageVector.Returns): Removed the setter.
21255 (FlowBranching.UsageVector): Added Break(), Return(),
21256 NeverReachable() and Throw() methods to modify the reachability.
21257 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
21258 done by FlowBranching.Merge().
21259 (FlowBranching.UsageVector.MergeChild): New method; merges the
21260 merge result into the current vector.
21261 (FlowBranching.Merge): New abstract method to merge a branching.
21263 2003-08-12 Martin Baulig <martin@ximian.com>
21265 * expression.cs (Indirection.CacheTemporaries): Create the
21266 LocalTemporary with the pointer type, not its element type.
21268 2003-08-10 Miguel de Icaza <miguel@ximian.com>
21270 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
21271 token was a keyword or not.
21273 Add `error' options where an IDENTIFIER was expected; Provide
21274 CheckToken and CheckIdentifierToken convenience error reporting
21277 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
21279 * decl.cs: Rename `NamespaceEntry Namespace' public field into
21280 NameSpaceEntry NameSpaceEntry.
21282 (LookupInterfaceOrClass): Avoid creating a full qualified name
21283 from namespace and name: avoid doing lookups when we know the
21284 namespace is non-existant. Use new Tree.LookupByNamespace which
21285 looks up DeclSpaces based on their namespace, name pair.
21287 * driver.cs: Provide a new `parser verbose' to display the
21288 exception thrown during parsing. This is turned off by default
21289 now, so the output of a failure from mcs is more graceful.
21291 * namespace.cs: Track all the namespaces defined in a hashtable
21294 (IsNamespace): New method
21296 2003-08-09 Miguel de Icaza <miguel@ximian.com>
21298 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
21299 we know that we need to concatenate (full typename can never be
21304 * statement.cs: Use a bitfield; Do not initialize to null things
21305 which are done by the constructor by default.
21307 * cs-parser.jay: bug fix, parameter was 4, not 3.
21309 * expression.cs: Just use the property;
21311 * statement.cs: No need for GetVariableInfo method.
21313 2003-08-08 Martin Baulig <martin@ximian.com>
21315 * flowanalysis.cs (FlowReturns): This is now nested in the
21316 `FlowBranching' class.
21317 (MyBitVector): Moved this here from statement.cs.
21318 (FlowBranching.SiblingType): New enum type.
21319 (FlowBranching.CreateSibling): Added `SiblingType' argument.
21321 2003-08-07 Martin Baulig <martin@ximian.com>
21323 * flowanalysis.cs (FlowBranchingType): This is now nested in the
21324 `FlowBranching' class and called `BranchingType'.
21326 2003-08-07 Martin Baulig <martin@ximian.com>
21328 * flowanalysis.cs: Moved all the control flow analysis code into
21331 2003-08-07 Martin Baulig <martin@ximian.com>
21333 * assign.cs (Assign.DoResolve): `target' must either be an
21334 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
21337 2003-08-07 Miguel de Icaza <miguel@ximian.com>
21339 * expression.cs (BinaryMethod): This kind of expression is created by the
21340 Binary class if it determines that the operator has to be handled
21343 (BinaryDelegate): This kind of expression is created if we are
21344 dealing with a + or - operator on delegates.
21346 (Binary): remove method, argumetns, and DelegateOperator: when
21347 dealing with methods,
21349 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
21351 * statement.cs (Block): use bitfields for the three extra booleans
21352 we had in use. Remove unused topblock parameter.
21354 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
21356 * assign.cs: Drop extra unneeded tests.
21358 2003-08-06 Miguel de Icaza <miguel@ximian.com>
21360 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
21362 * statement.cs (Foreach): Use VariableStorage instead of
21365 * codegen.cs (VariableStorage): New class used by clients that
21366 require a variable stored: locals or fields for variables that
21367 need to live across yield.
21369 Maybe provide a convenience api for EmitThis+EmitLoad?
21371 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
21374 2003-08-05 Miguel de Icaza <miguel@ximian.com>
21376 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
21377 RemapParameterLValue): New methods that are used to turn a
21378 precomputed FieldInfo into an expression like this:
21382 The idea is to use this instead of making LocalVariableReference
21383 have more than one meaning.
21385 * cs-parser.jay: Add error production to BASE.
21387 * ecore.cs: Deal with TypeManager.GetField returning null, which
21388 is now a valid return value.
21390 (FieldExprNoAddress): New expression for Fields whose address can
21393 * expression.cs (LocalVariableReference): During the resolve
21394 phases, create new expressions if we are in a remapping context.
21395 Remove code that dealt with remapping here.
21397 (ParameterReference): same.
21399 (ProxyInstance): New expression, like the `This' expression, but
21400 it is born fully resolved. We know what we are doing, so remove
21401 the errors that are targeted to user-provided uses of `this'.
21403 * statement.cs (Foreach): our variable is now stored as an
21404 Expression; During resolution, follow the protocol, dont just
21405 assume it will return this.
21407 2003-08-06 Martin Baulig <martin@ximian.com>
21409 * support.cs (SeekableStreamReader.cs): New public class.
21411 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
21412 SeekableStreamReader instead of the normal StreamReader.
21414 2003-08-04 Martin Baulig <martin@ximian.com>
21416 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
21417 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
21418 deambiguate casts and delegate invocations.
21419 (parenthesized_expression): Use the new tokens to ensure this is
21420 not a cast of method invocation.
21422 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
21423 when reading a `)' and Deambiguate_CloseParens () was previously
21426 * expression.cs (ParenthesizedExpression): New class. This is
21427 just used for the CS0075 test.
21428 (Binary.DoResolve): Check for CS0075.
21430 2003-07-29 Ravi Pratap <ravi@ximian.com>
21432 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
21433 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
21434 reference comparison.
21436 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
21437 examine the ReturnType for equality - this is necessary in the
21438 cases of implicit and explicit operators whose signature also
21439 includes the return type.
21441 2003-07-26 Miguel de Icaza <miguel@ximian.com>
21443 * namespace.cs: Cache the result of the namespace computation,
21444 instead of computing it every time.
21446 2003-07-24 Miguel de Icaza <miguel@ximian.com>
21448 * decl.cs: Use a global arraylist that we reuse over invocations
21449 to avoid excesive memory consumption. Reduces memory usage on an
21450 mcs compile by one meg (45 average).
21452 * typemanager.cs (LookupTypeReflection): In .NET pointers are
21453 private, work around that.
21455 2003-07-23 Miguel de Icaza <miguel@ximian.com>
21457 * literal.cs (IntLiteral): Define Zero and One static literals.
21459 * cs-parser.jay (integer_literal): use static literals to reduce
21460 memory usage for the most used literals (0, 1 and -1). 211kb
21461 reduced in memory usage.
21463 Replace all calls to `new ArrayList' with `new
21464 ArrayList(4)' which is a good average number for most allocations,
21465 and also requires only 16 bytes of memory for its buffer by
21468 This reduced MCS memory usage in seven megabytes for the RSS after
21471 2003-07-28 Ravi Pratap <ravi@ximian.com>
21473 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
21474 handle params methods the correct way by forming only one
21475 applicable set with params and normal methods in them. Earlier we
21476 were looking at params methods only if we found no normal methods
21477 which was not the correct thing to do.
21479 (Invocation.BetterFunction): Take separate arguments indicating
21480 when candidate and the best method are params methods in their
21483 This fixes bugs #43367 and #46199.
21485 * attribute.cs: Documentation updates.
21487 (CheckAttribute): Rename to CheckAttributeTarget.
21488 (GetValidPlaces): Rename to GetValidTargets.
21490 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
21491 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
21495 2003-07-28 Martin Baulig <martin@ximian.com>
21497 * class.cs (TypeContainer.DefineMembers): Use the base type's full
21498 name when looking up the base class of a nested class. Fixes #46977.
21500 2003-07-26 Martin Baulig <martin@ximian.com>
21502 * expression.cs (Indexers.Indexer): New nested struct; contains
21503 getter, setter and the indexer's type.
21504 (Indexers.Properties): This is now an ArrayList of
21505 Indexers.Indexer's.
21506 (IndexerAccess.DoResolveLValue): Correctly set the type if the
21507 indexer doesn't have any getters.
21509 * assign.cs (Assign.DoResolve): Also do the implicit conversions
21510 for embedded property and indexer assignments.
21512 2003-07-26 Martin Baulig <martin@ximian.com>
21514 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
21515 preprocessor directive is not the first non-whitespace character
21518 2003-07-26 Martin Baulig <martin@ximian.com>
21520 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
21521 namespace parsing, follow the spec more closely.
21523 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
21524 NamespaceEntry.Lookup().
21526 2003-07-25 Martin Baulig <martin@ximian.com>
21528 * MethodCore.cs (OverridesSomething): New public field; it's set
21529 from TypeContainer.DefineMembers if this method overrides
21530 something (which doesn't need to be a method). Fix #39462.
21532 2003-07-25 Ravi Pratap <ravi@ximian.com>
21534 * typemanager.cs (GetMembers): Ensure that the list of members is
21535 reversed. This keeps things in sync.
21537 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
21538 find an AttributeUsage attribute.
21540 * expression.cs (Invocation.OverloadResolve): Perform the check
21541 which disallows Invoke to be directly called on a Delegate.
21543 (Error_InvokeOnDelegate): Report error cs1533.
21545 2003-07-25 Martin Baulig <martin@ximian.com>
21547 * expression.cs (Indexers.GetIndexersForType): Only look in the
21548 interface hierarchy if the requested type is already an
21549 interface. Fixes #46788 while keeping #46502 fixed.
21551 2003-07-25 Martin Baulig <martin@ximian.com>
21553 * class.cs (TypeContainer.DefineMembers): Check whether all
21554 readonly fields have been assigned and report warning CS0649 if
21557 * statement.cs (LocalInfo.IsFixed): Always return true if this is
21560 2003-07-24 Ravi Pratap <ravi@ximian.com>
21562 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
21563 returned from GetMethods to make things consistent with the
21564 assumptions MCS makes about ordering of methods.
21566 This should comprehensively fix bug #45127 and it does :-)
21568 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
21569 ordering is actually reverse.
21571 * Clean up some debug messages I left lying around.
21573 * interface.cs (Populate*): Get rid of code which emits attributes
21574 since the stage in which we emit attributes is the 'Emit' stage,
21575 not the define stage.
21577 (Emit): Move attribute emission for interface members here.
21579 2003-07-22 Ravi Pratap <ravi@ximian.com>
21581 * expression.cs (Invocation.OverloadResolve): Follow the spec more
21582 closely: we eliminate methods in base types when we have an
21583 applicable method in a top-level type.
21585 Please see section 14.5.5.1 for an exact description of what goes
21588 This fixes bug #45127 and a host of other related to corlib compilation.
21590 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
21591 array is the method corresponding to the top-level type (this is
21592 because of the changes made to icall.c) so we change this
21595 (MethodGroupExpr.Name): This too.
21597 * typemanager.cs (GetElementType): New method which does the right
21598 thing when compiling corlib.
21600 * everywhere: Make use of the above in the relevant places.
21602 2003-07-22 Martin Baulig <martin@ximian.com>
21604 * cs-parser.jay (invocation_expression): Moved
21605 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
21606 `cast_expression', but create a InvocationOrCast which later
21607 resolves to either an Invocation or a Cast.
21609 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
21610 method; call this before EmitStatement() to make sure that this
21611 expression can be used as a statement.
21613 * expression.cs (InvocationOrCast): New class; resolves to either
21614 an Invocation or a Cast.
21616 * statement.cs (StatementExpression): Call ResolveStatement() on
21617 the ExpressionStatement before emitting it.
21619 2003-07-21 Martin Baulig <martin@ximian.com>
21621 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
21622 `ref' and `out' attributes match; fixes #46220.
21623 (MemberAccess.ResolveMemberAccess): You can't reference a type
21624 through an expression; fixes #33180.
21625 (Indexers.GetIndexersForType): Don't return the indexers from
21626 interfaces the class implements; fixes #46502.
21628 2003-07-21 Martin Baulig <martin@ximian.com>
21630 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
21631 CS0661 checks; fixes bug #30442.
21633 2003-07-21 Martin Baulig <martin@ximian.com>
21635 * decl.cs (AdditionResult): Added `Error'.
21637 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
21639 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
21640 makes cs0031.cs actually work.
21642 2003-07-20 Martin Baulig <martin@ximian.com>
21644 * namespace.cs: Fixed that bug which caused a crash when compiling
21645 the debugger's GUI.
21647 2003-07-20 Miguel de Icaza <miguel@ximian.com>
21649 * typemanager.cs (LookupTypeReflection): Never expose types which
21650 are NotPublic, NestedPrivate, NestedAssembly, or
21651 NestedFamANDAssem. We used to return these, and later do a check
21652 that would report a meaningful error, but the problem is that we
21653 would not get the real match, if there was a name override.
21655 2003-07-18 Miguel de Icaza <miguel@ximian.com>
21657 * namespace.cs (Namespace, Name): Do not compute the namespace
21658 name dynamically, compute it in the constructor. This reduced
21659 memory usage by 1697 KB.
21661 * driver.cs: Use --pause to pause at the end.
21663 2003-07-17 Peter Williams <peter@newton.cx>
21665 * Makefile: Change the name of the test target so that it doesn't
21666 conflict with the recursive test target.
21668 2003-07-17 Miguel de Icaza <miguel@ximian.com>
21670 * expression.cs (LocalVariableReference.Emit, EmitAssign,
21671 AddressOf): Do not use EmitThis, that was wrong, use the actual
21674 2003-07-15 Miguel de Icaza <miguel@ximian.com>
21676 * class.cs (MethodData.Define): While checking if a method is an
21677 interface implementation, improve the test: If we are not public
21678 (use new test here: use the computed MethodAttributes directly,
21679 instead of the parsed modifier flags) check if the `implementing'
21680 method comes from an interface or not.
21682 * pending.cs (VerifyPendingMethods): Slightly better error
21685 * makefile: add test target that does the mcs bootstrap.
21687 2003-07-16 Ravi Pratap <ravi@ximian.com>
21689 * interface.cs (Define): Do nothing here since there are no
21690 members to populate etc. Move the attribute emission out of here
21691 since this was just totally the wrong place to put it. Attribute
21692 application happens during the 'Emit' phase, not in the 'Define'
21695 (Emit): Add this method and move the attribute emission here
21697 * rootcontext.cs (EmitCode): Call the Emit method on interface
21700 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21702 * expression.cs (OverloadResolve): Report error only if Location
21703 is not 'Null' which means that there was a probe going on.
21705 2003-07-14 Martin Baulig <martin@ximian.com>
21707 * expression.cs (ConditionalLogicalOperator): New public class to
21708 implement user defined conditional logical operators.
21709 This is section 14.11.2 in the spec and bug #40505.
21711 2003-07-14 Martin Baulig <martin@ximian.com>
21713 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
21715 2003-07-14 Martin Baulig <martin@ximian.com>
21717 * codegen.cs (EmitContext.InFixedInitializer): New public field.
21719 * ecore.cs (IVariable.VerifyFixed): New interface method.
21721 * expression.cs (Unary.ResolveOperator): When resolving the `&'
21722 operator, check whether the variable is actually fixed. Fixes bug
21723 #36055. Set a variable definitely assigned when taking its
21724 address as required by the spec.
21726 * statement.cs (LocalInfo.IsFixed): New field.
21727 (LocalInfo.MakePinned): Set `IsFixed' to true.
21729 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21731 * attribute.cs (Attribute.Resolve): While doing a Member lookup
21732 for .ctors, ensure that we only ask for members declared in the
21733 attribute type (BindingFlags.DeclaredOnly).
21737 * expression.cs (Error_WrongNumArguments): Report error 1501
21738 correctly the way CSC does.
21740 2003-07-13 Martin Baulig <martin@ximian.com>
21742 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
21743 lookup on the fully qualified name, to make things like "X.X" work
21744 where "X.X" is a fully qualified type name, but we also have a
21745 namespace "X" in the using list. Fixes #41975.
21747 2003-07-13 Martin Baulig <martin@ximian.com>
21749 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
21750 function. If we're a CompoundAssign, we need to create an embedded
21751 CompoundAssign, not an embedded Assign.
21752 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
21755 2003-07-13 Martin Baulig <martin@ximian.com>
21757 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
21758 work to fix bug #46088.
21760 2003-07-13 Ravi Pratap <ravi@ximian.com>
21762 * class.cs (Operator.Emit): Do not emit attributes here - it is
21763 taken care of by the Method class that we delegate too. This takes
21764 care of bug #45876.
21766 2003-07-10 Martin Baulig <martin@ximian.com>
21768 * expression.cs (TypeOfVoid): New class.
21769 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
21771 2003-07-10 Martin Baulig <martin@ximian.com>
21773 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
21776 2003-07-10 Martin Baulig <martin@ximian.com>
21778 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
21779 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
21781 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
21783 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
21785 2003-07-10 Martin Baulig <martin@ximian.com>
21787 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
21788 of decimal. Fixes #42850.
21790 NOTE: I also fixed the created byte blob, but this doesn't work on
21791 the MS runtime and csc never produces any byte blobs for decimal
21794 2003-07-10 Martin Baulig <martin@ximian.com>
21796 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
21797 structs; fixes #32068.
21798 (Block.AddChildVariableNames): Fixed #44302.
21800 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21802 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
21804 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21806 * attribute.cs: And this test is onger needed.
21808 2003-07-08 Martin Baulig <martin@ximian.com>
21810 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
21811 inaccessible types. Fixes #36313.
21813 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
21815 * namespace.cs (NamespaceEntry): Create implicit entries for all
21816 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
21817 implicit entries for N1.N2 and N1.
21819 2003-07-08 Martin Baulig <martin@ximian.com>
21821 Rewrote the handling of namespaces to fix a lot of the issues
21822 wrt. `using' aliases etc.
21824 * namespace.cs (Namespace): Splitted this class into a
21825 per-assembly `Namespace' and a per-file `NamespaceEntry'.
21827 * typemanager.cs (TypeManager.IsNamespace): Removed.
21828 (TypeManager.ComputeNamespaces): Only compute namespaces from
21829 loaded assemblies here, not the namespaces from the assembly we're
21830 currently compiling.
21832 2003-07-08 Martin Baulig <martin@ximian.com>
21834 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
21836 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21838 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
21841 I thought about the memory savings here, but LookupTypeReflection
21842 is used under already very constrained scenarios. Compiling
21843 corlib or mcs only exposes one hit, so it would not really reduce
21844 any memory consumption.
21846 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21848 * typemanager.cs: fixes bug #45889 by only adding public types from
21849 other assemblies to the list of known types.
21851 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21853 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
21854 on the type we resolved.
21856 2003-07-05 Martin Baulig <martin@ximian.com>
21858 * pending.cs (PendingImplementation.ParentImplements): Don't
21859 create the proxy if the parent is abstract.
21861 * class.cs (TypeContainer.DefineIndexers): Process explicit
21862 interface implementations first. Fixes #37714.
21864 2003-07-04 Miguel de Icaza <miguel@ximian.com>
21866 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
21867 defined recursively; but since we modify the input parameters
21868 (left is set to `this' temporarily), we reset this value if the
21869 left_is_explicit is false, which gives the original semantics to
21872 * literal.cs (NullPointer): new class used to represent a null
21873 literal in a pointer context.
21875 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
21876 type is a pointer, use a NullPointer object instead of a
21877 NullLiteral. Closes 43687
21879 (ExplicitConversion): Convert pointer values using
21880 the conv opcode to the proper type.
21882 * ecore.cs (New): change ValueTypeVariable property into a method,
21883 that returns whether the valuetype is suitable for being used.
21885 * expression.cs (Binary.DoNumericPromotions): Only return if we
21886 the int constant was a valid uint, and we can return both left and
21887 right as uints. If not, we continue processing, to trigger the
21888 type conversion. This fixes 39018.
21890 * statement.cs (Block.EmitMeta): During constant resolution, set
21891 the CurrentBlock property on the emitcontext, so that we resolve
21892 constants propertly.
21894 2003-07-02 Martin Baulig <martin@ximian.com>
21896 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
21897 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
21899 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
21900 than emitting it here.
21902 * statement.cs: Fixed some more flow analysis bugs.
21904 2003-07-02 Martin Baulig <martin@ximian.com>
21906 * class.cs (MethodData.Define): When implementing interface
21907 methods, set Final unless we're Virtual.
21909 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
21910 check work for interface methods.
21912 2003-07-01 Martin Baulig <martin@ximian.com>
21914 * ecore.cs (EmitContext.This): Replaced this property with a
21915 GetThis() method which takes a Location argument. This ensures
21916 that we get the correct error location for a CS0188.
21918 2003-07-01 Miguel de Icaza <miguel@ximian.com>
21920 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
21921 ImplicitStandardConversion.
21923 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
21925 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
21927 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
21930 2003-06-30 Miguel de Icaza <miguel@ximian.com>
21932 * class.cs (Constructor.Define): Turn off initlocals for unsafe
21935 (MethodData.Define): Turn off initlocals for unsafe methods.
21937 2003-06-29 Miguel de Icaza <miguel@ximian.com>
21939 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
21940 complete; Fixes #37521.
21942 * delegate.cs: Use Modifiers.TypeAttr to compute the
21943 TypeAttributes, instead of rolling our own. This makes the flags
21944 correct for the delegates.
21946 2003-06-28 Miguel de Icaza <miguel@ximian.com>
21948 * class.cs (Constructor.Define): Set the private flag for static
21949 constructors as well.
21951 * cs-parser.jay (statement_expression): Set the return value to
21952 null, to avoid a crash when we catch an error.
21954 2003-06-24 Miguel de Icaza <miguel@ximian.com>
21956 * cs-parser.jay: Applied patch from Jackson that adds support for
21957 extern and unsafe modifiers to destructor declarations.
21959 * expression.cs: Report error 21 if the user is trying to index a
21962 * driver.cs: Add an error message, suggested by the bug report.
21964 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
21965 if we do not have a ": this ()" constructor initializer. Fixes 45149
21967 2003-06-14 Miguel de Icaza <miguel@ximian.com>
21969 * namespace.cs: Add some information to reduce FAQs.
21971 2003-06-13 Miguel de Icaza <miguel@ximian.com>
21973 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
21974 underlying enumeration types. Fixes #43915.
21976 * expression.cs: Treat ushort/short as legal values to be used in
21977 bitwise operations.
21979 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
21981 * delegate.cs: transfer custom attributes for paramenters from
21982 the delegate declaration to Invoke and BeginInvoke.
21984 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
21986 * attribute.cs: handle custom marshalers and emit marshal info
21989 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
21991 * makefile.gnu: Added anonymous.cs to the compiler sources.
21993 2003-05-28 Miguel de Icaza <miguel@ximian.com>
21995 * iterators.cs: Change the name of the proxy class to include two
21998 * cs-parser.jay: Update grammar to include anonymous methods.
22000 * anonymous.cs: new file.
22002 2003-05-27 Miguel de Icaza <miguel@ximian.com>
22004 * class.cs (Field.Define): Add missing test for pointers and
22007 2003-05-27 Ravi Pratap <ravi@ximian.com>
22009 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
22010 we use the stobj opcode.
22012 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
22013 since it wasn't the correct fix.
22015 It still is puzzling that we are required to use stobj for IntPtr
22016 which seems to be a ValueType.
22018 2003-05-26 Miguel de Icaza <miguel@ximian.com>
22020 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
22021 during regular simple name resolution. Now, the trick is that
22022 instead of returning for processing the simplename, we do a
22023 TypeManager.LookupType (ie, a rooted lookup as opposed to a
22024 contextual lookup type). If a match is found, return that, if
22025 not, return for further composition.
22027 This fixes long-standing 30485.
22029 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
22030 using the address to initialize an object, do an Stobj instead of
22031 using the regular Stelem.
22033 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
22034 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
22035 Because if we are a BaseIndexerAccess that value will be true.
22038 * statement.cs (GotoCase.Resolve): Return after reporting an
22039 error, do not attempt to continue.
22041 * expression.cs (PointerArithmetic.Emit): If our operand is a
22042 long, convert our constants to match the operand before
22043 multiplying. Convert to I type before adding. Fixes 43670.
22045 2003-05-14 Ravi Pratap <ravi@ximian.com>
22047 * enum.cs (ImplicitConversionExists) : Rename to
22048 ImplicitEnumConversionExists to remove ambiguity.
22050 * ecore.cs (NullCast): New type of cast expression class which
22051 basically is very similar to EmptyCast with the difference being
22052 it still is a constant since it is used only to cast a null to
22054 (eg. (string) null)
22056 * convert.cs (ImplicitReferenceConversion): When casting a null
22057 literal, we return a NullCast.
22059 * literal.cs (NullLiteralTyped): Remove - I don't see why this
22060 should be around anymore.
22062 The renaming (reported was slightly wrong). Corrections:
22064 ConvertImplicitStandard -> ImplicitConversionStandard
22065 ConvertExplicitStandard -> ExplicitConversionStandard
22067 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
22068 before passing them in !
22070 * convert.cs (ImplicitConversionStandard): When comparing for
22071 equal expr and target types, ensure that expr is not a
22074 In general, we must not be checking (expr_type ==
22075 target_type) in the top level conversion methods
22076 (ImplicitConversion, ExplicitConversion etc). This checking is
22077 done in the methods that they delegate to.
22079 2003-05-20 Miguel de Icaza <miguel@ximian.com>
22081 * convert.cs: Move Error_CannotConvertType,
22082 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
22083 ImplicitNumericConversion, ImplicitConversionExists,
22084 ImplicitUserConversionExists, StandardConversionExists,
22085 FindMostEncompassedType, FindMostSpecificSource,
22086 FindMostSpecificTarget, ImplicitUserConversion,
22087 ExplicitUserConversion, GetConversionOperators,
22088 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
22089 TryImplicitIntConversion, Error_CannotConvertImplicit,
22090 ConvertImplicitRequired, ConvertNumericExplicit,
22091 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
22092 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
22095 Perform the following renames:
22097 StandardConversionExists -> ImplicitStandardConversionExists
22098 ConvertImplicit -> ImplicitConversion
22099 ConvertImplicitStandard -> ImplicitStandardConversion
22100 TryImplicitIntConversion -> ImplicitIntConversion
22101 ConvertImplicitRequired -> ImplicitConversionRequired
22102 ConvertNumericExplicit -> ExplicitNumericConversion
22103 ConvertReferenceExplicit -> ExplicitReferenceConversion
22104 ConvertExplicit -> ExplicitConversion
22105 ConvertExplicitStandard -> ExplicitStandardConversion
22107 2003-05-19 Martin Baulig <martin@ximian.com>
22109 * statement.cs (TypeInfo.StructInfo): Made this type protected.
22110 (TypeInfo): Added support for structs having structs as fields.
22112 * ecore.cs (FieldExpr): Implement IVariable.
22113 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
22114 VariableInfo for the field.
22116 2003-05-18 Martin Baulig <martin@ximian.com>
22118 * expression.cs (This.DoResolve): Report a CS0027 if we're
22119 emitting a field initializer.
22121 2003-05-18 Martin Baulig <martin@ximian.com>
22123 * expression.cs (This.ResolveBase): New public function.
22124 (This.DoResolve): Check for CS0188.
22126 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
22129 * ecore.cs (MethodGroupExpr.DoResolve): Set the
22130 `instance_expression' to null if we don't have any non-static
22133 2003-05-18 Martin Baulig <martin@ximian.com>
22135 Reworked the way how local variables and parameters are handled by
22136 the flow analysis code.
22138 * statement.cs (TypeInfo, VariableMap): New public classes.
22139 (VariableInfo): New public class. This is now responsible for
22140 checking whether a variable has been assigned. It is used for
22141 parameters and local variables.
22142 (Block.EmitMeta): Take the InternalParameters as argument; compute
22143 the layout of the flow vectors here.
22144 (Block.LocalMap, Block.ParameterMap): New public properties.
22145 (FlowBranching): The .ctor doesn't get the InternalParameters
22146 anymore since Block.EmitMeta() now computes the layout of the flow
22148 (MyStructInfo): This class is now known as `StructInfo' and nested
22149 in `TypeInfo'; we don't access this directly anymore.
22151 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
22152 property and removed IsAssigned(), IsFieldAssigned(),
22153 SetAssigned() and SetFieldAssigned(); we now call them on the
22154 VariableInfo so we don't need to duplicate this code everywhere.
22156 * expression.cs (ParameterReference): Added `Block block' argument
22158 (LocalVariableReference, ParameterReference, This): The new
22159 VariableInfo class is now responsible for all the definite
22162 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
22163 IsParameterAssigned, SetParameterAssigned): Removed.
22165 2003-05-18 Martin Baulig <martin@ximian.com>
22167 * typemanager.cs (InitCoreTypes): Try calling
22168 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
22169 the 3-args-version. Corlib now also needs our `void_type'.
22170 (GetMethod): Added overloaded version which takes an optional
22171 `bool report_errors' to allow lookups of optional methods.
22173 2003-05-12 Martin Baulig <martin@ximian.com>
22175 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
22176 only used for locals and not for parameters.
22178 2003-05-12 Miguel de Icaza <miguel@ximian.com>
22180 * support.cs (InternalParameters.ParameterType): Return the
22181 ExternalType of the parameter.
22183 * parameter.cs (Parameter.ExternalType): drop the two arguments,
22186 2003-05-11 Miguel de Icaza <miguel@ximian.com>
22188 * class.cs (MethodData.Define): Do not set the `newslot' on
22189 interface members, if they are also flagged as "override".
22191 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
22192 better code for ++i and i++. This only works for static fields
22193 and local variables.
22195 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
22196 want to pull the DeclSpace out of the builder_to_declspace instead
22197 of the TypeBuilder (like in TypeContainer.FindMembers).
22199 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
22200 instead of LookupTypeContainer. Fixes the crash on .NET for
22201 looking up interface members.
22203 * const.cs: Create our own emit context during the Definition
22204 stage, so that constants are evaluated in the proper context, when
22205 a recursive definition happens.
22207 2003-05-11 Martin Baulig <martin@ximian.com>
22209 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
22210 new block for a switch section.
22211 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
22212 the adding/lookup in the switch block. Fixes #39828.
22214 2003-05-09 Miguel de Icaza <miguel@ximian.com>
22216 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
22217 functionality: I needed to convert the data after I had performed
22218 the add/sub operation into the operands type size.
22220 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
22221 pass the type for the box operation, otherwise the resulting
22222 object would have been of type object.
22224 (BoxedCast): Add constructor to specify the type to box as.
22226 2003-05-07 Miguel de Icaza <miguel@ximian.com>
22228 * iterators.cs: I was reusing the `count' variable inadvertently,
22229 take steps to not allow this to happen.
22231 2003-05-06 Miguel de Icaza <miguel@ximian.com>
22233 * attribute.cs (Attribute.Resolve): Params attributes are encoded
22234 by creating an array at the point where the params starts and
22235 putting all those arguments there, then adjusting the size of the
22238 2003-05-05 Miguel de Icaza <miguel@ximian.com>
22240 * expression.cs (New.AddressOf): Implement interface
22241 IMemoryLocation. This is used when the `new' operator is used in
22242 the context of an invocation to a method on a value type.
22244 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
22247 * namespace.cs: Also check the using aliases here.
22249 * driver.cs: Move the test for using validity after the types have
22250 been entered, so we do a single pass that also includes the using
22253 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
22254 in the regular case. CreateSiblingForFinally is doing extra
22257 * attribute.cs (GetAttributeArgumentExpression): Store the result
22258 on an out value, and use the return value to indicate failure
22259 instead of using null (which is a valid return for Constant.GetValue).
22261 * statement.cs: Perform the analysis flow for the increment
22262 portion after the statement, because this will be the real flow of
22263 execution. Fixes #42385
22265 * codegen.cs (EmitContext.EmitArgument,
22266 EmitContext.EmitStoreArgument): New helper functions when the
22267 RemapToProxy flag is set.
22269 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
22272 Add support for remapping parameters.
22274 * iterators.cs: Propagate parameter values; Store parameter
22275 values in the proxy classes.
22277 2003-05-04 Miguel de Icaza <miguel@ximian.com>
22279 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
22280 need a proxy reference; I do not know what I was thinking
22282 * cs-parser.jay (constructor_initializer): catch another error,
22283 and display nice message.
22285 (field_declaration): catch void field declaration
22286 to flag a better error.
22288 * class.cs (MemberBase.CheckBase): Report an error instead of a
22289 warning if a new protected member is declared in a struct.
22290 (Field.Define): catch the error of readonly/volatile.
22292 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
22294 (FieldExpr.AddressOf): ditto. Catch error where the address of a
22295 volatile variable is taken
22297 2003-05-02 Miguel de Icaza <miguel@ximian.com>
22299 * statement.cs (Fixed.Resolve): Report an error if we are not in
22302 2003-05-01 Miguel de Icaza <miguel@ximian.com>
22304 * typemanager.cs: reuse the code that handles type clashes for
22305 delegates and enumerations.
22307 * class.cs (Report28): Always report.
22309 * expression.cs (EncodeAsAttribute): Allow nulls here.
22311 2003-04-28 Miguel de Icaza <miguel@ximian.com>
22313 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
22314 the functionality for testing whether an expression is valid for
22315 an attribute here. Also handle the case of arrays of elements
22318 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
22319 encoding a linear array into an array of objects that are suitable
22320 to be passed to an CustomAttributeBuilder.
22322 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
22324 * ecore.cs: (FieldExpr): Handle field remapping here.
22326 * iteratators.cs: Pass the instance variable (if the method is an
22327 instance method) to the constructors, so we can access the field
22328 variables on the class.
22330 TODO: Test this with structs. I think the THIS variable on
22331 structs might have to be a pointer, and not a refenrece
22333 2003-04-27 Miguel de Icaza <miguel@ximian.com>
22335 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
22336 local variables to fields in a proxy class.
22338 * iterators.cs (PopulateProxy): Rename our internal fields to
22340 Create a <THIS> field if we are an instance method, so we can
22341 reference our parent container variables.
22342 (MapVariable): Called back from the EmitContext code to enter a
22343 new variable to field mapping into the proxy class (we just create
22347 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
22348 for using the remapped locals to fields.
22350 I placed the code here, because that gives the same semantics to
22351 local variables, and only changes the Emit code.
22353 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
22354 statements inside iterators.
22355 (VariableInfo): Add a FieldBuilder for the cases when we are
22356 remapping local variables to fields in a proxy class
22358 * ecore.cs (SimpleNameResolve): Avoid testing two times for
22359 current_block != null.
22361 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
22362 not cope with strings, as it has been moved to the
22363 TableSwitchEmit. Fixed bug in switch generation.
22365 * expression.cs (New.DoResolve): Provide more context for the user
22366 when reporting an error.
22368 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
22371 * expression.cs (MemberAccess.DoResolve): When we get a type back,
22372 check the permissions for it. Note than in a type-resolution
22373 context the check was already present in DeclSpace.ResolveType,
22374 but was missing from the MemberAccess.
22376 (ArrayCreation.CheckIndices): warn if the user has
22377 more nested levels of expressions, but there are no more
22378 dimensions specified. Avoids crash on bug 41906.
22380 2003-04-26 Miguel de Icaza <miguel@ximian.com>
22382 * statement.cs (Block): replace Implicit bool, for a generic
22384 New flag: `Unchecked'. This is used during the EmitMeta phase
22385 (which is out-of-line with the regular Resolve/Emit process for a
22386 statement, as this is done ahead of time, but still gets a chance
22387 to call constant resolve).
22389 (Block.Flags): new enum for adding a new flag.
22391 (Block.EmitMeta): track the state of unchecked.
22393 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
22394 to enable constant resolution to work there as well.
22396 2003-04-22 Miguel de Icaza <miguel@ximian.com>
22398 * typemanager.cs (ienumerable_type): Also look up
22399 System.Collections.IEnumerable.
22401 2003-04-21 Miguel de Icaza <miguel@ximian.com>
22403 TODO: Test more than one conditional per method.
22405 * class.cs (Indexer.Define): Report the location where the user is
22406 referencing the unsupported feature.
22408 (MethodData): Overload the use of `conditionals' to
22409 minimize the creation of needless ArrayLists. This saves roughly
22410 212kb on my machine.
22412 (Method): Implement the new IIteratorContainer interface.
22413 (Method.SetYields): Implement the method by setting the ModFlags
22414 to contain METHOD_YIELDS.
22416 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
22417 which just got set to null.
22419 * iterators.cs: New file.
22421 (Yield, YieldBreak): New statements.
22423 * statement.cs (Return.Resolve): Flag an error if we are used in
22424 an iterator method.
22426 * codegen.cs (InIterator): New flag set if the code is being
22427 compiled in an iterator method.
22429 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
22430 internal modifier, and we just use it to avoid adding extra
22431 fields, as this is seldom used.
22433 * cs-parser.jay: Add yield_statement (yield and yield break).
22435 * driver.cs: New flag -v2 to turn on version 2 features.
22437 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
22438 hashtable when v2 is enabled.
22440 2003-04-20 Miguel de Icaza <miguel@ximian.com>
22442 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
22443 there is already a namespace defined with this name.
22445 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
22446 people upgraded their corlibs.
22448 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
22449 always use fully qualified types, no need to use the compiler
22452 (TypeManager.IsNamespace): Use binarysearch.
22454 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
22455 AddDelegate): I did not quite use the new IsValid API properly: I
22456 have to pass the short-name and the fullname. I was passing only
22457 the basename instead of the fullname sometimes.
22459 (TypeContainer.DefineType): call NamespaceClash.
22461 * interface.cs (Interface.DefineType): use NamespaceClash before
22464 * delegate.cs (Delegate.DefineType): use NamespaceClash before
22467 * enum.cs: (Enum.DefineType): use NamespaceClash before
22470 * typemanager.cs (: 3-line patch that gives us some tasty 11%
22471 speed increase. First, use the negative_hits cache when we get a
22472 negative. Second, add the type with its full original name
22473 instead of the new . and + encoded name (reflection uses + to
22474 separate type from a nested type). Use LookupTypeReflection
22475 directly which bypasses the type->name hashtable (that we already
22476 know does not contain the type.
22478 * decl.cs (DeclSpace.ResolveTypeExpr): track the
22479 location/container type.
22481 * driver.cs: When passing utf8, use directly the UTF8Encoding.
22483 2003-04-19 Miguel de Icaza <miguel@ximian.com>
22485 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
22487 * delegate.cs (NewDelegate.Resolve): Test whether an instance
22488 method is being referenced in the method group from a static
22489 context, and report error 120 if so.
22491 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
22494 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
22495 is created, we create the A namespace).
22497 * cs-parser.jay: A namespace also introduces a DeclarationFound.
22500 2003-04-18 Miguel de Icaza <miguel@ximian.com>
22502 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
22503 invocation to ModuleBuilder.GetType with the same values will
22504 return a new type instance, so we need to cache its return
22507 * expression.cs (Binary.ResolveOperator): Only allow the compare
22508 operators on enums if they are of the same type.
22510 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
22511 types of ValueType on their own case. Before we were giving them
22512 the same treatment as objects.
22514 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
22515 fullname. Short name is used to compare against container name.
22516 Fullname is used to check against defined namespace names.
22518 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
22519 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
22521 (Method.CheckBase): Call parent.
22522 (MemberBase.CheckBase): Check for protected members on sealed
22524 (PropertyBase.CheckBase): Call parent.
22525 (Field.Define): Call parent.
22527 * report.cs: Negative error codes are now mapped to 8000 - code,
22528 so that the display is render more nicely.
22530 * typemanager.cs: Do not use try/catch, instead report a regular
22533 (GetPointerType, GetReferenceType): These methods provide
22534 mechanisms to obtain the T* and T& from a T. We had the code
22535 previously scattered around the code base, and it also used
22536 TypeManager.LookupType that would go through plenty of caches.
22537 This one goes directly to the type source.
22539 In some places we did the Type.GetType followed by
22540 ModuleBuilder.GetType, but not in others, so this unifies the
22541 processing as well.
22543 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
22544 statements now that we have namespace information.
22546 * typemanager.cs (IsNamespace): New method, returns whether the
22547 string presented is a namespace or not.
22549 (ComputeNamespaces): New public entry point, computes the list of
22550 available namespaces, using the GetNamespaces API call in Mono, or
22551 the slower version in MS.NET.
22553 Now before we start the semantic analysis phase, we have a
22554 complete list of namespaces including everything that the user has
22557 Deleted old code to cache namespaces in .nsc files.
22559 2003-04-17 Miguel de Icaza <miguel@ximian.com>
22561 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
22562 class/struct location definition Location for the implicit
22563 constructor location.
22565 (Operator.Define): Use the location of the operator for the
22566 implicit Method definition.
22568 (Constructor.Emit): use the constructor location for the implicit
22569 base initializer constructor.
22571 * ecore.cs: Remove ITypeExpression. This interface is now gone,
22572 and the Expression class now contains two new methods:
22574 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
22575 isolate type lookup from the rest of the resolution process.
22577 Since we use Expressions to hold type definitions due to the way
22578 we parse the input we have historically overloaded Resolve to
22579 perform the Type lookups if a special flag is passed. Now this is
22580 eliminated and two methods take their place.
22582 The differences in the two methods between xStep and xTerminal is
22583 that xStep is involved in our current lookup system that uses
22584 SimpleNames to compose a name, while xTerminal is used just to
22585 catch the case where the simplename lookup failed.
22587 2003-04-16 Miguel de Icaza <miguel@ximian.com>
22589 * expression.cs (ResolveMemberAccess): Remove redundant code.
22590 TypeExpr expressions are always born fully resolved.
22592 * interface.cs (PopulateMethod): Do not lookup the types twice.
22593 We were doing it once during SemanticAnalysis and once during
22596 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
22597 in local variable type definitions, were being returned as a
22598 SimpleName (we decomposed everything into a string), that is
22599 because primary_expression was being used instead of a type in the
22600 grammar (reduce/reduce conflicts).
22602 The part that was wrong is that we converted the expression into a
22603 string (an oversimplification in one hand, compounded with primary
22604 expressions doing string concatenation).
22610 Would return "A.B.C[]" as a SimpleName. This stopped things like
22611 using clauses from working on this particular context. And a type
22612 was being matched directly against "A.B.C[]".
22614 We now use the correct approach, and allow for ComposedCast to be
22615 part of the unary expression. So the "A.B.C []" become a composed
22616 cast of "A.B.C" (as a nested group of MemberAccess with a
22617 SimpleName at the end) plus the rank composition "[]".
22621 2003-04-10 Miguel de Icaza <miguel@ximian.com>
22623 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
22624 for the access level checking.
22626 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
22627 `TypeContainer container', because I kept getting confused when I
22628 was debugging this code.
22630 * expression.cs (Indexers): Instead of tracking getters/setters,
22631 we now track them in parallel. We create one arraylist less, but
22632 most importantly it is possible now for the LValue code to find a
22633 matching get for a set.
22635 (IndexerAccess.DoResolveLValue): Update the code.
22636 GetIndexersForType has been modified already to extract all the
22637 indexers from a type. The code assumed it did not.
22639 Also make the code set the correct return type for the indexer.
22640 This was fixed a long time ago for properties, but was missing for
22641 indexers. It used to be void_type.
22643 (Binary.Emit): Test first for doubles instead of
22644 floats, as they are more common.
22646 (Binary.EmitBranchable): Use the .un version of the branch opcodes
22647 when dealing with floats and the <=, >= operators. This fixes bug
22650 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
22651 to load the array value by emitting a load on the foreach variable
22652 type. This was incorrect.
22654 We now emit the code to load an element using the the array
22655 variable type, and then we emit the conversion operator.
22659 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
22661 * attribute.cs: Avoid allocation of ArrayLists in the common case.
22663 2003-04-09 Miguel de Icaza <miguel@ximian.com>
22665 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
22666 test for protection before we test for signatures.
22668 (MethodSignature.ToString): implement.
22670 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
22671 to the case where we reduced into a LongConstant.
22673 * decl.cs (CheckAccessLevel): If the type is an array, we can not
22674 depend on whether the information is acurrate, because the
22675 Microsoft runtime will always claim that the array type is public,
22676 regardless of the real state.
22678 If the type is a pointer, another problem happens: the type is
22679 reported as non-public in Microsoft.
22681 In both cases we have to call CheckAccessLevel recursively with
22682 the underlying type as the argument to be tested.
22684 2003-04-08 Miguel de Icaza <miguel@ximian.com>
22686 * assign.cs (Assign.Emit): If we are dealing with a compound
22687 assignment expression, we should use the code path that stores the
22688 intermediate result in a temporary value. This fixes #40903.
22690 *expression.cs (Indirection.ToString): Provide ToString method for
22693 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
22695 * class.cs: Null out fields holding references to Block objects so
22696 they can be garbage collected.
22698 * expression.cs (OverloadResolve): Remove unused local.
22700 2003-04-07 Martin Baulig <martin@ximian.com>
22702 * codegen.cs (EmitContext.CurrentFile): New public field.
22703 (EmitContext.Mark): Use the CurrentFile to check whether the
22704 location is in the correct file.
22705 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
22707 2003-04-07 Martin Baulig <martin@ximian.com>
22709 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
22711 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
22712 location. [FIXME: The location argument which gets passed to this
22713 method is sometimes wrong!]
22715 2003-04-07 Nick Drochak <ndrochak@gol.com>
22717 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
22719 2003-04-07 Miguel de Icaza <miguel@ximian.com>
22721 * expression.cs (Indirection.EmitAssign): We were using the
22722 temporary, but returning immediately instead of continuing the
22725 2003-04-06 Martin Baulig <martin@ximian.com>
22727 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
22728 if it's a nested child, but also deriving from the outer class.
22731 * typemanager.cs (IsNestedChildOf): Make this work if it's a
22732 nested child, but also deriving from the outer class. See
22734 (FilterWithClosure): We may access private members of the outer
22735 class if we're a nested child and deriving from the outer class.
22736 (RealMemberLookup): Only set `closure_private_ok' if the
22737 `original_bf' contained BindingFlags.NonPublic.
22739 2003-04-05 Martin Baulig <martin@ximian.com>
22741 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
22743 2003-04-02 Miguel de Icaza <miguel@ximian.com>
22745 * class.cs (Event.Define): Do not allow abstract events to have
22748 2003-04-01 Miguel de Icaza <miguel@ximian.com>
22750 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
22751 block in event declarations.
22753 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
22754 value type, get its address.
22756 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
22757 leaving a class on the stack instead of a boolean value (int
22758 0/1). Change the code so we compare against null, and then the
22759 result against zero.
22761 * class.cs (TypeContainer.GetClassBases): We were checking for the
22762 parent class being sealed too late.
22764 * expression.cs (Binary.Emit): For <= and >= when dealing with
22765 floating point values, use cgt.un and clt.un instead of cgt and
22768 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
22770 * statement.cs: Apply the same optimization as MS: skip the
22771 GetEnumerator returning an IEnumerator, and use the one returning a
22772 CharEnumerator instead. This allows us to avoid the try-finally block
22775 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
22777 * cs-parser.jay: Attributes cannot be applied to
22778 namespaces. Fixes #40473
22780 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22783 (Add*): check if the name is valid using the full name for constants,
22784 fields, properties and events.
22786 2003-03-28 Miguel de Icaza <miguel@ximian.com>
22788 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
22789 char constants to be part of the enumeration.
22791 * expression.cs (Conditional.DoResolve): Add support for operator
22792 true. Implements the missing functionality from 14.12
22794 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
22795 operator true/false as required by the spec.
22797 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
22798 implicit conversion to boolean.
22800 * statement.cs (Statement.ResolveBoolean): A boolean expression is
22801 also one where the type implements `operator true'.
22803 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
22804 get an expression that will invoke operator true based on an
22807 (GetConversionOperators): Removed the hack that called op_True
22810 (Expression.ResolveBoolean): Move this from Statement.
22812 2003-03-17 Miguel de Icaza <miguel@ximian.com>
22814 * ecore.cs (FieldExpr): do not allow initialization of initonly
22815 fields on derived classes
22817 2003-03-13 Martin Baulig <martin@ximian.com>
22819 * statement.cs (Block.Emit): Call ig.BeginScope() and
22820 ig.EndScope() when compiling with debugging info; call
22821 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
22823 2003-03-08 Miguel de Icaza <miguel@ximian.com>
22825 * expression.cs (Indexers): Do not construct immediately, allow
22826 for new members to be appended as we go. Fixes 38143
22828 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22830 * expression.cs: save/restore context when resolving an unchecked
22833 2003-03-05 Miguel de Icaza <miguel@ximian.com>
22835 * cfold.cs: Catch division by zero in modulus operator during
22838 2003-03-03 Miguel de Icaza <miguel@ximian.com>
22840 * interface.cs (Interface.DefineMembers): Avoid defining members
22843 2003-02-27 Miguel de Icaza <miguel@ximian.com>
22845 * driver.cs: handle the +/- options for -noconfig
22847 * statement.cs (Unckeched.Resolve): Also track the state of
22848 unchecked in the Resolve phase.
22850 2003-02-27 Martin Baulig <martin@ximian.com>
22852 * ecore.cs (Expression.MemberLookup): Don't create a
22853 MethodGroupExpr for something which is not a method. Fixes #38291.
22855 2003-02-25 Miguel de Icaza <miguel@ximian.com>
22857 * class.cs (MemberBase.CheckParameters): Also check that the type
22858 is unmanaged if it is a pointer.
22860 * expression.cs (SizeOf.Resolve): Add location information.
22862 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
22863 a managed type is declared.
22865 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
22866 parameter modifiers as well. Fixes bug 38606
22868 * class.cs: Very sad. Am backing out the speed up changes
22869 introduced by the ArrayList -> Array in the TypeContainer, as they
22870 were not actually that much faster, and introduced a bug (no error
22871 reports on duplicated methods).
22873 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
22874 source first, this will guarantee that we have a valid expression
22875 before calling in lower levels functions that will require a
22876 resolved object. Then use this original_source in the
22877 target.ResolveLValue instead of the original source that was
22880 Another change. Use target.Resolve instead of LValueResolve.
22881 Although we are resolving for LValues, we will let the Assign code
22882 take care of that (it will be called again from Resolve). This
22883 basically allows code like this:
22885 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
22886 class Y { void A (X x) { x [0] += o; }
22888 The problem was that the indexer was trying to resolve for
22889 set_Item (idx, object o) and never finding one. The real set_Item
22890 was set_Item (idx, X). By delaying the process we get the right
22895 2003-02-23 Martin Baulig <martin@ximian.com>
22897 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
22898 while calling DoEmit ().
22900 * codegen.cs (EmitContext.Mark): Don't mark locations in other
22901 source files; if you use the #line directive inside a method, the
22902 compiler stops emitting line numbers for the debugger until it
22903 reaches the end of the method or another #line directive which
22904 restores the original file.
22906 2003-02-23 Martin Baulig <martin@ximian.com>
22908 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
22910 2003-02-23 Martin Baulig <martin@ximian.com>
22912 * statement.cs (Block.AddChildVariableNames): We need to call this
22913 recursively, not just for our immediate children.
22915 2003-02-23 Martin Baulig <martin@ximian.com>
22917 * class.cs (Event.Define): Always make the field private, like csc does.
22919 * typemanager.cs (TypeManager.RealMemberLookup): Make events
22920 actually work, fixes bug #37521.
22922 2003-02-23 Miguel de Icaza <miguel@ximian.com>
22924 * delegate.cs: When creating the various temporary "Parameters"
22925 classes, make sure that we call the ComputeAndDefineParameterTypes
22926 on those new parameters (just like we do with the formal ones), to
22927 allow them to be resolved in the context of the DeclSpace.
22929 This fixes the bug that Dick observed in Bugzilla #38530.
22931 2003-02-22 Miguel de Icaza <miguel@ximian.com>
22933 * expression.cs (ResolveMemberAccess): When resolving a constant,
22934 do not attempt to pull a constant if the value was not able to
22935 generate a valid constant.
22937 * const.cs (LookupConstantValue): Do not report more errors than required.
22939 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22941 * expression.cs: fixes bug #38328.
22943 2003-02-18 Miguel de Icaza <miguel@ximian.com>
22945 * class.cs: Changed all the various members that can be part of a
22946 class from being an ArrayList to be an Array of the right type.
22947 During the DefineType type_list, interface_list, delegate_list and
22948 enum_list are turned into types, interfaces, delegates and enums
22951 And during the member population, indexer_list, event_list,
22952 constant_list, field_list, instance_constructor_list, method_list,
22953 operator_list and property_list are turned into their real arrays.
22955 Although we could probably perform this operation earlier, for
22956 good error reporting we need to keep the lists and remove the
22957 lists for longer than required.
22959 This optimization was triggered by Paolo profiling the compiler
22960 speed on the output of `gen-sample-program.pl' perl script.
22962 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
22963 not crash in methods like MemberLookupFailed that use this field.
22965 This problem arises when the compiler fails to resolve a type
22966 during interface type definition for example.
22968 2003-02-18 Miguel de Icaza <miguel@ximian.com>
22970 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
22971 inherit from System.Object, so we have to stop at null, not only
22972 when reaching System.Object.
22974 2003-02-17 Miguel de Icaza <miguel@ximian.com>
22976 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
22977 DeclaredOnly because the parent indexer might have had a different
22978 name, but did not loop until the top of the hierarchy was reached.
22980 The problem this one fixes is 35492: when a class implemented an
22981 indexer from an interface, we were getting the interface method
22982 (which was abstract) and we were flagging an error (can not invoke
22985 This also keeps bug 33089 functioning, and test-148 functioning.
22987 * typemanager.cs (IsSpecialMethod): The correct way of figuring
22988 out if a method is special is to see if it is declared in a
22989 property or event, or whether it is one of the predefined operator
22990 names. This should fix correctly #36804.
22992 2003-02-15 Miguel de Icaza <miguel@ximian.com>
22994 The goal here is to remove the dependency on EmptyCast.Peel ().
22995 Killing it completely.
22997 The problem is that currently in a number of places where
22998 constants are expected, we have to "probe" for an EmptyCast, and
22999 Peel, which is not the correct thing to do, as this will be
23000 repetitive and will likely lead to errors.
23002 The idea is to remove any EmptyCasts that are used in casts that
23003 can be reduced to constants, so we only have to cope with
23006 This bug hunt was triggered by Bug 37363 and the desire to remove
23007 the duplicate pattern where we were "peeling" emptycasts to check
23008 whether they were constants. Now constants will always be
23011 * ecore.cs: Use an enumconstant here instead of wrapping with
23014 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
23015 throwing me off. By handling this we can get rid of a few hacks.
23017 * statement.cs (Switch): Removed Peel() code.
23019 2003-02-14 Miguel de Icaza <miguel@ximian.com>
23021 * class.cs: Location information for error 508
23023 * expression.cs (New.DoResolve): Add a guard against double
23024 resolution of an expression.
23026 The New DoResolve might be called twice when initializing field
23027 expressions (see EmitFieldInitializers, the call to
23028 GetInitializerExpression will perform a resolve on the expression,
23029 and later the assign will trigger another resolution
23031 This leads to bugs (#37014)
23033 * delegate.cs: The signature for EndInvoke should contain any ref
23034 or out parameters as well. We were not doing this in the past.
23036 * class.cs (Field.Define): Do not overwrite the type definition
23037 inside the `volatile' group. Turns out that volatile enumerations
23038 were changing the type here to perform a validity test, which
23041 2003-02-12 Miguel de Icaza <miguel@ximian.com>
23043 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
23044 and structs, we do not want to load the instance variable
23046 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
23047 enum_type has to be handled like an object reference (implicit
23048 conversions exists from this to object), but the regular IsClass
23049 and IsValueType tests will never return true for this one.
23051 Also we use TypeManager.IsValueType instead of type.IsValueType,
23052 just for consistency with the rest of the code (this is only
23053 needed if we ever use the construct exposed by test-180.cs inside
23054 corlib, which we dont today).
23056 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
23058 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
23061 2003-02-09 Martin Baulig <martin@ximian.com>
23063 * namespace.cs (Namespace..ctor): Added SourceFile argument.
23064 (Namespace.DefineNamespaces): New static public method; this is
23065 called when we're compiling with debugging to add all namespaces
23066 to the symbol file.
23068 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
23069 pass it to the Namespace's .ctor.
23071 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
23072 and MethodBase arguments; pass the namespace ID to the symwriter;
23073 pass the MethodBase instead of the token to the symwriter.
23074 (SymbolWriter.DefineNamespace): New method to add a namespace to
23077 2003-02-09 Martin Baulig <martin@ximian.com>
23079 * symbolwriter.cs: New file. This is a wrapper around
23080 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
23081 methods here in near future.
23083 2003-02-09 Martin Baulig <martin@ximian.com>
23085 * codegen.cs (EmitContext.Mark): Just pass the arguments to
23086 ILGenerator.MarkSequencePoint() which are actually used by the
23089 2003-02-09 Martin Baulig <martin@ximian.com>
23091 * location.cs (SourceFile): New public sealed class. This
23092 contains the name and an index which is used in the location's token.
23093 (Location): Reserve an appropriate number of bits in the token for
23094 the source file instead of walking over that list, this gives us a
23095 really huge performance improvement when compiling with debugging.
23097 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
23098 `SourceFile' argument instead of a string.
23099 (Driver.ProcessFile): Add all the files via Location.AddFile(),
23100 but don't parse/tokenize here, we need to generate the list of all
23101 source files before we do that.
23102 (Driver.ProcessFiles): New static function. Parses/tokenizes all
23105 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
23106 instead of a string.
23108 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
23111 2003-02-09 Martin Baulig <martin@ximian.com>
23113 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
23114 filename on `#line default'.
23116 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
23118 * statement.cs: don't clear the pinned var when the fixed statement
23119 returns from the method (fixes bug#37752).
23121 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
23123 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
23126 2003-02-07 Martin Baulig <martin@ximian.com>
23128 * driver.cs: Removed the `--debug-args' command line argument.
23130 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
23131 automatically by the AsssemblyBuilder.
23132 (CodeGen.InitializeSymbolWriter): We don't need to call any
23133 initialization function on the symbol writer anymore. This method
23134 doesn't take any arguments.
23136 2003-02-03 Miguel de Icaza <miguel@ximian.com>
23138 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
23139 from referenced assemblies as well.
23141 2003-02-02 Martin Baulig <martin@ximian.com>
23143 * class.cs (MethodData.Emit): Generate debugging info for external methods.
23145 2003-02-02 Martin Baulig <martin@ximian.com>
23147 * class.cs (Constructor.Emit): Open the symbol writer before
23148 emitting the constructor initializer.
23149 (ConstructorInitializer.Emit): Call ec.Mark() to allow
23150 single-stepping through constructor initializers.
23152 2003-01-30 Miguel de Icaza <miguel@ximian.com>
23154 * class.cs: Handle error 549: do not allow virtual methods in
23157 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
23159 * decl.cs: Check access levels when resolving types
23161 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
23163 * statement.cs: Add parameters and locals set in catch blocks that might
23164 return to set vector
23166 2003-01-29 Miguel de Icaza <miguel@ximian.com>
23168 * class.cs (Operator): Set the SpecialName flags for operators.
23170 * expression.cs (Invocation.DoResolve): Only block calls to
23171 accessors and operators on SpecialName methods.
23173 (Cast.TryReduce): Handle conversions from char constants.
23176 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
23178 * statement.cs: small memory and time optimization in FlowBranching.
23180 2003-01-28 Pedro Mart <yoros@wanadoo.es>
23182 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
23183 problem that the last fix but in the other sid (Set).
23185 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
23186 access when there is no indexer in the hierarchy.
23188 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
23190 * class.cs: Combine some if statements.
23192 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23194 * driver.cs: fixed bug #37187.
23196 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
23198 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
23199 any indexer, it's needed to build a list with all the indexers in the
23200 hierarchy (AllGetters), else we have problems. Fixes #35653.
23202 2003-01-23 Miguel de Icaza <miguel@ximian.com>
23204 * class.cs (MethodData.Define): It is wrong for an interface
23205 implementation to be static in both cases: explicit and implicit.
23206 We were only handling this in one case.
23208 Improve the if situation there to not have negations.
23210 * class.cs (Field.Define): Turns out that we do not need to check
23211 the unsafe bit on field definition, only on usage. Remove the test.
23213 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23215 * driver.cs: use assembly.Location instead of Codebase (the latest
23216 patch made mcs fail when using MS assemblies).
23218 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
23220 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
23221 get the path to *corlib.dll.
23223 2003-01-21 Nick Drochak <ndrochak@gol.com>
23227 * typemanager.cs: Remove compiler warnings
23229 2003-01-20 Duncan Mak <duncan@ximian.com>
23231 * AssemblyInfo.cs: Bump the version number to 0.19.
23233 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23235 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
23237 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
23239 * class.cs (Constructor::Emit): Emit debugging info for constructors.
23241 2003-01-17 Miguel de Icaza <miguel@ximian.com>
23243 * cs-parser.jay: Small fix: we were not comparing the constructor
23244 name correctly. Thanks to Zoltan for the initial pointer.
23246 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
23248 * cs-tokenizer.cs: Set file name when specified with #line
23250 2003-01-15 Miguel de Icaza <miguel@ximian.com>
23252 * cs-parser.jay: Only perform the constructor checks here if we
23253 are named like the class; This will help provider a better
23254 error. The constructor path is taken when a type definition is
23255 not found, but most likely the user forgot to add the type, so
23256 report that rather than the constructor error.
23258 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
23260 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
23263 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23265 * cs-parser.jay: Add cleanup call.
23267 2003-01-13 Duncan Mak <duncan@ximian.com>
23269 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
23270 consistent with other methods.
23272 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23274 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
23276 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
23278 * attribute.cs: only set GuidAttr to true when we have a
23281 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23285 * typemanager.cs: fixes to allow mcs compile corlib with the new
23286 Type.IsSubclassOf fix.
23288 2003-01-08 Miguel de Icaza <miguel@ximian.com>
23290 * expression.cs (LocalVariableReference.DoResolve): Classify a
23291 constant as a value, not as a variable. Also, set the type for
23294 * cs-parser.jay (fixed_statement): take a type instead of a
23295 pointer_type, so we can produce a better error message later.
23297 * statement.cs (Fixed.Resolve): Flag types that are not pointers
23300 (For.DoEmit): Make inifinite loops have a
23301 non-conditional branch back.
23303 (Fixed.DoEmit): First populate the pinned variables, then emit the
23304 statement, then clear the variables. Before I was emitting the
23305 code once for each fixed piece.
23308 2003-01-08 Martin Baulig <martin@ximian.com>
23310 * statement.cs (FlowBranching.MergeChild): A break in a
23311 SWITCH_SECTION does not leave a loop. Fixes #36155.
23313 2003-01-08 Martin Baulig <martin@ximian.com>
23315 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
23316 lives in the same number space than `param_map'. Fixes #36154.
23318 2003-01-07 Miguel de Icaza <miguel@ximian.com>
23320 * cs-parser.jay (constructor_declaration): Set the
23321 Constructor.ModFlags before probing for it. This makes the
23322 compiler report 514, 515 and 132 (the code was there, but got
23325 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
23326 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
23327 (GotoCase.Resolve): Set `Returns' to ALWAYS.
23329 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
23331 * enum.cs: create the enum static fields using the enum type.
23333 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
23335 * class.cs: don't try to create the ParamBuilder for the return
23336 type if it's not needed (and handle it breaking for the ms runtime
23339 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
23341 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
23343 2002-12-29 Miguel de Icaza <miguel@ximian.com>
23345 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
23346 the command. This showed up while compiling the JANET source
23347 code, which used \r as its only newline separator.
23349 2002-12-28 Miguel de Icaza <miguel@ximian.com>
23351 * class.cs (Method.Define): If we are an operator (because it
23352 reuses our code), then set the SpecialName and HideBySig. #36128
23354 2002-12-22 Miguel de Icaza <miguel@ximian.com>
23356 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
23357 exception, report error 120 `object reference required'.
23359 * driver.cs: Add --pause option, used during to measure the size
23360 of the process as it goes with --timestamp.
23362 * expression.cs (Invocation.DoResolve): Do not allow methods with
23363 SpecialName to be invoked.
23365 2002-12-21 Miguel de Icaza <miguel@ximian.com>
23367 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
23368 number before adding it.
23370 2002-12-21 Ravi Pratap <ravi@ximian.com>
23372 * ecore.cs (StandardImplicitConversion): When in an unsafe
23373 context, we allow conversion between void * to any other pointer
23374 type. This fixes bug #35973.
23376 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
23378 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
23379 is not thrown when extensionless outputs are used
23381 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23383 * rootcontext.cs: fixed compilation of corlib.
23385 2002-12-19 Miguel de Icaza <miguel@ximian.com>
23387 * attribute.cs (Attributes.Contains): Add new method.
23389 * class.cs (MethodCore.LabelParameters): if the parameter is an
23390 `out' parameter, check that no attribute `[In]' has been passed.
23392 * enum.cs: Handle the `value__' name in an enumeration.
23394 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
23396 * decl.cs: Added special case to allow overrides on "protected
23399 2002-12-18 Ravi Pratap <ravi@ximian.com>
23401 * attribute.cs (Attributes.AddAttributeSection): Rename to this
23402 since it makes much more sense.
23404 (Attributes.ctor): Don't require a Location parameter.
23406 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
23408 * attribute.cs (ApplyAttributes): Remove extra Location parameters
23409 since we already have that information per attribute.
23411 * everywhere : make appropriate changes.
23413 * class.cs (LabelParameters): Write the code which actually
23414 applies attributes to the return type. We can't do this on the MS
23415 .NET runtime so we flag a warning in the case an exception is
23418 2002-12-18 Miguel de Icaza <miguel@ximian.com>
23420 * const.cs: Handle implicit null conversions here too.
23422 2002-12-17 Ravi Pratap <ravi@ximian.com>
23424 * class.cs (MethodCore.LabelParameters): Remove the extra
23425 Type [] parameter since it is completely unnecessary. Instead
23426 pass in the method's attributes so that we can extract
23427 the "return" attribute.
23429 2002-12-17 Miguel de Icaza <miguel@ximian.com>
23431 * cs-parser.jay (parse): Use Report.Error to flag errors instead
23432 of ignoring it and letting the compile continue.
23434 * typemanager.cs (ChangeType): use an extra argument to return an
23435 error condition instead of throwing an exception.
23437 2002-12-15 Miguel de Icaza <miguel@ximian.com>
23439 * expression.cs (Unary.TryReduce): mimic the code for the regular
23440 code path. Perform an implicit cast in the cases where we can
23441 implicitly convert to one of the integral types, and then reduce
23442 based on that constant. This fixes bug #35483.
23444 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23446 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
23448 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23450 * namespace.cs: fixed bug #35489.
23452 2002-12-12 Miguel de Icaza <miguel@ximian.com>
23454 * class.cs: Remove some dead code.
23456 * cs-parser.jay: Estimate the number of methods needed
23457 (RootContext.MethodCount);
23459 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
23460 numbers instead of StringBuilders.
23462 * support.cs (PtrHashtable): Add constructor with initial size;
23463 We can now reduce reallocations of the method table.
23465 2002-12-10 Ravi Pratap <ravi@ximian.com>
23467 * attribute.cs (ApplyAttributes): Keep track of the emitted
23468 attributes on a per-target basis. This fixes bug #35413.
23470 2002-12-10 Miguel de Icaza <miguel@ximian.com>
23472 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
23473 default to the Windows 1252 encoding.
23475 (UnixParseOption): Support version, thanks to Alp for the missing
23478 * AssemblyInfo.cs: Add nice assembly information.
23480 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
23483 * cs-parser.jay: Allow a trailing comma before the close bracked
23484 in the attribute_section production.
23486 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
23487 address of the instance was being taken, I will take this out,
23488 because we take the address of the object immediately here.
23490 2002-12-09 Ravi Pratap <ravi@ximian.com>
23492 * typemanager.cs (AreMultipleAllowed): Take care of the most
23493 obvious case where attribute type is not in the current assembly -
23496 2002-12-08 Miguel de Icaza <miguel@ximian.com>
23498 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
23499 definitions, instead of doing that afterwards.
23501 Also we use a nice little hack, depending on the constructor, we
23502 know if we are a "composed" name or a simple name. Hence, we
23503 avoid the IndexOf test, and we avoid
23505 * codegen.cs: Add code to assist in a bug reporter to track down
23506 the source of a compiler crash.
23508 2002-12-07 Ravi Pratap <ravi@ximian.com>
23510 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
23511 types have been emitted for a given element and flag an error
23512 if something which does not have AllowMultiple set is used more
23515 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
23516 attribute types and their corresponding AllowMultiple properties
23518 (AreMultipleAllowed): Check the property for a given type.
23520 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
23521 property in the case we have a TypeContainer.
23523 (Attributes.AddAttribute): Detect duplicates and just skip on
23524 adding them. This trivial fix catches a pretty gross error in our
23525 attribute emission - global attributes were being emitted twice!
23527 Bugzilla bug #33187 is now fixed.
23529 2002-12-06 Miguel de Icaza <miguel@ximian.com>
23531 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
23532 instead of pp_and).
23534 * expression.cs (Binary.ResolveOperator): I can only use the
23535 Concat (string, string, string) and Concat (string, string,
23536 string, string) if the child is actually a concatenation of
23539 2002-12-04 Miguel de Icaza <miguel@ximian.com>
23541 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
23542 context where we need a 2-character lookahead.
23544 * pending.cs (PendingImplementation): Rework so we can keep track
23545 of interface types all the time, and flag those which were
23546 implemented by parents as optional.
23548 2002-12-03 Miguel de Icaza <miguel@ximian.com>
23550 * expression.cs (Binary.ResolveOperator): Use
23551 String.Concat(string,string,string) or
23552 String.Concat(string,string,string,string) when possible.
23554 * typemanager: More helper methods.
23557 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
23559 * pending.cs: remove the bogus return from GetMissingInterfaces()
23560 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
23562 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23564 * namespace.cs: avoid duplicated 'using xxx' being added to
23565 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
23566 when we get more than one 'using' statement for the same namespace.
23567 Report a CS0105 warning for it.
23569 2002-11-30 Miguel de Icaza <miguel@ximian.com>
23571 * cs-tokenizer.cs (consume_identifier): use read directly, instead
23572 of calling getChar/putback, uses internal knowledge of it.
23574 (xtoken): Reorder tokenizer so most common patterns are checked
23575 first. This reduces the compilation time in another 5% (from 8.11s
23576 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
23578 The parsing time is 22% of the compilation in mcs, and from that
23579 64% is spent on the tokenization process.
23581 I tried using a binary search for keywords, but this is slower
23582 than the hashtable. Another option would be to do a couple of
23585 * Not use a StringBuilder, instead use an array of chars,
23586 with a set value. Notice that this way we could catch
23587 the 645 error without having to do it *afterwards*.
23589 * We could write a hand-parser to avoid the hashtable
23590 compares altogether.
23592 The identifier consumption process takes 37% of the tokenization
23593 time. Another 15% is spent on is_number. 56% of the time spent
23594 on is_number is spent on Int64.Parse:
23596 * We could probably choose based on the string length to
23597 use Int32.Parse or Int64.Parse and avoid all the 64-bit
23600 Another 3% is spend on wrapping `xtoken' in the `token' function.
23602 Handle 0xa0 as whitespace (#34752)
23604 2002-11-26 Miguel de Icaza <miguel@ximian.com>
23606 * typemanager.cs (IsCLRType): New routine to tell whether a type
23607 is one of the builtin types.
23609 Maybe it needs to use TypeCodes to be faster. Maybe we could use
23610 typecode in more places instead of doing pointer comparissions.
23611 We could leverage some knowledge about the way the typecodes are
23614 New code to cache namespaces in assemblies, it is currently not
23615 invoked, to be used soon.
23617 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
23619 * expression.cs (Binary.ResolveOperator): specially handle
23620 strings, and do not perform user-defined operator overloading for
23623 2002-11-24 Miguel de Icaza <miguel@ximian.com>
23625 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
23626 internalcall as it is a pretty simple operation; Avoid whenever
23627 possible to call Char.IsLetter.
23629 (consume_identifier): Cut by half the number of
23630 hashtable calls by merging the is_keyword and GetKeyword behavior.
23632 Do not short-circuit, because if we do, we
23633 report errors (ie, #if false && true would produce an invalid
23637 2002-11-24 Martin Baulig <martin@ximian.com>
23639 * expression.cs (Cast.TryReduce): If we're in checked syntax,
23640 check constant ranges and report a CS0221. Fixes #33186.
23642 2002-11-24 Martin Baulig <martin@ximian.com>
23644 * cs-parser.jay: Make this work for uninitialized variable
23645 declarations in the `for' initializer. Fixes #32416.
23647 2002-11-24 Martin Baulig <martin@ximian.com>
23649 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
23650 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
23652 2002-11-24 Martin Baulig <martin@ximian.com>
23654 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
23655 argument; if true, we also check for user-defined conversions.
23656 This is only needed if both arguments are of a user-defined type.
23657 Fixes #30443, added test-175.cs.
23658 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
23660 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
23662 2002-11-24 Martin Baulig <martin@ximian.com>
23664 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
23665 function to get the store opcode.
23666 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
23667 only emit the Ldelema if the store opcode is Stobj. You must run
23668 both test-34 and test-167 to test this. Fixes #34529.
23670 2002-11-23 Martin Baulig <martin@ximian.com>
23672 * ecore.cs (Expression.MemberLookup): Added additional
23673 `qualifier_type' argument which is used when we're being called
23674 from MemberAccess.DoResolve() and null if we're called from a
23676 (Expression.MemberLookupFailed): New method to report errors; this
23677 does the CS1540 check and reports the correct error message.
23679 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
23680 argument for the CS1540 check and redone the way how we're dealing
23681 with private members. See the comment in the source code for details.
23682 (FilterWithClosure): Reverted this back to revision 1.197; renamed
23683 `closure_start_type' to `closure_qualifier_type' and check whether
23684 it's not null. It was not this filter being broken, it was just
23685 being called with the wrong arguments.
23687 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
23688 and pass it the correct `qualifier_type'; this also does the error
23691 2002-11-22 Miguel de Icaza <miguel@ximian.com>
23693 * expression.cs (Invocation.EmitParams): If the we are dealing
23694 with a non-built-in value type, load its address as well.
23696 (ArrayCreation): Use a a pretty constant instead
23697 of the hardcoded value 2. Use 6 instead of 2 for the number of
23698 static initializers.
23700 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
23701 because they are not really value types, just glorified integers.
23703 * driver.cs: Do not append .exe, the CSC compiler does not do it.
23705 * ecore.cs: Remove redundant code for enumerations, make them use
23706 the same code path as everything else, fixes the casting issue
23707 with enumerations in Windows.Forms.
23709 * attribute.cs: Do only cast to string if it is a string, the
23710 validation happens later.
23712 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
23713 people upgrade their corlibs.
23715 * ecore.cs: Oops, enumerations were not following the entire code path
23717 2002-11-21 Miguel de Icaza <miguel@ximian.com>
23719 * typemanager.cs (FilterWithClosure): Commented out the test for
23720 1540 in typemanager.cs, as it has problems when accessing
23721 protected methods from a parent class (see test-174.cs).
23723 * attribute.cs (Attribute.ValidateGuid): new method.
23724 (Attribute.Resolve): Use above.
23726 2002-11-19 Miguel de Icaza <miguel@ximian.com>
23728 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
23730 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
23731 handling for enumerations, as we only needed the TypeContainer
23732 functionality to begin with (this is required for the fix below to
23733 work for enums that reference constants in a container class for
23736 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
23738 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
23739 a valid TypeBuilder to perform lookups on.o
23741 * class.cs (InheritableMemberSignatureCompare): Use true in the
23742 call to GetGetMethod and GetSetMethod, because we are comparing
23743 the signature, and we need to get the methods *even* if they are
23746 (PropertyBase.CheckBase): ditto.
23748 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
23749 GotoCase.Resolve): Use Peel on EmpytCasts.
23751 * ecore.cs (EmptyCast): drop child, add Peel method.
23753 2002-11-17 Martin Baulig <martin@ximian.com>
23755 * ecore.cs (EmptyCast.Child): New public property.
23757 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
23758 label resolved to an EmptyCast. Fixes #34162.
23759 (GotoCase.Resolve): Likewise.
23760 (Block.EmitMeta): Likewise.
23762 2002-11-17 Martin Baulig <martin@ximian.com>
23764 * expression.cs (Invocation.BetterConversion): Prefer int over
23765 uint; short over ushort; long over ulong for integer literals.
23766 Use ImplicitConversionExists instead of StandardConversionExists
23767 since we also need to check for user-defined implicit conversions.
23768 Fixes #34165. Added test-173.cs.
23770 2002-11-16 Martin Baulig <martin@ximian.com>
23772 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
23773 with the `true' and `false' literals. Fixes #33151.
23775 2002-11-16 Martin Baulig <martin@ximian.com>
23777 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
23778 October 22nd; don't do the cs1540 check for static members.
23780 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
23781 now using our own filter here and doing the cs1540 check again.
23783 2002-11-16 Martin Baulig <martin@ximian.com>
23785 * support.cs (InternalParameters): Don't crash if we don't have
23786 any fixed parameters. Fixes #33532.
23788 2002-11-16 Martin Baulig <martin@ximian.com>
23790 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
23791 when looking up static methods to make this work on Windows.
23794 2002-11-16 Martin Baulig <martin@ximian.com>
23796 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
23797 a setter rather than using PropertyInfo.CanWrite.
23799 2002-11-15 Nick Drochak <ndrochak@gol.com>
23801 * class.cs: Allow acces to block member by subclasses. Fixes build
23804 2002-11-14 Martin Baulig <martin@ximian.com>
23806 * class.cs (Constructor.Emit): Added the extern/block check.
23809 2002-11-14 Martin Baulig <martin@ximian.com>
23811 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
23812 iteration while looking for indexers, this is needed because the
23813 indexer may have a different name in our base classes. Fixed the
23814 error reporting (no indexers at all, not get accessor, no
23815 overloaded match). Fixes bug #33089.
23816 (IndexerAccess.DoResolveLValue): Likewise.
23818 2002-11-14 Martin Baulig <martin@ximian.com>
23820 * class.cs (PropertyBase.CheckBase): Make this work for multiple
23821 indexers. Fixes the first part of bug #33089.
23822 (MethodSignature.InheritableMemberSignatureCompare): Added support
23825 2002-11-13 Ravi Pratap <ravi@ximian.com>
23827 * attribute.cs (Attribute.Resolve): Catch the
23828 NullReferenceException and report it since it isn't supposed to
23831 2002-11-12 Miguel de Icaza <miguel@ximian.com>
23833 * expression.cs (Binary.EmitBranchable): Also handle the cases for
23834 LogicalOr and LogicalAnd that can benefit from recursively
23835 handling EmitBranchable. The code now should be nice for Paolo.
23837 2002-11-08 Miguel de Icaza <miguel@ximian.com>
23839 * typemanager.cs (LookupType): Added a negative-hit hashtable for
23840 the Type lookups, as we perform quite a number of lookups on
23841 non-Types. This can be removed once we can deterministically tell
23842 whether we have a type or a namespace in advance.
23844 But this might require special hacks from our corlib.
23848 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
23849 and double which avoids a conversion from an integer to a double.
23851 * expression.cs: tiny optimization, avoid calling IsConstant,
23852 because it effectively performs the lookup twice.
23854 2002-11-06 Miguel de Icaza <miguel@ximian.com>
23856 But a bogus return here to keep the semantics of the old code
23857 until the Mono runtime is fixed.
23859 * pending.cs (GetMissingInterfaces): New method used to remove all
23860 the interfaces that are already implemented by our parent
23861 classes from the list of pending methods.
23863 * interface.cs: Add checks for calls after ResolveTypeExpr.
23865 2002-11-05 Miguel de Icaza <miguel@ximian.com>
23867 * class.cs (Class.Emit): Report warning 67: event not used if the
23868 warning level is beyond 3.
23870 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
23871 being a NullLiteral.
23873 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
23876 * class.cs (TypeContainer.GetClassBases): Cover a missing code
23877 path that might fail if a type can not be resolved.
23879 * expression.cs (Binary.Emit): Emit unsigned versions of the
23882 * driver.cs: use error 5.
23884 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
23886 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
23888 2002-11-01 Miguel de Icaza <miguel@ximian.com>
23890 * cs-parser.jay (switch_section): A beautiful patch from Martin
23891 Baulig that fixed 33094.
23893 2002-10-31 Miguel de Icaza <miguel@ximian.com>
23895 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
23896 Check whether the base is abstract and report an error if so.
23898 * expression.cs (IndexerAccess.DoResolveLValue,
23899 IndexerAccess.DoResolve): ditto.
23901 (Invocation.DoResolve): ditto.
23903 (Invocation.FullMethodDesc): Improve the report string.
23905 * statement.cs (Block): Eliminate IsVariableDefined as it is
23906 basically just a wrapper for GetVariableInfo.
23908 * ecore.cs (SimpleName): Use new
23910 * support.cs (ReflectionParamter.ParameterType): We unwrap the
23911 type, as we return the actual parameter ref/unref state on a
23914 2002-10-30 Miguel de Icaza <miguel@ximian.com>
23916 * support.cs: Return proper flags REF/OUT fixing the previous
23919 * expression.cs: Reverted last patch, that was wrong. Is_ref is
23920 not used to mean `ref' but `ref or out' in ParameterReference
23922 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
23923 full type signature instead of calling TypeManger.CSharpName
23926 * support.cs (InternalParameters.ParameterDesc): Do not compare
23927 directly to the modflags, because REF/OUT will actually be bitsets
23930 * delegate.cs (VerifyMethod): Check also the modifiers.
23932 * cs-tokenizer.cs: Fix bug where floating point values with an
23933 exponent where a sign was missing was ignored.
23935 * driver.cs: Allow multiple assemblies to be specified in a single
23938 2002-10-28 Miguel de Icaza <miguel@ximian.com>
23940 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
23941 because identifiers after a parenthesis would end up in this kind
23942 of production, and we needed to desamiguate it for having casts
23945 (UserDefinedType *) xxx
23947 2002-10-24 Miguel de Icaza <miguel@ximian.com>
23949 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
23950 we should set on the Bindingflags.NonPublic, but not turn on
23951 private_ok. private_ok controls whether a Private member is
23952 returned (this is chekced on the filter routine), while the
23953 BindingFlags.NonPublic just controls whether private/protected
23954 will be allowed. This fixes the problem part of the problem of
23955 private properties being allowed to be used in derived classes.
23957 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
23958 so we can call the children DoResolveLValue method (this will
23959 properly signal errors on lvalue assignments to base properties)
23961 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
23962 getter are null, and we have a property info, we know that this
23963 happened because the lookup failed, so we report an error 122 for
23964 protection level violation.
23966 We also silently return if setter and getter are null in the
23967 resolve functions, this condition only happens if we have flagged
23968 the error before. This is the other half of the problem.
23970 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
23971 not have accessibility information, that is why we were returning
23972 true in the filter function in typemanager.cs.
23974 To properly report 122 (property is inaccessible because of its
23975 protection level) correctly, we report this error in ResolveAccess
23976 by failing if both the setter and the getter are lacking (ie, the
23979 DoResolve and DoLResolve have been modified to check for both
23980 setter/getter being null and returning silently, the reason being
23981 that I did not want to put the knowledge about this error in upper
23984 int old = Report.Errors;
23985 x = new PropertyExpr (...);
23986 if (old != Report.Errors)
23991 So the property expr is returned, but it is invalid, so the error
23992 will be flagged during the resolve process.
23994 * class.cs: Remove InheritablePropertySignatureCompare from the
23995 class, as we no longer depend on the property signature to compute
23996 whether it is possible to implement a method or not.
23998 The reason is that calling PropertyInfo.GetGetMethod will return
23999 null (in .NET, in Mono it works, and we should change this), in
24000 cases where the Get Method does not exist in that particular
24005 class X { public virtual int A { get { return 1; } } }
24007 class Z : Y { public override int A { get { return 2; } } }
24009 Would fail in Z because the parent (Y) would not have the property
24010 defined. So we avoid this completely now (because the alternative
24011 fix was ugly and slow), and we now depend exclusively on the
24014 (PropertyBase.CheckBase): Use a method-base mechanism to find our
24015 reference method, instead of using the property.
24017 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
24018 routines are gone now.
24020 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
24021 names, they were incorrectly named.
24023 * cs-tokenizer.cs: Return are more gentle token on failure.
24025 * pending.cs (PendingImplementation.InterfaceMethod): This routine
24026 had an out-of-sync index variable, which caused it to remove from
24027 the list of pending methods the wrong method sometimes.
24029 2002-10-22 Miguel de Icaza <miguel@ximian.com>
24031 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
24032 CanWrite, because those refer to this particular instance of the
24033 property, and do not take into account the fact that we can
24034 override single members of a property.
24036 Constructor requires an EmitContext. The resolution process does
24037 not happen here, but we need to compute the accessors before,
24038 because the resolution does not always happen for properties.
24040 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
24041 subclass, before we did not update this flag, but we did update
24044 (GetAccessors): Drop this routine, as it did not work in the
24045 presence of partially overwritten set/get methods.
24047 Notice that this broke the cs1540 detection, but that will require
24050 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24054 * driver.cs: issue a warning instead of an error if we don't support
24055 debugging for the platform. Also ignore a couple of errors that may
24056 arise when trying to write the symbols. Undo my previous patch.
24058 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24060 * driver.cs: ignore /debug switch except for Unix platforms.
24062 2002-10-23 Nick Drochak <ndrochak@gol.com>
24064 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
24066 2002-10-21 Miguel de Icaza <miguel@ximian.com>
24068 * driver.cs: Do not make mcs-debug conditional, so we do not break
24069 builds that use it.
24071 * statement.cs (UsageVector.MergeChildren): I would like Martin to
24072 review this patch. But basically after all the children variables
24073 have been merged, the value of "Breaks" was not being set to
24074 new_breaks for Switch blocks. I think that it should be set after
24075 it has executed. Currently I set this to the value of new_breaks,
24076 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
24077 conservative, but I do not understand this code very well.
24079 I did not break anything in the build, so that is good ;-)
24081 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
24083 2002-10-20 Mark Crichton <crichton@gimp.org>
24085 * cfold.cs: Fixed compile blocker. Really fixed it this time.
24087 2002-10-20 Nick Drochak <ndrochak@gol.com>
24089 * cfold.cs: Fixed compile blocker.
24091 2002-10-20 Miguel de Icaza <miguel@ximian.com>
24093 * driver.cs: I was chekcing the key, not the file.
24095 2002-10-19 Ravi Pratap <ravi@ximian.com>
24097 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
24098 message that we were generating - we just need to silently return
24101 2002-10-19 Miguel de Icaza <miguel@ximian.com>
24103 * class.cs (Event.Define): Change my previous commit, as this
24104 breaks the debugger. This is a temporary hack, as it seems like
24105 the compiler is generating events incorrectly to begin with.
24107 * expression.cs (Binary.ResolveOperator): Added support for
24108 "U operator - (E x, E y)"
24110 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
24113 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
24114 init-only variables, but this path did not take into account that
24115 there might be also instance readonly variables. Correct this
24118 This fixes bug 32253
24120 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
24123 * driver.cs: Change the extension for modules to `netmodule'
24125 * cs-parser.jay: Improved slightly the location tracking for
24126 the debugger symbols.
24128 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
24129 modifiers that were specified instead of the hardcoded value
24130 (FamAndAssem). This was basically ignoring the static modifier,
24131 and others. Fixes 32429.
24133 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
24134 fixed a bug in the process (32476)
24136 * expression.cs (ArrayAccess.EmitAssign): Patch from
24137 hwang_rob@yahoo.ca that fixes bug 31834.3
24139 2002-10-18 Miguel de Icaza <miguel@ximian.com>
24141 * driver.cs: Make the module extension .netmodule.
24143 2002-10-16 Miguel de Icaza <miguel@ximian.com>
24145 * driver.cs: Report an error if the resource file is not found
24146 instead of crashing.
24148 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
24149 false, like Emit does.
24151 2002-10-16 Nick Drochak <ndrochak@gol.com>
24153 * typemanager.cs: Remove unused private member. Also reported mcs
24154 bug to report this as a warning like csc.
24156 2002-10-15 Martin Baulig <martin@gnome.org>
24158 * statement.cs (Statement.Emit): Made this a virtual method; emits
24159 the line number info and calls DoEmit().
24160 (Statement.DoEmit): New protected abstract method, formerly knows
24161 as Statement.Emit().
24163 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
24165 2002-10-11 Miguel de Icaza <miguel@ximian.com>
24167 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
24168 have fixed a remaining problem: not every AddXXXX was adding a
24169 fully qualified name.
24171 Now everyone registers a fully qualified name in the DeclSpace as
24172 being defined instead of the partial name.
24174 Downsides: we are slower than we need to be due to the excess
24175 copies and the names being registered this way.
24177 The reason for this is that we currently depend (on the corlib
24178 bootstrap for instance) that types are fully qualified, because
24179 we dump all the types in the namespace, and we should really have
24180 types inserted into the proper namespace, so we can only store the
24181 basenames in the defined_names array.
24183 2002-10-10 Martin Baulig <martin@gnome.org>
24185 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
24186 from bug #31834, see the bug report for a testcase which is
24189 2002-10-10 Martin Baulig <martin@gnome.org>
24191 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
24192 flow analysis code for this.
24194 * statement.cs (Do, While, For): Tell the flow analysis code about
24196 (FlowBranching.UsageVector): Added support for infinite loops.
24197 (Block.Resolve): Moved the dead code elimination here and use flow
24200 2002-10-09 Miguel de Icaza <miguel@ximian.com>
24202 * class.cs (Field.Define): Catch cycles on struct type
24205 * typemanager.cs (IsUnmanagedtype): Do not recursively check
24206 fields if the fields are static. We only need to check instance
24209 * expression.cs (As.DoResolve): Test for reference type.
24211 * statement.cs (Using.ResolveExpression): Use
24212 ConvertImplicitRequired, not ConvertImplicit which reports an
24214 (Using.ResolveLocalVariableDecls): ditto.
24216 * expression.cs (Binary.ResolveOperator): Report errors in a few
24217 places where we had to.
24219 * typemanager.cs (IsUnmanagedtype): Finish implementation.
24221 2002-10-08 Miguel de Icaza <miguel@ximian.com>
24223 * expression.cs: Use StoreFromPtr instead of extracting the type
24224 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
24226 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
24227 an enumeration value to a System.Enum, but System.Enum is not a
24228 value type, but an class type, so we need to box.
24230 (Expression.ConvertExplicit): One codepath could return
24231 errors but not flag them. Fix this. Fixes #31853
24233 * parameter.cs (Resolve): Do not allow void as a parameter type.
24235 2002-10-06 Martin Baulig <martin@gnome.org>
24237 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
24238 if it's a class type and not a struct. Fixes #31815.
24240 2002-10-06 Martin Baulig <martin@gnome.org>
24242 * statement.cs: Reworked the flow analysis code a bit to make it
24243 usable for dead code elimination.
24245 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24247 * cs-parser.jay: allow empty source files. Fixes bug #31781.
24249 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24251 * expression.cs (ComposedCast.DoResolveType): A quick workaround
24252 to fix the test 165, will investigate deeper.
24254 2002-10-04 Martin Baulig <martin@gnome.org>
24256 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
24257 finally blocks actually work.
24258 (Try.Resolve): We don't need to create a sibling for `finally' if
24259 there is no finally block.
24261 2002-10-04 Martin Baulig <martin@gnome.org>
24263 * class.cs (Constructor.Define): The default accessibility for a
24264 non-default constructor is private, not public.
24266 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24268 * class.cs (Constructor): Make AllowedModifiers public, add
24271 * cs-parser.jay: Perform the modifiers test here, as the
24272 constructor for the Constructor class usually receives a zero
24273 because of the way we create it (first we create, later we
24274 customize, and we were never checking the modifiers).
24276 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
24277 is a version of LookupTypeReflection that includes the type-name
24278 cache. This can be used as a fast path for functions that know
24279 the fully qualified name and are only calling into *.GetType() to
24280 obtain a composed type.
24282 This is also used by TypeManager.LookupType during its type
24285 (LookupType): We now also track the real type name, as sometimes
24286 we can get a quey for the real type name from things like
24287 ComposedCast. This fixes bug 31422.
24289 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
24290 complete type fullname, it does not have to go through the type
24291 resolution system to obtain the composed version of the type (for
24292 obtaining arrays or pointers).
24294 (Conditional.Emit): Use the EmitBoolExpression to
24295 generate nicer code, as requested by Paolo.
24297 (ArrayCreation.CheckIndices): Use the patch from
24298 hwang_rob@yahoo.ca to validate the array initializers.
24300 2002-10-03 Miguel de Icaza <miguel@ximian.com>
24302 * class.cs (ConstructorInitializer.Emit): simplify code by using
24303 Invocation.EmitCall, and at the same time, fix the bugs in calling
24304 parent constructors that took variable arguments.
24306 * ecore.cs (Expression.ConvertNumericExplicit,
24307 Expression.ImplicitNumericConversion): Remove the code that
24308 manually wrapped decimal (InternalTypeConstructor call is now gone
24311 * expression.cs (Cast.TryReduce): Also handle decimal types when
24312 trying to perform a constant fold on the type.
24314 * typemanager.cs (IsUnmanagedtype): Partially implemented.
24316 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
24317 that only turned off an error report, and did nothing else.
24319 2002-10-02 Miguel de Icaza <miguel@ximian.com>
24321 * driver.cs: Handle and ignore /fullpaths
24323 2002-10-01 Miguel de Icaza <miguel@ximian.com>
24325 * expression.cs (Binary.ResolveOperator): Catch the case where
24326 DoNumericPromotions returns true,
24328 (Binary.DoNumericPromotions): Simplify the code, and the tests.
24330 2002-09-27 Miguel de Icaza <miguel@ximian.com>
24332 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
24335 2002-09-26 Miguel de Icaza <miguel@ximian.com>
24337 * ecore.cs (ConvertNumericExplicit): It is not enough that the
24338 conversion exists, but it is also required that the conversion be
24339 performed. This manifested in "(Type64Enum) 2".
24341 * class.cs (TypeManager.AddMethod): The fix is not to change
24342 AddEnum, because that one was using a fully qualified name (every
24343 DeclSpace derivative does), but to change the AddMethod routine
24344 that was using an un-namespaced name. This now correctly reports
24345 the duplicated name.
24347 Revert patch until I can properly fix it. The issue
24348 is that we have a shared Type space across all namespaces
24349 currently, which is wrong.
24351 Options include making the Namespace a DeclSpace, and merge
24352 current_namespace/current_container in the parser.
24354 2002-09-25 Miguel de Icaza <miguel@ximian.com>
24356 * cs-parser.jay: Improve error reporting when we get a different
24357 kind of expression in local_variable_type and
24358 local_variable_pointer_type.
24360 Propagate this to avoid missleading errors being reported.
24362 * ecore.cs (ImplicitReferenceConversion): treat
24363 TypeManager.value_type as a target just like object_type. As
24368 Is valid, and needs to result in the int 1 being boxed before it
24369 is assigned to the value type v.
24371 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
24372 to validate the enumeration name.
24374 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
24375 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
24376 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
24378 * ecore.cs (TryImplicitIntConversion): When doing an
24379 implicit-enumeration-conversion, check if the type is 64-bits and
24380 perform a conversion before passing to EnumConstant.
24382 2002-09-23 Miguel de Icaza <miguel@ximian.com>
24384 * decl.cs (Error_AmbiguousTypeReference); New routine used to
24385 report ambiguous type references. Unlike the MS version, we
24386 report what the ambiguity is. Innovation at work ;-)
24388 (DeclSpace.FindType): Require a location argument to
24389 display when we display an ambiguous error.
24391 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
24393 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
24395 * expression.cs (EmitDynamicInitializers): Apply patch from
24396 hwang_rob@yahoo.ca that fixes the order in which we emit our
24399 2002-09-21 Martin Baulig <martin@gnome.org>
24401 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
24402 delegate takes no arguments.
24404 2002-09-20 Miguel de Icaza <miguel@ximian.com>
24406 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
24409 * expression.cs: Extract the underlying type.
24411 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
24413 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
24415 2002-09-19 Miguel de Icaza <miguel@ximian.com>
24417 * class.cs (TypeContainer.DefineType): We can not use the nice
24418 PackingSize with the size set to 1 DefineType method, because it
24419 will not allow us to define the interfaces that the struct
24422 This completes the fixing of bug 27287
24424 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
24425 means also structs. This fixes part of the problem.
24426 (Expresion.ImplicitReferenceConversionExists): ditto.
24428 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
24429 error if there were no errors reported during the type lookup
24430 process, to avoid duplicates or redundant errors. Without this
24431 you would get an ambiguous errors plus a type not found. We have
24432 beaten the user enough with the first error.
24434 (DeclSparce.FindType): Emit a warning if we have an ambiguous
24437 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
24438 during the resolution process, stop the lookup, this avoids
24439 repeated error reports (same error twice).
24441 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
24443 * typemanager.cs (LookupType): Redo the type lookup code to match
24444 the needs of System.Reflection.
24446 The issue is that System.Reflection requires references to nested
24447 types to begin with a "+" sign instead of a dot. So toplevel
24448 types look like: "NameSpace.TopLevelClass", and nested ones look
24449 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
24452 2002-09-19 Martin Baulig <martin@gnome.org>
24454 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
24455 says that a method always returns or always throws an exception,
24456 don't report the CS0161.
24458 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
24459 set `Returns = new_returns'.
24461 2002-09-19 Martin Baulig <martin@gnome.org>
24463 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
24464 to an enum constant, check for a CS0176.
24466 2002-09-18 Miguel de Icaza <miguel@ximian.com>
24468 * class.cs (TypeContainer.CheckPairedOperators): Now we check
24469 for operators that must be in pairs and report errors.
24471 * ecore.cs (SimpleName.DoResolveType): During the initial type
24472 resolution process, when we define types recursively, we must
24473 check first for types in our current scope before we perform
24474 lookups in the enclosing scopes.
24476 * expression.cs (MakeByteBlob): Handle Decimal blobs.
24478 (Invocation.VerifyArgumentsCompat): Call
24479 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
24480 I thought we were supposed to always call this, but there are a
24481 few places in the code where we dont do it.
24483 2002-09-17 Miguel de Icaza <miguel@ximian.com>
24485 * driver.cs: Add support in -linkres and -resource to specify the
24486 name of the identifier.
24488 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24490 * ecore.cs (StandardConversionExists): Sync with the conversion
24491 code: allow anything-* to void* conversions.
24493 (FindMostSpecificSource): Use an Expression argument
24494 instead of a Type, because we might be handed over a Literal which
24495 gets a few more implicit conversions that plain types do not. So
24496 this information was being lost.
24498 Also, we drop the temporary type-holder expression when not
24501 2002-09-17 Martin Baulig <martin@gnome.org>
24503 * class.cs (PropertyBase.CheckBase): Don't check the base class if
24504 this is an explicit interface implementation.
24506 2002-09-17 Martin Baulig <martin@gnome.org>
24508 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
24509 different `IndexerName' attributes.
24511 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
24512 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
24513 virtual CommonResolve().
24515 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24517 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
24518 and convert that to the UnderlyingType.
24520 * statement.cs (Foreach.Resolve): Indexers are just like variables
24521 or PropertyAccesses.
24523 * cs-tokenizer.cs (consume_string): Track line numbers and columns
24524 inside quoted strings, we were not doing this before.
24526 2002-09-16 Martin Baulig <martin@gnome.org>
24528 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
24529 resolve it. This is needed for the definite assignment check of the
24530 instance expression, fixes bug #29846.
24531 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
24533 2002-09-16 Nick Drochak <ndrochak@gol.com>
24535 * parameter.cs: Fix compile error. Cannot reference static member
24536 from an instance object. Is this an mcs bug?
24538 2002-09-14 Martin Baulig <martin@gnome.org>
24540 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
24541 multiple times. Fixes bug #30295, added test-166.cs.
24543 2002-09-14 Martin Baulig <martin@gnome.org>
24545 * statement.cs (Block.Emit): Don't emit unreachable code.
24546 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
24547 `break' statements.
24548 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
24550 2002-09-14 Martin Baulig <martin@gnome.org>
24552 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
24555 2002-09-14 Martin Baulig <martin@gnome.org>
24557 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
24558 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
24559 be false on the ms runtime.
24561 2002-09-13 Martin Baulig <martin@gnome.org>
24563 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
24564 the CS0038 error message.
24566 2002-09-12 Miguel de Icaza <miguel@ximian.com>
24568 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
24569 constant inside, return it.
24571 2002-09-12 Martin Baulig <martin@gnome.org>
24573 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
24574 implicit conversion can be done between enum types.
24576 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
24577 check whether an implicit conversion to the current enum's UnderlyingType
24578 exists and report an error if not.
24580 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
24581 without debugging support.
24583 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
24584 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
24586 2002-09-12 Martin Baulig <martin@gnome.org>
24588 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
24590 * ecore.cs (IMemberExpr.DeclaringType): New property.
24591 (SimpleName.SimpleNameResolve): Check whether we're accessing a
24592 nonstatic member of an outer type (CS0038).
24594 2002-09-11 Miguel de Icaza <miguel@ximian.com>
24596 * driver.cs: Activate the using-error detector at warning level
24597 4 (at least for MS-compatible APIs).
24599 * namespace.cs (VerifyUsing): Small buglett fix.
24601 * pending.cs (PendingImplementation): pass the container pointer.
24603 * interface.cs (GetMethods): Allow for recursive definition. Long
24604 term, I would like to move every type to support recursive
24605 definitions, not the current ordering mechanism that we have right
24608 The situation is this: Attributes are handled before interfaces,
24609 so we can apply attributes to interfaces. But some attributes
24610 implement interfaces, we will now handle the simple cases
24611 (recursive definitions will just get an error).
24613 * parameter.cs: Only invalidate types at the end if we fail to
24616 2002-09-09 Martin Baulig <martin@gnome.org>
24618 * ecore.cs (PropertyExpr.Emit): Also check for
24619 TypeManager.system_int_array_get_length so this'll also work when
24620 compiling corlib. Fixes #30003.
24622 2002-09-09 Martin Baulig <martin@gnome.org>
24624 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
24625 and throw an exception if we can't get the type's size. Fixed #30040,
24628 2002-09-09 Martin Baulig <martin@gnome.org>
24630 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
24632 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
24633 context. Fixes bug #30027.
24635 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
24636 virtual functions. Fixes bug #30043, added test-164.cs.
24638 2002-09-08 Ravi Pratap <ravi@ximian.com>
24640 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
24642 2002-09-08 Nick Drochak <ndrochak@gol.com>
24644 * driver.cs: Use an object to get the windows codepage since it's not a
24647 2002-09-08 Miguel de Icaza <miguel@ximian.com>
24649 * statement.cs (For.Emit): for infinite loops (test == null)
24650 return whether there is a break inside, not always "true".
24652 * namespace.cs (UsingEntry): New struct to hold the name of the
24653 using definition, the location where it is defined, and whether it
24654 has been used in a successful type lookup.
24656 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
24661 2002-09-06 Ravi Pratap <ravi@ximian.com>
24663 * attribute.cs : Fix incorrect code which relied on catching
24664 a NullReferenceException to detect a null being passed in
24665 where an object was expected.
24667 2002-09-06 Miguel de Icaza <miguel@ximian.com>
24669 * statement.cs (Try): flag the catch variable as assigned
24671 * expression.cs (Cast): Simplified by using ResolveType instead of
24672 manually resolving.
24674 * statement.cs (Catch): Fix bug by using ResolveType.
24676 2002-09-06 Ravi Pratap <ravi@ximian.com>
24678 * expression.cs (BetterConversion): Special case for when we have
24679 a NullLiteral as the argument and we have to choose between string
24680 and object types - we choose string the way csc does.
24682 * attribute.cs (Attribute.Resolve): Catch the
24683 NullReferenceException and report error #182 since the Mono
24684 runtime no more has the bug and having this exception raised means
24685 we tried to select a constructor which takes an object and is
24688 2002-09-05 Ravi Pratap <ravi@ximian.com>
24690 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
24691 message (1502, 1503) when we can't locate a method after overload
24692 resolution. This is much more informative and closes the bug
24695 * interface.cs (PopulateMethod): Return if there are no argument
24696 types. Fixes a NullReferenceException bug.
24698 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
24699 expressions too. Previously we were checking only in one place for
24700 positional arguments leaving out named arguments.
24702 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
24703 type to the enum type is not allowed. Remove code corresponding to
24706 (ConvertNumericExplicit): Allow explicit conversions from
24707 the underlying type to enum type. This precisely follows the spec
24708 and closes a bug filed by Gonzalo.
24710 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24713 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
24715 2002-09-03 Miguel de Icaza <miguel@ximian.com>
24717 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
24718 it was important that we stored the right value after the
24719 reduction in `converted'.
24721 2002-09-04 Martin Baulig <martin@gnome.org>
24723 * location.cs (Location.SymbolDocument): Use full pathnames for the
24726 2002-08-30 Miguel de Icaza <miguel@ximian.com>
24728 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
24729 of the expression resolve mechanism, because that will catch the
24730 SimpleName error failures.
24732 (Conditional): If we can not resolve the
24733 expression, return, do not crash.
24735 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24738 (location): display token name instead of its number.
24740 2002-08-28 Martin Baulig <martin@gnome.org>
24742 * expression.cs (Binary.ResolveOperator): Don't silently return
24743 but return an error if an operator cannot be applied between two
24746 2002-08-28 Martin Baulig <martin@gnome.org>
24748 * class.cs (Constructor.Define): Set the permission attributes
24749 correctly instead of making all constructors public.
24751 2002-08-28 Martin Baulig <martin@gnome.org>
24753 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
24754 for private members before reporting a CS0103; if we find anything,
24757 2002-08-28 Martin Baulig <martin@gnome.org>
24759 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
24760 to check whether `closure_start_type == closure_invocation_type',
24761 we also need to check whether `m.DeclaringType == closure_invocation_type'
24762 before bypassing the permission checks. We might be accessing
24763 protected/private members from the base class.
24764 (TypeManager.RealMemberLookup): Only set private_ok if private
24765 members were requested via BindingFlags.NonPublic.
24767 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
24769 * expression.cs (MemberAccess.ResolveMemberAccess): Set
24770 MethodGroupExpr.IsExplicitImpl if appropriate.
24771 (Invocation.DoResolve): Don't report the CS0120 for explicit
24772 interface implementations.
24774 2002-08-27 Martin Baulig <martin@gnome.org>
24776 * expression.cs (Invocation.DoResolve): If this is a static
24777 method and we don't have an InstanceExpression, we must report
24780 2002-08-25 Martin Baulig <martin@gnome.org>
24782 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
24783 `==' between a valuetype and an object.
24785 2002-08-25 Miguel de Icaza <miguel@ximian.com>
24787 * ecore.cs (TypeExpr): Provide a ToString method.
24789 2002-08-24 Martin Baulig <martin@gnome.org>
24791 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
24792 now called proggie.dbg and it's a binary file.
24794 2002-08-23 Martin Baulig <martin@gnome.org>
24796 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
24798 2002-08-23 Martin Baulig <martin@gnome.org>
24800 * struct.cs (MyStructInfo.ctor): Make this work with empty
24801 structs; it's not allowed to use foreach() on null.
24803 2002-08-23 Martin Baulig <martin@gnome.org>
24805 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
24806 writer the full pathname of the generated assembly.
24808 2002-08-23 Martin Baulig <martin@gnome.org>
24810 * statements.cs (FlowBranching.UsageVector.MergeChildren):
24811 A `finally' block never returns or breaks; improved handling of
24814 2002-08-23 Martin Baulig <martin@gnome.org>
24816 * statement.cs (Throw.Resolve): Allow `throw null'.
24818 2002-08-23 Martin Baulig <martin@gnome.org>
24820 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
24821 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
24822 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
24823 MemberLookup would return a wrong event if this is an explicit
24824 interface implementation and the class has an event with the same
24827 2002-08-23 Martin Baulig <martin@gnome.org>
24829 * statement.cs (Block.AddChildVariableNames): New public method.
24830 (Block.AddChildVariableName): Likewise.
24831 (Block.IsVariableNameUsedInChildBlock): Likewise.
24832 (Block.AddVariable): Check whether a variable name has already
24833 been used in a child block.
24835 * cs-parser.jay (declare_local_variables): Mark all variable names
24836 from the current block as being used in a child block in the
24839 2002-08-23 Martin Baulig <martin@gnome.org>
24841 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
24842 find the symbol writer.
24844 * driver.cs: csc also allows the arguments to /define being
24845 separated by commas, not only by semicolons.
24847 2002-08-23 Martin Baulig <martin@gnome.org>
24849 * interface.cs (Interface.GetMembers): Added static check for events.
24851 2002-08-15 Martin Baulig <martin@gnome.org>
24853 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
24854 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
24856 * ecore.cs (Expression.MemberLookup): Added documentation and explained
24857 why the MethodData.EmitDestructor() change was necessary.
24859 2002-08-20 Martin Baulig <martin@gnome.org>
24861 * class.cs (TypeContainer.FindMembers): Added static check for events.
24863 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
24865 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
24866 use Type.GetEvents(), not Type.FindMembers().
24868 2002-08-20 Martin Baulig <martin@gnome.org>
24870 * decl.cs (MemberCache): Added a special method cache which will
24871 be used for method-only searched. This ensures that a method
24872 search will return a MethodInfo with the correct ReflectedType for
24875 2002-08-20 Martin Baulig <martin@gnome.org>
24877 * decl.cs (DeclSpace.FindMembers): Made this public.
24879 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24881 * delegate.cs: fixed build on windows.
24882 [FIXME: Filed as bug #29150: MCS must report these errors.]
24884 2002-08-19 Ravi Pratap <ravi@ximian.com>
24886 * ecore.cs (StandardConversionExists): Return a false
24887 if we are trying to convert the void type to anything else
24888 since that is not allowed.
24890 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
24891 we flag error 70 in the event an event is trying to be accessed
24892 directly from outside the declaring type.
24894 2002-08-20 Martin Baulig <martin@gnome.org>
24896 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
24897 MemberCache from typemanager.cs to decl.cs.
24899 2002-08-19 Martin Baulig <martin@gnome.org>
24901 * class.cs (TypeContainer): Implement IMemberContainer.
24902 (TypeContainer.DefineMembers): Create the MemberCache.
24903 (TypeContainer.FindMembers): Do better BindingFlags checking; only
24904 return public members if BindingFlags.Public was given, check
24905 whether members are static.
24907 2002-08-16 Martin Baulig <martin@gnome.org>
24909 * decl.cs (DeclSpace.Define): Splitted this in Define and
24910 DefineMembers. DefineMembers is called first and initializes the
24913 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
24914 DefineMembers() on all our DeclSpaces.
24916 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
24917 but call DefineMembers() on all nested interfaces. We call their
24918 Define() in our new Define() function.
24920 * interface.cs (Interface): Implement IMemberContainer.
24921 (Interface.Define): Moved all code except the attribute stuf to
24923 (Interface.DefineMembers): Initialize the member cache.
24925 * typemanager.cs (IMemberFinder): Removed this interface, we don't
24926 need this anymore since we can use MemberCache.FindMembers directly.
24928 2002-08-19 Martin Baulig <martin@gnome.org>
24930 * typemanager.cs (MemberCache): When creating the cache for an
24931 interface type, add all inherited members.
24932 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
24933 to `out bool used_cache' and documented it.
24934 (TypeManager.MemberLookup): If we already used the cache in the first
24935 iteration, we don't need to do the interfaces check.
24937 2002-08-19 Martin Baulig <martin@gnome.org>
24939 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
24940 here from IMemberFinder and don't implement this interface anymore.
24941 (DeclSpace.MemberCache): Moved here from IMemberFinder.
24943 * typemanager.cs (IMemberFinder): This interface is now only used by
24944 classes which actually support the member cache.
24945 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
24946 since we only put DeclSpaces into this Hashtable.
24947 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
24948 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
24950 2002-08-16 Martin Baulig <martin@gnome.org>
24952 * typemanager.cs (ICachingMemberFinder): Removed.
24953 (IMemberFinder.MemberCache): New property.
24954 (TypeManager.FindMembers): Merged this with RealFindMembers().
24955 This function will never be called from TypeManager.MemberLookup()
24956 so we can't use the cache here, just the IMemberFinder.
24957 (TypeManager.MemberLookup_FindMembers): Check whether the
24958 IMemberFinder has a MemberCache and call the cache's FindMembers
24960 (MemberCache): Rewrote larger parts of this yet another time and
24961 cleaned it up a bit.
24963 2002-08-15 Miguel de Icaza <miguel@ximian.com>
24965 * driver.cs (LoadArgs): Support quoting.
24967 (Usage): Show the CSC-like command line arguments.
24969 Improved a few error messages.
24971 2002-08-15 Martin Baulig <martin@gnome.org>
24973 * typemanager.cs (IMemberContainer.Type): New property.
24974 (IMemberContainer.IsInterface): New property.
24976 The following changes are conditional to BROKEN_RUNTIME, which is
24977 defined at the top of the file.
24979 * typemanager.cs (MemberCache.MemberCache): Don't add the base
24980 class'es members, but add all members from TypeHandle.ObjectType
24981 if we're an interface.
24982 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
24983 is the current type.
24984 (MemberCache.CacheEntry.Container): Removed this field.
24985 (TypeHandle.GetMembers): Include inherited members.
24987 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24989 * typemanager.cs: fixed compilation and added a comment on a field that
24992 2002-08-15 Martin Baulig <martin@gnome.org>
24994 * class.cs (ConstructorInitializer.Resolve): In the
24995 Expression.MemberLookup call, use the queried_type as
24998 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
24999 declared' attribute, it's always true.
25000 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
25001 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
25002 temporary wrapper for FindMembers which tells MemberLookup whether
25003 members from the base classes are included in the return value.
25004 This will go away soon.
25005 (TypeManager.MemberLookup): Use this temporary hack here; once the
25006 new MemberCache is completed, we don't need to do the DeclaredOnly
25007 looping here anymore since the MemberCache will take care of this.
25008 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
25009 (MemberCache): When creating the MemberCache for a class, get
25010 members from the current class and all its base classes.
25011 (MemberCache.CacheEntry.Container): New field. This is a
25012 temporary hack until the Mono runtime is fixed to distinguish
25013 between ReflectedType and DeclaringType. It allows us to use MCS
25014 with both the MS runtime and the unfixed Mono runtime without
25015 problems and without accecting performance.
25016 (MemberCache.SearchMembers): The DeclaredOnly looping from
25017 TypeManager.MemberLookup is now done here.
25019 2002-08-14 Martin Baulig <martin@gnome.org>
25021 * statement.cs (MyStructInfo.MyStructInfo): Don't call
25022 Type.GetFields on dynamic types but get the fields from the
25023 corresponding TypeContainer.
25024 (MyStructInfo.GetStructInfo): Added check for enum types.
25026 * typemanager.cs (MemberList.IsSynchronized): Implemented.
25027 (MemberList.SyncRoot): Implemented.
25028 (TypeManager.FilterWithClosure): No need to check permissions if
25029 closure_start_type == closure_invocation_type, don't crash if
25030 closure_invocation_type is null.
25032 2002-08-13 Martin Baulig <martin@gnome.org>
25034 Rewrote TypeContainer.FindMembers to use a member cache. This
25035 gives us a speed increase of about 35% for the self-hosting MCS
25036 build and of about 15-20% for the class libs (both on GNU/Linux).
25038 * report.cs (Timer): New class to get enhanced profiling. This
25039 whole class is "TIMER" conditional since it remarkably slows down
25042 * class.cs (MemberList): New class. This is an IList wrapper
25043 which we're now using instead of passing MemberInfo[]'s around to
25044 avoid copying this array unnecessarily.
25045 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
25046 (ICachingMemberFinder, IMemberContainer): New interface.
25047 (TypeManager.FilterWithClosure): If `criteria' is null, the name
25048 has already been checked, otherwise use it for the name comparision.
25049 (TypeManager.FindMembers): Renamed to RealMemberFinder and
25050 provided wrapper which tries to use ICachingMemberFinder.FindMembers
25051 if possible. Returns a MemberList, not a MemberInfo [].
25052 (TypeHandle): New class, implements IMemberContainer. We create
25053 one instance of this class per type, it contains a MemberCache
25054 which is used to do the member lookups.
25055 (MemberCache): New class. Each instance of this class contains
25056 all members of a type and a name-based hash table.
25057 (MemberCache.FindMembers): This is our new member lookup
25058 function. First, it looks up all members of the requested name in
25059 the hash table. Then, it walks this list and sorts out all
25060 applicable members and returns them.
25062 2002-08-13 Martin Baulig <martin@gnome.org>
25064 In addition to a nice code cleanup, this gives us a performance
25065 increase of about 1.4% on GNU/Linux - not much, but it's already
25066 half a second for the self-hosting MCS compilation.
25068 * typemanager.cs (IMemberFinder): New interface. It is used by
25069 TypeManager.FindMembers to call FindMembers on a TypeContainer,
25070 Enum, Delegate or Interface.
25071 (TypeManager.finder_to_member_finder): New PtrHashtable.
25072 (TypeManager.finder_to_container): Removed.
25073 (TypeManager.finder_to_delegate): Removed.
25074 (TypeManager.finder_to_interface): Removed.
25075 (TypeManager.finder_to_enum): Removed.
25077 * interface.cs (Interface): Implement IMemberFinder.
25079 * delegate.cs (Delegate): Implement IMemberFinder.
25081 * enum.cs (Enum): Implement IMemberFinder.
25083 * class.cs (TypeContainer): Implement IMemberFinder.
25085 2002-08-12 Martin Baulig <martin@gnome.org>
25087 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
25089 2002-08-12 Martin Baulig <martin@gnome.org>
25091 * ecore.cs (ITypeExpression): New interface for expressions which
25093 (TypeExpression): Renamed to TypeLookupExpression.
25094 (Expression.DoResolve): If we're doing a types-only lookup, the
25095 expression must implement the ITypeExpression interface and we
25096 call DoResolveType() on it.
25097 (SimpleName): Implement the new ITypeExpression interface.
25098 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
25099 hack, the situation that we're only looking up types can't happen
25100 anymore when this method is called. Moved the type lookup code to
25101 DoResolveType() and call it.
25102 (SimpleName.DoResolveType): This ITypeExpression interface method
25103 is now doing the types-only lookup.
25104 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
25105 (ResolveFlags): Added MaskExprClass.
25107 * expression.cs (MemberAccess): Implement the ITypeExpression
25109 (MemberAccess.DoResolve): Added support for a types-only lookup
25110 when we're called via ITypeExpression.DoResolveType().
25111 (ComposedCast): Implement the ITypeExpression interface.
25113 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
25114 Expression.Resolve() with ResolveFlags.Type instead.
25116 2002-08-12 Martin Baulig <martin@gnome.org>
25118 * interface.cs (Interface.Define): Apply attributes.
25120 * attribute.cs (Attribute.ApplyAttributes): Added support for
25121 interface attributes.
25123 2002-08-11 Martin Baulig <martin@gnome.org>
25125 * statement.cs (Block.Emit): Only check the "this" variable if we
25126 do not always throw an exception.
25128 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
25129 whether the property has a set accessor.
25131 2002-08-11 Martin Baulig <martin@gnome.org>
25133 Added control flow analysis support for structs.
25135 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
25136 with control flow analysis turned off.
25137 (IVariable): New interface.
25138 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
25139 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
25140 (FieldExpr.DoResolve): Resolve the instance expression with flow
25141 analysis turned off and do the definite assignment check after the
25142 resolving when we know what the expression will resolve to.
25144 * expression.cs (LocalVariableReference, ParameterReference):
25145 Implement the new IVariable interface, only call the flow analysis
25146 code if ec.DoFlowAnalysis is true.
25147 (This): Added constructor which takes a Block argument. Implement
25148 the new IVariable interface.
25149 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
25150 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
25151 This does the definite assignment checks for struct members.
25153 * class.cs (Constructor.Emit): If this is a non-static `struct'
25154 constructor which doesn't have any initializer, call
25155 Block.AddThisVariable() to tell the flow analysis code that all
25156 struct elements must be initialized before control returns from
25159 * statement.cs (MyStructInfo): New public class.
25160 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
25161 argument to this indexer. If non-zero, check an individual struct
25162 member, not the whole struct.
25163 (FlowBranching.CheckOutParameters): Check struct members.
25164 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
25165 overloaded versions of these methods which take an additional
25166 `int field_idx' argument to check struct members.
25167 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
25168 overloaded versions of these methods which take an additional
25169 `string field_name' argument to check struct member.s
25170 (VariableInfo): Implement the IVariable interface.
25171 (VariableInfo.StructInfo): New public property. Returns the
25172 MyStructInfo instance of the variable if it's a struct or null.
25173 (Block.AddThisVariable): New public method. This is called from
25174 Constructor.Emit() for non-static `struct' constructor which do
25175 not have any initializer. It creates a special variable for the
25176 "this" instance variable which will be checked by the flow
25177 analysis code to ensure that all of the struct's fields are
25178 initialized before control returns from the constructor.
25179 (UsageVector): Added support for struct members. If a
25180 variable/parameter is a struct with N members, we reserve a slot
25181 in the usage vector for each member. A struct is considered fully
25182 initialized if either the struct itself (slot 0) or all its
25183 members are initialized.
25185 2002-08-08 Martin Baulig <martin@gnome.org>
25187 * driver.cs (Driver.MainDriver): Only report an error CS5001
25188 if there were no compilation errors.
25190 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
25191 `UnsafeContext' property to determine whether the parent is in
25192 unsafe context rather than checking the parent's ModFlags:
25193 classes nested in an unsafe class are unsafe as well.
25195 2002-08-08 Martin Baulig <martin@gnome.org>
25197 * statement.cs (UsageVector.MergeChildren): Distinguish between
25198 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
25199 we return. Added test17() and test18() to test-154.cs.
25201 2002-08-08 Martin Baulig <martin@gnome.org>
25203 * typemanager.cs (TypeManager.FilterWithClosure): If we have
25204 Family access, make sure the invoking type isn't a subclass of the
25205 queried type (that'd be a CS1540).
25207 * ecore.cs (Expression.MemberLookup): Added overloaded version of
25208 this method which takes an additional `Type invocation_type'.
25210 * expression.cs (BaseAccess.DoResolve): Use the base type as
25211 invocation and query type.
25212 (MemberAccess.DoResolve): If the lookup failed and we're about to
25213 report a CS0122, try a lookup with the ec.ContainerType - if this
25214 succeeds, we must report a CS1540.
25216 2002-08-08 Martin Baulig <martin@gnome.org>
25218 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
25219 (MethodGroupExpr): Implement the IMemberExpr interface.
25221 * expression (MemberAccess.ResolveMemberAccess): No need to have
25222 any special code for MethodGroupExprs anymore, they're now
25225 2002-08-08 Martin Baulig <martin@gnome.org>
25227 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
25228 Family, FamANDAssem and FamORAssem permissions.
25229 (TypeManager.IsSubclassOrNestedChildOf): New public method.
25231 2002-08-08 Martin Baulig <martin@gnome.org>
25233 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
25234 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
25237 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
25239 * driver.cs: implemented /resource option to embed managed resources.
25241 2002-08-07 Martin Baulig <martin@gnome.org>
25243 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
25244 (FieldBase.HasFieldInitializer): New public property.
25245 (FieldBase.GetInitializerExpression): New public method. Resolves and
25246 returns the field initializer and makes sure it is only resolved once.
25247 (TypeContainer.EmitFieldInitializers): Call
25248 FieldBase.GetInitializerExpression to get the initializer, this ensures
25249 that it isn't resolved multiple times.
25251 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
25252 the resolving process (SimpleName/MemberLookup) that we're currently
25253 emitting a field initializer (which must not access any instance members,
25254 this is an error CS0236).
25256 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
25257 argument, if the `IsFieldInitializer' flag is set, we must report and
25258 error CS0236 and not an error CS0120.
25260 2002-08-07 Martin Baulig <martin@gnome.org>
25262 * ecore.cs (IMemberExpr): New public interface.
25263 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
25264 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
25265 if the expression is an IMemberExpr.
25267 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
25268 to be null, implicitly default to `this' if we're non-static in
25269 this case. Simplified the code a lot by using the new IMemberExpr
25270 interface. Also fixed bug #28176 here.
25272 2002-08-06 Martin Baulig <martin@gnome.org>
25274 * cs-parser.jay (SimpleLookup): Removed. We need to create
25275 ParameterReferences during semantic analysis so that we can do a
25276 type-only search when resolving Cast, TypeOf and SizeOf.
25277 (block): Pass the `current_local_parameters' to the Block's
25280 * class.cs (ConstructorInitializer): Added `Parameters parameters'
25281 argument to the constructor.
25282 (ConstructorInitializer.Resolve): Create a temporary implicit
25283 block with the parameters.
25285 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
25286 references here if we aren't doing a type-only search.
25288 * statement.cs (Block): Added constructor which takes a
25289 `Parameters parameters' argument.
25290 (Block.Parameters): New public property.
25292 * support.cs (InternalParameters.Parameters): Renamed `parameters'
25293 to `Parameters' and made it public readonly.
25295 2002-08-06 Martin Baulig <martin@gnome.org>
25297 * ecore.cs (Expression.Warning): Made this public as well.
25299 * report.cs (Report.Debug): Print the contents of collections.
25301 2002-08-06 Martin Baulig <martin@gnome.org>
25303 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
25304 used to tell Resolve() which kinds of expressions it may return.
25305 (Expression.Resolve): Added overloaded version of this method which
25306 takes a `ResolveFlags flags' argument. This can be used to tell
25307 Resolve() which kinds of expressions it may return. Reports a
25309 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
25310 ResolveFlags.SimpleName.
25311 (Expression.Error118): Added overloaded version of this method which
25312 takes a `ResolveFlags flags' argument. It uses the flags to determine
25313 which kinds of expressions are allowed.
25315 * expression.cs (Argument.ResolveMethodGroup): New public method.
25316 Resolves an argument, but allows a MethodGroup to be returned.
25317 This is used when invoking a delegate.
25319 * TODO: Updated a bit.
25321 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25323 Fixed compilation with csc.
25325 * ecore.cs: Expression.Error made public. Is this correct? Should
25326 Warning be made public too?
25328 * expression.cs: use ea.Location instead of ea.loc.
25329 [FIXME: Filed as bug #28607: MCS must report these errors.]
25331 2002-08-06 Martin Baulig <martin@gnome.org>
25333 * ecore.cs (Expression.loc): Moved the location here instead of
25334 duplicating it in all derived classes.
25335 (Expression.Location): New public property.
25336 (Expression.Error, Expression.Warning): Made them non-static and
25337 removed the location argument.
25338 (Expression.Warning): Added overloaded version which takes an
25339 `int level' argument.
25340 (Expression.Error118): Make this non-static and removed the
25341 expression and location arguments.
25342 (TypeExpr): Added location argument to the constructor.
25344 * expression.cs (StaticCallExpr): Added location argument to
25346 (Indirection, PointerArithmetic): Likewise.
25347 (CheckedExpr, UnCheckedExpr): Likewise.
25348 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
25349 (StringPtr): Likewise.
25352 2002-08-05 Martin Baulig <martin@gnome.org>
25354 * expression.cs (BaseAccess.DoResolve): Actually report errors.
25356 * assign.cs (Assign.DoResolve): Check whether the source
25357 expression is a value or variable.
25359 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
25360 while resolving the corresponding blocks.
25362 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
25363 an error, don't silently return null.
25365 * statement.cs (Block.AddVariable): Do the error reporting here
25366 and distinguish between CS0128 and CS0136.
25367 (Block.DoResolve): Report all unused labels (warning CS0164).
25368 (LabeledStatement): Pass the location to the constructor.
25369 (LabeledStatement.HasBeenReferenced): New property.
25370 (LabeledStatement.Resolve): Set it to true here.
25372 * statement.cs (Return.Emit): Return success even after reporting
25373 a type mismatch error (CS0126 or CS0127), this is what csc does and
25374 it avoids confusing the users with any consecutive errors.
25376 2002-08-05 Martin Baulig <martin@gnome.org>
25378 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
25380 * const.cs (Const.LookupConstantValue): Catch circular definitions.
25382 * expression.cs (MemberAccess.DoResolve): Silently return if an
25383 error has already been reported.
25385 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
25386 error has already been reported.
25388 2002-08-05 Martin Baulig <martin@gnome.org>
25390 * statement.cs (UsageVector): Only initialize the `parameters'
25391 vector if we actually have any "out" parameters.
25393 2002-08-05 Martin Baulig <martin@gnome.org>
25395 * expression.cs (Binary.ResolveOperator): When combining delegates,
25396 they must have the same type.
25398 2002-08-05 Martin Baulig <martin@gnome.org>
25400 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
25401 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
25402 work with the ms runtime and we also don't need it: if we're a
25403 PropertyBuilder and not in the `indexer_arguments' hash, then we
25404 are a property and not an indexer.
25406 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
25407 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
25408 since the latter one doesn't work with the ms runtime.
25410 2002-08-03 Martin Baulig <martin@gnome.org>
25412 Fixed bugs #27998 and #22735.
25414 * class.cs (Method.IsOperator): New public field.
25415 (Method.CheckBase): Report CS0111 if there's already a method
25416 with the same parameters in the current class. Report CS0508 when
25417 attempting to change the return type of an inherited method.
25418 (MethodData.Emit): Report CS0179 if a method doesn't have a body
25419 and it's not marked abstract or extern.
25420 (PropertyBase): New abstract base class for Property and Indexer.
25421 (PropertyBase.CheckBase): Moved here from Property and made it work
25423 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
25424 the same so we can reuse it there.
25425 (Property, Indexer): Derive from PropertyBase.
25426 (MethodSignature.inheritable_property_signature_filter): New delegate
25427 to find properties and indexers.
25429 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
25430 argument and improved error reporting.
25432 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
25433 EmptyReadOnlyParameters and made it a property.
25435 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
25436 version of this method which takes a `PropertyInfo indexer'.
25437 (TypeManager.RegisterIndexer): New method.
25439 * class.cs: Added myself as author of this file :-)
25441 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25443 * class.cs: fixed compilation on windoze.
25445 2002-08-03 Martin Baulig <martin@gnome.org>
25447 * interface.cs (Interface.GetInterfaceBases): Check whether all
25448 base interfaces are at least as accessible than the current one.
25450 * class.cs (TypeContainer.GetClassBases): Check whether base types
25451 are at least as accessible than the current type.
25452 (TypeContainer.AsAccessible): Implemented and made non-static.
25453 (MemberBase.CheckParameters): Report errors if the accessibility
25456 * delegate.cs (Delegate.Delegate): The default visibility is
25457 internal for top-level types and private for nested types.
25458 (Delegate.Define): Report errors if the accessibility checks fail.
25460 * enum.cs (Enum.Enum): The default visibility is internal for
25461 top-level types and private for nested types.
25462 (Enum.DefineType): Compute the correct visibility.
25464 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
25465 function which takes a `bool is_toplevel' instead of a TypeContainer.
25467 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
25470 2002-08-02 Martin Baulig <martin@gnome.org>
25472 * expression.cs (LocalVariableReferenc): Added constructor which
25473 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
25474 (LocalVariableReference.IsReadOnly): New property.
25475 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
25476 variable is readonly, use our own readonly flag to do this; you can
25477 use the new constructor to get a writable reference to a read-only
25480 * cs-parser.jay (foreach_statement, using_statement): Get a writable
25481 reference to the local variable.
25483 2002-08-01 Miguel de Icaza <miguel@ximian.com>
25485 * rootcontext.cs (ResolveCore): Also include System.Exception
25487 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
25488 we reach an EmptyStatement.
25490 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
25493 * expression.cs (Binary.ResolveOperator): Check error result in
25496 use brtrue/brfalse directly and avoid compares to null.
25498 2002-08-02 Martin Baulig <martin@gnome.org>
25500 * class.cs (TypeContainer.Define): Define all nested interfaces here.
25501 Fixes bug #28407, added test-155.cs.
25503 2002-08-01 Martin Baulig <martin@gnome.org>
25505 * class.cs (Event.EmitDefaultMethod): Make this work with static
25506 events. Fixes #28311, added verify-3.cs.
25508 2002-08-01 Martin Baulig <martin@gnome.org>
25510 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
25511 `is_disposable' fields.
25512 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
25513 `hm.is_disposable' if we're using the collection pattern.
25514 (Foreach.EmitCollectionForeach): Use the correct type for the
25515 enumerator's local variable, only emit the try/finally block if
25516 necessary (fixes #27713).
25518 2002-08-01 Martin Baulig <martin@gnome.org>
25520 * ecore.cs (Expression.report118): Renamed to Error118 and made
25523 * statement.cs (Throw.Resolve): Check whether the expression is of
25524 the correct type (CS0118) and whether the type derives from
25525 System.Exception (CS0155).
25526 (Catch.Resolve): New method. Do the type lookup here and check
25527 whether it derives from System.Exception (CS0155).
25528 (Catch.CatchType, Catch.IsGeneral): New public properties.
25530 * typemanager.cs (TypeManager.exception_type): Added.
25532 2002-07-31 Miguel de Icaza <miguel@ximian.com>
25534 * driver.cs: Updated About function.
25536 2002-07-31 Martin Baulig <martin@gnome.org>
25538 Implemented Control Flow Analysis.
25540 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
25541 (EmitContext.CurrentBranching): Added.
25542 (EmitContext.StartFlowBranching): Added.
25543 (EmitContext.EndFlowBranching): Added.
25544 (EmitContext.KillFlowBranching): Added.
25545 (EmitContext.IsVariableAssigned): Added.
25546 (EmitContext.SetVariableAssigned): Added.
25547 (EmitContext.IsParameterAssigned): Added.
25548 (EmitContext.SetParameterAssigned): Added.
25549 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
25550 Added control flow analysis stuff here.
25552 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
25553 resolve the expression as lvalue.
25554 (LocalVariableReference.DoResolve): Check whether the variable has
25555 already been assigned.
25556 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
25557 the parameter as assigned here.
25558 (ParameterReference.DoResolve): Check whether the parameter has already
25560 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
25561 expression as lvalue.
25563 * statement.cs (FlowBranching): New class for the flow analysis code.
25564 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
25565 (LabeledStatement.IsDefined): New public property.
25566 (LabeledStatement.AddUsageVector): New public method to tell flow
25567 analyis that the label may be reached via a forward jump.
25568 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
25570 (VariableInfo.Number): New public field. This is used by flow analysis
25571 to number all locals of a block.
25572 (Block.CountVariables): New public property. This is the number of
25573 local variables in this block (including the locals from all parent
25575 (Block.EmitMeta): Number all the variables.
25577 * statement.cs: Added flow analysis support to all classes.
25579 2002-07-31 Martin Baulig <martin@gnome.org>
25581 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
25582 To get debugging messages, compile mcs with /define:MCS_DEBUG and
25583 then use this argument.
25585 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
25587 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
25588 use this to specify /define options.
25590 2002-07-29 Martin Baulig <martin@gnome.org>
25592 * statement.cs (Fixed): Moved all code that does variable lookups
25593 and resolvings from Emit to Resolve.
25595 * statement.cs (For): Moved all code that does variable lookups
25596 and resolvings from Emit to Resolve.
25598 * statement.cs (Using): Moved all code that does variable lookups
25599 and resolvings from Emit to Resolve.
25601 2002-07-29 Martin Baulig <martin@gnome.org>
25603 * attribute.cs (Attribute.Resolve): Explicitly catch a
25604 System.NullReferenceException when creating the
25605 CustromAttributeBuilder and report a different warning message.
25607 2002-07-29 Martin Baulig <martin@gnome.org>
25609 * support.cs (ParameterData.ParameterName): Added method to
25610 get the name of a parameter.
25612 * typemanager.cs (TypeManager.IsValueType): New public method.
25614 2002-07-29 Martin Baulig <martin@gnome.org>
25616 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
25617 is a flag which specifies that it's either ref or out.
25618 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
25619 the out parameter to `out Parameter.Modifier mod', also set the
25620 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
25622 * support.cs (InternalParameters.ParameterModifier): Distinguish
25623 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25624 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25626 * expression.cs (Argument.GetParameterModifier): Distinguish
25627 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25628 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25630 2002-07-29 Martin Baulig <martin@gnome.org>
25632 * expression.cs (ParameterReference.ParameterReference): Added
25633 `Location loc' argument to the constructor.
25635 * cs-parser.jay: Pass location to ParameterReference.
25637 2002-07-28 Miguel de Icaza <miguel@ximian.com>
25639 * statement.cs (Try): Initialize the location.
25641 * cs-parser.jay: pass location to Try.
25643 * expression.cs (Unary.Reduce): Change the prototype to return
25644 whether a constant fold could be performed or not. The result is
25645 returned in an out parameters. In the case of Indirection and
25646 AddressOf, we want to perform the full tests.
25648 2002-07-26 Miguel de Icaza <miguel@ximian.com>
25650 * statement.cs (Statement.Emit): Flag dead code.
25652 2002-07-27 Andrew Birkett <andy@nobugs.org>
25654 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
25656 2002-07-27 Martin Baulig <martin@gnome.org>
25658 * class.cs (MethodData.Define): Put back call to
25659 TypeManager.AddMethod(), accidentally commented this out.
25661 * report.cs (Debug): New public method to print debugging information,
25662 this is `[Conditional ("DEBUG")]'.
25664 2002-07-26 Martin Baulig <martin@gnome.org>
25666 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
25667 (switch_statement): Push the current_block to the switch_stack and
25668 pop it again when we're done with the switch.
25669 (switch_section): The new block is a child of the current_block.
25670 Fixes bug #24007, added test-152.cs.
25672 2002-07-27 Martin Baulig <martin@gnome.org>
25674 * expression.cs (Invocation.EmitArguments): When calling a varargs
25675 function with only its fixed arguments, we need to pass an empty
25678 2002-07-27 Martin Baulig <martin@gnome.org>
25680 Mono 0.13 has been released.
25682 2002-07-25 Miguel de Icaza <miguel@ximian.com>
25684 * driver.cs: Rename --resource to --linkres, because that is what
25685 we do currently, we dont support --resource yet.
25687 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
25689 2002-07-25 Martin Baulig <martin@gnome.org>
25691 * class.cs (MethodData): New public class. This is a `method builder'
25692 class for a method or one accessor of a Property/Indexer/Event.
25693 (MethodData.GetMethodFlags): Moved here from MemberBase.
25694 (MethodData.ApplyAttributes): Likewise.
25695 (MethodData.ApplyObsoleteAttribute): Likewise.
25696 (MethodData.ApplyConditionalAttribute): Likewise.
25697 (MethodData.ApplyDllImportAttribute): Likewise.
25698 (MethodData.CheckAbstractAndExternal): Likewise.
25699 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
25700 (MethodData.Emit): Formerly known as Method.Emit().
25701 (MemberBase): Moved everything which was specific to a single
25702 accessor/method to MethodData.
25703 (Method): Create a new MethodData and call Define() and Emit() on it.
25704 (Property, Indexer, Event): Create a new MethodData objects for each
25705 accessor and call Define() and Emit() on them.
25707 2002-07-25 Martin Baulig <martin@gnome.org>
25709 Made MethodCore derive from MemberBase to reuse the code from there.
25710 MemberBase now also checks for attributes.
25712 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
25713 (MemberBase.GetMethodFlags): Moved here from class Method and marked
25715 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
25716 `CallingConventions cc' and `Attributes opt_attrs' arguments.
25717 (MemberBase.ApplyAttributes): New virtual method; applies the
25718 attributes to a method or accessor.
25719 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
25720 (MemberBase.ApplyConditionalAttribute): Likewise.
25721 (MemberBase.ApplyDllImportAttribute): Likewise.
25722 (MemberBase.CheckAbstractAndExternal): Likewise.
25723 (MethodCore.ParameterTypes): This is now a property instead of a
25724 method, it's initialized from DoDefineParameters().
25725 (MethodCore.ParameterInfo): Removed the set accessor.
25726 (MethodCore.DoDefineParameters): New protected virtual method to
25727 initialize ParameterTypes and ParameterInfo.
25728 (Method.GetReturnType): We can now simply return the MemberType.
25729 (Method.GetMethodFlags): Override the MemberBase version and add
25730 the conditional flags.
25731 (Method.CheckBase): Moved some code from Define() here, call
25732 DoDefineParameters() here.
25733 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
25734 here to avoid some larger code duplication.
25735 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
25736 ensure that abstract and external accessors don't declare a body.
25738 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
25739 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
25740 lookup in the attribute's parent classes, so we need to abort as soon
25741 as we found the first match.
25742 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
25743 the attribute has no arguments.
25745 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
25748 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25750 * cs-parser.jay: reverted previous patch.
25752 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25754 * cs-parser.jay: fixed bug #22119.
25756 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25758 * attribute.cs: fixed compilation. The error was:
25759 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
25760 be assigned to before control leaves the current method."
25761 [FIXME: Filed as bug #28186: MCS must report this error.]
25763 2002-07-25 Martin Baulig <martin@gnome.org>
25765 * attribute.cs (Attribute.Conditional_GetConditionName): New static
25766 method to pull the condition name ouf of a Conditional attribute.
25767 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
25768 the obsolete message and error flag out of an Obsolete attribute.
25770 * class.cs (Method.GetMethodFlags): New public method to get the
25771 TypeManager.MethodFlags for this method.
25772 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
25774 (Method.Define): Get and apply the Obsolete and Conditional attributes;
25775 if we're overriding a virtual function, set the new private variable
25776 `parent_method'; call the new TypeManager.AddMethod().
25778 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
25779 the MethodBuilder and the Method in a PtrHashtable.
25780 (TypeManager.builder_to_method): Added for this purpose.
25781 (TypeManager.MethodFlags): Added IsObsoleteError.
25782 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
25783 Obsolete and Conditional arguments in MethodBuilders. If we discover
25784 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
25785 the message from the attribute.
25787 2002-07-24 Martin Baulig <martin@gnome.org>
25789 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
25790 preprocessor directives, ensure that the argument to #define/#undef is
25791 exactly one identifier and that it's actually an identifier.
25793 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
25796 2002-07-24 Martin Baulig <martin@gnome.org>
25798 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
25799 initialize it to TypeManager.object_type in the constructor.
25800 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
25801 of the `hm.get_current' method if we're using the collection pattern.
25802 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
25803 for the explicit conversion to make it work when we're using the collection
25804 pattern and the `Current' property has a different return type than `object'.
25807 2002-07-24 Martin Baulig <martin@gnome.org>
25809 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
25810 does not match, but don't report any errors. This method is called in
25811 order for all methods in a MethodGroupExpr until a matching method is
25812 found, so we don't want to bail out if the first method doesn't match.
25813 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
25814 matches, report the 123. Fixes #28070.
25816 2002-07-24 Martin Baulig <martin@gnome.org>
25818 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
25819 TypeManager.TypeToCoreType() to the top of the method so the
25820 following equality checks will work. Fixes #28107.
25822 2002-07-24 Martin Baulig <martin@gnome.org>
25824 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
25825 operand is of type uint, and the other operand is of type sbyte,
25826 short or int, the operands are converted to type long." -
25827 Actually do what this comment already told us. Fixes bug #28106,
25830 2002-07-24 Martin Baulig <martin@gnome.org>
25832 * class.cs (MethodBase): New abstract class. This is now a base
25833 class for Property, Indexer and Event to avoid some code duplication
25834 in their Define() and DefineMethods() methods.
25835 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
25836 generic methods for Define() and DefineMethods().
25837 (FieldBase): Derive from MemberBase, not MemberCore.
25838 (Property): Derive from MemberBase, not MemberCore.
25839 (Property.DefineMethod): Moved all the code from this method to the
25840 new MethodBase.DefineAccessor(), just call it with appropriate
25842 (Property.Define): Call the new Property.DoDefine(), this does some
25843 sanity checks and we don't need to duplicate the code everywhere.
25844 (Event): Derive from MemberBase, not MemberCore.
25845 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
25846 accessors, this will also make them work with interface events.
25847 (Indexer): Derive from MemberBase, not MemberCore.
25848 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
25849 (Indexer.Define): Use the new MethodBase functions.
25851 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
25852 argument to the constructor.
25853 (Interface.FindMembers): Added support for interface events.
25854 (Interface.PopluateEvent): Implemented.
25856 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
25858 2002-07-22 Miguel de Icaza <miguel@ximian.com>
25860 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
25861 but this is required to check for a method name being the same as
25862 the containing class.
25866 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25868 * interface.cs: initialize variable.
25870 2002-07-23 Martin Baulig <martin@gnome.org>
25872 Implemented the IndexerName attribute in interfaces.
25874 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
25875 name if this is an explicit interface implementation.
25876 (Indexer.InterfaceIndexerName): New public variable. If we're
25877 implementing an interface indexer, this is the IndexerName in that
25878 interface. Otherwise, it's the IndexerName.
25879 (Indexer.DefineMethod): If we're implementing interface indexer,
25880 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
25881 and Pending.ImplementIndexer methods.
25882 (Indexer.Define): Also define the PropertyBuilder if we're
25883 implementing an interface indexer and this is neither an explicit
25884 interface implementation nor do the IndexerName match the one in
25887 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
25888 If a method is defined here, then we always need to create a proxy
25889 for it. This is used when implementing interface indexers.
25890 (Pending.IsInterfaceIndexer): New public method.
25891 (Pending.ImplementIndexer): New public method.
25892 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
25893 This is used when implementing interface indexers to define a proxy
25895 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
25896 define a proxy if necessary.
25898 * interface.cs (Interface.IndexerName): New public variable.
25899 (Interface.PopulateIndexer): Set the IndexerName.
25900 (Interface.DefineIndexers): New private method. Populate all the
25901 indexers and make sure their IndexerNames match.
25903 * typemanager.cs (IndexerPropertyName): Added support for interface
25906 2002-07-22 Martin Baulig <martin@gnome.org>
25908 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
25909 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
25910 ret if HasReturnLabel.
25911 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
25914 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
25915 and set the ec.LoopBeginTryCatchLevel.
25916 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
25917 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
25918 the current ec.TryCatchLevel, the branch goes out of an exception
25919 block. In this case, we need to use Leave and not Br.
25921 2002-07-22 Martin Baulig <martin@gnome.org>
25923 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
25924 block unless the block does not always return or it is contained in
25925 another try { ... } catch { ... } block. Fixes bug #26506.
25926 Added verify-1.cs to the test suite.
25928 2002-07-22 Martin Baulig <martin@gnome.org>
25930 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
25931 then we do not always return. Fixes bug #24985.
25933 2002-07-22 Martin Baulig <martin@gnome.org>
25935 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
25936 lookup on a per-class level; ie. walk up the class hierarchy until we
25937 found at least one applicable method, then choose the best among them.
25938 Fixes bug #24463 and test-29.cs.
25940 2002-07-22 Martin Baulig <martin@gnome.org>
25942 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
25943 return types of the methods. The return type is not part of the
25944 signature and we must not check it to make the `new' modifier work.
25945 Fixes bug #27999, also added test-147.cs.
25946 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
25948 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
25949 on the method's return type.
25951 2002-07-21 Martin Baulig <martin@gnome.org>
25953 * assign.cs: Make this work if the rightmost source is a constant and
25954 we need to do an implicit type conversion. Also adding a few more tests
25955 to test-38.cs which should have caught this.
25957 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
25958 target in the makefile for this. The makefile.gnu is primarily intended
25959 for end-users who don't want to debug the compiler.
25961 2002-07-21 Martin Baulig <martin@gnome.org>
25963 * assign.cs: Improved the Assign class so it can now handle embedded
25964 assignments (X = Y = Z = something). As a side-effect this'll now also
25965 consume less local variables. test-38.cs now passes with MCS, added
25966 a few new test cases to that test.
25968 2002-07-20 Martin Baulig <martin@gnome.org>
25970 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
25971 instructions. Fixes bug #27977, also added test-146.cs.
25973 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25975 * cs-tokenizer.cs: fixed getHex ().
25977 2002-07-19 Martin Baulig <martin@gnome.org>
25979 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
25980 not Type.GetType() to lookup the array type. This is needed when
25981 we're constructing an array of a user-defined type.
25982 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
25983 single-dimensional arrays, but also for single-dimensial arrays of
25986 2002-07-19 Martin Baulig <martin@gnome.org>
25988 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
25989 this function is called, it's not allowed to share LocalBuilders
25990 among ILGenerators.
25992 2002-07-19 Martin Baulig <martin@gnome.org>
25994 * expression.cs (Argument.Resolve): Report an error 118 when trying
25995 to pass a type as argument.
25997 2002-07-18 Martin Baulig <martin@gnome.org>
25999 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
26000 Conv_R_Un for the signed `long' type.
26002 2002-07-15 Miguel de Icaza <miguel@ximian.com>
26004 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
26005 `expr' for the temporary result, as that will fail if we do
26006 multiple resolves on the same expression.
26008 2002-07-05 Miguel de Icaza <miguel@ximian.com>
26010 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
26011 ec.TypeContainer for looking up aliases.
26013 * class.cs (TypeContainer): Remove LookupAlias from here.
26015 * decl.cs (DeclSpace); Move here.
26017 2002-07-01 Miguel de Icaza <miguel@ximian.com>
26019 * class.cs (FindMembers): Only call filter if the constructor
26020 bulider is not null.
26022 Also handle delegates in `NestedTypes' now. Now we will perform
26023 type lookups using the standard resolution process. This also
26026 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
26027 This uses Expressions (the limited kind that can be parsed by the
26028 tree) instead of strings.
26030 * expression.cs (ComposedCast.ToString): Implement, used to flag
26031 errors since now we have to render expressions.
26033 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
26036 * ecore.cs (SimpleName.ToString): ditto.
26038 * cs-parser.jay: Instead of using strings to assemble types, use
26039 Expressions to assemble the type (using SimpleName, ComposedCast,
26040 MemberAccess). This should fix the type lookups in declarations,
26041 because we were using a different code path for this.
26043 * statement.cs (Block.Resolve): Continue processing statements
26044 even when there is an error.
26046 2002-07-17 Miguel de Icaza <miguel@ximian.com>
26048 * class.cs (Event.Define): Also remove the `remove' method from
26049 the list of pending items.
26051 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
26052 generate more compact code.
26054 2002-07-17 Martin Baulig <martin@gnome.org>
26056 * const.cs (Const.LookupConstantValue): Add support for constant
26057 `unchecked' and `checked' expressions.
26058 Also adding test case test-140.cs for this.
26060 2002-07-17 Martin Baulig <martin@gnome.org>
26062 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
26063 check whether mi.ReturnType implements the IEnumerator interface; the
26064 `==' and the IsAssignableFrom() will fail in this situation.
26066 2002-07-16 Ravi Pratap <ravi@ximian.com>
26068 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
26071 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26073 * expression.cs: fixed bug #27811.
26075 2002-07-14 Miguel de Icaza <miguel@ximian.com>
26077 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
26078 Molaro: when we are a ref, the value already contains a pointer
26079 value, do not take the address of it.
26081 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26082 * removed mb-parser.jay and mb-tokenizer.cs
26084 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26086 * expression.cs: check against the building corlib void type.
26088 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
26090 * ecore.cs: fix for valuetype static readonly fields: when
26091 initializing them, we need their address, not the address of a copy.
26093 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26095 * typemanager.cs: register also enum_type in corlib.
26097 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26099 * class.cs: allow calling this (but not base) initializers in structs.
26101 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
26103 * ecore.cs: make sure we compare against the building base types
26106 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26108 * typemanager.cs: fix TypeToCoreType() to handle void and object
26109 (corlib gets no more typerefs after this change).
26111 2002-07-12 Miguel de Icaza <miguel@ximian.com>
26113 * expression.cs (ArrayCreation.EmitArrayArguments): use
26114 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
26116 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
26117 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
26118 array indexes, the runtime actually forbids them.
26120 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
26121 for array arguments here.
26123 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
26124 instead of the default for ValueTypes.
26126 (New.DoEmit): Use IsValueType instead of
26127 IsSubclassOf (value_type)
26128 (New.DoResolve): ditto.
26129 (Invocation.EmitCall): ditto.
26131 * assign.cs (Assign): ditto.
26133 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
26134 Statements *are* currently doing part of their resolution during
26137 Expressions do always resolve during resolve, but statements are
26138 only required to propagate resolution to their children.
26140 2002-07-11 Miguel de Icaza <miguel@ximian.com>
26142 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
26144 (LoadAssembly): Do not add the dll if it is already specified
26146 (MainDriver): Add the System directory to the link path at the end,
26147 after all the other -L arguments.
26149 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
26150 wrong opcode for loading bytes and bools (ldelem.i1 instead of
26151 ldelem.u1) and using the opposite for sbytes.
26153 This fixes Digger, and we can finally run it.
26155 * driver.cs (UnixParseOption): Move the option parsing here.
26156 (CSCParseOption): Implement CSC-like parsing of options.
26158 We now support both modes of operation, the old Unix way, and the
26159 new CSC-like way. This should help those who wanted to make cross
26160 platform makefiles.
26162 The only thing broken is that /r:, /reference: and /lib: are not
26163 implemented, because I want to make those have the same semantics
26164 as the CSC compiler has, and kill once and for all the confussion
26165 around this. Will be doing this tomorrow.
26167 * statement.cs (Unsafe.Resolve): The state is checked during
26168 resolve, not emit, so we have to set the flags for IsUnsfe here.
26170 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26172 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
26173 not catch the Error_ObjectRefRequired in SimpleName (as it is
26174 possible to have a class/instance variable name that later gets
26175 deambiguated), we have to check this here.
26177 2002-07-10 Ravi Pratap <ravi@ximian.com>
26179 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
26180 make static and put into Expression.
26182 (Event.Define): Register the private field of the event with the
26183 TypeManager so that GetFieldFromEvent can get at it.
26185 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
26186 keep track of the private field associated with an event which
26189 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
26192 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
26194 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26196 * expression.cs (Binary.EmitBranchable): this routine emits the
26197 Binary expression in a branchable context. This basically means:
26198 we need to branch somewhere, not just get the value on the stack.
26200 This works together with Statement.EmitBoolExpression.
26202 * statement.cs (Statement.EmitBoolExpression): Use
26205 2002-07-09 Miguel de Icaza <miguel@ximian.com>
26207 * statement.cs (For): Reduce the number of jumps in loops.
26209 (For): Implement loop inversion for the For statement.
26211 (Break): We can be breaking out of a Try/Catch controlled section
26212 (foreach might have an implicit try/catch clause), so we need to
26213 use Leave instead of Br.
26215 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
26216 now). If the instace expression supports IMemoryLocation, we use
26217 the AddressOf method from the IMemoryLocation to extract the
26218 address instead of emitting the instance.
26220 This showed up with `This', as we were emitting the instance
26221 always (Emit) instead of the Address of This. Particularly
26222 interesting when This is a value type, as we dont want the Emit
26223 effect (which was to load the object).
26225 2002-07-08 Miguel de Icaza <miguel@ximian.com>
26227 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
26229 * statement.cs (Checked): Set the CheckedState during the resolve
26230 process too, as the ConvCast operations track the checked state on
26231 the resolve process, and not emit.
26233 * cs-parser.jay (namespace_member_declaration): Flag that we have
26234 found a declaration when we do. This is used to flag error 1529
26236 * driver.cs: Report ok when we display the help only.
26238 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
26240 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
26242 2002-07-04 Miguel de Icaza <miguel@ximian.com>
26244 * cs-tokenizer.cs (define): We also have to track locally the
26245 defines. AllDefines is just used for the Conditional Attribute,
26246 but we also need the local defines for the current source code.
26248 2002-07-03 Miguel de Icaza <miguel@ximian.com>
26250 * statement.cs (While, For, Do): These loops can exit through a
26251 Break statement, use this information to tell whether the
26252 statement is the last piece of code.
26254 (Break): Flag that we break.
26256 * codegen.cs (EmitContexts): New `Breaks' state variable.
26258 2002-07-03 Martin Baulig <martin@gnome.org>
26260 * class.cs (TypeContainer.MethodModifiersValid): Allow override
26261 modifiers in method declarations in structs. Otherwise, you won't
26262 be able to override things like Object.Equals().
26264 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26266 * class.cs (Method, Property, Indexer): Do not allow the public
26267 modifier to be used in explicit interface implementations.
26269 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
26270 override modifiers in method declarations in structs
26272 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
26274 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
26275 integer or real overflow, report an error
26277 2002-07-02 Martin Baulig <martin@gnome.org>
26279 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
26280 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
26281 to tell the runtime about our newly created System.Object and
26282 System.ValueType types.
26284 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26286 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
26287 struct instead of Ldarg/Starg.
26289 2002-07-02 Martin Baulig <martin@gnome.org>
26291 * expression.cs (Indirection.Indirection): Call
26292 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
26294 2002-07-02 Martin Baulig <martin@gnome.org>
26296 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
26297 ValueType, call TypeManager.TypeToCoreType() on it.
26298 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
26299 the OpCodes.Newarr argument.
26301 2002-07-02 Martin Baulig <martin@gnome.org>
26303 * expression.cs (Invocation.EmitCall): When compiling corlib,
26304 replace all calls to the system's System.Array type to calls to
26305 the newly created one.
26307 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
26308 System.Array methods.
26309 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
26310 from the system's System.Array type which must be replaced.
26312 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
26314 * typemanager.cs: load unverifiable_code_ctor so we can build
26315 corlib using the correct type. Avoid using GetTypeCode() with
26317 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
26318 TypeManager.object_type to allow building corlib.
26320 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26322 * ecore.cs: handle System.Enum separately in LoadFromPtr().
26324 2002-07-01 Martin Baulig <martin@gnome.org>
26326 * class.cs: Make the last change actually work, we need to check
26327 whether `ifaces != null' to avoid a crash.
26329 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26331 * class.cs: when we build structs without fields that implement
26332 interfaces, we need to add the interfaces separately, since there is
26333 no API to both set the size and add the interfaces at type creation
26336 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26338 * expression.cs: the dimension arguments to the array constructors
26339 need to be converted if they are a long.
26341 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
26343 * class.cs: don't emit ldarg.0 if there is no parent constructor
26344 (fixes showstopper for corlib).
26346 2002-06-29 Martin Baulig <martin@gnome.org>
26348 MCS now compiles corlib on GNU/Linux :-)
26350 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
26351 ie. check for MethodImplOptions.InternalCall.
26353 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
26354 and TypeManager.attribute_type are null, so we must explicitly check
26355 whether parent is not null to find out whether it's an attribute type.
26356 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
26357 and SetBuilder, not only if the property is neither abstract nor external.
26358 This is necessary to set the MethodImplOptions on the accessor methods.
26359 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
26360 SetBuilder, see Property.Emit().
26362 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
26363 populate "System.Object", "System.ValueType" and "System.Attribute" since
26364 they've already been populated from BootCorlib_PopulateCoreTypes().
26366 2002-06-29 Martin Baulig <martin@gnome.org>
26368 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
26369 is the NullLiteral, we also need to make sure that target_type is not
26372 2002-06-29 Martin Baulig <martin@gnome.org>
26374 * rootcontext.cs (RootContext.ResolveCore): We must initialize
26375 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
26376 before calling BootstrapCorlib_ResolveDelegate ().
26378 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26380 * statement.cs: fixed build-breaker. All tests passed ok.
26382 2002-06-27 Martin Baulig <martin@gnome.org>
26384 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
26385 for System.Decimal when compiling corlib.
26387 2002-06-27 Martin Baulig <martin@gnome.org>
26389 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
26390 switch blocks which contain nothing but a default clause.
26392 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
26394 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
26396 2002-06-27 Martin Baulig <martin@gnome.org>
26398 * ecore.cs (PropertyExpr.PropertyExpr): Call
26399 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
26401 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
26402 is already a TypeBuilder.
26404 2002-06-27 Martin Baulig <martin@gnome.org>
26406 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
26407 `target_type == TypeManager.array_type', not IsAssignableFrom() in
26408 the "from an array-type to System.Array" case. This makes it work
26409 when compiling corlib.
26411 2002-06-27 Martin Baulig <martin@gnome.org>
26413 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
26414 non-static PropertyExpr, set its InstanceExpression. This makes
26415 the `ICollection.Count' property work in System/Array.cs.
26417 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
26419 * driver.cs: Made error handling more consistent. Errors now
26420 tracked by Report class, so many methods which used to return int
26421 now return void. Main() now prints success/failure and
26422 errors/warnings message.
26424 Renamed '--probe' compiler argument to '--expect-error'. Removed
26425 the magic number return values (123 and 124). Now, if the
26426 expected error occurs, the compiler exits with success (exit value
26427 0). If the compilation completes without seeing that particular
26428 error, the compiler exits with failure (exit value 1). The
26429 makefile in mcs/errors has been changed to handle the new behaviour.
26431 * report.cs: Made 'expected error' number a property and renamed
26432 it from 'Probe' to 'ExpectedError'.
26434 * genericparser.cs: Removed error handling support, since it is
26435 now all done by Report class.
26437 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
26438 class, so parse() no longer returns an int.
26440 * namespace.cs: Use Report.Error instead of GenericParser.error
26442 2002-06-22 Miguel de Icaza <miguel@ximian.com>
26444 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
26445 TypeContainer.AddOperator): At the front of the list put the
26446 explicit implementations, so they get resolved/defined first.
26448 2002-06-21 Miguel de Icaza <miguel@ximian.com>
26450 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
26451 interface type is implemented by this TypeContainer. Used during
26452 explicit interface implementation.
26454 (Property.Define, Indexer.Define, Method.Define): Validate that
26455 the given interface in the explicit implementation is one of the
26456 base classes for the containing type.
26458 Also if we are explicitly implementing an interface, but there is
26459 no match in the pending implementation table, report an error.
26461 (Property.Define): Only define the property if we are
26462 not explicitly implementing a property from an interface. Use the
26463 correct name also for those properties (the same CSC uses,
26464 although that is really not needed).
26466 (Property.Emit): Do not emit attributes for explicitly implemented
26467 properties, as there is no TypeBuilder.
26469 (Indexer.Emit): ditto.
26471 Hiding then means that we do not really *implement* a pending
26472 implementation, which makes code fail.
26474 2002-06-22 Martin Baulig <martin@gnome.org>
26476 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
26477 the return value of Object.GetType(). [FIXME: we need to do this whenever
26478 we get a type back from the reflection library].
26480 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26482 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
26484 2002-06-20 Miguel de Icaza <miguel@ximian.com>
26486 * attribute.cs: Return null if we can not look up the type.
26488 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
26489 the interface types found.
26491 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
26492 interface types found.
26494 * typemanager.cs (GetInterfaces): Make this routine returns alll
26495 the interfaces and work around the lame differences between
26496 System.Type and System.Reflection.Emit.TypeBuilder in the results
26497 result for GetInterfaces.
26499 (ExpandInterfaces): Given an array of interface types, expand and
26500 eliminate repeated ocurrences of an interface. This expands in
26501 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
26504 2002-06-21 Martin Baulig <martin@gnome.org>
26506 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
26509 2002-06-21 Martin Baulig <martin@gnome.org>
26511 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
26512 and called with one of the core types, return the corresponding typebuilder for
26515 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
26518 2002-06-21 Martin Baulig <martin@gnome.org>
26520 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
26521 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
26522 (Expression.ConvertReferenceExplicit): Likewise.
26524 * expression.cs (ElementAccess.DoResolve): Likewise.
26525 (ElementAccess.DoResolveLValue): Likewise.
26527 2002-06-10 Martin Baulig <martin@gnome.org>
26529 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
26530 add the "value" parameter to the parameter list.
26532 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
26535 2002-06-19 Miguel de Icaza <miguel@ximian.com>
26537 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
26538 the argument to an int, uint, long or ulong, per the spec. Also
26539 catch negative constants in array creation.
26541 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
26543 * class.cs: do not allow the same interface to appear twice in
26544 the definition list.
26546 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26548 * ecore.cs: don't use ldlen with System.Array.
26550 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26552 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
26554 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
26556 * modifiers.cs: produce correct field attributes for protected
26557 internal. Easy fix so miguel can work on ther harder stuff:-)
26559 2002-06-18 Miguel de Icaza <miguel@ximian.com>
26561 * pending.cs: New file. Move the code from class.cs here.
26562 Support clearning the pending flag for all methods (when not doing
26563 explicit interface implementation).
26565 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26567 * rootcontext.cs: added a couple more types needed to bootstrap.
26569 2002-06-17 Miguel de Icaza <miguel@ximian.com>
26571 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
26572 constructor in the type, instead of any constructor in the type
26573 hierarchy. Thanks to Paolo for finding this bug (it showed up as
26574 a bug in the Mono runtime when applying the params attribute).
26576 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26577 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
26579 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
26581 * expression.cs (Unary.ResolveOperator): Use TypeManager
26582 to resolve the type.
26584 2002-06-13 Ravi Pratap <ravi@ximian.com>
26586 * cs-parser.jay (enum_member_declaration): Pass in the attributes
26589 * enum.cs (AddEnumMember): Add support to store the attributes associated
26590 with each member too.
26592 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
26593 field builders too - this takes care of the enum member case.
26595 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
26597 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
26598 address-of operator on both value types and pointers.
26600 2002-06-10 Martin Baulig <martin@gnome.org>
26602 * interface.cs (Interface.PopulateIndexer): Add the indexer's
26603 PropertyBuilder to the `property_builders' list.
26605 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
26606 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
26607 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
26608 find any indexers which are inherited from an interface.
26610 2002-06-09 Martin Baulig <martin@gnome.org>
26612 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
26613 the same type as the constant if necessary. There's also a test-130.cs
26616 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
26618 * typemanager.cs (TypeManager.ChangeType): Previously known as
26619 Enum.ChangeEnumType().
26621 2002-06-09 Martin Baulig <martin@gnome.org>
26623 * expression.cs (Cast.TryReduce): Added support for consts.
26625 2002-06-08 Ravi Pratap <ravi@ximian.com>
26627 * class.cs (Accessor): Hold attributes information so we can pass
26630 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
26631 Modify to pass in attributes attached to the methods.
26633 (add_accessor_declaration, remove_accessor_declaration): Ditto.
26635 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
26636 to handle the Accessor kind :-)
26638 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
26640 2002-06-08 Martin Baulig <martin@gnome.org>
26642 * expression.cs (Unary.TryReduceNegative): Added support for
26645 2002-06-08 Martin Baulig <martin@gnome.org>
26647 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
26648 name can't be found in the `defined_names' - the caller will do a
26649 MemberLookup in this case and thus find methods in System.Enum
26650 such as Enum.IsDefined().
26652 2002-06-08 Martin Baulig <martin@gnome.org>
26654 * enum.cs (Enum.ChangeEnumType): This is a custom version of
26655 Convert.ChangeType() which works with TypeBuilder created types.
26656 (Enum.LookupEnumValue, Enum.Define): Use it here.
26658 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
26659 `TypeBuilder.BaseType != null' check.
26660 (TypeContainer.FindMembers): Only lookup parent members if we
26661 actually have a parent.
26662 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
26663 (ConstructorInitializer.Resolve): Likewise.
26665 * interface.cs (Interface.FindMembers): Added
26666 `TypeBuilder.BaseType != null' check.
26668 * rootcontext.cs (RootContext.ResolveCore): Added
26669 "System.Runtime.CompilerServices.IndexerNameAttribute" to
26670 classes_second_stage.
26672 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
26673 debug_type and trace_type when compiling with --nostdlib.
26675 2002-06-07 Martin Baulig <martin@gnome.org>
26677 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
26678 (AddField): Set it to true when adding a non-static field.
26679 (DefineType): Use `have_nonstatic_fields' to find out whether we
26680 have non-static fields, not `Fields != null'.
26682 2002-06-02 Miguel de Icaza <miguel@ximian.com>
26684 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
26685 dereferencing a null on the static-field code path)
26687 2002-05-30 Martin Baulig <martin@gnome.org>
26689 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
26690 to take command line arguments. Use reflection to call the new
26691 custom `Initialize' function on the symbol writer and pass it the
26692 command line arguments.
26694 * driver.cs (--debug-args): New command line argument to pass command
26695 line arguments to the symbol writer.
26697 2002-05-28 Miguel de Icaza <miguel@ximian.com>
26699 * assign.cs (DoResolve): Forgot to do the implicit conversion to
26700 the target type for indexers and properties. Thanks to Joe for
26703 2002-05-27 Miguel de Icaza <miguel@ximian.com>
26705 * typemanager.cs (MethodFlags): returns the method flags
26706 (Obsolete/ShouldIgnore) that control warning emission and whether
26707 the invocation should be made, or ignored.
26709 * expression.cs (Invocation.Emit): Remove previous hack, we should
26710 not do this on matching a base type, we should do this based on an attribute
26712 Only emit calls to System.Diagnostics.Debug and
26713 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
26714 on the command line.
26716 * rootcontext.cs: Global settings for tracing and debugging.
26718 * cs-tokenizer.cs (define): New utility function to track
26719 defines. Set the global settings for TRACE and DEBUG if found.
26721 2002-05-25 Ravi Pratap <ravi@ximian.com>
26723 * interface.cs (Populate*): Pass in the TypeContainer as well as
26724 the DeclSpace as parameters so that we can create EmitContexts and
26725 then use that to apply attributes etc.
26727 (PopulateMethod, PopulateEvent, PopulateProperty)
26728 (PopulateIndexer): Apply attributes everywhere.
26730 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
26733 (ApplyAttributes): Update accordingly.
26735 We now apply interface attributes for all members too.
26737 2002-05-26 Miguel de Icaza <miguel@ximian.com>
26739 * class.cs (Indexer.Define); Correctly check if we are explicit
26740 implementation (instead of checking the Name for a ".", we
26741 directly look up if the InterfaceType was specified).
26743 Delay the creation of the PropertyBuilder.
26745 Only create the PropertyBuilder if we are not an explicit
26746 interface implementation. This means that explicit interface
26747 implementation members do not participate in regular function
26748 lookups, and hence fixes another major ambiguity problem in
26749 overload resolution (that was the visible effect).
26751 (DefineMethod): Return whether we are doing an interface
26754 * typemanager.cs: Temporary hack until we get attributes in
26755 interfaces (Ravi is working on that) and we get IndexerName
26756 support in interfaces.
26758 * interface.cs: Register the indexers as properties.
26760 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
26761 warning, I have verified that this is a bug in the .NET runtime
26762 (JavaScript suffers of the same problem).
26764 * typemanager.cs (MemberLookup): When looking up members for
26765 interfaces, the parent of an interface is the implicit
26766 System.Object (so we succeed in searches of Object methods in an
26767 interface method invocation. Example: IEnumerable x; x.ToString
26770 2002-05-25 Miguel de Icaza <miguel@ximian.com>
26772 * class.cs (Event): Events should also register if they do
26773 implement the methods that an interface requires.
26775 * typemanager.cs (MemberLookup); use the new GetInterfaces
26778 (GetInterfaces): The code used to lookup interfaces for a type is
26779 used in more than one place, factor it here.
26781 * driver.cs: Track the errors at the bottom of the file, we kept
26784 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
26785 instance if the method we are calling is static!
26787 2002-05-24 Miguel de Icaza <miguel@ximian.com>
26789 * attribute.cs (ApplyAttributes): Make this function filter out
26790 the IndexerName attribute (as that attribute in reality is never
26791 applied) and return the string constant for the IndexerName
26794 * class.cs (TypeContainer.Emit): Validate that all the indexers
26795 have the same IndexerName attribute, and if so, set the
26796 DefaultName attribute on the class.
26798 * typemanager.cs: The return value might contain other stuff (not
26799 only methods). For instance, consider a method with an "Item"
26800 property and an Item method.
26802 * class.cs: If there is a problem with the parameter types,
26805 2002-05-24 Ravi Pratap <ravi@ximian.com>
26807 * ecore.cs (ImplicitConversionExists): Wrapper function which also
26808 looks at user defined conversion after making a call to
26809 StandardConversionExists - we need this for overload resolution.
26811 * expression.cs : Update accordingly the various method calls.
26813 This fixes 2 bugs filed against implicit user defined conversions
26815 2002-05-22 Miguel de Icaza <miguel@ximian.com>
26817 * statement.cs: Track the result of the assignment.
26819 2002-05-21 Miguel de Icaza <miguel@ximian.com>
26821 * expression.cs (MemberAccess): Improved error reporting for
26822 inaccessible members.
26824 2002-05-22 Martin Baulig <martin@gnome.org>
26826 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
26827 itself with debugging support.
26829 2002-05-22 Martin Baulig <martin@gnome.org>
26831 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
26832 Removed, this isn't needed anymore.
26834 2002-05-20 Martin Baulig <martin@gnome.org>
26836 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
26837 be underlying type for an enum.
26839 2002-05-20 Miguel de Icaza <miguel@ximian.com>
26841 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
26842 that splits out the loading of just the core types.
26844 * rootcontext.cs (ResolveCore): Split the struct resolution in
26845 two, so we can load the enumeration underlying types before any
26848 * expression.cs (Is): Bandaid until we fix properly Switch (see
26849 bug #24985 for details).
26851 * typemanager.cs (ImplementsInterface): The hashtable will contain
26852 a null if there are no interfaces implemented.
26854 2002-05-18 Miguel de Icaza <miguel@ximian.com>
26856 * cs-parser.jay (indexer_declarator): It is fine to have array
26859 2002-05-17 Miguel de Icaza <miguel@ximian.com>
26861 * typemanager.cs: (RegisterBuilder): New function used to register
26862 TypeBuilders that implement interfaces. Since
26863 TypeBuilder.GetInterfaces (as usual) does not work with lame
26865 (AddUserType): register interfaces.
26867 (ImplementsInterface): Use the builder_to_ifaces hash if we are
26868 dealing with TypeBuilder. Also, arrays are showing up as
26869 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
26870 methods can not be invoked on them!
26872 * ecore.cs (ExplicitReferenceConversionExists): Made public.
26873 (ImplicitReferenceConversionExists): Split out from
26874 StandardConversionExists.
26876 * expression.cs (As): We were only implementing one of the three
26877 cases for the as operator. We now implement them all.
26878 (Is): Implement the various other cases for Is as well.
26880 * typemanager.cs (CACHE): New define used to control if we want or
26881 not the FindMembers cache. Seems to have a negative impact on
26882 performance currently
26884 (MemberLookup): Nested types have full acess to
26885 enclosing type members
26887 Remove code that coped with instance/static returns for events, we
26888 now catch this in RealFindMembers.
26890 (RealFindMembers): only perform static lookup if the instance
26891 lookup did not return a type or an event.
26893 2002-05-17 Miguel de Icaza <miguel@ximian.com>
26895 * assign.cs (CompoundAssign): We pass more semantic information
26896 now to Compound Assignments than we did before: now we have all
26897 the information at hand, and now we resolve the target *before* we
26898 do the expression expansion, which allows the "CacheValue" method
26899 to have the effect we intended (before, a [x] += 1 would generate
26900 two differen ArrayAccess expressions from the ElementAccess,
26901 during the resolution process).
26903 (CompoundAssign.DoResolve): Resolve target and original_source here.
26905 2002-05-16 Miguel de Icaza <miguel@ximian.com>
26907 * expression.cs (ArrayAccess): dropped debugging information.
26909 * typemanager.cs: Small bug fix: I was always returning i_members,
26910 instead of one of i_members or s_members (depending on which had
26913 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
26914 method is invoked before any code generation takes place, and it
26915 is a mechanism to inform that the expression will be invoked more
26916 than once, and that the method should use temporary values to
26917 avoid having side effects
26919 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
26921 * ecore.cs (Expression.CacheTemporaries): Provide empty default
26924 * expression.cs (Indirection, ArrayAccess): Add support for
26925 CacheTemporaries in these two bad boys.
26927 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
26928 ldobj or ldind_ref.
26929 (StoreFromPtr): Handle stobj as well.
26931 * expression.cs (UnaryMutator): Share more code.
26933 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
26934 down: I was not tracking the Filter function as well, which
26935 was affecting the results of the cache.
26937 2002-05-15 Miguel de Icaza <miguel@ximian.com>
26939 * attribute.cs: Remove the hack to handle the CharSet property on
26942 2002-05-14 Miguel de Icaza <miguel@ximian.com>
26944 * attribute.cs (DoResolve): More uglyness, we now only try to
26945 resolve the attribute partially, to extract the CharSet
26946 information (only if we are a StructLayout attribute). Otherwise
26948 (GetExtraTypeInfo): Add some code to conditionally kill in the
26949 future this. I am more and more convinced that the .NET
26950 framework has special code to handle the attribute setting on
26953 * expression.cs (IsParamsMethodApplicable): Revert my previous
26954 foreach change here, it was wrong.
26956 2002-05-13 Miguel de Icaza <miguel@ximian.com>
26958 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
26959 (pp_expr): do not abort on unknown input, just return.
26960 (eval): abort if there are pending chars.
26962 * attribute.cs (Attribute.Resolve): Positional parameters are
26963 optional. Deal with that case.
26965 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
26966 the Ansi/Unicode/Auto information for the type.
26968 (TypeContainer.DefineType): instantiate the EmitContext here, as
26969 we will be using it during the type definition (to resolve
26970 attributes) and during the emit phase.
26972 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
26973 to pull type information out of the attributes
26975 (Attribute.Resolve): track the constructor builder, and allow for
26976 multiple invocations (structs and classes will use this).
26978 * ecore.cs (MemberLookupFinal): new version with all the
26979 parameters customizable.
26981 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
26982 constructors. Return if the result value is null (as the error
26983 would have been flagged already by MemberLookupFinal)
26985 Do not allow instances of abstract classes or interfaces to be
26988 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
26989 We have to compare the assembly property here when dealing with
26990 FamANDAssem and Assembly access modifiers, because we might be
26991 creating an assembly from *modules* (that means that we are not
26992 getting TypeBuilders for types defined in other modules that are
26993 part of this assembly).
26995 (Method.Emit): If the method is marked abstract and has a body,
26998 (TypeContainer.DefineMembers): If both the defined member and the
26999 parent name match are methods, then do not emit any warnings: let
27000 the Method.Define routine take care of flagging warnings. But if
27001 there is a mismatch (method overrides something else, or method is
27002 overriwritten by something, then emit warning).
27004 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
27005 set to null, this means `do not check for the return type on the
27008 (Method.Define): set the return type for the method signature to
27009 null, so that we get methods with the same name and parameters and
27010 different return types. This is used to flag warning 114 (you are
27011 hiding a method, and you probably want to use the new/override
27014 * typemanager.cs (MemberLookup): Implemented proper access
27015 control, closing a long standing set of bug reports. The problem
27016 was that the Framework only has two bits: Public and NonPublic,
27017 and NonPublic includes private and protected methods, but we need
27018 to enforce the FamANDAssem, FamOrAssem and Family.
27020 2002-05-11 Miguel de Icaza <miguel@ximian.com>
27022 * statement.cs (GotoCase): Return true: Ammounts to giving up
27023 knowledge on whether we return or not, and letting the other case
27024 be responsible for it.
27026 2002-05-10 Miguel de Icaza <miguel@ximian.com>
27028 * driver.cs: Do not load directories for each file processed, only
27029 do it if there is a pattern.
27031 * ecore.cs: Report readonly assigns here as well, as we might have
27032 been resolved only by MemberAccess.
27034 (SimpleName.SimpleNameResolve): Also be useful for LValue
27035 resolution. We need this to propagate assign to local readonly variables
27037 * typemanager.cs: Use a ptrhashtable for the criteria, because we
27038 do not want to reuse potential criteria memory.
27040 * class.cs (MyEventBuilder): Set reflected_type;
27042 * ecore.cs (Constantify): Added support for constifying bools.
27044 (RootContext.LookupType): Added a cache for values looked up in
27045 the declaration space.
27047 * typemanager.cs (FindMembers): Now is a front-end to
27048 RealFindMembers, and provides a two-level hashtable-based cache to
27051 15% performance improvement: from 22.5 to 19.2 seconds.
27053 * expression.cs (IsParamsMethodApplicable): use foreach.
27054 (Invocation.DoResolve): ditto.
27055 (New.DoResolve): ditto.
27056 (ArrayCreation.DoResolve): ditto.
27058 * ecore.cs (FindMostEncompassingType): use foreach.
27060 * delegate.cs (NewDelegate.DoResolve): Use foreach
27062 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
27063 (RemoveMethods): use foreach.
27065 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
27066 nested foreach statements instead of for, and also break out of
27067 the inner loop once a match is found.
27069 (Invocation.OverloadResolve): Use foreach, simplify the code.
27071 2002-05-08 Miguel de Icaza <miguel@ximian.com>
27073 * cfold.cs (BinaryFold): During an enumeration evaluation context,
27074 we actually unwrap the expression to allow for extra information
27077 * expression.cs: Use Shr_Un on unsigned operations.
27079 2002-05-08 Ravi Pratap <ravi@ximian.com>
27081 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
27082 applicable operators was not being considered correctly. This closes
27083 the bug Miguel reported.
27085 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
27087 * attribute.cs: check that the type derives from System.Attribute
27088 and report the correct error in that case (moved the duplicate code to
27089 its own method, too).
27091 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
27093 * attribute.cs: lookup attribute type name as the spec says: first the
27094 bare attribute name and then name + "Attribute" (nant compiles with
27095 mcs after this fix).
27097 2002-05-07 Miguel de Icaza <miguel@ximian.com>
27099 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
27100 Because of the way we parse things, we should try to see if a
27101 UIntConstant can fit in an integer.
27103 2002-05-07 Ravi Pratap <ravi@ximian.com>
27105 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
27106 when we are in an explicit context.
27108 (ConvertReferenceExplicit): When converting from Iface type S to Class
27109 T make sure the rules are implemented as an OR.
27111 * parameter.cs (ParameterType): Make it a property for now although the
27112 purpose really isn't anything immediate.
27114 * expression.cs (Is*Applicable): Do better checking on the parameter type
27115 of a ref/out parameter. The ones from the system assemblies are already
27116 marked with the correct type so we don't need to do any correction.
27118 * ecore.cs (StandardConversionExists): Conversion from Interface types to
27119 the object type is standard too so include that.
27121 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27123 * ecore.cs (StandardConversionExists): Augment with missing code:
27124 deal with IntConstant, LongConstants and Enumerations.
27126 * assign.cs: Report the error, instead of failing silently
27128 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
27129 typecontainer that they are declared, because the
27130 typecontainer/namespace will have the list of using clauses that
27131 need to be applied.
27133 Assembly Attributes were escaping the normal registration
27136 (EmitCode): Apply attributes within an EmitContext that represents
27137 the container they were declared on.
27139 * cs-parser.jay: Track bases for structs. How did I get this wrong?
27141 2002-05-06 Ravi Pratap <ravi@ximian.com>
27143 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
27144 Revamp completely - make much cleaner as we now operate only
27147 (FindMostSpecificSource, FindMostSpecificTarget): New methods
27148 to implement the logic detailed in the spec more correctly.
27150 (UserDefinedConversion): Update accordingly.
27152 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27154 * statement.cs: Return flow analysis information up.
27156 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
27159 (token): Do not consume an extra character before calling
27162 2002-05-06 Piers Haken <piersh@friskit.com>
27164 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
27166 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27168 * class.cs (Constructor.Emit): Set the IsStatic flag in the
27169 EmitContext during the instance constructor initializer
27170 resolution, to stop access to instance variables.
27172 This is mandated by the spec, last paragraph of the `constructor
27173 initializers' section.
27175 2002-05-05 Miguel de Icaza <miguel@ximian.com>
27177 * cs-parser.jay, class.cs (Accessor): new class used to represent
27178 an accessor (get or set). In the past we used `null' to represent
27179 a missing accessor. But this is ambiguous because there was no
27180 way to tell in abstract indexers/properties if one of them was
27183 Now there is a way of addressing that.
27185 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
27186 instead of FindMembers.
27188 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
27189 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
27191 * attribute.cs: Treat indexers and properties as the same in terms
27192 of applying attributes
27194 * ecore.cs (FindMostEncompassedType): Use statically initialized
27195 EmptyExpressions()s like we do elsewhere to avoid creating useless
27196 objects (and we take this out of the tight loop).
27198 (GetConversionOperators): Move the code to extract the actual
27199 operators to a separate routine to clean things up.
27201 2002-05-04 Miguel de Icaza <miguel@ximian.com>
27203 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
27204 events are always registered FieldBuilders.
27206 * class.cs (FieldBase): New class shared by Fields
27208 * delegate.cs: If we are a toplevel delegate, use our full name.
27209 If we are a nested delegate, then only use our tail name.
27211 2002-05-02 Ravi Pratap <ravi@ximian.com>
27213 * expression.cs (IsApplicable): Ensure that we add the "&" to
27214 ref/out types before comparing it with the type of the argument.
27216 (IsParamsMethodApplicable): Ditto.
27218 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
27221 * delegate.cs : Handle the case when we have more than one applicable
27222 method. Flag an error only when we finish checking all.
27224 2002-05-02 Miguel de Icaza <miguel@ximian.com>
27226 * expression.cs: Add support for boolean static initializers.
27228 2002-05-01 Miguel de Icaza <miguel@ximian.com>
27230 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
27232 * parameter.cs (ComputeParameterTypes,
27233 ComputeAndDefineParameterTypes): Better error handling: now we
27234 clear the `types' cache if we fail during any of the type lookups.
27235 We also return the status code correctly to our caller
27237 * delegate.cs: If we fail to define a delegate, abort the extra
27240 * expression.cs (Binary.ResolveOperator): for
27241 operator==(object,object) and operator !=(object, object) we also
27242 have to verify that there is an implicit conversion from one to
27245 (ArrayAccess.DoResolve): Array Access can operate on
27248 2002-04-30 Miguel de Icaza <miguel@ximian.com>
27250 * assign.cs (CompoundAssign): A new class used as a "flag" that
27251 the assignment actually is happening as part of a compound
27252 assignment operator.
27254 During compound assignment, a few new rules exist to enable things
27261 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
27262 to the type of x) if y is implicitly convertible to the type of x,
27263 and the operator is a builtin operator and the return type of the
27264 operator is explicitly convertible to the type of x.
27266 * rootcontext.cs: Reset warning level to 2. 4 catches various
27267 "interesting" features in mcs, we must clean this up at some
27268 point, but currently am trying to kill other bugs ;-)
27270 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
27271 in container classes as well.
27273 * expression.cs (Binary.ResolveOperator): Handle string case
27274 before anything else (as operator overloading does emit an error
27275 before doing anything else).
27277 This code could go away when we move to a table driven model, but
27278 i could not come up with a good plan last night.
27280 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
27282 * typemanager.cs (CSharpName): reimplementation using regex.
27283 * class.cs: added null check for fields in Emit
27284 * rootcontext.cs: set warninglevel to 4
27286 2002-04-29 Miguel de Icaza <miguel@ximian.com>
27288 * typemanager.cs (CSharpName): reimplemented with Lupus
27291 2002-04-28 Miguel de Icaza <miguel@ximian.com>
27293 * statement.cs (If): correclty implement Resolve, because we were
27294 not catching sem errors in there. The same process is needed
27296 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
27299 (Statement.Warning_DeadCodeFound): Factorize code.
27300 (While): Report dead code here too.
27302 (Statement): Added Resolve virtual method to allow
27303 for resolution split from the emit code.
27305 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27307 * statement.cs (EmitBoolExpression): No longer try to resolve the
27309 (MakeBoolean): New utility function that resolve, implicitly
27310 converts to boolean and tags the expression.
27313 (If, Do): Implement dead code elimination.
27314 (While): Implement loop inversion
27316 (Do, While, For, If): Resolve the expression prior to calling our
27319 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
27322 - added method Report28 (warning: program has more than one entry point)
27323 - added method IsEntryPoint, implements paragraph 10.1 of the spec
27324 - modified method Method.Define, the part at the end of the method
27326 * rootcontext.cs: added static public Location EntryPointLocation;
27328 * ../errors/cs0028.cs : Add test case for the above warning.
27331 - modified method CSharpName to allow arrays of primitive type to
27332 be printed nicely (e.g. instead of System.Int32[][] it now prints
27334 - added method CSharpSignature: returns the signature of a method
27335 in string format to be used in reporting errors, warnings, etc.
27337 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
27340 2002-04-26 Ravi Pratap <ravi@ximian.com>
27342 * delegate.cs (Define): Fix extremely silly bug where I was
27343 setting the type of the 'object' parameter of the BeginInvoke
27344 method to System.IAsyncResult instead of System.Object ;-)
27346 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27348 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
27351 (Constructor.Emit): return if we fail to initialize the
27352 constructor. Another door closed!
27354 * expression.cs (New.DoResolve): Improve error message (from -6 to
27355 1501). Use DeclaredOnly lookup to find the exact constructor.
27357 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
27358 loop. This is useful.
27360 * cs-parser.jay: Adjust the default parameters so that destructors
27361 have the proper signature.
27363 2002-04-26 Martin Baulig <martin@gnome.org>
27365 * driver.cs (LoadAssembly): If `assembly' contains any characters
27366 which are only valid in path names and not in assembly names
27367 (currently slash, backslash and point), use Assembly.LoadFrom ()
27368 instead of Assembly.Load () on the `assembly' (before iteration
27369 over the link_paths).
27371 2002-04-26 Martin Baulig <martin@gnome.org>
27373 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
27375 2002-04-25 Miguel de Icaza <miguel@ximian.com>
27377 * class.cs (Property): use the new typemanager.MemberLookup
27379 (TypeContainer.MemberLookup): Implement using the
27380 TypeManager.MemberLookup now.
27382 * typemanager.cs: Make MemberLookup a function of the TypeManager,
27383 and return MemberInfos, so that these can be used without an
27384 EmitContext (what we had before).
27386 2002-04-24 Miguel de Icaza <miguel@ximian.com>
27388 * expression.cs: Fix the case where the argument to params if the
27389 type of the params. I omitted handling this before. Fixed
27391 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27393 * driver.cs: Call BootCorlib_PopulateCoreType
27395 * class.cs (Property.CheckBase): Check for properties only, not
27398 * interface.cs: Temporary hack: try/catch around the
27399 CustomAttributeBuilder, because I am getting an exception that I
27402 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
27403 types whose definitions are required to be there (attributes are
27404 defined before standard types).
27406 Compute definitions as we boot the various types, as they are used
27407 immediately (value_type class will need object_type, but if we do
27408 not initialize object_type, we will pass a null, which will let
27409 the runtime pick the System.Object from the existing corlib, which
27410 is not what we want).
27412 2002-04-22 Patrik Torstensson <totte@labs2.com>
27414 * cs-tokenizer.cs: fixed a number of trim() issues.
27416 2002-04-22 Ravi Pratap <ravi@ximian.com>
27418 * expression.cs (Argument.Type): Ensure that we return the correct
27419 type when we have out or ref parameters [in which case we
27422 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27424 * class.cs (Property, Indexer): Allow extern modifier in there.
27426 * typemanager.cs (InitBaseTypes): Initializes object_type and
27427 value_type, since those will be used early on during the bootstrap
27428 process to compile corlib.
27430 (InitCoreTypes): Move code from here to InitBaseTypes.
27432 2002-04-21 Miguel de Icaza <miguel@ximian.com>
27434 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
27435 single-dimension arrays as using the ldlen opcode.
27437 Daniel Lewis discovered this optimization.
27439 * typemanager.cs: Add signature for System.Array::get_Length
27441 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27443 * statement.cs: report the error when the foreach does not apply to an
27444 array nor a collection.
27446 2002-04-19 Miguel de Icaza <miguel@ximian.com>
27448 * expression.cs: Add implicit conversions to the operator ~.
27450 * constant.cs (DecimalConstant.Emit): Emit decimal value.
27452 * typemanager.cs: Locate the decimal constructor.
27454 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27456 * attribute.cs: use the new property of TypeOf.
27457 * expression.cs: added 'get' property around typearg.
27459 These changes fix a build breaker reported by NickD. Is this the
27460 correct way to fix? If not, please, revert my changes and make it
27463 2002-04-17 Miguel de Icaza <miguel@ximian.com>
27465 * attribute.cs: Add support for typeof in attribute invocations.
27466 I am not sure that this is right though.
27468 2002-04-14 Duncan Mak <duncan@ximian.com>
27470 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
27471 Binary.Operator.Division case.
27473 2002-04-13 Ravi Pratap <ravi@ximian.com>
27475 * class.cs (DefineType): Ensure that we do a proper check on
27476 attribute types and also register it with the TypeManager.
27478 (TypeContainer.Targets): The default for attribute types is
27479 AttributeTargets.All.
27481 * attribute.cs (ApplyAttributes): Registering the attribute type
27482 is done elsewhere, not when we discover we have a Usage attribute.
27484 2002-04-12 Ravi Pratap <ravi@ximian.com>
27486 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
27487 and get rid of is_delegate parameter.
27489 * everywhere : update.
27491 2002-04-12 Ravi Pratap <ravi@ximian.com>
27493 * cs-parser.jay (compilation_unit): Revamp completely to use
27494 some new ideas that I got from Rhys' grammar to solve the problems
27495 with assembly level attributes.
27497 (outer_declaration): New grammar production.
27499 (attribute_sections): Add.
27501 (opt_attributes): Base on attribute_sections
27503 (namespace_declaration): Allow opt_attributes to tackle the case
27504 when we have assembly level attributes - we are clever in this
27507 * attribute.cs (ApplyAttributes): Do not worry about assembly
27508 attributes in the non-global context.
27510 * rootcontext.cs (AddGlobalAttributes): Go back to using this
27511 instead of SetGlobalAttributes.
27513 * class.cs, rootcontext.cs : Ensure we define and generate
27514 attribute types before anything else.
27516 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
27517 and flag the new error -20 for the case when the attribute type
27518 does not have valid targets specified. csc does not catch this.
27520 * ../errors/errors.txt : update for error # -20
27522 2002-04-11 Ravi Pratap <ravi@ximian.com>
27524 * support.cs (InternalParameters.ParameterModifier): Do some null
27525 checking and return sane values.
27527 * class.cs (Method.Define): If we are a PInvoke method, ensure
27528 that we are static and extern. Report error # 601
27530 * ../errors/cs0601.cs : Add test case for the above error.
27532 2002-04-07 Ravi Pratap <ravi@ximian.com>
27534 * rootcontext.cs (attribute_types): We need to keep type of
27535 all attribute types separately and emit code for them first.
27537 (RegisterAttribute) : Implement.
27539 * class.cs (DefineType): Check if the current Type is a custom
27540 attribute type and register it accordingly.
27542 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
27543 adding the first attribute twice and rename to
27545 (SetGlobalAttributes): this.
27547 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
27550 * attribute.cs (ApplyAttributes): Take an additional argument telling us
27551 if we are processing global arguments. Hmm, I am unsure of this.
27553 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27555 * expression.cs: added static array of strings to avoid calling
27556 Enum.ToString () for Operator in Binary. Significant recover of
27559 2002-04-10 Miguel de Icaza <miguel@ximian.com>
27561 * class.cs (FindMembers): Allow the Builders of the various
27562 members to be null. If they are skip them. This only happens
27563 during the PInvoke declaration.
27565 2002-04-09 Miguel de Icaza <miguel@ximian.com>
27567 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
27568 failure, so we do not keep going afterwards.
27570 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
27571 wanted to pass `false' as the `is_delegate' argument. If this is
27572 the case, why not use delegate_type == null to mean `is_delegate =
27573 false' and anything else as is_delegate = true.
27575 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
27577 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
27578 code for the section, not the beginning of the tests.
27580 2002-04-08 Miguel de Icaza <miguel@ximian.com>
27582 * cfold.cs: Handle operator + (Enum x, Underlying x)
27584 * expression.cs (Binary): same. Warn about errors where we have
27585 Enum/Enum in operator + as well.
27587 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
27590 - added support for switch(bool)
27591 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
27592 - add TableSwitchEmit() to handle table-based switch statements
27594 2002-04-05 Ravi Pratap <ravi@ximian.com>
27596 * expression.cs (Invocation.OverloadResolve): Factor out code which
27597 does parameter compatibility checking with arguments so that we can
27598 re-use the code even from Delegate.VerifyApplicability
27600 (VerifyArgumentsCompat): Move above code here.
27602 * delegate.cs (VerifyApplicability): Get rid of duplicate code
27603 and instead make a call to the above method.
27605 2002-03-31 Ravi Pratap <ravi@ximian.com>
27607 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
27608 We use it to keep track of classes which are attribute types.
27610 2002-04-02 Miguel de Icaza <miguel@ximian.com>
27612 * delegate.cs (Delegate.Define): Correctly define the types in the
27613 presence of fixed and array parameters.
27615 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
27618 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
27619 include NonPublic after the first iteration.
27621 * class.cs (Indexer.CheckBase): Only check if both parents are
27624 * cs-parser.jay (accessor_body): If empty, set to null.
27626 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
27627 same code path here to resolve constants names that we did have in
27628 MemberAccess.DoResolve. There is too much code duplicated here.
27630 2002-04-01 Miguel de Icaza <miguel@ximian.com>
27632 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
27634 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
27637 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
27638 tokens, numbers and strings.
27640 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
27643 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
27644 asyncronous parameters and the regular parameters.
27646 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
27647 specify the target directory.
27649 * expression.cs: (This.DoResolve): Simplify
27650 (As.Emit): Optimize, do not generate IsInst if the expression is
27651 always of the given type.
27653 (Is.DoResolve): Bug fix, we were reporting both always/never for
27656 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
27657 creating too many unnecessary arrays.
27659 2002-03-31 Miguel de Icaza <miguel@ximian.com>
27661 * class.cs (EmitFieldInitializer): Use Assign expression to assign
27662 fields instead of rolling our own initializer. Takes care of all
27663 implicit conversions, and drops unnecessary static checks/argument.
27665 2002-03-31 Dick Porter <dick@ximian.com>
27667 * driver.cs: use the GetDirectories() return values properly, and
27668 use "/" as path separator.
27670 2002-03-30 Miguel de Icaza <miguel@ximian.com>
27672 * expression.cs (Unary): Optimize - - expr into expr.
27673 (Binary): Optimize a + (-b) into a -b.
27675 * codegen.cs (CodeGen): Made all methods static.
27677 2002-03-29 Miguel de Icaza <miguel@ximian.com>
27681 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
27682 TypeBuilder property.
27684 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
27687 * tree.cs: Removed the various RecordXXXX, and replaced with a
27688 single RecordDecl. Removed all the accessor methods, and just
27689 left a single access point Type
27691 * enum.cs: Rename DefineEnum to DefineType.
27693 * decl.cs: New abstract method `DefineType' used to unify the
27694 Defines for Enumerations, Interfaces, TypeContainers and
27697 (FindType): Moved LookupInterfaceOrClass here. Moved the
27698 LookupBaseClasses method that used to live in class.cs and
27699 interface.cs here, and renamed to FindType.
27701 * delegate.cs: Implement DefineType. Take advantage of the
27702 refactored pattern for locating the parent builder without taking
27703 the parent_builder argument (which we know does not work if we are
27704 nested, and triggering a toplevel definition).
27706 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27708 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
27709 accessibility of a member has changed during override and report
27712 * class.cs (Method.Define, Property.Define): Only complain on
27713 overrides if the method is private, any other accessibility is
27714 fine (and since we just checked the permission is the same, we are
27717 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
27718 and elif are processed always. The other pre-processing
27719 directives are only processed if we are "taking" the path
27721 2002-03-29 Martin Baulig <martin@gnome.org>
27723 * class.cs (Method.Emit): Only emit symbolic debugging info if the
27724 current location is not Null.
27726 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
27727 a separate method so we can profile it.
27729 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
27730 `span.Seconds' are just seconds, but no minutes or hours.
27731 (MainDriver): Profile the CodeGen.SaveSymbols calls.
27733 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27735 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
27736 Remove the gratuitous set of Final:
27738 // If an interface implementation, then we can set Final.
27739 if (((flags & MethodAttributes.Abstract) == 0) &&
27740 implementing.DeclaringType.IsInterface)
27741 flags |= MethodAttributes.Final;
27743 I do not know what I was smoking when I used that.
27746 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
27747 step into fixing the name resolution issues for delegates and
27748 unifying the toplevel name resolution.
27750 2002-03-28 Martin Baulig <martin@gnome.org>
27752 * class.cs (Method.Emit): If we have a symbol writer, call its
27753 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
27754 tell it about the current method.
27756 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
27757 writer that we're going to emit the first byte of IL code for a new
27758 statement (a new source line).
27759 (EmitContext.EmitTopBlock): If we have a symbol writer, call
27760 EmitContext.Mark() before emitting any code.
27762 * location.cs (SymbolDocument): Return null when we're Null.
27764 * statement.cs (Statement): Moved the `Location loc' variable here.
27765 (Statement.EmitBoolExpression): If we have a symbol writer, call
27766 ec.Mark() before emitting any code to tell it that we're at the
27767 beginning of a new statement.
27768 (StatementExpression): Added `Location' argument to the constructor.
27769 (Block): Added public readonly variable `StartLocation' and public
27770 variable `EndLocation'. The latter is to be set using SetEndLocation().
27771 (Block): Added constructor which takes a start and end location.
27772 (Block.SetEndLocation): New method. This sets the end location.
27773 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
27774 local variables we create.
27775 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
27776 each statement and do also mark the begin and end of the block.
27778 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
27779 tell it the current lexer.Location, use Location.Null for the end of the
27781 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
27782 current block, set its end location using SetEndLocation().
27783 (statement_expression): StatementExpression constructor now takes the
27784 lexer.Location as additional argument.
27785 (for_statement, declare_local_variables): Likewise.
27786 (declare_local_variables): When creating a new implicit block, use the
27787 new Block constructor and pass it the lexer.Location.
27789 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27791 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
27792 members also on the parent interfaces recursively.
27794 2002-03-27 Miguel de Icaza <miguel@ximian.com>
27796 * report.cs: Use new formats, since Gonzalo finished the missing
27799 * expression.cs (Binary.ResolveOperator): added missing operator|
27800 operator& and operator^ for bool/bool.
27802 * cs-parser.jay: CheckDef now takes a Location argument that is
27803 used to report errors more precisly (instead of reporting the end
27804 of a definition, we try to track something which is a lot closer
27805 to the source of the problem).
27807 * cs-tokenizer.cs: Track global token use, so we can properly flag
27808 the use of #define/#undef after the first token has been seen.
27810 Also, rename the reportXXXX to Error_DescriptiveName
27812 * decl.cs (DeclSpace.IsTopLevel): Move property here from
27813 TypeContainer, so that Enum and Interface can use this too.
27815 * class.cs (TypeContainer.LookupInterfaceOrClass,
27816 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
27817 `builder' argument. Typically this was used to pass the parent
27818 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
27821 The problem is that a nested class could trigger the definition of
27822 a toplevel class, and the builder would be obviously wrong in that
27825 So we drop this argument, and we compute dynamically the
27826 TypeBuilder/ModuleBuilder (the correct information was available
27827 to us anyways from DeclSpace.Parent)
27829 * interface.cs (Interface.DefineInterface): Drop builder
27830 parameter cleanup like class.cs
27832 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
27835 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
27838 (Try.Emit): Propagate the returns value from the statement.
27840 (Return.Emit): Even if we are leavning
27842 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
27844 * modifiers.cs: Fix the computation of MethodAttributes flags.
27846 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
27848 * driver.cs: allow compilation of files that start with '/'.
27849 Add a default case when checking the argument of --target.
27851 2002-03-25 Miguel de Icaza <miguel@ximian.com>
27853 * interface.cs: Implement the same search algorithm for types in
27854 the interface code.
27856 * delegate.cs: Do not allow multiple definition.
27858 * Recovered ChangeLog that got accidentally amputated
27860 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
27862 * rootcontext.cs: Load manually enum to allow core classes to
27863 contain enumerations.
27865 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
27866 Update to new static methods in TypeManager.
27868 * typemanager.cs (GetMethod, GetConstructor): Use our
27869 implementation of FindMembers to find the members, since during
27870 corlib compilation, the types are TypeBuilders and GetMethod and
27871 GetConstructor do not work.
27873 Make all methods in TypeManager static.
27875 (InitCodeHelpers): Split the functionality from
27876 the InitCodeTypes function.
27878 * driver.cs: Call InitCodeHelpers after we have populated the
27881 * cs-parser.jay (delegate_declaration): we did not used to compute
27882 the delegate name correctly for void delegates.
27884 2002-03-24 Miguel de Icaza <miguel@ximian.com>
27886 * rootcontext.cs (RootContext): Init the interface_resolve_order
27887 and type_container_resolve_order always.
27889 (ResolveCore, BootstrapCorlib_ResolveClass,
27890 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
27891 compiler when compiling with --nostdlib
27893 * class.cs (TypeContainer.DefineType): Check that our parent is
27894 not null. This test is most important when we are bootstraping
27897 * codegen.cs: Split out the symbol writing code.
27899 2002-03-25 Martin Baulig <martin@gnome.org>
27901 * driver.cs (-g): Made -g an alias for --debug.
27903 2002-03-24 Martin Baulig <martin@gnome.org>
27905 * codegen.cs (SymbolWriter): New public variable. Returns the
27906 current symbol writer.
27907 (CodeGen): Added `bool want_debugging_support' argument to the
27908 constructor. If true, tell the ModuleBuild that we want debugging
27909 support and ask it for the ISymbolWriter.
27910 (Save): If we have a symbol writer, call it's Close() method after
27911 saving the assembly.
27913 * driver.c (--debug): New command line argument to create a
27914 debugger information file.
27916 * location.cs (SymbolDocument): New public property. Returns an
27917 ISymbolDocumentWriter object for the current source file or null
27918 if we don't have a symbol writer.
27920 2002-03-21 Miguel de Icaza <miguel@ximian.com>
27922 * driver.cs (LoadAssembly): Correctly return when all the paths
27923 have been tried and not before.
27925 * statement.cs (Switch.Emit): return the actual coverage for this
27926 statement (returns/not-returns)
27928 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
27929 switch of the statement if we are the last switch section. That
27930 kills two problems: try/catch problems (we used to emit an empty
27931 nop at the end) and switch statements where all branches would
27934 2002-03-19 Miguel de Icaza <miguel@ximian.com>
27936 * driver.cs: Add default assemblies (the equivalent to the
27937 Microsoft CSC.RSP file)
27939 * cs-tokenizer.cs: When updating `cols and setting it to zero,
27940 also update tokens_seen and set it to false.
27942 * driver.cs: Implement --recurse for Mike.
27944 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
27945 correctly splitting out the paths.
27947 2002-03-18 Miguel de Icaza <miguel@ximian.com>
27949 * interface.cs (Interface.PopulateProperty): Instead of using
27950 `parent' as the declaration space for the set parameters, use
27953 * support.cs (InternalParameters): InternalParameters constructor
27954 takes a DeclSpace instead of a TypeContainer.
27956 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
27957 types are being initialized, load the address of it before calling
27960 (New): Provide a mechanism to disable the generation of local
27961 value type temporaries when the caller will be providing us with
27962 an address to store it.
27964 (ArrayCreation.EmitDynamicInitializers): Use it.
27966 2002-03-17 Miguel de Icaza <miguel@ximian.com>
27968 * expression.cs (Invocation.EmitArguments): Only probe for array
27969 property if there is more than one argument. Sorry about that.
27971 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
27972 empty param arrays.
27974 * class.cs (Method.LabelParameters): Fix incorrect code path that
27975 prevented the `ParamArrayAttribute' from being applied to the
27978 2002-03-16 Miguel de Icaza <miguel@ximian.com>
27980 * support.cs (ReflectionParameters): Correctly compute whether the
27981 last argument is a params array. Fixes the problem with
27984 * typemanager.cs: Make the assemblies array always be non-null
27985 (empty, but non-null)
27987 * tree.cs (RecordDecl): New function that abstracts the recording
27988 of names. This reports error 101, and provides a pointer to the
27989 previous declaration. Fixes a crash in the compiler.
27991 * cs-parser.jay (constructor_declaration): Update to new grammar,
27992 and provide a constructor_body that can be empty.
27994 2002-03-15 Miguel de Icaza <miguel@ximian.com>
27996 * driver.cs: Add support for --resources.
27998 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
27999 Make all types for the various array helper methods be integer.
28001 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
28002 CheckState to ConvCast.
28004 (ConvCast): Now it takes a `checked' state argument, to avoid
28005 depending on the emit context for the conversion, and just using
28006 the resolve time setting.
28008 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
28009 instead of Invocation.EmitArguments. We do not emit the original
28010 arguments, instead we emit those which have been converted to
28011 unsigned int expressions.
28013 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
28015 * codegen.cs: ditto.
28017 * expression.cs (LocalVariableReference): Drop the use of the
28018 Store function that depended on the variable index.
28020 * statement.cs (VariableInfo): Drop the `Idx' property from this
28021 class, as this is not taking into account the indexes for
28022 temporaries tat we generate during the execution, getting the
28025 * class.cs: First emit class initializers, then call the parent
28028 * expression.cs (Binary): Fix opcode emision.
28029 (UnaryMutator.EmitCode): Support checked code generation
28031 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
28032 matches for events for both the Static and Instance scans,
28033 pointing to the same element. Fix that.
28035 2002-03-14 Miguel de Icaza <miguel@ximian.com>
28037 * rootcontext.cs (ResolveTree): Always set the
28038 interface_resolve_order, because nested interfaces will be calling
28041 * class.cs (GetInterfaceOrClass): Track the same resolution
28042 process used by TypeManager.LookupType. This fixes the nested
28043 type lookups in class declarations (separate path from
28046 (TypeContainer.DefineType): Also define nested interfaces.
28047 (TypeContainer.RegisterOrder): New public function used to
28048 register the order in which child interfaces need to be closed.
28050 Nested interfaces need to be closed after their parents have been
28053 * interface.cs (InterfaceAttr): Put all the logic for computing
28054 the interface attribute here.
28056 (DefineInterface): Register our interface order with the
28057 RootContext or with the TypeContainer depending on the case.
28059 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28061 * cs-parser.jay: rework foreach statement to work with the new
28062 changes to the policy on SimpleNames.
28064 * report.cs: support Stacktrace on warnings as well.
28066 * makefile: drop --unsafe and /unsafe from the compile.
28068 2002-03-13 Ravi Pratap <ravi@ximian.com>
28070 * ecore.cs (StandardConversionExists): Modify to take an Expression
28071 as the first parameter. Ensure we do null -> reference type conversion
28074 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
28075 temporary Expression objects.
28077 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
28079 * interface.cs: workaround bug in method overloading resolution
28080 (there is already a bugzilla bug for it).
28082 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28084 We could also solve this problem by having a separate path for
28085 performing type lookups, instead of DoResolve, we could have a
28086 ResolveType entry point, and only participating pieces of the
28087 production (simplename, deref, array) would implement this.
28089 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
28090 signal SimpleName to only resolve type names and not attempt to
28091 resolve anything else.
28093 * expression.cs (Cast): Set the flag.
28095 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
28097 * class.cs: Only report 108 if there is no `new' modifier.
28099 * cs-parser.jay: rework foreach statement to work with the new
28100 changes to the policy on SimpleNames.
28102 * report.cs: support Stacktrace on warnings as well.
28104 * makefile: drop --unsafe and /unsafe from the compile.
28106 2002-03-11 Miguel de Icaza <miguel@ximian.com>
28108 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28109 lookups here, instead of doing that at parse time. This means
28110 that our grammar will not introduce `LocalVariableReferences' as
28111 expressions at this point. That solves the problem of code like
28115 static void Main ()
28119 This is only half the fix. The full fix requires parameters to
28120 also be handled in this way.
28122 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
28123 makes the use more obvious of the DeclSpace. The
28124 ec.TypeContainer.TypeBuilder is now only used to pull the
28125 TypeBuilder for it.
28127 My theory is that I can get rid of the TypeBuilder completely from
28128 the EmitContext, and have typecasts where it is used (from
28129 DeclSpace to where it matters).
28131 The only pending problem is that the code that implements Aliases
28132 is on TypeContainer, and probably should go in DeclSpace.
28134 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28135 lookups here, instead of doing that at parse time. This means
28136 that our grammar will not introduce `LocalVariableReferences' as
28137 expressions at this point. That solves the problem of code like
28141 static void Main ()
28145 This is only half the fix. The full fix requires parameters to
28146 also be handled in this way.
28148 * class.cs (Property.DefineMethod): When implementing an interface
28149 method, set newslot, when implementing an abstract method, do not
28150 set the flag (before we tried never setting it, or always setting
28151 it, which is the difference).
28152 (Indexer.DefineMethod): same.
28153 (Method.DefineMethod): same.
28155 * ecore.cs: Only set the status used flag if we get back a Field.
28157 * attribute.cs: Temporary hack, so Paolo can keep working.
28159 2002-03-08 Ravi Pratap <ravi@ximian.com>
28161 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
28162 the unmanaged type in the case we have a MarshalAs attribute.
28164 (Resolve): Handle the case when we are parsing the special MarshalAs
28165 attribute [we need to store the unmanaged type to use later]
28167 * typemanager.cs (marshal_as_attr_type): Built in type for the
28168 MarshalAs Attribute.
28170 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
28171 on parameters and accordingly set the marshalling info.
28173 2002-03-09 Miguel de Icaza <miguel@ximian.com>
28175 * class.cs: Optimizing slightly by removing redundant code after
28176 we switched to the `NoTypes' return value.
28177 (Property.DefineMethod): use NoTypes here too.
28179 This fixes the bug I introduced in my last batch of changes.
28181 2002-03-05 Ravi Pratap <ravi@ximian.com>
28183 * tree.cs (RecordEnum): Add. We now keep track of enums too.
28185 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
28186 Enums since those are types too.
28188 * cs-parser.jay (enum_declaration): Record enums as we parse them.
28190 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
28191 thanks to a call during the lookup process.
28193 2002-03-07 Miguel de Icaza <miguel@ximian.com>
28195 * statement.cs (Foreach): Lots of work to accomodate a particular
28196 kind of foreach statement that I had not kept in mind. It is
28197 possible to have foreachs on classes that provide a GetEnumerator
28198 method that return objects that implement the "pattern" for using
28199 a foreach, there is no need to support GetEnumerator
28202 This is needed to compile nant.
28204 * decl.cs: Only report 114 if the member is not `Finalize' and if
28205 the warning level is at least 2.
28207 * class.cs: Moved the compare function from Method to
28210 (MethodSignature.InheritableMemberSignatureCompare): Add new
28211 filter function that is used to extract inheritable methods from a
28214 (Method.Define): Use the new `inheritable_method_signature_filter'
28217 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
28220 2002-03-06 Miguel de Icaza <miguel@ximian.com>
28222 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
28224 * cs-parser.jay: Add opt_semicolon to the interface declaration.
28226 * expression.cs: Pass location information to
28227 ConvertImplicitStandard.
28229 * class.cs: Added debugging code to track return values from
28232 2002-03-05 Miguel de Icaza <miguel@ximian.com>
28234 * expression.cs (Is.DoResolve): If either side of the `is' is an
28235 interface, do not flag the warning.
28237 * ecore.cs (ImplicitReferenceConversion): We need a separate test
28240 * report.cs: Allow for --fatal to be used with --probe.
28242 * typemanager.cs (NoTypes): Move the definition for the empty Type
28245 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
28247 (TypeContainer.DefineProxy): New function used to proxy to parent
28248 implementations when implementing interfaces.
28249 (TypeContainer.ParentImplements): used to lookup if our parent
28250 implements a public function that is required by an interface.
28251 (TypeContainer.VerifyPendingMethods): Hook this up.
28253 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
28254 `modules' and `assemblies' arraylists into arrays. We only grow
28255 these are the very early start up of the program, so this improves
28256 the speedof LookupType (nicely measured).
28258 * expression.cs (MakeByteBlob): Replaced unsafe code with
28259 BitConverter, as suggested by Paolo.
28261 * cfold.cs (ConstantFold.Binary): Special case: perform constant
28262 folding of string concatenation, but if either side is a string,
28263 and the other is not, then return null, and let the runtime use
28264 the concatenation on the string plus the object (using
28265 `Object.ToString').
28267 2002-03-04 Miguel de Icaza <miguel@ximian.com>
28269 Constant Folding has been implemented now.
28271 * expression.cs (Unary.Reduce): Do not throw an exception, catch
28272 the error instead on types that are not supported in one's
28275 * constant.cs (Constant and all children): New set of functions to
28276 perform implict and explicit conversions.
28278 * ecore.cs (EnumConstant): Implement the new functions to perform
28279 conversion by proxying to the child expression.
28281 * codegen.cs: (ConstantCheckState): Constant evaluation has its
28282 own separate setting that can not be turned off from the command
28283 line using --unchecked or --checked and is only controlled using
28284 the checked/unchecked statements and expressions. This setting is
28285 used by the constant folder to flag errors.
28287 * expression.cs (CheckedExpr, UncheckedExpr): Set the
28288 ConstantCheckState as well.
28290 During Resolve, they also have to flag the state, because the
28291 constant folder runs completely in the Resolve phase.
28293 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
28296 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28298 * cfold.cs: New file, this file contains the constant folder.
28300 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
28301 argument to track whether we are using the resulting address to
28302 load or store a value and provide better error messages.
28304 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
28305 new AddressOf arguments.
28307 * statement.cs (Foreach.EmitCollectionForeach): Update
28309 * expression.cs (Argument.Emit): Call AddressOf with proper
28310 arguments to track usage.
28312 (New.DoEmit): Call AddressOf with new arguments.
28314 (Unary.Emit): Adjust AddressOf call.
28316 2002-03-01 Ravi Pratap <ravi@ximian.com>
28318 * cs-parser.jay (member_access): Change the case for pre-defined types
28319 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
28322 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
28325 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
28326 essentially like methods and apply attributes like MethodImplOptions to them too.
28328 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
28331 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
28332 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
28335 * Update code everywhere accordingly.
28337 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
28339 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
28341 2002-02-28 Ravi Pratap <ravi@ximian.com>
28343 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
28344 try performing lookups against those instead of jumping straight into using
28345 the 'using' clauses.
28347 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
28349 (LookupType): Perform lookups in implicit parents too.
28351 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
28352 sequence as RootContext.LookupType.
28354 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
28355 the various cases of namespace lookups into this method.
28357 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28359 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
28360 in positional arguments)
28362 * class.cs (Operator): Update the AllowedModifiers to contain
28365 * cs-parser.jay: Update operator declaration to allow for the
28366 operator body to be empty.
28368 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
28371 2002-02-27 Miguel de Icaza <miguel@ximian.com>
28373 * class.cs (Method.Emit): Label parameters.
28375 * driver.cs: Return 1 or 0 as the program exit code.
28377 2002-02-26 Miguel de Icaza <miguel@ximian.com>
28379 * expression.cs: Special case the `null' object when trying to
28380 auto-compute the type, as anything can be explicitly converted to
28383 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
28384 spotting this Paolo.
28386 (Expression.ImplicitNumericConversion): Perform comparissions of
28387 the type using the underlying type in the case of an enumeration
28388 rather than using the enumeration type for the compare.
28390 Cope with the underlying == type case, which is not possible to
28393 (Expression.ConvertNumericExplicit): Perform comparissions of
28394 the type using the underlying type in the case of an enumeration
28395 rather than using the enumeration type for the compare.
28397 * driver.cs: If the user does not supply an extension, assume .exe
28399 * cs-parser.jay (if_statement): Rewrote so that we can track the
28400 location for the if statement.
28402 * expression.cs (Binary.ConstantFold): Only concat strings when
28403 the operation is "+", not everything ;-)
28405 * statement.cs (Statement.EmitBoolExpression): Take a location
28407 (If, While, Do): Track location.
28409 * expression.cs (Binary.ResolveOperator): In the object + string
28410 case, I was missing a call to ConvertImplicit
28412 2002-02-25 Ravi Pratap <ravi@ximian.com>
28414 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
28415 Location arguments. Ensure we use RootContext.LookupType to do our work
28416 and not try to do a direct Type.GetType and ModuleBuilder.GetType
28418 * interface.cs (PopulateMethod): Handle the type of the parameter being
28421 * expression.cs (Invocation.BetterFunction): Handle the case when we
28422 have a params method with no fixed arguments and a call is made with no
28425 2002-02-25 Miguel de Icaza <miguel@ximian.com>
28427 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
28428 the verbatim-string-literal
28430 * support.cs (InternalParameters.ParameterModifier): handle null
28432 (InternalParameters.ParameterType): ditto.
28434 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
28435 duplicating the name of the variable parameter.
28436 (GetParameterByName): Fix bug where we were not looking up array
28437 paramters if they were the only present (thanks Paolo!).
28438 (GetParameterInfo): We only have an empty set of types if both
28439 fixed and array are set to null.
28440 (GetParameterInfo-idx): Handle FixedParameter == null
28442 * cs-parser.jay: Handle the case where there is no catch
28443 statements (missing null test).
28445 2002-02-22 Miguel de Icaza <miguel@ximian.com>
28447 * driver.cs (MainDriver): Be conservative on our command line
28450 Catch DirectoryNotFoundException when calling GetFiles.
28452 (SplitPathAndPattern): Used to split the input specification into
28453 a path and a pattern that we can feed to Directory.GetFiles.
28455 2002-02-21 Miguel de Icaza <miguel@ximian.com>
28457 * statement.cs (Fixed): Implement the last case of the Fixed
28458 statement (string handling).
28460 * expression.cs (StringPtr): New class used to return a char * to
28461 a string; Used by the Fixed statement.
28463 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
28465 * expression.cs (Binary.ResolveOperator): Remove redundant
28466 MemberLookup pn parent type.
28467 Optimize union call, we do not need a union if the types are the same.
28468 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
28471 Specialize the use of MemberLookup everywhere, instead of using
28472 the default settings.
28474 (StackAlloc): Implement stackalloc keyword.
28476 * cs-parser.jay: Add rule to parse stackalloc.
28478 * driver.cs: Handle /h, /help, /?
28480 * expression.cs (MakeByteBlob): Removed the hacks we had in place
28481 before we supported unsafe code.
28483 * makefile: add --unsafe to the self compilation of mcs.
28485 2002-02-20 Miguel de Icaza <miguel@ximian.com>
28487 * expression.cs (PointerArithmetic): New class that is used to
28488 perform pointer arithmetic.
28489 (Binary.Resolve): Handle pointer arithmetic
28490 Handle pointer comparission.
28491 (ArrayPtr): Utility expression class that is used to take the
28492 address of an array.
28494 (ElementAccess): Implement array access for pointers
28496 * statement.cs (Fixed): Implement fixed statement for arrays, we
28497 are missing one more case before we are done.
28499 * expression.cs (Indirection): Implement EmitAssign and set the
28500 ExprClass to Variable. This allows pointer dereferences to be
28501 treated as variables, and to have values assigned to them.
28503 * ecore.cs (Expression.StoreFromPtr): New utility function to
28504 store values dereferencing.
28506 2002-02-20 Ravi Pratap <ravi@ximian.com>
28508 * expression.cs (Binary.ResolveOperator): Ensure that we are
28509 not trying to operate on a void type - this fixes the reported
28512 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
28513 the parent implementation is sealed.
28515 * ../errors/cs0239.cs : Add.
28517 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
28519 * typemanager.cs (unverifiable_code_type): Corresponds to
28520 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
28521 which have unsafe code in them.
28523 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
28526 2002-02-19 Miguel de Icaza <miguel@ximian.com>
28528 * cs-tokenizer.cs: Add support for @"litreal strings"
28530 Make tokenizer accept pre-processor directives
28531 on any column (remove the old C-like limitation).
28533 * rootcontext.cs (EmitCode): Emit any global attributes.
28534 (AddGlobalAttributes): Used to keep track of assembly attributes.
28536 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
28538 * cs-parser.jay: Add support for global attributes.
28540 2002-02-17 Miguel de Icaza <miguel@ximian.com>
28542 * expression.cs (Indirection): New helper class. Unary will
28543 create Indirection classes to be able to implement the
28544 IMemoryLocation interface on it.
28546 2002-02-16 Miguel de Icaza <miguel@ximian.com>
28548 * cs-parser.jay (fixed_statement): reference the right statement.
28550 * statement.cs (Fixed.Emit): Finish implementing the fixed
28551 statement for the &x case.
28553 2002-02-14 Miguel de Icaza <miguel@ximian.com>
28555 * class.cs (Property.Define, Method.Define): Remove newslot when
28558 * modifiers.cs: My use of NewSlot when `Abstract' was set was
28559 wrong. NewSlot should only be used if the `new' keyword is present.
28561 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
28562 locating our system dir. Sorry about this.
28564 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28566 * driver.cs (GetSystemDir): Compute correctly the location of our
28567 system assemblies. I was using the compiler directory instead of
28568 the library directory.
28570 2002-02-13 Ravi Pratap <ravi@ximian.com>
28572 * expression.cs (BetterFunction): Put back in what Miguel commented out
28573 since it is the correct fix. The problem is elsewhere ;-)
28575 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
28576 parameters of the parms method are themselves compatible or not !
28578 (StandardConversionExists): Fix very dangerous bug where we were forgetting
28579 to check that a class implements an interface before saying that an implicit
28580 conversion was allowed. Use ImplementsInterface to do the checking.
28582 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28584 * class.cs (Method.Define): Track whether we are an explicit
28585 implementation or not. And only call DefineMethodOverride if we
28586 are an explicit implementation.
28588 (Property.DefineMethod): Ditto.
28590 2002-02-11 Ravi Pratap <ravi@ximian.com>
28592 * expression.cs (BetterFunction): Catch hideous bug which was
28593 preventing us from detecting ambiguous calls due to implicit casts i.e
28596 2002-01-29 Miguel de Icaza <miguel@ximian.com>
28598 * support.cs (Pair): Remove un-needed method. I figured why I was
28599 getting the error in cs-parser.jay, the variable in a foreach loop
28600 is readonly, and the compiler does not really treat this as a variable.
28602 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
28603 instead of EQUALS in grammar.
28605 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
28607 * expression.cs (Unary.DoResolve): Check whether the argument is
28610 2002-01-28 Miguel de Icaza <miguel@ximian.com>
28612 * support.cs: Api for Pair to set a value. Despite the fact that
28613 the variables are public the MS C# compiler refuses to compile
28614 code that accesses the field if the variable is part of a foreach
28617 * statement.cs (Fixed): Begin implementation of the fixed
28620 (Block.AddVariable): Return the VariableInfo on success and null
28621 on failure instead of true/false.
28623 * cs-parser.jay (foreach): Catch errors on variables already
28624 defined (we were ignoring this value before) and properly unwind
28625 the block hierarchy
28627 (fixed_statement): grammar for the fixed statement.
28629 2002-01-25 Miguel de Icaza <miguel@ximian.com>
28631 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
28632 pointer types to be incretemented.
28634 (SizeOf): Implement.
28636 * cs-parser.jay (pointer_member_access): Implement
28637 expr->IDENTIFIER production.
28639 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
28640 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
28643 (Unary): Implement indirection.
28645 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
28646 use in non-unsafe context).
28648 (SimpleName.DoResolve): Check for pointers in field access on safe
28651 (Expression.LoadFromPtr): Factor the load-indirect code in this
28652 function. This was duplicated in UnboxCast and ParameterReference
28654 2002-01-24 Miguel de Icaza <miguel@ximian.com>
28656 * expression.cs (ComposedCast): report an error if a pointer cast
28657 is used in a safe region.
28659 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
28660 pointer type casts in unsafe context.
28662 * codegen.cs (EmitContext): Set up IsUnsafe.
28664 * cs-parser.jay (non_expression_type): Add productions for pointer
28667 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
28668 code. We should not use force into static mode if the method is
28669 not virtual. Fixes bug in MIS
28671 * statement.cs (Do.Emit, While.Emit, For.Emit,
28672 Statement.EmitBoolExpression): Add support to Do and While to
28673 propagate infinite loop as `I do return' semantics.
28675 Improve the For case to also test for boolean constants.
28677 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
28678 to the list of attributes we can add.
28680 Remove `EmitContext' argument.
28682 * class.cs (Method.Define): Apply parameter attributes.
28683 (Constructor.Define): Apply parameter attributes.
28684 (MethodCore.LabelParameters): Move here the core of labeling
28687 * support.cs (ReflectionParameters.ParameterModifier,
28688 InternalParameters.ParameterModifier): Use IsByRef on the type and
28689 only return the OUT bit for these parameters instead of in/out/ref
28692 This is because I miss-understood things. The ParameterInfo.IsIn
28693 and IsOut represent whether the parameter has the [In] and [Out]
28696 2002-01-22 Miguel de Icaza <miguel@ximian.com>
28698 * ecore.cs (FieldExpr.Emit): Release temporaries.
28700 * assign.cs (LocalTemporary.Release): new function.
28702 * codegen.cs (EmitContext.GetTemporaryStorage,
28703 EmitContext.FreeTemporaryStorage): Rework the way we deal with
28704 temporary storage. Now we can "put back" localbuilders when we
28707 2002-01-21 Miguel de Icaza <miguel@ximian.com>
28709 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
28710 need to make a copy of the variable to generate verifiable code.
28712 2002-01-19 Miguel de Icaza <miguel@ximian.com>
28714 * driver.cs: Compute dynamically the system directory.
28716 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
28717 Slower, but more generally useful. Used by the abstract
28718 registering implementation.
28720 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
28721 the rules for the special rule on Type/instances. First check if
28722 we have the same name, and if so, try that special static path
28723 rather than the instance path.
28725 2002-01-18 Miguel de Icaza <miguel@ximian.com>
28727 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
28730 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
28731 Enum, ValueType, Delegate or Array for non-corlib compiles.
28733 * cs-tokenizer.cs: Catch long identifiers (645)
28735 * typemanager.cs (IndexerPropetyName): Ravi never tested this
28738 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
28739 fix, we were returning too early, so we were not registering
28740 pending methods from abstract classes.
28742 Do not register pending methods if the class is abstract.
28744 * expression.cs (Conditional.DoResolve): Report circular implicit
28745 conversions when we neecd to compute it for conditional
28748 (Is.DoResolve): If the expression is always of the provided type,
28749 flag warning 183. If the expression can not ever be of the
28750 provided type flag warning 184.
28752 * class.cs: Catch 169 as well.
28754 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
28757 2002-01-18 Nick Drochak <ndrochak@gol.com>
28759 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
28761 2002-01-17 Miguel de Icaza <miguel@ximian.com>
28763 * interface.cs: (PopulateMethod): Check for pointers being defined
28764 only if the unsafe context is active.
28765 (PopulateProperty): ditto.
28766 (PopulateIndexer): ditto.
28768 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
28769 specified. If pointers are present, make sure that they are
28770 present in an unsafe context.
28771 (Constructor, Constructor.Define): ditto.
28772 (Field, Field.Define): ditto.
28773 (Property, Property.Define): ditto.
28774 (Event, Event.Define): ditto.
28776 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
28777 hashtable if there are classes or structs defined.
28779 * expression.cs (LocalVariableReference.DoResolve): Simplify this
28780 code, as the constant resolution moved.
28782 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
28783 the metadata, so we can flag error 133.
28785 * decl.cs (MemberCore.UnsafeOK): New function to test that a
28786 pointer is being declared in an unsafe context.
28788 2002-01-16 Miguel de Icaza <miguel@ximian.com>
28790 * modifiers.cs (Modifiers.Check): Require a Location argument.
28791 Report error 227 for Unsafe use.
28793 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
28795 * statement.cs (For.Emit): If the test is null, then report that
28796 we do `return', as we wont reach anything afterwards.
28798 (Switch.SwitchGoverningType): Track the expression that matched
28801 * driver.cs: Allow negative numbers as an error code to flag.
28803 * cs-parser.jay: Handle 1551.
28805 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
28807 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28809 * cs-parser.jay: Report 1518 (type declaration can only contain
28810 class, struct, interface, enum or delegate)
28812 (switch_label): Report 1523 (keywords `case' or `default' must
28815 (opt_switch_sections): Report 1522 (empty switch)
28817 * driver.cs: Report 1515 (response file specified multiple times)
28818 Report 1516 (Source file specified multiple times).
28820 * expression.cs (Argument.Resolve): Signal 1510
28822 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
28823 access not allowed in static code)
28825 2002-01-11 Ravi Pratap <ravi@ximian.com>
28827 * typemanager.cs (IsPointerType): Utility method which we are going
28830 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
28831 the object type, so we take care of that.
28833 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
28835 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
28836 added to non-params parameters :-)
28838 * typemanager.cs (CSharpName): Include 'void' type too.
28840 (void_ptr_type): Include in the set of core types.
28842 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
28845 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
28848 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
28849 completely forgotten about it.
28851 2002-01-10 Ravi Pratap <ravi@ximian.com>
28853 * cs-parser.jay (pointer_type): Add. This begins our implementation
28854 of parsing rules for unsafe code.
28856 (unsafe_statement): Implement.
28858 (embedded_statement): Modify to include the above.
28860 * statement.cs (Unsafe): Implement new class for unsafe blocks.
28862 * codegen.cs (EmitContext.InUnsafe): Add. This determines
28863 if the current context is an unsafe one.
28865 * cs-parser.jay (local_variable_pointer_type): Since local variable types
28866 are handled differently, we need separate rules for them.
28868 (local_variable_declaration): Update to use local_variable_pointer_type
28869 to allow variable declarations of unmanaged pointer types.
28871 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
28872 in unsafe contexts.
28874 * ../errors/cs0214.cs : Add.
28876 2002-01-16 Nick Drochak <ndrochak@gol.com>
28878 * makefile: remove 'response' file when cleaning.
28880 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28882 * cs-parser.jay: Report 1524.
28884 2002-01-14 Miguel de Icaza <miguel@ximian.com>
28886 * typemanager.cs (RegisterMethod): drop checking if we have
28887 registered this from here
28889 2002-01-12 Miguel de Icaza <miguel@ximian.com>
28891 * class.cs (Method.EmitDestructor): Implement calling our base
28894 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
28895 value of InFinally.
28897 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
28898 this routine and will wrap the call in a try/catch block. Deal
28901 2002-01-11 Miguel de Icaza <miguel@ximian.com>
28903 * ecore.cs (Expression.MemberLookup): instead of taking a
28904 parameter `same_type' that was used to tell whether we could
28905 access private members we compute our containing type from the
28908 (FieldExpr): Added partial support for volatile fields. This does
28909 not work for volatile fields exposed from assemblies, as I can not
28910 figure out how to extract the modreq from it.
28912 Updated all the source files to use this.
28914 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
28915 because it is referenced by MemberLookup very often.
28917 2002-01-09 Ravi Pratap <ravi@ximian.com>
28919 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
28920 TypeBuilder.GetCustomAttributes to retrieve what we need.
28922 Get rid of redundant default_member_attr_type as this is the same as
28923 default_member_type which already exists.
28925 * interface.cs, attribute.cs : Update accordingly.
28927 2002-01-08 Miguel de Icaza <miguel@ximian.com>
28929 * typemanager.cs: Enable IndexerPropertyName again. It does not
28930 work for TYpeBuilders though. Ravi, can you please fix this?
28932 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
28934 * expression.cs (Argument.Emit): Handle the case of ref objects
28935 being passed to ref functions;
28937 (ParameterReference.EmitLoad): Loads the content of the pointer
28938 without dereferencing.
28940 2002-01-07 Miguel de Icaza <miguel@ximian.com>
28942 * cs-tokenizer.cs: Implemented the pre-processing expressions.
28944 2002-01-08 Ravi Pratap <ravi@ximian.com>
28946 * class.cs (Indexer.DefineMethod): Incorporate the interface
28947 type in the name of the method if we are doing explicit interface
28950 * expression.cs (ConversionExists): Remove as it is completely obsolete.
28952 (BetterConversion): Fix extremely trivial bug where we were referring to
28953 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
28956 * ../errors/bug16.cs : Add although we have fixed it.
28958 2002-01-07 Miguel de Icaza <miguel@ximian.com>
28960 * expression.cs (BaseIndexer): Begin implementation.
28962 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
28964 * cs-parser.jay (indexer_declarator): Use qualified_identifier
28965 production directly to remove a shift/reduce, and implement
28966 explicit interface implementation.
28968 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
28969 after a floating point suffix.
28971 * expression.cs (DoNumericPromotions): Improved the conversion for
28972 uint/uint. If we have a constant, we avoid doing a typecast to a
28975 * class.cs (Indexer): Implement explicit interface implementation
28978 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
28980 * class.cs: make the default instance constructor public and hidebysig.
28982 2001-01-03 Ravi Pratap <ravi@ximian.com>
28984 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
28985 so we can call it from elsewhere.
28987 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
28988 we emit it internally if the class has a defined indexer; otherwise the user
28989 emits it by decorating the class definition with the DefaultMemberAttribute.
28991 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
28992 attribute is not used on a type which defines an indexer.
28994 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
28995 character when we skip whitespace.
28997 * ../errors/cs0646.cs : Add.
28999 2002-01-03 Miguel de Icaza <miguel@ximian.com>
29001 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
29004 * makefile: Add practical target `mcs3.exe' which builds the third
29005 generation compiler.
29007 * expression.cs (New): Fix structures constructor calling.
29009 * class.cs (Property, Method, Indexer): Emit Final flag on the
29010 method if we are an interface implementation and we are not
29013 * ecore.cs (PropertyExpr): New public field `IsBase', tells
29014 whether this property is referencing a `base' method.
29016 * expression.cs (Invocation.EmitCall): take an extra argument:
29017 is_base, this is used to determine whether the `call' or
29018 `callvirt' opcode should be used.
29021 * delegate.cs: update EmitCall.
29023 * class.cs (Method.Define): Set NewSlot for the cases where we are
29024 not implementing an interface method.
29026 (Property.Define): ditto.
29028 2002-01-02 Miguel de Icaza <miguel@ximian.com>
29030 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
29031 'r'. Allows mcs to parse itself fully.
29033 2002-01-02 Ravi Pratap <ravi@ximian.com>
29035 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
29036 of the number of initializers that require the InitializeArray method.
29038 (CheckIndices): Store the Expression in all cases - not the plain value. Also
29039 update the above field where necessary.
29041 (MakeByteBlob): Update accordingly.
29043 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
29046 (EmitDynamicInitializers): Update in accordance with the new optimization.
29048 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
29049 same OpCode applies.
29051 * cs-parser.jay : Fix some glaring errors I introduced.
29053 2002-01-01 Ravi Pratap <ravi@ximian.com>
29055 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
29056 so that we can check for name clashes there too.
29058 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
29059 for interface indexers.
29061 * interfaces.cs (Define): Emit the default member attribute.
29063 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
29064 variable was being referred to while setting the value ;-)
29066 2002-01-01 Miguel de Icaza <miguel@ximian.com>
29068 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
29069 byte-by-byte information when we know the data is zero.
29071 Make the block always a multiple of 4, because
29072 DefineInitializedData has a bug.
29074 * assign.cs: Fix, we should assign from the temporary, not from
29077 * expression.cs (MakeByteBlob): Fix my incorrect code.
29079 2001-12-31 Miguel de Icaza <miguel@ximian.com>
29081 * typemanager.cs (EnumToUnderlying): This function is used to get
29082 the underlying type from an enumeration, because it does not
29085 * constant.cs: Use the I4_S form for values between -128 and 127.
29087 * statement.cs (Block.LookupLabel): Looks up a label.
29088 (Block): Drop support for labeled blocks.
29090 (LabeledStatement): New kind of statement that represents a label
29093 (Goto): Finally implement this bad boy.
29095 * cs-parser.jay: Update to reflect new mechanism to implement
29098 2001-12-30 Miguel de Icaza <miguel@ximian.com>
29100 * codegen.cs (EmitContext.This): a codegen property that keeps the
29101 a single instance of this instead of creating many different this
29104 * delegate.cs (Delegate.DoResolve): Update to use the property;
29106 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
29108 * expression.cs (BaseAccess.DoResolve): Ditto.
29110 2001-12-29 Ravi Pratap <ravi@ximian.com>
29112 * typemanager.cs (methodimpl_attr_type): Add to hold the type
29113 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
29115 (InitCoreTypes): Update accordingly.
29117 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
29118 so we can quickly store the state.
29120 (ApplyAttributes): Set the correct implementation flags
29121 for InternalCall methods.
29123 2001-12-29 Miguel de Icaza <miguel@ximian.com>
29125 * expression.cs (EmitCall): if a method is not virtual, then do
29126 not use callvirt on it.
29128 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
29129 user defined stuff) requires the use of stobj, which takes an
29130 address on the stack instead of an array and an index. So emit
29131 the Ldelema operation for it.
29133 (EmitStoreOpcode): Use stobj for valuetypes.
29135 (UnaryMutator.EmitCode): Use the right 1 value depending on
29136 whether we are dealing with int64/uint64, float or doubles.
29138 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
29139 constructors that I implemented last night.
29141 (Constructor.IsDefault): Fix to work properly for static
29144 * cs-parser.jay (CheckDef): report method signature errors.
29145 Update error number 103 to be 132.
29147 * decl.cs: New AdditionResult enumeration value: MethodExists.
29148 Although we do this check for methods later on in the semantic
29149 analysis, catching repeated default constructors is so easy that
29150 we catch these here.
29152 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
29155 (ParameterReference.EmitAssign, Emit): handle
29158 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
29159 (ArrayAccess.EmitStoreOpcode): ditto.
29161 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
29163 * expression.cs (MakeByteBlob): Complete all the missing types
29164 (uint, short, ushort, byte, sbyte)
29166 * class.cs: Only init instance field initializers on instance
29169 Rename `constructors' to instance_constructors.
29171 (TypeContainer.AddConstructor): Only add constructors to the list
29172 if it is not static.
29174 Make sure that we handle default_static_constructor independently
29175 everywhere where we handle instance_constructors
29177 2001-12-28 Miguel de Icaza <miguel@ximian.com>
29179 * class.cs: Do not lookup or create a base initializer for a
29180 static constructor.
29182 (ConstructorInitializer.Resolve): use the proper type to lookup
29185 * cs-parser.jay: Report error 1585 (modifiers between type and name).
29187 * enum.cs, interface.cs: Remove CloseType, this is taken care by
29190 * decl.cs: CloseType is now an virtual method, the default
29191 implementation just closes this type.
29193 2001-12-28 Ravi Pratap <ravi@ximian.com>
29195 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
29196 to PreserveSig by default. Also emit HideBySig on such methods.
29198 Basically, set the defaults to standard values.
29200 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
29201 argument, if candidate is better, it can't be worse than the best !
29203 (Invocation): Re-write bits to differentiate between methods being
29204 applicable in their expanded form and their normal form - for params
29207 Get rid of use_standard everywhere as only standard conversions are allowed
29208 in overload resolution.
29210 More spec conformance.
29212 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29214 * driver.cs: Add --timestamp, to see where the compiler spends
29217 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
29218 `this' in static code.
29220 (SimpleName.DoResolve): Implement in terms of a helper function
29221 that allows static-references to be passed upstream to
29224 (Expression.ResolveWithSimpleName): Resolve specially simple
29225 names when called by MemberAccess to implement the special
29228 (Expression.ImplicitReferenceConversion): Handle conversions from
29229 Null to reference types before others, as Null's type is
29232 * expression.cs (Invocation.EmitCall): Handle the special case of
29233 calling methods declared on a reference type from a ValueType
29234 (Base classes System.Object and System.Enum)
29236 (MemberAccess.Resolve): Only perform lookups on Enumerations if
29237 the left hand side is a TypeExpr, not on every enumeration.
29239 (Binary.Resolve): If types are reference types, then do a cast to
29240 object on operators != and == of both arguments.
29242 * typemanager.cs (FindMembers): Extract instance and static
29243 members if requested.
29245 * interface.cs (PopulateProperty): Use void_type instead of null
29246 as the return type for the setter method.
29248 (PopulateIndexer): ditto.
29250 2001-12-27 Ravi Pratap <ravi@ximian.com>
29252 * support.cs (ReflectionParameters): Fix minor bug where we
29253 were examining the wrong parameter for the ParamArray attribute.
29255 Cope with requests for the type of the parameter at position
29256 greater than the params parameter's. We now return the element
29257 type of the params array as that makes more sense.
29259 * expression.cs (Invocation.IsParamsMethodApplicable): Update
29260 accordingly as we no longer have to extract the element type
29263 (Invocation.OverloadResolve): Update.
29265 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29267 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
29268 against IEnumerator, test whether the return value is a descendant
29269 of the IEnumerator interface.
29271 * class.cs (Indexer.Define): Use an auxiliary method to implement
29272 the other bits of the method definition. Begin support for
29273 explicit interface implementation.
29275 (Property.DefineMethod): Use TypeManager.void_type instead of null
29276 for an empty return value.
29278 2001-12-26 Miguel de Icaza <miguel@ximian.com>
29280 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
29281 dealing with a FieldExpr which is composed of a FieldBuilder, in
29282 the code path we did extract the constant, but we should have
29283 obtained the underlying value to be able to cast it (otherwise we
29284 end up in an infinite loop, this is what Ravi was running into).
29286 (ArrayCreation.UpdateIndices): Arrays might be empty.
29288 (MemberAccess.ResolveMemberAccess): Add support for section
29289 14.5.4.1 that deals with the special case of E.I when E is a type
29290 and something else, that I can be a reference to a static member.
29292 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
29293 handle a particular array type to create byte blobs, it is just
29294 something we dont generate byteblobs for.
29296 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
29299 * location.cs (Push): remove the key from the hashtable that we
29300 are about to add. This happens for empty files.
29302 * driver.cs: Dispose files after we have parsed them.
29304 (tokenize): new function that only runs the tokenizer on its
29305 input, for speed testing.
29307 2001-12-26 Ravi Pratap <ravi@ximian.com>
29309 * class.cs (Event.Define): Define the private field only if there
29310 are no accessors defined.
29312 * expression.cs (ResolveMemberAccess): If there is no associated
29313 field with the event, that means we have an event defined with its
29314 own accessors and we should flag error cs0070 since transforming
29315 ourselves into a field is not valid in that case.
29317 * ecore.cs (SimpleName.DoResolve): Same as above.
29319 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
29320 and charset to sane values.
29322 2001-12-25 Ravi Pratap <ravi@ximian.com>
29324 * assign.cs (DoResolve): Perform check on events only if they
29325 are being accessed outside the declaring type.
29327 * cs-parser.jay (event_declarations): Update rules to correctly
29328 set the type of the implicit parameter etc.
29330 (add_accessor, remove_accessor): Set current local parameters.
29332 * expression.cs (Binary): For delegate addition and subtraction,
29333 cast the return value from the method into the appropriate delegate
29336 2001-12-24 Ravi Pratap <ravi@ximian.com>
29338 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
29339 of these as the workaround is unnecessary.
29341 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
29342 delegate data - none of that is needed at all.
29344 Re-write bits to extract the instance expression and the delegate method
29347 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
29350 * attribute.cs (ApplyAttributes): New method to take care of common tasks
29351 of attaching attributes instead of duplicating code everywhere.
29353 * everywhere : Update code to do attribute emission using the above method.
29355 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29357 * expression.cs (IsParamsMethodApplicable): if there are not
29358 parameters, return immediately.
29360 * ecore.cs: The 0 literal can be implicity converted to an enum
29363 (SimpleName.DoResolve): First lookup the type, then lookup the
29366 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
29367 want to get its address. If the InstanceExpression is not
29368 addressable, store the result in a temporary variable, then get
29371 * codegen.cs: Only display 219 errors on warning level or above.
29373 * expression.cs (ArrayAccess): Make it implement the
29374 IMemoryLocation interface.
29376 (Binary.DoResolve): handle the operator == (object a, object b)
29377 and operator != (object a, object b) without incurring into a
29378 BoxedCast (because 5 != o should never be performed).
29380 Handle binary enumerator operators.
29382 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
29383 value type, otherwise use Ldelem_ref.
29385 Use precomputed names;
29387 (AddressOf): Implement address of
29389 * cs-parser.jay (labeled_statement): Fix recursive block
29390 addition by reworking the production.
29392 * expression.cs (New.DoEmit): New has a special case:
29394 If we are dealing with a ValueType, we have a few
29395 situations to deal with:
29397 * The target of New is a ValueType variable, that is
29398 easy, we just pass this as the variable reference
29400 * The target of New is being passed as an argument,
29401 to a boxing operation or a function that takes a
29404 In this case, we need to create a temporary variable
29405 that is the argument of New.
29408 2001-12-23 Ravi Pratap <ravi@ximian.com>
29410 * rootcontext.cs (LookupType): Check that current_type is not null before
29411 going about looking at nested types.
29413 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
29414 not implement the IAssignMethod interface any more.
29416 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
29417 where we tranform them into FieldExprs if they are being resolved from within
29418 the declaring type.
29420 * ecore.cs (SimpleName.DoResolve): Do the same here.
29422 * assign.cs (DoResolve, Emit): Clean up code considerably.
29424 * ../errors/bug10.cs : Add.
29426 * ../errors/cs0070.cs : Add.
29428 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
29430 * assign.cs : Get rid of EventIsLocal everywhere.
29432 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29434 * ecore.cs (ConvertIntLiteral): finished the implementation.
29436 * statement.cs (SwitchLabel): Convert the value we are using as a
29437 key before looking up the table.
29439 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29441 * codegen.cs (EmitTopBlock): Require a Location argument now.
29443 * cs-parser.jay (constructor_declarator): We need to setup
29444 current_local_parameters before we parse the
29445 opt_constructor_initializer, to allow the variables to be bound
29446 to the constructor arguments.
29448 * rootcontext.cs (LookupType): First lookup nested classes in our
29449 class and our parents before we go looking outside our class.
29451 * expression.cs (ConstantFold): Extract/debox the values at the
29454 * rootcontext.cs (EmitCode): Resolve the constants first before we
29455 resolve the types. This is not really needed, but it helps debugging.
29457 * statement.cs: report location.
29459 * cs-parser.jay: pass location to throw statement.
29461 * driver.cs: Small bug fix.
29463 * report.cs: Updated format to be 4-zero filled digits.
29465 2001-12-22 Ravi Pratap <ravi@ximian.com>
29467 * expression.cs (CheckIndices): Fix minor bug where the wrong
29468 variable was being referred to ;-)
29470 (DoEmit): Do not call EmitStaticInitializers when the
29471 underlying type is System.Object.
29473 2001-12-21 Ravi Pratap <ravi@ximian.com>
29475 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
29476 and do the usual workaround for SRE.
29478 * class.cs (MyEventBuilder.EventType): New member to get at the type
29479 of the event, quickly.
29481 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
29483 * assign.cs (Assign.DoResolve): Handle the case when the target
29484 is an EventExpr and perform the necessary checks.
29486 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
29489 (SimpleName.MemberStaticCheck): Include check for EventExpr.
29491 (EventExpr): Set the type in the constructor itself since we
29492 are meant to be born fully resolved.
29494 (EventExpr.Define): Revert code I wrote earlier.
29496 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
29497 instance expression is null. The instance expression is a This in that case
29498 or a null, depending on whether it is a static method or not.
29500 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
29501 refers to more than one method.
29503 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
29504 and accordingly flag errors.
29506 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29508 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
29510 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29512 * location.cs (ToString): Provide useful rutine.
29514 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29516 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
29517 objects, return the actual integral boxed.
29519 * statement.cs (SwitchLabel): define an ILLabel for each
29522 (Switch.CheckSwitch): If the value is a Literal, extract
29523 the underlying literal.
29525 Also in the unused hashtable we had, add the SwitchLabel so we can
29526 quickly look this value up.
29528 * constant.cs: Implement a bunch of new constants. Rewrite
29529 Literal based on this. Made changes everywhere to adapt to this.
29531 * expression.cs (Expression.MakeByteBlob): Optimize routine by
29532 dereferencing array only once, and also copes with enumrations.
29534 bytes are two bytes wide, not one.
29536 (Cast): Perform constant conversions.
29538 * ecore.cs (TryImplicitIntConversion): Return literals instead of
29539 wrappers to the literals here.
29541 * expression.cs (DoNumericPromotions): long literals can converted
29542 to ulong implicity (this is taken care of elsewhere, but I was
29543 missing this spot).
29545 * ecore.cs (Expression.Literalize): Make the return type Literal,
29546 to improve type checking.
29548 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
29550 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29552 * literal.cs: Revert code from ravi that checked the bounds. The
29553 bounds are sane by the definition of the type itself.
29555 * typemanager.cs: Fix implementation of ImplementsInterface. We
29556 need to actually look up in our parent hierarchy for interfaces
29559 * const.cs: Use the underlying type for enumerations
29561 * delegate.cs: Compute the basename for the delegate creation,
29562 that should fix the delegate test case, and restore the correct
29563 Type Lookup semantics in rootcontext
29565 * rootcontext.cs: Revert Ravi's last patch. The correct way of
29566 referencing a nested type with the Reflection API is using the "+"
29569 * cs-parser.jay: Do not require EOF token at the end.
29571 2001-12-20 Ravi Pratap <ravi@ximian.com>
29573 * rootcontext.cs (LookupType): Concatenate type names with
29574 a '.' instead of a '+' The test suite passes again.
29576 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
29577 field of the enumeration.
29579 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
29580 the case when the member is an EventExpr.
29582 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
29583 static has an associated instance expression.
29585 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
29587 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
29589 * class.cs (Event.Define): Register event and perform appropriate checks
29592 We define the Add and Remove methods even if the use provides none because
29593 in that case, we provide default implementations ourselves.
29595 Define a private field of the type of the event. This is done by the CSC compiler
29596 and we should be doing it too ;-)
29598 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
29599 More methods we use in code we generate.
29601 (multicast_delegate_type, delegate_type): Two separate types since the distinction
29604 (InitCoreTypes): Update accordingly for the above.
29606 * class.cs (Event.Emit): Generate code for default accessors that we provide
29608 (EmitDefaultMethod): Do the job in the above.
29610 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
29613 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29615 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
29616 builders even if we were missing one.
29618 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
29619 pass the Basename as our class name instead of the Name. The
29620 basename will be correctly composed for us.
29622 * parameter.cs (Paramters): Now takes a Location argument.
29624 * decl.cs (DeclSpace.LookupType): Removed convenience function and
29625 make all the code call directly LookupType in RootContext and take
29626 this chance to pass the Location information everywhere.
29628 * Everywhere: pass Location information.
29630 2001-12-19 Miguel de Icaza <miguel@ximian.com>
29632 * class.cs (Constructor.Define): Updated way of detecting the
29633 length of the parameters.
29635 (TypeContainer.DefineType): Use basename as the type name for
29638 (TypeContainer.Define): Do not recursively define types here, as
29639 definition is taken care in order by the RootContext.
29641 * tree.cs: Keep track of namespaces in a per-file basis.
29643 * parameter.cs (Parameter.ComputeSignature): Update to use
29646 (Parameters.GetSignature): ditto.
29648 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
29649 instead of a TypeContainer.
29651 (Interface.SemanticAnalysis): Use `this' instead of our parent to
29652 resolve names. Because we need to be resolve in our context, not
29655 * driver.cs: Implement response files.
29657 * class.cs (TypeContainer.DefineType): If we are defined, do not
29658 redefine ourselves.
29660 (Event.Emit): Emit the code for add/remove handlers.
29661 (Event.Define): Save the MethodBuilders for add/remove.
29663 * typemanager.cs: Use pair here too.
29665 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
29666 DictionaryEntry requires the first argument to be non-null.
29668 (enum_declaration): Compute full name for registering the
29671 (delegate_declaration): Instead of using
29672 formal_parameter_list, use opt_formal_parameter_list as the list
29675 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
29676 (EventParsing): New property that controls whether `add' and
29677 `remove' are returned as tokens or identifiers (for events);
29679 2001-12-19 Ravi Pratap <ravi@ximian.com>
29681 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
29682 use MyEventBuilder only and let it wrap the real builder for us.
29684 (MyEventBuilder): Revamp constructor etc.
29686 Implement all operations that we perform on EventBuilder in precisely the same
29689 (FindMembers): Update to use the EventBuilder member.
29691 (Event.Emit): Update accordingly.
29693 2001-12-18 Ravi Pratap <ravi@ximian.com>
29695 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
29696 by calling the appropriate methods.
29698 (GetCustomAttributes): Make stubs as they cannot possibly do anything
29701 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
29703 2001-12-17 Ravi Pratap <ravi@ximian.com>
29705 * delegate.cs (Delegate.Populate): Check that the return type
29706 and various parameters types are indeed accessible.
29708 * class.cs (Constructor.Define): Same here.
29710 (Field.Define): Ditto.
29712 (Event.Define): Ditto.
29714 (Operator.Define): Check that the underlying Method defined itself
29715 correctly - so it's MethodBuilder should not be null.
29717 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
29718 expression happens to be null.
29720 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
29721 members but as of now we don't seem to be able to do anything really useful with it.
29723 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
29724 not the EventBuilder.
29726 2001-12-18 Miguel de Icaza <miguel@ximian.com>
29728 * cs-tokenizer.cs: Add support for defines.
29729 Add support for #if, #elif, #else, #endif
29731 (eval_var): evaluates a variable.
29732 (eval): stubbed for evaluating functions.
29734 * cs-parser.jay: Pass the defines information
29736 * driver.cs: Add --define command line option.
29738 * decl.cs: Move MemberCore here.
29740 Make it the base class for DeclSpace. This allows us to catch and
29741 report 108 and 109 for everything now.
29743 * class.cs (TypeContainer.Define): Extract all the members
29744 before populating and emit the warning 108 (new keyword required
29745 to override) instead of having each member implement this.
29747 (MemberCore.Define): New abstract method, we will be using this in
29748 the warning reporting engine in Populate.
29750 (Operator.Define): Adjust to new MemberCore protocol.
29752 * const.cs (Const): This does not derive from Expression, it is a
29753 temporary object we use to create fields, it is a MemberCore.
29755 * class.cs (Method.Define): Allow the entry point to be in a
29758 * driver.cs: Rewrite the argument handler to clean it up a bit.
29760 * rootcontext.cs: Made it just an auxiliary namespace feature by
29761 making everything static.
29763 * driver.cs: Adapt code to use RootContext type name instead of
29766 * delegate.cs: Remove RootContext argument.
29768 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
29771 * class.cs (Event.Define): The lookup can fail.
29773 * cs-tokenizer.cs: Begin implementation of pre-procesor.
29775 * expression.cs: Resolve the this instance before invoking the code.
29777 2001-12-17 Miguel de Icaza <miguel@ximian.com>
29779 * cs-parser.jay: Add a production in element_access that allows
29780 the thing to become a "type" reference. This way we can parse
29781 things like "(string [])" as a type.
29783 Note that this still does not handle the more complex rules of
29787 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
29789 * ecore.cs: (CopyNewMethods): new utility function used to
29790 assemble the list of methods from running FindMembers.
29792 (MemberLookup): Rework FindMembers so that
29794 2001-12-16 Miguel de Icaza <miguel@ximian.com>
29796 * class.cs (TypeContainer): Remove Delegates who fail to be
29799 * delegate.cs (Populate): Verify that we dont get null return
29800 values. TODO: Check for AsAccessible.
29802 * cs-parser.jay: Use basename to emit error 574 (destructor should
29803 have the same name as container class), not the full name.
29805 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
29806 possible representation.
29808 Also implements integer type suffixes U and L.
29810 2001-12-15 Miguel de Icaza <miguel@ximian.com>
29812 * expression.cs (ArrayCreation.DoResolve): We need to do the
29813 argument resolution *always*.
29815 * decl.cs: Make this hold the namespace. Hold the root context as
29817 (LookupType): Move here.
29819 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
29821 * location.cs (Row, Name): Fixed the code, it was always returning
29822 references to the first file.
29824 * interface.cs: Register properties defined through interfaces.
29826 * driver.cs: Add support for globbing on the command line
29828 * class.cs (Field): Make it derive from MemberCore as well.
29831 2001-12-15 Ravi Pratap <ravi@ximian.com>
29833 * class.cs (Event::Define): Check that the type of the event is a delegate
29834 type else flag error #66.
29836 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
29839 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
29840 values of EntryPoint, CharSet etc etc.
29842 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
29844 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
29845 be null and we should ignore this. I am not sure if this is really clean. Apparently,
29846 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
29847 which needs this to do its work.
29849 * ../errors/cs0066.cs : Add.
29851 2001-12-14 Miguel de Icaza <miguel@ximian.com>
29853 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
29856 * class.cs: (MethodSignature.MethodSignature): Removed hack that
29857 clears out the parameters field.
29858 (MemberSignatureCompare): Cleanup
29860 (MemberCore): New base class used to share code between MethodCore
29863 (RegisterRequiredImplementations) BindingFlags.Public requires
29864 either BindingFlags.Instace or Static. Use instance here.
29866 (Property): Refactored code to cope better with the full spec.
29868 * parameter.cs (GetParameterInfo): Return an empty array instead
29871 * class.cs (Property): Abstract or extern properties have no bodies.
29873 * parameter.cs (GetParameterInfo): return a zero-sized array.
29875 * class.cs (TypeContainer.MethodModifiersValid): Move all the
29876 method modifier validation to the typecontainer so we can reuse
29877 this on properties.
29879 (MethodCore.ParameterTypes): return an empty sized array of types.
29881 (Property.Define): Test property modifier validity.
29883 Add tests for sealed/override too.
29885 (Method.Emit): abstract or extern methods have no bodies.
29887 2001-12-14 Ravi Pratap <ravi@ximian.com>
29889 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
29892 (Method::Define, ::Emit): Modify accordingly.
29894 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
29896 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
29898 * makefile: Pass in /unsafe.
29900 2001-12-13 Miguel de Icaza <miguel@ximian.com>
29902 * class.cs (MakeKey): Kill routine.
29904 * class.cs (TypeContainer.Define): Correctly define explicit
29905 method implementations (they require the full interface name plus
29908 * typemanager.cs: Deply the PtrHashtable here and stop using the
29909 lame keys. Things work so much better.
29911 This of course broke everyone who depended on `RegisterMethod' to
29912 do the `test for existance' test. This has to be done elsewhere.
29914 * support.cs (PtrHashtable): A hashtable that avoid comparing with
29915 the object stupid Equals method (because, that like fails all over
29916 the place). We still do not use it.
29918 * class.cs (TypeContainer.SetRequiredInterface,
29919 TypeContainer.RequireMethods): Killed these two routines and moved
29920 all the functionality to RegisterRequiredImplementations.
29922 (TypeContainer.RegisterRequiredImplementations): This routine now
29923 registers all the implementations required in an array for the
29924 interfaces and abstract methods. We use an array of structures
29925 which can be computed ahead of time to reduce memory usage and we
29926 also assume that lookups are cheap as most classes will not
29927 implement too many interfaces.
29929 We also avoid creating too many MethodSignatures.
29931 (TypeContainer.IsInterfaceMethod): Update and optionally does not
29932 clear the "pending" bit if we find that there are problems with
29935 (TypeContainer.VerifyPendingMethods): Update to report errors of
29936 methods that look like implementations but are not.
29938 (TypeContainer.Define): Add support for explicit interface method
29941 2001-12-12 Miguel de Icaza <miguel@ximian.com>
29943 * typemanager.cs: Keep track of the parameters here instead of
29944 being a feature of the TypeContainer.
29946 * class.cs: Drop the registration of parameters here, as
29947 InterfaceMethods are also interface declarations.
29949 * delegate.cs: Register methods with the TypeManager not only with
29950 the TypeContainer. This code was buggy.
29952 * interface.cs: Full registation here.
29954 2001-12-11 Miguel de Icaza <miguel@ximian.com>
29956 * expression.cs: Remove reducer for binary expressions, it can not
29959 * const.cs: Put here the code that used to go into constant.cs
29961 * constant.cs: Put here the code for constants, this is a new base
29962 class for Literals.
29964 * literal.cs: Make Literal derive from Constant.
29966 2001-12-09 Miguel de Icaza <miguel@ximian.com>
29968 * statement.cs (Return.Emit): Report error 157 if the user
29969 attempts to return from a finally block.
29971 (Return.Emit): Instead of emitting a return, jump to the end of
29974 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
29975 LocalBuilder to store the result of the function. ReturnLabel is
29976 the target where we jump.
29979 2001-12-09 Radek Doulik <rodo@ximian.com>
29981 * cs-parser.jay: remember alias in current namespace
29983 * ecore.cs (SimpleName::DoResolve): use aliases for types or
29986 * class.cs (LookupAlias): lookup alias in my_namespace
29988 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
29990 (LookupAlias): lookup alias in this and if needed in parent
29993 2001-12-08 Miguel de Icaza <miguel@ximian.com>
29997 * rootcontext.cs: (ModuleBuilder) Made static, first step into
29998 making things static. I need this to avoid passing the
29999 TypeContainer when calling ParameterType.
30001 * support.cs (InternalParameters.ParameterType): Remove ugly hack
30002 that did string manipulation to compute the type and then call
30003 GetType. Use Parameter.ParameterType instead.
30005 * cs-tokenizer.cs: Consume the suffix for floating values.
30007 * expression.cs (ParameterReference): figure out whether this is a
30008 reference parameter or not. Kill an extra variable by computing
30009 the arg_idx during emission.
30011 * parameter.cs (Parameters.GetParameterInfo): New overloaded
30012 function that returns whether a parameter is an out/ref value or not.
30014 (Parameter.ParameterType): The type of the parameter (base,
30015 without ref/out applied).
30017 (Parameter.Resolve): Perform resolution here.
30018 (Parameter.ExternalType): The full type (with ref/out applied).
30020 * statement.cs (Using.Emit, Using.EmitExpression): Implement
30021 support for expressions on the using statement.
30023 2001-12-07 Miguel de Icaza <miguel@ximian.com>
30025 * statement.cs (Using.EmitLocalVariableDecls): Split the
30026 localvariable handling of the using statement.
30028 (Block.EmitMeta): Keep track of variable count across blocks. We
30029 were reusing slots on separate branches of blocks.
30031 (Try.Emit): Emit the general code block, we were not emitting it.
30033 Check the type of the declaration to be an IDisposable or
30034 something that can be implicity converted to it.
30036 Emit conversions if required.
30038 * ecore.cs (EmptyExpression): New utility class.
30039 (Expression.ImplicitConversionExists): New utility function.
30041 2001-12-06 Miguel de Icaza <miguel@ximian.com>
30043 * statement.cs (Using): Implement.
30045 * expression.cs (LocalVariableReference): Support read only variables.
30047 * statement.cs: Remove the explicit emit for the Leave opcode.
30048 (VariableInfo): Add a readonly field.
30050 2001-12-05 Miguel de Icaza <miguel@ximian.com>
30052 * ecore.cs (ConvCast): new class used to encapsulate the various
30053 explicit integer conversions that works in both checked and
30054 unchecked contexts.
30056 (Expression.ConvertNumericExplicit): Use new ConvCast class to
30057 properly generate the overflow opcodes.
30059 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30061 * statement.cs: The correct type for the EmptyExpression is the
30062 element_type, not the variable type. Ravi pointed this out.
30064 2001-12-04 Ravi Pratap <ravi@ximian.com>
30066 * class.cs (Method::Define): Handle PInvoke methods specially
30067 by using DefinePInvokeMethod instead of the usual one.
30069 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
30070 above to do the task of extracting information and defining the method.
30072 2001-12-04 Ravi Pratap <ravi@ximian.com>
30074 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
30075 of the condition for string type.
30077 (Emit): Move that here.
30079 (ArrayCreation::CheckIndices): Keep string literals in their expression
30082 (EmitDynamicInitializers): Handle strings appropriately.
30084 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30086 * codegen.cs (EmitContext): Replace multiple variables with a
30087 single pointer to the current Switch statement.
30089 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
30092 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30096 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
30099 (Foreach.Emit): Foreach on arrays was not setting
30100 up the loop variables (for break/continue).
30102 (GotoCase): Semi-implented.
30104 2001-12-03 Ravi Pratap <ravi@ximian.com>
30106 * attribute.cs (CheckAttribute): Handle system attributes by using
30107 Attribute.GetAttributes to examine information we need.
30109 (GetValidPlaces): Same here.
30111 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
30113 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
30115 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
30117 (Method::Define): Set appropriate flags if we have a DllImport attribute.
30119 (Method::Emit): Handle the case when we are a PInvoke method.
30121 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30123 * expression.cs: Use ResolveWithSimpleName on compound names.
30125 2001-12-02 Ravi Pratap <ravi@ximian.com>
30127 * constant.cs (EmitConstant): Make sure we resolve the associated expression
30128 before trying to reduce it.
30130 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
30132 * constant.cs (LookupConstantValue): Implement.
30134 (EmitConstant): Use the above in emitting the constant.
30136 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
30137 that are user-defined by doing a LookupConstantValue on them.
30139 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
30142 2001-11-29 Miguel de Icaza <miguel@ximian.com>
30144 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
30146 (BaseAccess.DoResolve): Implement.
30148 (MemberAccess.DoResolve): Split this routine into a
30149 ResolveMemberAccess routine that can be used independently
30151 2001-11-28 Miguel de Icaza <miguel@ximian.com>
30153 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
30154 As that share bits of the implementation. Is returns a boolean,
30155 while As returns the Type that is being probed.
30157 2001-12-01 Ravi Pratap <ravi@ximian.com>
30159 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
30160 instead of a Literal - much easier.
30162 (EnumInTransit): Remove - utterly useless :-)
30164 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
30166 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
30168 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
30169 chain when we have no associated expression.
30171 2001-11-30 Ravi Pratap <ravi@ximian.com>
30173 * constant.cs (Define): Use Location while reporting the errror.
30175 Also emit a warning when 'new' is used and there is no inherited
30178 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
30181 (LookupEnumValue): Implement to lookup an enum member's value and define it
30184 (Populate): Re-write accordingly to use the above routine.
30186 2001-11-27 Miguel de Icaza <miguel@ximian.com>
30188 * expression.cs (This): Fix prototype for DoResolveLValue to
30189 override the base class DoResolveLValue.
30191 * cs-parser.cs: Report errors cs574 and cs575 (destructor
30194 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
30195 (we need to load the address of the field here). This fixes
30198 (FieldExpr.DoResolveLValue): Call the DoResolve
30199 function to initialize the Instance expression.
30201 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
30202 correctly the GetEnumerator operation on a value type.
30204 * cs-parser.jay: Add more simple parsing error catches.
30206 * statement.cs (Switch): Add support for string switches.
30207 Handle null specially.
30209 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
30211 2001-11-28 Ravi Pratap <ravi@ximian.com>
30213 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
30215 (declare_local_constant): New helper function.
30217 * statement.cs (AddConstant): Keep a separate record of constants
30219 (IsConstant): Implement to determine if a variable is a constant.
30221 (GetConstantExpression): Implement.
30223 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
30225 * statement.cs (IsVariableDefined): Re-write.
30227 2001-11-27 Ravi Pratap <ravi@ximian.com>
30229 * class.cs (TypeContainer::FindMembers): Look for constants
30230 in the case when we are looking for MemberTypes.Field
30232 * expression.cs (MemberAccess::DoResolve): Check that in the
30233 case we are a FieldExpr and a Literal, we are not being accessed
30234 by an instance reference.
30236 * cs-parser.jay (local_constant_declaration): Implement.
30238 (declaration_statement): Implement for constant declarations.
30240 2001-11-26 Miguel de Icaza <miguel@ximian.com>
30242 * statement.cs (Switch): Catch double defaults.
30244 (Switch): More work on the switch() statement
30245 implementation. It works for integral values now, need to finish
30249 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30251 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
30252 integer literals into other integer literals. To be used by
30255 2001-11-24 Ravi Pratap <ravi@ximian.com>
30257 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
30260 (EmitDynamicInitializers): Cope with the above since we extract data
30261 directly from ArrayData now.
30263 (ExpectInitializers): Keep track of whether initializers are mandatory
30266 (Bounds): Make it a hashtable to prevent the same dimension being
30267 recorded for every element in that dimension.
30269 (EmitDynamicInitializers): Fix bug which prevented the Set array method
30272 Also fix bug which was causing the indices to be emitted in the reverse
30275 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30277 * expression.cs (ArrayCreation): Implement the bits that Ravi left
30278 unfinished. They do not work, because the underlying code is
30281 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30283 * cs-parser.jay: Remove bogus fixme.
30285 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
30286 on Switch statement.
30288 2001-11-23 Ravi Pratap <ravi@ximian.com>
30290 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
30293 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
30294 parameter. Apparently, any expression is allowed.
30296 (ValidateInitializers): Update accordingly.
30298 (CheckIndices): Fix some tricky bugs thanks to recursion.
30300 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
30301 I was being completely brain-dead.
30303 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
30304 and re-write acordingly.
30306 (DelegateInvocation): Re-write accordingly.
30308 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
30310 (MakeByteBlob): Handle types more correctly.
30312 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
30313 initialization from expressions but it is incomplete because I am a complete
30316 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30318 * statement.cs (If.Emit): Fix a bug that generated incorrect code
30319 on If. Basically, we have to return `true' (ie, we do return to
30320 our caller) only if both branches of the if return.
30322 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
30323 short-circuit operators, handle them as short circuit operators.
30325 (Cast.DoResolve): Resolve type.
30326 (Cast.Cast): Take an expression as the target type.
30328 * cs-parser.jay (cast_expression): Remove old hack that only
30329 allowed a limited set of types to be handled. Now we take a
30330 unary_expression and we resolve to a type during semantic
30333 Use the grammar productions from Rhys to handle casts (this is
30334 not complete like Rhys syntax yet, we fail to handle that corner
30335 case that C# has regarding (-x), but we will get there.
30337 2001-11-22 Ravi Pratap <ravi@ximian.com>
30339 * class.cs (EmitFieldInitializer): Take care of the case when we have a
30340 field which is an array type.
30342 * cs-parser.jay (declare_local_variables): Support array initialization too.
30344 * typemanager.cs (MakeKey): Implement.
30346 (everywhere): Use the above appropriately.
30348 * cs-parser.jay (for_statement): Update for array initialization while
30349 declaring variables.
30351 * ecore.cs : The error message was correct, it's the variable's names that
30352 were misleading ;-) Make the code more readable.
30354 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
30355 the correct type etc.
30357 (ConvertExplicit): Handle Enum types by examining the underlying type.
30359 2001-11-21 Ravi Pratap <ravi@ximian.com>
30361 * parameter.cs (GetCallingConvention): Always return
30362 CallingConventions.Standard for now.
30364 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30366 * expression.cs (Binary.ResolveOperator): Update the values of `l'
30367 and `r' after calling DoNumericPromotions.
30369 * ecore.cs: Fix error message (the types were in the wrong order).
30371 * statement.cs (Foreach.ProbeCollectionType): Need to pass
30372 BindingFlags.Instance as well
30374 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
30375 implicit int literal conversion in an empty cast so that we
30376 propagate the right type upstream.
30378 (UnboxCast): new class used to unbox value types.
30379 (Expression.ConvertExplicit): Add explicit type conversions done
30382 (Expression.ImplicitNumericConversion): Oops, forgot to test for
30383 the target type before applying the implicit LongLiterals to ULong
30386 2001-11-21 Miguel de Icaza <miguel@ximian.com>
30388 * cs-parser.jay (for_statement): Reworked the way For works: now
30389 we declare manually any variables that are introduced in
30390 for_initializer to solve the problem of having out-of-band code
30391 emition (that is what got for broken).
30393 (declaration_statement): Perform the actual variable declaration
30394 that used to be done in local_variable_declaration here.
30396 (local_variable_declaration): Do not declare anything, just pass
30397 the information on a DictionaryEntry
30399 2001-11-20 Ravi Pratap <ravi@ximian.com>
30401 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
30402 re-write of the logic to now make it recursive.
30404 (UpdateIndices): Re-write accordingly.
30406 Store element data in a separate ArrayData list in the above methods.
30408 (MakeByteBlob): Implement to dump the array data into a byte array.
30410 2001-11-19 Ravi Pratap <ravi@ximian.com>
30412 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
30415 * constant.cs (Define): Implement.
30417 (EmitConstant): Re-write fully.
30419 Pass in location info.
30421 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
30424 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
30425 DictionaryEntry since we need location info too.
30427 (constant_declaration): Update accordingly.
30429 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
30430 code into another method : UpdateIndices.
30432 2001-11-18 Ravi Pratap <ravi@ximian.com>
30434 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
30435 some type checking etc.
30437 2001-11-17 Ravi Pratap <ravi@ximian.com>
30439 * expression.cs (ArrayCreation::ValidateInitializers): Implement
30440 bits to provide dimension info if the user skips doing that.
30442 Update second constructor to store the rank correctly.
30444 2001-11-16 Ravi Pratap <ravi@ximian.com>
30446 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
30447 and try to implement.
30449 * ../errors/cs0150.cs : Add.
30451 * ../errors/cs0178.cs : Add.
30453 2001-11-16 Miguel de Icaza <miguel@ximian.com>
30455 * statement.cs: Implement foreach on multi-dimensional arrays.
30457 * parameter.cs (Parameters.GetParameterByName): Also lookup the
30458 name of the params argument.
30460 * expression.cs: Use EmitStoreOpcode to get the right opcode while
30461 initializing the array.
30463 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
30464 we can use this elsewhere.
30466 * statement.cs: Finish implementation of foreach for single
30469 * cs-parser.jay: Use an out-of-band stack to pass information
30470 around, I wonder why I need this.
30472 foreach_block: Make the new foreach_block the current_block.
30474 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
30475 function used to return a static Parameters structure. Used for
30476 empty parameters, as those are created very frequently.
30478 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
30480 2001-11-15 Ravi Pratap <ravi@ximian.com>
30482 * interface.cs : Default modifier is private, not public. The
30483 make verify test passes again.
30485 2001-11-15 Ravi Pratap <ravi@ximian.com>
30487 * support.cs (ReflectionParameters): Fix logic to determine
30488 whether the last parameter is a params one. Test 9 passes again.
30490 * delegate.cs (Populate): Register the builders we define with
30491 RegisterParameterForBuilder. Test 19 passes again.
30493 * cs-parser.jay (property_declaration): Reference $6 instead
30494 of $$ to get at the location.
30496 (indexer_declaration): Similar stuff.
30498 (attribute): Ditto.
30500 * class.cs (Property): Register parameters for the Get and Set methods
30501 if they exist. Test 23 passes again.
30503 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
30504 call to EmitArguments as we are sure there aren't any params arguments.
30505 Test 32 passes again.
30507 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
30508 IndexOutOfRangeException.
30510 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
30511 Test 33 now passes again.
30513 2001-11-15 Miguel de Icaza <miguel@ximian.com>
30515 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
30516 broke a bunch of things. Will have to come up with a better way
30517 of tracking locations.
30519 * statement.cs: Implemented foreach for single dimension arrays.
30521 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30523 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
30524 an error. This removes the lookup from the critical path.
30526 * cs-parser.jay: Removed use of temporary_loc, which is completely
30529 2001-11-14 Miguel de Icaza <miguel@ximian.com>
30531 * support.cs (ReflectionParameters.ParameterModifier): Report
30532 whether the argument is a PARAMS argument or not.
30534 * class.cs: Set the attribute `ParamArrayAttribute' on the
30535 parameter argument.
30537 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
30538 and cons_param_array_attribute (ConstructorInfo for
30539 ParamArrayAttribute).,
30541 * codegen.cs: Emit the return using the `Return' statement, that
30542 way we can report the error correctly for missing return values.
30544 * class.cs (Method.Emit): Clean up.
30546 * expression.cs (Argument.Resolve): Take another argument: the
30547 location where this argument is used. Notice that this is not
30548 part of the "Argument" class as to reduce the size of the
30549 structure (we know the approximate location anyways).
30551 Test if the argument is a variable-reference, if not, then
30552 complain with a 206.
30554 (Argument.Emit): Emit addresses of variables.
30556 (Argument.FullDesc): Simplify.
30558 (Invocation.DoResolve): Update for Argument.Resolve.
30560 (ElementAccess.DoResolve): ditto.
30562 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
30563 method should be virtual, as this method is always virtual.
30565 (NewDelegate.DoResolve): Update for Argument.Resolve.
30567 * class.cs (ConstructorInitializer.DoResolve): ditto.
30569 * attribute.cs (Attribute.Resolve): ditto.
30571 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30573 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
30575 * expression.cs (ParameterReference): Drop IStackStorage and implement
30576 IAssignMethod instead.
30578 (LocalVariableReference): ditto.
30580 * ecore.cs (FieldExpr): Drop IStackStorage and implement
30581 IAssignMethod instead.
30583 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30585 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
30586 enumerations that are used in heavily used structures derive from
30587 byte in a laughable and pathetic attempt to reduce memory usage.
30588 This is the kind of pre-optimzations that you should not do at
30589 home without adult supervision.
30591 * expression.cs (UnaryMutator): New class, used to handle ++ and
30592 -- separatedly from the other unary operators. Cleans up the
30593 code, and kills the ExpressionStatement dependency in Unary.
30595 (Unary): Removed `method' and `Arguments' from this class, making
30596 it smaller, and moving it all to SimpleCall, so I can reuse this
30597 code in other locations and avoid creating a lot of transient data
30598 strucutres when not required.
30600 * cs-parser.jay: Adjust for new changes.
30602 2001-11-11 Miguel de Icaza <miguel@ximian.com>
30604 * enum.cs (Enum.Populate): If there is a failure during
30607 * cs-parser.jay (opt_enum_base): we used to catch type errors
30608 here, but this is really incorrect. The type error should be
30609 catched during semantic analysis.
30611 2001-12-11 Ravi Pratap <ravi@ximian.com>
30613 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
30614 current_local_parameters as expected since I, in my stupidity, had forgotten
30617 * attribute.cs (GetValidPlaces): Fix stupid bug.
30619 * class.cs (Method::Emit): Perform check on applicability of attributes.
30621 (Constructor::Emit): Ditto.
30623 (Field::Emit): Ditto.
30625 (Field.Location): Store location information.
30627 (Property, Event, Indexer, Operator): Ditto.
30629 * cs-parser.jay (field_declaration): Pass in location for each field.
30631 * ../errors/cs0592.cs : Add.
30633 2001-11-12 Ravi Pratap <ravi@ximian.com>
30635 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
30637 (InitCoreTypes): Update accordingly.
30639 (RegisterAttrType, LookupAttr): Implement.
30641 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
30642 info about the same.
30644 (Resolve): Update to populate the above as necessary.
30646 (Error592): Helper.
30648 (GetValidPlaces): Helper to the above.
30650 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
30652 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
30654 2001-11-12 Ravi Pratap <ravi@ximian.com>
30656 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
30658 * ../errors/cs0617.cs : Add.
30660 2001-11-11 Ravi Pratap <ravi@ximian.com>
30662 * enum.cs (Emit): Rename to Populate to be more consistent with what
30663 we expect it to do and when exactly it is called.
30665 * class.cs, rootcontext.cs : Update accordingly.
30667 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
30668 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
30670 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
30672 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
30673 of a fieldinfo using the above, when dealing with a FieldBuilder.
30675 2001-11-10 Ravi Pratap <ravi@ximian.com>
30677 * ../errors/cs0031.cs : Add.
30679 * ../errors/cs1008.cs : Add.
30681 * ../errrors/cs0543.cs : Add.
30683 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
30686 (FindMembers): Implement.
30688 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
30689 enums and delegates too.
30691 (enum_types): Rename to builder_to_enum.
30693 (delegate_types): Rename to builder_to_delegate.
30695 * delegate.cs (FindMembers): Implement.
30697 2001-11-09 Ravi Pratap <ravi@ximian.com>
30699 * typemanager.cs (IsEnumType): Implement.
30701 * enum.cs (Emit): Re-write parts to account for the underlying type
30702 better and perform checking etc.
30704 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
30705 of the underlying type.
30707 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
30710 * enum.cs (error31): Helper to report error #31.
30712 * cs-parser.jay (enum_declaration): Store location of each member too.
30714 * enum.cs (member_to_location): New hashtable.
30716 (AddEnumMember): Update location hashtable.
30718 (Emit): Use the location of each member while reporting errors.
30720 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30722 * cs-parser.jay: A for_initializer if is a
30723 local_variable_declaration really ammount to have an implicit
30724 block with the variable declaration and no initializer for for.
30726 * statement.cs (For.Emit): Cope with null initializers.
30728 This fixes the infinite loop on for initializers.
30730 2001-11-08 Miguel de Icaza <miguel@ximian.com>
30732 * enum.cs: More cleanup.
30734 * ecore.cs: Remove dead code.
30736 * class.cs (Property.Emit): More simplification.
30737 (Event.Emit): ditto.
30739 Reworked to have less levels of indentation.
30741 2001-11-08 Ravi Pratap <ravi@ximian.com>
30743 * class.cs (Property): Emit attributes.
30753 * enum.cs (Emit): Ditto.
30755 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
30758 * class.cs (Field, Event, etc.): Move attribute generation into the
30759 Emit method everywhere.
30761 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
30762 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
30763 as we had no way of defining nested enums !
30765 * rootcontext.cs : Adjust code accordingly.
30767 * typemanager.cs (AddEnumType): To keep track of enum types separately.
30769 2001-11-07 Ravi Pratap <ravi@ximian.com>
30771 * expression.cs (EvalConstantExpression): Move into ecore.cs
30773 * enum.cs (Enum): Rename some members and make them public and readonly
30774 according to our convention.
30776 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
30779 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
30781 (Enum::Emit): Write a simple version for now which doesn't try to compute
30782 expressions. I shall modify this to be more robust in just a while.
30784 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
30786 (TypeContainer::CloseType): Create the Enum types too.
30788 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
30790 * expression.cs (EvalConstantExpression): Get rid of completely.
30792 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
30793 user-defined values and other cases.
30795 (IsValidEnumLiteral): Helper function.
30797 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
30798 out there in the case we had a literal FieldExpr.
30800 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
30802 (Literalize): Revamp a bit to take two arguments.
30804 (EnumLiteral): New class which derives from Literal to wrap enum literals.
30806 2001-11-06 Ravi Pratap <ravi@ximian.com>
30808 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
30810 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
30812 (Resolve): Use the above to ensure we have proper initializers.
30814 2001-11-05 Ravi Pratap <ravi@ximian.com>
30816 * expression.cs (Expression::EvalConstantExpression): New method to
30817 evaluate constant expressions.
30819 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
30821 2001-11-07 Miguel de Icaza <miguel@ximian.com>
30823 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
30826 (Binary.ResolveOperator): Handle operator != (object a, object b)
30827 and operator == (object a, object b);
30829 (Binary.DoNumericPromotions): Indicate whether the numeric
30830 promotion was possible.
30832 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
30835 Made the ArrayAccess implement interface IAssignMethod instead of
30836 IStackStore as the order in which arguments are passed reflects
30839 * assign.cs: Instead of using expr.ExprClass to select the way of
30840 assinging, probe for the IStackStore/IAssignMethod interfaces.
30842 * typemanager.cs: Load InitializeArray definition.
30844 * rootcontext.cs (RootContext.MakeStaticData): Used to define
30845 static data that can be used to initialize arrays.
30847 2001-11-05 Miguel de Icaza <miguel@ximian.com>
30849 * expression.cs: Handle operator== and operator!= for booleans.
30851 (Conditioal.Reduce): Implement reducer for the ?: operator.
30853 (Conditional.Resolve): Implement dead code elimination.
30855 (Binary.Resolve): Catch string literals and return a new
30856 concatenated string.
30858 (Unary.Reduce): Implement reduction of unary expressions.
30860 * ecore.cs: Split out the expression core handling here.
30862 (Expression.Reduce): New method used to perform constant folding
30863 and CSE. This is needed to support constant-expressions.
30865 * statement.cs (Statement.EmitBoolExpression): Pass true and false
30866 targets, and optimize for !x.
30868 2001-11-04 Ravi Pratap <ravi@ximian.com>
30870 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
30871 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
30872 set custom atttributes.
30874 * literal.cs (Literal::GetValue): New abstract method to return the actual
30875 value of the literal, cast as an object.
30877 (*Literal): Implement GetValue method.
30879 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
30880 expressions to the arraylist but objects of type Argument.
30882 * class.cs (TypeContainer::Emit): Emit our attributes too.
30884 (Method::Emit, Constructor::Emit): Ditto.
30886 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
30887 to be ignoring earlier.
30889 2001-11-03 Ravi Pratap <ravi@ximian.com>
30891 * attribute.cs (AttributeSection::Define): Implement to do the business
30892 of constructing a CustomAttributeBuilder.
30894 (Attribute): New trivial class. Increases readability of code.
30896 * cs-parser.jay : Update accordingly.
30898 (positional_argument_list, named_argument_list, named_argument): New rules
30900 (attribute_arguments): Use the above so that we are more correct.
30902 2001-11-02 Ravi Pratap <ravi@ximian.com>
30904 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
30905 to perform all checks for a method with a params parameter.
30907 (Invocation::OverloadResolve): Update to use the above method and therefore
30908 cope correctly with params method invocations.
30910 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
30913 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
30914 constructors in our parent too because we can't afford to miss out on
30917 * attribute.cs (AttributeSection): New name for the class Attribute
30919 Other trivial changes to improve readability.
30921 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
30922 use the new class names.
30924 2001-11-01 Ravi Pratap <ravi@ximian.com>
30926 * class.cs (Method::Define): Complete definition for params types too
30928 (Indexer::Define): Ditto.
30930 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
30931 Cope everywhere with a request for info about the array parameter.
30933 2001-11-01 Ravi Pratap <ravi@ximian.com>
30935 * tree.cs (RecordNamespace): Fix up to check for the correct key.
30937 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
30938 local_variable_type to extract the string corresponding to the type.
30940 (local_variable_type): Fixup the action to use the new helper method.
30942 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
30945 * expression.cs : Clean out code which uses the above.
30947 2001-10-31 Ravi Pratap <ravi@ximian.com>
30949 * typemanager.cs (RegisterMethod): Check if we already have an existing key
30950 and bale out if necessary by returning a false.
30952 (RegisterProperty): Ditto.
30954 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
30955 and print out appropriate error messages.
30957 * interface.cs (everywhere): Ditto.
30959 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
30960 location to constructor.
30962 * class.cs (Property, Event, Indexer): Update accordingly.
30964 * ../errors/cs111.cs : Added.
30966 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
30967 of a method, as laid down by the spec.
30969 (Invocation::OverloadResolve): Use the above method.
30971 2001-10-31 Ravi Pratap <ravi@ximian.com>
30973 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
30974 now take a TypeContainer and a Parameters object.
30976 (ParameterData): Modify return type of ParameterModifier method to be
30977 Parameter.Modifier and not a string.
30979 (ReflectionParameters, InternalParameters): Update accordingly.
30981 * expression.cs (Argument::GetParameterModifier): Same here.
30983 * support.cs (InternalParameters::ParameterType): Find a better way of determining
30984 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
30985 symbol in it at all so maybe this is only for now.
30987 2001-10-30 Ravi Pratap <ravi@ximian.com>
30989 * support.cs (InternalParameters): Constructor now takes an extra argument
30990 which is the actual Parameters class.
30992 (ParameterDesc): Update to provide info on ref/out modifiers.
30994 * class.cs (everywhere): Update call to InternalParameters to pass in
30995 the second argument too.
30997 * support.cs (ParameterData): Add ParameterModifier, which is a method
30998 to return the modifier info [ref/out etc]
31000 (InternalParameters, ReflectionParameters): Implement the above.
31002 * expression.cs (Argument::ParameterModifier): Similar function to return
31003 info about the argument's modifiers.
31005 (Invocation::OverloadResolve): Update to take into account matching modifiers
31008 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
31009 a new SetFormalParameters object which we pass to InternalParameters.
31011 2001-10-30 Ravi Pratap <ravi@ximian.com>
31013 * expression.cs (NewArray): Merge into the ArrayCreation class.
31015 2001-10-29 Ravi Pratap <ravi@ximian.com>
31017 * expression.cs (NewArray): Merge classes NewBuiltinArray and
31018 NewUserdefinedArray into one as there wasn't much of a use in having
31021 * expression.cs (Argument): Change field's name to ArgType from Type.
31023 (Type): New readonly property which returns the proper type, taking into
31024 account ref/out modifiers.
31026 (everywhere): Adjust code accordingly for the above.
31028 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
31029 whether we are emitting for a ref or out parameter.
31031 * expression.cs (Argument::Emit): Use the above field to set the state.
31033 (LocalVariableReference::Emit): Update to honour the flag and emit the
31036 * parameter.cs (Attributes): Set the correct flags for ref parameters.
31038 * expression.cs (Argument::FullDesc): New function to provide a full desc.
31040 * support.cs (ParameterData): Add method ParameterDesc to the interface.
31042 (ReflectionParameters, InternalParameters): Implement the above method.
31044 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
31047 (Invocation::FullMethodDesc): Ditto.
31049 2001-10-29 Miguel de Icaza <miguel@ximian.com>
31051 * cs-parser.jay: Add extra production for the second form of array
31054 * expression.cs (ArrayCreation): Update to reflect the above
31057 * Small changes to prepare for Array initialization.
31059 2001-10-28 Miguel de Icaza <miguel@ximian.com>
31061 * typemanager.cs (ImplementsInterface): interface might be null;
31062 Deal with this problem;
31064 Also, we do store negative hits on the cache (null values), so use
31065 this instead of calling t.GetInterfaces on the type everytime.
31067 2001-10-28 Ravi Pratap <ravi@ximian.com>
31069 * typemanager.cs (IsBuiltinType): New method to help determine the same.
31071 * expression.cs (New::DoResolve): Get rid of array creation code and instead
31072 split functionality out into different classes.
31074 (New::FormArrayType): Move into NewBuiltinArray.
31076 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
31079 (NewBuiltinArray): New class to handle creation of built-in arrays.
31081 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
31082 account creation of one-dimensional arrays.
31084 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
31086 (NewUserdefinedArray::DoResolve): Implement.
31088 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
31090 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
31091 we maintain inside the TypeManager. This is necessary to perform lookups on the
31094 (LookupType): Update to perform GetType on the module builders too.
31096 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
31098 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
31100 2001-10-23 Ravi Pratap <ravi@ximian.com>
31102 * expression.cs (New::DoResolve): Implement guts of array creation.
31104 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
31106 2001-10-27 Miguel de Icaza <miguel@ximian.com>
31108 * expression.cs: Fix bug I introduced lsat night that broke
31111 (Expression.Resolve): Report a 246 error (can not resolve name)
31112 if we find a SimpleName in the stream.
31114 (Expression.ResolveLValue): Ditto.
31116 (Expression.ResolveWithSimpleName): This function is a variant of
31117 ResolveName, this one allows SimpleNames to be returned without a
31118 warning. The only consumer of SimpleNames is MemberAccess
31120 2001-10-26 Miguel de Icaza <miguel@ximian.com>
31122 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
31123 might arrive here. I have my doubts that this is correct.
31125 * statement.cs (Lock): Implement lock statement.
31127 * cs-parser.jay: Small fixes to support `lock' and `using'
31129 * cs-tokenizer.cs: Remove extra space
31131 * driver.cs: New flag --checked, allows to turn on integer math
31134 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
31135 Threading.Monitor.Exit
31137 2001-10-23 Miguel de Icaza <miguel@ximian.com>
31139 * expression.cs (IndexerAccess::DoResolveLValue): Set the
31140 Expression Class to be IndexerAccess.
31142 Notice that Indexer::DoResolve sets the eclass to Value.
31144 2001-10-22 Miguel de Icaza <miguel@ximian.com>
31146 * class.cs (TypeContainer::Emit): Emit code for indexers.
31148 * assign.cs (IAssignMethod): New interface implemented by Indexers
31149 and Properties for handling assignment.
31151 (Assign::Emit): Simplify and reuse code.
31153 * expression.cs (IndexerAccess, PropertyExpr): Implement
31154 IAssignMethod, clean up old code.
31156 2001-10-22 Ravi Pratap <ravi@ximian.com>
31158 * typemanager.cs (ImplementsInterface): New method to determine if a type
31159 implements a given interface. Provides a nice cache too.
31161 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
31164 (ConvertReferenceExplicit): Ditto.
31166 * delegate.cs (Delegate::Populate): Update to define the parameters on the
31167 various methods, with correct names etc.
31169 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
31170 Operator.UnaryNegation.
31172 * cs-parser.jay (operator_declarator): Be a little clever in the case where
31173 we have a unary plus or minus operator.
31175 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
31178 * everywhere : update accordingly.
31180 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
31183 * class.cs (Method::Define): For the case where we are implementing a method
31184 inherited from an interface, we need to set the MethodAttributes.Final flag too.
31185 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
31187 2001-10-21 Ravi Pratap <ravi@ximian.com>
31189 * interface.cs (FindMembers): Implement to work around S.R.E
31192 * typemanager.cs (IsInterfaceType): Implement.
31194 (FindMembers): Update to handle interface types too.
31196 * expression.cs (ImplicitReferenceConversion): Re-write bits which
31197 use IsAssignableFrom as that is not correct - it doesn't work.
31199 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
31200 and accordingly override EmitStatement.
31202 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
31203 using the correct logic :-)
31205 2001-10-19 Ravi Pratap <ravi@ximian.com>
31207 * ../errors/cs-11.cs : Add to demonstrate error -11
31209 2001-10-17 Miguel de Icaza <miguel@ximian.com>
31211 * assign.cs (Assign::Resolve): Resolve right hand side first, and
31212 then pass this as a hint to ResolveLValue.
31214 * expression.cs (FieldExpr): Add Location information
31216 (FieldExpr::LValueResolve): Report assignment to readonly
31219 (Expression::ExprClassFromMemberInfo): Pass location information.
31221 (Expression::ResolveLValue): Add new method that resolves an
31224 (Expression::DoResolveLValue): Default invocation calls
31227 (Indexers): New class used to keep track of indexers in a given
31230 (IStackStore): Renamed from LValue, as it did not really describe
31231 what this did. Also ResolveLValue is gone from this interface and
31232 now is part of Expression.
31234 (ElementAccess): Depending on the element access type
31236 * typemanager.cs: Add `indexer_name_type' as a Core type
31237 (System.Runtime.CompilerServices.IndexerNameAttribute)
31239 * statement.cs (Goto): Take a location.
31241 2001-10-18 Ravi Pratap <ravi@ximian.com>
31243 * delegate.cs (Delegate::VerifyDelegate): New method to verify
31244 if two delegates are compatible.
31246 (NewDelegate::DoResolve): Update to take care of the case when
31247 we instantiate a delegate from another delegate.
31249 * typemanager.cs (FindMembers): Don't even try to look up members
31250 of Delegate types for now.
31252 2001-10-18 Ravi Pratap <ravi@ximian.com>
31254 * delegate.cs (NewDelegate): New class to take care of delegate
31257 * expression.cs (New): Split the delegate related code out into
31258 the NewDelegate class.
31260 * delegate.cs (DelegateInvocation): New class to handle delegate
31263 * expression.cs (Invocation): Split out delegate related code into
31264 the DelegateInvocation class.
31266 2001-10-17 Ravi Pratap <ravi@ximian.com>
31268 * expression.cs (New::DoResolve): Implement delegate creation fully
31269 and according to the spec.
31271 (New::DoEmit): Update to handle delegates differently.
31273 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
31274 because of which we were printing out arguments in reverse order !
31276 * delegate.cs (VerifyMethod): Implement to check if the given method
31277 matches the delegate.
31279 (FullDelegateDesc): Implement.
31281 (VerifyApplicability): Implement.
31283 * expression.cs (Invocation::DoResolve): Update to accordingly handle
31284 delegate invocations too.
31286 (Invocation::Emit): Ditto.
31288 * ../errors/cs1593.cs : Added.
31290 * ../errors/cs1594.cs : Added.
31292 * delegate.cs (InstanceExpression, TargetMethod): New properties.
31294 2001-10-16 Ravi Pratap <ravi@ximian.com>
31296 * typemanager.cs (intptr_type): Core type for System.IntPtr
31298 (InitCoreTypes): Update for the same.
31300 (iasyncresult_type, asynccallback_type): Ditto.
31302 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
31305 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
31308 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
31309 the builders for the 4 members of a delegate type :-)
31311 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
31314 * expression.cs (New::DoResolve): Implement guts for delegate creation.
31316 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
31318 2001-10-15 Miguel de Icaza <miguel@ximian.com>
31320 * statement.cs (Break::Emit): Implement.
31321 (Continue::Emit): Implement.
31323 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
31324 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
31325 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
31326 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
31329 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
31330 properties that track the label for the current loop (begin of the
31331 loop and end of the loop).
31333 2001-10-15 Ravi Pratap <ravi@ximian.com>
31335 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
31336 use of emitting anything at all.
31338 * class.cs, rootcontext.cs : Get rid of calls to the same.
31340 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
31342 (Populate): Define the constructor correctly and set the implementation
31345 * typemanager.cs (delegate_types): New hashtable to hold delegates that
31348 (AddDelegateType): Implement.
31350 (IsDelegateType): Implement helper method.
31352 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
31354 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
31355 and accordingly handle it.
31357 * delegate.cs (Populate): Take TypeContainer argument.
31358 Implement bits to define the Invoke method. However, I still haven't figured out
31359 how to take care of the native int bit :-(
31361 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
31362 Qualify the name of the delegate, not its return type !
31364 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
31367 (StandardConversionExists): Checking for array types turns out to be recursive.
31369 (ConvertReferenceExplicit): Implement array conversion.
31371 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
31373 2001-10-12 Ravi Pratap <ravi@ximian.com>
31375 * cs-parser.jay (delegate_declaration): Store the fully qualified
31376 name as it is a type declaration.
31378 * delegate.cs (ReturnType, Name): Rename members to these. Make them
31381 (DefineDelegate): Renamed from Define. Does the same thing essentially,
31382 as TypeContainer::DefineType.
31384 (Populate): Method in which all the definition of the various methods (Invoke)
31387 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
31390 (CloseDelegate): Finally creates the delegate.
31392 * class.cs (TypeContainer::DefineType): Update to define delegates.
31393 (Populate, Emit and CloseType): Do the same thing here too.
31395 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
31396 delegates in all these operations.
31398 2001-10-14 Miguel de Icaza <miguel@ximian.com>
31400 * expression.cs: LocalTemporary: a new expression used to
31401 reference a temporary that has been created.
31403 * assign.cs: Handle PropertyAccess back here, so that we can
31404 provide the proper semantic access to properties.
31406 * expression.cs (Expression::ConvertReferenceExplicit): Implement
31407 a few more explicit conversions.
31409 * modifiers.cs: `NEW' modifier maps to HideBySig.
31411 * expression.cs (PropertyExpr): Make this into an
31412 ExpressionStatement, and support the EmitStatement code path.
31414 Perform get/set error checking, clean up the interface.
31416 * assign.cs: recognize PropertyExprs as targets, and if so, turn
31417 them into toplevel access objects.
31419 2001-10-12 Miguel de Icaza <miguel@ximian.com>
31421 * expression.cs: PropertyExpr::PropertyExpr: use work around the
31424 * typemanager.cs: Keep track here of our PropertyBuilders again to
31425 work around lameness in SRE.
31427 2001-10-11 Miguel de Icaza <miguel@ximian.com>
31429 * expression.cs (LValue::LValueResolve): New method in the
31430 interface, used to perform a second resolution pass for LValues.
31432 (This::DoResolve): Catch the use of this in static methods.
31434 (This::LValueResolve): Implement.
31436 (This::Store): Remove warning, assigning to `this' in structures
31439 (Invocation::Emit): Deal with invocation of
31440 methods on value types. We need to pass the address to structure
31441 methods rather than the object itself. (The equivalent code to
31442 emit "this" for structures leaves the entire structure on the
31443 stack instead of a pointer to it).
31445 (ParameterReference::DoResolve): Compute the real index for the
31446 argument based on whether the method takes or not a `this' pointer
31447 (ie, the method is static).
31449 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
31450 value types returned from functions when we need to invoke a
31451 method on the sturcture.
31454 2001-10-11 Ravi Pratap <ravi@ximian.com>
31456 * class.cs (TypeContainer::DefineType): Method to actually do the business of
31457 defining the type in the Modulebuilder or Typebuilder. This is to take
31458 care of nested types which need to be defined on the TypeBuilder using
31459 DefineNestedMethod.
31461 (TypeContainer::GetClassBases): Implement. Essentially the code from the
31462 methods in RootContext, only ported to be part of TypeContainer.
31464 (TypeContainer::GetInterfaceOrClass): Ditto.
31466 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
31468 * interface.cs (Interface::DefineInterface): New method. Does exactly
31469 what RootContext.CreateInterface did earlier, only it takes care of nested types
31472 (Interface::GetInterfaces): Move from RootContext here and port.
31474 (Interface::GetInterfaceByName): Same here.
31476 * rootcontext.cs (ResolveTree): Re-write.
31478 (PopulateTypes): Re-write.
31480 * class.cs (TypeContainer::Populate): Populate nested types too.
31481 (TypeContainer::Emit): Emit nested members too.
31483 * typemanager.cs (AddUserType): Do not make use of the FullName property,
31484 instead just use the name argument passed in as it is already fully
31487 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
31488 to TypeContainer mapping to see if a type is user-defined.
31490 * class.cs (TypeContainer::CloseType): Implement.
31492 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
31493 the default constructor.
31495 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
31498 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
31500 * interface.cs (CloseType): Create the type here.
31502 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
31505 Remove all the methods which are now in TypeContainer.
31507 2001-10-10 Ravi Pratap <ravi@ximian.com>
31509 * delegate.cs (Define): Re-write bits to define the delegate
31512 2001-10-10 Miguel de Icaza <miguel@ximian.com>
31514 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
31516 * expression.cs (ImplicitReferenceConversion): handle null as well
31517 as a source to convert to any reference type.
31519 * statement.cs (Return): Perform any implicit conversions to
31520 expected return type.
31522 Validate use of return statement.
31524 * codegen.cs (EmitContext): Pass the expected return type here.
31526 * class.cs (Method, Constructor, Property): Pass expected return
31527 type to EmitContext.
31529 2001-10-09 Miguel de Icaza <miguel@ximian.com>
31531 * expression.cs: Make DoResolve take an EmitContext instead of a
31534 Replaced `l' and `location' for `loc', for consistency.
31536 (Error, Warning): Remove unneeded Tc argument.
31538 * assign.cs, literal.cs, constant.cs: Update to new calling
31541 * codegen.cs: EmitContext now contains a flag indicating whether
31542 code is being generated in a static method or not.
31544 * cs-parser.jay: DecomposeQI, new function that replaces the old
31545 QualifiedIdentifier. Now we always decompose the assembled
31546 strings from qualified_identifier productions into a group of
31549 2001-10-08 Miguel de Icaza <miguel@ximian.com>
31551 * rootcontext.cs: Deal with field-less struct types correctly now
31552 by passing the size option to Define Type.
31554 * class.cs: Removed hack that created one static field.
31556 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31558 * statement.cs: Moved most of the code generation here.
31560 2001-10-09 Ravi Pratap <ravi@ximian.com>
31562 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
31565 (ElementAccess): Remove useless bits for now - keep checks as the spec
31568 2001-10-08 Ravi Pratap <ravi@ximian.com>
31570 * expression.cs (ElementAccess::DoResolve): Remove my crap code
31571 and start performing checks according to the spec.
31573 2001-10-07 Ravi Pratap <ravi@ximian.com>
31575 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
31576 rank_specifiers instead.
31578 (rank_specifiers): Change the order in which the rank specifiers are stored
31580 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
31582 * expression.cs (ElementAccess): Implement the LValue interface too.
31584 2001-10-06 Ravi Pratap <ravi@ximian.com>
31586 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
31587 except that user defined conversions are not included.
31589 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
31590 perform the conversion of the return type, if necessary.
31592 (New::DoResolve): Check whether we are creating an array or an object
31593 and accordingly do the needful.
31595 (New::Emit): Same here.
31597 (New::DoResolve): Implement guts of array creation.
31599 (New::FormLookupType): Helper function.
31601 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31603 * codegen.cs: Removed most of the code generation here, and move the
31604 corresponding code generation bits to the statement classes.
31606 Added support for try/catch/finalize and throw.
31608 * cs-parser.jay: Added support for try/catch/finalize.
31610 * class.cs: Catch static methods having the flags override,
31611 virtual or abstract.
31613 * expression.cs (UserCast): This user cast was not really doing
31614 what it was supposed to do. Which is to be born in fully resolved
31615 state. Parts of the resolution were being performed at Emit time!
31619 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31621 * expression.cs: Implicity convert the result from UserCast.
31623 2001-10-05 Ravi Pratap <ravi@ximian.com>
31625 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
31626 prevented it from working correctly.
31628 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
31629 merely ConvertImplicit.
31631 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31633 * typemanager.cs: Make the LookupTypeContainer function static,
31634 and not per-instance.
31636 * class.cs: Make static FindMembers (the one that takes a Type
31639 * codegen.cs: Add EmitForeach here.
31641 * cs-parser.jay: Make foreach a toplevel object instead of the
31642 inline expansion, as we need to perform semantic analysis on it.
31644 2001-10-05 Ravi Pratap <ravi@ximian.com>
31646 * expression.cs (Expression::ImplicitUserConversion): Rename to
31647 UserDefinedConversion.
31649 (Expression::UserDefinedConversion): Take an extra argument specifying
31650 whether we look for explicit user conversions too.
31652 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
31654 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
31656 (ExplicitUserConversion): Make it a call to UserDefinedConversion
31657 with the appropriate arguments.
31659 * cs-parser.jay (cast_expression): Record location too.
31661 * expression.cs (Cast): Record location info.
31663 (Expression::ConvertExplicit): Take location argument.
31665 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
31666 to determine if we are doing explicit conversions.
31668 (UserCast::Emit): Update accordingly.
31670 (Expression::ConvertExplicit): Report an error if everything fails.
31672 * ../errors/cs0030.cs : Add.
31674 2001-10-04 Miguel de Icaza <miguel@ximian.com>
31676 * modifiers.cs: If the ABSTRACT keyword is present, also set the
31677 virtual and newslot bits.
31679 * class.cs (TypeContainer::RegisterRequiredImplementations):
31680 Record methods we need.
31682 (TypeContainer::MakeKey): Helper function to make keys for
31683 MethodBases, since the Methodbase key is useless.
31685 (TypeContainer::Populate): Call RegisterRequiredImplementations
31686 before defining the methods.
31688 Create a mapping for method_builders_to_methods ahead of time
31689 instead of inside a tight loop.
31691 (::RequireMethods): Accept an object as the data to set into the
31692 hashtable so we can report interface vs abstract method mismatch.
31694 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31696 * report.cs: Make all of it static.
31698 * rootcontext.cs: Drop object_type and value_type computations, as
31699 we have those in the TypeManager anyways.
31701 Drop report instance variable too, now it is a global.
31703 * driver.cs: Use try/catch on command line handling.
31705 Add --probe option to debug the error reporting system with a test
31708 * report.cs: Add support for exiting program when a probe
31709 condition is reached.
31711 2001-10-03 Ravi Pratap <ravi@ximian.com>
31713 * expression.cs (Binary::DoNumericPromotions): Fix the case when
31714 we do a forcible conversion regardless of type, to check if
31715 ForceConversion returns a null.
31717 (Binary::error19): Use location to report error.
31719 (Unary::error23): Use location here too.
31721 * ../errors/cs0019.cs : Check in.
31723 * ../errors/cs0023.cs : Check in.
31725 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
31726 case of a non-null MethodInfo object with a length of 0 !
31728 (Binary::ResolveOperator): Flag error if overload resolution fails to find
31729 an applicable member - according to the spec :-)
31730 Also fix logic to find members in base types.
31732 (Unary::ResolveOperator): Same here.
31734 (Unary::report23): Change name to error23 and make first argument a TypeContainer
31735 as I was getting thoroughly confused between this and error19 :-)
31737 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
31738 (::FindMostEncompassedType): Implement.
31739 (::FindMostEncompassingType): Implement.
31740 (::StandardConversionExists): Implement.
31742 (UserImplicitCast): Re-vamp. We now need info about most specific
31743 source and target types so that we can do the necessary conversions.
31745 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
31746 mathematical union with no duplicates.
31748 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31750 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
31751 in order from base classes to child classes, so that we can in
31752 child classes look up in our parent for method names and
31753 attributes (required for handling abstract, virtual, new, override
31754 constructs: we need to instrospect our base class, and if we dont
31755 populate the classes in order, the introspection might be
31756 incorrect. For example, a method could query its parent before
31757 the parent has any methods and would determine that the parent has
31758 no abstract methods (while it could have had them)).
31760 (RootContext::CreateType): Record the order in which we define the
31763 2001-10-02 Miguel de Icaza <miguel@ximian.com>
31765 * class.cs (TypeContainer::Populate): Also method definitions can
31766 fail now, keep track of this.
31768 (TypeContainer::FindMembers): Implement support for
31769 DeclaredOnly/noDeclaredOnly flag.
31771 (Constructor::Emit) Return the ConstructorBuilder.
31773 (Method::Emit) Return the MethodBuilder.
31774 Check for abstract or virtual methods to be public.
31776 * rootcontext.cs (RootContext::CreateType): Register all the
31777 abstract methods required for the class to be complete and the
31778 interface methods that must be implemented.
31780 * cs-parser.jay: Report error 501 (method requires body if it is
31781 not marked abstract or extern).
31783 * expression.cs (TypeOf::Emit): Implement.
31785 * typemanager.cs: runtime_handle_type, new global type.
31787 * class.cs (Property::Emit): Generate code for properties.
31789 2001-10-02 Ravi Pratap <ravi@ximian.com>
31791 * expression.cs (Unary::ResolveOperator): Find operators on base type
31792 too - we now conform exactly to the spec.
31794 (Binary::ResolveOperator): Same here.
31796 * class.cs (Operator::Define): Fix minor quirk in the tests.
31798 * ../errors/cs0215.cs : Added.
31800 * ../errors/cs0556.cs : Added.
31802 * ../errors/cs0555.cs : Added.
31804 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31806 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
31807 single integer which is really efficient
31809 2001-10-01 Ravi Pratap <ravi@ximian.com>
31811 * expression.cs (Expression::ImplicitUserConversion): Use location
31812 even in the case when we are examining True operators.
31814 * class.cs (Operator::Define): Perform extensive checks to conform
31815 with the rules for operator overloading in the spec.
31817 * expression.cs (Expression::ImplicitReferenceConversion): Implement
31818 some of the other conversions mentioned in the spec.
31820 * typemanager.cs (array_type): New static member for the System.Array built-in
31823 (cloneable_interface): For System.ICloneable interface.
31825 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
31826 we start resolving the tree and populating types.
31828 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
31830 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31832 * expression.cs (Expression::ExprClassFromMemberInfo,
31833 Expression::Literalize): Create literal expressions from
31834 FieldInfos which are literals.
31836 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
31837 type casts, because they were wrong. The test suite in tests
31840 (ImplicitNumericConversion): ushort to ulong requires a widening
31843 Int32 constant to long requires widening cast as well.
31845 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
31846 for integers because the type on the stack is not i4.
31848 2001-09-30 Miguel de Icaza <miguel@ximian.com>
31850 * expression.cs (report118): require location argument.
31852 * parameter.cs: Do not dereference potential null value.
31854 * class.cs: Catch methods that lack the `new' keyword when
31855 overriding a name. Report warnings when `new' is used without
31856 anything being there to override.
31858 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
31860 * class.cs: Only add constructor to hashtable if it is non-null
31861 (as now constructors can fail on define).
31863 (TypeManager, Class, Struct): Take location arguments.
31865 Catch field instance initialization in structs as errors.
31867 accepting_filter: a new filter for FindMembers that is static so
31868 that we dont create an instance per invocation.
31870 (Constructor::Define): Catch errors where a struct constructor is
31873 * cs-parser.jay: Pass location information for various new
31876 * delegate.cs (Delegate): take a location argument.
31878 * driver.cs: Do not call EmitCode if there were problesm in the
31879 Definition of the types, as many Builders wont be there.
31881 * decl.cs (Decl::Decl): Require a location argument.
31883 * cs-tokenizer.cs: Handle properly hex constants that can not fit
31884 into integers, and find the most appropiate integer for it.
31886 * literal.cs: Implement ULongLiteral.
31888 * rootcontext.cs: Provide better information about the location of
31889 failure when CreateType fails.
31891 2001-09-29 Miguel de Icaza <miguel@ximian.com>
31893 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
31896 * expression.cs (Binary::CheckShiftArguments): Add missing type
31898 (Binary::ResolveOperator): Add type to the logical and and logical
31899 or, Bitwise And/Or and Exclusive Or code paths, it was missing
31902 (Binary::DoNumericPromotions): In the case where either argument
31903 is ulong (and most signed types combined with ulong cause an
31904 error) perform implicit integer constant conversions as well.
31906 2001-09-28 Miguel de Icaza <miguel@ximian.com>
31908 * expression.cs (UserImplicitCast): Method should always be
31910 (Invocation::BetterConversion): Simplified test for IntLiteral.
31912 (Expression::ImplicitNumericConversion): Split this routine out.
31913 Put the code that performs implicit constant integer conversions
31916 (Expression::Resolve): Become a wrapper around DoResolve so we can
31917 check eclass and type being set after resolve.
31919 (Invocation::Badness): Remove this dead function
31921 (Binary::ResolveOperator): Do not compute the expensive argumnets
31922 unless we have a union for it.
31924 (Probe::Emit): Is needs to do an isinst and then
31925 compare against null.
31927 (::CanConvert): Added Location argument. If the Location argument
31928 is null (Location.Null), then we do not report errors. This is
31929 used by the `probe' mechanism of the Explicit conversion. We do
31930 not want to generate an error for something that the user
31931 explicitly requested to be casted. But the pipeline for an
31932 explicit cast first tests for potential implicit casts.
31934 So for now, if the Location is null, it means `Probe only' to
31935 avoid adding another argument. Might have to revise this
31938 (ClassCast): New class used to type cast objects into arbitrary
31939 classes (used in Explicit Reference Conversions).
31941 Implement `as' as well.
31943 Reverted all the patches from Ravi below: they were broken:
31945 * The use of `level' as a mechanism to stop recursive
31946 invocations is wrong. That was there just to catch the
31947 bug with a strack trace but not as a way of addressing
31950 To fix the problem we have to *understand* what is going
31951 on and the interactions and come up with a plan, not
31952 just get things going.
31954 * The use of the type conversion cache that I proposed
31955 last night had an open topic: How does this work across
31956 protection domains. A user defined conversion might not
31957 be public in the location where we are applying the
31958 conversion, a different conversion might be selected
31959 (ie, private A->B (better) but public B->A (worse),
31960 inside A, A->B applies, but outside it, B->A will
31963 * On top of that (ie, even if the above is solved),
31964 conversions in a cache need to be abstract. Ie, `To
31965 convert from an Int to a Short use an OpcodeCast', not
31966 `To convert from an Int to a Short use the OpcodeCast on
31967 the variable 5' (which is what this patch was doing).
31969 2001-09-28 Ravi Pratap <ravi@ximian.com>
31971 * expression.cs (Invocation::ConversionExists): Re-write to use
31972 the conversion cache
31974 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
31975 cache all conversions done, not just user-defined ones.
31977 (Invocation::BetterConversion): The real culprit. Use ConversionExists
31978 to determine if a conversion exists instead of acutually trying to
31979 perform the conversion. It's faster too.
31981 (Expression::ConvertExplicit): Modify to use ConversionExists to check
31982 and only then attempt the implicit conversion.
31984 2001-09-28 Ravi Pratap <ravi@ximian.com>
31986 * expression.cs (ConvertImplicit): Use a cache for conversions
31987 already found. Check level of recursion and bail out if necessary.
31989 2001-09-28 Miguel de Icaza <miguel@ximian.com>
31991 * typemanager.cs (string_concat_string_string, string_concat_object_object):
31992 Export standard methods that we expect for string operations.
31994 * statement.cs (Block::UsageWarning): Track usage of variables and
31995 report the errors for not used variables.
31997 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
32000 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32002 * codegen.cs: remove unnneded code
32004 * expression.cs: Removed BuiltinTypeAccess class
32006 Fix the order in which implicit conversions are
32009 The previous fixed dropped support for boxed conversions (adding a
32010 test to the test suite now)
32012 (UserImplicitCast::CanConvert): Remove test for source being null,
32013 that code is broken. We should not feed a null to begin with, if
32014 we do, then we should track the bug where the problem originates
32015 and not try to cover it up here.
32017 Return a resolved expression of type UserImplicitCast on success
32018 rather than true/false. Ravi: this is what I was talking about,
32019 the pattern is to use a static method as a "constructor" for
32022 Also, do not create arguments until the very last minute,
32023 otherwise we always create the arguments even for lookups that
32024 will never be performed.
32026 (UserImplicitCast::Resolve): Eliminate, objects of type
32027 UserImplicitCast are born in a fully resolved state.
32029 * typemanager.cs (InitCoreTypes): Init also value_type
32030 (System.ValueType).
32032 * expression.cs (Cast::Resolve): First resolve the child expression.
32034 (LValue): Add new method AddressOf to be used by
32037 Change the argument of Store to take an EmitContext instead of an
32038 ILGenerator, because things like FieldExpr need to be able to call
32039 their children expression to generate the instance code.
32041 (Expression::Error, Expression::Warning): Sugar functions for
32044 (Expression::MemberLookup): Accept a TypeContainer instead of a
32045 Report as the first argument.
32047 (Expression::ResolvePrimary): Killed. I still want to improve
32048 this as currently the code is just not right.
32050 (Expression::ResolveMemberAccess): Simplify, but it is still
32053 (Unary::Resolve): Catch errors in AddressOf operators.
32055 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
32056 index to a byte for the short-version, or the compiler will choose
32057 the wrong Emit call, which generates the wrong data.
32059 (ParameterReference::Emit, ::Store): same.
32061 (FieldExpr::AddressOf): Implement.
32063 * typemanager.cs: TypeManager: made public variable instead of
32066 * driver.cs: document --fatal.
32068 * report.cs (ErrorMessage, WarningMessage): new names for the old
32069 Error and Warning classes.
32071 * cs-parser.jay (member_access): Turn built-in access to types
32072 into a normal simplename
32074 2001-09-27 Ravi Pratap <ravi@ximian.com>
32076 * expression.cs (Invocation::BetterConversion): Fix to cope
32077 with q being null, since this was introducing a bug.
32079 * expression.cs (ConvertImplicit): Do built-in conversions first.
32081 2001-09-27 Ravi Pratap <ravi@ximian.com>
32083 * expression.cs (UserImplicitCast::Resolve): Fix bug.
32085 2001-09-27 Ravi Pratap <ravi@ximian.com>
32087 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
32088 I had introduced long ago (what's new ?).
32090 * expression.cs (UserImplicitCast::CanConvert): Static method to do
32091 the work of all the checking.
32092 (ConvertImplicit): Call CanConvert and only then create object if necessary.
32093 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
32095 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
32096 that is the right way.
32098 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
32099 overloading resolution. Use everywhere instead of cutting and pasting code.
32101 (Binary::ResolveOperator): Use MakeUnionSet.
32103 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
32104 we have to convert to bool types. Not complete yet.
32106 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32108 * typemanager.cs (TypeManager::CSharpName): support ushort.
32110 * expression.cs (Expression::TryImplicitIntConversion): Attempts
32111 to provide an expression that performsn an implicit constant int
32112 conversion (section 6.1.6).
32113 (Expression::ConvertImplicitRequired): Reworked to include
32114 implicit constant expression conversions.
32116 (Expression::ConvertNumericExplicit): Finished.
32118 (Invocation::Emit): If InstanceExpression is null, then it means
32119 that we perform a call on this.
32121 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32123 * expression.cs (Unary::Emit): Remove some dead code.
32124 (Probe): Implement Resolve and Emit for `is'.
32125 (Expression::ConvertImplicitRequired): Attempt to do constant
32126 expression conversions here. Maybe should be moved to
32127 ConvertImplicit, but I am not sure.
32128 (Expression::ImplicitLongConstantConversionPossible,
32129 Expression::ImplicitIntConstantConversionPossible): New functions
32130 that tell whether is it possible to apply an implicit constant
32131 expression conversion.
32133 (ConvertNumericExplicit): Started work on explicit numeric
32136 * cs-parser.jay: Update operator constants.
32138 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
32139 (Parameters::GetSignature): Hook up VerifyArgs here.
32140 (Parameters::VerifyArgs): Verifies that no two arguments have the
32143 * class.cs (Operator): Update the operator names to reflect the
32144 ones that the spec expects (as we are just stringizing the
32147 * expression.cs (Unary::ResolveOperator): Fix bug: Use
32148 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
32149 previous usage did only work for our methods.
32150 (Expression::ConvertImplicit): Handle decimal implicit numeric
32151 conversions as well.
32152 (Expression::InternalTypeConstructor): Used to invoke constructors
32153 on internal types for default promotions.
32155 (Unary::Emit): Implement special handling for the pre/post
32156 increment/decrement for overloaded operators, as they need to have
32157 the same semantics as the other operators.
32159 (Binary::ResolveOperator): ditto.
32160 (Invocation::ConversionExists): ditto.
32161 (UserImplicitCast::Resolve): ditto.
32163 2001-09-26 Ravi Pratap <ravi@ximian.com>
32165 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
32166 operator, return after emitting body. Regression tests pass again !
32168 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
32169 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
32170 (Invocation::OverloadResolve): Ditto.
32171 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
32173 * everywhere : update calls to the above methods accordingly.
32175 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32177 * assign.cs (Assign): Make it inherit from ExpressionStatement.
32179 * expression.cs (ExpressionStatement): New base class used for
32180 expressions that can appear in statements, so that we can provide
32181 an alternate path to generate expression that do not leave a value
32184 (Expression::Emit, and all the derivatives): We no longer return
32185 whether a value is left on the stack or not. Every expression
32186 after being emitted leaves a single value on the stack.
32188 * codegen.cs (EmitContext::EmitStatementExpression): Use the
32189 facilties of ExpressionStatement if possible.
32191 * cs-parser.jay: Update statement_expression.
32193 2001-09-25 Miguel de Icaza <miguel@ximian.com>
32195 * driver.cs: Change the wording of message
32197 2001-09-25 Ravi Pratap <ravi@ximian.com>
32199 * expression.cs (Binary::ResolveOperator): Had forgottten to set
32200 the type of the expression to the return type of the method if
32201 we have an overloaded operator match ! The regression tests pass again !
32202 (Unary::ResolveOperator): Ditto.
32204 * expression.cs (Invocation::ConversionExists): Correct the member lookup
32205 to find "op_Implicit", not "implicit" ;-)
32206 (UserImplicitCast): New class to take care of user-defined implicit conversions.
32207 (ConvertImplicit, ForceConversion): Take TypeContainer argument
32209 * everywhere : Correct calls to the above accordingly.
32211 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
32212 (ConvertImplicit): Do user-defined conversion if it exists.
32214 2001-09-24 Miguel de Icaza <miguel@ximian.com>
32216 * assign.cs: track location.
32217 (Resolve): Use implicit conversions on assignment.
32219 * literal.cs: Oops. Not good, Emit of short access values should
32220 pass (Bytes) or the wrong argument will be selected.
32222 * expression.cs (Unary::Emit): Emit code for -expr.
32224 (Unary::ResolveOperator): Handle `Substract' for non-constants
32225 (substract from zero from the non-constants).
32226 Deal with Doubles as well.
32228 (Expression::ConvertImplicitRequired): New routine that reports an
32229 error if no implicit conversion exists.
32231 (Invocation::OverloadResolve): Store the converted implicit
32232 expressions if we make them
32234 2001-09-24 Ravi Pratap <ravi@ximian.com>
32236 * class.cs (ConstructorInitializer): Take a Location argument.
32237 (ConstructorBaseInitializer): Same here.
32238 (ConstructorThisInitializer): Same here.
32240 * cs-parser.jay : Update all calls accordingly.
32242 * expression.cs (Unary, Binary, New): Take location argument.
32243 Update accordingly everywhere.
32245 * cs-parser.jay : Update all calls to the above to take a location
32248 * class.cs : Ditto.
32250 2001-09-24 Ravi Pratap <ravi@ximian.com>
32252 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
32253 (Invocation::BetterConversion): Same here
32254 (Invocation::ConversionExists): Ditto.
32256 (Invocation::ConversionExists): Implement.
32258 2001-09-22 Ravi Pratap <ravi@ximian.com>
32260 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
32261 Also take an additional TypeContainer argument.
32263 * All over : Pass in TypeContainer as argument to OverloadResolve.
32265 * typemanager.cs (CSharpName): Update to check for the string type and return
32268 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
32271 2001-09-21 Ravi Pratap <ravi@ximian.com>
32273 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
32274 (Invocation::BetterFunction): Implement.
32275 (Invocation::BetterConversion): Implement.
32276 (Invocation::ConversionExists): Skeleton, no implementation yet.
32278 Okay, things work fine !
32280 2001-09-21 Miguel de Icaza <miguel@ximian.com>
32282 * typemanager.cs: declare and load enum_type, delegate_type and
32285 * expression.cs (Expression::Emit): Now emit returns a value that
32286 tells whether a value is left on the stack or not. This strategy
32287 might be reveted tomorrow with a mechanism that would address
32288 multiple assignments.
32289 (Expression::report118): Utility routine to report mismatches on
32292 (Unary::Report23): Report impossible type/operator combination
32295 (Unary::IsIncrementableNumber): Whether the type can be
32296 incremented or decremented with add.
32297 (Unary::ResolveOperator): Also allow enumerations to be bitwise
32299 (Unary::ResolveOperator): Implement ++, !, ~,
32301 (Invocation::Emit): Deal with new Emit convetion.
32303 * All Expression derivatives: Updated their Emit method to return
32304 whether they leave values on the stack or not.
32306 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
32307 stack for expressions that are statements.
32309 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32311 * expression.cs (LValue): New interface. Must be implemented by
32313 (LocalVariableReference, ParameterReference, FieldExpr): Implement
32316 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
32317 interface for generating code, simplifies the code.
32319 2001-09-20 Ravi Pratap <ravi@ximian.com>
32321 * expression.cs (everywhere): Comment out return statements in ::Resolve
32322 methods to avoid the warnings.
32324 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32326 * driver.cs (parse): Report error 2001 if we can not open the
32329 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
32332 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
32335 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
32336 otherwise nested blocks end up with the same index.
32338 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
32340 * expression.cs: Instead of having FIXMEs in the Resolve
32341 functions, throw exceptions so it is obvious that we are facing a
32344 * cs-parser.jay (invocation_expression): Pass Location information.
32346 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
32347 Use a basename for those routines because .NET does not like paths
32350 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
32353 2001-09-19 Miguel de Icaza <miguel@ximian.com>
32355 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
32356 are loading the correct data types (throws an exception if not).
32357 (TypeManager::InitCoreTypes): Use CoreLookupType
32359 * expression.cs (Unary::ResolveOperator): return the child
32360 expression for expressions which are just +expr.
32361 (Unary::ResolveOperator): Return negative literals for -LITERAL
32362 expressions (otherwise they are Unary {Literal}).
32363 (Invocation::Badness): Take into account `Implicit constant
32364 expression conversions'.
32366 * literal.cs (LongLiteral): Implement long literal class.
32367 (IntLiteral): export the `Value' of the intliteral.
32369 2001-09-19 Ravi Pratap <ravi@ximian.com>
32371 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
32373 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
32374 instead of 'Operator'
32376 * expression.cs (Binary::ResolveOperator): Update accordingly.
32377 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
32380 * cs-parser.jay (unary_expression): Update to use the new names.
32382 * gen-treedump.cs (GetUnary): Same here.
32384 * expression.cs (Unary::Resolve): Implement.
32385 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
32386 operators are found instead of making noise ;-)
32387 (Unary::ResolveOperator): New method to do precisely the same thing which
32388 Binary::ResolveOperator does for Binary expressions.
32389 (Unary.method, .Arguments): Add.
32390 (Unary::OperName): Implement.
32391 (Unary::ForceConversion): Copy and Paste !
32393 * class.cs (Operator::Define): Fix a small bug for the case when we have
32396 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
32397 for the inbuilt operators. Only overloading works for now ;-)
32399 2001-09-18 Miguel de Icaza <miguel@ximian.com>
32401 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
32402 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
32404 * expression.cs (This::Emit): Implement.
32405 (This::Resolve): Implement.
32406 (TypeOf:Resolve): Implement.
32407 (Expression::ResolveSimpleName): Add an implicit this to instance
32409 (MemberAccess::Resolve): Deal with Parameters and Fields.
32410 Bind instance variable to Field expressions.
32411 (FieldExpr::Instance): New field used to track the expression that
32412 represents the object instance.
32413 (FieldExpr::Resolve): Track potential errors from MemberLookup not
32415 (FieldExpr::Emit): Implement.
32417 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
32418 the last instruction contains a return opcode to avoid generating
32419 the last `ret' instruction (this generates correct code, and it is
32420 nice to pass the peverify output).
32422 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
32423 initializer for static and instance variables.
32424 (Constructor::Emit): Allow initializer to be null in the case of
32425 static constructors. Only emit initializer for instance
32428 (TypeContainer::FindMembers): Return a null array if there are no
32431 Also fix the code for the MemberTypes.Method branch, as it was not
32432 scanning that for operators (or tried to access null variables before).
32434 * assign.cs (Assign::Emit): Handle instance and static fields.
32438 * driver.cs: Stop compilation if there are parse errors.
32440 * cs-parser.jay (constructor_declaration): Provide default base
32441 initializer for non-static constructors.
32442 (constructor_declarator): Do not provide a default base
32443 initializers if none was specified.
32444 Catch the fact that constructors should not have parameters.
32446 * class.cs: Do not emit parent class initializers for static
32447 constructors, that should be flagged as an error.
32449 2001-09-18 Ravi Pratap <ravi@ximian.com>
32451 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
32452 Move back code into TypeContainer::Populate.
32454 2001-09-18 Ravi Pratap <ravi@ximian.com>
32456 * class.cs (TypeContainer::AddConstructor): Fix the check to
32457 compare against Name, not Basename.
32458 (Operator::OpType): Change Plus and Minus to Add and Subtract.
32460 * cs-parser.jay : Update accordingly.
32462 * class.cs (TypeContainer::FindMembers): For the case where we are searching
32463 for methods, don't forget to look into the operators too.
32464 (RegisterMethodBuilder): Helper method to take care of this for
32465 methods, constructors and operators.
32466 (Operator::Define): Completely revamp.
32467 (Operator.OperatorMethod, MethodName): New fields.
32468 (TypeContainer::Populate): Move the registering of builders into
32469 RegisterMethodBuilder.
32470 (Operator::Emit): Re-write.
32472 * expression.cs (Binary::Emit): Comment out code path to emit method
32473 invocation stuff for the case when we have a user defined operator. I am
32474 just not able to get it right !
32476 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32478 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
32481 (Expression::MemberLookup): Provide a version that allows to
32482 specify the MemberTypes and BindingFlags.
32484 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
32485 so it was not fetching variable information from outer blocks.
32487 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
32488 Beforefieldinit as it was buggy.
32490 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
32491 that Ravi put here.
32493 * class.cs (Constructor::Emit): Only emit if block is not null.
32494 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
32495 deal with this by semantically definining it as if the user had
32498 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
32499 constructors as we now "emit" them at a higher level.
32501 (TypeContainer::DefineDefaultConstructor): Used to define the
32502 default constructors if none was provided.
32504 (ConstructorInitializer): Add methods Resolve and Emit.
32506 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
32508 2001-09-17 Ravi Pratap <ravi@ximian.com>
32510 * class.cs (TypeContainer::EmitDefaultConstructor): Register
32511 the default constructor builder with our hashtable for methodbuilders
32514 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
32515 and argument_count is 0 in which case we have a match.
32516 (Binary::ResolveOperator): More null checking and miscellaneous coding
32519 2001-09-17 Ravi Pratap <ravi@ximian.com>
32521 * rootcontext.cs (IsNameSpace): Compare against null.
32523 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
32525 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
32526 and Unary::Operator.
32528 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
32531 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
32532 we have overloaded operators.
32533 (Binary::ResolveOperator): Implement the part which does the operator overload
32536 * class.cs (Operator::Emit): Implement.
32537 (TypeContainer::Emit): Emit the operators we have too.
32539 * expression.cs (Binary::Emit): Update to emit the appropriate code for
32540 the case when we have a user-defined operator.
32542 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32544 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
32546 2001-09-16 Ravi Pratap <ravi@ximian.com>
32548 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
32549 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
32550 (Constructor::Emit): Implement.
32551 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
32552 if we have no work to do.
32553 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
32556 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
32557 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
32559 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
32562 2001-09-15 Ravi Pratap <ravi@ximian.com>
32564 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
32566 (Tree::RecordNamespace): Method to do what the name says ;-)
32567 (Tree::Namespaces): Property to get at the namespaces hashtable.
32569 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
32572 * rootcontext.cs (IsNamespace): Fixed it :-)
32574 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32576 * class.cs (TypeContainer::FindMembers): Add support for
32578 (MethodCore): New class that encapsulates both the shared aspects
32579 of a Constructor and a Method.
32580 (Method, Constructor): Factored pieces into MethodCore.
32582 * driver.cs: Added --fatal which makes errors throw exceptions.
32583 Load System assembly as well as part of the standard library.
32585 * report.cs: Allow throwing exceptions on errors for debugging.
32587 * modifiers.cs: Do not use `parent', instead use the real type
32588 container to evaluate permission settings.
32590 * class.cs: Put Ravi's patch back in. He is right, and we will
32591 have to cope with the
32593 2001-09-14 Ravi Pratap <ravi@ximian.com>
32595 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
32596 FamORAssem, not FamANDAssem.
32598 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32600 * driver.cs: Added --parse option that only parses its input files
32603 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
32604 incorrect. IsTopLevel is not used to tell whether an object is
32605 root_types or not (that can be achieved by testing this ==
32606 root_types). But to see if this is a top-level *class* (not
32607 necessarly our "toplevel" container).
32609 2001-09-14 Ravi Pratap <ravi@ximian.com>
32611 * enum.cs (Enum::Define): Modify to call the Lookup method on the
32612 parent instead of a direct call to GetType.
32614 2001-09-14 Ravi Pratap <ravi@ximian.com>
32616 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
32617 Modifiers.TypeAttr. This should just be a call to that method.
32619 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
32620 object so that we can determine if we are top-level or not.
32622 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
32625 * enum.cs (Enum::Define): Ditto.
32627 * modifiers.cs (FieldAttr): Re-write.
32629 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
32630 (TypeContainer::HaveStaticConstructor): New property to provide access
32631 to precisely that info.
32633 * modifiers.cs (MethodAttr): Re-write.
32634 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
32636 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
32637 of top-level types as claimed.
32639 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32641 * expression.cs (MemberLookup): Fruitless attempt to lookup
32642 constructors. Maybe I need to emit default constructors? That
32643 might be it (currently .NET emits this for me automatically).
32644 (Invocation::OverloadResolve): Cope with Arguments == null.
32645 (Invocation::EmitArguments): new function, shared by the new
32646 constructor and us.
32647 (Invocation::Emit): Handle static and instance methods. Emit
32648 proper call instruction for virtual or non-virtual invocations.
32649 (New::Emit): Implement.
32650 (New::Resolve): Implement.
32651 (MemberAccess:Resolve): Implement.
32652 (MethodGroupExpr::InstanceExpression): used conforming to the spec
32653 to track instances.
32654 (FieldExpr::Resolve): Set type.
32656 * support.cs: Handle empty arguments.
32658 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
32659 SimpleLookup): Auxiliary routines to help parse a qualifier
32662 Update qualifier_identifier rule.
32664 * codegen.cs: Removed debugging messages.
32666 * class.cs: Make this a global thing, this acts just as a "key" to
32667 objects that we might have around.
32669 (Populate): Only initialize method_builders_to_methods once.
32671 * expression.cs (PropertyExpr): Initialize type from the
32674 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
32675 Resolve pattern. Attempt to implicitly convert value to boolean.
32678 * expression.cs: Set the type for the int32/int32 argument case.
32679 (Binary::ResolveOperator): Set the return type to boolean for
32680 comparission operators
32682 * typemanager.cs: Remove debugging print code.
32684 (Invocation::Resolve): resolve type.
32686 * class.cs: Allocate a MemberInfo of the correct size, as the code
32687 elsewhere depends on the test to reflect the correct contents.
32689 (Method::) Keep track of parameters, due to System.Reflection holes
32691 (TypeContainer::Populate): Keep track of MethodBuilders to Method
32694 (TypeContainer::FindMembers): Use ArrayList and then copy an array
32695 of the exact size and return that.
32697 (Class::LookupMethodByBuilder): New function that maps
32698 MethodBuilders to its methods. Required to locate the information
32699 on methods because System.Reflection bit us again.
32701 * support.cs: New file, contains an interface ParameterData and
32702 two implementations: ReflectionParameters and InternalParameters
32703 used to access Parameter information. We will need to grow this
32706 * expression.cs (Invocation::GetParameterData): implement a cache
32707 and a wrapper around the ParameterData creation for methods.
32708 (Invocation::OverloadResolve): Use new code.
32710 2001-09-13 Ravi Pratap <ravi@ximian.com>
32712 * class.cs (TypeContainer::EmitField): Remove and move into
32713 (Field::Define): here and modify accordingly.
32714 (Field.FieldBuilder): New member.
32715 (TypeContainer::Populate): Update accordingly.
32716 (TypeContainer::FindMembers): Implement.
32718 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32720 * statement.cs: (VariableInfo::VariableType): New field to be
32721 initialized with the full type once it is resolved.
32723 2001-09-12 Miguel de Icaza <miguel@ximian.com>
32725 * parameter.cs (GetParameterInfo): Use a type cache to compute
32726 things only once, and to reuse this information
32728 * expression.cs (LocalVariableReference::Emit): Implement.
32729 (OpcodeCast::Emit): fix.
32731 (ParameterReference::Resolve): Implement.
32732 (ParameterReference::Emit): Implement.
32734 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
32735 that are expressions need to stay as Expressions.
32737 * typemanager.cs (CSharpName): Returns the C# name of a type if
32740 * expression.cs (Expression::ConvertImplicit): New function that
32741 implements implicit type conversions.
32743 (Expression::ImplicitReferenceConversion): Implements implicit
32744 reference conversions.
32746 (EmptyCast): New type for transparent casts.
32748 (OpcodeCast): New type for casts of types that are performed with
32749 a sequence of bytecodes.
32751 (BoxedCast): New type used for casting value types into reference
32752 types. Emits a box opcode.
32754 (Binary::DoNumericPromotions): Implements numeric promotions of
32755 and computation of the Binary::Type.
32757 (Binary::EmitBranchable): Optimization.
32759 (Binary::Emit): Implement code emission for expressions.
32761 * typemanager.cs (TypeManager): Added two new core types: sbyte
32764 2001-09-12 Ravi Pratap <ravi@ximian.com>
32766 * class.cs (TypeContainer::FindMembers): Method which does exactly
32767 what Type.FindMembers does, only we don't have to use reflection. No
32768 implementation yet.
32770 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
32771 typecontainer objects as we need to get at them.
32772 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
32774 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
32775 typecontainer object.
32777 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
32778 of just a Report object.
32780 2001-09-11 Ravi Pratap <ravi@ximian.com>
32782 * class.cs (Event::Define): Go back to using the prefixes "add_" and
32784 (TypeContainer::Populate): Now define the delegates of the type too.
32785 (TypeContainer.Delegates): Property to access the list of delegates defined
32788 * delegates.cs (Delegate::Define): Implement partially.
32790 * modifiers.cs (TypeAttr): Handle more flags.
32792 2001-09-11 Ravi Pratap <ravi@ximian.com>
32794 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
32796 (Operator::Define): Re-write logic to get types by using the LookupType method
32797 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
32798 (Indexer::Define): Ditto.
32799 (Event::Define): Ditto.
32800 (Property::Define): Ditto.
32802 2001-09-10 Ravi Pratap <ravi@ximian.com>
32804 * class.cs (TypeContainer::Populate): Now define operators too.
32805 (TypeContainer.Operators): New property to access the list of operators
32807 (Operator.OperatorMethodBuilder): New member to hold the method builder
32808 for the operator we are defining.
32809 (Operator::Define): Implement.
32811 2001-09-10 Ravi Pratap <ravi@ximian.com>
32813 * class.cs (Event::Define): Make the prefixes of the accessor methods
32814 addOn_ and removeOn_
32816 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
32817 of the location being passed in too. Ideally, this should go later since all
32818 error reporting should be done through the Report object.
32820 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
32821 (Populate): Iterate thru the indexers we have and define them too.
32822 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
32823 for the get and set accessors.
32824 (Indexer::Define): Implement.
32826 2001-09-09 Miguel de Icaza <miguel@ximian.com>
32828 * expression.cs (Binary::Resolve): Beginning of it. I scratched
32829 my previous implementation, did not work.
32831 * typemanager.cs: Add a couple of missing types (the longs).
32833 * literal.cs: Use TypeManager.bool_type instead of getting it.
32835 * expression.cs (EventExpr): New kind of expressions.
32836 (Expressio::ExprClassFromMemberInfo): finish
32838 2001-09-08 Miguel de Icaza <miguel@ximian.com>
32840 * assign.cs: Emit stores to static fields differently.
32842 2001-09-08 Ravi Pratap <ravi@ximian.com>
32844 * Merge in changes and adjust code to tackle conflicts. Backed out my
32845 code in Assign::Resolve ;-)
32847 2001-09-08 Ravi Pratap <ravi@ximian.com>
32849 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
32850 instead Report.Error and also pass in the location.
32851 (CSharpParser::Lexer): New readonly property to return the reference
32852 to the Tokenizer object.
32853 (declare_local_variables): Use Report.Error with location instead of plain
32857 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
32858 (Operator.CheckBinaryOperator): Ditto.
32860 * cs-parser.jay (operator_declarator): Update accordingly.
32862 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
32863 (CheckBinaryOperator): Same here.
32865 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
32866 on the name without any prefixes of namespace names etc. This is because we
32867 already might have something already fully qualified like
32868 'System.Console.WriteLine'
32870 * assign.cs (Resolve): Begin implementation. Stuck ;-)
32872 2001-09-07 Ravi Pratap <ravi@ximian.com>
32874 * cs-tokenizer.cs (location): Return a string which also contains
32877 * expression.cs (ElementAccess): New class for expressions of the
32878 type 'element access.'
32879 (BaseAccess): New class for expressions of the type 'base access.'
32880 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
32883 * cs-parser.jay (element_access): Implement action.
32884 (base_access): Implement actions.
32885 (checked_expression, unchecked_expression): Implement.
32887 * cs-parser.jay (local_variable_type): Correct and implement.
32888 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
32890 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
32892 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
32893 name and the specifiers.
32895 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
32897 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
32898 making them all public ;-)
32900 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
32903 2001-09-07 Miguel de Icaza <miguel@ximian.com>
32905 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
32907 (FieldExpr, PropertyExprs): New resolved expressions.
32908 (SimpleName::MemberStaticCheck): Perform static checks for access
32909 to non-static fields on static methods. Maybe this should be
32910 generalized for MemberAccesses.
32911 (SimpleName::ResolveSimpleName): More work on simple name
32914 * cs-parser.jay (primary_expression/qualified_identifier): track
32915 the parameter index.
32917 * codegen.cs (CodeGen::Save): Catch save exception, report error.
32918 (EmitContext::EmitBoolExpression): Chain to expression generation
32919 instead of temporary hack.
32920 (::EmitStatementExpression): Put generic expression code generation.
32922 * assign.cs (Assign::Emit): Implement variable assignments to
32923 local variables, parameters and fields.
32925 2001-09-06 Miguel de Icaza <miguel@ximian.com>
32927 * statement.cs (Block::GetVariableInfo): New method, returns the
32928 VariableInfo for a variable name in a block.
32929 (Block::GetVariableType): Implement in terms of GetVariableInfo
32931 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
32932 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
32934 2001-09-06 Ravi Pratap <ravi@ximian.com>
32936 * cs-parser.jay (operator_declaration): Continue on my quest : update
32937 to take attributes argument.
32938 (event_declaration): Ditto.
32939 (enum_declaration): Ditto.
32940 (indexer_declaration): Ditto.
32942 * class.cs (Operator::Operator): Update constructor accordingly.
32943 (Event::Event): Ditto.
32945 * delegate.cs (Delegate::Delegate): Same here.
32947 * enum.cs (Enum::Enum): Same here.
32949 2001-09-05 Ravi Pratap <ravi@ximian.com>
32951 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
32953 * ../tests/cs0658.cs : New file to demonstrate error 0658.
32955 * attribute.cs (Attributes): New class to encapsulate all attributes which were
32956 being passed around as an arraylist.
32957 (Attributes::AddAttribute): Method to add attribute sections.
32959 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
32960 (struct_declaration): Update accordingly.
32961 (constant_declaration): Update.
32962 (field_declaration): Update.
32963 (method_header): Update.
32964 (fixed_parameter): Update.
32965 (parameter_array): Ditto.
32966 (property_declaration): Ditto.
32967 (destructor_declaration): Ditto.
32969 * class.cs (Struct::Struct): Update constructors accordingly.
32970 (Class::Class): Ditto.
32971 (Field::Field): Ditto.
32972 (Method::Method): Ditto.
32973 (Property::Property): Ditto.
32974 (TypeContainer::OptAttribute): update property's return type.
32976 * interface.cs (Interface.opt_attributes): New member.
32977 (Interface::Interface): Update to take the extra Attributes argument.
32979 * parameter.cs (Parameter::Parameter): Ditto.
32981 * constant.cs (Constant::Constant): Ditto.
32983 * interface.cs (InterfaceMemberBase): New OptAttributes field.
32984 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
32985 the attributes as a parameter.
32986 (InterfaceProperty): Update constructor call.
32987 (InterfaceEvent): Ditto.
32988 (InterfaceMethod): Ditto.
32989 (InterfaceIndexer): Ditto.
32991 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
32992 pass the attributes too.
32993 (interface_event_declaration): Ditto.
32994 (interface_property_declaration): Ditto.
32995 (interface_method_declaration): Ditto.
32996 (interface_declaration): Ditto.
32998 2001-09-05 Miguel de Icaza <miguel@ximian.com>
33000 * class.cs (Method::Define): Track the "static Main" definition to
33001 create an entry point.
33003 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
33004 EntryPoint if we find it.
33006 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
33007 (EmitContext::ig): Make this variable public.
33009 * driver.cs: Make the default output file be the first file name
33010 with the .exe extension.
33012 Detect empty compilations
33014 Handle various kinds of output targets. Handle --target and
33015 rename -t to --dumper.
33017 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
33018 methods inherited from Expression return now an Expression. This
33019 will is used during the tree rewriting as we resolve them during
33022 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
33023 the spec. Missing entirely is the information about
33024 accessability of elements of it.
33026 (Expression::ExprClassFromMemberInfo): New constructor for
33027 Expressions that creates a fully initialized Expression based on
33028 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
33031 (Invocation::Resolve): Begin implementing resolution of invocations.
33033 * literal.cs (StringLiteral): Implement Emit.
33035 2001-09-05 Ravi Pratap <ravi@ximian.com>
33037 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
33040 2001-09-04 Ravi Pratap <ravi@ximian.com>
33042 * cs-parser.jay (attribute_arguments): Implement actions.
33043 (attribute): Fix bug in production. Implement action.
33044 (attribute_list): Implement.
33045 (attribute_target): Implement.
33046 (attribute_target_specifier, opt_target_specifier): Implement
33047 (CheckAttributeTarget): New method to check if the attribute target
33049 (attribute_section): Implement.
33050 (opt_attributes): Implement.
33052 * attribute.cs : New file to handle attributes.
33053 (Attribute): Class to hold attribute info.
33055 * cs-parser.jay (opt_attribute_target_specifier): Remove production
33056 (attribute_section): Modify production to use 2 different rules to
33057 achieve the same thing. 1 s/r conflict down !
33058 Clean out commented, useless, non-reducing dimension_separator rules.
33060 * class.cs (TypeContainer.attributes): New member to hold list
33061 of attributes for a type.
33062 (Struct::Struct): Modify to take one more argument, the attribute list.
33063 (Class::Class): Ditto.
33064 (Field::Field): Ditto.
33065 (Method::Method): Ditto.
33066 (Property::Property): Ditto.
33068 * cs-parser.jay (struct_declaration): Update constructor call to
33069 pass in the attributes too.
33070 (class_declaration): Ditto.
33071 (constant_declaration): Ditto.
33072 (field_declaration): Ditto.
33073 (method_header): Ditto.
33074 (fixed_parameter): Ditto.
33075 (parameter_array): Ditto.
33076 (property_declaration): Ditto.
33078 * constant.cs (Constant::Constant): Update constructor similarly.
33079 Use System.Collections.
33081 * parameter.cs (Parameter::Parameter): Update as above.
33083 2001-09-02 Ravi Pratap <ravi@ximian.com>
33085 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
33086 (TypeContainer.delegates): New member to hold list of delegates.
33088 * cs-parser.jay (delegate_declaration): Implement the action correctly
33089 this time as I seem to be on crack ;-)
33091 2001-09-02 Miguel de Icaza <miguel@ximian.com>
33093 * rootcontext.cs (RootContext::IsNamespace): new function, used to
33094 tell whether an identifier represents a namespace.
33096 * expression.cs (NamespaceExpr): A namespace expression, used only
33097 temporarly during expression resolution.
33098 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
33099 utility functions to resolve names on expressions.
33101 2001-09-01 Miguel de Icaza <miguel@ximian.com>
33103 * codegen.cs: Add hook for StatementExpressions.
33105 * class.cs: Fix inverted test for static flag in methods.
33107 2001-09-02 Ravi Pratap <ravi@ximian.com>
33109 * class.cs (Operator::CheckUnaryOperator): Correct error number used
33110 to make it coincide with MS' number.
33111 (Operator::CheckBinaryOperator): Ditto.
33113 * ../errors/errors.txt : Remove error numbers added earlier.
33115 * ../errors/cs1019.cs : Test case for error # 1019
33117 * ../errros/cs1020.cs : Test case for error # 1020
33119 * cs-parser.jay : Clean out commented cruft.
33120 (dimension_separators, dimension_separator): Comment out. Ostensibly not
33121 used anywhere - non-reducing rule.
33122 (namespace_declarations): Non-reducing rule - comment out.
33124 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
33125 with TypeContainer::AddEnum.
33127 * delegate.cs : New file for delegate handling classes.
33128 (Delegate): Class for declaring delegates.
33130 * makefile : Update.
33132 * cs-parser.jay (delegate_declaration): Implement.
33134 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
33136 * class.cs (Event::Define): Implement.
33137 (Event.EventBuilder): New member.
33139 * class.cs (TypeContainer::Populate): Update to define all enums and events
33141 (Events): New property for the events arraylist we hold. Shouldn't we move to using
33142 readonly fields for all these cases ?
33144 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33146 * class.cs (Property): Revamp to use the convention of making fields readonly.
33147 Accordingly modify code elsewhere.
33149 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
33150 the Define method of the Property class.
33152 * class.cs : Clean up applied patch and update references to variables etc. Fix
33154 (TypeContainer::Populate): Update to define all the properties we have. Also
33155 define all enumerations.
33157 * enum.cs (Define): Implement.
33159 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33161 * cs-parser.jay (overloadable_operator): The semantic value is an
33162 enum of the Operator class.
33163 (operator_declarator): Implement actions.
33164 (operator_declaration): Implement.
33166 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
33167 validity of definitions.
33168 (Operator::CheckBinaryOperator): Static method to check for binary operators
33169 (TypeContainer::AddOperator): New method to add an operator to a type.
33171 * cs-parser.jay (indexer_declaration): Added line to actually call the
33172 AddIndexer method so it gets added ;-)
33174 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
33175 already taken care of by the MS compiler ?
33177 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33179 * class.cs (Operator): New class for operator declarations.
33180 (Operator::OpType): Enum for the various operators.
33182 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33184 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
33185 ostensibly handle this in semantic analysis.
33187 * cs-parser.jay (general_catch_clause): Comment out
33188 (specific_catch_clauses, specific_catch_clause): Ditto.
33189 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
33190 (catch_args, opt_catch_args): New productions.
33191 (catch_clause): Rewrite to use the new productions above
33192 (catch_clauses): Modify accordingly.
33193 (opt_catch_clauses): New production to use in try_statement
33194 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
33195 and re-write the code in the actions to extract the specific and
33196 general catch clauses by being a little smart ;-)
33198 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
33199 Hooray, try and catch statements parse fine !
33201 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33203 * statement.cs (Block::GetVariableType): Fix logic to extract the type
33204 string from the hashtable of variables.
33206 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
33207 I end up making that mistake ;-)
33208 (catch_clauses): Fixed gross error which made Key and Value of the
33209 DictionaryEntry the same : $1 !!
33211 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33213 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
33215 * cs-parser.jay (event_declaration): Correct to remove the semicolon
33216 when the add and remove accessors are specified.
33218 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33220 * cs-parser.jay (IndexerDeclaration): New helper class to hold
33221 information about indexer_declarator.
33222 (indexer_declarator): Implement actions.
33223 (parsing_indexer): New local boolean used to keep track of whether
33224 we are parsing indexers or properties. This is necessary because
33225 implicit_parameters come into picture even for the get accessor in the
33226 case of an indexer.
33227 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
33229 * class.cs (Indexer): New class for indexer declarations.
33230 (TypeContainer::AddIndexer): New method to add an indexer to a type.
33231 (TypeContainer::indexers): New member to hold list of indexers for the
33234 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33236 * cs-parser.jay (add_accessor_declaration): Implement action.
33237 (remove_accessor_declaration): Implement action.
33238 (event_accessors_declaration): Implement
33239 (variable_declarators): swap statements for first rule - trivial.
33241 * class.cs (Event): New class to hold information about event
33243 (TypeContainer::AddEvent): New method to add an event to a type
33244 (TypeContainer::events): New member to hold list of events.
33246 * cs-parser.jay (event_declaration): Implement actions.
33248 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33250 * cs-parser.jay (dim_separators): Implement. Make it a string
33251 concatenating all the commas together, just as they appear.
33252 (opt_dim_separators): Modify accordingly
33253 (rank_specifiers): Update accordingly. Basically do the same
33254 thing - instead, collect the brackets here.
33255 (opt_rank_sepcifiers): Modify accordingly.
33256 (array_type): Modify to actually return the complete type string
33257 instead of ignoring the rank_specifiers.
33258 (expression_list): Implement to collect the expressions
33259 (variable_initializer): Implement. We make it a list of expressions
33260 essentially so that we can handle the array_initializer case neatly too.
33261 (variable_initializer_list): Implement.
33262 (array_initializer): Make it a list of variable_initializers
33263 (opt_array_initializer): Modify accordingly.
33265 * expression.cs (New::NType): Add enumeration to help us
33266 keep track of whether we have an object/delegate creation
33267 or an array creation.
33268 (New:NewType, New::Rank, New::Indices, New::Initializers): New
33269 members to hold data about array creation.
33270 (New:New): Modify to update NewType
33271 (New:New): New Overloaded contructor for the array creation
33274 * cs-parser.jay (array_creation_expression): Implement to call
33275 the overloaded New constructor.
33277 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
33279 * class.cs (TypeContainer::Constructors): Return member
33280 constructors instead of returning null.
33282 2001-08-26 Miguel de Icaza <miguel@ximian.com>
33284 * typemanager.cs (InitCoreTypes): Initialize the various core
33285 types after we have populated the type manager with the user
33286 defined types (this distinction will be important later while
33287 compiling corlib.dll)
33289 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
33290 on Expression Classification. Now all expressions have a method
33291 `Resolve' and a method `Emit'.
33293 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
33294 generation from working. Also add some temporary debugging
33297 2001-08-24 Miguel de Icaza <miguel@ximian.com>
33299 * codegen.cs: Lots of code generation pieces. This is only the
33300 beginning, will continue tomorrow with more touches of polish. We
33301 handle the fundamentals of if, while, do, for, return. Others are
33302 trickier and I need to start working on invocations soon.
33304 * gen-treedump.cs: Bug fix, use s.Increment here instead of
33307 * codegen.cs (EmitContext): New struct, used during code
33308 emission to keep a context. Most of the code generation will be
33311 * cs-parser.jay: Add embedded blocks to the list of statements of
33312 this block. So code generation proceeds in a top down fashion.
33314 2001-08-23 Miguel de Icaza <miguel@ximian.com>
33316 * statement.cs: Add support for multiple child blocks.
33318 2001-08-22 Miguel de Icaza <miguel@ximian.com>
33320 * codegen.cs (EmitCode): New function, will emit the code for a
33321 Block of code given a TypeContainer and its ILGenerator.
33323 * statement.cs (Block): Standard public readonly optimization.
33324 (Block::Block constructors): Link children.
33325 (Block::Child): Child Linker.
33326 (Block::EmitVariables): Emits IL variable declarations.
33328 * class.cs: Drop support for MethodGroups here, delay until
33330 (Method::): Applied the same simplification that I did before, and
33331 move from Properties to public readonly fields.
33332 (Method::ParameterTypes): Returns the parameter types for the
33333 function, and implements a cache that will be useful later when I
33334 do error checking and the semantic analysis on the methods is
33336 (Constructor::GetCallingConvention): Renamed from CallingConvetion
33337 and made a method, optional argument tells whether this is a class
33338 or a structure to apply the `has-this' bit.
33339 (Method::GetCallingConvention): Implement, returns the calling
33341 (Method::Define): Defines the type, a second pass is performed
33342 later to populate the methods.
33344 (Constructor::ParameterTypes): implement a cache similar to the
33345 one on Method::ParameterTypes, useful later when we do semantic
33348 (TypeContainer::EmitMethod): New method. Emits methods.
33350 * expression.cs: Removed MethodGroup class from here.
33352 * parameter.cs (Parameters::GetCallingConvention): new method.
33354 2001-08-21 Miguel de Icaza <miguel@ximian.com>
33356 * class.cs (TypeContainer::Populate): Drop RootContext from the
33359 (Constructor::CallingConvention): Returns the calling convention.
33360 (Constructor::ParameterTypes): Returns the constructor parameter
33363 (TypeContainer::AddConstructor): Keep track of default constructor
33364 and the default static constructor.
33366 (Constructor::) Another class that starts using `public readonly'
33367 instead of properties.
33369 (Constructor::IsDefault): Whether this is a default constructor.
33371 (Field::) use readonly public fields instead of properties also.
33373 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
33374 track of static constructors; If none is used, turn on
33375 BeforeFieldInit in the TypeAttributes.
33377 * cs-parser.jay (opt_argument_list): now the return can be null
33378 for the cases where there are no arguments.
33380 (constructor_declarator): If there is no implicit `base' or
33381 `this', then invoke the default parent constructor.
33383 * modifiers.cs (MethodAttr): New static function maps a set of
33384 modifiers flags into a MethodAttributes enum
33385 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
33386 MethodAttr, TypeAttr to represent the various mappings where the
33387 modifiers are used.
33388 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
33390 2001-08-19 Miguel de Icaza <miguel@ximian.com>
33392 * parameter.cs (GetParameterInfo): Fix bug where there would be no
33395 * interface.cs (PopulateIndexer): Implemented the code generator
33396 for interface indexers.
33398 2001-08-17 Miguel de Icaza <miguel@ximian.com>
33400 * interface.cs (InterfaceMemberBase): Now we track the new status
33403 (PopulateProperty): Implement property population. Woohoo! Got
33404 Methods and Properties going today.
33406 Removed all the properties for interfaces, and replaced them with
33407 `public readonly' fields.
33409 2001-08-16 Miguel de Icaza <miguel@ximian.com>
33411 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
33412 initialize their hashtables/arraylists only when they are needed
33413 instead of doing this always.
33415 * parameter.cs: Handle refs and out parameters.
33417 * cs-parser.jay: Use an ArrayList to construct the arguments
33418 instead of the ParameterCollection, and then cast that to a
33421 * parameter.cs: Drop the use of ParameterCollection and use
33422 instead arrays of Parameters.
33424 (GetParameterInfo): Use the Type, not the Name when resolving
33427 2001-08-13 Miguel de Icaza <miguel@ximian.com>
33429 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
33430 and instead use public readonly fields.
33432 * class.cs: Put back walking code for type containers.
33434 2001-08-11 Miguel de Icaza <miguel@ximian.com>
33436 * class.cs (MakeConstant): Code to define constants.
33438 * rootcontext.cs (LookupType): New function. Used to locate types
33441 2001-08-08 Miguel de Icaza <miguel@ximian.com>
33443 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
33444 this System.Reflection code is. Kudos to Microsoft
33446 * typemanager.cs: Implement a type cache and avoid loading all
33447 types at boot time. Wrap in LookupType the internals. This made
33448 the compiler so much faster. Wow. I rule!
33450 * driver.cs: Make sure we always load mscorlib first (for
33451 debugging purposes, nothing really important).
33453 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
33454 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
33456 * rootcontext.cs: Lookup types on their namespace; Lookup types
33457 on namespaces that have been imported using the `using' keyword.
33459 * class.cs (TypeContainer::TypeAttr): Virtualize.
33460 (Class::TypeAttr): Return attributes suitable for this bad boy.
33461 (Struct::TypeAttr): ditto.
33462 Handle nested classes.
33463 (TypeContainer::) Remove all the type visiting code, it is now
33464 replaced with the rootcontext.cs code
33466 * rootcontext.cs (GetClassBases): Added support for structs.
33468 2001-08-06 Miguel de Icaza <miguel@ximian.com>
33470 * interface.cs, statement.cs, class.cs, parameter.cs,
33471 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
33472 Drop use of TypeRefs, and use strings instead.
33474 2001-08-04 Miguel de Icaza <miguel@ximian.com>
33478 * class.cs (Struct::Struct): set the SEALED flags after
33479 checking the modifiers.
33480 (TypeContainer::TypeAttr): new property, returns the
33481 TypeAttributes for a class.
33483 * cs-parser.jay (type_list): Oops, list production was creating a
33484 new list of base types.
33486 * rootcontext.cs (StdLib): New property.
33487 (GetInterfaceTypeByName): returns an interface by type name, and
33488 encapsulates error handling here.
33489 (GetInterfaces): simplified.
33490 (ResolveTree): Encapsulated all the tree resolution here.
33491 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
33494 * driver.cs: Add support for --nostdlib, to avoid loading the
33495 default assemblies.
33496 (Main): Do not put tree resolution here.
33498 * rootcontext.cs: Beginning of the class resolution.
33500 2001-08-03 Miguel de Icaza <miguel@ximian.com>
33502 * rootcontext.cs: Provide better error reporting.
33504 * cs-parser.jay (interface_base): set our $$ to be interfaces.
33506 * rootcontext.cs (CreateInterface): Handle the case where there
33507 are no parent interfaces.
33509 (CloseTypes): Routine to flush types at the end.
33510 (CreateInterface): Track types.
33511 (GetInterfaces): Returns an array of Types from the list of
33512 defined interfaces.
33514 * typemanager.c (AddUserType): Mechanism to track user types (puts
33515 the type on the global type hash, and allows us to close it at the
33518 2001-08-02 Miguel de Icaza <miguel@ximian.com>
33520 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
33521 RecordInterface instead.
33523 * cs-parser.jay: Updated to reflect changes above.
33525 * decl.cs (Definition): Keep track of the TypeBuilder type that
33526 represents this type here. Not sure we will use it in the long
33527 run, but wont hurt for now.
33529 * driver.cs: Smaller changes to accomodate the new code.
33531 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
33534 * rootcontext.cs (CreateInterface): New method, used to create
33535 the System.TypeBuilder type for interfaces.
33536 (ResolveInterfaces): new entry point to resolve the interface
33538 (CodeGen): Property, used to keep track of the code generator.
33540 2001-07-26 Miguel de Icaza <miguel@ximian.com>
33542 * cs-parser.jay: Add a second production for delegate_declaration
33545 (enum_body): Put an opt_comma here instead of putting it on
33546 enum_body or enum_member_declarations so we can handle trailing
33547 commas on enumeration members. Gets rid of a shift/reduce.
33549 (type_list): Need a COMMA in the middle.
33551 (indexer_declaration): Tell tokenizer to recognize get/set
33553 * Remove old targets.
33555 * Re-add the parser target.
33557 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33559 * cs-parser.jay: Add precendence rules for a number of operators
33560 ot reduce the number of shift/reduce conflicts in the grammar.
33562 2001-07-17 Miguel de Icaza <miguel@ximian.com>
33564 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
33567 Get rid of old crufty code.
33569 * rootcontext.cs: Use this to keep track of the parsed
33570 representation and the defined types available to the program.
33572 * gen-treedump.cs: adjust for new convention.
33574 * type.cs: Split out the type manager, and the assembly builder
33577 * typemanager.cs: the type manager will live here now.
33579 * cil-codegen.cs: And the code generator here.
33581 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
33583 * makefile: Fixed up for easy making.
33585 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33587 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
33590 (unary_expression): Expand pre_increment_expression and
33591 post_decrement_expression to reduce a shift/reduce.
33593 2001-07-11 Simon Cozens
33595 * cs-tokenizer.cs: Hex numbers should begin with a 0.
33597 Improve allow_keyword_as_indent name.
33599 2001-06-19 Miguel de Icaza <miguel@ximian.com>
33601 * Adjustments for Beta2.
33603 2001-06-13 Miguel de Icaza <miguel@ximian.com>
33605 * decl.cs: Added `Define' abstract method.
33606 (InTransit): new property, used to catch recursive definitions.
33608 * interface.cs: Implement `Define'.
33610 * modifiers.cs: Map Modifiers.constants to
33611 System.Reflection.TypeAttribute flags.
33613 * class.cs: Keep track of types and user-defined types.
33614 (BuilderInit): New method for creating an assembly
33615 (ResolveType): New function to launch the resolution process, only
33616 used by interfaces for now.
33618 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
33619 that are inserted into the name space.
33621 2001-06-08 Miguel de Icaza <miguel@ximian.com>
33623 * ARGH. I have screwed up my tree so many times due to the use of
33624 rsync rather than using CVS. Going to fix this at once.
33626 * driver.cs: Objetify driver. Load assemblies, use assemblies to
33629 2001-06-07 Miguel de Icaza <miguel@ximian.com>
33631 * Experiment successful: Use System.Type rather that our own
33634 2001-05-25 Miguel de Icaza <miguel@ximian.com>
33636 * cs-parser.jay: Removed nsAliases from here.
33638 Use new namespaces, handle `using XXX;'
33640 * namespace.cs: Reimplemented namespace handling, use a recursive
33641 definition of the class. Now we can keep track of using clauses
33642 and catch invalid using clauses.
33644 2001-05-24 Miguel de Icaza <miguel@ximian.com>
33646 * gen-treedump.cs: Adapted for all the renaming.
33648 * expression.cs (Expression): this class now has a Type property
33649 which returns an expression Type.
33651 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
33652 `Type', as this has a different meaning now in the base
33654 2001-05-22 Miguel de Icaza <miguel@ximian.com>
33656 * interface.cs, class.cs: Removed from all the sources the
33657 references to signature computation, as we can not do method
33658 signature computation during the parsing time, as we are not
33659 trying to solve at that point distinguishing:
33663 void a (NS.Blah x) {}
33666 Which depending on the context might be valid or not, as we do not
33667 know if Blah is the same thing as NS.Blah at that point.
33669 * Redid everything so the code uses TypeRefs now instead of
33670 Types. TypeRefs are just temporary type placeholders, that need
33671 to be resolved. They initially have a pointer to a string and the
33672 current scope in which they are used. This is used later by the
33673 compiler to resolve the reference to an actual Type.
33675 * DeclSpace is no longer a CIR.Type, and neither are
33676 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
33677 are all DeclSpaces, but no Types.
33679 * type.cs (TypeRefManager): This implements the TypeRef manager,
33680 which keeps track of all the types that need to be resolved after
33681 the parsing has finished.
33683 2001-05-13 Miguel de Icaza <miguel@ximian.com>
33685 * ARGH. We are going to have to store `foreach' as a class rather
33686 than resolving it, as we need to verify error 1579 after name
33687 resolution. *OR* we could keep a flag that says `This request to
33688 IEnumerator comes from a foreach statement' which we can then use
33689 to generate the error.
33691 2001-05-10 Miguel de Icaza <miguel@ximian.com>
33693 * class.cs (TypeContainer.AddMethod): we now add methods to the
33694 MethodGroup instead of the method hashtable.
33696 * expression.cs: Add MethodGroup abstraction, which gets us one
33697 step closer to the specification in the way we handle method
33700 * cs-parser.jay (primary_expression): qualified_identifier now
33701 tried to match up an identifier to a local variable reference or
33702 to a parameter reference.
33704 current_local_parameters is now a parser global variable that
33705 points to the current parameters for the block, used during name
33708 (property_declaration): Now creates an implicit `value' argument to
33711 2001-05-09 Miguel de Icaza <miguel@ximian.com>
33713 * parameter.cs: Do not use `param' arguments as part of the
33714 signature, per the spec.
33716 2001-05-08 Miguel de Icaza <miguel@ximian.com>
33718 * decl.cs: Base class for classes, structs and interfaces. This
33719 is the "Declaration Space"
33721 * cs-parser.jay: Use CheckDef for checking declaration errors
33722 instead of having one on each function.
33724 * class.cs: Factor out some code for handling error handling in
33725 accordance to the "Declarations" section in the "Basic Concepts"
33726 chapter in the ECMA C# spec.
33728 * interface.cs: Make all interface member classes derive from
33729 InterfaceMemberBase.
33731 2001-05-07 Miguel de Icaza <miguel@ximian.com>
33733 * Many things: all interfaces are parsed and generated in
33734 gen-treedump. Support for member variables, constructors,
33735 destructors, properties, constants is there.
33737 Beginning of the IL backend, but very little done, just there for
33740 2001-04-29 Miguel de Icaza <miguel@ximian.com>
33742 * cs-parser.jay: Fix labeled statement.
33744 * cs-tokenizer.cs (escape): Escape " and ' always.
33745 ref_line, ref_name: keep track of the line/filename as instructed
33746 by #line by the compiler.
33749 2001-04-27 Miguel de Icaza <miguel@ximian.com>
33751 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
33752 to match the values in System.CodeDOM.
33754 Divid renamed to Divide.
33756 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
33758 (Statements.set): remove.
33760 * System.CodeDOM/CodeCatchClause.cs: always have a valid
33763 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
33764 falseStatements always have valid values.
33766 * cs-parser.jay: Use System.CodeDOM now.