1 2010-05-21 Marek Safar <marek.safar@gmail.com>
3 * expression.cs: Use constrained prefix more broadly to avoid boxing.
5 2010-05-20 Marek Safar <marek.safar@gmail.com>
8 * nullable.cs: Don't double wrap same expression.
10 2010-05-20 Marek Safar <marek.safar@gmail.com>
13 * anonymous.cs: Any issued error in probing mode means no match.
15 2010-05-20 Marek Safar <marek.safar@gmail.com>
17 * expression.cs: Search for base indexer using the closest match
20 2010-05-20 Marek Safar <marek.safar@gmail.com>
23 * method.cs: Set override constraints using unexpanded interface
26 2010-05-20 Marek Safar <marek.safar@gmail.com>
29 * ecore.cs: Include secondary extension method lookup in probing
32 2010-05-19 Marek Safar <marek.safar@gmail.com>
35 * typespec.cs (MayBecomeEqualGenericTypes): Recursively check
38 2010-05-19 Marek Safar <marek.safar@gmail.com>
41 * pending.cs: Advance counter correctly.
43 2010-05-19 Marek Safar <marek.safar@gmail.com>
46 * method.cs, pending.cs: Indexer override uses base name.
48 2010-05-19 Marek Safar <marek.safar@gmail.com>
51 * generic.cs: Replace original with inflated type parameter on
54 2010-05-19 Marek Safar <marek.safar@gmail.com>
57 * parameter.cs: Extension attribute can be defined in each assembly.
59 2010-05-18 Marek Safar <marek.safar@gmail.com>
62 * method.cs: Only one method can implement an interface.
64 2010-05-18 Marek Safar <marek.safar@gmail.com>
67 * convert.cs, constant.cs, expression.cs, literal.cs, ecore.cs:
68 Typed null can be used as a source for expression methods.
70 2010-05-18 Marek Safar <marek.safar@gmail.com>
73 * namespace.cs: Using directive imports only types and not nested
76 2010-05-17 Marek Safar <marek.safar@gmail.com>
78 * typespec.cs, expression.cs, statement.cs, ecore.cs, complete.cs,
79 delegate.cs: Member instance is resolved after member overload
80 definitely resolves static/instance property of member expression.
81 Fixes #545047, #358848, #456605, #460016, #603299
83 2010-05-12 Marek Safar <marek.safar@gmail.com>
86 * generic.cs, decl.cs, anonymous.cs: Reset more type arguments
87 details for nested anonymous methods stories.
89 2010-05-11 Marek Safar <marek.safar@gmail.com>
92 * namespace.cs: Don't report namespace collision.
94 2010-05-11 Marek Safar <marek.safar@gmail.com>
97 * class.cs, typespec.cs: Search full imported attribute hierarchy
100 2010-05-11 Marek Safar <marek.safar@gmail.com>
102 * namespace.cs: Ignore missing dependencies failure at
105 2010-05-11 Marek Safar <marek.safar@gmail.com>
107 A fix for bug #604640
108 * namespace.cs: Don't resolve using constraints too early.
110 2010-05-11 Marek Safar <marek.safar@gmail.com>
112 A fix for bug #604239
113 * generic.cs: Copy partial type constraints to partial container.
115 2010-05-10 Marek Safar <marek.safar@gmail.com>
117 A fix for bug #557210
118 * import.cs: Relax underlying enum field rules.
120 2010-05-10 Marek Safar <marek.safar@gmail.com>
122 A fix for bug #603476
123 * property.cs: Implement IParametersMember for indexer accessors.
125 2010-05-07 Marek Safar <marek.safar@gmail.com>
127 A fix for bug #601141
128 * class.cs: Update all partial modifiers.
130 2010-05-06 Marek Safar <marek.safar@gmail.com>
132 A fix for bug #601708
133 * method.cs, membercache.cs: Destructors cannot be hidden.
135 2010-05-06 Marek Safar <marek.safar@gmail.com>
137 A fix for bug #602551
138 * class.cs: Resursive reference of type definition is allowed.
140 2010-05-06 Marek Safar <marek.safar@gmail.com>
142 * anonymous.cs: Mutate cached storey instance types too.
144 2010-05-06 Marek Safar <marek.safar@gmail.com>
146 A fix for bug #602443
147 * convert.cs: Explicit enum conversion cannot involve user operators
149 2010-05-05 Miguel de Icaza <miguel@novell.com>
151 * class.cs (TypeContainer.DefineBaseTypes)
152 (TypeContainer.CheckRecursiveDefinition): check for the iface not
153 being null, as we could have failed resolution and crashed;
156 * cs-parser.jay: Productions to catch common mistakes when other
157 punctuation operators are used instead of comma. Fixes 571702
159 2010-05-05 Marek Safar <marek.safar@gmail.com>
161 * anonymous.cs: Mutate correct set of constraints.
163 2010-05-05 Marek Safar <marek.safar@gmail.com>
165 A fix for bug #602842
166 * expression.cs: Resolve all array bound arguments.
168 2010-05-05 Marek Safar <marek.safar@gmail.com>
170 * import.cs: Don't import private fields.
172 2010-04-30 Marek Safar <marek.safar@gmail.com>
174 Partially based on patch by <sami.lamti@gmail.com>
176 * eval.cs, ecore.cs: Fixed eval show methods.
178 2010-04-30 Marek Safar <marek.safar@gmail.com>
180 * generic.cs, delegate.cs: Implement output type inference of
181 methodgroup now when the specification was cleared at least little
184 2010-04-29 Marek Safar <marek.safar@gmail.com>
186 A fix for bug #575611
187 * class.cs: Fix recursive unmanaged recursice sruct check.
189 2010-04-29 Marek Safar <marek.safar@gmail.com>
191 A fix for bug #479776
192 * expression.cs: Implement typeof unbounded nested generic types.
194 2010-04-29 Marek Safar <marek.safar@gmail.com>
196 A fix for bug #474953
197 * class.cs: Fix valid recursive base type definition.
199 2010-04-29 Marek Safar <marek.safar@gmail.com>
201 A fix for bug #421737
202 * convert.cs, expression.cs: A boxing conversion exists from a
203 nullable-type to a reference type, if a boxing conversion exists
204 from the underlying non-nullable-value-type to the reference type.
206 2010-04-29 Marek Safar <marek.safar@gmail.com>
208 A fix for bug #376875
209 * import.cs: Import volatile modifier.
211 2010-04-29 Marek Safar <marek.safar@gmail.com>
213 A fix for bug #372412
214 * typespec.cs, expression.cs, codegen.cs: Emit readonly prefix for
217 2010-04-29 Marek Safar <marek.safar@gmail.com>
219 A fix for bug #568955
220 * statements.cs: Handle recursive scope initializers.
222 2010-04-28 Marek Safar <marek.safar@gmail.com>
224 A fix for bug #566511
225 * anonymous.cs: Always get inflated version of hoisted variable
226 on generic type definition.
228 2010-04-28 Marek Safar <marek.safar@gmail.com>
230 * import.cs, membercache.cs: Relax rules for valid properties.
232 2010-04-28 Marek Safar <marek.safar@gmail.com>
234 * import.cs: Intern arrays used in generic arguments.
236 2010-04-28 Marek Safar <marek.safar@gmail.com>
238 A fix for bug #600398
239 * convert.cs: Actually use effective base type for the comparison.
241 2010-04-28 Marek Safar <marek.safar@gmail.com>
243 A fix for bug #600326
244 * ecore.cs: Pass arity to base member lookup.
246 2010-04-28 Marek Safar <marek.safar@gmail.com>
248 A fix for bug #573385
249 * expression.cs: MemberAccess is of generic type based on right
252 2010-05-28 Marek Safar <marek.safar@gmail.com>
254 * cs-tokenizer.cs: Made tab size configurable.
256 2010-05-27 Marek Safar <marek.safar@gmail.com>
258 * attribute.cs: Ensure Obsolete members are defined before doing
261 2010-05-27 Marek Safar <marek.safar@gmail.com>
263 * visit.cs: Add DOM visitor skeleton.
267 2010-05-27 Marek Safar <marek.safar@gmail.com>
269 * attribute.cs, codegen.cs: Drop COMPILER_ACCESS hack.
271 2010-05-27 Marek Safar <marek.safar@gmail.com>
273 * *.cs: Major rewrite of compiler internals to better work with
274 unmodified System.Reflection.Emit. Some of the key changes are
275 - TypeSpec replaces reflection specific System.Type.
276 - All Type(TypeSpec) operations are now done in compiler therefore
277 no dependency on SRE to inflate generic members and types or to
278 query unclosed types.
279 - MemberCache is now the only and full hierarchical topology.
280 - Generic constraints are implemented properly.
281 - And as a bonus compilation is on average 30% faster.
283 2010-04-15 Jb Evain <jbevain@novell.com>
285 * dmcs.exe.config: update the runtime version to .net 4.0 RTM.
287 2010-04-12 Marek Safar <marek.safar@gmail.com>
289 * expression.cs, attribute.cs, parameter.cs: More attribute type
292 2010-04-12 Marek Safar <marek.safar@gmail.com>
294 A fix for bug #593342
296 * generic.cs, parameter.cs, argument.cs, field.cs, property.cs,
297 decl.cs, roottypes.cs, constant.cs, nullable.cs, expression.cs,
298 method.cs, ecore.cs, class.cs, delegate.cs, attribute.cs,
299 codegen.cs: Add custom attribute encoder to deal with unfinished
300 types and easier corlib bootstrap from its own types.
302 2010-03-26 Marek Safar <marek.safar@gmail.com>
304 * cs-parser.jay: Report invalid constraint types.
306 2010-03-16 Jb Evain <jbevain@novell.com>
308 * Makefile: rename the net_2_1 profile to moonlight.
310 2010-03-11 Marek Safar <marek.safar@gmail.com>
312 * statement.cs, cs-parser.jay: Use correct location for empty
315 2010-03-11 Marek Safar <marek.safar@gmail.com>
317 * cs-parser.jay: Disable Location from expression.
319 * generic.cs: Check constraints for overrides in the parser.
321 2010-03-09 Marek Safar <marek.safar@gmail.com>
323 * cs-parser.jay (GetLocation): Use an expression when available.
325 2010-03-04 Marek Safar <marek.safar@gmail.com>
327 A fix for bug #582579
328 * ecore.cs (FieldExpr): Don't optimize cross reference loads.
330 2010-03-04 Marek Safar <marek.safar@gmail.com>
332 A patch by kornelpal@gmail.com
334 * dynamic.cs, anonymous.cs, rootcontext.cs, class.cs: Don't make
335 compiler generated classes sealed by default. Emit and close top
336 level compiler generated classes as well.
338 * support.cs: Use RuntimeHelpers.GetHashCode.
340 2010-03-03 Rolf Bjarne Kvinge <RKvinge@novell.com>
342 * Makefile: We need to use the internal bootstrapping gmcs for
343 net_2_1_bootstrap too now.
345 2010-03-02 Raja R Harinath <harinath@hurrynot.org>
347 * expression.cs (IndexerAccess.ResolveAccessor): Add CS1540 check.
349 2010-03-02 Marek Safar <marek.safar@gmail.com>
351 * cs-tokenizer.cs: Missed few locations in previous fix.
353 2010-03-02 Marek Safar <marek.safar@gmail.com>
355 * cs-tokenizer.cs, argument.cs, dynamic.cs, assign.cs, anonymous.cs,
356 nullable.cs, expression.cs, statement.cs, cs-parser.jay, cfold.cs:
357 Report correct location for operator errors.
359 2010-03-02 Marek Safar <marek.safar@gmail.com>
361 * typemanager.cs (IsDynamicType): Don't check external types when
362 the attribute is not external.
364 2010-02-24 Marek Safar <marek.safar@gmail.com>
366 A fix for bug #582579
367 * decl.cs (IsExposedFromAssembly): Use PartialContainer for parent
370 2010-02-24 Marek Safar <marek.safar@gmail.com>
372 A fix for bug #581804
373 * ecore.cs: Fixed type comparison.
375 2010-02-08 Miguel de Icaza <miguel@novell.com>
377 * namespace.cs (CompletionGetTypesStartingWith): Do not include
378 private types in the completion results.
380 * cs-parser.jay: Bubble completions after "from x in ?" and "from x
383 2010-02-17 Marek Safar <marek.safar@gmail.com>
385 * generic.cs, field.cs, decl.cs, cs-parser.jay: Simplify special
388 2010-02-14 Miguel de Icaza <miguel@novell.com>
390 * eval.cs: Do not do the report printer dance unless the user has
391 set the DescribeTypes feature.
393 2010-02-10 Marek Safar <marek.safar@gmail.com>
395 * argument.cs, dynamic.cs, expression.cs: Track RC API changes.
397 2010-02-08 Marek Safar <marek.safar@gmail.com>
399 A fix for bug #577029
400 * anonymous.cs: Fixed TypeBuilder* check.
402 2010-02-06 Miguel de Icaza <miguel@novell.com>
404 * eval.cs (CompileBlock): Also undo if there are problems during
405 semantic analysis, fixes various cases where invalid C# code would
406 be reported, but the internal changes would not be undone.
408 2010-02-03 Miguel de Icaza <miguel@novell.com>
410 * driver.cs: Change the --fatal flag to allow a number to be
411 passed, this ignores the first N fatal errors. Useful to debug
412 errors that do not happen on the first hit.
414 * cs-parser.jay (invocation_expression): accept both the
415 CLOSE_PARENS and COMPLETE_COMPLETION, this allows completions
416 inside an invocation.
418 * driver.cs: Expose FatalErrors.
420 * eval.cs: Initialize the printer's Fatal property from the
421 Driver's FatalError flag, this allows csharp --fatal to work
424 Add support for calling Describe (typeof (TYPE)) if the expression
427 2010-02-02 Marek Safar <marek.safar@gmail.com>
429 A fix for bug #574991
430 * rootcontext.cs, class.cs, driver.cs: Hide enhanced warnings behind
433 2010-02-02 Marek Safar <marek.safar@gmail.com>
435 A fix for bug #575986
436 * expression.cs: Don't mutate typeof type definitions.
438 2010-01-28 Marek Safar <marek.safar@gmail.com>
440 * decl.cs: Use only one set of modifiers.
442 2010-01-26 Marek Safar <marek.safar@gmail.com>
444 A fix for bug #573329
445 * eval.cs: Don't disable error reporting completely on silent mode.
447 2010-01-25 Marek Safar <marek.safar@gmail.com>
449 A fix for bug #573312
450 * constant.cs, expression.cs, ecore.cs: Emit correct offset for
451 pointer index of unknown size types greater than 2.
453 2010-01-15 Marek Safar <marek.safar@gmail.com>
455 * *.cs: Use only 1 member kind enum.
457 2010-01-15 Marek Safar <marek.safar@gmail.com>
459 * *.cs: Add event specification.
461 2010-01-14 Marek Safar <marek.safar@gmail.com>
463 * membercache.cs: Extracted from decl.cs.
465 * *.cs: Put more infrastructure in place.
467 2010-01-13 Marek Safar <marek.safar@gmail.com>
469 * *.cs: Add property specification, unused yet.
471 2010-01-13 Marek Safar <marek.safar@gmail.com>
473 * property.cs: Move all property based declarations into a new file.
475 2010-01-13 Marek Safar <marek.safar at gmail.com>
477 * expression.cs (Conditional): Resolve reduced expression.
479 2010-01-13 Marek Safar <marek.safar at gmail.com>
481 * *.cs: Introduced non-generic method specification.
483 2010-01-07 Marek Safar <marek.safar@gmail.com>
485 * method.cs: Move all method based declarations into a new file.
487 2010-01-07 Marek Safar <marek.safar@gmail.com>
489 * *.cs: Extract field specification.
491 2009-12-17 Marek Safar <marek.safar@gmail.com>
493 * field.cs: Extracted from class.cs
495 2009-12-15 Marek Safar <marek.safar@gmail.com>
497 * attribute.cs (GetFixedBuffer): Work on field definition only.
499 2009-12-15 Marek Safar <marek.safar@gmail.com>
501 * *.cs: Clean up NET_4_0 conditional where possible.
503 2009-12-14 Rodrigo Kumpera <rkumpera@novell.com>
505 support.cs (DynamicType): Assembly property returns the assembly builder.
506 This is required due to how compiler context works in corlib.
508 2009-12-14 Marek Safar <marek.safar@gmail.com>
510 A fix for bug #564376
511 * assign.cs (LocalTemporary): Removed no longer needed special
514 2009-12-11 Marek Safar <marek.safar@gmail.com>
516 * modifiers.cs, decl.cs, iterators.cs, const.cs, anonymous.cs,
517 class.cs, delegate.cs, cs-parser.jay, enum.cs: Turn modifiers into
518 enum for easier debugging.
520 2009-12-10 Marek Safar <marek.safar@gmail.com>
522 * decl.cs, anonymous.cs, class.cs: Sealed Define it's now main entry
525 * parameter.cs, delegate.cs, dynamic.cs: Don't use builder methods
528 2009-12-10 Marek Safar <marek.safar@gmail.com>
530 * cs-parser.jay, statement.cs: Handle parser error in code
533 2009-12-10 Marek Safar <marek.safar@gmail.com>
535 * ecore.cs: Ignore base imported methods when they are already
538 * eval.cs: Handle non-existent keys.
540 * report.cs, driver.cs: Make fatal work with console printer only.
542 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
544 * typemanager.cs (MakeGenericMethod): Fix stupid mistake.
546 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
548 * typemanager.cs: Add MakeGenericMethod that checks if the method
549 is really the generic method definition.
551 ecore.cs (MethodGroupExpr:IsApplicable): Use new TypeManager function
552 to inflate generic methods.
554 2009-12-08 Marek Safar <marek.safar@gmail.com>
556 A fix for bug #561149
557 * anonymous.cs: Use actual type parameters when checking for generic
560 2009-12-08 Marek Safar <marek.safar@gmail.com>
562 A fix for bug #561369
563 * expression.cs (DoNumericPromotion): Fixed typo.
565 2009-12-08 Marek Safar <marek.safar@gmail.com>
567 *.cs: Moving to generics world.
569 cs-parser.jay: Removed current_array_type.
571 2009-12-07 Marek Safar <marek.safar@gmail.com>
573 *.cs: Moving to generics world.
575 2009-12-04 Marek Safar <marek.safar@gmail.com>
577 *.cs: Moving to generics world (day 2).
579 2009-12-03 Marek Safar <marek.safar@gmail.com>
581 *.cs: Moving to generics world.
583 2009-12-02 Marek Safar <marek.safar@gmail.com>
585 * typemanager.cs, parameter.cs, class.cs, delegate.cs, attribute.cs:
586 Encode dynamic type attribute for elements where attributes cannot
589 2009-12-01 Marek Safar <marek.safar@gmail.com>
591 argument.cs, assign.cs, expression.cs, cs-parser.jay: Named
594 2009-12-01 Marek Safar <marek.safar@gmail.com>
596 A fix for bug #360455
597 * class.cs: Never report a unused warning for generic events to
598 workaround wrong expression type.
600 2009-11-30 Marek Safar <marek.safar@gmail.com>
602 A fix for bug #558305
603 * decl.cs, class.cs: Check partial method definitions using correct
606 2009-11-30 Marek Safar <marek.safar@gmail.com>
608 * argument.cs: Don't cache rarely used dynamic flag.
610 2009-11-27 Marek Safar <marek.safar@gmail.com>
612 * cs-parser.jay: Use jay global stacks (saves over 3MB for corlib).
614 2009-11-27 Marek Safar <marek.safar@gmail.com>
616 * ecore.cs (SimpleName): Removed no longer needed in_transit as
617 Resolve is now non-reentrant (saves ~0.6MB for corlib).
619 2009-11-26 Marek Safar <marek.safar@gmail.com>
621 A fix for bug #545081
622 * decl.cs: Check private nested types of nested types recursively.
624 2009-11-26 Marek Safar <marek.safar@gmail.com>
626 A fix for bug #558305
627 * location.cs: Ignore self referencing #line directive
629 2009-11-26 Marek Safar <marek.safar@gmail.com>
631 A fix for bug #558292
632 * class.cs: Allow single unsafe fixed buffer fields.
634 2009-11-26 Marek Safar <marek.safar@gmail.com>
636 * expression: Optimize few more zero-based operations.
638 2009-11-26 Marek Safar <marek.safar@gmail.com>
640 * cs-tokenizer.cs, cs-parser.jay: Simplify literal parsing, also
641 avoids boxing of literal values.
643 2009-11-26 Marek Safar <marek.safar@gmail.com>
645 * cs-tokenizer.cs, argument.cs, eval.cs, linq.cs, decl.cs,
646 expression.cs, ecore.cs, location.cs, cs-parser.jay, attribute.cs,
647 codegen.cs: LocatedToken redesing to avoid excessive allocation and
648 boxing (saves ~7MB for corlib). Also fixes presise token location.
650 2009-11-25 Marek Safar <marek.safar@gmail.com>
652 * ecore.cs, cs-parser.jay: Keep parser structures local. Share
655 2009-11-24 Marek Safar <marek.safar@gmail.com>
657 * expression.cs: Lower static array initializer barrier.
659 * support.cs, driver.cs: Share reader buffer.
661 2009-11-23 Marek Safar <marek.safar@gmail.com>
663 * cs-tokenizer.cs, support.cs: Some tokenizer optimizations.
665 2009-11-23 Marek Safar <marek.safar@gmail.com>
667 * cs-tokenizer.cs, support.cs: Use Dictionary instead of Hashtable,
668 cleanup some obsolete code.
670 2009-11-20 Marek Safar <marek.safar@gmail.com>
672 * context.cs, expression.cs, ecore.cs, complete.cs: Cleaned up
675 2009-11-20 Marek Safar <marek.safar@gmail.com>
677 * *.cs: Resolved expressions are never resolved again, this helps to
678 uncover some not easy to find bugs and improve the performance.
680 2009-11-19 Marek Safar <marek.safar@gmail.com>
682 * *.cs: Made constant expressions fully compatible with any other
685 2009-11-19 Marek Safar <marek.safar@gmail.com>
687 * *.cs: DoResolve is a worker method and has to be protected.
689 2009-11-18 Marek Safar <marek.safar@gmail.com>
691 * *.cs: More context specific handling.
693 2009-11-17 Marek Safar <marek.safar@gmail.com>
695 * *.cs: More context specific handling.
697 2009-11-16 Marek Safar <marek.safar@gmail.com>
699 * dynamic.cs, class.cs: Removed few fixed user types conversions.
701 * symbolwriter.cs: Uses public ILOffset.
703 2009-11-13 Marek Safar <marek.safar@gmail.com>
705 A fix for bug #553650
706 * generic.cs: Another missing TypeToCoreType, still too many to fix.
708 2009-11-13 Marek Safar <marek.safar@gmail.com>
710 A fix for bug #555170
712 * class.cs, delegate.cs, enum.cs: Constants have to be available
713 for parameters resolve.
715 2009-11-12 Marek Safar <marek.safar@gmail.com>
717 * typemanager.cs, argument.cs, support.cs, delegate.cs: Dynamic
720 2009-11-12 Marek Safar <marek.safar@gmail.com>
722 * argument.cs, context.cs, expression.cs, ecore.cs: Dynamic binding
723 with a statically known candidate set.
725 2009-11-11 Scott Peterson <lunchtimemama@gmail.com>
727 * generic.cs: Made type inflation for generic constraint checks
728 recursive. This fixes BGO #553655.
730 2009-11-11 Marek Safar <marek.safar@gmail.com>
732 * dynamic.cs, decl.cs, expression.cs, ecore.cs: More dynamic type
735 2009-11-10 Marek Safar <marek.safar@gmail.com>
737 * typemanager.cs, generic.cs, parameter.cs, argument.cs, dynamic.cs,
738 linq.cs, rootcontext.cs, ecore.cs, class.cs, delegate.cs,
739 attribute.cs: Add some dynamic error checking.
741 2009-11-07 Marek Safar <marek.safar@gmail.com>
743 A fix for bug #553465
745 * expression.cs: Fixed mixed version of expression tree anonymous
748 2009-11-06 Marek Safar <marek.safar@gmail.com>
750 A fix for bug #553031
752 * linq.cs, expression.cs, class.cs, cs-parser.jay: Initialize
753 expression tree version of anonymous type with members declaration.
755 2009-11-05 Marek Safar <marek.safar@gmail.com>
757 * parameter.cs: Handle nullable parameter default expression.
759 * argument.cs, dynamic.cs, expression.cs, support.cs, ecore.cs,
760 class.cs, attribute.cs: Check for wrong dynamic arguments.
762 2009-11-05 Marek Safar <marek.safar@gmail.com>
764 * statement.cs: Dynamic statements.
766 2009-11-04 Marek Safar <marek.safar@gmail.com>
768 * dynamic.cs, assign.cs, context.cs, expression.cs, ecore.cs:
769 Compound assignments over dynamic type.
771 2009-11-03 Marek Safar <marek.safar@gmail.com>
773 * argument.cs, dynamic.cs, expression.cs, delegate.cs: Dynamic
774 constructor arguments.
776 2009-10-30 Marek Safar <marek.safar@gmail.com>
778 * dynamic.cs, convert.cs, assign.cs, constant.cs, expression.cs,
779 codegen.cs: Unary mutator on dynamic member access expression.
781 2009-10-29 Marek Safar <marek.safar@gmail.com>
783 A fix for bug #550580
784 * convert.cs: Don't eliminate explicit precission casts.
786 2009-10-28 Marek Safar <marek.safar@gmail.com>
788 A fix for bug #550404
790 * parameter.cs, iterators.cs, context.cs, anonymous.cs,
791 expression.cs, statement.cs, ecore.cs: Quote any nested expression
794 2009-10-27 Marek Safar <marek.safar@gmail.com>
796 * constant.cs, nullable.cs: Create nullable-null as LiftedNull
799 * class.cs: Allow nullable binary user operators.
801 2009-10-26 Marek Safar <marek.safar@gmail.com>
803 * expression.cs: Move binary expression optimization at the end of
806 2009-10-23 Marek Safar <marek.safar@gmail.com>
808 * constant.cs, nullable.cs, expression.cs, literal.cs, cfold.cs:
809 Separate NullConstant from NullLiteral.
811 2009-10-23 Marek Safar <marek.safar@gmail.com>
813 * typemanager.cs, eval.cs, decl.cs, roottypes.cs, context.cs,
814 anonymous.cs, expression.cs, rootcontext.cs, ecore.cs, class.cs,
815 flowanalysis.cs, cs-parser.jay, driver.cs, codegen.cs: Split
816 ModuleContainer. Add common unclosed member check routine.
818 2009-10-22 Marek Safar <marek.safar@gmail.com>
820 * argument.cs: Use literal flag for real literals only.
822 * dynamic.cs: Use correct return type for custom delegates.
824 2009-10-22 Marek Safar <marek.safar@gmail.com>
826 * dynamic.cs, expression.cs: Pass logical binary flag to dynamic
829 2009-10-22 Marek Safar <marek.safar@gmail.com>
831 * dynamic.cs, ecore.cs: Dynamic invocation with void return type.
833 2009-10-21 Marek Safar <marek.safar@gmail.com>
835 * dynamic.cs, convert.cs, expression.cs, ecore.cs: Wrap array index
838 2009-10-21 Marek Safar <marek.safar@gmail.com>
840 * typemanager.cs, dynamic.cs, expression.cs: Don't resolve runtime
843 2009-10-20 Marek Safar <marek.safar@gmail.com>
845 * argument.cs, dynamic.cs, expression.cs: Latest API update.
847 2009-10-19 Marek Safar <marek.safar@gmail.com>
849 * typemanager.cs, expression.cs: Dynamic array initializer.
851 2009-10-16 Marek Safar <marek.safar@gmail.com>
853 * typemanager.cs, rootcontext.cs: Clear -nostdlib flag when object
856 2009-10-16 Marek Safar <marek.safar@gmail.com>
858 A fix for bug #493523, #507067
859 * convert.cs, nullable.cs, expression.cs: Do implicit and explicit
860 standard nullable conversion using underlying standard conversion
861 and not full conversion.
863 2009-10-15 Marek Safar <marek.safar@gmail.com>
865 * dynamic.cs, expression.cs, ecore.cs, delegate.cs: Check return
866 type in VerifyArgumentsCompat.
868 2009-10-15 Marek Safar <marek.safar@gmail.com>
870 * nullable.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
871 Reject variable used with type arguments.
873 2009-10-14 Marek Safar <marek.safar@gmail.com>
875 * argument.cs, dynamic.cs, assign.cs, expression.cs, ecore.cs:
876 Implement dynamic expressions assignment.
878 2009-10-14 Marek Safar <marek.safar@gmail.com>
880 * expression.cs: Build underlying expression when resolving unary
883 2009-10-14 Marek Safar <marek.safar@gmail.com>
885 * expression.cs: Emit enum array initializer using binary blob.
887 2009-10-08 Marek Safar <marek.safar@gmail.com>
889 * typemanager.cs, constant.cs: Optimize decimal constants which fit
892 2009-10-07 Marek Safar <marek.safar@gmail.com>
894 * typemanager.cs: Reset object_type.
896 * assign: Made SimpleAssign public.
898 2009-10-06 Marek Safar <marek.safar@gmail.com>
900 * typemanager.cs, decl.cs, namespace.cs, ecore.cs, class.cs: Pass
901 invocation assembly to IsThisOrFriendAssembly.
903 2009-10-05 Marek Safar <marek.safar@gmail.com>
905 * expression.cs: Equality comparison of generic parameter with
908 2009-10-05 Marek Safar <marek.safar@gmail.com>
910 A fix for bug #543570
911 * generic.cs: Import predefined constraints correctly.
913 2009-10-02 Marek Safar <marek.safar@gmail.com>
915 * ecore.cs: Don't crash on overloads with optional paremeters where
916 arguments count overflows.
918 * parameter.cs: Import optional parameter constants using optional
921 2009-10-01 Marek Safar <marek.safar@gmail.com>
923 * Makefile: Default is gmcs compiler.
925 2009-10-01 Marek Safar <marek.safar@gmail.com>
927 * cs-parser.jay: Fixed few NRE.
929 2009-10-01 Marek Safar <marek.safar@gmail.com>
931 * cs-parser.jay, driver.cs: Expose parser exception in verbose mode.
933 2009-09-30 Marek Safar <marek.safar@gmail.com>
935 * linq.cs, convert.cs, assign.cs, expression.cs, ecore.cs: Add
936 ShimExpression, ImplicitCast.
938 2009-09-30 Marek Safar <marek.safar@gmail.com>
940 A fix for bug #542959
941 * delegate.cs: Emit correct delegate instance variable when there
942 are static and non-static overloads.
944 2009-09-29 Marek Safar <marek.safar@gmail.com>
946 * dynamic.cs, linq.cs, anonymous.cs, expression.cs, statement.cs,
947 ecore.cs, cs-parser.jay: Unary expression dynamic compiler.
949 2009-09-28 Marek Safar <marek.safar@gmail.com>
951 A fix for bug #542487
952 * ecore.cs: Resolve extension methods hidden by properties.
954 2009-09-25 Marek Safar <marek.safar@gmail.com>
956 * expression.cs, ecore.cs: More dynamic binary expressions.
958 2009-09-22 Marek Safar <marek.safar@gmail.com>
960 * nullable.cs, expression.cs: Fixed null lifted conversion for
961 bitwise enum operations.
963 2009-09-22 Marek Safar <marek.safar@gmail.com>
965 * convert.cs, ecore.cs: Fixed explicit unsafe coversion of long
966 values in checked context.
968 2009-09-22 Marek Safar <marek.safar@gmail.com>
970 * expression.cs, ecore.cs: Fixed array index constant conversion.
972 2009-09-20 Miguel de Icaza <miguel@novell.com>
974 * expression.cs: Do not crash when MemberLookup returns something
975 that is not a MemberExpr here. Report error 582 instead.
979 2009-09-18 Marek Safar <marek.safar@gmail.com>
981 * decl.cs, class.cs: Check protected property accessors.
983 2009-09-18 Marek Safar <marek.safar@gmail.com>
985 * dynamic.cs, assign.cs: Dynamic compound assignment.
987 2009-09-17 Marek Safar <marek.safar@gmail.com>
989 * expression.cs: Fixed compound assignment explicit conversion.
991 2009-09-17 Marek Safar <marek.safar@gmail.com>
993 * expression.cs, ecore.cs: Cannot infer variables from method group.
995 2009-09-16 Marek Safar <marek.safar@gmail.com>
997 * argument.cs, dynamic.cs, convert.cs, context.cs, anonymous.cs,
998 constant.cs, nullable.cs, expression.cs, literal.cs, ecore.cs,
999 codegen.cs: Dynamic binary operations scaffolding.
1001 2009-09-15 Marek Safar <marek.safar@gmail.com>
1003 * expression.cs: Fixes nullable promotion for enum type variables.
1005 2009-09-11 Marek Safar <marek.safar@gmail.com>
1007 * driver.cs, dynamic.cs: Reset more static variables.
1009 2009-09-11 Marek Safar <marek.safar@gmail.com>
1011 * dynamic.cs, expression.cs, rootcontext.cs, namespace.cs, ecore.cs,
1012 driver.cs: Introduced Expression::MakeExpression.
1014 2009-09-11 Marek Safar <marek.safar@gmail.com>
1016 * eval.cs: Exposed MessageOutput instead of cleaning up eval API.
1018 2009-09-09 Marek Safar <marek.safar@gmail.com>
1020 * eval.cs, report.cs: Use Console.Out for all eval error or warning
1023 2009-09-09 Marek Safar <marek.safar@gmail.com>
1025 A fix for bug #518707
1026 * expression.cs (Is): Optimize only generic parameter type
1027 expression probing value type generic parameter.
1029 2009-09-09 Marek Safar <marek.safar@gmail.com>
1031 A fix for bug #532571
1032 * ecore.cs: Check for simple name type arguments used with
1035 2009-09-08 Marek Safar <marek.safar@gmail.com>
1037 A fix for bug #497421
1038 * generic.cs (CheckConstraint): Don't use buildin types to check for
1039 parameterless constructor.
1041 2009-09-08 Marek Safar <marek.safar@gmail.com>
1043 A fix for bug #537402
1044 * generic.cs (CheckConstraint): Correctly inflate generic type
1045 arguments when checking generic method.
1047 2009-09-08 Marek Safar <marek.safar@gmail.com>
1049 A fix for bug #536463
1050 * decl.cs (AddToContainer): Don't report collision between explicit
1051 and parameterless non-explicit members.
1053 2009-09-08 Marek Safar <marek.safar@gmail.com>
1055 * eval.cs: Reset more static stuff.
1057 2009-09-07 Marek Safar <marek.safar@gmail.com>
1059 A fix for bug #324625
1060 * expression.cs, ecore.cs: Create nested generic type expression
1061 using declaring and not current type.
1063 2009-09-07 Marek Safar <marek.safar@gmail.com>
1065 * *.cs: Changed Report class to accept various output printers and
1066 be an instance class. An expression resolver can now use different
1067 message reporter for each call and Report.Error can safely throw
1068 an exception. Part of ongoing work to turn mcs into proper library.
1070 2009-09-04 Marek Safar <marek.safar@gmail.com>
1072 * statement.cs, ecore.cs: Removed error reporting from emit code.
1074 2009-09-04 Marek Safar <marek.safar@gmail.com>
1076 * cs-parser.jay, parameter.cs: Moved parser check out of constructor
1078 2009-09-03 Marek Safar <marek.safar@gmail.com>
1080 * anonymous.cs, expression.cs, statement.cs, cs-parser.jay: Moved
1081 parser checks out of constructors.
1083 2009-09-02 Marek Safar <marek.safar@gmail.com>
1085 * expression.cs, statement.cs, ecore.cs: Use common Report.Error.
1087 2009-09-02 Marek Safar <marek.safar@gmail.com>
1089 A fix for bug #535448
1090 * anonymous.cs, class.cs: Copy return label between all contexts.
1092 2009-09-02 Marek Safar <marek.safar@gmail.com>
1094 A fix for bug #535395
1095 * namespace.cs: Resolve context can be null.
1097 2009-08-25 Marek Safar <marek.safar@gmail.com>
1099 A fix for bug #533912
1100 * generic.cs: Use correct context for constraints resolving.
1102 2009-08-25 Marek Safar <marek.safar@gmail.com>
1104 A fix for bug #532630
1105 * driver.cs: Trim conditional symbols.
1107 2009-08-25 Marek Safar <marek.safar@gmail.com>
1109 * context.cs: New file.
1111 * *.exe.sources, *.csproj: Updated.
1113 2009-08-25 Marek Safar <marek.safar@gmail.com>
1115 * generic.cs, parameter.cs, decl.cs, statement.cs, namespace.cs,
1116 class.cs, generic-mcs.cs, codegen.cs: Add GetSignatureForError to
1117 IMembercontext, some small cleanups.
1119 2009-08-24 Marek Safar <marek.safar@gmail.com>
1121 * *.cs: Split ResolveContext and EmitContext.
1123 2009-08-24 Marek Safar <marek.safar@gmail.com>
1125 * *.cs: Only ResolveContext implements IMemberContext.
1127 2009-08-21 Marek Safar <marek.safar@gmail.com>
1129 * *.cs: Renamed IResolveContext to IMemberContext.
1131 2009-08-21 Marek Safar <marek.safar@gmail.com>
1133 * *.cs: Detached ResolveContext from EmitContext.
1135 2009-08-21 Marek Safar <marek.safar@gmail.com>
1137 * codegen.cs: Moved flow-analysis to BlockContext.
1139 2009-08-21 Marek Safar <marek.safar@gmail.com>
1141 * *.cs: Detached BlockContext from EmitContext.
1143 2009-08-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1145 * statement.cs: avoid nullref when the return value of GetEnumerator()
1146 does not contain any MoveNext() method.
1148 2009-08-19 Marek Safar <marek.safar@gmail.com>
1150 * *.cs: Removed IResolveContext::GenericDeclContainer.
1152 2009-08-19 Marek Safar <marek.safar@gmail.com>
1154 * class.cs, delegate.cs: Changed Delegate to be TypeContainer based.
1156 2009-08-19 Marek Safar <marek.safar@gmail.com>
1158 * generic.cs, iterators.cs, expression.cs, statement.cs, ecore.cs,
1159 cs-parser.jay, attribute.cs, codegen.cs: Better error reports.
1161 2009-08-18 Marek Safar <marek.safar@gmail.com>
1163 * *.cs: Removed boolean fields from EmitContext.
1165 2009-08-18 Marek Safar <marek.safar@gmail.com>
1167 * *.cs: Add IResolveContext::IsStatic.
1169 2009-08-18 Marek Safar <marek.safar@gmail.com>
1171 * *.cs: Moved TopBlock's methods from EmitContext to TopBlock.
1173 2009-08-17 Marek Safar <marek.safar@gmail.com>
1175 * *.cs: Removed DeclContainer from EmitContext.
1177 2009-08-17 Marek Safar <marek.safar@gmail.com>
1179 * *.cs: Add IResolveContext::CurrentTypeParameters.
1181 2009-08-14 Marek Safar <marek.safar@gmail.com>
1183 * *.cs: Removed TypeContainer and ContainerType from EmitContext.
1185 2009-08-14 Marek Safar <marek.safar@gmail.com>
1187 * decl.cs, expression.cs, namespace.cs, ecore.cs, class.cs,
1188 codegen.cs: Add IResolveContext::LookupExtensionMethod.
1190 2009-08-13 Marek Safar <marek.safar@gmail.com>
1192 * decl.cs: Look in PartialContainer for parent type parameters.
1194 2009-08-13 Marek Safar <marek.safar@gmail.com>
1196 * decl.cs, namespace.cs, ecore.cs, class.cs, attribute.cs,
1197 codegen.cs: Add IResolveContext::LookupTypeParameter.
1199 2009-08-13 Marek Safar <marek.safar@gmail.com>
1201 * lambda.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
1202 Moved resolved logic from Emit to Resolve.
1204 2009-08-13 Marek Safar <marek.safar@gmail.com>
1206 * parameter.cs, decl.cs, roottypes.cs, class.cs, attribute.cs,
1207 codegen.cs: Reworked atttributes handling of ResolveContext.
1209 2009-08-12 Marek Safar <marek.safar@gmail.com>
1211 * decl.cs, ecore.cs, class.cs, attribute.cs, codegen.cs: Pushed
1212 LookupNamespaceOrType to ResolveContext.
1214 2009-08-12 Marek Safar <marek.safar@gmail.com>
1216 * typemanager.cs, decl.cs, expression.cs, namespace.cs, ecore.cs,
1217 class.cs: Removed unused parameters and methods.
1219 2009-08-11 Marek Safar <marek.safar@gmail.com>
1221 * generic.cs, lambda.cs, anonymous.cs, statement.cs, generic-mcs.cs,
1222 codegen.cs: Finding the best common type of a set of expressions for
1225 2009-08-07 Marek Safar <marek.safar@gmail.com>
1227 * dynamic.cs, expression.cs: More dynamic conversions.
1229 2009-08-06 Miguel de Icaza <miguel@novell.com>
1231 * generic.cs: This loop was incorrect, it was increment ii, but
1232 checking for `i'. This was a change introduced to fix #327497,
1235 * class.cs: Catch another case for cs0533 error, fixes #324782.
1237 2009-08-06 Rodrigo Kumpera <rkumpera@novell.com>
1239 * typemanager.cs (GetGenericArguments): SRE returns null for
1240 generic methods on type builder instances if they are not generic
1241 themselves. For example, for Foo<int>::Bar() it returns null, but
1242 not for Foo<int>::Bar<>() or Foo<int>::Bar<double>().
1244 2009-08-05 Marek Safar <marek.safar@gmail.com>
1246 * argument.cs, dynamic.cs, expression.cs, ecore.cs, class.cs,
1247 delegate.cs: Work on dynamic binding.
1249 2009-08-04 Marek Safar <marek.safar@gmail.com>
1251 A second fix for bug #525342
1252 * class.cs: Attach partial method attributes to method
1255 2009-08-03 Marek Safar <marek.safar@gmail.com>
1257 * typemanager.cs, parameter.cs, support.cs, class.cs: Dynamic type
1260 * rootcontext.cs: Default to langversion v4.
1262 2009-08-03 Marek Safar <marek.safar@gmail.com>
1264 * pending.cs: Check return type before member info is set.
1266 2009-08-03 Marek Safar <marek.safar@gmail.com>
1268 * anonymous.cs: Fully initialize generic hoisted field expression.
1270 2009-08-02 Miguel de Icaza <miguel@novell.com>
1272 * cs-parser.jay: Flag variables declared on the interactive shell
1273 as used to prevent the 168 warning about local variable not being
1276 2009-07-31 Marek Safar <marek.safar@gmail.com>
1278 * parameter.cs, dynamic.cs, support.cs, class.cs, delegate.cs,
1279 attribute.cs: Emit dynamic export attribute.
1281 2009-07-30 Marek Safar <marek.safar@gmail.com>
1283 * expression.cs: More verifier work.
1285 2009-07-29 Marek Safar <marek.safar@gmail.com>
1287 * nullable.cs: Fixed SRE crash during corlib compilation.
1289 2009-07-29 Marek Safar <marek.safar@gmail.com>
1291 * generic.cs, typemanager.cs, decl.cs, iterators.cs, convert.cs,
1292 nullable.cs, expression.cs, ecore.cs, class.cs, attribute.cs:
1293 More TypeManager.TypeToCoreType needed.
1295 2009-07-29 Marek Safar <marek.safar@gmail.com>
1297 * anonymous.cs: Update after recent SRE fixes.
1299 2009-07-28 Marek Safar <marek.safar@gmail.com>
1301 * typemanager.cs, expression.cs, ecore.cs, delegate.cs: Use correct
1302 version of GetFieldHandle for fields of generic types.
1304 2009-07-27 Marek Safar <marek.safar@gmail.com>
1306 * typemanager.cs, argument.cs, convert.cs, assign.cs, expression.cs,
1307 ecore.cs: Add TypeManager.IsDynamicType,
1308 PredefinedAttributes.Dynamic.
1310 2009-07-27 Marek Safar <marek.safar@gmail.com>
1312 A fix for bug #415375
1313 * expression.cs: Fixed object and reference type parameter
1316 2009-07-27 Marek Safar <marek.safar@gmail.com>
1318 A fix for bug #525342
1319 * class.cs: Attach partial method attributes to method
1322 2009-07-24 Marek Safar <marek.safar@gmail.com>
1324 * argument.cs, dynamic.cs, expression.cs, class.cs, attribute.cs:
1327 2009-07-24 Marek Safar <marek.safar@gmail.com>
1329 * anonymous.cs (MutateField): Add imported types handling.
1331 2009-07-23 Marek Safar <marek.safar@gmail.com>
1333 * expression.cs, delegate.cs: Moved arguments resolve into their
1334 counterparts expressions. Removed argument resolve from
1335 CollectionElementInitializer.
1337 2009-07-23 Marek Safar <marek.safar@gmail.com>
1339 A fix for bug #523683
1340 * convert.cs, delegate.cs: Use common overload mechanism for method
1341 group conversion check.
1343 2009-07-22 Marek Safar <marek.safar@gmail.com>
1345 A fix for bug #523899
1346 * generics.cs: Exact type inference with other bound types.
1348 2009-07-22 Raja R Harinath <harinath@hurrynot.org>
1350 Don't complain when the same type is implemented by the output
1351 assembly as well as multiple referenced assemblies
1352 * namespace.cs (RootNamespace.LookupTypeReflection): Add
1353 'must_be_unique' flag.
1354 (GlobalRootNamespace): Update to changes.
1355 (Namespace.LookupType): Pass 'must_be_unique' only when we don't
1356 already have a type in hand.
1358 2009-07-22 Marek Safar <marek.safar@gmail.com>
1360 * expression.cs: More verifier instrumentation.
1362 * statement.cs: Do proper throw expression conversion.
1364 2009-07-22 Marek Safar <marek.safar@gmail.com>
1366 A fix for bug #522789
1367 * expression.cs: Mutate invocation return type.
1369 2009-07-16 Marek Safar <marek.safar@gmail.com>
1371 * anonymous.cs: Split assignable and readonly generated variable
1374 2009-07-16 Marek Safar <marek.safar@gmail.com>
1376 A fix for bug #521671
1377 * statement.cs: Fixed crash when checking missing type.
1379 2009-07-16 Marek Safar <marek.safar@gmail.com>
1381 * typemanager.cs, generic.cs, argument.cs, linq.cs, convert.cs,
1382 assign.cs, expression.cs, statement.cs, support.cs, ecore.cs,
1383 class.cs, driver.cs: Work on dynamic binding.
1385 * dynamic.cs: New file.
1387 * *.sources, *.proj: Updated.
1389 2009-07-15 Marek Safar <marek.safar@gmail.com>
1391 * expression.cs (Conditional): Avoid double Resolve.
1393 2009-07-13 Marcus Griep <marcus@griep.us>
1395 * ecore.cs: Fix obscure bug with resolving members of interfaces
1396 that hide parent interface members. Fixes bug #444388 and corrects
1399 2009-07-13 Marek Safar <marek.safar@gmail.com>
1401 * expression.cs (LocalVariableReference): Bounce resolve.
1403 2009-07-10 Marek Safar <marek.safar@gmail.com>
1405 * typemanager.cs, lambda.cs, parameter.cs, convert.cs, anonymous.cs,
1406 expression.cs, literal.cs, ecore.cs, complete.cs: Moved internal
1409 * support.cs: New dynamic type wrapper.
1411 2009-07-08 Marek Safar <marek.safar@gmail.com>
1413 * ecore.cs, cs-parser.jay: Better error reporting for implicitly
1414 typed local variable.
1416 2009-07-06 Marek Safar <marek.safar@gmail.com>
1418 A fix for bug #519005
1419 * anonymous.cs: Use null_type as no return type placeholder.
1421 2009-07-02 Marek Safar <marek.safar@gmail.com>
1423 * generic.cs: Handle type inference of identical type parameters
1424 with different bounds.
1426 2009-07-01 Marek Safar <marek.safar@gmail.com>
1428 * expression.cs, class.cs: Events variance.
1430 * cs-parser.jay: Interface events error messages.
1432 2009-07-01 Marek Safar <marek.safar@gmail.com>
1434 * generic.cs, argument.cs: Updated type inference logic to C# 4.0.
1436 2009-06-29 Marek Safar <marek.safar@gmail.com>
1438 * parameter.cs, convert.cs, expression.cs, class.cs: Default
1439 parameter expression can be value-type New.
1441 * cs-parser.jay: Clean up too many parameter modifier boolean flags.
1443 2009-06-26 Marek Safar <marek.safar@gmail.com>
1445 * generic.cs, argument.cs, expression.cs, ecore.cs, cs-parser.jay:
1446 Implemented C# 4.0 named arguments.
1448 2009-06-24 Marek Safar <marek.safar@gmail.com>
1450 * typemanager.cs, parameter.cs, iterators.cs, convert.cs,
1451 expression.cs, ecore.cs, delegate.cs: Removed unnecessary ArgList
1452 parameter modifier. Also fixes bug #515497.
1454 2009-06-24 Marek Safar <marek.safar@gmail.com>
1456 * *.cs: Replaced ArrayList with Arguments in need of a nonsequential
1457 arguments expression to be implemented.
1459 *.sources: Add argument.cs
1461 2009-06-23 Marek Safar <marek.safar@gmail.com>
1463 * parameter.cs: Moved GetParameterIndexByName to base class.
1465 * expression.cs, statement.cs, ecore.cs, delegate.cs: Removed
1466 unused AType. Use argument's version of GetExpressionTree.
1468 2009-06-22 Marek Safar <marek.safar@gmail.com>
1470 * expression.cs, cs-parser.jay, attribute.cs, codegen.cs: Named
1473 2009-06-17 Marek Safar <marek.safar@gmail.com>
1475 A fix for bug #514096
1476 * class.cs: Allow IntPtr/UIntPtr fields to be volatile.
1478 2009-06-17 Marek Safar <marek.safar@gmail.com>
1480 * expression.cs: The first multi-dimensional array nested array
1481 initializers was not checked.
1483 * statement.cs (Switch): Fixed error message to reflect 2.0 changes.
1485 2009-06-17 Marek Safar <marek.safar@gmail.com>
1487 A fix for bug #513400
1488 * nullable.cs (EmitEquality): Operands emit could be simplified for
1489 built-in types when we now emit user operators differently.
1491 2009-06-16 Marek Safar <marek.safar@gmail.com>
1493 * ecore.cs: Report inaccessible delegate methods correctly.
1495 2009-06-16 Marek Safar <marek.safar@gmail.com>
1497 * parameter.cs, expression.cs, ecore.cs, class.cs, delegate.cs,
1498 cs-parser.jay: Implemented C# 4.0 optional parameters.
1500 2009-06-16 Marek Safar <marek.safar@gmail.com>
1502 * driver.cs: Removed broken DefineManifestResource.
1504 2009-06-16 Raja R Harinath <harinath@hurrynot.org>
1506 * Makefile [net_2_0_bootstrap]: Don't explicitly mention net_1_1.
1507 Use $(BOOTSTRAP_PROFILE) instead.
1509 2009-06-12 Jb Evain <jbevain@novell.com>
1511 * rootcontext.cs: add a Platform field.
1512 * driver.cs: handle /platform.
1513 * codegen.cs: pass the proper flags according to
1514 the platform when saving the assembly.
1516 2009-06-11 Marek Safar <marek.safar@gmail.com>
1518 * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
1519 Add optional parameters grammar.
1521 2009-06-10 Marek Safar <marek.safar@gmail.com>
1523 * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
1524 driver.cs: Split lang version and metadata version.
1526 2009-06-10 Marek Safar <marek.safar@gmail.com>
1528 * decl.cs: Better overload ctor collision error message.
1530 2009-06-05 Jb Evain <jbevain@novell.com>
1532 * driver.cs (EmbededResource): avoid using an internal method
1533 in gmcs to embed manifest resources.
1535 2009-06-04 Sebastien Pouliot <sebastien@ximian.com>
1537 * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
1538 the compiler from older mono versions (like moon's bots)
1540 2009-06-04 Marek Safar <marek.safar@gmail.com>
1542 * namespace.cs (LookupTypeReflection): Ignore collisions between
1545 2009-06-04 Marek Safar <marek.safar@gmail.com>
1547 * codegen.cs: Enabled generic type forwarders.
1549 2009-06-04 Marek Safar <marek.safar@gmail.com>
1551 * dmcs.*: Add another version of SRE compiler.
1553 2009-06-03 Marek Safar <marek.safar@gmail.com>
1555 * generic.cs, typemanager.cs, parameter.cs, convert.cs,
1556 generic-mcs.cs: Fixed variant type conversions.
1558 2009-06-02 Marek Safar <marek.safar@gmail.com>
1560 A fix for bug #507863
1561 * codegen.cs: Fixes a crash on invalid string value attribute.
1563 2009-06-01 Marek Safar <marek.safar@gmail.com>
1565 A fix for bug #508334
1566 * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
1567 cs-parser.jay: Fully import __arglist modifier.
1569 2009-05-29 Marek Safar <marek.safar@gmail.com>
1571 * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
1572 delegate.cs, generic-mcs.cs: Rewrote type variance checks to
1573 actually work with closed generic types.
1575 2009-05-27 Alan McGovern <amcgovern@novell.com>
1577 * class.cs, decl.cs, delegate.cs, parameter.cs:
1578 Fix the build by replacing the use of 'var' with the actual type.
1580 2009-05-27 Marek Safar <marek.safar@gmail.com>
1582 * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
1583 cs-parser.jay, generic-mcs.cs: Report wrong variant types
1586 * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
1589 2009-05-26 Rodrigo Kumpera <rkumpera@novell.com>
1590 Marek Safar <marek.safar@gmail.com>
1592 A fix for bug #377509
1593 * parameter.cs: Use predefined and not empty name for implicit
1596 2009-05-21 Marek Safar <marek.safar@gmail.com>
1598 * class.cs: Don't report wrong warnings for event fields.
1600 2009-05-21 Marek Safar <marek.safar@gmail.com>
1602 A fix for bug #504667
1603 * class.cs: Check for static class using parent container instead of
1606 2009-05-08 Marek Safar <marek.safar@gmail.com>
1608 A fix for bug #496922
1609 * expression.cs: Always use temporary variable when using object
1612 2009-04-28 Marek Safar <marek.safar@gmail.com>
1614 A fix for bug #495112
1615 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
1618 2009-04-27 Miguel de Icaza <miguel@novell.com>
1620 * driver.cs: Add a flag to work as a replacement for CSC in VS.
1622 2009-04-24 Miguel de Icaza <miguel@novell.com>
1624 * complete.cs: No idea how gonzalo got a null in the list, but
1627 2009-04-24 Miguel de Icaza <miguel@novell.com>
1629 * complete.cs (CompletionElementInitializer): New completion class
1630 to support completing inside a C# 3 element initializer, so this
1631 allows completion for Silverlight situations where it is very
1634 new TextBlock () { Fo<TAB>
1636 (CompletionSimpleName): Expose the prefix that was
1637 passed to the simple name.
1639 * cs-parser.jay (object_or_collection_initializer): Add support
1640 for element_initializers.
1642 * expression.cs (CollectionOrObjectInitializers.DoResolve):
1643 special case completion expressions as this method aggressively
1644 collects data before it operates, and errors were being thrown
1645 earlier than we were able to complete.
1647 2009-04-23 Miguel de Icaza <miguel@novell.com>
1649 * eval.cs: Make getcompletions silent and enable debugging output
1650 if the -v option is passed.
1652 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
1653 Consider looking up the namespace that matches the prefix being
1656 This is part of the support for allowing completions like:
1657 `System.Co<TAB>' to complete to System.Console.
1659 * complete.cs (CompletionSimpleName.AppendResults): Make this
1662 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
1664 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
1665 COMPLETE_COMPLETION as internal.
1667 2009-04-17 Miguel de Icaza <miguel@novell.com>
1669 * complete.cs: Include namespace resolution in simple names as
1670 well as global types and types in the using scope in the
1673 * namespace.cs: Supporting infrastrcture to provide completions
1674 based on the current using scope.
1676 * eval.cs: Introduce an entry point that allows for initialization
1677 to return a list of the files passed on the command line.
1679 2009-04-14 Marek Safar <marek.safar@gmail.com>
1681 A fix for bug #494243
1682 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
1684 2009-04-13 Marek Safar <marek.safar@gmail.com>
1686 A fix for bug #493887
1687 * statement.cs: Don't skip string multi-section with default or
1688 null label when populating string hashtable.
1690 2009-04-06 Marek Safar <marek.safar@gmail.com>
1692 A fix for bug #492329
1693 * expression.cs (New): Load variable when assigning type parameter
1696 2009-04-06 Marek Safar <marek.safar@gmail.com>
1698 A fix for bug #488960
1699 * decl.cs: Compare MVAR types using non-null values.
1701 2009-03-27 Marek Safar <marek.safar@gmail.com>
1703 * typemanager.cs, expression.cs: Removed unused nullable checks.
1705 2009-03-27 Marek Safar <marek.safar@gmail.com>
1707 * *.cs: Removed some gmcs conditionals.
1709 2009-03-26 Marek Safar <marek.safar@gmail.com>
1711 * generic.cs, support.cs: Moved generics stuff out of support.cs
1713 2009-03-24 Marek Safar <marek.safar@gmail.com>
1715 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
1718 2009-03-23 Marek Safar <marek.safar@gmail.com>
1720 * attribute.cs: Consider all members for error reporting when
1721 checking named arguments.
1723 2009-03-23 Marek Safar <marek.safar@gmail.com>
1725 A fix for bug #487625
1726 * namespace.cs: Use a warning for all predefined type conflicts.
1728 2009-03-23 Marek Safar <marek.safar@gmail.com>
1730 A fix for bug #485706
1731 * statement.cs: Explicitly type catch type argument to pass verifier
1734 2009-03-22 Miguel de Icaza <miguel@novell.com>
1736 Initial support to provide code completion facilities to consumers
1737 of the evaluator API.
1739 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
1740 support the completion engine. When we reach the end of the
1741 input stream instead of returning EOF, when this flag is true the
1742 tokenizer instead produces:
1744 One GENERATE_COMPLETION token: this token then must be
1745 handled in the grammar at every point where the user
1746 would likely request a completion.
1748 As many COMPLETE_COMPLETION tokens as necessary. These
1749 tokens are generated to assist the parser in unwinding and
1750 producing a valid parse tree.
1752 The parser rules do not have to be perfect, the parser needs to be
1753 augmented with judicious use of GENERATE_COMPLETION tokens to
1754 improve the areas where we can provide completion and the parser
1755 needs to add support for COMPLETE_COMPLETION tokens in productions
1758 It is common to not have enough support for COMPLETE_COMPLETION
1759 under certain rules and that even if we generated the
1760 GENERATE_COMPLETION token that the resulting tree will be invalid
1761 due to the missing rules that support COMPLETE_COMPLETION.
1763 The final EOF token is produced by having the parser notify the
1764 tokenizer when it reaches the root production that the next token
1767 * support.cs (CompletionResult): New Exception. This exception
1768 is thrown to return the completion results when one of the special
1769 completion expressions is reached.
1771 This exception is thrown by the completing ExpressionStatements
1772 classes that live in complete.cs
1774 * complete.cs (CompletingExpression): a new base class for
1775 completing expressions. This derives from the
1776 ExpressionStatement class and not from Expression as it allows
1777 completion to happen not only where expressions are expected in
1778 the grammar, but also where statements are expected.
1780 (CompletionSimpleName): A new class used to provide completions
1781 for SimpleNames. This currently only resolves to local
1782 variables from the evaluator context (GetVars call).
1784 (CompletionMemberAccess): Implements support for completing member
1787 * cs-parser.jay: Add support for completion in a few places.
1789 * eval.cs (GetCompletions): New public API for the evaluator that
1790 returns a list of possible completions given the input. The
1791 return value is an array of completions
1793 * anonymous.cs (Compatible): If the exception thrown from the
1794 resolved expression is a CompletionResult exception let that one
1795 through instead of printing a diagnostic error in the try/catch.
1797 2009-03-22 Miguel de Icaza <miguel@novell.com>
1801 * driver.cs (Main): Use Environment.Exit to quit quickly and
1802 prevent the compiler from doing the usual wait for helper thread
1805 This is to prevent a slowdown that was reported by Gonzalo on
1808 2009-03-19 Marek Safar <marek.safar@gmail.com>
1810 * ecore.cs: Load build-in types directly instead of accessing
1813 2009-03-18 Marek Safar <marek.safar@gmail.com>
1815 * ecore.cs: Always use unbox.any when available.
1817 2009-03-18 Marek Safar <marek.safar@gmail.com>
1819 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
1821 2009-03-17 Marek Safar <marek.safar@gmail.com>
1823 * generic.cs: Removed obsolete version of type inference.
1825 2009-03-16 Marek Safar <marek.safar@gmail.com>
1827 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
1828 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
1829 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
1830 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
1832 2009-03-11 Marek Safar <marek.safar@gmail.com>
1834 A fix for bug #482996
1835 * anonymous.cs: Make sure we are not infering return type when
1836 checking type compatibility.
1838 2009-03-11 Marek Safar <marek.safar@gmail.com>
1840 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
1841 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
1842 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
1843 attributes in their own structure. Needed when accessing their
1844 properties before they are resolved.
1846 2009-03-09 Marek Safar <marek.safar@gmail.com>
1848 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
1849 hashtable (~10x faster).
1851 * driver.cs: Removed wrong Reset.
1853 2009-03-08 Marek Safar <marek.safar@gmail.com>
1855 * class.cs: Use correct common base type for unmanaged delayed
1858 * rootcontext.cs: Wrap unhandled exception.
1860 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
1862 Make SeekableStreamReader self-tuning and arbitrarily seekable
1863 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
1865 (SeekableStreamReader.Position.set): Use it. Simplify logic
1866 which, as a side-effect, makes it arbitrarily-seekable. Tune the
1867 buffer size when the stream needs to be re-read from the beginning.
1869 2009-03-05 Marek Safar <marek.safar@gmail.com>
1871 A fix for bug #480100
1872 * parameter.cs: A parameter is not hoisted when used directly as ET.
1874 2009-03-04 Marek Safar <marek.safar@gmail.com>
1876 * statement.cs: Fixed an issue when using variable is of interface
1879 2009-03-03 Marek Safar <marek.safar@gmail.com>
1881 A fix for bug #480319
1882 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
1884 2009-03-03 Marek Safar <marek.safar@gmail.com>
1886 A fix for bug #480867
1887 * typemanager.cs, expression.cs, ecore.cs: Changed method group
1888 expression to have no valid type.
1890 2009-03-03 Marek Safar <marek.safar@gmail.com>
1892 A fix for bug #481258
1893 * class.cs: Set extension method flag in partial container.
1895 2009-03-03 Marek Safar <marek.safar@gmail.com>
1897 * statement.cs, typemanager.cs: Use expression for StringEmitter.
1899 * attribute.cs: Add sanity check.
1901 2009-02-27 Marek Safar <marek.safar@gmail.com>
1903 * class.cs: Add external constructor error.
1905 2009-02-26 Marek Safar <marek.safar@gmail.com>
1907 A fix for bug #475354
1908 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
1909 correctly user defined nullable equality operators.
1911 2009-02-25 Marek Safar <marek.safar@gmail.com>
1913 A fix for bug #479532
1914 * expression.cs: Implement NewInitialize::AddressOf.
1916 2009-02-25 Marek Safar <marek.safar@gmail.com>
1918 A fix for bug #413633
1919 * expression.cs: Iterate all base class-constraint types.
1921 2009-02-24 Marek Safar <marek.safar@gmail.com>
1923 A fix for bug #479209
1924 * literal.cs: Mutate null underlying type.
1926 2009-02-24 Marek Safar <marek.safar@gmail.com>
1928 A fix for bug #476295
1929 * convert.cs: Avoid wrapping implicitly convertible reference type.
1931 2009-02-23 Marek Safar <marek.safar@gmail.com>
1933 * iterators.cs: Create MemberName correctly.
1935 2009-02-23 Marek Safar <marek.safar@gmail.com>
1937 A fix for bug #478655
1938 * literal.cs: Check also underlying null type conversion.
1940 2009-02-21 Marek Safar <marek.safar@gmail.com>
1942 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
1944 2009-02-20 Marek Safar <marek.safar@gmail.com>
1946 A fix for bug #477447
1947 * statement.cs: Add reference to correct parent storey when this
1948 is accessible from deep children storey (more than 1 level).
1950 2009-02-19 Marek Safar <marek.safar@gmail.com>
1952 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
1953 * class.cs: Define base type members before setting up member cache.
1955 2009-02-18 Marek Safar <marek.safar@gmail.com>
1957 A fix for bug #477378
1958 * nullable.cs, expression.cs, statement.cs: More precise null type
1961 2009-02-18 Marek Safar <marek.safar@gmail.com>
1963 A fix for bug #472805
1964 * typemanager.cs, namespace.cs: Import only visible extension method
1967 2009-02-18 Marek Safar <marek.safar@gmail.com>
1969 A fix for bug #476895
1970 * attribute.cs: Use correct resolve context for attribute type.
1972 2009-02-18 Marek Safar <marek.safar@gmail.com>
1974 A fix for bug #476266
1975 * anonymous.cs: Mutate multi-dimensional arrays.
1977 2009-02-18 Marek Safar <marek.safar@gmail.com>
1979 A fix for bug #476400
1980 * statement.cs, expression.cs: Removed wrong Dispose optimization.
1982 2009-02-18 Marek Safar <marek.safar@gmail.com>
1984 A fix for bug #476811
1985 * generics.cs: Fixed null-literal check.
1987 2009-02-17 Marek Safar <marek.safar@gmail.com>
1989 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
1990 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
1991 messing with static variables.
1993 2009-02-16 Marek Safar <marek.safar@gmail.com>
1995 A fix for bug #475965
1996 * generics.cs: Check generic parameter type after extracting from
1999 2009-02-16 Marek Safar <marek.safar@gmail.com>
2001 A fix for bug #475823
2002 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
2005 2009-02-14 Marek Safar <marek.safar@gmail.com>
2007 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
2008 Simplified event field definition using backing field and not
2009 field builder directly.
2011 * expression.cs (EmitLdArg): Optimize fast paths.
2013 2009-02-13 Marek Safar <marek.safar@gmail.com>
2015 A fix for bug #475327
2016 * expression.cs (ArrayCreation): Don't mutate values optimized away.
2018 2009-02-13 Marek Safar <marek.safar@gmail.com>
2020 A fix for bug #475342
2021 * cs-parser.jay: Using 'super' instead of 'base' to call base
2022 constructor crashes compiler.
2024 2009-02-13 Marek Safar <marek.safar@gmail.com>
2026 A fix for bug #475354
2027 * expression.cs (Constantify): Add nullable types.
2029 * const.cs (EmitDecimalConstant): Avoid explicit cast.
2031 2009-02-12 Marek Safar <marek.safar@gmail.com>
2033 A fix for bug #475246
2034 * expression.cs: More broken flowanalysis hacking needed.
2036 2009-02-12 Marek Safar <marek.safar@gmail.com>
2038 * attribute.cs: Compare only ref/out array modifiers.
2040 2009-02-11 Marek Safar <marek.safar@gmail.com>
2042 * statement.cs: Use member cache when looking for foreach members.
2044 2009-02-11 Marek Safar <marek.safar@gmail.com>
2046 * expression.cs: Don't expose internal initializer types.
2048 * statement.cs: Check also explicit conversions for goto case.
2050 2009-02-11 Marek Safar <marek.safar@gmail.com>
2052 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
2054 2009-02-10 Marek Safar <marek.safar@gmail.com>
2056 * *.cs: Replace null-type with NullLiteral where appropriate.
2058 2009-02-09 Marek Safar <marek.safar@gmail.com>
2060 * expression.cs: Initializer of reference argument use temporary
2061 variable to be verifiable.
2063 * parameter.cs: Share EmitLdArg.
2065 2009-02-09 Marek Safar <marek.safar@gmail.com>
2067 A fix for bug #473559
2068 * class.cs: Fixed: Not reporting error about nested class with the
2071 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
2073 Contributed under the MIT/X11 license.
2075 * generic.cs: Added VerifyVariantTypeParameters which performs new
2076 variance verification logic. The old logic, based on the spec, was
2077 wrong because the spec is full of LIES!
2079 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
2081 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
2084 * ecore.cs: Added calls to the new variance verification logic.
2087 * delegate.cs: Removed calls to the old variance verification logic.
2089 2009-02-06 Marek Safar <marek.safar@gmail.com>
2091 * delegate.cs: Use cached Invoke method directly.
2093 2009-02-06 Marek Safar <marek.safar@gmail.com>
2095 * expression.cs: Emit expression tree for hoisted variable access.
2097 2009-02-04 Marek Safar <marek.safar@gmail.com>
2099 * namespace.cs: Add better extension class check.
2101 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
2103 * generic.cs: Fixed typeo (TypeParameter.Variacne).
2105 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
2107 This patch adds initial generic variance support to the compiler.
2108 It is contributed under the MIT/X11 license.
2110 * typemanager.cs: Modified ImplementsInterface to check variance.
2111 Added VerifyVariantTypeParameters which checks the specified type to see
2112 if it uses a variant type parameter as a type argument (which is not
2113 allowed). Added IsVariantOf which determins if the first type is a
2114 variant of the second. NOTE: This only supports reference types at
2115 the moment to conform with the current level of VM support. When the
2116 VM supports value types, this will follow step.
2118 * generic.cs: Added the Variance enum. Added a Variance property to
2119 TypeParameter and added variance support to definition phase. Added a
2120 Variance property to TypeParameterName. Also check to make sure that
2121 no variant types appear in generic method parameters.
2123 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
2124 keywords if the langversion supports it.
2126 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
2127 that variant types are only used in legal positions. Also added
2128 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
2131 * decl.cs: Construct TypeParameter with the variance information.
2133 * convert.cs: Checks variance in ImplicitReferenceConversionExists
2134 and ImplicitConversionStandard.
2136 * rootcontext.cs: Added new "Future" language version.
2138 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
2139 type parameters are not used as type arguments in interface inheritance.
2140 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
2141 parameters are not used as method return types. In MemberBase.
2142 ResolveMemberType, ensure that variant type parameters are not used
2143 as type arguments. Also call VerifyNoVariantTypeParameters on every
2144 set of parameters which are resolved.
2146 * delegate.cs: Modified Delegate.Define to ensure that variant
2147 parameters are not used as type arguments and that a contravariant
2148 parameter is not used as the return type. Also call
2149 VerifyNoVariantTypeParameters on the delegate parameters.
2151 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
2152 to specify generic variance.
2154 * driver.cs: Added support for LanguageVersion.Future in the form of
2155 "-langversion:future".
2157 * generic-mcs.cs: Stubbed out new members in generic.cs.
2159 2009-02-03 Marek Safar <marek.safar@gmail.com>
2161 * class.cs, generic.cs: Emit type parameter constraints for nested
2164 2009-02-02 Marek Safar <marek.safar@gmail.com>
2166 A fix for bug #471213
2167 * class.cs: Avoid emitting backing field for abstract event fields.
2169 2009-02-01 Marek Safar <marek.safar@gmail.com>
2171 A fix for bug #359731
2172 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
2175 2009-01-30 Marek Safar <marek.safar@gmail.com>
2177 A fix for bug #470767
2178 * statement.cs: Introduced BlockScopeExpression, needed when
2179 expression tree conversion has to emit scope variables.
2181 2009-01-29 Marek Safar <marek.safar@gmail.com>
2183 * class.cs: Remove duplicate CallingConvention.
2185 2009-01-29 Marek Safar <marek.safar@gmail.com>
2187 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
2188 when I finally found the right naming convention.
2190 2009-01-29 Marek Safar <marek.safar@gmail.com>
2192 * cs-tokenizer.cs: Put back different open parens optimization.
2194 2009-01-28 Marek Safar <marek.safar@gmail.com>
2196 A fix for bug #470227
2197 * cs-tokenizer.cs: Remove too agressive parser optimization.
2199 2009-01-28 Marek Safar <marek.safar@gmail.com>
2201 A fix for bug #324319
2202 * class.cs: Remove too early base type resolve.
2204 2009-01-27 Marek Safar <marek.safar@gmail.com>
2206 A fix for bug #324319
2207 * ecore.cs: Explicitly type null when assigning to type argument to
2208 make pass verifier check.
2210 2009-01-27 Marek Safar <marek.safar@gmail.com>
2212 * anonymous.cs: Fixed recent regression when initializing captured
2215 2009-01-26 Marek Safar <marek.safar@gmail.com>
2217 A fix for bug #469019
2218 * anonymous.cs: Use all parent type parameters when instantiating
2219 nested generic storey.
2221 2009-01-26 Marek Safar <marek.safar@gmail.com>
2223 * expression.cs: Check for null instance methodgroup expression.
2225 2009-01-26 Marek Safar <marek.safar@gmail.com>
2227 A fix for bug #469244
2228 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
2229 instance inside a conditional expression.
2231 2009-01-23 Marek Safar <marek.safar@gmail.com>
2233 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
2234 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
2235 GetElementType and HasElementType. IsValueType clean up.
2237 2009-01-23 Marek Safar <marek.safar@gmail.com>
2239 * nullable.cs: Use common EmitCall.
2241 * expression.cs: Emit constraint. for virtual calls only.
2243 2009-01-23 Marek Safar <marek.safar@gmail.com>
2245 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
2246 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
2247 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
2250 2009-01-22 Jb Evain <jbevain@novell.com>
2252 * anonymous.cs: make anonymous types' ToString implementation
2253 match what csc outputs.
2255 2009-01-21 Marek Safar <marek.safar@gmail.com>
2257 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
2260 2009-01-17 Marek Safar <marek.safar@gmail.com>
2262 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
2265 2009-01-16 Marek Safar <marek.safar@gmail.com>
2267 * nullable.cs (LiftedBinaryOperator): Check for all possible null
2270 2009-01-15 Marek Safar <marek.safar@gmail.com>
2272 A fix for bug #466634
2273 * statement.cs: Add reference for nested storey when only this
2276 2009-01-15 Marek Safar <marek.safar@gmail.com>
2278 A fix for bug #466474
2279 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
2282 2009-01-15 Marek Safar <marek.safar@gmail.com>
2284 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
2285 Fixed nested stories parent referencing process. Also fixes #463985.
2287 2009-01-06 Marek Safar <marek.safar@gmail.com>
2289 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
2290 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
2291 implementation. Also fixes #463108.
2293 2009-01-05 Marek Safar <marek.safar@gmail.com>
2295 A fix for bug #416109
2296 * decl.cs: Issue correct CLSAttribute warning location.
2298 2009-01-05 Marek Safar <marek.safar@gmail.com>
2300 A fix for bug #456775
2301 * attribute.cs: Use attribute owner scope when resolving attribute
2304 2009-01-05 Marek Safar <marek.safar@gmail.com>
2306 A fix for bug #457257
2307 * decl.cs: Fixed incorrect member declaring type comparison.
2309 2009-01-05 Marek Safar <marek.safar@gmail.com>
2311 A fix for bug #460896
2312 * driver.cs: Handle /RES resources as embeddable.
2314 2009-01-05 Marek Safar <marek.safar@gmail.com>
2316 A fix for bug #462515
2317 * ecore.cs: Report inacessible members upwards.
2319 2009-01-05 Marek Safar <marek.safar@gmail.com>
2321 A fix for bug #463190, #463192
2322 * decl.cs, namespace.cs: Also import internal extension classes.
2324 2009-01-04 Marek Safar <marek.safar@gmail.com>
2326 A fix for bug #463415
2327 * generic.cs: Use right index for RemoveDependentTypes.
2329 2009-01-02 Marek Safar <marek.safar@gmail.com>
2331 A fix for bug #463196
2332 * expression.cs: Fixed enum to null comparison.
2334 2009-01-02 Marek Safar <marek.safar@gmail.com>
2336 A fix for bug #463121
2337 * nullable.cs: Fixed nullable user equality operator comparison.
2339 2009-01-02 Marek Safar <marek.safar@gmail.com>
2341 A fix for bug #462950
2342 * class.cs, decl.cs: Use full explicit name when defining automatic
2343 property backing field.
2345 2009-01-02 Marek Safar <marek.safar@gmail.com>
2347 A fix for bug #462592
2348 * pending.cs: Emit type arguments for generic proxy method.
2350 2008-12-30 Marek Safar <marek.safar@gmail.com>
2352 * expression.cs (As): Mutate all type arguments.
2354 2008-12-29 Marek Safar <marek.safar@gmail.com>
2356 A fix for bug #462622
2357 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
2360 2008-12-29 Marek Safar <marek.safar@gmail.com>
2362 A fix for bug #450782
2363 * ecore.cs: Consider more variables of form V.I to be fixed.
2365 2008-12-29 Marek Safar <marek.safar@gmail.com>
2367 A fix for bug #460712
2368 * typemanager.cs: Core types could be imported.
2370 2008-12-28 Marek Safar <marek.safar@gmail.com>
2372 A fix for bugs #460847, #460772, #458049, #457339, #447807
2373 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
2374 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
2375 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
2376 user lambdas used inside query clauses.
2378 2008-12-18 Marek Safar <marek.safar@gmail.com>
2380 A fix for bug #460229
2381 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
2383 2008-12-18 Marek Safar <marek.safar@gmail.com>
2385 A fix for bug #459952
2386 * decl.cs, namespace.cs: Use common CheckAccessLevel.
2388 2008-12-18 Marek Safar <marek.safar@gmail.com>
2390 A fix for bug #459630
2391 * convert.cs: Enum to valuetype conversion is not allowed.
2393 2008-12-18 Marek Safar <marek.safar@gmail.com>
2395 A fix for bug #457087
2396 * generic.cs: Don't crash when constraint comes from type
2399 2008-12-16 Marek Safar <marek.safar@gmail.com>
2401 A fix for bug #459221
2402 * anonymous.cs, statement.cs: Delay only captured this
2405 2008-12-12 Marek Safar <marek.safar@gmail.com>
2407 A fix for bug #457489
2408 * anonymous.cs, statement.cs: Split anonymous storey instantiation
2409 and initialization to capture scope initializers correctly.
2411 2008-12-11 Marek Safar <marek.safar@gmail.com>
2413 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
2414 ParameterReference refactoring.
2416 2008-12-03 Marek Safar <marek.safar@gmail.com>
2418 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
2419 to be imported from any assembly.
2421 2008-12-03 Marek Safar <marek.safar@gmail.com>
2423 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
2424 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
2425 from anonymous method and lambda expression.
2427 2008-12-01 Marek Safar <marek.safar@gmail.com>
2429 A fix for bug #448560
2430 * expression.cs (As): Box any generic type arguments to be
2433 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2435 Add tripwire for implicit conversion bugs
2436 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
2438 (MethodGroupExpr.OverloadResolve): Add sanity check between
2439 IsApplicable and VerifyArgumentsCompat.
2440 (VerifyArgumentsCompat): Report CS1501 where appropriate.
2442 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2444 Fix build break in System.Data_test
2445 * convert.cs (ImplicitConversionExists): Move NullLiteral
2447 (ImplicitStandardConversionExists): ... here.
2449 2008-11-28 Marek Safar <marek.safar@gmail.com>
2451 * literal.cs: Emit correctly explicit null to nullable cast.
2453 2008-11-28 Marek Safar <marek.safar@gmail.com>
2455 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
2458 2008-11-28 Marek Safar <marek.safar@gmail.com>
2460 A fix for bug #449005
2461 * convert.cs, nullable.cs: Use only one implicit nullable
2464 2008-11-27 Marek Safar <marek.safar@gmail.com>
2466 * convert.cs, literal.cs: More Convert cleanup is needed.
2468 2008-11-27 Marek Safar <marek.safar@gmail.com>
2470 * decl.cs, class.cs: Fixed misleading error message.
2472 2008-11-26 Marek Safar <marek.safar@gmail.com>
2474 A fix for bug #449005
2475 * nullable.cs (EmitEquality): Disable optimization for user operator
2478 2008-11-25 Marek Safar <marek.safar@gmail.com>
2480 A fix for bug #447027
2481 * anonymous.cs (HoistedVariable): Cache also outer access to deal
2482 with context variables stored as expression instances.
2484 2008-11-25 Marek Safar <marek.safar@gmail.com>
2486 A fix for bug #447027
2487 * delegate.cs: Fixed delegate VerifyMethod logic.
2489 2008-11-24 Marek Safar <marek.safar@gmail.com>
2491 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
2494 2008-11-21 Marek Safar <marek.safar@gmail.com>
2496 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
2497 member type resolve to follow normal flow, instead of random
2500 2008-11-21 Marek Safar <marek.safar@gmail.com>
2502 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
2505 2008-11-21 Marek Safar <marek.safar@gmail.com>
2507 * const.cs: Emit decimal array constant as literal.
2509 2008-11-20 Marek Safar <marek.safar@gmail.com>
2511 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
2513 2008-11-19 Marek Safar <marek.safar@gmail.com>
2515 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
2516 into real property (saves 8 MB for corlib compilation).
2518 2008-11-19 Marek Safar <marek.safar@gmail.com>
2520 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
2521 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
2522 generic-mcs.cs: Small cleanup of TypeArguments.
2524 2008-11-18 Marek Safar <marek.safar@gmail.com>
2526 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
2527 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
2528 of ConstructedType expression, renamed to GenericTypeExpr.
2530 2008-11-17 Marek Safar <marek.safar@gmail.com>
2532 A fix for bug #445303
2533 * location.cs (IsConditionalDefined): Handle undefined global
2536 2008-11-17 Marek Safar <marek.safar@gmail.com>
2538 A fix for bug #444678
2539 * expression.cs (TryReduceConstant): Always create new constant
2542 2008-11-17 Marek Safar <marek.safar@gmail.com>
2544 A fix for bug #444673
2545 * ecore.cs: Ignore open generic types when used as generic type
2548 2008-11-17 Marek Safar <marek.safar@gmail.com>
2550 A fix for bug #445458
2551 * expression.cs, cs-parser.jay: Don't crash when an expression
2554 2008-11-17 Marek Safar <marek.safar@gmail.com>
2556 A fix for bug #445464
2557 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
2558 inside unbound type.
2560 2008-11-14 Jb Evain <jbevain@novell.com>
2562 * driver.cs: ignore empty -nowarn argument such as
2563 the one in -nowarn:12,13,,.
2565 2008-11-13 Marek Safar <marek.safar@gmail.com>
2567 A fix for bug #444271
2568 * anonymous.cs: Rescan parent storeys when best candidate was
2571 2008-11-13 Marek Safar <marek.safar@gmail.com>
2573 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
2574 useless UnboundTypeExpression.
2576 * attribute.cs: Do check obsolete attribute on generic types.
2578 2008-11-12 Marek Safar <marek.safar@gmail.com>
2580 A fix for bugs #425680, #400139
2581 * ecore.cs, expression.cs: Trying to do some almost_matched_members
2584 2008-11-11 Marek Safar <marek.safar@gmail.com>
2586 A fix for bug #435747
2587 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
2588 compound value types assignment. Few micro optimizations added.
2590 2008-11-10 Marek Safar <marek.safar@gmail.com>
2592 A fix for bug #442610
2593 * anonymous.cs (MutateConstructor): More SRE hacking.
2595 2008-11-10 Marek Safar <marek.safar@gmail.com>
2597 A fix for bug #442579
2598 * ecore.cs: Also initialize expanded form of a method with 1 params
2601 2008-11-06 Marek Safar <marek.safar@gmail.com>
2603 * expression.cs (UnaryMutator): Do early l-side check.
2605 2008-11-05 Miguel de Icaza <miguel@novell.com>
2607 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
2608 Init, otherwise we would crash later on when checking for friend
2611 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
2612 Otherwise we never get any meaningful information as to what
2615 2008-11-05 Marek Safar <marek.safar@gmail.com>
2617 A fix for bug #436318
2618 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
2620 2008-11-05 Miguel de Icaza <miguel@novell.com>
2622 * namespace.cs: Turns out that it was a really bad idea to hide
2623 the errors for namespaces not found here in eval mode.
2625 * eval.cs: When we process using clauses, only enter those into
2626 the list of valid using clauses after they have been validated.
2628 The above change gives the proper semantics: it does not
2629 senselessly report the same errors with broken using statements by
2630 never storing them in the first place when they are invalid.
2632 2008-11-05 Marek Safar <marek.safar@gmail.com>
2634 A fix for bug #421839
2635 * cs-parser.jay: Remove expression from coalesce rule to force lower
2636 priority than the assignment operator.
2638 2008-11-05 Marek Safar <marek.safar@gmail.com>
2640 A fix for bug #437875
2641 * nullable.cs: Compile correctly method group operand used with null
2642 coalescing operator.
2644 2008-11-04 Marek Safar <marek.safar@gmail.com>
2646 A fix for bug #434589
2647 * expression.cs (Binary): Ignore lifted conversions when at least
2648 one operand is of reference type.
2650 2008-11-04 Marek Safar <marek.safar@gmail.com>
2652 * cs-parser.jay: Better syntax error report.
2654 2008-11-03 Marek Safar <marek.safar@gmail.com>
2656 A fix for bug #436792
2657 * cs-parser.jay: Use GetLocation to access location.
2659 2008-11-03 Marek Safar <marek.safar@gmail.com>
2661 A fix for bug #440774
2662 * cs-parser.jay: Also set current_array_type when parsing local
2665 2008-11-03 Marek Safar <marek.safar@gmail.com>
2667 A fix for bug #440785
2668 * expression.cs (As): Don't resolve self modifing expression
2671 2008-11-03 Marek Safar <marek.safar@gmail.com>
2673 A fix for bug #439447
2674 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
2676 2008-11-03 Marek Safar <marek.safar@gmail.com>
2678 A fix for bug #437571
2679 * cs-parser.jay: Fixes internal error for invalid expression
2682 2008-10-17 Marek Safar <marek.safar@gmail.com>
2684 * ecore.cs: Resolve correctly ambiguous params delegate methods.
2686 2008-10-17 Marek Safar <marek.safar@gmail.com>
2688 * generic.cs, anonymous.cs: Simplified GetDeclarations.
2690 2008-10-17 Marek Safar <marek.safar@gmail.com>
2692 * cs-tokenizer.cs: More precise cast parsing.
2694 2008-10-16 Martin Baulig <martin@ximian.com>
2696 * anonymous.cs (AnonymousMethodStorey): Put back the
2697 `hoisted_locals' hashtable and use it in EmitType().
2699 2008-10-15 Marek Safar <marek.safar@gmail.com>
2701 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
2702 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
2705 2008-10-14 Marek Safar <marek.safar@gmail.com>
2707 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
2709 2008-10-14 Marek Safar <marek.safar@gmail.com>
2711 * statement.cs: Mutate scope initializers.
2713 2008-10-14 Marek Safar <marek.safar@gmail.com>
2715 * expression.cs: Use typeless value for This constant.
2717 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
2719 2008-10-14 Marek Safar <marek.safar@gmail.com>
2721 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
2724 2008-10-13 Marek Safar <marek.safar@gmail.com>
2726 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
2729 2008-10-13 Marek Safar <marek.safar@gmail.com>
2731 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
2732 parser and tokenizer. Fixes many ambiguities including #433258.
2734 2008-10-10 Marek Safar <marek.safar@gmail.com>
2736 * cs-parser.jay: Fixed missing accessor recovery.
2738 2008-10-10 Marek Safar <marek.safar@gmail.com>
2740 A fix for bug #433701
2741 * expression.cs: Better error message.
2743 2008-10-10 Marek Safar <marek.safar@gmail.com>
2745 * cs-parser.jay, expression.cs: Start reporting real parser errors.
2747 * Makefile: Disabled unused debug symbols.
2749 Also fixes: #320556, #321097, #321656, #321876, #351316
2751 2008-10-09 Miguel de Icaza <miguel@novell.com>
2753 * eval.cs: rename "<interactive>" to "{interactive}", to work
2754 around a requirement in the compiler that this be a valid
2755 filename, and in Windows it is not (433886).
2757 2008-10-09 Marek Safar <marek.safar@gmail.com>
2759 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
2761 2008-10-08 Marek Safar <marek.safar@gmail.com>
2763 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
2764 cs-parser.jay: Generic type declaration and type arguments cleanup.
2766 2008-10-05 Marek Safar <marek.safar@gmail.com>
2768 * cs-parser.jay: Allow parsing weird array creation construct.
2770 2008-10-05 Marek Safar <marek.safar@gmail.com>
2772 * cs-parser.jay: Conflicts reduction.
2774 2008-10-04 Marek Safar <marek.safar@gmail.com>
2776 * cs-parser.jay: Conflicts reduction.
2778 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
2781 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
2782 property. Add a 'count' hint about the use of the shared vector.
2783 Ensure that we don't leak out dirty bits.
2784 (UsageVector.MergeChild): Throw away information about variables
2786 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
2788 2008-10-03 Marek Safar <marek.safar@gmail.com>
2790 A fix for bug #431746
2791 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
2792 parameters when iterator is created.
2794 2008-10-03 Marek Safar <marek.safar@gmail.com>
2796 A fix for bug #431827
2797 * expression.cs: Fixed right based pointer arithmetic operations
2800 2008-10-03 Marek Safar <marek.safar@gmail.com>
2802 A fix for bug #353779
2803 * assign.cs, expression.cs: Fixed compound assignment conversions.
2805 2008-10-02 Marek Safar <marek.safar@gmail.com>
2807 A fix for bug #375262
2808 * statement.cs: Refactor ArrayForeach to be usable with string
2809 indexer. Optimized single dimentional arrays foreach.
2811 2008-10-02 Marek Safar <marek.safar@gmail.com>
2813 A fix for bug #431255
2814 * anonymous.cs, expression.cs: Removed broken optimization.
2816 2008-10-01 Marek Safar <marek.safar@gmail.com>
2818 * anonymous.cs: Use full type parameters of parent generic
2819 containers. Removed unnecessary AddParentStoreyReference call.
2821 2008-10-01 Marek Safar <marek.safar@gmail.com>
2823 A fix for bug #324702
2824 * class.cs: Use better shorter names for explicit interface member
2827 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
2829 2008-10-01 Marek Safar <marek.safar@gmail.com>
2831 * expression.cs: Use new interface to check fixed expression.
2833 2008-10-01 Marek Safar <marek.safar@gmail.com>
2835 A fix for bug #421101
2836 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
2837 interface to check for fixed fixed-buffers.
2839 2008-10-01 Marek Safar <marek.safar@gmail.com>
2841 A fix for bug #429264
2842 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
2844 * delegate.cs: Removed unnecessary casts.
2846 2008-09-30 Marek Safar <marek.safar@gmail.com>
2848 A fix for bug #352151
2849 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
2850 class.cs: Fixed already defined explicit interface members check.
2852 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
2854 cs-tokenizer.cs: Fix typo.
2856 2008-09-28 Miguel de Icaza <miguel@novell.com>
2858 * eval.cs (InteractiveBase): The quit command now just sets a
2859 flag, instead of calling Environment.Exit(), it is milder on
2862 CompiledMethod is now in Mono.CSharp, not nested inside
2863 the Evaluator, it was inconvenient to use.
2865 2008-09-27 Miguel de Icaza <miguel@novell.com>
2867 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
2868 code to be invoked without having to reparse.
2870 2008-09-27 Miguel de Icaza <miguel@novell.com>
2872 * ecore.cs: The recent changes to FieldExpr broke this as well.
2873 Fixes LINQ queries in the interactive shell.
2875 * Multiple files: indentation fixing for the Mono coding
2876 guidelines for the switch statement.
2878 * eval.cs: Make the Evaluator API thread safe.
2880 2008-09-26 Marek Safar <marek.safar@gmail.com>
2882 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
2883 constructor parsing.
2885 2008-09-26 Marek Safar <marek.safar@gmail.com>
2887 A fix for bug #325326
2888 * statement.cs: Check possible mistaken empty statement using
2889 explicit blocks only.
2891 2008-09-25 Miguel de Icaza <miguel@novell.com>
2893 * eval.cs (LoadAssembly, ReferenceAssembly): Call
2894 RootNamespace.ComputeNamespaces to update the internal list of
2895 namespaces, this is no longer done for us.
2897 (InteractiveBase): Use the Evaluator APIs instead of calling into
2900 2008-09-25 Marek Safar <marek.safar@gmail.com>
2902 A fix for bug #429264
2903 * expression.cs: Missing mutator for access to multidimensional
2906 2008-09-25 Marek Safar <marek.safar@gmail.com>
2908 * class.cs, statement: Emit DebuggerHidden attribute for iterator
2911 * driver.cs: Missing input argument check.
2913 2008-09-25 Marek Safar <marek.safar@gmail.com>
2915 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
2916 expression.cs, statement.cs, rootcontext.cs, class.cs,
2917 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
2920 2008-09-24 Miguel de Icaza <miguel@novell.com>
2922 * ecore.cs (FieldExpr): Only initialize eclass when we return a
2923 fully constructed FieldExpr, fixes the regression introduced in
2926 * ecore.cs, expression.cs: Plug back the eclass initialization as
2927 otherwise it regresses `csharp'.
2929 2008-09-24 Marek Safar <marek.safar@gmail.com>
2931 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
2932 ecore.cs, attribute.cs: Moved obsolete method checks from emit
2933 phase to resolve phase. It resolves problems with expression trees
2934 and fixes bugs #323796, #325156.
2936 2008-09-23 Marek Safar <marek.safar@gmail.com>
2938 * codegen.cs: Report better error when symbol writer is missing.
2940 2008-09-23 Marek Safar <marek.safar@gmail.com>
2942 * codegen.cs: Set .NET symbol writer.
2944 * decl.cs: Guard against null generic arguments.
2946 * report.cs: Don't report exactly same additional details.
2948 2008-09-22 Marek Safar <marek.safar@gmail.com>
2950 A fix for bug #324917
2951 * cs-parser.jay: Add missing multidimensional non-expression type
2954 2008-09-22 Marek Safar <marek.safar@gmail.com>
2956 A fix for bug #428191
2957 * anonymous.cs: Create an outer generic fields also for non-storey
2960 2008-09-22 Marek Safar <marek.safar@gmail.com>
2962 A fix for bug #378294
2963 * class.cs: Make fixed size buffers gmcs feature only.
2965 2008-09-22 Marek Safar <marek.safar@gmail.com>
2967 A fix for bug #355622, #324993
2968 * assign.cs, const.cs, class.cs: Create new EmitContext for each
2971 2008-09-19 Marek Safar <marek.safar@gmail.com>
2973 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
2976 2008-09-19 Marek Safar <marek.safar@gmail.com>
2978 A fix for bug #416110
2979 * generic.cs: Struct constraint results in default ctor and
2980 ValueType base type constraint to be set.
2982 2008-09-19 Marek Safar <marek.safar@gmail.com>
2984 A fix for bug #423791
2985 * generic.cs: Fixed params output type type-inference.
2987 2008-09-19 Marek Safar <marek.safar@gmail.com>
2989 * cs-parser.jay, expression.cs: Fixed few expression crashes.
2991 2008-09-19 Marek Safar <marek.safar@gmail.com>
2993 * cs-tokenizer.cs: Don't break on extra partial modifier.
2995 2008-09-19 Marek Safar <marek.safar@gmail.com>
2997 A fix for bug #427592
2998 * generic.cs: Use common parameter resolve method.
3000 2008-09-18 Marek Safar <marek.safar@gmail.com>
3002 A fix for bug #414758
3003 * expression.cs, ecore.cs: Fixed crash when accessing non-static
3006 2008-09-18 Marek Safar <marek.safar@gmail.com>
3008 * driver.cs, namespace.cs: Read types and namespaces after all
3009 requested assemblies are loaded, fixes issues with System.Core
3010 auto-reference, and #419888.
3012 2008-09-18 Marek Safar <marek.safar@gmail.com>
3014 A fix for bug #417705
3015 * cs-parser.jay: Fixed as/is operator expression split.
3017 2008-09-18 Marek Safar <marek.safar@gmail.com>
3019 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
3020 Fixed expression tree representation of empty new expression and
3021 new initializer expression.
3023 2008-09-18 Miguel de Icaza <miguel@novell.com>
3025 * eval.cs: Remove warning, keep reference to driver around.
3027 * Hide fields that do not need to be public.
3029 2008-09-17 Marek Safar <marek.safar@gmail.com>
3031 A fix for bug #426385
3032 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
3033 conversion for array elements.
3035 2008-09-17 Marek Safar <marek.safar@gmail.com>
3037 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
3038 void parsing conflicts.
3040 2008-09-15 Marek Safar <marek.safar@gmail.com>
3042 A fix for bug #425601
3043 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
3044 System.Core only when there is no custom ExtensionAttribute
3047 2008-09-15 Miguel de Icaza <miguel@novell.com>
3049 * namespace.cs: Do not report CS0246 (name
3051 2008-09-12 Marek Safar <marek.safar@gmail.com>
3053 A fix for bug #425669
3054 * generic.cs: Don't cache generic static anonymous method
3057 2008-09-12 Marek Safar <marek.safar@gmail.com>
3059 * generic.cs, class.cs, delegate.cs: Check recursive inherited
3060 conflicting constraints.
3062 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
3064 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
3067 2008-09-12 Marek Safar <marek.safar@gmail.com>
3069 * literal.cs, convert.cs, expression.cs, statement.cs: More null
3070 to null pointer conversion fixes.
3072 2008-09-11 Marek Safar <marek.safar@gmail.com>
3074 * cs-parser.jay, expression.cs: An implicitly typed local variable
3075 declarator cannot use an array initializer.
3077 2008-09-11 Marek Safar <marek.safar@gmail.com>
3079 * cs-parser.jay: Reduced number of printed tokens, add sorting.
3081 2008-09-11 Marek Safar <marek.safar@gmail.com>
3083 * generic.cs (InflatedConstraints): Don't crash when constraints
3086 * cs-parser.jay: const_declarator is a block.
3088 * constant.cs: Check for not allowed NaN conversions.
3090 2008-09-10 Miguel de Icaza <miguel@novell.com>
3092 * driver.cs: Drop --shell argument, the compiler is no longer a
3095 * eval.cs: Move most of the code that deals with evaluation into
3096 this file and document the public API from repl.cs
3098 * repl.cs: Remove from here.
3100 2008-09-10 Marek Safar <marek.safar@gmail.com>
3102 A fix for bug #424684
3103 * generic.cs: Generic class constraints must come first.
3105 2008-09-09 Miguel de Icaza <miguel@novell.com>
3107 * cs-parser.jay: Improve error reporting for syntax errors in
3108 statements and expressions, we now report the expected tokens
3109 instead of reporting the useless "; expected".
3111 Drop the strings from the token declaration, it turns out that
3112 they did not do what I thought they did. Instead they were adding
3113 two sets of tokens to the tables.
3115 2008-09-09 Marek Safar <marek.safar@gmail.com>
3117 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
3118 delegate.cs: Share special type check.
3120 2008-09-09 Marek Safar <marek.safar@gmail.com>
3122 A fix for bug #423981
3123 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
3125 2008-09-09 Marek Safar <marek.safar@gmail.com>
3127 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
3130 2008-09-09 Marek Safar <marek.safar@gmail.com>
3132 A fix for bugs: #324750, #335946
3133 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
3134 lookup rule to determine ?-based tokens.
3136 2008-09-08 Miguel de Icaza <miguel@novell.com>
3138 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
3139 expressions (like event adding or removing) end up here, so we
3140 need to treat those as statements.
3142 Add LoadAssembly method.
3144 2008-09-04 Miguel de Icaza <miguel@novell.com>
3146 * repl.cs: Add Time method.
3148 2008-09-05 Marek Safar <marek.safar@gmail.com>
3150 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
3152 2008-09-05 Miguel de Icaza <miguel@novell.com>
3154 * repl.cs: Add workaround for old compilers.
3156 2008-09-04 Jb Evain <jbevain@novell.com>
3158 * repl.cs (PrettyPrint): pretty print everything that
3159 implements IDictionary, as well as IEnumerables. Also,
3160 add a quit helper property.
3162 2008-09-04 Marek Safar <marek.safar@gmail.com>
3164 * constant.cs: Better error reporting for decimal literals.
3166 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
3169 2008-09-04 Marek Safar <marek.safar@gmail.com>
3170 Miguel de Icaza <miguel@novell.com>
3172 A fix for bug #422951
3173 * assign.cs (Assign.DoResolve): Perform the type conversions
3174 checks before we attempt to initialize `New' initializers.
3176 2008-09-04 Marek Safar <marek.safar@gmail.com>
3178 A fix for bug #422853
3179 * delegate.cs (DelegateCreation): Add special handling for
3180 EmptyExpression.Null instance expression which is just another
3181 hack for undecided member instance exression.
3183 2008-09-04 Marek Safar <marek.safar@gmail.com>
3185 * expression.cs, ecore.cs: Emit full expression tree for reduced
3188 2008-09-04 Marek Safar <marek.safar@gmail.com>
3190 * expression.cs (This): Guard against multi-resolving.
3192 * ecore.cs, statement.cs (Throw): Simplified.
3194 * flowanalysis.cs: Also verify event fields.
3196 2008-09-04 Miguel de Icaza <miguel@novell.com>
3198 * assign.cs (Assign.DoResolve): Perform the type conversions
3199 checks before we attempt to initialize `New' initializers.
3201 * repl.cs (PrettyPrint): Add Hashtable prettyprint
3203 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
3206 * repl.cs: Update help.
3208 2008-09-03 Miguel de Icaza <miguel@novell.com>
3210 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
3211 handling of the default config handling, including the special
3212 treatment of System.Core assembly.
3214 Fixes the REPL processing for LINQ.
3216 2008-09-03 Marek Safar <marek.safar@gmail.com>
3218 A fix for bug #422507
3219 * expression.cs (UnboxCast): Add missing child expression mutator.
3221 2008-09-03 Marek Safar <marek.safar@gmail.com>
3223 * driver.cs: Don't self reference System.Core assembly.
3225 2008-09-03 Marek Safar <marek.safar@gmail.com>
3227 A fix for bug #422507
3228 * expression.cs (StringConcat): Add missing type mutator.
3230 2008-09-03 Marek Safar <marek.safar@gmail.com>
3232 * generic.cs (TypeInferenceContext): Follow equality rule for
3233 constructed type lower bound type inference.
3235 2008-09-02 Miguel de Icaza <miguel@novell.com>
3237 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
3238 <dblank@cs.brynmawr.edu> which updates the cursor position on
3241 2008-09-02 Marek Safar <marek.safar@gmail.com>
3243 A fix for bug #367145
3244 * driver.cs: Fixed import of extension methods when using -noconfig
3247 2008-09-02 Marek Safar <marek.safar@gmail.com>
3249 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
3250 version from non-generic implementation instead.
3252 2008-09-01 Marek Safar <marek.safar@gmail.com>
3254 A fix for bug #418908
3255 * class.cs: Use AddScopeStatement for field initializers.
3257 2008-09-01 Marek Safar <marek.safar@gmail.com>
3259 A fix for bug #415385
3260 * ecore.cs, convert.cs: Do method group conversion for equal group types.
3262 2008-09-01 Marek Safar <marek.safar@gmail.com>
3264 A fix for bug #421736
3265 * iterators.cs: Don't crash on unreachable iterators.
3267 2008-09-01 Marek Safar <marek.safar@gmail.com>
3269 A fix for bug #421628
3270 * parameter.cs, attribute.cs: Clone also parameter attributes.
3272 2008-08-30 Miguel de Icaza <miguel@novell.com>
3274 * namespace.cs (LookupType): In EvalMode, try to replace
3275 the TypeBuilder from our cache with a Type as Reflection.Emit does
3276 not like to mix code from older assemblies emitted and new
3279 This sounds like a serious Mono bug that prevents multiple
3280 assemblies to be generated and consumed at the same time.
3282 * cs-parser.jay (push_current_class): Do not make interactive
3283 classes internal or private, make them public as we currently
3284 generate each new class in a new assembly.
3286 2008-08-29 Miguel de Icaza <miguel@novell.com>
3288 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
3289 remove types that are entered into the global namespace during
3290 parsing so that we can remove them on failure.
3292 * cs-parser.jay: Parsing: we now keep track of types that are
3293 entered into global variables and queue those in case the parsing
3296 This happens in a few situations: during partial-input, we invoke
3297 the parser repeatedly for example with the string "class X", this
3298 would cause X to be registed, and we need to remove this
3299 registration so that another parse attempt later with say "class X {"
3300 would actually work.
3302 Additionally, if there is an error in the resolution phase, for
3303 example: "class X : NonExistant {}" th
3305 * cs-parser.jay: Be more precise with the errors being raised,
3306 instead of flagging all exceptions during parsing to be attributed
3307 to the parsing process, distinguish those from errors happening in
3308 the actions and hint that using -v would produce the actual
3311 * repl.cs: Do not load all compiler references on each reset,
3312 doing the partial reset takes care of this.
3314 2008-08-28 Miguel de Icaza <miguel@novell.com>
3316 * repl.cs: Add support for loading all the files from
3317 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
3320 Introduce a micro-parser that is able to deambiguate on its input
3321 whether we are dealing with a compilation unit (namespace, class,
3322 interface, struct, delegate) declaration or a statement. This
3323 allows both declarations and statements to be entered.
3325 Set history size by default to 300 lines.
3327 Instead of distinguishing based on the parser.InteractiveResult,
3328 have only two cases: statements were parsed, or a compilation unit
3329 was. Always pull the Using statement additions from the
3330 compilation unit parse.
3332 * cs-tokenizer.cs: Rename tokens to better describe their intent
3333 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
3335 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
3336 EvalMode is used to trigger the lookup of global variables while
3337 StatementMode is used turn variable declarations into static
3340 * getline.cs: Allow history size to be set.
3342 2008-08-29 Marek Safar <marek.safar@gmail.com>
3344 A fix for bug #360755
3345 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
3347 2008-08-29 Marek Safar <marek.safar@gmail.com>
3349 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
3351 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
3352 member name, it is too confusing
3354 * decl.cs, class.cs: Don't report unused fields with attached attribute.
3356 * rootcontext.cs: Finally default to warning level 4.
3358 2008-08-28 Marek Safar <marek.safar@gmail.com>
3360 * class.cs (CheckBase): Ignore overloaded operators.
3362 2008-08-28 Marek Safar <marek.safar@gmail.com>
3364 A fix for bug #420830
3365 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
3367 2008-08-28 Marek Safar <marek.safar@gmail.com>
3369 A fix for bug #420832
3370 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
3372 2008-08-28 Marek Safar <marek.safar@gmail.com>
3374 A fix for bug #420386
3375 * nullables.cs: Fixed logic of nullable user comparison operators involving
3378 2008-08-28 Marek Safar <marek.safar@gmail.com>
3380 * attribute (IsClsCompliant): Use FALSE value for pointer types.
3382 2008-08-27 Miguel de Icaza <miguel@novell.com>
3384 * repl.cs: Add support for aborting the running code with C-c.
3386 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
3388 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
3390 2008-08-27 Miguel de Icaza <miguel@novell.com>
3392 * cs-parser.jay (interactive_statement_list): A new set of rules
3393 for hosting statements that uses the "interactive_" prefix.
3395 * repl.cs: Add support for parsing `using' as a statement or as a
3396 directive. Deambiguating before passing this to the parser.
3398 We need to distinguish statement_expressions that occur at the
3399 toplevel vs those that occur embedded into expressions.
3401 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
3402 that fixes the cursor key handling, and a history bug.
3404 2008-08-26 Miguel de Icaza <miguel@novell.com>
3406 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
3407 limitations in Console, instead the 2.0 bootstrap libraries now
3408 include the Console bits.
3410 Also, remove the use of Nullables from getline.cs
3414 Interactive support for the C# compiler. Use gmcs --shell to
3415 enter a read-eval-print loop shell.
3417 Docs: http://www.mono-project.com/CsharpRepl
3419 * sources: include repl.cs here and getline.cs for gmcs.exe,
3420 everything else is getline.cs impaired.
3422 * Makefile: when bootstrapping pass a special flag
3423 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
3424 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
3425 This distinguishes those two cases.
3427 * repl.cs: Support for a read-eval-print loop. Will be soon
3428 refactored into eval support and then REPL on top of it.
3430 * ecore.cs: If a simplename lookup fails, before erroring out,
3431 if we are in EvalMode to resolve the name to a declaration in the
3434 This means that variable declarations that happened in previous
3435 classes (as repl puts every statement in a separate class) are
3436 made visible in this way.
3438 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
3439 triggered an error due to the end of file being reached. This is
3440 used to do multi-line input, and notify the caller that the user
3441 needs to provide more text before a successful parse.
3443 Add new grammar rules after the INTERACTIVE_PARSER token is seen
3444 to drive the evaluation with a custom wrapper.
3446 * driver.cs: Add support for --shell, and refactor some code to be
3449 * namespace.cs: Add support for serializing the contents of the
3450 namespaces and reloading them.
3452 * getline.cs: A managed implementation of ReadLine under
3453 X11/Apache2 license terms. Easy to embed in other applications as
3456 * namespace.cs: Add some functions to save and restore the
3459 * rootcontext.cs: New public field.
3461 * cs-tokenizer.cs: Add support for one of the possible characters
3462 we introduce into the token stream.
3464 This patch does not affect the regular tokenization process, the
3465 only performance hit would happen if there is an invalid character
3466 on the input string.
3468 * support.cs: Move isatty helper routine here.
3470 * codegen.cs: Small cleanup, and add a mechanism to initialize the
3471 code generator for in-memory assemblies.
3473 2008-08-26 Marek Safar <marek.safar@gmail.com>
3475 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
3476 parameter cannot be always used as a type.
3478 2008-08-21 Marek Safar <marek.safar@gmail.com>
3480 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
3482 2008-08-21 Marek Safar <marek.safar@gmail.com>
3484 * convert.cs: Implement explicit array to IList<T> conversion.
3486 2008-08-20 Marek Safar <marek.safar@gmail.com>
3488 A fix for bug #362740
3489 * cs-tokenizer.cs: Handle UTF-16 surrogates.
3491 2008-08-20 Marek Safar <marek.safar@gmail.com>
3493 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
3494 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
3495 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
3496 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
3497 handling to use just one type of infrastructure and deal with generics
3500 2008-07-23 Martin Baulig <martin@ximian.com>
3502 *** Merged this from trunk revision 108527 ***
3505 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
3506 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
3509 2008-08-15 Marek Safar <marek.safar@gmail.com>
3511 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
3514 2008-08-15 Marek Safar <marek.safar@gmail.com>
3516 * delegate.cs: Fixed compiler crash when creating delegate using partial
3519 * typemanager.cs: MulticastDelegate is not a delegate.
3521 2008-08-14 Marek Safar <marek.safar@gmail.com>
3523 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
3526 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
3528 * cs-parser.jay (type): Allow 'var' in mcs too.
3529 (local_variable_type): Likewise.
3531 2008-08-14 Marek Safar <marek.safar@gmail.com>
3533 * driver.cs: Removed broken -noconfig variants.
3535 2008-08-14 Marek Safar <marek.safar@gmail.com>
3537 A fix for bug #417078
3538 * expression.cs: Emit correctly left side pointer operators.
3540 2008-08-13 Marek Safar <marek.safar@gmail.com>
3542 * generic.cs, lambda.cs: Inflate method generic arguments only.
3544 2008-08-12 Marek Safar <marek.safar@gmail.com>
3546 * class.cs: Fixed struct layout check regression.
3548 2008-08-12 Marek Safar <marek.safar@gmail.com>
3550 * cs-parser.jay, enum.cs: Simplified enum parsing.
3552 * decl.cs: Check all type parameters conflicts.
3554 * expression.cs, statement.cs, attribute.cs: More expression checks.
3556 2008-08-11 Marek Safar <marek.safar@gmail.com>
3558 * generic.cs: Add type inference types restriction.
3560 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
3561 anonymous.cs, expression.cs: Allocate less accessor parameters.
3563 2008-08-08 Marek Safar <marek.safar@gmail.com>
3565 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
3568 2008-08-08 Marek Safar <marek.safar@gmail.com>
3570 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
3572 2008-08-07 Marek Safar <marek.safar@gmail.com>
3574 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
3575 Also fixes #362146 and #381592.
3577 2008-08-07 Marek Safar <marek.safar@gmail.com>
3579 * ecore.cs: Reduced constant cannot be used as an attribute value.
3581 * cs-parser.jay: Base expression has to be a type.
3583 * expression.cs (Conditional): Uses ReducedExpression.
3585 2008-08-06 Marek Safar <marek.safar@gmail.com>
3587 A fix for bug #376826
3588 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
3589 address of hoisted local variable or parameter cannot be taken.
3591 2008-08-05 Marek Safar <marek.safar@gmail.com>
3593 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
3594 anonymous method inside checked/unchecked expression.
3596 2008-08-05 Marek Safar <marek.safar@gmail.com>
3598 * typemanager.cs (IsEqual): Guard against null.
3600 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
3601 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
3602 routine. Fixed few misleading conversion errors.
3604 2008-08-04 Marek Safar <marek.safar@gmail.com>
3606 * class.cs: Consider generics when checking cycles in struct layout.
3608 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
3610 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
3612 2008-08-04 Marek Safar <marek.safar@gmail.com>
3614 A fix for bug #414165
3615 * anonymous.cs: Use same anonymous implementation method for all anonymous
3618 2008-08-04 Marek Safar <marek.safar@gmail.com>
3620 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
3623 2008-08-04 Marek Safar <marek.safar@gmail.com>
3625 * cs-parser.jay: Typeof argument has to be a type expression.
3627 * namespace.cs: Check alias and namespace definitions collisions.
3629 * class.cs, pending.cs: Moved explicit interface accessor implementation
3632 * delegate.cs, expression.cs: Verify special name invocations.
3634 2008-08-01 Marek Safar <marek.safar@gmail.com>
3636 * cs-parser.jay: Don't choke on empty generic type arguments.
3638 * cs-tokenizer.cs: Handle escaped preprocessor directives.
3640 * expression.cs, ecore.cs: Minor expressions bugs.
3642 2008-08-01 Marek Safar <marek.safar@gmail.com>
3644 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
3645 and added more error handling.
3647 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
3649 * modifiers.cs, enum.cs: Fixed.
3651 2008-07-31 Jb Evain <jbevain@novell.com>
3653 * driver.cs: remove -pkg ability of smcs.
3655 2008-07-30 Marek Safar <marek.safar@gmail.com>
3657 * statement.cs (Switch): Correctly set empty default target for single
3660 2008-07-30 Marek Safar <marek.safar@gmail.com>
3662 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
3663 string switch statement implementation to use string dictionary which
3664 significantly (2-8x) improves performance of generated code.
3666 2008-07-29 Marek Safar <marek.safar@gmail.com>
3668 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
3669 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
3671 2008-07-29 Marek Safar <marek.safar@gmail.com>
3673 A fix for bug #412595
3674 * typemanager.cs, convert.cs, expression.cs: Some types are never
3675 convertible to each other.
3677 2008-07-29 Marek Safar <marek.safar@gmail.com>
3679 * nullable.cs (CreateNullConstant): An error messages update.
3681 2008-07-29 Marek Safar <marek.safar@gmail.com>
3683 A fix for bug #412595
3684 * cfold.cs: Don't cast undefined bool constant.
3686 2008-07-29 Martin Baulig <martin@ximian.com>
3689 (SymbolWriter.Reset): New public static method.
3692 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
3694 2008-07-28 Marek Safar <marek.safar@gmail.com>
3696 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
3698 * expression.cs (ElementAccess): Exact size allocation.
3700 2008-07-26 Marek Safar <marek.safar@gmail.com>
3702 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
3704 2008-07-25 Marek Safar <marek.safar@gmail.com>
3706 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
3708 * class.cs: Removed $PRIVATE$ field hack which caused problems during
3711 2008-07-25 Marek Safar <marek.safar@gmail.com>
3713 A fix for bug #412217
3714 * assign.cs: Mutate also assignment type.
3716 2008-07-25 Marek Safar <marek.safar@gmail.com>
3718 A fix for bug #323644
3719 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
3722 2008-07-25 Marek Safar <marek.safar@gmail.com>
3724 A fix for bug #412134
3725 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
3726 non-enumerable operands when overloading equality or bitwise operators.
3728 2008-07-25 Marek Safar <marek.safar@gmail.com>
3730 * anonymous.cs: Cache closed generic anonymous method delegates.
3732 2008-07-24 Marek Safar <marek.safar@gmail.com>
3734 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
3735 anonymous.cs, statement.cs: Always emit anonymous method as static method
3736 when is instance free. Use nesting for nested anynomous methods blocks.
3738 2008-07-23 Marek Safar <marek.safar@gmail.com>
3740 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
3743 2008-07-23 Marek Safar <marek.safar@gmail.com>
3745 * expression.cs: Removed MakeSimpleCall.
3747 2008-07-23 Marek Safar <marek.safar@gmail.com>
3749 A fix for bug #323012
3750 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
3751 Base method implementing interface has to be public.
3753 2008-07-23 Marek Safar <marek.safar@gmail.com>
3755 * cs-parser.jay: Don't break on missing argument.
3757 2008-07-22 Marek Safar <marek.safar@gmail.com>
3759 A fix for bug #320993
3760 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
3761 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
3763 2008-07-22 Marek Safar <marek.safar@gmail.com>
3765 A fix for bug #320748
3766 * convert.cs: Implicit user operators cannot convert to interfaces
3768 2008-07-22 Marek Safar <marek.safar@gmail.com>
3770 A fix for bug #312686
3771 * driver.cs: Ignore empty assembly references.
3773 2008-07-22 Marek Safar <marek.safar@gmail.com>
3775 A fix for bug #387040
3776 * ecore.cs: Skip constrains check for an explicit implementation.
3778 2008-07-21 Marek Safar <marek.safar@gmail.com>
3780 A fix for bug #409045
3781 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
3782 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
3783 identifiers are file specific unless passed as input arguments.
3785 2008-07-21 Marek Safar <marek.safar@gmail.com>
3787 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
3788 to emit UnmanagedMarshal data under 2.0 profile.
3790 2008-07-21 Marek Safar <marek.safar@gmail.com>
3792 A fix for bug #410369
3793 * parameter.cs: Clone correctly ParamsParameter.
3795 2008-07-21 Marek Safar <marek.safar@gmail.com>
3797 * expression.cs (Argument): Always report type for type based expressions
3800 2008-07-18 Marek Safar <marek.safar@gmail.com>
3802 A fix for bug #410666
3803 * anonymous.cs: Correctly initialize generic storey reference.
3805 2008-07-18 Marek Safar <marek.safar@gmail.com>
3807 * convert.cs: Don't box same type arguments.
3809 2008-07-18 Marek Safar <marek.safar@gmail.com>
3811 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
3812 Finished missing generic type mutators.
3814 2008-07-18 Marek Safar <marek.safar@gmail.com>
3816 * iterators.cs, statement.cs: Finished statements CloneTo.
3818 2008-07-18 Marek Safar <marek.safar@gmail.com>
3820 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
3822 * expression.cs: Emit optimized default value expressions in expression tree
3825 2008-07-18 Marek Safar <marek.safar@gmail.com>
3827 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
3829 2008-07-17 Marek Safar <marek.safar@gmail.com>
3831 A fix for bug #367536
3832 * cs-parser.jay: Check static constructor of generic types for an access
3835 2008-07-17 Marek Safar <marek.safar@gmail.com>
3837 A fix for bug #353800
3838 * lambda.cs: Emit ret for contextual statements.
3840 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
3841 up emitting redundant ret for all anonymous methods with return.
3843 2008-07-17 Marek Safar <marek.safar@gmail.com>
3845 A fix for bug #365188
3846 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
3847 create anonymous method storey in unreachable block.
3849 2008-07-17 Marek Safar <marek.safar@gmail.com>
3851 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
3852 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
3853 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
3854 statement.cs: Fixed relevant defects found by Gendarme.
3856 2008-07-17 Marek Safar <marek.safar@gmail.com>
3858 A fix for bug #325291
3859 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
3860 statement.cs: Replaced IAnonymousHost with top level block flag.
3862 2008-07-17 Marek Safar <marek.safar@gmail.com>
3864 * cs-parser.jay: Clean up unused open_parens.
3866 2008-07-17 Marek Safar <marek.safar@gmail.com>
3868 * ecore.cs: Custom error message for a range variable assignment.
3870 2008-07-16 Marek Safar <marek.safar@gmail.com>
3872 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
3875 2008-07-16 Marek Safar <marek.safar@gmail.com>
3877 * literal.cs: Null literal is of object type.
3879 2008-07-16 Marek Safar <marek.safar@gmail.com>
3881 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
3882 expression of nullable equality comparison.
3884 2008-07-15 Marek Safar <marek.safar@gmail.com>
3886 * expression.cs(PointerArithmetic): Removed redundant assignment.
3888 2008-07-15 Marek Safar <marek.safar@gmail.com>
3890 * decl.cs (GetSignatureForError): Report full namespace name for containers.
3892 2008-07-14 Marek Safar <marek.safar@gmail.com>
3894 A fix for bug #408361
3895 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
3896 they are replaced by GetMethod.
3898 2008-07-14 Marek Safar <marek.safar@gmail.com>
3900 A fix for bug #408721 by jeremie.laval@gmail.com
3901 * expression.cs (Indirection): Implemented CloneTo.
3903 2008-07-14 Marek Safar <marek.safar@gmail.com>
3905 * statement.cs (AssignableSlots): Temporary disabled variable initialization
3908 2008-07-14 Marek Safar <marek.safar@gmail.com>
3910 * report.cs (EnableReporting): Don't reinitialize 0-based values.
3912 2008-07-11 Marek Safar <marek.safar@gmail.com>
3914 * linq.cs: Reset tranparent parameter counter in probing mode.
3916 2008-07-11 Marek Safar <marek.safar@gmail.com>
3918 * anonymous.cs: Mutate anonymous method type.
3920 2008-07-11 Marek Safar <marek.safar@gmail.com>
3922 * ecore.cs, anonymous.cs: Mutate field expressions.
3924 2008-07-10 Marek Safar <marek.safar@gmail.com>
3926 A fix for bug #369670
3927 * linq.cs, statement.cs: Use explicit block for query expressions variables.
3929 2008-07-10 Marek Safar <marek.safar@gmail.com>
3931 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
3933 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
3936 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
3937 only one '>', and finds a '>>', abort the generic lookahead.
3939 2008-07-10 Marek Safar <marek.safar@gmail.com>
3941 A fix for bug #319902
3942 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
3944 2008-07-10 Marek Safar <marek.safar@gmail.com>
3946 A fix for bug #406371
3947 * statement.cs: Moved EmitSymbolInfo to Block.
3949 2008-07-09 Marek Safar <marek.safar@gmail.com>
3951 * ecore.cs: Report better error for extension method overload failures.
3953 2008-07-09 Marek Safar <marek.safar@gmail.com>
3955 * expression.cs (Is): No need to box reference values.
3957 2008-07-09 Marek Safar <marek.safar@gmail.com>
3959 * class.cs: Use event resolve context when initializing CreateEmitContext.
3961 2008-07-09 Marek Safar <marek.safar@gmail.com>
3963 A fix for bug #394436
3964 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
3965 method used inside expression trees. Added more LINQ to expression tree
3968 2008-07-08 Marek Safar <marek.safar@gmail.com>
3970 A fix for bug #378189, #370577
3971 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
3974 2008-07-08 Marek Safar <marek.safar@gmail.com>
3976 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
3979 2008-07-08 Marek Safar <marek.safar@gmail.com>
3981 A fix for bug #406702
3982 * anonymous.cs: Always park anonymous method in the nearest parent storey.
3984 2008-07-07 Marek Safar <marek.safar@gmail.com>
3986 A fix for bug #406648
3987 * cs-parser.jay: Report nullable use in mcs for some cases.
3989 2008-07-07 Marek Safar <marek.safar@gmail.com>
3991 * ecore.cs: Improved argument mismatch error messages.
3993 2008-07-07 Marek Safar <marek.safar@gmail.com>
3995 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
3997 2008-07-07 Marek Safar <marek.safar@gmail.com>
3999 * expression.cs (TypeOf): Mutate type argument.
4001 2008-07-04 Marek Safar <marek.safar@gmail.com>
4003 * class.cs: Report missing partial modifier for correct type.
4005 2008-07-04 Marek Safar <marek.safar@gmail.com>
4007 * ecore.cs, expression.cs (VariableReference): Variable property is
4010 2008-07-04 Marek Safar <marek.safar@gmail.com>
4012 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
4014 2008-07-04 Marek Safar <marek.safar@gmail.com>
4016 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
4019 2008-07-04 Marek Safar <marek.safar@gmail.com>
4021 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
4022 anonymous method storey to an instance method when only "this" is hoisted.
4024 2008-07-03 Marek Safar <marek.safar@gmail.com>
4026 A fix for bug #321615
4027 * expression.cs: Pointer comparisons use unsigned operator.
4029 2008-07-03 Marek Safar <marek.safar@gmail.com>
4031 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
4033 2008-07-02 Marek Safar <marek.safar@gmail.com>
4035 A fix for bug #404905
4036 * class.cs: Always initialize local unsafe variables.
4038 2008-06-30 Marek Safar <marek.safar@gmail.com>
4040 A fix for bug #396987
4041 * expression.cs (NewInitialize): Clear local temporary variable for next run
4043 2008-06-27 Marek Safar <marek.safar@gmail.com>
4045 A fix for bug #401020
4046 * ecore.cs: Both types and modifiers have to match for ref and out arguments
4048 2008-06-27 Marek Safar <marek.safar@gmail.com>
4050 A fix for bug #398319
4051 * cs-parser.jay: Implemented undocumented base access expression inside
4054 2008-06-26 Marek Safar <marek.safar@gmail.com>
4056 A fix for bug #404227
4057 * cs-parser.jay: Parse namespace declaration using qualified identifier.
4059 2008-06-26 Marek Safar <marek.safar@gmail.com>
4061 A fix for bug #404227
4062 * convert.cs: Fixed explicit array to interface cast.
4064 2008-06-26 Marek Safar <marek.safar@gmail.com>
4066 A fix for bug #403894
4067 * delegate.cs: Mutate DelegateInvocation type.
4069 2008-06-26 Marek Safar <marek.safar@gmail.com>
4071 A fix for bug #379348
4072 * delegate.cs: Box a load of generic parameters.
4074 2008-06-26 Marek Safar <marek.safar@gmail.com>
4076 * expression.cs: Add an array creation arguments mutate.
4078 2008-06-26 Marek Safar <marek.safar@gmail.com>
4080 A fix for bug #386068
4081 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
4084 2008-06-25 Marek Safar <marek.safar@gmail.com>
4086 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
4089 2008-06-25 Marek Safar <marek.safar@gmail.com>
4091 A fix for bug #403518
4092 * delegate.cs: Type correctly anonymous method new invocation.
4094 2008-06-24 Marek Safar <marek.safar@gmail.com>
4096 A fix for bug #394826
4097 * anonymous.cs: Fully qualify members when resolving anonymous type internal
4100 2008-06-24 Marek Safar <marek.safar@gmail.com>
4102 A fix for bug #394826
4103 * anonymous.cs, iterators.cs: Construct generic storey only when is really
4106 2008-06-24 Marek Safar <marek.safar@gmail.com>
4108 * class.cs: Clone indexer parameters for localized capturing.
4110 2008-06-24 Marek Safar <marek.safar@gmail.com>
4112 A fix for bug #402379
4113 * expression.cs: Don't crash when an object initializer resolve fails.
4115 2008-06-24 Marek Safar <marek.safar@gmail.com>
4117 A fix for bug #402888
4118 * expression.cs: Mutate conditional expression.
4120 2008-06-24 Marek Safar <marek.safar@gmail.com>
4122 A fix for bug #401012
4123 * class.cs: Keep StructLayout in shared container.
4125 2008-06-24 Marek Safar <marek.safar@gmail.com>
4127 A fix for bug #400438
4128 * decl.cs, class.cs: Only properties can be automatically implemented.
4130 2008-06-24 Marek Safar <marek.safar@gmail.com>
4132 * statement.cs (ChangeToIterator): Copy also labels.
4134 2008-06-23 Marek Safar <marek.safar@gmail.com>
4136 * ecore.cs: Pass type argument details to parent extension method.
4138 2008-06-23 Marek Safar <marek.safar@gmail.com>
4140 A fix for bug #375966
4141 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
4143 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
4145 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
4147 2008-06-22 Marek Safar <marek.safar@gmail.com>
4149 A fix for bug #394347
4150 * anonymous.cs: Cache compatible delegates as compatibility check produces
4151 a new method every time.
4153 2008-06-20 Marek Safar <marek.safar@gmail.com>
4155 * anonymous.cs: Propagate storey reference for single references.
4157 2008-06-20 Marek Safar <marek.safar@gmail.com>
4159 A fix for bug #387615
4160 * assign.cs, expression.cs: Correctly clone compound assignment.
4162 2008-06-19 Marek Safar <marek.safar@gmail.com>
4164 A fix for bug #359611, #359604
4165 * anonymous.cs: Mutate all types of hoisted parameters.
4167 2008-06-19 Marek Safar <marek.safar@gmail.com>
4169 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
4170 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
4171 expression.cs, codegen.cs, statement.cs
4173 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
4174 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
4176 ** Anonymous methods, lambda expressions rewrite **
4178 Anonymous expressions are now resolved when an explicit block is resolved
4179 and they don't require any registration procedure anymore. Further,
4180 anonymous methods are defined when explicit block is emitted which allows
4181 better control of whole process and opens possibilities for more
4182 optimizations as well as alternative to reverse whole process.
4184 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
4185 process consistent and to correctly emit hoisted generic methods when they
4186 have at least 1 hoisted variable.
4188 2008-06-17 Martin Baulig <martin@ximian.com>
4190 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
4192 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
4193 virtual property; check it in Emit().
4194 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
4196 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
4198 (Indexer.Define): Likewise.
4200 2008-06-17 Marek Safar <marek.safar@gmail.com>
4202 * convert.cs: Don't use IsInterface on type arguments.
4204 * delegate.cs: DelegateInvocation uses MethodInfo.
4206 * parameter.cs: Removed IsTypeParameter.
4208 * generic-mcs.cs: More missing stuff.
4210 2008-06-16 Martin Baulig <martin@ximian.com>
4213 (Modifiers.DEBUGGER_HIDDEN): New public const.
4216 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
4219 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
4220 (AbstractPropertyEventMethod): Likewise.
4221 (Constructor.Emit): Likewise.
4222 (SourceMethod.SetCompilerGenerated): Removed.
4224 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
4228 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
4229 if we're an `IteratorHost'.
4230 (AnonymousMethodMethod..ctor): Don't set
4231 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
4234 2008-06-16 Marek Safar <marek.safar@gmail.com>
4236 * statement.cs: Clean-up foreach statements.
4238 2008-06-12 Marek Safar <marek.safar@gmail.com>
4240 * class.cs: Stop using public method which should not exist
4241 (MethodBuilder.SetGenericMethodSignature).
4243 2008-06-11 Martin Baulig <martin@ximian.com>
4246 (Location.LookupFile): Add `CompilationUnit' argument; when given
4247 a relative file name, make it relative to the directory the .cs
4248 file is located in instead of using the current directory.
4250 2008-06-11 Martin Baulig <martin@ximian.com>
4253 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
4254 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
4255 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
4256 (SourceMethod.SetCompilerGenerated): Likewise.
4258 2008-06-11 Marek Safar <marek.safar@gmail.com>
4260 * codegen.cs, driver: Only write symbol file when it's asked for.
4262 2008-06-11 Marek Safar <marek.safar@gmail.com>
4264 * codegen.cs: Don't use assembly writer error handling for symbol writer.
4266 2008-06-10 Martin Baulig <martin@ximian.com>
4268 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
4270 2008-06-09 Marek Safar <marek.safar@gmail.com>
4272 A fix for bug #316290
4273 * expression.cs: Include decimal operators in predefined table.
4275 * parameters.cs: More readonlyness.
4277 2008-06-09 Marek Safar <marek.safar@gmail.com>
4279 A fix for bug #397213
4280 * cs-parser.jay: One more missing current_local_parameters reset.
4282 2008-06-09 Marek Safar <marek.safar@gmail.com>
4284 A fix for bug #396633
4285 * class.cs: Host backing field in partial container.
4287 2008-06-09 Marek Safar <marek.safar@gmail.com>
4289 A fix for bug #397068
4290 * expression.cs: Check both operand types when predefined operator is used.
4292 2008-06-05 Martin Baulig <martin@ximian.com>
4294 Merged the `debugger-kahalo' branch.
4297 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
4298 we're an iterator method.
4299 (SourceMethod): Reflect latest symbol writer changes;
4300 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
4301 now `start_row' and `end_row'.
4302 (Constructor.Emit): Fix the logic whether to emit symbol information.
4304 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
4308 (CompilationUnit): New public class; derives from `SourceFile'.
4309 (SourceFileEntry.DefineSymbolInfo): New public method.
4310 (SourceFileEntry.SetChecksum): New public method.
4311 (Location): Encode hidden line numbers by using `column == 255';
4312 the .ctor now accepts `column == -1' to mark a hidden line number.
4313 (Location.Hidden): New public property.
4314 (Location.CheckPoint): Add `CompilationUnit'.
4315 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
4316 (Location.Push): Add `CompilationUnit compile_unit' argument.
4317 (Location.CompilationUnit): New public property.
4320 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
4322 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
4324 * driver.cs: `SourceFile' -> `CompilationUnit'.
4326 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
4328 * namespace.cs: `SourceFile' -> `CompilationUnit'.
4330 * cs-tokenizer.cs: Add support for `#pragma checksum' and
4334 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
4335 new symbol writer API to also pass the file.
4337 2008-06-05 Marek Safar <marek.safar@gmail.com>
4339 * statement.cs: Emit catch variable assignment using variable expression.
4341 2008-06-05 Marek Safar <marek.safar@gmail.com>
4343 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
4344 with other variable types.
4346 2008-06-04 Marek Safar <marek.safar@gmail.com>
4348 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
4349 GetLength method emit, it breaks resolve rules.
4351 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
4352 Marek Safar <marek.safar@gmail.com>
4354 A fix for bug #395542
4355 * cs-parser.jay: The trailing comma is allowed in anonymous type member
4358 2008-06-02 Marek Safar <marek.safar@gmail.com>
4360 A fix for bug #395287
4361 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
4363 2008-05-31 Marek Safar <marek.safar@gmail.com>
4365 A fix for bug #395845
4366 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
4367 non-nullable parameter type.
4369 2008-05-31 Marek Safar <marek.safar@gmail.com>
4371 * class.cs: Handle contructor initializer as a statement in top-level block.
4373 2008-05-30 Marek Safar <marek.safar@gmail.com>
4375 * attribute.cs: Don't mix old and new corlib types when emitting corlib
4376 security attributes.
4378 2008-05-24 Marek Safar <marek.safar@gmail.com>
4380 * ecore.cs, expression.cs: Small IVariable refactoring.
4382 2008-05-22 Marek Safar <marek.safar@gmail.com>
4384 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
4386 2008-05-21 Marek Safar <marek.safar@gmail.com>
4388 * cs-parser.jay: Removed redundant catch type check.
4390 2008-05-21 Marek Safar <marek.safar@gmail.com>
4392 A fix for bug #390372
4393 * nullable.cs: Set correct return type.
4395 2008-05-21 Marek Safar <marek.safar@gmail.com>
4397 A fix for bug #391062
4398 * typemanager.cs: Fixed crash when comparing null types.
4400 2008-05-21 Marek Safar <marek.safar@gmail.com>
4402 A fix for bug #391871
4403 * cs-parser.jay: Better error handling for invalid catch type.
4405 2008-05-20 Marek Safar <marek.safar@gmail.com>
4407 A fix for bug #392155
4408 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
4410 2008-05-15 Marek Safar <marek.safar@gmail.com>
4412 A fix for bug #390666
4413 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
4416 2008-05-15 Marek Safar <marek.safar@gmail.com>
4418 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
4421 2008-05-13 Marek Safar <marek.safar@gmail.com>
4423 A fix for bug #389625
4424 * delegate.cs, generic.cs: Some progress on method group return type
4427 2008-05-13 Marek Safar <marek.safar@gmail.com>
4429 A fix for bug #378419
4430 * namespace.cs: Inspect also parent namespaces not only namespace entries.
4432 2008-05-12 Marek Safar <marek.safar@gmail.com>
4434 * class.cs (Constructor): Added IsCompilerGenerated.
4436 2008-05-12 Marek Safar <marek.safar@gmail.com>
4438 * expression.cs: Enum binary operators can accept non-enum operand only when
4439 is implicitly convertible to underlying type.
4441 2008-05-12 Marek Safar <marek.safar@gmail.com>
4443 A fix for bug #389272
4444 * support.cs: Workaround System.InvalidOperationException for enums.
4446 2008-05-12 Marek Safar <marek.safar@gmail.com>
4448 A fix for bug #389073
4449 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
4451 2008-05-10 Marek Safar <marek.safar@gmail.com>
4453 * driver.cs: Split Parse.
4455 * location.cs (LookupFile): Uses string.Empty.
4457 2008-05-07 Marek Safar <marek.safar@gmail.com>
4459 * expression.cs, parameter.cs: Small ParameterReference clean up.
4461 2008-05-07 Marek Safar <marek.safar@gmail.com>
4463 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
4464 hack. Fixes #387502.
4466 2008-05-06 Martin Baulig <martin@ximian.com>
4468 * class.cs (Constructor.Emit): Fix the logic whether to emit
4471 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
4474 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
4475 InvalidOperationException when the iterator is before the start or
4478 2008-05-06 Marek Safar <marek.safar@gmail.com>
4480 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
4481 when left is nullable type.
4483 2008-05-06 Marek Safar <marek.safar@gmail.com>
4485 A fix for bug #386628
4486 * expression.cs (LocalVariableReference): Continue in resolving when
4487 variable is not assigned.
4489 2008-05-05 Marek Safar <marek.safar@gmail.com>
4491 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
4492 nullable operations.
4494 2008-05-04 Marek Safar <marek.safar@gmail.com>
4496 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
4497 it saves many redundant temporary variables for nullable operations.
4499 2008-05-03 Marek Safar <marek.safar@gmail.com>
4501 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
4503 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
4506 * nullable.cs: Constant coalescing operator optimizations.
4508 2008-05-03 Marek Safar <marek.safar@gmail.com>
4510 * constant.cs: Use unsigned conversion for values which are unsigned only.
4512 2008-05-03 Marek Safar <marek.safar@gmail.com>
4514 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
4515 coalescing operator as it should be.
4517 2008-05-02 Marek Safar <marek.safar@gmail.com>
4519 A fix for bug #371016
4520 * expression.cs: All predefined delegate operators require implicit method
4523 2008-05-02 Marek Safar <marek.safar@gmail.com>
4525 * constant.cs: Emit long constant as uint when fits the range.
4527 * convert.cs, expression.cs: Fixed few unsafe conversions.
4529 2008-05-02 Marek Safar <marek.safar@gmail.com>
4531 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
4533 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
4536 * convert.cs (ImplicitNumericConversion): Don't modify the type of
4538 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
4540 2008-05-01 Marek Safar <marek.safar@gmail.com>
4542 * constant.cs, literal.cs: IsLiteral property for error reporting.
4544 * ecore.cs, expression.cs: Implemented Property expression.
4546 2008-05-01 Marek Safar <marek.safar@gmail.com>
4548 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
4550 * nullable.cs: Implemented nullable coalescing null operator.
4552 * ecore.cs, expression.cs: Expression trees work.
4554 2008-05-01 Marek Safar <marek.safar@gmail.com>
4556 * ecore.cs: CreateExpressionTree is finally abstract.
4558 * expression.cs, linq.cs: Updated.
4560 2008-05-01 Marek Safar <marek.safar@gmail.com>
4562 * expression.cs, ecore.cs: Block base access expression inside expression
4565 2008-05-01 Marek Safar <marek.safar@gmail.com>
4567 A fix for bug #385058
4568 * expression.cs: User-defined operator implementations always take
4569 precedence over predefined operator implementations.
4571 2008-04-30 Marek Safar <marek.safar@gmail.com>
4573 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
4574 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
4575 expression tree conversions.
4577 2008-04-30 Marek Safar <marek.safar@gmail.com>
4579 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
4580 operators method details to Operator class.
4582 2008-04-30 Marek Safar <marek.safar@gmail.com>
4584 * anonymous.cs: Pass unsafe flags to anonymous container.
4586 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
4587 inside expression tree.
4589 2008-04-29 Martin Baulig <martin@ximian.com>
4591 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
4592 (Tokenizer.PopPosition): Also restore the `line'.
4594 2008-04-29 Marek Safar <marek.safar@gmail.com>
4596 * delegate.cs: Implemented Invoke expression.
4598 2008-04-29 Marek Safar <marek.safar@gmail.com>
4600 * expression.cs: Fixed equality reference comparison regression.
4602 2008-04-29 Marek Safar <marek.safar@gmail.com>
4604 * ecore.cs: Clean up EmptyCast hack.
4606 * expression.cs, nullable.cs: Implemented enum binary and unary operations
4607 using correct conversion rules. Also fixes #383993.
4609 2008-04-28 Martin Baulig <martin@ximian.com>
4611 * class.cs (Constructor.Emit): Don't emit debugging information
4612 for generated default .ctor's.
4614 2008-04-28 Marek Safar <marek.safar@gmail.com>
4616 * convert.cs: Empty-cast ushort to int conversion.
4618 2008-04-28 Marek Safar <marek.safar@gmail.com>
4620 A fix for bug #384191
4621 * ecore.cs, expression.cs: Fixed expression cloning.
4623 2008-04-28 Marek Safar <marek.safar@gmail.com>
4625 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
4627 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
4629 Fix #381559, test-638.cs, test-639.cs
4630 * assign.cs (CompoundAssign.Helper): New wrapper.
4631 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
4633 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
4634 Pass unconverted expressions to the params array creation expression.
4635 (FieldExpr.EmitAssign): Don't special-case StringConcat.
4636 (PropertyExpr.EmitAssign): Likewise.
4637 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
4638 element if it is of kind CompoundAssign.Helper.
4639 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
4640 first before anything else.
4641 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
4642 (ArrayAccess.LoadArrayAndArguments): Simplify.
4644 2008-04-27 Marek Safar <marek.safar@gmail.com>
4646 * expression.cs: Fixed cloning of typeof(void).
4648 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
4650 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
4651 (Assign.Emit): Likewise. Move it to ...
4652 (CompoundAssign.DoResolve): ... here and ...
4653 (CompoundAssign.Emit): ... here.
4654 (EventAddOrRemove): New helper to handle += and -= on events, and
4655 avoid the use of BinaryDelegates.
4656 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
4657 (EventExpr.EmitAddOrRemove): Improve.
4658 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
4660 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
4661 create VarExprs for 'foo.bar.var'.
4662 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
4663 is a highly inappropriate name for its functionality.
4665 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4667 Simplify handling of multiple assignments
4668 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
4670 (SimpleAssign): New. Class to be used for normal assignments.
4671 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
4672 * expression.cs, parameter.cs, statement.cs: Likewise.
4674 2008-04-25 Marek Safar <marek.safar@gmail.com>
4676 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
4677 for incompatible underlying types, more to come, uff.
4679 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4682 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
4683 Handle 'leave_copy'.
4685 2008-04-25 Marek Safar <marek.safar@gmail.com>
4687 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
4689 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
4691 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
4692 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
4693 * statement.cs (While, Do, For): Allow test to have side effects.
4694 (For.DoEmit): Always emit InitStatement.
4697 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
4698 Always create SideEffectConstant.
4699 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
4700 of type EnumConstant.
4702 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4703 Handle 'right' being SideEffectConstant of type 'bool'.
4705 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4706 Use left.EmitBranchable instead of open coding it, so as to
4707 improve optimization opportunities.
4709 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
4711 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
4713 (Expression.EmitSideEffect): Document.
4715 2008-04-23 Marek Safar <marek.safar@gmail.com>
4717 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
4719 2008-04-23 Marek Safar <marek.safar@gmail.com>
4721 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
4723 2008-04-23 Marek Safar <marek.safar@gmail.com>
4725 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
4726 conversion to expression tree.
4728 2008-04-23 Marek Safar <marek.safar@gmail.com>
4730 * ecore.cs: Removed unused expression.
4732 2008-04-22 Marek Safar <marek.safar@gmail.com>
4734 * expression.cs: Implemented NegateChecked and New expressions.
4736 2008-04-22 Marek Safar <marek.safar@gmail.com>
4738 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
4740 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
4743 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
4744 needing final 'ret' instruction.
4746 2008-04-22 Marek Safar <marek.safar@gmail.com>
4748 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
4750 2008-04-21 Marek Safar <marek.safar@gmail.com>
4752 * expression.cs: Emit ldnull and not null expression as an instance argument
4753 of static method expression calls.
4755 2008-04-21 Marek Safar <marek.safar@gmail.com>
4757 A fix for bug #378200
4758 * expression.cs: Fixed crash when creating parameterless expression tree
4761 2008-04-21 Marek Safar <marek.safar@gmail.com>
4763 A fix for bug #375297
4764 * anonymous.cs: Fixed crash when inferring from null argument anonymous
4767 2008-04-21 Marek Safar <marek.safar@gmail.com>
4769 A fix for bug #377596
4770 * decl.cs, class.cs: Emit delegate type argument attributes.
4772 2008-04-21 Marek Safar <marek.safar@gmail.com>
4774 A fix for bug #365314
4775 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
4777 2008-04-21 Marek Safar <marek.safar@gmail.com>
4779 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
4782 2008-04-21 Marek Safar <marek.safar@gmail.com>
4784 * generic.cs (TypeParameter): Removed redundant location.
4786 2008-04-19 Marek Safar <marek.safar@gmail.com>
4788 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
4789 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
4790 FullNamedExpression in all declaration type expression, statements will come
4793 2008-04-18 Marek Safar <marek.safar@gmail.com>
4795 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
4796 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
4798 2008-04-18 Marek Safar <marek.safar@gmail.com>
4800 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
4803 2008-04-17 Marek Safar <marek.safar@gmail.com>
4805 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
4808 2008-04-17 Marek Safar <marek.safar@gmail.com>
4810 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
4814 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
4816 Hook up 'EmitSideEffect'
4817 * constant.cs (Constant.EmitSideEffect): New.
4818 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
4819 (SideEffectConstant.EmitSideEffect): New.
4820 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
4821 unconditional branch in EmitBranchable.
4822 (FieldExpr.EmitBranchable): New.
4823 * expression.cs (Unary.EmitSideEffect): New.
4824 (Binary.EmitSideEffect): New.
4825 (VariableReference.EmitSideEffect): New. Do nothing.
4827 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
4829 Introduce 'EmitSideEffect'
4830 * ecore.cs (Expression.EmitSideEffect): New.
4831 (TypeCast): Rename from EmptyCast.
4833 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
4834 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
4835 * convert.cs, nullable.cs: Update to changes.
4837 2008-04-16 Marek Safar <marek.safar@gmail.com>
4839 * class.cs, cs-parser.jay: Early check for base types expression.
4841 2008-04-16 Marek Safar <marek.safar@gmail.com>
4843 * decl.cs (MemberName): Declare PrettyName as obsolete.
4845 2008-04-16 Marek Safar <marek.safar@gmail.com>
4847 * namespace.cs: Use MemberName comparison.
4849 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
4852 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
4854 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
4855 (MemberName.FullyQualifiedName): New. Provides the functionality
4856 that users assume FullName would have.
4857 * ecore.cs, namespace.cs: Update to changes.
4859 * statement.cs (Using.assign): Make into ExpressionStatement.
4860 (Using.EmitPreTryBody): Simplify.
4862 2008-04-16 Marek Safar <marek.safar@gmail.com>
4864 * report.cs: ColorFormat is protected.
4866 * rootcontext.cs: Unused fields clean-up.
4868 * namespace.cs: Made UsingEntry name private.
4870 2008-04-16 Marek Safar <marek.safar@gmail.com>
4872 * cs-tokenizer.cs, location.cs: Removed unused field.
4874 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
4875 Raja R Harinath <harinath@hurrynot.org>
4878 * constant.cs (SideEffectConstant.value): Rename from 'left'.
4879 (SideEffectConstant.side_effect): Rename from 'right'.
4880 (SideEffectConstant..ctor): Normalize 'side_effect'.
4881 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
4882 value of this constant.
4883 * cfold.cs: Update to changes.
4885 2008-04-15 Marek Safar <marek.safar@gmail.com>
4887 * cs-paser.jay: Removed unused variable.
4889 * driver.cs: Made Compile instance method.
4891 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
4893 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
4895 2008-04-15 Marek Safar <marek.safar@gmail.com>
4897 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
4899 2008-04-13 Jb Evain <jbevain@novell.com>
4901 * namespace.cs: update the System.Core fullname for 2.1
4902 * driver.cs: update the list of required assemblies for 2.1.
4903 Merged from the Moonlight 2 branch.
4905 2008-04-11 Marek Safar <marek.safar@gmail.com>
4907 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
4908 types and user defined operators. User operators arguments has to be checked
4909 for null value before invocation, which also means no operator is called
4910 when any argument is not convertible to unwrapped nullable type.
4912 2008-04-09 Marek Safar <marek.safar@gmail.com>
4914 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
4915 of Unary expressions to follow operator overloading rules precisely.
4916 Also fixes #321794, #323794
4918 2008-04-08 Marek Safar <marek.safar@gmail.com>
4920 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
4923 2008-04-08 Marek Safar <marek.safar@gmail.com>
4925 * expression.cs, ecore.cs: Implemented MemberInit expression.
4927 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
4929 Fix mono/tests/exception4.cs
4930 * statement.cs (ExceptionStatement, TryCatch): Revert to using
4931 ec.NeedReturnLabel () rather emitting a 'nop'.
4933 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
4935 (TryCatch.SomeCodeFollows): Likewise.
4936 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
4937 for 'break', 'continue' and 'return' statements inside a try.
4938 We're fairly sure that the generated IL stream will have more
4939 instructions textually following the try.
4940 (FlowBranchingTryCatch): Likewise.
4942 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
4943 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
4946 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
4947 wrapper -- forward everything to CollectionForeach.
4948 (CollectionForeach.NonDisposableWrapper): New.
4949 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
4950 instead of a pop + branch to end.
4952 2008-04-07 Marek Safar <marek.safar@gmail.com>
4954 A fix for bug #377485
4955 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
4956 Propagate location for extension method groups. Report conversion failure at
4959 2008-04-07 Marek Safar <marek.safar@gmail.com>
4961 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
4962 ListInit and Field expressions.
4964 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
4966 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
4967 Since $PC is always -1 inside the body of MoveNext, the fault
4969 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
4970 * statement.cs (ExceptionStatement.emit_finally): Likewise.
4971 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
4973 The denouement! Fix #324708
4974 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
4975 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
4976 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
4977 'finally' inside the finally clause.
4979 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
4980 inside an iterator. Don't emit the body of the 'finally' inside
4981 the finally clause yet.
4983 Use the ResumableStatement infrastructure for MoveNext ()
4984 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
4985 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
4986 'old_resume_points'. Move dispatcher upfront.
4987 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
4988 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
4989 in an enumerator. This encodes the main fix in this patch series
4990 -- we can only jump into the first instruction of a try from the
4991 outside, but we want to emit try/finally regions in iterators and
4992 resume in the middle of them.
4994 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
4996 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
4997 of NeedReturnLabel here.
4999 Introduce a common point for emitting try/finally to IL
5000 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
5001 features of the various subclasses, which are now driven by ...
5002 (ExceptionStatement.EmitPreTryBody): ... this and ...
5003 (ExceptionStatement.EmitTryBody): ... this and the original
5005 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
5006 Remove DoEmit and update to follow above protocol.
5008 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
5009 of the dispatcher are the same, skip emitting the 'switch'.
5010 * iterator.cs (Iterator.EmitDispose): Update to changes.
5012 Clean up handling of 'using' statement
5013 * statement.cs (UsingTemporary): New. Carved out of ...
5014 (Using): ... this. Simplify drastically. Handle exactly
5016 * cs-parser.jay (using_statement): Split. Create UsingTemporary
5017 or Using as appropriate. If there are multiple variable declared,
5018 create nested Using statements.
5019 (resource_acquisition): Kill.
5021 * statement.cs (ExceptionStatement.EmitForDispose): Use
5022 EmitFinallyBody, not EmitFinally.
5024 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
5025 * iterator.cs: Update to changes.
5027 Start using the ResumableStatement infrastructure
5028 * statement.cs (ResumeableStatement.PrepareForDispose): New.
5029 (ResumableStatement.EmitForDispose): New.
5030 (ExceptionStatement): Override them.
5031 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
5032 EmitForDispose to create the body of the Dispose method. Don't
5035 * iterator.cs (Iterator.AddResumePoint): Move here from ...
5036 * statement.cs (Toplevel.AddResumePoint): ... here.
5037 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
5038 * flowanalysis.cs (FlowBranchingIterator): New.
5039 * codegen.cs (EmitContext): Update to changes.
5041 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
5042 (Iterator.old_resume_points): Rename from 'resume_points'.
5043 (Iterator.MoveNextStatement): Remove unused class.
5045 New infrastructure for try/finally in iterators (still unused)
5046 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
5047 (FlowBranchingToplevel.AddResumePoint): Hook into
5048 ToplevelBlock.AddResumePoint.
5049 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
5050 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
5051 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
5052 resume points and assign program-counter values.
5053 (ExceptionBlock.AddResumePoint): Collect resume points for
5054 de-muxer at the top of try block.
5055 * iterators.cs (Yield.CheckContext): Simplify.
5056 (Yield.Resolve): Use FlowBranching.AddResumePoint.
5058 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
5060 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
5061 argument to an ExitStatement.
5062 (FlowBranchingException): Refactor saved origins code.
5063 * statement.cs (ExitStatement): Update to cahges.
5064 * iterator.cs (YieldBreak): Likewise.
5066 * statement.cs (ResumableStatement): New. Common base class for
5067 YieldReturn and ExceptionStatement.
5068 (ExitStatement): New. Common base class for Return and YieldBreak.
5069 (Return): Update to changes.
5070 * iterator.cs (YieldBreak): Likewise.
5071 * lambda.cs (ContextualReturn): Likewise.
5074 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
5075 emit a meaningful error message.
5077 Fix #324765, #319508
5078 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
5079 (VariableInfo.SetAssigned): Set it.
5080 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
5081 determine if CS0219 or CS0168 is appropriate. Don't use
5082 flow-analysis information.
5083 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
5084 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
5085 (EmitContext.EndFlowBranching): ... this.
5087 2008-04-03 Marek Safar <marek.safar@gmail.com>
5089 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
5091 2008-04-03 Marek Safar <marek.safar@gmail.com>
5093 A fix for bug #376508
5094 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
5095 ImplicitConversionExists.
5097 2008-04-03 Marek Safar <marek.safar@gmail.com>
5099 * expression.cs (Binary): Added remaining binary operators to expression
5102 * nullable.cs: Optimize shift with null argument.
5104 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
5106 Fix minor IL regression
5107 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
5108 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
5109 * cs-parser.jay (try_statement): Update to changes.
5111 * statement.cs (TryFinally.need_exc_block): Delete.
5112 (TryFinally): Update to changes.
5114 Now all ExceptionStatements are unconditional
5115 * statement.cs (CollectionForeach.DisposableWrapper): New.
5116 Extract out the try/finally code into a new wrapper.
5117 (CollectionForeach.Resolve): Use it to simplify the code.
5119 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
5121 Start at simplifying ExceptionStatement semantics a bit
5122 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
5123 * cs-parser.jay (try_statement): Update to changes.
5124 (opt_catch_clauses): Remove.
5125 * flowanalysis.cs: Update to changes.
5126 (FlowBranching.BranchingType.TryCatch): New.
5127 (FlowBranchingTryCatch): New.
5129 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
5130 (FlowBranching.CreateBranching): Update to changes.
5131 (FlowBranchingBlock.AddSibling): Add sanity check.
5132 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
5135 * iterators.cs (Iterator.MarkFinally): Remove.
5136 * statement.cs (ExceptionStatement): Update to changes.
5138 Add support for skipping over finally blocks at runtime. First
5139 in a series to fix #324708
5140 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
5141 (Iterator.EmitMoveNext): Initialize it.
5142 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
5143 branch over the body of the 'finally' clause.
5145 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
5147 Avoid lopsided use of Foo/DoFoo names
5148 * statement.cs (ExpressionStatement.EmitFinallyBody):
5149 Rename from EmitFinally.
5150 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
5151 * iterator.cs: Update to changes.
5153 2008-04-02 Marek Safar <marek.safar@gmail.com>
5155 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
5156 based on UserOperatorCall. More binary nullable operators clean up.
5158 2008-04-02 Martin Baulig <martin@ximian.com>
5160 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
5162 2008-04-02 Marek Safar <marek.safar@gmail.com>
5164 * nullable.cs: Merge user and empty conversions when lifting expression
5167 * expression.cs (StringConcat): Implemented expression tree representation.
5169 2008-04-01 Marek Safar <marek.safar@gmail.com>
5171 * nullable.cs: When lifting null literal and a user operator exists, no call
5174 2008-04-01 Marek Safar <marek.safar@gmail.com>
5176 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
5179 2008-04-01 Marek Safar <marek.safar@gmail.com>
5181 * nullable.cs, expression.cs: Use namespace instead heavily nested
5182 monster abstract class.
5184 2008-04-01 Marek Safar <marek.safar@gmail.com>
5186 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
5187 lifting of null literal and user operators. Clean up of some temporary
5190 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
5192 Fix #368224, test-629.cs
5193 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
5194 if it crossed an unwind-protect boundary.
5195 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
5196 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
5197 inside an unwind-protected region.
5198 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
5199 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
5200 'leave' instead of a 'br' if unwind-protected.
5201 (Iterator.EmitYieldBreak): Likewise.
5203 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
5205 * driver.cs: Only define versioninfo resources if no win32 resource
5208 2008-03-28 Marek Safar <marek.safar@gmail.com>
5210 A fix for bug #372375
5211 * convert.cs: Fixed boxing of nullable types.
5213 2008-03-28 Marek Safar <marek.safar@gmail.com>
5215 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
5218 2008-03-28 Marek Safar <marek.safar@gmail.com>
5220 A fix for bug #374619
5221 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
5223 2008-03-27 Marek Safar <marek.safar@gmail.com>
5225 * lambda.cs: Check return type only for invocation.
5227 2008-03-27 Marek Safar <marek.safar@gmail.com>
5229 A fix for bug #374214
5230 * ecore.cs: Correctly report argument type mismatch.
5232 2008-03-27 Marek Safar <marek.safar@gmail.com>
5234 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
5235 and not rely on broken IsEnum.
5237 2008-03-27 Marek Safar <marek.safar@gmail.com>
5239 * nullable.cs: New file, extracted from generic.cs.
5241 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
5243 2008-03-27 Marek Safar <marek.safar@gmail.com>
5245 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
5246 predefined comparison operators and null literals.
5248 * report.cs: New warning ID.
5250 2008-03-25 Marek Safar <marek.safar@gmail.com>
5252 A fix for bug #370577
5253 * lambda.cs: Check return type too.
5255 2008-03-25 Marek Safar <marek.safar@gmail.com>
5257 A fix for bug #372846
5258 * class.cs: Automatic properties can be declared as unsafe.
5260 2008-03-20 Marek Safar <marek.safar@gmail.com>
5262 * location.cs: Use string based concatenation.
5264 * expression.cs: LiftedBinaryOperator is gmcs only.
5266 2008-03-20 Marek Safar <marek.safar@gmail.com>
5268 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
5269 conversions rules and expression trees.
5271 2008-03-19 Marek Safar <marek.safar@gmail.com>
5273 * delegate.cs: Use extension method source as delegate target.
5275 2008-03-19 Marek Safar <marek.safar@gmail.com>
5277 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
5278 binary operations to be purely based on binary operations and optimized
5279 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
5280 and other ET refactoring.
5282 * typemanager.cs: Fixed warning.
5284 2008-03-17 Marek Safar <marek.safar@gmail.com>
5286 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
5288 * symbolwriter.cs: Fixed.
5290 2008-03-17 Marek Safar <marek.safar@gmail.com>
5292 * anonymous.cs, driver.cs: Reset anonymous types counters.
5294 2008-03-17 Marek Safar <marek.safar@gmail.com>
5296 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
5298 * class.cs: Use fullname for all type member definitions.
5300 2008-02-19 Martin Baulig <martin@ximian.com>
5303 (IMethodData.EmitExtraSymbolInfo): New interface method.
5304 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
5305 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
5306 interface method here as an empty public virtual method.
5309 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
5310 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
5311 CodeGen.SymbolWriter.SetRealMethodName().
5313 2008-02-18 Martin Baulig <martin@ximian.com>
5316 (ScopeInfo.EmitType): Override this and emit debugging
5317 information for captured variables.
5318 (RootScopeInfo.EmitType): Override this and emit symbol
5319 information for a captured `this'.
5321 2008-02-15 Martin Baulig <martin@ximian.com>
5323 * iterators.cs: Emit debugging info.
5326 (EmitContext.Flags): Add `OmitDebuggingInfo'.
5327 (EmitContext.OmitDebuggingInfo): New public property.
5330 (While): Override Emit() and don't emit symbol info there; do it
5331 inside DoEmit() instead.
5332 (Block.Emit): Omit symbol information while emitting the scope
5333 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
5335 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
5336 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
5337 .ctor to make `IsIterator' work.
5339 2008-03-14 Martin Baulig <martin@ximian.com>
5341 * symbolwriter.cs: Added the new symbol writer function from the
5342 debugger's `terrania' branch; temporarily enclose them inside
5343 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
5346 2008-03-14 Martin Baulig <martin@ximian.com>
5349 (SymbolWriter): Make this a public static class.
5352 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
5353 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
5355 2008-03-14 Marek Safar <marek.safar@gmail.com>
5357 A fix for bug #370577
5358 * statement.cs, lambda.cs: Added extra limitations when dealing with void
5361 2008-03-14 Marek Safar <marek.safar@gmail.com>
5363 * typemanager.cs (CSharpName): Made 250 times faster.
5365 2008-03-13 Marek Safar <marek.safar@gmail.com>
5367 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
5369 2008-03-12 Marek Safar <marek.safar@gmail.com>
5371 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
5372 crash when predefined field does not exist.
5374 2008-03-12 Marek Safar <marek.safar@gmail.com>
5376 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
5378 2008-03-12 Marek Safar <marek.safar@gmail.com>
5380 * class.cs (FixedField): Don't crash when contructors are missing.
5382 2008-03-11 Marek Safar <marek.safar@gmail.com>
5384 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
5385 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
5386 check internal types accessibility for internal and external types.
5387 Replaced EnumToUnderlying by GetEnumUnderlyingType.
5389 2008-03-11 Marek Safar <marek.safar@gmail.com>
5391 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
5392 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
5393 attribute.cs, statement: Use corect instance of predefined types (work
5394 related to #364674).
5396 2008-03-07 Marek Safar <marek.safar@gmail.com>
5398 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
5400 2008-03-07 Marek Safar <marek.safar@gmail.com>
5402 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
5403 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
5404 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
5405 predefined types clean up, delayed predefined types members initialization
5406 (work related to #364674).
5408 2008-03-05 Marek Safar <marek.safar@gmail.com>
5410 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
5412 2008-03-05 Marek Safar <marek.safar@gmail.com>
5414 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
5415 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
5416 predefined types clean up (work related to #364674).
5418 2008-03-04 Marek Safar <marek.safar@gmail.com>
5420 * ecore.cs: Print an error message instead of throwing exception.
5422 2008-03-04 Marek Safar <marek.safar@gmail.com>
5424 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
5425 expression.cs, statement.cs: Unififed null literal representation.
5427 2008-03-03 Marek Safar <marek.safar@gmail.com>
5429 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
5430 expression.cs: Refactored binary operators resolve phase and improved speed.
5431 The nullable code is still missing and won't work correctly, more fixes
5434 It also fixes #323726, #324312, #324248, and many other unreported issues.
5436 2008-02-29 Zoltan Varga <vargaz@gmail.com>
5438 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
5441 2008-02-27 Marek Safar <marek.safar@gmail.com>
5443 * ecore.cs: Clean-up and split BetterConversion.
5445 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
5448 * enum.cs (EnumMember.Value): Only access 'value' if
5449 ResolveValue says it's ok.
5450 (EnumMember.DoResolveValue): Don't set prev_member.value.
5451 (Enum.GetDefinition): Reverse arguments of Equals --
5452 EnumMember.Value can return 'null'.
5454 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
5456 2008-02-22 Marek Safar <marek.safar@gmail.com>
5458 * generic.cs, expression.cs: More ongoing work on expression trees.
5460 2008-02-21 Marek Safar <marek.safar@gmail.com>
5462 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
5463 handle missing matches when mutiple operators exist.
5465 2008-02-20 Marek Safar <marek.safar@gmail.com>
5467 A fix for bug #363218
5468 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
5471 2008-02-20 Marek Safar <marek.safar@gmail.com>
5473 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
5474 update. This time to deal correctly with SideEffectConstant expression used
5475 as an argument for another constant folding.
5477 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
5479 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
5482 2008-02-19 Marek Safar <marek.safar@gmail.com>
5484 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
5486 2008-02-19 Marek Safar <marek.safar@gmail.com>
5488 A fix for bug #328136
5489 * expression.cs: Do not fold immediately LogicalAnd operators when the left
5490 side is a false constant, because we still need to evaluate the right-hand
5493 * statement.cs (If): Emit two types of boolean constants (simple constant,
5494 side-effect constant).
5496 2008-02-19 Marek Safar <marek.safar@gmail.com>
5498 * constant.cs (SideEffectConstant): Don't emit boolean constant.
5500 * expression.cs: Fold immediately LogicalAnd operators when both sides are
5503 2008-02-18 Marek Safar <marek.safar@gmail.com>
5505 A fix for bug #361457
5506 * ecore.cs (IsApplicable): Params methods have lower priority.
5508 * support.cs: Return correct parameter modifier for params types.
5510 2008-02-18 Marek Safar <marek.safar@gmail.com>
5512 * generic.cs (TypeParameter): Cache attribute target name.
5514 * support.cs: Removed unused variable.
5516 * typemanager.cs: Removed debugging leftover.
5518 * ecore.cs: Use local type instead of a property;
5520 * class.cs (VerifyMembers): Consider also parent to test whether type member
5523 * expression.cs (FullMethodDesc): Removed.
5525 * attribute.cs (IsValidArgumentType): Made static.
5527 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
5529 Cleanup to be more readable.
5530 * Makefile (GMCS_PROFILE): Remove.
5531 (COMPILER_NAME): New helper.
5533 2008-02-15 Miguel de Icaza <miguel@novell.com>
5535 * cs-tokenizer.cs: if a conditional expression happens inside a
5536 (...) this also means that we do not need to de-ambiguate between
5537 an parenthesized expression and a cast.
5541 * constant.cs (SideEffectConstant): a constant value that happens
5542 to have a side effect.
5544 Fixes the build regressions introduced by the fix for #359789
5546 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
5548 * expression.cs (Conditional.Emit): when emitting the ternary
5549 operator, use local variables to generate code verifiable code.
5551 The verifier cannot infer that the type on stack before the
5552 stloc.0 is executed is of type ParentB. This happens because the
5553 stack merge algorithm uses only parent types when deciding which
5554 is the common type. This is described in Part III 1.8.1.3 of ECMA
5557 This code compiled with mcs is not verifiable under MS. The MS
5558 verifier picks the first common interface of Foo and Bar, which is
5559 wrong, but doesn't use a full join type of the 2 interfaces.
5561 CSC uses a clever hack to compile such code in a verifiable
5562 way. It stores the intermediate values in a local variable with
5567 2008-02-14 Miguel de Icaza <miguel@novell.com>
5569 * expression.cs: Do not fold BitwiseAnd operators when the left
5570 side is a false constant, because we still need to evaluate the
5575 * support.cs: Instead of throwing an InternalErrorException when
5576 the position of the stream is outside the boundary of our buffer,
5577 reset the state of the reader, and restart the reading from the
5578 beginning of the file.
5580 2008-02-14 Marek Safar <marek.safar@gmail.com>
5582 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
5584 2008-02-14 Marek Safar <marek.safar@gmail.com>
5586 A fix for bug #361686
5587 * decl.cs: A protected types used inside a private class which parents
5588 derives from the protected class are accessible.
5590 2008-02-13 Marek Safar <marek.safar@gmail.com>
5592 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
5593 the parameterless constructor.
5595 2008-02-13 Marek Safar <marek.safar@gmail.com>
5597 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
5598 lookup methods to use standard member cache when doing member lookup.
5600 2008-02-12 Marek Safar <marek.safar@gmail.com>
5602 * driver.cs: Don't report full path for referenced module as assembly error.
5604 2008-02-12 Marek Safar <marek.safar@gmail.com>
5606 * Makefile: Fixed `qh' target to work on all machines.
5608 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
5609 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
5610 and HasElementType with TypeManager implementation.
5612 2008-02-08 Marek Safar <marek.safar@gmail.com>
5614 A fix for bugs #325134, #359749
5615 * expression.cs, ecore.cs: Try to resolve an extension method even if the
5616 first binds point to non-method member expression.
5618 2008-02-08 Marek Safar <marek.safar@gmail.com>
5620 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
5622 2008-02-08 Marek Safar <marek.safar@gmail.com>
5624 A fix for bugs #321394, #323028
5625 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
5626 Reworked naive IsAccessibleAs implementation to handle nested types.
5628 2008-02-05 Jb Evain <jbevain@novell.com>
5630 * class.cs: use generic type comparison for parameters
5633 2008-02-05 Marek Safar <marek.safar@gmail.com>
5635 A fix for bug #325372
5636 * class.cs: Use generic type comparison when testing method signatures.
5638 2008-02-05 Marek Safar <marek.safar@gmail.com>
5640 A fix for bug #357047
5641 * ecore.cs: Applied C# 3.0 changes to better conversion.
5643 2008-02-05 Marek Safar <marek.safar@gmail.com>
5645 A fix for bug #358374
5646 * cs-parser.jay: Correctly set modifiers for all constructor types.
5648 2008-02-04 Marek Safar <marek.safar@gmail.com>
5650 A fix for bug #355251
5651 * generic.cs: Added base class constraint based type inference.
5653 2008-02-01 Marek Safar <marek.safar@gmail.com>
5655 A fix for bug #357255
5656 * decl.cs: One more missing visibility check.
5658 2008-02-01 Marek Safar <marek.safar@gmail.com>
5660 * support.cs: Fixed broken return.
5662 2008-01-25 Marek Safar <marek.safar@gmail.com>
5664 * report.cs: Correctly reset warnings count after probing.
5666 2008-01-25 Martin Baulig <martin@ximian.com>
5669 (NamespaceEntry.SymbolFileID): Make this work again after
5670 MemberName.ToString() is gone.
5672 2008-01-25 Marek Safar <marek.safar@gmail.com>
5674 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
5677 2008-01-25 Marek Safar <marek.safar@gmail.com>
5679 * generic.cs: Use full implicit conversion for type inference fixing.
5681 2008-01-24 Marek Safar <marek.safar@gmail.com>
5683 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
5684 Fixed user operator conversions.
5686 2008-01-24 Marek Safar <marek.safar@gmail.com>
5688 * generic.cs: Do nullable type to null comparison optimization during
5691 2008-01-24 Marek Safar <marek.safar@gmail.com>
5693 A fix for bug #355163
5694 * generic.cs: Enabled l-value resolve on nullable expressions.
5696 2008-01-24 Marek Safar <marek.safar@gmail.com>
5698 A fix for bug #353986
5699 * class.cs: Ingore static ctors with parameters for any further checks.
5701 2008-01-24 Marek Safar <marek.safar@gmail.com>
5703 A fix for bug #354310
5704 * namespace.cs: Removed redundant check.
5706 2008-01-24 Marek Safar <marek.safar@gmail.com>
5708 A fix for bug #354928
5709 * expression.cs: ElementInitializers can be resolved only once.
5711 2008-01-24 Marek Safar <marek.safar@gmail.com>
5713 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
5714 Condition expressions.
5716 2008-01-23 Marek Safar <marek.safar@gmail.com>
5718 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
5720 2008-01-22 Marek Safar <marek.safar@gmail.com>
5722 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
5725 * generic.cs: Implemented coalesce expression.
5727 2008-01-22 Marek Safar <marek.safar@gmail.com>
5729 A fix for bug #355145
5730 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
5731 expression tree type inference.
5733 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
5736 * expression.cs (Binary.IsUnsignedType): Fix typo.
5738 2008-01-22 Marek Safar <marek.safar@gmail.com>
5740 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
5742 2008-01-22 Marek Safar <marek.safar@gmail.com>
5744 A fix for bug #355161
5745 * ecore.cs, expression.cs: Wider range of extension method supported
5748 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
5750 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
5751 AssemblyBuilder to operate in compiler context. Fixes mcs part of
5754 2008-01-22 Marek Safar <marek.safar@gmail.com>
5756 A fix for bug #355148
5757 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
5759 2008-01-22 Miguel de Icaza <miguel@novell.com>
5761 * expression.cs (CreateExpressionTree): Add support for or and
5762 logical or, and indent following the coding conventions.
5764 * typemanager.cs (LinqExpression): renamed from
5765 ExpressionTreeManager, for a shorter name.
5767 Use TypeManager.CoreLookupType to lookup types from our core
5768 assemblies and turn those into "Type" variables.
5770 Consumers that previously used "Namespace" and "Type" from this
5771 class should instead use the TypeExpression which is a type that
5772 is fully resolved (without involving the regular C# resolution
5775 This typically looks like this:
5777 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
5778 new MemberAccess (texpr, name, type_arguments, loc)
5780 This avoids the problem in: #355178
5782 2008-01-21 Marek Safar <marek.safar@gmail.com>
5784 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
5785 feature in parser only as we do in other cases.
5787 2008-01-21 Marek Safar <marek.safar@gmail.com>
5789 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
5790 typemanager.cs: A refactoring of params arguments to reuse existing
5791 expressions (params -> array initializer) to emit params argument instead
5792 of specialized handling.
5793 It was required by expression tree implementation and it has other benefits
5794 as well, we now apply same optimization for params arguments as we do for
5797 2008-01-18 Marek Safar <marek.safar@gmail.com>
5799 A fix for bug #353526
5800 * generic.cs: A type inference of params arguments may not required any
5801 temporary array creation.
5803 2008-01-18 Marek Safar <marek.safar@gmail.com>
5805 A fix for bug #353534
5806 * generic.cs, ecore.cs, expression.cs: A method group type inference is
5807 supported for delegates only.
5809 2008-01-18 Marek Safar <marek.safar@gmail.com>
5811 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
5812 type for more than 1 candidates.
5814 2008-01-18 Marek Safar <marek.safar@gmail.com>
5816 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
5819 2008-01-16 Marek Safar <marek.safar@gmail.com>
5821 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
5822 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
5823 operator) expressions.
5825 2008-01-16 Zoltan Varga <vargaz@gmail.com>
5827 * statement.cs: Avoid declaring an IL variable for this_variable since it is
5828 not accessed from the generated IL.
5830 2008-01-14 Marek Safar <marek.safar@gmail.com>
5832 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
5833 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
5834 statement.cs: The first expression tree implementation drop, mostly
5835 infrastructure work.
5837 2008-01-14 Marek Safar <marek.safar@gmail.com>
5839 * ecore.cs (IsNestedChild): Refactored.
5841 2008-01-11 Marek Safar <marek.safar@gmail.com>
5843 * lambda.cs: Don't use a cast on unknown expression statement.
5845 2008-01-10 Geoff Norton <gnorton@novell.com>
5847 * cs-tokenizer.cs: One more token to distinguish between method and lambda
5850 2008-01-09 Marek Safar <marek.safar@gmail.com>
5852 * doc.cs: Report better /doc crash details.
5854 2008-01-09 Marek Safar <marek.safar@gmail.com>
5856 A fix for bug #352536
5857 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
5859 2008-01-08 Marek Safar <marek.safar@gmail.com>
5861 A fix for bug #352287
5862 * ecore.cs, expression.cs: Do `this' access checking in all member access
5865 2008-01-08 Marek Safar <marek.safar@gmail.com>
5867 * rootcontext.cs, driver.cs: Switch to linq mode by default.
5869 * report.cs: Reset message stacks.
5871 2008-01-08 Marek Safar <marek.safar@gmail.com>
5873 * generic.cs (InferInPhases): Correctly calculate params position.
5875 2008-01-08 Marek Safar <marek.safar@gmail.com>
5877 * cs-tokenizer.cs: No need to parse full string when parsing lambda
5880 2008-01-07 Marek Safar <marek.safar@gmail.com>
5882 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
5884 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
5886 * driver.cs: Updated --help option.
5888 2008-01-07 Marek Safar <marek.safar@gmail.com>
5890 * generic.cs (InferParamsTypeArguments): Removed.
5891 (InferInPhases): Add params type inference.
5892 (LowerBoundInference): Fixed scoring mechanism.
5894 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
5896 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
5898 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
5899 byte array for unsigned "baked" assemblies.
5901 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
5903 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
5904 array for assemblies that are not strongnamed.
5906 2008-01-04 Marek Safar <marek.safar@gmail.com>
5908 A fix for bug #351481
5909 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
5910 declaring type for nested generic types.
5912 2008-01-04 Marek Safar <marek.safar@gmail.com>
5914 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
5915 instead of ToString.
5917 2008-01-03 Marek Safar <marek.safar@gmail.com>
5919 A fix for bug #351047
5920 * expression.cs (Binary.ResolveOperator): Allow equality operators between
5921 null and structs only when equality and inequality operators are defined
5922 either as an user-operators or predefined operators.
5924 2008-01-03 Marek Safar <marek.safar@gmail.com>
5926 A fix for bug #351047
5927 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
5929 2008-01-03 Marek Safar <marek.safar@gmail.com>
5931 A fix for bug #351257
5932 * cs-tokenizer.cs: Advance line number for '\r' correctly.
5934 2008-01-03 Marek Safar <marek.safar@gmail.com>
5936 A fix for bug #351157
5937 * class.cs (Using): Fixed yet another broken cloning.
5939 (Block): Put back more sensible default value for statements.
5941 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
5943 * codegen.cs: Allow AssemblyVersion with only major version component.
5946 2007-12-29 Marek Safar <marek.safar@gmail.com>
5948 A fix for bug #324654
5949 * class.cs: Use FullName property as member name.
5951 2007-12-28 Marek Safar <marek.safar@gmail.com>
5953 A fix for bug #342117
5954 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
5955 constructor constraint.
5957 2007-12-28 Marek Safar <marek.safar@gmail.com>
5959 A fix for bug #338273
5960 * class.cs (ProbertyBase): Access modifier checks are required for overrides
5963 2007-12-28 Marek Safar <marek.safar@gmail.com>
5965 A fix for bug #350839
5966 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
5968 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
5970 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
5973 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
5975 * statement.cs: Changed some Hashtables to use HybridDictionaries
5976 instead. It was observed that some HashTables only contained a few
5977 items in the vast majority of cases. Since HybridDictionary is
5978 more efficient on small sets (<10 elements), "known_variables"
5979 from class ExplicitBlock as well as "labels" and "constants " from
5980 class Block were changed to HybridDictionaries.
5982 Atsai results: (56216kb->54987kb)
5984 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
5987 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
5989 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
5992 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
5994 * expression.cs: foreach loop to for loop, saved on allocation of
5995 enumerator (59333kb->59141kb)
5997 * statement.cs. Changed foreach loops to for loops, saved on
5998 allocation of enumerator (59141kb->59006kb)
6000 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
6001 when constructed with no specified capacity. This was causing a
6002 few ArrayLists to allocate more memory than they would potentially
6003 need in the Block class and MemberCache class. Setting the
6004 ArrayLists to construct with a capacity of 1 saves some
6005 memory. (56216kb->55585kb)
6007 2007-12-27 Marek Safar <marek.safar@gmail.com>
6009 A fix for bug #347189 (2nd issue)
6010 * expression.cs (MemberAccess): Nested type can be found in base non-generic
6013 2007-12-27 Miguel de Icaza <miguel@novell.com>
6015 * report.cs: Do not use colors if stdout and stderr are not a
6018 2007-12-27 Marek Safar <marek.safar@gmail.com>
6020 A fix for bug #346998
6021 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
6024 2007-12-27 Marek Safar <marek.safar@gmail.com>
6026 A fix for bug #343465
6027 * class.cs: Explicit method name for nested types uses dots only.
6029 2007-12-27 Marek Safar <marek.safar@gmail.com>
6031 A fix for bug #343707
6032 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
6034 2007-12-27 Marek Safar <marek.safar@gmail.com>
6036 * ecore.cs: Report type inference errors only when arguments count matches
6039 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
6041 * expression.cs, report.cs: New warning.
6043 * typemanager.cs: Catch anonymous method type too.
6045 2007-12-23 Marek Safar <marek.safar@gmail.com>
6047 A fix for bug #346379
6048 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
6050 2007-12-23 Marek Safar <marek.safar@gmail.com>
6052 A fix for bug #347359
6053 * expression.cs (Invocation): Don't resolve already resolved expression.
6055 2007-12-23 Marek Safar <marek.safar@gmail.com>
6057 A fix for bug #347189
6058 * class.cs (FixedField): Use non-dependent code only in the define phase.
6060 2007-12-23 Marek Safar <marek.safar@gmail.com>
6062 A fix for bug #348076
6063 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
6065 2007-12-22 Marek Safar <marek.safar@gmail.com>
6067 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
6068 discovered extension methods.
6070 2007-12-22 Marek Safar <marek.safar@gmail.com>
6072 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
6075 2007-12-21 Miguel de Icaza <miguel@novell.com>
6077 * report.cs (ErrorMessage): Add support for using colors on
6078 terminals that support it.
6080 2007-12-21 Marek Safar <marek.safar@gmail.com>
6082 * ecore.cs: Use information about expanded params for error reporting.
6084 2007-12-21 Marek Safar <marek.safar@gmail.com>
6086 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
6087 and logic for params overloads.
6089 2007-12-15 Miguel de Icaza <miguel@novell.com>
6091 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
6092 as this is also created from the parser. Fixes #349034
6094 2007-12-12 Miguel de Icaza <miguel@novell.com>
6096 * statement.cs (Throw.CloneTo): it is valid to have empty
6097 expressions for throw.
6099 2007-12-03 Marek Safar <marek.safar@gmail.com>
6101 * cs-parser.jay: Set delegate constraint parsing region correctly.
6103 2007-12-03 Marek Safar <marek.safar@gmail.com>
6105 A fix for bug #345467
6106 * typemanager.cs (IsEqual): Compare generic parameters position only.
6108 2007-11-28 Marek Safar <marek.safar@gmail.com>
6110 * expression.cs (BaseAccess): Type arguments can be null.
6112 2007-11-27 Raja R Harinath <harinath@gmail.com>
6114 * statement.cs (Block.Resolve): Ensure flow-branching tree is
6115 consistent even when an error has occured.
6116 (Switch.Resolve): Likewise.
6118 2007-11-22 Marek Safar <marek.safar@gmail.com>
6120 A fix for bug #334505
6121 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
6124 2007-11-22 Marek Safar <marek.safar@gmail.com>
6126 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
6127 refactorings required to resolve extension methods correctly when mixing
6128 generics and non-generics members.
6130 2007-11-20 Marek Safar <marek.safar@gmail.com>
6132 A fix for bug #342584
6133 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
6136 2007-11-19 Marek Safar <marek.safar@gmail.com>
6138 A fix for bug #342512
6139 * delegate.cs: Use delegate argument expression when is available. Don't
6140 emit virtual call when class is sealed.
6142 2007-11-16 Marek Safar <marek.safar@gmail.com>
6144 A fix for bug #325423
6145 * assign.cs (FieldInitializer): Use resolved expression for emit.
6147 * class.cs: Print less confusing error message.
6149 2007-11-16 Marek Safar <marek.safar@gmail.com>
6151 * cs-tokenizer.cs: Removed GMCS ifdefs.
6153 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
6156 * cs-parser.jay: Disabled nullable check.
6158 * generic-mcs: Copied more generic stuff.
6160 2007-11-16 Marek Safar <marek.safar@gmail.com>
6162 * gcs-parser.jay: Merged to cs-parser.jay.
6164 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
6165 * *.csproj, *.sources: Updated to use only jay parser file.
6167 2007-11-16 Marek Safar <marek.safar@gmail.com>
6169 * gcs-parser.jay: Added nullable and default expression feature checks.
6171 2007-11-16 Marek Safar <marek.safar@gmail.com>
6173 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
6174 it fixes many TODOs and hidden bugs.
6176 * expression: Removed duplicate error check.
6178 2007-11-15 Marek Safar <marek.safar@gmail.com>
6180 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
6181 implicitly type local variable only when it is used in a declaration.
6183 2007-11-15 Marek Safar <marek.safar@gmail.com>
6185 * attribute.cs: Use CS0612 for empty strings.
6187 2007-11-14 Marek Safar <marek.safar@gmail.com>
6189 * lambda.cs, statement.cs: Contextual return may act as a statement.
6191 2007-11-14 Marek Safar <marek.safar@gmail.com>
6193 A fix for a regression cause by #324222
6194 * class.cs: Don't report unused even when it implements an interface.
6196 2007-11-13 Marek Safar <marek.safar@gmail.com>
6198 A fix for bug #341205
6199 * ecore.cs, expression.cs: Method group expression cannot do static
6200 method access with an instance reference check before overloading takes
6203 2007-11-13 Marek Safar <marek.safar@gmail.com>
6205 A fix for bug #325359
6206 * class.cs: Use predictable name for automatically generated property.
6208 2007-11-12 Marek Safar <marek.safar@gmail.com>
6210 A fix for bug #324996
6211 * expression.cs (Is): Handle case where D is nullable and T is not
6214 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
6216 2007-11-12 Marek Safar <marek.safar@gmail.com>
6218 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
6219 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
6220 Flush small error reporting changes.
6222 2007-11-09 Marek Safar <marek.safar@gmail.com>
6224 A fix for bug #324996
6225 * expression.cs: Rewrote Is expression implementation to work with
6226 generics, nullable types, anonymous method. A const result expression
6227 uses existing infrastructure instead of custom not fully-featured one.
6229 2007-11-08 Marek Safar <marek.safar@gmail.com>
6231 A fix for bug #340202
6232 * class.cs: Consider generics for volatile field.
6234 2007-11-08 Marek Safar <marek.safar@gmail.com>
6236 A fix for bug #335594
6237 * expression.cs: Use conversion rules when handling string addition.
6239 2007-11-07 Marek Safar <marek.safar@gmail.com>
6241 A fix for bug #336651
6242 * expression.cs: Fixed a crash when probing is on.
6244 2007-11-07 Marek Safar <marek.safar@gmail.com>
6246 A fix for bug #324242
6247 * covert.cs: Added a conversion from any nullable-type with an
6248 underlying enum-type to the type System.Enum.
6250 2007-11-07 Marek Safar <marek.safar@gmail.com>
6252 A fix for bug #324222
6253 * class.cs: Report all non-used event fields.
6255 2007-11-07 Marek Safar <marek.safar@gmail.com>
6257 A fix for bug #325161
6258 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
6259 qualifier for generic types.
6261 2007-11-07 Marek Safar <marek.safar@gmail.com>
6263 A fix for bug #322971
6264 * expression.cs, ecore.cs: Added intermediate result value check for
6267 2007-11-07 Marek Safar <marek.safar@gmail.com>
6269 A fix for bug #324754
6270 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
6271 when it was requested.
6273 2007-11-07 Marek Safar <marek.safar@gmail.com>
6275 A fix for bug #325101
6276 * expression.cs: Do type not value comparison for `is' expression.
6278 2007-11-07 Marek Safar <marek.safar@gmail.com>
6280 A fix for bug #320236
6281 * convert.cs: Don't apply user conversion on underlying target type.
6283 2007-11-06 Marek Safar <marek.safar@gmail.com>
6285 * expression.cs: Don't use unresolved expression for error reporting.
6287 2007-11-06 Marek Safar <marek.safar@gmail.com>
6289 A fix for bugs #337712, #324490
6290 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
6291 overloading resolution too.
6293 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
6294 the process consistent and more robust.
6296 * expression.cs, linq.cs, report.cs: Update.
6298 2007-11-02 Marek Safar <marek.safar@gmail.com>
6300 A fix for bug #332909
6301 * attribute.cs: Resolve attributes in correct context using error
6304 * rootcontext.cs: Define Obsolete attribute members as core members.
6306 2007-11-02 Marek Safar <marek.safar@gmail.com>
6308 * statement.cs: Removed unused methods.
6310 2007-10-31 Wade Berrier <wberrier@novell.com>
6312 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
6313 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
6316 2007-10-31 Marek Safar <marek.safar@gmail.com>
6318 A fix for bug #338102
6319 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
6320 methods registered as non-generics.
6322 2007-10-31 Marek Safar <marek.safar@gmail.com>
6324 A fix for bugs #337712, #324490
6325 * delegate.cs: Delegate covariance and contravariance is not allowed for
6328 2007-10-31 Marek Safar <marek.safar@gmail.com>
6330 A fix for bug #337719
6331 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
6334 2007-10-30 Marek Safar <marek.safar@gmail.com>
6336 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
6338 2007-10-29 Marek Safar <marek.safar@gmail.com>
6340 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
6343 2007-10-29 Raja R Harinath <rharinath@novell.com>
6345 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
6347 2007-10-29 Marek Safar <marek.safar@gmail.com>
6349 A fix for bug #334652
6350 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
6351 extension methods when we have not found the best candidate in normal
6354 2007-10-27 Marek Safar <marek.safar@gmail.com>
6356 * AssemblyInfo.cs: Keep up-to-date.
6358 2007-10-27 Marek Safar <marek.safar@gmail.com>
6360 * Makefile: Fixed generics compiler name.
6362 2007-10-27 Marek Safar <marek.safar@gmail.com>
6364 * lambda.test: removed, lambda parsing is done differently.
6366 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
6368 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
6370 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
6372 2007-10-27 Marek Safar <marek.safar@gmail.com>
6374 * Makefile, *.sources : All C# compilers are in mcs folder.
6376 * *.cs: Use existing 2_1 define for smcs.
6378 2007-10-26 Marek Safar <marek.safar@gmail.com>
6380 A fix for bug #335847
6381 * assign.cs, expression.cs: Couple of changes to avoid creating a
6382 temporary variable for each object initializer assignment statement. It
6383 simplifies struct initialization too, otherwise two temporary variables
6385 Implemented optimization of redundant default element initializers.
6387 2007-10-25 Marek Safar <marek.safar@gmail.com>
6389 A fix for bug #336766
6390 * expression.cs (Class.CheckBase): Use generic name when method is
6393 2007-10-25 Marek Safar <marek.safar@gmail.com>
6395 A fix for bug #334737
6396 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
6397 variable and not variable argument for prepared copies.
6399 2007-10-24 Marek Safar <marek.safar@gmail.com>
6401 A fix for bug #325110
6402 * class.cs, expression.cs, attribute.cs: Use open generic method when
6403 checking conditional attribute.
6405 2007-10-24 Marek Safar <marek.safar@gmail.com>
6407 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
6408 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
6409 FeatureIsNotAvailable.
6411 2007-10-24 Marek Safar <marek.safar@gmail.com>
6413 ** C# 3.0 Partial methods
6415 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
6416 methods support. Because of member cache issue with generics only
6417 non-generics partial methods are fully supported.
6419 2007-10-23 Marek Safar <marek.safar@gmail.com>
6421 * class.cs, decl.cs: Rewrote member overloads check to cope with
6422 generics and to use member cache for member checking. It also improves
6423 performance and fixes remaining overloads issues.
6425 2007-10-20 Marek Safar <marek.safar@gmail.com>
6427 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
6428 roottypes.cs, typemanager.cs:
6430 A member cache creation logic changed to add members immediately and
6431 not rely on fallback. The member cache is now only prefered way
6432 how to access and find type declaration members. It saves 5 MB of memory
6433 during MWF compilation and makes code ready for more optimizations and
6434 clean-ups, it's also a pre-requirement for partial methods.
6436 2007-10-18 Raja R Harinath <harinath@gmail.com>
6438 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
6439 handling for generic parameters.
6441 2007-10-15 Marek Safar <marek.safar@gmail.com>
6443 * class.cs (FixedField): Removed redundant volatile check.
6445 2007-10-15 Marek Safar <marek.safar@gmail.com>
6447 * class.cs, decl.cs: Fixed overload members verification to do only one
6448 check per possible collision.
6450 2007-10-13 Marek Safar <marek.safar@gmail.com>
6452 A fix for bug #325478
6453 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
6454 and create only one disposable flags container.
6456 2007-10-12 Marek Safar <marek.safar@gmail.com>
6458 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
6459 * statement.cs (Fixed): Fixed variables cloning.
6461 2007-10-12 Marek Safar <marek.safar@gmail.com>
6463 A fix for bug #333342
6464 * class.cs (EventField): Don't mark value type event as synchronized.
6466 2007-10-12 Marek Safar <marek.safar@gmail.com>
6468 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
6469 inference to identify best candidate method correctly.
6470 (ProperyExpr): A range variable is read only and cannot be modified.
6472 2007-10-11 Marek Safar <marek.safar@gmail.com>
6474 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
6475 logic to identify best candidate method correctly.
6477 2007-10-11 Marek Safar <marek.safar@gmail.com>
6479 * location.cs (Equals, GetHashCode): Removed.
6481 2007-10-11 Marek Safar <marek.safar@gmail.com>
6483 * report.cs: Implemented message recorder. It is used mainly for lambda
6484 expressions to capture otherwise swallowed error messages.
6486 * anonymous.cs, lambda.cs.cs: Do full parameters check.
6488 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
6490 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
6492 * expression.cs (MemberAccess): Always report lookup failure.
6494 * location.cs: Implemented Equals, GetHashCode.
6496 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
6498 2007-10-10 Jb Evain <jbevain@novell.com>
6500 * codegen.cs: re-enable assembly version check.
6502 2007-10-09 Marek Safar <marek.safar@gmail.com>
6504 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
6507 * namespace.cs (UsingAlias): Do correct version check.
6509 2007-10-08 Marek Safar <marek.safar@gmail.com>
6511 * expresison.cs, ecore.cs: Issue extension method error message when
6514 * rootcontext.cs: Added ISO_2 compiler mode option.
6516 2007-10-08 Marek Safar <marek.safar@gmail.com>
6518 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
6521 2007-10-08 Marek Safar <marek.safar@gmail.com>
6523 * attribute.cs (GetString, GetBoolean): Work with both literal and
6526 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
6527 Moved method overload specific methods to MethodGroupExpr.
6529 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
6530 it should be less memory consuming.
6532 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
6534 * codegen.cs: remove the assembly version check until the buildbot is
6537 2007-10-07 Jb Evain <jbevain@novell.com>
6539 * attribute.cs (Attribute.GetString): if the value
6540 expression is a StringConstant, return its string value.
6542 2007-10-07 Jb Evain <jbevain@novell.com>
6544 * typemanager.cs: add `assembly_version_attribute_type`.
6545 * codegen.cs: on attribute emission, check that the
6546 AssemblyVersionAttribute doesn't overflow.
6548 2007-10-05 Marek Safar <marek.safar@gmail.com>
6550 A fix for bug #324677
6551 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
6552 parent container of a scope container with currently resolved one.
6554 2007-10-05 Marek Safar <marek.safar@gmail.com>
6556 A fix for bug #325534
6557 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
6560 2007-10-05 Marek Safar <marek.safar@gmail.com>
6562 A fix for bug #327504
6563 * class.cs (Operator.Define): Refactored implicit and explicit user
6564 operator conversion rules.
6566 2007-10-05 Marek Safar <marek.safar@gmail.com>
6568 A fix for bug #327520
6569 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
6571 2007-10-04 Marek Safar <marek.safar@gmail.com>
6573 A fix for bug #328022
6574 * class.cs (MethodData.Define): Use correct method to check whether
6575 a method implementents an accessor.
6577 2007-10-04 Marek Safar <marek.safar@gmail.com>
6579 A fix for bug #330069
6580 * statement.cs (Fixed.Resolve): Read the first array element only when
6581 an array is instantiated.
6583 2007-10-04 Marek Safar <marek.safar@gmail.com>
6585 * expression.cs, assign.cs, generics.cs: Print correct operator when
6586 compound assignment is used.
6588 2007-10-04 Marek Safar <marek.safar@gmail.com>
6590 A fix for bug #325841
6591 * expression.cs (ArrayAccess): Use full argument cloning only for
6592 string compound concatenation.
6594 2007-10-03 Marek Safar <marek.safar@gmail.com>
6596 A fix for bug #328774
6597 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
6599 (PropertyExpr.EmitAssign): Fixed string concatenation compound
6602 2007-10-03 Raja R Harinath <rharinath@novell.com>
6605 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
6606 Event accessibility checks here. Remove some bogus code that
6607 accidently made GenericMethods work.
6608 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
6610 2007-09-25 Marek Safar <marek.safar@gmail.com>
6612 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
6614 * statement.cs (Block): Refactored AddVariable to allow error handling
6617 * generic.cs: New stub.
6619 2007-09-23 Marek Safar <marek.safar@gmail.com>
6621 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
6624 2007-09-17 Marek Safar <marek.safar@gmail.com>
6626 * class.cs: Use partial container to record whether any partial part
6627 contains static field initializer and therefore default contructor has
6630 2007-09-14 Marek Safar <marek.safar@gmail.com>
6632 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
6633 mono-list when only one of two partial parts has defined accessibility
6636 2007-09-14 Marek Safar <marek.safar@gmail.com>
6638 A fix for bug #82845
6640 * class.cs (TypeContainer): Set correct resolve context for all field
6643 2007-09-13 Marek Safar <marek.safar@gmail.com>
6645 * assign.cs: Fixed a crash when field is resolved twice with an error.
6647 * codegen.cs: Changed InFieldInitializer to be flag.
6649 * anonymous.cs, ecore.cs, expression.cs: Update after
6650 IsInFieldInitializer rename.
6652 * const.cs: Removed unused parameter.
6654 * class.cs: Changed the way how we resolve and emit field initializers.
6655 The field initilizers have to have access to contructor block to emit
6656 compiler generated code.
6658 2007-09-13 Marek Safar <marek.safar@gmail.com>
6660 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
6661 generics use TypeContainer instead.
6663 2007-09-12 Marek Safar <marek.safar@gmail.com>
6665 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
6667 * lambda.cs (ResolveParameters): Use more powerful
6668 InflateGenericArgument.
6670 * parameters.cs: Better exception message.
6672 2007-09-10 Marek Safar <marek.safar@gmail.com>
6674 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
6675 correct expression block type.
6677 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
6679 * expression.cs (Invocation): Extracted method group resolve to
6682 2007-09-07 Marek Safar <marek.safar@gmail.com>
6684 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
6685 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
6687 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
6688 generic extension methods.
6690 2007-09-06 Marek Safar <marek.safar@gmail.com>
6692 A fix for bug #82676 (Do I get it right now?)
6693 * convert.cs (Binary.ResolveOperator): An interface is converted to the
6694 object before a standard conversion is applied.
6696 2007-09-06 Marek Safar <marek.safar@gmail.com>
6698 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
6701 2007-09-05 Marek Safar <marek.safar@gmail.com>
6703 A fix for bug #82676
6704 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
6705 non-generic interface types.
6707 2007-09-05 Marek Safar <marek.safar@gmail.com>
6709 A fix for bug #82690
6710 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
6712 2007-09-05 Marek Safar <marek.safar@gmail.com>
6714 A fix for bug #82571
6715 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
6716 modifier for container based methods.
6718 2007-09-05 Marek Safar <marek.safar@gmail.com>
6720 A fix for bug #82676
6721 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
6722 any interface-type T means to any of interface type T.
6724 2007-09-04 Marek Safar <marek.safar@gmail.com>
6726 * namespace.cs: We have 2 versions of System.Core assembly.
6728 2007-09-04 Marek Safar <marek.safar@gmail.com>
6730 A fix for bug #82652
6731 * class.cs (Class.GetClassBases): Compare types and not expressions.
6733 2007-09-04 Marek Safar <marek.safar@gmail.com>
6735 A fix for bug #82620
6736 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
6737 actually never worked before.
6738 (IndexerAccess): Emit prepared arguments before they are modified.
6740 2007-09-04 Marek Safar <marek.safar@gmail.com>
6742 A fix for bug #82563
6743 * assign.cs: Revert wrong fix.
6745 * expression.cs (VariableReference.EmitAssign): Handle ref reference
6747 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
6748 Instead of ldelema/stdind we have to use temporary variables to handle
6749 cases like String.Concat (params string[]).
6751 2007-08-31 Marek Safar <marek.safar@gmail.com>
6753 * class.cs: EmitAttributes to Emit rename.
6755 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
6757 (MemberCore.HasClsCompliantAttribute): Don't depend on
6758 GetClsCompliantAttributeValue execution.
6760 2007-08-31 Marek Safar <marek.safar@gmail.com>
6762 * anonymous.cs: Use shorter type prefix.
6764 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
6767 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
6768 variables when probing is on.
6770 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
6771 unresolved variables.
6772 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
6773 handle transparent identifiers.
6775 2007-08-26 Marek Safar <marek.safar@gmail.com>
6777 * attribute.cs (IsClsCompliant): Add nullable types test.
6779 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
6781 * doc.cs : catch other types of exception than XmlException to
6782 report CS1570. Fixed bug #82565.
6784 2007-08-23 Marek Safar <marek.safar@gmail.com>
6786 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
6787 The number of delegate parameters has to match.
6788 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
6791 2007-08-21 Marek Safar <marek.safar@gmail.com>
6793 * anonymous.cs (AnonymousMethod): Generate private anonymous method
6794 to fix problem with private arguments.
6796 2007-08-20 Marek Safar <marek.safar@gmail.com>
6798 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
6800 * decl.cs (MemberName): Ignore generic type with no generic arguments.
6802 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
6803 empty. Add cloning suport.
6805 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
6807 2007-08-20 Marek Safar <marek.safar@gmail.com>
6809 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
6810 to create EmptyCast. It handles EmptyConstantCast specialization for
6813 2007-08-18 Marek Safar <marek.safar@gmail.com>
6815 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
6816 (EmitArrayArgument): One routine for array arguments.
6817 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
6819 2007-08-17 Marek Safar <marek.safar@gmail.com>
6821 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
6823 2007-08-17 Marek Safar <marek.safar@gmail.com>
6825 * anonymous.cs: MemberLookupFinal update.
6827 * class.cs (ConstructorInitializer): Is expression based.
6829 * delegate.cs: MethodGroupExpr update.
6831 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
6833 (Error_MemberLookupFailed): Customizable error override.
6834 (MethodGroupExpr): Keep queried type for later usage.
6835 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
6838 * expression.cs: Error_MemberLookupFailed refactoring.
6839 (New.DoResolve): Resolve as much as possible.
6840 (ElementInitializer.Error_MemberLookupFailed): Object initializer
6841 customization for invalid member types.
6843 * statement.cs: MethodGroupExpr update.
6845 2007-08-16 Marek Safar <marek.safar@gmail.com>
6847 * modifier.cs (Check): Check all modifiers and not only accessibility
6850 2007-08-16 Marek Safar <marek.safar@gmail.com>
6852 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
6853 type and not an expression.
6855 2007-08-16 Marek Safar <marek.safar@gmail.com>
6857 * statement.cs (Catch.Clone): Type and variable can be null.
6859 2007-08-16 Marek Safar <marek.safar@gmail.com>
6861 A fix for bug #81979
6862 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
6863 I am really not sure whether this is the best fix.
6865 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
6868 2007-08-14 Marek Safar <marek.safar@gmail.com>
6870 ** C# 3.0 Object and collection initializers (major re-write)
6872 * assign.cs (DoResolve): Initializers are not assign related.
6874 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
6875 used during collection or object initialization.
6877 * expression.cs (Error_InvalidArguments): Add initializers specific
6878 messages. More will come later because it requires some general
6880 (New.DoResolve): Better error handling for unsafe types.
6881 (EmptyExpressionStatement): New class.
6882 (ElementInitializer): An object initializer expression.
6883 (CollectionElementInitializer): A collection initializer expression.
6884 (CollectionOrObjectInitializers): A block of object or collection
6886 (NewInitialize): New expression with element/object initializers.
6888 * statement.cs: Reverted object/collection initializer hacks.
6890 * typemanager.cs (CSharpName): Filter __arglist type.
6892 2007-08-09 Marek Safar <marek.safar@gmail.com>
6894 ** C# 3.0 Anonymous Types (update to the latest standard)
6896 * expression.cs (Binary.ResolveOperator): Threat all null based types
6898 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
6899 (AnonymousTypeParameter): Updated.
6901 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
6902 (AnonymousTypeClass): New anonymous type container.
6904 * class.cs (AddField): Return operation result.
6906 * generic.cs: Another empty TypeArguments overload.
6908 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
6909 are stored at top of normal hierarchy.
6911 * typemanager.cs (CSharpName): Filter anonymous types.
6913 2007-08-09 Marek Safar <marek.safar@gmail.com>
6915 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
6916 as single Concat call. How could we miss that :-(
6918 2007-08-08 Marek Safar <marek.safar@gmail.com>
6920 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
6922 2007-08-07 Miguel de Icaza <miguel@novell.com>
6924 * expression.cs: Fix the previous commit, the creation of the
6925 arguments array list needs also to be conditional on the arguments
6928 * class.cs: Add a little bit of help to help narrow down problems.
6930 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
6931 not try to copy in that case.
6933 * driver.cs: When building SMCS, include a new different set of
6934 default assemblies here. Do this here so we can control whether
6935 to include the default assemblies with /noconfig.
6937 2007-08-03 Marek Safar <marek.safar@gmail.com>
6939 A fix for bug #81979
6940 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
6943 2007-08-03 Marek Safar <marek.safar@gmail.com>
6945 A fix for bug #82300
6947 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
6948 we are in probing scope.
6950 2007-08-03 Marek Safar <marek.safar@gmail.com>
6952 A fix for bug #82301
6954 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
6955 (Statement.CloneTo): Clone and not map children blocks.
6957 2007-08-03 Marek Safar <marek.safar@gmail.com>
6959 A fix for bug #82299
6961 * expression.cs (LocalVariableReference.CloneTo): Remap local info
6964 * statement.cs (Statement.CloneTo): Clone variables before statements
6965 to allow remaping of local variables.
6967 2007-08-03 Marek Safar <marek.safar@gmail.com>
6969 A fix for bug #82296
6972 * report.cs: Log crash details for future clone problems.
6974 * statement.cs (Return.Clone): Don't clone non-existent expression.
6976 2007-08-03 Raja R Harinath <harinath@gmail.com>
6978 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
6979 (Class.AddBasesForPart): Move CS0537 check here from ...
6980 * cs-parser.jay (class_declaration): ... here. Move calling of
6981 'AddBasesForPart' to ...
6982 (class_bases): ... here.
6983 (struct_declaration, interface_declaration): Update to changes.
6985 2007-08-02 Marek Safar <marek.safar@gmail.com>
6987 A fix for bug #81923
6989 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
6990 conversion is allowed.
6992 2007-08-02 Marek Safar <marek.safar@gmail.com>
6994 A fix for bug #81564
6996 * ecore.cs (EventExpr): Add IsBase handling.
6998 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
7001 2007-08-02 Raja R Harinath <harinath@gmail.com>
7003 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
7004 * cs-parser.jay: Some whitespace cleanups.
7005 (current_delegate): New.
7007 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
7008 a dummy code block, and use 'type_name' instead of 'member_name'.
7009 (interface_declaration, class_declaration): Likewise.
7010 (delegate_declaration): Likewise. Rearrange slightly and use
7012 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
7013 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
7015 2007-08-02 Marek Safar <marek.safar@gmail.com>
7017 A fix for bug #82039
7019 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
7022 * typemanager.cs (CSharpName): Split to string overload.
7024 2007-08-02 Marek Safar <marek.safar@gmail.com>
7027 * report.cs: Updated warning CS0472.
7029 2007-08-01 Marek Safar <marek.safar@gmail.com>
7031 A fix for bug #82181
7033 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
7035 2007-08-01 Marek Safar <marek.safar@gmail.com>
7037 A fix for bug #82277
7038 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
7040 2007-08-01 Marek Safar <marek.safar@gmail.com>
7042 ** C# 3.0 Type Inference (major bits are working)
7044 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
7045 (.ImplicitStandardConversionExists): Uses compatible.
7046 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
7047 (.InferReturnType): New method.
7048 (.Compatible): Refactored.
7049 (.ResolveParameters): Uses factory to create resolved parameters.
7050 (.CompatibleMethod): Add probing mode support.
7051 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
7052 clearly distinguish between 2 different operations.
7053 (LambdaMethod): Moved to lambda.cs.
7054 (AnonymousMethod): Removed unused fields and methods.
7055 (AnonymousDelegate): Simplified.
7057 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
7059 * convert. cs (ImplicitConversionStandard): Compatible works differently.
7061 * delegate.cs (Delegate): New mehods to reduce code duplication.
7062 (.GetConstructor): New method.
7063 (.GetInvokeMethod): New method.
7064 (DelegateCreation): Updated.
7066 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
7068 (OverloadResolve): Made probing little bit faster.
7070 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
7073 * generic.cs (TypeInferenceContext): Dummy implementation.
7075 * iterators.cs: Updated after Resolve/Define rename.
7077 * lambda.cs (LambdaExpression)
7078 (.ResolveParameters): Handles both type of arguments and type inference too.
7080 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
7081 (InflateTypes): Updated.
7083 * support.cs (InflateTypes): Changed signature and updated.
7085 * typemanager.cs (LookupMemberCache): Better dynamic type check.
7086 (MemberLookup_FindMembers): More MS tricks.
7087 (GetParameterData): Ditto.
7088 (GetDelegateParameters): Uses quick path for dynamic types.
7090 2007-08-01 Marek Safar <marek.safar@gmail.com>
7092 * class.cs (MethodData.Define): EmitContext is required for generic stuff
7095 2007-07-31 Marek Safar <marek.safar@gmail.com>
7097 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
7100 2007-07-26 Jb Evain <jbevain@novell.com>
7102 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
7103 which takes a boolean 'report_errors', similar to the GetMethod.
7104 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
7105 in .net 2.1, do not report errors here.
7107 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
7108 System.Runtime.CompilerServices.RequiredAttributeAttribute and
7109 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
7112 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
7113 of the type InternalsVisibleToAttribute before the first call
7114 to CoreLookupType which is allowed to fail (third boolean parameter
7115 to true). Because, during the resolution for a type that is not
7116 immediately found, we try to check if the type is not defined in
7117 a friend assembly, and to do so, we need the
7118 InternalVisibleToAttribute.
7120 2007-07-23 Miguel de Icaza <miguel@novell.com>
7122 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
7123 feature that allows structs to be compared against null and inline
7124 the result as true or false.
7126 Notice that the same code is not permitted inside a generic block
7127 of code that would do:
7129 class Foo<T> where T : struct {
7136 It is only allowed if the type of T is not bound (no where
7137 clause). In my opinion, this CSC 2 behavior is broken but people
7138 seem to be using it (IronRuby does, a few bug reports on bugzilla
7139 have it and some people have complained about it).
7141 All of the users that depend on this behavior have code that is
7144 * report.cs (Warning, Error): make these take object arguments,
7145 not strings, as that allows us to take advantage of Format.
7147 2007-07-20 William Holmes <billholmes54@gmail.com>
7149 * decl.cs: Changed MemberName.CountTypeArguments to also check the
7150 Left member variable for the Count.
7151 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
7152 MemberName.CountTypeArguments to avoid a NRE.
7154 This code is contributed under the MIT X11 license
7156 2007-07-18 Marek Safar <marek.safar@gmail.com>
7158 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
7160 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7162 * doc.cs : generic method arguments are written as ``x while generic
7163 type arguments are `x. Combined with the previous change, fixed bug
7166 2007-07-18 Raja R Harinath <rharinath@novell.com>
7169 * expression.cs (Binary.ResolveOperator): When converting
7170 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
7172 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7174 * doc.cs : when T: or whatever x: is specified, it does not really
7175 check the doc comment's syntax correctness. Fixed bug #82006.
7177 2007-07-18 Marek Safar <marek.safar@gmail.com>
7179 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
7180 LambdaExpression better.
7182 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
7184 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
7186 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
7187 as it can be generated.
7189 * expression.cs (Invocation.Error_InvalidArguments): Show correct
7192 * lambda.cs (LambdaExpression): Refactored to share same code with
7193 AnonymousMethodExpression.
7195 2007-07-17 Marek Safar <marek.safar@gmail.com>
7197 * anonymous.cs (MakeName): Include host name for easier debugging.
7198 (LambdaMethod): New class for lambda spcecific stuff.
7200 * attribute.cs: Set EmitContext return type.
7202 * class.cs: Set EmitContext return type.
7204 * codegen.cs (EmitContext): Return type cannot be null to stop messing
7205 with null/void meaning.
7207 * iterators.cs (ContainerType): Implemented.
7209 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
7211 * statement.cs (Return): Updated to lambda expressions.
7212 (Block.CloneTo): Parent can be null.
7214 2007-07-13 Marek Safar <marek.safar@gmail.com>
7216 A fix for bug #81917
7217 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
7219 * class.cs (FixedField): Check whether field is in unsafe scope.
7221 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
7222 (FieldExpr.Emit): Fixed buffers cannot be volatile.
7224 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
7227 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
7229 2007-07-13 Marek Safar <marek.safar@gmail.com>
7231 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
7232 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
7235 2007-07-13 Marek Safar <marek.safar@gmail.com>
7237 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
7239 2007-07-13 Marek Safar <marek.safar@gmail.com>
7241 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
7242 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
7244 * codegen.cs(EmitContext): Add ProbingMode flag.
7246 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
7248 * driver.cs: For now set both warning values.
7250 * ecore.cs (SimpleName): Name is readonly.
7251 (MethodGroup.OverloadResolve): One quick path for probing.
7253 * expression.cs (Unary): Set Oper r/o.
7254 (Binary): Set Oper r/o.
7255 (ParameterReference): Set few instance variables as r/o.
7256 (ParameterReference.DoResolveBase): Don't capture aruments when
7258 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
7259 (Arglist): arguments are private.
7260 (SizeOf): type is private and r/o.
7261 (MemberAccess): arguments are private.
7263 * report.cs: Enhanced reporting on/off capabilities.
7265 * lambda.cs: Uses ec.IsInProbingMode.
7266 (ContextualReturn): Derives from return.
7268 * rootcontext.cs: For now set both warning values.
7270 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
7272 (Return.Resolve): Don't die immediately.
7273 (Block.Resolve): Speed-up probing.
7274 (Block.CloneTo): Clone only child blocks.
7276 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
7278 * iterators.cs: reverted Miguel's latest change (r81925) as it
7279 breaks the build in System.
7281 2007-07-13 Miguel de Icaza <miguel@novell.com>
7283 * iterators.cs (Yield.CheckContext): Check for the iterator type
7284 also here as we can call into Yield even in codepaths that are not
7286 (MethodOrOperator is the only path that was checked).
7288 In addition to the standard check, use a more specific check for
7289 constructors to report a more verbose error.
7291 2007-07-12 Miguel de Icaza <miguel@novell.com>
7293 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
7294 report the warning and continue
7296 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
7297 values on the stack on the call to Emit. Use EmitStatement if
7298 possible, or using Emit + Pop if not possible. Fixes #82064
7300 2007-07-12 Raja R Harinath <rharinath@novell.com>
7302 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
7303 avoid try...finally in some cases.
7305 2007-07-10 Marek Safar <marek.safar@gmail.com>
7307 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
7309 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
7310 instead of method. Re-use standard error handling.
7311 (ConstructorInitializer.Emit): Simplified.
7313 * delegate.cs: Updated after Invocation.EmitCall change.
7315 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
7316 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
7317 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
7318 method and don't permanently changing input arguments.
7319 (MethodGroupExpr): Introduced resolved best_candidate, when method group
7320 is resolved it has one of the candidates is the best one which is later
7321 used to emit. Removed a few unused method.
7322 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
7324 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
7325 (Binary.ResolveOperator): Ditto.
7326 (ConditionalLogicalOperator.DoResolve): Ditto.
7327 (Invocation): Uses method group.
7328 (Invocation.DoResolve): Simplified.
7329 (Invocation.EmitCall): Removed useless is_static.
7330 (Invocation.Emit): Delegate to method group.
7331 (Invocation.EmitStatement): Simplified.
7332 (New): Uses method group.
7333 (MemberAccess.DoResolve): Don't destroy original expression.
7335 * statement.cs (ForEach.Resolve): Use null for no method arguments.
7337 2007-07-04 Marek Safar <marek.safar@gmail.com>
7339 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
7342 * lambda.cs: Add custom error message type.
7344 2007-07-03 Marek Safar <marek.safar@gmail.com>
7346 * lambda.cs: Simplified little bit.
7348 * parameter.cs: Introduced ImplicitLambdaParameter.
7349 (Parameters.CreateFullyResolved): New factory instead of ctor.
7353 * delegate.cs: Updated parameter creation.
7355 2007-07-03 Marek Safar <marek.safar@gmail.com>
7357 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
7360 * generic.cs: Synchronized with gmcs.
7362 2007-07-03 Marek Safar <marek.safar@gmail.com>
7364 * class.cs (Indexer): Check return type as soon as possible.
7366 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
7369 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
7371 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
7373 * parameter.cs (Parameter): Use expression type when it is available.
7375 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
7376 method modifier for the first parameter only.
7378 2007-06-24 Marek Safar <marek.safar@gmail.com>
7380 A fix for bug #81938
7381 * typemanager.cs (ChangeType): Fixed couple of char conversions.
7383 * constant.cs: Tide up an exception message.
7385 2007-06-22 Marek Safar <marek.safar@gmail.com>
7387 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
7388 an uninitialized variable is used.
7390 * expression.cs (LocalVariableReference.DoResolve): Ditto.
7392 2007-06-22 Marek Safar <marek.safar@gmail.com>
7394 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
7395 not found error handling.
7397 * expression.cs (ArrayCreation): Removed redundant fields and little bit
7399 (ArrayCreation.ResolveArrayElement): To be ready to customization.
7400 (ArrayCreation.DoResolve): Simplified.
7401 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
7402 its own resolve process.
7403 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
7405 2007-06-20 Marek Safar <marek.safar@gmail.com>
7407 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
7410 2007-06-20 Marek Safar <marek.safar@gmail.com>
7412 * cs-tokenizer.cs: Removed var related stuff.
7414 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
7415 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
7416 a type and a keyword at same time.
7418 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
7421 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
7422 implicitly typed arrays, more changes will follow.
7424 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
7426 2007-06-19 Marek Safar <marek.safar@gmail.com>
7428 * ecore.cs (VarExpr): Removed Handled field.
7430 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
7431 build-in assign functionality.
7432 (ForEach.Resolve): Removed all implicitly typed local variable code and
7434 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
7435 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
7437 2007-06-18 Marek Safar <marek.safar@gmail.com>
7439 * assign.cs: Removed implicitly typed local variable check.
7441 * expression.cs (LocalVariableReference.DoResolve): Add check for self
7442 referencing implicitly typed local variable.
7443 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
7446 * statement.cs (Fixed): Removed unsupported implicitly typed local
7449 2007-06-15 Marek Safar <marek.safar@gmail.com>
7451 * decl.cs (MemberName): Moved all Unbound stuff to parser.
7453 2007-06-14 Marek Safar <marek.safar@gmail.com>
7455 A fix for bugs #81855 and #76274
7456 * attribute.cs (AttachTo): Always set owner for global attributes to
7459 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
7462 * cs-parser.jay: Assembly and module attributes must precede all other
7463 elements except using clauses and extern alias declarations.
7465 2007-06-13 Marek Safar <marek.safar@gmail.com>
7467 A fix for bug #81748
7469 * expression.cs: More checks for non ISO-1 features.
7471 2007-06-12 Marek Safar <marek.safar@gmail.com>
7473 A fix for bug #81807
7474 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
7475 present inside switch statement and it is required by nullable check.
7477 2007-06-12 Marek Safar <marek.safar@gmail.com>
7479 A fix for bug #81840
7480 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
7481 when type matching fails.
7483 * namespace.cs: Tiny error message change.
7485 2007-06-12 Marek Safar <marek.safar@gmail.com>
7487 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
7488 reporting. Added automatic property check.
7490 * class.cs: Updated after CheckAbstractAndExtern relocation.
7491 (AEventPropertyAccessor.GetSignatureForError): Customized.
7493 2007-06-11 Marek Safar <marek.safar@gmail.com>
7495 * class.cs (DefineBaseTypes): Base type can be undefined.
7497 * ecore.cs (TypeLookup): Minor refactoring.
7498 (DoResolveAsTypeStep): Removed redundant check.
7500 * namespace.cs (Lookup): Removed redundant check.
7502 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
7503 ResolveAsTypeTerminal step.
7504 (BootstrapCorlib_*): Simplified.
7505 (PopulateCoreType): Core types can be now external.
7507 2007-06-07 Marek Safar <marek.safar@gmail.com>
7509 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
7511 (InferTypeArguments): Infers anonymous expression type arguments.
7512 (Compatible): Split to Compatible and InferTypeArguments.
7514 * lambda.cs: Updated.
7516 2007-06-08 Marek Safar <marek.safar@gmail.com>
7518 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
7520 2007-06-07 Raja R Harinath <harinath@gmail.com>
7522 Fix #80477, cs0135-2.cs, cs0135-3.cs
7523 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
7524 names to the "known" variables list.
7525 (Block.CheckInvariantMeaningInBlock): Handle the fact the
7526 parameter names are also "known".
7527 (Block.CheckError136): Remove.
7528 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
7531 2007-06-07 Marek Safar <marek.safar@gmail.com>
7533 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
7535 2007-06-06 Marek Safar <marek.safar@gmail.com>
7537 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
7538 internal error not an user error.
7540 * expression.cs (IsApplicable): Refactored to make debugging easier.
7542 * support.cs: More tricks for non-mono runtimes.
7544 * typemanager.cs (CoreLookupType): Made public.
7545 (InitSystemCore): All linq specific stuff moved to linq.cs
7547 2007-06-05 Marek Safar <marek.safar@gmail.com>
7549 * typemanager.cs (CSharpSignature): One more missing build-in types
7551 More tricks for non-mono runtime.
7553 2007-06-05 Raja R Harinath <harinath@gmail.com>
7555 * statement.cs (Block.CheckError136_InParents): Remove.
7556 (Block.AddVariable): Use GetParameterInfo instead.
7557 (ToplevelBlock.ProcessArguments): Likewise.
7559 2007-06-04 Raja R Harinath <rharinath@novell.com>
7561 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
7563 (ToplevelBlock.GetParameterInfo): Split out of ...
7564 (ToplevelBlock.GetParameterRefernce): ... this.
7565 (ToplevelBlock.ParameterMap): Remove.
7566 * expression.cs (ParameterReference): Update to use
7567 ToplevelParameterInfo.
7569 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
7572 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
7573 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
7575 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
7576 (ToplevelBlock.ProcessParameters) ... here.
7577 (ToplevelBlock..ctor): Invoke it.
7579 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
7582 * statement.cs (IKnownVariable): New interface.
7583 (LocalInfo): Implement it.
7584 (ToplevelParameterInfo): New class.
7585 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
7586 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
7587 GetKnownVariableInfo.
7589 2007-06-03 Raja R Harinath <harinath@gmail.com>
7591 Partly speed up CS0136 error checks.
7592 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
7593 'recurse' parameter.
7594 (Block.DoCheckError136): Only check errors in parameters. Move
7595 local variable checks ...
7596 (Block.AddVariable): ... here, and ...
7597 (ToplevelBlock.ResolveMeta): ... here.
7599 2007-06-02 Raja R Harinath <harinath@gmail.com>
7601 * statement.cs (Block.IsChildOf): Remove.
7603 * statement.cs (Statement.Clone): Move special case code ...
7604 (Block.CloneTo): ... here.
7606 2007-05-29 Raja R Harinath <rharinath@novell.com>
7608 * statement.cs (ToplevelBlock.container): Remove field. It's
7609 redundant with 'Parent'.
7610 (ToplevelBlock.ContainerBlock): Remove accessor.
7611 (ToplevelBlock..ctor): Update to changes. Register anonymous
7612 child with parent here, ...
7613 * cs-parser.jay (end_anonymous): ... not here. Don't modify
7615 (start_anonymous): Don't save current_block.
7616 (top_current_block): Remove.
7618 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
7619 (Block.Resolve): Update to changes.
7620 (Block..ctor): Move setting of "correct" 'Toplevel'
7621 and 'Explicit' fields to ...
7622 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
7624 2007-05-27 Raja R Harinath <harinath@gmail.com>
7627 * statement.cs (Block.Implicit): Remove.
7628 (Block): Update to changes.
7629 * flowanalysis.cs: Likewise.
7631 Mildly speed up CheckInvariantMeaningInBlock
7632 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
7633 Recursively call AddKnownVariable to all enclosing blocks.
7634 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
7635 Remove recursive calls.
7636 (Block): Update to changes.
7638 New ExplicitBlock invariants
7639 * statement.cs (Block.Explicit): New field. It points to the
7640 immediately enclosing non-implicit block.
7641 (Block..ctor): Maintain the invariant.
7642 * cs-parser.jay: Take advantage of invariant.
7644 Introduce ExplicitBlock
7645 * statement.cs (ExplicitBlock): New.
7646 (ToplevelBlock): Derive from it.
7647 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
7649 (Block.Implicit): Update to changes.
7650 * cs-parser.jay: Update to changes.
7653 * codegen.cs (EmitContext.IsLastStatement): Remove.
7654 * statement.cs (Block.DoEmit): Update to changes.
7656 2007-05-25 Raja R Harinath <rharinath@novell.com>
7658 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
7659 modifying current_block directly.
7661 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
7663 * class.cs: Implemented automatic properties (C# 3.0)
7664 Thanks to Marek for the help.
7666 2007-05-23 Raja R Harinath <rharinath@novell.com>
7668 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
7669 variable as assigned, note also that all its components are
7671 (MyBitVector.SetRange): New. Function to set multiple bits to true.
7673 2007-05-19 Marek Safar <marek.safar@gmail.com>
7675 * anonymous.cs, class.cs: Emit Compiler generated attribute when
7676 member is marked as compiler generated.
7678 * decl.cs (MemberCore): Refactored ModFlags into property.
7680 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
7681 (Check): Check only accessibility modifiers.
7683 2007-05-18 Raja R Harinath <rharinath@novell.com>
7685 Track all assignable slots in one bit array
7686 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
7687 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
7688 logic from VariableMap constructor here. Use the same 'offset'
7689 variable that's later used for computing offsets of local
7691 * flowanalysis.cs (UsageVector.parameters): Remove.
7692 (UsageVector): Update to changes.
7693 (VariableMap): Remove.
7695 Avoid creating ParameterMap in every block
7696 * statement.cs (Block.ParameterMap): Move ...
7697 (ToplevelBlock.ParameterMap): ... here.
7698 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
7700 * flowanalysis.cs (FlowBranching.param_map): Remove.
7701 (FlowBranching.UsageVector): Update to changes.
7702 (FlowBranchingToplevel.CheckOutParameters): Likewise.
7704 * statement.cs (Block.CloneTo): Clone Toplevel field too.
7706 * expression.cs (ParameterReference): Distinguish between block
7707 where parameter was referenced and declared.
7709 2007-05-18 Marek Safar <marek.safar@gmail.com>
7711 * flowanalysis.cs, statement.cs: Put back improved error handling.
7713 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
7717 Imporved object and collection initialization (C# 3.0).
7719 2007-05-15 Marek Safar <marek.safar@gmail.com>
7721 A fix for bug #81380
7722 * expression.cs (Is.DoResolve): Only value types have constant `is'
7725 2007-05-15 Raja R Harinath <rharinath@novell.com>
7727 * statement.cs (ToplevelBlock.child): Remove.
7729 2007-05-15 Raja R Harinath <harinath@gmail.com>
7731 Rationalize ResolveMeta: refactoring
7732 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
7733 out constant handling code into ...
7734 (Block.DoResolveConstants): ... this.
7736 Rationalize ResolveMeta: kill local_map
7737 * statement.cs (Block.local_map, Block.LocalMap): Remove.
7738 (Block.AssignableSlots): New.
7739 (Block.ResolveMeta): Make protected. Don't create a VariableMap
7740 for locals -- move code from VariableMap here. Avoid unnecessary
7742 * flowanalysis.cs (FlowBranching.local_map): Remove.
7743 (FlowBranching..ctor): Use Block.AssignableSlots.
7744 (VariableMap): Remove unused constructors.
7746 2007-05-11 Raja R Harinath <rharinath@novell.com>
7748 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
7750 2007-05-11 Marek Safar <marek.safar@gmail.com>
7752 * typemanager.cs (IsFriendAssembly): Should not be called for building
7755 2007-05-09 Marek Safar <marek.safar@gmail.com>
7757 * literal.cs (NullConstant): Print null in all cases.
7759 * expression.cs (Binary.ResolveOperator): Implemented delegate
7760 comparison based on C# 2.0 changes.
7762 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
7764 This code is contributed under the MIT X11 license
7766 The following enables support for several C# 3.0 language features:
7768 * cs-tokenizer.cs: Added support for the "var" keyword.
7770 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
7771 Added VarExpr class to facilitate type inferencing.
7773 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
7774 to support anonymous types.
7776 * assign.cs: Added support for type inferencing and initialization.
7778 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
7780 * expression.cs: Added implicit array support to ArrayCreation.
7781 Added 5 types and 1 interface:
7783 IInitializable Implementing classes can inject initializing
7784 statements after object instantiation.
7786 Initializer Stores data for object initialization.
7788 AnonymousType An expression for anonymous types.
7790 AnonymousTypeParameter Stores data about an anonymous type's field.
7792 NewInitialize An expression for object initialization.
7794 CollectionInitialize An expression for collection initialization.
7796 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
7799 2007-05-06 Marek Safar <marek.safar@gmail.com>
7801 A fix for bug #81500
7802 * cs-tokenizer.cs: Add special handling for coalescing operator.
7804 2007-05-06 Marek Safar <marek.safar@gmail.com>
7806 A fix for bug #81529
7807 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
7808 its value from base class until it is redefined.
7810 2007-05-02 Raja R Harinath <rharinath@novell.com>
7812 Fix regression in cs0631-3.cs
7813 * cs-parser.jay (operator_declarator): Add opt_attributes to error
7814 fallback. Make error fallback catch more cases.
7816 2007-05-01 Miguel de Icaza <miguel@novell.com>
7818 * cs-parser.jay: Allow parameters in operator declarations to have
7821 2007-04-27 Miguel de Icaza <miguel@novell.com>
7823 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
7826 * lambda.cs (ContextualReturn.Resolve): An expression is valid
7827 inside the ContextualReturn, it does not have to be an
7828 ExpressionStatement.
7830 2007-04-24 Miguel de Icaza <miguel@novell.com>
7832 * lambda.cs (ContextualReturn.Resolve): if the return type is not
7835 2007-04-23 Miguel de Icaza <miguel@novell.com>
7837 * anonymous.cs (AnonymousContainer): split the virtual Resolve
7838 method in two methods: ResolveNoDefine and Resolve.
7840 ResolveNoDefine will stop just after ResolveTopBlock has been
7843 Resolve will then continue by creating a method and issuing the
7844 call to method.Define ().
7846 (AnonymousMethod): Split and implement the new Resolve and
7847 ResolveNoDefine as well.
7849 * lambda.cs (LambdaExpression): Split the anonymous method
7850 resolution code into a separate routine (CoreCompatibilityTest)
7851 from DoCompatibleTest.
7853 (LambdaExpression.TryBuild): New method, this method tries to
7854 build the LambdaExpression with the given set of types to be used
7855 as the types for the various parameters of the lambda expression.
7857 If the compilation succeed with the given types, the infered type
7858 of the Anonymous method is returned, otherwise null is returned.
7860 2007-04-23 Marek Safar <marek.safar@gmail.com>
7862 A fix for bug #81414
7863 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
7865 2007-04-22 Miguel de Icaza <miguel@novell.com>
7867 * cs-tokenizer.cs: Change various identifiers here from the
7868 camelCasing to the recommended Linux-like style for instance
7869 variables from the Coding Guidelines.
7871 2007-04-19 Martin Baulig <martin@ximian.com>
7874 (Convert.ImplicitReferenceConversionCore): Allow conversions from
7875 System.Enum to System.ValueType.
7877 2007-04-13 Martin Baulig <martin@ximian.com>
7879 Rewrote implicit reference conversions. We need to distinguish
7880 between implicit reference conversions (13.1.4) and implicit
7881 boxing conversions (13.1.5).
7883 According to the spec, there's an an implicit conversion
7884 "From a one-dimensional array-type S[] to IList<T> and base
7885 interfaces of this interface, provided there is an implicit
7886 reference conversion from S to T." Note that this does not
7887 include boxing conversions.
7890 (Convert.ImplicitTypeParameterBoxingConversion): New method.
7891 (Convert.ImplicitReferenceConversion): Split into
7892 ImplicitReferenceConversionCore() and
7893 ImplicitBoxingConversionExist().
7894 (Convert.ImplicitReferenceConversionExists): Use the new
7895 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
7897 2007-04-12 Martin Baulig <martin@ximian.com>
7899 * convert.cs (Convert.ImplicitReferenceConversion): Move the
7900 `TypeManager.null_type' checks up to the top of the method.
7902 2007-04-11 Marek Safar <marek.safar@gmail.com>
7904 A fix for bug #81350
7905 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
7908 2007-04-11 Martin Baulig <martin@ximian.com>
7910 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
7911 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
7912 to make this work for generic classes; fixes #79561.
7914 2007-04-11 Martin Baulig <martin@ximian.com>
7916 * expression.cs (As): Add support for nullable types; fixes #79371.
7918 2007-04-11 Martin Baulig <martin@ximian.com>
7920 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
7921 `type.FullName' is null; fixes #80243.
7923 2007-04-11 Martin Baulig <martin@ximian.com>
7925 * expression.cs (Invocation.IsApplicable): Don't modify the method
7926 if type inference succeeded, but the method was not applicable.
7929 2007-04-10 Marek Safar <marek.safar@gmail.com>
7931 A fix for bug #81324
7932 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
7933 internal and external namespaces containers.
7935 2007-04-10 Martin Baulig <martin@ximian.com>
7937 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
7938 TypeManager.DropGenericMethodArguments() so we also call
7939 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
7941 2007-04-10 Martin Baulig <martin@ximian.com>
7943 * iterators.cs (Iterator.CreateIterator): Don't crash if
7944 `method.ReturnType' is null. This happens if something went wrong
7945 while resolving that typ (we already reported an error in this case).
7947 2007-04-10 Martin Baulig <martin@ximian.com>
7949 * expression.cs (New.DoResolve): Don't call CheckComImport() on
7950 generic interfaces; report the CS0144 directly.
7952 2007-04-10 Martin Baulig <martin@ximian.com>
7954 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
7955 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
7957 2007-04-10 Martin Baulig <martin@ximian.com>
7959 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
7961 2007-04-09 Raja R Harinath <rharinath@novell.com>
7964 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
7965 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
7968 * statement.cs (For.Resolve): If resolution fails, use
7971 2007-04-08 Marek Safar <marek.safar@gmail.com>
7973 * anonymous.cs (MakeName): Make faster and zero-based.
7974 (VerifyExplicitParameterCompatibility): Back to mode where generic
7975 parameter is ignored.
7976 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
7978 * class.cs (EmitType): Method can emit another new method.
7980 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
7982 * driver.cs: Updated.
7984 * lambda.cs: Reuse predefined empty parameters.
7986 * parameter.cs: Updated
7988 * support.cs: Implemented InflateTypes.
7990 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
7991 (InitSystemCore): Introduced to isolate 3.0 dependencies.
7993 2007-04-03 Martin Baulig <martin@ximian.com>
7997 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
7998 version of TypeManager.IsOverride() which also works with generic
8001 2007-04-03 Martin Baulig <martin@ximian.com>
8006 (Convert.ExplicitReferenceConversion): We need to cast when
8007 converting from IList<T> to S[].
8009 2007-04-01 Marek Safar <marek.safar@gmail.com>
8011 * decl.cs (FindExtensionMethods): Consider all candidates with same name
8014 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
8016 2007-03-31 Marek Safar <marek.safar@gmail.com>
8018 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
8019 argument and return type inferring.
8021 * codegen.cs (InferReturnType): Flag whether return can be inferred.
8022 (ReturnType): Turned to property.
8024 * statement.cs (Return): Implemented return type inferring.
8026 * support.cs (ReflectionParameters): Use local types if possible.
8028 2007-03-30 Raja R Harinath <rharinath@novell.com>
8030 * flowanalysis.cs (FlowBranching.Reachability): Remove.
8031 (FlowBranching.UsageVector): Update to changes.
8033 Prepare to kill 'Reachability'
8034 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
8035 argument of constructor.
8037 2007-03-29 Raja R Harinath <rharinath@novell.com>
8039 Prepare to kill 'Reachability'
8040 * flowanalysis.cs (UsageVector.is_unreachable): New.
8041 (UsageVector): Update to maintain 'is_unreachable' in parallel to
8042 'reachability', and verify they're consistent.
8045 * expression.cs (New.EmitStatement): Handle type parameters here too.
8047 2007-03-29 Martin Baulig <martin@ximian.com>
8052 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
8053 CompilerGeneratedClass.
8054 (ScopeInfo.EmitScopeInstance): Make this protected.
8055 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
8056 `ec.CurrentAnonymousMethod.Scope == Scope'.
8058 * statement.cs (Block.ScopeInfo): Make this a property.
8060 2007-03-27 Raja R Harinath <harinath@gmail.com>
8062 Prepare to kill 'Reachability'
8063 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
8064 (FlowBranching.UsageVector.Reachability): Remove property.
8065 (FlowBranching.UsageVector.IsUnreachable): New property.
8066 (FlowBranching.UsageVector.ResetBarrier): New.
8067 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
8068 * codegen.cs, statement.cs: Update to changes.
8070 2007-03-27 Martin Baulig <martin@ximian.com>
8075 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
8078 2007-03-26 Raja R Harinath <rharinath@novell.com>
8080 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
8081 instead of TriState. Remove all mention of TriState.
8083 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
8084 replaced by a boolean. Add boolean 'is_unreachable' field, check
8085 and maintain invariants.
8087 2007-03-25 Marek Safar <marek.safar@gmail.com>
8089 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
8091 2007-03-25 Marek Safar <marek.safar@gmail.com>
8093 * expression.cs: Stop using obsolete 2.0 opcodes.
8095 2007-03-25 Marek Safar <marek.safar@gmail.com>
8097 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
8098 one of the latests Martin's fixes.
8100 2007-03-23 Miguel de Icaza <miguel@novell.com>
8102 * expression.cs: On BigEndian systems, swap the bytes, temporary
8103 solution until we get a new bitconverter class.
8105 2007-03-23 Martin Baulig <martin@ximian.com>
8109 * decl.cs (MemberCache.AddMembers): Add generic methods both as
8110 "Method" and "Method`1". Normally, a cache lookup is done on the
8111 "Method" form (ie. without the generic arity), but this one makes
8112 lookups on the full form work as well.
8114 2007-03-22 Raja R Harinath <rharinath@novell.com>
8116 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
8119 2007-03-20 Bill Holmes <billholmes54@gmail.com>
8121 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
8122 ordered_member_list, to TypeBuilder to store members to be defined
8123 in the order they were parsed in.
8124 - ordered_explicit_member_list contains all properties indexers
8125 and methods that are defined as explicit implementation of an
8126 interface or base class.
8127 - ordered_member_list contains all properties indexers and methods
8128 that are not defined as explicit implementation of an interface
8131 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
8132 functionality in these removed classes has been replaced with
8133 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
8134 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
8136 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
8137 to CheckForDuplications inside GetMethod and SetMethod Define Method
8138 to handle method property and indexer name conflicts.
8142 All code is contributed under the MIT/X11 license.
8144 2007-03-20 Martin Baulig <martin@ximian.com>
8146 * class.cs (TypeContainer.Interfaces): Removed; they're now
8147 included in `TypeContainer.Types'.
8149 2007-03-20 Martin Baulig <martin@ximian.com>
8151 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
8153 * class.cs (TypeContainer.CreateType): New public method. This is
8154 now called before DefineType() to create the TypeBuilders.
8155 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
8156 has already been created by CreateType().
8157 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
8158 don't resolve our base classes here; this has been moved into
8159 DefineBaseTypes(). We're now called from CreateType().
8160 (TypeContainer.DefineBaseTypes): New private method; resolve our
8161 base classes here. We're now called from DefineType().
8164 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
8165 our types first to create all the TypeBuilders. After that, call
8166 TypeContainer.DefineType() on all the types which'll resolve their
8167 base classes and setup the resolve order.
8169 2007-03-20 Martin Baulig <martin@ximian.com>
8171 * class.cs (TypeContainer.Enums): Removed; they're now included in
8172 `TypeContainer.Types'.
8174 2007-03-20 Martin Baulig <martin@ximian.com>
8177 (TypeContainer.DefineType): Don't call ResolveMembers() here.
8178 (TypeContainer.DoResolveMembers): Call DefineType() on our
8179 `compiler_generated' classes; moved here from DefineNestedTypes().
8182 (RootContext.ResolveTree): Call ResolveMembers() on all
8183 TypeContainer's in the `type_container_resolve_order'.
8185 2007-03-19 Marek Safar <marek.safar@gmail.com>
8187 * class.cs: Use corlib to handle InternalMethodImplAttribute.
8189 2007-03-17 Marek Safar <marek.safar@gmail.com>
8191 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
8192 implementation flags.
8194 2007-03-17 Marek Safar <marek.safar@gmail.com>
8196 * class.cs: More optimizations for type parameters.
8198 2007-03-15 Marek Safar <marek.safar@gmail.com>
8200 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
8202 * ecore.cs, parameter.cs: More common code for both corlibs.
8204 * typemanager.cs (IsGenericMethod): Simplified.
8206 2007-03-15 Raja R Harinath <rharinath@novell.com>
8208 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8210 * statement.cs, iterators.cs, lambda.cs: Update to changes.
8212 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
8213 unconditionally. Simplify explanation.
8214 (Try.Resolve, Using.Resolve): Likewise.
8216 2007-03-15 Martin Baulig <martin@ximian.com>
8220 * decl.cs (DeclSpace): If we're a partial class, use our
8221 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
8223 2007-03-15 Raja R Harinath <rharinath@novell.com>
8225 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8227 (FlowBranching.UsageVector): Update to changes.
8228 (FlowBranching.MergeSiblings): Likewise.
8229 * statement.cs: Likewise.
8231 2007-03-15 Martin Baulig <martin@ximian.com>
8236 (MemberCache): Added a special .ctor for type parameters.
8239 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
8242 2007-03-09 Martin Baulig <martin@ximian.com>
8244 * enum.cs (Enum): Make this a TypeContainer.
8245 (EnumMember): Derive from `Const'.
8248 (Const.DoResolveValue): New protected virtual method; move most of
8249 the functionality of ResolveValue() here so we can override it in
8251 (Const.CreateConstantReference): Make this virtual.
8253 * class.cs (Kind): Add `Kind.Enum'.
8254 (TypeContainer.Emit): Don't emit the enums here; they're already
8255 in the `RootContext.typecontainer_resolve_order'.
8257 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
8258 here; they're already in the `typecontainer_resolve_order'.
8260 * ecore.cs (EnumConstant.ConvertImplicitly): Add
8261 TypeManager.DropGenericTypeArguments().
8264 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
8265 (TypeManager.IsEnumType): Likewise.
8266 (TypeManager.EnumToUnderlying): Likewise.
8267 (TypeManager.IsEqual): Add support for enums.
8269 2007-03-12 Raja R Harinath <rharinath@novell.com>
8271 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
8272 DefaultParameterValueAttribute to be undefined, say if System.dll
8275 2007-03-11 Marek Safar <marek.safar@gmail.com>
8277 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
8280 2007-03-10 Marek Safar <marek.safar@gmail.com>
8282 * class.cs, parameter.cs: Unified parameters verification.
8284 2007-03-08 Martin Baulig <martin@ximian.com>
8286 * cs-parser.jay (constructor_header): Pass the location to the
8287 newly created TopLevelBlock.
8289 2007-03-07 Martin Baulig <martin@ximian.com>
8291 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
8293 2007-03-06 Miguel de Icaza <miguel@novell.com>
8295 * convert.cs (ExplicitReferenceConversionExists): Sync this method
8296 with the changes from David, fixes the build.
8298 2007-03-05 David Mitchell <dmitchell@logos.com>
8300 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
8301 and its base interfaces to a one-dimensional array type S[],
8302 provided there is an implicit or explicit reference conversion
8305 2007-03-03 Marek Safar <marek.safar@gmail.com>
8307 * cs-tokenizer.cs: Implemented basic linq grammar.
8309 * driver.cs: Set linq lang version on demand.
8311 2007-02-26 Marek Safar <marek.safar@gmail.com>
8313 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
8315 2007-02-25 Marek Safar <marek.safar@gmail.com>
8317 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
8320 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
8322 Check property and event extern attributes.
8324 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
8327 2007-02-24 Marek Safar <marek.safar@gmail.com>
8329 A fix for bug #80407
8330 * ecore.cs: Don't report ambiguity error when methods have same parent.
8332 2007-02-23 Marek Safar <marek.safar@gmail.com>
8334 A fix for bug #80878
8335 * class.cs, cs-parser.jay: Event property can host anonymous methods.
8337 2007-02-22 Marek Safar <marek.safar@gmail.com>
8339 * attribute.cs: Enable ExtensionAttribute presence test.
8341 2007-02-22 Marek Safar <marek.safar@gmail.com>
8343 * class.cs: Warn about missing GetHashCode only when Equals is override.
8345 * decl.cs: Check accessibility of type arguments.
8347 * typemanager.cs: Correctly report nullable array.
8349 2007-02-20 Marek Safar <marek.safar@gmail.com>
8351 * class.cs, report.cs: Capture more details when things go wrong.
8353 2007-02-20 Marek Safar <marek.safar@gmail.com>
8355 A fix for bug #80650
8356 * cs-parser.jay: Anonymous container starts at constructor declaration
8357 and not at block beginning because it has to be usable in constructor
8360 * statement.cs: Use context location and not block one for error reporting.
8362 2007-02-18 Marek Safar <marek.safar@gmail.com>
8364 A fix for bug #78712
8365 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
8368 2007-02-18 Marek Safar <marek.safar@gmail.com>
8370 A fix for bug #80493 by Atsushi Enomoto
8371 * cs-parser.jay: Ignore invalid attribute target.
8373 2007-02-18 Marek Safar <marek.safar@gmail.com>
8375 * cs-tokenizer.cs: Ignore '\0' as white space character.
8377 2007-02-17 Miguel de Icaza <miguel@novell.com>
8379 * cs-parser.jay: Add support for lambda expressions to the mcs
8382 * lambda.cs: Only clone when we are probing, not on the final call
8383 (Compatible is the final call).
8385 * statement.cs (CloneContext): Introduce class to provide block
8386 remapping during clone.
8388 All statements Clone themselves now.
8390 (Clone): special handling for blocks, when we clone a block, we
8391 register the block inside this routine, as children of the block
8392 might trigger a lookup.
8394 * expression.cs: Add support for CloneContext in all expressions.
8396 2007-02-17 Marek Safar <marek.safar@gmail.com>
8398 A fix for bug #80493
8399 * statement.cs: Report ambiguous warning when interfaces are not related.
8401 2007-02-15 Marek Safar <marek.safar@gmail.com>
8403 C# 3.0 extension methods.
8405 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
8406 cannot be used directly.
8408 * class.cs (Class.Emit): Emit extension attribute if any class method
8409 is extension method.
8410 (Method.Define): Add basic extension method validation conditions.
8411 (Method.Emit): Emit extension attribute for method.
8413 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
8414 extension method exists. Currently we follow same approach as Microsoft
8415 does, emit even if a method or a class are private but this can change
8418 * cs-parser.jay: Add handling of `this' keyword in method parameters
8421 * decl.cs (DeclSpace.IsStaticClass): New property.
8422 (MemberCache.FindExtensionMethods): Looks for extension methods with
8423 defined name and extension type.
8425 * doc.cs: Updated after OverloadResolve changes.
8427 * driver.cs: Add new soft reference to System.Core.dll.
8429 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
8430 (ExtensionMethodGroupExpr): Represents group of extension methods.
8432 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
8433 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
8434 to MethodGroupExpr and made non-static for easier customization.
8435 (Invocation.DoResolve): Add extension method lookup when no standard
8437 (MemberAccess.DoResolve): Try extension methods if no member exists.
8439 * modifiers.cs: Add METHOD_EXTENSION modifier.
8441 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
8442 as well as candidate extension type.
8443 (ComputeNamespaces): When assembly constains extension methods registers
8445 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
8446 extension method lookup.
8447 (Namespace.LookupExtensionMethod): Looks for extension method in this
8449 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
8450 find a method which matches name and extensionType.
8452 * parameter.cs (Parameter): Add This modifer.
8453 (HasExtensionMethodModifier): New property.
8454 (Resolve): Add extension parameter check.
8455 (ModFlags): turned to property to exclude this modifier as it is not real
8457 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
8459 * support.cs (ParameterData): Add ExtensionMethodType.
8460 (ReflectionParameters): Implemented ExtensionMethodType interface property.
8462 * typemanager.cs: Add type and ctor extension attribute type.
8464 2007-02-15 Miguel de Icaza <miguel@novell.com>
8466 * report.cs (DisableErrors, EnableErrors): used to prevent error
8467 output when we are "trying" to compile various methods with
8470 * ecore.cs (Expression): Add Clone method that calls the virtual
8471 CloneTo method. The current CloneTo method in Expression throws
8472 an exception so we can track down all the places where this must
8473 be implemented (not using abstract, because that would be a lot of
8474 up-front-work before we can start testing the implementation
8477 Important: we only need Clone capabilities for expressions created
8478 by the parser, as the expressions we will be cloning are
8479 expressions in the pre-resolved state. This vastly simplifies
8482 (SimpleName): Add CloneTo that does nothing.
8483 (EmptyCast): Add CloneTo.
8485 * expression.cs (Binary): Implement CloneTo.
8486 (Invocation.IsApplicable): Store the current ec in
8487 EmitContext.TempEc and restore it on return. This is used so we
8488 do not have to sprinkle hundres of methods with an extra
8489 EmitContext, we know that the only user is the lambda expression
8490 ImplicitConversionExists code.
8492 (Argument): Add Cloning capabilities.
8493 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
8494 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
8495 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
8496 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
8497 IndexerAccess): Add Clone capability.
8499 (LocalVariableReference, This): TODO: needs cloned Block mapping.
8501 (Argument): Add cloning capability.
8503 * assign.cs (Assign): Implement CloneTo.
8505 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
8507 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
8508 version by calling Convert with the EmitContext (that we are
8509 currently storing in ec, this is not great, but will do for now,
8510 to avoid passing EmitContext parameters to hundreds of functions
8511 that do not need them now).
8513 (SetExpression): Remove, it is not needed.
8515 (ContextualReturn): Implement CloneTo.
8517 * statement.cs (Statement): Implement cloning infrastructure,
8518 similar to expressions.
8520 (Block): Partial implementation of Clone for statements.
8522 (Return): Implement clone.
8524 * constant.cs (Constant.CloneTo): New method, does nothing.
8526 * codegen.cs (TempEc): Add a static EmitContext as a temporary
8527 solution, until we decide how to exactly do this.
8529 2007-02-14 Marek Safar <marek.safar@gmail.com>
8531 A fix for bug #80493
8532 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
8533 a property is override we need to use second accessor.
8535 2007-02-13 Marek Safar <marek.safar@gmail.com>
8537 A fix for bug #80418
8538 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
8541 2007-02-13 Marek Safar <marek.safar@gmail.com>
8543 Another fix for bug #80749
8544 * pending.cs: Abstract class has priority over interfaces.
8546 2007-02-13 Marek Safar <marek.safar@gmail.com>
8548 Another fix for bug #80749
8549 * pending.cs: Abstract class has priority over interfaces.
8551 2007-02-13 Marek Safar <marek.safar@gmail.com>
8553 Another fix for bug #80749
8554 * pending.cs: Abstract class has priority over interfaces.
8556 2007-02-13 Marek Safar <marek.safar@gmail.com>
8558 Another fix for bug #80749
8559 * pending.cs: Abstract class has priority over interfaces.
8561 2007-02-13 Marek Safar <marek.safar@gmail.com>
8563 * class.cs Better error message.
8565 * driver.cs: Add shorter versions of -optimize option.
8567 2007-02-13 Martin Baulig <martin@ximian.com>
8569 * class.cs (Constructor.Emit): Check the return value of
8570 ec.ResolveTopBlock() and return on error.
8572 2007-02-13 Raja R Harinath <rharinath@novell.com>
8574 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
8575 message to fix error message regression.
8577 2007-02-12 Marek Safar <marek.safar@gmail.com>
8579 * delegate.cs: Delegate creation expression cannot be of Nullable type.
8581 2007-02-12 Marek Safar <marek.safar@gmail.com>
8583 A fix for bug #80749
8584 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
8585 its parent container.
8587 * class.cs (DefineFieldInitializers): Each initializer can has different
8590 * const.cs: Updated.
8592 2007-02-11 Miguel de Icaza <miguel@novell.com>
8594 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
8595 now all the heavy lifting to check that embedded statements or
8596 expressions have the right form is done in the ContextualReturn.
8598 (ContextualReturn): New class.
8600 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
8601 method that can be invoked to report 201, so we do not replicate
8604 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
8606 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
8607 treating tabs as spaces.
8609 2007-02-09 Marek Safar <marek.safar@gmail.com>
8611 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
8612 * assign.cs: Use full implicit conversion for right side check.
8614 2007-02-09 Marek Safar <marek.safar@gmail.com>
8616 * statement.cs (Switch): Switch over boolean type is not standardized.
8618 2007-02-08 Marek Safar <marek.safar@gmail.com>
8620 A fix for bug #80755
8621 * decl.cs (FindBaseEvent): Don't use method cache for events.
8623 2007-02-07 Marek Safar <marek.safar@gmail.com>
8625 * cs-parser.jay: Better syntax error handling.
8627 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
8628 instead of underlying type value.
8630 2007-02-06 Marek Safar <marek.safar@gmail.com>
8632 * driver.cs: Check define identifier before is registered.
8634 * namespace.cs: Use existing error message.
8636 * report.cs: New warning.
8638 2007-02-06 Marek Safar <marek.safar@gmail.com>
8640 A fix for bug #80742
8641 * expression.cs: Delegate Invoke method can be called directly.
8643 2007-02-06 Marek Safar <marek.safar@gmail.com>
8645 A fix for bug #80676
8646 * class.cs (IsEntryPoint): The Main method can have params modifier.
8648 2007-02-04 Miguel de Icaza <miguel@novell.com>
8650 * parameter.cs (Parameter, Parameters): Add Clone method.
8652 * anonymous.cs (Compatible): Turn method into virtual method, so
8653 LambdaExpression can implement a different behavior.
8655 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
8656 out the basic checking here, so it can be used by
8659 * lambda.cs: Introduce "Compatible" function that will do the
8662 2007-02-02 Marek Safar <marek.safar@gmail.com>
8664 * attribute.cs: Unified one error message.
8666 * class.cs (Class): Use type attributes and not properties to test static
8668 (IsEntryPoint): Don's pass local variable.
8670 * convert.cs: Removed duplicate check.
8672 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
8674 * driver.cs: Don't crash when soft reference does not exist.
8676 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
8677 (UsingEntry): Removed redundant allocation.
8679 * parameter.cs: Add fast path for type parameters.
8681 * support.cs: Don't allocate attribute when it's not used.
8683 2007-01-30 Miguel de Icaza <miguel@novell.com>
8686 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
8687 this into a virtual method, so we can override it in LambdaExpression.
8689 * driver.cs: Improve diagnostics in case of failure.
8691 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
8692 write a function that is slightly more complex and that parses:
8694 type identifier [, type identifier]* )
8696 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
8699 (canEmpty ? i >= 0 : i > 0)
8701 2007-01-30 Raja R Harinath <rharinath@novell.com>
8703 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
8704 exception on possibly valid code.
8706 2007-01-29 Raja R Harinath <rharinath@novell.com>
8708 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
8710 (parse_opt_type_arguments): Remove. It's almost the same as
8712 (parse_namespace_or_typename): Use parse_less_than.
8714 2007-01-28 Miguel de Icaza <miguel@novell.com>
8716 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
8717 this bug took a few hours to find, because the state saved and
8718 restored by PushPosition and PopPosition was ignoring the state of
8719 parse_generic_less_than.
8721 I can also now remove the handling of OP_LT and OP_GT, this solves
8724 * cs-tokenizer.cs: store the location for the ARROW token, we use
8727 (PushPosition, PopPosition): save/restore also `current_token',
8728 restore `parse_generic_less_than' (was missing).
8730 (parse_opt_type_arguments): use parse_type, not
8731 parse_namespace_or_typename to parse types.
8733 * lambda.cs: Empty new file, will eventually have the lambda
8734 expression implementation.
8736 * lambda.test: used to test the internal tokenizer.
8738 * report.cs (FeatureIsNotISO1): Rename from
8739 FeatureIsNotStandardized, because it was about the language level
8740 (1 vs 2) it was not about standarization.
8742 (FeatureRequiresLINQ): New.
8744 * support.cs (SeekableStreamReader): Only require that the reader
8745 is a TextReader, not a StreamReader, so we can plug StringReader.
8747 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
8748 given position in the input stream the following tokens can be
8749 parsed as a type followed by an identifier.
8751 (is_punct): after a '(' if parse_type_and_parameter returns true,
8752 then return a special token OPEN_PARENS_LAMBDA which is used to
8753 avoid reduce/reduce errors in the grammar for the
8754 lambda_expression rules.
8756 (parse_type): implement a type parser inside the
8757 tokenizer, the parser only returns true or false depending on
8758 whether the input at a given position can be parsed as a type.
8760 (peek_token): new method used during type parsing.
8762 2007-01-28 Raja R Harinath <rharinath@novell.com>
8765 * anonymous.cs (ScopeInfo.InflateParameters): New.
8766 (AnonymousContainer.Resolve): Use it to redirect types of
8767 delegate parameters.
8769 2007-01-27 Raja R Harinath <rharinath@novell.com>
8772 * expression.cs (Error_InvalidArguments): Don't use two different
8773 messages for CS1503. Use ExtraInformation and
8774 SymbolRelatedToPreviousError instead.
8777 * decl.cs (DeclSpace.initialize_type_params): Don't access
8778 'type_params' of a partial class directly.
8780 2007-01-26 Miguel de Icaza <miguel@novell.com>
8782 * constant.cs: Removed a handful of out-of-range checks that were
8785 2007-01-25 Marek Safar <marek.safar@gmail.com>
8787 * expression.cs (CheckUselessComparison): Add additional check for char
8790 * namespace.cs: Fixed typo.
8792 2007-01-23 Miguel de Icaza <miguel@novell.com>
8794 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
8795 gone, instead we inline the test, preventing the needless casts to
8796 longs, ulongs and doubles for the parameters, avoiding calls to
8797 methods that overchecked stuff, and instead inlined things
8800 2007-01-20 Marek Safar <marek.safar@gmail.com>
8802 * cs-parser.jay: Better parameter error handling.
8804 2007-01-17 Marek Safar <marek.safar@gmail.com>
8806 A fix for bug #80368, #80522
8807 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
8808 whether array initializer contains constants only.
8809 (ArrayCreation.Emit): Use better formula to decide when
8810 are array initializers for static initialization.
8811 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
8812 have to emit even constants otherwise they are pre-initialized.
8814 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
8815 Raja R Harinath <rharinath@novell.com>
8817 Fix emit order of 'get' vs. 'set'.
8818 * support.cs (Accessors): New.
8819 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
8820 Note the order in which accessors are declared in the source.
8821 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
8822 Refactored from Property.Define and Indexer.Define.
8823 (PropertyBase.DefineAccessors): New helper that calls the above in
8824 appropriate order as noted by the parser.
8825 (Property.Define, Indexer.Define): Update to changes.
8826 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
8828 2007-01-17 Raja R Harinath <rharinath@novell.com>
8830 Fix cs0029-6.cs and gcs0029-2.cs (regression)
8831 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
8832 there's an implicit conversion from the current type to the target
8833 type before converting the underlying constant.
8835 2007-01-16 Marek Safar <marek.safar@gmail.com>
8837 * const.cs (ResolveValue): Updated after constant conversion was made more
8840 * constant.cs (GetAttributableValue): constant to object conversion is
8841 used for attributes only.
8842 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
8843 constant conversions.
8844 (LongConstant.ConvertImplicitly): Ditto.
8846 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
8847 (ImplicitConversionStandard): Handle constant conversion as extra step.
8848 It solves the issue when constant conversion was called indirectly like
8849 inside array initializer and constant folding was skipped.
8851 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
8854 * statement.cs(ImplicitConversionStandard): Updated after constant
8855 conversion was made more generic.
8857 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
8859 * expression.cs (As.DoResolve): Use GenericConstraints instead of
8860 Constraints, solves the problem where the compiler incorrectly
8861 reported that a type parameter was not constrained to a class (Bug
8864 2007-01-14 Marek Habersack <grendello@gmail.com>
8866 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
8868 2007-01-14 Marek Safar <marek.safar@gmail.com>
8870 A fix for bug #80368
8871 * assign.cs (FieldInitializer): New class implements field
8872 initializer statement.
8874 * attribute.cs: Update after FieldMember rename.
8876 * class.cs (PropertyBasedMember): New common class for property based
8878 (InterfaceMemberBase): New base class for all members which can be used as
8879 an interface members.
8880 (MethodCore): Moved really common code to InterfaceMemberBase.
8881 (Method.Define): Equal and GetHasCode detection is relevant for methods
8883 (MethodData.Define): Don't assume that public event implements an
8884 interface automatically.
8885 (MethodData.DefineMethodBuilder): Issue an error even if only extern
8887 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
8888 (FieldMember): Merged with FieldBase.
8889 (EventProperty.AEventPropertyAccessor): New specialization to check whether
8890 event extern modifier can be used.
8891 (EventField.EventFieldAccessor): Moved event field specific code here.
8892 (Event.AllowedModifiers): Even event can be extern.
8893 (Event.FindOutBaseMethod): New override specific to events.
8894 (Indexer.parameters): Reintroduce parameters because base class holds
8895 only properties common data.
8896 (Indexer.CheckForDuplications): Indexers are threated as methods so we
8897 need do extra parameters check.
8899 * const.cs: Update after FieldMember rename.
8901 * decl.cs (MemberCache.FindBaseEvent): New method.
8903 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
8904 to reflect that indexer is now derived from PropertyBased.
8906 * ecore.cs (GetMemberType): Made public.
8907 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
8910 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
8912 * typemanager.cs (CSharpSignature): Correctly print event accessors.
8913 (RegisterEvent): Removed.
8914 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
8915 (GetPrivateFieldOfEvent): Renamed to GetEventField.
8917 2007-01-11 Raja R Harinath <rharinath@novell.com>
8920 * statement.cs (CollectionForeach.TryType): Prefer generic
8921 GetEnumerator over non-generic variant. Fix code to follow comments.
8923 2007-01-09 Raja R Harinath <rharinath@novell.com>
8926 * support.cs (ReflectionParameter): Don't use an invalid index on
8927 the generic parameter data.
8929 2007-01-08 Miguel de Icaza <miguel@novell.com>
8931 * driver.cs: Just add a tiny bit of infrastructure.
8933 2007-01-02 Marek Safar <marek.safar@gmail.com>
8935 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
8936 where field type is struct from current assembly.
8938 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
8941 2007-01-02 Marek Safar <marek.safar@gmail.com>
8943 A fix for bug #80381
8944 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
8947 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
8949 (Namespace.LookupType): Always use core types from corlib when speficied.
8951 * report.cs: A new warning.
8953 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
8954 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
8955 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
8957 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
8958 (InitCoreTypes): Set expression type of object_type and value_type
8959 immediately after lookup.
8961 2007-01-01 Miguel de Icaza <miguel@novell.com>
8963 * cs-tokenizer.cs: Accept Pc class characters (Connector
8964 Punctuation) as valid identifiers. Fixes #78259
8966 * expression.cs (Invocation.DoResolve): Moved the check for the
8967 use of `this' for doing method calls to the Invocation resolution
8968 step, after overload resolution has taken place instead of doing
8969 the check at the low-level `This.DoResolve' level.
8971 The `This.DoResolve'(appens before overload resolution, so it has
8972 no way of knowing if the method that will be called will be
8973 instace or static, triggering an erroneous report for cs0188 (Bug
8976 We now do the check for instance method invocations after we know
8977 what method will be called.
8979 (This.CheckThisUsage): Move the actual use of this structure
8980 checking into its own method and expose it.
8982 * Everywhere that called Error_ValueCannotBeConverted: pass a new
8985 Exceptions: Null.ConvertImplicitly,
8986 Constant.ImplicitConversionRequired as there are too many call
8987 sites for passing the ec.
8989 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
8990 EmitContext, if the value is null, then we do not try to provide
8991 the extra information from the error (If a userdefined conversion
8992 exists, as UserDefinedConversion requires a non null-EmitContext).
8996 2006-12-30 Raja R Harinath <rharinath@novell.com>
8998 * flowanalysis.cs (MyBitVector): Document some invariants.
8999 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
9000 introduced below, and add a couple of others,
9002 2006-12-30 Marek Safar <marek.safar@gmail.com>
9004 * attribute.cs (GetMethodObsoleteAttribute): Uses new
9005 GetPropertyFromAccessor and GetEventFromAccessor.
9007 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
9008 overrides non-obsolete one.
9009 (Indexer.Define): Error message has been moved to the parser.
9011 * cs-parser.jay: Better syntax errors handling.
9013 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
9014 when an invocation has no arguments.
9016 * ecore.cs: Removed not used caching.
9018 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
9021 * report.cs: Add a new warning.
9023 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
9025 * typemanager.cs (enumeration_type): Removed.
9026 (CSharpSignature): Reuses IsSpecialMethod.
9027 (IsEqual): Hack for MS BCL.
9028 (GetPropertyFromAccessor): New method.
9029 (GetEventFromAccessor): New method.
9030 (IsSpecialMethod): Fixed to handle more cases.
9032 2006-12-30 Marek Safar <marek.safar@gmail.com>
9034 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
9035 Made white spaces array static.
9037 * ecore.cs (RemoveGenericArity): Optimized.
9039 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
9041 (MyBitVector.initialize_vector): Simplified.
9043 2006-12-22 Miguel de Icaza <miguel@novell.com>
9045 * ecore.cs: Am not entirely happy with this hack, but it seems to
9046 address the issue in 80257 (a small test case for
9049 I set the MethodGroupExpr.Type to an internal compiler type
9050 (itself in this case) to force the resolution to take place. Why
9051 it does not take place with a null is beyond me.
9053 2006-12-20 Marek Safar <marek.safar@gmail.com>
9055 A fix for bug #80288
9056 * expression.cs (ResolveOperator): Consider user defined conversion for
9057 logical and operator too.
9058 (EmitBranchable): Optimization for logical and when full constant folding
9059 could not be applied but one operand is constant.
9061 2006-12-19 Marek Safar <marek.safar@gmail.com>
9063 * class.cs (GetClassBases): Write 5 times every day, will never use
9064 FullName for error reporting.
9066 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
9068 2006-12-19 Martin Baulig <martin@ximian.com>
9070 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
9071 the symbol file info here.
9073 2006-12-18 Marek Safar <marek.safar@gmail.com>
9075 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
9076 of `elseif' is taking then following sections are not taking.
9077 Fixes an issue reported on mono mailing list.
9079 2006-12-18 Marek Safar <marek.safar@gmail.com>
9081 A fix for bug #80300
9082 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
9083 a caller is not taking.
9085 2006-12-18 Raja R Harinath <rharinath@novell.com>
9087 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
9088 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
9089 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
9090 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
9091 * class.cs: Update to changes.
9093 2006-12-17 Marek Safar <marek.safar@gmail.com>
9095 A fix for bug #79934
9096 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
9099 * class.cs (ResolveMembers): Register an iterator in current container and
9102 2006-12-16 Raja R Harinath <rharinath@novell.com>
9105 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
9106 satisfy a params annotated parameter.
9108 2006-12-16 Marek Safar <marek.safar@gmail.com>
9110 A fix for bug #77014
9111 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
9112 paramters correctly and not rely on hacks in Parameters class.
9113 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
9115 (Invocation.VerifyArgumentsCompat): Ditto.
9116 (Invocation.EmitArguments): Changed to correctly emit params arguments at
9119 * parameter.cs (HasParams): Don't assume that params is the last one.
9121 * support.cs (ReflectionParameters.ctor): Look for params attribute
9123 (ReflectionParameters.ParameterType): Removed hack when we returned last
9124 parameter for out of range parameters.
9125 (ParameterName, ParameterModifier): Ditto.
9127 2006-12-14 Marek Safar <marek.safar@gmail.com>
9129 A fix for bug #79987
9130 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
9131 when assembly is not CLS compliant but type is. I have no idea why is this
9134 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
9136 2006-12-13 Miguel de Icaza <miguel@novell.com>
9138 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
9139 in struct constructors, they are basically no-ops.
9141 2006-12-12 Marek Safar <marek.safar@gmail.com>
9143 * cs-tokenizer.cs (Position): Save preprocessor status too.
9145 2006-12-12 Marek Safar <marek.safar@gmail.com>
9147 A fix for bug #77794
9148 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
9150 2006-12-12 Marek Safar <marek.safar@gmail.com>
9152 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
9154 (pp_expr): Report error for an invalid expression.
9155 (handle_preprocessing_directive): Simplified; add more error checking.
9157 2006-12-11 Marek Safar <marek.safar@gmail.com>
9159 A fix for bug #74939
9160 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
9161 directives handling.
9163 2006-12-10 Marek Safar <marek.safar@gmail.com>
9165 A fix for bugs #80093, and #75984
9166 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
9167 logic, it seems to me as it worked before "by coincidence".
9168 (xtoken): Simplified to use reworked handle_preprocessing_directive.
9169 (cleanup): Enabled endif check.
9171 2006-12-09 Marek Safar <marek.safar@gmail.com>
9173 A fix for bug #80162
9174 * statement.cs (CollectionForeach.TryType): Generics and non-generics
9175 enumerators are never ambiguous.
9177 2006-12-08 Raja R Harinath <rharinath@novell.com>
9180 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
9182 2006-12-06 Marek Safar <marek.safar@gmail.com>
9184 A fix for bug #80144
9185 * class.cs (EventProperty.Define): Explicit implementation means
9186 that an even is used.
9188 2006-12-06 Marek Safar <marek.safar@gmail.com>
9190 Fixes the operators implementation (part II)
9192 * cfold.cs (DoConstantNumericPromotions): Renamed to
9193 DoBinaryNumericPromotions and simplified.
9194 (BinaryFold): Couple of conversion fixes; simplified.
9196 * constant.cs, ecore.cs, literal.cs
9197 (ToType): Renamed to ConvertImplicitly.
9198 (Reduce): Renamed to ConvertExplicitly.
9200 * class.cs, convert.cs: Updated.
9202 * expression.cs: TryReduce doesn't throw an exception.
9204 2006-12-01 Marek Safar <marek.safar@gmail.com>
9206 A fix for bug #80108
9207 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
9210 2006-11-30 Marek Safar <marek.safar@gmail.com>
9212 Fixes unary operators implementation (part I)
9215 * cfold.cs (Error_CompileTimeOverflow): Made internal
9217 * const.cs (IConstant): Changed to use reference to constant and
9218 not constant itself.
9219 Updated IConstant implementations.
9221 * constant.cs (CreateConstant): New factory method.
9222 Updated IConstant implementation.
9224 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
9226 * ecore.cs: Updated to use CreateConstantReference.
9228 * enum.cs: Reflects IConstant changes.
9230 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
9232 * literal.cs (NullConstant): Change to be independently usable.
9234 2006-11-29 Martin Baulig <martin@ximian.com>
9236 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
9237 we need to emit the scope initializer before calling the base .ctor.
9239 * anonymous.cs: Merged back from the new anonymous methods branch.
9240 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
9242 * expression.cs (ParameterReference.DoResolveBase): Create a
9243 "normal" ScopeInfo when capturing parameters rather than using the
9244 root scope; this makes things work with anonymous methods having
9248 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
9250 2006-11-22 Marek Safar <marek.safar@gmail.com>
9252 A fix for bug #79987
9253 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
9254 check to a base class.
9255 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
9256 only when assembly has missing attribute.
9257 * report.cs: Update.
9259 2006-11-21 Marek Safar <marek.safar@gmail.com>
9261 * cs-tokenizer.cs: Merged with gmcs version.
9263 2006-11-20 Marek Safar <marek.safar@gmail.com>
9266 * cs-parser.jay: Better error message when partial keyword is misplaced.
9268 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
9270 A fix for bug #79810
9271 report.cs: CS1058 only applies to 2.0 profile (gmcs).
9272 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
9273 a RuntimeWrappedException by default.
9275 2006-11-18 Marek Safar <marek.safar@gmail.com>
9277 A fix for bug #79843
9278 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
9280 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
9282 2006-11-18 Marek Safar <marek.safar@gmail.com>
9284 * driver.cs, namespace.cs: Uses faster IndexOf version.
9286 2006-11-17 Marek Safar <marek.safar@gmail.com>
9288 A fix for bug #79941
9289 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
9291 (Operator.Define): Implicit/Explicit operator of same type is duplicate
9292 even if internal name is different.
9293 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
9294 (UserDefinedConversion): Simplified as the operators cannot be internal.
9295 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
9297 (MethodLookup): Replaced EmitContext with parentType.
9298 * expression.cs: Updated.
9300 2006-11-09 Raja R Harinath <rharinath@novell.com>
9302 * driver.cs (BadAssembly): Handle all the ugliness of
9303 DefineDynamicAssembly.
9305 2006-11-08 Raja R Harinath <rharinath@novell.com>
9307 Address parts of #58244 -- most of what's left is in the runtime
9308 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
9309 CS1509 error checks, and handle them for all assembly loads, not
9310 just the first invocation.
9311 (LoadModule): Likewise. Move handling of 'adder_method' ...
9312 * codegen.cs (AssemblyClass.AddModule): ... here.
9314 2006-11-02 Marek Safar <marek.safar@gmail.com>
9316 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
9317 IEnumerable<T> is ambiguous.
9319 2006-10-31 Marek Safar <marek.safar@gmail.com>
9321 A fix for bug #67689
9322 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
9323 GetEnumerator is ambiguous.
9325 * report.cs: Add new warning.
9327 2006-10-29 Marek Safar <marek.safar@gmail.com>
9329 A fix for bug #78602
9330 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9331 to protected member can be nested type.
9333 2006-10-28 Marek Safar <marek.safar@gmail.com>
9335 A fix for bug #78965
9336 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9337 to protected member must derive from current type.
9339 2006-10-27 Marek Safar <marek.safar@gmail.com>
9341 assign.cs: Reuses error method.
9343 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
9344 instead of type for constants.
9345 (Expression.Error_ValueAssignment): Common error method.
9347 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
9350 2006-10-27 Marek Safar <marek.safar@gmail.com>
9352 A fix for bug #79081
9353 * expression.cs (MemberAccess.DoResolve): Check nested type
9356 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
9358 * doc.cs : nested delegates were not handled. Fixed bug #79754.
9360 2006-10-26 Marek Safar <marek.safar@gmail.com>
9362 A fix for bug #76591
9363 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
9365 2006-10-26 Marek Safar <marek.safar@gmail.com>
9367 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
9368 type forwarder of the same type multiple times.
9370 2006-10-26 Raja R Harinath <rharinath@novell.com>
9373 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
9374 instance as an rvalue, even when we later resolve as an lvalue.
9376 2006-10-25 Martin Baulig <martin@ximian.com>
9378 * anonymous.cs: Fix #79673.
9380 2006-10-24 Marek Safar <marek.safar@seznam.cz>
9382 A fix for bug #79666
9383 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
9384 ignored when is optimized (= default value) as its value is already set.
9386 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9388 A fix for bug #79724
9389 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
9390 TypeContainer for type lookup.
9392 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9394 A fix for bug #79231
9395 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
9396 * expression.cs (OverloadResolve): Always convert type name for
9398 (ResolveNamespaceOrType): Don't confuse a nested type with any
9401 2006-10-18 Martin Baulig <martin@ximian.com>
9403 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
9405 2006-10-17 Miguel de Icaza <miguel@novell.com>
9407 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
9408 an int32, but requesting an int64 from the conversion
9410 2006-10-12 Martin Baulig <martin@ximian.com>
9413 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
9415 2006-10-12 Martin Baulig <martin@ximian.com>
9418 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
9420 2006-10-11 Miguel de Icaza <miguel@novell.com>
9422 * convert.cs: Remove broken code: I was doing the "Existance"
9423 tests for Implicit conversions.
9425 2006-10-10 Miguel de Icaza <miguel@novell.com>
9427 * convert.cs: Added one missing case in
9428 ImplicitStandardConversionExists uint64 to intptr.
9432 * typemanager.cs (uintptr_type): another core known type.
9434 * ecore.cs (OperatorCast): routine used to do cast operations that
9435 depend on op_Explicit. We could change some of the Decimal
9436 conversions to use this.
9438 This one has a probe mechanism that checks both types for an op_
9439 which it coudl be used to eliminate two classes: CastToDecimal
9440 and CastFromDecimal.
9442 * convert.cs: Implement the conversions documented in #59800
9444 2006-10-10 Martin Baulig <martin@ximian.com>
9446 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
9447 before RootScope.ResolveMembers().
9449 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
9450 `CurrentType' if appropriate.
9452 2006-10-09 Marek Safar <marek.safar@seznam.cz>
9454 A fix for bug #78568
9455 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
9456 when contains binary operators.
9457 * cs-parser.jay: Updated.
9459 2006-10-09 Martin Baulig <martin@ximian.com>
9462 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
9463 moved that into Define() and also do the other type parameter
9464 checks there. Fixes #79094. Added gtest-292.cs.
9467 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
9468 since that doesn't include type parameters; don't use `Ldelema'
9469 for type parameters. Fixes #78980. Added gtest-293.cs.
9471 2006-10-08 Marek Safar <marek.safar@seznam.cz>
9474 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
9475 conversion is allowed.
9477 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9479 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
9480 error reporting when no error occurs.
9482 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9484 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
9487 2006-10-06 Raja R Harinath <rharinath@novell.com>
9490 * class.cs (DefineTypeBuilder): Check circular dependencies before
9491 setting the parent of the TypeBuilder.
9492 (CheckRecursiveDefinition): Don't use 'BaseType', since
9493 it may not be valid until after DefineTypeBuilder. Use
9494 'base_type' instead.
9496 2006-10-04 Martin Baulig <martin@ximian.com>
9498 Merged the Anonymous Methods patch.
9500 * anonymous.cs, iterators.cs: The new anonymous methods code.
9502 * statement.cs (Variable): New public abstract class.
9503 (LocalInfo.Variable): New public property.
9504 (LocalInfo.ResolveVariable): New public method.
9505 (Block.Flags): Add `IsIterator'.
9506 (Block.AddVariable): Improved the CS0136 check.
9507 (Block.AnonymousChildren): New public property.
9508 (Block.AddAnonymousChild): New public method.
9509 (ToplevelBlock): Update to use the new anonymous method framework.
9510 (ToplevelBlock.ctor): `container' is now a `Block' and not a
9511 `ToplevelBlock'; this is required to correctly implement the
9513 (Fixed, Using): Use `TemporaryVariable' instead of directly
9514 creating the `LocalBuilder'.
9516 * parameter.cs (Parameter.ResolveVariable): New public method.
9517 (Parameters.ResolveVariable): Likewise.
9519 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
9521 * class.cs (TypeContainer): Replaced the `iterators' list and
9522 corresponding methods with a list of `CompilerGeneratedClass'es.
9523 (TypeContainer.ResolveMembers): New public method.
9524 (Method): `IIteratorContainer' has been replaced by
9527 * expression.cs (VariableReference): New public abstract base
9528 class for `LocalVariableReference', `ParameterReference' and
9531 * codegen.cs (EmitContext): Removed `capture_context',
9532 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
9533 (EmitContext.EmitThis): Removed.
9535 * cs-parser.jay: Replace `iterator_container' with
9538 2006-10-04 Martin Baulig <martin@ximian.com>
9540 * generic.cs (GenericMethod): Don't make this abstract.
9541 (Constraints.Clone): Added dummy implementation.
9543 2006-10-04 Raja R Harinath <harinath@gmail.com>
9546 * namespace.cs (LookForAnyGenericType): Avoid nullref on
9547 'declspaces'. Avoid allocating arrays willy-nilly.
9550 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
9551 cases out of the switch.
9553 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9555 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
9556 message when non-generic type is used with the type arguments.
9557 * expression.cs: Updated.
9559 2006-09-28 Raja R Harinath <rharinath@novell.com>
9562 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
9563 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9564 Change semantics slightly. Don't insist on having only one
9565 temporary EmptyExpression -- just throttle the creation of new ones.
9568 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
9569 non-interfaces too. If no methods are found, don't try to create
9572 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9574 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
9577 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
9578 us produce better error message.
9580 2006-09-27 Marek Safar <marek.safar@seznam.cz>
9582 * expression.cs (Binary.ResolveOperator): Warn about a side effect
9583 of the `|' operator.
9585 * report.cs: A new warning added.
9587 2006-09-27 Martin Baulig <martin@ximian.com>
9589 * generic.cs (GenericMethod): Don't make this abstract.
9591 2006-09-27 Martin Baulig <martin@ximian.com>
9594 (InternalErrorException): Added overloaded ctor taking a params array.
9596 2006-09-26 Marek Safar <marek.safar@seznam.cz>
9598 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
9599 Fixed the cases when same error was reported twice.
9601 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
9602 now report symbol information.
9604 2006-09-25 Martin Baulig <martin@ximian.com>
9606 * class.cs: Completely unified with the gmcs version.
9608 2006-09-25 Martin Baulig <martin@ximian.com>
9610 * typemanager.cs (TypeManager.IsNullableType): New public function.
9611 (TypeManager.IsNullableTypeOf): Likewise.
9612 (TypeManager.IsNullableValueType): Likewise.
9614 * class.cs (MethodCore): Added the `GenericMethod' argument from
9615 gmcs and also unified all classes derived from `MethodCore' with gmcs.
9617 2006-09-24 Raja R Harinath <harinath@gmail.com>
9619 * convert.cs: Unify with gmcs version.
9621 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9623 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
9624 verify them as well.
9626 * report.cs: New warning.
9628 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9630 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
9631 for anonymous block with out argument.
9633 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9635 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
9636 not used private events only.
9638 2006-09-23 Marek Safar <marek.safar@seznam.cz>
9640 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
9642 * const.cs (Const.Define): Check for constant type.
9643 (Const.IsConstantTypeValid): Looks for valid constant types.
9645 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
9647 * ecore.cs (EmptyConstantCast): New common class for all constant based
9650 * expression.cs (Is.DoResolve): Handle null constant especially.
9651 (New.DoResolve): Check for new void().
9652 (MemberAccess.DoResolve): Cope with all kind of nulls.
9654 * literal.cs (NullConstant): Uses EmptyConstantCast.
9655 (NullDefault): Based on EmptyConstantCast.
9656 (NullLiteral): Uses EmptyConstantCast.
9658 * statement.cs (Block.ResolveMeta): Check for constant type.
9660 2006-09-22 Martin Baulig <martin@ximian.com>
9662 * delegate.cs, attribute.cs: Merged with the gmcs versions.
9664 2006-09-22 Raja R Harinath <rharinath@novell.com>
9666 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
9670 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
9671 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
9674 2006-09-22 Martin Baulig <martin@ximian.com>
9676 * ecore.cs: Merged with the gmcs version.
9678 * generic.cs (ConstructedType): New dummy class.
9679 (TypeArguments): Don't make this abstract.
9682 (TypeManager.IsGenericTypeDefinition): New method.
9683 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
9685 2006-09-22 Raja R Harinath <rharinath@novell.com>
9687 * expression.cs (ComposedCast): Check for arrays of TypedReference
9688 before creating the type, not after.
9690 2006-09-21 Marek Safar <marek.safar@seznam.cz>
9692 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
9693 after ToType change.
9695 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
9696 when constant must be implicitly convertible.
9698 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
9700 * ecore.cs (NullCast): Derives from NullConstant.
9702 * expression.cs (Is.DoResolve): Removed useless variables.
9703 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
9704 (New.Constantify): Add enum support.
9705 (MemberAccess.DoResolve): Add warning when accessing null constant or
9708 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
9711 * literal.cs (NullConstant): New abstract class with common
9712 functionality for all null specializations.
9713 (NullDefault): Represents default(X) when result can be
9715 (NullLiteral): Updated.
9717 * report.cs: Add new warning.
9719 2006-09-21 Martin Baulig <martin@ximian.com>
9721 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
9723 2006-09-21 Martin Baulig <martin@ximian.com>
9725 * generic.cs (GenericConstraints): New dummy class.
9726 (Constraints): Likewise.
9727 (TypeParameter): Likewise.
9728 (TypeParameterName): Likewise.
9729 (GenericMethod): Likewise.
9731 * typemanager.cs (TypeManager.GetGenericArguments): New method.
9733 * decl.cs: Merged with the gmcs version.
9735 2006-09-21 Raja R Harinath <rharinath@novell.com>
9737 * generic.cs (TypeParameter): Implement IMemberContainer.
9738 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
9740 * rootcontext.cs: Unify with gmcs version.
9742 * report.cs: Unify with gmcs version.
9743 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
9744 from gmcs/generics.cs.
9745 * generics.cs (TypeParameter): New dummy class.
9747 * support.cs: Unify with gmcs version.
9749 2006-09-20 Raja R Harinath <rharinath@novell.com>
9751 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
9752 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
9754 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
9755 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
9756 * mcs.exe.sources: Add generic.cs.
9758 * codegen.cs: Unify with gmcs version.
9760 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
9761 (EmitContext): Add GenericDeclContainer implementation.
9762 * decl.cs (MemberCore, DeclSpace): Likewise.
9763 * namespace.cs: Remove #ifdef GMCS_SOURCE.
9765 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
9766 MCS TypeManager has a corresponding dummy method.
9768 2006-09-19 Martin Baulig <martin@ximian.com>
9770 * expression.cs: Completely merged with the gmcs version.
9772 2006-09-19 Martin Baulig <martin@ximian.com>
9774 * expression.cs (Invocation): Merged with the gmcs version.
9775 (ArrayAccess.GetStoreOpcode): Likewise.
9777 2006-09-19 Martin Baulig <martin@ximian.com>
9780 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
9781 (TypeManager.IsGenericMethodDefinition): Likewise.
9783 2006-09-19 Martin Baulig <martin@ximian.com>
9786 (TypeManager.IsEqual): Moved the gmcs implementation here.
9787 (TypeManager.DropGenericTypeArguments): Likewise.
9788 (TypeManager.DropGenericMethodArguments): Likewise.
9789 (TypeManager.GetTypeArguments): Moved here from gmcs.
9790 (TypeManager.HasGenericArguments): Likewise.
9792 2006-09-19 Martin Baulig <martin@ximian.com>
9794 * expression.cs (Binary): Merged with the gmcs version.
9796 2006-09-19 Martin Baulig <martin@ximian.com>
9798 * expression.cs (Probe, As, Is): Merged with the gmcs version.
9800 2006-09-19 Martin Baulig <martin@ximian.com>
9802 * typemanager.cs: Merged with the gmcs version.
9804 2006-09-16 Raja R Harinath <rharinath@novell.com>
9806 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
9807 * driver.cs: Likewise.
9809 2006-09-16 Marek Safar <marek.safar@seznam.cz>
9812 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
9813 only if parent type is class.
9814 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
9817 2006-09-15 Marek Safar <marek.safar@seznam.cz>
9820 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
9822 * typemanager.cs(CSharpName): Converts NullType to null.
9824 2006-09-15 Martin Baulig <martin@ximian.com>
9827 (TypeManager.GetMethodName): Added mcs implementation.
9828 (TypeManager.IsEqual): Likewise.
9831 (SimpleName.RemoveGenericArity): Added dummy implementation.
9833 * pending.cs: Merged with the gmcs version.
9835 2006-09-15 Martin Baulig <martin@ximian.com>
9837 * statement.cs: Merge with the gmcs version.
9839 2006-09-15 Martin Baulig <martin@ximian.com>
9841 * statement.cs (Switch): Merge with the gmcs implementation
9842 (without nullables), which is newer.
9844 2006-09-15 Martin Baulig <martin@ximian.com>
9846 * statement.cs (Block.Variables): Make this public.
9847 (ToplevelBlock.Parameters): Make this a property.
9848 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
9850 2006-09-15 Martin Baulig <martin@ximian.com>
9852 * namespace.cs: Merge with the gmcs version.
9854 2006-09-15 Martin Baulig <martin@ximian.com>
9856 * decl.cs (MemberName): Minor code cleanups.
9858 2006-09-15 Martin Baulig <martin@ximian.com>
9860 * parameter.cs: Merge with the gmcs version.
9862 2006-09-15 Martin Baulig <martin@ximian.com>
9864 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
9865 and an error in mcs.
9867 2006-09-15 Martin Baulig <martin@ximian.com>
9869 * flowanalysis.cs: Merged from GMCS; added the generics code into
9870 a `GMCS_SOURCE' conditional so we can share this file.
9872 2006-09-08 Martin Baulig <martin@ximian.com>
9874 * typemanager.cs (TypeManager.interlocked_type): New public field.
9875 (TypeManager.int_interlocked_compare-exchange): New public field.
9876 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
9877 enumerator types here and call InitGenericCoreTypes().
9878 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
9879 after calling InitEnumUnderlyingTypes().
9882 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
9883 `classes_second_stage'.
9885 2006-09-14 Marek Safar <marek.safar@seznam.cz>
9887 * assign.cs, ecore.cs, expression.cs: Share error message text.
9888 * class.cs (FieldMember.Define): Check for varible of static type.
9889 * driver.cs (LoadAssembly): Uses error output for errors.
9890 * statement.cs: Updated.
9892 2006-09-08 Marek Safar <marek.safar@seznam.cz>
9894 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
9897 2006-09-07 Martin Baulig <martin@ximian.com>
9900 (MainDriver): Revert r62663 from Marek; see #70506 for details.
9902 2006-08-29 Miguel de Icaza <miguel@novell.com>
9904 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
9906 2006-08-17 Miguel de Icaza <miguel@novell.com>
9908 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
9909 #52019 and #79064, the use of the \uXXXX sequence in source code
9910 to represent unicode characters.
9912 2006-08-15 Marek Safar <marek.safar@seznam.cz>
9914 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
9916 * class.cs, ecore.cs, statement.cs: Merged to one error message.
9918 2006-08-13 Miguel de Icaza <miguel@novell.com>
9920 * assign.cs: Catch attempts to assign to a method groups in += and
9923 2006-08-13 Marek Safar <marek.safar@seznam.cz>
9926 * cs-parser.jay: Don't destroy current array type by typeof of array's.
9928 2006-08-12 Marek Safar <marek.safar@seznam.cz>
9930 * class.cs (Method.Define): Issue a warning when generic method looks like
9932 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
9935 2006-08-09 Marek Safar <marek.safar@seznam.cz>
9937 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
9939 * decl.cs (MemberCache.FindMembers): When container is interface we need to
9940 search all base interfaces as a member can be ambiguous.
9941 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
9942 Constructor member type filter.
9943 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
9944 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
9945 reporting for returned memberinfos.
9946 * report.cs: Updated.
9947 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
9948 version to work on all runtimes.
9949 (TypeManager.RealMemberLookup): Removed members filtering.
9951 2006-08-08 Raja R Harinath <rharinath@novell.com>
9953 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
9954 (PropertyExpr.EmitAssign): Likewise.
9955 * expression.cs (Indirection.EmitAssign): Likewise.
9956 (LocalVariableReference.EmitAssign): Likewise.
9957 (ParameterReference.EmitAssign): Likewise.
9958 (Invocation.EmitArguments): Likewise.
9959 (ArrayAccess.EmitAssign): Likewise.
9960 (IndexerAccess.EmitAssign): Likewise.
9961 (This.EmitAssign): Likewise.
9962 (ConditionalLogicalOperator.Emit): Likewise.
9965 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
9966 instead of ArrayList. If the hashtable has a LocalBuilder, don't
9967 leave it in after returning it.
9968 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
9970 2006-08-06 Marek Safar <marek.safar@seznam.cz>
9972 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
9975 2006-08-03 Raja R Harinath <rharinath@novell.com>
9977 Fix cs0146-3.cs and cs0146-4.cs.
9978 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
9979 enclosing types don't depend on the current type.
9981 2006-08-02 Raja R Harinath <rharinath@novell.com>
9984 * class.cs (TypeContainer.DoDefineMembers): Use
9985 FindBaseMemberWithSameName on Parent, since we're interested in
9986 whether we hide inherited members or not.
9987 (FindBaseMemberWithSameName): Make slightly more robust.
9989 Fix the non-generic testcase from #77396
9990 * decl.cs (DeclSpace.DeclContainer): Remove override.
9992 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
9993 declspaces for doppelgangers too.
9994 (UsingEntry): Implement IResolveContext.
9995 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
9996 'this' as the resolve context.
9997 (LocalAliasEntry): Likewise.
9999 Implement parts of #77403
10000 * roottypes.cs (RootDeclSpace): New. Used to represent the
10001 toplevel declaration space. Each namespace declaration introduces
10002 a "partial" root declaretion space.
10003 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
10004 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
10005 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
10006 from 'current_namespace.SlaveDeclSpace'.
10007 (namespace_declaration): Likewise.
10008 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
10009 check. It can't happen now.
10010 * decl.cs (DeclSpace.LookupType): Likewise.
10011 * driver.cs (MainDriver): Sanity check.
10013 2006-08-01 Raja R Harinath <rharinath@novell.com>
10015 * decl.cs (DeclSpace.FindNestedType): Remove.
10016 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
10017 LookupTypeContainer to get the container of the nested type.
10018 * class.cs (TypeContainer.FindNestedType): Make non-override.
10020 2006-07-31 Raja R Harinath <rharinath@novell.com>
10022 * decl.cs (DeclSpace.PartialContainer): Move field from ...
10023 * class.cs (TypeContainer.PartialContainer): ... here.
10024 (TypeContainer.AddBasesForPart): New helper.
10025 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
10027 * cs-parser.jay (current_class): Convert to DeclSpace.
10028 (struct_declaration, interface_declaration, class_declaration):
10029 Use AddBasesForPart instead of .Bases directly.
10030 * const.cs, iterators.cs: Update to changes.
10032 2006-07-28 Raja R Harinath <rharinath@novell.com>
10034 * class.cs (TypeContainer.AddMemberType): Rename from
10035 AddToTypeContainer.
10036 (TypeContainer.AddMember): Rename from AddToMemberContainer.
10037 (AddTypeContainer): New. Combine AddClassOrStruct and
10039 (AddPartial): Update. Add 'is_partial' argument.
10040 * roottypes.cs: Update to changes.
10041 * cs-parser.jay (push_current_class): New helper for handling
10042 current_container and current_class.
10043 (struct_declaration, interface_declaration, class_declaration):
10046 2006-07-26 Raja R Harinath <rharinath@novell.com>
10048 * roottypes.cs: Rename from tree.cs.
10050 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
10051 * tree.cs (Tree, ITreeDump): Remove types.
10052 * rootcontext.cs (tree, Tree): Remove fields.
10053 (root, ToplevelTypes): New.
10054 * *.cs: Update to rename.
10056 * tree.cs (Tree.RecordDecl): Remove.
10057 (RootTypes.AddToTypeContainer): Record the toplevel type in its
10059 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
10061 2006-07-23 Raja R Harinath <harinath@gmail.com>
10063 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
10064 DoFlowAnalysis and OmitStructFlowAnalysis here.
10065 (ec.With): Rename from WithUnsafe and generalize.
10066 (ec.WithCheckState): Remove. All users can be handled by 'With'.
10067 (ec.WithFlowAnalyis): New.
10068 * ecore.cs, expression.cs, statement.cs: Update.
10070 2006-07-22 Raja R Harinath <harinath@gmail.com>
10072 * statement.cs (Block.ResolveMeta): Simplify slightly.
10074 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
10075 multiple boolean fields. Convert InUnsafe, constant_check_state,
10076 check_state to flags.
10077 (CheckState, ConstantCheckState): Update.
10078 (InUnsafe): New read-only property.
10079 (FlagsHandle): Rename from CheckStateHandle and convert to handle
10081 (WithUnsafe): New helper similar to WithCheckState.
10082 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
10083 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
10085 2006-07-21 Raja R Harinath <rharinath@novell.com>
10087 Make comparisons use the same IL irrespective of whether they're
10088 in a 'checked' or 'unchecked' context: one of the issues in #78899
10089 * codegen.cs (EmitContext.CheckState): Make read-only property.
10090 (EmitContext.ConstantCheckState): Likewise.
10091 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
10092 helper that implement a save/restore stack for CheckState
10093 values. This is the only way to change check-state.
10094 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
10095 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
10096 (CheckedExpr.EmitBranchable): New forwarding method.
10097 (UnCheckedExpr): Likewise.
10098 * statement.cs (Block.ResolveMeta): Use WithCheckState.
10099 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
10100 (Checked.Resolve, checked.DoEmit): Likewise.
10102 2006-07-20 Miguel de Icaza <miguel@novell.com>
10104 * anonymous.cs: Cache the resolved anonymous delegate, and return
10105 this so that the ResolveTopBlock is only triggered once, not
10108 Currently we trigger ResolvetopBlock twice due to a first pass of
10109 argument check compatibility, and a second pass that does the
10112 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10114 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
10116 * rootcontext.cs (Reset): Add helper_classes.
10118 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10121 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
10124 2006-07-13 Miguel de Icaza <miguel@novell.com>
10126 * statement.cs (Lock): Handle expressions of type
10127 TypeManager.null_type specially. Fixes #78770
10129 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10131 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
10134 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10136 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
10137 for accessors as well.
10138 * ecore.cs (EventExpr): Add AccessorTable.
10140 2006-07-01 Marek Safar <marek.safar@seznam.cz>
10143 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
10144 for CS0122 where appropriate.
10145 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
10147 (Filter): Assembly can be null in the case of top level attributes.
10149 2006-06-25 Marek Safar <marek.safar@seznam.cz>
10153 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
10154 is done at global level.
10156 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10158 A fix for #77002, Implemented TypeForwarder support.
10160 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
10161 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
10162 * typemanager.cs (): Add type_forwarder_attr_type.
10164 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10166 * report.cs: Add CS0469 warning.
10168 2006-06-21 Martin Baulig <martin@ximian.com>
10170 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
10171 the `try'-block, so we also report CS0016 etc. there.
10173 2006-06-21 Martin Baulig <martin@ximian.com>
10176 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
10178 2006-06-21 Martin Baulig <martin@ximian.com>
10180 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
10181 also report CS1686 for parameters.
10183 2006-06-21 Martin Baulig <martin@ximian.com>
10185 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
10186 instead of an error if the value is not implicitly convertible to
10187 the switch types; fixes #77964.
10189 2006-06-21 Raja R Harinath <rharinath@novell.com>
10192 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
10193 FieldBuilder is null.
10196 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
10197 'left' and 'right' before error-checking.
10199 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
10201 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
10203 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
10204 (FieldExpr.DoResolve): likewise.
10205 (PropertyExpr.InstanceResolve): likewise.
10206 (EventExpr.InstanceResolve): likewise.
10208 2006-06-04 Marek Safar <marek.safar@seznam.cz>
10210 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
10211 attribute applicable tests for attribute argument.
10213 2006-06-02 Raja R Harinath <rharinath@novell.com>
10216 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
10217 (Binary.OverloadResolve_PredefinedIntegral): New.
10218 (Binary.OverloadResolve_PredefinedFloating): New.
10219 (Binary.OverloadResolve_PredefinedString): New.
10220 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
10221 Follow the standard more closely, and treat numeric promotions in
10222 terms of overload resolution.
10223 (Binary.CheckShiftArguments): Simplify.
10225 2006-06-01 Raja R Harinath <rharinath@novell.com>
10227 * flowanalysis.cs (MyBitVector): Simplify representation.
10228 (MyBitVector.Clone): Avoid allocating BitArray.
10229 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
10230 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
10231 (*): Update. Change all references to MyBitVector.And and
10232 MyBitVector.Or to &= and |=.
10234 2006-05-29 Raja R Harinath <rharinath@novell.com>
10236 Fix cs0231-[34].cs.
10237 * cs-parser.jay (formal_parameter_list): Extend the pattern below
10238 to param arguments too.
10240 2006-05-26 Miguel de Icaza <miguel@novell.com>
10242 * cs-parser.jay: Catch another parsing form for arglist being
10243 followed by other arguments. Fixes #78313.
10245 2006-05-24 Raja R Harinath <rharinath@novell.com>
10247 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
10248 checking of out parameters to ...
10249 (FlowBranchingToplevel.Merge): ... here.
10250 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
10251 set, propagate the origin upward, and only complain if there was
10253 (FlowBranchingException.AddContinueOrigin): Likewise.
10254 (FlowBranchingException.AddReturnOrigin): Likewise.
10255 (FlowBranchingException.AddGotoOrigin): Likewise.
10257 2006-05-23 Raja R Harinath <rharinath@novell.com>
10259 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
10260 unreachable, skip it.
10261 (FlowBranchingException.Merge): Always propagate jumps, even if
10262 the finally block renders subsequent code unreachable.
10264 2006-05-18 Raja R Harinath <rharinath@novell.com>
10267 * statement.cs (Goto.Resolve): Move responsibility for resolving
10268 'goto' to FlowBranching.AddGotoOrigin.
10269 (Goto.SetResolvedTarget): New. Callback to set the
10270 LabeledStatement that's the target of the goto.
10271 (Goto.DoEmit): Use Leave instead of Br when crossing an
10272 unwind-protect boundary.
10273 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
10274 LookupLabel and adjust to new semantics.
10275 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
10276 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
10277 Goto.SetResolvedTarget to update target.
10278 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
10279 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
10280 AddBreakOrigin & co. Delay propagation until ...
10281 (FlowBranchingException.Merge): ... this.
10283 * statement.cs (Block.Resolve): Always depend on flow-branching to
10284 determine unreachability. Kill workaround that originally emitted
10285 only one statement after an "unreachable" label (see infloop in
10288 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
10289 This is still "wrong", but anything better would probably need a
10290 multi-pass algorithm.
10291 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
10292 usage vector. Force current usage vector to be reachable, to
10293 optimistically signify backward jumps.
10294 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
10296 (FlowBranchingLabeled.Merge): New. If no backward jump was
10297 detected, return the original salted-away usage vector instead,
10298 updated with appropriate changes. Print unreachable warning if
10300 * statement.cs (Block.Resolve): Don't print unreachable warning on
10301 a labeled statement.
10303 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
10305 * driver.cs: Pass filename without path to AssemblyBuilder's
10306 AddResourceFile. Fixes bug #78407.
10308 2006-05-17 Raja R Harinath <rharinath@novell.com>
10310 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
10311 * flowanalysis.cs (FlowBranchingLabeled): ... here.
10312 (FlowBranching.MergeChild): Overwrite
10313 reachability information from Labeled branchings too.
10315 2006-05-16 Raja R Harinath <rharinath@novell.com>
10317 * statement.cs (Goto.Resolve): Merge jump origins here ...
10318 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
10320 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
10321 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
10322 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
10323 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
10325 * statement.cs (Goto.Resolve): ... not here.
10326 (Goto.Emit): Remove CS1632 check.
10328 2006-05-14 Marek Safar <marek.safar@seznam.cz>
10330 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
10333 2006-05-11 Raja R Harinath <rharinath@novell.com>
10335 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
10336 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
10337 (FlowBranchingException.Label): Likewise.
10339 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
10341 (MyBitVector.Or): Use it to avoid losing information (Count).
10342 (FlowBranching.MergeOrigins): Likewise.
10344 * flowanalysis.cs (UsageVector.IsDirty): Remove.
10345 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
10346 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
10347 (UsageVector.ToString): Simplify.
10348 (UsageVector.MergeSiblings): Move here from ...
10349 (FlowBranching.Merge): ... here.
10350 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
10353 2006-05-10 Raja R Harinath <rharinath@novell.com>
10355 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
10356 null bitvector is treated as all-true.
10358 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
10359 (MyBitVector): Rationalize invariants. 'vector != null' implies
10360 that we have our own copy of the bitvector. Otherwise,
10361 'InheritsFrom == null' implies all inherited bits are true.
10363 2006-05-09 Marek Safar <marek.safar@seznam.cz>
10365 * statement.cs (LocalInfo): Add IsConstant.
10366 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
10367 local variable for constants.
10369 2006-05-09 Raja R Harinath <rharinath@novell.com>
10371 * flowanalysis.cs (MyBitVector.Empty): New.
10372 (MyBitVector): Don't allow InheritedFrom to be null.
10373 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
10374 (UsageVector, FlowBranching): Update to changes.
10376 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
10377 recursion. The 'Parent == null' condition isn't sufficient for
10379 (FlowBranching.AddBreakOrigin): Likewise.
10380 (FlowBranching.AddContinueOrigin): Likewise.
10381 (FlowBranching.AddReturnOrigin): Likewise.
10382 (FlowBranching.StealFinallyClauses): Likewise.
10383 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
10384 (FlowBranching.CheckOutParameters): Likewise.
10385 (FlowBranchingToplevel): Terminate all the above recursions here.
10386 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
10387 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
10389 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
10391 (FlowBranchingToplevel): New. Empty for now.
10392 (FlowBranching.MergeTopBlock): Update.
10393 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
10394 branching for the anonymous delegate.
10395 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
10397 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
10398 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
10399 information at the start of the merge. Reorganize.
10401 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10403 * class.cs (MethodData.Define): Method cannot implement interface accessor.
10405 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10407 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
10408 to newly introduced ctor.
10410 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
10411 message to one place.
10412 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
10415 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10417 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
10419 * ecore.cs (Expression.ResolveAsConstant): Updated.
10421 * statement.cs (ResolveMeta): Updated.
10423 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10425 * cs-parser.jay: __arglist cannot be used in initializer.
10427 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10430 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
10433 2006-05-05 Raja R Harinath <rharinath@novell.com>
10435 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
10436 (LabeledStatement): Add 'name' parameter.
10437 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
10438 (Block.AddLabel): Update to changes.
10439 * cs-parser.jay (labeled_statement): Likewise.
10441 * flowanalysis.cs (BranchingType.Labeled): New.
10442 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
10443 (FlowBranchingLabeled): New. Does nothing for now, but will
10444 eventually handle 'goto' flows.
10445 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
10446 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
10447 that's terminated ...
10448 (Block.Resolve): ... here.
10450 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
10451 (UsageVector.MergeFinallyOrigins): Likewise.
10452 (FlowBranching.InTryOrCatch): Likewise.
10453 (FlowBranching.AddFinallyVector): Likewise.
10454 (FlowBranchingException): Update to changes.
10457 * statement.cs (Return.Resolve): Move error checking to ...
10458 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
10459 (FlowBranchingException): Handle return origins like break and
10461 (FlowBranching.UsageVector.CheckOutParameters): Remove.
10463 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10466 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
10469 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10472 * class.cs (MethodData.Define): Do public accessor check only when method
10473 implements an interface.
10475 2006-05-04 Raja R Harinath <rharinath@novell.com>
10477 Remove special handling of 'break'
10478 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
10479 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
10480 (UsageVector.Break): Remove.
10481 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
10483 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
10485 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
10486 UsageVector.Breaks (). Don't set NeedsReturnLabel.
10488 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10491 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
10492 be the interface member.
10494 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10497 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
10498 for emitting small (int) values.
10500 2006-05-03 Raja R Harinath <rharinath@novell.com>
10503 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
10504 control-flow passes through the 'finally' after merging-in all the
10505 control-flows from 'try' and the 'catch' clauses.
10507 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
10508 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
10509 always true at the only non-recursive entry point.
10510 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
10511 FlowBranchingBreakable.
10512 (FlowBranchingLoop): Remove.
10513 * statement.cs (Return.DoResolve): Update to changes.
10516 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
10517 (FlowBranching.CreateBranching): Handle it: create a
10518 FlowBranchingContinuable.
10519 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
10520 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
10521 except that it handles the 'continue' command.
10522 (FlowBranching.UsageVector.MergeOrigins): Rename from
10524 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
10525 except that it overrides AddContinueOrigin.
10526 (FlowBranchingException): Override AddContinueOrigin, similar to
10528 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
10529 Create a new branching around the embedded statement.
10530 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
10531 control flow after the embedded statement.
10532 (Continue.Resolve): Move all error checking to AddContinueOrigin.
10534 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
10535 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
10536 FlowBranchingBreakable.
10537 (FlowBranchingSwitch): Remove.
10540 * statement.cs (Break.Resolve): Simplify. Move responsibility for
10541 error reporting to ...
10542 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
10543 Rename from 'AddBreakVector'. Add new location argument. Return
10544 a bool indicating whether the 'break' crosses an unwind-protect.
10545 (FlowBranchingException.AddBreakOrigin): Add.
10546 (FlowBranchingException.Merge): Propagate 'break's to surrounding
10547 flowbranching after updating with the effects of the 'finally'
10549 (FlowBranchingBreakable): New common base class for
10550 FlowBranchingLoop and FlowBranchingSwitch.
10552 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
10553 embedded statement.
10554 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
10556 2006-05-02 Raja R Harinath <rharinath@novell.com>
10558 * statement.cs (Do.Resolve): If the loop is infinite, set the
10560 (While.Resolve, For.Resolve): Set a barrier after the embedded
10561 statement. There's no direct control flow that goes from the end
10562 of the embedded statement to the end of the loop.
10563 * flowanalysis.cs (FlowBranching.Infinite): Remove.
10564 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
10565 above ensure that the reachability is correctly computed.
10567 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
10568 (UsageVector.MergeBreakOrigins): If the current path is
10569 unreachable, treat it as if all parameters/locals are initialized.
10570 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
10571 infinite loops before merging-in break origins.
10573 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
10574 (Reachability.Reachable): Split part into ...
10575 (Reachability.Unreachable): ... this. Simplify.
10576 (Reachability.IsUnreachable): Use 'Unreachable' instead.
10578 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
10579 (Reachability.SetThrowsSometimes): Likewise.
10580 (FlowBranchingBlock.MergeTopBlock): Don't compare against
10581 TriState.Always, use corresponding property.
10582 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
10583 (Block.Resolve): Likewise. Remove some redundant checks.
10585 2006-05-02 Raja R Harinath <harinath@gmail.com>
10587 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
10588 (Reachability.Meet): Don't bother checking AlwaysThrows --
10589 barrier is always set.
10590 (FlowBranchingBlock.Merge): Likewise.
10592 2006-05-01 Raja R Harinath <harinath@gmail.com>
10594 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
10595 checks for unreachable.
10597 2006-05-01 Marek Safar <marek.safar@seznam.cz>
10600 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
10602 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
10603 whether field is really assigned.
10605 2006-04-30 Raja R Harinath <harinath@gmail.com>
10607 * flowanalysis.cs (Reachability): Make 4-argument constructor
10609 (Reachability.Meet): Rename from 'And'. Remove static variant.
10610 (Reachability.Always): Rename from the highly misleading
10611 'Reachability.Never'.
10612 (FlowBranching.Merge): Update to changes. Mark an impossible
10613 situation with a 'throw'.
10614 (*): Update to changes.
10616 2006-04-29 Raja R Harinath <harinath@gmail.com>
10618 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
10619 Remove 'Undefined'.
10620 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
10621 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
10622 (*): Update to changes.
10623 * statement.cs: Update to changes.
10625 2006-04-28 Marek Safar <marek.safar@seznam.cz>
10628 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
10630 2006-04-28 Raja R Harinath <harinath@gmail.com>
10632 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
10635 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
10636 argument to two arguments: an usage-vector and a bool. Move call
10637 to FlowBranching.Merge () ...
10638 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
10640 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
10641 handling of loop and switch reachability to ...
10642 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
10644 2006-04-27 Raja R Harinath <harinath@gmail.com>
10646 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
10647 handling to FlowBranchingLoop.InLoop.
10648 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
10650 2006-04-26 Marek Safar <marek.safar@seznam.cz>
10653 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
10654 anonymous method is allowed from AnonymousContainer here.
10656 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
10658 2006-04-24 Raja R Harinath <rharinath@novell.com>
10661 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
10663 2006-04-23 Marek Safar <marek.safar@seznam.cz>
10666 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
10667 (DoubleConstant.Reduce): Ditto.
10669 2006-04-23 Raja R Harinath <rharinath@novell.com>
10671 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
10672 Remove 'lvalue_right_side' argument. Move parts to ...
10673 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
10674 (LocalVariable.DoResolveLValue): ... these.
10676 2006-04-21 Raja R Harinath <rharinath@novell.com>
10679 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
10680 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
10681 (LocalVariableReference.DoResolveBase): Use it to implement new
10683 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
10684 (Argument.Resolve): Simplify. Move CS1510 check ...
10685 * ecore.cs (Expression.ResolveLValue): ... here.
10686 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
10687 (PropertyExpr.DoResolveLValue): Likewise.
10688 (FieldExpr.Report_AssignToReadonly): Likewise.
10689 (FieldExpr.DoResolve): Add 'out_access' argument. Use
10690 LValueMemberAccess or LValueMemberOutAccess on instance depending
10692 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
10693 DoResolve as appropriate.
10695 2006-04-20 Raja R Harinath <rharinath@novell.com>
10698 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
10699 implicit conversions on 'out' and 'ref' arguments.
10701 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
10702 improve clarity. Remove dead code.
10705 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
10706 (Catch.Resolve): Resolve VarBlock if it exists.
10708 2006-04-19 Miguel de Icaza <miguel@novell.com>
10710 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
10711 twice, this was some residual code, the enumerator was emitted
10712 properly in the two branche of if later.
10714 2006-04-19 Raja R Harinath <rharinath@novell.com>
10716 * expression.cs (Cast.ResolveLValue): Remove. The result of a
10717 cast is never an lvalue.
10718 (Cast.DoResolve, Cast.ResolveRest): Combine.
10719 (Argument.Emit): Simplify slightly. Move 'Expr is
10720 IMemoryLocation' check ...
10721 (Argument.Resolve): ... here.
10722 (Argument.Error_LValueRequired): Remove. Inline into only user.
10724 Simplifications. Fix cs0191-2.cs
10725 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
10726 CS1649 and CS1651 to ...
10727 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
10728 the actual selection of the error code and message to a lookup
10729 table. Add a dummy return value to simplify callsites.
10730 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
10731 readonly fields of other instances of the same type. Move CS0197
10733 * expression.cs (Argument.Resolve): ... here. Simplify code.
10734 Ensure that ec.InRefOutArgumentResolving is only set during LValue
10735 resolution of an out or ref argument. The code simplification
10736 above uses this invariant.
10738 2006-04-18 Raja R Harinath <rharinath@novell.com>
10740 Possibly fix #77752. Fix cs1690-[4-7].cs.
10741 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
10742 CheckMarshallByRefAccess. Drop parameter.
10743 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
10745 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
10746 InstanceExpression.
10747 * report.cs (AllWarnings): Add CS1690.
10748 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
10749 for ref access too.
10750 (LocalVariableReference.DoResolveBase): Update.
10752 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10754 * class.cs (MethodOrOperator): Moved common parts from method class.
10755 detect obsolete attributes.
10756 (Method.Define): Simplified as it reuses code from base.
10757 (Constructor.ValidAttributeTargets): Fixed issue found during
10759 (Destructor.ValidAttributeTargets): Fixed issue found during
10761 (Operator): Finished refactoring set off by #78020. Operator class is now
10762 ordinary method class.
10764 * anonymous.cs: Updated.
10766 * decl.cs (DeclSpace): Add IsGeneric
10768 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10770 * class.cs (Constructor.Emit): Don't emit the attributes twice.
10772 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10774 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
10775 detect obsolete attributes.
10776 (Method.CreateEmitContext): Moved to MethodOrOperator.
10778 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10781 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
10782 customized exception to make crash detection easier.
10783 (MethodOrOperator): Started to work on new base class for methods and
10785 (Method): Derives from MethodOrOperator.
10786 (Constructor.Emit): Emits its own attributes.
10787 (AbstractPropertyEventMethod.Emit): Ditto.
10788 (Operator): Derives from MethodOrOperator, will refactor fully in extra
10790 (Operator.Emit): It's temporary more tricky than should be.
10792 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
10794 * report.cs (InternalErrorException): Add ctor with inner exception.
10796 2006-04-08 Marek Safar <marek.safar@seznam.cz>
10799 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
10802 2006-04-07 Marek Safar <marek.safar@seznam.cz>
10805 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
10808 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10810 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
10811 attribute is present and Guid not.
10812 (Interface.ApplyAttributeBuilder): Ditto.
10814 * attribute.cs: Add error message.
10816 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10820 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
10821 sources (it's composite) so hold them in extra array as they are used in
10822 Emit phase only. It worked in the previous versions by mistake.
10823 (Attribute.Emit): Emit attribute for more owners when exist.
10825 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
10826 it has now different behaviour.
10828 2006-04-04 Marek Safar <marek.safar@seznam.cz>
10830 * constant.cs (Constant.IsDefaultInitializer): New method.
10832 * class.cs: Updated.
10834 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
10835 re-initialize default values. It saves KBs almost for every assembly.
10836 Thanks Zoltan for the idea.
10837 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
10838 (ArrayCreation.DoResolve): Resolve only once.
10839 (ArrayCreation.Emit): Emit static initializer only when it is faster.
10840 (ArrayCreation.GetAttributableValue): Cope with optimized values.
10842 2006-04-03 Zoltan Varga <vargaz@gmail.com>
10844 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
10847 2006-04-01 Marek Safar <marek.safar@seznam.cz>
10849 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
10850 in an embedded statement too.
10852 2006-04-01 Raja R Harinath <rharinath@novell.com>
10855 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
10857 2006-04-01 Marek Safar <marek.safar@seznam.cz>
10861 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
10864 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
10866 2006-03-31 Marek Safar <marek.safar@seznam.cz>
10868 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
10871 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
10872 LocalTemporary change.
10874 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
10876 (ClassOrStruct.DefineFieldInitializers): Implemented static field
10877 initializers optimization.
10878 (ClassOrStruct.TypeAttr): Moved from modifiers.
10879 (Constructor.CheckBase): Don't crash when static ctor has parameters.
10880 (FieldBase.ResolveInitializer): Resolves initializer.
10881 (FieldBase.HasDefaultInitializer): New property.
10883 * cs-parser.jay: Removed message.
10885 * expression.cs (CompilerGeneratedThis): New specialization.
10887 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
10889 2006-03-28 Marek Safar <marek.safar@seznam.cz>
10891 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
10893 2006-03-27 Marek Safar <marek.safar@seznam.cz>
10895 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
10896 be now EnumConstants only.
10898 2006-03-27 Marek Safar <marek.safar@seznam.cz>
10900 * attribute.cs, driver.cs: Reset more caches.
10902 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10904 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
10906 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10908 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
10909 for easier reuse. Updated all overrides.
10910 (IntegralConstant): New base class for all integral constants.
10911 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
10912 of the constant range, report custom error.
10913 (UIntConstant.Reduce): Fixed uint conversion.
10915 * ecore.cs, literal.cs: Reduce updates.
10917 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10921 * class.cs (Constructor.Define): Removed extra if for default ctors.
10922 A patch from Atsushi Enomoto.
10924 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10926 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
10927 GetAttributableValue.
10929 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
10932 * convert.cs (ImplicitConversionRequired): Error message moved to
10935 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
10936 automatic implicit conversion of an output value.
10937 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
10939 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
10941 (TypeOf.GetAttributableValue): Add extra handling for object type.
10943 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
10944 special error message.
10946 2006-03-25 Marek Safar <marek.safar@seznam.cz>
10948 * class.cs (Constructor.Emit): Don't crash when struct ctor is
10950 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
10951 compatible with MS runtime.
10953 2006-03-23 Marek Safar <marek.safar@seznam.cz>
10955 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
10956 attribute arguments here.
10958 * class.cs (Indexer.Define): The check was moved to attribute class.
10960 2006-03-22 Marek Safar <marek.safar@seznam.cz>
10962 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
10963 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
10966 2006-03-22 Raja R Harinath <rharinath@novell.com>
10968 Support ParameterDefaultValueAttribute in gmcs. Also applied to
10969 mcs to keep code differences small.
10970 * attribute.cs (Attribute.GetParameterDefaultValue): New.
10971 * typemanager.cs (parameter_default_value_attribute_type): New.
10972 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
10975 2006-03-21 Marek Safar <marek.safar@seznam.cz>
10977 * expression.cs (StringConcat.Append): Reverted back to no warning state.
10979 2006-03-21 Marek Safar <marek.safar@seznam.cz>
10981 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
10983 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
10986 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
10988 * doc-bootstrap.cs : fix build.
10990 2006-03-20 Marek Safar <marek.safar@seznam.cz>
10992 * expression.cs (StringConcat.Append): Issue a warning when empty string
10993 is going to append.
10995 2006-03-20 Marek Safar <marek.safar@seznam.cz>
10997 * assign.cs (CompoundAssign.ResolveSource): Removed.
10999 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
11002 * class.cs (TypeContainer.FindMethods): Removed.
11003 (TypeContainer.CheckMemberUsage): Made static.
11005 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
11007 * constant.cs (CheckRange): Removed unused type argument.
11008 (CheckUnsigned): Removed unused type argument.
11010 * cs-parser.jay: Updated after MemberAccess clean up.
11011 Uses Length for empty string test.
11013 * cs-tokenizer.cs: Uses Length for empty string test.
11014 (IsCastToken): Made static.
11015 (is_hex): Made static.
11016 (real_type_suffix): Made static.
11018 * decl.cs (SetupCache): Made static.
11019 (OnGenerateDocComment): Removed unused ds argument.
11021 * delegate.cs (VerifyDelegate): Removed unused argument.
11023 * doc.cs: Uses Length for empty string test.
11025 * driver.cs: Uses Length for empty string test.
11027 * enum.cs (IsValidEnumType): Made static
11029 * expression.cs (EnumLiftUp): Removed unused argument.
11030 (ResolveMethodGroup): Ditto.
11031 (BetterConversion): Ditto.
11032 (GetVarargsTypes): Ditto.
11033 (UpdateIndices): Ditto.
11034 (ValidateInitializers): Ditto.
11035 (MemberAccess.ctor): Ditto.
11036 (GetIndexersForType): Ditto.
11038 * flowanalysis.cs: (MergeFinally): Removed unused argument.
11040 * iterators.cs: Updated after MemberAccess clean up.
11042 * location.cs: Uses Length for empty string test.
11044 * namespace.cs: Uses Length for empty string test.
11046 * report.cs (CheckWarningCode): Made static.
11048 * statement.cs (LabeledStatement): Removed unused argument.
11050 * typemanager.cs (FilterNone): Removed.
11052 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11054 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
11057 * class.cs: Updated.
11059 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11061 * cs-parser.jay.cs: __arglist is not allowed for delegates.
11063 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11067 * expression.cs (VerifyArgumentsCompat): Reverted to double error
11068 reporting, it's more tricky than I thought.
11070 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11074 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
11076 (AnonymousMethod.ImplicitStandardConversionExists): New method.
11077 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
11078 Add more error reporting; Fixed issue with params.
11080 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
11082 * cs-parser.jay: AnonymousMethod requires host container.
11084 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
11086 2006-03-18 Raja R Harinath <harinath@gmail.com>
11088 * class.cs: Change 'TypeContainer ds' constructor argument to
11089 'DeclSpace parent'. Some classes were missed below due to
11090 different naming convention.
11092 * class.cs (MemberCore.Parent): Delete. This makes the
11093 ParentContainer changes below enforceable by the compiler.
11095 Treat pointers to enclosing declaration space as 'DeclSpace', not
11097 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
11098 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
11100 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
11102 (Block.AddThisVariable): Likewise.
11103 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
11104 (AbstractPropertyEventMethod.Emit): Likewise.
11105 (AbstractPropertyEventMethod.EmitMethod): Likewise.
11106 (GetMethod.Define, SetMethod.Define): Likewise.
11107 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
11108 (DelegateMethod.EmitMethod): Likewise.
11110 Fix regression test-partial-13.cs.
11111 Rationalize use of PartialContainer. Ensure that the partial
11112 class semantics can be tied to type-correctness, i.e., any
11113 violation will cause a compile error.
11114 * class.cs, const.cs: Access all fields that belong to class
11115 TypeContainer via ParentContainer. Arguments of EmitContexts and
11116 Resolve()-like functions still use 'Parent'.
11118 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
11119 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
11120 (PropertyMethod.CheckModifiers): Remove unused argument.
11121 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
11124 2006-03-17 Raja R Harinath <harinath@gmail.com>
11126 Make semantics of PartialContainer simpler.
11127 * decl.cs (DeclSpace.IsPartial): Remove.
11128 * class.cs (TypeContainer.IsPartial): Likewise.
11129 (TypeContainer..ctor): Set PartialContainer to point to self.
11130 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
11131 (TypeContainer.FindNestedType): Likewise.
11132 (MemberCore.ParentContainer): Simplify. Remove deprecation.
11134 2006-03-17 Marek Safar <marek.safar@seznam.cz>
11136 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
11138 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11140 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
11143 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11145 * class.cs (Operator.Define): An error for base conversion was not
11146 reported correctly.
11148 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
11150 * iterator.cs : yield break is allowed in try statement which has
11151 catch clauses. Fixed bug #77767.
11153 2006-03-13 Marek Safar <marek.safar@seznam.cz>
11155 A fix for #77593, #77574.
11157 * class.cs (MethodCore.CheckBase): Another if for operator.
11159 2006-03-09 Marek Safar <marek.safar@seznam.cz>
11161 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
11164 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
11165 (DelegateCreation.ImplicitStandardConversionExists): New method for just
11168 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
11171 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
11172 Updated after another emitcontext usage was clean up. It should help us to
11173 synchronize with gmcs easier.
11175 2006-03-04 Marek Safar <marek.safar@seznam.cz>
11179 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
11180 (Event.Define): ditto
11181 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
11183 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
11184 Removed redundant code and set NewSlot for Invoke method too.
11186 * parameter.cs (Parameters.ctor): Add custom, type ctor.
11187 (Parameters.MergeGenerated): New method. Use this method when you merge
11188 compiler generated argument with user arguments.
11190 2006-03-03 Marek Safar <marek.safar@seznam.cz>
11192 * attribute.cs (ResolveAsTypeTerminal): Removed.
11194 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
11195 specialization for predefined types; 30% speed up.
11196 Finally placed obsolete check to right place.
11197 (Expression.ResolveType): Removed.
11199 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
11200 Updated after ResolveType was removed.
11202 * expression.cs (Cast.ctor): Check void cast.
11203 (Binary.ResolveAsTypeTerminal): Is never type.
11204 (Conditional.ResolveAsTypeTerminal): Is never type.
11206 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
11208 2006-03-01 Raja R Harinath <rharinath@novell.com>
11211 * expression.cs (ParameterReference.DoResolveBase): Change return
11213 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
11217 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
11220 * typemanager.cs (GetFullNameSignature): Don't nullref on
11221 protected accessors.
11223 2006-02-27 Marek Safar <marek.safar@seznam.cz>
11225 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
11226 these two separated members to simplify the code.
11227 (Attribute.Resolve): Refactored to use new fields and methods.
11228 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
11229 implemented obsolete attribute checking.
11230 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
11231 implemented obsolete checking again. It look line never ending quest ;-)
11232 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
11234 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
11236 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
11238 *class.cs (Property.Define): Add RegisterProperty call.
11240 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
11241 argument groups (only 2).
11243 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
11244 encoding expression to arguments.
11245 (Expression.ExprClassToResolveFlags): Just turned to property.
11247 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
11248 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
11249 optimized as well as implemented support for zero-length attributes.
11251 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
11252 Add caching of PropertyInfo's.
11254 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11256 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
11257 error multiple times.
11259 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11261 New partial class implementation.
11262 A fix for #77027, #77029, #77403
11264 * attribute.cs (Attributable): Made attributes protected.
11266 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
11267 the replacements of ClassPart and PartialContainer.
11268 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
11269 (TypeContainer.AddInterface): Ditto.
11270 (TypeContainer.AddPartial): The main method for partial classes. It checks
11271 for errors and merges ModFlags and attributes. At the end class is added to
11272 partial_parts list.
11273 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
11275 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
11276 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
11277 from the rest of partial classes.
11278 (TypeContainer.GetClassBases): Simplified.
11279 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
11281 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
11282 (TypeContainer.HasExplicitLayout): Uses Flags now.
11283 (PartialContainer): Removed.
11284 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
11285 (StaticClass): Was merged with Class.
11286 (Class.GetClassBases): class and static class bases are verified here.
11287 (Class.TypeAttr): Added static attributes when class is static.
11288 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
11289 (MemberBase): In some cases we need to call parent container for partial
11290 class. It should be eliminated but it's not easy now.
11292 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
11294 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
11295 partial classed to accumulate class comments.
11296 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
11298 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
11300 * driver.cs (MainDriver): Tree.GetDecl was removed.
11302 * modifiers.cs (Modifiers): Add partial modifier.
11304 * tree.cs (Tree.decl): Removed.
11305 (RootTypes): Started to use this class more often for root types
11308 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11312 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
11313 external interface does not have an attribute.
11315 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11317 Another prerequisites for new partial classs implementation.
11319 * attribute.cs (Attribute.Equal): Implemented.
11320 (Attribute.Emit): Changed as attributes can be applied more than twice.
11321 (Attributes.Emit): Check for duplicate attributes here.
11323 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
11324 as a parameter, clean-up.
11326 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11330 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
11331 contains obsolete attribute check which can in some cases look for base
11332 type of current class which is not initialized yet.
11333 (TypeContainer.BaseType): Replacement of ptype.
11335 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
11337 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11339 First of prerequisites for new partial classs implemention.
11341 * attribute.cs (Attributable): Extended by ResolveContext;
11342 Attributes finally have correct context for resolving in all cases.
11343 (AttachTo): Attribute owner is assigned here.
11345 * codegen.cs (IResolveContext): Introduce new interface to hold
11346 all information needed in resolving phase.
11347 (EmitContext): Implements IResolveContext; more clean-up needed here.
11349 * decl.cs (MemberCore): Implemented IResolveContext.
11351 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
11352 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
11353 parameter.cs, statement.cs, tree.cs, typemanager.cs:
11354 Refactored to use new IResolveContext instead of EmitContext; cleanup
11356 2006-02-06 Miguel de Icaza <miguel@novell.com>
11358 * codegen.cs (EmitScopeInitFromBlock): check here the
11359 capture_context, there is no need to make two calls to the
11362 * anonymous.cs: Add some debugging messages that might help me
11363 track other instances of this problem in the future (the
11364 regression of test 467).
11366 * cs-parser.jay: track the variable block, as we need to initalize
11367 any captured variables declared in this block for the "catch"
11368 portion of the "Try" statement.
11370 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
11371 scope initialization for captured variables.
11373 Also, move the emit for the variables after the block location has
11376 2006-02-06 Marek Safar <marek.safar@seznam.cz>
11378 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
11380 2006-02-02 Miguel de Icaza <miguel@novell.com>
11382 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
11383 commit yesterday, the initialization for the roots is necessary.
11384 What is not necessary is the scope activation.
11386 2006-02-02 Raja R Harinath <rharinath@novell.com>
11388 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
11389 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
11391 (Argument.Resolve): Remove CS0206 checks.
11393 2006-02-01 Miguel de Icaza <miguel@novell.com>
11395 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
11396 scopes for all the roots, the scopes will now be emitted when the
11397 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
11399 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
11400 code. This reduces a lot of existing cruft.
11402 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
11403 that the ScopeInfo is generated as we enter the scope, not at the
11404 time of use, which is what we used to do before.
11406 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
11407 every time a Block is about to be emitted if we have a
11410 2006-02-01 Raja R Harinath <rharinath@novell.com>
11412 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
11414 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
11416 * typemanager.cs (cons_param_array_attribute): Make private.
11417 (Reset): Set it to null.
11418 (InitCoreHelpers): Don't initialize it.
11419 (ConsParamArrayAttribute): New. Initialize it as needed.
11420 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
11422 2006-01-31 Miguel de Icaza <miguel@novell.com>
11424 * expression.cs: There might be errors reported during the
11425 selection of applicable methods. If there are errors, do not
11426 continue execution as it will lead the compiler to crash.
11428 2006-01-30 Miguel de Icaza <miguel@novell.com>
11430 * expression.cs: Member access is not allowed on anonymous
11431 methods. Fixes #77402.
11433 2006-01-30 Raja R Harinath <rharinath@novell.com>
11436 * cs-parser.jay (VariableDeclaration): Don't set
11437 current_array_type to null.
11438 (field_declaration, event_declaration, declaration_statement):
11439 Set it to null here.
11441 2006-01-28 Raja R Harinath <harinath@gmail.com>
11443 * typemanager.cs (GenericParameterPosition): New.
11446 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
11448 * doc.cs : To process "include" elements, first we should create
11449 another list than XmlNodeList, because it could result in node
11450 removal, which could result in that the XmlNodeList gives up
11451 yielding next node.
11453 (Also made code identical to gmcs again.)
11455 2006-01-25 Miguel de Icaza <miguel@novell.com>
11457 * ecore.cs: Introduce an error report that we were not catching
11458 before, if not silent, we must report the error. Gonzalo ran into
11461 2006-01-23 Miguel de Icaza <miguel@novell.com>
11463 A fix for bug: #76957
11465 * iterators.cs (MoveNextMethod.CreateMethodHost): call
11466 ComputeMethodHost before creating the method, this is a new
11469 * anonymous.cs (AnonymousContainer): Now we track all the scopes
11470 that this method references (RegisterScope). The actual scope
11471 where the method is hosted is computed with the ComputeMethodHost
11472 before we create the method.
11474 Moved the Deepest routine here.
11476 (AnonymousContainer.ComputeMethodHost): New routine used to
11477 compute the proper ScopeInfo that will host the anonymous method.
11479 (ScopeInfo): Deal with multiple roots. The problem was that we
11480 did not have a unique root where all ScopeInfos could be hanged
11481 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
11484 Remove AdjustMethodScope which is now computed at the end. Remove
11485 LinkScope which did a partial link, instead link all ScopeInfos
11486 before code generation from the new "LinkScopes" routine.
11488 Simplify all the Add* routines as they no longer need to maintain
11489 the tree, they just need to record that they are using variables
11492 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
11493 routines to produce the forest of ScopeInfo trees.
11495 * class.cs (TypeContainer.AppendMethod): This is just like
11496 AddMethod, but ensures that an interface implementation method
11497 (IEnumerable.XXX) is not inserted at the beginning of the queue of
11498 methods, but at the end.
11500 We use this functionality to ensure that the generated MoveNext
11501 method in the iterator class is resolved/emitted before the
11502 enumerator methods created.
11504 This is required because the MoveNext method computes the right
11505 ScopeInfo for the method. And the other methods will eventually
11506 need to resolve and fetch information computed from the anonymous
11509 2006-01-21 Raja R Harinath <harinath@gmail.com>
11510 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11512 Fix rest of #76995.
11513 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
11514 the 'aliases' hash.
11515 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
11516 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
11518 2006-01-18 Raja R Harinath <rharinath@novell.com>
11520 Fix #76656, cs0231-2.cs.
11521 * cs-parser.jay (formal_parameter_list): Make error case catch
11523 (parenthesized_expression_0): Add CS1026 check.
11524 (invocation_expression): Remove unused { $$ = lexer.Location }.
11526 2006-01-17 Raja R Harinath <rharinath@novell.com>
11529 * cs-parser.jay (statement_expression): Don't list out the
11530 individual statement-expressions. Convert syntax error into
11533 2006-01-16 Raja R Harinath <rharinath@novell.com>
11536 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
11537 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
11538 CheckIntermediateModification.
11539 (FieldExpr.DoResolve): Add new two-argument version that
11540 allows us to resolve the InstanceExpression as an lvalue.
11541 The one-argument variant is now just a wrapper.
11542 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
11543 Resolve the lhs as an lvalue if the it has a value type.
11544 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
11545 from Assign.DoResolve.
11546 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
11547 resolved as an lvalue.
11548 (PropertyExpr.DoResolve): Update.
11549 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
11550 has a value type. Move CS1612 check here from
11551 CheckIntermediateModification.
11552 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
11553 * expression.cs (EmptyExpression.OutAccess): New. Used as the
11554 'right_side' of a ResolveLValue on an 'out' argument.
11555 (EmptyExpression.LValueMemberAccess): New. Used as the
11556 'right_side' of a propagated ResolveLValue on a value type.
11557 (LocalVariableReference.DoResolveBase): Recognize
11558 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
11560 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
11561 EmptyExpression.Null.
11563 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
11565 * typemanager.cs : added IsGenericParameter(). In mcs it always
11567 * doc.cs : for generic parameters, use GenericParameterPosition,
11570 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
11572 * expression.cs: Fix Console.WriteLine ((this = x).foo);
11574 2006-01-12 Miguel de Icaza <miguel@novell.com>
11576 This fixes the problem where we used ldfld instead of ldflda to
11577 load the "THIS" pointer on captured parameters, when THIS is a
11578 value type. See bug #77205.
11580 * iterators.cs (CapturedThisReference.Emit): Pass false to
11581 EmitThis (we do not need the address).
11583 * codegen.cs (EmitThis): it needs to know whether we need the
11584 address of `this' or not. This is used by value types.
11586 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
11587 every other call passes false.
11589 2006-01-12 Raja R Harinath <rharinath@novell.com>
11592 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
11594 * expression.cs (Invocation.OverloadResolve): Update.
11595 (Invocation.DoResolve): Avoid double resolution of invocation.
11597 2006-01-11 Raja R Harinath <rharinath@novell.com>
11600 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
11601 unary negation of floating point types as 0-expr; negation cannot
11602 overflow in floating point types.
11605 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
11606 on operands of 'void' type.
11609 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
11610 and ExclusiveOr for boolean constants too.
11612 2006-01-09 Raja R Harinath <rharinath@novell.com>
11615 * expression.cs (Invocation.OverloadResolve): Replace reflected
11616 override methods with their base virtual methods, rather than
11617 skipping over them.
11618 * typemanager.cs (TypeManager.GetOverride): New.
11620 2006-01-05 Jb Evain <jbevain@gmail.com>
11622 * class.cs (Property.Define, Indexer.Define): do not tag the
11623 properties as SpecialName | RTSpecialName.
11625 2006-01-04 Miguel de Icaza <miguel@novell.com>
11627 * class.cs (MethodCore.IsDuplicateImplementation): This method was
11628 doing a low-level comparission of parameter types. It was lacking
11629 a check for __argslist.
11631 2005-12-30 Miguel de Icaza <miguel@novell.com>
11633 * expression.cs (ParameterReference.DoResolveBase): Allow
11634 reference parameters if they are local to this block.
11636 This allows the ref and out parameters of a delegate to be used in
11637 an anonymous method, for example:
11639 delegate void set (out int x);
11641 set s = delegate (out int x){
11645 This is used by functionality introduced late in the C# language.
11647 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
11648 method that take ref and out parameters.
11650 Fixes #77119 which was a late change in the spec.
11652 2005-12-23 Miguel de Icaza <miguel@novell.com>
11654 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
11655 parent if its the same scope. Fixes #77060.
11657 2005-12-21 Miguel de Icaza <miguel@novell.com>
11659 * driver.cs: Report the case of no source files and no -out:
11662 2005-12-20 Raja R Harinath <rharinath@novell.com>
11665 * expression.cs (ComposedCast.GetSignatureForError): Define.
11667 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11671 * namespace.cs (NamespaceEntry): Add extern_aliases as a
11672 ListDictionary, to contain the ExternAliasEntry entries (in
11673 addition to the NamespaceEntry.aliases hashtable). This field is
11674 shared between the original entry and its doppelganger (bodyless
11676 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
11677 extern_aliases field.
11678 (NamespaceEntry.Lookup): Move the IsImplicit check after the
11679 lookup in extern_aliases.
11681 2005-12-16 Raja R Harinath <rharinath@novell.com>
11684 * class.cs (TypeContainer.Mark_HasEquals): New.
11685 (TypeContainer.Mark_HasGetHashCode): New.
11686 (ClassPart): Override them.
11687 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
11690 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
11691 'parent' argument to the base constructor.
11693 Remove all mention of TypeContainer from decl.cs.
11694 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
11695 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
11696 (DeclSpace.DeclSpace): Likewise.
11697 (DeclSpace.DefineMembers): Remove unused argument.
11698 * cs-parser.jay (pop_current_class): Update to changes. Simplify
11699 debugging check -- we don't care if the debug code throws an
11700 InvalidCastException instead of an InternalErrorException.
11701 * class.cs (TypeContainer.DefineMembers): Update to changes.
11702 (TypeContainer.DoDefineMembers): Likewise.
11703 (TypeContainer.GetMethods): Likewise.
11704 (PropertyMember.Define): Likewise.
11705 (MemberBase.Parent): New property that forwards to
11706 MemberCore.Parent, but ensures that we get a TypeContainer.
11707 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
11708 (RootContext.PopulateTypes): Likewise. Remove special case code
11709 for !RootContext.StdLib: DefineMembers is idempotent.
11711 2005-12-14 Miguel de Icaza <miguel@novell.com>
11713 * convert.cs (ExplicitConversionCore): Check the return value from
11714 ExplicitConversionCore which can return null on failure. Fixes #76914
11716 2005-12-13 Marek Safar <marek.safar@seznam.cz>
11718 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
11720 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
11722 * doc.cs : The search for referenced namespace was insufficient to
11723 get global one as it used to do. Fixed bug #76965.
11725 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
11727 * doc.cs : check name in cref in the last phase that whether it is
11730 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11732 * cs-tokenizer.cs : reverted the latest change: it somehow broke
11735 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11737 * doc.cs : so it turned out that we cannot skip override check for
11738 interface members. Fixed bug #76954.
11740 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11742 * cs-tokenizer.cs : fixed bug #75984:
11743 - #warning and #error should not be handled when the source line
11745 - #line is not checked strictly when the source line is disabled.
11746 - #define and #undef is on the other hand checked strictly at any
11749 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
11751 * cs-tokenizer.cs : missing Location (actually, filename) in one of
11754 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11756 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
11758 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
11759 event initializers.
11760 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
11761 (FieldBase.Initializer): Initializer is now optional.
11762 (EventField.Define): Only event field can have initializer.
11764 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
11766 * const.cs (Const): Reuse initializer.
11768 * cs-parser.jay: Updated after FieldBase changes.
11769 Added current_array_type to simplify array initializers.
11771 * ecore.cs (NullCast.IsDefaultValue): Implemented.
11773 * expression.cs, iterators.cs: Updated.
11775 * namespace.cs (NamespaceEntry): Made UsingFound private.
11777 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11779 * parameterCollection.cs: Obsolete, removed.
11780 * parser.cs: Obsolete, removed.
11782 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11785 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
11787 * enum.cs (Enum.Define): Set obsolete context here.
11789 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11792 - FindDocumentedMember() now expects 1) paramList as null
11793 when "we don't have to check the number of parameters" and
11794 2) Type.EmptyTypes when "there is no arguments".
11795 - Introduced FoundMember struct to hold the exact type which was
11796 used to find the documented member (the above change broke
11797 test-xml-044; it might be better just to use DeclaringType than
11798 what MS does, like this change does, but it depends on usage.)
11800 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11802 * doc.cs : documented member might be from DeclaringType for nested
11803 types. Fixed bug #76782.
11805 2005-12-03 Ben Maurer <bmaurer@ximian.com>
11807 * anonymous.cs: Have the param code handle leaving copies on the
11808 stack etc. Allows anonymous params to take part in the assignment
11809 code (++, +=, etc). Fixes bug #76550
11811 * expression.cs: Handle the prepare_for_load/leave_copy by passing
11812 it down to the anon code.
11814 * iterators.cs: Use dummy var here
11816 * codegen.cs: Handle new vars
11818 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11821 * class.cs (MethodData.Define): Set proper Obsolete context.
11823 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
11825 (FieldExpr.DoResolve): Ditto.
11827 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11830 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
11831 parent is not obsolete.
11833 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
11835 * doc.cs : (FindDocumentedMember) find parameterless members first
11836 and get CS0419 in the early stage. Fixed first case of bug #76727.
11838 2005-11-30 Marek Safar <marek.safar@seznam.cz>
11841 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
11842 no error was reported.
11844 *expression.cs (Binary.DoResolve): left can be null.
11846 2005-11-22 Marek Safar <marek.safar@seznam.cz>
11849 * class.cs (MethodData.Emit): Parameters should be labeled first.
11851 2005-11-21 Marek Safar <marek.safar@seznam.cz>
11854 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
11856 2005-11-18 Marek Safar <marek.safar@seznam.cz>
11858 * attribute.cs (AreParametersCompliant): Moved to Parameter.
11860 * class.cs (MethodCore): Parameter clean up.
11861 (IMethodData): Added ParameterInfo.
11862 (MethodData): Parameter clean up.
11863 (Indexer.Define): Parameter clean up.
11875 * typemanager.cs: Parameter clean up.
11877 * delegate.cs (Define): Get rid of duplicated code.
11879 * expression.cs (ParameterReference): Removed useless parameters
11881 (Invocation): Ditto.
11883 * parameter.cs (ParamsParameter): New class, params specialization.
11884 (ArglistParameter): Attemp to separate arglist.
11885 (Parameter): Refactored to be reusable and faster.
11886 (Parameter.Modifier): Made understandable.
11887 (Parameters): Changed to be used as a class for `this' assembly
11888 parameters. Refactored to use new specialized classes.
11890 * support.cs (ParameterData): Added Types property.
11891 (InternalParameters): Deleted.
11893 2005-08-20 Martin Baulig <martin@ximian.com>
11895 Merging this patch from GMCS to fix #75867.
11897 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11898 scope if we don't already have it.
11900 2005-11-17 Martin Baulig <martin@ximian.com>
11903 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
11904 inherit the scope from our parent. Fixes #76653.
11906 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11908 * doc.cs : the previous patch does not actually fix the bug.
11909 PropertyInfo override check is now implemented and really fixed it.
11910 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
11912 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11914 * doc.cs : apply "override filter" also to properties.
11917 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11919 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
11920 no need to check overrides. For classes, omit those results from
11921 interfaces since they must exist in the class. Fixed bug #76726.
11923 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11925 * typemanager.cs : (GetFullNameSignature) differentiate indexers
11926 with different parameters. Fixed the second problem in #76685.
11928 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11930 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
11931 get expected 'protected' access in CheckValidFamilyAccess()).
11934 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11936 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
11937 Fixed bug #76705. CS1569 was incorrectly commented out.
11939 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
11941 * doc.cs : use Invocation.IsOverride() to do real override check.
11942 * expression.cs : made Invocation.IsOverride() internal.
11944 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
11946 * doc.cs : use TypeManager.FindMembers() instead of (possible)
11947 TypeBuilder.FindMembers() and filter overriden base members out.
11950 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11952 * doc.cs : ref/out parameters are represented as '@' (instead of
11953 '&' in type FullName). Fixed bug #76630 (additionally crefs).
11955 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11957 * doc.cs : when there was no '.' in cref to methods in doc comment,
11958 then parameters were missing in the output. Fixed bug #76691.
11960 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11962 * driver.cs : don't output docs when there is an error.
11965 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11968 Now it should detect indexers. Fixed primary concern in bug #76685.
11969 Fixed CS0419 message to not show the identical member signature in
11972 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11974 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
11975 instead of Type.FindMembers() since it does not handle events.
11978 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
11980 * codegen.cs: Fixed typo (speficied -> specified).
11982 2005-11-11 Marek Safar <marek.safar@seznam.cz>
11985 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
11987 2005-11-11 Marek Safar <marek.safar@seznam.cz>
11989 * attribute.cs: Changed error message.
11991 * cs-tokenizer.cs: One more check.
11993 2005-11-10 Marek Safar <marek.safar@seznam.cz>
11995 * statement.cs (Block.Resolve): Ignore empty statement.
11997 2005-11-10 Marek Safar <marek.safar@seznam.cz>
11999 * report.cs: Made error/warning methods more strict to avoid
12002 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
12003 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
12004 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
12005 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
12007 2005-11-08 Marek Safar <marek.safar@seznam.cz>
12009 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
12010 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
12012 * class.cs (TypeContainer.IsComImport): New property.
12013 (Constructor.Define): Create proper ctor for ComImport types.
12015 * expression.cs (New.CheckComImport): Fixed.
12017 2005-11-07 Miguel de Icaza <miguel@novell.com>
12019 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
12020 that a parameter has been captured does not mean that we do not
12021 have to do the rest of the processing. This fixes the second part
12022 of #76592. If there was another anonymous method capturing
12023 values in the past, the Scope would never be set for the second
12024 method that captured the same parameter.
12026 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
12027 properly manipulate the stack. Second part of fix for #76592.
12029 * expression.cs (New): Add support for invoking "new" on
12030 interfaces that have been flagged with the ComImport attribute and
12031 the CoClass. Fixes #76637
12033 * statement.cs (Try.DoEmit): When a variable is captured, do not
12034 try to emit the vi.LocalBuilder variable as it has been captured.
12035 Create a temporary variable and store the results on the
12036 FieldBuilder. Fixes #76642
12038 2005-11-07 Marek Safar <marek.safar@seznam.cz>
12040 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
12042 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
12044 * expression.cs (Binary.DoResolve): Added && optimalization.
12046 * typemanager.cs (AddUserType): Removed useless argument.
12048 2005-11-04 Marek Safar <marek.safar@seznam.cz>
12050 * statement.cs (Block.variables): Uses ListDictionary.
12052 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12055 * class.cs (PartialContainer.EmitType): Customized to emit
12056 security attributes.
12057 (ClassPart.ApplyAttributeBuilder): Transform security attribute
12058 for partial classes.
12060 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12063 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
12064 access has to be fixed.
12066 * typemanager.cs (IsUnmanagedType): Wrong common field type.
12068 2005-11-01 Marek Safar <marek.safar@seznam.cz>
12071 * ecore.cs (NullCast.Reduce): Implemented.
12073 * expression.cs (ArrayCreation.CheckIndices): Correcly check
12076 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
12078 (Foreach.Resolve): Catch null properly.
12080 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12082 * cs-tokenizer.cs: Warning text fix.
12084 * driver.cs: AllWarningNumbers exposed on public interface.
12086 * report.cs (): Reviewed warning numbers.
12087 (IsValidWarning): Use binary search.
12089 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12091 * driver.cs: Implemeted resource visibility.
12092 (Resources): New class for code sharing between /res: and
12095 2005-10-28 Marek Safar <marek.safar@seznam.cz>
12098 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
12101 * convert (Convert.ImplicitReferenceConversion): NullCast holds
12104 * ecore.cs (NullCast): Child is contant only.
12106 * literal.cs (NullLiteral.Reduce): null can be converted to any
12109 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
12111 * driver.cs: Use Encoding.Default as default code page instead
12114 2005-10-27 Raja R Harinath <rharinath@novell.com>
12117 * expression.cs (Invocation.Error_InvalidArguments): Handle
12118 __arglist parameters.
12119 (Invocation.VerifyArgumentsCompat): Likewise.
12120 * support.cs (ReflectionParameters.GetSignatureForError): Print
12121 __arglist parameters.
12122 (InternalParamters.GetSignatureForError): Likewise.
12123 * parameter.cs (Parameters.GetSignatureForError): Likewise.
12125 2005-10-26 Marek Safar <marek.safar@seznam.cz>
12127 * attribute.cs (GetPropertyValue): Made public.
12129 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
12131 Add new property WrapNonExceptionThrows to handle 2.0 assembly
12133 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
12136 * driver.cs: Reflect method name change.
12138 * statement.cs (Try.Resolve): Warn when try has both general
12139 exception handlers.
12141 * typemanager.cs: runtime_compatibility_attr_type new predefined
12144 2005-10-26 Raja R Harinath <harinath@gmail.com>
12147 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
12148 treat it as an empty parameter list.
12150 2005-10-26 Raja R Harinath <rharinath@novell.com>
12153 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
12154 ResolveAsTypeStep silent.
12155 * statement.cs (Block.AddConstant): Mark block as used.
12156 (Block.ResolveMeta): Avoid piling on error messages
12157 if a constant initializer resolution fails.
12159 2005-10-25 Raja R Harinath <rharinath@novell.com>
12161 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
12163 (NamespaceEntry.VerifyAllUsing): New.
12164 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
12165 behaviour. Delegates actual resolution of alias to ...
12166 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
12167 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
12169 * driver.cs (Driver.MainDriver): Update.
12171 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
12172 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
12174 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
12176 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
12177 RootNamespace.DefineNamespacesForAll.
12179 2005-10-24 Raja R Harinath <harinath@gmail.com>
12181 * typemanager.cs (assemblies, external_aliases, modules)
12182 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
12183 (ComputeNamespaces, GetRootNamespace): Remove extra staging
12184 overhead. Move resposibility ...
12185 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
12186 * driver.cs, attribute.cs, codegen.cs: Update to changes.
12188 2005-10-23 Raja R Harinath <harinath@gmail.com>
12190 * namespace.cs (RootNamespace.all_namespaces): Renamed from
12191 cached_namespaces. Improve usage.
12192 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
12193 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
12194 Move from GlobalRootNamespace and simplify.
12195 (RootNamespace.Global): Make instance variable.
12196 (RootNamespace.RootNamespace): Add "alias name" parameter.
12197 (GlobalRootNamespace): Simplify drastically.
12198 (Namespace.Lookup): Don't use GetNamespace.
12199 * typemanager.cs (GetRootNamespace): Rename from
12200 ComputeNamespaceForAlias.
12201 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
12203 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12205 * anonymous.cs (AnonymousContainer): Don't crash when container
12208 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12210 * expression.cs (Binary.DoResolve): Warn when comparing same
12213 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12216 * expression.cs (Binary.DoResolve): It looks like there are no
12217 convetsion rules in enum context.
12219 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12221 Add support for extern alias qualifiers.
12222 * typemanager.cs: Move some LookupTypeReflection code
12223 to namespace.cs, to have cleaner code. Added some methods
12224 to help us keep track of the extern aliased references.
12225 * driver.cs: Add suport for extern alias assemblies on command
12226 line and check for their warnings/errors. Also keep track of the
12227 extern aliased assemblies.
12228 * namespace.cs: Move the global functionality of Namespace
12229 to GlobalRootNamespace/RootNamespace. Now the global namespace
12230 is GlobalRootNamespace.Globa. Also the code moved from
12231 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
12232 Finally added LocalAliasEntry (AliasEntry before) and
12233 ExternAliasEntry, to handle alias statements.
12234 * cs-parser.jay: Add support in the grammar for extern alias
12236 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
12237 Update callings to Namespace (now in GlobalRootNamespace).
12239 2005-10-18 Raja R Harinath <rharinath@novell.com>
12242 * class.cs (TypeContainer.DefineType): Move updating of
12243 topological sort earlier in the code.
12244 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
12246 2005-10-18 Marek Safar <marek.safar@seznam.cz>
12249 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
12251 * constant.cs (Constant.TryReduce): Moved from Cast class.
12252 (Reduce): Made little bit more OO and fixed missing conversions.
12254 * ecore.cs (Reduce): Implemented.
12255 (Binary.EnumLiftUp): New method to upgrade values to enum values.
12257 * literal.cs (Reduce): Implemented.
12259 * class.cs: Reverted Miguel's wrong commit.
12261 2005-10-14 Miguel de Icaza <miguel@novell.com>
12263 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
12265 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
12267 * cs-parser.jay, expression.cs : CS0214 was missing error location
12268 for constants. Fixed bug #76404.
12270 2005-10-11 Marek Safar <marek.safar@seznam.cz>
12273 * convert.cs (ExplicitConversionCore): Fixed object->enum
12276 2005-10-10 Raja R Harinath <rharinath@novell.com>
12278 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
12279 InstanceExpression.
12280 (PropertyExpr.EmitCall): Likewise.
12281 * expression.cs (Invocation.EmitArguments): Handle case where
12283 (Invocation.EmitCall): Avoid allocating temporary variable if
12284 there are no arguments.
12286 2005-10-07 Raja R Harinath <rharinath@novell.com>
12289 * convert.cs (ImplicitConversionStandard): Move conversion of
12290 void* to arbitrary pointer types ...
12291 (ExplicitConversionStandard): .. here.
12292 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
12293 error to always print typenames.
12295 2005-10-07 Raja R Harinath <rharinath@novell.com>
12297 * convert.cs (GetConversionOperator): Rename from
12298 GetConversionOperators. Move operator selection code from ...
12299 (UserDefinedConversion): ... here.
12301 2005-10-06 Marek Safar <marek.safar@seznam.cz>
12303 * convert.cs (ExplicitConversionCore): Removed duplicate enum
12306 2005-10-05 Marek Safar <marek.safar@seznam.cz>
12308 * assign.cs (Assign.DoResolve): Error method changed.
12310 * cfold.cs (DoConstantNumericPromotions): Error method changed.
12312 * const.cs (ResolveValue): Reset in_transit immediately.
12314 * constant.cs: Error method changed.
12316 * convert.cs: Removed useless location parameter.
12317 (ExplicitNumericConversion): Don't do double enum check.
12318 (ExplicitConversionCore): Renamed from ExplicitConversion.
12319 (ExplicitUnsafe): Extracted from ExplicitConversion.
12320 (ExplicitConversion): Uses for error reporting.
12322 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
12324 (ResolveBoolean): Uses common error method.
12325 (CastToDecimal): Get rid of ec.
12326 (CastFromDecimal): Optimized.
12327 (ConvCast): Get rid of ec.
12329 * enum.cs (ResolveValue): Reset in_transit immediately.
12330 (Emit): Return after first error.
12332 * expression.cs: Convert changes.
12334 * literal.cs: Error method changed.
12336 * statement.cs: Error method changed.
12338 2005-10-03 Raja R Harinath <rharinath@novell.com>
12340 * support.cs (SeekableStreamReader.Position): Don't error out when
12341 the requested position is just beyond the end of the current
12344 2005-09-28 Raja R Harinath <rharinath@novell.com>
12346 * support.cs (SeekableStreamReader): Simplify drastically. Don't
12347 try to keep in sync with the byte count of the underlying Stream.
12348 However, this limits us to a window size of 2048 characters: i.e.,
12349 the maximum lookahead of our lexer/parser can be 2048 characters.
12351 2005-09-28 Marek Safar <marek.safar@seznam.cz>
12354 * driver.cs: Fix compilation files with full root path.
12356 2005-09-25 Miguel de Icaza <miguel@novell.com>
12358 * report.cs (SymbolRelatedToPreviousError): Format the output so
12359 it does not use an open parenthesis that is never closed.
12361 * driver.cs: Follow coding guidelines
12363 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12366 * const.cs (Const.ResolveValue): Check for assigning non-null
12367 value to reference type.
12369 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12371 * anonymous.cs: Implemented ExprClassName.
12373 * assign.cs (Assign.DoResolve): Don't chrash when type is not
12376 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
12379 * class.cs (StaticClass.DefineContainerMembers): Report protected
12382 * codegen.cs: if(ed) PRODUCTION.
12384 * convert.cs (Error_CannotImplicitConversion): Better error
12387 * cs-parser.jay: More error checks.
12389 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
12391 * driver.cs (CSCParseOption): Enabled wrong option check.
12393 * ecore.cs (Expression.ExprClassName): Turned to property.
12394 (MemberExpr.CheckIntermediateModification): For checking boxed
12395 value types modification.
12397 * statement.cs (Fixed.Resolve): Expression type must be
12398 convertible to fixed type.
12399 (CollectionForeach.GetEnumeratorFilter,TryType):
12400 Small refactoring for easier error checking.
12402 2005-09-26 Marek Safar <marek.safar@seznam.cz>
12404 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
12407 * class.cs (GeneratedBaseInitializer): New class for customization
12408 compiler generated initializers.
12409 (MemberBase.DoDefine): Check Obsolete attribute here.
12410 (FieldMember.DoDefine): Ditto.
12412 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
12415 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
12416 (MemberCore.GetObsoleteAttribute): Removed argument.
12417 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
12418 (MemberCore.CheckObsoleteType): New helper.
12422 * statement.cs: Updates after MemberCore changes.
12424 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
12425 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
12427 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
12428 obsolete attribute for compiler construct.
12429 (As.DoResolve): Cache result.
12431 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
12433 2005-09-26 Raja R Harinath <rharinath@novell.com>
12436 * expression.cs (This.VerifyFixed): In a value type T, the type of
12437 'this' is T&, iow, 'this' is either an out or ref parameter. In a
12438 value type R, 'this' is treated as a value parameter.
12440 2005-09-22 Miguel de Icaza <miguel@novell.com>
12442 * statement.cs (Lock): Use the TemporaryVariable class instead of
12443 manually using local variables as those do not work when variables
12446 * ecore.cs: Moved the TemporaryVariable class from being a nested
12447 class inside Foreach to be a public class that can be employed in
12450 2005-09-19 Marek Safar <marek.safar@seznam.cz>
12452 * cs-parser.jay: interface_accessors replaced by
12453 accessor_declarations.
12455 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
12458 * statement.cs (GotoCase.Resolve): Convert null constant to
12460 (SwitchLabel.ResolveAndReduce): Ditto.
12461 (SwitchLabel.NullStringCase): Custom null stamp.
12462 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
12464 typemanager.cs (CSharpSignature): Don't skip first argument
12467 2005-09-18 Miguel de Icaza <miguel@novell.com>
12469 * driver.cs: Set InEmacs based on the environment variable EMACS.
12471 * location.cs (InEmacs): in this mode, do not report column
12472 location as it confuses Emacs.
12474 2005-09-16 Marek Safar <marek.safar@seznam.cz>
12476 * cfold.cs, constant.cs, convert.cs, ecore.cs,
12477 expression.cs, iterators.cs, literal.cs: Store constants and
12480 * class.cs (MemberBase.ShortName): Pass location.
12482 * cs-parser.jay: Some location fixes.
12484 * ecore.cs (Expression.Location): Made virtual.
12486 2005-09-05 Miguel de Icaza <miguel@novell.com>
12488 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
12489 if the underlying types are the same, otherwise we need to produce
12490 code that will do the proper cast.
12492 This was exposed by Marek's constant rewrite which produced
12493 invalid code for the call site:
12495 enum X : long { a }
12496 void Method (X v) {}
12500 This fixes test-49.cs
12502 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12504 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
12505 Type/Object should be allowed as well. Fixed bug #75968.
12507 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12509 * expression.cs : (Binary.DoResolve): when one is enum constant and
12510 another is constant 0, then return enum one *as enum type*.
12513 2005-09-02 Raja R Harinath <rharinath@novell.com>
12515 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
12519 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
12520 flow-branching for LocalVariableReferences in case we were invoked
12521 from a MemberAccess.
12522 * expression.cs (LocalVariableReference.VerifyAssigned): New.
12524 (LocalVariableReference.DoResolveBase): ... this.
12525 (MemberAccess.Resolve): Do the check that was disabled during
12528 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12531 (PartialContainer.Create): check abstract/sealed/static strictly
12532 but abstract/sealed can exist only at one side. Fixed bug #75883.
12534 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
12537 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
12538 specified, don't default to UnmanagedType.I4.
12540 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12542 * expression.cs : conditional operator should check possibly
12543 incorrect assign expression. Fixed bug #75946.
12545 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12547 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
12548 Reverting the change. gmcs is much complex than mcs on this matter.
12550 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12552 * cs-tokenizer.cs : To read another token ahead of the actual
12553 consumption, use new SavedToken and cache token instead of moving
12554 back the stream with SeekableStreamReader (it seemed problematic).
12556 driver.cs : Thus use StreamReader directly.
12557 * support.cs : Thus removed SeekableStreamReader.
12559 2005-08-30 Raja R Harinath <rharinath@novell.com>
12562 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
12563 (ScopeInfo.EmitScopeType): Use it to construct field names from
12564 names of captured locals.
12567 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
12568 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
12569 Pass 'target_type' to BoxedCast. Don't default to 'object'.
12570 (ExplicitConversion): Remove enum cases already handled by
12571 implicit conversion. Move implicit conversion check to the beginning.
12572 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
12573 * expression.cs (ArrayCreation.EmitDynamicInitializers):
12574 Don't treat System.Enum as a struct.
12576 2005-08-30 Jb Evain <jbevain@gmail.com>
12578 * attribute.cs: handles as expression in parameters.
12580 2005-08-30 Raja R Harinath <rharinath@novell.com>
12583 * class.cs (TypeContainer.VerifyClsName): Don't use a
12584 PartialContainer when verifying CLS compliance.
12585 (AbstractPropertyEventMethod): Set Parent here, ...
12586 (PropertyMethod): ... not here.
12588 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
12590 * attribute.cs : escaped attribute name should not be allowed to be
12591 resolved (e.g. @class as classAttribute). Fixed bug #75930.
12593 2005-08-29 Raja R Harinath <rharinath@novell.com>
12596 * convert.cs (ImplicitStandardConversionExists): Allow zero also
12597 when converting a long constant to unsigned long.
12598 * expression.cs (Invocation.OverloadResolve): Add sanity check to
12599 detect where IsApplicable and VerifyArgumentsCompat disagree.
12601 2005-08-29 Raja R Harinath <rharinath@novell.com>
12602 and Carlos Alberto Cortez <carlos@unixmexico.org>
12605 * class.cs (TypeContainer.CanElideInitializer): New helper.
12606 (TypeContainer.EmitFieldInitializers): Use it to determine if we
12607 can safely emitting the initializer of a field.
12609 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12611 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
12612 allowed inside a switch (without loop). Fixed bug #75433.
12614 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
12616 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
12617 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
12619 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12621 * driver.cs : kinda reverting the default encoding changes (not exact
12622 revert since I noticed that "codepage:reset" might not work fine).
12624 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12626 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
12627 Location. Now getter and setter store location correctly.
12628 (errors/cs0111-12.cs now reports the expected location.)
12630 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12632 * driver.cs : Use default encoding on the environment.
12633 Removed (now that) extra parameter for SeekableStreamReader.
12634 * support.cs : (SeekableStreamReader) third .ctor() argument for
12635 StreamReader is not required (always true). preamble size could
12636 be acquired in simpler and safe way.
12638 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
12640 * cs-parser.jay: report CS0642 at warning level 3
12641 and report CS0642 for an if else statement also
12642 fixes bug #74745. Patch by John Luke (and a bit
12644 Removed extra CS0642 warning check for "while",
12646 * statement.cs: In Block.Resolve(), CS0642 check
12647 is reimplemented to check a sequence of an empty
12648 statement and a block.
12650 Both fix bug #66777.
12652 2005-08-24 Marek Safar <marek.safar@seznam.cz>
12654 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
12655 detection until I fix it.
12657 * cs-tokenizer.cs: Changed error message.
12659 * cs-parser.jay: Fixed 2 error locations.
12661 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
12662 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
12665 * enum.cs (GetSignatureForError): Fixed.
12667 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
12671 * typemanager.cs (RegisterProperty): Removed.
12673 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
12675 2005-08-24 Raja R Harinath <rharinath@novell.com>
12678 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
12679 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
12681 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12683 * expression.cs : tiny fix is required for not warning positive ulong.
12686 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12688 * expression.cs : add CS0652 check for constant and integral
12689 expression. Fixed bug #53974.
12691 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12693 * expression.cs : in DoNumericPromotions(), check if there is implicit
12694 conversion overload for string (to check CS0034). Fixed bug #52492.
12696 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12698 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
12700 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12702 * ecore.cs : report location when it is *not* Null.
12704 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12710 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
12711 correctly. Fixed bug #75721.
12713 2005-08-23 Raja R Harinath <rharinath@novell.com>
12715 * support.cs (SeekableStreamReader.Position): Avoid an expensive
12716 loop that performs 'min (pos, char_count)'.
12719 * expression.cs (Unary.ResolveOperator): Don't discard implicit
12720 converted value in Operator.OnesComplement.
12722 2005-08-22 Ben Maurer <bmaurer@ximian.com>
12724 * anonymous.cs: If the anon method is pulled into a helper class,
12725 it needs to be `internal' not `private'. Fixes runtime behavior on
12728 2005-08-20 Martin Baulig <martin@ximian.com>
12730 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
12731 scope if we don't already have it.
12733 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
12734 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
12737 2005-08-17 Marek Safar <marek.safar@seznam.cz>
12740 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
12741 is a partial class.
12743 2005-08-16 Marek Safar <marek.safar@seznam.cz>
12745 The big constants rewrite
12746 Fix #75746, #75685 and more
12747 As a side effect saved 1MB for MWF ;-)
12749 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
12750 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
12751 enum based for corlib compilation.
12753 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
12756 * class.cs (FixedField.Define): Use ResolveAsConstant.
12758 * const.cs (IConstant): Interface constants and enums.
12759 (Const.ResolveValue): New method for constant resolvning.
12760 (ExternalConstant): Constants from imported assemblies.
12762 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
12763 conversion; like enums.
12764 (Constant.ToType): Converts this constant to different type.
12765 (Constant.Increment): Adds 1.
12767 * convert.cs (ImplicitConversionRequired): Simplified.
12769 * cs-parser.jay: Create EnumMember directly.
12771 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
12773 * doc.cs (GenerateEnumDocComment): Removed.
12775 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
12776 (ConvertIntLiteral): Removed.
12777 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
12779 * enum.cs (EnumMember): Implement IConstant.
12780 (Enum.IsValidEnumConstant): Removed.
12781 (Enum.GetNextDefaultValue): Removed.
12782 (Enum.FindMembers): Updated.
12783 (Enum.GenerateDocComment): Iterate enum members.
12785 * expression.cs (Cast.TryReduce): Handle enums correctly.
12786 (New.Constantify): Made public.
12787 (MemberAccess.DoResolve): Removed contant specific if(s).
12789 * literal.cs (NullLiteral): Implement new abstract methods.
12791 * statement.cs (GotoCase.Resolve): Use new constant methods.
12792 (SwitchLabel.ResolveAndReduce): Use new constant methods.
12794 * typemanager.cs (LookupEnum): Removed.
12795 (IsEnumType): Fixed to work with corlib.
12796 (RegisterConstant): Removed.
12797 (LookupConstant): Removed.
12798 (GetConstant): Changed to work with IConstant.
12800 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
12802 * location.cs : Fixed overflown (>255) column number.
12804 2005-08-03 Raja R Harinath <rharinath@novell.com>
12806 First cut of the qualified-alias-member feature.
12807 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
12809 * cs-parser.jay (DOUBLE_COLON): New token.
12810 (namespace_or_type_name): Add rule for recognizing
12811 qualified-alias-members.
12812 (primary_expression): Likewise.
12813 (element_access): Allow QualifiedAliasMember as a possible
12814 type-bearing expression.
12815 (local_variable_type, local_variable_pointer_type): Likewise.
12816 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
12817 aliases in the current and enclosing namespace declarations.
12818 (NamespaceEntry.UsingAlias): Add CS0440 warning.
12819 * decl.cs (MemberName.is_double_colon): New.
12820 (MemberName.MemberName): Add new constructor for alias-member.
12821 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
12822 * expression.cs (QualifiedAliasMember): New expression type.
12824 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12826 * location.cs : it borked when no argument was specified.
12828 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12830 * location.cs : tiny ToString() format fix.
12832 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12834 * statement.cs : oops, it was missing.
12836 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12838 A set of fixes for precise line/column location.
12841 "token" field now holds a file/line "delta", a line number offset
12842 from the segment, and a column number. See also:
12843 http://lists.ximian.com/pipermail/mono-devel-list/2004-
12844 December/009508.html
12845 Removed static IsNull. Use instance IsNull property instead.
12846 * cs-tokenizer.cs :
12847 For some tokens it stores Location. For Identifier it stores
12848 LocatedToken which is a pair of string name and location.
12849 Column numbers are adjusted only at getChar().
12851 Use Location.ToString() for reporting (it now contains column).
12853 Largely modified to use LocatedToken instead of
12854 string (IDENTIFIER), and to acquire Location from some tokens.
12855 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
12856 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
12858 Now MemberName holds Location. DeclSpace.ctor() receives Location
12859 as a parameter. Removed extra parameters to all derived classes.
12860 Replaced Location.IsNull() with instance property.
12861 * assign.cs, expression.cs :
12862 Added .ctor() overload that omits Location.
12864 Added "nameEscaped" flag that indicates the identifier was escaped
12865 in the source file. This fixes bug #57047.
12867 2005-08-02 Marek Safar <marek.safar@seznam.cz>
12869 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
12870 New method, looking for lo-case imported cls type.
12872 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
12875 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
12877 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
12879 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
12880 all_imported_types.
12881 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
12883 Optimized to save 3.5 MB for SWF compilation.
12885 2005-08-01 Marek Safar <marek.safar@seznam.cz>
12887 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
12888 (PartialContainer.Create): Moved logic AddToContainer.
12889 (PartialContainer.MarkForDuplicationCheck): Shares name.
12891 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
12894 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
12896 (Namespace.GetSignatureForError): New method.
12898 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
12899 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
12901 2005-08-01 Raja R Harinath <rharinath@novell.com>
12904 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
12905 member lookup rather than qualifier_type, since qualifier_type can
12908 2005-08-01 Marek Safar <marek.safar@seznam.cz>
12910 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
12913 2005-07-31 Miguel de Icaza <miguel@novell.com>
12915 * statement.cs: Copy the local exception into the exception
12916 captured local. Fixes 75674
12918 2005-07-31 Raja R Harinath <harinath@gmail.com>
12921 * expression.cs (Invocation.OverloadResolve): Don't report error
12922 CS1501 if error CS1502 has been reported.
12923 (New.DoResolve): Delegate CS1501 reporting to
12924 Invocation.OverloadResolve.
12927 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
12928 invariant-meaning-in-block property in an enclosing block if
12931 2005-07-29 Marek Safar <marek.safar@seznam.cz>
12933 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
12934 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
12935 (Switch.CheckSwitch): Just save 50kb for SWF.
12937 2005-07-27 Martin Baulig <martin@ximian.com>
12939 * anonymous.cs (CaptureContext.AddField): Added
12940 `AnonymousContainer am' argument; compute its toplevel scope if
12941 it's not already computed. Fixes #75649.
12943 2005-07-26 Raja R Harinath <rharinath@novell.com>
12946 * class.cs (Constructor.Emit): Reset block to null if the block
12949 2005-07-25 Marek Safar <marek.safar@seznam.cz>
12951 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
12953 2005-07-25 Marek Safar <marek.safar@seznam.cz>
12955 * class.cs (MethodData.Define): Check whether accessor implementing
12956 interface is public.
12958 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
12960 2005-07-22 Marek Safar <marek.safar@seznam.cz>
12963 * namespace.cs (LookupType): Moved same type check to...
12965 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
12966 with the same name.
12968 2005-07-21 Raja R Harinath <rharinath@novell.com>
12970 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
12971 already found a typebuilder.
12972 * class.cs (MethodCore.IsDuplicateImplementation): Compare
12973 MemberNames, not strings.
12975 * const.cs (Error_ExpressionMustBeConst):
12976 Rename from Error_EpressionMustBeConst.
12977 * const.cs, class.cs, statement.cd: Update.
12979 2005-07-21 Marek Safar <marek.safar@seznam.cz>
12983 * const.cs (Const.LookupConstantValue): Report missing contant expression
12985 (Error_EpressionMustBeConstant): Only one error method.
12987 * class.cs, statement.c: Updated.
12989 2005-07-20 Raja R Harinath <rharinath@novell.com>
12991 * statement.cs (Block.Flags): Add back HasVarargs.
12992 (Block.flags): Make protected.
12993 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
12995 * typemanager.cs (types, typecontainers, user_types): Remove.
12996 (UserTypes, TypeContainers): Likewise.
12997 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
12998 (CleanUp, Reset): Update.
12999 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
13000 (GetNestedType): Use Type.GetNestedType.
13001 (CoreLookupType): Take two arguments, the namespace and the
13002 basename of the type. Update to use the Namespace.Lookup
13004 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
13005 (RealMemberLookup): Use IsNestedChildOf instead of playing with
13006 string concatenation and substring matches.
13007 * class.cs, enum.cs, delegate.cs: Update to changes.
13009 2005-07-20 Marek Safar <marek.safar@seznam.cz>
13011 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
13012 Expression and made virtual.
13014 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
13015 (ImplicitStandardConversionExists): Fixed `byte' typo ?
13017 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
13019 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
13022 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
13025 2005-07-18 Marek Safar <marek.safar@seznam.cz>
13028 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
13029 AssemblyCultureAttribute is not used on executable.
13032 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
13034 2005-07-16 Raja R Harinath <rharinath@novell.com>
13037 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
13038 New. Reports CS0252/CS0253.
13039 Mostly taken from preliminary patch by Duncak Mak.
13040 (Binary.DoResolveOperator): Store results of operator lookup.
13041 Use them to detect if we need to warn about unintended reference
13044 2005-07-15 Raja R Harinath <rharinath@novell.com>
13047 * namespace.cs (Namespace.Lookup): Add back location parameter.
13048 (Namespace.LookupType): Add CS0436 report. Add location parameter.
13049 * delegate.cs, ecore.cs, expression.cs: Update to changes.
13051 * codegen.cs (EmitContext.DeclSpace): Make readonly.
13052 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
13053 (Namespace.LookupType): ... this.
13054 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
13056 * typemanager.cs (LookupTypeReflection): Remove buggy code that
13057 purported to handle pointers.
13058 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
13061 2005-07-15 Marek Safar <marek.safar@seznam.cz>
13063 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
13066 2005-07-15 Raja R Harinath <rharinath@novell.com>
13068 * namespace.cs (Namespace.Lookup): Drop location parameter.
13069 (NamespaceEntry.LookupAlias): Remove. Merge into ...
13070 (NamespaceEntry.Lookup): ... this.
13071 (NamespaceEntry.Error_AmbiguousTypeReference):
13072 Move here from DeclSpace.
13073 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
13075 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
13076 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
13077 Move to NamespaceEntry.
13078 * delegate.cs, expression.cs: Update to changes.
13080 2005-07-14 Marek Safar <marek.safar@seznam.cz>
13082 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
13083 CheckAttributeType and refactored.
13084 (Attribute.ResolvePossibleAttributeType): Changed to reuse
13085 ResolveAsTypeTerminal error handling.
13086 (ResolveAsTypeTerminal): Introduced because of global attributes extra
13088 (GetSignatureForError): Print errors in same way.
13091 * codegen.cs: Reflect attribute GetSignatureForError change.
13094 * expression.cs: Add silent parameter to ResolveAsTypeStep.
13096 * namespace.cs (UsingEntry): Refactored to make fields private.
13099 statement.cs: Error_UnexpectedKind has extra parameter.
13101 2005-07-14 Raja R Harinath <rharinath@novell.com>
13103 * ecore.cs (IAlias): Remove.
13104 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
13105 that implement the interface.
13106 * namespace.cs (Namespace): Likewise.
13107 (Namespace.declspaces): Renamed from 'defined_names'.
13108 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
13109 DeclSpace instead of an IAlias.
13110 * tree.cs (Tree.AddDecl): Update.
13112 2005-07-12 Raja R Harinath <rharinath@novell.com>
13114 * statement.cs (Block.Flags); Remove HasVarargs.
13115 (Block.HasVarargs): Move to ToplevelBlock.
13116 (Block.ThisVariable, Block.AddThisVariable): Likewise.
13117 (Block.Variables): Make protected. Initialize variable hashtable
13119 (Block.AddVariable): Update.
13120 (Block.Resolve): Update to changes.
13121 (ToplevelBlock.HasVarargs): New boolean.
13122 (ToplevelBlock.ThisVariable): Move here from Block.
13123 (ToplevelBlock.AddThisVariable): Likewise.
13124 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
13125 * expression.cs (This.ResolveBase): Update to changes.
13126 (ArglistAccess.DoResolve): Likewise.
13128 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13131 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
13133 * class.cs (TypeContainer.VerifyMembers): Distinguish between
13134 not used and not used & assigned.
13135 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
13137 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13140 * expression.cs (Is.DoResolve): null is never provided type.
13142 2005-07-08 Marek Safar <marek.safar@seznam.cz>
13145 * cs-parser.jay: Less strict event error rule to catch more errors.
13147 2005-07-08 Martin Baulig <martin@ximian.com>
13149 Fix test-iter-10.cs - distinguish whether we `yield' in a property
13150 gettter (allowed) or setter (not allowed).
13152 * class.cs (Accessor): Implement IIteratorContainer.
13153 (Accessor.Yields): New public field.
13154 (PropertyBase.PropertyMethod.Define): Handle iterators on a
13155 per-accessor basis.
13158 (get_accessor_declaration, set_accessor_declaration): Set the
13159 `yields' flag on the accessor, not the property.
13160 (property_declaration): Do the iterators check on a per-accessor
13161 basis and not for the whole property.
13163 2005-07-08 Martin Baulig <martin@ximian.com>
13165 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
13166 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
13168 2005-07-07 Marek Safar <marek.safar@seznam.cz>
13171 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
13172 (ExtractSecurityPermissionSet): Cope with self referencing security
13173 attributes properly.
13175 * driver.cs (SetOutputFile): Made public property OutputFile.
13177 2005-07-07 Raja R Harinath <rharinath@novell.com>
13180 * class.cs (TypeContainer.first_nonstatic_field): Rename from
13181 has_nonstatic_fields. Make into a FieldBase pointer.
13182 (TypeContainer.AddField): Add CS0282 check.
13183 (TypeContainer.EmitType): Update.
13185 2005-07-06 Miguel de Icaza <miguel@novell.com>
13187 * cs-tokenizer.cs (consume_identifier): Do not create strings to
13188 compare if they start with __.
13190 2005-07-06 Raja R Harinath <rharinath@novell.com>
13192 * statement.cs (Switch.SwitchGoverningType): Only look at
13193 UserCasts that don't need implicit standard conversions to one of
13194 the allowed switch types (Fixes test-322.cs).
13195 (LocalInfo.Resolve): Re-enable sanity-test.
13197 2005-07-06 Marek Safar <marek.safar@seznam.cz>
13199 * cs-tokenizer.cs (consume_identifier): Detect double undescores
13201 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
13203 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
13205 2005-07-06 Raja R Harinath <rharinath@novell.com>
13208 * ecore.cs (SimpleName.GetSignatureForError): Add.
13209 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
13210 (MemberAccess.GetSignatureForError): Add.
13212 2005-07-05 Marek Safar <marek.safar@seznam.cz>
13214 The big error and warning messages review.
13244 * typemanager.cs: Updated.
13246 * class.cs: (MethodCore.SetYields): Moved here to share.
13247 (PropertyMethod.Define): Moved iterator setup here.
13249 * iterators.cs: Add orig_method to have full access to parent
13252 2005-07-05 Raja R Harinath <rharinath@novell.com>
13254 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
13255 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
13256 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
13257 variable of struct type.
13258 * expression.cs (Unary.ResolveOperator): Update to change.
13259 (Indirection.VerifyFixed): Likewise.
13260 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
13261 (ParameterReference.VerifyFixed): Value parameters are fixed.
13262 (This.VerifyFixed): Treat 'this' as a value parameter.
13263 * statement.cs (LocalInfo.IsFixed): Remove.
13265 2005-07-01 Martin Baulig <martin@ximian.com>
13267 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
13268 `ec.EmitThis ()' to get the correct scope.
13270 2005-07-01 Martin Baulig <martin@ximian.com>
13272 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
13273 instance is a ParameterReference; fixes #75299.
13275 2005-07-01 Martin Baulig <martin@ximian.com>
13277 Reverted Marek's latest patch (r46725):
13278 - it contains structural changes which are neither mentioned in
13279 the ChangeLog nor explained anywhere; for example the additional
13280 argument of EmitContext's and Iterator's .ctor's and the
13281 TypeContainer.DefineMembers() change.
13282 - structural changes like this should go in in seperate patches
13283 and not be hidden in a huge patch which just seems to affect
13284 warnings and errors.
13285 a big and hard to understand patch.
13286 - it breaks iterators and causes regressions, for instance in
13289 2005-06-30 Raja R Harinath <rharinath@novell.com>
13292 * expression.cs (Indexers.map): Remove.
13293 (Indexers.Append): Filter out inaccessible setters and getters.
13294 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
13297 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
13298 Refactored from ...
13299 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
13300 (FieldExpr.Emit, PropertyExpr.Emit): Update.
13301 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
13302 * expression.cs (Invocation.EmitCall): Add CS0120 check.
13304 2005-06-30 Marek Safar <marek.safar@seznam.cz>
13307 * class.cs (FieldBase.GetInitializerExpression): One more field
13310 2005-06-28 Miguel de Icaza <miguel@novell.com>
13312 * pending.cs: Do not define a proxy if the base method is virtual,
13313 it will be picked up by the runtime (bug 75270).
13315 2005-06-08 Martin Baulig <martin@ximian.com>
13317 The big Iterators rewrite :-)
13319 * iterators.cs: Rewrite this to use the anonymous methods framework.
13321 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
13322 before the TypeContainers; see 2test-21.cs.
13325 (TypeContainer.DefineType): Don't create a new EmitContext if we
13326 already have one (this only happens if we're an Iterator).
13327 (TypeContainer.Define): Also call Define() on all our iterators.
13328 (Method.CreateEmitContext): Added support for iterators.
13331 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
13332 (AnonymousContainer.CreateMethodHost): Moved here from
13333 AnonymousMethod and made abstract.
13334 (AnonymousContainer.CreateScopeType): New abstract method.
13335 (AnonymousContainer.IsIterator): New public property.
13336 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
13337 get the ScopeTypeBuilder rather than manually defining it here.
13338 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
13341 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
13342 before RootContext.DefineTypes().
13344 * codegen.cs (EmitContext.RemapToProxy): Removed.
13345 (EmitContext.CurrentAnonymousMethod): Changed type from
13346 AnonymousMethod -> AnonymousContainer.
13347 (EmitContext.ResolveTopBlock): Protect from being called twice.
13348 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
13349 (EmitContext.EmitThis): Removed the iterators hacks; use the
13350 anonymous methods framework for that.
13353 (ToplevelBlock.Container): Make this a property, not a field.
13354 (ToplevelBlock.ReParent): New public method; move the
13355 ToplevelBlock into a new container.
13356 (Foreach.TemporaryVariable): Simplify.
13358 2005-06-05 Martin Baulig <martin@ximian.com>
13360 * statement.cs (LocalInfo.CompilerGenerated): New flag.
13361 (Block.AddTemporaryVariable): New public method; creates a new
13362 `LocalInfo' for a temporary variable.
13363 (Block.EmitMeta): Create the LocalBuilders for all the temporary
13365 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
13366 non-iterator variables.
13368 2005-06-05 Martin Baulig <martin@ximian.com>
13370 * statement.cs (Foreach.TemporaryVariable): Create the
13371 LocalBuilder in the Emit phase and not in Resolve since in some
13372 situations, we don't have an ILGenerator during Resolve; see
13373 2test-19.cs for an example.
13375 2005-06-04 Martin Baulig <martin@ximian.com>
13377 **** Merged r45395 from GCS ****
13379 The big Foreach rewrite - Part II.
13381 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
13382 with `PropertyInfo ienumerator_getcurrent'.
13384 * codegen.cs (VariableStorage): Removed.
13387 (Foreach): Derive from Statement, not ExceptionStatement.
13388 (Foreach.CollectionForeach): New nested class. Moved all the code
13389 dealing with collection foreach here.
13390 (Foreach.ForeachHelperMethods): Removed.
13391 (Foreach.TemporaryVariable): Implement IMemoryLocation.
13393 2005-05-23 Martin Baulig <martin@ximian.com>
13395 * statement.cs (Try.DoResolve): Don't create a `finally' if we
13396 don't need to. Fix #75014.
13398 2005-05-20 Martin Baulig <martin@ximian.com>
13400 Merged r44808 from GMCS.
13402 * class.cs (TypeContainer.CircularDepException): Removed.
13403 (TypeContainer.DefineType): Removed the `InTransit' stuff.
13404 (TypeContainer.CheckRecursiveDefinition): Check for circular class
13405 (CS0146) and interface (CS0529) dependencies here.
13407 2005-06-21 Raja R Harinath <rharinath@novell.com>
13409 * expression.cs (Invocation.EmitCall): Fix initialization
13410 'this_call' to reflect current behaviour. Fix indentation.
13412 * convert.cs (FindMostEncompassedType): Add two trivial special
13413 cases (number_of_types == 0 || number_of_types == 1).
13414 (FindMostEncompasingType): Likewise.
13416 2005-06-17 Raja R Harinath <rharinath@novell.com>
13418 Some cleanups preparing for the fix of #75283.
13419 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
13421 (EventExpr.InstanceResolve): Likewise.
13422 (EventExpr.DoResolve): Remove redundant checks.
13424 2005-06-10 Duncan Mak <duncan@novell.com>
13426 * cs-tokenizer.cs (process_directives): New flag for controlling
13427 the processing of preprocessor directives.
13428 (x_token): After seeing a '#', return Token.NONE instead of going
13429 to handle_preprocessing_directive() when not processing
13430 directives. This avoids unnecessary processing during the token peek in
13435 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
13436 the existing error reporting methods instead of Report.Error.
13438 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
13439 after Raja's rewrite.
13441 2005-06-08 Miguel de Icaza <miguel@novell.com>
13443 * class.cs: Small fix.
13445 2005-06-08 Raja R Harinath <rharinath@novell.com>
13448 * class.cs (GetPartialBases): Fix return value check of
13449 part.GetClassBases.
13451 2005-06-07 Raja R Harinath <rharinath@novell.com>
13453 Ensure that partial classes are registered in their enclosing
13454 namespace. Initial part of fix of #75160.
13455 * tree.cs (Tree.RecordDecl): Add new namespace argument.
13456 Register declspace with namespace here, not in
13457 DeclSpace.RecordDecl.
13458 * cs-parser.jay: Pass namespace to RecordDecl.
13459 * class.cs (PartialContainer.Create): Likewise.
13460 (ClassPart.DefineType): New sanity-check. Throws an exception if
13462 * decl.cs (Declspace.RecordDecl): Remove.
13463 * namespace.cs (NamespaceEntry.DefineName): Remove.
13465 2005-06-06 Marek Safar <marek.safar@seznam.cz>
13467 * rootcontext.cs: Reset TargetExt as well.
13469 2005-06-03 Raja R Harinath <rharinath@novell.com>
13471 * ecore.cs (Expression.Resolve): Emit CS0654 error when
13472 -langversion:ISO-1.
13474 2005-06-02 Raja R Harinath <rharinath@novell.com>
13476 Fix #75080, cs0119.cs.
13477 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
13479 (Expression.Resolve): ... this. Use it. Remove bogus code
13480 allowing ExprClass.Type and ExprClass.Namespace for
13481 ResolveFlags.VariableOrValue.
13482 (Expression.Resolve) [1-argument variant]: Change default resolve
13483 flags based on language version.
13484 (Expression.Error_UnexpectedKind): Use a simple string array
13485 rather than an ArrayList.
13486 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
13487 not ExprClass.Type.
13488 (TypeOfVoid.DoResolve): Likewise.
13489 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
13490 flags argument -- it always has the same value.
13492 2005-05-31 Raja R Harinath <rharinath@novell.com>
13495 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
13496 Use it in the error message.
13497 * assign.cs, expression.cs, statement.cs: Update.
13499 2005-05-30 Raja R Harinath <rharinath@novell.com>
13502 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
13503 the "almostMatchedMember" case too.
13504 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
13505 that failed the accessibility checks to 'almost_match'.
13507 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
13509 * attribute.cs: Use internal MethodBuilder methods to set
13510 ExactSpelling and SetLastError on PInvoke methods, instead
13511 of passing them via charset. Fixes #75060.
13513 2005-05-27 Raja R Harinath <rharinath@novell.com>
13515 * parameter.cs (Parameter): Remove TODO comment.
13516 (Parameter.DefineParameter): Remove Location parameter.
13517 (Parameters.LabelParameters): Likewise.
13518 * class.cs (Constructor.Emit): Update to change.
13519 (MethodData.Emit): Likewise.
13520 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
13521 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
13523 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
13526 Removed Parameters.Location and added Parameter.Location instead.
13527 Removed Location parameter from Emit() and GetSignature().
13534 Modified all related calls.
13536 2005-05-26 Raja R Harinath <rharinath@novell.com>
13538 Improve user-defined conversion handling.
13539 * convert.cs (GetConversionOperators): Rewrite. Return only the
13540 applicable operators.
13541 (AddConversionOperators): New. Helper for GetConversionOperators.
13542 (FindMostEncompassedType, FindMostEncompassingType): Verify that
13543 there is only one most encompassed/encompassing type.
13544 (FindMostSpecificSource, FindMostSpecificTarget): Remove
13545 "applicable operator" handling.
13546 (UserConversion): Move cache here from GetConversionOperators.
13547 Directly cache the chosen operator, rather than the whole
13549 (ExplicitNumericConversion): Fix buggy implementation of Decimal
13550 case. Allow conversion of decimal to sbyte and byte too.
13551 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
13552 New static methods. Used to avoid allocating EmptyExpressions in
13555 2005-05-24 Duncan Mak <duncan@novell.com>
13557 * ecore.cs (CastFromDecimal): New class for casting a decimal to
13558 another class, used in Convert.ExplicitNumericConversion.
13559 (CastToDecimal): New class, similar to above, but casts to
13560 System.Decimal, used in Convert.ImplicitNumericConversion and also
13561 in explicit convesion from double/float to decimal.
13563 * convert.cs (ImplicitNumericConversion): Handle implicit
13564 conversions to System.Decimal.
13565 (ExplicitNumericConversion): handle explicit conversions to
13570 2005-05-20 Miguel de Icaza <miguel@novell.com>
13572 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
13573 know the type at this stage, just break through. Fixes #75008
13575 2005-05-19 Martin Baulig <martin@ximian.com>
13578 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
13579 to disable error reporting.
13581 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
13582 here since we don't want to report an error; see the new test-336.cs.
13584 2005-05-19 Raja R Harinath <rharinath@novell.com>
13586 * statement.cs (ToplevelBlock.GetParameterReference)
13587 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
13588 Move here from class Block.
13589 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
13590 * expression.cs (ParameterReference.DoResolveBase): Likewise.
13592 2005-05-18 Martin Baulig <martin@ximian.com>
13597 (FlowBranching.Reachability): Add non-static public And() and Or()
13599 (FlowBranchingSwitch): New class; do the `break_origins' thing
13600 like in FlowBranchingLoop.
13601 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
13602 reachability, not just locals and parameters.
13603 (FlowBranching.MergeChild): Remove some of the hacks for loop and
13604 switch; MergeBreakOrigins() now takes care of that.
13606 2005-05-18 Martin Baulig <martin@ximian.com>
13608 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13609 a loop and may leave it, reset the barrier; fixes #74974.
13611 2005-05-17 Marek Safar <marek.safar@seznam.cz>
13613 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
13616 * cs-parser.jay: Catch more lexical errors.
13618 * report.cs: Add one more Error method.
13621 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
13623 2005-05-17 Martin Baulig <martin@ximian.com>
13625 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
13628 2005-05-16 Raja R Harinath <rharinath@novell.com>
13630 Fix test-382.cs. Emit values of decimal constants.
13631 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
13633 (TypeContainer.AddField): ... this.
13634 (TypeContainer.EmitFieldInitializers): Allow the list of fields
13635 with initializers to include 'Const's.
13636 (ClassPart.RegisterFieldForInitialization): Forward to
13638 * const.cs (Const.Const): Pass initializer to base class.
13639 (Const.Define): In case of decimal constants, register them for
13640 initialization in a static constructor.
13642 2005-05-14 Martin Baulig <martin@ximian.com>
13644 * statement.cs (Block.Resolve): Correctly handle unreachable code;
13645 do not call ResolveUnreachable() on unreachable statements in
13646 here, see the comment in the source code.
13648 2005-05-13 Raja R Harinath <rharinath@novell.com>
13651 * expression.cs (BinaryResolveOperator): If one of the operands of
13652 an equality comparison is 'null' and the other is a pointer type,
13653 convert the null to a NullPointer.
13654 * convert.cs (ImplicitReferenceConversion): If the expression is a
13655 NullLiteral and the target type is a pointer type, return a
13656 NullPointer instead.
13657 (ImplicitConversionStandard): Likewise.
13659 2005-05-13 Marek Safar <marek.safar@seznam.cz>
13661 * cs-parser.jay: Set readonly context based on special constructs.
13663 * expression.cs (LocalVariableReference.DoResolveBase): Improved
13664 readonly variable error handling.
13666 * rootcontext.cs (EmitCode): Don't verify members when error
13669 * statement.cs (LocalInfo): Add reaodnly context information.
13670 (SetReadOnlyContext, GetReadOnlyContext): New methods.
13672 2005-05-13 Raja R Harinath <rharinath@novell.com>
13674 * statement.cs (Block.Resolve): Revert change below. Modify fix
13675 for #74041 to initialize 'resolved' to false only for explicit
13676 blocks. Fixes #74873.
13678 2005-05-12 Raja R Harinath <harinath@gmail.com>
13681 * typemanager.cs (unmanaged_enclosing_types): New.
13682 (IsUnmanagedType): Avoid infloops by using
13683 'unmanaged_enclosing_types' to talk with recursive invocations.
13685 2005-05-13 Martin Baulig <martin@ximian.com>
13687 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
13688 instance variable, not a local. Fix #74873.
13689 (Block.ResolveUnreachable): Set it to true here.
13691 2005-05-11 Duncan Mak <duncan@novell.com>
13693 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
13694 continuing to process for 'arg'.
13695 (handle_preprocessing_directive): Check the argument of the #endif
13696 directive and report error CS1025 if there are any trailing
13699 According to the C# spec, having even whitespace after the #endif
13700 directive is illegal; however, because we call arg.TrimEnd ()
13701 beforehand, we have the same behavior as csc, allowing whitespace
13702 after the directive.
13706 2005-05-11 Marek Safar <marek.safar@seznam.cz>
13710 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
13711 (Constructor.GetObsoleteAttribute): Implemented correctly.
13713 2005-05-10 Martin Baulig <martin@ximian.com>
13715 * support.cs (ReflectionParameters.ParameterModifier): Use
13716 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
13717 and `ParameterAttributes.In'. Fixes #74884.
13719 2005-05-10 Marek Safar <marek.safar@seznam.cz>
13721 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
13723 * expression.cs (Argument.GetParameterModifier): Turned to property.
13724 (Invocation.Error_InvalidArguments): Add more descriptive errors.
13726 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
13729 2005-05-09 Raja R Harinath <rharinath@novell.com>
13732 * decl.cs (MemberCache.AddMethods): Register override methods,
13733 rather than non-override methods.
13734 * typemanager.cs (RegisterOverride): New.
13735 (IsOverride): Update.
13737 2005-05-09 Marek Safar <marek.safar@seznam.cz>
13741 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
13742 recursive declaration.
13744 * statement.cs (Block.ResolveMeta): Report any error in resolving.
13746 2005-05-06 Marek Safar <marek.safar@seznam.cz>
13748 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
13750 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
13752 2005-05-05 Raja R Harinath <rharinath@novell.com>
13755 * decl.cs (DeclSpace.FamilyAccessible):
13756 Use TypeManager.IsNestedFamilyAccessible.
13758 Fix reopened #64812.
13759 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
13762 2005-05-04 Raja R Harinath <rharinath@novell.com>
13763 Abin Thomas <projectmonokochi@rediffmail.com>
13764 Anoob V E <projectmonokochi@rediffmail.com>
13765 Harilal P R <projectmonokochi@rediffmail.com>
13768 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
13769 allow access to all static members.
13771 2005-05-04 Martin Baulig <martin@ximian.com>
13773 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
13775 2005-05-04 Martin Baulig <martin@ximian.com>
13779 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
13780 section at the end; make things work if `default' is not the last
13783 2005-05-04 Martin Baulig <martin@ximian.com>
13787 * statement.cs (Switch): Replaced the `got_default' field with a
13788 `default_section' one.
13789 (Switch.CheckSwitch): Set `default_section' here.
13790 (Switch.Resolve): If we're a constant switch and the constant is
13791 not found, use the default section.
13793 2005-05-03 Martin Baulig <martin@ximian.com>
13795 * expression.cs (ArrayAccess.EmitGetLength): New public method.
13797 * statement.cs (Foreach.ArrayForeach): New nested class.
13798 (Foreach.TemporaryVariable): New nested class.
13799 (Foreach.EmitArrayForeach): Removed; this is now in the new
13800 ArrayForeach class.
13802 2005-05-03 Raja R Harinath <rharinath@novell.com>
13804 * pending.cs (BaseImplements): Move the #74773 fix here. This is
13806 (VerifyPendingMethods): Revert change below.
13808 * typemanager.cs (IsOverride, RegisterNonOverride): New.
13809 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
13810 that used to trigger warning -28. Remove warning -28.
13811 * expression.cs (Invocation.OverloadResolve): Use
13812 TypeManager.IsOverride to distinguish override methods.
13815 * pending.cs (VerifyPendingMethods): If a base type implements the
13816 requested interface, don't bother checking individual methods of
13817 the base type. As a side-effect, this prevents the creation of
13818 unnecessary proxies.
13820 2005-05-02 Martin Baulig <martin@ximian.com>
13824 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13825 Also `And' the locals if the old vector is null.
13826 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
13827 null; in this case we basically reset all the variables.
13829 2005-05-02 Martin Baulig <martin@ximian.com>
13833 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
13834 Added `FlowBranching branching' argument; always `and' the
13835 variables instead of `or'ing them unless we're an infinite loop.
13837 * statement.cs (While.Resolve): Create a new sibling unless we're
13840 2005-05-02 Martin Baulig <martin@ximian.com>
13844 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
13845 arguments; use it instead of creating a new TopLevelBlock.
13846 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
13847 our ConstructorInitializer.
13850 (TopLevelBlock.TopLevelBranching): New public property.
13851 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
13852 and create our `TopLevelBranching'.
13854 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
13855 anonymous method host, use `block.TopLevelBranching' rather than
13856 creating a new branching.
13858 2005-04-20 Miguel de Icaza <miguel@novell.com>
13860 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
13861 a ScopeInfo, if any of the current children is a child of the new
13862 entry, move those children there.
13864 2005-04-30 Martin Baulig <martin@ximian.com>
13866 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
13867 at the beginning of a SwitchSection. Fix #73335.
13869 2005-04-27 Marek Safar <marek.safar@seznam.cz>
13872 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
13874 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
13875 (FieldExpr.DoResolve): Obsolete members are ignored for field
13878 2005-04-26 Marek Safar <marek.safar@seznam.cz>
13880 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
13881 of arrays detection.
13883 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
13885 (Field.VerifyClsCompliance): Volatile fields are not compliant.
13887 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
13890 2005-04-25 Ben Maurer <bmaurer@ximian.com>
13892 * cs-parser.jay: Use the prefered version of -unsafe in error
13895 2005-04-22 Marek Safar <marek.safar@seznam.cz>
13897 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
13900 2005-04-20 John Luke <john.luke@gmail.com>
13902 * driver.cs: fix typo in error message, --outout to --output
13904 2005-04-20 Marek Safar <marek.safar@seznam.cz>
13906 * codegen.cs (InRefOutArgumentResolving): New field.
13908 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
13909 fields outside contructor.
13911 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
13913 2005-04-19 Miguel de Icaza <miguel@novell.com>
13915 * anonymous.cs (CaptureContext.EmitParameterInstance): The
13916 parameter code was not completed ever, so it was not as up-to-date
13917 as local variables. Must finish it.
13919 The bug fix was to compare the Toplevel of the block, not the
13920 current block. Thanks for Ben for pointing this out.
13922 2005-04-19 Raja R Harinath <rharinath@novell.com>
13924 * decl.cs (AddMethods): Use the declaring type of the problem
13925 method to determine if we want to squash a warning.
13927 2005-04-19 Marek Safar <marek.safar@seznam.cz>
13929 * attribute.cs: Removed debug output.
13931 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
13933 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
13936 2005-04-18 Raja R Harinath <rharinath@novell.com>
13939 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
13940 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
13941 all null comparisons against reference types.
13943 2005-04-18 Marek Safar <marek.safar@seznam.cz>
13946 * class.cs (TypeContainer.CircularDepException) New nested
13948 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
13949 (TypeContainer.DefineType): Removed error, reset InTransit before
13951 (Class.DefineType): Throw exception when is in Transit.
13952 Catch exception and report error.
13953 (Struct.DefineType): Throw exception when is in Transit.
13954 Catch exception and report error.
13955 (Interface.DefineType): Throw exception when is in Transit.
13956 Catch exception and report error.
13958 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
13959 handle nested exception handlers.
13961 * flowanalysis.cs (InTryWithCatch): New method, search for try with
13964 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
13965 InFinally and InCatch storage.
13967 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
13968 (Catch.Resolve): Set and Restore ec.InCatch.
13969 (Try.Resolve): Set and Restore ec.InFinally.
13970 (Try.HasCatch): True when try has catch.
13972 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
13974 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
13975 for the same event member, so exclude such cases from warning 419.
13978 2005-04-16 Miguel de Icaza <miguel@novell.com>
13980 * expression.cs (Binary.ResolveOperator): Apply patch from John
13981 Luke to fix bug 59864: operators &, | and ^ on enumerations
13982 require that the same enum type on both sides.
13984 * driver.cs: Add warnings to old flag usage, this is to assist
13985 people who produce Makefiles and hope that the Makefiles will be
13988 * class.cs (TypeContainer.EmitType): Moved the definition of the
13989 special $PRIVATE$ field from the resolve phase to the Emit phase.
13990 During resolve we do not know if we are a struct with
13991 HasExplicitLayout, we know this only after the attributes for the
13994 Set the FieldOffset to zero on the dummy field that we create for
13995 the class. Fixes 74590.
13997 2005-04-16 Raja R Harinath <rharinath@novell.com>
14000 * ecore.cs (PropertyExpr.resolved): New.
14001 (DoResolve): Use it to handle a case of double resolution here.
14002 Handle a case of identical-name-and-type-name.
14003 * expression.cs (ArrayCreation.CheckIndices): Avoid double
14004 resolution by storing the results of expression resolution back
14005 into the "probes" array.
14007 2005-04-15 Raja R Harinath <rharinath@novell.com>
14009 Fix cs0208-7.cs and cs0208-8.cs.
14010 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
14011 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
14012 error reporting to point out the reason a struct is not unmanaged.
14014 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14016 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
14017 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
14019 2005-04-13 Raja R Harinath <rharinath@novell.com>
14022 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
14023 IdenticalNameAndTypeName here.
14024 (EventExpr.InstanceResolve): Likewise.
14026 2005-04-13 Marek Safar <marek.safar@seznam.cz>
14028 C# 2.0 DefaultCharSetAttribute implementation
14030 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
14031 which allows us to set GlobalNamespace for every resolve.
14032 (Attribute.ResolveArguments): Cut from Resolve.
14033 (Attribute.GetCharSetValue): Returns CharSet named argument.
14034 (Attribute.DefinePInvokeMethod): Gets default charset from
14036 (GlobalAttribute.ResolveAsTypeStep): Override.
14037 (GlobalAttribute.ResolveArguments): Override.
14039 * class.cs (TypeAttr): Is protected.
14041 * codegen.cs (ModuleClass.DefaultCharSet): New member.
14042 (ModuleClass.DefaultCharSetType): New memeber.
14043 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
14045 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
14046 charset from module.
14048 * delegate.cs (TypeAttr): Override.
14049 (Delegate.DefineType): Use this TypeAttr.
14051 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
14052 at very early stage (before types are defined) to resolve model
14053 module attributes. It will probably not work with corlib but it
14056 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
14057 charset from module.
14059 * typemanager.cs (default_charset_type): New type.
14061 2005-04-13 Raja R Harinath <rharinath@novell.com>
14063 * decl.cs (MemberCache.AddMethods): Don't warn if
14064 System.Object.Finalize has buggy MethodAttributes.
14066 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
14069 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14071 * doc.cs : detect ambiguous reference to overloaded members.
14072 Fixed bug #71603. MS 1.1 csc does not detect it.
14074 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14076 * doc.cs : delegates must not be referenced with parameters.
14079 2005-04-12 Miguel de Icaza <miguel@novell.com>
14081 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
14083 2005-04-10 Miguel de Icaza <miguel@novell.com>
14085 * driver.cs (MainDriver): Stop processing if the CLS stage found
14088 (CompilerCallableEntryPoint.InvokeCompiler): Always
14089 reset after execution; Take a TextWriter argument for the
14092 * report.cs: Use the error stream instead of hardcoding stderr.
14094 2005-04-09 Miguel de Icaza <miguel@novell.com>
14096 * class.cs: Reduce code paths to test, too small of an
14097 optimization to make it worth the extra testing. Always perform
14100 2005-04-08 Raja R Harinath <rharinath@novell.com>
14103 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
14104 operators that had errors reported on them.
14106 2005-04-08 Marek Safar <marek.safar@seznam.cz>
14108 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
14110 (Attribute.Resolve): Add named argument type checking.
14112 * class.cs (FixedField.Define): Use IsPrimitiveType
14114 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
14116 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
14117 unsafe parameter types.
14119 * statement.cs (Using.ResolveExpression): Add better error description.
14121 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
14123 2005-04-08 Raja R Harinath <rharinath@novell.com>
14126 * attribute.cs (Attribute.GetAttributeUsage): Resolve
14127 AttributeUsageAttribute in the emitcontext of the attribute class,
14128 not in the emitcontext of the attributable entity it was attached to.
14129 * cs-parser.jay: Use 'current_class', not 'current_container',
14130 when creating a GlobalAttribute.
14132 2005-04-08 Alp Toker <alp@atoker.com>
14134 * pending.cs: The fix to #58413 failed to compile methods implementing
14135 interfaces with/without params modifiers and vice versa, even though
14136 params modifiers aren't part of the signature. Make the modifier check
14137 less strict as in csc.
14139 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
14140 Anoob V E <projectmonokochi@rediffmail.com>
14141 Harilal P R <projectmonokochi@rediffmail.com>
14144 * pending.cs (TypeAndMethods.mods): New. Store the parameter
14145 modifiers of pending methods.
14146 (PendingImplementation.PendingImplementation): Initialize it.
14147 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
14148 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
14149 with ParameterData. Add check for modifiers.
14150 * class.cs (MethodData.Define): Update to changes.
14152 2005-04-07 Raja R Harinath <rharinath@novell.com>
14154 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
14156 2005-04-07 Marek Safar <marek.safar@seznam.cz>
14158 * class.cs (PropertyMethod.Define): Check private accessor in abstract
14161 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
14164 * typemanager.cs: Registered RequiredAttributeAttribute.
14166 2005-04-06 Marek Safar <marek.safar@seznam.cz>
14168 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
14169 Warning CS0169 is back at level 3.
14170 (IMethodData.SetMemberIsUsed): New method.
14172 * decl.cs (IsUsed): New value; moved from FieldBase.Status
14173 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
14175 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
14177 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
14179 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
14182 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
14185 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
14186 to avoid the problems with nested types.
14188 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
14189 Anoob V.E <projectmonokochi@rediffmail.com>
14190 Harilal P.R <projectmonokochi@rediffmail.com>
14191 Raja R Harinath <rharinath@novell.com>
14194 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
14196 * typemanager (GetConstructor): Make public.
14198 2005-04-05 John Luke <john.luke@gmail.com>
14199 Raja R Harinath <rharinath@novell.com>
14202 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
14203 struct too. Return false quicker in a few cases.
14204 (VerifyUnManaged): Use it.
14206 2005-04-05 Raja R Harinath <rharinath@novell.com>
14209 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
14210 not 'unreachable_seen'.
14212 2005-04-04 Marek Safar <marek.safar@seznam.cz>
14214 * attribute.cs (Attribute.GetValue): Removed unused.
14216 * codegen.cs (CodeGen.TrimExt): Removed unused.
14218 * cs-parser.jay (output): Removed unused.
14220 * cs-tokenizer.cs (hex_digits): Removed unused.
14222 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
14224 * expression.cs (Indirection.LoadExprValue): Removed unused.
14225 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
14227 * iterators.cs (Iterator.param_types): Removed unused.
14229 * statement.cs (Goto.block): Removed unused.
14230 (ToplevelBlock.did): Removed unused.
14231 (Switch.ResolveConstantSwitch): Removed unused.
14233 2005-04-01 Ben Maurer <bmaurer@ximian.com>
14235 * rootcontext.cs: Allow mcs to bootstrap with the compilation
14238 2005-04-01 Raja R Harinath <rharinath@novell.com>
14240 Fix #74232 and cs0208-3.cs.
14241 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
14242 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
14243 unmanaged type. Don't use FieldBuilders when 't' is a
14244 TypeBuilder. Use ModFlags and MemberType fields.
14245 * class.cs (MemberBase.member_type): Rename from MemberType.
14246 (MemberBase.MemberType): New property. Determines member_type on
14248 (MemberBase.DoDefine): Don't initialize MemberType here.
14249 (FieldMember.Define): Likewise.
14251 2005-04-01 Marek Safar <marek.safar@seznam.cz>
14254 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
14255 Attributes are emitted there.
14257 2005-04-01 Raja R Harinath <rharinath@novell.com>
14259 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
14260 keyword in 'partial enum' too.
14261 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
14263 Report from Kamil Skalski <nazgul@omega.pl>.
14266 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
14267 have partial containers too.
14269 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
14270 in block' checks to Block.CheckInvariantMeaningInBlock.
14271 * statement.cs (Block.GetKnownVariableInfo): Make private.
14272 (Block.IsVariableUsedInChildBlock): Remove.
14273 (Block.IsVariableUsedInBlock): Likewise.
14274 (Block.CheckInvariantMeaningInBlock): New. Show location of
14275 conflicting declaration.
14276 (Block.AddVariable): Make error messages less long-winded and more
14277 specific. Show location of conflicting declaration.
14278 * parameter.cs (Parameters.Location): New readonly property.
14280 2005-03-31 Raja R Harinath <rharinath@novell.com>
14282 Clean up semantics of invoking ResolveMemberAccess.
14283 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
14284 can have an instance, ensure that we pass in a non-TypeExpression
14285 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
14286 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
14287 argument. Update to changes and simplify.
14288 (FieldExpr.Emitinstance): Remove CS0120 check.
14289 (PropertyExpr.EmitInstance): Likewise.
14290 * expression.cs (Argument.Resolve): Likewise.
14291 (Invocation.DoResolve): Update to changes in semantics of
14292 InstanceExpression.
14294 2005-03-31 Marek Safar <marek.safar@seznam.cz>
14297 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
14300 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
14302 2005-03-31 Raja R Harinath <rharinath@novell.com>
14304 Fix difference in behaviour with commandline invocation.
14305 * driver.cs (Driver.Reset): New.
14306 (CompilerCallableEntryPoint): Call it.
14308 * statement.cs (If.Resolve): Avoid spurious "uninitialized
14309 variable" warnings if the boolean expression failed to resolve.
14311 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
14313 * attribute.cs: Fix the union of several permissions when some of them
14314 are unrestricted (so the result isn't an unrestricted permission set).
14317 2005-03-30 Raja R Harinath <rharinath@novell.com>
14319 * ecore.cs (MemberExpr): New class. Convert from interface
14321 (MemberExpr.ResolveMemberAccess): Refactor and move here from
14322 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
14324 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
14325 (MethodGroupExpr.IsExplicitImpl): Remove.
14326 (Expression.GetFieldFromEvent): Remove.
14327 (SimpleName.MemberStaticCheck): Remove.
14328 (SimpleName.DoSimpleNameResolve): Update to changes.
14329 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
14330 (MemberAccess.IdenticalNameAndTypeName): Remove.
14331 (MemberAccess.error176): Move to MemberExpr.
14332 (MemberAccess.DoResolve): Update to changes.
14333 (BaseAccess.DoResolve): Likewise.
14335 2005-03-30 Marek Safar <marek.safar@seznam.cz>
14337 C# 2.0 Conditional attribute class implementation
14339 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
14340 Analyzes class whether it has attribute which has ConditionalAttribute
14341 and its condition is not defined.
14343 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
14344 (Class.IsExcluded): New method. Search for at least one defined
14345 condition in ConditionalAttribute of attribute class.
14347 2005-03-30 Raja R Harinath <rharinath@novell.com>
14349 * ecore.cs (PropertyExpr): Derive from Expression, not
14350 ExpressionStatement.
14351 (PropertyExpr.EmitStatement): Remove.
14353 2005-03-29 Raja R Harinath <rharinath@novell.com>
14356 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
14357 internal field "value__" of an enum be private. The examples for
14358 "value__" that I found on MSDN all used FieldAttributes.Private.
14360 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
14361 Don't mention IL method attribute names.
14363 Fix #47991. Remove a TODO.
14364 * statement.cs (Block.Toplevel): Make into a field.
14365 (Block.Parameters): Move into ToplevelBlock.
14366 (Block.known_variables): Rename from child_variable_names.
14367 (Block.Block): Remove variants that take Parameters. Initialize
14368 'Toplevel' with the immediately surrounding toplevel block.
14369 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
14370 LocalInfo parameter.
14371 (Block.GetKnownVariableInfo): New.
14372 (Block.IsVariableNameUsedInChildBlock): Update.
14373 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
14374 the block, even though it may not be in scope.
14375 (Block.AddVariable): Remove Parameters parameter. Use
14376 Toplevel.Parameters instead.
14377 (Block.AddConstant): Remove Parameters parameter.
14378 (Block.GetParameterReference): Update to use Toplevel.Parameters.
14379 (Block.IsParamaterReference): Likewise.
14380 (Block.IsLocalParameter): Likewise. Simplify a lot.
14381 (ToplevelBlock.Parameters): New. Moved from Block.
14382 (ToplevelBlock.ToplevelBlock): Update to changes. Always
14383 initialize Parameters to a non-null value.
14384 * cs-parser.jay: Update to changes.
14385 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
14386 simple names that mean different things in the same block. Use
14387 Block.IsVariableNameUsedInBlock.
14389 2005-03-28 Raja R Harinath <rharinath@novell.com>
14391 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
14392 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
14393 GetTypeHandle. It is possible for a reflected type to derive from
14394 a TypeBuilder (e.g., int[] derives from the TypeBuilder
14395 System.Array during mscorlib compilation).
14396 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
14397 contain a method_hash, don't create one either. Don't create a
14398 deep copy of the base cache's method_hash.
14399 (MemberCache.SetupCache): Rename back from DeepCopy.
14400 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
14401 already initialized. If we see an override function, add its
14402 underlying base virtual function to the member_hash too.
14404 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
14406 2005-03-26 Raja R Harinath <harinath@acm.org>
14409 * assign.cs (Assign.DoResolve): When the RHS of an assignment
14410 fails to resolve, ensure that the LHS is still resolved as an
14413 2005-03-25 Raja R Harinath <harinath@acm.org>
14415 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
14417 (Enum.current_ec): Remove.
14418 (Enum.LookupEnumValue): Remove EmitContext argument.
14419 Just uses the one created during DefineType.
14420 (Enum.FindMembers): Update.
14421 * expression.cs (MemberAccess.DoResolve): Update.
14423 2005-03-22 Marek Safar <marek.safar@seznam.cz>
14425 * assign.cs (Assign.DoResolve): Check for CS1717 when
14426 source and target are same (uses Equals).
14428 * expression.cs (LocalVariableReference, ParameterReference,
14429 This): Implemented Equals, GetHashCode.
14431 * statement.cs (Block.GetParameterReference): Removed useless
14434 2005-03-22 Raja R Harinath <rharinath@novell.com>
14437 * statement.cs (Block.AddVariable): Ensure that we skip implicit
14438 blocks before deciding whether the error is cs0136 or cs0128.
14440 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
14441 (using_alias_directive, using_namespace_directive): Pass
14442 MemberName, not an expression to Namespace.UsingAlias and
14444 (MakeName): Use the MemberName of the namespace.
14445 * namespace.cs (Namespace.MemberName): New.
14446 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
14447 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
14449 * decl.cs (MemberName.Name): Make readonly.
14450 (MemberName.FromDotted): New "constructor".
14451 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
14452 (MemberCore.Name): Compute from MemberName on demand.
14453 (MemberCore.SetMemberName): Provide a way to change the
14455 (MemberCore.AddToContainer): Don't take a fullname parameter.
14456 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
14457 fully qualified name of the container to the member name.
14458 (TypeContainer.AddToTypeContainer): Use a fully qualified name
14459 only if the type is a member of the root container.
14460 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
14461 MemberName.Left rather than searching for an embedded ".".
14462 (PartialContainer.CreatePart): Update to changes in RootContext.
14463 (MemberBase.ShortName): Turn into a property. Use
14464 MemberCore.SetMemberName.
14465 (MemberBase.ExplicitInterfaceName): Remove.
14466 (MemberBase.UpdateMemberName): Remove.
14467 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
14468 (PropertyBase.SetMemberName): New override.
14469 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
14470 (Tree.GetDecl): New.
14471 (Tree.AllDecls): Rename from Decls.
14472 * attribute.cs, enum.cs, report.cs: Update to changes.
14473 * driver.cs (MainDriver): Use MemberName.FromDotted on
14474 RootContext.MainClass.
14476 2005-03-21 Marek Safar <marek.safar@seznam.cz>
14478 * class.cs (FixedField.Define): Check for CS1664 and more sanity
14481 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
14483 2005-03-18 Marek Safar <marek.safar@seznam.cz>
14485 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
14486 property accessor modifiers.
14488 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
14489 fixed buffer attribute (CS1716).
14490 (PropertyMethod.HasCustomAccessModifier): When property accessor
14491 has custom modifier.
14493 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
14495 (PropertyExpr.DoResolveLValue): Add CS0272.
14497 2005-03-17 Miguel de Icaza <miguel@novell.com>
14499 * convert.cs: When converting to a pointer, use the proper Conv.U
14500 or Conv.I depending on the source data type.
14502 * cs-tokenizer.cs: Make the size for large decimal constants,
14505 2005-03-17 Martin Baulig <martin@ximian.com>
14507 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
14508 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
14510 2005-03-17 Martin Baulig <martin@ximian.com>
14512 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
14513 to bool so we can return an error condition.
14514 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
14517 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
14519 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
14522 2005-03-16 Raja R Harinath <rharinath@novell.com>
14524 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
14525 Refactor to avoid traversing the list of assemblies, and to avoid
14526 string concatenation.
14527 * typemanager.cs (guid_attr_type): Remove.
14528 (negative_hits, pointers, references): Remove hashes.
14530 (GetConstructedType): New. Uses type_hash to handle constructed
14531 types (arrays, references, pointers).
14532 (GetReferenceType, GetPointerType): Use it.
14533 (GetNestedType): New. Uses type_hash to handle nested types of
14535 (LookupType, LookupTypeDirect): Remove.
14536 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
14537 'types' hash and LookupTypeReflection directly.
14538 (params_string, params_object): Use GetConstructedType.
14539 * namespace.cs (Namespace.cached_types): New. Cache of reflected
14541 (Namespace.Lookup): Use cached_types.
14542 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
14543 provided by old TypeManager.LookupType.
14544 * rootcontext.cs (MakeFQN): Remove.
14545 * decl.cs (DeclSpace.MakeFQN): Likewise.
14546 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
14547 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
14548 TypeManager.GetConstructedType.
14549 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
14551 2005-03-15 Marek Safar <marek.safar@seznam.cz>
14553 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
14556 * cs-parser.jay: Reports CS1527 for any namespace element.
14558 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
14561 * expression.cs (ParameterReference.IsAssigned): Changed error to
14563 (Error_WrongNumArguments): Moved CS0245 detection here.
14565 * statement.cs (Return.Resolve): Add CS1622 report.
14567 2005-03-11 Marek Safar <marek.safar@seznam.cz>
14569 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
14571 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
14573 * attribute.cs expression.cs: Get rid of some allocations.
14575 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
14577 * doc.cs : just eliminate the latest change.
14579 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14581 * doc.cs : commented out the latest change. It breaks xml-030.cs
14583 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14585 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
14586 fail. So invoke CreateType() in FindDocumentedType().
14588 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14590 * cs-tokenizer.cs : added IsKeyword().
14591 * doc.cs : Detect keyword incorrectly used as identifier.
14592 Allow identifiers prefixed by @.
14594 2005-03-10 Marek Safar <marek.safar@seznam.cz>
14596 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
14597 It caused exception in namespace resolving (again!).
14599 * class.cs (Class.ctor): Removed exit.
14600 (PropertyMethod.ctor): ditto.
14602 * codegen.cs (Codegen.Reset): Reset static data.
14603 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
14605 * cs-tokenizer.cs (Cleanup): Removed.
14607 * driver.cs (GetSystemDir): Rewrote to one line command.
14608 It caused problem with unloaded dynamic modules.
14609 (UnixParseOption): Removed Exit.
14610 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
14611 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
14612 Now can be mcs used as library.
14614 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
14617 * location.cs (Reset): Reset static data.
14619 * namespace.cs (Reset): Reset static data.
14621 * report.cs (Report.Reset): Reset static data.
14623 * rootcontext.cs (RootContext.Reset): Reset static data.
14625 * tree.cs (RootTypes.ctor): Use Location.Null
14627 * typemanager.cs (TypeManager.Reset): Reset static data.
14628 (CoreLookupType): Removed Exit.
14629 (TypeHandle.Reset): Reset static data.
14631 2005-03-10 Raja R Harinath <rharinath@novell.com>
14634 * typemanager.cs (ComputeNamespaces): Import namespaces from
14635 referenced modules too.
14637 2005-03-09 Raja R Harinath <rharinath@novell.com>
14639 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
14642 2005-03-09 Raja R Harinath <rharinath@novell.com>
14644 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
14645 enclosing DeclSpace. This ensures that a name-lookup populates
14646 more caches and there are fewer 'TypeExpression's. Carve out
14647 nested type lookup into ...
14648 (LookupNestedTypeInHierarchy): ... this.
14650 2005-03-09 Raja R Harinath <rharinath@novell.com>
14652 Clean up a few partial-class semantics.
14653 Fixes test-357.cs and cs1618-2.cs.
14654 * cs-parser.jay (struct_declaration): Use 'current_class' as
14655 parent of newly-created struct. Remove call to Register ().
14656 Use 'pop_current_class' to complete handing the current struct.
14657 (interface_declaration): Likewise.
14658 (class_declaration): Likewise.
14659 (enum_declaration): Use 'current_class' as parent of newly created
14661 (delegate_declaration): Likewise.
14662 (pop_current_class): New function. This is used to handle closing
14663 up the 'current_class' and 'current_container', and pointing them
14664 to the enclosing class/container.
14665 (CSharpParser): Initialize 'current_class' too.
14666 * decl.cs (MemberCore): Add check for invariant: a partial
14667 container is not a parsed entity, and thus does not enclose any
14669 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
14670 (DeclSpace.BaseTypeExpr): Use it.
14671 (DeclSpace.LookupType): Add check for invariant.
14672 * class.cs (TypeContainer): Add check for invariant: a nested
14673 class should have the same NamespaceEntry as its enclosing class.
14674 (TypeContainer.EmitFieldInitializers): Make virtual.
14675 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
14677 (TypeContainer.Register): Remove.
14678 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
14679 null. Use TypeResolveEmitContext for resolving base types and
14680 interfaces. Move initialization of Parts.TypeBuilder here from
14682 (TypeContainer.DefineNestedTypes): ... here.
14683 (PartialContainer): Take a Namespace not a NamespaceEntry.
14684 (PartialContainer.Create): Don't use Register. Call the
14685 appropriate Add... function directly.
14686 (ClassPart): Take both the PartialContainer and the enclosing
14687 class as constructor arguments.
14688 (ClassPart.EmitFieldInitializers): Override.
14689 (ClassPart.PartFindNestedTypes): Remove.
14690 (FieldBase.GetInitializerExpression): Resolve the initializer
14691 expression in the emit context of the enclosing class.
14692 * tree.cs (RootTypes): Remove Register ().
14694 2005-03-08 Marek Safar <marek.safar@seznam.cz>
14696 * cs-parser.jay: Removed CS0134.
14698 * driver.cs: Removed CS1901.
14700 * expression.cs (SizeOf.DoResolve): Don't report CS0233
14701 for predefined types.
14703 2005-03-07 Duncan Mak <duncan@novell.com>
14705 * codegen.cs (Save): Catch UnauthorizedAccessException as
14706 well. Fixes bug #73454.
14708 2005-03-07 Marek Safar <marek.safar@seznam.cz>
14710 * cs-tokenizer.cs (xtoken): Add CS1035.
14712 * class.cs (MethodData.Define): Add CS0683.
14713 (FieldMember.ctor): Add CS0681.
14715 2005-03-07 Raja R Harinath <rharinath@novell.com>
14717 * ecore.cs (SimpleName.DoResolve): Rename from
14718 SimpleName.DoResolveAllowStatic.
14719 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
14720 Pass 'intermediate' flag to MemberStaticCheck.
14721 (SimpleName.MemberStaticCheck): Skip "static check" only in case
14722 of "intermediate" lookups via MemberAccess.
14723 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
14724 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
14726 2005-03-07 Raja R Harinath <rharinath@novell.com>
14729 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
14730 slipped in because of variable names that are identical to a
14731 builtin type's BCL equivalent ('string String;', 'int Int32;').
14732 (PropertyExpr.EmitInstance): Likewise.
14734 2005-03-04 Marek Safar <marek.safar@seznam.cz>
14736 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
14738 * report.cs (warning_ignore_table): Made public.
14740 2005-03-04 Raja R Harinath <rharinath@novell.com>
14743 * class.cs (MethodData.Emit): Pass 'container' to
14744 container.GetObsoleteAttribute instead of 'container.Parent'.
14746 2005-03-03 Marek Safar <marek.safar@seznam.cz>
14748 * cs-parser.jay: Add 1534 error test.
14750 * iterators.cs (Yield.CheckContext): Add error 1629.
14751 (Iterator.ctor): Save unsafe modifier.
14752 (MoveNextMethod.DoEmit): Restore unsafe context.
14754 * namespace.cs (UsingAlias): Better error message.
14756 2005-03-03 Dan Winship <danw@novell.com>
14758 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
14759 the warning message [#73219]
14761 2005-03-03 Raja R Harinath <rharinath@novell.com>
14763 Fix compile with MCS 1.0.0.0.
14764 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
14765 w_restore to not depend on string constant folding.
14767 2005-03-03 Raja R Harinath <rharinath@novell.com>
14769 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
14770 CS0246 check to users who passed 'silent = false'.
14771 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
14773 (SimpleName.SimpleNameResolve): Update.
14774 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
14775 (MemberAccess.IdenticalNameAndTypeName): Update.
14776 * doc.cs (FindDocumentedTypeNonArray): Update.
14778 2005-03-03 Raja R Harinath <rharinath@novell.com>
14780 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
14781 * parameters.cs (ComputeAndDefineParameters): Remove.
14782 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
14783 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
14784 Use GetParameterInfo.
14786 2005-03-02 Marek Safar <marek.safar@seznam.cz>
14788 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
14790 2005-03-02 Raja R Harinath <rharinath@novell.com>
14792 Unify DeclSpace.LookupType and DeclSpace.FindType.
14793 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
14794 is in charge of defining nested types on demand.
14795 (DeclSpace.LookupType): Use it when the current_type is a
14796 TypeBuilder. Use LookupTypeDirect for reflected types.
14797 (DeclSpace.FindType): Remove.
14798 (DeclSpace.LookupInterfaceOrClass): Likewise.
14799 (DeclSpace.DefineTypeAndParents): Likewise.
14800 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
14801 DeclSpace.LookupType.
14802 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
14803 * typemanager.cs (LookupType): Simplify.
14804 (AddUserType): Remove type from negative_hits.
14805 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
14806 * class.cs (TypeContainer.FindMembers): Move handling of nested
14808 (TypeContainer.FindMembers_NestedTypes): ... here.
14809 (TypeContainer.FindNestedType): Implement override.
14810 (ClassPart.FindNestedType): Delegate to PartialContainer.
14811 (ClassPart.PartFindNestedType): Looks up the nested types of the
14814 2005-03-02 Martin Baulig <martin@ximian.com>
14816 * class.cs (TypeContainer.DoDefineMembers): We also need a default
14817 static constructor in static classes.
14819 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
14821 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
14822 sizeParamIndex is not specified.
14824 2005-03-01 Marek Safar <marek.safar@seznam.cz>
14827 * report.cs (WarningMessage.IsEnabled): Missing null check.
14829 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14831 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
14832 in the fields and not in the properties.
14834 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
14836 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
14839 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14841 * attribute.cs: Small refactoring (improved robustness).
14842 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
14843 (ValidateGuid): Removed.
14844 (Resolve): Removed referenced to above mentioned.
14845 (GetAttributeUsage): Made private and changed to work without
14847 (GetIndexerAttributeValue): Don't crash.
14848 (GetConditionalAttributeValue): Ditto.
14849 (GetClsCompliantAttributeValue): Ditto.
14850 (ExtractSecurityPermissionSet): All attributes exceptions are
14852 (GetPropertyValue): New helper.
14853 (GetMethodImplOptions): New method.
14854 (DefinePInvokeMethod): Reuse common code. Implemented handling of
14855 some missing properties.
14857 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
14858 (Method.ApplyAttributeBuilder): Updated.
14860 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
14863 2005-02-28 Raja R Harinath <rharinath@novell.com>
14866 * report.cs (Report.SymbolRelatedToPreviousError): Handle
14867 non-simple types (array, pointer, reference).
14869 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14871 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
14873 * class.cs (MethodCore.IsDuplicateImplementation): Special error
14875 (Method.CheckBase): Catch wrong destructor here.
14876 (MethodData.Define): Add errors 550, 668.
14878 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
14880 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
14882 * pending.cs (VerifyPendingMethods): Add error 551.
14884 * typemanager.cs (CSharpName): Next error report helper.
14886 2005-02-25 Marek Safar <marek.safar@seznam.cz>
14888 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
14889 attributes. Removed useless attribute double check.
14890 It saves almost 2MBs for corlib.
14892 2005-02-25 Raja R Harinath <rharinath@novell.com>
14895 * statement.cs (ExpressionStatement.Resolve): Make robust to being
14896 called twice in case of error.
14898 2005-02-23 Chris Toshok <toshok@ximian.com>
14900 Fix compiler portions of #72827.
14901 * statement.cs (Block.Emit): call Begin/EndScope on the
14902 EmitContext instead of the ILGenerator.
14904 * codegen.cs (EmitContext.BeginScope): new method, call
14905 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
14907 (EmitContext.BeginScope): same, but EndScope and CloseScope
14909 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
14910 offset and call the superclass's OpenScope(int) with it.
14911 (SymbolWriter.CloseScope): get the current il
14912 offset and call superclass's CloseScope(int) with it.
14914 2005-02-23 Marek Safar <marek.safar@seznam.cz>
14916 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
14917 CS1677 for out and ref as well.
14919 * class.cs (Method.Define): Add error CS1599 detection.
14921 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
14923 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
14925 * delegate.cs (Delegate.Define): Add error CS1599 detection.
14927 * support.cs.cs (ModifierDesc): New helper method.
14929 2005-02-23 Raja R Harinath <rharinath@novell.com>
14930 Abin Thomas <projectmonokochi@rediffmail.com>
14931 Anoob V E <projectmonokochi@rediffmail.com>
14932 Harilal P R <projectmonokochi@rediffmail.com>
14934 Fix #57851, #72718.
14935 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
14936 MemberLookup (used for error reporting) actually returns a result.
14937 Fix error report number (122, not 112).
14939 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
14940 Anoob V E <projectmonokochi@rediffmail.com>
14941 Harilal P R <projectmonokochi@rediffmail.com>
14944 * pending.cs (PendingImplementation.GetAbstractMethods):
14945 Find NonPublic members too.
14947 2005-02-22 Marek Safar <marek.safar@seznam.cz>
14949 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
14952 * class.cs (MethodCore.CheckMethodAgainstBase):
14953 Add error 239 report.
14955 2005-02-21 Raja R Harinath <rharinath@novell.com>
14958 * expression.cs (Invocation.IsApplicable): Make public.
14959 (Invocation.IsParamsMethodApplicable): Likewise.
14960 * delegate.cs (Delegate.VerifyApplicability): Don't use
14961 Invocation.VerifyArgumentCompat for parameter applicability
14962 testing. Use Invocation.IsApplicable and
14963 Invocation.IsParamsMethodApplicable.
14965 2005-02-21 Marek Safar <marek.safar@seznam.cz>
14967 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
14969 * class.cs (Operator.Define): Add error 217 report.
14971 2005-02-21 Raja R Harinath <rharinath@novell.com>
14973 * namespace.cs (UsingEntry.Resolve): Undo change below.
14975 2005-02-21 Raja R Harinath <rharinath@novell.com>
14978 * ecore.cs (Expression.MemberLookupFailed): Add argument to
14979 disable the error message when the extended MemberLookup also
14981 (Expression.MemberLookupFinal): Update.
14982 (SimpleName.DoSimpleNameResolve): Update.
14983 * expression.cs (MemberAccess.ResolveNamespaceOrType):
14984 Don't use MemberLookupFinal.
14985 (New.DoResolve): Update.
14986 (BaseAccess.CommonResolve): Update.
14988 2005-02-21 Raja R Harinath <rharinath@novell.com>
14991 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
14992 occured previously, don't resolve again.
14994 2005-02-21 Marek Safar <marek.safar@seznam.cz>
14997 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
14998 argument. Call ResolveAttributeUsage for unresolved.
14999 when types doesn't match ctor arguments.
15001 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
15002 for nested attribute classes.
15003 (Class.attribute_usage): Removed.
15004 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
15005 for attribute class.
15007 * ecore.cs (IsAttribute): Removed.
15009 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
15011 * rootcontext.cs (RegisterAttribute): Removed, attributes are
15013 (attribute_types): Removed.
15014 (EmitCode): Global attributes are emited as the latest.
15016 2005-02-18 Marek Safar <marek.safar@seznam.cz>
15018 * class.cs (EmitFieldInitializers): Don't emit field initializer
15019 for default values when optimilization is on.
15021 * constant.cs (Constant.IsDefaultValue): New property.
15023 * driver.cs: Add /optimize handling.
15027 * literal.cs: Implement new IsDefaultValue property.
15029 * rootcontext.cs (Optimize): New field, holds /optimize option.
15031 2005-02-18 Raja R Harinath <rharinath@novell.com>
15033 Fix crasher in re-opened #72347.
15034 * namespace.cs (Namespace.Lookup): Return null if
15035 DeclSpace.DefineType returns null.
15038 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
15040 2005-02-18 Raja R Harinath <rharinath@novell.com>
15042 Fix remainder of #63202. Change semantics of DoResolveLValue: it
15043 now returns null if it cannot resolve to an lvalue.
15044 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
15045 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
15046 returned null. Remove check for SimpleName.
15047 (EventExpr.DoResolveLValue): New.
15048 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
15049 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
15051 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
15052 avoid CS0131 error.
15053 (Unary.ResolveOperator): Move CS0211 check ...
15054 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
15056 (Unary.DoResolveLValue): Simplify.
15057 (AddressOf.DoResolveLValue): New.
15058 (ArrayAccess.DoResolveLValue): New.
15060 2005-02-16 Marek Safar <marek.safar@seznam.cz>
15062 * attribute.cs (Attribute.Resolve): Add arguments casting for
15063 when types doesn't match ctor arguments.
15065 2005-02-16 Raja R Harinath <rharinath@novell.com>
15067 Fix parts of #63202.
15068 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
15069 lookup of operator in base type. Ensure that all checks happen
15070 when the operator resolves to an "op_..." method.
15072 2005-02-15 Raja R Harinath <rharinath@novell.com>
15075 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
15076 'ignore_cs0104' parameter. Pass it to ...
15077 (NamespaceEntry.Lookup): ... this.
15078 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
15079 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
15080 (TypeLookupExpression.DoResolveAsTypeStep): Update.
15081 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
15082 Update. Request that cs0104 errors be ignored.
15083 (ComposedCast.ResolveAsTypeStep): Update.
15085 2005-02-14 Raja R Harinath <rharinath@novell.com>
15088 * expression.cs (Invocation.BetterFunction): Remove support for
15089 comparing virtual functions and their overrides.
15090 (Invocation.IsOverride): New.
15091 (Invocation.OverloadResolve): Don't consider 'override' functions
15092 during candidate selection. Store them in a lookaside list.
15093 If the selected method is a 'virtual' function, use the list to
15094 find any overrides that are closer to the LHS type.
15096 2005-02-14 Marek Safar <marek.safar@seznam.cz>
15098 * expression.cs (New.DoResolve): Add complex core type reduction.
15099 (New.Constantify): Converts complex core type syntax like 'new int ()'
15100 to simple constant.
15102 2005-02-14 Raja R Harinath <rharinath@novell.com>
15104 * decl.cs (EntryType.EntryType): New constructor to create an
15105 updated copy of a cache entry.
15106 (MemberCache.AddMethods): Use it.
15107 (MemberCache.ClearDeclaredOnly): Remove.
15108 (MemberCache.MemberCache): Update.
15110 2005-02-11 Miguel de Icaza <miguel@novell.com>
15112 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
15113 variable. This one is represents the actual low-level declaration
15114 of the method, as opposed to the semantic level `IsStatic'.
15116 An anonymous method which is hosted into a static method might be
15117 actually an instance method. IsStatic would reflect the
15118 container, while MethodIsStatic represents the actual code
15121 * expression.cs (ParameterReference): Use the new MethodIsStatic
15122 instead of IsStatic.
15124 * anonymous.cs (AnonymousMethod.Compatible): Pass the
15125 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
15126 set on the current EmitContext.
15128 * expression.cs (Cast): Overload DoResolveLValue so we can pass
15129 resolve our casted expression as an LValue. This triggers the
15130 proper LValue processing that is later required by Assign.
15134 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
15136 2005-02-11 Marek Safar <marek.safar@seznam.cz>
15138 C# 2.0 Fixed buffer implementation
15140 * anonymous.cs: Update after RegisterHelperClass renaming.
15142 * attribute.cs (AttributeTester.fixed_buffer_cache):
15143 Cache of external fixed buffers.
15144 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
15145 implementation if field is fixed buffer else null.
15148 (TypeContainer.AddField): Accept FieldMember instead of Field.
15149 (FieldBase.IsFieldClsCompliant): Extracted code from
15150 VerifyClsCompliance descendant customization.
15151 (FixedField): New class handles fixed buffer fields.
15152 (FixedFieldExternal): Keeps information about imported fixed
15154 (IFixedField): Make access to internal or external fixed buffer
15157 * cs-parser.jay: Add fixed buffer parsing.
15159 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
15162 * expression.cs (Indirection): Extended implementation to accept
15163 fixed buffer field.
15164 (PointerArithmetic.Emit): Get element from fixed buffer as well.
15165 (ElementAccess.MakePointerAccess): Get type as parameter.
15166 (DoResolve): Add fixed buffer field expression conversion.
15167 (DoResolveLValue): Ditto.
15168 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
15169 (ArrayPtr): Derives from FixedBufferPtr.
15170 (ArrayPtr.Emit): Add extra emit for array elements.
15172 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
15174 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
15175 for compiler generated types.
15176 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
15178 * statement.cs (Fixed): Refactored to be easier add fixed buffer
15179 and consume less memory.
15180 (Fixed.Resolve): Add fixed buffer case.
15182 * typemanager.cs (compiler_generated_attr_ctor,
15183 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
15184 (HasElementType): Add our own implementation to work on every
15187 2005-02-11 Miguel de Icaza <miguel@novell.com>
15189 * anonymous.cs (CaptureContext): Track whether `this' has been
15192 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
15193 only captured `this' if it was implicitly done (instance
15194 methods/variables were used).
15196 * codegen.cs (EmitContext.CaptureThis): New method to flag that
15197 `this' must be captured.
15199 2005-01-30 Miguel de Icaza <miguel@novell.com>
15201 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
15202 is null it means that there has been no need to capture anything,
15203 so we just create a sibling.
15205 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
15207 Just a partial fix. The other half is fairly elusive.
15209 2005-02-10 Raja R Harinath <rharinath@novell.com>
15211 Fix #52586, cs0121-4.cs.
15212 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
15213 and return a hashtable.
15214 (MemberCache.ClearDeclaredOnly): New.
15215 (MemberCache.MemberCache): Update to change. Make a deep copy of
15216 the method_hash of a base type too.
15217 (MemberCache.AddMethods): Adapt to having a deep copy of the base
15218 type methods. Overwrite entries with the same MethodHandle so
15219 that the ReflectedType is correct. The process leaves in base
15220 virtual functions and their overrides as distinct entries.
15221 (CacheEntry): Now a class instead of a struct. It shouldn't alter
15222 matters since it was boxed in a ArrayList before.
15223 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
15225 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
15226 case of a virtual function and its override (choose the overload
15228 (Invocation.OverloadResolve): Avoid 'override' members during
15229 'applicable_type' calculation.
15231 2005-02-09 Raja R Harinath <rharinath@novell.com>
15233 Combine two near-redundant caches.
15234 * typemanager.cs (method_params): Rename from method_internal_params.
15235 (TypeManager.GetParameterData): New. Replace
15236 Invocation.GetParameterData.
15237 (TypeManager.LookupParametersByBuilder): Remove.
15238 * expression.cs (Invocation.method_parameter_cache): Remove.
15239 (Invocation.GetParameterData): Remove.
15241 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
15244 2005-02-08 Raja R Harinath <rharinath@novell.com>
15247 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
15248 TypeManager.multicast_delegate_type is null, resolve it by looking
15249 up "System.MulticastDelegate".
15250 * rootcontext.cs (RootContext.ResolveCore): Simplify.
15252 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
15253 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
15254 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
15257 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
15258 (LabeledStatement.AddReference): New. Set 'referenced'.
15259 (Goto.Resolve): Use it.
15261 2005-02-05 John Luke <john.luke@gmail.com>
15263 * driver.cs: remove duplicate -doc line in Usage ()
15265 2005-02-04 Raja R Harinath <rharinath@novell.com>
15267 * location.cs (Location.AddFile): Fix CS2002 error report.
15269 2005-02-02 Martin Baulig <martin@ximian.com>
15271 * delegate.cs (Delegate.DefineType): Report an internal error if
15272 TypeManager.multicast_delegate_type is null. See bug #72015 for
15275 2005-02-02 Raja R Harinath <rharinath@novell.com>
15277 Fix a crasher in a variant of #31984.
15278 * const.cs (Constant.CheckBase): New override that defers the
15279 new-or-override check in case the base type hasn't been populated
15281 (Constant.Define): Ensure the new-or-override check is performed.
15283 2005-02-01 Duncan Mak <duncan@ximian.com>
15285 * const.cs (LookupConstantValue): Check that `ce' is not null
15286 before calling GetValue ().
15288 2005-02-01 Raja R Harinath <rharinath@novell.com>
15290 Fix test-334.cs (#69519).
15291 * cs-parser.jay (using_alias_directive): Pass in an expression to
15292 NamespaceEntry.UsingAlias.
15293 (using_namespace_directive): Pass in an expression to
15294 NamespaceEntry.Using.
15295 (namespace_name): Don't flatten to a string.
15296 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
15297 (NamespaceEntry.AliasEntry.Resolve): Lookup using
15299 (NamespaceEntry.UsingEntry): Likewise.
15300 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
15302 (NamespaceEntry.LookupForUsing): Remove.
15303 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
15305 (NamespaceEntry.Lookup): Remove support for dotted names.
15307 2005-02-01 Raja R Harinath <rharinath@novell.com>
15309 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
15311 (NamespaceEntry.ImplicitParent): Compute on demand.
15312 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
15313 parallels the current.
15314 (NamespaceEntry.LookupForUsing): Use it.
15315 (NamespaceEntry.Lookup): If the current namespace-entry is
15316 implicit, don't search aliases and using tables.
15318 2005-02-01 Raja R Harinath <rharinath@novell.com>
15321 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
15323 (TypeContainer.BaseCache): Compute on demand.
15324 (TypeContainer.FindMembers): Define constants and types if they're
15325 not already created.
15326 (FieldMember.Define): Move resetting of ec.InUnsafe before error
15328 * const.cs (Constant.Define): Make idempotent.
15330 2005-01-29 Miguel de Icaza <miguel@novell.com>
15332 * pending.cs: Produce better code (no nops produced by using Ldarg
15335 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
15336 i - 1' it should be arg + 1.
15340 2005-01-28 Raja R Harinath <rharinath@novell.com>
15342 * attribute.cs (Attribute.CheckAttributeType): Make private
15344 (Attribute.ResolveType): Make virtual.
15345 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
15346 handling of RootContext.Tree.Types.
15348 2005-01-27 Raja R Harinath <rharinath@novell.com>
15350 Update attribute-handling to use the SimpleName/MemberAccess
15352 * cs-parser.jay (attribute): Pass in an expression to the
15353 constructors of Attribute and GlobalAttribute.
15354 * attribute.cs (Attribute): Take an expression for the name.
15355 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
15356 passed in attribute name expression.
15357 (Attribute.CheckAttributeType): Use it.
15358 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
15359 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
15360 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
15361 argument to prevent error messages if the lookup fails.
15363 2005-01-27 Marek Safar <marek.safar@seznam.cz>
15365 * expression.cs (Indirection): Implemented IVariable interface
15366 to support indirection in AddressOf operator.
15367 (PointerArithmetic.Emit): Add optimalization for case where
15368 result can be precomputed.
15370 2005-01-26 Martin Baulig <martin@ximian.com>
15372 * class.cs (TypeContainer.AttributeTargets): Return the correct
15373 AttributeTargets depending on our `Kind' instead of throwing an
15374 exception; fixes #71632.
15376 2005-01-26 Marek Safar <marek.safar@seznam.cz>
15379 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
15382 2005-01-25 Raja R Harinath <rharinath@novell.com>
15385 * expression.cs (MemberAccess.DoResolve): Don't complain with
15386 cs0572 when the LHS of a member access has identical name and type
15389 2005-01-25 Marek Safar <marek.safar@seznam.cz>
15392 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
15394 Create custom PermissionSet only for PermissionSetAttribute.
15396 2005-01-24 Marek Safar <marek.safar@seznam.cz>
15399 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
15400 delegates in static class.
15402 2005-01-24 Martin Baulig <martin@ximian.com>
15404 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15405 merging an implicit block, just use its reachability.
15407 * statement.cs (Block.Resolve): Make the unreachable code check
15408 work wrt. implicit blocks; see test-337 from #63842.
15410 2005-01-21 Alp Toker <alp@atoker.com>
15412 * cs-parser.jay: destructor_declaration's container is PartialContainer
15413 not Class when partial types are used, so use Kind prop instead of
15416 2005-01-22 Miguel de Icaza <miguel@ximian.com>
15418 * cs-parser.jay: Improve error reporting when an interface
15419 declares new types.
15421 2005-01-20 Dick Porter <dick@ximian.com>
15423 * support.cs: SeekableStreamReader fix from Sandor Dobos
15424 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
15425 chars are read. Fixes bug 70369.
15427 2005-01-20 Raja R Harinath <rharinath@novell.com>
15429 * cs-parser.jay (catch_clause): Simplify current_block handling
15432 2005-01-17 Miguel de Icaza <miguel@ximian.com>
15434 * convert.cs (ImplicitStandardConversionExists): Synchronize the
15435 code with ImplicitStandardConversion to handle the implicit
15436 conversion of method groups into valid delegate invocations.
15438 The problem is that in parameter handling we were using this code
15439 path. Fixes bug #64698
15441 2005-01-19 Raja R Harinath <rharinath@novell.com>
15443 * cs-parser.jay: Fix several infelicities.
15444 - Avoid assigning to the parser value stack. Code like
15445 '$3 = null' is unclean. Synthesize a value for the code block
15447 - Avoid using oob_stack for storing location information. Use ...
15448 (_mark_): ... this. New (empty) rule. Saves the current location
15450 (foreach_statement): Avoid using oob_stack for current_block
15451 handling. Use technique used in for_statement and
15452 using_statement. Synthesize a value for the code block to store
15453 additional intermediate information.
15455 2005-01-13 Miguel de Icaza <miguel@ximian.com>
15457 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
15458 of a different type is only allowed to private fields of a
15459 containing type, not on fields of a base class.
15461 See test-174.cs and error cs0122-9.cs
15463 2005-01-13 Raja R Harinath <rharinath@novell.com>
15465 Fix test-335.cs (bug #58126).
15466 * cs-parser.jay (argument): Split out non-expression parts of the
15467 rule into 'non_simple_argument'.
15468 (invocation_expression): Support parenthesized invocations with
15469 multiple arguments, and with single non-simple arguments.
15471 2005-01-13 Raja R Harinath <rharinath@novell.com>
15473 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
15476 2005-01-12 Raja R Harinath <rharinath@novell.com>
15478 Fix cs0038-1.cs, cs1640-6.cs.
15479 * ecore.cs (Expression.Resolve): Remove special-case for
15480 SimpleName in error-handling.
15481 (Expression.almostMatchedMembers): Relax access permission to
15483 (Expression.MemberLookupFailed): Handle duplicates in
15484 almostMatchedMembers list.
15485 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
15486 * expression.cs (New.DoResolve): Report CS1540 for more cases.
15487 * typemanager.cs (GetFullNameSignature): Use the MethodBase
15488 overload if the passed in MemberInfo is a MethodBase.
15490 2005-01-12 Marek Safar <marek.safar@seznam.cz>
15493 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
15494 for non-CAS & merge permission sets properly.
15496 2005-01-11 Raja R Harinath <rharinath@novell.com>
15498 Improve standard-compliance of simple name and member access
15499 resolution. Fixes bugs #52697, #57200, #67520, #69519.
15500 * ecore.cs (FullNamedExpression): New abstract base class
15501 for Namespaces and TypeExpressions.
15502 (ResolveFlags.SimpleName): Remove.
15503 (SimpleName): Remove support for dotted names.
15504 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
15505 DeclSpace.FindType and DeclSpace.LookupType.
15506 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
15507 (Expression.ExprClassName): Make member function.
15508 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
15509 a namespace. Remove creation of dotted "SimpleName"s.
15510 (MemberAccess.DoResolve): Likewise.
15511 * decl.cs (DeclSpace.Cache): Make private.
15512 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
15513 (DeclSpace.FindType): Update.
15514 (DeclSpace.LookupType): Move here from RootContext. Return a
15515 FullNamedExpression.
15516 * namespace.cs (Namespace): Derive from FullNamedExpression
15517 so that it can be part of expression resolution.
15518 (Namespace.Lookup): Return an FullNamedExpression.
15519 (NamespaceEntry.LookupAlias): Lookup aliases only in current
15521 * rootcontext.cs (NamespaceLookup): Remove.
15522 (LookupType): Move to DeclSpace.
15523 * attribute.cs (CheckAttributeType): Update.
15524 * doc.cs (FindDocumentedType): Remove allowAlias argument.
15525 (FindDocumentedTypeNonArray): Likewise.
15527 2005-01-11 Raja R Harinath <rharinath@novell.com>
15529 Fix cs0509.cs, cs1632.cs.
15530 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
15531 is the same as IsInterface.
15532 (TypeContainer.GetClassBases): Likewise.
15533 * statement.cs (LabeledStatement.ig): New field.
15534 (LabeledStatement.LabelTarget): Save ILGenerator which created the
15536 (LabeledStatement.DoEmit): Check that the label was created with
15537 the same ILGenerator.
15539 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15542 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
15543 accessors to its properties.
15545 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
15546 from accessors to property.
15548 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15551 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
15552 only for overrides.
15554 2005-01-08 Miguel de Icaza <miguel@ximian.com>
15556 * attribute.cs: Check for null and empty strings.
15558 I have lost another battle to Paolo.
15560 2005-01-07 Marek Safar <marek.safar@seznam.cz>
15563 * class.cs (PropertyMethod): Set Parent field in ctors.
15564 (SetMethod.InternalParameters): Add unsafe switch hack.
15565 Override MarkForDuplicationCheck where it is appropriate.
15567 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
15568 It says whether container allows members with the same name.
15569 Base default is no.
15570 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
15571 Removed is_method parameter.
15573 2005-01-06 Duncan Mak <duncan@ximian.com>
15575 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
15576 because the previous change led to incorrect reporting of CS1032
15577 ("Cannot define/undefine preprocessor symbols after first token in
15578 file"). Instead of using `tokens_seen' as the only flag that
15579 triggers CS1040, introduce `comments_seen'. This new flag is used
15580 to signify having seen comments on the current line, so it is
15581 unset after a newline.
15583 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15585 * doc.cs : When searching for a type, find nested type too.
15586 This fixes bug #71040.
15588 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15591 - Warn missing member comment on those classes which also does not
15592 have doc comments. Fixed bug #71041.
15593 - Don't warn missing doc comment on default constructor.
15596 2005-01-06 Duncan Mak <duncan@ximian.com>
15598 * cs-tokenizer.cs (xtoken): After handling traditional C-style
15599 comments, set `tokens_seen' to true. This allows us to detect
15600 misplaced preprocessor directives (i.e. not at the beginning of
15601 the a line, nor after whitespaces). In that case, report error
15602 CS1040. This fixes bug #56460.
15604 * cs-parser.jay (interface_member_declaration): Add checks for
15605 IsExplicitImpl, and report CS0541 error if an interface member is
15606 defined as an explicit interface declaration.
15608 2005-01-06 Marek Safar <marek.safar@seznam.cz>
15611 * class.cs (PropertyMethod): Set Parent field in ctors.
15612 (SetMethod.InternalParameters): Add unsafe switch hack.
15614 * decl.cs (MemberCore.Parent): Cannot be readonly.
15616 2005-01-06 Raja R Harinath <rharinath@novell.com>
15618 * decl.cs (DeclSpace.ResolveType): Remove.
15619 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
15620 Merge in code from ...
15621 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
15622 * class.cs, enum.cs: Update to changes.
15624 2005-01-06 Miguel de Icaza <miguel@ximian.com>
15626 * anonymous.cs: Ensure that we init the scope of our parent if it
15627 has not been initialized yet.
15629 2004-12-30 Duncan Mak <duncan@ximian.com>
15631 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
15632 if field.FieldBuilder is null. Fixes #70758.
15634 * convert.cs: Fixed some typos and updated some of the comments.
15635 (ImplicitStandardConversionExists):
15636 (TryImplicitIntConversion): If `target_type' is an interface and
15637 the type of `ic' implements this interface, return true or a new
15638 BoxedCast instead of null. This fixes #70468.
15640 2004-12-29 Duncan Mak <duncan@ximian.com>
15642 * expression.cs (Argument.Emit): Check that Expr is
15643 IMemoryLocation before casting to it, and report CS1510 otherwise.
15647 2004-12-21 Ben Maurer <bmaurer@ximian.com>
15649 * statement.cs (Block.ThisVariable): remove the recursion here, to
15650 make the --profile more sane.
15652 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
15654 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
15655 assembly, by JB Evain.
15657 2004-12-17 Raja R Harinath <rharinath@novell.com>
15659 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
15660 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
15661 "parent" refers to enclosing type/class. "base" refers to superclass.
15663 2004-12-17 Raja R Harinath <rharinath@novell.com>
15665 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15666 Ensure that we only have GlobalAttributes.
15667 * attribute.cs (Attribute.Emit): Make non-virtual.
15668 (GlobalAttribute.Emit): Remove.
15669 (Attribute.Resolve): Make virtual.
15670 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
15671 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
15672 the argument. Don't create one.
15673 (Attribute.GetObsoleteAttribute): Likewise.
15674 (Attribute.GetClsCompliantAttributeValue): Likewise.
15675 * class.cs, decl.cs: Update to changes.
15677 2004-12-17 Marek Safar <marek.safar@seznam.cz>
15679 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
15681 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
15683 * statement.cs (Foreach.Resolve): Add error 186 report.
15685 2004-12-16 Marek Safar <marek.safar@seznam.cz>
15687 * expression.cs (Conditional.DoResolve): Add warning 429.
15689 * statement.cs (If.Resolve): Add warning 665.
15691 2004-12-16 Raja R Harinath <rharinath@novell.com>
15693 New invariant: RootContext.Tree.Types.NamespaceEntry == null
15694 except when in the parser, and in GlobalAttribute.
15695 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
15696 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
15697 RootContext.Tree.Types.NamespaceEntry once work is done.
15698 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
15699 and resets RootContext.Tree.Types.NamespaceEntry.
15701 2004-12-15 Marek Safar <marek.safar@seznam.cz>
15703 * cs-parser.jay: Don't create a block for every variable.
15705 2004-12-14 Miguel de Icaza <miguel@ximian.com>
15707 * location.cs: Provide extra information.
15709 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
15710 variables from the captured environment, it is the ldarg_0.
15712 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15714 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
15717 * class.cs: Changed warning level for 169 to avoid developer
15718 displeasure from warning flooding. It will be changed back when they
15719 fix most of current BCL warnings.
15721 * RootContext.cs: Pushed default WarningLevel to 3.
15723 * statement.cs: Removed unused variable.
15725 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15727 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
15728 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
15729 Add error 502 report.
15730 (StaticClass.DefineType): Add error 441 report.
15731 (Class.AllowedModifiersProp): New virtual property as temporary
15732 extension to AllowedModifiers.
15733 (Class.DefineType): Add error 418 report. Moved ModFlags check here
15734 to share implementation with StaticClass and don't call virtual
15737 * driver.cs (MainDriver): Add error 1558 test.
15739 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
15740 report. Moved error 36 test here.
15742 * statement.cs (Throw.Resolve): Add error 724 report.
15744 * typemanager.cs: Add out_attribute_type core type.
15746 2004-12-13 Marek Safar <marek.safar@seznam.cz>
15748 * class.cs (TypeContainer.VerifyClsCompliance): Add error
15750 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
15752 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
15755 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
15757 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
15758 Add error 3023 report.
15759 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
15761 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
15764 2004-12-12 John Luke <john.luke@gmail.com>
15766 * driver.cs (AddArgs): take -- into account when
15767 adding arguments, fixes bug 65710
15769 2004-12-12 Martin Baulig <martin@ximian.com>
15771 * expression.cs (Unary.TryReduceNegative): Added support for
15772 SByteConstant and ByteConstant.
15773 (Unary.Reduce): Check error values from TryReduceNegative().
15775 2004-12-10 Marek Safar <marek.safar@seznam.cz>
15777 * attributes.cs (Attribute.Resolve): Avoid multiple error report
15778 and report exception as error 182.
15780 2004-12-10 Raja R Harinath <rharinath@novell.com>
15782 * driver.cs (Main): Fix message when there are warnings.
15784 2004-12-09 Miguel de Icaza <miguel@ximian.com>
15786 * delegate.cs: Fixed my fix from yesterday, sorry about that.
15788 2004-12-09 Marek Safar <marek.safar@seznam.cz>
15790 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
15791 Reduced number of warnings.
15793 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
15795 2004-12-08 Miguel de Icaza <miguel@ximian.com>
15797 * driver.cs: Removed message.
15799 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
15801 2004-12-08 <vargaz@freemail.hu>
15803 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
15805 2004-12-08 Martin Baulig <martin@ximian.com>
15807 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
15808 instead of a CS3002 for properties and indexer.
15810 2004-12-08 Martin Baulig <martin@ximian.com>
15812 * decl.cs (MemberName.ToString): Make this work again.
15814 2004-12-08 Marek Safar <marek.safar@seznam.cz>
15816 * attribute.cs (Resolve): Add error 591 detection.
15818 * class.cs (FieldMember.Define): Add error 1547 detection.
15819 (Indexer.Define): Add error 620 detection.
15820 (Operator.Define): Add error 590 detection.
15822 * ecore.cs: Missing argument for error 79.
15824 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
15827 2004-12-07 Marek Safar <marek.safar@seznam.cz>
15830 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
15833 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
15835 * cs-parser.jay : handle doc comments on implicit/explicit operators.
15836 Some operator comments were suppressed.
15837 * doc.cs : Implicit/explicit operator name in doc comments are like
15838 "op_Explicit(type)~returnType", so added suffix handling.
15840 2004-12-07 Martin Baulig <martin@ximian.com>
15843 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
15844 (MemberCore.GetClsCompliantAttributeValue): Likewise.
15845 (DeclSpace.ec): New protected field; store the EmitContext here.
15846 (DeclSpace.EmitContext): New public property; moved here from
15848 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
15851 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
15852 (Enum.Emit): Don't create a new EmitContext.
15854 * delegate.cs (Delegate.DefineType): Always create the
15857 * iterators.cs (Iterators.DefineIterator): Create a new
15858 EmitContext and store it in `ec'.
15860 2004-08-24 Martin Baulig <martin@ximian.com>
15863 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
15864 this for accessibility checks.
15865 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
15866 IsNestedFamilyAccessible.
15867 (TypeManager.IsSubclassOf): New method, do what the name actually
15870 2004-12-06 Raja R Harinath <rharinath@novell.com>
15872 Fix crash on cs0657-17.cs.
15873 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15874 Use RootContext.Tree.Types, not 'new RootTypes ()'.
15875 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
15876 the case where the NamespaceEntry gets overwritten.
15878 2004-12-06 Marek Safar <marek.safar@seznam.cz>
15880 Fixed #69195, #56821
15881 * ecore.cs (ResolveBoolean): Tiny refactoring.
15883 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
15884 of right expression resolving when left is false constant and
15885 operator is LogicalAnd OR true constant and operator is LogicalOr.
15887 * statement.cs (ResolveUnreachable): Always reports warning.
15889 2004-12-05 Miguel de Icaza <miguel@ximian.com>
15891 * class.cs: Distinguish between 1721 and 1722 (just a little help
15892 for the programmer).
15894 2004-12-03 Miguel de Icaza <miguel@ximian.com>
15896 * delegate.cs: Only allow this on new versions of the language.
15898 2004-12-02 Duncan Mak <duncan@ximian.com>
15900 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
15902 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
15903 here as a static method. Take an additional bool out parameter
15904 `must_do_cs1540_check' for signaling to InstanceResolve.
15905 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
15906 member field from PropertyExpr class and made it an argument of
15907 the method instead.
15908 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
15909 check for MarshalByRefObject, and report CS0122 instead of CS1540.
15910 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
15911 and `remove_accessor' as well as InstanceResolve: report CS0122
15916 2004-12-03 Raja R Harinath <rharinath@novell.com>
15918 Fix test-327.cs, test-328.cs, and put in early infrastructure
15919 for eventually fixing #52697.
15920 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
15921 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
15922 from other methods.
15923 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
15924 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
15925 (VerifyUsing, error246): Update.
15926 * rootcontext.cs (RootContext.NamespaceLookup): Just use
15927 'NamespaceEntry.LookupNamespaceOrType'.
15929 2004-12-03 Martin Baulig <martin@ximian.com>
15931 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
15932 method as our child, call AnonymousMethod.Compatible() on it.
15934 2004-12-03 Raja R Harinath <rharinath@novell.com>
15936 Disable XML documentation support in 'basic' profile.
15937 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
15938 Redirect XmlElement to System.Object.
15939 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
15940 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
15941 * mcs.exe.sources: Add doc-bootstrap.cs.
15942 * doc-bootstrap.cs: New file. Contains empty stub implementation
15945 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
15947 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
15948 comments are allowed.
15950 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
15952 * delegate.cs: Add checks for subtypes in paramaters and return values
15953 in VerifyMethod () to add support for Covariance/Contravariance
15956 2004-12-02 Miguel de Icaza <miguel@ximian.com>
15958 * report.cs: Remove extra closing parenthesis.
15960 * convert.cs (Error_CannotImplicitConversion): If the name of the
15961 types are the same, provide some extra information.
15963 * class.cs (FieldBase): Use an unused bit field from the field to
15964 encode the `has_offset' property from the FieldMember. This saves
15965 a couple of Ks on bootstrap compilation.
15967 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
15968 method as our child, return the AnonymousMethod resolved
15971 * expression.cs (New.DoResolve): Allow return values from
15972 NewDelegate to also include AnonymousMethods.
15976 2004-12-02 Marek Safar <marek.safar@seznam.cz>
15979 * attribute.cs (Resolve): Improved implementation of params
15980 attribute arguments.
15982 * support.cs (ParameterData): Add HasParams to be faster.
15984 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
15986 all things are for /doc support:
15988 * doc.cs: new file that supports XML documentation generation.
15989 * mcs.exe.sources: added doc.cs.
15991 Handle /doc command line option.
15992 Report error 2006 instead of 5 for missing file name for /doc.
15993 Generate XML documentation when required, after type resolution.
15995 Added support for picking up documentation (/// and /** ... */),
15996 including a new XmlCommentState enumeration.
15998 Added lines to fill Documentation element for field, constant,
15999 property, indexer, method, constructor, destructor, operator, event
16000 and class, struct, interface, delegate, enum.
16001 Added lines to warn incorrect comment.
16003 Added Documentation field (passed only when /doc was specified).
16005 Added DocComment, DocCommentHeader, GenerateDocComment() and
16006 OnGenerateDocComment() and some supporting private members for
16007 /doc feature to MemberCore.
16009 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
16011 Added overriden DocCommentHeader.
16013 Added overriden DocCommentHeader and GenerateDocComment().
16015 2004-12-01 Miguel de Icaza <miguel@ximian.com>
16017 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
16018 unwrapping the enumeration values, chain to
16019 DoConstantNumericPromotions again, so we can promote things to the
16020 fundamental types (takes care of enums that are bytes, sbytes).
16024 2004-12-01 Raja R Harinath <rharinath@novell.com>
16026 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
16027 Fix long-standing bug in type-lookup. Use FindType instead of
16028 LookupType when ec.ResolvingTypeTree.
16029 (Attribute.ResolveType, Attribute.Resolve)
16030 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
16032 (Attributes.Search): Remove internal version. Update.
16033 (Attributes.SearchMulti): Update.
16034 (Attributes.GetClsCompliantAttribute): Remove.
16035 (Attributes.GetIndexerNameAttribute): Remove.
16036 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
16037 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
16038 * class.cs (Indexer.Define): Likewise.
16040 2004-12-01 Marek Safar <marek.safar@seznam.cz>
16043 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
16044 MarshallByReference members access.
16046 * expression.cs: Use CheckMarshallByRefAccess;
16047 Better error CS0197 message.
16049 * report.cs: Print whole related error message.
16051 2004-11-30 Raja R Harinath <rharinath@novell.com>
16053 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
16054 the current directory to help debugging.
16056 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16058 * class (GetClassBases): Better error 60 report.
16059 (EventProperty): Disabled warning 67 detection.
16061 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16064 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
16066 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
16069 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16072 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
16074 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
16076 2004-11-26 Miguel de Icaza <miguel@ximian.com>
16078 * attribute.cs (Attribute.Resolve): Refine error reporting and
16079 report a cs0117 if the identifier does not exist, to distinguish
16080 from 0617 which is a miss-use of the actual identifier.
16082 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
16083 between cs0070 and cs0079.
16085 * class.cs (MemberBase.DoDefine): When reporting a wrong
16086 accessibility level, we use MethodCore to compare instead of
16087 Method (this was a regression in some refactoring effort).
16089 So now we correctly report cs0056 again.
16091 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
16092 testing the target_type (which was known to be object_type) and
16093 not the source type (which is anonymous_method).
16095 Fixed reporting of error cs1660.
16097 * expression.cs (UserCast.Source): Expose the underlying cast.
16099 * statement.cs (Switch.SwitchGoverningType): Sort the list of
16100 allowed types to find a match to int32 first (most common).
16102 In addition, it ignores any ImplicitUserConversions that did an
16103 internal implicit conversion (as the switch statement allows only
16104 one integral conversion to exist).
16106 * class.cs (PartialContainer.Create): rename `name' to
16107 `member_name' for clarity. Then replace the string calls with a
16108 call to MemberName.GetPartialName, as now using
16109 MemberName.ToString is an error (this is due to the side effects
16110 it had, that were fixed in the past).
16112 This will restore the error reporting on a number of partial class
16113 errors that were missusing this (and getting an exception as a
16114 results, which is now just a plain textual warning, because
16115 yyparse debug output would crash otherwise).
16117 2004-11-26 Raja R Harinath <rharinath@novell.com>
16119 * Makefile (PROGRAM_INSTALL_DIR): Remove.
16121 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16123 * rootcontext.cs (LookupType): Make sure to cache lookups that
16124 don't give us a negative result. This saves about 5% of corlib
16127 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16129 * report.cs (AbstractMessage.Print): messages are sent to stderr
16131 * class.cs (TypeContainer.GetClassBases): It is an error to have a
16132 non-interface in the list of interfaces (at this point, either
16133 parent was properly set, or a base class is being listed in the
16134 interfaces section).
16136 This flags error 1722, and resolves the crash from bug 69259.
16138 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16140 * statement.cs (Using.EmitExpressionFinally): make this work right
16141 for valuetypes. Fixes 69926.
16143 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16145 * const.cs (Const.ChangeType): Cope with the "0 literal can be
16146 converted to an enum" here, before we try to change the underlying
16147 type. This code exists, but it is a different code path than the
16148 one used while encoding constants.
16150 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
16151 old bug: when converting from the null literal to a pointer,
16152 return an EmptyCast, not the NullLiteral.
16154 This fixes #69921, the recent null_type changes probably made this
16155 bug more prominent.
16157 (ImplicitReferenceConversionExists): In addition, resynchronized
16158 the code here, so it matches the same code in
16159 ImplicitReferenceConversionExists for the `from any class-type S
16160 to any interface-type T'.
16163 2004-11-25 Marek Safar <marek.safar@seznam.cz>
16165 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
16167 2004-11-24 Miguel de Icaza <miguel@ximian.com>
16169 * cs-parser.jay: Use verbosity accordingly.
16171 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16173 * expression.cs (Unary.ResolveOperator): Do not report warning;
16174 AddressOf reads from variable.
16176 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
16178 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16182 * attribute.cs (Attributable): Removed CheckTargets.
16183 (Attributes.Emit): Explicit attribute targets are tested here.
16185 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
16186 not enabled for interfaces.
16188 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
16189 (GetAssemblyName): Ouch next bug there.
16191 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16193 * expression.cs: Error 275 added.
16195 2004-11-23 Marek Safar <marek.safar@seznam.cz>
16197 Fix bug #69177 (Implemented decimal constant support)
16199 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
16200 (BinaryFold): Add DecimalConstant.
16202 * const.cs (Define): Decimal constant
16204 (ChangeType): Add decimal type handling.
16205 (LookupConstantValue): Don't set value for decimal type but
16206 emit DecimalConstantAttribute. Needed for constant optimization.
16208 * constant.cs (ToDecimal): New method.
16209 (ConvertToDecimal): New method.
16210 (IntConstant): Implemented ConvertToDecimal.
16211 (DecimalConstant.Emit): Emit optimized version for decimals in
16214 * expression.cs (ResolveOperator): Changed order of constant
16215 reduction to work correctly with native types which have
16216 overloaded operators.
16217 (ResolveMemberAccess): Extract constant value from attribute
16220 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
16222 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
16223 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
16224 (ChangeType): Decimal is special.
16225 (TypeToCoreType): Add decimal type.
16227 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16229 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
16232 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16234 * class.cs (EventField.ApplyAttributeBuilder): Fix error
16237 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16239 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
16241 * pending.cs (PendingImplementation): Grab only interfaces.
16243 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16245 * statement.cs (ForeachHelperMethods): Add location member and
16246 error 202 detection.
16248 2004-11-19 Raja R Harinath <rharinath@novell.com>
16250 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
16251 automatically handled by executable.make.
16252 (PROGRAM): Make profile-specific.
16254 2004-11-18 Marek Safar <marek.safar@seznam.cz>
16256 * expression.cs (DoResolveBase): Fixed wrong warning for out
16259 2004-11-18 Martin Baulig <martin@ximian.com>
16261 Merged latest changes into gmcs. Please keep this comment in
16262 here, it makes it easier for me to see what changed in MCS since
16263 the last time I merged.
16265 2004-11-17 Raja R Harinath <rharinath@novell.com>
16267 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
16268 (TypeHandle.GetMemberCache): New.
16269 (TypeHandle.TypeHandle): Update.
16270 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
16271 (TypeManager.LookupParentInterfacesCache):
16272 Rename from LookupInterfaceCache. Optimize slightly.
16273 (TypeManager.MemberLookup_FindMembers): Update.
16274 * decl.cs (MemberCache.MemberCache): Set Container to null in the
16275 multi-type variant.
16276 (AddCacheContents): Rename from AddHashtable.
16277 * class.cs (TypeContainer.parent_container): Remove.
16278 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
16279 (TypeContainer.DoDefineMembers): Don't initialize it.
16280 Update to name changes.
16282 2004-11-17 Miguel de Icaza <miguel@ximian.com>
16284 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
16285 that factors the code to check access modifiers on override.
16287 (PropertyBase): Use the code here.
16289 Patch from Lluis S'anchez, fixes bug #69361.
16291 2004-11-15 Miguel de Icaza <miguel@ximian.com>
16293 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
16294 routine that is used to report the use of a captured variable
16295 whose address has been taken.
16297 There are two checks: one when variables are being captured and
16298 the other check is when the address of a variable is taken.
16300 (because an anonymous methods might be resolved before *or* after
16301 the address has been taken) and
16303 * expression.cs (Conditional.DoResolve): Remove the special
16304 casing that Martin added to trueExpr and falseExpr being both
16305 NullLiteral. We get the right behavior now just by introducing
16306 the null_type into the compiler.
16308 * convert.cs (ExplicitConversion): Change the code to use
16309 null_type instead of testing `expr is NullLiteral'.
16310 (ImplicitConversionStandard): use null_type too.
16311 (ImplicitReferenceConversionExists): use null_type too.
16312 (ImplicitReferenceConversion): use null_type too.
16314 * literal.cs: The type of `NullLiteral' is now null_type instead
16316 (Resolve): Set the type here.
16318 * typemanager.cs: Introduce null_type.
16320 2004-11-17 Martin Baulig <martin@ximian.com>
16322 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
16323 direction, like FindMembers() does. Fixes #69546, testcase is in
16326 2004-11-16 Martin Baulig <martin@ximian.com>
16328 This is based on a patch from Marek Safar, see bug #69082.
16329 Fixes bugs #63705 and #67130.
16331 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
16332 method; create a MemberCache for an interface type and cache the
16335 * decl.cs (IMemberContainer.ParentContainer): Removed.
16336 (IMemberContainer.ParentCache): New property.
16337 (MemberCache.SetupCacheForInterface): Removed.
16338 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
16339 to create a cache for an interface's "parent".
16341 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
16344 2004-11-16 Martin Baulig <martin@ximian.com>
16346 Merged back from gmcs; these changes already went into gmcs a
16347 couple of weeks ago.
16350 (TypeManager.AddUserType): Removed the `ifaces' argument.
16351 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
16353 (TypeManager.AddUserInterface): Removed.
16354 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
16356 (TypeManager.GetInterfaces): Likewise.
16357 (TypeManager.GetExplicitInterfaces): Likewise.
16359 * ecore.cs (TypeExpr.GetInterfaces): Removed.
16361 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
16362 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
16364 2004-11-14 Ben Maurer <bmaurer@ximian.com>
16366 * statement.cs: Avoid adding bools to a hashtable.
16368 2004-11-07 Miguel de Icaza <miguel@ximian.com>
16370 * expression.cs (Invocation.OverloadResolve): Flag error if we are
16371 calling an unsafe method from a safe location.
16373 2004-11-06 Marek Safar <marek.safar@seznam.cz>
16376 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
16378 2004-11-06 Miguel de Icaza <miguel@ximian.com>
16380 * namespace.cs (VerifyUsing): use GetPartialName instead of
16383 2004-11-05 Miguel de Icaza <miguel@ximian.com>
16385 * statement.cs (Return.Resolve): Fix regression in typo: if
16386 `in_exc', we have to request a NeedReturnLabel, this was a typo
16387 introduced in the anonymous method check-in. Fixes #69131.
16389 * Indexers were using the ShortName when defining themselves,
16390 causing a regression in the compiler bootstrap when applying the
16391 patch from 2004-11-02 (first part), now they use their full name
16392 and the bug is gone.
16394 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
16396 * driver.cs: Strip the path from the names of embedded resources. Fixes
16399 2004-11-04 Raja R Harinath <rharinath@novell.com>
16401 Fix error message regression: cs0104-2.cs.
16402 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
16403 (AliasEntry.Resolve): Update.
16404 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
16406 (RootContext.LookupType): Update.
16408 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
16410 * cs-parser.jay: Add support for handling accessor modifiers
16411 * class: Add support port accessor modifiers and error checking,
16412 define PropertyMethod.Define as virtual (not abstract anymore)
16413 * ecore.cs: Add checking for proeprties access with access modifiers
16414 * iterators.cs: Modify Accessor constructor call based in the modified
16416 2004-11-02 Ben Maurer <bmaurer@ximian.com>
16418 * expression.cs (StringConcat): Handle being called twice,
16419 as when we have a concat in a field init with more than two
16422 2004-11-02 Miguel de Icaza <miguel@ximian.com>
16424 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
16425 special case explicit implementations, we should always produce
16426 the .property or .event declaration.
16428 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
16429 since it will not return correct data if people use this
16430 unresolved in the presence of using statements (see test-313).
16432 * class.cs (MethodData.Define): If we are an explicit interface
16433 implementation, set the method name to the full name of the
16434 interface plus the name of the method.
16436 Notice that using the method.MethodName.GetFullName() does not
16437 work, as it will only contain the name as declared on the source
16438 file (it can be a shorthand in the presence of using statements)
16439 and not the fully qualifed type name, for example:
16443 class D : ICloneable {
16444 object ICloneable.Clone () {
16448 Would produce a method called `ICloneable.Clone' instead of
16449 `System.ICloneable.Clone'.
16451 * namespace.cs (Alias.Resolve): Use GetPartialName.
16453 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16455 * cs-parser.jay: Add error 1055 report.
16457 2004-11-01 Miguel de Icaza <miguel@ximian.com>
16459 * assign.cs (Assign.DoResolve): Only do the transform of
16460 assignment into a New if the types are compatible, if not, fall
16461 through and let the implicit code deal with the errors and with
16462 the necessary conversions.
16464 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16466 * cs-parser.jay: Add error 1031 report.
16468 * cs-tokenizer.cs: Add location for error 1038.
16470 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16472 * cs-parser.jay: Add error 1016 report.
16474 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16476 * cs-parser.jay: Add errors 1575,1611 report.
16478 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16480 * cs-parser.jay: Add error 1001 report.
16482 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16485 * attribute.cs (GetMarshal): Add method argument for
16486 caller identification.
16488 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
16489 agument for GetMarshal and RuntimeMissingSupport.
16491 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16493 * attribute.cs (ExtractSecurityPermissionSet): Removed
16494 TypeManager.code_access_permission_type.
16496 * typemanager.cs: Removed TypeManager.code_access_permission_type.
16498 2004-10-27 Miguel de Icaza <miguel@ximian.com>
16500 * expression.cs (LocalVariableReference.DoResolveLValue): Check
16501 for obsolete use of a variable here. Fixes regression on errors
16502 cs0619-25 and cs0619-26.
16504 2004-10-27 Marek Safar <marek.safar@seznam.cz>
16506 Fix #62358, implemented security attribute encoding.
16508 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
16509 Tests permitted SecurityAction for assembly or other types.
16510 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
16511 data from SecurityPermissionAttribute to PermisionSet class.
16513 * class.cs (ApplyAttributeBuilder): Added special handling
16514 for System.Security.Permissions.SecurityAttribute based types.
16516 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
16517 special handling for System.Security.Permissions.SecurityAttribute
16520 * enum.cs (ApplyAttributeBuilder): Added special handling
16521 for System.Security.Permissions.SecurityAttribute based types.
16523 * parameter.cs (ApplyAttributeBuilder): Added special handling
16524 for System.Security.Permissions.SecurityAttribute based types.
16526 * rootcontext.cs: Next 2 core types.
16528 * typemanager.cs (TypeManager.security_permission_attr_type):
16529 Built in type for the SecurityPermission Attribute.
16530 (code_access_permission_type): Build in type.
16532 2004-10-17 Miguel de Icaza <miguel@ximian.com>
16534 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
16535 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
16536 all of this information into
16537 EmitContext.EmitCapturedVariableInstance.
16539 * codegen.cs (EmitCapturedVariableInstance): move here the
16540 funcionality of emitting an ldarg.0 in the presence of a
16541 remapping. This centralizes the instance emit code.
16543 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
16544 then emit a load of this: it means that we have reached the
16545 topmost ScopeInfo: the one that contains the pointer to the
16546 instance of the class hosting the anonymous method.
16548 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
16549 captures to the topmost CaptureContext.
16551 2004-10-12 Miguel de Icaza <miguel@ximian.com>
16553 * expression.cs (LocalVariableReference): Move the knowledge about
16554 the iterators into codegen's EmitCapturedVariableInstance.
16556 2004-10-11 Miguel de Icaza <miguel@ximian.com>
16558 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
16559 all code paths return a value from an anonymous method (it is the
16560 same as the 161 error, but for anonymous methods).
16562 2004-10-08 Miguel de Icaza <miguel@ximian.com>
16564 The introduction of anonymous methods in the compiler changed
16565 various ways of doing things in the compiler. The most
16566 significant one is the hard split between the resolution phase
16567 and the emission phases of the compiler.
16569 For instance, routines that referenced local variables no
16570 longer can safely create temporary variables during the
16571 resolution phase: they must do so from the emission phase,
16572 since the variable might have been "captured", hence access to
16573 it can not be done with the local-variable operations from the runtime.
16577 (Block.Flags): New flag `IsTopLevel' to indicate that this block
16578 is a toplevel block.
16580 (ToplevelBlock): A new kind of Block, these are the blocks that
16581 are created by the parser for all toplevel method bodies. These
16582 include methods, accessors and anonymous methods.
16584 These contain some extra information not found in regular blocks:
16585 A pointer to an optional CaptureContext (for tracking captured
16586 local variables and parameters). A pointer to the parent
16589 (Return.Resolve): Catch missmatches when returning a value from an
16590 anonymous method (error 1662).
16591 Invoke NeedReturnLabel from the Resolve phase instead of the emit
16594 (Break.Resolve): ditto.
16596 (SwitchLabel): instead of defining the labels during the
16597 resolution phase, we now turned the public ILLabel and ILLabelCode
16598 labels into methods called GetILLabelCode() and GetILLabel() that
16599 only define the label during the Emit phase.
16601 (GotoCase): Track the SwitchLabel instead of the computed label
16602 (its contained therein). Emit the code by using
16603 SwitchLabel.GetILLabelCode ().
16605 (LocalInfo.Flags.Captured): A new flag has been introduce to track
16606 whether the Local has been captured or not.
16608 (LocalInfo.IsCaptured): New property, used to tell whether the
16609 local has been captured.
16611 * anonymous.cs: Vastly updated to contain the anonymous method
16614 The main classes here are: CaptureContext which tracks any
16615 captured information for a toplevel block and ScopeInfo used to
16616 track the activation frames for various local variables.
16618 Each toplevel block has an optional capture context associated
16619 with it. When a method contains an anonymous method both the
16620 toplevel method and the anonymous method will create a capture
16621 context. When variables or parameters are captured, they are
16622 recorded on the CaptureContext that owns them, for example:
16626 MyDelegate d = delegate {
16631 Here `a' will be recorded as captured on the toplevel
16632 CapturedContext, the inner captured context will not have anything
16633 (it will only have data if local variables or parameters from it
16634 are captured in a nested anonymous method.
16636 The ScopeInfo is used to track the activation frames for local
16637 variables, for example:
16639 for (int i = 0; i < 10; i++)
16640 for (int j = 0; j < 10; j++){
16641 MyDelegate d = delegate {
16646 At runtime this captures a single captured variable `i', but it
16647 captures 10 different versions of the variable `j'. The variable
16648 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
16649 recorded on a child.
16651 The toplevel ScopeInfo will also track information like the `this'
16652 pointer if instance variables were referenced (this is necessary
16653 as the anonymous method lives inside a nested class in the host
16654 type of the method).
16656 (AnonymousMethod): Expanded to track the Toplevel, implement
16657 `AnonymousMethod.Compatible' to tell whether an anonymous method
16658 can be converted to a target delegate type.
16660 The routine now also produces the anonymous method content
16662 (AnonymousDelegate): A helper class that derives from
16663 DelegateCreation, this is used to generate the code necessary to
16664 produce the delegate for the anonymous method that was created.
16666 * assign.cs: API adjustments for new changes in
16667 Convert.ImplicitStandardConversionExists.
16669 * class.cs: Adjustments to cope with the fact that now toplevel
16670 blocks are of type `ToplevelBlock'.
16672 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
16673 insteda of standard blocks.
16675 Flag errors if params arguments are passed to anonymous methods.
16677 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
16678 `CurrentAnonymousMethod' which points to the current Anonymous
16679 Method. The variable points to the AnonymousMethod class that
16680 holds the code being compiled. It is set in the new EmitContext
16681 created for the anonymous method.
16683 (EmitContext.Phase): Introduce a variable and an enumeration to
16684 assist in enforcing some rules about when and where we are allowed
16685 to invoke certain methods (EmitContext.NeedsReturnLabel is the
16686 only one that enfonces this right now).
16688 (EmitContext.HaveCaptureInfo): new helper method that returns
16689 whether we have a CapturedContext initialized.
16691 (EmitContext.CaptureVariable): New method used to register that a
16692 LocalInfo must be flagged for capturing.
16694 (EmitContext.CapturedParameter): New method used to register that a
16695 parameters must be flagged for capturing.
16697 (EmitContext.CapturedField): New method used to register that a
16698 field must be flagged for capturing.
16700 (EmitContext.HaveCapturedVariables,
16701 EmitContext.HaveCapturedFields): Return whether there are captured
16702 variables or fields.
16704 (EmitContext.EmitMethodHostInstance): This is used to emit the
16705 instance for the anonymous method. The instance might be null
16706 (static methods), this (for anonymous methods that capture nothing
16707 and happen to live side-by-side with the current method body) or a
16708 more complicated expression if the method has a CaptureContext.
16710 (EmitContext.EmitTopBlock): Routine that drives the emission of
16711 code: it will first resolve the top block, then emit any metadata
16712 and then emit the code. The split is done so that we can extract
16713 any anonymous methods and flag any captured variables/parameters.
16715 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
16716 during this phase, the ILGenerator should not be used as labels
16717 and local variables declared here might not be accessible to any
16718 code that is part of an anonymous method.
16720 Exceptions to this include the temporary variables that are
16721 created by some statements internally for holding temporary
16724 (EmitContext.EmitMeta): New routine, in charge of emitting all the
16727 (EmitContext.TemporaryReturn): This method is typically called
16728 from the Emit phase, and its the only place where we allow the
16729 ReturnLabel to be defined other than the EmitMeta. The reason is
16730 that otherwise we would have to duplicate a lot of logic in the
16731 Resolve phases of various methods that today is on the Emit
16734 (EmitContext.NeedReturnLabel): This no longer creates the label,
16735 as the ILGenerator is not valid during the resolve phase.
16737 (EmitContext.EmitThis): Extended the knowledge in this class to
16738 work in anonymous methods in addition to iterators.
16740 (EmitContext.EmitCapturedVariableInstance): This emits whatever
16741 code is necessary on the stack to access the instance to a local
16742 variable (the variable will be accessed as a field).
16744 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
16745 EmitContext.EmitAddressOfParameter): Routines to support
16746 parameters (not completed at this point).
16748 Removals: Removed RemapLocal and RemapLocalLValue. We probably
16749 will also remove the parameters.
16751 * convert.cs (Convert): Define a `ConstantEC' which points to a
16752 null. This is just to prefity some code that uses
16753 ImplicitStandardConversion code and do not have an EmitContext
16756 The idea is to flag explicitly that at that point in time, it is
16757 known that the conversion will not trigger the delegate checking
16758 code in implicit conversions (which requires a valid
16761 Everywhere: pass new EmitContext parameter since
16762 ImplicitStandardConversionExists now requires it to check for
16763 anonymous method conversions.
16765 (Convert.ImplicitStandardConversionExists): If the type of an
16766 expression is the anonymous_method_type, and the type is a
16767 delegate, we invoke the AnonymousMethod.Compatible method to check
16768 whether an implicit conversion is possible.
16770 (Convert.ImplicitConversionStandard): Only do implicit method
16771 group conversions if the language level is not ISO_1.
16773 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
16774 MethodInfo for the Invoke method. used by Delegate and
16777 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
16778 method conversions if the target type is a delegate.
16780 Removed extra debugging nops.
16782 (LocalVariableReference): Turn the `local_info' into a public
16785 Add `prepared' field, the same hack used for FieldExprs to cope
16786 with composed assignments, as Local variables do not necessarily
16787 operate purely on the stack as they used to: they can be captured
16790 Add `temp' for a temporary result, like fields.
16792 Refactor DoResolve and DoResolveLValue into DoResolveBase.
16794 It now copes with Local variables that are captured and emits the
16795 proper instance variable to load it from a field in the captured
16798 (ParameterReference.DoResolveBase): During the resolve phase,
16799 capture parameters if we are in an anonymous method.
16801 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
16802 anonymous method, use the EmitContext helper routines to emit the
16803 parameter reference.
16805 * iterators.cs: Set RemapToProxy to true/false during the
16808 * parameters.cs (GetParameterByName): New helper method.
16810 * typemanager.cs (anonymous_method_type) a new type that
16811 represents an anonyous method. This is always an internal type,
16812 used as a fencepost to test against the anonymous-methodness of an
16815 2004-10-20 Marek Safar <marek.safar@seznam.cz>
16817 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
16819 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
16821 2004-10-18 Martin Baulig <martin@ximian.com>
16823 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
16824 `Type' directly, but call ResolveType() on it.
16825 (Catch.Resolve): Likewise.
16826 (Foreach.Resolve): Likewise.
16828 2004-10-18 Martin Baulig <martin@ximian.com>
16830 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
16831 `Type' directly, but call ResolveType() on it.
16832 (Probe.DoResolve): Likewise.
16833 (ArrayCreation.LookupType): Likewise.
16834 (TypeOf.DoResolve): Likewise.
16835 (SizeOf.DoResolve): Likewise.
16837 2004-10-18 Martin Baulig <martin@ximian.com>
16839 * expression.cs (Invocation.BetterFunction): Put back
16840 TypeManager.TypeToCoreType().
16842 2004-10-18 Raja R Harinath <rharinath@novell.com>
16844 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
16847 2004-10-18 Martin Baulig <martin@ximian.com>
16849 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
16850 `Type' directly, but call ResolveType() on it.
16852 2004-10-18 Martin Baulig <martin@ximian.com>
16854 * class.cs (FieldMember.Define): Don't access the TypeExpr's
16855 `Type' directly, but call ResolveType() on it.
16856 (MemberBase.DoDefine): Likewise.
16858 * expression.cs (New.DoResolve): Don't access the TypeExpr's
16859 `Type' directly, but call ResolveType() on it.
16860 (ComposedCast.DoResolveAsTypeStep): Likewise.
16862 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
16863 `Type' directly, but call ResolveType() on it.
16865 2004-10-17 John Luke <john.luke@gmail.com>
16867 * class.cs (Operator.GetSignatureForError): use CSharpName
16869 * parameter.cs (Parameter.GetSignatureForError): Returns
16870 correct name even if was not defined.
16872 2004-10-13 Raja R Harinath <rharinath@novell.com>
16875 * class.cs (TypeContainer.EmitContext): New property.
16876 (DefineNestedTypes): Create an emitcontext for each part.
16877 (MethodCore.DoDefineParameters): Use container's emitcontext.
16878 Pass type array to InternalParameters.
16879 (MemberBase.DoDefine): Use container's emitcontext.
16880 (FieldMember.Define): Likewise.
16881 (Event.Define): Likewise.
16882 (SetMethod.GetParameterInfo): Change argument to EmitContext.
16883 Pass type array to InternalParameters.
16884 (SetIndexerMethod.GetParameterInfo): Likewise.
16885 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
16886 * delegate.cs (Define): Pass emitcontext to
16887 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
16888 array to InternalParameters.
16889 * expression.cs (ParameterReference.DoResolveBase): Pass
16890 emitcontext to GetParameterInfo.
16891 (ComposedCast.DoResolveAsTypeStep): Remove check on
16892 ec.ResolvingTypeTree.
16893 * parameter.cs (Parameter.Resolve): Change argument to
16894 EmitContext. Use ResolveAsTypeTerminal.
16895 (Parameter.GetSignature): Change argument to EmitContext.
16896 (Parameters.ComputeSignature): Likewise.
16897 (Parameters.ComputeParameterTypes): Likewise.
16898 (Parameters.GetParameterInfo): Likewise.
16899 (Parameters.ComputeAndDefineParameterTypes): Likewise.
16900 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
16901 * support.cs (InternalParameters..ctor): Remove variant that takes
16903 * typemanager.cs (system_intptr_expr): New.
16904 (InitExpressionTypes): Initialize it.
16906 2004-10-12 Chris Toshok <toshok@ximian.com>
16908 * cs-parser.jay: fix location for try_statement and catch_clause.
16910 2004-10-11 Martin Baulig <martin@ximian.com>
16912 * report.cs: Don't make --fatal abort on warnings, we have
16913 -warnaserror for that.
16915 2004-10-07 Raja R Harinath <rharinath@novell.com>
16917 More DeclSpace.ResolveType avoidance.
16918 * decl.cs (MemberCore.InUnsafe): New property.
16919 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
16920 with newly created EmitContext.
16921 (FieldMember.Define): Likewise.
16922 * delegate.cs (Delegate.Define): Likewise.
16923 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
16924 only if normal name-lookup fails.
16925 (TypeExpr.DoResolve): Enable error-checking.
16926 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
16927 (SizeOf.DoResolve): Likewise.
16928 (ComposedCast.DoResolveAsTypeStep): Likewise.
16929 (StackAlloc.DoResolve): Likewise.
16930 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
16931 (Block.Unsafe): New property.
16932 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
16933 (Unsafe): Set 'unsafe' flag of contained block.
16934 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
16935 (Fixed.Resolve): Likewise.
16936 (Catch.Resolve): Likewise.
16937 (Using.ResolveLocalVariableDecls): Likewise.
16938 (Foreach.Resolve): Likewise.
16940 2004-10-05 John Luke <john.luke@gmail.com>
16942 * cs-parser.jay: add location to error CS0175
16944 2004-10-04 Miguel de Icaza <miguel@ximian.com>
16946 * ecore.cs (Expression.Constantity): Add support for turning null
16949 * const.cs (Const.Define): Allow constants to be reference types
16950 as long as the value is Null.
16952 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
16954 * namespace.cs (NamespaceEntry.Using): No matter which warning
16955 level is set, check if this namespace name has already been added.
16957 2004-10-03 Ben Maurer <bmaurer@ximian.com>
16959 * expression.cs: reftype [!=]= null should always use br[true,false].
16962 2004-10-03 Marek Safar <marek.safar@seznam.cz>
16965 * attribute.cs: Enum conversion moved to
16966 GetAttributeArgumentExpression to be applied to the all
16969 2004-10-01 Raja R Harinath <rharinath@novell.com>
16971 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
16972 * class.c (TypeContainer.DefineType): Flag error if
16973 base types aren't accessible due to access permissions.
16974 * decl.cs (DeclSpace.ResolveType): Move logic to
16975 Expression.ResolveAsTypeTerminal.
16976 (DeclSpace.ResolveTypeExpr): Thin layer over
16977 Expression.ResolveAsTypeTerminal.
16978 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
16979 Refactor code into NestedAccess. Use it.
16980 (DeclSpace.NestedAccess): New.
16981 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
16982 argument to silence errors. Check access permissions.
16983 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
16984 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
16985 (Cast.DoResolve): Likewise.
16986 (New.DoResolve): Likewise.
16987 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
16988 (TypeOf.DoResolve): Likewise.
16990 * expression.cs (Invocation.BetterConversion): Return the Type of
16991 the better conversion. Implement section 14.4.2.3 more faithfully.
16992 (Invocation.BetterFunction): Make boolean. Make correspondence to
16993 section 14.4.2.2 explicit.
16994 (Invocation.OverloadResolve): Update.
16995 (Invocation): Remove is_base field.
16996 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
16997 (Invocation.Emit): Likewise.
16999 2004-09-27 Raja R Harinath <rharinath@novell.com>
17001 * README: Update to changes.
17003 2004-09-24 Marek Safar <marek.safar@seznam.cz>
17005 * cs-parser.jay: Reverted 642 warning fix.
17007 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17010 * decl.cs (FindMemberWithSameName): Indexer can have more than
17013 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17015 * expression.cs (LocalVariableReference.DoResolveLValue):
17016 Do not report warning 219 for out values.
17017 (EmptyExpression.Null): New member to avoid extra allocations.
17019 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17021 * cs-parser.jay: Fix wrong warning 642 report.
17023 * cs-tokenizer.cs (CheckNextToken): New helper;
17024 Inspect next character if is same as expected.
17026 2004-09-23 Martin Baulig <martin@ximian.com>
17028 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
17029 (Convert.ImplicitReferenceConversionExists): Likewise.
17031 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17033 * class.cs (Operator.Define): Add error 448 and 559 report.
17035 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17037 * class.cs (MemberBase.IsTypePermitted): New protected
17038 method for checking error CS0610.
17040 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17042 * class.cs (TypeContainer.HasExplicitLayout): New property
17043 Returns whether container has StructLayout attribute set Explicit.
17044 (FieldMember): New abstract class for consts and fields.
17045 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
17046 (Field): Reuse FieldMember.
17048 * const.cs (Const): Reuse FieldMember.
17050 * rootcontext.cs: EmitConstants call moved to class.
17052 2004-09-22 Martin Baulig <martin@ximian.com>
17054 Thanks to Peter Sestoft for this bug report.
17056 * expression.cs (Conditional): If both the `trueExpr' and the
17057 `falseExpr' is a NullLiteral, return a NullLiteral.
17059 2004-09-22 Martin Baulig <martin@ximian.com>
17061 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
17062 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
17063 for the "get_Current" call.
17065 2004-09-22 Martin Baulig <martin@ximian.com>
17067 Marek and me just fixed one of our oldest bugs: #28562 :-)
17069 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
17071 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
17072 we're an EnumConstant, just return that.
17073 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
17074 an EnumConstant. In this case, we need to use GetValueAsEnumType()
17075 to get the value which'll actually be written into the attribute.
17076 However, we have to use GetValue() to access the attribute's value
17079 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17081 * constant.cs (Constant.IsNegative): New abstract property
17084 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
17085 (StackAlloc.DoResolve): Reused IsNegative.
17087 2004-09-21 Martin Baulig <martin@ximian.com>
17089 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
17090 if we're used in an iterator, we may be called from different
17093 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
17094 we actually have an exception block.
17096 2004-09-20 John Luke <jluke@cfl.rr.com>
17098 * class.cs, cs-parser.jay: Improve the error report for 1520:
17099 report the actual line where the error happens, not where the
17100 class was declared.
17102 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
17103 Pass location information that was available elsewhere.
17105 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
17107 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
17108 runtime to delay sign assemblies.
17110 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17112 * cs-parser.jay: Do not report the stack trace, this is barely
17115 2004-08-22 John Luke <john.luke@gmail.com>
17117 * driver.cs : check that a resource id is not already used
17118 before adding it, report CS1508 if it is, bug #63637
17120 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17122 * ecore.cs: Removed dead code.
17124 2004-09-18 Marek Safar <marek.safar@seznam.cz>
17126 * class.cs: Do not report warning CS0067 on the interfaces.
17128 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17130 * cs-parser.jay: Add error 504 report.
17132 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17134 * rootcontext.cs: WarningLevel is 4 by default now.
17136 * statement.cs (Fixed.Resolve): Do not null
17139 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17142 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
17143 deep search when property is not virtual.
17144 (PropertyExpr.ResolveAccessors): Make one call for both
17147 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17150 * statement.cs: Error 152 report constains also location.
17152 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17155 * const.cs: Explicitly set constant as static.
17157 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17160 * cs-parser.jay: Add error 1017 report.
17162 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17164 Fixed bug #59980, #64224
17165 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
17167 * typemanager.cs (IsSpecialMethod): Simplified
17169 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17171 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
17172 condition with better params.
17174 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17177 * attribute.cs (Resolve): Property has to have both
17180 2004-09-14 Martin Baulig <martin@ximian.com>
17182 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
17184 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17187 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
17188 called and is obsolete then this member suppress message
17189 when call is inside next [Obsolete] method or type.
17191 * expression.cs: Use TestObsoleteMethodUsage member.
17193 2004-09-14 Martin Baulig <martin@ximian.com>
17195 * cs-parser.jay: Sync a bit with the GMCS version.
17197 2004-09-14 Martin Baulig <martin@ximian.com>
17199 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
17200 (CSharpParser.yacc_verbose_flag): New public field.
17202 * genericparser.cs: Removed.
17204 2004-09-14 Raja R Harinath <rharinath@novell.com>
17206 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
17208 2004-09-13 Marek Safar <marek.safar@seznam.cz>
17210 * class.cs (MethodCore.CheckBase): Fix bug #65757.
17212 2004-09-10 Martin Baulig <martin@ximian.com>
17214 Backported my MemberName changes from GMCS into MCS.
17216 - we are now using a special `MemberName' class instead of using
17217 strings; in GMCS, the `MemberName' also contains the type
17220 - changed the grammar rules a bit:
17221 * the old `member_name' is now a `namespace_or_type_name':
17222 The rule is that we use `namespace_or_type_name' everywhere
17223 where we expect either a "member name" (GetEnumerator) or a
17224 "member name" with an explicit interface name
17225 (IEnumerable.GetEnumerator).
17226 In GMCS, the explicit interface name may include type arguments
17227 (IEnumerable<T>.GetEnumerator).
17228 * we use `member_name' instead of just `IDENTIFIER' for
17230 The rule is that we use `member_name' wherever a member may
17231 have type parameters in GMCS.
17233 * decl.cs (MemberName): New public class.
17234 (MemberCore.MemberName): New public readonly field.
17235 (MemberCore.ctor): Take a `MemberName' argument, not a string.
17236 (DeclSpace): Likewise.
17238 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
17239 * enum.cs (Enum.ctor): Likewise.
17241 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
17243 (AliasEntry.ctor): Take a MemberName, not an Expression.
17244 (AliasEntry.UsingAlias): Likewise.
17246 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
17247 (IMethodData.MemberName): Changed type from string to MemberName.
17248 (MemberBase.ExplicitInterfaceName): Likewise.
17249 (AbstractPropertyEventMethod.SetupName): Make this private.
17250 (AbstractPropertyEventMethod.ctor): Added `string prefix'
17251 argument; compute the member name here.
17252 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
17253 on the `member.MemberName' and the `prefix'.
17255 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
17257 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
17258 thus, we get a `MemberName' instead of a `string'. These
17259 declarations may have type parameters in GMCS.
17260 (interface_method_declaration, delegate_declaration): Likewise.
17261 (class_declaration, interface_declaration): Likewise.
17262 (method_header): Use `namespace_or_type_name' instead of
17263 `member_name'. We may be an explicit interface implementation.
17264 (property_declaration, event_declaration): Likewise.
17265 (member_name): This is now just an `IDENTIFIER', not a
17266 `namespace_or_type_name'.
17267 (type_name, interface_type): Removed.
17268 (namespace_or_type_name): Return a MemberName, not an Expression.
17269 (primary_expression): Use `member_name' instead of `IDENTIFIER';
17270 call GetTypeExpression() on the MemberName to get an expression.
17271 (IndexerDeclaration.interface_type): Changed type from string to
17273 (MakeName): Operate on MemberName's instead of string's.
17275 2004-09-13 Raja R Harinath <rharinath@novell.com>
17278 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
17279 (NamespaceEntry.Lookup): Add new argument to flag if we want the
17280 lookup to avoid symbols introduced by 'using'.
17281 * rootcontext.cs (NamespaceLookup): Update.
17283 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17285 * class.cs (TypeContainer.DoDefineMembers): Do not call
17286 DefineDefaultConstructor for static classes.
17288 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17290 * attribute.cs (Attribute.Resolve): Add error 653 report.
17292 * class.cs (Class.ApplyAttributeBuilder): Add error 641
17294 (Method.ApplyAttributeBuilder): Add error 685 report.
17295 (Operator.Define): Add error 564 report.
17297 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
17299 * expression.cs (Invocation.DoResolve): Add error
17300 245 and 250 report.
17302 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
17305 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17307 * class.cs (ConstructorInitializer.Resolve):
17308 Wrong error number (515->516).
17310 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17312 * class.cs (Indexer.Define): Add error 631 report.
17314 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17316 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
17318 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17320 * expression.cs (Probe.DoResolve): Add error CS0241 report.
17322 2004-09-10 Marek Safar <marek.safar@seznam.cz>
17324 * cs-parser.jay: Added error CS0241 report.
17326 2004-09-10 Raja R Harinath <rharinath@novell.com>
17328 * cs-parser.jay (fixed_statement): Introduce a scope for the
17329 declaration in the 'fixed' statement.
17331 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17333 * cs-parser.jay: Added CS0230 error report.
17335 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17337 * cs-parser.jay: Added errors CS0231 and CS0257 report.
17339 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17341 * expression.cs (Argument.Resolve): Added error CS0192 and
17344 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17346 C# 2.0 #pragma warning feature
17348 * cs-tokenizer.cs (PreProcessPragma): New method;
17349 Handles #pragma directive.
17351 * report.cs (WarningRegions): New class; Support
17352 class for #pragma warning directive. It tests whether
17353 warning is enabled for a given line.
17355 2004-09-08 Miguel de Icaza <miguel@ximian.com>
17357 * const.cs: Add more descriptive error report, tahnks to
17360 2004-09-08 Marek Safar <marek.safar@seznam.cz>
17362 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
17364 2004-09-07 Miguel de Icaza <miguel@ximian.com>
17366 * expression.cs: Apply patch from Ben: Remove dead code from
17367 ArrayCreation, and remove the TurnintoConstant call in const.cs,
17368 as that code just threw an exception anwyays.
17370 * const.cs: Remove the call to the turnintoconstant, for details
17373 * literal.cs: The type of the null-literal is the null type; So
17374 we use a placeholder type (literal.cs:System.Null, defined here)
17377 * expression.cs (Conditional.DoResolve): Remove some old code that
17378 is no longer needed, conversions have been fixed.
17380 (ArrayCreationExpression.DoResolve): Return false if we fail to
17381 resolve the inner expression.
17383 2004-09-07 Raja R Harinath <rharinath@novell.com>
17386 * cs-parser.jay (delegate_declaration): Record a delegate
17387 declaration as a type declaration.
17388 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
17390 2004-09-06 Miguel de Icaza <miguel@ximian.com>
17392 * parameter.cs: Do not crash if the type can not be resolved.
17394 * expression.cs: Report errors with unsafe pointers, fixes #64896
17396 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
17398 * expression.cs: Pointer arith always needs to do a conv.i
17399 if the operand is a long. fix 65320
17401 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17403 Fixed cs0619-37.cs, cs0619-38.cs
17405 * enum.cs (GetObsoleteAttribute): Removed.
17407 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
17408 on Enum member is double staged. The first is tested member
17411 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17413 Fixed #56986, #63631, #65231
17415 * class.cs: (TypeContainer.AddToMemberContainer): New method,
17416 adds member to name container.
17417 (TypeContainer.AddToTypeContainer): New method, adds type to
17419 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
17420 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
17421 AddOperator): Simplified by reusing AddToMemberContainer.
17422 (TypeContainer.UserDefinedStaticConstructor): Changed to property
17424 (Method.CheckForDuplications): Fixed implementation to test all
17426 (MemberBase): Detection whether member is explicit interface
17427 implementation is now in constructor.
17428 (MemberBase.UpdateMemberName): Handles IndexerName.
17429 (Accessor): Changed to keep also location information.
17430 (AbstractPropertyEventMethod): Is derived from MemberCore.
17431 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
17432 will be emited or not.
17433 (PropertyBase.AreAccessorsDuplicateImplementation):
17434 Tests whether accessors are not in collision with some method.
17435 (Operator): Is derived from MethodCore to simplify common
17438 * decl.cs (Flags.TestMethodDuplication): Test for duplication
17440 (DeclSpace.AddToContainer): Adds the member to defined_names
17441 table. It tests for duplications and enclosing name conflicts.
17443 * enum.cs (EnumMember): Clean up to reuse the base structures
17445 2004-09-03 Martin Baulig <martin@ximian.com>
17447 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
17448 into TypeContainer, to make partial classes work again.
17450 2004-09-03 Martin Baulig <martin@ximian.com>
17452 * rootcontext.cs (RootContext.V2): Removed.
17454 2004-03-23 Martin Baulig <martin@ximian.com>
17456 * expression.cs (Invocation.OverloadResolve): Added `bool
17457 may_fail' argument and use it instead of the Location.IsNull() hack.
17459 2004-09-03 Martin Baulig <martin@ximian.com>
17461 Merged latest changes into gmcs. Please keep this comment in
17462 here, it makes it easier for me to see what changed in MCS since
17463 the last time I merged.
17465 2004-09-03 Raja R Harinath <rharinath@novell.com>
17468 * expression.cs (BetterConversion): Don't allow either conversion
17469 to be null. Remove redundant implicit conversion test when 'q ==
17470 null' -- when this function is invoked, we already know that the
17471 implicit conversion exists.
17472 (BetterFunction): Assume that 'best' is non-null. Remove
17473 redundant reimplementation of IsApplicable when 'best' is null.
17474 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
17475 number of arguments.
17476 (IsAncestralType): Extract from OverloadResolve.
17477 (OverloadResolve): Make robust to the MethodGroupExpr being
17478 unsorted. Implement all the logic of Section 14.5.5.1, and
17479 support overloading of methods from multiple applicable types.
17480 Clean up logic somewhat. Don't pass null methods to BetterFunction.
17482 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
17483 (RealError, Warning): Append type of report to related symbol.
17485 2004-09-03 Marek Safar <marek.safar@seznam.cz>
17487 * enum.cs: Fixed CLS-Compliance checks for enum members.
17488 Error tests cs3008-8.cs, cs3014-8.cs
17490 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17492 Fixed bug #62342, #63102
17493 * class.cs: ImplementIndexer uses member.IsExplicitImpl
17494 like ImplementMethod.
17496 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17498 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17501 2004-09-02 Martin Baulig <martin@ximian.com>
17503 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
17504 TypeManager.GetArgumentTypes() rather than calling GetParameters()
17507 2004-09-01 Marek Safar <marek.safar@seznam.cz>
17509 C# 2.0 Static classes implemented
17511 * class.cs (TypeContainer): instance_constructors,
17512 initialized_fields, initialized_static_fields,
17513 default_constructor, base_inteface_types are protected to be
17514 accessible from StaticClass.
17515 (TypeContainer.DefineDefaultConstructor): New virtual method
17516 for custom default constructor generating
17517 (StaticClass): New class to handle "Static classes" feature.
17519 * cs-parser.jay: Handle static keyword on class like instance
17522 * driver.cs: Added "/langversion" command line switch with two
17523 options (iso-1, default).
17525 2004-08-31 Marek Safar <marek.safar@seznam.cz>
17527 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
17529 2004-08-31 Miguel de Icaza <miguel@ximian.com>
17531 * delegate.cs: Style.
17533 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
17535 * delegate.cs: Add seperate instance expr field for miguel.
17537 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17539 * PointerArithmetic (Resolve): make sure we are not doing
17540 pointer arith on void*. Also, make sure we are resolved
17541 by not setting eclass until resolve.
17543 All callers: Make sure that PointerArithmetic gets resolved.
17545 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17547 * ArrayCreation (LookupType): If the type does not resolve
17548 to an array, give an error.
17550 2004-08-27 Marek Safar <marek.safar@seznam.cz>
17552 * statement.cs (Try.Resolve): Fixed bug #64222
17554 2004-08-27 Martin Baulig <martin@ximian.com>
17557 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
17560 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17562 * ecore.cs (Constantify): Get underlying type via
17563 System.Enum.GetUnderlyingType to avoid StackOverflow on the
17564 Windows in special cases.
17566 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17568 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
17569 for obtaining also private methods.
17570 (GetRemoveMethod): Used GetRemoveMethod (true)
17571 for obtaining also private methods.
17573 2004-08-24 Martin Baulig <martin@ximian.com>
17575 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
17576 MethodAttributes.HideBySig for operators.
17578 2004-08-23 Martin Baulig <martin@ximian.com>
17580 Back to the old error reporting system :-)
17582 * report.cs (Message): Removed.
17583 (Report.MessageData, ErrorData, WarningData): Removed.
17584 (Report.Error, Warning): Back to the old system.
17586 2004-08-23 Martin Baulig <martin@ximian.com>
17588 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
17590 * class.cs (TypeContainer.ParentContainer): New public virtual
17591 method; replaces the explicit interface implementation.
17592 (ClassPart.ParentContainer): Override.
17594 2004-08-23 Martin Baulig <martin@ximian.com>
17596 * statement.cs (Switch): Added support for constant switches; see
17597 #59428 or test-285.cs.
17599 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17602 * statement.cs (GetEnumeratorFilter): Removed useless
17603 logic because C# specs is strict. GetEnumerator must be
17606 2004-08-22 Martin Baulig <martin@ximian.com>
17608 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17609 a switch and may break, reset the barrier. Fixes #59867.
17611 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17613 CLS-Compliance speed up (~5% for corlib)
17615 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
17616 New method. Tests container for CLS-Compliant names
17618 * class.cs (TypeContainer.VerifyClsName): New method.
17619 Checks whether container name is CLS Compliant.
17620 (Constructor): Implements IMethodData.
17622 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
17623 low-case table for CLS Compliance test.
17624 (MemberCache.VerifyClsParameterConflict): New method.
17625 Checks method parameters for CS3006 error.
17627 * enum.cs (EnumMember): Is derived from MemberCore.
17628 (Enum.VerifyClsName): Optimized for better performance.
17630 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17632 * report.cs: Renamed Error_T to Error and changed all
17635 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17637 * class.cs (TypeContainer.IndexerArrayList): New inner class
17638 container for indexers.
17639 (TypeContainer.DefaultIndexerName): New constant for default
17640 indexer name. Replaced all "Item" with this constant.
17641 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
17643 * typemanager.cs (TypeManager.default_member_ctor): Cache here
17644 DefaultMemberAttribute constructor.
17646 2004-08-05 Martin Baulig <martin@ximian.com>
17648 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
17651 2004-08-05 Marek Safar <marek.safar@seznam.cz>
17653 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
17654 multi platforms problem.
17656 * compiler.csproj: Included shared files.
17658 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17660 Fix bug 60333, 55971 in the more general way
17661 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17662 Added arg_type argument for constant conversion.
17663 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
17665 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17668 * class.cs (TypeContainer ): New inner classes MethodArrayList,
17669 OperatorArrayList, MethodCoreArrayList for typecontainer
17670 containers. Changed class member types to these new types.
17671 (MethodArrayList.DefineMembers): Added test for CS0659.
17673 2004-08-04 Miguel de Icaza <miguel@ximian.com>
17675 * cfold.cs: Synchronize the folding with the code in expression.cs
17676 Binary.DoNumericPromotions for uint operands.
17678 * attribute.cs: Revert patch from Raja, it introduced a regression
17679 while building Blam-1.2.1 (hard to isolate a test case).
17681 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17685 (TypeContainer.Define): Renamed to DefineContainerMembers because of
17687 (MethodCore.parent_method): New member. The method we're overriding
17688 if this is an override method.
17689 (MethodCore.CheckBase): Moved from Method class and made common.
17690 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
17692 (MethodCore.CheckForDuplications): New abstract method. For custom
17693 member duplication search in a container
17694 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
17695 method and its return type.
17696 (Event.conflict_symbol): New member. Symbol with same name in the
17700 (MemberCache.FindMemberWithSameName): New method. The method
17701 is looking for conflict with inherited symbols.
17703 2004-08-04 Martin Baulig <martin@ximian.com>
17705 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
17707 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
17709 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17711 * report.cs (Message): New enum for better error, warning reference in
17713 (MessageData): New inner abstract class. It generally handles printing of
17714 error and warning messages.
17715 Removed unused Error, Warning, Message methods.
17717 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17719 Fix for cs0592-8.cs test
17721 (Attributable.ValidAttributeTargets): Made public.
17722 (Attribute.ExplicitTarget): New member for explicit target value.
17723 (Attribute.CheckTargets): Now we translate explicit attribute
17724 target to Target here.
17726 2004-08-03 Ben Maurer <bmaurer@ximian.com>
17728 * ecore.cs (MethodGroupExpr): new IsBase property.
17730 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
17732 * delegate.cs (DelegateCreation): store a MethodGroupExpr
17733 rather than an instance expr.
17735 (DelegateCreation.Emit): Use the method group rather than
17736 the instance expression. Also, if you have base.Foo as the
17737 method for a delegate, make sure to emit ldftn, not ldftnvirt.
17739 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
17741 (NewDelegate.DoResolve): Only check for the existance of Invoke
17742 if the method is going to be needed. Use MethodGroupExpr.
17744 (NewDelegate.Emit): Remove, DelegateCreation implements this.
17746 * expression.cs: For pointer arith., make sure to use
17747 the size of the type, not the size of the pointer to
17750 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17753 * class.cs (Class): Added error CS0502 test.
17755 2004-08-03 John Luke <jluke@cfl.rr.com>
17756 Raja R Harinath <rharinath@novell.com>
17759 * attribute.cs (Attribute.complained_before): New flag.
17760 (Attribute.ResolveType, Attribute.Resolve),
17761 (Attribute.DefinePInvokeMethod): Set it.
17762 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
17764 2004-08-03 Martin Baulig <martin@ximian.com>
17766 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
17767 use a user-defined operator; we still need to do numeric
17768 promotions in case one argument is a builtin type and the other
17769 one has an implicit conversion to that type. Fixes #62322.
17771 2004-08-02 Martin Baulig <martin@ximian.com>
17773 * statement.cs (LocalInfo.Flags): Added `IsThis'.
17774 (LocalInfo.IsThis): New public property.
17775 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
17777 2004-08-01 Martin Baulig <martin@ximian.com>
17779 * class.cs (TypeContainer.GetClassBases): Don't set the default
17780 here since we may get called from GetPartialBases().
17781 (TypeContainer.DefineType): If GetClassBases() didn't return a
17782 parent, use the default one.
17784 2004-07-30 Duncan Mak <duncan@ximian.com>
17786 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
17788 2004-07-30 Martin Baulig <martin@ximian.com>
17790 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
17792 * class.cs (SourceMethod): New public class, derive from the
17793 symbol writer's ISourceMethod.
17794 (Method): Use the new symbol writer API.
17796 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
17797 as argument and use the new symbol writer.
17800 (SourceFile): Implement the symbol writer's ISourceFile.
17801 (Location.SymbolDocument): Removed.
17802 (Location.SourceFile): New public property.
17804 * symbolwriter.cs: Use the new symbol writer API.
17806 2004-07-30 Raja R Harinath <rharinath@novell.com>
17808 * Makefile (install-local): Remove. Functionality moved to
17811 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
17813 * Makefile: Install mcs.exe.config file together with mcs.exe.
17814 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
17815 correct runtime version.
17817 2004-07-25 Martin Baulig <martin@ximian.com>
17820 (TypeContainer.RegisterOrder): Removed, this was unused.
17821 (TypeContainer, interface_order): Removed.
17822 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
17823 TypeContainer as argument since we can also be called with a
17824 `PartialContainer' for a partial class/struct/interface.
17825 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
17826 of checking whether we're an `Interface' - we could be a
17827 `PartialContainer'.
17828 (PartialContainer.Register): Override; call
17829 AddClass()/AddStruct()/AddInterface() on our parent.
17831 * cs-parser.jay (interface_member_declaration): Add things to the
17832 `current_container', not the `current_class'.
17834 * rootcontext.cs (RegisterOrder): The overloaded version which
17835 takes an `Interface' was unused, removed.
17837 * typemanager.cs (TypeManager.LookupInterface): Return a
17838 `TypeContainer', not an `Interface'.
17839 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
17840 contain a `PartialContainer' for an interface, so check it's
17841 `Kind' to figure out what it is.
17843 2004-07-25 Martin Baulig <martin@ximian.com>
17845 * class.cs (Class.DefaultTypeAttributes): New public constant.
17846 (Struct.DefaultTypeAttributes): Likewise.
17847 (Interface.DefaultTypeAttributes): Likewise.
17848 (PartialContainer.TypeAttr): Override this and add the
17849 DefaultTypeAttributes.
17851 2004-07-25 Martin Baulig <martin@ximian.com>
17853 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
17854 we can just use the `Parent' field instead.
17856 2004-07-25 Martin Baulig <martin@ximian.com>
17858 * class.cs (TypeContainer.Emit): Renamed to EmitType().
17860 2004-07-25 Martin Baulig <martin@ximian.com>
17862 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
17863 our parts before defining any methods.
17864 (TypeContainer.VerifyImplements): Make this virtual.
17865 (ClassPart.VerifyImplements): Override and call VerifyImplements()
17866 on our PartialContainer.
17868 2004-07-25 Martin Baulig <martin@ximian.com>
17870 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
17872 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
17873 argument, we can just use the `Parent' field instead.
17876 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
17877 (MemberBase.DoDefine): Likewise.
17879 2004-07-24 Martin Baulig <martin@ximian.com>
17881 * decl.cs (MemberCore.Parent): New public field.
17882 (DeclSpace.Parent): Moved to MemberCore.
17884 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
17885 (MemberBase.ctor): Added TypeContainer argument, pass it to our
17887 (FieldBase, Field, Operator): Likewise.
17888 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
17889 (EventField, Event): Likewise.
17891 2004-07-23 Martin Baulig <martin@ximian.com>
17893 * class.cs (PartialContainer): New public class.
17894 (ClassPart): New public class.
17895 (TypeContainer): Added support for partial classes.
17896 (TypeContainer.GetClassBases): Splitted some of the functionality
17897 out into GetNormalBases() and GetPartialBases().
17899 * cs-tokenizer.cs (Token.PARTIAL): New token.
17900 (Tokenizer.consume_identifier): Added some hacks to recognize
17901 `partial', but only if it's immediately followed by `class',
17902 `struct' or `interface'.
17904 * cs-parser.jay: Added support for partial clases.
17906 2004-07-23 Martin Baulig <martin@ximian.com>
17908 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
17909 a `DeclSpace' and also made it readonly.
17910 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
17911 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
17912 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
17914 * cs-parser.jay: Pass the `current_class', not the
17915 `current_container' (at the moment, this is still the same thing)
17916 to a new Method, Property, Event, Indexer or Constructor.
17918 2004-07-23 Martin Baulig <martin@ximian.com>
17920 * cs-parser.jay (CSharpParser): Added a new `current_class' field
17921 and removed the `current_interface' one.
17922 (struct_declaration, class_declaration, interface_declaration):
17923 Set `current_class' to the newly created class/struct/interface;
17924 set their `Bases' and call Register() before parsing their body.
17926 2004-07-23 Martin Baulig <martin@ximian.com>
17928 * class.cs (Kind): New public enum.
17929 (TypeContainer): Made this class abstract.
17930 (TypeContainer.Kind): New public readonly field.
17931 (TypeContainer.CheckDef): New public method; moved here from
17933 (TypeContainer.Register): New public abstract method.
17934 (TypeContainer.GetPendingImplementations): New public abstract
17936 (TypeContainer.GetClassBases): Removed the `is_class' and
17937 `is_iface' parameters.
17938 (TypeContainer.DefineNestedTypes): Formerly known as
17940 (ClassOrStruct): Made this class abstract.
17942 * tree.cs (RootTypes): New public type.
17944 2004-07-20 Martin Baulig <martin@ximian.com>
17946 * tree.cs (Tree.RecordNamespace): Removed.
17947 (Tree.Namespaces): Removed.
17949 * rootcontext.cs (RootContext.IsNamespace): Removed.
17951 * cs-parser.jay (namespace_declaration): Just create a new
17952 NamespaceEntry here.
17954 2004-07-20 Martin Baulig <martin@ximian.com>
17956 * statement.cs (ExceptionStatement): New abstract class. This is
17957 now used as a base class for everyone who's using `finally'.
17958 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
17959 our local variables before using them.
17961 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
17962 virtual method. This is used by Yield.Resolve() to "steal" an
17963 outer block's `finally' clauses.
17964 (FlowBranchingException): The .ctor now takes an ExceptionStatement
17967 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
17968 version which takes an ExceptionStatement. This version must be
17969 used to create exception branchings.
17972 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
17973 (Iterator.EmitMoveNext): Added exception support; protect the
17974 block with a `fault' clause, properly handle 'finally' clauses.
17975 (Iterator.EmitDispose): Run all the `finally' clauses here.
17977 2004-07-20 Martin Baulig <martin@ximian.com>
17979 * iterator.cs: This is the first of a set of changes in the
17980 iterator code. Match the spec more closely: if we're an
17981 IEnumerable, then GetEnumerator() must be called. The first time
17982 GetEnumerator() is called, it returns the current instance; all
17983 subsequent invocations (if any) must create a copy.
17985 2004-07-19 Miguel de Icaza <miguel@ximian.com>
17987 * expression.cs: Resolve the constant expression before returning
17990 2004-07-19 Martin Baulig <martin@ximian.com>
17992 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
17993 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
17994 the return type of the new EmitContext.
17996 2004-07-18 Martin Baulig <martin@ximian.com>
17998 * class.cs (Property.Define): Fix iterators.
18000 * iterators.cs (Iterator.Define): Moved the
18001 `container.AddInterator (this)' call here from the .ctor; only do
18002 it if we resolved successfully.
18004 2004-07-17 Miguel de Icaza <miguel@ximian.com>
18006 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
18007 `true' for preprocessing directives that we parse. The return
18008 value indicates whether we should return to regular tokenizing or
18009 not, not whether it was parsed successfully.
18011 In the past if we were in: #if false ... #line #endif, we would
18012 resume parsing after `#line'. See bug 61604.
18014 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
18015 building: IsEnumType should return true only for enums, not for
18016 enums or System.Enum itself. This fixes #61593.
18018 Likely what happened is that corlib was wrong: mcs depended on
18019 this bug in some places. The bug got fixed, we had to add the
18020 hack, which caused bug 61593.
18022 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
18023 that was a workaround for the older conditions.
18025 2004-07-16 Ben Maurer <bmaurer@ximian.com>
18027 * assign.cs: IAssignMethod has a new interface, as documented
18028 inline. All assignment code now uses this new api.
18030 * ecore.cs, expression.cs: All classes which implement
18031 IAssignMethod now use the new interface.
18033 * expression.cs (Invocation): add a hack to EmitCall so that
18034 IndexerAccess can be the target of a compound assignment without
18035 evaluating its arguments twice.
18037 * statement.cs: Handle changes in Invocation api.
18039 2004-07-16 Martin Baulig <martin@ximian.com>
18041 * iterators.cs: Rewrote this. We're now using one single Proxy
18042 class for both the IEnumerable and the IEnumerator interface and
18043 `Iterator' derives from Class so we can use the high-level API.
18045 * class.cs (TypeContainer.AddIterator): New method.
18046 (TypeContainer.DoDefineType): New protected virtual method, which
18047 is called from DefineType().
18048 (TypeContainer.DoDefineMembers): Call DefineType() and
18049 DefineMembers() on all our iterators.
18050 (TypeContainer.Emit): Call Emit() on all our iterators.
18051 (TypeContainer.CloseType): Call CloseType() on all our iterators.
18053 * codegen.cs (EmitContext.CurrentIterator): New public field.
18055 2004-07-15 Martin Baulig <martin@ximian.com>
18058 (TypeManager.not_supported_exception_type): New type.
18060 2004-07-14 Martin Baulig <martin@ximian.com>
18062 * iterators.cs: Use real error numbers.
18064 2004-07-14 Martin Baulig <martin@ximian.com>
18066 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
18067 requires this to be a System.Collection.IEnumerable and not a
18068 class implementing that interface.
18069 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
18071 2004-07-13 Marek Safar <marek.safar@seznam.cz>
18073 * class.cs: Fixed previous fix, it broke some error tests.
18075 2004-07-12 Martin Baulig <martin@ximian.com>
18077 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
18080 2004-07-09 Miguel de Icaza <miguel@ximian.com>
18082 * assign.cs (LocalTemporary): Add new argument: is_address,If
18083 `is_address' is true, then the value that we store is the address
18084 to the real value, and not the value itself.
18086 * ecore.cs (PropertyExpr): use the new local temporary
18087 stuff to allow us to handle X.Y += z (where X is a struct)
18089 2004-07-08 Martin Baulig <martin@ximian.com>
18091 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
18092 not always return, just like we're doing in Using.Resolve().
18094 2004-07-07 Miguel de Icaza <miguel@ximian.com>
18096 * cs-parser.jay (fixed_statement): flag this as Pinned.
18098 2004-07-06 Miguel de Icaza <miguel@ximian.com>
18100 * typemanager.cs (TypeManager): Removed MakePinned method, this
18101 mechanism is replaced with the .NET 2.x compatible mechanism of
18102 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
18104 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
18105 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
18106 `IsFixed' property which has a different meaning.
18108 2004-07-02 Raja R Harinath <rharinath@novell.com>
18110 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
18111 visible from inside a nested class, not just the names of the
18112 immediately enclosing class.
18113 Fix for bug #60730.
18115 2004-06-24 Raja R Harinath <rharinath@novell.com>
18117 * expression.cs (BetterConversion): Remove buggy special-case
18118 handling of "implicit constant expression conversions". At this
18119 point, we already know that the conversion is possible -- we're
18120 only checking to see which is better.
18122 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18124 * cs-parser.jay: Added error CS0210 test.
18126 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18128 * cs-parser.jay: Added error CS0134 test.
18130 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18133 * cs-parser.jay: Added error CS0145 test.
18135 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18137 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
18139 2004-06-23 Ben Maurer <bmaurer@ximian.com>
18141 * expression.cs (StackAlloc.Resolve): The argument may not
18142 be a constant; deal with this case.
18144 2004-06-23 Marek Safar <marek.safar@seznam.cz>
18146 * attribute.cs (IndexerName_GetIndexerName): Renamed to
18147 GetIndexerAttributeValue.
18148 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
18150 * class.cs (Indexer.Define): Added error tests for CS0415,
18153 2004-06-23 Miguel de Icaza <miguel@ximian.com>
18155 * attribute.cs (Attribute.Resolve): Keep field code in sync with
18158 2004-06-23 Martin Baulig <martin@ximian.com>
18160 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
18161 neither return nor throw, reset the barrier as well. Fixes #60457.
18163 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
18165 * class.cs : EventAttributes is now set to None by default.
18166 This fixes bug #60459.
18168 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18171 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18172 Don't throw exception but return null (it's sufficient now).
18174 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18176 * typemanager.cs (GetArgumentTypes): Faster implementation.
18178 2004-06-18 Martin Baulig <martin@ximian.com>
18180 * attribute.cs (Attribute.Resolve): Check whether we're an
18181 EmptyCast which a Constant child. Fixes #60333.
18183 2004-06-17 Ben Maurer <bmaurer@ximian.com>
18185 * statement.cs (EmitCollectionForeach): Account for the fact that
18186 not all valuetypes are in areas which we can take the address of.
18187 For these variables, we store to a temporary variable. Also, make
18188 sure that we dont emit a `callvirt' on a valuetype method.
18190 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18192 * expression.cs (StackAlloc.DoReSolve): Added test for
18193 negative parameter (CS0247).
18195 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18198 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
18200 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18203 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
18206 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18208 Fix bug #58254 & cs1555.cs, cs1556.cs
18209 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
18211 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18213 * cs-parser.jay: Added error CS1669 test for indexers.
18215 2004-06-11 Martin Baulig <martin@ximian.com>
18217 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
18218 call this twice: for params and varargs methods.
18220 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18223 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
18225 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18227 * attribute.cs (Attribute.GetValidTargets): Made public.
18230 (AbstractPropertyEventMethod): New class for better code sharing.
18231 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
18233 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
18235 2004-06-11 Raja R Harinath <rharinath@novell.com>
18238 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
18239 that the call to Resolve is part of a MemberAccess.
18240 (Expression.Resolve): Use it for SimpleName resolution.
18241 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
18242 Add 'intermediate' boolean argument.
18243 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
18244 error message when the SimpleName can be resolved ambiguously
18245 between an expression and a type.
18246 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
18248 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
18249 call on the left-side.
18251 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18254 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
18256 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18258 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
18260 2004-06-11 Martin Baulig <martin@ximian.com>
18262 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
18263 varargs methods if applicable.
18265 2004-06-11 Martin Baulig <martin@ximian.com>
18267 * expression.cs (Invocation.EmitCall): Don't use
18268 `method.CallingConvention == CallingConventions.VarArgs' since the
18269 method could also have `CallingConventions.HasThis'.
18271 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18273 * class.cs (Event.GetSignatureForError): Implemented.
18274 Fixed crash in error test cs3010.cs
18276 2004-06-10 Miguel de Icaza <miguel@ximian.com>
18278 * cs-tokenizer.cs: Change the way we track __arglist to be
18279 consistent with the other keywords.
18281 2004-06-09 Miguel de Icaza <miguel@ximian.com>
18283 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
18286 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
18288 * codegen.cs: Check that all referenced assemblies have a strongname
18289 before strongnaming the compiled assembly. If not report error CS1577.
18290 Fix bug #56563. Patch by Jackson Harper.
18291 * typemanager.cs: Added a method to return all referenced assemblies.
18292 Fix bug #56563. Patch by Jackson Harper.
18294 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18297 (Method.ApplyAttributeBuilder): Moved and added conditional
18298 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
18301 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
18303 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18306 * class.cs: (EventField.attribute_targets): Changed default target.
18308 2004-06-08 Martin Baulig <martin@ximian.com>
18310 * expression.cs (Invocation.EmitCall): Enable varargs methods.
18312 2004-06-08 Martin Baulig <martin@ximian.com>
18314 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
18316 2004-06-07 Martin Baulig <martin@ximian.com>
18318 Added support for varargs methods.
18320 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
18323 * cs-parser.jay: Added support for `__arglist'.
18325 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
18327 * expression.cs (Argument.AType): Added `ArgList'.
18328 (Invocation): Added support for varargs methods.
18329 (ArglistAccess): New public class.
18330 (Arglist): New public class.
18332 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
18334 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
18335 a method's top-level block if the method has varargs.
18337 * support.cs (ReflectionParameters, InternalParameters): Added
18338 support for varargs methods.
18340 2004-06-07 Miguel de Icaza <miguel@ximian.com>
18342 * class.cs: Provide location in indexer error report.
18344 * driver.cs: Use standard names.
18346 * namespace.cs: Catch the use of using after a namespace has been
18347 declared also on using aliases.
18349 2004-06-03 Raja R Harinath <rharinath@novell.com>
18352 * typemanager.cs (closure_private_ok, closure_invocation_type)
18353 (closure_qualifier_type, closure_invocation_assembly)
18354 (FilterWithClosure): Move to ...
18355 (Closure): New internal nested class.
18356 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
18357 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
18358 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
18359 (MemberLookup, MemberLookupFailed): Use it.
18360 * expression.cs (New.DoResolve): Treat the lookup for the
18361 constructor as being qualified by the 'new'ed type.
18362 (Indexers.GetIndexersForTypeOrInterface): Update.
18364 2004-06-03 Marek Safar <marek.safar@seznam.cz>
18367 (GetConditionalAttributeValue): New method. Returns
18368 condition of ConditionalAttribute.
18369 (SearchMulti): New method. Returns all attributes of type 't'.
18370 Use it when attribute is AllowMultiple = true.
18371 (IsConditionalMethodExcluded): New method.
18374 (Method.IsExcluded): Implemented. Returns true if method has conditional
18375 attribute and the conditions is not defined (method is excluded).
18376 (IMethodData): Extended interface for ConditionalAttribute support.
18377 (PropertyMethod.IsExcluded): Implemented.
18380 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
18383 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
18386 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
18388 * expression.cs (ArrayCreationExpression): Make this just an
18389 `expression'. It can't be a statement, so the code here was
18392 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18395 * typemanager.cs (GetFullNameSignature): New method for
18398 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18401 * class.cs (MemberBase.GetSignatureForError): New virtual method.
18402 Use this method when MethodBuilder is null.
18403 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
18404 Added test for error CS0626 (MONO reports error for this situation).
18405 (IMethodData.GetSignatureForError): Extended interface.
18407 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18410 (AttributeTester.GetObsoleteAttribute): Returns instance of
18411 ObsoleteAttribute when type is obsolete.
18414 (TypeContainer.VerifyObsoleteAttribute): Override.
18415 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
18416 (MethodCode.VerifyObsoleteAttribute): Override.
18417 (MemberBase.VerifyObsoleteAttribute): Override.
18420 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
18421 and report proper error.
18424 Delegate.VerifyObsoleteAttribute): Override.
18427 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
18428 and report proper error.
18429 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
18432 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
18436 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
18437 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
18438 Added test for ObsoleteAttribute.
18441 (Catch): Derived from Statement.
18443 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18445 Fixed bug #59071 & cs0160.cs
18447 * statement.cs (Try.Resolve): Check here whether order of catch
18448 clauses matches their dependencies.
18450 2004-05-31 Miguel de Icaza <miguel@ximian.com>
18452 * Reverted patch to namespace.cs (Use lookuptypedirect). This
18453 caused a regression: #59343. Referencing nested classes from an
18454 assembly stopped working.
18456 2004-05-31 Martin Baulig <martin@ximian.com>
18458 MCS is now frozen for beta 2.
18460 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18462 * convert.cs: add a trivial cache for overload operator resolution.
18464 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18466 * decl.cs: If possible, use lookuptypedirect here. We can only do
18467 this if there is no `.' after the namespace. Avoids using
18468 LookupType, which does lots of slow processing.
18469 (FindNestedType) New method, does what it says :-).
18470 * namespace.cs: use LookupTypeDirect.
18471 * rootcontext.cs: use membercache, if possible.
18472 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
18474 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18477 According to the spec,
18479 In a member access of the form E.I, if E is a single identifier,
18480 and if the meaning of E as a simple-name (§7.5.2) is a constant,
18481 field, property, localvariable, or parameter with the same type as
18482 the meaning of E as a type-name (§3.8), then both possible
18483 meanings of E are permitted.
18485 We did not check that E as a simple-name had the same type as E as
18488 This trivial check gives us 5-7% on bootstrap time.
18490 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18492 * expression.cs (Invocation.OverloadResolve): Avoid the
18493 use of hashtables and boxing here by allocating on demand.
18495 2004-05-30 Martin Baulig <martin@ximian.com>
18497 * rootcontext.cs (RootContext.LookupType): Don't cache things if
18498 we're doing a silent lookup. Don't try to lookup nested types in
18499 TypeManager.object_type (thanks to Ben Maurer).
18501 2004-05-30 Martin Baulig <martin@ximian.com>
18503 Committing a patch from Ben Maurer.
18505 * rootcontext.cs (RootContext.LookupType): Cache negative results.
18507 2004-05-29 Martin Baulig <martin@ximian.com>
18509 * class.cs (IMethodData.ShouldIgnore): New method.
18511 * typemanager.cs (TypeManager.MethodFlags): Don't take a
18512 `Location' argument, we don't need it anywhere. Use
18513 `IMethodData.ShouldIgnore ()' instead of
18514 `MethodData.GetMethodFlags ()'.
18515 (TypeManager.AddMethod): Removed.
18516 (TypeManager.AddMethod2): Renamed to AddMethod.
18518 2004-05-29 Martin Baulig <martin@ximian.com>
18520 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
18522 * convert.cs (Convert.ImplicitReferenceConversion): If we're
18523 converting from a class type S to an interface type and we already
18524 have an object on the stack, don't box it again. Fixes #52578.
18526 2004-05-29 Martin Baulig <martin@ximian.com>
18528 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18529 Added support for `params' parameters. Fixes #59267.
18531 2004-05-29 Martin Baulig <martin@ximian.com>
18533 * literal.cs (NullPointer): Provide a private .ctor which sets
18534 `type' to TypeManager.object_type. Fixes #59048.
18536 2004-05-29 Martin Baulig <martin@ximian.com>
18538 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
18539 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
18541 * ecore.cs (EventExpr.instance_expr): Make the field private.
18543 2004-05-26 Marek Safar <marek.safar@seznam.cz>
18545 Fixed bug #50080 & cs0214-2.cs
18546 * expression.cs (Cast.DoResolve): Check unsafe context here.
18548 * statement.cs (Resolve.DoResolve): Likewise.
18550 2004-05-26 Martin Baulig <martin@ximian.com>
18552 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
18554 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
18555 (RootContext.LookupType): Pass down the `silent' flag.
18557 2004-05-25 Martin Baulig <martin@ximian.com>
18560 (MethodGroupExpr.IdenticalTypeName): New public property.
18561 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
18562 expression actually refers to a type.
18564 2004-05-25 Martin Baulig <martin@ximian.com>
18566 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
18567 for #56176 and made it actually work.
18569 2004-05-25 Martin Baulig <martin@ximian.com>
18571 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
18572 (FieldExpr, PropertyExpr): Override and implement
18573 CacheTemporaries. Fixes #52279.
18575 2004-05-25 Miguel de Icaza <miguel@ximian.com>
18577 * location.cs: In the new compiler listing a file twice is a
18578 warning, not an error.
18580 2004-05-24 Martin Baulig <martin@ximian.com>
18582 * enum.cs (Enum.DefineType): For the `BaseType' to be a
18583 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
18585 2004-05-24 Martin Baulig <martin@ximian.com>
18587 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
18588 walking the `using' list. Fixes #53921.
18590 2004-05-24 Martin Baulig <martin@ximian.com>
18592 * const.cs (Const.LookupConstantValue): Added support for
18593 EmptyCast's; fixes #55251.
18595 2004-05-24 Martin Baulig <martin@ximian.com>
18597 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
18598 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
18599 which does the CS0135 check. The reason is that we first need to
18600 check whether the variable actually exists.
18602 2004-05-24 Martin Baulig <martin@ximian.com>
18604 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
18605 than RootContext.LookupType() to find the explicit interface
18606 type. Fixes #58584.
18608 2004-05-24 Raja R Harinath <rharinath@novell.com>
18610 * Makefile: Simplify. Use executable.make.
18611 * mcs.exe.sources: New file. List of sources of mcs.exe.
18613 2004-05-24 Anders Carlsson <andersca@gnome.org>
18617 Use the invariant culture when doing String.Compare for CLS case
18620 2004-05-23 Martin Baulig <martin@ximian.com>
18622 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
18623 don't have any dots. Fixes #52622, added cs0246-8.cs.
18625 * namespace.cs (NamespaceEntry.Lookup): Likewise.
18627 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18629 * class.cs (MemberBase.Define): Reuse MemberType member for
18630 resolved type. Other methods can use it too.
18632 2004-05-23 Martin Baulig <martin@ximian.com>
18634 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
18635 the variable also exists in the current block (otherwise, we need
18636 to report a CS0103). Fixes #58670.
18638 2004-05-23 Martin Baulig <martin@ximian.com>
18640 * flowanalysis.cs (Reachability.Reachable): Compute this
18641 on-the-fly rather than storing it as a field.
18643 2004-05-23 Martin Baulig <martin@ximian.com>
18645 * flowanalysis.cs (Reachability.And): Manually compute the
18646 resulting `barrier' from the reachability.
18648 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18651 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
18652 instance of ObsoleteAttribute when symbol is obsolete.
18655 (IMethodData): Extended interface for ObsoleteAttribute support.
18657 2004-05-22 Marek Safar <marek.safar@seznam.cz>
18659 * attribute.cs: Fix bug #55970
18661 2004-05-22 Marek Safar <marek.safar@seznam.cz>
18665 (GetObsoleteAttribute): New method. Creates the instance of
18667 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
18668 ObsoleteAttribute when member is obsolete.
18669 (AttributeTester.Report_ObsoleteMessage): Common method for
18670 Obsolete error/warning reporting.
18673 (TypeContainer.base_classs_type): New member for storing parent type.
18676 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
18677 for this MemberCore.
18679 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18681 * attribute.cs, const.cs: Fix bug #58590
18683 2004-05-21 Martin Baulig <martin@ximian.com>
18685 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
18686 out parameters if the end of the method is unreachable. Fixes
18689 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18691 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
18692 Hari was right, why extra method.
18694 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18696 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
18698 2004-05-20 Martin Baulig <martin@ximian.com>
18700 Merged this back from gmcs to keep the differences to a minumum.
18702 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
18703 instead of a Declspace.
18704 (Attribute.ResolveType): Likewise.
18705 (Attributes.Search): Likewise.
18706 (Attributes.Contains): Likewise.
18707 (Attributes.GetClsCompliantAttribute): Likewise.
18709 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
18711 (MethodData.ApplyAttributes): Take an EmitContext instead of a
18714 2004-05-19 Marek Safar <marek.safar@seznam.cz>
18716 Fix bug #58688 (MCS does not report error when the same attribute
18719 * attribute.cs (Attribute.Emit): Distinction between null and default.
18721 2004-05-19 Raja R Harinath <rharinath@novell.com>
18723 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
18724 of a top-level attribute without an attribute target.
18725 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
18727 (Attribute.Conditional_GetConditionName),
18728 (Attribute.Obsolete_GetObsoleteMessage): Update.
18729 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
18730 part of ScanForIndexerName.
18731 (Attribute.CanIgnoreInvalidAttribute): New function.
18732 (Attribute.ScanForIndexerName): Move to ...
18733 (Attributes.ScanForIndexerName): ... here.
18734 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
18735 (Attributes.Search): New internal variant that can choose not to
18736 complain if types aren't resolved. The original signature now
18738 (Attributes.GetClsCompliantAttribute): Use internal variant, with
18739 complaints suppressed.
18740 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
18741 only if it not useful.
18742 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
18743 top-level for attributes that are shared between the assembly
18744 and a top-level class.
18745 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
18746 * class.cs: Update to reflect changes.
18747 (DefineIndexers): Fuse loops.
18748 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
18749 a couple more variants of attribute names.
18751 2004-05-18 Marek Safar <marek.safar@seznam.cz>
18753 Fix bug #52585 (Implemented explicit attribute declaration)
18756 (Attributable.ValidAttributeTargets): New abstract method. It gets
18757 list of valid attribute targets for explicit target declaration.
18758 (Attribute.Target): It holds target itself.
18759 (AttributeSection): Removed.
18760 (Attribute.CheckTargets): New method. It checks whether attribute
18761 target is valid for the current element.
18764 (EventProperty): New class. For events that are declared like
18765 property (with add and remove accessors).
18766 (EventField): New class. For events that are declared like field.
18769 * cs-parser.jay: Implemented explicit attribute target declaration.
18771 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
18772 Override ValidAttributeTargets.
18775 (ReturnParameter): Class for applying custom attributes on
18777 (ParameterAtribute): New class. Class for applying custom
18778 attributes on the parameter type.
18780 2004-05-17 Miguel de Icaza <miguel@ximian.com>
18782 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
18785 (Method): Allow UNSAFE here.
18787 * modifiers.cs: Support unsafe reporting.
18789 2004-05-17 Marek Safar <marek.safar@seznam.cz>
18791 * decl.cs: Fix bug #58478.
18793 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18795 * statement.cs: When checking for unreachable code on an EmptyStatement,
18796 set the location. Fixes bug #58488.
18798 2004-05-13 Miguel de Icaza <miguel@ximian.com>
18800 * driver.cs: Add -pkg handling.
18802 From Gonzalo: UseShelLExecute=false
18804 2004-05-12 Marek Safar <marek.safar@seznam.cz>
18807 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
18809 (Attribute.IsClsCompliaceRequired): Moved to base for better
18811 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
18812 when attribute is AttributeUsageAttribute.
18813 (Attribute.GetValidTargets): Simplified.
18814 (Attribute.GetAttributeUsage): New method returns AttributeUsage
18815 attribute for this type.
18816 (Attribute.ApplyAttributes): Method renamed to Emit and make
18818 (GlobalAttributeSection): New class for special handling of global
18819 attributes (assembly, module).
18820 (AttributeSection.Emit): New method.
18822 * class.cs: Implemented Attributable abstract methods.
18823 (MethodCore.LabelParameters): Moved to Parameter class.
18824 (Accessor): Is back simple class.
18825 (PropertyMethod): Implemented Attributable abstract class.
18826 (DelegateMethod): Implemented Attributable abstract class.
18827 (Event): New constructor for disctintion between normal Event
18828 and Event with accessors.
18830 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
18832 * codegen.cs, const.cs, decl.cs, delegate.cs:
18833 (CommonAssemblyModulClass): Implemented Attributable abstract class
18836 * enum.cs: Implement IAttributeSupport interface.
18837 (EnumMember): New class for emum members. Implemented Attributable
18841 (ParameterBase): Is abstract.
18842 (ReturnParameter): New class for easier [return:] attribute handling.
18844 * typemanager.cs: Removed builder_to_attr.
18846 2004-05-11 Raja R Harinath <rharinath@novell.com>
18849 * attribute.cs (Attribute.GetPositionalValue): New function.
18850 * class.cs (TypeContainer.VerifyMembers): New function.
18851 (TypeContainer.Emit): Use it.
18852 (ClassOrStruct): New base class for Class and Struct.
18853 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
18854 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
18856 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
18857 then each non-static field should have a FieldOffset attribute.
18858 Otherwise, none of the fields should have a FieldOffset attribute.
18859 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
18860 and FieldOffset attributes.
18861 * typemanager.cs (TypeManager.struct_layout_attribute_type)
18862 (TypeManager.field_offset_attribute_type): New core types.
18863 (TypeManager.InitCoreTypes): Initialize them.
18865 2004-05-11 Michal Moskal <malekith@pld-linux.org>
18867 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
18868 Return correct type.
18871 2004-05-09 Miguel de Icaza <miguel@ximian.com>
18873 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
18874 be implicitly converted to ulong.
18876 * expression.cs: The logic for allowing operator &, | and ^ worked
18877 was wrong, it worked before because we did not report an error in
18878 an else branch. Fixes 57895.
18880 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
18881 allow volatile fields to be reference types.
18883 2004-05-07 Miguel de Icaza <miguel@ximian.com>
18885 * driver.cs: Add support for /debug-
18887 2004-05-07 Raja R Harinath <rharinath@novell.com>
18889 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
18890 Add a 'complain' parameter to silence errors.
18891 (Attribute.Resolve): Update to changes. Put in sanity check to catch
18892 silently overlooked type-resolutions.
18893 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
18894 to reflect changes.
18895 (Attributes.Search): New function.
18896 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
18897 (Attributes.GetAttributeFullName): Remove hack.
18898 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
18899 Update to reflect changes.
18900 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
18901 Use Attributes.Search instead of nested loops.
18903 2004-05-07 Marek Safar <marek.safar@seznam.cz>
18906 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
18907 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
18908 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
18910 * report.cs: (Report.Warning): Renamed to Warning_T because of
18911 parameter collision.
18913 2004-05-05 Raja R Harinath <rharinath@novell.com>
18915 * expression.cs (MemberAccess.ResolveMemberAccess):
18916 Exit with non-zero status after Report.Error.
18917 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
18919 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
18921 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
18923 * support.cs: Don't hang when the file is empty.
18925 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
18927 * support.cs: In SeekableStreamReader, compute the preamble size of the
18928 underlying stream. Position changes should take into account that initial
18931 2004-05-03 Todd Berman <tberman@sevenl.net>
18933 * driver.cs: remove unused GetSysVersion function.
18935 2004-05-03 Todd Berman <tberman@sevenl.net>
18937 * driver.cs: Remove the hack from saturday, as well as the hack
18938 from jackson (LoadAssemblyFromGac), also adds the CWD to the
18939 link_paths to get that bit proper.
18941 2004-05-01 Todd Berman <tberman@sevenl.net>
18943 * driver.cs: Try a LoadFrom before a Load, this checks the current
18944 path. This is currently a bug in mono that is be fixed, however, this
18945 provides a workaround for now. This will be removed when the bug
18948 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
18950 * CryptoConvert.cs: Updated to latest version. Fix issue with
18951 incomplete key pairs (#57941).
18953 2004-05-01 Todd Berman <tberman@sevenl.net>
18955 * driver.cs: Remove '.' from path_chars, now System.* loads properly
18958 2004-04-30 Jackson Harper <jackson@ximian.com>
18960 * codegen.cs: Open keys readonly.
18962 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18964 * typemanager.cs: don't report cyclic struct layout when a struct
18965 contains 2 or more fields of the same type. Failed for Pango.AttrShape
18966 which has 2 Pango.Rectangle fields.
18968 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
18970 * expression.cs: Handle IntPtr comparisons with IL code
18971 rather than a method call.
18973 2004-04-29 Martin Baulig <martin@ximian.com>
18975 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
18976 the list of PropertyInfo's in class hierarchy and find the
18977 accessor. Fixes #56013.
18979 2004-04-29 Martin Baulig <martin@ximian.com>
18981 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
18983 2004-04-29 Martin Baulig <martin@ximian.com>
18985 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
18987 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
18989 2004-04-29 Martin Baulig <martin@ximian.com>
18991 * class.cs (ConstructorInitializer.Resolve): Check whether the
18992 parent .ctor is accessible. Fixes #52146.
18994 2004-04-29 Martin Baulig <martin@ximian.com>
18996 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
18998 * statement.cs (Using.EmitLocalVariableDecls): Use
18999 TypeManager.idisposable_type, not typeof (IDisposable).
19000 (Foreach.EmitCollectionForeach): Added support for valuetypes.
19002 2004-04-29 Martin Baulig <martin@ximian.com>
19004 * class.cs (Event.Define): Don't emit the field and don't set
19005 RTSpecialName and SpecialName for events on interfaces. Fixes
19008 2004-04-29 Raja R Harinath <rharinath@novell.com>
19010 Refactor Attribute.ApplyAttributes.
19011 * attribute.cs (Attributable): New base class for objects that can
19012 have Attributes applied on them.
19013 (Attribute): Make AttributeUsage fields public.
19014 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
19015 (Attribute.IsInternalCall): New property.
19016 (Attribute.UsageAttr): Convert to a public read-only property.
19017 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
19018 (Attribute.ResolveType, Attribute.Resolve)
19019 (Attribute.ScanForIndexerName): Update to reflect changes.
19020 (Attribute.CheckAttributeTarget): Re-format.
19021 (Attribute.ApplyAttributes): Refactor, to various
19022 Attributable.ApplyAttributeBuilder methods.
19023 * decl.cs (MemberCore): Make Attributable.
19024 * class.cs (Accessor): Make Attributable.
19025 (MethodData.ApplyAttributes): Use proper attribute types, not
19027 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
19028 (TypeContainer.ApplyAttributeBuilder)
19029 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
19030 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
19031 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
19032 (Operator.ApplyAttributeBuilder): New factored-out methods.
19033 * const.cs (Const.ApplyAttributeBuilder): Likewise.
19034 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
19035 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
19036 * parameter.cs (ParameterBase): New Attributable base class
19037 that can also represent Return types.
19038 (Parameter): Update to the changes.
19040 2004-04-29 Jackson Harper <jackson@ximian.com>
19042 * driver.cs: Prefer the corlib system version when looking for
19043 assemblies in the GAC. This is still a hack, but its a better hack
19046 2004-04-29 Marek Safar <marek.safar@seznam.cz>
19048 * decl.cs, enum.cs: Improved error 3005 reporting.
19050 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
19051 (related_symbols): New private member for list of symbols
19052 related to reported error/warning.
19054 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
19056 2004-04-29 Martin Baulig <martin@ximian.com>
19058 * ecore.cs (Expression.Constantify): If we're an enum and
19059 TypeManager.TypeToCoreType() doesn't give us another type, use
19060 t.UnderlyingSystemType. Fixes #56178.
19062 2004-04-29 Martin Baulig <martin@ximian.com>
19064 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
19065 interfaces and for each interface, only add members directly
19066 declared in that interface. Fixes #53255.
19068 2004-04-28 Martin Baulig <martin@ximian.com>
19070 * expression.cs (ConditionalLogicalOperator): Use a temporary
19071 variable for `left' to avoid that we evaluate it more than once;
19074 2004-04-28 Martin Baulig <martin@ximian.com>
19076 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
19079 2004-04-28 Martin Baulig <martin@ximian.com>
19081 * statement.cs (LocalInfo.Resolve): Check whether the type is not
19084 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
19085 whether the type is not void (CS1547).
19087 2004-04-28 Martin Baulig <martin@ximian.com>
19089 * expression.cs (Unary.DoResolveLValue): Override this and report
19090 CS0131 for anything but Operator.Indirection.
19092 2004-04-28 Martin Baulig <martin@ximian.com>
19094 Committing a patch from Ben Maurer; see bug #50820.
19096 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19099 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19102 2004-04-28 Martin Baulig <martin@ximian.com>
19104 Committing a patch from Ben Maurer; see bug #50820.
19106 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19109 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19112 2004-04-28 Martin Baulig <martin@ximian.com>
19114 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
19115 (Block.AddLabel): Call DoLookupLabel() to only search in the
19118 2004-04-28 Martin Baulig <martin@ximian.com>
19120 * cfold.cs (ConstantFold.BinaryFold): Added special support for
19121 comparing StringConstants and NullLiterals in Equality and Inequality.
19123 2004-04-28 Jackson Harper <jackson@ximian.com>
19125 * driver.cs: Attempt to load referenced assemblies from the
19126 GAC. This is the quick and dirty version of this method that
19127 doesnt take into account versions and just takes the first
19128 canidate found. Will be good enough for now as we will not have more
19129 then one version installed into the GAC until I update this method.
19131 2004-04-28 Martin Baulig <martin@ximian.com>
19133 * typemanager.cs (TypeManager.CheckStructCycles): New public
19134 static method to check for cycles in the struct layout.
19136 * rootcontext.cs (RootContext.PopulateTypes): Call
19137 TypeManager.CheckStructCycles() for each TypeContainer.
19138 [Note: We only need to visit each type once.]
19140 2004-04-28 Martin Baulig <martin@ximian.com>
19142 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
19144 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
19145 success and added `out object value'. Use a `bool resolved' field
19146 to check whether we've already been called rather than
19147 `ConstantValue != null' since this breaks for NullLiterals.
19149 2004-04-28 Raja R Harinath <rharinath@novell.com>
19151 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
19152 setting of this flag, since the 'set' method may be non-public.
19154 2004-04-28 Raja R Harinath <rharinath@novell.com>
19156 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
19157 check on current_vector.Block.
19159 2004-04-27 Martin Baulig <martin@ximian.com>
19161 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
19162 a field initializer. Fixes #56459.
19164 2004-04-27 Martin Baulig <martin@ximian.com>
19166 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
19167 we're not attempting to use an indexer. Fixes #52154.
19169 2004-04-27 Martin Baulig <martin@ximian.com>
19171 * statement.cs (Return): Don't create a return label if we don't
19172 need it; reverts my change from January 20th. Thanks to Ben
19175 2004-04-27 Martin Baulig <martin@ximian.com>
19177 According to the spec, `goto' can only leave a nested scope, but
19180 * statement.cs (Block.LookupLabel): Only lookup in the current
19181 block, don't recurse into parent or child blocks.
19182 (Block.AddLabel): Check in parent and child blocks, report
19183 CS0140/CS0158 if we find a duplicate.
19184 (Block): Removed this indexer for label lookups.
19185 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
19186 this already does the error reporting for us.
19189 (FlowBranching.UsageVector.Block): New public variable; may be null.
19190 (FlowBranching.CreateSibling): Added `Block' argument.
19191 (FlowBranching.LookupLabel): New public virtual method. Lookup a
19192 label for the target of a `goto' and check whether we're not
19193 leaving a `finally'.
19195 2004-04-27 Martin Baulig <martin@ximian.com>
19197 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
19198 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
19201 2004-04-27 Martin Baulig <martin@ximian.com>
19203 * statement.cs (Block.AddLabel): Also check for implicit blocks
19204 and added a CS0158 check.
19206 2004-04-27 Martin Baulig <martin@ximian.com>
19208 * flowanalysis.cs (FlowBranchingLoop): New class.
19209 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
19210 UsageVector's instead of an ArrayList.
19211 (FlowBranching.Label): Likewise.
19212 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
19213 (FlowBranching.AddBreakVector): New method.
19215 2004-04-27 Miguel de Icaza <miguel@ximian.com>
19217 * attribute.cs: Small regression fix: only convert the type if we
19218 the type is different, fixes System.Drawing build.
19220 2004-04-27 Martin Baulig <martin@ximian.com>
19222 * attribute.cs (Attribute.Resolve): If we have a constant value
19223 for a named field or property, implicity convert it to the correct
19226 2004-04-27 Raja R Harinath <rharinath@novell.com>
19228 * statement.cs (Block.Block): Implicit blocks share
19229 'child_variable_names' fields with parent blocks.
19230 (Block.AddChildVariableNames): Remove.
19231 (Block.AddVariable): Mark variable as "used by a child block" in
19232 every surrounding block.
19233 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
19234 been used in a child block, complain about violation of "Invariant
19235 meaning in blocks" rule.
19236 * cs-parser.jay (declare_local_variables): Don't use
19237 AddChildVariableNames.
19238 (foreach_statement): Don't create an implicit block: 'foreach'
19239 introduces a scope.
19241 2004-04-23 Miguel de Icaza <miguel@ximian.com>
19243 * convert.cs (ImplicitNumericConversion): 0 is also positive when
19244 converting from 0L to ulong. Fixes 57522.
19246 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19248 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
19249 derived class hides via 'new' keyword field from base class (test-242.cs).
19250 TODO: Handle this in the more general way.
19252 * class.cs (CheckBase): Ditto.
19254 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19256 * decl.cs (caching_flags): New member for storing cached values
19258 (MemberCore.Flags): New enum where bit flags for caching_flags
19260 (MemberCore.cls_compliance): Moved to caching_flags.
19261 (DeclSpace.Created): Moved to caching_flags.
19263 * class.cs: Use caching_flags instead of DeclSpace.Created
19265 2004-04-21 Miguel de Icaza <miguel@ximian.com>
19267 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
19268 if we are only a derived class, not a nested class.
19270 * typemanager.cs: Same as above, but do this at the MemberLookup
19271 level (used by field and methods, properties are handled in
19272 PropertyExpr). Allow for the qualified access if we are a nested
19275 2004-04-21 Marek Safar <marek.safar@seznam.cz>
19277 * class.cs: Refactoring.
19278 (IMethodData): New inteface; Holds links to parent members
19279 to avoid member duplication (reduced memory allocation).
19280 (Method): Implemented IMethodData interface.
19281 (PropertyBase): New inner classes for get/set methods.
19282 (PropertyBase.PropertyMethod): Implemented IMethodData interface
19283 (Event): New inner classes for add/remove methods.
19284 (Event.DelegateMethod): Implemented IMethodData interface.
19286 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
19287 EmitContext (related to class.cs refactoring).
19289 2004-04-21 Raja R Harinath <rharinath@novell.com>
19291 * delegate.cs (Delegate.VerifyApplicability): If the number of
19292 arguments are the same as the number of parameters, first try to
19293 verify applicability ignoring any 'params' modifier on the last
19297 2004-04-16 Raja R Harinath <rharinath@novell.com>
19299 * class.cs (TypeContainer.AddIndexer): Use
19300 'ExplicitInterfaceName' to determine if interface name was
19301 explicitly specified. 'InterfaceType' is not initialized at this time.
19302 (TypeContainer.DefineIndexers): Remove use of temporary list. The
19303 Indexers array is already in the required order. Initialize
19304 'IndexerName' only if there are normal indexers.
19305 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
19306 (TypeContainer.Emit): Emit DefaultMember attribute only if
19307 IndexerName is initialized.
19310 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
19312 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
19315 2004-04-15 Raja R Harinath <rharinath@novell.com>
19317 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
19321 * attribute.cs (Attribute.Resolve): Check for duplicate named
19325 2004-04-15 Miguel de Icaza <miguel@ximian.com>
19327 * iterators.cs (MarkYield): track whether we are in an exception,
19328 and generate code accordingly. Use a temporary value to store the
19329 result for our state.
19331 I had ignored a bit the interaction of try/catch with iterators
19332 since their behavior was not entirely obvious, but now it is
19333 possible to verify that our behavior is the same as MS .NET 2.0
19337 2004-04-14 Miguel de Icaza <miguel@ximian.com>
19339 * iterators.cs: Avoid creating temporaries if there is no work to
19342 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
19343 Enumerations, use TypeManager.EnumToUnderlying and call
19346 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
19349 (This.Emit): Use EmitContext.EmitThis to emit our
19352 (This.EmitAssign): Ditto.
19354 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
19355 codepaths, we will move all the functionality into
19358 (FieldExpr.EmitAssign): Ditto.
19360 This fixes several hidden bugs that I uncovered while doing a code
19361 review of this today.
19363 * codegen.cs (EmitThis): reworked so the semantics are more clear
19364 and also support value types "this" instances.
19366 * iterators.cs: Changed so that for iterators in value types, we
19367 do not pass the value type as a parameter.
19369 Initialization of the enumerator helpers is now done in the caller
19370 instead of passing the parameters to the constructors and having
19371 the constructor set the fields.
19373 The fields have now `assembly' visibility instead of private.
19375 2004-04-11 Miguel de Icaza <miguel@ximian.com>
19377 * expression.cs (Argument.Resolve): Check if fields passed as ref
19378 or out are contained in a MarshalByRefObject.
19380 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
19381 another compiler type.
19383 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
19385 * class.cs (Indexer.Define): use the new name checking method.
19386 Also, return false on an error.
19387 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
19388 (is_identifier_[start/part]_character): make static.
19390 2004-04-10 Miguel de Icaza <miguel@ximian.com>
19392 * expression.cs (Binary.ResolveOperator): Do no append strings
19393 twice: since we can be invoked more than once (array evaluation)
19394 on the same concatenation, take care of this here. Based on a fix
19395 from Ben (bug #56454)
19397 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
19399 * codegen.cs: Fix another case where CS1548 must be reported (when
19400 delay-sign isn't specified and no private is available #56564). Fix
19401 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
19402 error when MCS is used on the MS runtime and we need to delay-sign
19403 (which seems unsupported by AssemblyBuilder - see #56621).
19405 2004-04-08 Marek Safar <marek.safar@seznam.cz>
19407 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
19408 (TypeManager.ComputeNamespaces): Faster implementation for
19411 * compiler.csproj: Updated AssemblyName to mcs.
19413 2004-04-07 Miguel de Icaza <miguel@ximian.com>
19415 * rootcontext.cs: Add new types to the boot resolution.
19417 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
19418 MulticastDelegate is not allowed.
19420 * typemanager.cs: Add new types to lookup: System.TypedReference
19423 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
19424 check for TypedReference or ArgIterator, they are not allowed.
19426 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
19427 makes us properly catch 1510 in some conditions (see bug 56016 for
19430 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
19432 * CryptoConvert.cs: update from corlib version
19435 2004-04-05 Miguel de Icaza <miguel@ximian.com>
19437 * class.cs (Indexer.Define): Check indexername declaration
19439 2004-04-05 Marek Safar <marek.safar@seznam.cz>
19441 * attribute.cs (IsClsCompliant): Fixed problem with handling
19442 all three states (compliant, not-compliant, undetected).
19444 2004-03-30 Marek Safar <marek.safar@seznam.cz>
19446 * attribute.cs (Attribute): Location is now public.
19447 (Resolve): Store resolved arguments (pos_values) in attribute class.
19448 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
19449 (GetClsCompliantAttributeValue): New method that gets
19450 CLSCompliantAttribute value.
19451 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
19452 if exists else null.
19453 (AttributeTester): New class for CLS-Compliant verification routines.
19455 * class.cs (Emit): Add CLS-Compliant verification.
19456 (Method.GetSignatureForError): Implemented.
19457 (Constructor.GetSignatureForError): Implemented
19458 (Constructor.HasCompliantArgs): Returns if constructor has
19459 CLS-Compliant arguments.
19460 (Constructor.Emit): Override.
19461 (Construcor.IsIdentifierClsCompliant): New method; For constructors
19462 is needed to test only parameters.
19463 (FieldBase.GetSignatureForError): Implemented.
19464 (TypeContainer): New member for storing base interfaces.
19465 (TypeContainer.FindMembers): Search in base interfaces too.
19467 * codegen.cs (GetClsComplianceAttribute): New method that gets
19468 assembly or module CLSCompliantAttribute value.
19469 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
19471 (ModuleClass.Emit): Add error 3012 test.
19473 * const.cs (Emit): Override and call base for CLS-Compliant tests.
19475 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
19476 state for all decl types.
19477 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
19478 if CLS-Compliant tests are required.
19479 (IsClsCompliaceRequired): New method. Analyze whether code
19480 must be CLS-Compliant.
19481 (IsExposedFromAssembly): New method. Returns true when MemberCore
19482 is exposed from assembly.
19483 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
19484 value or gets cached value.
19485 (HasClsCompliantAttribute): New method. Returns true if MemberCore
19486 is explicitly marked with CLSCompliantAttribute.
19487 (IsIdentifierClsCompliant): New abstract method. This method is
19488 used to testing error 3005.
19489 (IsIdentifierAndParamClsCompliant): New method. Common helper method
19490 for identifier and parameters CLS-Compliant testing.
19491 (VerifyClsCompliance): New method. The main virtual method for
19492 CLS-Compliant verifications.
19493 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
19494 null. I don't know why is null (too many public members !).
19495 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
19496 and get value of first CLSCompliantAttribute that found.
19498 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
19499 (VerifyClsCompliance): Override and add extra tests.
19501 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
19502 clscheck- disable CLS-Compliant verification event if assembly is has
19503 CLSCompliantAttribute(true).
19505 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
19506 ApllyAttribute is now called in emit section as in the other cases.
19507 Possible future Emit integration.
19508 (IsIdentifierClsCompliant): New override.
19509 (VerifyClsCompliance): New override.
19510 (GetEnumeratorName): Returns full enum name.
19512 * parameter.cs (GetSignatureForError): Implemented.
19514 * report.cs (WarningData): New struct for Warning message information.
19515 (LocationOfPreviousError): New method.
19516 (Warning): New method. Reports warning based on the warning table.
19517 (Error_T): New method. Reports error based on the error table.
19519 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
19520 verifications are done here.
19522 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
19524 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
19525 CLSCompliantAttribute.
19526 (all_imported_types): New member holds all imported types from other
19528 (LoadAllImportedTypes): New method fills static table with exported types
19529 from all referenced assemblies.
19530 (Modules): New property returns all assembly modules.
19532 2004-03-30 Miguel de Icaza <miguel@ximian.com>
19534 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
19535 throwing a parser error.
19537 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
19538 which removes the hardcoded get_/set_ prefixes for properties, as
19539 IL allows for the properties to be named something else.
19543 * expression.cs: Do not override operand before we know if it is
19544 non-null. Fix 56207
19546 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19548 * typemanager.cs: support for pinned variables.
19550 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19552 * decl.cs, typemanager.cs: Avoid using an arraylist
19553 as a buffer if there is only one result set.
19555 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19557 * expression.cs: Make sure you cant call a static method
19558 with an instance expression, bug #56174.
19560 2004-03-29 Miguel de Icaza <miguel@ximian.com>
19562 * class.cs (IsDuplicateImplementation): Improve error reporting to
19563 flag 663 (method only differs in parameter modifier).
19565 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
19566 in preprocessor directives.
19568 * location.cs (LookupFile): Allow for the empty path.
19570 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
19571 better approach for some of that patch, but its failing with the
19572 CharSet enumeration. For now try/catch will do.
19574 * typemanager.cs: Do not crash if a struct does not have fields.
19577 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19579 * expression.cs: cs0213, cant fix a fixed expression.
19582 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19584 * cs-parser.jay: detect invalid embeded statements gracefully.
19587 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19589 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
19592 the invocation type may not be a subclass of the tye of the item/
19593 The type of the item must be a subclass of the invocation item.
19598 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
19600 * attribute.cs: Added methods to get a string and a bool from an
19601 attribute. Required to information from AssemblyKeyFileAttribute,
19602 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
19603 * codegen.cs: Modified AssemblyName creation to include support for
19604 strongnames. Catch additional exceptions to report them as CS1548.
19605 * compiler.csproj: Updated include CryptoConvert.cs.
19606 * compiler.csproj.user: Removed file - user specific configuration.
19607 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
19608 Mono.Security assembly. The original class is maintained and tested in
19609 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
19610 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
19611 like CSC 8.0 (C# v2) supports.
19612 * Makefile: Added CryptoConvert.cs to mcs sources.
19613 * rootcontext.cs: Added new options for strongnames.
19615 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
19617 * driver.cs: For --expect-error, report error code `2'
19618 if the program compiled with no errors, error code `1' if
19619 it compiled with an error other than the one expected.
19621 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
19623 * compiler.csproj: Updated for Visual Studio .NET 2003.
19624 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
19625 * compiler.sln: Updated for Visual Studio .NET 2003.
19627 2004-03-24 Ravi Pratap M <ravi@ximian.com>
19629 * expression.cs: Fix bug #47234. We basically need to apply the
19630 rule that we prefer the conversion of null to a reference type
19631 when faced with a conversion to 'object' (csc behaviour).
19633 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19635 * statement.cs: Shorter form for foreach, eliminates
19636 a local variable. r=Martin.
19638 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19640 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
19641 checks if we can use brtrue/brfalse to test for 0.
19642 * expression.cs: use the above in the test for using brtrue/brfalse.
19643 cleanup code a bit.
19645 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19647 * expression.cs: Rewrite string concat stuff. Benefits:
19649 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
19650 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
19651 rather than a concat chain.
19653 * typemanager.cs: Add lookups for more concat overloads.
19655 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19657 * expression.cs: Emit shorter il code for array init.
19674 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
19676 * statement.cs: Before, two switch blocks would be merged if the
19677 total size of the blocks (end_item - begin_item + 1) was less than
19678 two times the combined sizes of the blocks.
19680 Now, it will only merge if after the merge at least half of the
19685 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
19687 * class.cs : csc build fix for GetMethods(). See bug #52503.
19689 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
19691 * expression.cs: Make sure fp comparisons work with NaN.
19692 This fixes bug #54303. Mig approved this patch a long
19693 time ago, but we were not able to test b/c the runtime
19696 2004-03-19 Miguel de Icaza <miguel@ximian.com>
19698 * ecore.cs (TypExpr.GetHashCode): implement this overload.
19700 2004-03-19 Martin Baulig <martin@ximian.com>
19702 * class.cs (MemberCore.IsDuplicateImplementation): Report the
19703 error here and not in our caller.
19705 2004-03-19 Martin Baulig <martin@ximian.com>
19707 * interface.cs: Completely killed this file.
19708 (Interface): We're now a TypeContainer and live in class.cs.
19710 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
19711 argument; we're now also called for interfaces.
19712 (TypeContainer.DefineMembers): Allow this method being called
19714 (TypeContainer.GetMethods): New public method; formerly known as
19715 Interface.GetMethod(). This is used by PendingImplementation.
19716 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
19717 it's now private and non-static.
19718 (Interface): Moved this here; it's now implemented similar to
19720 (Method, Property, Event, Indexer): Added `bool is_interface'
19721 argument to their .ctor's.
19722 (MemberBase.IsInterface): New public field.
19724 * cs-parser.jay: Create normal Method, Property, Event, Indexer
19725 instances instead of InterfaceMethod, InterfaceProperty, etc.
19726 (opt_interface_base): Removed; we now use `opt_class_base' instead.
19727 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
19729 2004-03-19 Martin Baulig <martin@ximian.com>
19731 * class.cs (MethodCore.IsDuplicateImplementation): New private
19732 method which does the CS0111 checking.
19733 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
19734 Use IsDuplicateImplementation().
19736 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
19738 * decl.cs (FindMemberToOverride): New method to find the correct
19739 method or property to override in the base class.
19741 - Make Method/Property use the above method to find the
19742 version in the base class.
19743 - Remove the InheritableMemberSignatureCompare as it is now
19746 This patch makes large code bases much faster to compile, as it is
19747 O(n) rather than O(n^2) to do this validation.
19749 Also, it fixes bug 52458 which is that nested classes are not
19750 taken into account when finding the base class member.
19752 Reviewed/Approved by Martin.
19754 2004-03-17 Marek Safar <marek.safar@seznam.cz>
19756 * interface.cs: In all interface classes removed redundant
19757 member initialization.
19759 2004-03-16 Martin Baulig <martin@ximian.com>
19761 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
19763 2004-03-15 Miguel de Icaza <miguel@ximian.com>
19765 * decl.cs (DefineTypeAndParents): New helper method to define a
19766 type's containers before the type itself is defined; This is a
19767 bug exposed by the recent changes to Windows.Forms when an
19768 implemented interface was defined inside a class that had not been
19771 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
19773 (Check): Loop correctly to report errors modifiers
19774 (UNSAFE was not in the loop, since it was the same as TOP).
19776 * interface.cs: Every interface member now takes a ModFlags,
19777 instead of a "is_new" bool, which we set on the base MemberCore.
19779 Every place where we called "UnsafeOk" in the interface, now we
19780 call the proper member (InterfaceMethod.UnsafeOK) instead to get
19781 the unsafe settings from the member declaration instead of the
19782 container interface.
19784 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
19786 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
19787 `set_indexer_name' to the pending bits (one per type).
19789 We fixed a bug today that was picking the wrong method to
19790 override, since for properties the existing InterfaceMethod code
19791 basically ignored the method name. Now we make sure that the
19792 method name is one of the valid indexer names.
19794 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
19796 * support.cs (SeekableStreamReader): Keep track of stream byte
19797 positions and don't mix them with character offsets to the buffer.
19799 Patch from Gustavo Giráldez
19801 2004-03-15 Marek Safar <marek.safar@seznam.cz>
19803 * interface.cs (InterfaceSetGetBase): Removed double member
19804 initialization, base class does it as well.
19806 2004-03-13 Martin Baulig <martin@ximian.com>
19808 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
19809 when compiling corlib.
19811 2004-03-13 Miguel de Icaza <miguel@ximian.com>
19813 * convert.cs (ExplicitConversion): We were reporting an error on
19814 certain conversions (object_type source to a value type, when the
19815 expression was `null') before we had a chance to pass it through
19816 the user defined conversions.
19818 * driver.cs: Replace / and \ in resource specifications to dots.
19821 * class.cs: Add check for duplicate operators. Fixes 52477
19823 2004-03-11 Miguel de Icaza <miguel@ximian.com>
19825 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
19826 that are in the middle of the statements, not only at the end.
19829 * class.cs (TypeContainer.AddField): No longer set the
19830 `HaveStaticConstructor' flag, now we call it
19831 `UserDefineStaticConstructor' to diferentiate the slightly
19832 semantic difference.
19834 The situation is that we were not adding BeforeFieldInit (from
19835 Modifiers.TypeAttr) to classes that could have it.
19836 BeforeFieldInit should be set to classes that have no static
19841 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
19843 And most importantly Zoltan's comment:
19845 http://bugzilla.ximian.com/show_bug.cgi?id=44229
19847 "I think beforefieldinit means 'it's ok to initialize the type sometime
19848 before its static fields are used', i.e. initialization does not need
19849 to be triggered by the first access to the type. Setting this flag
19850 helps the JIT to compile better code, since it can run the static
19851 constructor at JIT time, and does not need to generate code to call it
19852 (possibly lots of times) at runtime. Unfortunately, mcs does not set
19853 this flag for lots of classes like String.
19855 csc sets this flag if the type does not have an explicit static
19856 constructor. The reasoning seems to be that if there are only static
19857 initalizers for a type, and no static constructor, then the programmer
19858 does not care when this initialization happens, so beforefieldinit
19861 This bug prevents the AOT compiler from being usable, since it
19862 generates so many calls to mono_runtime_class_init that the AOT code
19863 is much slower than the JITted code. The JITted code is faster,
19864 because it does not generate these calls if the vtable is type is
19865 already initialized, which is true in the majority of cases. But the
19866 AOT compiler can't do this."
19868 2004-03-10 Miguel de Icaza <miguel@ximian.com>
19870 * class.cs (MethodData.Emit): Refactor the code so symbolic
19871 information is generated for destructors; For some reasons we
19872 were taking a code path that did not generate symbolic information
19875 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
19877 * class.cs: Create a Constructor.CheckBase method that
19878 takes care of all validation type code. The method
19879 contains some code that was moved from Define.
19881 It also includes new code that checks for duplicate ctors.
19882 This fixes bug #55148.
19884 2004-03-09 Joshua Tauberer <tauberer@for.net>
19886 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
19887 a { ... }-style array creation invokes EmitStaticInitializers
19888 which is not good for reference-type arrays. String, decimal
19889 and now null constants (NullCast) are not counted toward
19890 static initializers.
19892 2004-03-05 Martin Baulig <martin@ximian.com>
19894 * location.cs (SourceFile.HasLineDirective): New public field;
19895 specifies whether the file contains or is referenced by a "#line"
19897 (Location.DefineSymbolDocuments): Ignore source files which
19898 either contain or are referenced by a "#line" directive.
19900 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
19902 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
19903 direct access to our parent, so check the method inline there.
19905 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
19907 * expression.cs (Invocation.EmitCall): Miguel's last commit
19908 caused a regression. If you had:
19913 In Foo the implict this would be null.
19915 2004-02-27 Miguel de Icaza <miguel@ximian.com>
19917 * expression.cs (Invocation.EmitCall): If the method is not
19918 virtual, do not emit a CallVirt to it, use Call.
19920 * typemanager.cs (GetFullNameSignature): Improve the method to
19921 cope with ".ctor" and replace it with the type name.
19923 * class.cs (ConstructorInitializer.Resolve): Now the method takes
19924 as an argument the ConstructorBuilder where it is being defined,
19925 to catch the recursive constructor invocations.
19927 2004-02-26 Miguel de Icaza <miguel@ximian.com>
19929 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
19930 routines to check if a type is an enumerable/enumerator allow
19931 classes that implement the IEnumerable or IEnumerator interfaces.
19933 * class.cs (Property, Operator): Implement IIteratorContainer, and
19934 implement SetYields.
19936 (Property.Define): Do the block swapping for get_methods in the
19937 context of iterators. We need to check if Properties also
19938 include indexers or not.
19940 (Operator): Assign the Block before invoking the
19941 OperatorMethod.Define, so we can trigger the Iterator code
19944 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
19945 Property and Operator classes are not created when we parse the
19946 declarator but until we have the block completed, so we use a
19947 singleton SimpleIteratorContainer.Simple to flag whether the
19948 SetYields has been invoked.
19950 We propagate this setting then to the Property or the Operator to
19951 allow the `yield' to function.
19953 2004-02-25 Marek Safar <marek.safar@seznam.cz>
19955 * codegen.cs: Implemented attribute support for modules.
19956 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
19957 Assembly/Module functionality.
19959 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
19960 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
19961 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
19963 2004-02-16 Marek Safar <marek.safar@seznam.cz>
19965 * interface.cs (FindMembers): The operation is performed on all base
19966 interfaces and not only on the first. It is required for future CLS Compliance patch.
19968 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
19970 * statement.cs, codegen.cs:
19971 This patch deals with patterns such as:
19973 public class List : IEnumerable {
19975 public MyEnumerator GetEnumerator () {
19976 return new MyEnumerator(this);
19979 IEnumerator IEnumerable.GetEnumerator () {
19983 public struct MyEnumerator : IEnumerator {
19988 Before, there were a few things we did wrong:
19989 1) we would emit callvirt on a struct, which is illegal
19990 2) we emited ldarg when we needed to emit ldarga
19991 3) we would mistakenly call the interface methods on an enumerator
19992 type that derived from IEnumerator and was in another assembly. For example:
19994 public class MyEnumerator : IEnumerator
19996 Would have the interface methods called, even if there were public impls of the
19997 method. In a struct, this lead to invalid IL code.
19999 2004-02-11 Marek Safar <marek.safar@seznam.cz>
20001 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
20004 * delegate.cs (Define): Fixed crash when delegate type is undefined.
20006 2004-02-11 Miguel de Icaza <miguel@ximian.com>
20008 * cs-parser.jay: Fix small regression: we were not testing V2
20009 compiler features correctly.
20011 * interface.cs: If the emit context is null, then create one
20013 2004-02-09 Marek Safar <marek.safar@seznam.cz>
20015 * decl.cs (GetSignatureForError): New virtual method to get full name
20016 for error messages.
20018 * attribute.cs (IAttributeSupport): New interface for attribute setting.
20019 Now it is possible to rewrite ApplyAttributes method to be less if/else.
20021 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
20022 Duplicated members and code in these classes has been removed.
20023 Better encapsulation in these classes.
20025 2004-02-07 Miguel de Icaza <miguel@ximian.com>
20027 * assign.cs (Assign.DoResolve): When dealing with compound
20028 assignments, there is a new rule in ECMA C# 2.4 (might have been
20029 there before, but it is documented here) that states that in:
20033 If b is of type int, and the `op' is a shift-operator, then the
20034 above is evaluated as:
20038 * expression.cs (Binary.ResolveOperator): Instead of testing for
20039 int/uint/long/ulong, try to implicitly convert to any of those
20040 types and use that in pointer arithmetic.
20042 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
20043 method to print information for from the type, not from the
20044 null-method we were given.
20046 2004-02-01 Duncan Mak <duncan@ximian.com>
20048 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
20049 parsing for cmd, fixes bug #53694.
20051 2004-02-04 Marek Safar <marek.safar@seznam.cz>
20053 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
20054 in the member name duplication tests. Property and operator name duplication
20055 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
20057 2004-02-03 Marek Safar <marek.safar@seznam.cz>
20059 * interface.cs (PopulateMethod): Fixed crash when interface method
20060 returns not existing type (error test cs0246-3.cs).
20062 2004-02-02 Ravi Pratap M <ravi@ximian.com>
20064 * cs-parser.jay (interface_accessors): Re-write actions to also
20065 store attributes attached to get and set methods. Fix spelling
20068 (inteface_property_declaration): Modify accordingly.
20070 (InterfaceAccessorInfo): New helper class to store information to pass
20071 around between rules that use interface_accessors.
20073 * interface.cs (Emit): Apply attributes on the get and set
20074 accessors of properties and indexers too.
20076 * attribute.cs (ApplyAttributes): Modify accordingly to use the
20077 right MethodBuilder when applying attributes to the get and set accessors.
20079 2004-01-31 Miguel de Icaza <miguel@ximian.com>
20081 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
20083 2004-01-26 Miguel de Icaza <miguel@ximian.com>
20085 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
20087 2004-01-25 Miguel de Icaza <miguel@ximian.com>
20089 * cs-parser.jay: Remove YIELD token, instead use the new grammar
20090 changes that treat `yield' specially when present before `break'
20091 or `return' tokens.
20093 * cs-tokenizer.cs: yield is no longer a keyword.
20095 2004-01-23 Marek Safar <marek.safar@seznam.cz>
20097 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
20098 setting for default constructors.
20099 For default constructors are almost every time set wrong Modifier. The
20100 generated IL code has been alright. But inside mcs this values was
20101 wrong and this was reason why several of my CLS Compliance tests
20104 2004-01-22 Martin Baulig <martin@ximian.com>
20106 * cs-parser.jay (namespace_or_type_name): Return an Expression,
20107 not a QualifiedIdentifier. This is what `type_name_expression'
20108 was previously doing.
20109 (type_name_expression): Removed; the code is now in
20110 `namespace_or_type_name'.
20111 (qualified_identifier): Removed, use `namespace_or_type_name'
20113 (QualifiedIdentifier): Removed this class.
20115 2004-01-22 Martin Baulig <martin@ximian.com>
20117 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
20118 not a string as alias name.
20120 2004-01-21 Miguel de Icaza <miguel@ximian.com>
20122 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
20123 #52730 bug, and instead compute correctly the need to use a
20124 temporary variable when requesting an address based on the
20125 static/instace modified of the field and the constructor.
20127 2004-01-21 Martin Baulig <martin@ximian.com>
20129 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
20130 class and namespace before looking up aliases. Fixes #52517.
20132 2004-01-21 Martin Baulig <martin@ximian.com>
20134 * flowanalysis.cs (UsageVector.Merge): Allow variables being
20135 assinged in a 'try'; fixes exception4.cs.
20137 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20138 * class.cs : Implemented parameter-less constructor for TypeContainer
20140 * decl.cs: Attributes are now stored here. New property OptAttributes
20142 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
20144 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
20146 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20148 * typemanager.cs (CSharpSignature): Now reports also inner class name.
20149 (CSharpSignature): New method for indexer and property signature.
20151 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20153 * pending.cs (IsVirtualFilter): Faster implementation.
20155 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20157 * typemanager.cs: Avoid inclusion of same assembly more than once.
20159 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20161 * cs-parser.jay: Fixed problem where the last assembly attribute
20162 has been applied also to following declaration (class, struct, etc.)
20164 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20166 * class.cs: Added error CS0538, CS0539 reporting.
20167 Fixed crash on Microsoft runtime when field type is void.
20169 * cs-parser.jay: Added error CS0537 reporting.
20171 * pending.cs: Added error CS0535 reporting.
20172 Improved error report for errors CS0536, CS0534.
20174 2004-01-20 Miguel de Icaza <miguel@ximian.com>
20176 Merge a few bits from the Anonymous Method MCS tree.
20178 * statement.cs (ToplevelBlock): New class for toplevel methods,
20179 will hold anonymous methods, lifted variables.
20181 * cs-parser.jay: Create toplevel blocks for delegates and for
20182 regular blocks of code.
20184 2004-01-20 Martin Baulig <martin@ximian.com>
20186 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
20187 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
20188 and `NeedExplicitReturn'; added `IsLastStatement'.
20189 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
20190 have a `ReturnLabel' or we're not unreachable.
20192 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
20193 child's reachability; don't just override ours with it. Fixes
20194 #58058 (lluis's example).
20195 (FlowBranching): Added public InTryOrCatch(), InCatch(),
20196 InFinally(), InLoop(), InSwitch() and
20197 BreakCrossesTryCatchBoundary() methods.
20199 * statement.cs (Return): Do all error checking in Resolve().
20200 Unless we are the last statement in a top-level block, always
20201 create a return label and jump to it.
20202 (Break, Continue): Do all error checking in Resolve(); also make
20203 sure we aren't leaving a `finally'.
20204 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
20205 statement in a top-level block.
20206 (Block.Flags): Added `IsDestructor'.
20207 (Block.IsDestructor): New public property.
20209 2004-01-20 Martin Baulig <martin@ximian.com>
20211 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
20213 2004-01-20 Martin Baulig <martin@ximian.com>
20215 * statement.cs (Statement.ResolveUnreachable): New public method.
20216 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
20217 (Block.Resolve): Resolve unreachable statements.
20219 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20221 * expression.cs: We need to fix the case where we do
20222 not have a temp variable here.
20224 * assign.cs: Only expression compound assignments need
20225 temporary variables.
20227 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20229 * flowanalysis.cs: Reduce memory allocation in a few ways:
20230 - A block with no variables should not allocate a bit
20232 - A method with no out parameters does not need any tracking
20233 for assignment of the parameters, so we need not allocate
20236 public readonly Type[] VariableTypes;
20237 public readonly string[] VariableNames;
20238 Are redundant. The data is already stored in the variable
20239 map, so we need not allocate another array for it.
20240 - We need to add alot of checks for if (params | locals) == null
20241 due to the first two changes.
20243 2004-01-18 Miguel de Icaza <miguel@ximian.com>
20245 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
20246 implement IMemoryLocation, we store a copy on a local variable and
20247 take the address of it. Patch from Benjamin Jemlich
20249 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
20250 to use a special "type_name_expression" rule which reduces the
20251 number of "QualifiedIdentifier" classes created, and instead
20252 directly creates MemberAccess expressions.
20254 2004-01-17 Miguel de Icaza <miguel@ximian.com>
20256 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
20257 that fixes #52853. Null literal assignment to ValueType
20259 * class.cs (MethodData.Emit): Instead of checking the name of the
20260 method to determine if its a destructor, create a new derived
20261 class from Method called Destructor, and test for that.
20263 * cs-parser.jay: Create a Destructor object instead of a Method.
20265 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
20269 2004-01-16 Miguel de Icaza <miguel@ximian.com>
20271 * expression.cs (Binary.ResolveOperator): Perform an implicit
20272 conversion from MethodGroups to their delegate types on the
20273 Addition operation.
20275 * delegate.cs: Introduce a new class DelegateCreation that is the
20276 base class for `NewDelegate' and `ImplicitDelegateCreation',
20277 factor some code in here.
20279 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
20280 conversion from MethodGroups to compatible delegate types.
20282 * ecore.cs (Expression.Resolve): Do not flag error 654
20283 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
20284 we allow conversions from MethodGroups to delegate types now.
20286 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
20287 assignments in v2 either.
20289 2004-01-10 Miguel de Icaza <miguel@ximian.com>
20291 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
20292 static read-only fields in ctors.
20294 Applied patch from Benjamin Jemlich
20296 * expression.cs (UnaryMutator): Avoid leaking local variables.
20298 2004-01-09 Miguel de Icaza <miguel@ximian.com>
20300 * cs-tokenizer.cs (IsCastToken): Allow the various native types
20301 here to return true, as they can be used like this:
20303 (XXX) int.MEMBER ()
20305 Fixed 49836 and all the other dups
20307 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
20309 * driver.cs: Implement /win32res and /win32icon.
20311 2004-01-08 Miguel de Icaza <miguel@ximian.com>
20313 * cs-parser.jay: Add a rule to improve error handling for the
20314 common mistake of placing modifiers after the type.
20316 2004-01-07 Miguel de Icaza <miguel@ximian.com>
20318 * cs-parser.jay (interface_event_declaration): Catch
20319 initialization of events on interfaces, and report cs0068
20321 * cs-parser.jay (interface_event_declaration): Catch
20322 initialization of events.
20324 * ecore.cs: Better report missing constructors.
20326 * expression.cs (Binary.ResolveOperator): My previous bug fix had
20327 the error reporting done in the wrong place. Fix.
20329 * expression.cs (Binary.ResolveOperator): Catch the
20330 operator + (E x, E y) error earlier, and later allow for implicit
20331 conversions in operator +/- (E e, U x) from U to the underlying
20334 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
20335 52596, if the container class is abstract, the default constructor
20336 is protected otherwise its public (before, we were always public).
20338 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
20341 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
20342 Jemlich that fixes bug #52597, MCS was generating invalid code for
20343 idisposable structs. Thanks to Ben for following up with this
20346 2004-01-06 Miguel de Icaza <miguel@ximian.com>
20348 * driver.cs: Allow assemblies without code to be generated, fixes
20351 2004-01-07 Nick Drochak <ndrochak@gol.com>
20353 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
20355 2004-01-05 Miguel de Icaza <miguel@ximian.com>
20357 * cs-parser.jay: Add rules to improve error reporting if fields or
20358 methods are declared at the namespace level (error 116)
20360 * Add rules to catch event add/remove
20362 2004-01-04 David Sheldon <dave-mono@earth.li>
20364 * expression.cs: Added matching ")" to error message for
20367 2004-01-03 Todd Berman <tberman@gentoo.org>
20369 * ecore.cs, attribute.cs:
20370 Applying fix from #52429.
20372 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20374 * ecore.cs, expression.cs, statement.cs:
20375 Total rewrite of how we handle branching. We
20376 now handle complex boolean expressions with fewer
20377 jumps. As well if (x == 0) no longer emits a ceq.
20379 if (x is Foo) is much faster now, because we generate
20382 Overall, we get a pretty big improvement on our benchmark
20383 tests. The code we generate is smaller and more readable.
20385 I did a full two-stage bootstrap. The patch was reviewed
20386 by Martin and Miguel.
20388 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20390 * cs-parser.jay: Make primary_expression not take a QI.
20391 we dont need this because the member_access rule covers
20392 us here. So we replace the rule with just IDENTIFIER.
20394 This has two good effects. First, we remove a s/r conflict.
20395 Second, we allocate many fewer QualifiedIdentifier objects.
20397 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20399 * attribute.cs: Handle MarshalAs attributes as pseudo, and
20400 set the correct information via SRE. This prevents
20401 hanging on the MS runtime. Fixes #29374.
20403 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20405 * convert.cs: correctly handle conversions to value types
20406 from Enum and ValueType as unboxing conversions.
20408 Fixes bug #52569. Patch by Benjamin Jemlich.
20410 2004-01-02 Ravi Pratap <ravi@ximian.com>
20412 * expression.cs (BetterConversion): Prefer int -> uint
20413 over int -> ulong (csc's behaviour). This fixed bug #52046.
20415 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
20417 * decl.cs (MemberCache.FindMembers): now returns a
20420 * typemanager.cs: In general, go with with ^^.
20421 (CopyNewMethods): take an IList.
20422 (RealMemberLookup): Only allocate an arraylist
20423 if we copy from two sets of methods.
20425 This change basically does two things:
20426 1) Fewer array lists allocated due to CopyNewMethods.
20427 2) the explicit cast in MemberList costed ALOT.
20429 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
20431 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
20432 a hashtable to avoid needless string allocations when an identifier is
20433 used more than once (the common case).
20435 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20437 * pending.cs: MS's TypeBuilder.GetInterfaces ()
20438 is broken, it will not return anything. So, we
20439 have to use the information we have in mcs to
20442 * typemanager.cs: Add a cache for GetInterfaces,
20443 since this will now be used more often (due to ^^)
20445 (GetExplicitInterfaces) New method that gets the
20446 declared, not effective, interfaces on a type
20447 builder (eg, if you have interface IFoo, interface
20448 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
20451 This patch makes MCS able to bootstrap itself on
20454 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20456 * expression.cs: Remove the Nop's that Miguel put
20459 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20461 * report.cs, codegen.cs: Give the real stack trace to
20462 the error when an exception is thrown.
20464 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20466 * decl.cs: only allocate hashtables for ifaces if
20469 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20471 * expression.cs: fix the error from cs0121-2.cs
20472 (a parent interface has two child interfaces that
20473 have a function with the same name and 0 params
20474 and the function is called through the parent).
20476 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
20478 * class.cs, rootcontext.cs, typmanager.cs: do not
20481 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
20483 * codegen.cs: remove stack for the ec flow branching.
20484 It is already a linked list, so no need.
20486 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
20488 * Makefile: Allow custom profiler here.
20490 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20492 * typemanager.cs (LookupType):
20493 - Use a static char [], because split takes
20494 a param array for args, so it was allocating
20496 - Do not store true in a hashtable, it boxes.
20498 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20500 * flowanalysis.cs: bytify common enums.
20502 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20504 * modifiers.cs: Add a new set of flags for the
20505 flags allowed on explicit interface impls.
20506 * cs-parser.jay: catch the use of modifiers in
20507 interfaces correctly.
20508 * class.cs: catch private void IFoo.Blah ().
20510 All related to bug #50572.
20512 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20514 * decl.cs: Rewrite the consistant accessability checking.
20515 Accessability is not linear, it must be implemented in
20516 a tableish way. Fixes #49704.
20518 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20520 * expression.cs: Handle negation in a checked context.
20521 We must use subtraction from zero. Fixes #38674.
20523 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20525 * class.cs: Ignore static void main in DLLs.
20526 * rootcontext.cs: Handle the target type here,
20527 since we are have to access it from class.cs
20528 * driver.cs: account for the above.
20530 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20532 * report.cs: Give line numbers and files if available.
20534 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
20536 * driver.cs: Implement /addmodule.
20538 * typemanager.cs: Change 'modules' field so it now contains Modules not
20541 2003-12-20 Martin Baulig <martin@ximian.com>
20543 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
20544 (FieldBase.IsAssigned): Removed this field.
20545 (FieldBase.SetAssigned): New public method.
20546 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
20548 2003-12-20 Martin Baulig <martin@ximian.com>
20550 * expression.cs (LocalVariableReference.DoResolve): Don't set
20551 `vi.Used' if we're called from DoResolveLValue().
20553 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
20554 returns the usage vector it just merged into the current one -
20555 pass this one to UsageWarning().
20556 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
20557 of the `EmitContext', don't call this recursively on our children.
20559 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
20561 * driver.cs: Implement /target:module.
20563 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
20565 * support.cs (CharArrayHashtable): New helper class.
20567 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
20568 char arrays, not strings, so we can avoid creating a string in
20569 consume_identifier if the identifier is a keyword.
20571 2003-12-16 Martin Baulig <martin@ximian.com>
20573 * statement.cs (LocalInfo.Assigned): Removed this property.
20574 (LocalInfo.Flags): Removed `Assigned'.
20575 (LocalInfo.IsAssigned): New public method; takes the EmitContext
20576 and uses flow analysis.
20577 (Block.UsageWarning): Made this method private.
20578 (Block.Resolve): Call UsageWarning() if appropriate.
20580 * expression.cs (LocalVariableReference.DoResolve): Always set
20581 LocalInfo.Used here.
20583 2003-12-13 Martin Baulig <martin@ximian.com>
20585 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
20586 any value here; we're now using flow analysis to figure out
20587 whether a statement/block returns a value.
20589 2003-12-13 Martin Baulig <martin@ximian.com>
20591 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
20593 (FlowBranching.MergeFinally): Don't call
20594 `branching.CheckOutParameters()' here, this is called in
20596 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
20597 when adding the `finally' vector.
20599 2003-12-13 Martin Baulig <martin@ximian.com>
20602 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
20603 actually work and also fix #48962.
20605 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
20607 * decl.cs: Do not check System.Object for nested types,
20608 since we know it does not have any. Big bang for buck:
20611 Run 1: 8.35 seconds
20612 Run 2: 8.32 seconds
20613 corlib: 17.99 seconds
20615 Run 1: 8.17 seconds
20616 Run 2: 8.17 seconds
20617 corlib: 17.39 seconds
20619 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
20621 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
20622 time we are returning 0 members, so we save alot here.
20624 2003-12-11 Martin Baulig <martin@ximian.com>
20626 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
20627 `MergeChild()', also just take the `FlowBranching' as argument;
20628 call Merge() on it and return the result.
20629 (FlowBranching.Merge): We don't need to do anything if we just
20632 2003-12-11 Martin Baulig <martin@ximian.com>
20634 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
20635 them in an `ArrayList' to reduce memory usage. Thanks to Ben
20636 Maurer for this idea.
20638 2003-12-11 Martin Baulig <martin@ximian.com>
20640 * flowanalysis.cs (MergeResult): This class is now gone; we now
20641 use the `UsageVector' for this. The reason for this is that if a
20642 branching just has one sibling, we don't need to "merge" them at
20643 all - that's the next step to do.
20644 (FlowBranching.Merge): We now return a `UsageVector' instead of a
20647 2003-12-11 Martin Baulig <martin@ximian.com>
20649 Reworked flow analyis and made it more precise and bug-free. The
20650 most important change is that we're now using a special `Reachability'
20651 class instead of having "magic" meanings of `FlowReturns'. I'll
20652 do some more cleanups and optimizations and also add some more
20653 documentation this week.
20655 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
20656 largely reworked this class.
20657 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
20658 the new `Reachability' class instead of having "magic" values here.
20659 (FlowBranching): We're now using an instance of `Reachability'
20660 instead of having separate `Returns', `Breaks' etc. fields.
20662 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
20663 based on flow analysis; ignore the return value of block.Emit ().
20665 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
20667 * driver.cs typemanager.cs: Find the mono extensions to corlib even
20668 if they are private.
20670 2003-12-09 Martin Baulig <martin@ximian.com>
20672 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
20673 call them directly on the UsageVector.
20675 2003-12-09 Martin Baulig <martin@ximian.com>
20677 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
20678 Changed return type from `FlowReturns' to `Reachability'.
20680 2003-12-09 Martin Baulig <martin@ximian.com>
20682 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
20683 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
20684 `Reachable' fields with a single `Reachability' one.
20686 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20688 * class.cs (FindMembers): Remove foreach's.
20693 Run 1: 8.74 seconds
20694 Run 2: 8.71 seconds
20697 Run 1: 8.64 seconds
20698 Run 2: 8.58 seconds
20701 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20706 This patch does a few things:
20707 1. EmptyStatement is now a singleton, so it is never reallocated.
20708 2. All blah is EmptyStatement constructs have been changed to
20709 blah == EmptyStatement.Value, which is much faster and valid
20710 now that EmptyStatement is a singleton.
20711 3. When resolving a block, rather than allocating a new array for
20712 the non-empty statements, empty statements are replaced with
20713 EmptyStatement.Value
20714 4. Some recursive functions have been made non-recursive.
20715 Mainly the performance impact is from (3), however (1) and (2) are needed for
20716 this to work. (4) does not make a big difference in normal situations, however
20717 it makes the profile look saner.
20722 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20723 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20724 Total memory allocated: 56397 KB
20727 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
20728 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
20729 Total memory allocated: 55666 KB
20731 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20733 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
20734 than the hashtable in a hashtable version
20736 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
20737 we always end up concating a string. This results in a huge perf
20738 loss, because many strings have to be tracked by the GC. In this
20739 patch, we first use a hashtable that works with two keys, so that
20740 the strings do not need to be concat'ed.
20744 Run 1: 8.74 seconds
20745 Run 2: 8.71 seconds
20748 Run 1: 8.65 seconds
20749 Run 2: 8.56 seconds
20751 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20753 * Makefile: Add a new target `do-time' that does a quick and simple
20754 profile, leaving easy to parse output.
20756 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
20758 * codegen.cs (Init): Create the dynamic assembly with
20759 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
20761 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
20763 * support.cs: Make the PtrHashtable use only one
20764 instance of its comparer.
20766 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
20768 * typemanager.cs: Fix lookup of GetNamespaces.
20770 2003-11-29 Miguel de Icaza <miguel@ximian.com>
20772 * expression.cs: Removed redundant line.
20774 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
20775 ArrayLists, use for loops with bounds.
20777 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
20780 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
20781 arraylists, use for loop with bounds.
20783 The above three changes give us a 0.071 second performance
20784 improvement out of 3.294 seconds down to 3.223. On my machine
20785 the above changes reduced the memory usage by 1,387 KB during
20786 compiler bootstrap.
20788 * cs-parser.jay (QualifiedIdentifier): New class used to represent
20789 QualifiedIdentifiers. Before we created a new string through
20790 concatenation, and mostly later on, the result would be
20791 manipulated by DecomposeQI through string manipulation.
20793 This reduced the compiler memory usage for bootstrapping from
20794 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
20795 compile times in 0.05 seconds.
20797 2003-11-28 Dick Porter <dick@ximian.com>
20799 * support.cs: Do string compares with the Invariant culture.
20807 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
20808 the comparison is done with the Invariant culture.
20810 2003-11-27 Miguel de Icaza <miguel@ximian.com>
20812 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
20813 GetEnumerator method.
20815 (ProbeCollectionType): Iterate starting at the most specific type
20816 upwards looking for a GetEnumerator
20818 * expression.cs: Shift count can be up to 31 for int/uint and 63
20821 2003-11-26 Miguel de Icaza <miguel@ximian.com>
20823 * statement.cs (Block.LookupLabel): Also look for the label on the
20824 children blocks. Use a hash table to keep track of visited
20827 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
20828 we actually did transform the other operand, otherwise fall back
20829 to the common codepath that casts to long.
20831 * cs-tokenizer.cs: Use the same code pattern as the int case.
20832 Maybe I should do the parsing myself, and avoid depending on the
20833 Parse routines to get this done.
20835 2003-11-25 Miguel de Icaza <miguel@ximian.com>
20837 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
20838 which fixes bug 51347. This time test it.
20840 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
20841 attributes for example can not tell the difference between these.
20842 The difference was only a syntax feature of the language.
20844 * attribute.cs: Apply attributes to delegates.
20846 * delegate.cs: Call the apply attributes method.
20848 2003-11-24 Miguel de Icaza <miguel@ximian.com>
20850 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
20851 comparing 0 vs Byte.MinValue, not the value
20853 (ImplicitConversionRequired): When reporting a conversion error,
20854 use error 31 to print out the constant error instead of the
20857 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
20858 which fixes bug 51347.
20860 2003-11-22 Miguel de Icaza <miguel@ximian.com>
20862 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
20863 which fixes the -warnaserror command line option.
20865 2003-11-21 Miguel de Icaza <miguel@ximian.com>
20867 * cfold.cs (DoNumericPromotions): During constant folding of
20868 additions on UIntConstant, special case intconstants with
20869 IntConstants like we do on the expression binary operator.
20871 2003-11-12 Miguel de Icaza <miguel@ximian.com>
20873 * convert.cs (ImplicitReferenceConversion): We were missing a case
20874 (System.Enum are not value types or class types, so we need to
20875 classify them separatedly).
20877 * driver.cs: We do not support error 2007.
20879 2003-11-12 Jackson Harper <jackson@ximian.com>
20881 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
20882 system directory. Also use the full file name so users can
20883 libraries names mscorlib-o-tron.dll in a non system dir.
20885 2003-11-10 Martin Baulig <martin@ximian.com>
20887 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
20888 (TypeManager.InitCoreTypes): Initialize them here, but instead of
20889 calling `ResolveType()' on them, directly assign their `Type'.
20891 2003-11-08 Martin Baulig <martin@ximian.com>
20893 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
20894 return value and the `out parent' parameter.
20895 (TypeContainer.DefineType): Moved the CS0644 check into
20896 GetClassBases(). Don't pass the interface types to the
20897 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
20898 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
20900 * ecore.cs (TypeExpr.IsAttribute): New property.
20901 (TypeExpr.GetInterfaces): New method.
20903 * interface.cs (Interface.GetInterfaceTypeByName): Return a
20904 TypeExpr instead of a Type.
20905 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
20906 (Interface.DefineType): Don't pass the interface types to the
20907 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
20908 them later and then call `TypeBulider.AddInterfaceImplementation()'.
20910 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
20911 instead of a `Type[]'.
20912 (TypeManager.RegisterBuilder): Likewise.
20913 (TypeManager.AddUserInterface): Likewise.
20914 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
20915 `Type[]' and also return a `TypeExpr[]'.
20916 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
20918 2003-11-08 Martin Baulig <martin@ximian.com>
20920 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
20923 2003-11-08 Martin Baulig <martin@ximian.com>
20925 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
20926 TypeManager.ResolveExpressionTypes().
20928 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
20929 instead of an Expression.
20930 (TypeExpr): This is now an abstract base class for `TypeExpression'.
20931 (TypeExpression): New public class; formerly known as `TypeExpr'.
20933 * expression.cs (ComposedCast): Derive from TypeExpr.
20935 * typemanager.cs (TypeManager.system_*_expr): These are now
20936 TypExpr's instead of Expression's.
20937 (TypeManager.ResolveExpressionTypes): New public static function;
20938 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
20941 2003-11-06 Miguel de Icaza <miguel@ximian.com>
20943 * expression.cs (New.DoResolve): Do not dereference value that
20944 might be a null return.
20946 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
20947 sure that the constant value has the right type. Fixes an
20948 unreported bug, similar to 50425.
20950 * const.cs (Const.LookupConstantValue): Call
20951 ImplicitStandardConversionExists before doing a conversion to
20952 avoid havng the TypeManager.ChangeType do conversions.
20954 Reduced the number of casts used
20956 (Const.ChangeType): New routine to enable reuse of the constant
20957 type changing code from statement.
20959 * typemanager.cs (ChangeType): Move common initialization to
20960 static global variables.
20964 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
20965 every value type to go through, even if it was void. Fix that.
20967 * cs-tokenizer.cs: Use is_identifier_start_character on the start
20968 character of the define, and the is_identifier_part_character for
20969 the rest of the string.
20971 2003-11-05 Miguel de Icaza <miguel@ximian.com>
20973 * expression.cs (UnaryMutator.EmitCode): When I updated
20974 LocalVariableReference.DoResolve, I overdid it, and dropped an
20975 optimization done on local variable references.
20977 2003-11-04 Miguel de Icaza <miguel@ximian.com>
20979 * ecore.cs: Convert the return from Ldlen into an int.
20981 2003-10-20 Miguel de Icaza <miguel@ximian.com>
20983 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
20984 the accessibility, this is a special case for toplevel non-public
20985 classes (internal for instance).
20987 2003-10-20 Nick Drochak <ndrochak@gol.com>
20989 * ecore.cs: Fix typo and build. Needed another right paren.
20991 2003-10-19 Miguel de Icaza <miguel@ximian.com>
20993 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
20994 `internal' case regular and protected, but not allowing protected
20995 to be evaluated later. Bug 49840
20997 2003-10-15 Miguel de Icaza <miguel@ximian.com>
20999 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
21000 to kb.Nlast, and not the kb.nFirst to isolate the switch
21003 Extract the underlying type, so enumerations of long/ulong are
21004 treated like long/ulong.
21006 2003-10-14 Miguel de Icaza <miguel@ximian.com>
21008 * expression.cs (New): Overload the meaning of RequestedType to
21009 track the possible creation of the NewDelegate type, since
21010 DoResolve is invoked more than once for new constructors on field
21013 See bugs: #48800 and #37014
21015 * cs-parser.jay (declare_local_constants): Take an arraylist
21016 instead of a single constant.
21018 (local_constant_declaration): It should take a
21019 constant_declarators, not a constant_declarator. Fixes 49487
21021 * convert.cs: Fix error report.
21023 2003-10-13 Jackson Harper <jackson@ximian.com>
21025 * typemanager.cs (TypeToCoreType): Add float and double this fixes
21028 2003-10-09 Martin Baulig <martin@ximian.com>
21030 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
21032 (MethodCore.DoDefineParameters): Removed the TypeContainer
21033 argument; use the DeclSpace which was passed to the .ctor instead.
21034 (MethodCore.CheckParameter): Take a DeclSpace instead of a
21035 TypeContainer; we only need a DeclSpace here.
21037 2003-10-09 Martin Baulig <martin@ximian.com>
21039 * class.cs (MethodData): Added additional `DeclSpace ds' argument
21041 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
21042 EmitContext's .ctor.
21044 2003-10-09 Martin Baulig <martin@ximian.com>
21046 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
21047 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
21048 AsAccessible(), moved them as well.
21050 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
21052 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
21054 * cs-parser.jay : Renamed yyName to yyNames related to jay.
21056 2003-10-07 Miguel de Icaza <miguel@ximian.com>
21058 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
21059 generation for >=, as spotted by Paolo, bug 48679.
21060 Patch from David Waite.
21062 * cs-tokenizer.cs: Add handling for #pragma.
21064 * cs-parser.jay: Allow for both yield and yield return in the
21065 syntax. The anti-cobolization of C# fight will go on!
21067 * class.cs (TypeBuilder.DefineType): Catch error condition here
21068 (Parent.DefineType erroring out and returning null).
21070 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
21071 coping with enumerations variables, we were mistakenly processing
21072 them as a regular value type instead of built-in types. Fixes the
21075 * typemanager.cs (IsBuiltinOrEnum): New method.
21077 2003-09-30 Miguel de Icaza <miguel@ximian.com>
21079 * cs-parser.jay: Upgrade: yield now needs the return clause.
21081 2003-09-19 Martin Baulig <martin@ximian.com>
21083 * decl.cs (MemberCache.SetupCacheForInterface): Take a
21084 `MemberCache parent' argument. Normally, an interface doesn't
21085 have a parent type except System.Object, but we use this in gmcs
21086 for generic type parameters.
21088 2003-09-18 Martin Baulig <martin@ximian.com>
21090 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
21091 on `type.IsInterface'; don't check whether the type has a parent
21092 to determine whether it's an interface.
21094 2003-09-15 Martin Baulig <martin@ximian.com>
21096 * class.cs (TypeContainer.DefineType): Added an error flag to
21097 avoid reporting duplicate CS0146's ("class definition is
21100 * driver.cs (Driver.MainDriver): Abort if
21101 RootContext.ResolveTree() reported any errors.
21103 2003-09-07 Martin Baulig <martin@ximian.com>
21105 * report.cs (Error, Warning): Added overloaded versions which take
21106 a `params object[] args' and call String.Format().
21108 2003-09-07 Martin Baulig <martin@ximian.com>
21110 * decl.cs (DeclSpace..ctor): Don't call
21111 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
21112 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
21113 (DeclSpace.RecordDecl): New method.
21115 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
21117 2003-09-02 Ravi Pratap <ravi@ximian.com>
21119 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
21120 value attributes to be applied to ParameterBuilders.
21122 * class.cs (MethodCore.LabelParameters): Make static and more
21123 generic so that it can be used from other places - like interface
21124 methods, for instance.
21126 * interface.cs (Interface.Emit): Call LabelParameters before
21127 emitting attributes on the InterfaceMethod.
21129 2003-08-26 Martin Baulig <martin@ximian.com>
21131 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
21132 resolving aliases; fixes #47927.
21134 2003-08-26 Martin Baulig <martin@ximian.com>
21136 * statement.cs (Using.DoResolve): This is internally emitting a
21137 try/finally clause, so we need to set ec.NeedExplicitReturn if we
21138 do not always return. Fixes #47681.
21140 2003-08-26 Martin Baulig <martin@ximian.com>
21142 * decl.cs (MemberCore): Moved WarningNotHiding(),
21143 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
21145 (AdditionResult): Make this nested in DeclSpace.
21146 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
21147 argument; call NamespaceEntry.Define() unless we're nested in a
21150 * namespace.cs (Namespace.DefineName): New public function. This
21151 is called from DeclSpace's .ctor to add
21152 (Namespace.Lookup): Include DeclSpaces in the lookup.
21154 * class.cs (Operator): Derive from MemberBase, not MemberCore.
21156 * const.cs (Const): Derive from MemberBase, not MemberCore.
21158 2003-08-25 Martin Baulig <martin@ximian.com>
21160 * convert.cs (Convert.ExplicitReferenceConversion): When
21161 converting from an interface type to a class, unbox if the target
21162 type is a struct type. Fixes #47822.
21164 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21166 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
21169 2003-08-22 Martin Baulig <martin@ximian.com>
21171 * class.cs (TypeManager.DefineType): When defining a nested type,
21172 call DefineType() on our parent; fixes #47801.
21174 2003-08-22 Martin Baulig <martin@ximian.com>
21176 * class.cs (MethodData.Define): While checking if a method is an
21177 interface implementation, improve the test a bit more to fix #47654.
21179 2003-08-22 Martin Baulig <martin@ximian.com>
21181 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
21182 correctly; fixes #47722.
21184 2003-08-22 Martin Baulig <martin@ximian.com>
21186 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
21187 LocalVariableReference, ensure it's not read-only. Fixes #47536.
21189 * statement.cs (Fixed.DoResolve): Make all variables read-only.
21191 2003-08-22 Martin Baulig <martin@ximian.com>
21193 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
21194 can only be assigned in static constructors. Fixes #47161.
21196 2003-08-22 Martin Baulig <martin@ximian.com>
21198 Rewrote and improved the flow analysis code.
21200 * flowbranching.cs (FlowBranching): Make this class abstract.
21201 (FlowBranching.CreateBranching): New static function to create a
21202 new flow branching.
21203 (FlowBranchingBlock, FlowBranchingException): New classes.
21204 (FlowBranching.UsageVector.Type): New public readonly field.
21205 (FlowBranching.UsageVector.Breaks): Removed the setter.
21206 (FlowBranching.UsageVector.Returns): Removed the setter.
21207 (FlowBranching.UsageVector): Added Break(), Return(),
21208 NeverReachable() and Throw() methods to modify the reachability.
21209 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
21210 done by FlowBranching.Merge().
21211 (FlowBranching.UsageVector.MergeChild): New method; merges the
21212 merge result into the current vector.
21213 (FlowBranching.Merge): New abstract method to merge a branching.
21215 2003-08-12 Martin Baulig <martin@ximian.com>
21217 * expression.cs (Indirection.CacheTemporaries): Create the
21218 LocalTemporary with the pointer type, not its element type.
21220 2003-08-10 Miguel de Icaza <miguel@ximian.com>
21222 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
21223 token was a keyword or not.
21225 Add `error' options where an IDENTIFIER was expected; Provide
21226 CheckToken and CheckIdentifierToken convenience error reporting
21229 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
21231 * decl.cs: Rename `NamespaceEntry Namespace' public field into
21232 NameSpaceEntry NameSpaceEntry.
21234 (LookupInterfaceOrClass): Avoid creating a full qualified name
21235 from namespace and name: avoid doing lookups when we know the
21236 namespace is non-existant. Use new Tree.LookupByNamespace which
21237 looks up DeclSpaces based on their namespace, name pair.
21239 * driver.cs: Provide a new `parser verbose' to display the
21240 exception thrown during parsing. This is turned off by default
21241 now, so the output of a failure from mcs is more graceful.
21243 * namespace.cs: Track all the namespaces defined in a hashtable
21246 (IsNamespace): New method
21248 2003-08-09 Miguel de Icaza <miguel@ximian.com>
21250 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
21251 we know that we need to concatenate (full typename can never be
21256 * statement.cs: Use a bitfield; Do not initialize to null things
21257 which are done by the constructor by default.
21259 * cs-parser.jay: bug fix, parameter was 4, not 3.
21261 * expression.cs: Just use the property;
21263 * statement.cs: No need for GetVariableInfo method.
21265 2003-08-08 Martin Baulig <martin@ximian.com>
21267 * flowanalysis.cs (FlowReturns): This is now nested in the
21268 `FlowBranching' class.
21269 (MyBitVector): Moved this here from statement.cs.
21270 (FlowBranching.SiblingType): New enum type.
21271 (FlowBranching.CreateSibling): Added `SiblingType' argument.
21273 2003-08-07 Martin Baulig <martin@ximian.com>
21275 * flowanalysis.cs (FlowBranchingType): This is now nested in the
21276 `FlowBranching' class and called `BranchingType'.
21278 2003-08-07 Martin Baulig <martin@ximian.com>
21280 * flowanalysis.cs: Moved all the control flow analysis code into
21283 2003-08-07 Martin Baulig <martin@ximian.com>
21285 * assign.cs (Assign.DoResolve): `target' must either be an
21286 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
21289 2003-08-07 Miguel de Icaza <miguel@ximian.com>
21291 * expression.cs (BinaryMethod): This kind of expression is created by the
21292 Binary class if it determines that the operator has to be handled
21295 (BinaryDelegate): This kind of expression is created if we are
21296 dealing with a + or - operator on delegates.
21298 (Binary): remove method, argumetns, and DelegateOperator: when
21299 dealing with methods,
21301 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
21303 * statement.cs (Block): use bitfields for the three extra booleans
21304 we had in use. Remove unused topblock parameter.
21306 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
21308 * assign.cs: Drop extra unneeded tests.
21310 2003-08-06 Miguel de Icaza <miguel@ximian.com>
21312 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
21314 * statement.cs (Foreach): Use VariableStorage instead of
21317 * codegen.cs (VariableStorage): New class used by clients that
21318 require a variable stored: locals or fields for variables that
21319 need to live across yield.
21321 Maybe provide a convenience api for EmitThis+EmitLoad?
21323 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
21326 2003-08-05 Miguel de Icaza <miguel@ximian.com>
21328 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
21329 RemapParameterLValue): New methods that are used to turn a
21330 precomputed FieldInfo into an expression like this:
21334 The idea is to use this instead of making LocalVariableReference
21335 have more than one meaning.
21337 * cs-parser.jay: Add error production to BASE.
21339 * ecore.cs: Deal with TypeManager.GetField returning null, which
21340 is now a valid return value.
21342 (FieldExprNoAddress): New expression for Fields whose address can
21345 * expression.cs (LocalVariableReference): During the resolve
21346 phases, create new expressions if we are in a remapping context.
21347 Remove code that dealt with remapping here.
21349 (ParameterReference): same.
21351 (ProxyInstance): New expression, like the `This' expression, but
21352 it is born fully resolved. We know what we are doing, so remove
21353 the errors that are targeted to user-provided uses of `this'.
21355 * statement.cs (Foreach): our variable is now stored as an
21356 Expression; During resolution, follow the protocol, dont just
21357 assume it will return this.
21359 2003-08-06 Martin Baulig <martin@ximian.com>
21361 * support.cs (SeekableStreamReader.cs): New public class.
21363 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
21364 SeekableStreamReader instead of the normal StreamReader.
21366 2003-08-04 Martin Baulig <martin@ximian.com>
21368 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
21369 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
21370 deambiguate casts and delegate invocations.
21371 (parenthesized_expression): Use the new tokens to ensure this is
21372 not a cast of method invocation.
21374 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
21375 when reading a `)' and Deambiguate_CloseParens () was previously
21378 * expression.cs (ParenthesizedExpression): New class. This is
21379 just used for the CS0075 test.
21380 (Binary.DoResolve): Check for CS0075.
21382 2003-07-29 Ravi Pratap <ravi@ximian.com>
21384 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
21385 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
21386 reference comparison.
21388 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
21389 examine the ReturnType for equality - this is necessary in the
21390 cases of implicit and explicit operators whose signature also
21391 includes the return type.
21393 2003-07-26 Miguel de Icaza <miguel@ximian.com>
21395 * namespace.cs: Cache the result of the namespace computation,
21396 instead of computing it every time.
21398 2003-07-24 Miguel de Icaza <miguel@ximian.com>
21400 * decl.cs: Use a global arraylist that we reuse over invocations
21401 to avoid excesive memory consumption. Reduces memory usage on an
21402 mcs compile by one meg (45 average).
21404 * typemanager.cs (LookupTypeReflection): In .NET pointers are
21405 private, work around that.
21407 2003-07-23 Miguel de Icaza <miguel@ximian.com>
21409 * literal.cs (IntLiteral): Define Zero and One static literals.
21411 * cs-parser.jay (integer_literal): use static literals to reduce
21412 memory usage for the most used literals (0, 1 and -1). 211kb
21413 reduced in memory usage.
21415 Replace all calls to `new ArrayList' with `new
21416 ArrayList(4)' which is a good average number for most allocations,
21417 and also requires only 16 bytes of memory for its buffer by
21420 This reduced MCS memory usage in seven megabytes for the RSS after
21423 2003-07-28 Ravi Pratap <ravi@ximian.com>
21425 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
21426 handle params methods the correct way by forming only one
21427 applicable set with params and normal methods in them. Earlier we
21428 were looking at params methods only if we found no normal methods
21429 which was not the correct thing to do.
21431 (Invocation.BetterFunction): Take separate arguments indicating
21432 when candidate and the best method are params methods in their
21435 This fixes bugs #43367 and #46199.
21437 * attribute.cs: Documentation updates.
21439 (CheckAttribute): Rename to CheckAttributeTarget.
21440 (GetValidPlaces): Rename to GetValidTargets.
21442 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
21443 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
21447 2003-07-28 Martin Baulig <martin@ximian.com>
21449 * class.cs (TypeContainer.DefineMembers): Use the base type's full
21450 name when looking up the base class of a nested class. Fixes #46977.
21452 2003-07-26 Martin Baulig <martin@ximian.com>
21454 * expression.cs (Indexers.Indexer): New nested struct; contains
21455 getter, setter and the indexer's type.
21456 (Indexers.Properties): This is now an ArrayList of
21457 Indexers.Indexer's.
21458 (IndexerAccess.DoResolveLValue): Correctly set the type if the
21459 indexer doesn't have any getters.
21461 * assign.cs (Assign.DoResolve): Also do the implicit conversions
21462 for embedded property and indexer assignments.
21464 2003-07-26 Martin Baulig <martin@ximian.com>
21466 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
21467 preprocessor directive is not the first non-whitespace character
21470 2003-07-26 Martin Baulig <martin@ximian.com>
21472 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
21473 namespace parsing, follow the spec more closely.
21475 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
21476 NamespaceEntry.Lookup().
21478 2003-07-25 Martin Baulig <martin@ximian.com>
21480 * MethodCore.cs (OverridesSomething): New public field; it's set
21481 from TypeContainer.DefineMembers if this method overrides
21482 something (which doesn't need to be a method). Fix #39462.
21484 2003-07-25 Ravi Pratap <ravi@ximian.com>
21486 * typemanager.cs (GetMembers): Ensure that the list of members is
21487 reversed. This keeps things in sync.
21489 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
21490 find an AttributeUsage attribute.
21492 * expression.cs (Invocation.OverloadResolve): Perform the check
21493 which disallows Invoke to be directly called on a Delegate.
21495 (Error_InvokeOnDelegate): Report error cs1533.
21497 2003-07-25 Martin Baulig <martin@ximian.com>
21499 * expression.cs (Indexers.GetIndexersForType): Only look in the
21500 interface hierarchy if the requested type is already an
21501 interface. Fixes #46788 while keeping #46502 fixed.
21503 2003-07-25 Martin Baulig <martin@ximian.com>
21505 * class.cs (TypeContainer.DefineMembers): Check whether all
21506 readonly fields have been assigned and report warning CS0649 if
21509 * statement.cs (LocalInfo.IsFixed): Always return true if this is
21512 2003-07-24 Ravi Pratap <ravi@ximian.com>
21514 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
21515 returned from GetMethods to make things consistent with the
21516 assumptions MCS makes about ordering of methods.
21518 This should comprehensively fix bug #45127 and it does :-)
21520 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
21521 ordering is actually reverse.
21523 * Clean up some debug messages I left lying around.
21525 * interface.cs (Populate*): Get rid of code which emits attributes
21526 since the stage in which we emit attributes is the 'Emit' stage,
21527 not the define stage.
21529 (Emit): Move attribute emission for interface members here.
21531 2003-07-22 Ravi Pratap <ravi@ximian.com>
21533 * expression.cs (Invocation.OverloadResolve): Follow the spec more
21534 closely: we eliminate methods in base types when we have an
21535 applicable method in a top-level type.
21537 Please see section 14.5.5.1 for an exact description of what goes
21540 This fixes bug #45127 and a host of other related to corlib compilation.
21542 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
21543 array is the method corresponding to the top-level type (this is
21544 because of the changes made to icall.c) so we change this
21547 (MethodGroupExpr.Name): This too.
21549 * typemanager.cs (GetElementType): New method which does the right
21550 thing when compiling corlib.
21552 * everywhere: Make use of the above in the relevant places.
21554 2003-07-22 Martin Baulig <martin@ximian.com>
21556 * cs-parser.jay (invocation_expression): Moved
21557 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
21558 `cast_expression', but create a InvocationOrCast which later
21559 resolves to either an Invocation or a Cast.
21561 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
21562 method; call this before EmitStatement() to make sure that this
21563 expression can be used as a statement.
21565 * expression.cs (InvocationOrCast): New class; resolves to either
21566 an Invocation or a Cast.
21568 * statement.cs (StatementExpression): Call ResolveStatement() on
21569 the ExpressionStatement before emitting it.
21571 2003-07-21 Martin Baulig <martin@ximian.com>
21573 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
21574 `ref' and `out' attributes match; fixes #46220.
21575 (MemberAccess.ResolveMemberAccess): You can't reference a type
21576 through an expression; fixes #33180.
21577 (Indexers.GetIndexersForType): Don't return the indexers from
21578 interfaces the class implements; fixes #46502.
21580 2003-07-21 Martin Baulig <martin@ximian.com>
21582 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
21583 CS0661 checks; fixes bug #30442.
21585 2003-07-21 Martin Baulig <martin@ximian.com>
21587 * decl.cs (AdditionResult): Added `Error'.
21589 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
21591 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
21592 makes cs0031.cs actually work.
21594 2003-07-20 Martin Baulig <martin@ximian.com>
21596 * namespace.cs: Fixed that bug which caused a crash when compiling
21597 the debugger's GUI.
21599 2003-07-20 Miguel de Icaza <miguel@ximian.com>
21601 * typemanager.cs (LookupTypeReflection): Never expose types which
21602 are NotPublic, NestedPrivate, NestedAssembly, or
21603 NestedFamANDAssem. We used to return these, and later do a check
21604 that would report a meaningful error, but the problem is that we
21605 would not get the real match, if there was a name override.
21607 2003-07-18 Miguel de Icaza <miguel@ximian.com>
21609 * namespace.cs (Namespace, Name): Do not compute the namespace
21610 name dynamically, compute it in the constructor. This reduced
21611 memory usage by 1697 KB.
21613 * driver.cs: Use --pause to pause at the end.
21615 2003-07-17 Peter Williams <peter@newton.cx>
21617 * Makefile: Change the name of the test target so that it doesn't
21618 conflict with the recursive test target.
21620 2003-07-17 Miguel de Icaza <miguel@ximian.com>
21622 * expression.cs (LocalVariableReference.Emit, EmitAssign,
21623 AddressOf): Do not use EmitThis, that was wrong, use the actual
21626 2003-07-15 Miguel de Icaza <miguel@ximian.com>
21628 * class.cs (MethodData.Define): While checking if a method is an
21629 interface implementation, improve the test: If we are not public
21630 (use new test here: use the computed MethodAttributes directly,
21631 instead of the parsed modifier flags) check if the `implementing'
21632 method comes from an interface or not.
21634 * pending.cs (VerifyPendingMethods): Slightly better error
21637 * makefile: add test target that does the mcs bootstrap.
21639 2003-07-16 Ravi Pratap <ravi@ximian.com>
21641 * interface.cs (Define): Do nothing here since there are no
21642 members to populate etc. Move the attribute emission out of here
21643 since this was just totally the wrong place to put it. Attribute
21644 application happens during the 'Emit' phase, not in the 'Define'
21647 (Emit): Add this method and move the attribute emission here
21649 * rootcontext.cs (EmitCode): Call the Emit method on interface
21652 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21654 * expression.cs (OverloadResolve): Report error only if Location
21655 is not 'Null' which means that there was a probe going on.
21657 2003-07-14 Martin Baulig <martin@ximian.com>
21659 * expression.cs (ConditionalLogicalOperator): New public class to
21660 implement user defined conditional logical operators.
21661 This is section 14.11.2 in the spec and bug #40505.
21663 2003-07-14 Martin Baulig <martin@ximian.com>
21665 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
21667 2003-07-14 Martin Baulig <martin@ximian.com>
21669 * codegen.cs (EmitContext.InFixedInitializer): New public field.
21671 * ecore.cs (IVariable.VerifyFixed): New interface method.
21673 * expression.cs (Unary.ResolveOperator): When resolving the `&'
21674 operator, check whether the variable is actually fixed. Fixes bug
21675 #36055. Set a variable definitely assigned when taking its
21676 address as required by the spec.
21678 * statement.cs (LocalInfo.IsFixed): New field.
21679 (LocalInfo.MakePinned): Set `IsFixed' to true.
21681 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21683 * attribute.cs (Attribute.Resolve): While doing a Member lookup
21684 for .ctors, ensure that we only ask for members declared in the
21685 attribute type (BindingFlags.DeclaredOnly).
21689 * expression.cs (Error_WrongNumArguments): Report error 1501
21690 correctly the way CSC does.
21692 2003-07-13 Martin Baulig <martin@ximian.com>
21694 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
21695 lookup on the fully qualified name, to make things like "X.X" work
21696 where "X.X" is a fully qualified type name, but we also have a
21697 namespace "X" in the using list. Fixes #41975.
21699 2003-07-13 Martin Baulig <martin@ximian.com>
21701 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
21702 function. If we're a CompoundAssign, we need to create an embedded
21703 CompoundAssign, not an embedded Assign.
21704 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
21707 2003-07-13 Martin Baulig <martin@ximian.com>
21709 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
21710 work to fix bug #46088.
21712 2003-07-13 Ravi Pratap <ravi@ximian.com>
21714 * class.cs (Operator.Emit): Do not emit attributes here - it is
21715 taken care of by the Method class that we delegate too. This takes
21716 care of bug #45876.
21718 2003-07-10 Martin Baulig <martin@ximian.com>
21720 * expression.cs (TypeOfVoid): New class.
21721 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
21723 2003-07-10 Martin Baulig <martin@ximian.com>
21725 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
21728 2003-07-10 Martin Baulig <martin@ximian.com>
21730 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
21731 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
21733 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
21735 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
21737 2003-07-10 Martin Baulig <martin@ximian.com>
21739 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
21740 of decimal. Fixes #42850.
21742 NOTE: I also fixed the created byte blob, but this doesn't work on
21743 the MS runtime and csc never produces any byte blobs for decimal
21746 2003-07-10 Martin Baulig <martin@ximian.com>
21748 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
21749 structs; fixes #32068.
21750 (Block.AddChildVariableNames): Fixed #44302.
21752 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21754 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
21756 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21758 * attribute.cs: And this test is onger needed.
21760 2003-07-08 Martin Baulig <martin@ximian.com>
21762 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
21763 inaccessible types. Fixes #36313.
21765 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
21767 * namespace.cs (NamespaceEntry): Create implicit entries for all
21768 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
21769 implicit entries for N1.N2 and N1.
21771 2003-07-08 Martin Baulig <martin@ximian.com>
21773 Rewrote the handling of namespaces to fix a lot of the issues
21774 wrt. `using' aliases etc.
21776 * namespace.cs (Namespace): Splitted this class into a
21777 per-assembly `Namespace' and a per-file `NamespaceEntry'.
21779 * typemanager.cs (TypeManager.IsNamespace): Removed.
21780 (TypeManager.ComputeNamespaces): Only compute namespaces from
21781 loaded assemblies here, not the namespaces from the assembly we're
21782 currently compiling.
21784 2003-07-08 Martin Baulig <martin@ximian.com>
21786 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
21788 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21790 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
21793 I thought about the memory savings here, but LookupTypeReflection
21794 is used under already very constrained scenarios. Compiling
21795 corlib or mcs only exposes one hit, so it would not really reduce
21796 any memory consumption.
21798 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21800 * typemanager.cs: fixes bug #45889 by only adding public types from
21801 other assemblies to the list of known types.
21803 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21805 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
21806 on the type we resolved.
21808 2003-07-05 Martin Baulig <martin@ximian.com>
21810 * pending.cs (PendingImplementation.ParentImplements): Don't
21811 create the proxy if the parent is abstract.
21813 * class.cs (TypeContainer.DefineIndexers): Process explicit
21814 interface implementations first. Fixes #37714.
21816 2003-07-04 Miguel de Icaza <miguel@ximian.com>
21818 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
21819 defined recursively; but since we modify the input parameters
21820 (left is set to `this' temporarily), we reset this value if the
21821 left_is_explicit is false, which gives the original semantics to
21824 * literal.cs (NullPointer): new class used to represent a null
21825 literal in a pointer context.
21827 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
21828 type is a pointer, use a NullPointer object instead of a
21829 NullLiteral. Closes 43687
21831 (ExplicitConversion): Convert pointer values using
21832 the conv opcode to the proper type.
21834 * ecore.cs (New): change ValueTypeVariable property into a method,
21835 that returns whether the valuetype is suitable for being used.
21837 * expression.cs (Binary.DoNumericPromotions): Only return if we
21838 the int constant was a valid uint, and we can return both left and
21839 right as uints. If not, we continue processing, to trigger the
21840 type conversion. This fixes 39018.
21842 * statement.cs (Block.EmitMeta): During constant resolution, set
21843 the CurrentBlock property on the emitcontext, so that we resolve
21844 constants propertly.
21846 2003-07-02 Martin Baulig <martin@ximian.com>
21848 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
21849 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
21851 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
21852 than emitting it here.
21854 * statement.cs: Fixed some more flow analysis bugs.
21856 2003-07-02 Martin Baulig <martin@ximian.com>
21858 * class.cs (MethodData.Define): When implementing interface
21859 methods, set Final unless we're Virtual.
21861 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
21862 check work for interface methods.
21864 2003-07-01 Martin Baulig <martin@ximian.com>
21866 * ecore.cs (EmitContext.This): Replaced this property with a
21867 GetThis() method which takes a Location argument. This ensures
21868 that we get the correct error location for a CS0188.
21870 2003-07-01 Miguel de Icaza <miguel@ximian.com>
21872 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
21873 ImplicitStandardConversion.
21875 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
21877 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
21879 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
21882 2003-06-30 Miguel de Icaza <miguel@ximian.com>
21884 * class.cs (Constructor.Define): Turn off initlocals for unsafe
21887 (MethodData.Define): Turn off initlocals for unsafe methods.
21889 2003-06-29 Miguel de Icaza <miguel@ximian.com>
21891 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
21892 complete; Fixes #37521.
21894 * delegate.cs: Use Modifiers.TypeAttr to compute the
21895 TypeAttributes, instead of rolling our own. This makes the flags
21896 correct for the delegates.
21898 2003-06-28 Miguel de Icaza <miguel@ximian.com>
21900 * class.cs (Constructor.Define): Set the private flag for static
21901 constructors as well.
21903 * cs-parser.jay (statement_expression): Set the return value to
21904 null, to avoid a crash when we catch an error.
21906 2003-06-24 Miguel de Icaza <miguel@ximian.com>
21908 * cs-parser.jay: Applied patch from Jackson that adds support for
21909 extern and unsafe modifiers to destructor declarations.
21911 * expression.cs: Report error 21 if the user is trying to index a
21914 * driver.cs: Add an error message, suggested by the bug report.
21916 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
21917 if we do not have a ": this ()" constructor initializer. Fixes 45149
21919 2003-06-14 Miguel de Icaza <miguel@ximian.com>
21921 * namespace.cs: Add some information to reduce FAQs.
21923 2003-06-13 Miguel de Icaza <miguel@ximian.com>
21925 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
21926 underlying enumeration types. Fixes #43915.
21928 * expression.cs: Treat ushort/short as legal values to be used in
21929 bitwise operations.
21931 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
21933 * delegate.cs: transfer custom attributes for paramenters from
21934 the delegate declaration to Invoke and BeginInvoke.
21936 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
21938 * attribute.cs: handle custom marshalers and emit marshal info
21941 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
21943 * makefile.gnu: Added anonymous.cs to the compiler sources.
21945 2003-05-28 Miguel de Icaza <miguel@ximian.com>
21947 * iterators.cs: Change the name of the proxy class to include two
21950 * cs-parser.jay: Update grammar to include anonymous methods.
21952 * anonymous.cs: new file.
21954 2003-05-27 Miguel de Icaza <miguel@ximian.com>
21956 * class.cs (Field.Define): Add missing test for pointers and
21959 2003-05-27 Ravi Pratap <ravi@ximian.com>
21961 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
21962 we use the stobj opcode.
21964 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
21965 since it wasn't the correct fix.
21967 It still is puzzling that we are required to use stobj for IntPtr
21968 which seems to be a ValueType.
21970 2003-05-26 Miguel de Icaza <miguel@ximian.com>
21972 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
21973 during regular simple name resolution. Now, the trick is that
21974 instead of returning for processing the simplename, we do a
21975 TypeManager.LookupType (ie, a rooted lookup as opposed to a
21976 contextual lookup type). If a match is found, return that, if
21977 not, return for further composition.
21979 This fixes long-standing 30485.
21981 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
21982 using the address to initialize an object, do an Stobj instead of
21983 using the regular Stelem.
21985 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
21986 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
21987 Because if we are a BaseIndexerAccess that value will be true.
21990 * statement.cs (GotoCase.Resolve): Return after reporting an
21991 error, do not attempt to continue.
21993 * expression.cs (PointerArithmetic.Emit): If our operand is a
21994 long, convert our constants to match the operand before
21995 multiplying. Convert to I type before adding. Fixes 43670.
21997 2003-05-14 Ravi Pratap <ravi@ximian.com>
21999 * enum.cs (ImplicitConversionExists) : Rename to
22000 ImplicitEnumConversionExists to remove ambiguity.
22002 * ecore.cs (NullCast): New type of cast expression class which
22003 basically is very similar to EmptyCast with the difference being
22004 it still is a constant since it is used only to cast a null to
22006 (eg. (string) null)
22008 * convert.cs (ImplicitReferenceConversion): When casting a null
22009 literal, we return a NullCast.
22011 * literal.cs (NullLiteralTyped): Remove - I don't see why this
22012 should be around anymore.
22014 The renaming (reported was slightly wrong). Corrections:
22016 ConvertImplicitStandard -> ImplicitConversionStandard
22017 ConvertExplicitStandard -> ExplicitConversionStandard
22019 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
22020 before passing them in !
22022 * convert.cs (ImplicitConversionStandard): When comparing for
22023 equal expr and target types, ensure that expr is not a
22026 In general, we must not be checking (expr_type ==
22027 target_type) in the top level conversion methods
22028 (ImplicitConversion, ExplicitConversion etc). This checking is
22029 done in the methods that they delegate to.
22031 2003-05-20 Miguel de Icaza <miguel@ximian.com>
22033 * convert.cs: Move Error_CannotConvertType,
22034 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
22035 ImplicitNumericConversion, ImplicitConversionExists,
22036 ImplicitUserConversionExists, StandardConversionExists,
22037 FindMostEncompassedType, FindMostSpecificSource,
22038 FindMostSpecificTarget, ImplicitUserConversion,
22039 ExplicitUserConversion, GetConversionOperators,
22040 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
22041 TryImplicitIntConversion, Error_CannotConvertImplicit,
22042 ConvertImplicitRequired, ConvertNumericExplicit,
22043 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
22044 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
22047 Perform the following renames:
22049 StandardConversionExists -> ImplicitStandardConversionExists
22050 ConvertImplicit -> ImplicitConversion
22051 ConvertImplicitStandard -> ImplicitStandardConversion
22052 TryImplicitIntConversion -> ImplicitIntConversion
22053 ConvertImplicitRequired -> ImplicitConversionRequired
22054 ConvertNumericExplicit -> ExplicitNumericConversion
22055 ConvertReferenceExplicit -> ExplicitReferenceConversion
22056 ConvertExplicit -> ExplicitConversion
22057 ConvertExplicitStandard -> ExplicitStandardConversion
22059 2003-05-19 Martin Baulig <martin@ximian.com>
22061 * statement.cs (TypeInfo.StructInfo): Made this type protected.
22062 (TypeInfo): Added support for structs having structs as fields.
22064 * ecore.cs (FieldExpr): Implement IVariable.
22065 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
22066 VariableInfo for the field.
22068 2003-05-18 Martin Baulig <martin@ximian.com>
22070 * expression.cs (This.DoResolve): Report a CS0027 if we're
22071 emitting a field initializer.
22073 2003-05-18 Martin Baulig <martin@ximian.com>
22075 * expression.cs (This.ResolveBase): New public function.
22076 (This.DoResolve): Check for CS0188.
22078 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
22081 * ecore.cs (MethodGroupExpr.DoResolve): Set the
22082 `instance_expression' to null if we don't have any non-static
22085 2003-05-18 Martin Baulig <martin@ximian.com>
22087 Reworked the way how local variables and parameters are handled by
22088 the flow analysis code.
22090 * statement.cs (TypeInfo, VariableMap): New public classes.
22091 (VariableInfo): New public class. This is now responsible for
22092 checking whether a variable has been assigned. It is used for
22093 parameters and local variables.
22094 (Block.EmitMeta): Take the InternalParameters as argument; compute
22095 the layout of the flow vectors here.
22096 (Block.LocalMap, Block.ParameterMap): New public properties.
22097 (FlowBranching): The .ctor doesn't get the InternalParameters
22098 anymore since Block.EmitMeta() now computes the layout of the flow
22100 (MyStructInfo): This class is now known as `StructInfo' and nested
22101 in `TypeInfo'; we don't access this directly anymore.
22103 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
22104 property and removed IsAssigned(), IsFieldAssigned(),
22105 SetAssigned() and SetFieldAssigned(); we now call them on the
22106 VariableInfo so we don't need to duplicate this code everywhere.
22108 * expression.cs (ParameterReference): Added `Block block' argument
22110 (LocalVariableReference, ParameterReference, This): The new
22111 VariableInfo class is now responsible for all the definite
22114 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
22115 IsParameterAssigned, SetParameterAssigned): Removed.
22117 2003-05-18 Martin Baulig <martin@ximian.com>
22119 * typemanager.cs (InitCoreTypes): Try calling
22120 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
22121 the 3-args-version. Corlib now also needs our `void_type'.
22122 (GetMethod): Added overloaded version which takes an optional
22123 `bool report_errors' to allow lookups of optional methods.
22125 2003-05-12 Martin Baulig <martin@ximian.com>
22127 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
22128 only used for locals and not for parameters.
22130 2003-05-12 Miguel de Icaza <miguel@ximian.com>
22132 * support.cs (InternalParameters.ParameterType): Return the
22133 ExternalType of the parameter.
22135 * parameter.cs (Parameter.ExternalType): drop the two arguments,
22138 2003-05-11 Miguel de Icaza <miguel@ximian.com>
22140 * class.cs (MethodData.Define): Do not set the `newslot' on
22141 interface members, if they are also flagged as "override".
22143 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
22144 better code for ++i and i++. This only works for static fields
22145 and local variables.
22147 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
22148 want to pull the DeclSpace out of the builder_to_declspace instead
22149 of the TypeBuilder (like in TypeContainer.FindMembers).
22151 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
22152 instead of LookupTypeContainer. Fixes the crash on .NET for
22153 looking up interface members.
22155 * const.cs: Create our own emit context during the Definition
22156 stage, so that constants are evaluated in the proper context, when
22157 a recursive definition happens.
22159 2003-05-11 Martin Baulig <martin@ximian.com>
22161 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
22162 new block for a switch section.
22163 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
22164 the adding/lookup in the switch block. Fixes #39828.
22166 2003-05-09 Miguel de Icaza <miguel@ximian.com>
22168 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
22169 functionality: I needed to convert the data after I had performed
22170 the add/sub operation into the operands type size.
22172 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
22173 pass the type for the box operation, otherwise the resulting
22174 object would have been of type object.
22176 (BoxedCast): Add constructor to specify the type to box as.
22178 2003-05-07 Miguel de Icaza <miguel@ximian.com>
22180 * iterators.cs: I was reusing the `count' variable inadvertently,
22181 take steps to not allow this to happen.
22183 2003-05-06 Miguel de Icaza <miguel@ximian.com>
22185 * attribute.cs (Attribute.Resolve): Params attributes are encoded
22186 by creating an array at the point where the params starts and
22187 putting all those arguments there, then adjusting the size of the
22190 2003-05-05 Miguel de Icaza <miguel@ximian.com>
22192 * expression.cs (New.AddressOf): Implement interface
22193 IMemoryLocation. This is used when the `new' operator is used in
22194 the context of an invocation to a method on a value type.
22196 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
22199 * namespace.cs: Also check the using aliases here.
22201 * driver.cs: Move the test for using validity after the types have
22202 been entered, so we do a single pass that also includes the using
22205 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
22206 in the regular case. CreateSiblingForFinally is doing extra
22209 * attribute.cs (GetAttributeArgumentExpression): Store the result
22210 on an out value, and use the return value to indicate failure
22211 instead of using null (which is a valid return for Constant.GetValue).
22213 * statement.cs: Perform the analysis flow for the increment
22214 portion after the statement, because this will be the real flow of
22215 execution. Fixes #42385
22217 * codegen.cs (EmitContext.EmitArgument,
22218 EmitContext.EmitStoreArgument): New helper functions when the
22219 RemapToProxy flag is set.
22221 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
22224 Add support for remapping parameters.
22226 * iterators.cs: Propagate parameter values; Store parameter
22227 values in the proxy classes.
22229 2003-05-04 Miguel de Icaza <miguel@ximian.com>
22231 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
22232 need a proxy reference; I do not know what I was thinking
22234 * cs-parser.jay (constructor_initializer): catch another error,
22235 and display nice message.
22237 (field_declaration): catch void field declaration
22238 to flag a better error.
22240 * class.cs (MemberBase.CheckBase): Report an error instead of a
22241 warning if a new protected member is declared in a struct.
22242 (Field.Define): catch the error of readonly/volatile.
22244 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
22246 (FieldExpr.AddressOf): ditto. Catch error where the address of a
22247 volatile variable is taken
22249 2003-05-02 Miguel de Icaza <miguel@ximian.com>
22251 * statement.cs (Fixed.Resolve): Report an error if we are not in
22254 2003-05-01 Miguel de Icaza <miguel@ximian.com>
22256 * typemanager.cs: reuse the code that handles type clashes for
22257 delegates and enumerations.
22259 * class.cs (Report28): Always report.
22261 * expression.cs (EncodeAsAttribute): Allow nulls here.
22263 2003-04-28 Miguel de Icaza <miguel@ximian.com>
22265 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
22266 the functionality for testing whether an expression is valid for
22267 an attribute here. Also handle the case of arrays of elements
22270 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
22271 encoding a linear array into an array of objects that are suitable
22272 to be passed to an CustomAttributeBuilder.
22274 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
22276 * ecore.cs: (FieldExpr): Handle field remapping here.
22278 * iteratators.cs: Pass the instance variable (if the method is an
22279 instance method) to the constructors, so we can access the field
22280 variables on the class.
22282 TODO: Test this with structs. I think the THIS variable on
22283 structs might have to be a pointer, and not a refenrece
22285 2003-04-27 Miguel de Icaza <miguel@ximian.com>
22287 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
22288 local variables to fields in a proxy class.
22290 * iterators.cs (PopulateProxy): Rename our internal fields to
22292 Create a <THIS> field if we are an instance method, so we can
22293 reference our parent container variables.
22294 (MapVariable): Called back from the EmitContext code to enter a
22295 new variable to field mapping into the proxy class (we just create
22299 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
22300 for using the remapped locals to fields.
22302 I placed the code here, because that gives the same semantics to
22303 local variables, and only changes the Emit code.
22305 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
22306 statements inside iterators.
22307 (VariableInfo): Add a FieldBuilder for the cases when we are
22308 remapping local variables to fields in a proxy class
22310 * ecore.cs (SimpleNameResolve): Avoid testing two times for
22311 current_block != null.
22313 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
22314 not cope with strings, as it has been moved to the
22315 TableSwitchEmit. Fixed bug in switch generation.
22317 * expression.cs (New.DoResolve): Provide more context for the user
22318 when reporting an error.
22320 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
22323 * expression.cs (MemberAccess.DoResolve): When we get a type back,
22324 check the permissions for it. Note than in a type-resolution
22325 context the check was already present in DeclSpace.ResolveType,
22326 but was missing from the MemberAccess.
22328 (ArrayCreation.CheckIndices): warn if the user has
22329 more nested levels of expressions, but there are no more
22330 dimensions specified. Avoids crash on bug 41906.
22332 2003-04-26 Miguel de Icaza <miguel@ximian.com>
22334 * statement.cs (Block): replace Implicit bool, for a generic
22336 New flag: `Unchecked'. This is used during the EmitMeta phase
22337 (which is out-of-line with the regular Resolve/Emit process for a
22338 statement, as this is done ahead of time, but still gets a chance
22339 to call constant resolve).
22341 (Block.Flags): new enum for adding a new flag.
22343 (Block.EmitMeta): track the state of unchecked.
22345 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
22346 to enable constant resolution to work there as well.
22348 2003-04-22 Miguel de Icaza <miguel@ximian.com>
22350 * typemanager.cs (ienumerable_type): Also look up
22351 System.Collections.IEnumerable.
22353 2003-04-21 Miguel de Icaza <miguel@ximian.com>
22355 TODO: Test more than one conditional per method.
22357 * class.cs (Indexer.Define): Report the location where the user is
22358 referencing the unsupported feature.
22360 (MethodData): Overload the use of `conditionals' to
22361 minimize the creation of needless ArrayLists. This saves roughly
22362 212kb on my machine.
22364 (Method): Implement the new IIteratorContainer interface.
22365 (Method.SetYields): Implement the method by setting the ModFlags
22366 to contain METHOD_YIELDS.
22368 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
22369 which just got set to null.
22371 * iterators.cs: New file.
22373 (Yield, YieldBreak): New statements.
22375 * statement.cs (Return.Resolve): Flag an error if we are used in
22376 an iterator method.
22378 * codegen.cs (InIterator): New flag set if the code is being
22379 compiled in an iterator method.
22381 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
22382 internal modifier, and we just use it to avoid adding extra
22383 fields, as this is seldom used.
22385 * cs-parser.jay: Add yield_statement (yield and yield break).
22387 * driver.cs: New flag -v2 to turn on version 2 features.
22389 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
22390 hashtable when v2 is enabled.
22392 2003-04-20 Miguel de Icaza <miguel@ximian.com>
22394 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
22395 there is already a namespace defined with this name.
22397 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
22398 people upgraded their corlibs.
22400 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
22401 always use fully qualified types, no need to use the compiler
22404 (TypeManager.IsNamespace): Use binarysearch.
22406 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
22407 AddDelegate): I did not quite use the new IsValid API properly: I
22408 have to pass the short-name and the fullname. I was passing only
22409 the basename instead of the fullname sometimes.
22411 (TypeContainer.DefineType): call NamespaceClash.
22413 * interface.cs (Interface.DefineType): use NamespaceClash before
22416 * delegate.cs (Delegate.DefineType): use NamespaceClash before
22419 * enum.cs: (Enum.DefineType): use NamespaceClash before
22422 * typemanager.cs (: 3-line patch that gives us some tasty 11%
22423 speed increase. First, use the negative_hits cache when we get a
22424 negative. Second, add the type with its full original name
22425 instead of the new . and + encoded name (reflection uses + to
22426 separate type from a nested type). Use LookupTypeReflection
22427 directly which bypasses the type->name hashtable (that we already
22428 know does not contain the type.
22430 * decl.cs (DeclSpace.ResolveTypeExpr): track the
22431 location/container type.
22433 * driver.cs: When passing utf8, use directly the UTF8Encoding.
22435 2003-04-19 Miguel de Icaza <miguel@ximian.com>
22437 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
22439 * delegate.cs (NewDelegate.Resolve): Test whether an instance
22440 method is being referenced in the method group from a static
22441 context, and report error 120 if so.
22443 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
22446 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
22447 is created, we create the A namespace).
22449 * cs-parser.jay: A namespace also introduces a DeclarationFound.
22452 2003-04-18 Miguel de Icaza <miguel@ximian.com>
22454 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
22455 invocation to ModuleBuilder.GetType with the same values will
22456 return a new type instance, so we need to cache its return
22459 * expression.cs (Binary.ResolveOperator): Only allow the compare
22460 operators on enums if they are of the same type.
22462 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
22463 types of ValueType on their own case. Before we were giving them
22464 the same treatment as objects.
22466 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
22467 fullname. Short name is used to compare against container name.
22468 Fullname is used to check against defined namespace names.
22470 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
22471 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
22473 (Method.CheckBase): Call parent.
22474 (MemberBase.CheckBase): Check for protected members on sealed
22476 (PropertyBase.CheckBase): Call parent.
22477 (Field.Define): Call parent.
22479 * report.cs: Negative error codes are now mapped to 8000 - code,
22480 so that the display is render more nicely.
22482 * typemanager.cs: Do not use try/catch, instead report a regular
22485 (GetPointerType, GetReferenceType): These methods provide
22486 mechanisms to obtain the T* and T& from a T. We had the code
22487 previously scattered around the code base, and it also used
22488 TypeManager.LookupType that would go through plenty of caches.
22489 This one goes directly to the type source.
22491 In some places we did the Type.GetType followed by
22492 ModuleBuilder.GetType, but not in others, so this unifies the
22493 processing as well.
22495 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
22496 statements now that we have namespace information.
22498 * typemanager.cs (IsNamespace): New method, returns whether the
22499 string presented is a namespace or not.
22501 (ComputeNamespaces): New public entry point, computes the list of
22502 available namespaces, using the GetNamespaces API call in Mono, or
22503 the slower version in MS.NET.
22505 Now before we start the semantic analysis phase, we have a
22506 complete list of namespaces including everything that the user has
22509 Deleted old code to cache namespaces in .nsc files.
22511 2003-04-17 Miguel de Icaza <miguel@ximian.com>
22513 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
22514 class/struct location definition Location for the implicit
22515 constructor location.
22517 (Operator.Define): Use the location of the operator for the
22518 implicit Method definition.
22520 (Constructor.Emit): use the constructor location for the implicit
22521 base initializer constructor.
22523 * ecore.cs: Remove ITypeExpression. This interface is now gone,
22524 and the Expression class now contains two new methods:
22526 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
22527 isolate type lookup from the rest of the resolution process.
22529 Since we use Expressions to hold type definitions due to the way
22530 we parse the input we have historically overloaded Resolve to
22531 perform the Type lookups if a special flag is passed. Now this is
22532 eliminated and two methods take their place.
22534 The differences in the two methods between xStep and xTerminal is
22535 that xStep is involved in our current lookup system that uses
22536 SimpleNames to compose a name, while xTerminal is used just to
22537 catch the case where the simplename lookup failed.
22539 2003-04-16 Miguel de Icaza <miguel@ximian.com>
22541 * expression.cs (ResolveMemberAccess): Remove redundant code.
22542 TypeExpr expressions are always born fully resolved.
22544 * interface.cs (PopulateMethod): Do not lookup the types twice.
22545 We were doing it once during SemanticAnalysis and once during
22548 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
22549 in local variable type definitions, were being returned as a
22550 SimpleName (we decomposed everything into a string), that is
22551 because primary_expression was being used instead of a type in the
22552 grammar (reduce/reduce conflicts).
22554 The part that was wrong is that we converted the expression into a
22555 string (an oversimplification in one hand, compounded with primary
22556 expressions doing string concatenation).
22562 Would return "A.B.C[]" as a SimpleName. This stopped things like
22563 using clauses from working on this particular context. And a type
22564 was being matched directly against "A.B.C[]".
22566 We now use the correct approach, and allow for ComposedCast to be
22567 part of the unary expression. So the "A.B.C []" become a composed
22568 cast of "A.B.C" (as a nested group of MemberAccess with a
22569 SimpleName at the end) plus the rank composition "[]".
22573 2003-04-10 Miguel de Icaza <miguel@ximian.com>
22575 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
22576 for the access level checking.
22578 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
22579 `TypeContainer container', because I kept getting confused when I
22580 was debugging this code.
22582 * expression.cs (Indexers): Instead of tracking getters/setters,
22583 we now track them in parallel. We create one arraylist less, but
22584 most importantly it is possible now for the LValue code to find a
22585 matching get for a set.
22587 (IndexerAccess.DoResolveLValue): Update the code.
22588 GetIndexersForType has been modified already to extract all the
22589 indexers from a type. The code assumed it did not.
22591 Also make the code set the correct return type for the indexer.
22592 This was fixed a long time ago for properties, but was missing for
22593 indexers. It used to be void_type.
22595 (Binary.Emit): Test first for doubles instead of
22596 floats, as they are more common.
22598 (Binary.EmitBranchable): Use the .un version of the branch opcodes
22599 when dealing with floats and the <=, >= operators. This fixes bug
22602 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
22603 to load the array value by emitting a load on the foreach variable
22604 type. This was incorrect.
22606 We now emit the code to load an element using the the array
22607 variable type, and then we emit the conversion operator.
22611 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
22613 * attribute.cs: Avoid allocation of ArrayLists in the common case.
22615 2003-04-09 Miguel de Icaza <miguel@ximian.com>
22617 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
22618 test for protection before we test for signatures.
22620 (MethodSignature.ToString): implement.
22622 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
22623 to the case where we reduced into a LongConstant.
22625 * decl.cs (CheckAccessLevel): If the type is an array, we can not
22626 depend on whether the information is acurrate, because the
22627 Microsoft runtime will always claim that the array type is public,
22628 regardless of the real state.
22630 If the type is a pointer, another problem happens: the type is
22631 reported as non-public in Microsoft.
22633 In both cases we have to call CheckAccessLevel recursively with
22634 the underlying type as the argument to be tested.
22636 2003-04-08 Miguel de Icaza <miguel@ximian.com>
22638 * assign.cs (Assign.Emit): If we are dealing with a compound
22639 assignment expression, we should use the code path that stores the
22640 intermediate result in a temporary value. This fixes #40903.
22642 *expression.cs (Indirection.ToString): Provide ToString method for
22645 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
22647 * class.cs: Null out fields holding references to Block objects so
22648 they can be garbage collected.
22650 * expression.cs (OverloadResolve): Remove unused local.
22652 2003-04-07 Martin Baulig <martin@ximian.com>
22654 * codegen.cs (EmitContext.CurrentFile): New public field.
22655 (EmitContext.Mark): Use the CurrentFile to check whether the
22656 location is in the correct file.
22657 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
22659 2003-04-07 Martin Baulig <martin@ximian.com>
22661 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
22663 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
22664 location. [FIXME: The location argument which gets passed to this
22665 method is sometimes wrong!]
22667 2003-04-07 Nick Drochak <ndrochak@gol.com>
22669 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
22671 2003-04-07 Miguel de Icaza <miguel@ximian.com>
22673 * expression.cs (Indirection.EmitAssign): We were using the
22674 temporary, but returning immediately instead of continuing the
22677 2003-04-06 Martin Baulig <martin@ximian.com>
22679 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
22680 if it's a nested child, but also deriving from the outer class.
22683 * typemanager.cs (IsNestedChildOf): Make this work if it's a
22684 nested child, but also deriving from the outer class. See
22686 (FilterWithClosure): We may access private members of the outer
22687 class if we're a nested child and deriving from the outer class.
22688 (RealMemberLookup): Only set `closure_private_ok' if the
22689 `original_bf' contained BindingFlags.NonPublic.
22691 2003-04-05 Martin Baulig <martin@ximian.com>
22693 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
22695 2003-04-02 Miguel de Icaza <miguel@ximian.com>
22697 * class.cs (Event.Define): Do not allow abstract events to have
22700 2003-04-01 Miguel de Icaza <miguel@ximian.com>
22702 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
22703 block in event declarations.
22705 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
22706 value type, get its address.
22708 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
22709 leaving a class on the stack instead of a boolean value (int
22710 0/1). Change the code so we compare against null, and then the
22711 result against zero.
22713 * class.cs (TypeContainer.GetClassBases): We were checking for the
22714 parent class being sealed too late.
22716 * expression.cs (Binary.Emit): For <= and >= when dealing with
22717 floating point values, use cgt.un and clt.un instead of cgt and
22720 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
22722 * statement.cs: Apply the same optimization as MS: skip the
22723 GetEnumerator returning an IEnumerator, and use the one returning a
22724 CharEnumerator instead. This allows us to avoid the try-finally block
22727 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
22729 * cs-parser.jay: Attributes cannot be applied to
22730 namespaces. Fixes #40473
22732 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22735 (Add*): check if the name is valid using the full name for constants,
22736 fields, properties and events.
22738 2003-03-28 Miguel de Icaza <miguel@ximian.com>
22740 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
22741 char constants to be part of the enumeration.
22743 * expression.cs (Conditional.DoResolve): Add support for operator
22744 true. Implements the missing functionality from 14.12
22746 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
22747 operator true/false as required by the spec.
22749 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
22750 implicit conversion to boolean.
22752 * statement.cs (Statement.ResolveBoolean): A boolean expression is
22753 also one where the type implements `operator true'.
22755 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
22756 get an expression that will invoke operator true based on an
22759 (GetConversionOperators): Removed the hack that called op_True
22762 (Expression.ResolveBoolean): Move this from Statement.
22764 2003-03-17 Miguel de Icaza <miguel@ximian.com>
22766 * ecore.cs (FieldExpr): do not allow initialization of initonly
22767 fields on derived classes
22769 2003-03-13 Martin Baulig <martin@ximian.com>
22771 * statement.cs (Block.Emit): Call ig.BeginScope() and
22772 ig.EndScope() when compiling with debugging info; call
22773 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
22775 2003-03-08 Miguel de Icaza <miguel@ximian.com>
22777 * expression.cs (Indexers): Do not construct immediately, allow
22778 for new members to be appended as we go. Fixes 38143
22780 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22782 * expression.cs: save/restore context when resolving an unchecked
22785 2003-03-05 Miguel de Icaza <miguel@ximian.com>
22787 * cfold.cs: Catch division by zero in modulus operator during
22790 2003-03-03 Miguel de Icaza <miguel@ximian.com>
22792 * interface.cs (Interface.DefineMembers): Avoid defining members
22795 2003-02-27 Miguel de Icaza <miguel@ximian.com>
22797 * driver.cs: handle the +/- options for -noconfig
22799 * statement.cs (Unckeched.Resolve): Also track the state of
22800 unchecked in the Resolve phase.
22802 2003-02-27 Martin Baulig <martin@ximian.com>
22804 * ecore.cs (Expression.MemberLookup): Don't create a
22805 MethodGroupExpr for something which is not a method. Fixes #38291.
22807 2003-02-25 Miguel de Icaza <miguel@ximian.com>
22809 * class.cs (MemberBase.CheckParameters): Also check that the type
22810 is unmanaged if it is a pointer.
22812 * expression.cs (SizeOf.Resolve): Add location information.
22814 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
22815 a managed type is declared.
22817 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
22818 parameter modifiers as well. Fixes bug 38606
22820 * class.cs: Very sad. Am backing out the speed up changes
22821 introduced by the ArrayList -> Array in the TypeContainer, as they
22822 were not actually that much faster, and introduced a bug (no error
22823 reports on duplicated methods).
22825 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
22826 source first, this will guarantee that we have a valid expression
22827 before calling in lower levels functions that will require a
22828 resolved object. Then use this original_source in the
22829 target.ResolveLValue instead of the original source that was
22832 Another change. Use target.Resolve instead of LValueResolve.
22833 Although we are resolving for LValues, we will let the Assign code
22834 take care of that (it will be called again from Resolve). This
22835 basically allows code like this:
22837 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
22838 class Y { void A (X x) { x [0] += o; }
22840 The problem was that the indexer was trying to resolve for
22841 set_Item (idx, object o) and never finding one. The real set_Item
22842 was set_Item (idx, X). By delaying the process we get the right
22847 2003-02-23 Martin Baulig <martin@ximian.com>
22849 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
22850 while calling DoEmit ().
22852 * codegen.cs (EmitContext.Mark): Don't mark locations in other
22853 source files; if you use the #line directive inside a method, the
22854 compiler stops emitting line numbers for the debugger until it
22855 reaches the end of the method or another #line directive which
22856 restores the original file.
22858 2003-02-23 Martin Baulig <martin@ximian.com>
22860 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
22862 2003-02-23 Martin Baulig <martin@ximian.com>
22864 * statement.cs (Block.AddChildVariableNames): We need to call this
22865 recursively, not just for our immediate children.
22867 2003-02-23 Martin Baulig <martin@ximian.com>
22869 * class.cs (Event.Define): Always make the field private, like csc does.
22871 * typemanager.cs (TypeManager.RealMemberLookup): Make events
22872 actually work, fixes bug #37521.
22874 2003-02-23 Miguel de Icaza <miguel@ximian.com>
22876 * delegate.cs: When creating the various temporary "Parameters"
22877 classes, make sure that we call the ComputeAndDefineParameterTypes
22878 on those new parameters (just like we do with the formal ones), to
22879 allow them to be resolved in the context of the DeclSpace.
22881 This fixes the bug that Dick observed in Bugzilla #38530.
22883 2003-02-22 Miguel de Icaza <miguel@ximian.com>
22885 * expression.cs (ResolveMemberAccess): When resolving a constant,
22886 do not attempt to pull a constant if the value was not able to
22887 generate a valid constant.
22889 * const.cs (LookupConstantValue): Do not report more errors than required.
22891 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22893 * expression.cs: fixes bug #38328.
22895 2003-02-18 Miguel de Icaza <miguel@ximian.com>
22897 * class.cs: Changed all the various members that can be part of a
22898 class from being an ArrayList to be an Array of the right type.
22899 During the DefineType type_list, interface_list, delegate_list and
22900 enum_list are turned into types, interfaces, delegates and enums
22903 And during the member population, indexer_list, event_list,
22904 constant_list, field_list, instance_constructor_list, method_list,
22905 operator_list and property_list are turned into their real arrays.
22907 Although we could probably perform this operation earlier, for
22908 good error reporting we need to keep the lists and remove the
22909 lists for longer than required.
22911 This optimization was triggered by Paolo profiling the compiler
22912 speed on the output of `gen-sample-program.pl' perl script.
22914 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
22915 not crash in methods like MemberLookupFailed that use this field.
22917 This problem arises when the compiler fails to resolve a type
22918 during interface type definition for example.
22920 2003-02-18 Miguel de Icaza <miguel@ximian.com>
22922 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
22923 inherit from System.Object, so we have to stop at null, not only
22924 when reaching System.Object.
22926 2003-02-17 Miguel de Icaza <miguel@ximian.com>
22928 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
22929 DeclaredOnly because the parent indexer might have had a different
22930 name, but did not loop until the top of the hierarchy was reached.
22932 The problem this one fixes is 35492: when a class implemented an
22933 indexer from an interface, we were getting the interface method
22934 (which was abstract) and we were flagging an error (can not invoke
22937 This also keeps bug 33089 functioning, and test-148 functioning.
22939 * typemanager.cs (IsSpecialMethod): The correct way of figuring
22940 out if a method is special is to see if it is declared in a
22941 property or event, or whether it is one of the predefined operator
22942 names. This should fix correctly #36804.
22944 2003-02-15 Miguel de Icaza <miguel@ximian.com>
22946 The goal here is to remove the dependency on EmptyCast.Peel ().
22947 Killing it completely.
22949 The problem is that currently in a number of places where
22950 constants are expected, we have to "probe" for an EmptyCast, and
22951 Peel, which is not the correct thing to do, as this will be
22952 repetitive and will likely lead to errors.
22954 The idea is to remove any EmptyCasts that are used in casts that
22955 can be reduced to constants, so we only have to cope with
22958 This bug hunt was triggered by Bug 37363 and the desire to remove
22959 the duplicate pattern where we were "peeling" emptycasts to check
22960 whether they were constants. Now constants will always be
22963 * ecore.cs: Use an enumconstant here instead of wrapping with
22966 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
22967 throwing me off. By handling this we can get rid of a few hacks.
22969 * statement.cs (Switch): Removed Peel() code.
22971 2003-02-14 Miguel de Icaza <miguel@ximian.com>
22973 * class.cs: Location information for error 508
22975 * expression.cs (New.DoResolve): Add a guard against double
22976 resolution of an expression.
22978 The New DoResolve might be called twice when initializing field
22979 expressions (see EmitFieldInitializers, the call to
22980 GetInitializerExpression will perform a resolve on the expression,
22981 and later the assign will trigger another resolution
22983 This leads to bugs (#37014)
22985 * delegate.cs: The signature for EndInvoke should contain any ref
22986 or out parameters as well. We were not doing this in the past.
22988 * class.cs (Field.Define): Do not overwrite the type definition
22989 inside the `volatile' group. Turns out that volatile enumerations
22990 were changing the type here to perform a validity test, which
22993 2003-02-12 Miguel de Icaza <miguel@ximian.com>
22995 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
22996 and structs, we do not want to load the instance variable
22998 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
22999 enum_type has to be handled like an object reference (implicit
23000 conversions exists from this to object), but the regular IsClass
23001 and IsValueType tests will never return true for this one.
23003 Also we use TypeManager.IsValueType instead of type.IsValueType,
23004 just for consistency with the rest of the code (this is only
23005 needed if we ever use the construct exposed by test-180.cs inside
23006 corlib, which we dont today).
23008 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
23010 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
23013 2003-02-09 Martin Baulig <martin@ximian.com>
23015 * namespace.cs (Namespace..ctor): Added SourceFile argument.
23016 (Namespace.DefineNamespaces): New static public method; this is
23017 called when we're compiling with debugging to add all namespaces
23018 to the symbol file.
23020 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
23021 pass it to the Namespace's .ctor.
23023 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
23024 and MethodBase arguments; pass the namespace ID to the symwriter;
23025 pass the MethodBase instead of the token to the symwriter.
23026 (SymbolWriter.DefineNamespace): New method to add a namespace to
23029 2003-02-09 Martin Baulig <martin@ximian.com>
23031 * symbolwriter.cs: New file. This is a wrapper around
23032 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
23033 methods here in near future.
23035 2003-02-09 Martin Baulig <martin@ximian.com>
23037 * codegen.cs (EmitContext.Mark): Just pass the arguments to
23038 ILGenerator.MarkSequencePoint() which are actually used by the
23041 2003-02-09 Martin Baulig <martin@ximian.com>
23043 * location.cs (SourceFile): New public sealed class. This
23044 contains the name and an index which is used in the location's token.
23045 (Location): Reserve an appropriate number of bits in the token for
23046 the source file instead of walking over that list, this gives us a
23047 really huge performance improvement when compiling with debugging.
23049 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
23050 `SourceFile' argument instead of a string.
23051 (Driver.ProcessFile): Add all the files via Location.AddFile(),
23052 but don't parse/tokenize here, we need to generate the list of all
23053 source files before we do that.
23054 (Driver.ProcessFiles): New static function. Parses/tokenizes all
23057 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
23058 instead of a string.
23060 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
23063 2003-02-09 Martin Baulig <martin@ximian.com>
23065 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
23066 filename on `#line default'.
23068 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
23070 * statement.cs: don't clear the pinned var when the fixed statement
23071 returns from the method (fixes bug#37752).
23073 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
23075 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
23078 2003-02-07 Martin Baulig <martin@ximian.com>
23080 * driver.cs: Removed the `--debug-args' command line argument.
23082 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
23083 automatically by the AsssemblyBuilder.
23084 (CodeGen.InitializeSymbolWriter): We don't need to call any
23085 initialization function on the symbol writer anymore. This method
23086 doesn't take any arguments.
23088 2003-02-03 Miguel de Icaza <miguel@ximian.com>
23090 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
23091 from referenced assemblies as well.
23093 2003-02-02 Martin Baulig <martin@ximian.com>
23095 * class.cs (MethodData.Emit): Generate debugging info for external methods.
23097 2003-02-02 Martin Baulig <martin@ximian.com>
23099 * class.cs (Constructor.Emit): Open the symbol writer before
23100 emitting the constructor initializer.
23101 (ConstructorInitializer.Emit): Call ec.Mark() to allow
23102 single-stepping through constructor initializers.
23104 2003-01-30 Miguel de Icaza <miguel@ximian.com>
23106 * class.cs: Handle error 549: do not allow virtual methods in
23109 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
23111 * decl.cs: Check access levels when resolving types
23113 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
23115 * statement.cs: Add parameters and locals set in catch blocks that might
23116 return to set vector
23118 2003-01-29 Miguel de Icaza <miguel@ximian.com>
23120 * class.cs (Operator): Set the SpecialName flags for operators.
23122 * expression.cs (Invocation.DoResolve): Only block calls to
23123 accessors and operators on SpecialName methods.
23125 (Cast.TryReduce): Handle conversions from char constants.
23128 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
23130 * statement.cs: small memory and time optimization in FlowBranching.
23132 2003-01-28 Pedro Mart <yoros@wanadoo.es>
23134 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
23135 problem that the last fix but in the other sid (Set).
23137 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
23138 access when there is no indexer in the hierarchy.
23140 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
23142 * class.cs: Combine some if statements.
23144 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23146 * driver.cs: fixed bug #37187.
23148 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
23150 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
23151 any indexer, it's needed to build a list with all the indexers in the
23152 hierarchy (AllGetters), else we have problems. Fixes #35653.
23154 2003-01-23 Miguel de Icaza <miguel@ximian.com>
23156 * class.cs (MethodData.Define): It is wrong for an interface
23157 implementation to be static in both cases: explicit and implicit.
23158 We were only handling this in one case.
23160 Improve the if situation there to not have negations.
23162 * class.cs (Field.Define): Turns out that we do not need to check
23163 the unsafe bit on field definition, only on usage. Remove the test.
23165 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23167 * driver.cs: use assembly.Location instead of Codebase (the latest
23168 patch made mcs fail when using MS assemblies).
23170 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
23172 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
23173 get the path to *corlib.dll.
23175 2003-01-21 Nick Drochak <ndrochak@gol.com>
23179 * typemanager.cs: Remove compiler warnings
23181 2003-01-20 Duncan Mak <duncan@ximian.com>
23183 * AssemblyInfo.cs: Bump the version number to 0.19.
23185 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23187 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
23189 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
23191 * class.cs (Constructor::Emit): Emit debugging info for constructors.
23193 2003-01-17 Miguel de Icaza <miguel@ximian.com>
23195 * cs-parser.jay: Small fix: we were not comparing the constructor
23196 name correctly. Thanks to Zoltan for the initial pointer.
23198 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
23200 * cs-tokenizer.cs: Set file name when specified with #line
23202 2003-01-15 Miguel de Icaza <miguel@ximian.com>
23204 * cs-parser.jay: Only perform the constructor checks here if we
23205 are named like the class; This will help provider a better
23206 error. The constructor path is taken when a type definition is
23207 not found, but most likely the user forgot to add the type, so
23208 report that rather than the constructor error.
23210 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
23212 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
23215 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23217 * cs-parser.jay: Add cleanup call.
23219 2003-01-13 Duncan Mak <duncan@ximian.com>
23221 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
23222 consistent with other methods.
23224 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23226 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
23228 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
23230 * attribute.cs: only set GuidAttr to true when we have a
23233 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23237 * typemanager.cs: fixes to allow mcs compile corlib with the new
23238 Type.IsSubclassOf fix.
23240 2003-01-08 Miguel de Icaza <miguel@ximian.com>
23242 * expression.cs (LocalVariableReference.DoResolve): Classify a
23243 constant as a value, not as a variable. Also, set the type for
23246 * cs-parser.jay (fixed_statement): take a type instead of a
23247 pointer_type, so we can produce a better error message later.
23249 * statement.cs (Fixed.Resolve): Flag types that are not pointers
23252 (For.DoEmit): Make inifinite loops have a
23253 non-conditional branch back.
23255 (Fixed.DoEmit): First populate the pinned variables, then emit the
23256 statement, then clear the variables. Before I was emitting the
23257 code once for each fixed piece.
23260 2003-01-08 Martin Baulig <martin@ximian.com>
23262 * statement.cs (FlowBranching.MergeChild): A break in a
23263 SWITCH_SECTION does not leave a loop. Fixes #36155.
23265 2003-01-08 Martin Baulig <martin@ximian.com>
23267 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
23268 lives in the same number space than `param_map'. Fixes #36154.
23270 2003-01-07 Miguel de Icaza <miguel@ximian.com>
23272 * cs-parser.jay (constructor_declaration): Set the
23273 Constructor.ModFlags before probing for it. This makes the
23274 compiler report 514, 515 and 132 (the code was there, but got
23277 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
23278 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
23279 (GotoCase.Resolve): Set `Returns' to ALWAYS.
23281 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
23283 * enum.cs: create the enum static fields using the enum type.
23285 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
23287 * class.cs: don't try to create the ParamBuilder for the return
23288 type if it's not needed (and handle it breaking for the ms runtime
23291 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
23293 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
23295 2002-12-29 Miguel de Icaza <miguel@ximian.com>
23297 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
23298 the command. This showed up while compiling the JANET source
23299 code, which used \r as its only newline separator.
23301 2002-12-28 Miguel de Icaza <miguel@ximian.com>
23303 * class.cs (Method.Define): If we are an operator (because it
23304 reuses our code), then set the SpecialName and HideBySig. #36128
23306 2002-12-22 Miguel de Icaza <miguel@ximian.com>
23308 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
23309 exception, report error 120 `object reference required'.
23311 * driver.cs: Add --pause option, used during to measure the size
23312 of the process as it goes with --timestamp.
23314 * expression.cs (Invocation.DoResolve): Do not allow methods with
23315 SpecialName to be invoked.
23317 2002-12-21 Miguel de Icaza <miguel@ximian.com>
23319 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
23320 number before adding it.
23322 2002-12-21 Ravi Pratap <ravi@ximian.com>
23324 * ecore.cs (StandardImplicitConversion): When in an unsafe
23325 context, we allow conversion between void * to any other pointer
23326 type. This fixes bug #35973.
23328 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
23330 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
23331 is not thrown when extensionless outputs are used
23333 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23335 * rootcontext.cs: fixed compilation of corlib.
23337 2002-12-19 Miguel de Icaza <miguel@ximian.com>
23339 * attribute.cs (Attributes.Contains): Add new method.
23341 * class.cs (MethodCore.LabelParameters): if the parameter is an
23342 `out' parameter, check that no attribute `[In]' has been passed.
23344 * enum.cs: Handle the `value__' name in an enumeration.
23346 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
23348 * decl.cs: Added special case to allow overrides on "protected
23351 2002-12-18 Ravi Pratap <ravi@ximian.com>
23353 * attribute.cs (Attributes.AddAttributeSection): Rename to this
23354 since it makes much more sense.
23356 (Attributes.ctor): Don't require a Location parameter.
23358 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
23360 * attribute.cs (ApplyAttributes): Remove extra Location parameters
23361 since we already have that information per attribute.
23363 * everywhere : make appropriate changes.
23365 * class.cs (LabelParameters): Write the code which actually
23366 applies attributes to the return type. We can't do this on the MS
23367 .NET runtime so we flag a warning in the case an exception is
23370 2002-12-18 Miguel de Icaza <miguel@ximian.com>
23372 * const.cs: Handle implicit null conversions here too.
23374 2002-12-17 Ravi Pratap <ravi@ximian.com>
23376 * class.cs (MethodCore.LabelParameters): Remove the extra
23377 Type [] parameter since it is completely unnecessary. Instead
23378 pass in the method's attributes so that we can extract
23379 the "return" attribute.
23381 2002-12-17 Miguel de Icaza <miguel@ximian.com>
23383 * cs-parser.jay (parse): Use Report.Error to flag errors instead
23384 of ignoring it and letting the compile continue.
23386 * typemanager.cs (ChangeType): use an extra argument to return an
23387 error condition instead of throwing an exception.
23389 2002-12-15 Miguel de Icaza <miguel@ximian.com>
23391 * expression.cs (Unary.TryReduce): mimic the code for the regular
23392 code path. Perform an implicit cast in the cases where we can
23393 implicitly convert to one of the integral types, and then reduce
23394 based on that constant. This fixes bug #35483.
23396 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23398 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
23400 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23402 * namespace.cs: fixed bug #35489.
23404 2002-12-12 Miguel de Icaza <miguel@ximian.com>
23406 * class.cs: Remove some dead code.
23408 * cs-parser.jay: Estimate the number of methods needed
23409 (RootContext.MethodCount);
23411 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
23412 numbers instead of StringBuilders.
23414 * support.cs (PtrHashtable): Add constructor with initial size;
23415 We can now reduce reallocations of the method table.
23417 2002-12-10 Ravi Pratap <ravi@ximian.com>
23419 * attribute.cs (ApplyAttributes): Keep track of the emitted
23420 attributes on a per-target basis. This fixes bug #35413.
23422 2002-12-10 Miguel de Icaza <miguel@ximian.com>
23424 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
23425 default to the Windows 1252 encoding.
23427 (UnixParseOption): Support version, thanks to Alp for the missing
23430 * AssemblyInfo.cs: Add nice assembly information.
23432 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
23435 * cs-parser.jay: Allow a trailing comma before the close bracked
23436 in the attribute_section production.
23438 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
23439 address of the instance was being taken, I will take this out,
23440 because we take the address of the object immediately here.
23442 2002-12-09 Ravi Pratap <ravi@ximian.com>
23444 * typemanager.cs (AreMultipleAllowed): Take care of the most
23445 obvious case where attribute type is not in the current assembly -
23448 2002-12-08 Miguel de Icaza <miguel@ximian.com>
23450 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
23451 definitions, instead of doing that afterwards.
23453 Also we use a nice little hack, depending on the constructor, we
23454 know if we are a "composed" name or a simple name. Hence, we
23455 avoid the IndexOf test, and we avoid
23457 * codegen.cs: Add code to assist in a bug reporter to track down
23458 the source of a compiler crash.
23460 2002-12-07 Ravi Pratap <ravi@ximian.com>
23462 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
23463 types have been emitted for a given element and flag an error
23464 if something which does not have AllowMultiple set is used more
23467 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
23468 attribute types and their corresponding AllowMultiple properties
23470 (AreMultipleAllowed): Check the property for a given type.
23472 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
23473 property in the case we have a TypeContainer.
23475 (Attributes.AddAttribute): Detect duplicates and just skip on
23476 adding them. This trivial fix catches a pretty gross error in our
23477 attribute emission - global attributes were being emitted twice!
23479 Bugzilla bug #33187 is now fixed.
23481 2002-12-06 Miguel de Icaza <miguel@ximian.com>
23483 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
23484 instead of pp_and).
23486 * expression.cs (Binary.ResolveOperator): I can only use the
23487 Concat (string, string, string) and Concat (string, string,
23488 string, string) if the child is actually a concatenation of
23491 2002-12-04 Miguel de Icaza <miguel@ximian.com>
23493 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
23494 context where we need a 2-character lookahead.
23496 * pending.cs (PendingImplementation): Rework so we can keep track
23497 of interface types all the time, and flag those which were
23498 implemented by parents as optional.
23500 2002-12-03 Miguel de Icaza <miguel@ximian.com>
23502 * expression.cs (Binary.ResolveOperator): Use
23503 String.Concat(string,string,string) or
23504 String.Concat(string,string,string,string) when possible.
23506 * typemanager: More helper methods.
23509 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
23511 * pending.cs: remove the bogus return from GetMissingInterfaces()
23512 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
23514 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23516 * namespace.cs: avoid duplicated 'using xxx' being added to
23517 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
23518 when we get more than one 'using' statement for the same namespace.
23519 Report a CS0105 warning for it.
23521 2002-11-30 Miguel de Icaza <miguel@ximian.com>
23523 * cs-tokenizer.cs (consume_identifier): use read directly, instead
23524 of calling getChar/putback, uses internal knowledge of it.
23526 (xtoken): Reorder tokenizer so most common patterns are checked
23527 first. This reduces the compilation time in another 5% (from 8.11s
23528 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
23530 The parsing time is 22% of the compilation in mcs, and from that
23531 64% is spent on the tokenization process.
23533 I tried using a binary search for keywords, but this is slower
23534 than the hashtable. Another option would be to do a couple of
23537 * Not use a StringBuilder, instead use an array of chars,
23538 with a set value. Notice that this way we could catch
23539 the 645 error without having to do it *afterwards*.
23541 * We could write a hand-parser to avoid the hashtable
23542 compares altogether.
23544 The identifier consumption process takes 37% of the tokenization
23545 time. Another 15% is spent on is_number. 56% of the time spent
23546 on is_number is spent on Int64.Parse:
23548 * We could probably choose based on the string length to
23549 use Int32.Parse or Int64.Parse and avoid all the 64-bit
23552 Another 3% is spend on wrapping `xtoken' in the `token' function.
23554 Handle 0xa0 as whitespace (#34752)
23556 2002-11-26 Miguel de Icaza <miguel@ximian.com>
23558 * typemanager.cs (IsCLRType): New routine to tell whether a type
23559 is one of the builtin types.
23561 Maybe it needs to use TypeCodes to be faster. Maybe we could use
23562 typecode in more places instead of doing pointer comparissions.
23563 We could leverage some knowledge about the way the typecodes are
23566 New code to cache namespaces in assemblies, it is currently not
23567 invoked, to be used soon.
23569 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
23571 * expression.cs (Binary.ResolveOperator): specially handle
23572 strings, and do not perform user-defined operator overloading for
23575 2002-11-24 Miguel de Icaza <miguel@ximian.com>
23577 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
23578 internalcall as it is a pretty simple operation; Avoid whenever
23579 possible to call Char.IsLetter.
23581 (consume_identifier): Cut by half the number of
23582 hashtable calls by merging the is_keyword and GetKeyword behavior.
23584 Do not short-circuit, because if we do, we
23585 report errors (ie, #if false && true would produce an invalid
23589 2002-11-24 Martin Baulig <martin@ximian.com>
23591 * expression.cs (Cast.TryReduce): If we're in checked syntax,
23592 check constant ranges and report a CS0221. Fixes #33186.
23594 2002-11-24 Martin Baulig <martin@ximian.com>
23596 * cs-parser.jay: Make this work for uninitialized variable
23597 declarations in the `for' initializer. Fixes #32416.
23599 2002-11-24 Martin Baulig <martin@ximian.com>
23601 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
23602 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
23604 2002-11-24 Martin Baulig <martin@ximian.com>
23606 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
23607 argument; if true, we also check for user-defined conversions.
23608 This is only needed if both arguments are of a user-defined type.
23609 Fixes #30443, added test-175.cs.
23610 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
23612 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
23614 2002-11-24 Martin Baulig <martin@ximian.com>
23616 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
23617 function to get the store opcode.
23618 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
23619 only emit the Ldelema if the store opcode is Stobj. You must run
23620 both test-34 and test-167 to test this. Fixes #34529.
23622 2002-11-23 Martin Baulig <martin@ximian.com>
23624 * ecore.cs (Expression.MemberLookup): Added additional
23625 `qualifier_type' argument which is used when we're being called
23626 from MemberAccess.DoResolve() and null if we're called from a
23628 (Expression.MemberLookupFailed): New method to report errors; this
23629 does the CS1540 check and reports the correct error message.
23631 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
23632 argument for the CS1540 check and redone the way how we're dealing
23633 with private members. See the comment in the source code for details.
23634 (FilterWithClosure): Reverted this back to revision 1.197; renamed
23635 `closure_start_type' to `closure_qualifier_type' and check whether
23636 it's not null. It was not this filter being broken, it was just
23637 being called with the wrong arguments.
23639 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
23640 and pass it the correct `qualifier_type'; this also does the error
23643 2002-11-22 Miguel de Icaza <miguel@ximian.com>
23645 * expression.cs (Invocation.EmitParams): If the we are dealing
23646 with a non-built-in value type, load its address as well.
23648 (ArrayCreation): Use a a pretty constant instead
23649 of the hardcoded value 2. Use 6 instead of 2 for the number of
23650 static initializers.
23652 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
23653 because they are not really value types, just glorified integers.
23655 * driver.cs: Do not append .exe, the CSC compiler does not do it.
23657 * ecore.cs: Remove redundant code for enumerations, make them use
23658 the same code path as everything else, fixes the casting issue
23659 with enumerations in Windows.Forms.
23661 * attribute.cs: Do only cast to string if it is a string, the
23662 validation happens later.
23664 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
23665 people upgrade their corlibs.
23667 * ecore.cs: Oops, enumerations were not following the entire code path
23669 2002-11-21 Miguel de Icaza <miguel@ximian.com>
23671 * typemanager.cs (FilterWithClosure): Commented out the test for
23672 1540 in typemanager.cs, as it has problems when accessing
23673 protected methods from a parent class (see test-174.cs).
23675 * attribute.cs (Attribute.ValidateGuid): new method.
23676 (Attribute.Resolve): Use above.
23678 2002-11-19 Miguel de Icaza <miguel@ximian.com>
23680 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
23682 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
23683 handling for enumerations, as we only needed the TypeContainer
23684 functionality to begin with (this is required for the fix below to
23685 work for enums that reference constants in a container class for
23688 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
23690 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
23691 a valid TypeBuilder to perform lookups on.o
23693 * class.cs (InheritableMemberSignatureCompare): Use true in the
23694 call to GetGetMethod and GetSetMethod, because we are comparing
23695 the signature, and we need to get the methods *even* if they are
23698 (PropertyBase.CheckBase): ditto.
23700 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
23701 GotoCase.Resolve): Use Peel on EmpytCasts.
23703 * ecore.cs (EmptyCast): drop child, add Peel method.
23705 2002-11-17 Martin Baulig <martin@ximian.com>
23707 * ecore.cs (EmptyCast.Child): New public property.
23709 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
23710 label resolved to an EmptyCast. Fixes #34162.
23711 (GotoCase.Resolve): Likewise.
23712 (Block.EmitMeta): Likewise.
23714 2002-11-17 Martin Baulig <martin@ximian.com>
23716 * expression.cs (Invocation.BetterConversion): Prefer int over
23717 uint; short over ushort; long over ulong for integer literals.
23718 Use ImplicitConversionExists instead of StandardConversionExists
23719 since we also need to check for user-defined implicit conversions.
23720 Fixes #34165. Added test-173.cs.
23722 2002-11-16 Martin Baulig <martin@ximian.com>
23724 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
23725 with the `true' and `false' literals. Fixes #33151.
23727 2002-11-16 Martin Baulig <martin@ximian.com>
23729 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
23730 October 22nd; don't do the cs1540 check for static members.
23732 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
23733 now using our own filter here and doing the cs1540 check again.
23735 2002-11-16 Martin Baulig <martin@ximian.com>
23737 * support.cs (InternalParameters): Don't crash if we don't have
23738 any fixed parameters. Fixes #33532.
23740 2002-11-16 Martin Baulig <martin@ximian.com>
23742 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
23743 when looking up static methods to make this work on Windows.
23746 2002-11-16 Martin Baulig <martin@ximian.com>
23748 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
23749 a setter rather than using PropertyInfo.CanWrite.
23751 2002-11-15 Nick Drochak <ndrochak@gol.com>
23753 * class.cs: Allow acces to block member by subclasses. Fixes build
23756 2002-11-14 Martin Baulig <martin@ximian.com>
23758 * class.cs (Constructor.Emit): Added the extern/block check.
23761 2002-11-14 Martin Baulig <martin@ximian.com>
23763 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
23764 iteration while looking for indexers, this is needed because the
23765 indexer may have a different name in our base classes. Fixed the
23766 error reporting (no indexers at all, not get accessor, no
23767 overloaded match). Fixes bug #33089.
23768 (IndexerAccess.DoResolveLValue): Likewise.
23770 2002-11-14 Martin Baulig <martin@ximian.com>
23772 * class.cs (PropertyBase.CheckBase): Make this work for multiple
23773 indexers. Fixes the first part of bug #33089.
23774 (MethodSignature.InheritableMemberSignatureCompare): Added support
23777 2002-11-13 Ravi Pratap <ravi@ximian.com>
23779 * attribute.cs (Attribute.Resolve): Catch the
23780 NullReferenceException and report it since it isn't supposed to
23783 2002-11-12 Miguel de Icaza <miguel@ximian.com>
23785 * expression.cs (Binary.EmitBranchable): Also handle the cases for
23786 LogicalOr and LogicalAnd that can benefit from recursively
23787 handling EmitBranchable. The code now should be nice for Paolo.
23789 2002-11-08 Miguel de Icaza <miguel@ximian.com>
23791 * typemanager.cs (LookupType): Added a negative-hit hashtable for
23792 the Type lookups, as we perform quite a number of lookups on
23793 non-Types. This can be removed once we can deterministically tell
23794 whether we have a type or a namespace in advance.
23796 But this might require special hacks from our corlib.
23800 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
23801 and double which avoids a conversion from an integer to a double.
23803 * expression.cs: tiny optimization, avoid calling IsConstant,
23804 because it effectively performs the lookup twice.
23806 2002-11-06 Miguel de Icaza <miguel@ximian.com>
23808 But a bogus return here to keep the semantics of the old code
23809 until the Mono runtime is fixed.
23811 * pending.cs (GetMissingInterfaces): New method used to remove all
23812 the interfaces that are already implemented by our parent
23813 classes from the list of pending methods.
23815 * interface.cs: Add checks for calls after ResolveTypeExpr.
23817 2002-11-05 Miguel de Icaza <miguel@ximian.com>
23819 * class.cs (Class.Emit): Report warning 67: event not used if the
23820 warning level is beyond 3.
23822 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
23823 being a NullLiteral.
23825 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
23828 * class.cs (TypeContainer.GetClassBases): Cover a missing code
23829 path that might fail if a type can not be resolved.
23831 * expression.cs (Binary.Emit): Emit unsigned versions of the
23834 * driver.cs: use error 5.
23836 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
23838 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
23840 2002-11-01 Miguel de Icaza <miguel@ximian.com>
23842 * cs-parser.jay (switch_section): A beautiful patch from Martin
23843 Baulig that fixed 33094.
23845 2002-10-31 Miguel de Icaza <miguel@ximian.com>
23847 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
23848 Check whether the base is abstract and report an error if so.
23850 * expression.cs (IndexerAccess.DoResolveLValue,
23851 IndexerAccess.DoResolve): ditto.
23853 (Invocation.DoResolve): ditto.
23855 (Invocation.FullMethodDesc): Improve the report string.
23857 * statement.cs (Block): Eliminate IsVariableDefined as it is
23858 basically just a wrapper for GetVariableInfo.
23860 * ecore.cs (SimpleName): Use new
23862 * support.cs (ReflectionParamter.ParameterType): We unwrap the
23863 type, as we return the actual parameter ref/unref state on a
23866 2002-10-30 Miguel de Icaza <miguel@ximian.com>
23868 * support.cs: Return proper flags REF/OUT fixing the previous
23871 * expression.cs: Reverted last patch, that was wrong. Is_ref is
23872 not used to mean `ref' but `ref or out' in ParameterReference
23874 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
23875 full type signature instead of calling TypeManger.CSharpName
23878 * support.cs (InternalParameters.ParameterDesc): Do not compare
23879 directly to the modflags, because REF/OUT will actually be bitsets
23882 * delegate.cs (VerifyMethod): Check also the modifiers.
23884 * cs-tokenizer.cs: Fix bug where floating point values with an
23885 exponent where a sign was missing was ignored.
23887 * driver.cs: Allow multiple assemblies to be specified in a single
23890 2002-10-28 Miguel de Icaza <miguel@ximian.com>
23892 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
23893 because identifiers after a parenthesis would end up in this kind
23894 of production, and we needed to desamiguate it for having casts
23897 (UserDefinedType *) xxx
23899 2002-10-24 Miguel de Icaza <miguel@ximian.com>
23901 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
23902 we should set on the Bindingflags.NonPublic, but not turn on
23903 private_ok. private_ok controls whether a Private member is
23904 returned (this is chekced on the filter routine), while the
23905 BindingFlags.NonPublic just controls whether private/protected
23906 will be allowed. This fixes the problem part of the problem of
23907 private properties being allowed to be used in derived classes.
23909 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
23910 so we can call the children DoResolveLValue method (this will
23911 properly signal errors on lvalue assignments to base properties)
23913 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
23914 getter are null, and we have a property info, we know that this
23915 happened because the lookup failed, so we report an error 122 for
23916 protection level violation.
23918 We also silently return if setter and getter are null in the
23919 resolve functions, this condition only happens if we have flagged
23920 the error before. This is the other half of the problem.
23922 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
23923 not have accessibility information, that is why we were returning
23924 true in the filter function in typemanager.cs.
23926 To properly report 122 (property is inaccessible because of its
23927 protection level) correctly, we report this error in ResolveAccess
23928 by failing if both the setter and the getter are lacking (ie, the
23931 DoResolve and DoLResolve have been modified to check for both
23932 setter/getter being null and returning silently, the reason being
23933 that I did not want to put the knowledge about this error in upper
23936 int old = Report.Errors;
23937 x = new PropertyExpr (...);
23938 if (old != Report.Errors)
23943 So the property expr is returned, but it is invalid, so the error
23944 will be flagged during the resolve process.
23946 * class.cs: Remove InheritablePropertySignatureCompare from the
23947 class, as we no longer depend on the property signature to compute
23948 whether it is possible to implement a method or not.
23950 The reason is that calling PropertyInfo.GetGetMethod will return
23951 null (in .NET, in Mono it works, and we should change this), in
23952 cases where the Get Method does not exist in that particular
23957 class X { public virtual int A { get { return 1; } } }
23959 class Z : Y { public override int A { get { return 2; } } }
23961 Would fail in Z because the parent (Y) would not have the property
23962 defined. So we avoid this completely now (because the alternative
23963 fix was ugly and slow), and we now depend exclusively on the
23966 (PropertyBase.CheckBase): Use a method-base mechanism to find our
23967 reference method, instead of using the property.
23969 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
23970 routines are gone now.
23972 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
23973 names, they were incorrectly named.
23975 * cs-tokenizer.cs: Return are more gentle token on failure.
23977 * pending.cs (PendingImplementation.InterfaceMethod): This routine
23978 had an out-of-sync index variable, which caused it to remove from
23979 the list of pending methods the wrong method sometimes.
23981 2002-10-22 Miguel de Icaza <miguel@ximian.com>
23983 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
23984 CanWrite, because those refer to this particular instance of the
23985 property, and do not take into account the fact that we can
23986 override single members of a property.
23988 Constructor requires an EmitContext. The resolution process does
23989 not happen here, but we need to compute the accessors before,
23990 because the resolution does not always happen for properties.
23992 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
23993 subclass, before we did not update this flag, but we did update
23996 (GetAccessors): Drop this routine, as it did not work in the
23997 presence of partially overwritten set/get methods.
23999 Notice that this broke the cs1540 detection, but that will require
24002 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24006 * driver.cs: issue a warning instead of an error if we don't support
24007 debugging for the platform. Also ignore a couple of errors that may
24008 arise when trying to write the symbols. Undo my previous patch.
24010 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24012 * driver.cs: ignore /debug switch except for Unix platforms.
24014 2002-10-23 Nick Drochak <ndrochak@gol.com>
24016 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
24018 2002-10-21 Miguel de Icaza <miguel@ximian.com>
24020 * driver.cs: Do not make mcs-debug conditional, so we do not break
24021 builds that use it.
24023 * statement.cs (UsageVector.MergeChildren): I would like Martin to
24024 review this patch. But basically after all the children variables
24025 have been merged, the value of "Breaks" was not being set to
24026 new_breaks for Switch blocks. I think that it should be set after
24027 it has executed. Currently I set this to the value of new_breaks,
24028 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
24029 conservative, but I do not understand this code very well.
24031 I did not break anything in the build, so that is good ;-)
24033 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
24035 2002-10-20 Mark Crichton <crichton@gimp.org>
24037 * cfold.cs: Fixed compile blocker. Really fixed it this time.
24039 2002-10-20 Nick Drochak <ndrochak@gol.com>
24041 * cfold.cs: Fixed compile blocker.
24043 2002-10-20 Miguel de Icaza <miguel@ximian.com>
24045 * driver.cs: I was chekcing the key, not the file.
24047 2002-10-19 Ravi Pratap <ravi@ximian.com>
24049 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
24050 message that we were generating - we just need to silently return
24053 2002-10-19 Miguel de Icaza <miguel@ximian.com>
24055 * class.cs (Event.Define): Change my previous commit, as this
24056 breaks the debugger. This is a temporary hack, as it seems like
24057 the compiler is generating events incorrectly to begin with.
24059 * expression.cs (Binary.ResolveOperator): Added support for
24060 "U operator - (E x, E y)"
24062 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
24065 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
24066 init-only variables, but this path did not take into account that
24067 there might be also instance readonly variables. Correct this
24070 This fixes bug 32253
24072 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
24075 * driver.cs: Change the extension for modules to `netmodule'
24077 * cs-parser.jay: Improved slightly the location tracking for
24078 the debugger symbols.
24080 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
24081 modifiers that were specified instead of the hardcoded value
24082 (FamAndAssem). This was basically ignoring the static modifier,
24083 and others. Fixes 32429.
24085 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
24086 fixed a bug in the process (32476)
24088 * expression.cs (ArrayAccess.EmitAssign): Patch from
24089 hwang_rob@yahoo.ca that fixes bug 31834.3
24091 2002-10-18 Miguel de Icaza <miguel@ximian.com>
24093 * driver.cs: Make the module extension .netmodule.
24095 2002-10-16 Miguel de Icaza <miguel@ximian.com>
24097 * driver.cs: Report an error if the resource file is not found
24098 instead of crashing.
24100 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
24101 false, like Emit does.
24103 2002-10-16 Nick Drochak <ndrochak@gol.com>
24105 * typemanager.cs: Remove unused private member. Also reported mcs
24106 bug to report this as a warning like csc.
24108 2002-10-15 Martin Baulig <martin@gnome.org>
24110 * statement.cs (Statement.Emit): Made this a virtual method; emits
24111 the line number info and calls DoEmit().
24112 (Statement.DoEmit): New protected abstract method, formerly knows
24113 as Statement.Emit().
24115 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
24117 2002-10-11 Miguel de Icaza <miguel@ximian.com>
24119 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
24120 have fixed a remaining problem: not every AddXXXX was adding a
24121 fully qualified name.
24123 Now everyone registers a fully qualified name in the DeclSpace as
24124 being defined instead of the partial name.
24126 Downsides: we are slower than we need to be due to the excess
24127 copies and the names being registered this way.
24129 The reason for this is that we currently depend (on the corlib
24130 bootstrap for instance) that types are fully qualified, because
24131 we dump all the types in the namespace, and we should really have
24132 types inserted into the proper namespace, so we can only store the
24133 basenames in the defined_names array.
24135 2002-10-10 Martin Baulig <martin@gnome.org>
24137 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
24138 from bug #31834, see the bug report for a testcase which is
24141 2002-10-10 Martin Baulig <martin@gnome.org>
24143 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
24144 flow analysis code for this.
24146 * statement.cs (Do, While, For): Tell the flow analysis code about
24148 (FlowBranching.UsageVector): Added support for infinite loops.
24149 (Block.Resolve): Moved the dead code elimination here and use flow
24152 2002-10-09 Miguel de Icaza <miguel@ximian.com>
24154 * class.cs (Field.Define): Catch cycles on struct type
24157 * typemanager.cs (IsUnmanagedtype): Do not recursively check
24158 fields if the fields are static. We only need to check instance
24161 * expression.cs (As.DoResolve): Test for reference type.
24163 * statement.cs (Using.ResolveExpression): Use
24164 ConvertImplicitRequired, not ConvertImplicit which reports an
24166 (Using.ResolveLocalVariableDecls): ditto.
24168 * expression.cs (Binary.ResolveOperator): Report errors in a few
24169 places where we had to.
24171 * typemanager.cs (IsUnmanagedtype): Finish implementation.
24173 2002-10-08 Miguel de Icaza <miguel@ximian.com>
24175 * expression.cs: Use StoreFromPtr instead of extracting the type
24176 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
24178 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
24179 an enumeration value to a System.Enum, but System.Enum is not a
24180 value type, but an class type, so we need to box.
24182 (Expression.ConvertExplicit): One codepath could return
24183 errors but not flag them. Fix this. Fixes #31853
24185 * parameter.cs (Resolve): Do not allow void as a parameter type.
24187 2002-10-06 Martin Baulig <martin@gnome.org>
24189 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
24190 if it's a class type and not a struct. Fixes #31815.
24192 2002-10-06 Martin Baulig <martin@gnome.org>
24194 * statement.cs: Reworked the flow analysis code a bit to make it
24195 usable for dead code elimination.
24197 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24199 * cs-parser.jay: allow empty source files. Fixes bug #31781.
24201 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24203 * expression.cs (ComposedCast.DoResolveType): A quick workaround
24204 to fix the test 165, will investigate deeper.
24206 2002-10-04 Martin Baulig <martin@gnome.org>
24208 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
24209 finally blocks actually work.
24210 (Try.Resolve): We don't need to create a sibling for `finally' if
24211 there is no finally block.
24213 2002-10-04 Martin Baulig <martin@gnome.org>
24215 * class.cs (Constructor.Define): The default accessibility for a
24216 non-default constructor is private, not public.
24218 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24220 * class.cs (Constructor): Make AllowedModifiers public, add
24223 * cs-parser.jay: Perform the modifiers test here, as the
24224 constructor for the Constructor class usually receives a zero
24225 because of the way we create it (first we create, later we
24226 customize, and we were never checking the modifiers).
24228 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
24229 is a version of LookupTypeReflection that includes the type-name
24230 cache. This can be used as a fast path for functions that know
24231 the fully qualified name and are only calling into *.GetType() to
24232 obtain a composed type.
24234 This is also used by TypeManager.LookupType during its type
24237 (LookupType): We now also track the real type name, as sometimes
24238 we can get a quey for the real type name from things like
24239 ComposedCast. This fixes bug 31422.
24241 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
24242 complete type fullname, it does not have to go through the type
24243 resolution system to obtain the composed version of the type (for
24244 obtaining arrays or pointers).
24246 (Conditional.Emit): Use the EmitBoolExpression to
24247 generate nicer code, as requested by Paolo.
24249 (ArrayCreation.CheckIndices): Use the patch from
24250 hwang_rob@yahoo.ca to validate the array initializers.
24252 2002-10-03 Miguel de Icaza <miguel@ximian.com>
24254 * class.cs (ConstructorInitializer.Emit): simplify code by using
24255 Invocation.EmitCall, and at the same time, fix the bugs in calling
24256 parent constructors that took variable arguments.
24258 * ecore.cs (Expression.ConvertNumericExplicit,
24259 Expression.ImplicitNumericConversion): Remove the code that
24260 manually wrapped decimal (InternalTypeConstructor call is now gone
24263 * expression.cs (Cast.TryReduce): Also handle decimal types when
24264 trying to perform a constant fold on the type.
24266 * typemanager.cs (IsUnmanagedtype): Partially implemented.
24268 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
24269 that only turned off an error report, and did nothing else.
24271 2002-10-02 Miguel de Icaza <miguel@ximian.com>
24273 * driver.cs: Handle and ignore /fullpaths
24275 2002-10-01 Miguel de Icaza <miguel@ximian.com>
24277 * expression.cs (Binary.ResolveOperator): Catch the case where
24278 DoNumericPromotions returns true,
24280 (Binary.DoNumericPromotions): Simplify the code, and the tests.
24282 2002-09-27 Miguel de Icaza <miguel@ximian.com>
24284 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
24287 2002-09-26 Miguel de Icaza <miguel@ximian.com>
24289 * ecore.cs (ConvertNumericExplicit): It is not enough that the
24290 conversion exists, but it is also required that the conversion be
24291 performed. This manifested in "(Type64Enum) 2".
24293 * class.cs (TypeManager.AddMethod): The fix is not to change
24294 AddEnum, because that one was using a fully qualified name (every
24295 DeclSpace derivative does), but to change the AddMethod routine
24296 that was using an un-namespaced name. This now correctly reports
24297 the duplicated name.
24299 Revert patch until I can properly fix it. The issue
24300 is that we have a shared Type space across all namespaces
24301 currently, which is wrong.
24303 Options include making the Namespace a DeclSpace, and merge
24304 current_namespace/current_container in the parser.
24306 2002-09-25 Miguel de Icaza <miguel@ximian.com>
24308 * cs-parser.jay: Improve error reporting when we get a different
24309 kind of expression in local_variable_type and
24310 local_variable_pointer_type.
24312 Propagate this to avoid missleading errors being reported.
24314 * ecore.cs (ImplicitReferenceConversion): treat
24315 TypeManager.value_type as a target just like object_type. As
24320 Is valid, and needs to result in the int 1 being boxed before it
24321 is assigned to the value type v.
24323 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
24324 to validate the enumeration name.
24326 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
24327 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
24328 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
24330 * ecore.cs (TryImplicitIntConversion): When doing an
24331 implicit-enumeration-conversion, check if the type is 64-bits and
24332 perform a conversion before passing to EnumConstant.
24334 2002-09-23 Miguel de Icaza <miguel@ximian.com>
24336 * decl.cs (Error_AmbiguousTypeReference); New routine used to
24337 report ambiguous type references. Unlike the MS version, we
24338 report what the ambiguity is. Innovation at work ;-)
24340 (DeclSpace.FindType): Require a location argument to
24341 display when we display an ambiguous error.
24343 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
24345 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
24347 * expression.cs (EmitDynamicInitializers): Apply patch from
24348 hwang_rob@yahoo.ca that fixes the order in which we emit our
24351 2002-09-21 Martin Baulig <martin@gnome.org>
24353 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
24354 delegate takes no arguments.
24356 2002-09-20 Miguel de Icaza <miguel@ximian.com>
24358 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
24361 * expression.cs: Extract the underlying type.
24363 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
24365 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
24367 2002-09-19 Miguel de Icaza <miguel@ximian.com>
24369 * class.cs (TypeContainer.DefineType): We can not use the nice
24370 PackingSize with the size set to 1 DefineType method, because it
24371 will not allow us to define the interfaces that the struct
24374 This completes the fixing of bug 27287
24376 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
24377 means also structs. This fixes part of the problem.
24378 (Expresion.ImplicitReferenceConversionExists): ditto.
24380 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
24381 error if there were no errors reported during the type lookup
24382 process, to avoid duplicates or redundant errors. Without this
24383 you would get an ambiguous errors plus a type not found. We have
24384 beaten the user enough with the first error.
24386 (DeclSparce.FindType): Emit a warning if we have an ambiguous
24389 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
24390 during the resolution process, stop the lookup, this avoids
24391 repeated error reports (same error twice).
24393 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
24395 * typemanager.cs (LookupType): Redo the type lookup code to match
24396 the needs of System.Reflection.
24398 The issue is that System.Reflection requires references to nested
24399 types to begin with a "+" sign instead of a dot. So toplevel
24400 types look like: "NameSpace.TopLevelClass", and nested ones look
24401 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
24404 2002-09-19 Martin Baulig <martin@gnome.org>
24406 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
24407 says that a method always returns or always throws an exception,
24408 don't report the CS0161.
24410 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
24411 set `Returns = new_returns'.
24413 2002-09-19 Martin Baulig <martin@gnome.org>
24415 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
24416 to an enum constant, check for a CS0176.
24418 2002-09-18 Miguel de Icaza <miguel@ximian.com>
24420 * class.cs (TypeContainer.CheckPairedOperators): Now we check
24421 for operators that must be in pairs and report errors.
24423 * ecore.cs (SimpleName.DoResolveType): During the initial type
24424 resolution process, when we define types recursively, we must
24425 check first for types in our current scope before we perform
24426 lookups in the enclosing scopes.
24428 * expression.cs (MakeByteBlob): Handle Decimal blobs.
24430 (Invocation.VerifyArgumentsCompat): Call
24431 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
24432 I thought we were supposed to always call this, but there are a
24433 few places in the code where we dont do it.
24435 2002-09-17 Miguel de Icaza <miguel@ximian.com>
24437 * driver.cs: Add support in -linkres and -resource to specify the
24438 name of the identifier.
24440 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24442 * ecore.cs (StandardConversionExists): Sync with the conversion
24443 code: allow anything-* to void* conversions.
24445 (FindMostSpecificSource): Use an Expression argument
24446 instead of a Type, because we might be handed over a Literal which
24447 gets a few more implicit conversions that plain types do not. So
24448 this information was being lost.
24450 Also, we drop the temporary type-holder expression when not
24453 2002-09-17 Martin Baulig <martin@gnome.org>
24455 * class.cs (PropertyBase.CheckBase): Don't check the base class if
24456 this is an explicit interface implementation.
24458 2002-09-17 Martin Baulig <martin@gnome.org>
24460 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
24461 different `IndexerName' attributes.
24463 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
24464 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
24465 virtual CommonResolve().
24467 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24469 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
24470 and convert that to the UnderlyingType.
24472 * statement.cs (Foreach.Resolve): Indexers are just like variables
24473 or PropertyAccesses.
24475 * cs-tokenizer.cs (consume_string): Track line numbers and columns
24476 inside quoted strings, we were not doing this before.
24478 2002-09-16 Martin Baulig <martin@gnome.org>
24480 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
24481 resolve it. This is needed for the definite assignment check of the
24482 instance expression, fixes bug #29846.
24483 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
24485 2002-09-16 Nick Drochak <ndrochak@gol.com>
24487 * parameter.cs: Fix compile error. Cannot reference static member
24488 from an instance object. Is this an mcs bug?
24490 2002-09-14 Martin Baulig <martin@gnome.org>
24492 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
24493 multiple times. Fixes bug #30295, added test-166.cs.
24495 2002-09-14 Martin Baulig <martin@gnome.org>
24497 * statement.cs (Block.Emit): Don't emit unreachable code.
24498 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
24499 `break' statements.
24500 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
24502 2002-09-14 Martin Baulig <martin@gnome.org>
24504 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
24507 2002-09-14 Martin Baulig <martin@gnome.org>
24509 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
24510 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
24511 be false on the ms runtime.
24513 2002-09-13 Martin Baulig <martin@gnome.org>
24515 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
24516 the CS0038 error message.
24518 2002-09-12 Miguel de Icaza <miguel@ximian.com>
24520 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
24521 constant inside, return it.
24523 2002-09-12 Martin Baulig <martin@gnome.org>
24525 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
24526 implicit conversion can be done between enum types.
24528 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
24529 check whether an implicit conversion to the current enum's UnderlyingType
24530 exists and report an error if not.
24532 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
24533 without debugging support.
24535 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
24536 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
24538 2002-09-12 Martin Baulig <martin@gnome.org>
24540 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
24542 * ecore.cs (IMemberExpr.DeclaringType): New property.
24543 (SimpleName.SimpleNameResolve): Check whether we're accessing a
24544 nonstatic member of an outer type (CS0038).
24546 2002-09-11 Miguel de Icaza <miguel@ximian.com>
24548 * driver.cs: Activate the using-error detector at warning level
24549 4 (at least for MS-compatible APIs).
24551 * namespace.cs (VerifyUsing): Small buglett fix.
24553 * pending.cs (PendingImplementation): pass the container pointer.
24555 * interface.cs (GetMethods): Allow for recursive definition. Long
24556 term, I would like to move every type to support recursive
24557 definitions, not the current ordering mechanism that we have right
24560 The situation is this: Attributes are handled before interfaces,
24561 so we can apply attributes to interfaces. But some attributes
24562 implement interfaces, we will now handle the simple cases
24563 (recursive definitions will just get an error).
24565 * parameter.cs: Only invalidate types at the end if we fail to
24568 2002-09-09 Martin Baulig <martin@gnome.org>
24570 * ecore.cs (PropertyExpr.Emit): Also check for
24571 TypeManager.system_int_array_get_length so this'll also work when
24572 compiling corlib. Fixes #30003.
24574 2002-09-09 Martin Baulig <martin@gnome.org>
24576 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
24577 and throw an exception if we can't get the type's size. Fixed #30040,
24580 2002-09-09 Martin Baulig <martin@gnome.org>
24582 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
24584 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
24585 context. Fixes bug #30027.
24587 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
24588 virtual functions. Fixes bug #30043, added test-164.cs.
24590 2002-09-08 Ravi Pratap <ravi@ximian.com>
24592 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
24594 2002-09-08 Nick Drochak <ndrochak@gol.com>
24596 * driver.cs: Use an object to get the windows codepage since it's not a
24599 2002-09-08 Miguel de Icaza <miguel@ximian.com>
24601 * statement.cs (For.Emit): for infinite loops (test == null)
24602 return whether there is a break inside, not always "true".
24604 * namespace.cs (UsingEntry): New struct to hold the name of the
24605 using definition, the location where it is defined, and whether it
24606 has been used in a successful type lookup.
24608 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
24613 2002-09-06 Ravi Pratap <ravi@ximian.com>
24615 * attribute.cs : Fix incorrect code which relied on catching
24616 a NullReferenceException to detect a null being passed in
24617 where an object was expected.
24619 2002-09-06 Miguel de Icaza <miguel@ximian.com>
24621 * statement.cs (Try): flag the catch variable as assigned
24623 * expression.cs (Cast): Simplified by using ResolveType instead of
24624 manually resolving.
24626 * statement.cs (Catch): Fix bug by using ResolveType.
24628 2002-09-06 Ravi Pratap <ravi@ximian.com>
24630 * expression.cs (BetterConversion): Special case for when we have
24631 a NullLiteral as the argument and we have to choose between string
24632 and object types - we choose string the way csc does.
24634 * attribute.cs (Attribute.Resolve): Catch the
24635 NullReferenceException and report error #182 since the Mono
24636 runtime no more has the bug and having this exception raised means
24637 we tried to select a constructor which takes an object and is
24640 2002-09-05 Ravi Pratap <ravi@ximian.com>
24642 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
24643 message (1502, 1503) when we can't locate a method after overload
24644 resolution. This is much more informative and closes the bug
24647 * interface.cs (PopulateMethod): Return if there are no argument
24648 types. Fixes a NullReferenceException bug.
24650 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
24651 expressions too. Previously we were checking only in one place for
24652 positional arguments leaving out named arguments.
24654 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
24655 type to the enum type is not allowed. Remove code corresponding to
24658 (ConvertNumericExplicit): Allow explicit conversions from
24659 the underlying type to enum type. This precisely follows the spec
24660 and closes a bug filed by Gonzalo.
24662 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24665 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
24667 2002-09-03 Miguel de Icaza <miguel@ximian.com>
24669 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
24670 it was important that we stored the right value after the
24671 reduction in `converted'.
24673 2002-09-04 Martin Baulig <martin@gnome.org>
24675 * location.cs (Location.SymbolDocument): Use full pathnames for the
24678 2002-08-30 Miguel de Icaza <miguel@ximian.com>
24680 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
24681 of the expression resolve mechanism, because that will catch the
24682 SimpleName error failures.
24684 (Conditional): If we can not resolve the
24685 expression, return, do not crash.
24687 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24690 (location): display token name instead of its number.
24692 2002-08-28 Martin Baulig <martin@gnome.org>
24694 * expression.cs (Binary.ResolveOperator): Don't silently return
24695 but return an error if an operator cannot be applied between two
24698 2002-08-28 Martin Baulig <martin@gnome.org>
24700 * class.cs (Constructor.Define): Set the permission attributes
24701 correctly instead of making all constructors public.
24703 2002-08-28 Martin Baulig <martin@gnome.org>
24705 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
24706 for private members before reporting a CS0103; if we find anything,
24709 2002-08-28 Martin Baulig <martin@gnome.org>
24711 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
24712 to check whether `closure_start_type == closure_invocation_type',
24713 we also need to check whether `m.DeclaringType == closure_invocation_type'
24714 before bypassing the permission checks. We might be accessing
24715 protected/private members from the base class.
24716 (TypeManager.RealMemberLookup): Only set private_ok if private
24717 members were requested via BindingFlags.NonPublic.
24719 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
24721 * expression.cs (MemberAccess.ResolveMemberAccess): Set
24722 MethodGroupExpr.IsExplicitImpl if appropriate.
24723 (Invocation.DoResolve): Don't report the CS0120 for explicit
24724 interface implementations.
24726 2002-08-27 Martin Baulig <martin@gnome.org>
24728 * expression.cs (Invocation.DoResolve): If this is a static
24729 method and we don't have an InstanceExpression, we must report
24732 2002-08-25 Martin Baulig <martin@gnome.org>
24734 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
24735 `==' between a valuetype and an object.
24737 2002-08-25 Miguel de Icaza <miguel@ximian.com>
24739 * ecore.cs (TypeExpr): Provide a ToString method.
24741 2002-08-24 Martin Baulig <martin@gnome.org>
24743 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
24744 now called proggie.dbg and it's a binary file.
24746 2002-08-23 Martin Baulig <martin@gnome.org>
24748 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
24750 2002-08-23 Martin Baulig <martin@gnome.org>
24752 * struct.cs (MyStructInfo.ctor): Make this work with empty
24753 structs; it's not allowed to use foreach() on null.
24755 2002-08-23 Martin Baulig <martin@gnome.org>
24757 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
24758 writer the full pathname of the generated assembly.
24760 2002-08-23 Martin Baulig <martin@gnome.org>
24762 * statements.cs (FlowBranching.UsageVector.MergeChildren):
24763 A `finally' block never returns or breaks; improved handling of
24766 2002-08-23 Martin Baulig <martin@gnome.org>
24768 * statement.cs (Throw.Resolve): Allow `throw null'.
24770 2002-08-23 Martin Baulig <martin@gnome.org>
24772 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
24773 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
24774 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
24775 MemberLookup would return a wrong event if this is an explicit
24776 interface implementation and the class has an event with the same
24779 2002-08-23 Martin Baulig <martin@gnome.org>
24781 * statement.cs (Block.AddChildVariableNames): New public method.
24782 (Block.AddChildVariableName): Likewise.
24783 (Block.IsVariableNameUsedInChildBlock): Likewise.
24784 (Block.AddVariable): Check whether a variable name has already
24785 been used in a child block.
24787 * cs-parser.jay (declare_local_variables): Mark all variable names
24788 from the current block as being used in a child block in the
24791 2002-08-23 Martin Baulig <martin@gnome.org>
24793 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
24794 find the symbol writer.
24796 * driver.cs: csc also allows the arguments to /define being
24797 separated by commas, not only by semicolons.
24799 2002-08-23 Martin Baulig <martin@gnome.org>
24801 * interface.cs (Interface.GetMembers): Added static check for events.
24803 2002-08-15 Martin Baulig <martin@gnome.org>
24805 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
24806 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
24808 * ecore.cs (Expression.MemberLookup): Added documentation and explained
24809 why the MethodData.EmitDestructor() change was necessary.
24811 2002-08-20 Martin Baulig <martin@gnome.org>
24813 * class.cs (TypeContainer.FindMembers): Added static check for events.
24815 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
24817 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
24818 use Type.GetEvents(), not Type.FindMembers().
24820 2002-08-20 Martin Baulig <martin@gnome.org>
24822 * decl.cs (MemberCache): Added a special method cache which will
24823 be used for method-only searched. This ensures that a method
24824 search will return a MethodInfo with the correct ReflectedType for
24827 2002-08-20 Martin Baulig <martin@gnome.org>
24829 * decl.cs (DeclSpace.FindMembers): Made this public.
24831 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24833 * delegate.cs: fixed build on windows.
24834 [FIXME: Filed as bug #29150: MCS must report these errors.]
24836 2002-08-19 Ravi Pratap <ravi@ximian.com>
24838 * ecore.cs (StandardConversionExists): Return a false
24839 if we are trying to convert the void type to anything else
24840 since that is not allowed.
24842 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
24843 we flag error 70 in the event an event is trying to be accessed
24844 directly from outside the declaring type.
24846 2002-08-20 Martin Baulig <martin@gnome.org>
24848 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
24849 MemberCache from typemanager.cs to decl.cs.
24851 2002-08-19 Martin Baulig <martin@gnome.org>
24853 * class.cs (TypeContainer): Implement IMemberContainer.
24854 (TypeContainer.DefineMembers): Create the MemberCache.
24855 (TypeContainer.FindMembers): Do better BindingFlags checking; only
24856 return public members if BindingFlags.Public was given, check
24857 whether members are static.
24859 2002-08-16 Martin Baulig <martin@gnome.org>
24861 * decl.cs (DeclSpace.Define): Splitted this in Define and
24862 DefineMembers. DefineMembers is called first and initializes the
24865 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
24866 DefineMembers() on all our DeclSpaces.
24868 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
24869 but call DefineMembers() on all nested interfaces. We call their
24870 Define() in our new Define() function.
24872 * interface.cs (Interface): Implement IMemberContainer.
24873 (Interface.Define): Moved all code except the attribute stuf to
24875 (Interface.DefineMembers): Initialize the member cache.
24877 * typemanager.cs (IMemberFinder): Removed this interface, we don't
24878 need this anymore since we can use MemberCache.FindMembers directly.
24880 2002-08-19 Martin Baulig <martin@gnome.org>
24882 * typemanager.cs (MemberCache): When creating the cache for an
24883 interface type, add all inherited members.
24884 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
24885 to `out bool used_cache' and documented it.
24886 (TypeManager.MemberLookup): If we already used the cache in the first
24887 iteration, we don't need to do the interfaces check.
24889 2002-08-19 Martin Baulig <martin@gnome.org>
24891 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
24892 here from IMemberFinder and don't implement this interface anymore.
24893 (DeclSpace.MemberCache): Moved here from IMemberFinder.
24895 * typemanager.cs (IMemberFinder): This interface is now only used by
24896 classes which actually support the member cache.
24897 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
24898 since we only put DeclSpaces into this Hashtable.
24899 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
24900 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
24902 2002-08-16 Martin Baulig <martin@gnome.org>
24904 * typemanager.cs (ICachingMemberFinder): Removed.
24905 (IMemberFinder.MemberCache): New property.
24906 (TypeManager.FindMembers): Merged this with RealFindMembers().
24907 This function will never be called from TypeManager.MemberLookup()
24908 so we can't use the cache here, just the IMemberFinder.
24909 (TypeManager.MemberLookup_FindMembers): Check whether the
24910 IMemberFinder has a MemberCache and call the cache's FindMembers
24912 (MemberCache): Rewrote larger parts of this yet another time and
24913 cleaned it up a bit.
24915 2002-08-15 Miguel de Icaza <miguel@ximian.com>
24917 * driver.cs (LoadArgs): Support quoting.
24919 (Usage): Show the CSC-like command line arguments.
24921 Improved a few error messages.
24923 2002-08-15 Martin Baulig <martin@gnome.org>
24925 * typemanager.cs (IMemberContainer.Type): New property.
24926 (IMemberContainer.IsInterface): New property.
24928 The following changes are conditional to BROKEN_RUNTIME, which is
24929 defined at the top of the file.
24931 * typemanager.cs (MemberCache.MemberCache): Don't add the base
24932 class'es members, but add all members from TypeHandle.ObjectType
24933 if we're an interface.
24934 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
24935 is the current type.
24936 (MemberCache.CacheEntry.Container): Removed this field.
24937 (TypeHandle.GetMembers): Include inherited members.
24939 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24941 * typemanager.cs: fixed compilation and added a comment on a field that
24944 2002-08-15 Martin Baulig <martin@gnome.org>
24946 * class.cs (ConstructorInitializer.Resolve): In the
24947 Expression.MemberLookup call, use the queried_type as
24950 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
24951 declared' attribute, it's always true.
24952 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
24953 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
24954 temporary wrapper for FindMembers which tells MemberLookup whether
24955 members from the base classes are included in the return value.
24956 This will go away soon.
24957 (TypeManager.MemberLookup): Use this temporary hack here; once the
24958 new MemberCache is completed, we don't need to do the DeclaredOnly
24959 looping here anymore since the MemberCache will take care of this.
24960 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
24961 (MemberCache): When creating the MemberCache for a class, get
24962 members from the current class and all its base classes.
24963 (MemberCache.CacheEntry.Container): New field. This is a
24964 temporary hack until the Mono runtime is fixed to distinguish
24965 between ReflectedType and DeclaringType. It allows us to use MCS
24966 with both the MS runtime and the unfixed Mono runtime without
24967 problems and without accecting performance.
24968 (MemberCache.SearchMembers): The DeclaredOnly looping from
24969 TypeManager.MemberLookup is now done here.
24971 2002-08-14 Martin Baulig <martin@gnome.org>
24973 * statement.cs (MyStructInfo.MyStructInfo): Don't call
24974 Type.GetFields on dynamic types but get the fields from the
24975 corresponding TypeContainer.
24976 (MyStructInfo.GetStructInfo): Added check for enum types.
24978 * typemanager.cs (MemberList.IsSynchronized): Implemented.
24979 (MemberList.SyncRoot): Implemented.
24980 (TypeManager.FilterWithClosure): No need to check permissions if
24981 closure_start_type == closure_invocation_type, don't crash if
24982 closure_invocation_type is null.
24984 2002-08-13 Martin Baulig <martin@gnome.org>
24986 Rewrote TypeContainer.FindMembers to use a member cache. This
24987 gives us a speed increase of about 35% for the self-hosting MCS
24988 build and of about 15-20% for the class libs (both on GNU/Linux).
24990 * report.cs (Timer): New class to get enhanced profiling. This
24991 whole class is "TIMER" conditional since it remarkably slows down
24994 * class.cs (MemberList): New class. This is an IList wrapper
24995 which we're now using instead of passing MemberInfo[]'s around to
24996 avoid copying this array unnecessarily.
24997 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
24998 (ICachingMemberFinder, IMemberContainer): New interface.
24999 (TypeManager.FilterWithClosure): If `criteria' is null, the name
25000 has already been checked, otherwise use it for the name comparision.
25001 (TypeManager.FindMembers): Renamed to RealMemberFinder and
25002 provided wrapper which tries to use ICachingMemberFinder.FindMembers
25003 if possible. Returns a MemberList, not a MemberInfo [].
25004 (TypeHandle): New class, implements IMemberContainer. We create
25005 one instance of this class per type, it contains a MemberCache
25006 which is used to do the member lookups.
25007 (MemberCache): New class. Each instance of this class contains
25008 all members of a type and a name-based hash table.
25009 (MemberCache.FindMembers): This is our new member lookup
25010 function. First, it looks up all members of the requested name in
25011 the hash table. Then, it walks this list and sorts out all
25012 applicable members and returns them.
25014 2002-08-13 Martin Baulig <martin@gnome.org>
25016 In addition to a nice code cleanup, this gives us a performance
25017 increase of about 1.4% on GNU/Linux - not much, but it's already
25018 half a second for the self-hosting MCS compilation.
25020 * typemanager.cs (IMemberFinder): New interface. It is used by
25021 TypeManager.FindMembers to call FindMembers on a TypeContainer,
25022 Enum, Delegate or Interface.
25023 (TypeManager.finder_to_member_finder): New PtrHashtable.
25024 (TypeManager.finder_to_container): Removed.
25025 (TypeManager.finder_to_delegate): Removed.
25026 (TypeManager.finder_to_interface): Removed.
25027 (TypeManager.finder_to_enum): Removed.
25029 * interface.cs (Interface): Implement IMemberFinder.
25031 * delegate.cs (Delegate): Implement IMemberFinder.
25033 * enum.cs (Enum): Implement IMemberFinder.
25035 * class.cs (TypeContainer): Implement IMemberFinder.
25037 2002-08-12 Martin Baulig <martin@gnome.org>
25039 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
25041 2002-08-12 Martin Baulig <martin@gnome.org>
25043 * ecore.cs (ITypeExpression): New interface for expressions which
25045 (TypeExpression): Renamed to TypeLookupExpression.
25046 (Expression.DoResolve): If we're doing a types-only lookup, the
25047 expression must implement the ITypeExpression interface and we
25048 call DoResolveType() on it.
25049 (SimpleName): Implement the new ITypeExpression interface.
25050 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
25051 hack, the situation that we're only looking up types can't happen
25052 anymore when this method is called. Moved the type lookup code to
25053 DoResolveType() and call it.
25054 (SimpleName.DoResolveType): This ITypeExpression interface method
25055 is now doing the types-only lookup.
25056 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
25057 (ResolveFlags): Added MaskExprClass.
25059 * expression.cs (MemberAccess): Implement the ITypeExpression
25061 (MemberAccess.DoResolve): Added support for a types-only lookup
25062 when we're called via ITypeExpression.DoResolveType().
25063 (ComposedCast): Implement the ITypeExpression interface.
25065 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
25066 Expression.Resolve() with ResolveFlags.Type instead.
25068 2002-08-12 Martin Baulig <martin@gnome.org>
25070 * interface.cs (Interface.Define): Apply attributes.
25072 * attribute.cs (Attribute.ApplyAttributes): Added support for
25073 interface attributes.
25075 2002-08-11 Martin Baulig <martin@gnome.org>
25077 * statement.cs (Block.Emit): Only check the "this" variable if we
25078 do not always throw an exception.
25080 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
25081 whether the property has a set accessor.
25083 2002-08-11 Martin Baulig <martin@gnome.org>
25085 Added control flow analysis support for structs.
25087 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
25088 with control flow analysis turned off.
25089 (IVariable): New interface.
25090 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
25091 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
25092 (FieldExpr.DoResolve): Resolve the instance expression with flow
25093 analysis turned off and do the definite assignment check after the
25094 resolving when we know what the expression will resolve to.
25096 * expression.cs (LocalVariableReference, ParameterReference):
25097 Implement the new IVariable interface, only call the flow analysis
25098 code if ec.DoFlowAnalysis is true.
25099 (This): Added constructor which takes a Block argument. Implement
25100 the new IVariable interface.
25101 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
25102 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
25103 This does the definite assignment checks for struct members.
25105 * class.cs (Constructor.Emit): If this is a non-static `struct'
25106 constructor which doesn't have any initializer, call
25107 Block.AddThisVariable() to tell the flow analysis code that all
25108 struct elements must be initialized before control returns from
25111 * statement.cs (MyStructInfo): New public class.
25112 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
25113 argument to this indexer. If non-zero, check an individual struct
25114 member, not the whole struct.
25115 (FlowBranching.CheckOutParameters): Check struct members.
25116 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
25117 overloaded versions of these methods which take an additional
25118 `int field_idx' argument to check struct members.
25119 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
25120 overloaded versions of these methods which take an additional
25121 `string field_name' argument to check struct member.s
25122 (VariableInfo): Implement the IVariable interface.
25123 (VariableInfo.StructInfo): New public property. Returns the
25124 MyStructInfo instance of the variable if it's a struct or null.
25125 (Block.AddThisVariable): New public method. This is called from
25126 Constructor.Emit() for non-static `struct' constructor which do
25127 not have any initializer. It creates a special variable for the
25128 "this" instance variable which will be checked by the flow
25129 analysis code to ensure that all of the struct's fields are
25130 initialized before control returns from the constructor.
25131 (UsageVector): Added support for struct members. If a
25132 variable/parameter is a struct with N members, we reserve a slot
25133 in the usage vector for each member. A struct is considered fully
25134 initialized if either the struct itself (slot 0) or all its
25135 members are initialized.
25137 2002-08-08 Martin Baulig <martin@gnome.org>
25139 * driver.cs (Driver.MainDriver): Only report an error CS5001
25140 if there were no compilation errors.
25142 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
25143 `UnsafeContext' property to determine whether the parent is in
25144 unsafe context rather than checking the parent's ModFlags:
25145 classes nested in an unsafe class are unsafe as well.
25147 2002-08-08 Martin Baulig <martin@gnome.org>
25149 * statement.cs (UsageVector.MergeChildren): Distinguish between
25150 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
25151 we return. Added test17() and test18() to test-154.cs.
25153 2002-08-08 Martin Baulig <martin@gnome.org>
25155 * typemanager.cs (TypeManager.FilterWithClosure): If we have
25156 Family access, make sure the invoking type isn't a subclass of the
25157 queried type (that'd be a CS1540).
25159 * ecore.cs (Expression.MemberLookup): Added overloaded version of
25160 this method which takes an additional `Type invocation_type'.
25162 * expression.cs (BaseAccess.DoResolve): Use the base type as
25163 invocation and query type.
25164 (MemberAccess.DoResolve): If the lookup failed and we're about to
25165 report a CS0122, try a lookup with the ec.ContainerType - if this
25166 succeeds, we must report a CS1540.
25168 2002-08-08 Martin Baulig <martin@gnome.org>
25170 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
25171 (MethodGroupExpr): Implement the IMemberExpr interface.
25173 * expression (MemberAccess.ResolveMemberAccess): No need to have
25174 any special code for MethodGroupExprs anymore, they're now
25177 2002-08-08 Martin Baulig <martin@gnome.org>
25179 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
25180 Family, FamANDAssem and FamORAssem permissions.
25181 (TypeManager.IsSubclassOrNestedChildOf): New public method.
25183 2002-08-08 Martin Baulig <martin@gnome.org>
25185 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
25186 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
25189 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
25191 * driver.cs: implemented /resource option to embed managed resources.
25193 2002-08-07 Martin Baulig <martin@gnome.org>
25195 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
25196 (FieldBase.HasFieldInitializer): New public property.
25197 (FieldBase.GetInitializerExpression): New public method. Resolves and
25198 returns the field initializer and makes sure it is only resolved once.
25199 (TypeContainer.EmitFieldInitializers): Call
25200 FieldBase.GetInitializerExpression to get the initializer, this ensures
25201 that it isn't resolved multiple times.
25203 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
25204 the resolving process (SimpleName/MemberLookup) that we're currently
25205 emitting a field initializer (which must not access any instance members,
25206 this is an error CS0236).
25208 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
25209 argument, if the `IsFieldInitializer' flag is set, we must report and
25210 error CS0236 and not an error CS0120.
25212 2002-08-07 Martin Baulig <martin@gnome.org>
25214 * ecore.cs (IMemberExpr): New public interface.
25215 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
25216 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
25217 if the expression is an IMemberExpr.
25219 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
25220 to be null, implicitly default to `this' if we're non-static in
25221 this case. Simplified the code a lot by using the new IMemberExpr
25222 interface. Also fixed bug #28176 here.
25224 2002-08-06 Martin Baulig <martin@gnome.org>
25226 * cs-parser.jay (SimpleLookup): Removed. We need to create
25227 ParameterReferences during semantic analysis so that we can do a
25228 type-only search when resolving Cast, TypeOf and SizeOf.
25229 (block): Pass the `current_local_parameters' to the Block's
25232 * class.cs (ConstructorInitializer): Added `Parameters parameters'
25233 argument to the constructor.
25234 (ConstructorInitializer.Resolve): Create a temporary implicit
25235 block with the parameters.
25237 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
25238 references here if we aren't doing a type-only search.
25240 * statement.cs (Block): Added constructor which takes a
25241 `Parameters parameters' argument.
25242 (Block.Parameters): New public property.
25244 * support.cs (InternalParameters.Parameters): Renamed `parameters'
25245 to `Parameters' and made it public readonly.
25247 2002-08-06 Martin Baulig <martin@gnome.org>
25249 * ecore.cs (Expression.Warning): Made this public as well.
25251 * report.cs (Report.Debug): Print the contents of collections.
25253 2002-08-06 Martin Baulig <martin@gnome.org>
25255 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
25256 used to tell Resolve() which kinds of expressions it may return.
25257 (Expression.Resolve): Added overloaded version of this method which
25258 takes a `ResolveFlags flags' argument. This can be used to tell
25259 Resolve() which kinds of expressions it may return. Reports a
25261 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
25262 ResolveFlags.SimpleName.
25263 (Expression.Error118): Added overloaded version of this method which
25264 takes a `ResolveFlags flags' argument. It uses the flags to determine
25265 which kinds of expressions are allowed.
25267 * expression.cs (Argument.ResolveMethodGroup): New public method.
25268 Resolves an argument, but allows a MethodGroup to be returned.
25269 This is used when invoking a delegate.
25271 * TODO: Updated a bit.
25273 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25275 Fixed compilation with csc.
25277 * ecore.cs: Expression.Error made public. Is this correct? Should
25278 Warning be made public too?
25280 * expression.cs: use ea.Location instead of ea.loc.
25281 [FIXME: Filed as bug #28607: MCS must report these errors.]
25283 2002-08-06 Martin Baulig <martin@gnome.org>
25285 * ecore.cs (Expression.loc): Moved the location here instead of
25286 duplicating it in all derived classes.
25287 (Expression.Location): New public property.
25288 (Expression.Error, Expression.Warning): Made them non-static and
25289 removed the location argument.
25290 (Expression.Warning): Added overloaded version which takes an
25291 `int level' argument.
25292 (Expression.Error118): Make this non-static and removed the
25293 expression and location arguments.
25294 (TypeExpr): Added location argument to the constructor.
25296 * expression.cs (StaticCallExpr): Added location argument to
25298 (Indirection, PointerArithmetic): Likewise.
25299 (CheckedExpr, UnCheckedExpr): Likewise.
25300 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
25301 (StringPtr): Likewise.
25304 2002-08-05 Martin Baulig <martin@gnome.org>
25306 * expression.cs (BaseAccess.DoResolve): Actually report errors.
25308 * assign.cs (Assign.DoResolve): Check whether the source
25309 expression is a value or variable.
25311 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
25312 while resolving the corresponding blocks.
25314 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
25315 an error, don't silently return null.
25317 * statement.cs (Block.AddVariable): Do the error reporting here
25318 and distinguish between CS0128 and CS0136.
25319 (Block.DoResolve): Report all unused labels (warning CS0164).
25320 (LabeledStatement): Pass the location to the constructor.
25321 (LabeledStatement.HasBeenReferenced): New property.
25322 (LabeledStatement.Resolve): Set it to true here.
25324 * statement.cs (Return.Emit): Return success even after reporting
25325 a type mismatch error (CS0126 or CS0127), this is what csc does and
25326 it avoids confusing the users with any consecutive errors.
25328 2002-08-05 Martin Baulig <martin@gnome.org>
25330 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
25332 * const.cs (Const.LookupConstantValue): Catch circular definitions.
25334 * expression.cs (MemberAccess.DoResolve): Silently return if an
25335 error has already been reported.
25337 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
25338 error has already been reported.
25340 2002-08-05 Martin Baulig <martin@gnome.org>
25342 * statement.cs (UsageVector): Only initialize the `parameters'
25343 vector if we actually have any "out" parameters.
25345 2002-08-05 Martin Baulig <martin@gnome.org>
25347 * expression.cs (Binary.ResolveOperator): When combining delegates,
25348 they must have the same type.
25350 2002-08-05 Martin Baulig <martin@gnome.org>
25352 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
25353 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
25354 work with the ms runtime and we also don't need it: if we're a
25355 PropertyBuilder and not in the `indexer_arguments' hash, then we
25356 are a property and not an indexer.
25358 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
25359 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
25360 since the latter one doesn't work with the ms runtime.
25362 2002-08-03 Martin Baulig <martin@gnome.org>
25364 Fixed bugs #27998 and #22735.
25366 * class.cs (Method.IsOperator): New public field.
25367 (Method.CheckBase): Report CS0111 if there's already a method
25368 with the same parameters in the current class. Report CS0508 when
25369 attempting to change the return type of an inherited method.
25370 (MethodData.Emit): Report CS0179 if a method doesn't have a body
25371 and it's not marked abstract or extern.
25372 (PropertyBase): New abstract base class for Property and Indexer.
25373 (PropertyBase.CheckBase): Moved here from Property and made it work
25375 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
25376 the same so we can reuse it there.
25377 (Property, Indexer): Derive from PropertyBase.
25378 (MethodSignature.inheritable_property_signature_filter): New delegate
25379 to find properties and indexers.
25381 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
25382 argument and improved error reporting.
25384 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
25385 EmptyReadOnlyParameters and made it a property.
25387 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
25388 version of this method which takes a `PropertyInfo indexer'.
25389 (TypeManager.RegisterIndexer): New method.
25391 * class.cs: Added myself as author of this file :-)
25393 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25395 * class.cs: fixed compilation on windoze.
25397 2002-08-03 Martin Baulig <martin@gnome.org>
25399 * interface.cs (Interface.GetInterfaceBases): Check whether all
25400 base interfaces are at least as accessible than the current one.
25402 * class.cs (TypeContainer.GetClassBases): Check whether base types
25403 are at least as accessible than the current type.
25404 (TypeContainer.AsAccessible): Implemented and made non-static.
25405 (MemberBase.CheckParameters): Report errors if the accessibility
25408 * delegate.cs (Delegate.Delegate): The default visibility is
25409 internal for top-level types and private for nested types.
25410 (Delegate.Define): Report errors if the accessibility checks fail.
25412 * enum.cs (Enum.Enum): The default visibility is internal for
25413 top-level types and private for nested types.
25414 (Enum.DefineType): Compute the correct visibility.
25416 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
25417 function which takes a `bool is_toplevel' instead of a TypeContainer.
25419 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
25422 2002-08-02 Martin Baulig <martin@gnome.org>
25424 * expression.cs (LocalVariableReferenc): Added constructor which
25425 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
25426 (LocalVariableReference.IsReadOnly): New property.
25427 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
25428 variable is readonly, use our own readonly flag to do this; you can
25429 use the new constructor to get a writable reference to a read-only
25432 * cs-parser.jay (foreach_statement, using_statement): Get a writable
25433 reference to the local variable.
25435 2002-08-01 Miguel de Icaza <miguel@ximian.com>
25437 * rootcontext.cs (ResolveCore): Also include System.Exception
25439 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
25440 we reach an EmptyStatement.
25442 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
25445 * expression.cs (Binary.ResolveOperator): Check error result in
25448 use brtrue/brfalse directly and avoid compares to null.
25450 2002-08-02 Martin Baulig <martin@gnome.org>
25452 * class.cs (TypeContainer.Define): Define all nested interfaces here.
25453 Fixes bug #28407, added test-155.cs.
25455 2002-08-01 Martin Baulig <martin@gnome.org>
25457 * class.cs (Event.EmitDefaultMethod): Make this work with static
25458 events. Fixes #28311, added verify-3.cs.
25460 2002-08-01 Martin Baulig <martin@gnome.org>
25462 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
25463 `is_disposable' fields.
25464 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
25465 `hm.is_disposable' if we're using the collection pattern.
25466 (Foreach.EmitCollectionForeach): Use the correct type for the
25467 enumerator's local variable, only emit the try/finally block if
25468 necessary (fixes #27713).
25470 2002-08-01 Martin Baulig <martin@gnome.org>
25472 * ecore.cs (Expression.report118): Renamed to Error118 and made
25475 * statement.cs (Throw.Resolve): Check whether the expression is of
25476 the correct type (CS0118) and whether the type derives from
25477 System.Exception (CS0155).
25478 (Catch.Resolve): New method. Do the type lookup here and check
25479 whether it derives from System.Exception (CS0155).
25480 (Catch.CatchType, Catch.IsGeneral): New public properties.
25482 * typemanager.cs (TypeManager.exception_type): Added.
25484 2002-07-31 Miguel de Icaza <miguel@ximian.com>
25486 * driver.cs: Updated About function.
25488 2002-07-31 Martin Baulig <martin@gnome.org>
25490 Implemented Control Flow Analysis.
25492 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
25493 (EmitContext.CurrentBranching): Added.
25494 (EmitContext.StartFlowBranching): Added.
25495 (EmitContext.EndFlowBranching): Added.
25496 (EmitContext.KillFlowBranching): Added.
25497 (EmitContext.IsVariableAssigned): Added.
25498 (EmitContext.SetVariableAssigned): Added.
25499 (EmitContext.IsParameterAssigned): Added.
25500 (EmitContext.SetParameterAssigned): Added.
25501 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
25502 Added control flow analysis stuff here.
25504 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
25505 resolve the expression as lvalue.
25506 (LocalVariableReference.DoResolve): Check whether the variable has
25507 already been assigned.
25508 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
25509 the parameter as assigned here.
25510 (ParameterReference.DoResolve): Check whether the parameter has already
25512 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
25513 expression as lvalue.
25515 * statement.cs (FlowBranching): New class for the flow analysis code.
25516 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
25517 (LabeledStatement.IsDefined): New public property.
25518 (LabeledStatement.AddUsageVector): New public method to tell flow
25519 analyis that the label may be reached via a forward jump.
25520 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
25522 (VariableInfo.Number): New public field. This is used by flow analysis
25523 to number all locals of a block.
25524 (Block.CountVariables): New public property. This is the number of
25525 local variables in this block (including the locals from all parent
25527 (Block.EmitMeta): Number all the variables.
25529 * statement.cs: Added flow analysis support to all classes.
25531 2002-07-31 Martin Baulig <martin@gnome.org>
25533 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
25534 To get debugging messages, compile mcs with /define:MCS_DEBUG and
25535 then use this argument.
25537 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
25539 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
25540 use this to specify /define options.
25542 2002-07-29 Martin Baulig <martin@gnome.org>
25544 * statement.cs (Fixed): Moved all code that does variable lookups
25545 and resolvings from Emit to Resolve.
25547 * statement.cs (For): Moved all code that does variable lookups
25548 and resolvings from Emit to Resolve.
25550 * statement.cs (Using): Moved all code that does variable lookups
25551 and resolvings from Emit to Resolve.
25553 2002-07-29 Martin Baulig <martin@gnome.org>
25555 * attribute.cs (Attribute.Resolve): Explicitly catch a
25556 System.NullReferenceException when creating the
25557 CustromAttributeBuilder and report a different warning message.
25559 2002-07-29 Martin Baulig <martin@gnome.org>
25561 * support.cs (ParameterData.ParameterName): Added method to
25562 get the name of a parameter.
25564 * typemanager.cs (TypeManager.IsValueType): New public method.
25566 2002-07-29 Martin Baulig <martin@gnome.org>
25568 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
25569 is a flag which specifies that it's either ref or out.
25570 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
25571 the out parameter to `out Parameter.Modifier mod', also set the
25572 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
25574 * support.cs (InternalParameters.ParameterModifier): Distinguish
25575 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25576 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25578 * expression.cs (Argument.GetParameterModifier): Distinguish
25579 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25580 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25582 2002-07-29 Martin Baulig <martin@gnome.org>
25584 * expression.cs (ParameterReference.ParameterReference): Added
25585 `Location loc' argument to the constructor.
25587 * cs-parser.jay: Pass location to ParameterReference.
25589 2002-07-28 Miguel de Icaza <miguel@ximian.com>
25591 * statement.cs (Try): Initialize the location.
25593 * cs-parser.jay: pass location to Try.
25595 * expression.cs (Unary.Reduce): Change the prototype to return
25596 whether a constant fold could be performed or not. The result is
25597 returned in an out parameters. In the case of Indirection and
25598 AddressOf, we want to perform the full tests.
25600 2002-07-26 Miguel de Icaza <miguel@ximian.com>
25602 * statement.cs (Statement.Emit): Flag dead code.
25604 2002-07-27 Andrew Birkett <andy@nobugs.org>
25606 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
25608 2002-07-27 Martin Baulig <martin@gnome.org>
25610 * class.cs (MethodData.Define): Put back call to
25611 TypeManager.AddMethod(), accidentally commented this out.
25613 * report.cs (Debug): New public method to print debugging information,
25614 this is `[Conditional ("DEBUG")]'.
25616 2002-07-26 Martin Baulig <martin@gnome.org>
25618 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
25619 (switch_statement): Push the current_block to the switch_stack and
25620 pop it again when we're done with the switch.
25621 (switch_section): The new block is a child of the current_block.
25622 Fixes bug #24007, added test-152.cs.
25624 2002-07-27 Martin Baulig <martin@gnome.org>
25626 * expression.cs (Invocation.EmitArguments): When calling a varargs
25627 function with only its fixed arguments, we need to pass an empty
25630 2002-07-27 Martin Baulig <martin@gnome.org>
25632 Mono 0.13 has been released.
25634 2002-07-25 Miguel de Icaza <miguel@ximian.com>
25636 * driver.cs: Rename --resource to --linkres, because that is what
25637 we do currently, we dont support --resource yet.
25639 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
25641 2002-07-25 Martin Baulig <martin@gnome.org>
25643 * class.cs (MethodData): New public class. This is a `method builder'
25644 class for a method or one accessor of a Property/Indexer/Event.
25645 (MethodData.GetMethodFlags): Moved here from MemberBase.
25646 (MethodData.ApplyAttributes): Likewise.
25647 (MethodData.ApplyObsoleteAttribute): Likewise.
25648 (MethodData.ApplyConditionalAttribute): Likewise.
25649 (MethodData.ApplyDllImportAttribute): Likewise.
25650 (MethodData.CheckAbstractAndExternal): Likewise.
25651 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
25652 (MethodData.Emit): Formerly known as Method.Emit().
25653 (MemberBase): Moved everything which was specific to a single
25654 accessor/method to MethodData.
25655 (Method): Create a new MethodData and call Define() and Emit() on it.
25656 (Property, Indexer, Event): Create a new MethodData objects for each
25657 accessor and call Define() and Emit() on them.
25659 2002-07-25 Martin Baulig <martin@gnome.org>
25661 Made MethodCore derive from MemberBase to reuse the code from there.
25662 MemberBase now also checks for attributes.
25664 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
25665 (MemberBase.GetMethodFlags): Moved here from class Method and marked
25667 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
25668 `CallingConventions cc' and `Attributes opt_attrs' arguments.
25669 (MemberBase.ApplyAttributes): New virtual method; applies the
25670 attributes to a method or accessor.
25671 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
25672 (MemberBase.ApplyConditionalAttribute): Likewise.
25673 (MemberBase.ApplyDllImportAttribute): Likewise.
25674 (MemberBase.CheckAbstractAndExternal): Likewise.
25675 (MethodCore.ParameterTypes): This is now a property instead of a
25676 method, it's initialized from DoDefineParameters().
25677 (MethodCore.ParameterInfo): Removed the set accessor.
25678 (MethodCore.DoDefineParameters): New protected virtual method to
25679 initialize ParameterTypes and ParameterInfo.
25680 (Method.GetReturnType): We can now simply return the MemberType.
25681 (Method.GetMethodFlags): Override the MemberBase version and add
25682 the conditional flags.
25683 (Method.CheckBase): Moved some code from Define() here, call
25684 DoDefineParameters() here.
25685 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
25686 here to avoid some larger code duplication.
25687 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
25688 ensure that abstract and external accessors don't declare a body.
25690 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
25691 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
25692 lookup in the attribute's parent classes, so we need to abort as soon
25693 as we found the first match.
25694 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
25695 the attribute has no arguments.
25697 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
25700 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25702 * cs-parser.jay: reverted previous patch.
25704 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25706 * cs-parser.jay: fixed bug #22119.
25708 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25710 * attribute.cs: fixed compilation. The error was:
25711 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
25712 be assigned to before control leaves the current method."
25713 [FIXME: Filed as bug #28186: MCS must report this error.]
25715 2002-07-25 Martin Baulig <martin@gnome.org>
25717 * attribute.cs (Attribute.Conditional_GetConditionName): New static
25718 method to pull the condition name ouf of a Conditional attribute.
25719 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
25720 the obsolete message and error flag out of an Obsolete attribute.
25722 * class.cs (Method.GetMethodFlags): New public method to get the
25723 TypeManager.MethodFlags for this method.
25724 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
25726 (Method.Define): Get and apply the Obsolete and Conditional attributes;
25727 if we're overriding a virtual function, set the new private variable
25728 `parent_method'; call the new TypeManager.AddMethod().
25730 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
25731 the MethodBuilder and the Method in a PtrHashtable.
25732 (TypeManager.builder_to_method): Added for this purpose.
25733 (TypeManager.MethodFlags): Added IsObsoleteError.
25734 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
25735 Obsolete and Conditional arguments in MethodBuilders. If we discover
25736 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
25737 the message from the attribute.
25739 2002-07-24 Martin Baulig <martin@gnome.org>
25741 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
25742 preprocessor directives, ensure that the argument to #define/#undef is
25743 exactly one identifier and that it's actually an identifier.
25745 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
25748 2002-07-24 Martin Baulig <martin@gnome.org>
25750 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
25751 initialize it to TypeManager.object_type in the constructor.
25752 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
25753 of the `hm.get_current' method if we're using the collection pattern.
25754 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
25755 for the explicit conversion to make it work when we're using the collection
25756 pattern and the `Current' property has a different return type than `object'.
25759 2002-07-24 Martin Baulig <martin@gnome.org>
25761 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
25762 does not match, but don't report any errors. This method is called in
25763 order for all methods in a MethodGroupExpr until a matching method is
25764 found, so we don't want to bail out if the first method doesn't match.
25765 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
25766 matches, report the 123. Fixes #28070.
25768 2002-07-24 Martin Baulig <martin@gnome.org>
25770 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
25771 TypeManager.TypeToCoreType() to the top of the method so the
25772 following equality checks will work. Fixes #28107.
25774 2002-07-24 Martin Baulig <martin@gnome.org>
25776 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
25777 operand is of type uint, and the other operand is of type sbyte,
25778 short or int, the operands are converted to type long." -
25779 Actually do what this comment already told us. Fixes bug #28106,
25782 2002-07-24 Martin Baulig <martin@gnome.org>
25784 * class.cs (MethodBase): New abstract class. This is now a base
25785 class for Property, Indexer and Event to avoid some code duplication
25786 in their Define() and DefineMethods() methods.
25787 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
25788 generic methods for Define() and DefineMethods().
25789 (FieldBase): Derive from MemberBase, not MemberCore.
25790 (Property): Derive from MemberBase, not MemberCore.
25791 (Property.DefineMethod): Moved all the code from this method to the
25792 new MethodBase.DefineAccessor(), just call it with appropriate
25794 (Property.Define): Call the new Property.DoDefine(), this does some
25795 sanity checks and we don't need to duplicate the code everywhere.
25796 (Event): Derive from MemberBase, not MemberCore.
25797 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
25798 accessors, this will also make them work with interface events.
25799 (Indexer): Derive from MemberBase, not MemberCore.
25800 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
25801 (Indexer.Define): Use the new MethodBase functions.
25803 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
25804 argument to the constructor.
25805 (Interface.FindMembers): Added support for interface events.
25806 (Interface.PopluateEvent): Implemented.
25808 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
25810 2002-07-22 Miguel de Icaza <miguel@ximian.com>
25812 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
25813 but this is required to check for a method name being the same as
25814 the containing class.
25818 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25820 * interface.cs: initialize variable.
25822 2002-07-23 Martin Baulig <martin@gnome.org>
25824 Implemented the IndexerName attribute in interfaces.
25826 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
25827 name if this is an explicit interface implementation.
25828 (Indexer.InterfaceIndexerName): New public variable. If we're
25829 implementing an interface indexer, this is the IndexerName in that
25830 interface. Otherwise, it's the IndexerName.
25831 (Indexer.DefineMethod): If we're implementing interface indexer,
25832 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
25833 and Pending.ImplementIndexer methods.
25834 (Indexer.Define): Also define the PropertyBuilder if we're
25835 implementing an interface indexer and this is neither an explicit
25836 interface implementation nor do the IndexerName match the one in
25839 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
25840 If a method is defined here, then we always need to create a proxy
25841 for it. This is used when implementing interface indexers.
25842 (Pending.IsInterfaceIndexer): New public method.
25843 (Pending.ImplementIndexer): New public method.
25844 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
25845 This is used when implementing interface indexers to define a proxy
25847 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
25848 define a proxy if necessary.
25850 * interface.cs (Interface.IndexerName): New public variable.
25851 (Interface.PopulateIndexer): Set the IndexerName.
25852 (Interface.DefineIndexers): New private method. Populate all the
25853 indexers and make sure their IndexerNames match.
25855 * typemanager.cs (IndexerPropertyName): Added support for interface
25858 2002-07-22 Martin Baulig <martin@gnome.org>
25860 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
25861 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
25862 ret if HasReturnLabel.
25863 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
25866 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
25867 and set the ec.LoopBeginTryCatchLevel.
25868 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
25869 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
25870 the current ec.TryCatchLevel, the branch goes out of an exception
25871 block. In this case, we need to use Leave and not Br.
25873 2002-07-22 Martin Baulig <martin@gnome.org>
25875 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
25876 block unless the block does not always return or it is contained in
25877 another try { ... } catch { ... } block. Fixes bug #26506.
25878 Added verify-1.cs to the test suite.
25880 2002-07-22 Martin Baulig <martin@gnome.org>
25882 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
25883 then we do not always return. Fixes bug #24985.
25885 2002-07-22 Martin Baulig <martin@gnome.org>
25887 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
25888 lookup on a per-class level; ie. walk up the class hierarchy until we
25889 found at least one applicable method, then choose the best among them.
25890 Fixes bug #24463 and test-29.cs.
25892 2002-07-22 Martin Baulig <martin@gnome.org>
25894 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
25895 return types of the methods. The return type is not part of the
25896 signature and we must not check it to make the `new' modifier work.
25897 Fixes bug #27999, also added test-147.cs.
25898 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
25900 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
25901 on the method's return type.
25903 2002-07-21 Martin Baulig <martin@gnome.org>
25905 * assign.cs: Make this work if the rightmost source is a constant and
25906 we need to do an implicit type conversion. Also adding a few more tests
25907 to test-38.cs which should have caught this.
25909 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
25910 target in the makefile for this. The makefile.gnu is primarily intended
25911 for end-users who don't want to debug the compiler.
25913 2002-07-21 Martin Baulig <martin@gnome.org>
25915 * assign.cs: Improved the Assign class so it can now handle embedded
25916 assignments (X = Y = Z = something). As a side-effect this'll now also
25917 consume less local variables. test-38.cs now passes with MCS, added
25918 a few new test cases to that test.
25920 2002-07-20 Martin Baulig <martin@gnome.org>
25922 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
25923 instructions. Fixes bug #27977, also added test-146.cs.
25925 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25927 * cs-tokenizer.cs: fixed getHex ().
25929 2002-07-19 Martin Baulig <martin@gnome.org>
25931 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
25932 not Type.GetType() to lookup the array type. This is needed when
25933 we're constructing an array of a user-defined type.
25934 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
25935 single-dimensional arrays, but also for single-dimensial arrays of
25938 2002-07-19 Martin Baulig <martin@gnome.org>
25940 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
25941 this function is called, it's not allowed to share LocalBuilders
25942 among ILGenerators.
25944 2002-07-19 Martin Baulig <martin@gnome.org>
25946 * expression.cs (Argument.Resolve): Report an error 118 when trying
25947 to pass a type as argument.
25949 2002-07-18 Martin Baulig <martin@gnome.org>
25951 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
25952 Conv_R_Un for the signed `long' type.
25954 2002-07-15 Miguel de Icaza <miguel@ximian.com>
25956 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
25957 `expr' for the temporary result, as that will fail if we do
25958 multiple resolves on the same expression.
25960 2002-07-05 Miguel de Icaza <miguel@ximian.com>
25962 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
25963 ec.TypeContainer for looking up aliases.
25965 * class.cs (TypeContainer): Remove LookupAlias from here.
25967 * decl.cs (DeclSpace); Move here.
25969 2002-07-01 Miguel de Icaza <miguel@ximian.com>
25971 * class.cs (FindMembers): Only call filter if the constructor
25972 bulider is not null.
25974 Also handle delegates in `NestedTypes' now. Now we will perform
25975 type lookups using the standard resolution process. This also
25978 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
25979 This uses Expressions (the limited kind that can be parsed by the
25980 tree) instead of strings.
25982 * expression.cs (ComposedCast.ToString): Implement, used to flag
25983 errors since now we have to render expressions.
25985 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
25988 * ecore.cs (SimpleName.ToString): ditto.
25990 * cs-parser.jay: Instead of using strings to assemble types, use
25991 Expressions to assemble the type (using SimpleName, ComposedCast,
25992 MemberAccess). This should fix the type lookups in declarations,
25993 because we were using a different code path for this.
25995 * statement.cs (Block.Resolve): Continue processing statements
25996 even when there is an error.
25998 2002-07-17 Miguel de Icaza <miguel@ximian.com>
26000 * class.cs (Event.Define): Also remove the `remove' method from
26001 the list of pending items.
26003 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
26004 generate more compact code.
26006 2002-07-17 Martin Baulig <martin@gnome.org>
26008 * const.cs (Const.LookupConstantValue): Add support for constant
26009 `unchecked' and `checked' expressions.
26010 Also adding test case test-140.cs for this.
26012 2002-07-17 Martin Baulig <martin@gnome.org>
26014 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
26015 check whether mi.ReturnType implements the IEnumerator interface; the
26016 `==' and the IsAssignableFrom() will fail in this situation.
26018 2002-07-16 Ravi Pratap <ravi@ximian.com>
26020 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
26023 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26025 * expression.cs: fixed bug #27811.
26027 2002-07-14 Miguel de Icaza <miguel@ximian.com>
26029 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
26030 Molaro: when we are a ref, the value already contains a pointer
26031 value, do not take the address of it.
26033 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26034 * removed mb-parser.jay and mb-tokenizer.cs
26036 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26038 * expression.cs: check against the building corlib void type.
26040 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
26042 * ecore.cs: fix for valuetype static readonly fields: when
26043 initializing them, we need their address, not the address of a copy.
26045 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26047 * typemanager.cs: register also enum_type in corlib.
26049 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26051 * class.cs: allow calling this (but not base) initializers in structs.
26053 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
26055 * ecore.cs: make sure we compare against the building base types
26058 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26060 * typemanager.cs: fix TypeToCoreType() to handle void and object
26061 (corlib gets no more typerefs after this change).
26063 2002-07-12 Miguel de Icaza <miguel@ximian.com>
26065 * expression.cs (ArrayCreation.EmitArrayArguments): use
26066 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
26068 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
26069 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
26070 array indexes, the runtime actually forbids them.
26072 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
26073 for array arguments here.
26075 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
26076 instead of the default for ValueTypes.
26078 (New.DoEmit): Use IsValueType instead of
26079 IsSubclassOf (value_type)
26080 (New.DoResolve): ditto.
26081 (Invocation.EmitCall): ditto.
26083 * assign.cs (Assign): ditto.
26085 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
26086 Statements *are* currently doing part of their resolution during
26089 Expressions do always resolve during resolve, but statements are
26090 only required to propagate resolution to their children.
26092 2002-07-11 Miguel de Icaza <miguel@ximian.com>
26094 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
26096 (LoadAssembly): Do not add the dll if it is already specified
26098 (MainDriver): Add the System directory to the link path at the end,
26099 after all the other -L arguments.
26101 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
26102 wrong opcode for loading bytes and bools (ldelem.i1 instead of
26103 ldelem.u1) and using the opposite for sbytes.
26105 This fixes Digger, and we can finally run it.
26107 * driver.cs (UnixParseOption): Move the option parsing here.
26108 (CSCParseOption): Implement CSC-like parsing of options.
26110 We now support both modes of operation, the old Unix way, and the
26111 new CSC-like way. This should help those who wanted to make cross
26112 platform makefiles.
26114 The only thing broken is that /r:, /reference: and /lib: are not
26115 implemented, because I want to make those have the same semantics
26116 as the CSC compiler has, and kill once and for all the confussion
26117 around this. Will be doing this tomorrow.
26119 * statement.cs (Unsafe.Resolve): The state is checked during
26120 resolve, not emit, so we have to set the flags for IsUnsfe here.
26122 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26124 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
26125 not catch the Error_ObjectRefRequired in SimpleName (as it is
26126 possible to have a class/instance variable name that later gets
26127 deambiguated), we have to check this here.
26129 2002-07-10 Ravi Pratap <ravi@ximian.com>
26131 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
26132 make static and put into Expression.
26134 (Event.Define): Register the private field of the event with the
26135 TypeManager so that GetFieldFromEvent can get at it.
26137 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
26138 keep track of the private field associated with an event which
26141 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
26144 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
26146 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26148 * expression.cs (Binary.EmitBranchable): this routine emits the
26149 Binary expression in a branchable context. This basically means:
26150 we need to branch somewhere, not just get the value on the stack.
26152 This works together with Statement.EmitBoolExpression.
26154 * statement.cs (Statement.EmitBoolExpression): Use
26157 2002-07-09 Miguel de Icaza <miguel@ximian.com>
26159 * statement.cs (For): Reduce the number of jumps in loops.
26161 (For): Implement loop inversion for the For statement.
26163 (Break): We can be breaking out of a Try/Catch controlled section
26164 (foreach might have an implicit try/catch clause), so we need to
26165 use Leave instead of Br.
26167 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
26168 now). If the instace expression supports IMemoryLocation, we use
26169 the AddressOf method from the IMemoryLocation to extract the
26170 address instead of emitting the instance.
26172 This showed up with `This', as we were emitting the instance
26173 always (Emit) instead of the Address of This. Particularly
26174 interesting when This is a value type, as we dont want the Emit
26175 effect (which was to load the object).
26177 2002-07-08 Miguel de Icaza <miguel@ximian.com>
26179 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
26181 * statement.cs (Checked): Set the CheckedState during the resolve
26182 process too, as the ConvCast operations track the checked state on
26183 the resolve process, and not emit.
26185 * cs-parser.jay (namespace_member_declaration): Flag that we have
26186 found a declaration when we do. This is used to flag error 1529
26188 * driver.cs: Report ok when we display the help only.
26190 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
26192 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
26194 2002-07-04 Miguel de Icaza <miguel@ximian.com>
26196 * cs-tokenizer.cs (define): We also have to track locally the
26197 defines. AllDefines is just used for the Conditional Attribute,
26198 but we also need the local defines for the current source code.
26200 2002-07-03 Miguel de Icaza <miguel@ximian.com>
26202 * statement.cs (While, For, Do): These loops can exit through a
26203 Break statement, use this information to tell whether the
26204 statement is the last piece of code.
26206 (Break): Flag that we break.
26208 * codegen.cs (EmitContexts): New `Breaks' state variable.
26210 2002-07-03 Martin Baulig <martin@gnome.org>
26212 * class.cs (TypeContainer.MethodModifiersValid): Allow override
26213 modifiers in method declarations in structs. Otherwise, you won't
26214 be able to override things like Object.Equals().
26216 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26218 * class.cs (Method, Property, Indexer): Do not allow the public
26219 modifier to be used in explicit interface implementations.
26221 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
26222 override modifiers in method declarations in structs
26224 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
26226 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
26227 integer or real overflow, report an error
26229 2002-07-02 Martin Baulig <martin@gnome.org>
26231 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
26232 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
26233 to tell the runtime about our newly created System.Object and
26234 System.ValueType types.
26236 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26238 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
26239 struct instead of Ldarg/Starg.
26241 2002-07-02 Martin Baulig <martin@gnome.org>
26243 * expression.cs (Indirection.Indirection): Call
26244 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
26246 2002-07-02 Martin Baulig <martin@gnome.org>
26248 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
26249 ValueType, call TypeManager.TypeToCoreType() on it.
26250 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
26251 the OpCodes.Newarr argument.
26253 2002-07-02 Martin Baulig <martin@gnome.org>
26255 * expression.cs (Invocation.EmitCall): When compiling corlib,
26256 replace all calls to the system's System.Array type to calls to
26257 the newly created one.
26259 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
26260 System.Array methods.
26261 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
26262 from the system's System.Array type which must be replaced.
26264 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
26266 * typemanager.cs: load unverifiable_code_ctor so we can build
26267 corlib using the correct type. Avoid using GetTypeCode() with
26269 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
26270 TypeManager.object_type to allow building corlib.
26272 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26274 * ecore.cs: handle System.Enum separately in LoadFromPtr().
26276 2002-07-01 Martin Baulig <martin@gnome.org>
26278 * class.cs: Make the last change actually work, we need to check
26279 whether `ifaces != null' to avoid a crash.
26281 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26283 * class.cs: when we build structs without fields that implement
26284 interfaces, we need to add the interfaces separately, since there is
26285 no API to both set the size and add the interfaces at type creation
26288 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26290 * expression.cs: the dimension arguments to the array constructors
26291 need to be converted if they are a long.
26293 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
26295 * class.cs: don't emit ldarg.0 if there is no parent constructor
26296 (fixes showstopper for corlib).
26298 2002-06-29 Martin Baulig <martin@gnome.org>
26300 MCS now compiles corlib on GNU/Linux :-)
26302 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
26303 ie. check for MethodImplOptions.InternalCall.
26305 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
26306 and TypeManager.attribute_type are null, so we must explicitly check
26307 whether parent is not null to find out whether it's an attribute type.
26308 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
26309 and SetBuilder, not only if the property is neither abstract nor external.
26310 This is necessary to set the MethodImplOptions on the accessor methods.
26311 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
26312 SetBuilder, see Property.Emit().
26314 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
26315 populate "System.Object", "System.ValueType" and "System.Attribute" since
26316 they've already been populated from BootCorlib_PopulateCoreTypes().
26318 2002-06-29 Martin Baulig <martin@gnome.org>
26320 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
26321 is the NullLiteral, we also need to make sure that target_type is not
26324 2002-06-29 Martin Baulig <martin@gnome.org>
26326 * rootcontext.cs (RootContext.ResolveCore): We must initialize
26327 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
26328 before calling BootstrapCorlib_ResolveDelegate ().
26330 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26332 * statement.cs: fixed build-breaker. All tests passed ok.
26334 2002-06-27 Martin Baulig <martin@gnome.org>
26336 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
26337 for System.Decimal when compiling corlib.
26339 2002-06-27 Martin Baulig <martin@gnome.org>
26341 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
26342 switch blocks which contain nothing but a default clause.
26344 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
26346 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
26348 2002-06-27 Martin Baulig <martin@gnome.org>
26350 * ecore.cs (PropertyExpr.PropertyExpr): Call
26351 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
26353 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
26354 is already a TypeBuilder.
26356 2002-06-27 Martin Baulig <martin@gnome.org>
26358 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
26359 `target_type == TypeManager.array_type', not IsAssignableFrom() in
26360 the "from an array-type to System.Array" case. This makes it work
26361 when compiling corlib.
26363 2002-06-27 Martin Baulig <martin@gnome.org>
26365 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
26366 non-static PropertyExpr, set its InstanceExpression. This makes
26367 the `ICollection.Count' property work in System/Array.cs.
26369 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
26371 * driver.cs: Made error handling more consistent. Errors now
26372 tracked by Report class, so many methods which used to return int
26373 now return void. Main() now prints success/failure and
26374 errors/warnings message.
26376 Renamed '--probe' compiler argument to '--expect-error'. Removed
26377 the magic number return values (123 and 124). Now, if the
26378 expected error occurs, the compiler exits with success (exit value
26379 0). If the compilation completes without seeing that particular
26380 error, the compiler exits with failure (exit value 1). The
26381 makefile in mcs/errors has been changed to handle the new behaviour.
26383 * report.cs: Made 'expected error' number a property and renamed
26384 it from 'Probe' to 'ExpectedError'.
26386 * genericparser.cs: Removed error handling support, since it is
26387 now all done by Report class.
26389 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
26390 class, so parse() no longer returns an int.
26392 * namespace.cs: Use Report.Error instead of GenericParser.error
26394 2002-06-22 Miguel de Icaza <miguel@ximian.com>
26396 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
26397 TypeContainer.AddOperator): At the front of the list put the
26398 explicit implementations, so they get resolved/defined first.
26400 2002-06-21 Miguel de Icaza <miguel@ximian.com>
26402 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
26403 interface type is implemented by this TypeContainer. Used during
26404 explicit interface implementation.
26406 (Property.Define, Indexer.Define, Method.Define): Validate that
26407 the given interface in the explicit implementation is one of the
26408 base classes for the containing type.
26410 Also if we are explicitly implementing an interface, but there is
26411 no match in the pending implementation table, report an error.
26413 (Property.Define): Only define the property if we are
26414 not explicitly implementing a property from an interface. Use the
26415 correct name also for those properties (the same CSC uses,
26416 although that is really not needed).
26418 (Property.Emit): Do not emit attributes for explicitly implemented
26419 properties, as there is no TypeBuilder.
26421 (Indexer.Emit): ditto.
26423 Hiding then means that we do not really *implement* a pending
26424 implementation, which makes code fail.
26426 2002-06-22 Martin Baulig <martin@gnome.org>
26428 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
26429 the return value of Object.GetType(). [FIXME: we need to do this whenever
26430 we get a type back from the reflection library].
26432 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26434 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
26436 2002-06-20 Miguel de Icaza <miguel@ximian.com>
26438 * attribute.cs: Return null if we can not look up the type.
26440 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
26441 the interface types found.
26443 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
26444 interface types found.
26446 * typemanager.cs (GetInterfaces): Make this routine returns alll
26447 the interfaces and work around the lame differences between
26448 System.Type and System.Reflection.Emit.TypeBuilder in the results
26449 result for GetInterfaces.
26451 (ExpandInterfaces): Given an array of interface types, expand and
26452 eliminate repeated ocurrences of an interface. This expands in
26453 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
26456 2002-06-21 Martin Baulig <martin@gnome.org>
26458 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
26461 2002-06-21 Martin Baulig <martin@gnome.org>
26463 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
26464 and called with one of the core types, return the corresponding typebuilder for
26467 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
26470 2002-06-21 Martin Baulig <martin@gnome.org>
26472 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
26473 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
26474 (Expression.ConvertReferenceExplicit): Likewise.
26476 * expression.cs (ElementAccess.DoResolve): Likewise.
26477 (ElementAccess.DoResolveLValue): Likewise.
26479 2002-06-10 Martin Baulig <martin@gnome.org>
26481 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
26482 add the "value" parameter to the parameter list.
26484 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
26487 2002-06-19 Miguel de Icaza <miguel@ximian.com>
26489 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
26490 the argument to an int, uint, long or ulong, per the spec. Also
26491 catch negative constants in array creation.
26493 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
26495 * class.cs: do not allow the same interface to appear twice in
26496 the definition list.
26498 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26500 * ecore.cs: don't use ldlen with System.Array.
26502 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26504 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
26506 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
26508 * modifiers.cs: produce correct field attributes for protected
26509 internal. Easy fix so miguel can work on ther harder stuff:-)
26511 2002-06-18 Miguel de Icaza <miguel@ximian.com>
26513 * pending.cs: New file. Move the code from class.cs here.
26514 Support clearning the pending flag for all methods (when not doing
26515 explicit interface implementation).
26517 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26519 * rootcontext.cs: added a couple more types needed to bootstrap.
26521 2002-06-17 Miguel de Icaza <miguel@ximian.com>
26523 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
26524 constructor in the type, instead of any constructor in the type
26525 hierarchy. Thanks to Paolo for finding this bug (it showed up as
26526 a bug in the Mono runtime when applying the params attribute).
26528 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26529 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
26531 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
26533 * expression.cs (Unary.ResolveOperator): Use TypeManager
26534 to resolve the type.
26536 2002-06-13 Ravi Pratap <ravi@ximian.com>
26538 * cs-parser.jay (enum_member_declaration): Pass in the attributes
26541 * enum.cs (AddEnumMember): Add support to store the attributes associated
26542 with each member too.
26544 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
26545 field builders too - this takes care of the enum member case.
26547 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
26549 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
26550 address-of operator on both value types and pointers.
26552 2002-06-10 Martin Baulig <martin@gnome.org>
26554 * interface.cs (Interface.PopulateIndexer): Add the indexer's
26555 PropertyBuilder to the `property_builders' list.
26557 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
26558 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
26559 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
26560 find any indexers which are inherited from an interface.
26562 2002-06-09 Martin Baulig <martin@gnome.org>
26564 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
26565 the same type as the constant if necessary. There's also a test-130.cs
26568 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
26570 * typemanager.cs (TypeManager.ChangeType): Previously known as
26571 Enum.ChangeEnumType().
26573 2002-06-09 Martin Baulig <martin@gnome.org>
26575 * expression.cs (Cast.TryReduce): Added support for consts.
26577 2002-06-08 Ravi Pratap <ravi@ximian.com>
26579 * class.cs (Accessor): Hold attributes information so we can pass
26582 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
26583 Modify to pass in attributes attached to the methods.
26585 (add_accessor_declaration, remove_accessor_declaration): Ditto.
26587 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
26588 to handle the Accessor kind :-)
26590 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
26592 2002-06-08 Martin Baulig <martin@gnome.org>
26594 * expression.cs (Unary.TryReduceNegative): Added support for
26597 2002-06-08 Martin Baulig <martin@gnome.org>
26599 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
26600 name can't be found in the `defined_names' - the caller will do a
26601 MemberLookup in this case and thus find methods in System.Enum
26602 such as Enum.IsDefined().
26604 2002-06-08 Martin Baulig <martin@gnome.org>
26606 * enum.cs (Enum.ChangeEnumType): This is a custom version of
26607 Convert.ChangeType() which works with TypeBuilder created types.
26608 (Enum.LookupEnumValue, Enum.Define): Use it here.
26610 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
26611 `TypeBuilder.BaseType != null' check.
26612 (TypeContainer.FindMembers): Only lookup parent members if we
26613 actually have a parent.
26614 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
26615 (ConstructorInitializer.Resolve): Likewise.
26617 * interface.cs (Interface.FindMembers): Added
26618 `TypeBuilder.BaseType != null' check.
26620 * rootcontext.cs (RootContext.ResolveCore): Added
26621 "System.Runtime.CompilerServices.IndexerNameAttribute" to
26622 classes_second_stage.
26624 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
26625 debug_type and trace_type when compiling with --nostdlib.
26627 2002-06-07 Martin Baulig <martin@gnome.org>
26629 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
26630 (AddField): Set it to true when adding a non-static field.
26631 (DefineType): Use `have_nonstatic_fields' to find out whether we
26632 have non-static fields, not `Fields != null'.
26634 2002-06-02 Miguel de Icaza <miguel@ximian.com>
26636 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
26637 dereferencing a null on the static-field code path)
26639 2002-05-30 Martin Baulig <martin@gnome.org>
26641 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
26642 to take command line arguments. Use reflection to call the new
26643 custom `Initialize' function on the symbol writer and pass it the
26644 command line arguments.
26646 * driver.cs (--debug-args): New command line argument to pass command
26647 line arguments to the symbol writer.
26649 2002-05-28 Miguel de Icaza <miguel@ximian.com>
26651 * assign.cs (DoResolve): Forgot to do the implicit conversion to
26652 the target type for indexers and properties. Thanks to Joe for
26655 2002-05-27 Miguel de Icaza <miguel@ximian.com>
26657 * typemanager.cs (MethodFlags): returns the method flags
26658 (Obsolete/ShouldIgnore) that control warning emission and whether
26659 the invocation should be made, or ignored.
26661 * expression.cs (Invocation.Emit): Remove previous hack, we should
26662 not do this on matching a base type, we should do this based on an attribute
26664 Only emit calls to System.Diagnostics.Debug and
26665 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
26666 on the command line.
26668 * rootcontext.cs: Global settings for tracing and debugging.
26670 * cs-tokenizer.cs (define): New utility function to track
26671 defines. Set the global settings for TRACE and DEBUG if found.
26673 2002-05-25 Ravi Pratap <ravi@ximian.com>
26675 * interface.cs (Populate*): Pass in the TypeContainer as well as
26676 the DeclSpace as parameters so that we can create EmitContexts and
26677 then use that to apply attributes etc.
26679 (PopulateMethod, PopulateEvent, PopulateProperty)
26680 (PopulateIndexer): Apply attributes everywhere.
26682 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
26685 (ApplyAttributes): Update accordingly.
26687 We now apply interface attributes for all members too.
26689 2002-05-26 Miguel de Icaza <miguel@ximian.com>
26691 * class.cs (Indexer.Define); Correctly check if we are explicit
26692 implementation (instead of checking the Name for a ".", we
26693 directly look up if the InterfaceType was specified).
26695 Delay the creation of the PropertyBuilder.
26697 Only create the PropertyBuilder if we are not an explicit
26698 interface implementation. This means that explicit interface
26699 implementation members do not participate in regular function
26700 lookups, and hence fixes another major ambiguity problem in
26701 overload resolution (that was the visible effect).
26703 (DefineMethod): Return whether we are doing an interface
26706 * typemanager.cs: Temporary hack until we get attributes in
26707 interfaces (Ravi is working on that) and we get IndexerName
26708 support in interfaces.
26710 * interface.cs: Register the indexers as properties.
26712 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
26713 warning, I have verified that this is a bug in the .NET runtime
26714 (JavaScript suffers of the same problem).
26716 * typemanager.cs (MemberLookup): When looking up members for
26717 interfaces, the parent of an interface is the implicit
26718 System.Object (so we succeed in searches of Object methods in an
26719 interface method invocation. Example: IEnumerable x; x.ToString
26722 2002-05-25 Miguel de Icaza <miguel@ximian.com>
26724 * class.cs (Event): Events should also register if they do
26725 implement the methods that an interface requires.
26727 * typemanager.cs (MemberLookup); use the new GetInterfaces
26730 (GetInterfaces): The code used to lookup interfaces for a type is
26731 used in more than one place, factor it here.
26733 * driver.cs: Track the errors at the bottom of the file, we kept
26736 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
26737 instance if the method we are calling is static!
26739 2002-05-24 Miguel de Icaza <miguel@ximian.com>
26741 * attribute.cs (ApplyAttributes): Make this function filter out
26742 the IndexerName attribute (as that attribute in reality is never
26743 applied) and return the string constant for the IndexerName
26746 * class.cs (TypeContainer.Emit): Validate that all the indexers
26747 have the same IndexerName attribute, and if so, set the
26748 DefaultName attribute on the class.
26750 * typemanager.cs: The return value might contain other stuff (not
26751 only methods). For instance, consider a method with an "Item"
26752 property and an Item method.
26754 * class.cs: If there is a problem with the parameter types,
26757 2002-05-24 Ravi Pratap <ravi@ximian.com>
26759 * ecore.cs (ImplicitConversionExists): Wrapper function which also
26760 looks at user defined conversion after making a call to
26761 StandardConversionExists - we need this for overload resolution.
26763 * expression.cs : Update accordingly the various method calls.
26765 This fixes 2 bugs filed against implicit user defined conversions
26767 2002-05-22 Miguel de Icaza <miguel@ximian.com>
26769 * statement.cs: Track the result of the assignment.
26771 2002-05-21 Miguel de Icaza <miguel@ximian.com>
26773 * expression.cs (MemberAccess): Improved error reporting for
26774 inaccessible members.
26776 2002-05-22 Martin Baulig <martin@gnome.org>
26778 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
26779 itself with debugging support.
26781 2002-05-22 Martin Baulig <martin@gnome.org>
26783 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
26784 Removed, this isn't needed anymore.
26786 2002-05-20 Martin Baulig <martin@gnome.org>
26788 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
26789 be underlying type for an enum.
26791 2002-05-20 Miguel de Icaza <miguel@ximian.com>
26793 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
26794 that splits out the loading of just the core types.
26796 * rootcontext.cs (ResolveCore): Split the struct resolution in
26797 two, so we can load the enumeration underlying types before any
26800 * expression.cs (Is): Bandaid until we fix properly Switch (see
26801 bug #24985 for details).
26803 * typemanager.cs (ImplementsInterface): The hashtable will contain
26804 a null if there are no interfaces implemented.
26806 2002-05-18 Miguel de Icaza <miguel@ximian.com>
26808 * cs-parser.jay (indexer_declarator): It is fine to have array
26811 2002-05-17 Miguel de Icaza <miguel@ximian.com>
26813 * typemanager.cs: (RegisterBuilder): New function used to register
26814 TypeBuilders that implement interfaces. Since
26815 TypeBuilder.GetInterfaces (as usual) does not work with lame
26817 (AddUserType): register interfaces.
26819 (ImplementsInterface): Use the builder_to_ifaces hash if we are
26820 dealing with TypeBuilder. Also, arrays are showing up as
26821 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
26822 methods can not be invoked on them!
26824 * ecore.cs (ExplicitReferenceConversionExists): Made public.
26825 (ImplicitReferenceConversionExists): Split out from
26826 StandardConversionExists.
26828 * expression.cs (As): We were only implementing one of the three
26829 cases for the as operator. We now implement them all.
26830 (Is): Implement the various other cases for Is as well.
26832 * typemanager.cs (CACHE): New define used to control if we want or
26833 not the FindMembers cache. Seems to have a negative impact on
26834 performance currently
26836 (MemberLookup): Nested types have full acess to
26837 enclosing type members
26839 Remove code that coped with instance/static returns for events, we
26840 now catch this in RealFindMembers.
26842 (RealFindMembers): only perform static lookup if the instance
26843 lookup did not return a type or an event.
26845 2002-05-17 Miguel de Icaza <miguel@ximian.com>
26847 * assign.cs (CompoundAssign): We pass more semantic information
26848 now to Compound Assignments than we did before: now we have all
26849 the information at hand, and now we resolve the target *before* we
26850 do the expression expansion, which allows the "CacheValue" method
26851 to have the effect we intended (before, a [x] += 1 would generate
26852 two differen ArrayAccess expressions from the ElementAccess,
26853 during the resolution process).
26855 (CompoundAssign.DoResolve): Resolve target and original_source here.
26857 2002-05-16 Miguel de Icaza <miguel@ximian.com>
26859 * expression.cs (ArrayAccess): dropped debugging information.
26861 * typemanager.cs: Small bug fix: I was always returning i_members,
26862 instead of one of i_members or s_members (depending on which had
26865 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
26866 method is invoked before any code generation takes place, and it
26867 is a mechanism to inform that the expression will be invoked more
26868 than once, and that the method should use temporary values to
26869 avoid having side effects
26871 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
26873 * ecore.cs (Expression.CacheTemporaries): Provide empty default
26876 * expression.cs (Indirection, ArrayAccess): Add support for
26877 CacheTemporaries in these two bad boys.
26879 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
26880 ldobj or ldind_ref.
26881 (StoreFromPtr): Handle stobj as well.
26883 * expression.cs (UnaryMutator): Share more code.
26885 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
26886 down: I was not tracking the Filter function as well, which
26887 was affecting the results of the cache.
26889 2002-05-15 Miguel de Icaza <miguel@ximian.com>
26891 * attribute.cs: Remove the hack to handle the CharSet property on
26894 2002-05-14 Miguel de Icaza <miguel@ximian.com>
26896 * attribute.cs (DoResolve): More uglyness, we now only try to
26897 resolve the attribute partially, to extract the CharSet
26898 information (only if we are a StructLayout attribute). Otherwise
26900 (GetExtraTypeInfo): Add some code to conditionally kill in the
26901 future this. I am more and more convinced that the .NET
26902 framework has special code to handle the attribute setting on
26905 * expression.cs (IsParamsMethodApplicable): Revert my previous
26906 foreach change here, it was wrong.
26908 2002-05-13 Miguel de Icaza <miguel@ximian.com>
26910 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
26911 (pp_expr): do not abort on unknown input, just return.
26912 (eval): abort if there are pending chars.
26914 * attribute.cs (Attribute.Resolve): Positional parameters are
26915 optional. Deal with that case.
26917 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
26918 the Ansi/Unicode/Auto information for the type.
26920 (TypeContainer.DefineType): instantiate the EmitContext here, as
26921 we will be using it during the type definition (to resolve
26922 attributes) and during the emit phase.
26924 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
26925 to pull type information out of the attributes
26927 (Attribute.Resolve): track the constructor builder, and allow for
26928 multiple invocations (structs and classes will use this).
26930 * ecore.cs (MemberLookupFinal): new version with all the
26931 parameters customizable.
26933 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
26934 constructors. Return if the result value is null (as the error
26935 would have been flagged already by MemberLookupFinal)
26937 Do not allow instances of abstract classes or interfaces to be
26940 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
26941 We have to compare the assembly property here when dealing with
26942 FamANDAssem and Assembly access modifiers, because we might be
26943 creating an assembly from *modules* (that means that we are not
26944 getting TypeBuilders for types defined in other modules that are
26945 part of this assembly).
26947 (Method.Emit): If the method is marked abstract and has a body,
26950 (TypeContainer.DefineMembers): If both the defined member and the
26951 parent name match are methods, then do not emit any warnings: let
26952 the Method.Define routine take care of flagging warnings. But if
26953 there is a mismatch (method overrides something else, or method is
26954 overriwritten by something, then emit warning).
26956 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
26957 set to null, this means `do not check for the return type on the
26960 (Method.Define): set the return type for the method signature to
26961 null, so that we get methods with the same name and parameters and
26962 different return types. This is used to flag warning 114 (you are
26963 hiding a method, and you probably want to use the new/override
26966 * typemanager.cs (MemberLookup): Implemented proper access
26967 control, closing a long standing set of bug reports. The problem
26968 was that the Framework only has two bits: Public and NonPublic,
26969 and NonPublic includes private and protected methods, but we need
26970 to enforce the FamANDAssem, FamOrAssem and Family.
26972 2002-05-11 Miguel de Icaza <miguel@ximian.com>
26974 * statement.cs (GotoCase): Return true: Ammounts to giving up
26975 knowledge on whether we return or not, and letting the other case
26976 be responsible for it.
26978 2002-05-10 Miguel de Icaza <miguel@ximian.com>
26980 * driver.cs: Do not load directories for each file processed, only
26981 do it if there is a pattern.
26983 * ecore.cs: Report readonly assigns here as well, as we might have
26984 been resolved only by MemberAccess.
26986 (SimpleName.SimpleNameResolve): Also be useful for LValue
26987 resolution. We need this to propagate assign to local readonly variables
26989 * typemanager.cs: Use a ptrhashtable for the criteria, because we
26990 do not want to reuse potential criteria memory.
26992 * class.cs (MyEventBuilder): Set reflected_type;
26994 * ecore.cs (Constantify): Added support for constifying bools.
26996 (RootContext.LookupType): Added a cache for values looked up in
26997 the declaration space.
26999 * typemanager.cs (FindMembers): Now is a front-end to
27000 RealFindMembers, and provides a two-level hashtable-based cache to
27003 15% performance improvement: from 22.5 to 19.2 seconds.
27005 * expression.cs (IsParamsMethodApplicable): use foreach.
27006 (Invocation.DoResolve): ditto.
27007 (New.DoResolve): ditto.
27008 (ArrayCreation.DoResolve): ditto.
27010 * ecore.cs (FindMostEncompassingType): use foreach.
27012 * delegate.cs (NewDelegate.DoResolve): Use foreach
27014 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
27015 (RemoveMethods): use foreach.
27017 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
27018 nested foreach statements instead of for, and also break out of
27019 the inner loop once a match is found.
27021 (Invocation.OverloadResolve): Use foreach, simplify the code.
27023 2002-05-08 Miguel de Icaza <miguel@ximian.com>
27025 * cfold.cs (BinaryFold): During an enumeration evaluation context,
27026 we actually unwrap the expression to allow for extra information
27029 * expression.cs: Use Shr_Un on unsigned operations.
27031 2002-05-08 Ravi Pratap <ravi@ximian.com>
27033 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
27034 applicable operators was not being considered correctly. This closes
27035 the bug Miguel reported.
27037 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
27039 * attribute.cs: check that the type derives from System.Attribute
27040 and report the correct error in that case (moved the duplicate code to
27041 its own method, too).
27043 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
27045 * attribute.cs: lookup attribute type name as the spec says: first the
27046 bare attribute name and then name + "Attribute" (nant compiles with
27047 mcs after this fix).
27049 2002-05-07 Miguel de Icaza <miguel@ximian.com>
27051 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
27052 Because of the way we parse things, we should try to see if a
27053 UIntConstant can fit in an integer.
27055 2002-05-07 Ravi Pratap <ravi@ximian.com>
27057 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
27058 when we are in an explicit context.
27060 (ConvertReferenceExplicit): When converting from Iface type S to Class
27061 T make sure the rules are implemented as an OR.
27063 * parameter.cs (ParameterType): Make it a property for now although the
27064 purpose really isn't anything immediate.
27066 * expression.cs (Is*Applicable): Do better checking on the parameter type
27067 of a ref/out parameter. The ones from the system assemblies are already
27068 marked with the correct type so we don't need to do any correction.
27070 * ecore.cs (StandardConversionExists): Conversion from Interface types to
27071 the object type is standard too so include that.
27073 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27075 * ecore.cs (StandardConversionExists): Augment with missing code:
27076 deal with IntConstant, LongConstants and Enumerations.
27078 * assign.cs: Report the error, instead of failing silently
27080 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
27081 typecontainer that they are declared, because the
27082 typecontainer/namespace will have the list of using clauses that
27083 need to be applied.
27085 Assembly Attributes were escaping the normal registration
27088 (EmitCode): Apply attributes within an EmitContext that represents
27089 the container they were declared on.
27091 * cs-parser.jay: Track bases for structs. How did I get this wrong?
27093 2002-05-06 Ravi Pratap <ravi@ximian.com>
27095 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
27096 Revamp completely - make much cleaner as we now operate only
27099 (FindMostSpecificSource, FindMostSpecificTarget): New methods
27100 to implement the logic detailed in the spec more correctly.
27102 (UserDefinedConversion): Update accordingly.
27104 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27106 * statement.cs: Return flow analysis information up.
27108 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
27111 (token): Do not consume an extra character before calling
27114 2002-05-06 Piers Haken <piersh@friskit.com>
27116 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
27118 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27120 * class.cs (Constructor.Emit): Set the IsStatic flag in the
27121 EmitContext during the instance constructor initializer
27122 resolution, to stop access to instance variables.
27124 This is mandated by the spec, last paragraph of the `constructor
27125 initializers' section.
27127 2002-05-05 Miguel de Icaza <miguel@ximian.com>
27129 * cs-parser.jay, class.cs (Accessor): new class used to represent
27130 an accessor (get or set). In the past we used `null' to represent
27131 a missing accessor. But this is ambiguous because there was no
27132 way to tell in abstract indexers/properties if one of them was
27135 Now there is a way of addressing that.
27137 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
27138 instead of FindMembers.
27140 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
27141 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
27143 * attribute.cs: Treat indexers and properties as the same in terms
27144 of applying attributes
27146 * ecore.cs (FindMostEncompassedType): Use statically initialized
27147 EmptyExpressions()s like we do elsewhere to avoid creating useless
27148 objects (and we take this out of the tight loop).
27150 (GetConversionOperators): Move the code to extract the actual
27151 operators to a separate routine to clean things up.
27153 2002-05-04 Miguel de Icaza <miguel@ximian.com>
27155 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
27156 events are always registered FieldBuilders.
27158 * class.cs (FieldBase): New class shared by Fields
27160 * delegate.cs: If we are a toplevel delegate, use our full name.
27161 If we are a nested delegate, then only use our tail name.
27163 2002-05-02 Ravi Pratap <ravi@ximian.com>
27165 * expression.cs (IsApplicable): Ensure that we add the "&" to
27166 ref/out types before comparing it with the type of the argument.
27168 (IsParamsMethodApplicable): Ditto.
27170 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
27173 * delegate.cs : Handle the case when we have more than one applicable
27174 method. Flag an error only when we finish checking all.
27176 2002-05-02 Miguel de Icaza <miguel@ximian.com>
27178 * expression.cs: Add support for boolean static initializers.
27180 2002-05-01 Miguel de Icaza <miguel@ximian.com>
27182 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
27184 * parameter.cs (ComputeParameterTypes,
27185 ComputeAndDefineParameterTypes): Better error handling: now we
27186 clear the `types' cache if we fail during any of the type lookups.
27187 We also return the status code correctly to our caller
27189 * delegate.cs: If we fail to define a delegate, abort the extra
27192 * expression.cs (Binary.ResolveOperator): for
27193 operator==(object,object) and operator !=(object, object) we also
27194 have to verify that there is an implicit conversion from one to
27197 (ArrayAccess.DoResolve): Array Access can operate on
27200 2002-04-30 Miguel de Icaza <miguel@ximian.com>
27202 * assign.cs (CompoundAssign): A new class used as a "flag" that
27203 the assignment actually is happening as part of a compound
27204 assignment operator.
27206 During compound assignment, a few new rules exist to enable things
27213 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
27214 to the type of x) if y is implicitly convertible to the type of x,
27215 and the operator is a builtin operator and the return type of the
27216 operator is explicitly convertible to the type of x.
27218 * rootcontext.cs: Reset warning level to 2. 4 catches various
27219 "interesting" features in mcs, we must clean this up at some
27220 point, but currently am trying to kill other bugs ;-)
27222 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
27223 in container classes as well.
27225 * expression.cs (Binary.ResolveOperator): Handle string case
27226 before anything else (as operator overloading does emit an error
27227 before doing anything else).
27229 This code could go away when we move to a table driven model, but
27230 i could not come up with a good plan last night.
27232 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
27234 * typemanager.cs (CSharpName): reimplementation using regex.
27235 * class.cs: added null check for fields in Emit
27236 * rootcontext.cs: set warninglevel to 4
27238 2002-04-29 Miguel de Icaza <miguel@ximian.com>
27240 * typemanager.cs (CSharpName): reimplemented with Lupus
27243 2002-04-28 Miguel de Icaza <miguel@ximian.com>
27245 * statement.cs (If): correclty implement Resolve, because we were
27246 not catching sem errors in there. The same process is needed
27248 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
27251 (Statement.Warning_DeadCodeFound): Factorize code.
27252 (While): Report dead code here too.
27254 (Statement): Added Resolve virtual method to allow
27255 for resolution split from the emit code.
27257 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27259 * statement.cs (EmitBoolExpression): No longer try to resolve the
27261 (MakeBoolean): New utility function that resolve, implicitly
27262 converts to boolean and tags the expression.
27265 (If, Do): Implement dead code elimination.
27266 (While): Implement loop inversion
27268 (Do, While, For, If): Resolve the expression prior to calling our
27271 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
27274 - added method Report28 (warning: program has more than one entry point)
27275 - added method IsEntryPoint, implements paragraph 10.1 of the spec
27276 - modified method Method.Define, the part at the end of the method
27278 * rootcontext.cs: added static public Location EntryPointLocation;
27280 * ../errors/cs0028.cs : Add test case for the above warning.
27283 - modified method CSharpName to allow arrays of primitive type to
27284 be printed nicely (e.g. instead of System.Int32[][] it now prints
27286 - added method CSharpSignature: returns the signature of a method
27287 in string format to be used in reporting errors, warnings, etc.
27289 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
27292 2002-04-26 Ravi Pratap <ravi@ximian.com>
27294 * delegate.cs (Define): Fix extremely silly bug where I was
27295 setting the type of the 'object' parameter of the BeginInvoke
27296 method to System.IAsyncResult instead of System.Object ;-)
27298 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27300 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
27303 (Constructor.Emit): return if we fail to initialize the
27304 constructor. Another door closed!
27306 * expression.cs (New.DoResolve): Improve error message (from -6 to
27307 1501). Use DeclaredOnly lookup to find the exact constructor.
27309 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
27310 loop. This is useful.
27312 * cs-parser.jay: Adjust the default parameters so that destructors
27313 have the proper signature.
27315 2002-04-26 Martin Baulig <martin@gnome.org>
27317 * driver.cs (LoadAssembly): If `assembly' contains any characters
27318 which are only valid in path names and not in assembly names
27319 (currently slash, backslash and point), use Assembly.LoadFrom ()
27320 instead of Assembly.Load () on the `assembly' (before iteration
27321 over the link_paths).
27323 2002-04-26 Martin Baulig <martin@gnome.org>
27325 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
27327 2002-04-25 Miguel de Icaza <miguel@ximian.com>
27329 * class.cs (Property): use the new typemanager.MemberLookup
27331 (TypeContainer.MemberLookup): Implement using the
27332 TypeManager.MemberLookup now.
27334 * typemanager.cs: Make MemberLookup a function of the TypeManager,
27335 and return MemberInfos, so that these can be used without an
27336 EmitContext (what we had before).
27338 2002-04-24 Miguel de Icaza <miguel@ximian.com>
27340 * expression.cs: Fix the case where the argument to params if the
27341 type of the params. I omitted handling this before. Fixed
27343 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27345 * driver.cs: Call BootCorlib_PopulateCoreType
27347 * class.cs (Property.CheckBase): Check for properties only, not
27350 * interface.cs: Temporary hack: try/catch around the
27351 CustomAttributeBuilder, because I am getting an exception that I
27354 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
27355 types whose definitions are required to be there (attributes are
27356 defined before standard types).
27358 Compute definitions as we boot the various types, as they are used
27359 immediately (value_type class will need object_type, but if we do
27360 not initialize object_type, we will pass a null, which will let
27361 the runtime pick the System.Object from the existing corlib, which
27362 is not what we want).
27364 2002-04-22 Patrik Torstensson <totte@labs2.com>
27366 * cs-tokenizer.cs: fixed a number of trim() issues.
27368 2002-04-22 Ravi Pratap <ravi@ximian.com>
27370 * expression.cs (Argument.Type): Ensure that we return the correct
27371 type when we have out or ref parameters [in which case we
27374 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27376 * class.cs (Property, Indexer): Allow extern modifier in there.
27378 * typemanager.cs (InitBaseTypes): Initializes object_type and
27379 value_type, since those will be used early on during the bootstrap
27380 process to compile corlib.
27382 (InitCoreTypes): Move code from here to InitBaseTypes.
27384 2002-04-21 Miguel de Icaza <miguel@ximian.com>
27386 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
27387 single-dimension arrays as using the ldlen opcode.
27389 Daniel Lewis discovered this optimization.
27391 * typemanager.cs: Add signature for System.Array::get_Length
27393 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27395 * statement.cs: report the error when the foreach does not apply to an
27396 array nor a collection.
27398 2002-04-19 Miguel de Icaza <miguel@ximian.com>
27400 * expression.cs: Add implicit conversions to the operator ~.
27402 * constant.cs (DecimalConstant.Emit): Emit decimal value.
27404 * typemanager.cs: Locate the decimal constructor.
27406 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27408 * attribute.cs: use the new property of TypeOf.
27409 * expression.cs: added 'get' property around typearg.
27411 These changes fix a build breaker reported by NickD. Is this the
27412 correct way to fix? If not, please, revert my changes and make it
27415 2002-04-17 Miguel de Icaza <miguel@ximian.com>
27417 * attribute.cs: Add support for typeof in attribute invocations.
27418 I am not sure that this is right though.
27420 2002-04-14 Duncan Mak <duncan@ximian.com>
27422 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
27423 Binary.Operator.Division case.
27425 2002-04-13 Ravi Pratap <ravi@ximian.com>
27427 * class.cs (DefineType): Ensure that we do a proper check on
27428 attribute types and also register it with the TypeManager.
27430 (TypeContainer.Targets): The default for attribute types is
27431 AttributeTargets.All.
27433 * attribute.cs (ApplyAttributes): Registering the attribute type
27434 is done elsewhere, not when we discover we have a Usage attribute.
27436 2002-04-12 Ravi Pratap <ravi@ximian.com>
27438 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
27439 and get rid of is_delegate parameter.
27441 * everywhere : update.
27443 2002-04-12 Ravi Pratap <ravi@ximian.com>
27445 * cs-parser.jay (compilation_unit): Revamp completely to use
27446 some new ideas that I got from Rhys' grammar to solve the problems
27447 with assembly level attributes.
27449 (outer_declaration): New grammar production.
27451 (attribute_sections): Add.
27453 (opt_attributes): Base on attribute_sections
27455 (namespace_declaration): Allow opt_attributes to tackle the case
27456 when we have assembly level attributes - we are clever in this
27459 * attribute.cs (ApplyAttributes): Do not worry about assembly
27460 attributes in the non-global context.
27462 * rootcontext.cs (AddGlobalAttributes): Go back to using this
27463 instead of SetGlobalAttributes.
27465 * class.cs, rootcontext.cs : Ensure we define and generate
27466 attribute types before anything else.
27468 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
27469 and flag the new error -20 for the case when the attribute type
27470 does not have valid targets specified. csc does not catch this.
27472 * ../errors/errors.txt : update for error # -20
27474 2002-04-11 Ravi Pratap <ravi@ximian.com>
27476 * support.cs (InternalParameters.ParameterModifier): Do some null
27477 checking and return sane values.
27479 * class.cs (Method.Define): If we are a PInvoke method, ensure
27480 that we are static and extern. Report error # 601
27482 * ../errors/cs0601.cs : Add test case for the above error.
27484 2002-04-07 Ravi Pratap <ravi@ximian.com>
27486 * rootcontext.cs (attribute_types): We need to keep type of
27487 all attribute types separately and emit code for them first.
27489 (RegisterAttribute) : Implement.
27491 * class.cs (DefineType): Check if the current Type is a custom
27492 attribute type and register it accordingly.
27494 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
27495 adding the first attribute twice and rename to
27497 (SetGlobalAttributes): this.
27499 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
27502 * attribute.cs (ApplyAttributes): Take an additional argument telling us
27503 if we are processing global arguments. Hmm, I am unsure of this.
27505 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27507 * expression.cs: added static array of strings to avoid calling
27508 Enum.ToString () for Operator in Binary. Significant recover of
27511 2002-04-10 Miguel de Icaza <miguel@ximian.com>
27513 * class.cs (FindMembers): Allow the Builders of the various
27514 members to be null. If they are skip them. This only happens
27515 during the PInvoke declaration.
27517 2002-04-09 Miguel de Icaza <miguel@ximian.com>
27519 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
27520 failure, so we do not keep going afterwards.
27522 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
27523 wanted to pass `false' as the `is_delegate' argument. If this is
27524 the case, why not use delegate_type == null to mean `is_delegate =
27525 false' and anything else as is_delegate = true.
27527 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
27529 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
27530 code for the section, not the beginning of the tests.
27532 2002-04-08 Miguel de Icaza <miguel@ximian.com>
27534 * cfold.cs: Handle operator + (Enum x, Underlying x)
27536 * expression.cs (Binary): same. Warn about errors where we have
27537 Enum/Enum in operator + as well.
27539 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
27542 - added support for switch(bool)
27543 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
27544 - add TableSwitchEmit() to handle table-based switch statements
27546 2002-04-05 Ravi Pratap <ravi@ximian.com>
27548 * expression.cs (Invocation.OverloadResolve): Factor out code which
27549 does parameter compatibility checking with arguments so that we can
27550 re-use the code even from Delegate.VerifyApplicability
27552 (VerifyArgumentsCompat): Move above code here.
27554 * delegate.cs (VerifyApplicability): Get rid of duplicate code
27555 and instead make a call to the above method.
27557 2002-03-31 Ravi Pratap <ravi@ximian.com>
27559 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
27560 We use it to keep track of classes which are attribute types.
27562 2002-04-02 Miguel de Icaza <miguel@ximian.com>
27564 * delegate.cs (Delegate.Define): Correctly define the types in the
27565 presence of fixed and array parameters.
27567 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
27570 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
27571 include NonPublic after the first iteration.
27573 * class.cs (Indexer.CheckBase): Only check if both parents are
27576 * cs-parser.jay (accessor_body): If empty, set to null.
27578 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
27579 same code path here to resolve constants names that we did have in
27580 MemberAccess.DoResolve. There is too much code duplicated here.
27582 2002-04-01 Miguel de Icaza <miguel@ximian.com>
27584 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
27586 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
27589 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
27590 tokens, numbers and strings.
27592 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
27595 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
27596 asyncronous parameters and the regular parameters.
27598 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
27599 specify the target directory.
27601 * expression.cs: (This.DoResolve): Simplify
27602 (As.Emit): Optimize, do not generate IsInst if the expression is
27603 always of the given type.
27605 (Is.DoResolve): Bug fix, we were reporting both always/never for
27608 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
27609 creating too many unnecessary arrays.
27611 2002-03-31 Miguel de Icaza <miguel@ximian.com>
27613 * class.cs (EmitFieldInitializer): Use Assign expression to assign
27614 fields instead of rolling our own initializer. Takes care of all
27615 implicit conversions, and drops unnecessary static checks/argument.
27617 2002-03-31 Dick Porter <dick@ximian.com>
27619 * driver.cs: use the GetDirectories() return values properly, and
27620 use "/" as path separator.
27622 2002-03-30 Miguel de Icaza <miguel@ximian.com>
27624 * expression.cs (Unary): Optimize - - expr into expr.
27625 (Binary): Optimize a + (-b) into a -b.
27627 * codegen.cs (CodeGen): Made all methods static.
27629 2002-03-29 Miguel de Icaza <miguel@ximian.com>
27633 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
27634 TypeBuilder property.
27636 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
27639 * tree.cs: Removed the various RecordXXXX, and replaced with a
27640 single RecordDecl. Removed all the accessor methods, and just
27641 left a single access point Type
27643 * enum.cs: Rename DefineEnum to DefineType.
27645 * decl.cs: New abstract method `DefineType' used to unify the
27646 Defines for Enumerations, Interfaces, TypeContainers and
27649 (FindType): Moved LookupInterfaceOrClass here. Moved the
27650 LookupBaseClasses method that used to live in class.cs and
27651 interface.cs here, and renamed to FindType.
27653 * delegate.cs: Implement DefineType. Take advantage of the
27654 refactored pattern for locating the parent builder without taking
27655 the parent_builder argument (which we know does not work if we are
27656 nested, and triggering a toplevel definition).
27658 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27660 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
27661 accessibility of a member has changed during override and report
27664 * class.cs (Method.Define, Property.Define): Only complain on
27665 overrides if the method is private, any other accessibility is
27666 fine (and since we just checked the permission is the same, we are
27669 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
27670 and elif are processed always. The other pre-processing
27671 directives are only processed if we are "taking" the path
27673 2002-03-29 Martin Baulig <martin@gnome.org>
27675 * class.cs (Method.Emit): Only emit symbolic debugging info if the
27676 current location is not Null.
27678 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
27679 a separate method so we can profile it.
27681 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
27682 `span.Seconds' are just seconds, but no minutes or hours.
27683 (MainDriver): Profile the CodeGen.SaveSymbols calls.
27685 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27687 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
27688 Remove the gratuitous set of Final:
27690 // If an interface implementation, then we can set Final.
27691 if (((flags & MethodAttributes.Abstract) == 0) &&
27692 implementing.DeclaringType.IsInterface)
27693 flags |= MethodAttributes.Final;
27695 I do not know what I was smoking when I used that.
27698 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
27699 step into fixing the name resolution issues for delegates and
27700 unifying the toplevel name resolution.
27702 2002-03-28 Martin Baulig <martin@gnome.org>
27704 * class.cs (Method.Emit): If we have a symbol writer, call its
27705 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
27706 tell it about the current method.
27708 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
27709 writer that we're going to emit the first byte of IL code for a new
27710 statement (a new source line).
27711 (EmitContext.EmitTopBlock): If we have a symbol writer, call
27712 EmitContext.Mark() before emitting any code.
27714 * location.cs (SymbolDocument): Return null when we're Null.
27716 * statement.cs (Statement): Moved the `Location loc' variable here.
27717 (Statement.EmitBoolExpression): If we have a symbol writer, call
27718 ec.Mark() before emitting any code to tell it that we're at the
27719 beginning of a new statement.
27720 (StatementExpression): Added `Location' argument to the constructor.
27721 (Block): Added public readonly variable `StartLocation' and public
27722 variable `EndLocation'. The latter is to be set using SetEndLocation().
27723 (Block): Added constructor which takes a start and end location.
27724 (Block.SetEndLocation): New method. This sets the end location.
27725 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
27726 local variables we create.
27727 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
27728 each statement and do also mark the begin and end of the block.
27730 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
27731 tell it the current lexer.Location, use Location.Null for the end of the
27733 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
27734 current block, set its end location using SetEndLocation().
27735 (statement_expression): StatementExpression constructor now takes the
27736 lexer.Location as additional argument.
27737 (for_statement, declare_local_variables): Likewise.
27738 (declare_local_variables): When creating a new implicit block, use the
27739 new Block constructor and pass it the lexer.Location.
27741 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27743 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
27744 members also on the parent interfaces recursively.
27746 2002-03-27 Miguel de Icaza <miguel@ximian.com>
27748 * report.cs: Use new formats, since Gonzalo finished the missing
27751 * expression.cs (Binary.ResolveOperator): added missing operator|
27752 operator& and operator^ for bool/bool.
27754 * cs-parser.jay: CheckDef now takes a Location argument that is
27755 used to report errors more precisly (instead of reporting the end
27756 of a definition, we try to track something which is a lot closer
27757 to the source of the problem).
27759 * cs-tokenizer.cs: Track global token use, so we can properly flag
27760 the use of #define/#undef after the first token has been seen.
27762 Also, rename the reportXXXX to Error_DescriptiveName
27764 * decl.cs (DeclSpace.IsTopLevel): Move property here from
27765 TypeContainer, so that Enum and Interface can use this too.
27767 * class.cs (TypeContainer.LookupInterfaceOrClass,
27768 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
27769 `builder' argument. Typically this was used to pass the parent
27770 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
27773 The problem is that a nested class could trigger the definition of
27774 a toplevel class, and the builder would be obviously wrong in that
27777 So we drop this argument, and we compute dynamically the
27778 TypeBuilder/ModuleBuilder (the correct information was available
27779 to us anyways from DeclSpace.Parent)
27781 * interface.cs (Interface.DefineInterface): Drop builder
27782 parameter cleanup like class.cs
27784 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
27787 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
27790 (Try.Emit): Propagate the returns value from the statement.
27792 (Return.Emit): Even if we are leavning
27794 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
27796 * modifiers.cs: Fix the computation of MethodAttributes flags.
27798 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
27800 * driver.cs: allow compilation of files that start with '/'.
27801 Add a default case when checking the argument of --target.
27803 2002-03-25 Miguel de Icaza <miguel@ximian.com>
27805 * interface.cs: Implement the same search algorithm for types in
27806 the interface code.
27808 * delegate.cs: Do not allow multiple definition.
27810 * Recovered ChangeLog that got accidentally amputated
27812 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
27814 * rootcontext.cs: Load manually enum to allow core classes to
27815 contain enumerations.
27817 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
27818 Update to new static methods in TypeManager.
27820 * typemanager.cs (GetMethod, GetConstructor): Use our
27821 implementation of FindMembers to find the members, since during
27822 corlib compilation, the types are TypeBuilders and GetMethod and
27823 GetConstructor do not work.
27825 Make all methods in TypeManager static.
27827 (InitCodeHelpers): Split the functionality from
27828 the InitCodeTypes function.
27830 * driver.cs: Call InitCodeHelpers after we have populated the
27833 * cs-parser.jay (delegate_declaration): we did not used to compute
27834 the delegate name correctly for void delegates.
27836 2002-03-24 Miguel de Icaza <miguel@ximian.com>
27838 * rootcontext.cs (RootContext): Init the interface_resolve_order
27839 and type_container_resolve_order always.
27841 (ResolveCore, BootstrapCorlib_ResolveClass,
27842 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
27843 compiler when compiling with --nostdlib
27845 * class.cs (TypeContainer.DefineType): Check that our parent is
27846 not null. This test is most important when we are bootstraping
27849 * codegen.cs: Split out the symbol writing code.
27851 2002-03-25 Martin Baulig <martin@gnome.org>
27853 * driver.cs (-g): Made -g an alias for --debug.
27855 2002-03-24 Martin Baulig <martin@gnome.org>
27857 * codegen.cs (SymbolWriter): New public variable. Returns the
27858 current symbol writer.
27859 (CodeGen): Added `bool want_debugging_support' argument to the
27860 constructor. If true, tell the ModuleBuild that we want debugging
27861 support and ask it for the ISymbolWriter.
27862 (Save): If we have a symbol writer, call it's Close() method after
27863 saving the assembly.
27865 * driver.c (--debug): New command line argument to create a
27866 debugger information file.
27868 * location.cs (SymbolDocument): New public property. Returns an
27869 ISymbolDocumentWriter object for the current source file or null
27870 if we don't have a symbol writer.
27872 2002-03-21 Miguel de Icaza <miguel@ximian.com>
27874 * driver.cs (LoadAssembly): Correctly return when all the paths
27875 have been tried and not before.
27877 * statement.cs (Switch.Emit): return the actual coverage for this
27878 statement (returns/not-returns)
27880 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
27881 switch of the statement if we are the last switch section. That
27882 kills two problems: try/catch problems (we used to emit an empty
27883 nop at the end) and switch statements where all branches would
27886 2002-03-19 Miguel de Icaza <miguel@ximian.com>
27888 * driver.cs: Add default assemblies (the equivalent to the
27889 Microsoft CSC.RSP file)
27891 * cs-tokenizer.cs: When updating `cols and setting it to zero,
27892 also update tokens_seen and set it to false.
27894 * driver.cs: Implement --recurse for Mike.
27896 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
27897 correctly splitting out the paths.
27899 2002-03-18 Miguel de Icaza <miguel@ximian.com>
27901 * interface.cs (Interface.PopulateProperty): Instead of using
27902 `parent' as the declaration space for the set parameters, use
27905 * support.cs (InternalParameters): InternalParameters constructor
27906 takes a DeclSpace instead of a TypeContainer.
27908 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
27909 types are being initialized, load the address of it before calling
27912 (New): Provide a mechanism to disable the generation of local
27913 value type temporaries when the caller will be providing us with
27914 an address to store it.
27916 (ArrayCreation.EmitDynamicInitializers): Use it.
27918 2002-03-17 Miguel de Icaza <miguel@ximian.com>
27920 * expression.cs (Invocation.EmitArguments): Only probe for array
27921 property if there is more than one argument. Sorry about that.
27923 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
27924 empty param arrays.
27926 * class.cs (Method.LabelParameters): Fix incorrect code path that
27927 prevented the `ParamArrayAttribute' from being applied to the
27930 2002-03-16 Miguel de Icaza <miguel@ximian.com>
27932 * support.cs (ReflectionParameters): Correctly compute whether the
27933 last argument is a params array. Fixes the problem with
27936 * typemanager.cs: Make the assemblies array always be non-null
27937 (empty, but non-null)
27939 * tree.cs (RecordDecl): New function that abstracts the recording
27940 of names. This reports error 101, and provides a pointer to the
27941 previous declaration. Fixes a crash in the compiler.
27943 * cs-parser.jay (constructor_declaration): Update to new grammar,
27944 and provide a constructor_body that can be empty.
27946 2002-03-15 Miguel de Icaza <miguel@ximian.com>
27948 * driver.cs: Add support for --resources.
27950 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
27951 Make all types for the various array helper methods be integer.
27953 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
27954 CheckState to ConvCast.
27956 (ConvCast): Now it takes a `checked' state argument, to avoid
27957 depending on the emit context for the conversion, and just using
27958 the resolve time setting.
27960 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
27961 instead of Invocation.EmitArguments. We do not emit the original
27962 arguments, instead we emit those which have been converted to
27963 unsigned int expressions.
27965 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
27967 * codegen.cs: ditto.
27969 * expression.cs (LocalVariableReference): Drop the use of the
27970 Store function that depended on the variable index.
27972 * statement.cs (VariableInfo): Drop the `Idx' property from this
27973 class, as this is not taking into account the indexes for
27974 temporaries tat we generate during the execution, getting the
27977 * class.cs: First emit class initializers, then call the parent
27980 * expression.cs (Binary): Fix opcode emision.
27981 (UnaryMutator.EmitCode): Support checked code generation
27983 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
27984 matches for events for both the Static and Instance scans,
27985 pointing to the same element. Fix that.
27987 2002-03-14 Miguel de Icaza <miguel@ximian.com>
27989 * rootcontext.cs (ResolveTree): Always set the
27990 interface_resolve_order, because nested interfaces will be calling
27993 * class.cs (GetInterfaceOrClass): Track the same resolution
27994 process used by TypeManager.LookupType. This fixes the nested
27995 type lookups in class declarations (separate path from
27998 (TypeContainer.DefineType): Also define nested interfaces.
27999 (TypeContainer.RegisterOrder): New public function used to
28000 register the order in which child interfaces need to be closed.
28002 Nested interfaces need to be closed after their parents have been
28005 * interface.cs (InterfaceAttr): Put all the logic for computing
28006 the interface attribute here.
28008 (DefineInterface): Register our interface order with the
28009 RootContext or with the TypeContainer depending on the case.
28011 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28013 * cs-parser.jay: rework foreach statement to work with the new
28014 changes to the policy on SimpleNames.
28016 * report.cs: support Stacktrace on warnings as well.
28018 * makefile: drop --unsafe and /unsafe from the compile.
28020 2002-03-13 Ravi Pratap <ravi@ximian.com>
28022 * ecore.cs (StandardConversionExists): Modify to take an Expression
28023 as the first parameter. Ensure we do null -> reference type conversion
28026 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
28027 temporary Expression objects.
28029 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
28031 * interface.cs: workaround bug in method overloading resolution
28032 (there is already a bugzilla bug for it).
28034 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28036 We could also solve this problem by having a separate path for
28037 performing type lookups, instead of DoResolve, we could have a
28038 ResolveType entry point, and only participating pieces of the
28039 production (simplename, deref, array) would implement this.
28041 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
28042 signal SimpleName to only resolve type names and not attempt to
28043 resolve anything else.
28045 * expression.cs (Cast): Set the flag.
28047 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
28049 * class.cs: Only report 108 if there is no `new' modifier.
28051 * cs-parser.jay: rework foreach statement to work with the new
28052 changes to the policy on SimpleNames.
28054 * report.cs: support Stacktrace on warnings as well.
28056 * makefile: drop --unsafe and /unsafe from the compile.
28058 2002-03-11 Miguel de Icaza <miguel@ximian.com>
28060 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28061 lookups here, instead of doing that at parse time. This means
28062 that our grammar will not introduce `LocalVariableReferences' as
28063 expressions at this point. That solves the problem of code like
28067 static void Main ()
28071 This is only half the fix. The full fix requires parameters to
28072 also be handled in this way.
28074 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
28075 makes the use more obvious of the DeclSpace. The
28076 ec.TypeContainer.TypeBuilder is now only used to pull the
28077 TypeBuilder for it.
28079 My theory is that I can get rid of the TypeBuilder completely from
28080 the EmitContext, and have typecasts where it is used (from
28081 DeclSpace to where it matters).
28083 The only pending problem is that the code that implements Aliases
28084 is on TypeContainer, and probably should go in DeclSpace.
28086 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28087 lookups here, instead of doing that at parse time. This means
28088 that our grammar will not introduce `LocalVariableReferences' as
28089 expressions at this point. That solves the problem of code like
28093 static void Main ()
28097 This is only half the fix. The full fix requires parameters to
28098 also be handled in this way.
28100 * class.cs (Property.DefineMethod): When implementing an interface
28101 method, set newslot, when implementing an abstract method, do not
28102 set the flag (before we tried never setting it, or always setting
28103 it, which is the difference).
28104 (Indexer.DefineMethod): same.
28105 (Method.DefineMethod): same.
28107 * ecore.cs: Only set the status used flag if we get back a Field.
28109 * attribute.cs: Temporary hack, so Paolo can keep working.
28111 2002-03-08 Ravi Pratap <ravi@ximian.com>
28113 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
28114 the unmanaged type in the case we have a MarshalAs attribute.
28116 (Resolve): Handle the case when we are parsing the special MarshalAs
28117 attribute [we need to store the unmanaged type to use later]
28119 * typemanager.cs (marshal_as_attr_type): Built in type for the
28120 MarshalAs Attribute.
28122 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
28123 on parameters and accordingly set the marshalling info.
28125 2002-03-09 Miguel de Icaza <miguel@ximian.com>
28127 * class.cs: Optimizing slightly by removing redundant code after
28128 we switched to the `NoTypes' return value.
28129 (Property.DefineMethod): use NoTypes here too.
28131 This fixes the bug I introduced in my last batch of changes.
28133 2002-03-05 Ravi Pratap <ravi@ximian.com>
28135 * tree.cs (RecordEnum): Add. We now keep track of enums too.
28137 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
28138 Enums since those are types too.
28140 * cs-parser.jay (enum_declaration): Record enums as we parse them.
28142 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
28143 thanks to a call during the lookup process.
28145 2002-03-07 Miguel de Icaza <miguel@ximian.com>
28147 * statement.cs (Foreach): Lots of work to accomodate a particular
28148 kind of foreach statement that I had not kept in mind. It is
28149 possible to have foreachs on classes that provide a GetEnumerator
28150 method that return objects that implement the "pattern" for using
28151 a foreach, there is no need to support GetEnumerator
28154 This is needed to compile nant.
28156 * decl.cs: Only report 114 if the member is not `Finalize' and if
28157 the warning level is at least 2.
28159 * class.cs: Moved the compare function from Method to
28162 (MethodSignature.InheritableMemberSignatureCompare): Add new
28163 filter function that is used to extract inheritable methods from a
28166 (Method.Define): Use the new `inheritable_method_signature_filter'
28169 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
28172 2002-03-06 Miguel de Icaza <miguel@ximian.com>
28174 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
28176 * cs-parser.jay: Add opt_semicolon to the interface declaration.
28178 * expression.cs: Pass location information to
28179 ConvertImplicitStandard.
28181 * class.cs: Added debugging code to track return values from
28184 2002-03-05 Miguel de Icaza <miguel@ximian.com>
28186 * expression.cs (Is.DoResolve): If either side of the `is' is an
28187 interface, do not flag the warning.
28189 * ecore.cs (ImplicitReferenceConversion): We need a separate test
28192 * report.cs: Allow for --fatal to be used with --probe.
28194 * typemanager.cs (NoTypes): Move the definition for the empty Type
28197 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
28199 (TypeContainer.DefineProxy): New function used to proxy to parent
28200 implementations when implementing interfaces.
28201 (TypeContainer.ParentImplements): used to lookup if our parent
28202 implements a public function that is required by an interface.
28203 (TypeContainer.VerifyPendingMethods): Hook this up.
28205 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
28206 `modules' and `assemblies' arraylists into arrays. We only grow
28207 these are the very early start up of the program, so this improves
28208 the speedof LookupType (nicely measured).
28210 * expression.cs (MakeByteBlob): Replaced unsafe code with
28211 BitConverter, as suggested by Paolo.
28213 * cfold.cs (ConstantFold.Binary): Special case: perform constant
28214 folding of string concatenation, but if either side is a string,
28215 and the other is not, then return null, and let the runtime use
28216 the concatenation on the string plus the object (using
28217 `Object.ToString').
28219 2002-03-04 Miguel de Icaza <miguel@ximian.com>
28221 Constant Folding has been implemented now.
28223 * expression.cs (Unary.Reduce): Do not throw an exception, catch
28224 the error instead on types that are not supported in one's
28227 * constant.cs (Constant and all children): New set of functions to
28228 perform implict and explicit conversions.
28230 * ecore.cs (EnumConstant): Implement the new functions to perform
28231 conversion by proxying to the child expression.
28233 * codegen.cs: (ConstantCheckState): Constant evaluation has its
28234 own separate setting that can not be turned off from the command
28235 line using --unchecked or --checked and is only controlled using
28236 the checked/unchecked statements and expressions. This setting is
28237 used by the constant folder to flag errors.
28239 * expression.cs (CheckedExpr, UncheckedExpr): Set the
28240 ConstantCheckState as well.
28242 During Resolve, they also have to flag the state, because the
28243 constant folder runs completely in the Resolve phase.
28245 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
28248 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28250 * cfold.cs: New file, this file contains the constant folder.
28252 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
28253 argument to track whether we are using the resulting address to
28254 load or store a value and provide better error messages.
28256 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
28257 new AddressOf arguments.
28259 * statement.cs (Foreach.EmitCollectionForeach): Update
28261 * expression.cs (Argument.Emit): Call AddressOf with proper
28262 arguments to track usage.
28264 (New.DoEmit): Call AddressOf with new arguments.
28266 (Unary.Emit): Adjust AddressOf call.
28268 2002-03-01 Ravi Pratap <ravi@ximian.com>
28270 * cs-parser.jay (member_access): Change the case for pre-defined types
28271 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
28274 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
28277 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
28278 essentially like methods and apply attributes like MethodImplOptions to them too.
28280 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
28283 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
28284 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
28287 * Update code everywhere accordingly.
28289 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
28291 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
28293 2002-02-28 Ravi Pratap <ravi@ximian.com>
28295 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
28296 try performing lookups against those instead of jumping straight into using
28297 the 'using' clauses.
28299 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
28301 (LookupType): Perform lookups in implicit parents too.
28303 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
28304 sequence as RootContext.LookupType.
28306 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
28307 the various cases of namespace lookups into this method.
28309 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28311 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
28312 in positional arguments)
28314 * class.cs (Operator): Update the AllowedModifiers to contain
28317 * cs-parser.jay: Update operator declaration to allow for the
28318 operator body to be empty.
28320 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
28323 2002-02-27 Miguel de Icaza <miguel@ximian.com>
28325 * class.cs (Method.Emit): Label parameters.
28327 * driver.cs: Return 1 or 0 as the program exit code.
28329 2002-02-26 Miguel de Icaza <miguel@ximian.com>
28331 * expression.cs: Special case the `null' object when trying to
28332 auto-compute the type, as anything can be explicitly converted to
28335 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
28336 spotting this Paolo.
28338 (Expression.ImplicitNumericConversion): Perform comparissions of
28339 the type using the underlying type in the case of an enumeration
28340 rather than using the enumeration type for the compare.
28342 Cope with the underlying == type case, which is not possible to
28345 (Expression.ConvertNumericExplicit): Perform comparissions of
28346 the type using the underlying type in the case of an enumeration
28347 rather than using the enumeration type for the compare.
28349 * driver.cs: If the user does not supply an extension, assume .exe
28351 * cs-parser.jay (if_statement): Rewrote so that we can track the
28352 location for the if statement.
28354 * expression.cs (Binary.ConstantFold): Only concat strings when
28355 the operation is "+", not everything ;-)
28357 * statement.cs (Statement.EmitBoolExpression): Take a location
28359 (If, While, Do): Track location.
28361 * expression.cs (Binary.ResolveOperator): In the object + string
28362 case, I was missing a call to ConvertImplicit
28364 2002-02-25 Ravi Pratap <ravi@ximian.com>
28366 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
28367 Location arguments. Ensure we use RootContext.LookupType to do our work
28368 and not try to do a direct Type.GetType and ModuleBuilder.GetType
28370 * interface.cs (PopulateMethod): Handle the type of the parameter being
28373 * expression.cs (Invocation.BetterFunction): Handle the case when we
28374 have a params method with no fixed arguments and a call is made with no
28377 2002-02-25 Miguel de Icaza <miguel@ximian.com>
28379 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
28380 the verbatim-string-literal
28382 * support.cs (InternalParameters.ParameterModifier): handle null
28384 (InternalParameters.ParameterType): ditto.
28386 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
28387 duplicating the name of the variable parameter.
28388 (GetParameterByName): Fix bug where we were not looking up array
28389 paramters if they were the only present (thanks Paolo!).
28390 (GetParameterInfo): We only have an empty set of types if both
28391 fixed and array are set to null.
28392 (GetParameterInfo-idx): Handle FixedParameter == null
28394 * cs-parser.jay: Handle the case where there is no catch
28395 statements (missing null test).
28397 2002-02-22 Miguel de Icaza <miguel@ximian.com>
28399 * driver.cs (MainDriver): Be conservative on our command line
28402 Catch DirectoryNotFoundException when calling GetFiles.
28404 (SplitPathAndPattern): Used to split the input specification into
28405 a path and a pattern that we can feed to Directory.GetFiles.
28407 2002-02-21 Miguel de Icaza <miguel@ximian.com>
28409 * statement.cs (Fixed): Implement the last case of the Fixed
28410 statement (string handling).
28412 * expression.cs (StringPtr): New class used to return a char * to
28413 a string; Used by the Fixed statement.
28415 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
28417 * expression.cs (Binary.ResolveOperator): Remove redundant
28418 MemberLookup pn parent type.
28419 Optimize union call, we do not need a union if the types are the same.
28420 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
28423 Specialize the use of MemberLookup everywhere, instead of using
28424 the default settings.
28426 (StackAlloc): Implement stackalloc keyword.
28428 * cs-parser.jay: Add rule to parse stackalloc.
28430 * driver.cs: Handle /h, /help, /?
28432 * expression.cs (MakeByteBlob): Removed the hacks we had in place
28433 before we supported unsafe code.
28435 * makefile: add --unsafe to the self compilation of mcs.
28437 2002-02-20 Miguel de Icaza <miguel@ximian.com>
28439 * expression.cs (PointerArithmetic): New class that is used to
28440 perform pointer arithmetic.
28441 (Binary.Resolve): Handle pointer arithmetic
28442 Handle pointer comparission.
28443 (ArrayPtr): Utility expression class that is used to take the
28444 address of an array.
28446 (ElementAccess): Implement array access for pointers
28448 * statement.cs (Fixed): Implement fixed statement for arrays, we
28449 are missing one more case before we are done.
28451 * expression.cs (Indirection): Implement EmitAssign and set the
28452 ExprClass to Variable. This allows pointer dereferences to be
28453 treated as variables, and to have values assigned to them.
28455 * ecore.cs (Expression.StoreFromPtr): New utility function to
28456 store values dereferencing.
28458 2002-02-20 Ravi Pratap <ravi@ximian.com>
28460 * expression.cs (Binary.ResolveOperator): Ensure that we are
28461 not trying to operate on a void type - this fixes the reported
28464 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
28465 the parent implementation is sealed.
28467 * ../errors/cs0239.cs : Add.
28469 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
28471 * typemanager.cs (unverifiable_code_type): Corresponds to
28472 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
28473 which have unsafe code in them.
28475 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
28478 2002-02-19 Miguel de Icaza <miguel@ximian.com>
28480 * cs-tokenizer.cs: Add support for @"litreal strings"
28482 Make tokenizer accept pre-processor directives
28483 on any column (remove the old C-like limitation).
28485 * rootcontext.cs (EmitCode): Emit any global attributes.
28486 (AddGlobalAttributes): Used to keep track of assembly attributes.
28488 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
28490 * cs-parser.jay: Add support for global attributes.
28492 2002-02-17 Miguel de Icaza <miguel@ximian.com>
28494 * expression.cs (Indirection): New helper class. Unary will
28495 create Indirection classes to be able to implement the
28496 IMemoryLocation interface on it.
28498 2002-02-16 Miguel de Icaza <miguel@ximian.com>
28500 * cs-parser.jay (fixed_statement): reference the right statement.
28502 * statement.cs (Fixed.Emit): Finish implementing the fixed
28503 statement for the &x case.
28505 2002-02-14 Miguel de Icaza <miguel@ximian.com>
28507 * class.cs (Property.Define, Method.Define): Remove newslot when
28510 * modifiers.cs: My use of NewSlot when `Abstract' was set was
28511 wrong. NewSlot should only be used if the `new' keyword is present.
28513 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
28514 locating our system dir. Sorry about this.
28516 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28518 * driver.cs (GetSystemDir): Compute correctly the location of our
28519 system assemblies. I was using the compiler directory instead of
28520 the library directory.
28522 2002-02-13 Ravi Pratap <ravi@ximian.com>
28524 * expression.cs (BetterFunction): Put back in what Miguel commented out
28525 since it is the correct fix. The problem is elsewhere ;-)
28527 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
28528 parameters of the parms method are themselves compatible or not !
28530 (StandardConversionExists): Fix very dangerous bug where we were forgetting
28531 to check that a class implements an interface before saying that an implicit
28532 conversion was allowed. Use ImplementsInterface to do the checking.
28534 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28536 * class.cs (Method.Define): Track whether we are an explicit
28537 implementation or not. And only call DefineMethodOverride if we
28538 are an explicit implementation.
28540 (Property.DefineMethod): Ditto.
28542 2002-02-11 Ravi Pratap <ravi@ximian.com>
28544 * expression.cs (BetterFunction): Catch hideous bug which was
28545 preventing us from detecting ambiguous calls due to implicit casts i.e
28548 2002-01-29 Miguel de Icaza <miguel@ximian.com>
28550 * support.cs (Pair): Remove un-needed method. I figured why I was
28551 getting the error in cs-parser.jay, the variable in a foreach loop
28552 is readonly, and the compiler does not really treat this as a variable.
28554 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
28555 instead of EQUALS in grammar.
28557 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
28559 * expression.cs (Unary.DoResolve): Check whether the argument is
28562 2002-01-28 Miguel de Icaza <miguel@ximian.com>
28564 * support.cs: Api for Pair to set a value. Despite the fact that
28565 the variables are public the MS C# compiler refuses to compile
28566 code that accesses the field if the variable is part of a foreach
28569 * statement.cs (Fixed): Begin implementation of the fixed
28572 (Block.AddVariable): Return the VariableInfo on success and null
28573 on failure instead of true/false.
28575 * cs-parser.jay (foreach): Catch errors on variables already
28576 defined (we were ignoring this value before) and properly unwind
28577 the block hierarchy
28579 (fixed_statement): grammar for the fixed statement.
28581 2002-01-25 Miguel de Icaza <miguel@ximian.com>
28583 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
28584 pointer types to be incretemented.
28586 (SizeOf): Implement.
28588 * cs-parser.jay (pointer_member_access): Implement
28589 expr->IDENTIFIER production.
28591 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
28592 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
28595 (Unary): Implement indirection.
28597 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
28598 use in non-unsafe context).
28600 (SimpleName.DoResolve): Check for pointers in field access on safe
28603 (Expression.LoadFromPtr): Factor the load-indirect code in this
28604 function. This was duplicated in UnboxCast and ParameterReference
28606 2002-01-24 Miguel de Icaza <miguel@ximian.com>
28608 * expression.cs (ComposedCast): report an error if a pointer cast
28609 is used in a safe region.
28611 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
28612 pointer type casts in unsafe context.
28614 * codegen.cs (EmitContext): Set up IsUnsafe.
28616 * cs-parser.jay (non_expression_type): Add productions for pointer
28619 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
28620 code. We should not use force into static mode if the method is
28621 not virtual. Fixes bug in MIS
28623 * statement.cs (Do.Emit, While.Emit, For.Emit,
28624 Statement.EmitBoolExpression): Add support to Do and While to
28625 propagate infinite loop as `I do return' semantics.
28627 Improve the For case to also test for boolean constants.
28629 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
28630 to the list of attributes we can add.
28632 Remove `EmitContext' argument.
28634 * class.cs (Method.Define): Apply parameter attributes.
28635 (Constructor.Define): Apply parameter attributes.
28636 (MethodCore.LabelParameters): Move here the core of labeling
28639 * support.cs (ReflectionParameters.ParameterModifier,
28640 InternalParameters.ParameterModifier): Use IsByRef on the type and
28641 only return the OUT bit for these parameters instead of in/out/ref
28644 This is because I miss-understood things. The ParameterInfo.IsIn
28645 and IsOut represent whether the parameter has the [In] and [Out]
28648 2002-01-22 Miguel de Icaza <miguel@ximian.com>
28650 * ecore.cs (FieldExpr.Emit): Release temporaries.
28652 * assign.cs (LocalTemporary.Release): new function.
28654 * codegen.cs (EmitContext.GetTemporaryStorage,
28655 EmitContext.FreeTemporaryStorage): Rework the way we deal with
28656 temporary storage. Now we can "put back" localbuilders when we
28659 2002-01-21 Miguel de Icaza <miguel@ximian.com>
28661 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
28662 need to make a copy of the variable to generate verifiable code.
28664 2002-01-19 Miguel de Icaza <miguel@ximian.com>
28666 * driver.cs: Compute dynamically the system directory.
28668 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
28669 Slower, but more generally useful. Used by the abstract
28670 registering implementation.
28672 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
28673 the rules for the special rule on Type/instances. First check if
28674 we have the same name, and if so, try that special static path
28675 rather than the instance path.
28677 2002-01-18 Miguel de Icaza <miguel@ximian.com>
28679 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
28682 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
28683 Enum, ValueType, Delegate or Array for non-corlib compiles.
28685 * cs-tokenizer.cs: Catch long identifiers (645)
28687 * typemanager.cs (IndexerPropetyName): Ravi never tested this
28690 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
28691 fix, we were returning too early, so we were not registering
28692 pending methods from abstract classes.
28694 Do not register pending methods if the class is abstract.
28696 * expression.cs (Conditional.DoResolve): Report circular implicit
28697 conversions when we neecd to compute it for conditional
28700 (Is.DoResolve): If the expression is always of the provided type,
28701 flag warning 183. If the expression can not ever be of the
28702 provided type flag warning 184.
28704 * class.cs: Catch 169 as well.
28706 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
28709 2002-01-18 Nick Drochak <ndrochak@gol.com>
28711 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
28713 2002-01-17 Miguel de Icaza <miguel@ximian.com>
28715 * interface.cs: (PopulateMethod): Check for pointers being defined
28716 only if the unsafe context is active.
28717 (PopulateProperty): ditto.
28718 (PopulateIndexer): ditto.
28720 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
28721 specified. If pointers are present, make sure that they are
28722 present in an unsafe context.
28723 (Constructor, Constructor.Define): ditto.
28724 (Field, Field.Define): ditto.
28725 (Property, Property.Define): ditto.
28726 (Event, Event.Define): ditto.
28728 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
28729 hashtable if there are classes or structs defined.
28731 * expression.cs (LocalVariableReference.DoResolve): Simplify this
28732 code, as the constant resolution moved.
28734 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
28735 the metadata, so we can flag error 133.
28737 * decl.cs (MemberCore.UnsafeOK): New function to test that a
28738 pointer is being declared in an unsafe context.
28740 2002-01-16 Miguel de Icaza <miguel@ximian.com>
28742 * modifiers.cs (Modifiers.Check): Require a Location argument.
28743 Report error 227 for Unsafe use.
28745 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
28747 * statement.cs (For.Emit): If the test is null, then report that
28748 we do `return', as we wont reach anything afterwards.
28750 (Switch.SwitchGoverningType): Track the expression that matched
28753 * driver.cs: Allow negative numbers as an error code to flag.
28755 * cs-parser.jay: Handle 1551.
28757 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
28759 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28761 * cs-parser.jay: Report 1518 (type declaration can only contain
28762 class, struct, interface, enum or delegate)
28764 (switch_label): Report 1523 (keywords `case' or `default' must
28767 (opt_switch_sections): Report 1522 (empty switch)
28769 * driver.cs: Report 1515 (response file specified multiple times)
28770 Report 1516 (Source file specified multiple times).
28772 * expression.cs (Argument.Resolve): Signal 1510
28774 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
28775 access not allowed in static code)
28777 2002-01-11 Ravi Pratap <ravi@ximian.com>
28779 * typemanager.cs (IsPointerType): Utility method which we are going
28782 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
28783 the object type, so we take care of that.
28785 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
28787 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
28788 added to non-params parameters :-)
28790 * typemanager.cs (CSharpName): Include 'void' type too.
28792 (void_ptr_type): Include in the set of core types.
28794 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
28797 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
28800 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
28801 completely forgotten about it.
28803 2002-01-10 Ravi Pratap <ravi@ximian.com>
28805 * cs-parser.jay (pointer_type): Add. This begins our implementation
28806 of parsing rules for unsafe code.
28808 (unsafe_statement): Implement.
28810 (embedded_statement): Modify to include the above.
28812 * statement.cs (Unsafe): Implement new class for unsafe blocks.
28814 * codegen.cs (EmitContext.InUnsafe): Add. This determines
28815 if the current context is an unsafe one.
28817 * cs-parser.jay (local_variable_pointer_type): Since local variable types
28818 are handled differently, we need separate rules for them.
28820 (local_variable_declaration): Update to use local_variable_pointer_type
28821 to allow variable declarations of unmanaged pointer types.
28823 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
28824 in unsafe contexts.
28826 * ../errors/cs0214.cs : Add.
28828 2002-01-16 Nick Drochak <ndrochak@gol.com>
28830 * makefile: remove 'response' file when cleaning.
28832 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28834 * cs-parser.jay: Report 1524.
28836 2002-01-14 Miguel de Icaza <miguel@ximian.com>
28838 * typemanager.cs (RegisterMethod): drop checking if we have
28839 registered this from here
28841 2002-01-12 Miguel de Icaza <miguel@ximian.com>
28843 * class.cs (Method.EmitDestructor): Implement calling our base
28846 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
28847 value of InFinally.
28849 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
28850 this routine and will wrap the call in a try/catch block. Deal
28853 2002-01-11 Miguel de Icaza <miguel@ximian.com>
28855 * ecore.cs (Expression.MemberLookup): instead of taking a
28856 parameter `same_type' that was used to tell whether we could
28857 access private members we compute our containing type from the
28860 (FieldExpr): Added partial support for volatile fields. This does
28861 not work for volatile fields exposed from assemblies, as I can not
28862 figure out how to extract the modreq from it.
28864 Updated all the source files to use this.
28866 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
28867 because it is referenced by MemberLookup very often.
28869 2002-01-09 Ravi Pratap <ravi@ximian.com>
28871 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
28872 TypeBuilder.GetCustomAttributes to retrieve what we need.
28874 Get rid of redundant default_member_attr_type as this is the same as
28875 default_member_type which already exists.
28877 * interface.cs, attribute.cs : Update accordingly.
28879 2002-01-08 Miguel de Icaza <miguel@ximian.com>
28881 * typemanager.cs: Enable IndexerPropertyName again. It does not
28882 work for TYpeBuilders though. Ravi, can you please fix this?
28884 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
28886 * expression.cs (Argument.Emit): Handle the case of ref objects
28887 being passed to ref functions;
28889 (ParameterReference.EmitLoad): Loads the content of the pointer
28890 without dereferencing.
28892 2002-01-07 Miguel de Icaza <miguel@ximian.com>
28894 * cs-tokenizer.cs: Implemented the pre-processing expressions.
28896 2002-01-08 Ravi Pratap <ravi@ximian.com>
28898 * class.cs (Indexer.DefineMethod): Incorporate the interface
28899 type in the name of the method if we are doing explicit interface
28902 * expression.cs (ConversionExists): Remove as it is completely obsolete.
28904 (BetterConversion): Fix extremely trivial bug where we were referring to
28905 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
28908 * ../errors/bug16.cs : Add although we have fixed it.
28910 2002-01-07 Miguel de Icaza <miguel@ximian.com>
28912 * expression.cs (BaseIndexer): Begin implementation.
28914 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
28916 * cs-parser.jay (indexer_declarator): Use qualified_identifier
28917 production directly to remove a shift/reduce, and implement
28918 explicit interface implementation.
28920 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
28921 after a floating point suffix.
28923 * expression.cs (DoNumericPromotions): Improved the conversion for
28924 uint/uint. If we have a constant, we avoid doing a typecast to a
28927 * class.cs (Indexer): Implement explicit interface implementation
28930 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
28932 * class.cs: make the default instance constructor public and hidebysig.
28934 2001-01-03 Ravi Pratap <ravi@ximian.com>
28936 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
28937 so we can call it from elsewhere.
28939 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
28940 we emit it internally if the class has a defined indexer; otherwise the user
28941 emits it by decorating the class definition with the DefaultMemberAttribute.
28943 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
28944 attribute is not used on a type which defines an indexer.
28946 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
28947 character when we skip whitespace.
28949 * ../errors/cs0646.cs : Add.
28951 2002-01-03 Miguel de Icaza <miguel@ximian.com>
28953 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
28956 * makefile: Add practical target `mcs3.exe' which builds the third
28957 generation compiler.
28959 * expression.cs (New): Fix structures constructor calling.
28961 * class.cs (Property, Method, Indexer): Emit Final flag on the
28962 method if we are an interface implementation and we are not
28965 * ecore.cs (PropertyExpr): New public field `IsBase', tells
28966 whether this property is referencing a `base' method.
28968 * expression.cs (Invocation.EmitCall): take an extra argument:
28969 is_base, this is used to determine whether the `call' or
28970 `callvirt' opcode should be used.
28973 * delegate.cs: update EmitCall.
28975 * class.cs (Method.Define): Set NewSlot for the cases where we are
28976 not implementing an interface method.
28978 (Property.Define): ditto.
28980 2002-01-02 Miguel de Icaza <miguel@ximian.com>
28982 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
28983 'r'. Allows mcs to parse itself fully.
28985 2002-01-02 Ravi Pratap <ravi@ximian.com>
28987 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
28988 of the number of initializers that require the InitializeArray method.
28990 (CheckIndices): Store the Expression in all cases - not the plain value. Also
28991 update the above field where necessary.
28993 (MakeByteBlob): Update accordingly.
28995 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
28998 (EmitDynamicInitializers): Update in accordance with the new optimization.
29000 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
29001 same OpCode applies.
29003 * cs-parser.jay : Fix some glaring errors I introduced.
29005 2002-01-01 Ravi Pratap <ravi@ximian.com>
29007 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
29008 so that we can check for name clashes there too.
29010 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
29011 for interface indexers.
29013 * interfaces.cs (Define): Emit the default member attribute.
29015 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
29016 variable was being referred to while setting the value ;-)
29018 2002-01-01 Miguel de Icaza <miguel@ximian.com>
29020 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
29021 byte-by-byte information when we know the data is zero.
29023 Make the block always a multiple of 4, because
29024 DefineInitializedData has a bug.
29026 * assign.cs: Fix, we should assign from the temporary, not from
29029 * expression.cs (MakeByteBlob): Fix my incorrect code.
29031 2001-12-31 Miguel de Icaza <miguel@ximian.com>
29033 * typemanager.cs (EnumToUnderlying): This function is used to get
29034 the underlying type from an enumeration, because it does not
29037 * constant.cs: Use the I4_S form for values between -128 and 127.
29039 * statement.cs (Block.LookupLabel): Looks up a label.
29040 (Block): Drop support for labeled blocks.
29042 (LabeledStatement): New kind of statement that represents a label
29045 (Goto): Finally implement this bad boy.
29047 * cs-parser.jay: Update to reflect new mechanism to implement
29050 2001-12-30 Miguel de Icaza <miguel@ximian.com>
29052 * codegen.cs (EmitContext.This): a codegen property that keeps the
29053 a single instance of this instead of creating many different this
29056 * delegate.cs (Delegate.DoResolve): Update to use the property;
29058 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
29060 * expression.cs (BaseAccess.DoResolve): Ditto.
29062 2001-12-29 Ravi Pratap <ravi@ximian.com>
29064 * typemanager.cs (methodimpl_attr_type): Add to hold the type
29065 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
29067 (InitCoreTypes): Update accordingly.
29069 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
29070 so we can quickly store the state.
29072 (ApplyAttributes): Set the correct implementation flags
29073 for InternalCall methods.
29075 2001-12-29 Miguel de Icaza <miguel@ximian.com>
29077 * expression.cs (EmitCall): if a method is not virtual, then do
29078 not use callvirt on it.
29080 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
29081 user defined stuff) requires the use of stobj, which takes an
29082 address on the stack instead of an array and an index. So emit
29083 the Ldelema operation for it.
29085 (EmitStoreOpcode): Use stobj for valuetypes.
29087 (UnaryMutator.EmitCode): Use the right 1 value depending on
29088 whether we are dealing with int64/uint64, float or doubles.
29090 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
29091 constructors that I implemented last night.
29093 (Constructor.IsDefault): Fix to work properly for static
29096 * cs-parser.jay (CheckDef): report method signature errors.
29097 Update error number 103 to be 132.
29099 * decl.cs: New AdditionResult enumeration value: MethodExists.
29100 Although we do this check for methods later on in the semantic
29101 analysis, catching repeated default constructors is so easy that
29102 we catch these here.
29104 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
29107 (ParameterReference.EmitAssign, Emit): handle
29110 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
29111 (ArrayAccess.EmitStoreOpcode): ditto.
29113 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
29115 * expression.cs (MakeByteBlob): Complete all the missing types
29116 (uint, short, ushort, byte, sbyte)
29118 * class.cs: Only init instance field initializers on instance
29121 Rename `constructors' to instance_constructors.
29123 (TypeContainer.AddConstructor): Only add constructors to the list
29124 if it is not static.
29126 Make sure that we handle default_static_constructor independently
29127 everywhere where we handle instance_constructors
29129 2001-12-28 Miguel de Icaza <miguel@ximian.com>
29131 * class.cs: Do not lookup or create a base initializer for a
29132 static constructor.
29134 (ConstructorInitializer.Resolve): use the proper type to lookup
29137 * cs-parser.jay: Report error 1585 (modifiers between type and name).
29139 * enum.cs, interface.cs: Remove CloseType, this is taken care by
29142 * decl.cs: CloseType is now an virtual method, the default
29143 implementation just closes this type.
29145 2001-12-28 Ravi Pratap <ravi@ximian.com>
29147 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
29148 to PreserveSig by default. Also emit HideBySig on such methods.
29150 Basically, set the defaults to standard values.
29152 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
29153 argument, if candidate is better, it can't be worse than the best !
29155 (Invocation): Re-write bits to differentiate between methods being
29156 applicable in their expanded form and their normal form - for params
29159 Get rid of use_standard everywhere as only standard conversions are allowed
29160 in overload resolution.
29162 More spec conformance.
29164 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29166 * driver.cs: Add --timestamp, to see where the compiler spends
29169 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
29170 `this' in static code.
29172 (SimpleName.DoResolve): Implement in terms of a helper function
29173 that allows static-references to be passed upstream to
29176 (Expression.ResolveWithSimpleName): Resolve specially simple
29177 names when called by MemberAccess to implement the special
29180 (Expression.ImplicitReferenceConversion): Handle conversions from
29181 Null to reference types before others, as Null's type is
29184 * expression.cs (Invocation.EmitCall): Handle the special case of
29185 calling methods declared on a reference type from a ValueType
29186 (Base classes System.Object and System.Enum)
29188 (MemberAccess.Resolve): Only perform lookups on Enumerations if
29189 the left hand side is a TypeExpr, not on every enumeration.
29191 (Binary.Resolve): If types are reference types, then do a cast to
29192 object on operators != and == of both arguments.
29194 * typemanager.cs (FindMembers): Extract instance and static
29195 members if requested.
29197 * interface.cs (PopulateProperty): Use void_type instead of null
29198 as the return type for the setter method.
29200 (PopulateIndexer): ditto.
29202 2001-12-27 Ravi Pratap <ravi@ximian.com>
29204 * support.cs (ReflectionParameters): Fix minor bug where we
29205 were examining the wrong parameter for the ParamArray attribute.
29207 Cope with requests for the type of the parameter at position
29208 greater than the params parameter's. We now return the element
29209 type of the params array as that makes more sense.
29211 * expression.cs (Invocation.IsParamsMethodApplicable): Update
29212 accordingly as we no longer have to extract the element type
29215 (Invocation.OverloadResolve): Update.
29217 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29219 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
29220 against IEnumerator, test whether the return value is a descendant
29221 of the IEnumerator interface.
29223 * class.cs (Indexer.Define): Use an auxiliary method to implement
29224 the other bits of the method definition. Begin support for
29225 explicit interface implementation.
29227 (Property.DefineMethod): Use TypeManager.void_type instead of null
29228 for an empty return value.
29230 2001-12-26 Miguel de Icaza <miguel@ximian.com>
29232 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
29233 dealing with a FieldExpr which is composed of a FieldBuilder, in
29234 the code path we did extract the constant, but we should have
29235 obtained the underlying value to be able to cast it (otherwise we
29236 end up in an infinite loop, this is what Ravi was running into).
29238 (ArrayCreation.UpdateIndices): Arrays might be empty.
29240 (MemberAccess.ResolveMemberAccess): Add support for section
29241 14.5.4.1 that deals with the special case of E.I when E is a type
29242 and something else, that I can be a reference to a static member.
29244 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
29245 handle a particular array type to create byte blobs, it is just
29246 something we dont generate byteblobs for.
29248 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
29251 * location.cs (Push): remove the key from the hashtable that we
29252 are about to add. This happens for empty files.
29254 * driver.cs: Dispose files after we have parsed them.
29256 (tokenize): new function that only runs the tokenizer on its
29257 input, for speed testing.
29259 2001-12-26 Ravi Pratap <ravi@ximian.com>
29261 * class.cs (Event.Define): Define the private field only if there
29262 are no accessors defined.
29264 * expression.cs (ResolveMemberAccess): If there is no associated
29265 field with the event, that means we have an event defined with its
29266 own accessors and we should flag error cs0070 since transforming
29267 ourselves into a field is not valid in that case.
29269 * ecore.cs (SimpleName.DoResolve): Same as above.
29271 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
29272 and charset to sane values.
29274 2001-12-25 Ravi Pratap <ravi@ximian.com>
29276 * assign.cs (DoResolve): Perform check on events only if they
29277 are being accessed outside the declaring type.
29279 * cs-parser.jay (event_declarations): Update rules to correctly
29280 set the type of the implicit parameter etc.
29282 (add_accessor, remove_accessor): Set current local parameters.
29284 * expression.cs (Binary): For delegate addition and subtraction,
29285 cast the return value from the method into the appropriate delegate
29288 2001-12-24 Ravi Pratap <ravi@ximian.com>
29290 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
29291 of these as the workaround is unnecessary.
29293 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
29294 delegate data - none of that is needed at all.
29296 Re-write bits to extract the instance expression and the delegate method
29299 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
29302 * attribute.cs (ApplyAttributes): New method to take care of common tasks
29303 of attaching attributes instead of duplicating code everywhere.
29305 * everywhere : Update code to do attribute emission using the above method.
29307 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29309 * expression.cs (IsParamsMethodApplicable): if there are not
29310 parameters, return immediately.
29312 * ecore.cs: The 0 literal can be implicity converted to an enum
29315 (SimpleName.DoResolve): First lookup the type, then lookup the
29318 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
29319 want to get its address. If the InstanceExpression is not
29320 addressable, store the result in a temporary variable, then get
29323 * codegen.cs: Only display 219 errors on warning level or above.
29325 * expression.cs (ArrayAccess): Make it implement the
29326 IMemoryLocation interface.
29328 (Binary.DoResolve): handle the operator == (object a, object b)
29329 and operator != (object a, object b) without incurring into a
29330 BoxedCast (because 5 != o should never be performed).
29332 Handle binary enumerator operators.
29334 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
29335 value type, otherwise use Ldelem_ref.
29337 Use precomputed names;
29339 (AddressOf): Implement address of
29341 * cs-parser.jay (labeled_statement): Fix recursive block
29342 addition by reworking the production.
29344 * expression.cs (New.DoEmit): New has a special case:
29346 If we are dealing with a ValueType, we have a few
29347 situations to deal with:
29349 * The target of New is a ValueType variable, that is
29350 easy, we just pass this as the variable reference
29352 * The target of New is being passed as an argument,
29353 to a boxing operation or a function that takes a
29356 In this case, we need to create a temporary variable
29357 that is the argument of New.
29360 2001-12-23 Ravi Pratap <ravi@ximian.com>
29362 * rootcontext.cs (LookupType): Check that current_type is not null before
29363 going about looking at nested types.
29365 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
29366 not implement the IAssignMethod interface any more.
29368 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
29369 where we tranform them into FieldExprs if they are being resolved from within
29370 the declaring type.
29372 * ecore.cs (SimpleName.DoResolve): Do the same here.
29374 * assign.cs (DoResolve, Emit): Clean up code considerably.
29376 * ../errors/bug10.cs : Add.
29378 * ../errors/cs0070.cs : Add.
29380 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
29382 * assign.cs : Get rid of EventIsLocal everywhere.
29384 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29386 * ecore.cs (ConvertIntLiteral): finished the implementation.
29388 * statement.cs (SwitchLabel): Convert the value we are using as a
29389 key before looking up the table.
29391 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29393 * codegen.cs (EmitTopBlock): Require a Location argument now.
29395 * cs-parser.jay (constructor_declarator): We need to setup
29396 current_local_parameters before we parse the
29397 opt_constructor_initializer, to allow the variables to be bound
29398 to the constructor arguments.
29400 * rootcontext.cs (LookupType): First lookup nested classes in our
29401 class and our parents before we go looking outside our class.
29403 * expression.cs (ConstantFold): Extract/debox the values at the
29406 * rootcontext.cs (EmitCode): Resolve the constants first before we
29407 resolve the types. This is not really needed, but it helps debugging.
29409 * statement.cs: report location.
29411 * cs-parser.jay: pass location to throw statement.
29413 * driver.cs: Small bug fix.
29415 * report.cs: Updated format to be 4-zero filled digits.
29417 2001-12-22 Ravi Pratap <ravi@ximian.com>
29419 * expression.cs (CheckIndices): Fix minor bug where the wrong
29420 variable was being referred to ;-)
29422 (DoEmit): Do not call EmitStaticInitializers when the
29423 underlying type is System.Object.
29425 2001-12-21 Ravi Pratap <ravi@ximian.com>
29427 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
29428 and do the usual workaround for SRE.
29430 * class.cs (MyEventBuilder.EventType): New member to get at the type
29431 of the event, quickly.
29433 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
29435 * assign.cs (Assign.DoResolve): Handle the case when the target
29436 is an EventExpr and perform the necessary checks.
29438 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
29441 (SimpleName.MemberStaticCheck): Include check for EventExpr.
29443 (EventExpr): Set the type in the constructor itself since we
29444 are meant to be born fully resolved.
29446 (EventExpr.Define): Revert code I wrote earlier.
29448 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
29449 instance expression is null. The instance expression is a This in that case
29450 or a null, depending on whether it is a static method or not.
29452 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
29453 refers to more than one method.
29455 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
29456 and accordingly flag errors.
29458 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29460 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
29462 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29464 * location.cs (ToString): Provide useful rutine.
29466 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29468 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
29469 objects, return the actual integral boxed.
29471 * statement.cs (SwitchLabel): define an ILLabel for each
29474 (Switch.CheckSwitch): If the value is a Literal, extract
29475 the underlying literal.
29477 Also in the unused hashtable we had, add the SwitchLabel so we can
29478 quickly look this value up.
29480 * constant.cs: Implement a bunch of new constants. Rewrite
29481 Literal based on this. Made changes everywhere to adapt to this.
29483 * expression.cs (Expression.MakeByteBlob): Optimize routine by
29484 dereferencing array only once, and also copes with enumrations.
29486 bytes are two bytes wide, not one.
29488 (Cast): Perform constant conversions.
29490 * ecore.cs (TryImplicitIntConversion): Return literals instead of
29491 wrappers to the literals here.
29493 * expression.cs (DoNumericPromotions): long literals can converted
29494 to ulong implicity (this is taken care of elsewhere, but I was
29495 missing this spot).
29497 * ecore.cs (Expression.Literalize): Make the return type Literal,
29498 to improve type checking.
29500 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
29502 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29504 * literal.cs: Revert code from ravi that checked the bounds. The
29505 bounds are sane by the definition of the type itself.
29507 * typemanager.cs: Fix implementation of ImplementsInterface. We
29508 need to actually look up in our parent hierarchy for interfaces
29511 * const.cs: Use the underlying type for enumerations
29513 * delegate.cs: Compute the basename for the delegate creation,
29514 that should fix the delegate test case, and restore the correct
29515 Type Lookup semantics in rootcontext
29517 * rootcontext.cs: Revert Ravi's last patch. The correct way of
29518 referencing a nested type with the Reflection API is using the "+"
29521 * cs-parser.jay: Do not require EOF token at the end.
29523 2001-12-20 Ravi Pratap <ravi@ximian.com>
29525 * rootcontext.cs (LookupType): Concatenate type names with
29526 a '.' instead of a '+' The test suite passes again.
29528 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
29529 field of the enumeration.
29531 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
29532 the case when the member is an EventExpr.
29534 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
29535 static has an associated instance expression.
29537 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
29539 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
29541 * class.cs (Event.Define): Register event and perform appropriate checks
29544 We define the Add and Remove methods even if the use provides none because
29545 in that case, we provide default implementations ourselves.
29547 Define a private field of the type of the event. This is done by the CSC compiler
29548 and we should be doing it too ;-)
29550 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
29551 More methods we use in code we generate.
29553 (multicast_delegate_type, delegate_type): Two separate types since the distinction
29556 (InitCoreTypes): Update accordingly for the above.
29558 * class.cs (Event.Emit): Generate code for default accessors that we provide
29560 (EmitDefaultMethod): Do the job in the above.
29562 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
29565 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29567 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
29568 builders even if we were missing one.
29570 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
29571 pass the Basename as our class name instead of the Name. The
29572 basename will be correctly composed for us.
29574 * parameter.cs (Paramters): Now takes a Location argument.
29576 * decl.cs (DeclSpace.LookupType): Removed convenience function and
29577 make all the code call directly LookupType in RootContext and take
29578 this chance to pass the Location information everywhere.
29580 * Everywhere: pass Location information.
29582 2001-12-19 Miguel de Icaza <miguel@ximian.com>
29584 * class.cs (Constructor.Define): Updated way of detecting the
29585 length of the parameters.
29587 (TypeContainer.DefineType): Use basename as the type name for
29590 (TypeContainer.Define): Do not recursively define types here, as
29591 definition is taken care in order by the RootContext.
29593 * tree.cs: Keep track of namespaces in a per-file basis.
29595 * parameter.cs (Parameter.ComputeSignature): Update to use
29598 (Parameters.GetSignature): ditto.
29600 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
29601 instead of a TypeContainer.
29603 (Interface.SemanticAnalysis): Use `this' instead of our parent to
29604 resolve names. Because we need to be resolve in our context, not
29607 * driver.cs: Implement response files.
29609 * class.cs (TypeContainer.DefineType): If we are defined, do not
29610 redefine ourselves.
29612 (Event.Emit): Emit the code for add/remove handlers.
29613 (Event.Define): Save the MethodBuilders for add/remove.
29615 * typemanager.cs: Use pair here too.
29617 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
29618 DictionaryEntry requires the first argument to be non-null.
29620 (enum_declaration): Compute full name for registering the
29623 (delegate_declaration): Instead of using
29624 formal_parameter_list, use opt_formal_parameter_list as the list
29627 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
29628 (EventParsing): New property that controls whether `add' and
29629 `remove' are returned as tokens or identifiers (for events);
29631 2001-12-19 Ravi Pratap <ravi@ximian.com>
29633 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
29634 use MyEventBuilder only and let it wrap the real builder for us.
29636 (MyEventBuilder): Revamp constructor etc.
29638 Implement all operations that we perform on EventBuilder in precisely the same
29641 (FindMembers): Update to use the EventBuilder member.
29643 (Event.Emit): Update accordingly.
29645 2001-12-18 Ravi Pratap <ravi@ximian.com>
29647 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
29648 by calling the appropriate methods.
29650 (GetCustomAttributes): Make stubs as they cannot possibly do anything
29653 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
29655 2001-12-17 Ravi Pratap <ravi@ximian.com>
29657 * delegate.cs (Delegate.Populate): Check that the return type
29658 and various parameters types are indeed accessible.
29660 * class.cs (Constructor.Define): Same here.
29662 (Field.Define): Ditto.
29664 (Event.Define): Ditto.
29666 (Operator.Define): Check that the underlying Method defined itself
29667 correctly - so it's MethodBuilder should not be null.
29669 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
29670 expression happens to be null.
29672 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
29673 members but as of now we don't seem to be able to do anything really useful with it.
29675 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
29676 not the EventBuilder.
29678 2001-12-18 Miguel de Icaza <miguel@ximian.com>
29680 * cs-tokenizer.cs: Add support for defines.
29681 Add support for #if, #elif, #else, #endif
29683 (eval_var): evaluates a variable.
29684 (eval): stubbed for evaluating functions.
29686 * cs-parser.jay: Pass the defines information
29688 * driver.cs: Add --define command line option.
29690 * decl.cs: Move MemberCore here.
29692 Make it the base class for DeclSpace. This allows us to catch and
29693 report 108 and 109 for everything now.
29695 * class.cs (TypeContainer.Define): Extract all the members
29696 before populating and emit the warning 108 (new keyword required
29697 to override) instead of having each member implement this.
29699 (MemberCore.Define): New abstract method, we will be using this in
29700 the warning reporting engine in Populate.
29702 (Operator.Define): Adjust to new MemberCore protocol.
29704 * const.cs (Const): This does not derive from Expression, it is a
29705 temporary object we use to create fields, it is a MemberCore.
29707 * class.cs (Method.Define): Allow the entry point to be in a
29710 * driver.cs: Rewrite the argument handler to clean it up a bit.
29712 * rootcontext.cs: Made it just an auxiliary namespace feature by
29713 making everything static.
29715 * driver.cs: Adapt code to use RootContext type name instead of
29718 * delegate.cs: Remove RootContext argument.
29720 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
29723 * class.cs (Event.Define): The lookup can fail.
29725 * cs-tokenizer.cs: Begin implementation of pre-procesor.
29727 * expression.cs: Resolve the this instance before invoking the code.
29729 2001-12-17 Miguel de Icaza <miguel@ximian.com>
29731 * cs-parser.jay: Add a production in element_access that allows
29732 the thing to become a "type" reference. This way we can parse
29733 things like "(string [])" as a type.
29735 Note that this still does not handle the more complex rules of
29739 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
29741 * ecore.cs: (CopyNewMethods): new utility function used to
29742 assemble the list of methods from running FindMembers.
29744 (MemberLookup): Rework FindMembers so that
29746 2001-12-16 Miguel de Icaza <miguel@ximian.com>
29748 * class.cs (TypeContainer): Remove Delegates who fail to be
29751 * delegate.cs (Populate): Verify that we dont get null return
29752 values. TODO: Check for AsAccessible.
29754 * cs-parser.jay: Use basename to emit error 574 (destructor should
29755 have the same name as container class), not the full name.
29757 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
29758 possible representation.
29760 Also implements integer type suffixes U and L.
29762 2001-12-15 Miguel de Icaza <miguel@ximian.com>
29764 * expression.cs (ArrayCreation.DoResolve): We need to do the
29765 argument resolution *always*.
29767 * decl.cs: Make this hold the namespace. Hold the root context as
29769 (LookupType): Move here.
29771 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
29773 * location.cs (Row, Name): Fixed the code, it was always returning
29774 references to the first file.
29776 * interface.cs: Register properties defined through interfaces.
29778 * driver.cs: Add support for globbing on the command line
29780 * class.cs (Field): Make it derive from MemberCore as well.
29783 2001-12-15 Ravi Pratap <ravi@ximian.com>
29785 * class.cs (Event::Define): Check that the type of the event is a delegate
29786 type else flag error #66.
29788 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
29791 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
29792 values of EntryPoint, CharSet etc etc.
29794 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
29796 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
29797 be null and we should ignore this. I am not sure if this is really clean. Apparently,
29798 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
29799 which needs this to do its work.
29801 * ../errors/cs0066.cs : Add.
29803 2001-12-14 Miguel de Icaza <miguel@ximian.com>
29805 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
29808 * class.cs: (MethodSignature.MethodSignature): Removed hack that
29809 clears out the parameters field.
29810 (MemberSignatureCompare): Cleanup
29812 (MemberCore): New base class used to share code between MethodCore
29815 (RegisterRequiredImplementations) BindingFlags.Public requires
29816 either BindingFlags.Instace or Static. Use instance here.
29818 (Property): Refactored code to cope better with the full spec.
29820 * parameter.cs (GetParameterInfo): Return an empty array instead
29823 * class.cs (Property): Abstract or extern properties have no bodies.
29825 * parameter.cs (GetParameterInfo): return a zero-sized array.
29827 * class.cs (TypeContainer.MethodModifiersValid): Move all the
29828 method modifier validation to the typecontainer so we can reuse
29829 this on properties.
29831 (MethodCore.ParameterTypes): return an empty sized array of types.
29833 (Property.Define): Test property modifier validity.
29835 Add tests for sealed/override too.
29837 (Method.Emit): abstract or extern methods have no bodies.
29839 2001-12-14 Ravi Pratap <ravi@ximian.com>
29841 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
29844 (Method::Define, ::Emit): Modify accordingly.
29846 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
29848 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
29850 * makefile: Pass in /unsafe.
29852 2001-12-13 Miguel de Icaza <miguel@ximian.com>
29854 * class.cs (MakeKey): Kill routine.
29856 * class.cs (TypeContainer.Define): Correctly define explicit
29857 method implementations (they require the full interface name plus
29860 * typemanager.cs: Deply the PtrHashtable here and stop using the
29861 lame keys. Things work so much better.
29863 This of course broke everyone who depended on `RegisterMethod' to
29864 do the `test for existance' test. This has to be done elsewhere.
29866 * support.cs (PtrHashtable): A hashtable that avoid comparing with
29867 the object stupid Equals method (because, that like fails all over
29868 the place). We still do not use it.
29870 * class.cs (TypeContainer.SetRequiredInterface,
29871 TypeContainer.RequireMethods): Killed these two routines and moved
29872 all the functionality to RegisterRequiredImplementations.
29874 (TypeContainer.RegisterRequiredImplementations): This routine now
29875 registers all the implementations required in an array for the
29876 interfaces and abstract methods. We use an array of structures
29877 which can be computed ahead of time to reduce memory usage and we
29878 also assume that lookups are cheap as most classes will not
29879 implement too many interfaces.
29881 We also avoid creating too many MethodSignatures.
29883 (TypeContainer.IsInterfaceMethod): Update and optionally does not
29884 clear the "pending" bit if we find that there are problems with
29887 (TypeContainer.VerifyPendingMethods): Update to report errors of
29888 methods that look like implementations but are not.
29890 (TypeContainer.Define): Add support for explicit interface method
29893 2001-12-12 Miguel de Icaza <miguel@ximian.com>
29895 * typemanager.cs: Keep track of the parameters here instead of
29896 being a feature of the TypeContainer.
29898 * class.cs: Drop the registration of parameters here, as
29899 InterfaceMethods are also interface declarations.
29901 * delegate.cs: Register methods with the TypeManager not only with
29902 the TypeContainer. This code was buggy.
29904 * interface.cs: Full registation here.
29906 2001-12-11 Miguel de Icaza <miguel@ximian.com>
29908 * expression.cs: Remove reducer for binary expressions, it can not
29911 * const.cs: Put here the code that used to go into constant.cs
29913 * constant.cs: Put here the code for constants, this is a new base
29914 class for Literals.
29916 * literal.cs: Make Literal derive from Constant.
29918 2001-12-09 Miguel de Icaza <miguel@ximian.com>
29920 * statement.cs (Return.Emit): Report error 157 if the user
29921 attempts to return from a finally block.
29923 (Return.Emit): Instead of emitting a return, jump to the end of
29926 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
29927 LocalBuilder to store the result of the function. ReturnLabel is
29928 the target where we jump.
29931 2001-12-09 Radek Doulik <rodo@ximian.com>
29933 * cs-parser.jay: remember alias in current namespace
29935 * ecore.cs (SimpleName::DoResolve): use aliases for types or
29938 * class.cs (LookupAlias): lookup alias in my_namespace
29940 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
29942 (LookupAlias): lookup alias in this and if needed in parent
29945 2001-12-08 Miguel de Icaza <miguel@ximian.com>
29949 * rootcontext.cs: (ModuleBuilder) Made static, first step into
29950 making things static. I need this to avoid passing the
29951 TypeContainer when calling ParameterType.
29953 * support.cs (InternalParameters.ParameterType): Remove ugly hack
29954 that did string manipulation to compute the type and then call
29955 GetType. Use Parameter.ParameterType instead.
29957 * cs-tokenizer.cs: Consume the suffix for floating values.
29959 * expression.cs (ParameterReference): figure out whether this is a
29960 reference parameter or not. Kill an extra variable by computing
29961 the arg_idx during emission.
29963 * parameter.cs (Parameters.GetParameterInfo): New overloaded
29964 function that returns whether a parameter is an out/ref value or not.
29966 (Parameter.ParameterType): The type of the parameter (base,
29967 without ref/out applied).
29969 (Parameter.Resolve): Perform resolution here.
29970 (Parameter.ExternalType): The full type (with ref/out applied).
29972 * statement.cs (Using.Emit, Using.EmitExpression): Implement
29973 support for expressions on the using statement.
29975 2001-12-07 Miguel de Icaza <miguel@ximian.com>
29977 * statement.cs (Using.EmitLocalVariableDecls): Split the
29978 localvariable handling of the using statement.
29980 (Block.EmitMeta): Keep track of variable count across blocks. We
29981 were reusing slots on separate branches of blocks.
29983 (Try.Emit): Emit the general code block, we were not emitting it.
29985 Check the type of the declaration to be an IDisposable or
29986 something that can be implicity converted to it.
29988 Emit conversions if required.
29990 * ecore.cs (EmptyExpression): New utility class.
29991 (Expression.ImplicitConversionExists): New utility function.
29993 2001-12-06 Miguel de Icaza <miguel@ximian.com>
29995 * statement.cs (Using): Implement.
29997 * expression.cs (LocalVariableReference): Support read only variables.
29999 * statement.cs: Remove the explicit emit for the Leave opcode.
30000 (VariableInfo): Add a readonly field.
30002 2001-12-05 Miguel de Icaza <miguel@ximian.com>
30004 * ecore.cs (ConvCast): new class used to encapsulate the various
30005 explicit integer conversions that works in both checked and
30006 unchecked contexts.
30008 (Expression.ConvertNumericExplicit): Use new ConvCast class to
30009 properly generate the overflow opcodes.
30011 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30013 * statement.cs: The correct type for the EmptyExpression is the
30014 element_type, not the variable type. Ravi pointed this out.
30016 2001-12-04 Ravi Pratap <ravi@ximian.com>
30018 * class.cs (Method::Define): Handle PInvoke methods specially
30019 by using DefinePInvokeMethod instead of the usual one.
30021 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
30022 above to do the task of extracting information and defining the method.
30024 2001-12-04 Ravi Pratap <ravi@ximian.com>
30026 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
30027 of the condition for string type.
30029 (Emit): Move that here.
30031 (ArrayCreation::CheckIndices): Keep string literals in their expression
30034 (EmitDynamicInitializers): Handle strings appropriately.
30036 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30038 * codegen.cs (EmitContext): Replace multiple variables with a
30039 single pointer to the current Switch statement.
30041 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
30044 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30048 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
30051 (Foreach.Emit): Foreach on arrays was not setting
30052 up the loop variables (for break/continue).
30054 (GotoCase): Semi-implented.
30056 2001-12-03 Ravi Pratap <ravi@ximian.com>
30058 * attribute.cs (CheckAttribute): Handle system attributes by using
30059 Attribute.GetAttributes to examine information we need.
30061 (GetValidPlaces): Same here.
30063 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
30065 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
30067 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
30069 (Method::Define): Set appropriate flags if we have a DllImport attribute.
30071 (Method::Emit): Handle the case when we are a PInvoke method.
30073 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30075 * expression.cs: Use ResolveWithSimpleName on compound names.
30077 2001-12-02 Ravi Pratap <ravi@ximian.com>
30079 * constant.cs (EmitConstant): Make sure we resolve the associated expression
30080 before trying to reduce it.
30082 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
30084 * constant.cs (LookupConstantValue): Implement.
30086 (EmitConstant): Use the above in emitting the constant.
30088 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
30089 that are user-defined by doing a LookupConstantValue on them.
30091 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
30094 2001-11-29 Miguel de Icaza <miguel@ximian.com>
30096 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
30098 (BaseAccess.DoResolve): Implement.
30100 (MemberAccess.DoResolve): Split this routine into a
30101 ResolveMemberAccess routine that can be used independently
30103 2001-11-28 Miguel de Icaza <miguel@ximian.com>
30105 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
30106 As that share bits of the implementation. Is returns a boolean,
30107 while As returns the Type that is being probed.
30109 2001-12-01 Ravi Pratap <ravi@ximian.com>
30111 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
30112 instead of a Literal - much easier.
30114 (EnumInTransit): Remove - utterly useless :-)
30116 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
30118 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
30120 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
30121 chain when we have no associated expression.
30123 2001-11-30 Ravi Pratap <ravi@ximian.com>
30125 * constant.cs (Define): Use Location while reporting the errror.
30127 Also emit a warning when 'new' is used and there is no inherited
30130 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
30133 (LookupEnumValue): Implement to lookup an enum member's value and define it
30136 (Populate): Re-write accordingly to use the above routine.
30138 2001-11-27 Miguel de Icaza <miguel@ximian.com>
30140 * expression.cs (This): Fix prototype for DoResolveLValue to
30141 override the base class DoResolveLValue.
30143 * cs-parser.cs: Report errors cs574 and cs575 (destructor
30146 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
30147 (we need to load the address of the field here). This fixes
30150 (FieldExpr.DoResolveLValue): Call the DoResolve
30151 function to initialize the Instance expression.
30153 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
30154 correctly the GetEnumerator operation on a value type.
30156 * cs-parser.jay: Add more simple parsing error catches.
30158 * statement.cs (Switch): Add support for string switches.
30159 Handle null specially.
30161 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
30163 2001-11-28 Ravi Pratap <ravi@ximian.com>
30165 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
30167 (declare_local_constant): New helper function.
30169 * statement.cs (AddConstant): Keep a separate record of constants
30171 (IsConstant): Implement to determine if a variable is a constant.
30173 (GetConstantExpression): Implement.
30175 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
30177 * statement.cs (IsVariableDefined): Re-write.
30179 2001-11-27 Ravi Pratap <ravi@ximian.com>
30181 * class.cs (TypeContainer::FindMembers): Look for constants
30182 in the case when we are looking for MemberTypes.Field
30184 * expression.cs (MemberAccess::DoResolve): Check that in the
30185 case we are a FieldExpr and a Literal, we are not being accessed
30186 by an instance reference.
30188 * cs-parser.jay (local_constant_declaration): Implement.
30190 (declaration_statement): Implement for constant declarations.
30192 2001-11-26 Miguel de Icaza <miguel@ximian.com>
30194 * statement.cs (Switch): Catch double defaults.
30196 (Switch): More work on the switch() statement
30197 implementation. It works for integral values now, need to finish
30201 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30203 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
30204 integer literals into other integer literals. To be used by
30207 2001-11-24 Ravi Pratap <ravi@ximian.com>
30209 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
30212 (EmitDynamicInitializers): Cope with the above since we extract data
30213 directly from ArrayData now.
30215 (ExpectInitializers): Keep track of whether initializers are mandatory
30218 (Bounds): Make it a hashtable to prevent the same dimension being
30219 recorded for every element in that dimension.
30221 (EmitDynamicInitializers): Fix bug which prevented the Set array method
30224 Also fix bug which was causing the indices to be emitted in the reverse
30227 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30229 * expression.cs (ArrayCreation): Implement the bits that Ravi left
30230 unfinished. They do not work, because the underlying code is
30233 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30235 * cs-parser.jay: Remove bogus fixme.
30237 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
30238 on Switch statement.
30240 2001-11-23 Ravi Pratap <ravi@ximian.com>
30242 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
30245 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
30246 parameter. Apparently, any expression is allowed.
30248 (ValidateInitializers): Update accordingly.
30250 (CheckIndices): Fix some tricky bugs thanks to recursion.
30252 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
30253 I was being completely brain-dead.
30255 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
30256 and re-write acordingly.
30258 (DelegateInvocation): Re-write accordingly.
30260 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
30262 (MakeByteBlob): Handle types more correctly.
30264 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
30265 initialization from expressions but it is incomplete because I am a complete
30268 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30270 * statement.cs (If.Emit): Fix a bug that generated incorrect code
30271 on If. Basically, we have to return `true' (ie, we do return to
30272 our caller) only if both branches of the if return.
30274 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
30275 short-circuit operators, handle them as short circuit operators.
30277 (Cast.DoResolve): Resolve type.
30278 (Cast.Cast): Take an expression as the target type.
30280 * cs-parser.jay (cast_expression): Remove old hack that only
30281 allowed a limited set of types to be handled. Now we take a
30282 unary_expression and we resolve to a type during semantic
30285 Use the grammar productions from Rhys to handle casts (this is
30286 not complete like Rhys syntax yet, we fail to handle that corner
30287 case that C# has regarding (-x), but we will get there.
30289 2001-11-22 Ravi Pratap <ravi@ximian.com>
30291 * class.cs (EmitFieldInitializer): Take care of the case when we have a
30292 field which is an array type.
30294 * cs-parser.jay (declare_local_variables): Support array initialization too.
30296 * typemanager.cs (MakeKey): Implement.
30298 (everywhere): Use the above appropriately.
30300 * cs-parser.jay (for_statement): Update for array initialization while
30301 declaring variables.
30303 * ecore.cs : The error message was correct, it's the variable's names that
30304 were misleading ;-) Make the code more readable.
30306 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
30307 the correct type etc.
30309 (ConvertExplicit): Handle Enum types by examining the underlying type.
30311 2001-11-21 Ravi Pratap <ravi@ximian.com>
30313 * parameter.cs (GetCallingConvention): Always return
30314 CallingConventions.Standard for now.
30316 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30318 * expression.cs (Binary.ResolveOperator): Update the values of `l'
30319 and `r' after calling DoNumericPromotions.
30321 * ecore.cs: Fix error message (the types were in the wrong order).
30323 * statement.cs (Foreach.ProbeCollectionType): Need to pass
30324 BindingFlags.Instance as well
30326 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
30327 implicit int literal conversion in an empty cast so that we
30328 propagate the right type upstream.
30330 (UnboxCast): new class used to unbox value types.
30331 (Expression.ConvertExplicit): Add explicit type conversions done
30334 (Expression.ImplicitNumericConversion): Oops, forgot to test for
30335 the target type before applying the implicit LongLiterals to ULong
30338 2001-11-21 Miguel de Icaza <miguel@ximian.com>
30340 * cs-parser.jay (for_statement): Reworked the way For works: now
30341 we declare manually any variables that are introduced in
30342 for_initializer to solve the problem of having out-of-band code
30343 emition (that is what got for broken).
30345 (declaration_statement): Perform the actual variable declaration
30346 that used to be done in local_variable_declaration here.
30348 (local_variable_declaration): Do not declare anything, just pass
30349 the information on a DictionaryEntry
30351 2001-11-20 Ravi Pratap <ravi@ximian.com>
30353 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
30354 re-write of the logic to now make it recursive.
30356 (UpdateIndices): Re-write accordingly.
30358 Store element data in a separate ArrayData list in the above methods.
30360 (MakeByteBlob): Implement to dump the array data into a byte array.
30362 2001-11-19 Ravi Pratap <ravi@ximian.com>
30364 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
30367 * constant.cs (Define): Implement.
30369 (EmitConstant): Re-write fully.
30371 Pass in location info.
30373 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
30376 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
30377 DictionaryEntry since we need location info too.
30379 (constant_declaration): Update accordingly.
30381 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
30382 code into another method : UpdateIndices.
30384 2001-11-18 Ravi Pratap <ravi@ximian.com>
30386 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
30387 some type checking etc.
30389 2001-11-17 Ravi Pratap <ravi@ximian.com>
30391 * expression.cs (ArrayCreation::ValidateInitializers): Implement
30392 bits to provide dimension info if the user skips doing that.
30394 Update second constructor to store the rank correctly.
30396 2001-11-16 Ravi Pratap <ravi@ximian.com>
30398 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
30399 and try to implement.
30401 * ../errors/cs0150.cs : Add.
30403 * ../errors/cs0178.cs : Add.
30405 2001-11-16 Miguel de Icaza <miguel@ximian.com>
30407 * statement.cs: Implement foreach on multi-dimensional arrays.
30409 * parameter.cs (Parameters.GetParameterByName): Also lookup the
30410 name of the params argument.
30412 * expression.cs: Use EmitStoreOpcode to get the right opcode while
30413 initializing the array.
30415 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
30416 we can use this elsewhere.
30418 * statement.cs: Finish implementation of foreach for single
30421 * cs-parser.jay: Use an out-of-band stack to pass information
30422 around, I wonder why I need this.
30424 foreach_block: Make the new foreach_block the current_block.
30426 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
30427 function used to return a static Parameters structure. Used for
30428 empty parameters, as those are created very frequently.
30430 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
30432 2001-11-15 Ravi Pratap <ravi@ximian.com>
30434 * interface.cs : Default modifier is private, not public. The
30435 make verify test passes again.
30437 2001-11-15 Ravi Pratap <ravi@ximian.com>
30439 * support.cs (ReflectionParameters): Fix logic to determine
30440 whether the last parameter is a params one. Test 9 passes again.
30442 * delegate.cs (Populate): Register the builders we define with
30443 RegisterParameterForBuilder. Test 19 passes again.
30445 * cs-parser.jay (property_declaration): Reference $6 instead
30446 of $$ to get at the location.
30448 (indexer_declaration): Similar stuff.
30450 (attribute): Ditto.
30452 * class.cs (Property): Register parameters for the Get and Set methods
30453 if they exist. Test 23 passes again.
30455 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
30456 call to EmitArguments as we are sure there aren't any params arguments.
30457 Test 32 passes again.
30459 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
30460 IndexOutOfRangeException.
30462 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
30463 Test 33 now passes again.
30465 2001-11-15 Miguel de Icaza <miguel@ximian.com>
30467 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
30468 broke a bunch of things. Will have to come up with a better way
30469 of tracking locations.
30471 * statement.cs: Implemented foreach for single dimension arrays.
30473 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30475 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
30476 an error. This removes the lookup from the critical path.
30478 * cs-parser.jay: Removed use of temporary_loc, which is completely
30481 2001-11-14 Miguel de Icaza <miguel@ximian.com>
30483 * support.cs (ReflectionParameters.ParameterModifier): Report
30484 whether the argument is a PARAMS argument or not.
30486 * class.cs: Set the attribute `ParamArrayAttribute' on the
30487 parameter argument.
30489 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
30490 and cons_param_array_attribute (ConstructorInfo for
30491 ParamArrayAttribute).,
30493 * codegen.cs: Emit the return using the `Return' statement, that
30494 way we can report the error correctly for missing return values.
30496 * class.cs (Method.Emit): Clean up.
30498 * expression.cs (Argument.Resolve): Take another argument: the
30499 location where this argument is used. Notice that this is not
30500 part of the "Argument" class as to reduce the size of the
30501 structure (we know the approximate location anyways).
30503 Test if the argument is a variable-reference, if not, then
30504 complain with a 206.
30506 (Argument.Emit): Emit addresses of variables.
30508 (Argument.FullDesc): Simplify.
30510 (Invocation.DoResolve): Update for Argument.Resolve.
30512 (ElementAccess.DoResolve): ditto.
30514 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
30515 method should be virtual, as this method is always virtual.
30517 (NewDelegate.DoResolve): Update for Argument.Resolve.
30519 * class.cs (ConstructorInitializer.DoResolve): ditto.
30521 * attribute.cs (Attribute.Resolve): ditto.
30523 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30525 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
30527 * expression.cs (ParameterReference): Drop IStackStorage and implement
30528 IAssignMethod instead.
30530 (LocalVariableReference): ditto.
30532 * ecore.cs (FieldExpr): Drop IStackStorage and implement
30533 IAssignMethod instead.
30535 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30537 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
30538 enumerations that are used in heavily used structures derive from
30539 byte in a laughable and pathetic attempt to reduce memory usage.
30540 This is the kind of pre-optimzations that you should not do at
30541 home without adult supervision.
30543 * expression.cs (UnaryMutator): New class, used to handle ++ and
30544 -- separatedly from the other unary operators. Cleans up the
30545 code, and kills the ExpressionStatement dependency in Unary.
30547 (Unary): Removed `method' and `Arguments' from this class, making
30548 it smaller, and moving it all to SimpleCall, so I can reuse this
30549 code in other locations and avoid creating a lot of transient data
30550 strucutres when not required.
30552 * cs-parser.jay: Adjust for new changes.
30554 2001-11-11 Miguel de Icaza <miguel@ximian.com>
30556 * enum.cs (Enum.Populate): If there is a failure during
30559 * cs-parser.jay (opt_enum_base): we used to catch type errors
30560 here, but this is really incorrect. The type error should be
30561 catched during semantic analysis.
30563 2001-12-11 Ravi Pratap <ravi@ximian.com>
30565 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
30566 current_local_parameters as expected since I, in my stupidity, had forgotten
30569 * attribute.cs (GetValidPlaces): Fix stupid bug.
30571 * class.cs (Method::Emit): Perform check on applicability of attributes.
30573 (Constructor::Emit): Ditto.
30575 (Field::Emit): Ditto.
30577 (Field.Location): Store location information.
30579 (Property, Event, Indexer, Operator): Ditto.
30581 * cs-parser.jay (field_declaration): Pass in location for each field.
30583 * ../errors/cs0592.cs : Add.
30585 2001-11-12 Ravi Pratap <ravi@ximian.com>
30587 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
30589 (InitCoreTypes): Update accordingly.
30591 (RegisterAttrType, LookupAttr): Implement.
30593 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
30594 info about the same.
30596 (Resolve): Update to populate the above as necessary.
30598 (Error592): Helper.
30600 (GetValidPlaces): Helper to the above.
30602 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
30604 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
30606 2001-11-12 Ravi Pratap <ravi@ximian.com>
30608 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
30610 * ../errors/cs0617.cs : Add.
30612 2001-11-11 Ravi Pratap <ravi@ximian.com>
30614 * enum.cs (Emit): Rename to Populate to be more consistent with what
30615 we expect it to do and when exactly it is called.
30617 * class.cs, rootcontext.cs : Update accordingly.
30619 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
30620 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
30622 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
30624 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
30625 of a fieldinfo using the above, when dealing with a FieldBuilder.
30627 2001-11-10 Ravi Pratap <ravi@ximian.com>
30629 * ../errors/cs0031.cs : Add.
30631 * ../errors/cs1008.cs : Add.
30633 * ../errrors/cs0543.cs : Add.
30635 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
30638 (FindMembers): Implement.
30640 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
30641 enums and delegates too.
30643 (enum_types): Rename to builder_to_enum.
30645 (delegate_types): Rename to builder_to_delegate.
30647 * delegate.cs (FindMembers): Implement.
30649 2001-11-09 Ravi Pratap <ravi@ximian.com>
30651 * typemanager.cs (IsEnumType): Implement.
30653 * enum.cs (Emit): Re-write parts to account for the underlying type
30654 better and perform checking etc.
30656 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
30657 of the underlying type.
30659 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
30662 * enum.cs (error31): Helper to report error #31.
30664 * cs-parser.jay (enum_declaration): Store location of each member too.
30666 * enum.cs (member_to_location): New hashtable.
30668 (AddEnumMember): Update location hashtable.
30670 (Emit): Use the location of each member while reporting errors.
30672 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30674 * cs-parser.jay: A for_initializer if is a
30675 local_variable_declaration really ammount to have an implicit
30676 block with the variable declaration and no initializer for for.
30678 * statement.cs (For.Emit): Cope with null initializers.
30680 This fixes the infinite loop on for initializers.
30682 2001-11-08 Miguel de Icaza <miguel@ximian.com>
30684 * enum.cs: More cleanup.
30686 * ecore.cs: Remove dead code.
30688 * class.cs (Property.Emit): More simplification.
30689 (Event.Emit): ditto.
30691 Reworked to have less levels of indentation.
30693 2001-11-08 Ravi Pratap <ravi@ximian.com>
30695 * class.cs (Property): Emit attributes.
30705 * enum.cs (Emit): Ditto.
30707 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
30710 * class.cs (Field, Event, etc.): Move attribute generation into the
30711 Emit method everywhere.
30713 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
30714 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
30715 as we had no way of defining nested enums !
30717 * rootcontext.cs : Adjust code accordingly.
30719 * typemanager.cs (AddEnumType): To keep track of enum types separately.
30721 2001-11-07 Ravi Pratap <ravi@ximian.com>
30723 * expression.cs (EvalConstantExpression): Move into ecore.cs
30725 * enum.cs (Enum): Rename some members and make them public and readonly
30726 according to our convention.
30728 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
30731 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
30733 (Enum::Emit): Write a simple version for now which doesn't try to compute
30734 expressions. I shall modify this to be more robust in just a while.
30736 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
30738 (TypeContainer::CloseType): Create the Enum types too.
30740 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
30742 * expression.cs (EvalConstantExpression): Get rid of completely.
30744 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
30745 user-defined values and other cases.
30747 (IsValidEnumLiteral): Helper function.
30749 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
30750 out there in the case we had a literal FieldExpr.
30752 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
30754 (Literalize): Revamp a bit to take two arguments.
30756 (EnumLiteral): New class which derives from Literal to wrap enum literals.
30758 2001-11-06 Ravi Pratap <ravi@ximian.com>
30760 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
30762 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
30764 (Resolve): Use the above to ensure we have proper initializers.
30766 2001-11-05 Ravi Pratap <ravi@ximian.com>
30768 * expression.cs (Expression::EvalConstantExpression): New method to
30769 evaluate constant expressions.
30771 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
30773 2001-11-07 Miguel de Icaza <miguel@ximian.com>
30775 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
30778 (Binary.ResolveOperator): Handle operator != (object a, object b)
30779 and operator == (object a, object b);
30781 (Binary.DoNumericPromotions): Indicate whether the numeric
30782 promotion was possible.
30784 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
30787 Made the ArrayAccess implement interface IAssignMethod instead of
30788 IStackStore as the order in which arguments are passed reflects
30791 * assign.cs: Instead of using expr.ExprClass to select the way of
30792 assinging, probe for the IStackStore/IAssignMethod interfaces.
30794 * typemanager.cs: Load InitializeArray definition.
30796 * rootcontext.cs (RootContext.MakeStaticData): Used to define
30797 static data that can be used to initialize arrays.
30799 2001-11-05 Miguel de Icaza <miguel@ximian.com>
30801 * expression.cs: Handle operator== and operator!= for booleans.
30803 (Conditioal.Reduce): Implement reducer for the ?: operator.
30805 (Conditional.Resolve): Implement dead code elimination.
30807 (Binary.Resolve): Catch string literals and return a new
30808 concatenated string.
30810 (Unary.Reduce): Implement reduction of unary expressions.
30812 * ecore.cs: Split out the expression core handling here.
30814 (Expression.Reduce): New method used to perform constant folding
30815 and CSE. This is needed to support constant-expressions.
30817 * statement.cs (Statement.EmitBoolExpression): Pass true and false
30818 targets, and optimize for !x.
30820 2001-11-04 Ravi Pratap <ravi@ximian.com>
30822 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
30823 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
30824 set custom atttributes.
30826 * literal.cs (Literal::GetValue): New abstract method to return the actual
30827 value of the literal, cast as an object.
30829 (*Literal): Implement GetValue method.
30831 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
30832 expressions to the arraylist but objects of type Argument.
30834 * class.cs (TypeContainer::Emit): Emit our attributes too.
30836 (Method::Emit, Constructor::Emit): Ditto.
30838 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
30839 to be ignoring earlier.
30841 2001-11-03 Ravi Pratap <ravi@ximian.com>
30843 * attribute.cs (AttributeSection::Define): Implement to do the business
30844 of constructing a CustomAttributeBuilder.
30846 (Attribute): New trivial class. Increases readability of code.
30848 * cs-parser.jay : Update accordingly.
30850 (positional_argument_list, named_argument_list, named_argument): New rules
30852 (attribute_arguments): Use the above so that we are more correct.
30854 2001-11-02 Ravi Pratap <ravi@ximian.com>
30856 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
30857 to perform all checks for a method with a params parameter.
30859 (Invocation::OverloadResolve): Update to use the above method and therefore
30860 cope correctly with params method invocations.
30862 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
30865 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
30866 constructors in our parent too because we can't afford to miss out on
30869 * attribute.cs (AttributeSection): New name for the class Attribute
30871 Other trivial changes to improve readability.
30873 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
30874 use the new class names.
30876 2001-11-01 Ravi Pratap <ravi@ximian.com>
30878 * class.cs (Method::Define): Complete definition for params types too
30880 (Indexer::Define): Ditto.
30882 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
30883 Cope everywhere with a request for info about the array parameter.
30885 2001-11-01 Ravi Pratap <ravi@ximian.com>
30887 * tree.cs (RecordNamespace): Fix up to check for the correct key.
30889 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
30890 local_variable_type to extract the string corresponding to the type.
30892 (local_variable_type): Fixup the action to use the new helper method.
30894 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
30897 * expression.cs : Clean out code which uses the above.
30899 2001-10-31 Ravi Pratap <ravi@ximian.com>
30901 * typemanager.cs (RegisterMethod): Check if we already have an existing key
30902 and bale out if necessary by returning a false.
30904 (RegisterProperty): Ditto.
30906 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
30907 and print out appropriate error messages.
30909 * interface.cs (everywhere): Ditto.
30911 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
30912 location to constructor.
30914 * class.cs (Property, Event, Indexer): Update accordingly.
30916 * ../errors/cs111.cs : Added.
30918 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
30919 of a method, as laid down by the spec.
30921 (Invocation::OverloadResolve): Use the above method.
30923 2001-10-31 Ravi Pratap <ravi@ximian.com>
30925 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
30926 now take a TypeContainer and a Parameters object.
30928 (ParameterData): Modify return type of ParameterModifier method to be
30929 Parameter.Modifier and not a string.
30931 (ReflectionParameters, InternalParameters): Update accordingly.
30933 * expression.cs (Argument::GetParameterModifier): Same here.
30935 * support.cs (InternalParameters::ParameterType): Find a better way of determining
30936 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
30937 symbol in it at all so maybe this is only for now.
30939 2001-10-30 Ravi Pratap <ravi@ximian.com>
30941 * support.cs (InternalParameters): Constructor now takes an extra argument
30942 which is the actual Parameters class.
30944 (ParameterDesc): Update to provide info on ref/out modifiers.
30946 * class.cs (everywhere): Update call to InternalParameters to pass in
30947 the second argument too.
30949 * support.cs (ParameterData): Add ParameterModifier, which is a method
30950 to return the modifier info [ref/out etc]
30952 (InternalParameters, ReflectionParameters): Implement the above.
30954 * expression.cs (Argument::ParameterModifier): Similar function to return
30955 info about the argument's modifiers.
30957 (Invocation::OverloadResolve): Update to take into account matching modifiers
30960 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
30961 a new SetFormalParameters object which we pass to InternalParameters.
30963 2001-10-30 Ravi Pratap <ravi@ximian.com>
30965 * expression.cs (NewArray): Merge into the ArrayCreation class.
30967 2001-10-29 Ravi Pratap <ravi@ximian.com>
30969 * expression.cs (NewArray): Merge classes NewBuiltinArray and
30970 NewUserdefinedArray into one as there wasn't much of a use in having
30973 * expression.cs (Argument): Change field's name to ArgType from Type.
30975 (Type): New readonly property which returns the proper type, taking into
30976 account ref/out modifiers.
30978 (everywhere): Adjust code accordingly for the above.
30980 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
30981 whether we are emitting for a ref or out parameter.
30983 * expression.cs (Argument::Emit): Use the above field to set the state.
30985 (LocalVariableReference::Emit): Update to honour the flag and emit the
30988 * parameter.cs (Attributes): Set the correct flags for ref parameters.
30990 * expression.cs (Argument::FullDesc): New function to provide a full desc.
30992 * support.cs (ParameterData): Add method ParameterDesc to the interface.
30994 (ReflectionParameters, InternalParameters): Implement the above method.
30996 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
30999 (Invocation::FullMethodDesc): Ditto.
31001 2001-10-29 Miguel de Icaza <miguel@ximian.com>
31003 * cs-parser.jay: Add extra production for the second form of array
31006 * expression.cs (ArrayCreation): Update to reflect the above
31009 * Small changes to prepare for Array initialization.
31011 2001-10-28 Miguel de Icaza <miguel@ximian.com>
31013 * typemanager.cs (ImplementsInterface): interface might be null;
31014 Deal with this problem;
31016 Also, we do store negative hits on the cache (null values), so use
31017 this instead of calling t.GetInterfaces on the type everytime.
31019 2001-10-28 Ravi Pratap <ravi@ximian.com>
31021 * typemanager.cs (IsBuiltinType): New method to help determine the same.
31023 * expression.cs (New::DoResolve): Get rid of array creation code and instead
31024 split functionality out into different classes.
31026 (New::FormArrayType): Move into NewBuiltinArray.
31028 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
31031 (NewBuiltinArray): New class to handle creation of built-in arrays.
31033 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
31034 account creation of one-dimensional arrays.
31036 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
31038 (NewUserdefinedArray::DoResolve): Implement.
31040 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
31042 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
31043 we maintain inside the TypeManager. This is necessary to perform lookups on the
31046 (LookupType): Update to perform GetType on the module builders too.
31048 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
31050 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
31052 2001-10-23 Ravi Pratap <ravi@ximian.com>
31054 * expression.cs (New::DoResolve): Implement guts of array creation.
31056 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
31058 2001-10-27 Miguel de Icaza <miguel@ximian.com>
31060 * expression.cs: Fix bug I introduced lsat night that broke
31063 (Expression.Resolve): Report a 246 error (can not resolve name)
31064 if we find a SimpleName in the stream.
31066 (Expression.ResolveLValue): Ditto.
31068 (Expression.ResolveWithSimpleName): This function is a variant of
31069 ResolveName, this one allows SimpleNames to be returned without a
31070 warning. The only consumer of SimpleNames is MemberAccess
31072 2001-10-26 Miguel de Icaza <miguel@ximian.com>
31074 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
31075 might arrive here. I have my doubts that this is correct.
31077 * statement.cs (Lock): Implement lock statement.
31079 * cs-parser.jay: Small fixes to support `lock' and `using'
31081 * cs-tokenizer.cs: Remove extra space
31083 * driver.cs: New flag --checked, allows to turn on integer math
31086 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
31087 Threading.Monitor.Exit
31089 2001-10-23 Miguel de Icaza <miguel@ximian.com>
31091 * expression.cs (IndexerAccess::DoResolveLValue): Set the
31092 Expression Class to be IndexerAccess.
31094 Notice that Indexer::DoResolve sets the eclass to Value.
31096 2001-10-22 Miguel de Icaza <miguel@ximian.com>
31098 * class.cs (TypeContainer::Emit): Emit code for indexers.
31100 * assign.cs (IAssignMethod): New interface implemented by Indexers
31101 and Properties for handling assignment.
31103 (Assign::Emit): Simplify and reuse code.
31105 * expression.cs (IndexerAccess, PropertyExpr): Implement
31106 IAssignMethod, clean up old code.
31108 2001-10-22 Ravi Pratap <ravi@ximian.com>
31110 * typemanager.cs (ImplementsInterface): New method to determine if a type
31111 implements a given interface. Provides a nice cache too.
31113 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
31116 (ConvertReferenceExplicit): Ditto.
31118 * delegate.cs (Delegate::Populate): Update to define the parameters on the
31119 various methods, with correct names etc.
31121 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
31122 Operator.UnaryNegation.
31124 * cs-parser.jay (operator_declarator): Be a little clever in the case where
31125 we have a unary plus or minus operator.
31127 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
31130 * everywhere : update accordingly.
31132 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
31135 * class.cs (Method::Define): For the case where we are implementing a method
31136 inherited from an interface, we need to set the MethodAttributes.Final flag too.
31137 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
31139 2001-10-21 Ravi Pratap <ravi@ximian.com>
31141 * interface.cs (FindMembers): Implement to work around S.R.E
31144 * typemanager.cs (IsInterfaceType): Implement.
31146 (FindMembers): Update to handle interface types too.
31148 * expression.cs (ImplicitReferenceConversion): Re-write bits which
31149 use IsAssignableFrom as that is not correct - it doesn't work.
31151 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
31152 and accordingly override EmitStatement.
31154 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
31155 using the correct logic :-)
31157 2001-10-19 Ravi Pratap <ravi@ximian.com>
31159 * ../errors/cs-11.cs : Add to demonstrate error -11
31161 2001-10-17 Miguel de Icaza <miguel@ximian.com>
31163 * assign.cs (Assign::Resolve): Resolve right hand side first, and
31164 then pass this as a hint to ResolveLValue.
31166 * expression.cs (FieldExpr): Add Location information
31168 (FieldExpr::LValueResolve): Report assignment to readonly
31171 (Expression::ExprClassFromMemberInfo): Pass location information.
31173 (Expression::ResolveLValue): Add new method that resolves an
31176 (Expression::DoResolveLValue): Default invocation calls
31179 (Indexers): New class used to keep track of indexers in a given
31182 (IStackStore): Renamed from LValue, as it did not really describe
31183 what this did. Also ResolveLValue is gone from this interface and
31184 now is part of Expression.
31186 (ElementAccess): Depending on the element access type
31188 * typemanager.cs: Add `indexer_name_type' as a Core type
31189 (System.Runtime.CompilerServices.IndexerNameAttribute)
31191 * statement.cs (Goto): Take a location.
31193 2001-10-18 Ravi Pratap <ravi@ximian.com>
31195 * delegate.cs (Delegate::VerifyDelegate): New method to verify
31196 if two delegates are compatible.
31198 (NewDelegate::DoResolve): Update to take care of the case when
31199 we instantiate a delegate from another delegate.
31201 * typemanager.cs (FindMembers): Don't even try to look up members
31202 of Delegate types for now.
31204 2001-10-18 Ravi Pratap <ravi@ximian.com>
31206 * delegate.cs (NewDelegate): New class to take care of delegate
31209 * expression.cs (New): Split the delegate related code out into
31210 the NewDelegate class.
31212 * delegate.cs (DelegateInvocation): New class to handle delegate
31215 * expression.cs (Invocation): Split out delegate related code into
31216 the DelegateInvocation class.
31218 2001-10-17 Ravi Pratap <ravi@ximian.com>
31220 * expression.cs (New::DoResolve): Implement delegate creation fully
31221 and according to the spec.
31223 (New::DoEmit): Update to handle delegates differently.
31225 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
31226 because of which we were printing out arguments in reverse order !
31228 * delegate.cs (VerifyMethod): Implement to check if the given method
31229 matches the delegate.
31231 (FullDelegateDesc): Implement.
31233 (VerifyApplicability): Implement.
31235 * expression.cs (Invocation::DoResolve): Update to accordingly handle
31236 delegate invocations too.
31238 (Invocation::Emit): Ditto.
31240 * ../errors/cs1593.cs : Added.
31242 * ../errors/cs1594.cs : Added.
31244 * delegate.cs (InstanceExpression, TargetMethod): New properties.
31246 2001-10-16 Ravi Pratap <ravi@ximian.com>
31248 * typemanager.cs (intptr_type): Core type for System.IntPtr
31250 (InitCoreTypes): Update for the same.
31252 (iasyncresult_type, asynccallback_type): Ditto.
31254 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
31257 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
31260 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
31261 the builders for the 4 members of a delegate type :-)
31263 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
31266 * expression.cs (New::DoResolve): Implement guts for delegate creation.
31268 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
31270 2001-10-15 Miguel de Icaza <miguel@ximian.com>
31272 * statement.cs (Break::Emit): Implement.
31273 (Continue::Emit): Implement.
31275 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
31276 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
31277 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
31278 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
31281 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
31282 properties that track the label for the current loop (begin of the
31283 loop and end of the loop).
31285 2001-10-15 Ravi Pratap <ravi@ximian.com>
31287 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
31288 use of emitting anything at all.
31290 * class.cs, rootcontext.cs : Get rid of calls to the same.
31292 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
31294 (Populate): Define the constructor correctly and set the implementation
31297 * typemanager.cs (delegate_types): New hashtable to hold delegates that
31300 (AddDelegateType): Implement.
31302 (IsDelegateType): Implement helper method.
31304 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
31306 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
31307 and accordingly handle it.
31309 * delegate.cs (Populate): Take TypeContainer argument.
31310 Implement bits to define the Invoke method. However, I still haven't figured out
31311 how to take care of the native int bit :-(
31313 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
31314 Qualify the name of the delegate, not its return type !
31316 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
31319 (StandardConversionExists): Checking for array types turns out to be recursive.
31321 (ConvertReferenceExplicit): Implement array conversion.
31323 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
31325 2001-10-12 Ravi Pratap <ravi@ximian.com>
31327 * cs-parser.jay (delegate_declaration): Store the fully qualified
31328 name as it is a type declaration.
31330 * delegate.cs (ReturnType, Name): Rename members to these. Make them
31333 (DefineDelegate): Renamed from Define. Does the same thing essentially,
31334 as TypeContainer::DefineType.
31336 (Populate): Method in which all the definition of the various methods (Invoke)
31339 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
31342 (CloseDelegate): Finally creates the delegate.
31344 * class.cs (TypeContainer::DefineType): Update to define delegates.
31345 (Populate, Emit and CloseType): Do the same thing here too.
31347 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
31348 delegates in all these operations.
31350 2001-10-14 Miguel de Icaza <miguel@ximian.com>
31352 * expression.cs: LocalTemporary: a new expression used to
31353 reference a temporary that has been created.
31355 * assign.cs: Handle PropertyAccess back here, so that we can
31356 provide the proper semantic access to properties.
31358 * expression.cs (Expression::ConvertReferenceExplicit): Implement
31359 a few more explicit conversions.
31361 * modifiers.cs: `NEW' modifier maps to HideBySig.
31363 * expression.cs (PropertyExpr): Make this into an
31364 ExpressionStatement, and support the EmitStatement code path.
31366 Perform get/set error checking, clean up the interface.
31368 * assign.cs: recognize PropertyExprs as targets, and if so, turn
31369 them into toplevel access objects.
31371 2001-10-12 Miguel de Icaza <miguel@ximian.com>
31373 * expression.cs: PropertyExpr::PropertyExpr: use work around the
31376 * typemanager.cs: Keep track here of our PropertyBuilders again to
31377 work around lameness in SRE.
31379 2001-10-11 Miguel de Icaza <miguel@ximian.com>
31381 * expression.cs (LValue::LValueResolve): New method in the
31382 interface, used to perform a second resolution pass for LValues.
31384 (This::DoResolve): Catch the use of this in static methods.
31386 (This::LValueResolve): Implement.
31388 (This::Store): Remove warning, assigning to `this' in structures
31391 (Invocation::Emit): Deal with invocation of
31392 methods on value types. We need to pass the address to structure
31393 methods rather than the object itself. (The equivalent code to
31394 emit "this" for structures leaves the entire structure on the
31395 stack instead of a pointer to it).
31397 (ParameterReference::DoResolve): Compute the real index for the
31398 argument based on whether the method takes or not a `this' pointer
31399 (ie, the method is static).
31401 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
31402 value types returned from functions when we need to invoke a
31403 method on the sturcture.
31406 2001-10-11 Ravi Pratap <ravi@ximian.com>
31408 * class.cs (TypeContainer::DefineType): Method to actually do the business of
31409 defining the type in the Modulebuilder or Typebuilder. This is to take
31410 care of nested types which need to be defined on the TypeBuilder using
31411 DefineNestedMethod.
31413 (TypeContainer::GetClassBases): Implement. Essentially the code from the
31414 methods in RootContext, only ported to be part of TypeContainer.
31416 (TypeContainer::GetInterfaceOrClass): Ditto.
31418 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
31420 * interface.cs (Interface::DefineInterface): New method. Does exactly
31421 what RootContext.CreateInterface did earlier, only it takes care of nested types
31424 (Interface::GetInterfaces): Move from RootContext here and port.
31426 (Interface::GetInterfaceByName): Same here.
31428 * rootcontext.cs (ResolveTree): Re-write.
31430 (PopulateTypes): Re-write.
31432 * class.cs (TypeContainer::Populate): Populate nested types too.
31433 (TypeContainer::Emit): Emit nested members too.
31435 * typemanager.cs (AddUserType): Do not make use of the FullName property,
31436 instead just use the name argument passed in as it is already fully
31439 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
31440 to TypeContainer mapping to see if a type is user-defined.
31442 * class.cs (TypeContainer::CloseType): Implement.
31444 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
31445 the default constructor.
31447 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
31450 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
31452 * interface.cs (CloseType): Create the type here.
31454 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
31457 Remove all the methods which are now in TypeContainer.
31459 2001-10-10 Ravi Pratap <ravi@ximian.com>
31461 * delegate.cs (Define): Re-write bits to define the delegate
31464 2001-10-10 Miguel de Icaza <miguel@ximian.com>
31466 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
31468 * expression.cs (ImplicitReferenceConversion): handle null as well
31469 as a source to convert to any reference type.
31471 * statement.cs (Return): Perform any implicit conversions to
31472 expected return type.
31474 Validate use of return statement.
31476 * codegen.cs (EmitContext): Pass the expected return type here.
31478 * class.cs (Method, Constructor, Property): Pass expected return
31479 type to EmitContext.
31481 2001-10-09 Miguel de Icaza <miguel@ximian.com>
31483 * expression.cs: Make DoResolve take an EmitContext instead of a
31486 Replaced `l' and `location' for `loc', for consistency.
31488 (Error, Warning): Remove unneeded Tc argument.
31490 * assign.cs, literal.cs, constant.cs: Update to new calling
31493 * codegen.cs: EmitContext now contains a flag indicating whether
31494 code is being generated in a static method or not.
31496 * cs-parser.jay: DecomposeQI, new function that replaces the old
31497 QualifiedIdentifier. Now we always decompose the assembled
31498 strings from qualified_identifier productions into a group of
31501 2001-10-08 Miguel de Icaza <miguel@ximian.com>
31503 * rootcontext.cs: Deal with field-less struct types correctly now
31504 by passing the size option to Define Type.
31506 * class.cs: Removed hack that created one static field.
31508 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31510 * statement.cs: Moved most of the code generation here.
31512 2001-10-09 Ravi Pratap <ravi@ximian.com>
31514 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
31517 (ElementAccess): Remove useless bits for now - keep checks as the spec
31520 2001-10-08 Ravi Pratap <ravi@ximian.com>
31522 * expression.cs (ElementAccess::DoResolve): Remove my crap code
31523 and start performing checks according to the spec.
31525 2001-10-07 Ravi Pratap <ravi@ximian.com>
31527 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
31528 rank_specifiers instead.
31530 (rank_specifiers): Change the order in which the rank specifiers are stored
31532 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
31534 * expression.cs (ElementAccess): Implement the LValue interface too.
31536 2001-10-06 Ravi Pratap <ravi@ximian.com>
31538 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
31539 except that user defined conversions are not included.
31541 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
31542 perform the conversion of the return type, if necessary.
31544 (New::DoResolve): Check whether we are creating an array or an object
31545 and accordingly do the needful.
31547 (New::Emit): Same here.
31549 (New::DoResolve): Implement guts of array creation.
31551 (New::FormLookupType): Helper function.
31553 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31555 * codegen.cs: Removed most of the code generation here, and move the
31556 corresponding code generation bits to the statement classes.
31558 Added support for try/catch/finalize and throw.
31560 * cs-parser.jay: Added support for try/catch/finalize.
31562 * class.cs: Catch static methods having the flags override,
31563 virtual or abstract.
31565 * expression.cs (UserCast): This user cast was not really doing
31566 what it was supposed to do. Which is to be born in fully resolved
31567 state. Parts of the resolution were being performed at Emit time!
31571 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31573 * expression.cs: Implicity convert the result from UserCast.
31575 2001-10-05 Ravi Pratap <ravi@ximian.com>
31577 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
31578 prevented it from working correctly.
31580 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
31581 merely ConvertImplicit.
31583 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31585 * typemanager.cs: Make the LookupTypeContainer function static,
31586 and not per-instance.
31588 * class.cs: Make static FindMembers (the one that takes a Type
31591 * codegen.cs: Add EmitForeach here.
31593 * cs-parser.jay: Make foreach a toplevel object instead of the
31594 inline expansion, as we need to perform semantic analysis on it.
31596 2001-10-05 Ravi Pratap <ravi@ximian.com>
31598 * expression.cs (Expression::ImplicitUserConversion): Rename to
31599 UserDefinedConversion.
31601 (Expression::UserDefinedConversion): Take an extra argument specifying
31602 whether we look for explicit user conversions too.
31604 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
31606 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
31608 (ExplicitUserConversion): Make it a call to UserDefinedConversion
31609 with the appropriate arguments.
31611 * cs-parser.jay (cast_expression): Record location too.
31613 * expression.cs (Cast): Record location info.
31615 (Expression::ConvertExplicit): Take location argument.
31617 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
31618 to determine if we are doing explicit conversions.
31620 (UserCast::Emit): Update accordingly.
31622 (Expression::ConvertExplicit): Report an error if everything fails.
31624 * ../errors/cs0030.cs : Add.
31626 2001-10-04 Miguel de Icaza <miguel@ximian.com>
31628 * modifiers.cs: If the ABSTRACT keyword is present, also set the
31629 virtual and newslot bits.
31631 * class.cs (TypeContainer::RegisterRequiredImplementations):
31632 Record methods we need.
31634 (TypeContainer::MakeKey): Helper function to make keys for
31635 MethodBases, since the Methodbase key is useless.
31637 (TypeContainer::Populate): Call RegisterRequiredImplementations
31638 before defining the methods.
31640 Create a mapping for method_builders_to_methods ahead of time
31641 instead of inside a tight loop.
31643 (::RequireMethods): Accept an object as the data to set into the
31644 hashtable so we can report interface vs abstract method mismatch.
31646 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31648 * report.cs: Make all of it static.
31650 * rootcontext.cs: Drop object_type and value_type computations, as
31651 we have those in the TypeManager anyways.
31653 Drop report instance variable too, now it is a global.
31655 * driver.cs: Use try/catch on command line handling.
31657 Add --probe option to debug the error reporting system with a test
31660 * report.cs: Add support for exiting program when a probe
31661 condition is reached.
31663 2001-10-03 Ravi Pratap <ravi@ximian.com>
31665 * expression.cs (Binary::DoNumericPromotions): Fix the case when
31666 we do a forcible conversion regardless of type, to check if
31667 ForceConversion returns a null.
31669 (Binary::error19): Use location to report error.
31671 (Unary::error23): Use location here too.
31673 * ../errors/cs0019.cs : Check in.
31675 * ../errors/cs0023.cs : Check in.
31677 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
31678 case of a non-null MethodInfo object with a length of 0 !
31680 (Binary::ResolveOperator): Flag error if overload resolution fails to find
31681 an applicable member - according to the spec :-)
31682 Also fix logic to find members in base types.
31684 (Unary::ResolveOperator): Same here.
31686 (Unary::report23): Change name to error23 and make first argument a TypeContainer
31687 as I was getting thoroughly confused between this and error19 :-)
31689 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
31690 (::FindMostEncompassedType): Implement.
31691 (::FindMostEncompassingType): Implement.
31692 (::StandardConversionExists): Implement.
31694 (UserImplicitCast): Re-vamp. We now need info about most specific
31695 source and target types so that we can do the necessary conversions.
31697 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
31698 mathematical union with no duplicates.
31700 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31702 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
31703 in order from base classes to child classes, so that we can in
31704 child classes look up in our parent for method names and
31705 attributes (required for handling abstract, virtual, new, override
31706 constructs: we need to instrospect our base class, and if we dont
31707 populate the classes in order, the introspection might be
31708 incorrect. For example, a method could query its parent before
31709 the parent has any methods and would determine that the parent has
31710 no abstract methods (while it could have had them)).
31712 (RootContext::CreateType): Record the order in which we define the
31715 2001-10-02 Miguel de Icaza <miguel@ximian.com>
31717 * class.cs (TypeContainer::Populate): Also method definitions can
31718 fail now, keep track of this.
31720 (TypeContainer::FindMembers): Implement support for
31721 DeclaredOnly/noDeclaredOnly flag.
31723 (Constructor::Emit) Return the ConstructorBuilder.
31725 (Method::Emit) Return the MethodBuilder.
31726 Check for abstract or virtual methods to be public.
31728 * rootcontext.cs (RootContext::CreateType): Register all the
31729 abstract methods required for the class to be complete and the
31730 interface methods that must be implemented.
31732 * cs-parser.jay: Report error 501 (method requires body if it is
31733 not marked abstract or extern).
31735 * expression.cs (TypeOf::Emit): Implement.
31737 * typemanager.cs: runtime_handle_type, new global type.
31739 * class.cs (Property::Emit): Generate code for properties.
31741 2001-10-02 Ravi Pratap <ravi@ximian.com>
31743 * expression.cs (Unary::ResolveOperator): Find operators on base type
31744 too - we now conform exactly to the spec.
31746 (Binary::ResolveOperator): Same here.
31748 * class.cs (Operator::Define): Fix minor quirk in the tests.
31750 * ../errors/cs0215.cs : Added.
31752 * ../errors/cs0556.cs : Added.
31754 * ../errors/cs0555.cs : Added.
31756 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31758 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
31759 single integer which is really efficient
31761 2001-10-01 Ravi Pratap <ravi@ximian.com>
31763 * expression.cs (Expression::ImplicitUserConversion): Use location
31764 even in the case when we are examining True operators.
31766 * class.cs (Operator::Define): Perform extensive checks to conform
31767 with the rules for operator overloading in the spec.
31769 * expression.cs (Expression::ImplicitReferenceConversion): Implement
31770 some of the other conversions mentioned in the spec.
31772 * typemanager.cs (array_type): New static member for the System.Array built-in
31775 (cloneable_interface): For System.ICloneable interface.
31777 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
31778 we start resolving the tree and populating types.
31780 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
31782 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31784 * expression.cs (Expression::ExprClassFromMemberInfo,
31785 Expression::Literalize): Create literal expressions from
31786 FieldInfos which are literals.
31788 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
31789 type casts, because they were wrong. The test suite in tests
31792 (ImplicitNumericConversion): ushort to ulong requires a widening
31795 Int32 constant to long requires widening cast as well.
31797 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
31798 for integers because the type on the stack is not i4.
31800 2001-09-30 Miguel de Icaza <miguel@ximian.com>
31802 * expression.cs (report118): require location argument.
31804 * parameter.cs: Do not dereference potential null value.
31806 * class.cs: Catch methods that lack the `new' keyword when
31807 overriding a name. Report warnings when `new' is used without
31808 anything being there to override.
31810 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
31812 * class.cs: Only add constructor to hashtable if it is non-null
31813 (as now constructors can fail on define).
31815 (TypeManager, Class, Struct): Take location arguments.
31817 Catch field instance initialization in structs as errors.
31819 accepting_filter: a new filter for FindMembers that is static so
31820 that we dont create an instance per invocation.
31822 (Constructor::Define): Catch errors where a struct constructor is
31825 * cs-parser.jay: Pass location information for various new
31828 * delegate.cs (Delegate): take a location argument.
31830 * driver.cs: Do not call EmitCode if there were problesm in the
31831 Definition of the types, as many Builders wont be there.
31833 * decl.cs (Decl::Decl): Require a location argument.
31835 * cs-tokenizer.cs: Handle properly hex constants that can not fit
31836 into integers, and find the most appropiate integer for it.
31838 * literal.cs: Implement ULongLiteral.
31840 * rootcontext.cs: Provide better information about the location of
31841 failure when CreateType fails.
31843 2001-09-29 Miguel de Icaza <miguel@ximian.com>
31845 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
31848 * expression.cs (Binary::CheckShiftArguments): Add missing type
31850 (Binary::ResolveOperator): Add type to the logical and and logical
31851 or, Bitwise And/Or and Exclusive Or code paths, it was missing
31854 (Binary::DoNumericPromotions): In the case where either argument
31855 is ulong (and most signed types combined with ulong cause an
31856 error) perform implicit integer constant conversions as well.
31858 2001-09-28 Miguel de Icaza <miguel@ximian.com>
31860 * expression.cs (UserImplicitCast): Method should always be
31862 (Invocation::BetterConversion): Simplified test for IntLiteral.
31864 (Expression::ImplicitNumericConversion): Split this routine out.
31865 Put the code that performs implicit constant integer conversions
31868 (Expression::Resolve): Become a wrapper around DoResolve so we can
31869 check eclass and type being set after resolve.
31871 (Invocation::Badness): Remove this dead function
31873 (Binary::ResolveOperator): Do not compute the expensive argumnets
31874 unless we have a union for it.
31876 (Probe::Emit): Is needs to do an isinst and then
31877 compare against null.
31879 (::CanConvert): Added Location argument. If the Location argument
31880 is null (Location.Null), then we do not report errors. This is
31881 used by the `probe' mechanism of the Explicit conversion. We do
31882 not want to generate an error for something that the user
31883 explicitly requested to be casted. But the pipeline for an
31884 explicit cast first tests for potential implicit casts.
31886 So for now, if the Location is null, it means `Probe only' to
31887 avoid adding another argument. Might have to revise this
31890 (ClassCast): New class used to type cast objects into arbitrary
31891 classes (used in Explicit Reference Conversions).
31893 Implement `as' as well.
31895 Reverted all the patches from Ravi below: they were broken:
31897 * The use of `level' as a mechanism to stop recursive
31898 invocations is wrong. That was there just to catch the
31899 bug with a strack trace but not as a way of addressing
31902 To fix the problem we have to *understand* what is going
31903 on and the interactions and come up with a plan, not
31904 just get things going.
31906 * The use of the type conversion cache that I proposed
31907 last night had an open topic: How does this work across
31908 protection domains. A user defined conversion might not
31909 be public in the location where we are applying the
31910 conversion, a different conversion might be selected
31911 (ie, private A->B (better) but public B->A (worse),
31912 inside A, A->B applies, but outside it, B->A will
31915 * On top of that (ie, even if the above is solved),
31916 conversions in a cache need to be abstract. Ie, `To
31917 convert from an Int to a Short use an OpcodeCast', not
31918 `To convert from an Int to a Short use the OpcodeCast on
31919 the variable 5' (which is what this patch was doing).
31921 2001-09-28 Ravi Pratap <ravi@ximian.com>
31923 * expression.cs (Invocation::ConversionExists): Re-write to use
31924 the conversion cache
31926 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
31927 cache all conversions done, not just user-defined ones.
31929 (Invocation::BetterConversion): The real culprit. Use ConversionExists
31930 to determine if a conversion exists instead of acutually trying to
31931 perform the conversion. It's faster too.
31933 (Expression::ConvertExplicit): Modify to use ConversionExists to check
31934 and only then attempt the implicit conversion.
31936 2001-09-28 Ravi Pratap <ravi@ximian.com>
31938 * expression.cs (ConvertImplicit): Use a cache for conversions
31939 already found. Check level of recursion and bail out if necessary.
31941 2001-09-28 Miguel de Icaza <miguel@ximian.com>
31943 * typemanager.cs (string_concat_string_string, string_concat_object_object):
31944 Export standard methods that we expect for string operations.
31946 * statement.cs (Block::UsageWarning): Track usage of variables and
31947 report the errors for not used variables.
31949 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
31952 2001-09-27 Miguel de Icaza <miguel@ximian.com>
31954 * codegen.cs: remove unnneded code
31956 * expression.cs: Removed BuiltinTypeAccess class
31958 Fix the order in which implicit conversions are
31961 The previous fixed dropped support for boxed conversions (adding a
31962 test to the test suite now)
31964 (UserImplicitCast::CanConvert): Remove test for source being null,
31965 that code is broken. We should not feed a null to begin with, if
31966 we do, then we should track the bug where the problem originates
31967 and not try to cover it up here.
31969 Return a resolved expression of type UserImplicitCast on success
31970 rather than true/false. Ravi: this is what I was talking about,
31971 the pattern is to use a static method as a "constructor" for
31974 Also, do not create arguments until the very last minute,
31975 otherwise we always create the arguments even for lookups that
31976 will never be performed.
31978 (UserImplicitCast::Resolve): Eliminate, objects of type
31979 UserImplicitCast are born in a fully resolved state.
31981 * typemanager.cs (InitCoreTypes): Init also value_type
31982 (System.ValueType).
31984 * expression.cs (Cast::Resolve): First resolve the child expression.
31986 (LValue): Add new method AddressOf to be used by
31989 Change the argument of Store to take an EmitContext instead of an
31990 ILGenerator, because things like FieldExpr need to be able to call
31991 their children expression to generate the instance code.
31993 (Expression::Error, Expression::Warning): Sugar functions for
31996 (Expression::MemberLookup): Accept a TypeContainer instead of a
31997 Report as the first argument.
31999 (Expression::ResolvePrimary): Killed. I still want to improve
32000 this as currently the code is just not right.
32002 (Expression::ResolveMemberAccess): Simplify, but it is still
32005 (Unary::Resolve): Catch errors in AddressOf operators.
32007 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
32008 index to a byte for the short-version, or the compiler will choose
32009 the wrong Emit call, which generates the wrong data.
32011 (ParameterReference::Emit, ::Store): same.
32013 (FieldExpr::AddressOf): Implement.
32015 * typemanager.cs: TypeManager: made public variable instead of
32018 * driver.cs: document --fatal.
32020 * report.cs (ErrorMessage, WarningMessage): new names for the old
32021 Error and Warning classes.
32023 * cs-parser.jay (member_access): Turn built-in access to types
32024 into a normal simplename
32026 2001-09-27 Ravi Pratap <ravi@ximian.com>
32028 * expression.cs (Invocation::BetterConversion): Fix to cope
32029 with q being null, since this was introducing a bug.
32031 * expression.cs (ConvertImplicit): Do built-in conversions first.
32033 2001-09-27 Ravi Pratap <ravi@ximian.com>
32035 * expression.cs (UserImplicitCast::Resolve): Fix bug.
32037 2001-09-27 Ravi Pratap <ravi@ximian.com>
32039 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
32040 I had introduced long ago (what's new ?).
32042 * expression.cs (UserImplicitCast::CanConvert): Static method to do
32043 the work of all the checking.
32044 (ConvertImplicit): Call CanConvert and only then create object if necessary.
32045 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
32047 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
32048 that is the right way.
32050 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
32051 overloading resolution. Use everywhere instead of cutting and pasting code.
32053 (Binary::ResolveOperator): Use MakeUnionSet.
32055 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
32056 we have to convert to bool types. Not complete yet.
32058 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32060 * typemanager.cs (TypeManager::CSharpName): support ushort.
32062 * expression.cs (Expression::TryImplicitIntConversion): Attempts
32063 to provide an expression that performsn an implicit constant int
32064 conversion (section 6.1.6).
32065 (Expression::ConvertImplicitRequired): Reworked to include
32066 implicit constant expression conversions.
32068 (Expression::ConvertNumericExplicit): Finished.
32070 (Invocation::Emit): If InstanceExpression is null, then it means
32071 that we perform a call on this.
32073 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32075 * expression.cs (Unary::Emit): Remove some dead code.
32076 (Probe): Implement Resolve and Emit for `is'.
32077 (Expression::ConvertImplicitRequired): Attempt to do constant
32078 expression conversions here. Maybe should be moved to
32079 ConvertImplicit, but I am not sure.
32080 (Expression::ImplicitLongConstantConversionPossible,
32081 Expression::ImplicitIntConstantConversionPossible): New functions
32082 that tell whether is it possible to apply an implicit constant
32083 expression conversion.
32085 (ConvertNumericExplicit): Started work on explicit numeric
32088 * cs-parser.jay: Update operator constants.
32090 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
32091 (Parameters::GetSignature): Hook up VerifyArgs here.
32092 (Parameters::VerifyArgs): Verifies that no two arguments have the
32095 * class.cs (Operator): Update the operator names to reflect the
32096 ones that the spec expects (as we are just stringizing the
32099 * expression.cs (Unary::ResolveOperator): Fix bug: Use
32100 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
32101 previous usage did only work for our methods.
32102 (Expression::ConvertImplicit): Handle decimal implicit numeric
32103 conversions as well.
32104 (Expression::InternalTypeConstructor): Used to invoke constructors
32105 on internal types for default promotions.
32107 (Unary::Emit): Implement special handling for the pre/post
32108 increment/decrement for overloaded operators, as they need to have
32109 the same semantics as the other operators.
32111 (Binary::ResolveOperator): ditto.
32112 (Invocation::ConversionExists): ditto.
32113 (UserImplicitCast::Resolve): ditto.
32115 2001-09-26 Ravi Pratap <ravi@ximian.com>
32117 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
32118 operator, return after emitting body. Regression tests pass again !
32120 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
32121 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
32122 (Invocation::OverloadResolve): Ditto.
32123 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
32125 * everywhere : update calls to the above methods accordingly.
32127 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32129 * assign.cs (Assign): Make it inherit from ExpressionStatement.
32131 * expression.cs (ExpressionStatement): New base class used for
32132 expressions that can appear in statements, so that we can provide
32133 an alternate path to generate expression that do not leave a value
32136 (Expression::Emit, and all the derivatives): We no longer return
32137 whether a value is left on the stack or not. Every expression
32138 after being emitted leaves a single value on the stack.
32140 * codegen.cs (EmitContext::EmitStatementExpression): Use the
32141 facilties of ExpressionStatement if possible.
32143 * cs-parser.jay: Update statement_expression.
32145 2001-09-25 Miguel de Icaza <miguel@ximian.com>
32147 * driver.cs: Change the wording of message
32149 2001-09-25 Ravi Pratap <ravi@ximian.com>
32151 * expression.cs (Binary::ResolveOperator): Had forgottten to set
32152 the type of the expression to the return type of the method if
32153 we have an overloaded operator match ! The regression tests pass again !
32154 (Unary::ResolveOperator): Ditto.
32156 * expression.cs (Invocation::ConversionExists): Correct the member lookup
32157 to find "op_Implicit", not "implicit" ;-)
32158 (UserImplicitCast): New class to take care of user-defined implicit conversions.
32159 (ConvertImplicit, ForceConversion): Take TypeContainer argument
32161 * everywhere : Correct calls to the above accordingly.
32163 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
32164 (ConvertImplicit): Do user-defined conversion if it exists.
32166 2001-09-24 Miguel de Icaza <miguel@ximian.com>
32168 * assign.cs: track location.
32169 (Resolve): Use implicit conversions on assignment.
32171 * literal.cs: Oops. Not good, Emit of short access values should
32172 pass (Bytes) or the wrong argument will be selected.
32174 * expression.cs (Unary::Emit): Emit code for -expr.
32176 (Unary::ResolveOperator): Handle `Substract' for non-constants
32177 (substract from zero from the non-constants).
32178 Deal with Doubles as well.
32180 (Expression::ConvertImplicitRequired): New routine that reports an
32181 error if no implicit conversion exists.
32183 (Invocation::OverloadResolve): Store the converted implicit
32184 expressions if we make them
32186 2001-09-24 Ravi Pratap <ravi@ximian.com>
32188 * class.cs (ConstructorInitializer): Take a Location argument.
32189 (ConstructorBaseInitializer): Same here.
32190 (ConstructorThisInitializer): Same here.
32192 * cs-parser.jay : Update all calls accordingly.
32194 * expression.cs (Unary, Binary, New): Take location argument.
32195 Update accordingly everywhere.
32197 * cs-parser.jay : Update all calls to the above to take a location
32200 * class.cs : Ditto.
32202 2001-09-24 Ravi Pratap <ravi@ximian.com>
32204 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
32205 (Invocation::BetterConversion): Same here
32206 (Invocation::ConversionExists): Ditto.
32208 (Invocation::ConversionExists): Implement.
32210 2001-09-22 Ravi Pratap <ravi@ximian.com>
32212 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
32213 Also take an additional TypeContainer argument.
32215 * All over : Pass in TypeContainer as argument to OverloadResolve.
32217 * typemanager.cs (CSharpName): Update to check for the string type and return
32220 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
32223 2001-09-21 Ravi Pratap <ravi@ximian.com>
32225 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
32226 (Invocation::BetterFunction): Implement.
32227 (Invocation::BetterConversion): Implement.
32228 (Invocation::ConversionExists): Skeleton, no implementation yet.
32230 Okay, things work fine !
32232 2001-09-21 Miguel de Icaza <miguel@ximian.com>
32234 * typemanager.cs: declare and load enum_type, delegate_type and
32237 * expression.cs (Expression::Emit): Now emit returns a value that
32238 tells whether a value is left on the stack or not. This strategy
32239 might be reveted tomorrow with a mechanism that would address
32240 multiple assignments.
32241 (Expression::report118): Utility routine to report mismatches on
32244 (Unary::Report23): Report impossible type/operator combination
32247 (Unary::IsIncrementableNumber): Whether the type can be
32248 incremented or decremented with add.
32249 (Unary::ResolveOperator): Also allow enumerations to be bitwise
32251 (Unary::ResolveOperator): Implement ++, !, ~,
32253 (Invocation::Emit): Deal with new Emit convetion.
32255 * All Expression derivatives: Updated their Emit method to return
32256 whether they leave values on the stack or not.
32258 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
32259 stack for expressions that are statements.
32261 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32263 * expression.cs (LValue): New interface. Must be implemented by
32265 (LocalVariableReference, ParameterReference, FieldExpr): Implement
32268 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
32269 interface for generating code, simplifies the code.
32271 2001-09-20 Ravi Pratap <ravi@ximian.com>
32273 * expression.cs (everywhere): Comment out return statements in ::Resolve
32274 methods to avoid the warnings.
32276 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32278 * driver.cs (parse): Report error 2001 if we can not open the
32281 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
32284 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
32287 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
32288 otherwise nested blocks end up with the same index.
32290 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
32292 * expression.cs: Instead of having FIXMEs in the Resolve
32293 functions, throw exceptions so it is obvious that we are facing a
32296 * cs-parser.jay (invocation_expression): Pass Location information.
32298 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
32299 Use a basename for those routines because .NET does not like paths
32302 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
32305 2001-09-19 Miguel de Icaza <miguel@ximian.com>
32307 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
32308 are loading the correct data types (throws an exception if not).
32309 (TypeManager::InitCoreTypes): Use CoreLookupType
32311 * expression.cs (Unary::ResolveOperator): return the child
32312 expression for expressions which are just +expr.
32313 (Unary::ResolveOperator): Return negative literals for -LITERAL
32314 expressions (otherwise they are Unary {Literal}).
32315 (Invocation::Badness): Take into account `Implicit constant
32316 expression conversions'.
32318 * literal.cs (LongLiteral): Implement long literal class.
32319 (IntLiteral): export the `Value' of the intliteral.
32321 2001-09-19 Ravi Pratap <ravi@ximian.com>
32323 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
32325 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
32326 instead of 'Operator'
32328 * expression.cs (Binary::ResolveOperator): Update accordingly.
32329 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
32332 * cs-parser.jay (unary_expression): Update to use the new names.
32334 * gen-treedump.cs (GetUnary): Same here.
32336 * expression.cs (Unary::Resolve): Implement.
32337 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
32338 operators are found instead of making noise ;-)
32339 (Unary::ResolveOperator): New method to do precisely the same thing which
32340 Binary::ResolveOperator does for Binary expressions.
32341 (Unary.method, .Arguments): Add.
32342 (Unary::OperName): Implement.
32343 (Unary::ForceConversion): Copy and Paste !
32345 * class.cs (Operator::Define): Fix a small bug for the case when we have
32348 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
32349 for the inbuilt operators. Only overloading works for now ;-)
32351 2001-09-18 Miguel de Icaza <miguel@ximian.com>
32353 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
32354 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
32356 * expression.cs (This::Emit): Implement.
32357 (This::Resolve): Implement.
32358 (TypeOf:Resolve): Implement.
32359 (Expression::ResolveSimpleName): Add an implicit this to instance
32361 (MemberAccess::Resolve): Deal with Parameters and Fields.
32362 Bind instance variable to Field expressions.
32363 (FieldExpr::Instance): New field used to track the expression that
32364 represents the object instance.
32365 (FieldExpr::Resolve): Track potential errors from MemberLookup not
32367 (FieldExpr::Emit): Implement.
32369 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
32370 the last instruction contains a return opcode to avoid generating
32371 the last `ret' instruction (this generates correct code, and it is
32372 nice to pass the peverify output).
32374 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
32375 initializer for static and instance variables.
32376 (Constructor::Emit): Allow initializer to be null in the case of
32377 static constructors. Only emit initializer for instance
32380 (TypeContainer::FindMembers): Return a null array if there are no
32383 Also fix the code for the MemberTypes.Method branch, as it was not
32384 scanning that for operators (or tried to access null variables before).
32386 * assign.cs (Assign::Emit): Handle instance and static fields.
32390 * driver.cs: Stop compilation if there are parse errors.
32392 * cs-parser.jay (constructor_declaration): Provide default base
32393 initializer for non-static constructors.
32394 (constructor_declarator): Do not provide a default base
32395 initializers if none was specified.
32396 Catch the fact that constructors should not have parameters.
32398 * class.cs: Do not emit parent class initializers for static
32399 constructors, that should be flagged as an error.
32401 2001-09-18 Ravi Pratap <ravi@ximian.com>
32403 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
32404 Move back code into TypeContainer::Populate.
32406 2001-09-18 Ravi Pratap <ravi@ximian.com>
32408 * class.cs (TypeContainer::AddConstructor): Fix the check to
32409 compare against Name, not Basename.
32410 (Operator::OpType): Change Plus and Minus to Add and Subtract.
32412 * cs-parser.jay : Update accordingly.
32414 * class.cs (TypeContainer::FindMembers): For the case where we are searching
32415 for methods, don't forget to look into the operators too.
32416 (RegisterMethodBuilder): Helper method to take care of this for
32417 methods, constructors and operators.
32418 (Operator::Define): Completely revamp.
32419 (Operator.OperatorMethod, MethodName): New fields.
32420 (TypeContainer::Populate): Move the registering of builders into
32421 RegisterMethodBuilder.
32422 (Operator::Emit): Re-write.
32424 * expression.cs (Binary::Emit): Comment out code path to emit method
32425 invocation stuff for the case when we have a user defined operator. I am
32426 just not able to get it right !
32428 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32430 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
32433 (Expression::MemberLookup): Provide a version that allows to
32434 specify the MemberTypes and BindingFlags.
32436 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
32437 so it was not fetching variable information from outer blocks.
32439 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
32440 Beforefieldinit as it was buggy.
32442 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
32443 that Ravi put here.
32445 * class.cs (Constructor::Emit): Only emit if block is not null.
32446 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
32447 deal with this by semantically definining it as if the user had
32450 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
32451 constructors as we now "emit" them at a higher level.
32453 (TypeContainer::DefineDefaultConstructor): Used to define the
32454 default constructors if none was provided.
32456 (ConstructorInitializer): Add methods Resolve and Emit.
32458 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
32460 2001-09-17 Ravi Pratap <ravi@ximian.com>
32462 * class.cs (TypeContainer::EmitDefaultConstructor): Register
32463 the default constructor builder with our hashtable for methodbuilders
32466 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
32467 and argument_count is 0 in which case we have a match.
32468 (Binary::ResolveOperator): More null checking and miscellaneous coding
32471 2001-09-17 Ravi Pratap <ravi@ximian.com>
32473 * rootcontext.cs (IsNameSpace): Compare against null.
32475 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
32477 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
32478 and Unary::Operator.
32480 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
32483 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
32484 we have overloaded operators.
32485 (Binary::ResolveOperator): Implement the part which does the operator overload
32488 * class.cs (Operator::Emit): Implement.
32489 (TypeContainer::Emit): Emit the operators we have too.
32491 * expression.cs (Binary::Emit): Update to emit the appropriate code for
32492 the case when we have a user-defined operator.
32494 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32496 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
32498 2001-09-16 Ravi Pratap <ravi@ximian.com>
32500 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
32501 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
32502 (Constructor::Emit): Implement.
32503 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
32504 if we have no work to do.
32505 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
32508 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
32509 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
32511 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
32514 2001-09-15 Ravi Pratap <ravi@ximian.com>
32516 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
32518 (Tree::RecordNamespace): Method to do what the name says ;-)
32519 (Tree::Namespaces): Property to get at the namespaces hashtable.
32521 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
32524 * rootcontext.cs (IsNamespace): Fixed it :-)
32526 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32528 * class.cs (TypeContainer::FindMembers): Add support for
32530 (MethodCore): New class that encapsulates both the shared aspects
32531 of a Constructor and a Method.
32532 (Method, Constructor): Factored pieces into MethodCore.
32534 * driver.cs: Added --fatal which makes errors throw exceptions.
32535 Load System assembly as well as part of the standard library.
32537 * report.cs: Allow throwing exceptions on errors for debugging.
32539 * modifiers.cs: Do not use `parent', instead use the real type
32540 container to evaluate permission settings.
32542 * class.cs: Put Ravi's patch back in. He is right, and we will
32543 have to cope with the
32545 2001-09-14 Ravi Pratap <ravi@ximian.com>
32547 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
32548 FamORAssem, not FamANDAssem.
32550 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32552 * driver.cs: Added --parse option that only parses its input files
32555 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
32556 incorrect. IsTopLevel is not used to tell whether an object is
32557 root_types or not (that can be achieved by testing this ==
32558 root_types). But to see if this is a top-level *class* (not
32559 necessarly our "toplevel" container).
32561 2001-09-14 Ravi Pratap <ravi@ximian.com>
32563 * enum.cs (Enum::Define): Modify to call the Lookup method on the
32564 parent instead of a direct call to GetType.
32566 2001-09-14 Ravi Pratap <ravi@ximian.com>
32568 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
32569 Modifiers.TypeAttr. This should just be a call to that method.
32571 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
32572 object so that we can determine if we are top-level or not.
32574 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
32577 * enum.cs (Enum::Define): Ditto.
32579 * modifiers.cs (FieldAttr): Re-write.
32581 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
32582 (TypeContainer::HaveStaticConstructor): New property to provide access
32583 to precisely that info.
32585 * modifiers.cs (MethodAttr): Re-write.
32586 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
32588 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
32589 of top-level types as claimed.
32591 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32593 * expression.cs (MemberLookup): Fruitless attempt to lookup
32594 constructors. Maybe I need to emit default constructors? That
32595 might be it (currently .NET emits this for me automatically).
32596 (Invocation::OverloadResolve): Cope with Arguments == null.
32597 (Invocation::EmitArguments): new function, shared by the new
32598 constructor and us.
32599 (Invocation::Emit): Handle static and instance methods. Emit
32600 proper call instruction for virtual or non-virtual invocations.
32601 (New::Emit): Implement.
32602 (New::Resolve): Implement.
32603 (MemberAccess:Resolve): Implement.
32604 (MethodGroupExpr::InstanceExpression): used conforming to the spec
32605 to track instances.
32606 (FieldExpr::Resolve): Set type.
32608 * support.cs: Handle empty arguments.
32610 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
32611 SimpleLookup): Auxiliary routines to help parse a qualifier
32614 Update qualifier_identifier rule.
32616 * codegen.cs: Removed debugging messages.
32618 * class.cs: Make this a global thing, this acts just as a "key" to
32619 objects that we might have around.
32621 (Populate): Only initialize method_builders_to_methods once.
32623 * expression.cs (PropertyExpr): Initialize type from the
32626 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
32627 Resolve pattern. Attempt to implicitly convert value to boolean.
32630 * expression.cs: Set the type for the int32/int32 argument case.
32631 (Binary::ResolveOperator): Set the return type to boolean for
32632 comparission operators
32634 * typemanager.cs: Remove debugging print code.
32636 (Invocation::Resolve): resolve type.
32638 * class.cs: Allocate a MemberInfo of the correct size, as the code
32639 elsewhere depends on the test to reflect the correct contents.
32641 (Method::) Keep track of parameters, due to System.Reflection holes
32643 (TypeContainer::Populate): Keep track of MethodBuilders to Method
32646 (TypeContainer::FindMembers): Use ArrayList and then copy an array
32647 of the exact size and return that.
32649 (Class::LookupMethodByBuilder): New function that maps
32650 MethodBuilders to its methods. Required to locate the information
32651 on methods because System.Reflection bit us again.
32653 * support.cs: New file, contains an interface ParameterData and
32654 two implementations: ReflectionParameters and InternalParameters
32655 used to access Parameter information. We will need to grow this
32658 * expression.cs (Invocation::GetParameterData): implement a cache
32659 and a wrapper around the ParameterData creation for methods.
32660 (Invocation::OverloadResolve): Use new code.
32662 2001-09-13 Ravi Pratap <ravi@ximian.com>
32664 * class.cs (TypeContainer::EmitField): Remove and move into
32665 (Field::Define): here and modify accordingly.
32666 (Field.FieldBuilder): New member.
32667 (TypeContainer::Populate): Update accordingly.
32668 (TypeContainer::FindMembers): Implement.
32670 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32672 * statement.cs: (VariableInfo::VariableType): New field to be
32673 initialized with the full type once it is resolved.
32675 2001-09-12 Miguel de Icaza <miguel@ximian.com>
32677 * parameter.cs (GetParameterInfo): Use a type cache to compute
32678 things only once, and to reuse this information
32680 * expression.cs (LocalVariableReference::Emit): Implement.
32681 (OpcodeCast::Emit): fix.
32683 (ParameterReference::Resolve): Implement.
32684 (ParameterReference::Emit): Implement.
32686 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
32687 that are expressions need to stay as Expressions.
32689 * typemanager.cs (CSharpName): Returns the C# name of a type if
32692 * expression.cs (Expression::ConvertImplicit): New function that
32693 implements implicit type conversions.
32695 (Expression::ImplicitReferenceConversion): Implements implicit
32696 reference conversions.
32698 (EmptyCast): New type for transparent casts.
32700 (OpcodeCast): New type for casts of types that are performed with
32701 a sequence of bytecodes.
32703 (BoxedCast): New type used for casting value types into reference
32704 types. Emits a box opcode.
32706 (Binary::DoNumericPromotions): Implements numeric promotions of
32707 and computation of the Binary::Type.
32709 (Binary::EmitBranchable): Optimization.
32711 (Binary::Emit): Implement code emission for expressions.
32713 * typemanager.cs (TypeManager): Added two new core types: sbyte
32716 2001-09-12 Ravi Pratap <ravi@ximian.com>
32718 * class.cs (TypeContainer::FindMembers): Method which does exactly
32719 what Type.FindMembers does, only we don't have to use reflection. No
32720 implementation yet.
32722 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
32723 typecontainer objects as we need to get at them.
32724 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
32726 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
32727 typecontainer object.
32729 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
32730 of just a Report object.
32732 2001-09-11 Ravi Pratap <ravi@ximian.com>
32734 * class.cs (Event::Define): Go back to using the prefixes "add_" and
32736 (TypeContainer::Populate): Now define the delegates of the type too.
32737 (TypeContainer.Delegates): Property to access the list of delegates defined
32740 * delegates.cs (Delegate::Define): Implement partially.
32742 * modifiers.cs (TypeAttr): Handle more flags.
32744 2001-09-11 Ravi Pratap <ravi@ximian.com>
32746 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
32748 (Operator::Define): Re-write logic to get types by using the LookupType method
32749 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
32750 (Indexer::Define): Ditto.
32751 (Event::Define): Ditto.
32752 (Property::Define): Ditto.
32754 2001-09-10 Ravi Pratap <ravi@ximian.com>
32756 * class.cs (TypeContainer::Populate): Now define operators too.
32757 (TypeContainer.Operators): New property to access the list of operators
32759 (Operator.OperatorMethodBuilder): New member to hold the method builder
32760 for the operator we are defining.
32761 (Operator::Define): Implement.
32763 2001-09-10 Ravi Pratap <ravi@ximian.com>
32765 * class.cs (Event::Define): Make the prefixes of the accessor methods
32766 addOn_ and removeOn_
32768 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
32769 of the location being passed in too. Ideally, this should go later since all
32770 error reporting should be done through the Report object.
32772 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
32773 (Populate): Iterate thru the indexers we have and define them too.
32774 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
32775 for the get and set accessors.
32776 (Indexer::Define): Implement.
32778 2001-09-09 Miguel de Icaza <miguel@ximian.com>
32780 * expression.cs (Binary::Resolve): Beginning of it. I scratched
32781 my previous implementation, did not work.
32783 * typemanager.cs: Add a couple of missing types (the longs).
32785 * literal.cs: Use TypeManager.bool_type instead of getting it.
32787 * expression.cs (EventExpr): New kind of expressions.
32788 (Expressio::ExprClassFromMemberInfo): finish
32790 2001-09-08 Miguel de Icaza <miguel@ximian.com>
32792 * assign.cs: Emit stores to static fields differently.
32794 2001-09-08 Ravi Pratap <ravi@ximian.com>
32796 * Merge in changes and adjust code to tackle conflicts. Backed out my
32797 code in Assign::Resolve ;-)
32799 2001-09-08 Ravi Pratap <ravi@ximian.com>
32801 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
32802 instead Report.Error and also pass in the location.
32803 (CSharpParser::Lexer): New readonly property to return the reference
32804 to the Tokenizer object.
32805 (declare_local_variables): Use Report.Error with location instead of plain
32809 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
32810 (Operator.CheckBinaryOperator): Ditto.
32812 * cs-parser.jay (operator_declarator): Update accordingly.
32814 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
32815 (CheckBinaryOperator): Same here.
32817 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
32818 on the name without any prefixes of namespace names etc. This is because we
32819 already might have something already fully qualified like
32820 'System.Console.WriteLine'
32822 * assign.cs (Resolve): Begin implementation. Stuck ;-)
32824 2001-09-07 Ravi Pratap <ravi@ximian.com>
32826 * cs-tokenizer.cs (location): Return a string which also contains
32829 * expression.cs (ElementAccess): New class for expressions of the
32830 type 'element access.'
32831 (BaseAccess): New class for expressions of the type 'base access.'
32832 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
32835 * cs-parser.jay (element_access): Implement action.
32836 (base_access): Implement actions.
32837 (checked_expression, unchecked_expression): Implement.
32839 * cs-parser.jay (local_variable_type): Correct and implement.
32840 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
32842 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
32844 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
32845 name and the specifiers.
32847 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
32849 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
32850 making them all public ;-)
32852 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
32855 2001-09-07 Miguel de Icaza <miguel@ximian.com>
32857 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
32859 (FieldExpr, PropertyExprs): New resolved expressions.
32860 (SimpleName::MemberStaticCheck): Perform static checks for access
32861 to non-static fields on static methods. Maybe this should be
32862 generalized for MemberAccesses.
32863 (SimpleName::ResolveSimpleName): More work on simple name
32866 * cs-parser.jay (primary_expression/qualified_identifier): track
32867 the parameter index.
32869 * codegen.cs (CodeGen::Save): Catch save exception, report error.
32870 (EmitContext::EmitBoolExpression): Chain to expression generation
32871 instead of temporary hack.
32872 (::EmitStatementExpression): Put generic expression code generation.
32874 * assign.cs (Assign::Emit): Implement variable assignments to
32875 local variables, parameters and fields.
32877 2001-09-06 Miguel de Icaza <miguel@ximian.com>
32879 * statement.cs (Block::GetVariableInfo): New method, returns the
32880 VariableInfo for a variable name in a block.
32881 (Block::GetVariableType): Implement in terms of GetVariableInfo
32883 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
32884 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
32886 2001-09-06 Ravi Pratap <ravi@ximian.com>
32888 * cs-parser.jay (operator_declaration): Continue on my quest : update
32889 to take attributes argument.
32890 (event_declaration): Ditto.
32891 (enum_declaration): Ditto.
32892 (indexer_declaration): Ditto.
32894 * class.cs (Operator::Operator): Update constructor accordingly.
32895 (Event::Event): Ditto.
32897 * delegate.cs (Delegate::Delegate): Same here.
32899 * enum.cs (Enum::Enum): Same here.
32901 2001-09-05 Ravi Pratap <ravi@ximian.com>
32903 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
32905 * ../tests/cs0658.cs : New file to demonstrate error 0658.
32907 * attribute.cs (Attributes): New class to encapsulate all attributes which were
32908 being passed around as an arraylist.
32909 (Attributes::AddAttribute): Method to add attribute sections.
32911 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
32912 (struct_declaration): Update accordingly.
32913 (constant_declaration): Update.
32914 (field_declaration): Update.
32915 (method_header): Update.
32916 (fixed_parameter): Update.
32917 (parameter_array): Ditto.
32918 (property_declaration): Ditto.
32919 (destructor_declaration): Ditto.
32921 * class.cs (Struct::Struct): Update constructors accordingly.
32922 (Class::Class): Ditto.
32923 (Field::Field): Ditto.
32924 (Method::Method): Ditto.
32925 (Property::Property): Ditto.
32926 (TypeContainer::OptAttribute): update property's return type.
32928 * interface.cs (Interface.opt_attributes): New member.
32929 (Interface::Interface): Update to take the extra Attributes argument.
32931 * parameter.cs (Parameter::Parameter): Ditto.
32933 * constant.cs (Constant::Constant): Ditto.
32935 * interface.cs (InterfaceMemberBase): New OptAttributes field.
32936 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
32937 the attributes as a parameter.
32938 (InterfaceProperty): Update constructor call.
32939 (InterfaceEvent): Ditto.
32940 (InterfaceMethod): Ditto.
32941 (InterfaceIndexer): Ditto.
32943 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
32944 pass the attributes too.
32945 (interface_event_declaration): Ditto.
32946 (interface_property_declaration): Ditto.
32947 (interface_method_declaration): Ditto.
32948 (interface_declaration): Ditto.
32950 2001-09-05 Miguel de Icaza <miguel@ximian.com>
32952 * class.cs (Method::Define): Track the "static Main" definition to
32953 create an entry point.
32955 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
32956 EntryPoint if we find it.
32958 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
32959 (EmitContext::ig): Make this variable public.
32961 * driver.cs: Make the default output file be the first file name
32962 with the .exe extension.
32964 Detect empty compilations
32966 Handle various kinds of output targets. Handle --target and
32967 rename -t to --dumper.
32969 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
32970 methods inherited from Expression return now an Expression. This
32971 will is used during the tree rewriting as we resolve them during
32974 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
32975 the spec. Missing entirely is the information about
32976 accessability of elements of it.
32978 (Expression::ExprClassFromMemberInfo): New constructor for
32979 Expressions that creates a fully initialized Expression based on
32980 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
32983 (Invocation::Resolve): Begin implementing resolution of invocations.
32985 * literal.cs (StringLiteral): Implement Emit.
32987 2001-09-05 Ravi Pratap <ravi@ximian.com>
32989 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
32992 2001-09-04 Ravi Pratap <ravi@ximian.com>
32994 * cs-parser.jay (attribute_arguments): Implement actions.
32995 (attribute): Fix bug in production. Implement action.
32996 (attribute_list): Implement.
32997 (attribute_target): Implement.
32998 (attribute_target_specifier, opt_target_specifier): Implement
32999 (CheckAttributeTarget): New method to check if the attribute target
33001 (attribute_section): Implement.
33002 (opt_attributes): Implement.
33004 * attribute.cs : New file to handle attributes.
33005 (Attribute): Class to hold attribute info.
33007 * cs-parser.jay (opt_attribute_target_specifier): Remove production
33008 (attribute_section): Modify production to use 2 different rules to
33009 achieve the same thing. 1 s/r conflict down !
33010 Clean out commented, useless, non-reducing dimension_separator rules.
33012 * class.cs (TypeContainer.attributes): New member to hold list
33013 of attributes for a type.
33014 (Struct::Struct): Modify to take one more argument, the attribute list.
33015 (Class::Class): Ditto.
33016 (Field::Field): Ditto.
33017 (Method::Method): Ditto.
33018 (Property::Property): Ditto.
33020 * cs-parser.jay (struct_declaration): Update constructor call to
33021 pass in the attributes too.
33022 (class_declaration): Ditto.
33023 (constant_declaration): Ditto.
33024 (field_declaration): Ditto.
33025 (method_header): Ditto.
33026 (fixed_parameter): Ditto.
33027 (parameter_array): Ditto.
33028 (property_declaration): Ditto.
33030 * constant.cs (Constant::Constant): Update constructor similarly.
33031 Use System.Collections.
33033 * parameter.cs (Parameter::Parameter): Update as above.
33035 2001-09-02 Ravi Pratap <ravi@ximian.com>
33037 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
33038 (TypeContainer.delegates): New member to hold list of delegates.
33040 * cs-parser.jay (delegate_declaration): Implement the action correctly
33041 this time as I seem to be on crack ;-)
33043 2001-09-02 Miguel de Icaza <miguel@ximian.com>
33045 * rootcontext.cs (RootContext::IsNamespace): new function, used to
33046 tell whether an identifier represents a namespace.
33048 * expression.cs (NamespaceExpr): A namespace expression, used only
33049 temporarly during expression resolution.
33050 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
33051 utility functions to resolve names on expressions.
33053 2001-09-01 Miguel de Icaza <miguel@ximian.com>
33055 * codegen.cs: Add hook for StatementExpressions.
33057 * class.cs: Fix inverted test for static flag in methods.
33059 2001-09-02 Ravi Pratap <ravi@ximian.com>
33061 * class.cs (Operator::CheckUnaryOperator): Correct error number used
33062 to make it coincide with MS' number.
33063 (Operator::CheckBinaryOperator): Ditto.
33065 * ../errors/errors.txt : Remove error numbers added earlier.
33067 * ../errors/cs1019.cs : Test case for error # 1019
33069 * ../errros/cs1020.cs : Test case for error # 1020
33071 * cs-parser.jay : Clean out commented cruft.
33072 (dimension_separators, dimension_separator): Comment out. Ostensibly not
33073 used anywhere - non-reducing rule.
33074 (namespace_declarations): Non-reducing rule - comment out.
33076 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
33077 with TypeContainer::AddEnum.
33079 * delegate.cs : New file for delegate handling classes.
33080 (Delegate): Class for declaring delegates.
33082 * makefile : Update.
33084 * cs-parser.jay (delegate_declaration): Implement.
33086 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
33088 * class.cs (Event::Define): Implement.
33089 (Event.EventBuilder): New member.
33091 * class.cs (TypeContainer::Populate): Update to define all enums and events
33093 (Events): New property for the events arraylist we hold. Shouldn't we move to using
33094 readonly fields for all these cases ?
33096 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33098 * class.cs (Property): Revamp to use the convention of making fields readonly.
33099 Accordingly modify code elsewhere.
33101 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
33102 the Define method of the Property class.
33104 * class.cs : Clean up applied patch and update references to variables etc. Fix
33106 (TypeContainer::Populate): Update to define all the properties we have. Also
33107 define all enumerations.
33109 * enum.cs (Define): Implement.
33111 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33113 * cs-parser.jay (overloadable_operator): The semantic value is an
33114 enum of the Operator class.
33115 (operator_declarator): Implement actions.
33116 (operator_declaration): Implement.
33118 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
33119 validity of definitions.
33120 (Operator::CheckBinaryOperator): Static method to check for binary operators
33121 (TypeContainer::AddOperator): New method to add an operator to a type.
33123 * cs-parser.jay (indexer_declaration): Added line to actually call the
33124 AddIndexer method so it gets added ;-)
33126 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
33127 already taken care of by the MS compiler ?
33129 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33131 * class.cs (Operator): New class for operator declarations.
33132 (Operator::OpType): Enum for the various operators.
33134 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33136 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
33137 ostensibly handle this in semantic analysis.
33139 * cs-parser.jay (general_catch_clause): Comment out
33140 (specific_catch_clauses, specific_catch_clause): Ditto.
33141 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
33142 (catch_args, opt_catch_args): New productions.
33143 (catch_clause): Rewrite to use the new productions above
33144 (catch_clauses): Modify accordingly.
33145 (opt_catch_clauses): New production to use in try_statement
33146 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
33147 and re-write the code in the actions to extract the specific and
33148 general catch clauses by being a little smart ;-)
33150 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
33151 Hooray, try and catch statements parse fine !
33153 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33155 * statement.cs (Block::GetVariableType): Fix logic to extract the type
33156 string from the hashtable of variables.
33158 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
33159 I end up making that mistake ;-)
33160 (catch_clauses): Fixed gross error which made Key and Value of the
33161 DictionaryEntry the same : $1 !!
33163 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33165 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
33167 * cs-parser.jay (event_declaration): Correct to remove the semicolon
33168 when the add and remove accessors are specified.
33170 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33172 * cs-parser.jay (IndexerDeclaration): New helper class to hold
33173 information about indexer_declarator.
33174 (indexer_declarator): Implement actions.
33175 (parsing_indexer): New local boolean used to keep track of whether
33176 we are parsing indexers or properties. This is necessary because
33177 implicit_parameters come into picture even for the get accessor in the
33178 case of an indexer.
33179 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
33181 * class.cs (Indexer): New class for indexer declarations.
33182 (TypeContainer::AddIndexer): New method to add an indexer to a type.
33183 (TypeContainer::indexers): New member to hold list of indexers for the
33186 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33188 * cs-parser.jay (add_accessor_declaration): Implement action.
33189 (remove_accessor_declaration): Implement action.
33190 (event_accessors_declaration): Implement
33191 (variable_declarators): swap statements for first rule - trivial.
33193 * class.cs (Event): New class to hold information about event
33195 (TypeContainer::AddEvent): New method to add an event to a type
33196 (TypeContainer::events): New member to hold list of events.
33198 * cs-parser.jay (event_declaration): Implement actions.
33200 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33202 * cs-parser.jay (dim_separators): Implement. Make it a string
33203 concatenating all the commas together, just as they appear.
33204 (opt_dim_separators): Modify accordingly
33205 (rank_specifiers): Update accordingly. Basically do the same
33206 thing - instead, collect the brackets here.
33207 (opt_rank_sepcifiers): Modify accordingly.
33208 (array_type): Modify to actually return the complete type string
33209 instead of ignoring the rank_specifiers.
33210 (expression_list): Implement to collect the expressions
33211 (variable_initializer): Implement. We make it a list of expressions
33212 essentially so that we can handle the array_initializer case neatly too.
33213 (variable_initializer_list): Implement.
33214 (array_initializer): Make it a list of variable_initializers
33215 (opt_array_initializer): Modify accordingly.
33217 * expression.cs (New::NType): Add enumeration to help us
33218 keep track of whether we have an object/delegate creation
33219 or an array creation.
33220 (New:NewType, New::Rank, New::Indices, New::Initializers): New
33221 members to hold data about array creation.
33222 (New:New): Modify to update NewType
33223 (New:New): New Overloaded contructor for the array creation
33226 * cs-parser.jay (array_creation_expression): Implement to call
33227 the overloaded New constructor.
33229 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
33231 * class.cs (TypeContainer::Constructors): Return member
33232 constructors instead of returning null.
33234 2001-08-26 Miguel de Icaza <miguel@ximian.com>
33236 * typemanager.cs (InitCoreTypes): Initialize the various core
33237 types after we have populated the type manager with the user
33238 defined types (this distinction will be important later while
33239 compiling corlib.dll)
33241 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
33242 on Expression Classification. Now all expressions have a method
33243 `Resolve' and a method `Emit'.
33245 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
33246 generation from working. Also add some temporary debugging
33249 2001-08-24 Miguel de Icaza <miguel@ximian.com>
33251 * codegen.cs: Lots of code generation pieces. This is only the
33252 beginning, will continue tomorrow with more touches of polish. We
33253 handle the fundamentals of if, while, do, for, return. Others are
33254 trickier and I need to start working on invocations soon.
33256 * gen-treedump.cs: Bug fix, use s.Increment here instead of
33259 * codegen.cs (EmitContext): New struct, used during code
33260 emission to keep a context. Most of the code generation will be
33263 * cs-parser.jay: Add embedded blocks to the list of statements of
33264 this block. So code generation proceeds in a top down fashion.
33266 2001-08-23 Miguel de Icaza <miguel@ximian.com>
33268 * statement.cs: Add support for multiple child blocks.
33270 2001-08-22 Miguel de Icaza <miguel@ximian.com>
33272 * codegen.cs (EmitCode): New function, will emit the code for a
33273 Block of code given a TypeContainer and its ILGenerator.
33275 * statement.cs (Block): Standard public readonly optimization.
33276 (Block::Block constructors): Link children.
33277 (Block::Child): Child Linker.
33278 (Block::EmitVariables): Emits IL variable declarations.
33280 * class.cs: Drop support for MethodGroups here, delay until
33282 (Method::): Applied the same simplification that I did before, and
33283 move from Properties to public readonly fields.
33284 (Method::ParameterTypes): Returns the parameter types for the
33285 function, and implements a cache that will be useful later when I
33286 do error checking and the semantic analysis on the methods is
33288 (Constructor::GetCallingConvention): Renamed from CallingConvetion
33289 and made a method, optional argument tells whether this is a class
33290 or a structure to apply the `has-this' bit.
33291 (Method::GetCallingConvention): Implement, returns the calling
33293 (Method::Define): Defines the type, a second pass is performed
33294 later to populate the methods.
33296 (Constructor::ParameterTypes): implement a cache similar to the
33297 one on Method::ParameterTypes, useful later when we do semantic
33300 (TypeContainer::EmitMethod): New method. Emits methods.
33302 * expression.cs: Removed MethodGroup class from here.
33304 * parameter.cs (Parameters::GetCallingConvention): new method.
33306 2001-08-21 Miguel de Icaza <miguel@ximian.com>
33308 * class.cs (TypeContainer::Populate): Drop RootContext from the
33311 (Constructor::CallingConvention): Returns the calling convention.
33312 (Constructor::ParameterTypes): Returns the constructor parameter
33315 (TypeContainer::AddConstructor): Keep track of default constructor
33316 and the default static constructor.
33318 (Constructor::) Another class that starts using `public readonly'
33319 instead of properties.
33321 (Constructor::IsDefault): Whether this is a default constructor.
33323 (Field::) use readonly public fields instead of properties also.
33325 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
33326 track of static constructors; If none is used, turn on
33327 BeforeFieldInit in the TypeAttributes.
33329 * cs-parser.jay (opt_argument_list): now the return can be null
33330 for the cases where there are no arguments.
33332 (constructor_declarator): If there is no implicit `base' or
33333 `this', then invoke the default parent constructor.
33335 * modifiers.cs (MethodAttr): New static function maps a set of
33336 modifiers flags into a MethodAttributes enum
33337 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
33338 MethodAttr, TypeAttr to represent the various mappings where the
33339 modifiers are used.
33340 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
33342 2001-08-19 Miguel de Icaza <miguel@ximian.com>
33344 * parameter.cs (GetParameterInfo): Fix bug where there would be no
33347 * interface.cs (PopulateIndexer): Implemented the code generator
33348 for interface indexers.
33350 2001-08-17 Miguel de Icaza <miguel@ximian.com>
33352 * interface.cs (InterfaceMemberBase): Now we track the new status
33355 (PopulateProperty): Implement property population. Woohoo! Got
33356 Methods and Properties going today.
33358 Removed all the properties for interfaces, and replaced them with
33359 `public readonly' fields.
33361 2001-08-16 Miguel de Icaza <miguel@ximian.com>
33363 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
33364 initialize their hashtables/arraylists only when they are needed
33365 instead of doing this always.
33367 * parameter.cs: Handle refs and out parameters.
33369 * cs-parser.jay: Use an ArrayList to construct the arguments
33370 instead of the ParameterCollection, and then cast that to a
33373 * parameter.cs: Drop the use of ParameterCollection and use
33374 instead arrays of Parameters.
33376 (GetParameterInfo): Use the Type, not the Name when resolving
33379 2001-08-13 Miguel de Icaza <miguel@ximian.com>
33381 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
33382 and instead use public readonly fields.
33384 * class.cs: Put back walking code for type containers.
33386 2001-08-11 Miguel de Icaza <miguel@ximian.com>
33388 * class.cs (MakeConstant): Code to define constants.
33390 * rootcontext.cs (LookupType): New function. Used to locate types
33393 2001-08-08 Miguel de Icaza <miguel@ximian.com>
33395 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
33396 this System.Reflection code is. Kudos to Microsoft
33398 * typemanager.cs: Implement a type cache and avoid loading all
33399 types at boot time. Wrap in LookupType the internals. This made
33400 the compiler so much faster. Wow. I rule!
33402 * driver.cs: Make sure we always load mscorlib first (for
33403 debugging purposes, nothing really important).
33405 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
33406 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
33408 * rootcontext.cs: Lookup types on their namespace; Lookup types
33409 on namespaces that have been imported using the `using' keyword.
33411 * class.cs (TypeContainer::TypeAttr): Virtualize.
33412 (Class::TypeAttr): Return attributes suitable for this bad boy.
33413 (Struct::TypeAttr): ditto.
33414 Handle nested classes.
33415 (TypeContainer::) Remove all the type visiting code, it is now
33416 replaced with the rootcontext.cs code
33418 * rootcontext.cs (GetClassBases): Added support for structs.
33420 2001-08-06 Miguel de Icaza <miguel@ximian.com>
33422 * interface.cs, statement.cs, class.cs, parameter.cs,
33423 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
33424 Drop use of TypeRefs, and use strings instead.
33426 2001-08-04 Miguel de Icaza <miguel@ximian.com>
33430 * class.cs (Struct::Struct): set the SEALED flags after
33431 checking the modifiers.
33432 (TypeContainer::TypeAttr): new property, returns the
33433 TypeAttributes for a class.
33435 * cs-parser.jay (type_list): Oops, list production was creating a
33436 new list of base types.
33438 * rootcontext.cs (StdLib): New property.
33439 (GetInterfaceTypeByName): returns an interface by type name, and
33440 encapsulates error handling here.
33441 (GetInterfaces): simplified.
33442 (ResolveTree): Encapsulated all the tree resolution here.
33443 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
33446 * driver.cs: Add support for --nostdlib, to avoid loading the
33447 default assemblies.
33448 (Main): Do not put tree resolution here.
33450 * rootcontext.cs: Beginning of the class resolution.
33452 2001-08-03 Miguel de Icaza <miguel@ximian.com>
33454 * rootcontext.cs: Provide better error reporting.
33456 * cs-parser.jay (interface_base): set our $$ to be interfaces.
33458 * rootcontext.cs (CreateInterface): Handle the case where there
33459 are no parent interfaces.
33461 (CloseTypes): Routine to flush types at the end.
33462 (CreateInterface): Track types.
33463 (GetInterfaces): Returns an array of Types from the list of
33464 defined interfaces.
33466 * typemanager.c (AddUserType): Mechanism to track user types (puts
33467 the type on the global type hash, and allows us to close it at the
33470 2001-08-02 Miguel de Icaza <miguel@ximian.com>
33472 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
33473 RecordInterface instead.
33475 * cs-parser.jay: Updated to reflect changes above.
33477 * decl.cs (Definition): Keep track of the TypeBuilder type that
33478 represents this type here. Not sure we will use it in the long
33479 run, but wont hurt for now.
33481 * driver.cs: Smaller changes to accomodate the new code.
33483 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
33486 * rootcontext.cs (CreateInterface): New method, used to create
33487 the System.TypeBuilder type for interfaces.
33488 (ResolveInterfaces): new entry point to resolve the interface
33490 (CodeGen): Property, used to keep track of the code generator.
33492 2001-07-26 Miguel de Icaza <miguel@ximian.com>
33494 * cs-parser.jay: Add a second production for delegate_declaration
33497 (enum_body): Put an opt_comma here instead of putting it on
33498 enum_body or enum_member_declarations so we can handle trailing
33499 commas on enumeration members. Gets rid of a shift/reduce.
33501 (type_list): Need a COMMA in the middle.
33503 (indexer_declaration): Tell tokenizer to recognize get/set
33505 * Remove old targets.
33507 * Re-add the parser target.
33509 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33511 * cs-parser.jay: Add precendence rules for a number of operators
33512 ot reduce the number of shift/reduce conflicts in the grammar.
33514 2001-07-17 Miguel de Icaza <miguel@ximian.com>
33516 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
33519 Get rid of old crufty code.
33521 * rootcontext.cs: Use this to keep track of the parsed
33522 representation and the defined types available to the program.
33524 * gen-treedump.cs: adjust for new convention.
33526 * type.cs: Split out the type manager, and the assembly builder
33529 * typemanager.cs: the type manager will live here now.
33531 * cil-codegen.cs: And the code generator here.
33533 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
33535 * makefile: Fixed up for easy making.
33537 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33539 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
33542 (unary_expression): Expand pre_increment_expression and
33543 post_decrement_expression to reduce a shift/reduce.
33545 2001-07-11 Simon Cozens
33547 * cs-tokenizer.cs: Hex numbers should begin with a 0.
33549 Improve allow_keyword_as_indent name.
33551 2001-06-19 Miguel de Icaza <miguel@ximian.com>
33553 * Adjustments for Beta2.
33555 2001-06-13 Miguel de Icaza <miguel@ximian.com>
33557 * decl.cs: Added `Define' abstract method.
33558 (InTransit): new property, used to catch recursive definitions.
33560 * interface.cs: Implement `Define'.
33562 * modifiers.cs: Map Modifiers.constants to
33563 System.Reflection.TypeAttribute flags.
33565 * class.cs: Keep track of types and user-defined types.
33566 (BuilderInit): New method for creating an assembly
33567 (ResolveType): New function to launch the resolution process, only
33568 used by interfaces for now.
33570 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
33571 that are inserted into the name space.
33573 2001-06-08 Miguel de Icaza <miguel@ximian.com>
33575 * ARGH. I have screwed up my tree so many times due to the use of
33576 rsync rather than using CVS. Going to fix this at once.
33578 * driver.cs: Objetify driver. Load assemblies, use assemblies to
33581 2001-06-07 Miguel de Icaza <miguel@ximian.com>
33583 * Experiment successful: Use System.Type rather that our own
33586 2001-05-25 Miguel de Icaza <miguel@ximian.com>
33588 * cs-parser.jay: Removed nsAliases from here.
33590 Use new namespaces, handle `using XXX;'
33592 * namespace.cs: Reimplemented namespace handling, use a recursive
33593 definition of the class. Now we can keep track of using clauses
33594 and catch invalid using clauses.
33596 2001-05-24 Miguel de Icaza <miguel@ximian.com>
33598 * gen-treedump.cs: Adapted for all the renaming.
33600 * expression.cs (Expression): this class now has a Type property
33601 which returns an expression Type.
33603 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
33604 `Type', as this has a different meaning now in the base
33606 2001-05-22 Miguel de Icaza <miguel@ximian.com>
33608 * interface.cs, class.cs: Removed from all the sources the
33609 references to signature computation, as we can not do method
33610 signature computation during the parsing time, as we are not
33611 trying to solve at that point distinguishing:
33615 void a (NS.Blah x) {}
33618 Which depending on the context might be valid or not, as we do not
33619 know if Blah is the same thing as NS.Blah at that point.
33621 * Redid everything so the code uses TypeRefs now instead of
33622 Types. TypeRefs are just temporary type placeholders, that need
33623 to be resolved. They initially have a pointer to a string and the
33624 current scope in which they are used. This is used later by the
33625 compiler to resolve the reference to an actual Type.
33627 * DeclSpace is no longer a CIR.Type, and neither are
33628 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
33629 are all DeclSpaces, but no Types.
33631 * type.cs (TypeRefManager): This implements the TypeRef manager,
33632 which keeps track of all the types that need to be resolved after
33633 the parsing has finished.
33635 2001-05-13 Miguel de Icaza <miguel@ximian.com>
33637 * ARGH. We are going to have to store `foreach' as a class rather
33638 than resolving it, as we need to verify error 1579 after name
33639 resolution. *OR* we could keep a flag that says `This request to
33640 IEnumerator comes from a foreach statement' which we can then use
33641 to generate the error.
33643 2001-05-10 Miguel de Icaza <miguel@ximian.com>
33645 * class.cs (TypeContainer.AddMethod): we now add methods to the
33646 MethodGroup instead of the method hashtable.
33648 * expression.cs: Add MethodGroup abstraction, which gets us one
33649 step closer to the specification in the way we handle method
33652 * cs-parser.jay (primary_expression): qualified_identifier now
33653 tried to match up an identifier to a local variable reference or
33654 to a parameter reference.
33656 current_local_parameters is now a parser global variable that
33657 points to the current parameters for the block, used during name
33660 (property_declaration): Now creates an implicit `value' argument to
33663 2001-05-09 Miguel de Icaza <miguel@ximian.com>
33665 * parameter.cs: Do not use `param' arguments as part of the
33666 signature, per the spec.
33668 2001-05-08 Miguel de Icaza <miguel@ximian.com>
33670 * decl.cs: Base class for classes, structs and interfaces. This
33671 is the "Declaration Space"
33673 * cs-parser.jay: Use CheckDef for checking declaration errors
33674 instead of having one on each function.
33676 * class.cs: Factor out some code for handling error handling in
33677 accordance to the "Declarations" section in the "Basic Concepts"
33678 chapter in the ECMA C# spec.
33680 * interface.cs: Make all interface member classes derive from
33681 InterfaceMemberBase.
33683 2001-05-07 Miguel de Icaza <miguel@ximian.com>
33685 * Many things: all interfaces are parsed and generated in
33686 gen-treedump. Support for member variables, constructors,
33687 destructors, properties, constants is there.
33689 Beginning of the IL backend, but very little done, just there for
33692 2001-04-29 Miguel de Icaza <miguel@ximian.com>
33694 * cs-parser.jay: Fix labeled statement.
33696 * cs-tokenizer.cs (escape): Escape " and ' always.
33697 ref_line, ref_name: keep track of the line/filename as instructed
33698 by #line by the compiler.
33701 2001-04-27 Miguel de Icaza <miguel@ximian.com>
33703 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
33704 to match the values in System.CodeDOM.
33706 Divid renamed to Divide.
33708 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
33710 (Statements.set): remove.
33712 * System.CodeDOM/CodeCatchClause.cs: always have a valid
33715 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
33716 falseStatements always have valid values.
33718 * cs-parser.jay: Use System.CodeDOM now.