1 2010-05-19 Marek Safar <marek.safar@gmail.com>
4 * generic.cs: Replace original with inflated type parameter on
7 2010-05-19 Marek Safar <marek.safar@gmail.com>
10 * parameter.cs: Extension attribute can be defined in each assembly.
12 2010-05-18 Marek Safar <marek.safar@gmail.com>
15 * method.cs: Only one method can implement an interface.
17 2010-05-18 Marek Safar <marek.safar@gmail.com>
20 * convert.cs, constant.cs, expression.cs, literal.cs, ecore.cs:
21 Typed null can be used as a source for expression methods.
23 2010-05-18 Marek Safar <marek.safar@gmail.com>
26 * namespace.cs: Using directive imports only types and not nested
29 2010-05-17 Marek Safar <marek.safar@gmail.com>
31 * typespec.cs, expression.cs, statement.cs, ecore.cs, complete.cs,
32 delegate.cs: Member instance is resolved after member overload
33 definitely resolves static/instance property of member expression.
34 Fixes #545047, #358848, #456605, #460016, #603299
36 2010-05-12 Marek Safar <marek.safar@gmail.com>
39 * generic.cs, decl.cs, anonymous.cs: Reset more type arguments
40 details for nested anonymous methods stories.
42 2010-05-11 Marek Safar <marek.safar@gmail.com>
45 * namespace.cs: Don't report namespace collision.
47 2010-05-11 Marek Safar <marek.safar@gmail.com>
50 * class.cs, typespec.cs: Search full imported attribute hierarchy
53 2010-05-11 Marek Safar <marek.safar@gmail.com>
55 * namespace.cs: Ignore missing dependencies failure at
58 2010-05-11 Marek Safar <marek.safar@gmail.com>
61 * namespace.cs: Don't resolve using constraints too early.
63 2010-05-11 Marek Safar <marek.safar@gmail.com>
66 * generic.cs: Copy partial type constraints to partial container.
68 2010-05-10 Marek Safar <marek.safar@gmail.com>
71 * import.cs: Relax underlying enum field rules.
73 2010-05-10 Marek Safar <marek.safar@gmail.com>
76 * property.cs: Implement IParametersMember for indexer accessors.
78 2010-05-07 Marek Safar <marek.safar@gmail.com>
81 * class.cs: Update all partial modifiers.
83 2010-05-06 Marek Safar <marek.safar@gmail.com>
86 * method.cs, membercache.cs: Destructors cannot be hidden.
88 2010-05-06 Marek Safar <marek.safar@gmail.com>
91 * class.cs: Resursive reference of type definition is allowed.
93 2010-05-06 Marek Safar <marek.safar@gmail.com>
95 * anonymous.cs: Mutate cached storey instance types too.
97 2010-05-06 Marek Safar <marek.safar@gmail.com>
100 * convert.cs: Explicit enum conversion cannot involve user operators
102 2010-05-05 Miguel de Icaza <miguel@novell.com>
104 * class.cs (TypeContainer.DefineBaseTypes)
105 (TypeContainer.CheckRecursiveDefinition): check for the iface not
106 being null, as we could have failed resolution and crashed;
109 * cs-parser.jay: Productions to catch common mistakes when other
110 punctuation operators are used instead of comma. Fixes 571702
112 2010-05-05 Marek Safar <marek.safar@gmail.com>
114 * anonymous.cs: Mutate correct set of constraints.
116 2010-05-05 Marek Safar <marek.safar@gmail.com>
118 A fix for bug #602842
119 * expression.cs: Resolve all array bound arguments.
121 2010-05-05 Marek Safar <marek.safar@gmail.com>
123 * import.cs: Don't import private fields.
125 2010-04-30 Marek Safar <marek.safar@gmail.com>
127 Partially based on patch by <sami.lamti@gmail.com>
129 * eval.cs, ecore.cs: Fixed eval show methods.
131 2010-04-30 Marek Safar <marek.safar@gmail.com>
133 * generic.cs, delegate.cs: Implement output type inference of
134 methodgroup now when the specification was cleared at least little
137 2010-04-29 Marek Safar <marek.safar@gmail.com>
139 A fix for bug #575611
140 * class.cs: Fix recursive unmanaged recursice sruct check.
142 2010-04-29 Marek Safar <marek.safar@gmail.com>
144 A fix for bug #479776
145 * expression.cs: Implement typeof unbounded nested generic types.
147 2010-04-29 Marek Safar <marek.safar@gmail.com>
149 A fix for bug #474953
150 * class.cs: Fix valid recursive base type definition.
152 2010-04-29 Marek Safar <marek.safar@gmail.com>
154 A fix for bug #421737
155 * convert.cs, expression.cs: A boxing conversion exists from a
156 nullable-type to a reference type, if a boxing conversion exists
157 from the underlying non-nullable-value-type to the reference type.
159 2010-04-29 Marek Safar <marek.safar@gmail.com>
161 A fix for bug #376875
162 * import.cs: Import volatile modifier.
164 2010-04-29 Marek Safar <marek.safar@gmail.com>
166 A fix for bug #372412
167 * typespec.cs, expression.cs, codegen.cs: Emit readonly prefix for
170 2010-04-29 Marek Safar <marek.safar@gmail.com>
172 A fix for bug #568955
173 * statements.cs: Handle recursive scope initializers.
175 2010-04-28 Marek Safar <marek.safar@gmail.com>
177 A fix for bug #566511
178 * anonymous.cs: Always get inflated version of hoisted variable
179 on generic type definition.
181 2010-04-28 Marek Safar <marek.safar@gmail.com>
183 * import.cs, membercache.cs: Relax rules for valid properties.
185 2010-04-28 Marek Safar <marek.safar@gmail.com>
187 * import.cs: Intern arrays used in generic arguments.
189 2010-04-28 Marek Safar <marek.safar@gmail.com>
191 A fix for bug #600398
192 * convert.cs: Actually use effective base type for the comparison.
194 2010-04-28 Marek Safar <marek.safar@gmail.com>
196 A fix for bug #600326
197 * ecore.cs: Pass arity to base member lookup.
199 2010-04-28 Marek Safar <marek.safar@gmail.com>
201 A fix for bug #573385
202 * expression.cs: MemberAccess is of generic type based on right
205 2010-05-28 Marek Safar <marek.safar@gmail.com>
207 * cs-tokenizer.cs: Made tab size configurable.
209 2010-05-27 Marek Safar <marek.safar@gmail.com>
211 * attribute.cs: Ensure Obsolete members are defined before doing
214 2010-05-27 Marek Safar <marek.safar@gmail.com>
216 * visit.cs: Add DOM visitor skeleton.
220 2010-05-27 Marek Safar <marek.safar@gmail.com>
222 * attribute.cs, codegen.cs: Drop COMPILER_ACCESS hack.
224 2010-05-27 Marek Safar <marek.safar@gmail.com>
226 * *.cs: Major rewrite of compiler internals to better work with
227 unmodified System.Reflection.Emit. Some of the key changes are
228 - TypeSpec replaces reflection specific System.Type.
229 - All Type(TypeSpec) operations are now done in compiler therefore
230 no dependency on SRE to inflate generic members and types or to
231 query unclosed types.
232 - MemberCache is now the only and full hierarchical topology.
233 - Generic constraints are implemented properly.
234 - And as a bonus compilation is on average 30% faster.
236 2010-04-15 Jb Evain <jbevain@novell.com>
238 * dmcs.exe.config: update the runtime version to .net 4.0 RTM.
240 2010-04-12 Marek Safar <marek.safar@gmail.com>
242 * expression.cs, attribute.cs, parameter.cs: More attribute type
245 2010-04-12 Marek Safar <marek.safar@gmail.com>
247 A fix for bug #593342
249 * generic.cs, parameter.cs, argument.cs, field.cs, property.cs,
250 decl.cs, roottypes.cs, constant.cs, nullable.cs, expression.cs,
251 method.cs, ecore.cs, class.cs, delegate.cs, attribute.cs,
252 codegen.cs: Add custom attribute encoder to deal with unfinished
253 types and easier corlib bootstrap from its own types.
255 2010-03-26 Marek Safar <marek.safar@gmail.com>
257 * cs-parser.jay: Report invalid constraint types.
259 2010-03-16 Jb Evain <jbevain@novell.com>
261 * Makefile: rename the net_2_1 profile to moonlight.
263 2010-03-11 Marek Safar <marek.safar@gmail.com>
265 * statement.cs, cs-parser.jay: Use correct location for empty
268 2010-03-11 Marek Safar <marek.safar@gmail.com>
270 * cs-parser.jay: Disable Location from expression.
272 * generic.cs: Check constraints for overrides in the parser.
274 2010-03-09 Marek Safar <marek.safar@gmail.com>
276 * cs-parser.jay (GetLocation): Use an expression when available.
278 2010-03-04 Marek Safar <marek.safar@gmail.com>
280 A fix for bug #582579
281 * ecore.cs (FieldExpr): Don't optimize cross reference loads.
283 2010-03-04 Marek Safar <marek.safar@gmail.com>
285 A patch by kornelpal@gmail.com
287 * dynamic.cs, anonymous.cs, rootcontext.cs, class.cs: Don't make
288 compiler generated classes sealed by default. Emit and close top
289 level compiler generated classes as well.
291 * support.cs: Use RuntimeHelpers.GetHashCode.
293 2010-03-03 Rolf Bjarne Kvinge <RKvinge@novell.com>
295 * Makefile: We need to use the internal bootstrapping gmcs for
296 net_2_1_bootstrap too now.
298 2010-03-02 Raja R Harinath <harinath@hurrynot.org>
300 * expression.cs (IndexerAccess.ResolveAccessor): Add CS1540 check.
302 2010-03-02 Marek Safar <marek.safar@gmail.com>
304 * cs-tokenizer.cs: Missed few locations in previous fix.
306 2010-03-02 Marek Safar <marek.safar@gmail.com>
308 * cs-tokenizer.cs, argument.cs, dynamic.cs, assign.cs, anonymous.cs,
309 nullable.cs, expression.cs, statement.cs, cs-parser.jay, cfold.cs:
310 Report correct location for operator errors.
312 2010-03-02 Marek Safar <marek.safar@gmail.com>
314 * typemanager.cs (IsDynamicType): Don't check external types when
315 the attribute is not external.
317 2010-02-24 Marek Safar <marek.safar@gmail.com>
319 A fix for bug #582579
320 * decl.cs (IsExposedFromAssembly): Use PartialContainer for parent
323 2010-02-24 Marek Safar <marek.safar@gmail.com>
325 A fix for bug #581804
326 * ecore.cs: Fixed type comparison.
328 2010-02-08 Miguel de Icaza <miguel@novell.com>
330 * namespace.cs (CompletionGetTypesStartingWith): Do not include
331 private types in the completion results.
333 * cs-parser.jay: Bubble completions after "from x in ?" and "from x
336 2010-02-17 Marek Safar <marek.safar@gmail.com>
338 * generic.cs, field.cs, decl.cs, cs-parser.jay: Simplify special
341 2010-02-14 Miguel de Icaza <miguel@novell.com>
343 * eval.cs: Do not do the report printer dance unless the user has
344 set the DescribeTypes feature.
346 2010-02-10 Marek Safar <marek.safar@gmail.com>
348 * argument.cs, dynamic.cs, expression.cs: Track RC API changes.
350 2010-02-08 Marek Safar <marek.safar@gmail.com>
352 A fix for bug #577029
353 * anonymous.cs: Fixed TypeBuilder* check.
355 2010-02-06 Miguel de Icaza <miguel@novell.com>
357 * eval.cs (CompileBlock): Also undo if there are problems during
358 semantic analysis, fixes various cases where invalid C# code would
359 be reported, but the internal changes would not be undone.
361 2010-02-03 Miguel de Icaza <miguel@novell.com>
363 * driver.cs: Change the --fatal flag to allow a number to be
364 passed, this ignores the first N fatal errors. Useful to debug
365 errors that do not happen on the first hit.
367 * cs-parser.jay (invocation_expression): accept both the
368 CLOSE_PARENS and COMPLETE_COMPLETION, this allows completions
369 inside an invocation.
371 * driver.cs: Expose FatalErrors.
373 * eval.cs: Initialize the printer's Fatal property from the
374 Driver's FatalError flag, this allows csharp --fatal to work
377 Add support for calling Describe (typeof (TYPE)) if the expression
380 2010-02-02 Marek Safar <marek.safar@gmail.com>
382 A fix for bug #574991
383 * rootcontext.cs, class.cs, driver.cs: Hide enhanced warnings behind
386 2010-02-02 Marek Safar <marek.safar@gmail.com>
388 A fix for bug #575986
389 * expression.cs: Don't mutate typeof type definitions.
391 2010-01-28 Marek Safar <marek.safar@gmail.com>
393 * decl.cs: Use only one set of modifiers.
395 2010-01-26 Marek Safar <marek.safar@gmail.com>
397 A fix for bug #573329
398 * eval.cs: Don't disable error reporting completely on silent mode.
400 2010-01-25 Marek Safar <marek.safar@gmail.com>
402 A fix for bug #573312
403 * constant.cs, expression.cs, ecore.cs: Emit correct offset for
404 pointer index of unknown size types greater than 2.
406 2010-01-15 Marek Safar <marek.safar@gmail.com>
408 * *.cs: Use only 1 member kind enum.
410 2010-01-15 Marek Safar <marek.safar@gmail.com>
412 * *.cs: Add event specification.
414 2010-01-14 Marek Safar <marek.safar@gmail.com>
416 * membercache.cs: Extracted from decl.cs.
418 * *.cs: Put more infrastructure in place.
420 2010-01-13 Marek Safar <marek.safar@gmail.com>
422 * *.cs: Add property specification, unused yet.
424 2010-01-13 Marek Safar <marek.safar@gmail.com>
426 * property.cs: Move all property based declarations into a new file.
428 2010-01-13 Marek Safar <marek.safar at gmail.com>
430 * expression.cs (Conditional): Resolve reduced expression.
432 2010-01-13 Marek Safar <marek.safar at gmail.com>
434 * *.cs: Introduced non-generic method specification.
436 2010-01-07 Marek Safar <marek.safar@gmail.com>
438 * method.cs: Move all method based declarations into a new file.
440 2010-01-07 Marek Safar <marek.safar@gmail.com>
442 * *.cs: Extract field specification.
444 2009-12-17 Marek Safar <marek.safar@gmail.com>
446 * field.cs: Extracted from class.cs
448 2009-12-15 Marek Safar <marek.safar@gmail.com>
450 * attribute.cs (GetFixedBuffer): Work on field definition only.
452 2009-12-15 Marek Safar <marek.safar@gmail.com>
454 * *.cs: Clean up NET_4_0 conditional where possible.
456 2009-12-14 Rodrigo Kumpera <rkumpera@novell.com>
458 support.cs (DynamicType): Assembly property returns the assembly builder.
459 This is required due to how compiler context works in corlib.
461 2009-12-14 Marek Safar <marek.safar@gmail.com>
463 A fix for bug #564376
464 * assign.cs (LocalTemporary): Removed no longer needed special
467 2009-12-11 Marek Safar <marek.safar@gmail.com>
469 * modifiers.cs, decl.cs, iterators.cs, const.cs, anonymous.cs,
470 class.cs, delegate.cs, cs-parser.jay, enum.cs: Turn modifiers into
471 enum for easier debugging.
473 2009-12-10 Marek Safar <marek.safar@gmail.com>
475 * decl.cs, anonymous.cs, class.cs: Sealed Define it's now main entry
478 * parameter.cs, delegate.cs, dynamic.cs: Don't use builder methods
481 2009-12-10 Marek Safar <marek.safar@gmail.com>
483 * cs-parser.jay, statement.cs: Handle parser error in code
486 2009-12-10 Marek Safar <marek.safar@gmail.com>
488 * ecore.cs: Ignore base imported methods when they are already
491 * eval.cs: Handle non-existent keys.
493 * report.cs, driver.cs: Make fatal work with console printer only.
495 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
497 * typemanager.cs (MakeGenericMethod): Fix stupid mistake.
499 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
501 * typemanager.cs: Add MakeGenericMethod that checks if the method
502 is really the generic method definition.
504 ecore.cs (MethodGroupExpr:IsApplicable): Use new TypeManager function
505 to inflate generic methods.
507 2009-12-08 Marek Safar <marek.safar@gmail.com>
509 A fix for bug #561149
510 * anonymous.cs: Use actual type parameters when checking for generic
513 2009-12-08 Marek Safar <marek.safar@gmail.com>
515 A fix for bug #561369
516 * expression.cs (DoNumericPromotion): Fixed typo.
518 2009-12-08 Marek Safar <marek.safar@gmail.com>
520 *.cs: Moving to generics world.
522 cs-parser.jay: Removed current_array_type.
524 2009-12-07 Marek Safar <marek.safar@gmail.com>
526 *.cs: Moving to generics world.
528 2009-12-04 Marek Safar <marek.safar@gmail.com>
530 *.cs: Moving to generics world (day 2).
532 2009-12-03 Marek Safar <marek.safar@gmail.com>
534 *.cs: Moving to generics world.
536 2009-12-02 Marek Safar <marek.safar@gmail.com>
538 * typemanager.cs, parameter.cs, class.cs, delegate.cs, attribute.cs:
539 Encode dynamic type attribute for elements where attributes cannot
542 2009-12-01 Marek Safar <marek.safar@gmail.com>
544 argument.cs, assign.cs, expression.cs, cs-parser.jay: Named
547 2009-12-01 Marek Safar <marek.safar@gmail.com>
549 A fix for bug #360455
550 * class.cs: Never report a unused warning for generic events to
551 workaround wrong expression type.
553 2009-11-30 Marek Safar <marek.safar@gmail.com>
555 A fix for bug #558305
556 * decl.cs, class.cs: Check partial method definitions using correct
559 2009-11-30 Marek Safar <marek.safar@gmail.com>
561 * argument.cs: Don't cache rarely used dynamic flag.
563 2009-11-27 Marek Safar <marek.safar@gmail.com>
565 * cs-parser.jay: Use jay global stacks (saves over 3MB for corlib).
567 2009-11-27 Marek Safar <marek.safar@gmail.com>
569 * ecore.cs (SimpleName): Removed no longer needed in_transit as
570 Resolve is now non-reentrant (saves ~0.6MB for corlib).
572 2009-11-26 Marek Safar <marek.safar@gmail.com>
574 A fix for bug #545081
575 * decl.cs: Check private nested types of nested types recursively.
577 2009-11-26 Marek Safar <marek.safar@gmail.com>
579 A fix for bug #558305
580 * location.cs: Ignore self referencing #line directive
582 2009-11-26 Marek Safar <marek.safar@gmail.com>
584 A fix for bug #558292
585 * class.cs: Allow single unsafe fixed buffer fields.
587 2009-11-26 Marek Safar <marek.safar@gmail.com>
589 * expression: Optimize few more zero-based operations.
591 2009-11-26 Marek Safar <marek.safar@gmail.com>
593 * cs-tokenizer.cs, cs-parser.jay: Simplify literal parsing, also
594 avoids boxing of literal values.
596 2009-11-26 Marek Safar <marek.safar@gmail.com>
598 * cs-tokenizer.cs, argument.cs, eval.cs, linq.cs, decl.cs,
599 expression.cs, ecore.cs, location.cs, cs-parser.jay, attribute.cs,
600 codegen.cs: LocatedToken redesing to avoid excessive allocation and
601 boxing (saves ~7MB for corlib). Also fixes presise token location.
603 2009-11-25 Marek Safar <marek.safar@gmail.com>
605 * ecore.cs, cs-parser.jay: Keep parser structures local. Share
608 2009-11-24 Marek Safar <marek.safar@gmail.com>
610 * expression.cs: Lower static array initializer barrier.
612 * support.cs, driver.cs: Share reader buffer.
614 2009-11-23 Marek Safar <marek.safar@gmail.com>
616 * cs-tokenizer.cs, support.cs: Some tokenizer optimizations.
618 2009-11-23 Marek Safar <marek.safar@gmail.com>
620 * cs-tokenizer.cs, support.cs: Use Dictionary instead of Hashtable,
621 cleanup some obsolete code.
623 2009-11-20 Marek Safar <marek.safar@gmail.com>
625 * context.cs, expression.cs, ecore.cs, complete.cs: Cleaned up
628 2009-11-20 Marek Safar <marek.safar@gmail.com>
630 * *.cs: Resolved expressions are never resolved again, this helps to
631 uncover some not easy to find bugs and improve the performance.
633 2009-11-19 Marek Safar <marek.safar@gmail.com>
635 * *.cs: Made constant expressions fully compatible with any other
638 2009-11-19 Marek Safar <marek.safar@gmail.com>
640 * *.cs: DoResolve is a worker method and has to be protected.
642 2009-11-18 Marek Safar <marek.safar@gmail.com>
644 * *.cs: More context specific handling.
646 2009-11-17 Marek Safar <marek.safar@gmail.com>
648 * *.cs: More context specific handling.
650 2009-11-16 Marek Safar <marek.safar@gmail.com>
652 * dynamic.cs, class.cs: Removed few fixed user types conversions.
654 * symbolwriter.cs: Uses public ILOffset.
656 2009-11-13 Marek Safar <marek.safar@gmail.com>
658 A fix for bug #553650
659 * generic.cs: Another missing TypeToCoreType, still too many to fix.
661 2009-11-13 Marek Safar <marek.safar@gmail.com>
663 A fix for bug #555170
665 * class.cs, delegate.cs, enum.cs: Constants have to be available
666 for parameters resolve.
668 2009-11-12 Marek Safar <marek.safar@gmail.com>
670 * typemanager.cs, argument.cs, support.cs, delegate.cs: Dynamic
673 2009-11-12 Marek Safar <marek.safar@gmail.com>
675 * argument.cs, context.cs, expression.cs, ecore.cs: Dynamic binding
676 with a statically known candidate set.
678 2009-11-11 Scott Peterson <lunchtimemama@gmail.com>
680 * generic.cs: Made type inflation for generic constraint checks
681 recursive. This fixes BGO #553655.
683 2009-11-11 Marek Safar <marek.safar@gmail.com>
685 * dynamic.cs, decl.cs, expression.cs, ecore.cs: More dynamic type
688 2009-11-10 Marek Safar <marek.safar@gmail.com>
690 * typemanager.cs, generic.cs, parameter.cs, argument.cs, dynamic.cs,
691 linq.cs, rootcontext.cs, ecore.cs, class.cs, delegate.cs,
692 attribute.cs: Add some dynamic error checking.
694 2009-11-07 Marek Safar <marek.safar@gmail.com>
696 A fix for bug #553465
698 * expression.cs: Fixed mixed version of expression tree anonymous
701 2009-11-06 Marek Safar <marek.safar@gmail.com>
703 A fix for bug #553031
705 * linq.cs, expression.cs, class.cs, cs-parser.jay: Initialize
706 expression tree version of anonymous type with members declaration.
708 2009-11-05 Marek Safar <marek.safar@gmail.com>
710 * parameter.cs: Handle nullable parameter default expression.
712 * argument.cs, dynamic.cs, expression.cs, support.cs, ecore.cs,
713 class.cs, attribute.cs: Check for wrong dynamic arguments.
715 2009-11-05 Marek Safar <marek.safar@gmail.com>
717 * statement.cs: Dynamic statements.
719 2009-11-04 Marek Safar <marek.safar@gmail.com>
721 * dynamic.cs, assign.cs, context.cs, expression.cs, ecore.cs:
722 Compound assignments over dynamic type.
724 2009-11-03 Marek Safar <marek.safar@gmail.com>
726 * argument.cs, dynamic.cs, expression.cs, delegate.cs: Dynamic
727 constructor arguments.
729 2009-10-30 Marek Safar <marek.safar@gmail.com>
731 * dynamic.cs, convert.cs, assign.cs, constant.cs, expression.cs,
732 codegen.cs: Unary mutator on dynamic member access expression.
734 2009-10-29 Marek Safar <marek.safar@gmail.com>
736 A fix for bug #550580
737 * convert.cs: Don't eliminate explicit precission casts.
739 2009-10-28 Marek Safar <marek.safar@gmail.com>
741 A fix for bug #550404
743 * parameter.cs, iterators.cs, context.cs, anonymous.cs,
744 expression.cs, statement.cs, ecore.cs: Quote any nested expression
747 2009-10-27 Marek Safar <marek.safar@gmail.com>
749 * constant.cs, nullable.cs: Create nullable-null as LiftedNull
752 * class.cs: Allow nullable binary user operators.
754 2009-10-26 Marek Safar <marek.safar@gmail.com>
756 * expression.cs: Move binary expression optimization at the end of
759 2009-10-23 Marek Safar <marek.safar@gmail.com>
761 * constant.cs, nullable.cs, expression.cs, literal.cs, cfold.cs:
762 Separate NullConstant from NullLiteral.
764 2009-10-23 Marek Safar <marek.safar@gmail.com>
766 * typemanager.cs, eval.cs, decl.cs, roottypes.cs, context.cs,
767 anonymous.cs, expression.cs, rootcontext.cs, ecore.cs, class.cs,
768 flowanalysis.cs, cs-parser.jay, driver.cs, codegen.cs: Split
769 ModuleContainer. Add common unclosed member check routine.
771 2009-10-22 Marek Safar <marek.safar@gmail.com>
773 * argument.cs: Use literal flag for real literals only.
775 * dynamic.cs: Use correct return type for custom delegates.
777 2009-10-22 Marek Safar <marek.safar@gmail.com>
779 * dynamic.cs, expression.cs: Pass logical binary flag to dynamic
782 2009-10-22 Marek Safar <marek.safar@gmail.com>
784 * dynamic.cs, ecore.cs: Dynamic invocation with void return type.
786 2009-10-21 Marek Safar <marek.safar@gmail.com>
788 * dynamic.cs, convert.cs, expression.cs, ecore.cs: Wrap array index
791 2009-10-21 Marek Safar <marek.safar@gmail.com>
793 * typemanager.cs, dynamic.cs, expression.cs: Don't resolve runtime
796 2009-10-20 Marek Safar <marek.safar@gmail.com>
798 * argument.cs, dynamic.cs, expression.cs: Latest API update.
800 2009-10-19 Marek Safar <marek.safar@gmail.com>
802 * typemanager.cs, expression.cs: Dynamic array initializer.
804 2009-10-16 Marek Safar <marek.safar@gmail.com>
806 * typemanager.cs, rootcontext.cs: Clear -nostdlib flag when object
809 2009-10-16 Marek Safar <marek.safar@gmail.com>
811 A fix for bug #493523, #507067
812 * convert.cs, nullable.cs, expression.cs: Do implicit and explicit
813 standard nullable conversion using underlying standard conversion
814 and not full conversion.
816 2009-10-15 Marek Safar <marek.safar@gmail.com>
818 * dynamic.cs, expression.cs, ecore.cs, delegate.cs: Check return
819 type in VerifyArgumentsCompat.
821 2009-10-15 Marek Safar <marek.safar@gmail.com>
823 * nullable.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
824 Reject variable used with type arguments.
826 2009-10-14 Marek Safar <marek.safar@gmail.com>
828 * argument.cs, dynamic.cs, assign.cs, expression.cs, ecore.cs:
829 Implement dynamic expressions assignment.
831 2009-10-14 Marek Safar <marek.safar@gmail.com>
833 * expression.cs: Build underlying expression when resolving unary
836 2009-10-14 Marek Safar <marek.safar@gmail.com>
838 * expression.cs: Emit enum array initializer using binary blob.
840 2009-10-08 Marek Safar <marek.safar@gmail.com>
842 * typemanager.cs, constant.cs: Optimize decimal constants which fit
845 2009-10-07 Marek Safar <marek.safar@gmail.com>
847 * typemanager.cs: Reset object_type.
849 * assign: Made SimpleAssign public.
851 2009-10-06 Marek Safar <marek.safar@gmail.com>
853 * typemanager.cs, decl.cs, namespace.cs, ecore.cs, class.cs: Pass
854 invocation assembly to IsThisOrFriendAssembly.
856 2009-10-05 Marek Safar <marek.safar@gmail.com>
858 * expression.cs: Equality comparison of generic parameter with
861 2009-10-05 Marek Safar <marek.safar@gmail.com>
863 A fix for bug #543570
864 * generic.cs: Import predefined constraints correctly.
866 2009-10-02 Marek Safar <marek.safar@gmail.com>
868 * ecore.cs: Don't crash on overloads with optional paremeters where
869 arguments count overflows.
871 * parameter.cs: Import optional parameter constants using optional
874 2009-10-01 Marek Safar <marek.safar@gmail.com>
876 * Makefile: Default is gmcs compiler.
878 2009-10-01 Marek Safar <marek.safar@gmail.com>
880 * cs-parser.jay: Fixed few NRE.
882 2009-10-01 Marek Safar <marek.safar@gmail.com>
884 * cs-parser.jay, driver.cs: Expose parser exception in verbose mode.
886 2009-09-30 Marek Safar <marek.safar@gmail.com>
888 * linq.cs, convert.cs, assign.cs, expression.cs, ecore.cs: Add
889 ShimExpression, ImplicitCast.
891 2009-09-30 Marek Safar <marek.safar@gmail.com>
893 A fix for bug #542959
894 * delegate.cs: Emit correct delegate instance variable when there
895 are static and non-static overloads.
897 2009-09-29 Marek Safar <marek.safar@gmail.com>
899 * dynamic.cs, linq.cs, anonymous.cs, expression.cs, statement.cs,
900 ecore.cs, cs-parser.jay: Unary expression dynamic compiler.
902 2009-09-28 Marek Safar <marek.safar@gmail.com>
904 A fix for bug #542487
905 * ecore.cs: Resolve extension methods hidden by properties.
907 2009-09-25 Marek Safar <marek.safar@gmail.com>
909 * expression.cs, ecore.cs: More dynamic binary expressions.
911 2009-09-22 Marek Safar <marek.safar@gmail.com>
913 * nullable.cs, expression.cs: Fixed null lifted conversion for
914 bitwise enum operations.
916 2009-09-22 Marek Safar <marek.safar@gmail.com>
918 * convert.cs, ecore.cs: Fixed explicit unsafe coversion of long
919 values in checked context.
921 2009-09-22 Marek Safar <marek.safar@gmail.com>
923 * expression.cs, ecore.cs: Fixed array index constant conversion.
925 2009-09-20 Miguel de Icaza <miguel@novell.com>
927 * expression.cs: Do not crash when MemberLookup returns something
928 that is not a MemberExpr here. Report error 582 instead.
932 2009-09-18 Marek Safar <marek.safar@gmail.com>
934 * decl.cs, class.cs: Check protected property accessors.
936 2009-09-18 Marek Safar <marek.safar@gmail.com>
938 * dynamic.cs, assign.cs: Dynamic compound assignment.
940 2009-09-17 Marek Safar <marek.safar@gmail.com>
942 * expression.cs: Fixed compound assignment explicit conversion.
944 2009-09-17 Marek Safar <marek.safar@gmail.com>
946 * expression.cs, ecore.cs: Cannot infer variables from method group.
948 2009-09-16 Marek Safar <marek.safar@gmail.com>
950 * argument.cs, dynamic.cs, convert.cs, context.cs, anonymous.cs,
951 constant.cs, nullable.cs, expression.cs, literal.cs, ecore.cs,
952 codegen.cs: Dynamic binary operations scaffolding.
954 2009-09-15 Marek Safar <marek.safar@gmail.com>
956 * expression.cs: Fixes nullable promotion for enum type variables.
958 2009-09-11 Marek Safar <marek.safar@gmail.com>
960 * driver.cs, dynamic.cs: Reset more static variables.
962 2009-09-11 Marek Safar <marek.safar@gmail.com>
964 * dynamic.cs, expression.cs, rootcontext.cs, namespace.cs, ecore.cs,
965 driver.cs: Introduced Expression::MakeExpression.
967 2009-09-11 Marek Safar <marek.safar@gmail.com>
969 * eval.cs: Exposed MessageOutput instead of cleaning up eval API.
971 2009-09-09 Marek Safar <marek.safar@gmail.com>
973 * eval.cs, report.cs: Use Console.Out for all eval error or warning
976 2009-09-09 Marek Safar <marek.safar@gmail.com>
978 A fix for bug #518707
979 * expression.cs (Is): Optimize only generic parameter type
980 expression probing value type generic parameter.
982 2009-09-09 Marek Safar <marek.safar@gmail.com>
984 A fix for bug #532571
985 * ecore.cs: Check for simple name type arguments used with
988 2009-09-08 Marek Safar <marek.safar@gmail.com>
990 A fix for bug #497421
991 * generic.cs (CheckConstraint): Don't use buildin types to check for
992 parameterless constructor.
994 2009-09-08 Marek Safar <marek.safar@gmail.com>
996 A fix for bug #537402
997 * generic.cs (CheckConstraint): Correctly inflate generic type
998 arguments when checking generic method.
1000 2009-09-08 Marek Safar <marek.safar@gmail.com>
1002 A fix for bug #536463
1003 * decl.cs (AddToContainer): Don't report collision between explicit
1004 and parameterless non-explicit members.
1006 2009-09-08 Marek Safar <marek.safar@gmail.com>
1008 * eval.cs: Reset more static stuff.
1010 2009-09-07 Marek Safar <marek.safar@gmail.com>
1012 A fix for bug #324625
1013 * expression.cs, ecore.cs: Create nested generic type expression
1014 using declaring and not current type.
1016 2009-09-07 Marek Safar <marek.safar@gmail.com>
1018 * *.cs: Changed Report class to accept various output printers and
1019 be an instance class. An expression resolver can now use different
1020 message reporter for each call and Report.Error can safely throw
1021 an exception. Part of ongoing work to turn mcs into proper library.
1023 2009-09-04 Marek Safar <marek.safar@gmail.com>
1025 * statement.cs, ecore.cs: Removed error reporting from emit code.
1027 2009-09-04 Marek Safar <marek.safar@gmail.com>
1029 * cs-parser.jay, parameter.cs: Moved parser check out of constructor
1031 2009-09-03 Marek Safar <marek.safar@gmail.com>
1033 * anonymous.cs, expression.cs, statement.cs, cs-parser.jay: Moved
1034 parser checks out of constructors.
1036 2009-09-02 Marek Safar <marek.safar@gmail.com>
1038 * expression.cs, statement.cs, ecore.cs: Use common Report.Error.
1040 2009-09-02 Marek Safar <marek.safar@gmail.com>
1042 A fix for bug #535448
1043 * anonymous.cs, class.cs: Copy return label between all contexts.
1045 2009-09-02 Marek Safar <marek.safar@gmail.com>
1047 A fix for bug #535395
1048 * namespace.cs: Resolve context can be null.
1050 2009-08-25 Marek Safar <marek.safar@gmail.com>
1052 A fix for bug #533912
1053 * generic.cs: Use correct context for constraints resolving.
1055 2009-08-25 Marek Safar <marek.safar@gmail.com>
1057 A fix for bug #532630
1058 * driver.cs: Trim conditional symbols.
1060 2009-08-25 Marek Safar <marek.safar@gmail.com>
1062 * context.cs: New file.
1064 * *.exe.sources, *.csproj: Updated.
1066 2009-08-25 Marek Safar <marek.safar@gmail.com>
1068 * generic.cs, parameter.cs, decl.cs, statement.cs, namespace.cs,
1069 class.cs, generic-mcs.cs, codegen.cs: Add GetSignatureForError to
1070 IMembercontext, some small cleanups.
1072 2009-08-24 Marek Safar <marek.safar@gmail.com>
1074 * *.cs: Split ResolveContext and EmitContext.
1076 2009-08-24 Marek Safar <marek.safar@gmail.com>
1078 * *.cs: Only ResolveContext implements IMemberContext.
1080 2009-08-21 Marek Safar <marek.safar@gmail.com>
1082 * *.cs: Renamed IResolveContext to IMemberContext.
1084 2009-08-21 Marek Safar <marek.safar@gmail.com>
1086 * *.cs: Detached ResolveContext from EmitContext.
1088 2009-08-21 Marek Safar <marek.safar@gmail.com>
1090 * codegen.cs: Moved flow-analysis to BlockContext.
1092 2009-08-21 Marek Safar <marek.safar@gmail.com>
1094 * *.cs: Detached BlockContext from EmitContext.
1096 2009-08-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1098 * statement.cs: avoid nullref when the return value of GetEnumerator()
1099 does not contain any MoveNext() method.
1101 2009-08-19 Marek Safar <marek.safar@gmail.com>
1103 * *.cs: Removed IResolveContext::GenericDeclContainer.
1105 2009-08-19 Marek Safar <marek.safar@gmail.com>
1107 * class.cs, delegate.cs: Changed Delegate to be TypeContainer based.
1109 2009-08-19 Marek Safar <marek.safar@gmail.com>
1111 * generic.cs, iterators.cs, expression.cs, statement.cs, ecore.cs,
1112 cs-parser.jay, attribute.cs, codegen.cs: Better error reports.
1114 2009-08-18 Marek Safar <marek.safar@gmail.com>
1116 * *.cs: Removed boolean fields from EmitContext.
1118 2009-08-18 Marek Safar <marek.safar@gmail.com>
1120 * *.cs: Add IResolveContext::IsStatic.
1122 2009-08-18 Marek Safar <marek.safar@gmail.com>
1124 * *.cs: Moved TopBlock's methods from EmitContext to TopBlock.
1126 2009-08-17 Marek Safar <marek.safar@gmail.com>
1128 * *.cs: Removed DeclContainer from EmitContext.
1130 2009-08-17 Marek Safar <marek.safar@gmail.com>
1132 * *.cs: Add IResolveContext::CurrentTypeParameters.
1134 2009-08-14 Marek Safar <marek.safar@gmail.com>
1136 * *.cs: Removed TypeContainer and ContainerType from EmitContext.
1138 2009-08-14 Marek Safar <marek.safar@gmail.com>
1140 * decl.cs, expression.cs, namespace.cs, ecore.cs, class.cs,
1141 codegen.cs: Add IResolveContext::LookupExtensionMethod.
1143 2009-08-13 Marek Safar <marek.safar@gmail.com>
1145 * decl.cs: Look in PartialContainer for parent type parameters.
1147 2009-08-13 Marek Safar <marek.safar@gmail.com>
1149 * decl.cs, namespace.cs, ecore.cs, class.cs, attribute.cs,
1150 codegen.cs: Add IResolveContext::LookupTypeParameter.
1152 2009-08-13 Marek Safar <marek.safar@gmail.com>
1154 * lambda.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
1155 Moved resolved logic from Emit to Resolve.
1157 2009-08-13 Marek Safar <marek.safar@gmail.com>
1159 * parameter.cs, decl.cs, roottypes.cs, class.cs, attribute.cs,
1160 codegen.cs: Reworked atttributes handling of ResolveContext.
1162 2009-08-12 Marek Safar <marek.safar@gmail.com>
1164 * decl.cs, ecore.cs, class.cs, attribute.cs, codegen.cs: Pushed
1165 LookupNamespaceOrType to ResolveContext.
1167 2009-08-12 Marek Safar <marek.safar@gmail.com>
1169 * typemanager.cs, decl.cs, expression.cs, namespace.cs, ecore.cs,
1170 class.cs: Removed unused parameters and methods.
1172 2009-08-11 Marek Safar <marek.safar@gmail.com>
1174 * generic.cs, lambda.cs, anonymous.cs, statement.cs, generic-mcs.cs,
1175 codegen.cs: Finding the best common type of a set of expressions for
1178 2009-08-07 Marek Safar <marek.safar@gmail.com>
1180 * dynamic.cs, expression.cs: More dynamic conversions.
1182 2009-08-06 Miguel de Icaza <miguel@novell.com>
1184 * generic.cs: This loop was incorrect, it was increment ii, but
1185 checking for `i'. This was a change introduced to fix #327497,
1188 * class.cs: Catch another case for cs0533 error, fixes #324782.
1190 2009-08-06 Rodrigo Kumpera <rkumpera@novell.com>
1192 * typemanager.cs (GetGenericArguments): SRE returns null for
1193 generic methods on type builder instances if they are not generic
1194 themselves. For example, for Foo<int>::Bar() it returns null, but
1195 not for Foo<int>::Bar<>() or Foo<int>::Bar<double>().
1197 2009-08-05 Marek Safar <marek.safar@gmail.com>
1199 * argument.cs, dynamic.cs, expression.cs, ecore.cs, class.cs,
1200 delegate.cs: Work on dynamic binding.
1202 2009-08-04 Marek Safar <marek.safar@gmail.com>
1204 A second fix for bug #525342
1205 * class.cs: Attach partial method attributes to method
1208 2009-08-03 Marek Safar <marek.safar@gmail.com>
1210 * typemanager.cs, parameter.cs, support.cs, class.cs: Dynamic type
1213 * rootcontext.cs: Default to langversion v4.
1215 2009-08-03 Marek Safar <marek.safar@gmail.com>
1217 * pending.cs: Check return type before member info is set.
1219 2009-08-03 Marek Safar <marek.safar@gmail.com>
1221 * anonymous.cs: Fully initialize generic hoisted field expression.
1223 2009-08-02 Miguel de Icaza <miguel@novell.com>
1225 * cs-parser.jay: Flag variables declared on the interactive shell
1226 as used to prevent the 168 warning about local variable not being
1229 2009-07-31 Marek Safar <marek.safar@gmail.com>
1231 * parameter.cs, dynamic.cs, support.cs, class.cs, delegate.cs,
1232 attribute.cs: Emit dynamic export attribute.
1234 2009-07-30 Marek Safar <marek.safar@gmail.com>
1236 * expression.cs: More verifier work.
1238 2009-07-29 Marek Safar <marek.safar@gmail.com>
1240 * nullable.cs: Fixed SRE crash during corlib compilation.
1242 2009-07-29 Marek Safar <marek.safar@gmail.com>
1244 * generic.cs, typemanager.cs, decl.cs, iterators.cs, convert.cs,
1245 nullable.cs, expression.cs, ecore.cs, class.cs, attribute.cs:
1246 More TypeManager.TypeToCoreType needed.
1248 2009-07-29 Marek Safar <marek.safar@gmail.com>
1250 * anonymous.cs: Update after recent SRE fixes.
1252 2009-07-28 Marek Safar <marek.safar@gmail.com>
1254 * typemanager.cs, expression.cs, ecore.cs, delegate.cs: Use correct
1255 version of GetFieldHandle for fields of generic types.
1257 2009-07-27 Marek Safar <marek.safar@gmail.com>
1259 * typemanager.cs, argument.cs, convert.cs, assign.cs, expression.cs,
1260 ecore.cs: Add TypeManager.IsDynamicType,
1261 PredefinedAttributes.Dynamic.
1263 2009-07-27 Marek Safar <marek.safar@gmail.com>
1265 A fix for bug #415375
1266 * expression.cs: Fixed object and reference type parameter
1269 2009-07-27 Marek Safar <marek.safar@gmail.com>
1271 A fix for bug #525342
1272 * class.cs: Attach partial method attributes to method
1275 2009-07-24 Marek Safar <marek.safar@gmail.com>
1277 * argument.cs, dynamic.cs, expression.cs, class.cs, attribute.cs:
1280 2009-07-24 Marek Safar <marek.safar@gmail.com>
1282 * anonymous.cs (MutateField): Add imported types handling.
1284 2009-07-23 Marek Safar <marek.safar@gmail.com>
1286 * expression.cs, delegate.cs: Moved arguments resolve into their
1287 counterparts expressions. Removed argument resolve from
1288 CollectionElementInitializer.
1290 2009-07-23 Marek Safar <marek.safar@gmail.com>
1292 A fix for bug #523683
1293 * convert.cs, delegate.cs: Use common overload mechanism for method
1294 group conversion check.
1296 2009-07-22 Marek Safar <marek.safar@gmail.com>
1298 A fix for bug #523899
1299 * generics.cs: Exact type inference with other bound types.
1301 2009-07-22 Raja R Harinath <harinath@hurrynot.org>
1303 Don't complain when the same type is implemented by the output
1304 assembly as well as multiple referenced assemblies
1305 * namespace.cs (RootNamespace.LookupTypeReflection): Add
1306 'must_be_unique' flag.
1307 (GlobalRootNamespace): Update to changes.
1308 (Namespace.LookupType): Pass 'must_be_unique' only when we don't
1309 already have a type in hand.
1311 2009-07-22 Marek Safar <marek.safar@gmail.com>
1313 * expression.cs: More verifier instrumentation.
1315 * statement.cs: Do proper throw expression conversion.
1317 2009-07-22 Marek Safar <marek.safar@gmail.com>
1319 A fix for bug #522789
1320 * expression.cs: Mutate invocation return type.
1322 2009-07-16 Marek Safar <marek.safar@gmail.com>
1324 * anonymous.cs: Split assignable and readonly generated variable
1327 2009-07-16 Marek Safar <marek.safar@gmail.com>
1329 A fix for bug #521671
1330 * statement.cs: Fixed crash when checking missing type.
1332 2009-07-16 Marek Safar <marek.safar@gmail.com>
1334 * typemanager.cs, generic.cs, argument.cs, linq.cs, convert.cs,
1335 assign.cs, expression.cs, statement.cs, support.cs, ecore.cs,
1336 class.cs, driver.cs: Work on dynamic binding.
1338 * dynamic.cs: New file.
1340 * *.sources, *.proj: Updated.
1342 2009-07-15 Marek Safar <marek.safar@gmail.com>
1344 * expression.cs (Conditional): Avoid double Resolve.
1346 2009-07-13 Marcus Griep <marcus@griep.us>
1348 * ecore.cs: Fix obscure bug with resolving members of interfaces
1349 that hide parent interface members. Fixes bug #444388 and corrects
1352 2009-07-13 Marek Safar <marek.safar@gmail.com>
1354 * expression.cs (LocalVariableReference): Bounce resolve.
1356 2009-07-10 Marek Safar <marek.safar@gmail.com>
1358 * typemanager.cs, lambda.cs, parameter.cs, convert.cs, anonymous.cs,
1359 expression.cs, literal.cs, ecore.cs, complete.cs: Moved internal
1362 * support.cs: New dynamic type wrapper.
1364 2009-07-08 Marek Safar <marek.safar@gmail.com>
1366 * ecore.cs, cs-parser.jay: Better error reporting for implicitly
1367 typed local variable.
1369 2009-07-06 Marek Safar <marek.safar@gmail.com>
1371 A fix for bug #519005
1372 * anonymous.cs: Use null_type as no return type placeholder.
1374 2009-07-02 Marek Safar <marek.safar@gmail.com>
1376 * generic.cs: Handle type inference of identical type parameters
1377 with different bounds.
1379 2009-07-01 Marek Safar <marek.safar@gmail.com>
1381 * expression.cs, class.cs: Events variance.
1383 * cs-parser.jay: Interface events error messages.
1385 2009-07-01 Marek Safar <marek.safar@gmail.com>
1387 * generic.cs, argument.cs: Updated type inference logic to C# 4.0.
1389 2009-06-29 Marek Safar <marek.safar@gmail.com>
1391 * parameter.cs, convert.cs, expression.cs, class.cs: Default
1392 parameter expression can be value-type New.
1394 * cs-parser.jay: Clean up too many parameter modifier boolean flags.
1396 2009-06-26 Marek Safar <marek.safar@gmail.com>
1398 * generic.cs, argument.cs, expression.cs, ecore.cs, cs-parser.jay:
1399 Implemented C# 4.0 named arguments.
1401 2009-06-24 Marek Safar <marek.safar@gmail.com>
1403 * typemanager.cs, parameter.cs, iterators.cs, convert.cs,
1404 expression.cs, ecore.cs, delegate.cs: Removed unnecessary ArgList
1405 parameter modifier. Also fixes bug #515497.
1407 2009-06-24 Marek Safar <marek.safar@gmail.com>
1409 * *.cs: Replaced ArrayList with Arguments in need of a nonsequential
1410 arguments expression to be implemented.
1412 *.sources: Add argument.cs
1414 2009-06-23 Marek Safar <marek.safar@gmail.com>
1416 * parameter.cs: Moved GetParameterIndexByName to base class.
1418 * expression.cs, statement.cs, ecore.cs, delegate.cs: Removed
1419 unused AType. Use argument's version of GetExpressionTree.
1421 2009-06-22 Marek Safar <marek.safar@gmail.com>
1423 * expression.cs, cs-parser.jay, attribute.cs, codegen.cs: Named
1426 2009-06-17 Marek Safar <marek.safar@gmail.com>
1428 A fix for bug #514096
1429 * class.cs: Allow IntPtr/UIntPtr fields to be volatile.
1431 2009-06-17 Marek Safar <marek.safar@gmail.com>
1433 * expression.cs: The first multi-dimensional array nested array
1434 initializers was not checked.
1436 * statement.cs (Switch): Fixed error message to reflect 2.0 changes.
1438 2009-06-17 Marek Safar <marek.safar@gmail.com>
1440 A fix for bug #513400
1441 * nullable.cs (EmitEquality): Operands emit could be simplified for
1442 built-in types when we now emit user operators differently.
1444 2009-06-16 Marek Safar <marek.safar@gmail.com>
1446 * ecore.cs: Report inaccessible delegate methods correctly.
1448 2009-06-16 Marek Safar <marek.safar@gmail.com>
1450 * parameter.cs, expression.cs, ecore.cs, class.cs, delegate.cs,
1451 cs-parser.jay: Implemented C# 4.0 optional parameters.
1453 2009-06-16 Marek Safar <marek.safar@gmail.com>
1455 * driver.cs: Removed broken DefineManifestResource.
1457 2009-06-16 Raja R Harinath <harinath@hurrynot.org>
1459 * Makefile [net_2_0_bootstrap]: Don't explicitly mention net_1_1.
1460 Use $(BOOTSTRAP_PROFILE) instead.
1462 2009-06-12 Jb Evain <jbevain@novell.com>
1464 * rootcontext.cs: add a Platform field.
1465 * driver.cs: handle /platform.
1466 * codegen.cs: pass the proper flags according to
1467 the platform when saving the assembly.
1469 2009-06-11 Marek Safar <marek.safar@gmail.com>
1471 * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
1472 Add optional parameters grammar.
1474 2009-06-10 Marek Safar <marek.safar@gmail.com>
1476 * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
1477 driver.cs: Split lang version and metadata version.
1479 2009-06-10 Marek Safar <marek.safar@gmail.com>
1481 * decl.cs: Better overload ctor collision error message.
1483 2009-06-05 Jb Evain <jbevain@novell.com>
1485 * driver.cs (EmbededResource): avoid using an internal method
1486 in gmcs to embed manifest resources.
1488 2009-06-04 Sebastien Pouliot <sebastien@ximian.com>
1490 * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
1491 the compiler from older mono versions (like moon's bots)
1493 2009-06-04 Marek Safar <marek.safar@gmail.com>
1495 * namespace.cs (LookupTypeReflection): Ignore collisions between
1498 2009-06-04 Marek Safar <marek.safar@gmail.com>
1500 * codegen.cs: Enabled generic type forwarders.
1502 2009-06-04 Marek Safar <marek.safar@gmail.com>
1504 * dmcs.*: Add another version of SRE compiler.
1506 2009-06-03 Marek Safar <marek.safar@gmail.com>
1508 * generic.cs, typemanager.cs, parameter.cs, convert.cs,
1509 generic-mcs.cs: Fixed variant type conversions.
1511 2009-06-02 Marek Safar <marek.safar@gmail.com>
1513 A fix for bug #507863
1514 * codegen.cs: Fixes a crash on invalid string value attribute.
1516 2009-06-01 Marek Safar <marek.safar@gmail.com>
1518 A fix for bug #508334
1519 * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
1520 cs-parser.jay: Fully import __arglist modifier.
1522 2009-05-29 Marek Safar <marek.safar@gmail.com>
1524 * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
1525 delegate.cs, generic-mcs.cs: Rewrote type variance checks to
1526 actually work with closed generic types.
1528 2009-05-27 Alan McGovern <amcgovern@novell.com>
1530 * class.cs, decl.cs, delegate.cs, parameter.cs:
1531 Fix the build by replacing the use of 'var' with the actual type.
1533 2009-05-27 Marek Safar <marek.safar@gmail.com>
1535 * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
1536 cs-parser.jay, generic-mcs.cs: Report wrong variant types
1539 * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
1542 2009-05-26 Rodrigo Kumpera <rkumpera@novell.com>
1543 Marek Safar <marek.safar@gmail.com>
1545 A fix for bug #377509
1546 * parameter.cs: Use predefined and not empty name for implicit
1549 2009-05-21 Marek Safar <marek.safar@gmail.com>
1551 * class.cs: Don't report wrong warnings for event fields.
1553 2009-05-21 Marek Safar <marek.safar@gmail.com>
1555 A fix for bug #504667
1556 * class.cs: Check for static class using parent container instead of
1559 2009-05-08 Marek Safar <marek.safar@gmail.com>
1561 A fix for bug #496922
1562 * expression.cs: Always use temporary variable when using object
1565 2009-04-28 Marek Safar <marek.safar@gmail.com>
1567 A fix for bug #495112
1568 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
1571 2009-04-27 Miguel de Icaza <miguel@novell.com>
1573 * driver.cs: Add a flag to work as a replacement for CSC in VS.
1575 2009-04-24 Miguel de Icaza <miguel@novell.com>
1577 * complete.cs: No idea how gonzalo got a null in the list, but
1580 2009-04-24 Miguel de Icaza <miguel@novell.com>
1582 * complete.cs (CompletionElementInitializer): New completion class
1583 to support completing inside a C# 3 element initializer, so this
1584 allows completion for Silverlight situations where it is very
1587 new TextBlock () { Fo<TAB>
1589 (CompletionSimpleName): Expose the prefix that was
1590 passed to the simple name.
1592 * cs-parser.jay (object_or_collection_initializer): Add support
1593 for element_initializers.
1595 * expression.cs (CollectionOrObjectInitializers.DoResolve):
1596 special case completion expressions as this method aggressively
1597 collects data before it operates, and errors were being thrown
1598 earlier than we were able to complete.
1600 2009-04-23 Miguel de Icaza <miguel@novell.com>
1602 * eval.cs: Make getcompletions silent and enable debugging output
1603 if the -v option is passed.
1605 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
1606 Consider looking up the namespace that matches the prefix being
1609 This is part of the support for allowing completions like:
1610 `System.Co<TAB>' to complete to System.Console.
1612 * complete.cs (CompletionSimpleName.AppendResults): Make this
1615 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
1617 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
1618 COMPLETE_COMPLETION as internal.
1620 2009-04-17 Miguel de Icaza <miguel@novell.com>
1622 * complete.cs: Include namespace resolution in simple names as
1623 well as global types and types in the using scope in the
1626 * namespace.cs: Supporting infrastrcture to provide completions
1627 based on the current using scope.
1629 * eval.cs: Introduce an entry point that allows for initialization
1630 to return a list of the files passed on the command line.
1632 2009-04-14 Marek Safar <marek.safar@gmail.com>
1634 A fix for bug #494243
1635 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
1637 2009-04-13 Marek Safar <marek.safar@gmail.com>
1639 A fix for bug #493887
1640 * statement.cs: Don't skip string multi-section with default or
1641 null label when populating string hashtable.
1643 2009-04-06 Marek Safar <marek.safar@gmail.com>
1645 A fix for bug #492329
1646 * expression.cs (New): Load variable when assigning type parameter
1649 2009-04-06 Marek Safar <marek.safar@gmail.com>
1651 A fix for bug #488960
1652 * decl.cs: Compare MVAR types using non-null values.
1654 2009-03-27 Marek Safar <marek.safar@gmail.com>
1656 * typemanager.cs, expression.cs: Removed unused nullable checks.
1658 2009-03-27 Marek Safar <marek.safar@gmail.com>
1660 * *.cs: Removed some gmcs conditionals.
1662 2009-03-26 Marek Safar <marek.safar@gmail.com>
1664 * generic.cs, support.cs: Moved generics stuff out of support.cs
1666 2009-03-24 Marek Safar <marek.safar@gmail.com>
1668 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
1671 2009-03-23 Marek Safar <marek.safar@gmail.com>
1673 * attribute.cs: Consider all members for error reporting when
1674 checking named arguments.
1676 2009-03-23 Marek Safar <marek.safar@gmail.com>
1678 A fix for bug #487625
1679 * namespace.cs: Use a warning for all predefined type conflicts.
1681 2009-03-23 Marek Safar <marek.safar@gmail.com>
1683 A fix for bug #485706
1684 * statement.cs: Explicitly type catch type argument to pass verifier
1687 2009-03-22 Miguel de Icaza <miguel@novell.com>
1689 Initial support to provide code completion facilities to consumers
1690 of the evaluator API.
1692 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
1693 support the completion engine. When we reach the end of the
1694 input stream instead of returning EOF, when this flag is true the
1695 tokenizer instead produces:
1697 One GENERATE_COMPLETION token: this token then must be
1698 handled in the grammar at every point where the user
1699 would likely request a completion.
1701 As many COMPLETE_COMPLETION tokens as necessary. These
1702 tokens are generated to assist the parser in unwinding and
1703 producing a valid parse tree.
1705 The parser rules do not have to be perfect, the parser needs to be
1706 augmented with judicious use of GENERATE_COMPLETION tokens to
1707 improve the areas where we can provide completion and the parser
1708 needs to add support for COMPLETE_COMPLETION tokens in productions
1711 It is common to not have enough support for COMPLETE_COMPLETION
1712 under certain rules and that even if we generated the
1713 GENERATE_COMPLETION token that the resulting tree will be invalid
1714 due to the missing rules that support COMPLETE_COMPLETION.
1716 The final EOF token is produced by having the parser notify the
1717 tokenizer when it reaches the root production that the next token
1720 * support.cs (CompletionResult): New Exception. This exception
1721 is thrown to return the completion results when one of the special
1722 completion expressions is reached.
1724 This exception is thrown by the completing ExpressionStatements
1725 classes that live in complete.cs
1727 * complete.cs (CompletingExpression): a new base class for
1728 completing expressions. This derives from the
1729 ExpressionStatement class and not from Expression as it allows
1730 completion to happen not only where expressions are expected in
1731 the grammar, but also where statements are expected.
1733 (CompletionSimpleName): A new class used to provide completions
1734 for SimpleNames. This currently only resolves to local
1735 variables from the evaluator context (GetVars call).
1737 (CompletionMemberAccess): Implements support for completing member
1740 * cs-parser.jay: Add support for completion in a few places.
1742 * eval.cs (GetCompletions): New public API for the evaluator that
1743 returns a list of possible completions given the input. The
1744 return value is an array of completions
1746 * anonymous.cs (Compatible): If the exception thrown from the
1747 resolved expression is a CompletionResult exception let that one
1748 through instead of printing a diagnostic error in the try/catch.
1750 2009-03-22 Miguel de Icaza <miguel@novell.com>
1754 * driver.cs (Main): Use Environment.Exit to quit quickly and
1755 prevent the compiler from doing the usual wait for helper thread
1758 This is to prevent a slowdown that was reported by Gonzalo on
1761 2009-03-19 Marek Safar <marek.safar@gmail.com>
1763 * ecore.cs: Load build-in types directly instead of accessing
1766 2009-03-18 Marek Safar <marek.safar@gmail.com>
1768 * ecore.cs: Always use unbox.any when available.
1770 2009-03-18 Marek Safar <marek.safar@gmail.com>
1772 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
1774 2009-03-17 Marek Safar <marek.safar@gmail.com>
1776 * generic.cs: Removed obsolete version of type inference.
1778 2009-03-16 Marek Safar <marek.safar@gmail.com>
1780 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
1781 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
1782 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
1783 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
1785 2009-03-11 Marek Safar <marek.safar@gmail.com>
1787 A fix for bug #482996
1788 * anonymous.cs: Make sure we are not infering return type when
1789 checking type compatibility.
1791 2009-03-11 Marek Safar <marek.safar@gmail.com>
1793 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
1794 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
1795 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
1796 attributes in their own structure. Needed when accessing their
1797 properties before they are resolved.
1799 2009-03-09 Marek Safar <marek.safar@gmail.com>
1801 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
1802 hashtable (~10x faster).
1804 * driver.cs: Removed wrong Reset.
1806 2009-03-08 Marek Safar <marek.safar@gmail.com>
1808 * class.cs: Use correct common base type for unmanaged delayed
1811 * rootcontext.cs: Wrap unhandled exception.
1813 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
1815 Make SeekableStreamReader self-tuning and arbitrarily seekable
1816 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
1818 (SeekableStreamReader.Position.set): Use it. Simplify logic
1819 which, as a side-effect, makes it arbitrarily-seekable. Tune the
1820 buffer size when the stream needs to be re-read from the beginning.
1822 2009-03-05 Marek Safar <marek.safar@gmail.com>
1824 A fix for bug #480100
1825 * parameter.cs: A parameter is not hoisted when used directly as ET.
1827 2009-03-04 Marek Safar <marek.safar@gmail.com>
1829 * statement.cs: Fixed an issue when using variable is of interface
1832 2009-03-03 Marek Safar <marek.safar@gmail.com>
1834 A fix for bug #480319
1835 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
1837 2009-03-03 Marek Safar <marek.safar@gmail.com>
1839 A fix for bug #480867
1840 * typemanager.cs, expression.cs, ecore.cs: Changed method group
1841 expression to have no valid type.
1843 2009-03-03 Marek Safar <marek.safar@gmail.com>
1845 A fix for bug #481258
1846 * class.cs: Set extension method flag in partial container.
1848 2009-03-03 Marek Safar <marek.safar@gmail.com>
1850 * statement.cs, typemanager.cs: Use expression for StringEmitter.
1852 * attribute.cs: Add sanity check.
1854 2009-02-27 Marek Safar <marek.safar@gmail.com>
1856 * class.cs: Add external constructor error.
1858 2009-02-26 Marek Safar <marek.safar@gmail.com>
1860 A fix for bug #475354
1861 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
1862 correctly user defined nullable equality operators.
1864 2009-02-25 Marek Safar <marek.safar@gmail.com>
1866 A fix for bug #479532
1867 * expression.cs: Implement NewInitialize::AddressOf.
1869 2009-02-25 Marek Safar <marek.safar@gmail.com>
1871 A fix for bug #413633
1872 * expression.cs: Iterate all base class-constraint types.
1874 2009-02-24 Marek Safar <marek.safar@gmail.com>
1876 A fix for bug #479209
1877 * literal.cs: Mutate null underlying type.
1879 2009-02-24 Marek Safar <marek.safar@gmail.com>
1881 A fix for bug #476295
1882 * convert.cs: Avoid wrapping implicitly convertible reference type.
1884 2009-02-23 Marek Safar <marek.safar@gmail.com>
1886 * iterators.cs: Create MemberName correctly.
1888 2009-02-23 Marek Safar <marek.safar@gmail.com>
1890 A fix for bug #478655
1891 * literal.cs: Check also underlying null type conversion.
1893 2009-02-21 Marek Safar <marek.safar@gmail.com>
1895 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
1897 2009-02-20 Marek Safar <marek.safar@gmail.com>
1899 A fix for bug #477447
1900 * statement.cs: Add reference to correct parent storey when this
1901 is accessible from deep children storey (more than 1 level).
1903 2009-02-19 Marek Safar <marek.safar@gmail.com>
1905 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
1906 * class.cs: Define base type members before setting up member cache.
1908 2009-02-18 Marek Safar <marek.safar@gmail.com>
1910 A fix for bug #477378
1911 * nullable.cs, expression.cs, statement.cs: More precise null type
1914 2009-02-18 Marek Safar <marek.safar@gmail.com>
1916 A fix for bug #472805
1917 * typemanager.cs, namespace.cs: Import only visible extension method
1920 2009-02-18 Marek Safar <marek.safar@gmail.com>
1922 A fix for bug #476895
1923 * attribute.cs: Use correct resolve context for attribute type.
1925 2009-02-18 Marek Safar <marek.safar@gmail.com>
1927 A fix for bug #476266
1928 * anonymous.cs: Mutate multi-dimensional arrays.
1930 2009-02-18 Marek Safar <marek.safar@gmail.com>
1932 A fix for bug #476400
1933 * statement.cs, expression.cs: Removed wrong Dispose optimization.
1935 2009-02-18 Marek Safar <marek.safar@gmail.com>
1937 A fix for bug #476811
1938 * generics.cs: Fixed null-literal check.
1940 2009-02-17 Marek Safar <marek.safar@gmail.com>
1942 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
1943 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
1944 messing with static variables.
1946 2009-02-16 Marek Safar <marek.safar@gmail.com>
1948 A fix for bug #475965
1949 * generics.cs: Check generic parameter type after extracting from
1952 2009-02-16 Marek Safar <marek.safar@gmail.com>
1954 A fix for bug #475823
1955 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
1958 2009-02-14 Marek Safar <marek.safar@gmail.com>
1960 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
1961 Simplified event field definition using backing field and not
1962 field builder directly.
1964 * expression.cs (EmitLdArg): Optimize fast paths.
1966 2009-02-13 Marek Safar <marek.safar@gmail.com>
1968 A fix for bug #475327
1969 * expression.cs (ArrayCreation): Don't mutate values optimized away.
1971 2009-02-13 Marek Safar <marek.safar@gmail.com>
1973 A fix for bug #475342
1974 * cs-parser.jay: Using 'super' instead of 'base' to call base
1975 constructor crashes compiler.
1977 2009-02-13 Marek Safar <marek.safar@gmail.com>
1979 A fix for bug #475354
1980 * expression.cs (Constantify): Add nullable types.
1982 * const.cs (EmitDecimalConstant): Avoid explicit cast.
1984 2009-02-12 Marek Safar <marek.safar@gmail.com>
1986 A fix for bug #475246
1987 * expression.cs: More broken flowanalysis hacking needed.
1989 2009-02-12 Marek Safar <marek.safar@gmail.com>
1991 * attribute.cs: Compare only ref/out array modifiers.
1993 2009-02-11 Marek Safar <marek.safar@gmail.com>
1995 * statement.cs: Use member cache when looking for foreach members.
1997 2009-02-11 Marek Safar <marek.safar@gmail.com>
1999 * expression.cs: Don't expose internal initializer types.
2001 * statement.cs: Check also explicit conversions for goto case.
2003 2009-02-11 Marek Safar <marek.safar@gmail.com>
2005 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
2007 2009-02-10 Marek Safar <marek.safar@gmail.com>
2009 * *.cs: Replace null-type with NullLiteral where appropriate.
2011 2009-02-09 Marek Safar <marek.safar@gmail.com>
2013 * expression.cs: Initializer of reference argument use temporary
2014 variable to be verifiable.
2016 * parameter.cs: Share EmitLdArg.
2018 2009-02-09 Marek Safar <marek.safar@gmail.com>
2020 A fix for bug #473559
2021 * class.cs: Fixed: Not reporting error about nested class with the
2024 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
2026 Contributed under the MIT/X11 license.
2028 * generic.cs: Added VerifyVariantTypeParameters which performs new
2029 variance verification logic. The old logic, based on the spec, was
2030 wrong because the spec is full of LIES!
2032 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
2034 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
2037 * ecore.cs: Added calls to the new variance verification logic.
2040 * delegate.cs: Removed calls to the old variance verification logic.
2042 2009-02-06 Marek Safar <marek.safar@gmail.com>
2044 * delegate.cs: Use cached Invoke method directly.
2046 2009-02-06 Marek Safar <marek.safar@gmail.com>
2048 * expression.cs: Emit expression tree for hoisted variable access.
2050 2009-02-04 Marek Safar <marek.safar@gmail.com>
2052 * namespace.cs: Add better extension class check.
2054 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
2056 * generic.cs: Fixed typeo (TypeParameter.Variacne).
2058 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
2060 This patch adds initial generic variance support to the compiler.
2061 It is contributed under the MIT/X11 license.
2063 * typemanager.cs: Modified ImplementsInterface to check variance.
2064 Added VerifyVariantTypeParameters which checks the specified type to see
2065 if it uses a variant type parameter as a type argument (which is not
2066 allowed). Added IsVariantOf which determins if the first type is a
2067 variant of the second. NOTE: This only supports reference types at
2068 the moment to conform with the current level of VM support. When the
2069 VM supports value types, this will follow step.
2071 * generic.cs: Added the Variance enum. Added a Variance property to
2072 TypeParameter and added variance support to definition phase. Added a
2073 Variance property to TypeParameterName. Also check to make sure that
2074 no variant types appear in generic method parameters.
2076 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
2077 keywords if the langversion supports it.
2079 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
2080 that variant types are only used in legal positions. Also added
2081 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
2084 * decl.cs: Construct TypeParameter with the variance information.
2086 * convert.cs: Checks variance in ImplicitReferenceConversionExists
2087 and ImplicitConversionStandard.
2089 * rootcontext.cs: Added new "Future" language version.
2091 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
2092 type parameters are not used as type arguments in interface inheritance.
2093 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
2094 parameters are not used as method return types. In MemberBase.
2095 ResolveMemberType, ensure that variant type parameters are not used
2096 as type arguments. Also call VerifyNoVariantTypeParameters on every
2097 set of parameters which are resolved.
2099 * delegate.cs: Modified Delegate.Define to ensure that variant
2100 parameters are not used as type arguments and that a contravariant
2101 parameter is not used as the return type. Also call
2102 VerifyNoVariantTypeParameters on the delegate parameters.
2104 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
2105 to specify generic variance.
2107 * driver.cs: Added support for LanguageVersion.Future in the form of
2108 "-langversion:future".
2110 * generic-mcs.cs: Stubbed out new members in generic.cs.
2112 2009-02-03 Marek Safar <marek.safar@gmail.com>
2114 * class.cs, generic.cs: Emit type parameter constraints for nested
2117 2009-02-02 Marek Safar <marek.safar@gmail.com>
2119 A fix for bug #471213
2120 * class.cs: Avoid emitting backing field for abstract event fields.
2122 2009-02-01 Marek Safar <marek.safar@gmail.com>
2124 A fix for bug #359731
2125 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
2128 2009-01-30 Marek Safar <marek.safar@gmail.com>
2130 A fix for bug #470767
2131 * statement.cs: Introduced BlockScopeExpression, needed when
2132 expression tree conversion has to emit scope variables.
2134 2009-01-29 Marek Safar <marek.safar@gmail.com>
2136 * class.cs: Remove duplicate CallingConvention.
2138 2009-01-29 Marek Safar <marek.safar@gmail.com>
2140 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
2141 when I finally found the right naming convention.
2143 2009-01-29 Marek Safar <marek.safar@gmail.com>
2145 * cs-tokenizer.cs: Put back different open parens optimization.
2147 2009-01-28 Marek Safar <marek.safar@gmail.com>
2149 A fix for bug #470227
2150 * cs-tokenizer.cs: Remove too agressive parser optimization.
2152 2009-01-28 Marek Safar <marek.safar@gmail.com>
2154 A fix for bug #324319
2155 * class.cs: Remove too early base type resolve.
2157 2009-01-27 Marek Safar <marek.safar@gmail.com>
2159 A fix for bug #324319
2160 * ecore.cs: Explicitly type null when assigning to type argument to
2161 make pass verifier check.
2163 2009-01-27 Marek Safar <marek.safar@gmail.com>
2165 * anonymous.cs: Fixed recent regression when initializing captured
2168 2009-01-26 Marek Safar <marek.safar@gmail.com>
2170 A fix for bug #469019
2171 * anonymous.cs: Use all parent type parameters when instantiating
2172 nested generic storey.
2174 2009-01-26 Marek Safar <marek.safar@gmail.com>
2176 * expression.cs: Check for null instance methodgroup expression.
2178 2009-01-26 Marek Safar <marek.safar@gmail.com>
2180 A fix for bug #469244
2181 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
2182 instance inside a conditional expression.
2184 2009-01-23 Marek Safar <marek.safar@gmail.com>
2186 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
2187 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
2188 GetElementType and HasElementType. IsValueType clean up.
2190 2009-01-23 Marek Safar <marek.safar@gmail.com>
2192 * nullable.cs: Use common EmitCall.
2194 * expression.cs: Emit constraint. for virtual calls only.
2196 2009-01-23 Marek Safar <marek.safar@gmail.com>
2198 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
2199 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
2200 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
2203 2009-01-22 Jb Evain <jbevain@novell.com>
2205 * anonymous.cs: make anonymous types' ToString implementation
2206 match what csc outputs.
2208 2009-01-21 Marek Safar <marek.safar@gmail.com>
2210 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
2213 2009-01-17 Marek Safar <marek.safar@gmail.com>
2215 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
2218 2009-01-16 Marek Safar <marek.safar@gmail.com>
2220 * nullable.cs (LiftedBinaryOperator): Check for all possible null
2223 2009-01-15 Marek Safar <marek.safar@gmail.com>
2225 A fix for bug #466634
2226 * statement.cs: Add reference for nested storey when only this
2229 2009-01-15 Marek Safar <marek.safar@gmail.com>
2231 A fix for bug #466474
2232 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
2235 2009-01-15 Marek Safar <marek.safar@gmail.com>
2237 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
2238 Fixed nested stories parent referencing process. Also fixes #463985.
2240 2009-01-06 Marek Safar <marek.safar@gmail.com>
2242 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
2243 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
2244 implementation. Also fixes #463108.
2246 2009-01-05 Marek Safar <marek.safar@gmail.com>
2248 A fix for bug #416109
2249 * decl.cs: Issue correct CLSAttribute warning location.
2251 2009-01-05 Marek Safar <marek.safar@gmail.com>
2253 A fix for bug #456775
2254 * attribute.cs: Use attribute owner scope when resolving attribute
2257 2009-01-05 Marek Safar <marek.safar@gmail.com>
2259 A fix for bug #457257
2260 * decl.cs: Fixed incorrect member declaring type comparison.
2262 2009-01-05 Marek Safar <marek.safar@gmail.com>
2264 A fix for bug #460896
2265 * driver.cs: Handle /RES resources as embeddable.
2267 2009-01-05 Marek Safar <marek.safar@gmail.com>
2269 A fix for bug #462515
2270 * ecore.cs: Report inacessible members upwards.
2272 2009-01-05 Marek Safar <marek.safar@gmail.com>
2274 A fix for bug #463190, #463192
2275 * decl.cs, namespace.cs: Also import internal extension classes.
2277 2009-01-04 Marek Safar <marek.safar@gmail.com>
2279 A fix for bug #463415
2280 * generic.cs: Use right index for RemoveDependentTypes.
2282 2009-01-02 Marek Safar <marek.safar@gmail.com>
2284 A fix for bug #463196
2285 * expression.cs: Fixed enum to null comparison.
2287 2009-01-02 Marek Safar <marek.safar@gmail.com>
2289 A fix for bug #463121
2290 * nullable.cs: Fixed nullable user equality operator comparison.
2292 2009-01-02 Marek Safar <marek.safar@gmail.com>
2294 A fix for bug #462950
2295 * class.cs, decl.cs: Use full explicit name when defining automatic
2296 property backing field.
2298 2009-01-02 Marek Safar <marek.safar@gmail.com>
2300 A fix for bug #462592
2301 * pending.cs: Emit type arguments for generic proxy method.
2303 2008-12-30 Marek Safar <marek.safar@gmail.com>
2305 * expression.cs (As): Mutate all type arguments.
2307 2008-12-29 Marek Safar <marek.safar@gmail.com>
2309 A fix for bug #462622
2310 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
2313 2008-12-29 Marek Safar <marek.safar@gmail.com>
2315 A fix for bug #450782
2316 * ecore.cs: Consider more variables of form V.I to be fixed.
2318 2008-12-29 Marek Safar <marek.safar@gmail.com>
2320 A fix for bug #460712
2321 * typemanager.cs: Core types could be imported.
2323 2008-12-28 Marek Safar <marek.safar@gmail.com>
2325 A fix for bugs #460847, #460772, #458049, #457339, #447807
2326 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
2327 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
2328 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
2329 user lambdas used inside query clauses.
2331 2008-12-18 Marek Safar <marek.safar@gmail.com>
2333 A fix for bug #460229
2334 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
2336 2008-12-18 Marek Safar <marek.safar@gmail.com>
2338 A fix for bug #459952
2339 * decl.cs, namespace.cs: Use common CheckAccessLevel.
2341 2008-12-18 Marek Safar <marek.safar@gmail.com>
2343 A fix for bug #459630
2344 * convert.cs: Enum to valuetype conversion is not allowed.
2346 2008-12-18 Marek Safar <marek.safar@gmail.com>
2348 A fix for bug #457087
2349 * generic.cs: Don't crash when constraint comes from type
2352 2008-12-16 Marek Safar <marek.safar@gmail.com>
2354 A fix for bug #459221
2355 * anonymous.cs, statement.cs: Delay only captured this
2358 2008-12-12 Marek Safar <marek.safar@gmail.com>
2360 A fix for bug #457489
2361 * anonymous.cs, statement.cs: Split anonymous storey instantiation
2362 and initialization to capture scope initializers correctly.
2364 2008-12-11 Marek Safar <marek.safar@gmail.com>
2366 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
2367 ParameterReference refactoring.
2369 2008-12-03 Marek Safar <marek.safar@gmail.com>
2371 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
2372 to be imported from any assembly.
2374 2008-12-03 Marek Safar <marek.safar@gmail.com>
2376 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
2377 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
2378 from anonymous method and lambda expression.
2380 2008-12-01 Marek Safar <marek.safar@gmail.com>
2382 A fix for bug #448560
2383 * expression.cs (As): Box any generic type arguments to be
2386 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2388 Add tripwire for implicit conversion bugs
2389 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
2391 (MethodGroupExpr.OverloadResolve): Add sanity check between
2392 IsApplicable and VerifyArgumentsCompat.
2393 (VerifyArgumentsCompat): Report CS1501 where appropriate.
2395 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2397 Fix build break in System.Data_test
2398 * convert.cs (ImplicitConversionExists): Move NullLiteral
2400 (ImplicitStandardConversionExists): ... here.
2402 2008-11-28 Marek Safar <marek.safar@gmail.com>
2404 * literal.cs: Emit correctly explicit null to nullable cast.
2406 2008-11-28 Marek Safar <marek.safar@gmail.com>
2408 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
2411 2008-11-28 Marek Safar <marek.safar@gmail.com>
2413 A fix for bug #449005
2414 * convert.cs, nullable.cs: Use only one implicit nullable
2417 2008-11-27 Marek Safar <marek.safar@gmail.com>
2419 * convert.cs, literal.cs: More Convert cleanup is needed.
2421 2008-11-27 Marek Safar <marek.safar@gmail.com>
2423 * decl.cs, class.cs: Fixed misleading error message.
2425 2008-11-26 Marek Safar <marek.safar@gmail.com>
2427 A fix for bug #449005
2428 * nullable.cs (EmitEquality): Disable optimization for user operator
2431 2008-11-25 Marek Safar <marek.safar@gmail.com>
2433 A fix for bug #447027
2434 * anonymous.cs (HoistedVariable): Cache also outer access to deal
2435 with context variables stored as expression instances.
2437 2008-11-25 Marek Safar <marek.safar@gmail.com>
2439 A fix for bug #447027
2440 * delegate.cs: Fixed delegate VerifyMethod logic.
2442 2008-11-24 Marek Safar <marek.safar@gmail.com>
2444 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
2447 2008-11-21 Marek Safar <marek.safar@gmail.com>
2449 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
2450 member type resolve to follow normal flow, instead of random
2453 2008-11-21 Marek Safar <marek.safar@gmail.com>
2455 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
2458 2008-11-21 Marek Safar <marek.safar@gmail.com>
2460 * const.cs: Emit decimal array constant as literal.
2462 2008-11-20 Marek Safar <marek.safar@gmail.com>
2464 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
2466 2008-11-19 Marek Safar <marek.safar@gmail.com>
2468 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
2469 into real property (saves 8 MB for corlib compilation).
2471 2008-11-19 Marek Safar <marek.safar@gmail.com>
2473 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
2474 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
2475 generic-mcs.cs: Small cleanup of TypeArguments.
2477 2008-11-18 Marek Safar <marek.safar@gmail.com>
2479 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
2480 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
2481 of ConstructedType expression, renamed to GenericTypeExpr.
2483 2008-11-17 Marek Safar <marek.safar@gmail.com>
2485 A fix for bug #445303
2486 * location.cs (IsConditionalDefined): Handle undefined global
2489 2008-11-17 Marek Safar <marek.safar@gmail.com>
2491 A fix for bug #444678
2492 * expression.cs (TryReduceConstant): Always create new constant
2495 2008-11-17 Marek Safar <marek.safar@gmail.com>
2497 A fix for bug #444673
2498 * ecore.cs: Ignore open generic types when used as generic type
2501 2008-11-17 Marek Safar <marek.safar@gmail.com>
2503 A fix for bug #445458
2504 * expression.cs, cs-parser.jay: Don't crash when an expression
2507 2008-11-17 Marek Safar <marek.safar@gmail.com>
2509 A fix for bug #445464
2510 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
2511 inside unbound type.
2513 2008-11-14 Jb Evain <jbevain@novell.com>
2515 * driver.cs: ignore empty -nowarn argument such as
2516 the one in -nowarn:12,13,,.
2518 2008-11-13 Marek Safar <marek.safar@gmail.com>
2520 A fix for bug #444271
2521 * anonymous.cs: Rescan parent storeys when best candidate was
2524 2008-11-13 Marek Safar <marek.safar@gmail.com>
2526 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
2527 useless UnboundTypeExpression.
2529 * attribute.cs: Do check obsolete attribute on generic types.
2531 2008-11-12 Marek Safar <marek.safar@gmail.com>
2533 A fix for bugs #425680, #400139
2534 * ecore.cs, expression.cs: Trying to do some almost_matched_members
2537 2008-11-11 Marek Safar <marek.safar@gmail.com>
2539 A fix for bug #435747
2540 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
2541 compound value types assignment. Few micro optimizations added.
2543 2008-11-10 Marek Safar <marek.safar@gmail.com>
2545 A fix for bug #442610
2546 * anonymous.cs (MutateConstructor): More SRE hacking.
2548 2008-11-10 Marek Safar <marek.safar@gmail.com>
2550 A fix for bug #442579
2551 * ecore.cs: Also initialize expanded form of a method with 1 params
2554 2008-11-06 Marek Safar <marek.safar@gmail.com>
2556 * expression.cs (UnaryMutator): Do early l-side check.
2558 2008-11-05 Miguel de Icaza <miguel@novell.com>
2560 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
2561 Init, otherwise we would crash later on when checking for friend
2564 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
2565 Otherwise we never get any meaningful information as to what
2568 2008-11-05 Marek Safar <marek.safar@gmail.com>
2570 A fix for bug #436318
2571 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
2573 2008-11-05 Miguel de Icaza <miguel@novell.com>
2575 * namespace.cs: Turns out that it was a really bad idea to hide
2576 the errors for namespaces not found here in eval mode.
2578 * eval.cs: When we process using clauses, only enter those into
2579 the list of valid using clauses after they have been validated.
2581 The above change gives the proper semantics: it does not
2582 senselessly report the same errors with broken using statements by
2583 never storing them in the first place when they are invalid.
2585 2008-11-05 Marek Safar <marek.safar@gmail.com>
2587 A fix for bug #421839
2588 * cs-parser.jay: Remove expression from coalesce rule to force lower
2589 priority than the assignment operator.
2591 2008-11-05 Marek Safar <marek.safar@gmail.com>
2593 A fix for bug #437875
2594 * nullable.cs: Compile correctly method group operand used with null
2595 coalescing operator.
2597 2008-11-04 Marek Safar <marek.safar@gmail.com>
2599 A fix for bug #434589
2600 * expression.cs (Binary): Ignore lifted conversions when at least
2601 one operand is of reference type.
2603 2008-11-04 Marek Safar <marek.safar@gmail.com>
2605 * cs-parser.jay: Better syntax error report.
2607 2008-11-03 Marek Safar <marek.safar@gmail.com>
2609 A fix for bug #436792
2610 * cs-parser.jay: Use GetLocation to access location.
2612 2008-11-03 Marek Safar <marek.safar@gmail.com>
2614 A fix for bug #440774
2615 * cs-parser.jay: Also set current_array_type when parsing local
2618 2008-11-03 Marek Safar <marek.safar@gmail.com>
2620 A fix for bug #440785
2621 * expression.cs (As): Don't resolve self modifing expression
2624 2008-11-03 Marek Safar <marek.safar@gmail.com>
2626 A fix for bug #439447
2627 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
2629 2008-11-03 Marek Safar <marek.safar@gmail.com>
2631 A fix for bug #437571
2632 * cs-parser.jay: Fixes internal error for invalid expression
2635 2008-10-17 Marek Safar <marek.safar@gmail.com>
2637 * ecore.cs: Resolve correctly ambiguous params delegate methods.
2639 2008-10-17 Marek Safar <marek.safar@gmail.com>
2641 * generic.cs, anonymous.cs: Simplified GetDeclarations.
2643 2008-10-17 Marek Safar <marek.safar@gmail.com>
2645 * cs-tokenizer.cs: More precise cast parsing.
2647 2008-10-16 Martin Baulig <martin@ximian.com>
2649 * anonymous.cs (AnonymousMethodStorey): Put back the
2650 `hoisted_locals' hashtable and use it in EmitType().
2652 2008-10-15 Marek Safar <marek.safar@gmail.com>
2654 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
2655 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
2658 2008-10-14 Marek Safar <marek.safar@gmail.com>
2660 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
2662 2008-10-14 Marek Safar <marek.safar@gmail.com>
2664 * statement.cs: Mutate scope initializers.
2666 2008-10-14 Marek Safar <marek.safar@gmail.com>
2668 * expression.cs: Use typeless value for This constant.
2670 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
2672 2008-10-14 Marek Safar <marek.safar@gmail.com>
2674 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
2677 2008-10-13 Marek Safar <marek.safar@gmail.com>
2679 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
2682 2008-10-13 Marek Safar <marek.safar@gmail.com>
2684 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
2685 parser and tokenizer. Fixes many ambiguities including #433258.
2687 2008-10-10 Marek Safar <marek.safar@gmail.com>
2689 * cs-parser.jay: Fixed missing accessor recovery.
2691 2008-10-10 Marek Safar <marek.safar@gmail.com>
2693 A fix for bug #433701
2694 * expression.cs: Better error message.
2696 2008-10-10 Marek Safar <marek.safar@gmail.com>
2698 * cs-parser.jay, expression.cs: Start reporting real parser errors.
2700 * Makefile: Disabled unused debug symbols.
2702 Also fixes: #320556, #321097, #321656, #321876, #351316
2704 2008-10-09 Miguel de Icaza <miguel@novell.com>
2706 * eval.cs: rename "<interactive>" to "{interactive}", to work
2707 around a requirement in the compiler that this be a valid
2708 filename, and in Windows it is not (433886).
2710 2008-10-09 Marek Safar <marek.safar@gmail.com>
2712 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
2714 2008-10-08 Marek Safar <marek.safar@gmail.com>
2716 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
2717 cs-parser.jay: Generic type declaration and type arguments cleanup.
2719 2008-10-05 Marek Safar <marek.safar@gmail.com>
2721 * cs-parser.jay: Allow parsing weird array creation construct.
2723 2008-10-05 Marek Safar <marek.safar@gmail.com>
2725 * cs-parser.jay: Conflicts reduction.
2727 2008-10-04 Marek Safar <marek.safar@gmail.com>
2729 * cs-parser.jay: Conflicts reduction.
2731 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
2734 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
2735 property. Add a 'count' hint about the use of the shared vector.
2736 Ensure that we don't leak out dirty bits.
2737 (UsageVector.MergeChild): Throw away information about variables
2739 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
2741 2008-10-03 Marek Safar <marek.safar@gmail.com>
2743 A fix for bug #431746
2744 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
2745 parameters when iterator is created.
2747 2008-10-03 Marek Safar <marek.safar@gmail.com>
2749 A fix for bug #431827
2750 * expression.cs: Fixed right based pointer arithmetic operations
2753 2008-10-03 Marek Safar <marek.safar@gmail.com>
2755 A fix for bug #353779
2756 * assign.cs, expression.cs: Fixed compound assignment conversions.
2758 2008-10-02 Marek Safar <marek.safar@gmail.com>
2760 A fix for bug #375262
2761 * statement.cs: Refactor ArrayForeach to be usable with string
2762 indexer. Optimized single dimentional arrays foreach.
2764 2008-10-02 Marek Safar <marek.safar@gmail.com>
2766 A fix for bug #431255
2767 * anonymous.cs, expression.cs: Removed broken optimization.
2769 2008-10-01 Marek Safar <marek.safar@gmail.com>
2771 * anonymous.cs: Use full type parameters of parent generic
2772 containers. Removed unnecessary AddParentStoreyReference call.
2774 2008-10-01 Marek Safar <marek.safar@gmail.com>
2776 A fix for bug #324702
2777 * class.cs: Use better shorter names for explicit interface member
2780 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
2782 2008-10-01 Marek Safar <marek.safar@gmail.com>
2784 * expression.cs: Use new interface to check fixed expression.
2786 2008-10-01 Marek Safar <marek.safar@gmail.com>
2788 A fix for bug #421101
2789 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
2790 interface to check for fixed fixed-buffers.
2792 2008-10-01 Marek Safar <marek.safar@gmail.com>
2794 A fix for bug #429264
2795 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
2797 * delegate.cs: Removed unnecessary casts.
2799 2008-09-30 Marek Safar <marek.safar@gmail.com>
2801 A fix for bug #352151
2802 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
2803 class.cs: Fixed already defined explicit interface members check.
2805 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
2807 cs-tokenizer.cs: Fix typo.
2809 2008-09-28 Miguel de Icaza <miguel@novell.com>
2811 * eval.cs (InteractiveBase): The quit command now just sets a
2812 flag, instead of calling Environment.Exit(), it is milder on
2815 CompiledMethod is now in Mono.CSharp, not nested inside
2816 the Evaluator, it was inconvenient to use.
2818 2008-09-27 Miguel de Icaza <miguel@novell.com>
2820 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
2821 code to be invoked without having to reparse.
2823 2008-09-27 Miguel de Icaza <miguel@novell.com>
2825 * ecore.cs: The recent changes to FieldExpr broke this as well.
2826 Fixes LINQ queries in the interactive shell.
2828 * Multiple files: indentation fixing for the Mono coding
2829 guidelines for the switch statement.
2831 * eval.cs: Make the Evaluator API thread safe.
2833 2008-09-26 Marek Safar <marek.safar@gmail.com>
2835 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
2836 constructor parsing.
2838 2008-09-26 Marek Safar <marek.safar@gmail.com>
2840 A fix for bug #325326
2841 * statement.cs: Check possible mistaken empty statement using
2842 explicit blocks only.
2844 2008-09-25 Miguel de Icaza <miguel@novell.com>
2846 * eval.cs (LoadAssembly, ReferenceAssembly): Call
2847 RootNamespace.ComputeNamespaces to update the internal list of
2848 namespaces, this is no longer done for us.
2850 (InteractiveBase): Use the Evaluator APIs instead of calling into
2853 2008-09-25 Marek Safar <marek.safar@gmail.com>
2855 A fix for bug #429264
2856 * expression.cs: Missing mutator for access to multidimensional
2859 2008-09-25 Marek Safar <marek.safar@gmail.com>
2861 * class.cs, statement: Emit DebuggerHidden attribute for iterator
2864 * driver.cs: Missing input argument check.
2866 2008-09-25 Marek Safar <marek.safar@gmail.com>
2868 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
2869 expression.cs, statement.cs, rootcontext.cs, class.cs,
2870 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
2873 2008-09-24 Miguel de Icaza <miguel@novell.com>
2875 * ecore.cs (FieldExpr): Only initialize eclass when we return a
2876 fully constructed FieldExpr, fixes the regression introduced in
2879 * ecore.cs, expression.cs: Plug back the eclass initialization as
2880 otherwise it regresses `csharp'.
2882 2008-09-24 Marek Safar <marek.safar@gmail.com>
2884 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
2885 ecore.cs, attribute.cs: Moved obsolete method checks from emit
2886 phase to resolve phase. It resolves problems with expression trees
2887 and fixes bugs #323796, #325156.
2889 2008-09-23 Marek Safar <marek.safar@gmail.com>
2891 * codegen.cs: Report better error when symbol writer is missing.
2893 2008-09-23 Marek Safar <marek.safar@gmail.com>
2895 * codegen.cs: Set .NET symbol writer.
2897 * decl.cs: Guard against null generic arguments.
2899 * report.cs: Don't report exactly same additional details.
2901 2008-09-22 Marek Safar <marek.safar@gmail.com>
2903 A fix for bug #324917
2904 * cs-parser.jay: Add missing multidimensional non-expression type
2907 2008-09-22 Marek Safar <marek.safar@gmail.com>
2909 A fix for bug #428191
2910 * anonymous.cs: Create an outer generic fields also for non-storey
2913 2008-09-22 Marek Safar <marek.safar@gmail.com>
2915 A fix for bug #378294
2916 * class.cs: Make fixed size buffers gmcs feature only.
2918 2008-09-22 Marek Safar <marek.safar@gmail.com>
2920 A fix for bug #355622, #324993
2921 * assign.cs, const.cs, class.cs: Create new EmitContext for each
2924 2008-09-19 Marek Safar <marek.safar@gmail.com>
2926 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
2929 2008-09-19 Marek Safar <marek.safar@gmail.com>
2931 A fix for bug #416110
2932 * generic.cs: Struct constraint results in default ctor and
2933 ValueType base type constraint to be set.
2935 2008-09-19 Marek Safar <marek.safar@gmail.com>
2937 A fix for bug #423791
2938 * generic.cs: Fixed params output type type-inference.
2940 2008-09-19 Marek Safar <marek.safar@gmail.com>
2942 * cs-parser.jay, expression.cs: Fixed few expression crashes.
2944 2008-09-19 Marek Safar <marek.safar@gmail.com>
2946 * cs-tokenizer.cs: Don't break on extra partial modifier.
2948 2008-09-19 Marek Safar <marek.safar@gmail.com>
2950 A fix for bug #427592
2951 * generic.cs: Use common parameter resolve method.
2953 2008-09-18 Marek Safar <marek.safar@gmail.com>
2955 A fix for bug #414758
2956 * expression.cs, ecore.cs: Fixed crash when accessing non-static
2959 2008-09-18 Marek Safar <marek.safar@gmail.com>
2961 * driver.cs, namespace.cs: Read types and namespaces after all
2962 requested assemblies are loaded, fixes issues with System.Core
2963 auto-reference, and #419888.
2965 2008-09-18 Marek Safar <marek.safar@gmail.com>
2967 A fix for bug #417705
2968 * cs-parser.jay: Fixed as/is operator expression split.
2970 2008-09-18 Marek Safar <marek.safar@gmail.com>
2972 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
2973 Fixed expression tree representation of empty new expression and
2974 new initializer expression.
2976 2008-09-18 Miguel de Icaza <miguel@novell.com>
2978 * eval.cs: Remove warning, keep reference to driver around.
2980 * Hide fields that do not need to be public.
2982 2008-09-17 Marek Safar <marek.safar@gmail.com>
2984 A fix for bug #426385
2985 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
2986 conversion for array elements.
2988 2008-09-17 Marek Safar <marek.safar@gmail.com>
2990 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
2991 void parsing conflicts.
2993 2008-09-15 Marek Safar <marek.safar@gmail.com>
2995 A fix for bug #425601
2996 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
2997 System.Core only when there is no custom ExtensionAttribute
3000 2008-09-15 Miguel de Icaza <miguel@novell.com>
3002 * namespace.cs: Do not report CS0246 (name
3004 2008-09-12 Marek Safar <marek.safar@gmail.com>
3006 A fix for bug #425669
3007 * generic.cs: Don't cache generic static anonymous method
3010 2008-09-12 Marek Safar <marek.safar@gmail.com>
3012 * generic.cs, class.cs, delegate.cs: Check recursive inherited
3013 conflicting constraints.
3015 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
3017 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
3020 2008-09-12 Marek Safar <marek.safar@gmail.com>
3022 * literal.cs, convert.cs, expression.cs, statement.cs: More null
3023 to null pointer conversion fixes.
3025 2008-09-11 Marek Safar <marek.safar@gmail.com>
3027 * cs-parser.jay, expression.cs: An implicitly typed local variable
3028 declarator cannot use an array initializer.
3030 2008-09-11 Marek Safar <marek.safar@gmail.com>
3032 * cs-parser.jay: Reduced number of printed tokens, add sorting.
3034 2008-09-11 Marek Safar <marek.safar@gmail.com>
3036 * generic.cs (InflatedConstraints): Don't crash when constraints
3039 * cs-parser.jay: const_declarator is a block.
3041 * constant.cs: Check for not allowed NaN conversions.
3043 2008-09-10 Miguel de Icaza <miguel@novell.com>
3045 * driver.cs: Drop --shell argument, the compiler is no longer a
3048 * eval.cs: Move most of the code that deals with evaluation into
3049 this file and document the public API from repl.cs
3051 * repl.cs: Remove from here.
3053 2008-09-10 Marek Safar <marek.safar@gmail.com>
3055 A fix for bug #424684
3056 * generic.cs: Generic class constraints must come first.
3058 2008-09-09 Miguel de Icaza <miguel@novell.com>
3060 * cs-parser.jay: Improve error reporting for syntax errors in
3061 statements and expressions, we now report the expected tokens
3062 instead of reporting the useless "; expected".
3064 Drop the strings from the token declaration, it turns out that
3065 they did not do what I thought they did. Instead they were adding
3066 two sets of tokens to the tables.
3068 2008-09-09 Marek Safar <marek.safar@gmail.com>
3070 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
3071 delegate.cs: Share special type check.
3073 2008-09-09 Marek Safar <marek.safar@gmail.com>
3075 A fix for bug #423981
3076 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
3078 2008-09-09 Marek Safar <marek.safar@gmail.com>
3080 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
3083 2008-09-09 Marek Safar <marek.safar@gmail.com>
3085 A fix for bugs: #324750, #335946
3086 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
3087 lookup rule to determine ?-based tokens.
3089 2008-09-08 Miguel de Icaza <miguel@novell.com>
3091 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
3092 expressions (like event adding or removing) end up here, so we
3093 need to treat those as statements.
3095 Add LoadAssembly method.
3097 2008-09-04 Miguel de Icaza <miguel@novell.com>
3099 * repl.cs: Add Time method.
3101 2008-09-05 Marek Safar <marek.safar@gmail.com>
3103 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
3105 2008-09-05 Miguel de Icaza <miguel@novell.com>
3107 * repl.cs: Add workaround for old compilers.
3109 2008-09-04 Jb Evain <jbevain@novell.com>
3111 * repl.cs (PrettyPrint): pretty print everything that
3112 implements IDictionary, as well as IEnumerables. Also,
3113 add a quit helper property.
3115 2008-09-04 Marek Safar <marek.safar@gmail.com>
3117 * constant.cs: Better error reporting for decimal literals.
3119 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
3122 2008-09-04 Marek Safar <marek.safar@gmail.com>
3123 Miguel de Icaza <miguel@novell.com>
3125 A fix for bug #422951
3126 * assign.cs (Assign.DoResolve): Perform the type conversions
3127 checks before we attempt to initialize `New' initializers.
3129 2008-09-04 Marek Safar <marek.safar@gmail.com>
3131 A fix for bug #422853
3132 * delegate.cs (DelegateCreation): Add special handling for
3133 EmptyExpression.Null instance expression which is just another
3134 hack for undecided member instance exression.
3136 2008-09-04 Marek Safar <marek.safar@gmail.com>
3138 * expression.cs, ecore.cs: Emit full expression tree for reduced
3141 2008-09-04 Marek Safar <marek.safar@gmail.com>
3143 * expression.cs (This): Guard against multi-resolving.
3145 * ecore.cs, statement.cs (Throw): Simplified.
3147 * flowanalysis.cs: Also verify event fields.
3149 2008-09-04 Miguel de Icaza <miguel@novell.com>
3151 * assign.cs (Assign.DoResolve): Perform the type conversions
3152 checks before we attempt to initialize `New' initializers.
3154 * repl.cs (PrettyPrint): Add Hashtable prettyprint
3156 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
3159 * repl.cs: Update help.
3161 2008-09-03 Miguel de Icaza <miguel@novell.com>
3163 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
3164 handling of the default config handling, including the special
3165 treatment of System.Core assembly.
3167 Fixes the REPL processing for LINQ.
3169 2008-09-03 Marek Safar <marek.safar@gmail.com>
3171 A fix for bug #422507
3172 * expression.cs (UnboxCast): Add missing child expression mutator.
3174 2008-09-03 Marek Safar <marek.safar@gmail.com>
3176 * driver.cs: Don't self reference System.Core assembly.
3178 2008-09-03 Marek Safar <marek.safar@gmail.com>
3180 A fix for bug #422507
3181 * expression.cs (StringConcat): Add missing type mutator.
3183 2008-09-03 Marek Safar <marek.safar@gmail.com>
3185 * generic.cs (TypeInferenceContext): Follow equality rule for
3186 constructed type lower bound type inference.
3188 2008-09-02 Miguel de Icaza <miguel@novell.com>
3190 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
3191 <dblank@cs.brynmawr.edu> which updates the cursor position on
3194 2008-09-02 Marek Safar <marek.safar@gmail.com>
3196 A fix for bug #367145
3197 * driver.cs: Fixed import of extension methods when using -noconfig
3200 2008-09-02 Marek Safar <marek.safar@gmail.com>
3202 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
3203 version from non-generic implementation instead.
3205 2008-09-01 Marek Safar <marek.safar@gmail.com>
3207 A fix for bug #418908
3208 * class.cs: Use AddScopeStatement for field initializers.
3210 2008-09-01 Marek Safar <marek.safar@gmail.com>
3212 A fix for bug #415385
3213 * ecore.cs, convert.cs: Do method group conversion for equal group types.
3215 2008-09-01 Marek Safar <marek.safar@gmail.com>
3217 A fix for bug #421736
3218 * iterators.cs: Don't crash on unreachable iterators.
3220 2008-09-01 Marek Safar <marek.safar@gmail.com>
3222 A fix for bug #421628
3223 * parameter.cs, attribute.cs: Clone also parameter attributes.
3225 2008-08-30 Miguel de Icaza <miguel@novell.com>
3227 * namespace.cs (LookupType): In EvalMode, try to replace
3228 the TypeBuilder from our cache with a Type as Reflection.Emit does
3229 not like to mix code from older assemblies emitted and new
3232 This sounds like a serious Mono bug that prevents multiple
3233 assemblies to be generated and consumed at the same time.
3235 * cs-parser.jay (push_current_class): Do not make interactive
3236 classes internal or private, make them public as we currently
3237 generate each new class in a new assembly.
3239 2008-08-29 Miguel de Icaza <miguel@novell.com>
3241 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
3242 remove types that are entered into the global namespace during
3243 parsing so that we can remove them on failure.
3245 * cs-parser.jay: Parsing: we now keep track of types that are
3246 entered into global variables and queue those in case the parsing
3249 This happens in a few situations: during partial-input, we invoke
3250 the parser repeatedly for example with the string "class X", this
3251 would cause X to be registed, and we need to remove this
3252 registration so that another parse attempt later with say "class X {"
3253 would actually work.
3255 Additionally, if there is an error in the resolution phase, for
3256 example: "class X : NonExistant {}" th
3258 * cs-parser.jay: Be more precise with the errors being raised,
3259 instead of flagging all exceptions during parsing to be attributed
3260 to the parsing process, distinguish those from errors happening in
3261 the actions and hint that using -v would produce the actual
3264 * repl.cs: Do not load all compiler references on each reset,
3265 doing the partial reset takes care of this.
3267 2008-08-28 Miguel de Icaza <miguel@novell.com>
3269 * repl.cs: Add support for loading all the files from
3270 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
3273 Introduce a micro-parser that is able to deambiguate on its input
3274 whether we are dealing with a compilation unit (namespace, class,
3275 interface, struct, delegate) declaration or a statement. This
3276 allows both declarations and statements to be entered.
3278 Set history size by default to 300 lines.
3280 Instead of distinguishing based on the parser.InteractiveResult,
3281 have only two cases: statements were parsed, or a compilation unit
3282 was. Always pull the Using statement additions from the
3283 compilation unit parse.
3285 * cs-tokenizer.cs: Rename tokens to better describe their intent
3286 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
3288 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
3289 EvalMode is used to trigger the lookup of global variables while
3290 StatementMode is used turn variable declarations into static
3293 * getline.cs: Allow history size to be set.
3295 2008-08-29 Marek Safar <marek.safar@gmail.com>
3297 A fix for bug #360755
3298 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
3300 2008-08-29 Marek Safar <marek.safar@gmail.com>
3302 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
3304 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
3305 member name, it is too confusing
3307 * decl.cs, class.cs: Don't report unused fields with attached attribute.
3309 * rootcontext.cs: Finally default to warning level 4.
3311 2008-08-28 Marek Safar <marek.safar@gmail.com>
3313 * class.cs (CheckBase): Ignore overloaded operators.
3315 2008-08-28 Marek Safar <marek.safar@gmail.com>
3317 A fix for bug #420830
3318 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
3320 2008-08-28 Marek Safar <marek.safar@gmail.com>
3322 A fix for bug #420832
3323 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
3325 2008-08-28 Marek Safar <marek.safar@gmail.com>
3327 A fix for bug #420386
3328 * nullables.cs: Fixed logic of nullable user comparison operators involving
3331 2008-08-28 Marek Safar <marek.safar@gmail.com>
3333 * attribute (IsClsCompliant): Use FALSE value for pointer types.
3335 2008-08-27 Miguel de Icaza <miguel@novell.com>
3337 * repl.cs: Add support for aborting the running code with C-c.
3339 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
3341 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
3343 2008-08-27 Miguel de Icaza <miguel@novell.com>
3345 * cs-parser.jay (interactive_statement_list): A new set of rules
3346 for hosting statements that uses the "interactive_" prefix.
3348 * repl.cs: Add support for parsing `using' as a statement or as a
3349 directive. Deambiguating before passing this to the parser.
3351 We need to distinguish statement_expressions that occur at the
3352 toplevel vs those that occur embedded into expressions.
3354 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
3355 that fixes the cursor key handling, and a history bug.
3357 2008-08-26 Miguel de Icaza <miguel@novell.com>
3359 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
3360 limitations in Console, instead the 2.0 bootstrap libraries now
3361 include the Console bits.
3363 Also, remove the use of Nullables from getline.cs
3367 Interactive support for the C# compiler. Use gmcs --shell to
3368 enter a read-eval-print loop shell.
3370 Docs: http://www.mono-project.com/CsharpRepl
3372 * sources: include repl.cs here and getline.cs for gmcs.exe,
3373 everything else is getline.cs impaired.
3375 * Makefile: when bootstrapping pass a special flag
3376 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
3377 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
3378 This distinguishes those two cases.
3380 * repl.cs: Support for a read-eval-print loop. Will be soon
3381 refactored into eval support and then REPL on top of it.
3383 * ecore.cs: If a simplename lookup fails, before erroring out,
3384 if we are in EvalMode to resolve the name to a declaration in the
3387 This means that variable declarations that happened in previous
3388 classes (as repl puts every statement in a separate class) are
3389 made visible in this way.
3391 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
3392 triggered an error due to the end of file being reached. This is
3393 used to do multi-line input, and notify the caller that the user
3394 needs to provide more text before a successful parse.
3396 Add new grammar rules after the INTERACTIVE_PARSER token is seen
3397 to drive the evaluation with a custom wrapper.
3399 * driver.cs: Add support for --shell, and refactor some code to be
3402 * namespace.cs: Add support for serializing the contents of the
3403 namespaces and reloading them.
3405 * getline.cs: A managed implementation of ReadLine under
3406 X11/Apache2 license terms. Easy to embed in other applications as
3409 * namespace.cs: Add some functions to save and restore the
3412 * rootcontext.cs: New public field.
3414 * cs-tokenizer.cs: Add support for one of the possible characters
3415 we introduce into the token stream.
3417 This patch does not affect the regular tokenization process, the
3418 only performance hit would happen if there is an invalid character
3419 on the input string.
3421 * support.cs: Move isatty helper routine here.
3423 * codegen.cs: Small cleanup, and add a mechanism to initialize the
3424 code generator for in-memory assemblies.
3426 2008-08-26 Marek Safar <marek.safar@gmail.com>
3428 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
3429 parameter cannot be always used as a type.
3431 2008-08-21 Marek Safar <marek.safar@gmail.com>
3433 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
3435 2008-08-21 Marek Safar <marek.safar@gmail.com>
3437 * convert.cs: Implement explicit array to IList<T> conversion.
3439 2008-08-20 Marek Safar <marek.safar@gmail.com>
3441 A fix for bug #362740
3442 * cs-tokenizer.cs: Handle UTF-16 surrogates.
3444 2008-08-20 Marek Safar <marek.safar@gmail.com>
3446 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
3447 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
3448 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
3449 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
3450 handling to use just one type of infrastructure and deal with generics
3453 2008-07-23 Martin Baulig <martin@ximian.com>
3455 *** Merged this from trunk revision 108527 ***
3458 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
3459 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
3462 2008-08-15 Marek Safar <marek.safar@gmail.com>
3464 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
3467 2008-08-15 Marek Safar <marek.safar@gmail.com>
3469 * delegate.cs: Fixed compiler crash when creating delegate using partial
3472 * typemanager.cs: MulticastDelegate is not a delegate.
3474 2008-08-14 Marek Safar <marek.safar@gmail.com>
3476 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
3479 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
3481 * cs-parser.jay (type): Allow 'var' in mcs too.
3482 (local_variable_type): Likewise.
3484 2008-08-14 Marek Safar <marek.safar@gmail.com>
3486 * driver.cs: Removed broken -noconfig variants.
3488 2008-08-14 Marek Safar <marek.safar@gmail.com>
3490 A fix for bug #417078
3491 * expression.cs: Emit correctly left side pointer operators.
3493 2008-08-13 Marek Safar <marek.safar@gmail.com>
3495 * generic.cs, lambda.cs: Inflate method generic arguments only.
3497 2008-08-12 Marek Safar <marek.safar@gmail.com>
3499 * class.cs: Fixed struct layout check regression.
3501 2008-08-12 Marek Safar <marek.safar@gmail.com>
3503 * cs-parser.jay, enum.cs: Simplified enum parsing.
3505 * decl.cs: Check all type parameters conflicts.
3507 * expression.cs, statement.cs, attribute.cs: More expression checks.
3509 2008-08-11 Marek Safar <marek.safar@gmail.com>
3511 * generic.cs: Add type inference types restriction.
3513 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
3514 anonymous.cs, expression.cs: Allocate less accessor parameters.
3516 2008-08-08 Marek Safar <marek.safar@gmail.com>
3518 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
3521 2008-08-08 Marek Safar <marek.safar@gmail.com>
3523 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
3525 2008-08-07 Marek Safar <marek.safar@gmail.com>
3527 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
3528 Also fixes #362146 and #381592.
3530 2008-08-07 Marek Safar <marek.safar@gmail.com>
3532 * ecore.cs: Reduced constant cannot be used as an attribute value.
3534 * cs-parser.jay: Base expression has to be a type.
3536 * expression.cs (Conditional): Uses ReducedExpression.
3538 2008-08-06 Marek Safar <marek.safar@gmail.com>
3540 A fix for bug #376826
3541 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
3542 address of hoisted local variable or parameter cannot be taken.
3544 2008-08-05 Marek Safar <marek.safar@gmail.com>
3546 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
3547 anonymous method inside checked/unchecked expression.
3549 2008-08-05 Marek Safar <marek.safar@gmail.com>
3551 * typemanager.cs (IsEqual): Guard against null.
3553 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
3554 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
3555 routine. Fixed few misleading conversion errors.
3557 2008-08-04 Marek Safar <marek.safar@gmail.com>
3559 * class.cs: Consider generics when checking cycles in struct layout.
3561 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
3563 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
3565 2008-08-04 Marek Safar <marek.safar@gmail.com>
3567 A fix for bug #414165
3568 * anonymous.cs: Use same anonymous implementation method for all anonymous
3571 2008-08-04 Marek Safar <marek.safar@gmail.com>
3573 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
3576 2008-08-04 Marek Safar <marek.safar@gmail.com>
3578 * cs-parser.jay: Typeof argument has to be a type expression.
3580 * namespace.cs: Check alias and namespace definitions collisions.
3582 * class.cs, pending.cs: Moved explicit interface accessor implementation
3585 * delegate.cs, expression.cs: Verify special name invocations.
3587 2008-08-01 Marek Safar <marek.safar@gmail.com>
3589 * cs-parser.jay: Don't choke on empty generic type arguments.
3591 * cs-tokenizer.cs: Handle escaped preprocessor directives.
3593 * expression.cs, ecore.cs: Minor expressions bugs.
3595 2008-08-01 Marek Safar <marek.safar@gmail.com>
3597 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
3598 and added more error handling.
3600 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
3602 * modifiers.cs, enum.cs: Fixed.
3604 2008-07-31 Jb Evain <jbevain@novell.com>
3606 * driver.cs: remove -pkg ability of smcs.
3608 2008-07-30 Marek Safar <marek.safar@gmail.com>
3610 * statement.cs (Switch): Correctly set empty default target for single
3613 2008-07-30 Marek Safar <marek.safar@gmail.com>
3615 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
3616 string switch statement implementation to use string dictionary which
3617 significantly (2-8x) improves performance of generated code.
3619 2008-07-29 Marek Safar <marek.safar@gmail.com>
3621 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
3622 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
3624 2008-07-29 Marek Safar <marek.safar@gmail.com>
3626 A fix for bug #412595
3627 * typemanager.cs, convert.cs, expression.cs: Some types are never
3628 convertible to each other.
3630 2008-07-29 Marek Safar <marek.safar@gmail.com>
3632 * nullable.cs (CreateNullConstant): An error messages update.
3634 2008-07-29 Marek Safar <marek.safar@gmail.com>
3636 A fix for bug #412595
3637 * cfold.cs: Don't cast undefined bool constant.
3639 2008-07-29 Martin Baulig <martin@ximian.com>
3642 (SymbolWriter.Reset): New public static method.
3645 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
3647 2008-07-28 Marek Safar <marek.safar@gmail.com>
3649 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
3651 * expression.cs (ElementAccess): Exact size allocation.
3653 2008-07-26 Marek Safar <marek.safar@gmail.com>
3655 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
3657 2008-07-25 Marek Safar <marek.safar@gmail.com>
3659 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
3661 * class.cs: Removed $PRIVATE$ field hack which caused problems during
3664 2008-07-25 Marek Safar <marek.safar@gmail.com>
3666 A fix for bug #412217
3667 * assign.cs: Mutate also assignment type.
3669 2008-07-25 Marek Safar <marek.safar@gmail.com>
3671 A fix for bug #323644
3672 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
3675 2008-07-25 Marek Safar <marek.safar@gmail.com>
3677 A fix for bug #412134
3678 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
3679 non-enumerable operands when overloading equality or bitwise operators.
3681 2008-07-25 Marek Safar <marek.safar@gmail.com>
3683 * anonymous.cs: Cache closed generic anonymous method delegates.
3685 2008-07-24 Marek Safar <marek.safar@gmail.com>
3687 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
3688 anonymous.cs, statement.cs: Always emit anonymous method as static method
3689 when is instance free. Use nesting for nested anynomous methods blocks.
3691 2008-07-23 Marek Safar <marek.safar@gmail.com>
3693 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
3696 2008-07-23 Marek Safar <marek.safar@gmail.com>
3698 * expression.cs: Removed MakeSimpleCall.
3700 2008-07-23 Marek Safar <marek.safar@gmail.com>
3702 A fix for bug #323012
3703 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
3704 Base method implementing interface has to be public.
3706 2008-07-23 Marek Safar <marek.safar@gmail.com>
3708 * cs-parser.jay: Don't break on missing argument.
3710 2008-07-22 Marek Safar <marek.safar@gmail.com>
3712 A fix for bug #320993
3713 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
3714 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
3716 2008-07-22 Marek Safar <marek.safar@gmail.com>
3718 A fix for bug #320748
3719 * convert.cs: Implicit user operators cannot convert to interfaces
3721 2008-07-22 Marek Safar <marek.safar@gmail.com>
3723 A fix for bug #312686
3724 * driver.cs: Ignore empty assembly references.
3726 2008-07-22 Marek Safar <marek.safar@gmail.com>
3728 A fix for bug #387040
3729 * ecore.cs: Skip constrains check for an explicit implementation.
3731 2008-07-21 Marek Safar <marek.safar@gmail.com>
3733 A fix for bug #409045
3734 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
3735 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
3736 identifiers are file specific unless passed as input arguments.
3738 2008-07-21 Marek Safar <marek.safar@gmail.com>
3740 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
3741 to emit UnmanagedMarshal data under 2.0 profile.
3743 2008-07-21 Marek Safar <marek.safar@gmail.com>
3745 A fix for bug #410369
3746 * parameter.cs: Clone correctly ParamsParameter.
3748 2008-07-21 Marek Safar <marek.safar@gmail.com>
3750 * expression.cs (Argument): Always report type for type based expressions
3753 2008-07-18 Marek Safar <marek.safar@gmail.com>
3755 A fix for bug #410666
3756 * anonymous.cs: Correctly initialize generic storey reference.
3758 2008-07-18 Marek Safar <marek.safar@gmail.com>
3760 * convert.cs: Don't box same type arguments.
3762 2008-07-18 Marek Safar <marek.safar@gmail.com>
3764 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
3765 Finished missing generic type mutators.
3767 2008-07-18 Marek Safar <marek.safar@gmail.com>
3769 * iterators.cs, statement.cs: Finished statements CloneTo.
3771 2008-07-18 Marek Safar <marek.safar@gmail.com>
3773 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
3775 * expression.cs: Emit optimized default value expressions in expression tree
3778 2008-07-18 Marek Safar <marek.safar@gmail.com>
3780 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
3782 2008-07-17 Marek Safar <marek.safar@gmail.com>
3784 A fix for bug #367536
3785 * cs-parser.jay: Check static constructor of generic types for an access
3788 2008-07-17 Marek Safar <marek.safar@gmail.com>
3790 A fix for bug #353800
3791 * lambda.cs: Emit ret for contextual statements.
3793 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
3794 up emitting redundant ret for all anonymous methods with return.
3796 2008-07-17 Marek Safar <marek.safar@gmail.com>
3798 A fix for bug #365188
3799 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
3800 create anonymous method storey in unreachable block.
3802 2008-07-17 Marek Safar <marek.safar@gmail.com>
3804 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
3805 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
3806 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
3807 statement.cs: Fixed relevant defects found by Gendarme.
3809 2008-07-17 Marek Safar <marek.safar@gmail.com>
3811 A fix for bug #325291
3812 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
3813 statement.cs: Replaced IAnonymousHost with top level block flag.
3815 2008-07-17 Marek Safar <marek.safar@gmail.com>
3817 * cs-parser.jay: Clean up unused open_parens.
3819 2008-07-17 Marek Safar <marek.safar@gmail.com>
3821 * ecore.cs: Custom error message for a range variable assignment.
3823 2008-07-16 Marek Safar <marek.safar@gmail.com>
3825 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
3828 2008-07-16 Marek Safar <marek.safar@gmail.com>
3830 * literal.cs: Null literal is of object type.
3832 2008-07-16 Marek Safar <marek.safar@gmail.com>
3834 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
3835 expression of nullable equality comparison.
3837 2008-07-15 Marek Safar <marek.safar@gmail.com>
3839 * expression.cs(PointerArithmetic): Removed redundant assignment.
3841 2008-07-15 Marek Safar <marek.safar@gmail.com>
3843 * decl.cs (GetSignatureForError): Report full namespace name for containers.
3845 2008-07-14 Marek Safar <marek.safar@gmail.com>
3847 A fix for bug #408361
3848 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
3849 they are replaced by GetMethod.
3851 2008-07-14 Marek Safar <marek.safar@gmail.com>
3853 A fix for bug #408721 by jeremie.laval@gmail.com
3854 * expression.cs (Indirection): Implemented CloneTo.
3856 2008-07-14 Marek Safar <marek.safar@gmail.com>
3858 * statement.cs (AssignableSlots): Temporary disabled variable initialization
3861 2008-07-14 Marek Safar <marek.safar@gmail.com>
3863 * report.cs (EnableReporting): Don't reinitialize 0-based values.
3865 2008-07-11 Marek Safar <marek.safar@gmail.com>
3867 * linq.cs: Reset tranparent parameter counter in probing mode.
3869 2008-07-11 Marek Safar <marek.safar@gmail.com>
3871 * anonymous.cs: Mutate anonymous method type.
3873 2008-07-11 Marek Safar <marek.safar@gmail.com>
3875 * ecore.cs, anonymous.cs: Mutate field expressions.
3877 2008-07-10 Marek Safar <marek.safar@gmail.com>
3879 A fix for bug #369670
3880 * linq.cs, statement.cs: Use explicit block for query expressions variables.
3882 2008-07-10 Marek Safar <marek.safar@gmail.com>
3884 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
3886 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
3889 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
3890 only one '>', and finds a '>>', abort the generic lookahead.
3892 2008-07-10 Marek Safar <marek.safar@gmail.com>
3894 A fix for bug #319902
3895 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
3897 2008-07-10 Marek Safar <marek.safar@gmail.com>
3899 A fix for bug #406371
3900 * statement.cs: Moved EmitSymbolInfo to Block.
3902 2008-07-09 Marek Safar <marek.safar@gmail.com>
3904 * ecore.cs: Report better error for extension method overload failures.
3906 2008-07-09 Marek Safar <marek.safar@gmail.com>
3908 * expression.cs (Is): No need to box reference values.
3910 2008-07-09 Marek Safar <marek.safar@gmail.com>
3912 * class.cs: Use event resolve context when initializing CreateEmitContext.
3914 2008-07-09 Marek Safar <marek.safar@gmail.com>
3916 A fix for bug #394436
3917 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
3918 method used inside expression trees. Added more LINQ to expression tree
3921 2008-07-08 Marek Safar <marek.safar@gmail.com>
3923 A fix for bug #378189, #370577
3924 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
3927 2008-07-08 Marek Safar <marek.safar@gmail.com>
3929 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
3932 2008-07-08 Marek Safar <marek.safar@gmail.com>
3934 A fix for bug #406702
3935 * anonymous.cs: Always park anonymous method in the nearest parent storey.
3937 2008-07-07 Marek Safar <marek.safar@gmail.com>
3939 A fix for bug #406648
3940 * cs-parser.jay: Report nullable use in mcs for some cases.
3942 2008-07-07 Marek Safar <marek.safar@gmail.com>
3944 * ecore.cs: Improved argument mismatch error messages.
3946 2008-07-07 Marek Safar <marek.safar@gmail.com>
3948 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
3950 2008-07-07 Marek Safar <marek.safar@gmail.com>
3952 * expression.cs (TypeOf): Mutate type argument.
3954 2008-07-04 Marek Safar <marek.safar@gmail.com>
3956 * class.cs: Report missing partial modifier for correct type.
3958 2008-07-04 Marek Safar <marek.safar@gmail.com>
3960 * ecore.cs, expression.cs (VariableReference): Variable property is
3963 2008-07-04 Marek Safar <marek.safar@gmail.com>
3965 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
3967 2008-07-04 Marek Safar <marek.safar@gmail.com>
3969 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
3972 2008-07-04 Marek Safar <marek.safar@gmail.com>
3974 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
3975 anonymous method storey to an instance method when only "this" is hoisted.
3977 2008-07-03 Marek Safar <marek.safar@gmail.com>
3979 A fix for bug #321615
3980 * expression.cs: Pointer comparisons use unsigned operator.
3982 2008-07-03 Marek Safar <marek.safar@gmail.com>
3984 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
3986 2008-07-02 Marek Safar <marek.safar@gmail.com>
3988 A fix for bug #404905
3989 * class.cs: Always initialize local unsafe variables.
3991 2008-06-30 Marek Safar <marek.safar@gmail.com>
3993 A fix for bug #396987
3994 * expression.cs (NewInitialize): Clear local temporary variable for next run
3996 2008-06-27 Marek Safar <marek.safar@gmail.com>
3998 A fix for bug #401020
3999 * ecore.cs: Both types and modifiers have to match for ref and out arguments
4001 2008-06-27 Marek Safar <marek.safar@gmail.com>
4003 A fix for bug #398319
4004 * cs-parser.jay: Implemented undocumented base access expression inside
4007 2008-06-26 Marek Safar <marek.safar@gmail.com>
4009 A fix for bug #404227
4010 * cs-parser.jay: Parse namespace declaration using qualified identifier.
4012 2008-06-26 Marek Safar <marek.safar@gmail.com>
4014 A fix for bug #404227
4015 * convert.cs: Fixed explicit array to interface cast.
4017 2008-06-26 Marek Safar <marek.safar@gmail.com>
4019 A fix for bug #403894
4020 * delegate.cs: Mutate DelegateInvocation type.
4022 2008-06-26 Marek Safar <marek.safar@gmail.com>
4024 A fix for bug #379348
4025 * delegate.cs: Box a load of generic parameters.
4027 2008-06-26 Marek Safar <marek.safar@gmail.com>
4029 * expression.cs: Add an array creation arguments mutate.
4031 2008-06-26 Marek Safar <marek.safar@gmail.com>
4033 A fix for bug #386068
4034 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
4037 2008-06-25 Marek Safar <marek.safar@gmail.com>
4039 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
4042 2008-06-25 Marek Safar <marek.safar@gmail.com>
4044 A fix for bug #403518
4045 * delegate.cs: Type correctly anonymous method new invocation.
4047 2008-06-24 Marek Safar <marek.safar@gmail.com>
4049 A fix for bug #394826
4050 * anonymous.cs: Fully qualify members when resolving anonymous type internal
4053 2008-06-24 Marek Safar <marek.safar@gmail.com>
4055 A fix for bug #394826
4056 * anonymous.cs, iterators.cs: Construct generic storey only when is really
4059 2008-06-24 Marek Safar <marek.safar@gmail.com>
4061 * class.cs: Clone indexer parameters for localized capturing.
4063 2008-06-24 Marek Safar <marek.safar@gmail.com>
4065 A fix for bug #402379
4066 * expression.cs: Don't crash when an object initializer resolve fails.
4068 2008-06-24 Marek Safar <marek.safar@gmail.com>
4070 A fix for bug #402888
4071 * expression.cs: Mutate conditional expression.
4073 2008-06-24 Marek Safar <marek.safar@gmail.com>
4075 A fix for bug #401012
4076 * class.cs: Keep StructLayout in shared container.
4078 2008-06-24 Marek Safar <marek.safar@gmail.com>
4080 A fix for bug #400438
4081 * decl.cs, class.cs: Only properties can be automatically implemented.
4083 2008-06-24 Marek Safar <marek.safar@gmail.com>
4085 * statement.cs (ChangeToIterator): Copy also labels.
4087 2008-06-23 Marek Safar <marek.safar@gmail.com>
4089 * ecore.cs: Pass type argument details to parent extension method.
4091 2008-06-23 Marek Safar <marek.safar@gmail.com>
4093 A fix for bug #375966
4094 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
4096 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
4098 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
4100 2008-06-22 Marek Safar <marek.safar@gmail.com>
4102 A fix for bug #394347
4103 * anonymous.cs: Cache compatible delegates as compatibility check produces
4104 a new method every time.
4106 2008-06-20 Marek Safar <marek.safar@gmail.com>
4108 * anonymous.cs: Propagate storey reference for single references.
4110 2008-06-20 Marek Safar <marek.safar@gmail.com>
4112 A fix for bug #387615
4113 * assign.cs, expression.cs: Correctly clone compound assignment.
4115 2008-06-19 Marek Safar <marek.safar@gmail.com>
4117 A fix for bug #359611, #359604
4118 * anonymous.cs: Mutate all types of hoisted parameters.
4120 2008-06-19 Marek Safar <marek.safar@gmail.com>
4122 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
4123 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
4124 expression.cs, codegen.cs, statement.cs
4126 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
4127 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
4129 ** Anonymous methods, lambda expressions rewrite **
4131 Anonymous expressions are now resolved when an explicit block is resolved
4132 and they don't require any registration procedure anymore. Further,
4133 anonymous methods are defined when explicit block is emitted which allows
4134 better control of whole process and opens possibilities for more
4135 optimizations as well as alternative to reverse whole process.
4137 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
4138 process consistent and to correctly emit hoisted generic methods when they
4139 have at least 1 hoisted variable.
4141 2008-06-17 Martin Baulig <martin@ximian.com>
4143 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
4145 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
4146 virtual property; check it in Emit().
4147 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
4149 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
4151 (Indexer.Define): Likewise.
4153 2008-06-17 Marek Safar <marek.safar@gmail.com>
4155 * convert.cs: Don't use IsInterface on type arguments.
4157 * delegate.cs: DelegateInvocation uses MethodInfo.
4159 * parameter.cs: Removed IsTypeParameter.
4161 * generic-mcs.cs: More missing stuff.
4163 2008-06-16 Martin Baulig <martin@ximian.com>
4166 (Modifiers.DEBUGGER_HIDDEN): New public const.
4169 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
4172 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
4173 (AbstractPropertyEventMethod): Likewise.
4174 (Constructor.Emit): Likewise.
4175 (SourceMethod.SetCompilerGenerated): Removed.
4177 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
4181 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
4182 if we're an `IteratorHost'.
4183 (AnonymousMethodMethod..ctor): Don't set
4184 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
4187 2008-06-16 Marek Safar <marek.safar@gmail.com>
4189 * statement.cs: Clean-up foreach statements.
4191 2008-06-12 Marek Safar <marek.safar@gmail.com>
4193 * class.cs: Stop using public method which should not exist
4194 (MethodBuilder.SetGenericMethodSignature).
4196 2008-06-11 Martin Baulig <martin@ximian.com>
4199 (Location.LookupFile): Add `CompilationUnit' argument; when given
4200 a relative file name, make it relative to the directory the .cs
4201 file is located in instead of using the current directory.
4203 2008-06-11 Martin Baulig <martin@ximian.com>
4206 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
4207 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
4208 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
4209 (SourceMethod.SetCompilerGenerated): Likewise.
4211 2008-06-11 Marek Safar <marek.safar@gmail.com>
4213 * codegen.cs, driver: Only write symbol file when it's asked for.
4215 2008-06-11 Marek Safar <marek.safar@gmail.com>
4217 * codegen.cs: Don't use assembly writer error handling for symbol writer.
4219 2008-06-10 Martin Baulig <martin@ximian.com>
4221 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
4223 2008-06-09 Marek Safar <marek.safar@gmail.com>
4225 A fix for bug #316290
4226 * expression.cs: Include decimal operators in predefined table.
4228 * parameters.cs: More readonlyness.
4230 2008-06-09 Marek Safar <marek.safar@gmail.com>
4232 A fix for bug #397213
4233 * cs-parser.jay: One more missing current_local_parameters reset.
4235 2008-06-09 Marek Safar <marek.safar@gmail.com>
4237 A fix for bug #396633
4238 * class.cs: Host backing field in partial container.
4240 2008-06-09 Marek Safar <marek.safar@gmail.com>
4242 A fix for bug #397068
4243 * expression.cs: Check both operand types when predefined operator is used.
4245 2008-06-05 Martin Baulig <martin@ximian.com>
4247 Merged the `debugger-kahalo' branch.
4250 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
4251 we're an iterator method.
4252 (SourceMethod): Reflect latest symbol writer changes;
4253 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
4254 now `start_row' and `end_row'.
4255 (Constructor.Emit): Fix the logic whether to emit symbol information.
4257 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
4261 (CompilationUnit): New public class; derives from `SourceFile'.
4262 (SourceFileEntry.DefineSymbolInfo): New public method.
4263 (SourceFileEntry.SetChecksum): New public method.
4264 (Location): Encode hidden line numbers by using `column == 255';
4265 the .ctor now accepts `column == -1' to mark a hidden line number.
4266 (Location.Hidden): New public property.
4267 (Location.CheckPoint): Add `CompilationUnit'.
4268 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
4269 (Location.Push): Add `CompilationUnit compile_unit' argument.
4270 (Location.CompilationUnit): New public property.
4273 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
4275 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
4277 * driver.cs: `SourceFile' -> `CompilationUnit'.
4279 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
4281 * namespace.cs: `SourceFile' -> `CompilationUnit'.
4283 * cs-tokenizer.cs: Add support for `#pragma checksum' and
4287 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
4288 new symbol writer API to also pass the file.
4290 2008-06-05 Marek Safar <marek.safar@gmail.com>
4292 * statement.cs: Emit catch variable assignment using variable expression.
4294 2008-06-05 Marek Safar <marek.safar@gmail.com>
4296 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
4297 with other variable types.
4299 2008-06-04 Marek Safar <marek.safar@gmail.com>
4301 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
4302 GetLength method emit, it breaks resolve rules.
4304 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
4305 Marek Safar <marek.safar@gmail.com>
4307 A fix for bug #395542
4308 * cs-parser.jay: The trailing comma is allowed in anonymous type member
4311 2008-06-02 Marek Safar <marek.safar@gmail.com>
4313 A fix for bug #395287
4314 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
4316 2008-05-31 Marek Safar <marek.safar@gmail.com>
4318 A fix for bug #395845
4319 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
4320 non-nullable parameter type.
4322 2008-05-31 Marek Safar <marek.safar@gmail.com>
4324 * class.cs: Handle contructor initializer as a statement in top-level block.
4326 2008-05-30 Marek Safar <marek.safar@gmail.com>
4328 * attribute.cs: Don't mix old and new corlib types when emitting corlib
4329 security attributes.
4331 2008-05-24 Marek Safar <marek.safar@gmail.com>
4333 * ecore.cs, expression.cs: Small IVariable refactoring.
4335 2008-05-22 Marek Safar <marek.safar@gmail.com>
4337 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
4339 2008-05-21 Marek Safar <marek.safar@gmail.com>
4341 * cs-parser.jay: Removed redundant catch type check.
4343 2008-05-21 Marek Safar <marek.safar@gmail.com>
4345 A fix for bug #390372
4346 * nullable.cs: Set correct return type.
4348 2008-05-21 Marek Safar <marek.safar@gmail.com>
4350 A fix for bug #391062
4351 * typemanager.cs: Fixed crash when comparing null types.
4353 2008-05-21 Marek Safar <marek.safar@gmail.com>
4355 A fix for bug #391871
4356 * cs-parser.jay: Better error handling for invalid catch type.
4358 2008-05-20 Marek Safar <marek.safar@gmail.com>
4360 A fix for bug #392155
4361 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
4363 2008-05-15 Marek Safar <marek.safar@gmail.com>
4365 A fix for bug #390666
4366 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
4369 2008-05-15 Marek Safar <marek.safar@gmail.com>
4371 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
4374 2008-05-13 Marek Safar <marek.safar@gmail.com>
4376 A fix for bug #389625
4377 * delegate.cs, generic.cs: Some progress on method group return type
4380 2008-05-13 Marek Safar <marek.safar@gmail.com>
4382 A fix for bug #378419
4383 * namespace.cs: Inspect also parent namespaces not only namespace entries.
4385 2008-05-12 Marek Safar <marek.safar@gmail.com>
4387 * class.cs (Constructor): Added IsCompilerGenerated.
4389 2008-05-12 Marek Safar <marek.safar@gmail.com>
4391 * expression.cs: Enum binary operators can accept non-enum operand only when
4392 is implicitly convertible to underlying type.
4394 2008-05-12 Marek Safar <marek.safar@gmail.com>
4396 A fix for bug #389272
4397 * support.cs: Workaround System.InvalidOperationException for enums.
4399 2008-05-12 Marek Safar <marek.safar@gmail.com>
4401 A fix for bug #389073
4402 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
4404 2008-05-10 Marek Safar <marek.safar@gmail.com>
4406 * driver.cs: Split Parse.
4408 * location.cs (LookupFile): Uses string.Empty.
4410 2008-05-07 Marek Safar <marek.safar@gmail.com>
4412 * expression.cs, parameter.cs: Small ParameterReference clean up.
4414 2008-05-07 Marek Safar <marek.safar@gmail.com>
4416 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
4417 hack. Fixes #387502.
4419 2008-05-06 Martin Baulig <martin@ximian.com>
4421 * class.cs (Constructor.Emit): Fix the logic whether to emit
4424 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
4427 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
4428 InvalidOperationException when the iterator is before the start or
4431 2008-05-06 Marek Safar <marek.safar@gmail.com>
4433 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
4434 when left is nullable type.
4436 2008-05-06 Marek Safar <marek.safar@gmail.com>
4438 A fix for bug #386628
4439 * expression.cs (LocalVariableReference): Continue in resolving when
4440 variable is not assigned.
4442 2008-05-05 Marek Safar <marek.safar@gmail.com>
4444 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
4445 nullable operations.
4447 2008-05-04 Marek Safar <marek.safar@gmail.com>
4449 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
4450 it saves many redundant temporary variables for nullable operations.
4452 2008-05-03 Marek Safar <marek.safar@gmail.com>
4454 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
4456 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
4459 * nullable.cs: Constant coalescing operator optimizations.
4461 2008-05-03 Marek Safar <marek.safar@gmail.com>
4463 * constant.cs: Use unsigned conversion for values which are unsigned only.
4465 2008-05-03 Marek Safar <marek.safar@gmail.com>
4467 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
4468 coalescing operator as it should be.
4470 2008-05-02 Marek Safar <marek.safar@gmail.com>
4472 A fix for bug #371016
4473 * expression.cs: All predefined delegate operators require implicit method
4476 2008-05-02 Marek Safar <marek.safar@gmail.com>
4478 * constant.cs: Emit long constant as uint when fits the range.
4480 * convert.cs, expression.cs: Fixed few unsafe conversions.
4482 2008-05-02 Marek Safar <marek.safar@gmail.com>
4484 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
4486 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
4489 * convert.cs (ImplicitNumericConversion): Don't modify the type of
4491 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
4493 2008-05-01 Marek Safar <marek.safar@gmail.com>
4495 * constant.cs, literal.cs: IsLiteral property for error reporting.
4497 * ecore.cs, expression.cs: Implemented Property expression.
4499 2008-05-01 Marek Safar <marek.safar@gmail.com>
4501 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
4503 * nullable.cs: Implemented nullable coalescing null operator.
4505 * ecore.cs, expression.cs: Expression trees work.
4507 2008-05-01 Marek Safar <marek.safar@gmail.com>
4509 * ecore.cs: CreateExpressionTree is finally abstract.
4511 * expression.cs, linq.cs: Updated.
4513 2008-05-01 Marek Safar <marek.safar@gmail.com>
4515 * expression.cs, ecore.cs: Block base access expression inside expression
4518 2008-05-01 Marek Safar <marek.safar@gmail.com>
4520 A fix for bug #385058
4521 * expression.cs: User-defined operator implementations always take
4522 precedence over predefined operator implementations.
4524 2008-04-30 Marek Safar <marek.safar@gmail.com>
4526 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
4527 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
4528 expression tree conversions.
4530 2008-04-30 Marek Safar <marek.safar@gmail.com>
4532 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
4533 operators method details to Operator class.
4535 2008-04-30 Marek Safar <marek.safar@gmail.com>
4537 * anonymous.cs: Pass unsafe flags to anonymous container.
4539 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
4540 inside expression tree.
4542 2008-04-29 Martin Baulig <martin@ximian.com>
4544 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
4545 (Tokenizer.PopPosition): Also restore the `line'.
4547 2008-04-29 Marek Safar <marek.safar@gmail.com>
4549 * delegate.cs: Implemented Invoke expression.
4551 2008-04-29 Marek Safar <marek.safar@gmail.com>
4553 * expression.cs: Fixed equality reference comparison regression.
4555 2008-04-29 Marek Safar <marek.safar@gmail.com>
4557 * ecore.cs: Clean up EmptyCast hack.
4559 * expression.cs, nullable.cs: Implemented enum binary and unary operations
4560 using correct conversion rules. Also fixes #383993.
4562 2008-04-28 Martin Baulig <martin@ximian.com>
4564 * class.cs (Constructor.Emit): Don't emit debugging information
4565 for generated default .ctor's.
4567 2008-04-28 Marek Safar <marek.safar@gmail.com>
4569 * convert.cs: Empty-cast ushort to int conversion.
4571 2008-04-28 Marek Safar <marek.safar@gmail.com>
4573 A fix for bug #384191
4574 * ecore.cs, expression.cs: Fixed expression cloning.
4576 2008-04-28 Marek Safar <marek.safar@gmail.com>
4578 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
4580 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
4582 Fix #381559, test-638.cs, test-639.cs
4583 * assign.cs (CompoundAssign.Helper): New wrapper.
4584 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
4586 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
4587 Pass unconverted expressions to the params array creation expression.
4588 (FieldExpr.EmitAssign): Don't special-case StringConcat.
4589 (PropertyExpr.EmitAssign): Likewise.
4590 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
4591 element if it is of kind CompoundAssign.Helper.
4592 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
4593 first before anything else.
4594 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
4595 (ArrayAccess.LoadArrayAndArguments): Simplify.
4597 2008-04-27 Marek Safar <marek.safar@gmail.com>
4599 * expression.cs: Fixed cloning of typeof(void).
4601 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
4603 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
4604 (Assign.Emit): Likewise. Move it to ...
4605 (CompoundAssign.DoResolve): ... here and ...
4606 (CompoundAssign.Emit): ... here.
4607 (EventAddOrRemove): New helper to handle += and -= on events, and
4608 avoid the use of BinaryDelegates.
4609 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
4610 (EventExpr.EmitAddOrRemove): Improve.
4611 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
4613 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
4614 create VarExprs for 'foo.bar.var'.
4615 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
4616 is a highly inappropriate name for its functionality.
4618 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4620 Simplify handling of multiple assignments
4621 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
4623 (SimpleAssign): New. Class to be used for normal assignments.
4624 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
4625 * expression.cs, parameter.cs, statement.cs: Likewise.
4627 2008-04-25 Marek Safar <marek.safar@gmail.com>
4629 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
4630 for incompatible underlying types, more to come, uff.
4632 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4635 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
4636 Handle 'leave_copy'.
4638 2008-04-25 Marek Safar <marek.safar@gmail.com>
4640 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
4642 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
4644 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
4645 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
4646 * statement.cs (While, Do, For): Allow test to have side effects.
4647 (For.DoEmit): Always emit InitStatement.
4650 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
4651 Always create SideEffectConstant.
4652 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
4653 of type EnumConstant.
4655 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4656 Handle 'right' being SideEffectConstant of type 'bool'.
4658 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4659 Use left.EmitBranchable instead of open coding it, so as to
4660 improve optimization opportunities.
4662 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
4664 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
4666 (Expression.EmitSideEffect): Document.
4668 2008-04-23 Marek Safar <marek.safar@gmail.com>
4670 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
4672 2008-04-23 Marek Safar <marek.safar@gmail.com>
4674 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
4676 2008-04-23 Marek Safar <marek.safar@gmail.com>
4678 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
4679 conversion to expression tree.
4681 2008-04-23 Marek Safar <marek.safar@gmail.com>
4683 * ecore.cs: Removed unused expression.
4685 2008-04-22 Marek Safar <marek.safar@gmail.com>
4687 * expression.cs: Implemented NegateChecked and New expressions.
4689 2008-04-22 Marek Safar <marek.safar@gmail.com>
4691 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
4693 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
4696 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
4697 needing final 'ret' instruction.
4699 2008-04-22 Marek Safar <marek.safar@gmail.com>
4701 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
4703 2008-04-21 Marek Safar <marek.safar@gmail.com>
4705 * expression.cs: Emit ldnull and not null expression as an instance argument
4706 of static method expression calls.
4708 2008-04-21 Marek Safar <marek.safar@gmail.com>
4710 A fix for bug #378200
4711 * expression.cs: Fixed crash when creating parameterless expression tree
4714 2008-04-21 Marek Safar <marek.safar@gmail.com>
4716 A fix for bug #375297
4717 * anonymous.cs: Fixed crash when inferring from null argument anonymous
4720 2008-04-21 Marek Safar <marek.safar@gmail.com>
4722 A fix for bug #377596
4723 * decl.cs, class.cs: Emit delegate type argument attributes.
4725 2008-04-21 Marek Safar <marek.safar@gmail.com>
4727 A fix for bug #365314
4728 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
4730 2008-04-21 Marek Safar <marek.safar@gmail.com>
4732 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
4735 2008-04-21 Marek Safar <marek.safar@gmail.com>
4737 * generic.cs (TypeParameter): Removed redundant location.
4739 2008-04-19 Marek Safar <marek.safar@gmail.com>
4741 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
4742 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
4743 FullNamedExpression in all declaration type expression, statements will come
4746 2008-04-18 Marek Safar <marek.safar@gmail.com>
4748 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
4749 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
4751 2008-04-18 Marek Safar <marek.safar@gmail.com>
4753 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
4756 2008-04-17 Marek Safar <marek.safar@gmail.com>
4758 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
4761 2008-04-17 Marek Safar <marek.safar@gmail.com>
4763 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
4767 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
4769 Hook up 'EmitSideEffect'
4770 * constant.cs (Constant.EmitSideEffect): New.
4771 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
4772 (SideEffectConstant.EmitSideEffect): New.
4773 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
4774 unconditional branch in EmitBranchable.
4775 (FieldExpr.EmitBranchable): New.
4776 * expression.cs (Unary.EmitSideEffect): New.
4777 (Binary.EmitSideEffect): New.
4778 (VariableReference.EmitSideEffect): New. Do nothing.
4780 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
4782 Introduce 'EmitSideEffect'
4783 * ecore.cs (Expression.EmitSideEffect): New.
4784 (TypeCast): Rename from EmptyCast.
4786 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
4787 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
4788 * convert.cs, nullable.cs: Update to changes.
4790 2008-04-16 Marek Safar <marek.safar@gmail.com>
4792 * class.cs, cs-parser.jay: Early check for base types expression.
4794 2008-04-16 Marek Safar <marek.safar@gmail.com>
4796 * decl.cs (MemberName): Declare PrettyName as obsolete.
4798 2008-04-16 Marek Safar <marek.safar@gmail.com>
4800 * namespace.cs: Use MemberName comparison.
4802 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
4805 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
4807 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
4808 (MemberName.FullyQualifiedName): New. Provides the functionality
4809 that users assume FullName would have.
4810 * ecore.cs, namespace.cs: Update to changes.
4812 * statement.cs (Using.assign): Make into ExpressionStatement.
4813 (Using.EmitPreTryBody): Simplify.
4815 2008-04-16 Marek Safar <marek.safar@gmail.com>
4817 * report.cs: ColorFormat is protected.
4819 * rootcontext.cs: Unused fields clean-up.
4821 * namespace.cs: Made UsingEntry name private.
4823 2008-04-16 Marek Safar <marek.safar@gmail.com>
4825 * cs-tokenizer.cs, location.cs: Removed unused field.
4827 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
4828 Raja R Harinath <harinath@hurrynot.org>
4831 * constant.cs (SideEffectConstant.value): Rename from 'left'.
4832 (SideEffectConstant.side_effect): Rename from 'right'.
4833 (SideEffectConstant..ctor): Normalize 'side_effect'.
4834 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
4835 value of this constant.
4836 * cfold.cs: Update to changes.
4838 2008-04-15 Marek Safar <marek.safar@gmail.com>
4840 * cs-paser.jay: Removed unused variable.
4842 * driver.cs: Made Compile instance method.
4844 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
4846 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
4848 2008-04-15 Marek Safar <marek.safar@gmail.com>
4850 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
4852 2008-04-13 Jb Evain <jbevain@novell.com>
4854 * namespace.cs: update the System.Core fullname for 2.1
4855 * driver.cs: update the list of required assemblies for 2.1.
4856 Merged from the Moonlight 2 branch.
4858 2008-04-11 Marek Safar <marek.safar@gmail.com>
4860 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
4861 types and user defined operators. User operators arguments has to be checked
4862 for null value before invocation, which also means no operator is called
4863 when any argument is not convertible to unwrapped nullable type.
4865 2008-04-09 Marek Safar <marek.safar@gmail.com>
4867 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
4868 of Unary expressions to follow operator overloading rules precisely.
4869 Also fixes #321794, #323794
4871 2008-04-08 Marek Safar <marek.safar@gmail.com>
4873 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
4876 2008-04-08 Marek Safar <marek.safar@gmail.com>
4878 * expression.cs, ecore.cs: Implemented MemberInit expression.
4880 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
4882 Fix mono/tests/exception4.cs
4883 * statement.cs (ExceptionStatement, TryCatch): Revert to using
4884 ec.NeedReturnLabel () rather emitting a 'nop'.
4886 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
4888 (TryCatch.SomeCodeFollows): Likewise.
4889 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
4890 for 'break', 'continue' and 'return' statements inside a try.
4891 We're fairly sure that the generated IL stream will have more
4892 instructions textually following the try.
4893 (FlowBranchingTryCatch): Likewise.
4895 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
4896 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
4899 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
4900 wrapper -- forward everything to CollectionForeach.
4901 (CollectionForeach.NonDisposableWrapper): New.
4902 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
4903 instead of a pop + branch to end.
4905 2008-04-07 Marek Safar <marek.safar@gmail.com>
4907 A fix for bug #377485
4908 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
4909 Propagate location for extension method groups. Report conversion failure at
4912 2008-04-07 Marek Safar <marek.safar@gmail.com>
4914 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
4915 ListInit and Field expressions.
4917 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
4919 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
4920 Since $PC is always -1 inside the body of MoveNext, the fault
4922 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
4923 * statement.cs (ExceptionStatement.emit_finally): Likewise.
4924 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
4926 The denouement! Fix #324708
4927 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
4928 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
4929 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
4930 'finally' inside the finally clause.
4932 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
4933 inside an iterator. Don't emit the body of the 'finally' inside
4934 the finally clause yet.
4936 Use the ResumableStatement infrastructure for MoveNext ()
4937 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
4938 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
4939 'old_resume_points'. Move dispatcher upfront.
4940 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
4941 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
4942 in an enumerator. This encodes the main fix in this patch series
4943 -- we can only jump into the first instruction of a try from the
4944 outside, but we want to emit try/finally regions in iterators and
4945 resume in the middle of them.
4947 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
4949 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
4950 of NeedReturnLabel here.
4952 Introduce a common point for emitting try/finally to IL
4953 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
4954 features of the various subclasses, which are now driven by ...
4955 (ExceptionStatement.EmitPreTryBody): ... this and ...
4956 (ExceptionStatement.EmitTryBody): ... this and the original
4958 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
4959 Remove DoEmit and update to follow above protocol.
4961 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
4962 of the dispatcher are the same, skip emitting the 'switch'.
4963 * iterator.cs (Iterator.EmitDispose): Update to changes.
4965 Clean up handling of 'using' statement
4966 * statement.cs (UsingTemporary): New. Carved out of ...
4967 (Using): ... this. Simplify drastically. Handle exactly
4969 * cs-parser.jay (using_statement): Split. Create UsingTemporary
4970 or Using as appropriate. If there are multiple variable declared,
4971 create nested Using statements.
4972 (resource_acquisition): Kill.
4974 * statement.cs (ExceptionStatement.EmitForDispose): Use
4975 EmitFinallyBody, not EmitFinally.
4977 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
4978 * iterator.cs: Update to changes.
4980 Start using the ResumableStatement infrastructure
4981 * statement.cs (ResumeableStatement.PrepareForDispose): New.
4982 (ResumableStatement.EmitForDispose): New.
4983 (ExceptionStatement): Override them.
4984 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
4985 EmitForDispose to create the body of the Dispose method. Don't
4988 * iterator.cs (Iterator.AddResumePoint): Move here from ...
4989 * statement.cs (Toplevel.AddResumePoint): ... here.
4990 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
4991 * flowanalysis.cs (FlowBranchingIterator): New.
4992 * codegen.cs (EmitContext): Update to changes.
4994 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
4995 (Iterator.old_resume_points): Rename from 'resume_points'.
4996 (Iterator.MoveNextStatement): Remove unused class.
4998 New infrastructure for try/finally in iterators (still unused)
4999 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
5000 (FlowBranchingToplevel.AddResumePoint): Hook into
5001 ToplevelBlock.AddResumePoint.
5002 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
5003 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
5004 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
5005 resume points and assign program-counter values.
5006 (ExceptionBlock.AddResumePoint): Collect resume points for
5007 de-muxer at the top of try block.
5008 * iterators.cs (Yield.CheckContext): Simplify.
5009 (Yield.Resolve): Use FlowBranching.AddResumePoint.
5011 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
5013 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
5014 argument to an ExitStatement.
5015 (FlowBranchingException): Refactor saved origins code.
5016 * statement.cs (ExitStatement): Update to cahges.
5017 * iterator.cs (YieldBreak): Likewise.
5019 * statement.cs (ResumableStatement): New. Common base class for
5020 YieldReturn and ExceptionStatement.
5021 (ExitStatement): New. Common base class for Return and YieldBreak.
5022 (Return): Update to changes.
5023 * iterator.cs (YieldBreak): Likewise.
5024 * lambda.cs (ContextualReturn): Likewise.
5027 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
5028 emit a meaningful error message.
5030 Fix #324765, #319508
5031 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
5032 (VariableInfo.SetAssigned): Set it.
5033 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
5034 determine if CS0219 or CS0168 is appropriate. Don't use
5035 flow-analysis information.
5036 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
5037 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
5038 (EmitContext.EndFlowBranching): ... this.
5040 2008-04-03 Marek Safar <marek.safar@gmail.com>
5042 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
5044 2008-04-03 Marek Safar <marek.safar@gmail.com>
5046 A fix for bug #376508
5047 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
5048 ImplicitConversionExists.
5050 2008-04-03 Marek Safar <marek.safar@gmail.com>
5052 * expression.cs (Binary): Added remaining binary operators to expression
5055 * nullable.cs: Optimize shift with null argument.
5057 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
5059 Fix minor IL regression
5060 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
5061 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
5062 * cs-parser.jay (try_statement): Update to changes.
5064 * statement.cs (TryFinally.need_exc_block): Delete.
5065 (TryFinally): Update to changes.
5067 Now all ExceptionStatements are unconditional
5068 * statement.cs (CollectionForeach.DisposableWrapper): New.
5069 Extract out the try/finally code into a new wrapper.
5070 (CollectionForeach.Resolve): Use it to simplify the code.
5072 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
5074 Start at simplifying ExceptionStatement semantics a bit
5075 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
5076 * cs-parser.jay (try_statement): Update to changes.
5077 (opt_catch_clauses): Remove.
5078 * flowanalysis.cs: Update to changes.
5079 (FlowBranching.BranchingType.TryCatch): New.
5080 (FlowBranchingTryCatch): New.
5082 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
5083 (FlowBranching.CreateBranching): Update to changes.
5084 (FlowBranchingBlock.AddSibling): Add sanity check.
5085 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
5088 * iterators.cs (Iterator.MarkFinally): Remove.
5089 * statement.cs (ExceptionStatement): Update to changes.
5091 Add support for skipping over finally blocks at runtime. First
5092 in a series to fix #324708
5093 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
5094 (Iterator.EmitMoveNext): Initialize it.
5095 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
5096 branch over the body of the 'finally' clause.
5098 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
5100 Avoid lopsided use of Foo/DoFoo names
5101 * statement.cs (ExpressionStatement.EmitFinallyBody):
5102 Rename from EmitFinally.
5103 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
5104 * iterator.cs: Update to changes.
5106 2008-04-02 Marek Safar <marek.safar@gmail.com>
5108 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
5109 based on UserOperatorCall. More binary nullable operators clean up.
5111 2008-04-02 Martin Baulig <martin@ximian.com>
5113 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
5115 2008-04-02 Marek Safar <marek.safar@gmail.com>
5117 * nullable.cs: Merge user and empty conversions when lifting expression
5120 * expression.cs (StringConcat): Implemented expression tree representation.
5122 2008-04-01 Marek Safar <marek.safar@gmail.com>
5124 * nullable.cs: When lifting null literal and a user operator exists, no call
5127 2008-04-01 Marek Safar <marek.safar@gmail.com>
5129 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
5132 2008-04-01 Marek Safar <marek.safar@gmail.com>
5134 * nullable.cs, expression.cs: Use namespace instead heavily nested
5135 monster abstract class.
5137 2008-04-01 Marek Safar <marek.safar@gmail.com>
5139 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
5140 lifting of null literal and user operators. Clean up of some temporary
5143 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
5145 Fix #368224, test-629.cs
5146 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
5147 if it crossed an unwind-protect boundary.
5148 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
5149 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
5150 inside an unwind-protected region.
5151 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
5152 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
5153 'leave' instead of a 'br' if unwind-protected.
5154 (Iterator.EmitYieldBreak): Likewise.
5156 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
5158 * driver.cs: Only define versioninfo resources if no win32 resource
5161 2008-03-28 Marek Safar <marek.safar@gmail.com>
5163 A fix for bug #372375
5164 * convert.cs: Fixed boxing of nullable types.
5166 2008-03-28 Marek Safar <marek.safar@gmail.com>
5168 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
5171 2008-03-28 Marek Safar <marek.safar@gmail.com>
5173 A fix for bug #374619
5174 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
5176 2008-03-27 Marek Safar <marek.safar@gmail.com>
5178 * lambda.cs: Check return type only for invocation.
5180 2008-03-27 Marek Safar <marek.safar@gmail.com>
5182 A fix for bug #374214
5183 * ecore.cs: Correctly report argument type mismatch.
5185 2008-03-27 Marek Safar <marek.safar@gmail.com>
5187 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
5188 and not rely on broken IsEnum.
5190 2008-03-27 Marek Safar <marek.safar@gmail.com>
5192 * nullable.cs: New file, extracted from generic.cs.
5194 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
5196 2008-03-27 Marek Safar <marek.safar@gmail.com>
5198 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
5199 predefined comparison operators and null literals.
5201 * report.cs: New warning ID.
5203 2008-03-25 Marek Safar <marek.safar@gmail.com>
5205 A fix for bug #370577
5206 * lambda.cs: Check return type too.
5208 2008-03-25 Marek Safar <marek.safar@gmail.com>
5210 A fix for bug #372846
5211 * class.cs: Automatic properties can be declared as unsafe.
5213 2008-03-20 Marek Safar <marek.safar@gmail.com>
5215 * location.cs: Use string based concatenation.
5217 * expression.cs: LiftedBinaryOperator is gmcs only.
5219 2008-03-20 Marek Safar <marek.safar@gmail.com>
5221 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
5222 conversions rules and expression trees.
5224 2008-03-19 Marek Safar <marek.safar@gmail.com>
5226 * delegate.cs: Use extension method source as delegate target.
5228 2008-03-19 Marek Safar <marek.safar@gmail.com>
5230 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
5231 binary operations to be purely based on binary operations and optimized
5232 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
5233 and other ET refactoring.
5235 * typemanager.cs: Fixed warning.
5237 2008-03-17 Marek Safar <marek.safar@gmail.com>
5239 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
5241 * symbolwriter.cs: Fixed.
5243 2008-03-17 Marek Safar <marek.safar@gmail.com>
5245 * anonymous.cs, driver.cs: Reset anonymous types counters.
5247 2008-03-17 Marek Safar <marek.safar@gmail.com>
5249 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
5251 * class.cs: Use fullname for all type member definitions.
5253 2008-02-19 Martin Baulig <martin@ximian.com>
5256 (IMethodData.EmitExtraSymbolInfo): New interface method.
5257 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
5258 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
5259 interface method here as an empty public virtual method.
5262 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
5263 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
5264 CodeGen.SymbolWriter.SetRealMethodName().
5266 2008-02-18 Martin Baulig <martin@ximian.com>
5269 (ScopeInfo.EmitType): Override this and emit debugging
5270 information for captured variables.
5271 (RootScopeInfo.EmitType): Override this and emit symbol
5272 information for a captured `this'.
5274 2008-02-15 Martin Baulig <martin@ximian.com>
5276 * iterators.cs: Emit debugging info.
5279 (EmitContext.Flags): Add `OmitDebuggingInfo'.
5280 (EmitContext.OmitDebuggingInfo): New public property.
5283 (While): Override Emit() and don't emit symbol info there; do it
5284 inside DoEmit() instead.
5285 (Block.Emit): Omit symbol information while emitting the scope
5286 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
5288 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
5289 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
5290 .ctor to make `IsIterator' work.
5292 2008-03-14 Martin Baulig <martin@ximian.com>
5294 * symbolwriter.cs: Added the new symbol writer function from the
5295 debugger's `terrania' branch; temporarily enclose them inside
5296 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
5299 2008-03-14 Martin Baulig <martin@ximian.com>
5302 (SymbolWriter): Make this a public static class.
5305 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
5306 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
5308 2008-03-14 Marek Safar <marek.safar@gmail.com>
5310 A fix for bug #370577
5311 * statement.cs, lambda.cs: Added extra limitations when dealing with void
5314 2008-03-14 Marek Safar <marek.safar@gmail.com>
5316 * typemanager.cs (CSharpName): Made 250 times faster.
5318 2008-03-13 Marek Safar <marek.safar@gmail.com>
5320 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
5322 2008-03-12 Marek Safar <marek.safar@gmail.com>
5324 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
5325 crash when predefined field does not exist.
5327 2008-03-12 Marek Safar <marek.safar@gmail.com>
5329 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
5331 2008-03-12 Marek Safar <marek.safar@gmail.com>
5333 * class.cs (FixedField): Don't crash when contructors are missing.
5335 2008-03-11 Marek Safar <marek.safar@gmail.com>
5337 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
5338 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
5339 check internal types accessibility for internal and external types.
5340 Replaced EnumToUnderlying by GetEnumUnderlyingType.
5342 2008-03-11 Marek Safar <marek.safar@gmail.com>
5344 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
5345 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
5346 attribute.cs, statement: Use corect instance of predefined types (work
5347 related to #364674).
5349 2008-03-07 Marek Safar <marek.safar@gmail.com>
5351 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
5353 2008-03-07 Marek Safar <marek.safar@gmail.com>
5355 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
5356 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
5357 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
5358 predefined types clean up, delayed predefined types members initialization
5359 (work related to #364674).
5361 2008-03-05 Marek Safar <marek.safar@gmail.com>
5363 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
5365 2008-03-05 Marek Safar <marek.safar@gmail.com>
5367 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
5368 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
5369 predefined types clean up (work related to #364674).
5371 2008-03-04 Marek Safar <marek.safar@gmail.com>
5373 * ecore.cs: Print an error message instead of throwing exception.
5375 2008-03-04 Marek Safar <marek.safar@gmail.com>
5377 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
5378 expression.cs, statement.cs: Unififed null literal representation.
5380 2008-03-03 Marek Safar <marek.safar@gmail.com>
5382 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
5383 expression.cs: Refactored binary operators resolve phase and improved speed.
5384 The nullable code is still missing and won't work correctly, more fixes
5387 It also fixes #323726, #324312, #324248, and many other unreported issues.
5389 2008-02-29 Zoltan Varga <vargaz@gmail.com>
5391 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
5394 2008-02-27 Marek Safar <marek.safar@gmail.com>
5396 * ecore.cs: Clean-up and split BetterConversion.
5398 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
5401 * enum.cs (EnumMember.Value): Only access 'value' if
5402 ResolveValue says it's ok.
5403 (EnumMember.DoResolveValue): Don't set prev_member.value.
5404 (Enum.GetDefinition): Reverse arguments of Equals --
5405 EnumMember.Value can return 'null'.
5407 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
5409 2008-02-22 Marek Safar <marek.safar@gmail.com>
5411 * generic.cs, expression.cs: More ongoing work on expression trees.
5413 2008-02-21 Marek Safar <marek.safar@gmail.com>
5415 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
5416 handle missing matches when mutiple operators exist.
5418 2008-02-20 Marek Safar <marek.safar@gmail.com>
5420 A fix for bug #363218
5421 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
5424 2008-02-20 Marek Safar <marek.safar@gmail.com>
5426 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
5427 update. This time to deal correctly with SideEffectConstant expression used
5428 as an argument for another constant folding.
5430 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
5432 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
5435 2008-02-19 Marek Safar <marek.safar@gmail.com>
5437 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
5439 2008-02-19 Marek Safar <marek.safar@gmail.com>
5441 A fix for bug #328136
5442 * expression.cs: Do not fold immediately LogicalAnd operators when the left
5443 side is a false constant, because we still need to evaluate the right-hand
5446 * statement.cs (If): Emit two types of boolean constants (simple constant,
5447 side-effect constant).
5449 2008-02-19 Marek Safar <marek.safar@gmail.com>
5451 * constant.cs (SideEffectConstant): Don't emit boolean constant.
5453 * expression.cs: Fold immediately LogicalAnd operators when both sides are
5456 2008-02-18 Marek Safar <marek.safar@gmail.com>
5458 A fix for bug #361457
5459 * ecore.cs (IsApplicable): Params methods have lower priority.
5461 * support.cs: Return correct parameter modifier for params types.
5463 2008-02-18 Marek Safar <marek.safar@gmail.com>
5465 * generic.cs (TypeParameter): Cache attribute target name.
5467 * support.cs: Removed unused variable.
5469 * typemanager.cs: Removed debugging leftover.
5471 * ecore.cs: Use local type instead of a property;
5473 * class.cs (VerifyMembers): Consider also parent to test whether type member
5476 * expression.cs (FullMethodDesc): Removed.
5478 * attribute.cs (IsValidArgumentType): Made static.
5480 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
5482 Cleanup to be more readable.
5483 * Makefile (GMCS_PROFILE): Remove.
5484 (COMPILER_NAME): New helper.
5486 2008-02-15 Miguel de Icaza <miguel@novell.com>
5488 * cs-tokenizer.cs: if a conditional expression happens inside a
5489 (...) this also means that we do not need to de-ambiguate between
5490 an parenthesized expression and a cast.
5494 * constant.cs (SideEffectConstant): a constant value that happens
5495 to have a side effect.
5497 Fixes the build regressions introduced by the fix for #359789
5499 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
5501 * expression.cs (Conditional.Emit): when emitting the ternary
5502 operator, use local variables to generate code verifiable code.
5504 The verifier cannot infer that the type on stack before the
5505 stloc.0 is executed is of type ParentB. This happens because the
5506 stack merge algorithm uses only parent types when deciding which
5507 is the common type. This is described in Part III 1.8.1.3 of ECMA
5510 This code compiled with mcs is not verifiable under MS. The MS
5511 verifier picks the first common interface of Foo and Bar, which is
5512 wrong, but doesn't use a full join type of the 2 interfaces.
5514 CSC uses a clever hack to compile such code in a verifiable
5515 way. It stores the intermediate values in a local variable with
5520 2008-02-14 Miguel de Icaza <miguel@novell.com>
5522 * expression.cs: Do not fold BitwiseAnd operators when the left
5523 side is a false constant, because we still need to evaluate the
5528 * support.cs: Instead of throwing an InternalErrorException when
5529 the position of the stream is outside the boundary of our buffer,
5530 reset the state of the reader, and restart the reading from the
5531 beginning of the file.
5533 2008-02-14 Marek Safar <marek.safar@gmail.com>
5535 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
5537 2008-02-14 Marek Safar <marek.safar@gmail.com>
5539 A fix for bug #361686
5540 * decl.cs: A protected types used inside a private class which parents
5541 derives from the protected class are accessible.
5543 2008-02-13 Marek Safar <marek.safar@gmail.com>
5545 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
5546 the parameterless constructor.
5548 2008-02-13 Marek Safar <marek.safar@gmail.com>
5550 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
5551 lookup methods to use standard member cache when doing member lookup.
5553 2008-02-12 Marek Safar <marek.safar@gmail.com>
5555 * driver.cs: Don't report full path for referenced module as assembly error.
5557 2008-02-12 Marek Safar <marek.safar@gmail.com>
5559 * Makefile: Fixed `qh' target to work on all machines.
5561 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
5562 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
5563 and HasElementType with TypeManager implementation.
5565 2008-02-08 Marek Safar <marek.safar@gmail.com>
5567 A fix for bugs #325134, #359749
5568 * expression.cs, ecore.cs: Try to resolve an extension method even if the
5569 first binds point to non-method member expression.
5571 2008-02-08 Marek Safar <marek.safar@gmail.com>
5573 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
5575 2008-02-08 Marek Safar <marek.safar@gmail.com>
5577 A fix for bugs #321394, #323028
5578 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
5579 Reworked naive IsAccessibleAs implementation to handle nested types.
5581 2008-02-05 Jb Evain <jbevain@novell.com>
5583 * class.cs: use generic type comparison for parameters
5586 2008-02-05 Marek Safar <marek.safar@gmail.com>
5588 A fix for bug #325372
5589 * class.cs: Use generic type comparison when testing method signatures.
5591 2008-02-05 Marek Safar <marek.safar@gmail.com>
5593 A fix for bug #357047
5594 * ecore.cs: Applied C# 3.0 changes to better conversion.
5596 2008-02-05 Marek Safar <marek.safar@gmail.com>
5598 A fix for bug #358374
5599 * cs-parser.jay: Correctly set modifiers for all constructor types.
5601 2008-02-04 Marek Safar <marek.safar@gmail.com>
5603 A fix for bug #355251
5604 * generic.cs: Added base class constraint based type inference.
5606 2008-02-01 Marek Safar <marek.safar@gmail.com>
5608 A fix for bug #357255
5609 * decl.cs: One more missing visibility check.
5611 2008-02-01 Marek Safar <marek.safar@gmail.com>
5613 * support.cs: Fixed broken return.
5615 2008-01-25 Marek Safar <marek.safar@gmail.com>
5617 * report.cs: Correctly reset warnings count after probing.
5619 2008-01-25 Martin Baulig <martin@ximian.com>
5622 (NamespaceEntry.SymbolFileID): Make this work again after
5623 MemberName.ToString() is gone.
5625 2008-01-25 Marek Safar <marek.safar@gmail.com>
5627 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
5630 2008-01-25 Marek Safar <marek.safar@gmail.com>
5632 * generic.cs: Use full implicit conversion for type inference fixing.
5634 2008-01-24 Marek Safar <marek.safar@gmail.com>
5636 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
5637 Fixed user operator conversions.
5639 2008-01-24 Marek Safar <marek.safar@gmail.com>
5641 * generic.cs: Do nullable type to null comparison optimization during
5644 2008-01-24 Marek Safar <marek.safar@gmail.com>
5646 A fix for bug #355163
5647 * generic.cs: Enabled l-value resolve on nullable expressions.
5649 2008-01-24 Marek Safar <marek.safar@gmail.com>
5651 A fix for bug #353986
5652 * class.cs: Ingore static ctors with parameters for any further checks.
5654 2008-01-24 Marek Safar <marek.safar@gmail.com>
5656 A fix for bug #354310
5657 * namespace.cs: Removed redundant check.
5659 2008-01-24 Marek Safar <marek.safar@gmail.com>
5661 A fix for bug #354928
5662 * expression.cs: ElementInitializers can be resolved only once.
5664 2008-01-24 Marek Safar <marek.safar@gmail.com>
5666 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
5667 Condition expressions.
5669 2008-01-23 Marek Safar <marek.safar@gmail.com>
5671 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
5673 2008-01-22 Marek Safar <marek.safar@gmail.com>
5675 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
5678 * generic.cs: Implemented coalesce expression.
5680 2008-01-22 Marek Safar <marek.safar@gmail.com>
5682 A fix for bug #355145
5683 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
5684 expression tree type inference.
5686 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
5689 * expression.cs (Binary.IsUnsignedType): Fix typo.
5691 2008-01-22 Marek Safar <marek.safar@gmail.com>
5693 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
5695 2008-01-22 Marek Safar <marek.safar@gmail.com>
5697 A fix for bug #355161
5698 * ecore.cs, expression.cs: Wider range of extension method supported
5701 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
5703 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
5704 AssemblyBuilder to operate in compiler context. Fixes mcs part of
5707 2008-01-22 Marek Safar <marek.safar@gmail.com>
5709 A fix for bug #355148
5710 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
5712 2008-01-22 Miguel de Icaza <miguel@novell.com>
5714 * expression.cs (CreateExpressionTree): Add support for or and
5715 logical or, and indent following the coding conventions.
5717 * typemanager.cs (LinqExpression): renamed from
5718 ExpressionTreeManager, for a shorter name.
5720 Use TypeManager.CoreLookupType to lookup types from our core
5721 assemblies and turn those into "Type" variables.
5723 Consumers that previously used "Namespace" and "Type" from this
5724 class should instead use the TypeExpression which is a type that
5725 is fully resolved (without involving the regular C# resolution
5728 This typically looks like this:
5730 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
5731 new MemberAccess (texpr, name, type_arguments, loc)
5733 This avoids the problem in: #355178
5735 2008-01-21 Marek Safar <marek.safar@gmail.com>
5737 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
5738 feature in parser only as we do in other cases.
5740 2008-01-21 Marek Safar <marek.safar@gmail.com>
5742 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
5743 typemanager.cs: A refactoring of params arguments to reuse existing
5744 expressions (params -> array initializer) to emit params argument instead
5745 of specialized handling.
5746 It was required by expression tree implementation and it has other benefits
5747 as well, we now apply same optimization for params arguments as we do for
5750 2008-01-18 Marek Safar <marek.safar@gmail.com>
5752 A fix for bug #353526
5753 * generic.cs: A type inference of params arguments may not required any
5754 temporary array creation.
5756 2008-01-18 Marek Safar <marek.safar@gmail.com>
5758 A fix for bug #353534
5759 * generic.cs, ecore.cs, expression.cs: A method group type inference is
5760 supported for delegates only.
5762 2008-01-18 Marek Safar <marek.safar@gmail.com>
5764 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
5765 type for more than 1 candidates.
5767 2008-01-18 Marek Safar <marek.safar@gmail.com>
5769 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
5772 2008-01-16 Marek Safar <marek.safar@gmail.com>
5774 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
5775 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
5776 operator) expressions.
5778 2008-01-16 Zoltan Varga <vargaz@gmail.com>
5780 * statement.cs: Avoid declaring an IL variable for this_variable since it is
5781 not accessed from the generated IL.
5783 2008-01-14 Marek Safar <marek.safar@gmail.com>
5785 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
5786 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
5787 statement.cs: The first expression tree implementation drop, mostly
5788 infrastructure work.
5790 2008-01-14 Marek Safar <marek.safar@gmail.com>
5792 * ecore.cs (IsNestedChild): Refactored.
5794 2008-01-11 Marek Safar <marek.safar@gmail.com>
5796 * lambda.cs: Don't use a cast on unknown expression statement.
5798 2008-01-10 Geoff Norton <gnorton@novell.com>
5800 * cs-tokenizer.cs: One more token to distinguish between method and lambda
5803 2008-01-09 Marek Safar <marek.safar@gmail.com>
5805 * doc.cs: Report better /doc crash details.
5807 2008-01-09 Marek Safar <marek.safar@gmail.com>
5809 A fix for bug #352536
5810 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
5812 2008-01-08 Marek Safar <marek.safar@gmail.com>
5814 A fix for bug #352287
5815 * ecore.cs, expression.cs: Do `this' access checking in all member access
5818 2008-01-08 Marek Safar <marek.safar@gmail.com>
5820 * rootcontext.cs, driver.cs: Switch to linq mode by default.
5822 * report.cs: Reset message stacks.
5824 2008-01-08 Marek Safar <marek.safar@gmail.com>
5826 * generic.cs (InferInPhases): Correctly calculate params position.
5828 2008-01-08 Marek Safar <marek.safar@gmail.com>
5830 * cs-tokenizer.cs: No need to parse full string when parsing lambda
5833 2008-01-07 Marek Safar <marek.safar@gmail.com>
5835 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
5837 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
5839 * driver.cs: Updated --help option.
5841 2008-01-07 Marek Safar <marek.safar@gmail.com>
5843 * generic.cs (InferParamsTypeArguments): Removed.
5844 (InferInPhases): Add params type inference.
5845 (LowerBoundInference): Fixed scoring mechanism.
5847 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
5849 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
5851 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
5852 byte array for unsigned "baked" assemblies.
5854 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
5856 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
5857 array for assemblies that are not strongnamed.
5859 2008-01-04 Marek Safar <marek.safar@gmail.com>
5861 A fix for bug #351481
5862 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
5863 declaring type for nested generic types.
5865 2008-01-04 Marek Safar <marek.safar@gmail.com>
5867 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
5868 instead of ToString.
5870 2008-01-03 Marek Safar <marek.safar@gmail.com>
5872 A fix for bug #351047
5873 * expression.cs (Binary.ResolveOperator): Allow equality operators between
5874 null and structs only when equality and inequality operators are defined
5875 either as an user-operators or predefined operators.
5877 2008-01-03 Marek Safar <marek.safar@gmail.com>
5879 A fix for bug #351047
5880 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
5882 2008-01-03 Marek Safar <marek.safar@gmail.com>
5884 A fix for bug #351257
5885 * cs-tokenizer.cs: Advance line number for '\r' correctly.
5887 2008-01-03 Marek Safar <marek.safar@gmail.com>
5889 A fix for bug #351157
5890 * class.cs (Using): Fixed yet another broken cloning.
5892 (Block): Put back more sensible default value for statements.
5894 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
5896 * codegen.cs: Allow AssemblyVersion with only major version component.
5899 2007-12-29 Marek Safar <marek.safar@gmail.com>
5901 A fix for bug #324654
5902 * class.cs: Use FullName property as member name.
5904 2007-12-28 Marek Safar <marek.safar@gmail.com>
5906 A fix for bug #342117
5907 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
5908 constructor constraint.
5910 2007-12-28 Marek Safar <marek.safar@gmail.com>
5912 A fix for bug #338273
5913 * class.cs (ProbertyBase): Access modifier checks are required for overrides
5916 2007-12-28 Marek Safar <marek.safar@gmail.com>
5918 A fix for bug #350839
5919 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
5921 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
5923 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
5926 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
5928 * statement.cs: Changed some Hashtables to use HybridDictionaries
5929 instead. It was observed that some HashTables only contained a few
5930 items in the vast majority of cases. Since HybridDictionary is
5931 more efficient on small sets (<10 elements), "known_variables"
5932 from class ExplicitBlock as well as "labels" and "constants " from
5933 class Block were changed to HybridDictionaries.
5935 Atsai results: (56216kb->54987kb)
5937 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
5940 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
5942 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
5945 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
5947 * expression.cs: foreach loop to for loop, saved on allocation of
5948 enumerator (59333kb->59141kb)
5950 * statement.cs. Changed foreach loops to for loops, saved on
5951 allocation of enumerator (59141kb->59006kb)
5953 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
5954 when constructed with no specified capacity. This was causing a
5955 few ArrayLists to allocate more memory than they would potentially
5956 need in the Block class and MemberCache class. Setting the
5957 ArrayLists to construct with a capacity of 1 saves some
5958 memory. (56216kb->55585kb)
5960 2007-12-27 Marek Safar <marek.safar@gmail.com>
5962 A fix for bug #347189 (2nd issue)
5963 * expression.cs (MemberAccess): Nested type can be found in base non-generic
5966 2007-12-27 Miguel de Icaza <miguel@novell.com>
5968 * report.cs: Do not use colors if stdout and stderr are not a
5971 2007-12-27 Marek Safar <marek.safar@gmail.com>
5973 A fix for bug #346998
5974 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
5977 2007-12-27 Marek Safar <marek.safar@gmail.com>
5979 A fix for bug #343465
5980 * class.cs: Explicit method name for nested types uses dots only.
5982 2007-12-27 Marek Safar <marek.safar@gmail.com>
5984 A fix for bug #343707
5985 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
5987 2007-12-27 Marek Safar <marek.safar@gmail.com>
5989 * ecore.cs: Report type inference errors only when arguments count matches
5992 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
5994 * expression.cs, report.cs: New warning.
5996 * typemanager.cs: Catch anonymous method type too.
5998 2007-12-23 Marek Safar <marek.safar@gmail.com>
6000 A fix for bug #346379
6001 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
6003 2007-12-23 Marek Safar <marek.safar@gmail.com>
6005 A fix for bug #347359
6006 * expression.cs (Invocation): Don't resolve already resolved expression.
6008 2007-12-23 Marek Safar <marek.safar@gmail.com>
6010 A fix for bug #347189
6011 * class.cs (FixedField): Use non-dependent code only in the define phase.
6013 2007-12-23 Marek Safar <marek.safar@gmail.com>
6015 A fix for bug #348076
6016 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
6018 2007-12-22 Marek Safar <marek.safar@gmail.com>
6020 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
6021 discovered extension methods.
6023 2007-12-22 Marek Safar <marek.safar@gmail.com>
6025 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
6028 2007-12-21 Miguel de Icaza <miguel@novell.com>
6030 * report.cs (ErrorMessage): Add support for using colors on
6031 terminals that support it.
6033 2007-12-21 Marek Safar <marek.safar@gmail.com>
6035 * ecore.cs: Use information about expanded params for error reporting.
6037 2007-12-21 Marek Safar <marek.safar@gmail.com>
6039 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
6040 and logic for params overloads.
6042 2007-12-15 Miguel de Icaza <miguel@novell.com>
6044 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
6045 as this is also created from the parser. Fixes #349034
6047 2007-12-12 Miguel de Icaza <miguel@novell.com>
6049 * statement.cs (Throw.CloneTo): it is valid to have empty
6050 expressions for throw.
6052 2007-12-03 Marek Safar <marek.safar@gmail.com>
6054 * cs-parser.jay: Set delegate constraint parsing region correctly.
6056 2007-12-03 Marek Safar <marek.safar@gmail.com>
6058 A fix for bug #345467
6059 * typemanager.cs (IsEqual): Compare generic parameters position only.
6061 2007-11-28 Marek Safar <marek.safar@gmail.com>
6063 * expression.cs (BaseAccess): Type arguments can be null.
6065 2007-11-27 Raja R Harinath <harinath@gmail.com>
6067 * statement.cs (Block.Resolve): Ensure flow-branching tree is
6068 consistent even when an error has occured.
6069 (Switch.Resolve): Likewise.
6071 2007-11-22 Marek Safar <marek.safar@gmail.com>
6073 A fix for bug #334505
6074 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
6077 2007-11-22 Marek Safar <marek.safar@gmail.com>
6079 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
6080 refactorings required to resolve extension methods correctly when mixing
6081 generics and non-generics members.
6083 2007-11-20 Marek Safar <marek.safar@gmail.com>
6085 A fix for bug #342584
6086 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
6089 2007-11-19 Marek Safar <marek.safar@gmail.com>
6091 A fix for bug #342512
6092 * delegate.cs: Use delegate argument expression when is available. Don't
6093 emit virtual call when class is sealed.
6095 2007-11-16 Marek Safar <marek.safar@gmail.com>
6097 A fix for bug #325423
6098 * assign.cs (FieldInitializer): Use resolved expression for emit.
6100 * class.cs: Print less confusing error message.
6102 2007-11-16 Marek Safar <marek.safar@gmail.com>
6104 * cs-tokenizer.cs: Removed GMCS ifdefs.
6106 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
6109 * cs-parser.jay: Disabled nullable check.
6111 * generic-mcs: Copied more generic stuff.
6113 2007-11-16 Marek Safar <marek.safar@gmail.com>
6115 * gcs-parser.jay: Merged to cs-parser.jay.
6117 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
6118 * *.csproj, *.sources: Updated to use only jay parser file.
6120 2007-11-16 Marek Safar <marek.safar@gmail.com>
6122 * gcs-parser.jay: Added nullable and default expression feature checks.
6124 2007-11-16 Marek Safar <marek.safar@gmail.com>
6126 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
6127 it fixes many TODOs and hidden bugs.
6129 * expression: Removed duplicate error check.
6131 2007-11-15 Marek Safar <marek.safar@gmail.com>
6133 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
6134 implicitly type local variable only when it is used in a declaration.
6136 2007-11-15 Marek Safar <marek.safar@gmail.com>
6138 * attribute.cs: Use CS0612 for empty strings.
6140 2007-11-14 Marek Safar <marek.safar@gmail.com>
6142 * lambda.cs, statement.cs: Contextual return may act as a statement.
6144 2007-11-14 Marek Safar <marek.safar@gmail.com>
6146 A fix for a regression cause by #324222
6147 * class.cs: Don't report unused even when it implements an interface.
6149 2007-11-13 Marek Safar <marek.safar@gmail.com>
6151 A fix for bug #341205
6152 * ecore.cs, expression.cs: Method group expression cannot do static
6153 method access with an instance reference check before overloading takes
6156 2007-11-13 Marek Safar <marek.safar@gmail.com>
6158 A fix for bug #325359
6159 * class.cs: Use predictable name for automatically generated property.
6161 2007-11-12 Marek Safar <marek.safar@gmail.com>
6163 A fix for bug #324996
6164 * expression.cs (Is): Handle case where D is nullable and T is not
6167 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
6169 2007-11-12 Marek Safar <marek.safar@gmail.com>
6171 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
6172 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
6173 Flush small error reporting changes.
6175 2007-11-09 Marek Safar <marek.safar@gmail.com>
6177 A fix for bug #324996
6178 * expression.cs: Rewrote Is expression implementation to work with
6179 generics, nullable types, anonymous method. A const result expression
6180 uses existing infrastructure instead of custom not fully-featured one.
6182 2007-11-08 Marek Safar <marek.safar@gmail.com>
6184 A fix for bug #340202
6185 * class.cs: Consider generics for volatile field.
6187 2007-11-08 Marek Safar <marek.safar@gmail.com>
6189 A fix for bug #335594
6190 * expression.cs: Use conversion rules when handling string addition.
6192 2007-11-07 Marek Safar <marek.safar@gmail.com>
6194 A fix for bug #336651
6195 * expression.cs: Fixed a crash when probing is on.
6197 2007-11-07 Marek Safar <marek.safar@gmail.com>
6199 A fix for bug #324242
6200 * covert.cs: Added a conversion from any nullable-type with an
6201 underlying enum-type to the type System.Enum.
6203 2007-11-07 Marek Safar <marek.safar@gmail.com>
6205 A fix for bug #324222
6206 * class.cs: Report all non-used event fields.
6208 2007-11-07 Marek Safar <marek.safar@gmail.com>
6210 A fix for bug #325161
6211 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
6212 qualifier for generic types.
6214 2007-11-07 Marek Safar <marek.safar@gmail.com>
6216 A fix for bug #322971
6217 * expression.cs, ecore.cs: Added intermediate result value check for
6220 2007-11-07 Marek Safar <marek.safar@gmail.com>
6222 A fix for bug #324754
6223 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
6224 when it was requested.
6226 2007-11-07 Marek Safar <marek.safar@gmail.com>
6228 A fix for bug #325101
6229 * expression.cs: Do type not value comparison for `is' expression.
6231 2007-11-07 Marek Safar <marek.safar@gmail.com>
6233 A fix for bug #320236
6234 * convert.cs: Don't apply user conversion on underlying target type.
6236 2007-11-06 Marek Safar <marek.safar@gmail.com>
6238 * expression.cs: Don't use unresolved expression for error reporting.
6240 2007-11-06 Marek Safar <marek.safar@gmail.com>
6242 A fix for bugs #337712, #324490
6243 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
6244 overloading resolution too.
6246 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
6247 the process consistent and more robust.
6249 * expression.cs, linq.cs, report.cs: Update.
6251 2007-11-02 Marek Safar <marek.safar@gmail.com>
6253 A fix for bug #332909
6254 * attribute.cs: Resolve attributes in correct context using error
6257 * rootcontext.cs: Define Obsolete attribute members as core members.
6259 2007-11-02 Marek Safar <marek.safar@gmail.com>
6261 * statement.cs: Removed unused methods.
6263 2007-10-31 Wade Berrier <wberrier@novell.com>
6265 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
6266 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
6269 2007-10-31 Marek Safar <marek.safar@gmail.com>
6271 A fix for bug #338102
6272 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
6273 methods registered as non-generics.
6275 2007-10-31 Marek Safar <marek.safar@gmail.com>
6277 A fix for bugs #337712, #324490
6278 * delegate.cs: Delegate covariance and contravariance is not allowed for
6281 2007-10-31 Marek Safar <marek.safar@gmail.com>
6283 A fix for bug #337719
6284 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
6287 2007-10-30 Marek Safar <marek.safar@gmail.com>
6289 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
6291 2007-10-29 Marek Safar <marek.safar@gmail.com>
6293 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
6296 2007-10-29 Raja R Harinath <rharinath@novell.com>
6298 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
6300 2007-10-29 Marek Safar <marek.safar@gmail.com>
6302 A fix for bug #334652
6303 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
6304 extension methods when we have not found the best candidate in normal
6307 2007-10-27 Marek Safar <marek.safar@gmail.com>
6309 * AssemblyInfo.cs: Keep up-to-date.
6311 2007-10-27 Marek Safar <marek.safar@gmail.com>
6313 * Makefile: Fixed generics compiler name.
6315 2007-10-27 Marek Safar <marek.safar@gmail.com>
6317 * lambda.test: removed, lambda parsing is done differently.
6319 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
6321 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
6323 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
6325 2007-10-27 Marek Safar <marek.safar@gmail.com>
6327 * Makefile, *.sources : All C# compilers are in mcs folder.
6329 * *.cs: Use existing 2_1 define for smcs.
6331 2007-10-26 Marek Safar <marek.safar@gmail.com>
6333 A fix for bug #335847
6334 * assign.cs, expression.cs: Couple of changes to avoid creating a
6335 temporary variable for each object initializer assignment statement. It
6336 simplifies struct initialization too, otherwise two temporary variables
6338 Implemented optimization of redundant default element initializers.
6340 2007-10-25 Marek Safar <marek.safar@gmail.com>
6342 A fix for bug #336766
6343 * expression.cs (Class.CheckBase): Use generic name when method is
6346 2007-10-25 Marek Safar <marek.safar@gmail.com>
6348 A fix for bug #334737
6349 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
6350 variable and not variable argument for prepared copies.
6352 2007-10-24 Marek Safar <marek.safar@gmail.com>
6354 A fix for bug #325110
6355 * class.cs, expression.cs, attribute.cs: Use open generic method when
6356 checking conditional attribute.
6358 2007-10-24 Marek Safar <marek.safar@gmail.com>
6360 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
6361 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
6362 FeatureIsNotAvailable.
6364 2007-10-24 Marek Safar <marek.safar@gmail.com>
6366 ** C# 3.0 Partial methods
6368 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
6369 methods support. Because of member cache issue with generics only
6370 non-generics partial methods are fully supported.
6372 2007-10-23 Marek Safar <marek.safar@gmail.com>
6374 * class.cs, decl.cs: Rewrote member overloads check to cope with
6375 generics and to use member cache for member checking. It also improves
6376 performance and fixes remaining overloads issues.
6378 2007-10-20 Marek Safar <marek.safar@gmail.com>
6380 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
6381 roottypes.cs, typemanager.cs:
6383 A member cache creation logic changed to add members immediately and
6384 not rely on fallback. The member cache is now only prefered way
6385 how to access and find type declaration members. It saves 5 MB of memory
6386 during MWF compilation and makes code ready for more optimizations and
6387 clean-ups, it's also a pre-requirement for partial methods.
6389 2007-10-18 Raja R Harinath <harinath@gmail.com>
6391 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
6392 handling for generic parameters.
6394 2007-10-15 Marek Safar <marek.safar@gmail.com>
6396 * class.cs (FixedField): Removed redundant volatile check.
6398 2007-10-15 Marek Safar <marek.safar@gmail.com>
6400 * class.cs, decl.cs: Fixed overload members verification to do only one
6401 check per possible collision.
6403 2007-10-13 Marek Safar <marek.safar@gmail.com>
6405 A fix for bug #325478
6406 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
6407 and create only one disposable flags container.
6409 2007-10-12 Marek Safar <marek.safar@gmail.com>
6411 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
6412 * statement.cs (Fixed): Fixed variables cloning.
6414 2007-10-12 Marek Safar <marek.safar@gmail.com>
6416 A fix for bug #333342
6417 * class.cs (EventField): Don't mark value type event as synchronized.
6419 2007-10-12 Marek Safar <marek.safar@gmail.com>
6421 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
6422 inference to identify best candidate method correctly.
6423 (ProperyExpr): A range variable is read only and cannot be modified.
6425 2007-10-11 Marek Safar <marek.safar@gmail.com>
6427 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
6428 logic to identify best candidate method correctly.
6430 2007-10-11 Marek Safar <marek.safar@gmail.com>
6432 * location.cs (Equals, GetHashCode): Removed.
6434 2007-10-11 Marek Safar <marek.safar@gmail.com>
6436 * report.cs: Implemented message recorder. It is used mainly for lambda
6437 expressions to capture otherwise swallowed error messages.
6439 * anonymous.cs, lambda.cs.cs: Do full parameters check.
6441 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
6443 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
6445 * expression.cs (MemberAccess): Always report lookup failure.
6447 * location.cs: Implemented Equals, GetHashCode.
6449 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
6451 2007-10-10 Jb Evain <jbevain@novell.com>
6453 * codegen.cs: re-enable assembly version check.
6455 2007-10-09 Marek Safar <marek.safar@gmail.com>
6457 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
6460 * namespace.cs (UsingAlias): Do correct version check.
6462 2007-10-08 Marek Safar <marek.safar@gmail.com>
6464 * expresison.cs, ecore.cs: Issue extension method error message when
6467 * rootcontext.cs: Added ISO_2 compiler mode option.
6469 2007-10-08 Marek Safar <marek.safar@gmail.com>
6471 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
6474 2007-10-08 Marek Safar <marek.safar@gmail.com>
6476 * attribute.cs (GetString, GetBoolean): Work with both literal and
6479 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
6480 Moved method overload specific methods to MethodGroupExpr.
6482 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
6483 it should be less memory consuming.
6485 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
6487 * codegen.cs: remove the assembly version check until the buildbot is
6490 2007-10-07 Jb Evain <jbevain@novell.com>
6492 * attribute.cs (Attribute.GetString): if the value
6493 expression is a StringConstant, return its string value.
6495 2007-10-07 Jb Evain <jbevain@novell.com>
6497 * typemanager.cs: add `assembly_version_attribute_type`.
6498 * codegen.cs: on attribute emission, check that the
6499 AssemblyVersionAttribute doesn't overflow.
6501 2007-10-05 Marek Safar <marek.safar@gmail.com>
6503 A fix for bug #324677
6504 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
6505 parent container of a scope container with currently resolved one.
6507 2007-10-05 Marek Safar <marek.safar@gmail.com>
6509 A fix for bug #325534
6510 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
6513 2007-10-05 Marek Safar <marek.safar@gmail.com>
6515 A fix for bug #327504
6516 * class.cs (Operator.Define): Refactored implicit and explicit user
6517 operator conversion rules.
6519 2007-10-05 Marek Safar <marek.safar@gmail.com>
6521 A fix for bug #327520
6522 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
6524 2007-10-04 Marek Safar <marek.safar@gmail.com>
6526 A fix for bug #328022
6527 * class.cs (MethodData.Define): Use correct method to check whether
6528 a method implementents an accessor.
6530 2007-10-04 Marek Safar <marek.safar@gmail.com>
6532 A fix for bug #330069
6533 * statement.cs (Fixed.Resolve): Read the first array element only when
6534 an array is instantiated.
6536 2007-10-04 Marek Safar <marek.safar@gmail.com>
6538 * expression.cs, assign.cs, generics.cs: Print correct operator when
6539 compound assignment is used.
6541 2007-10-04 Marek Safar <marek.safar@gmail.com>
6543 A fix for bug #325841
6544 * expression.cs (ArrayAccess): Use full argument cloning only for
6545 string compound concatenation.
6547 2007-10-03 Marek Safar <marek.safar@gmail.com>
6549 A fix for bug #328774
6550 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
6552 (PropertyExpr.EmitAssign): Fixed string concatenation compound
6555 2007-10-03 Raja R Harinath <rharinath@novell.com>
6558 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
6559 Event accessibility checks here. Remove some bogus code that
6560 accidently made GenericMethods work.
6561 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
6563 2007-09-25 Marek Safar <marek.safar@gmail.com>
6565 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
6567 * statement.cs (Block): Refactored AddVariable to allow error handling
6570 * generic.cs: New stub.
6572 2007-09-23 Marek Safar <marek.safar@gmail.com>
6574 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
6577 2007-09-17 Marek Safar <marek.safar@gmail.com>
6579 * class.cs: Use partial container to record whether any partial part
6580 contains static field initializer and therefore default contructor has
6583 2007-09-14 Marek Safar <marek.safar@gmail.com>
6585 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
6586 mono-list when only one of two partial parts has defined accessibility
6589 2007-09-14 Marek Safar <marek.safar@gmail.com>
6591 A fix for bug #82845
6593 * class.cs (TypeContainer): Set correct resolve context for all field
6596 2007-09-13 Marek Safar <marek.safar@gmail.com>
6598 * assign.cs: Fixed a crash when field is resolved twice with an error.
6600 * codegen.cs: Changed InFieldInitializer to be flag.
6602 * anonymous.cs, ecore.cs, expression.cs: Update after
6603 IsInFieldInitializer rename.
6605 * const.cs: Removed unused parameter.
6607 * class.cs: Changed the way how we resolve and emit field initializers.
6608 The field initilizers have to have access to contructor block to emit
6609 compiler generated code.
6611 2007-09-13 Marek Safar <marek.safar@gmail.com>
6613 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
6614 generics use TypeContainer instead.
6616 2007-09-12 Marek Safar <marek.safar@gmail.com>
6618 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
6620 * lambda.cs (ResolveParameters): Use more powerful
6621 InflateGenericArgument.
6623 * parameters.cs: Better exception message.
6625 2007-09-10 Marek Safar <marek.safar@gmail.com>
6627 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
6628 correct expression block type.
6630 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
6632 * expression.cs (Invocation): Extracted method group resolve to
6635 2007-09-07 Marek Safar <marek.safar@gmail.com>
6637 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
6638 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
6640 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
6641 generic extension methods.
6643 2007-09-06 Marek Safar <marek.safar@gmail.com>
6645 A fix for bug #82676 (Do I get it right now?)
6646 * convert.cs (Binary.ResolveOperator): An interface is converted to the
6647 object before a standard conversion is applied.
6649 2007-09-06 Marek Safar <marek.safar@gmail.com>
6651 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
6654 2007-09-05 Marek Safar <marek.safar@gmail.com>
6656 A fix for bug #82676
6657 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
6658 non-generic interface types.
6660 2007-09-05 Marek Safar <marek.safar@gmail.com>
6662 A fix for bug #82690
6663 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
6665 2007-09-05 Marek Safar <marek.safar@gmail.com>
6667 A fix for bug #82571
6668 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
6669 modifier for container based methods.
6671 2007-09-05 Marek Safar <marek.safar@gmail.com>
6673 A fix for bug #82676
6674 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
6675 any interface-type T means to any of interface type T.
6677 2007-09-04 Marek Safar <marek.safar@gmail.com>
6679 * namespace.cs: We have 2 versions of System.Core assembly.
6681 2007-09-04 Marek Safar <marek.safar@gmail.com>
6683 A fix for bug #82652
6684 * class.cs (Class.GetClassBases): Compare types and not expressions.
6686 2007-09-04 Marek Safar <marek.safar@gmail.com>
6688 A fix for bug #82620
6689 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
6690 actually never worked before.
6691 (IndexerAccess): Emit prepared arguments before they are modified.
6693 2007-09-04 Marek Safar <marek.safar@gmail.com>
6695 A fix for bug #82563
6696 * assign.cs: Revert wrong fix.
6698 * expression.cs (VariableReference.EmitAssign): Handle ref reference
6700 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
6701 Instead of ldelema/stdind we have to use temporary variables to handle
6702 cases like String.Concat (params string[]).
6704 2007-08-31 Marek Safar <marek.safar@gmail.com>
6706 * class.cs: EmitAttributes to Emit rename.
6708 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
6710 (MemberCore.HasClsCompliantAttribute): Don't depend on
6711 GetClsCompliantAttributeValue execution.
6713 2007-08-31 Marek Safar <marek.safar@gmail.com>
6715 * anonymous.cs: Use shorter type prefix.
6717 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
6720 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
6721 variables when probing is on.
6723 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
6724 unresolved variables.
6725 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
6726 handle transparent identifiers.
6728 2007-08-26 Marek Safar <marek.safar@gmail.com>
6730 * attribute.cs (IsClsCompliant): Add nullable types test.
6732 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
6734 * doc.cs : catch other types of exception than XmlException to
6735 report CS1570. Fixed bug #82565.
6737 2007-08-23 Marek Safar <marek.safar@gmail.com>
6739 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
6740 The number of delegate parameters has to match.
6741 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
6744 2007-08-21 Marek Safar <marek.safar@gmail.com>
6746 * anonymous.cs (AnonymousMethod): Generate private anonymous method
6747 to fix problem with private arguments.
6749 2007-08-20 Marek Safar <marek.safar@gmail.com>
6751 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
6753 * decl.cs (MemberName): Ignore generic type with no generic arguments.
6755 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
6756 empty. Add cloning suport.
6758 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
6760 2007-08-20 Marek Safar <marek.safar@gmail.com>
6762 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
6763 to create EmptyCast. It handles EmptyConstantCast specialization for
6766 2007-08-18 Marek Safar <marek.safar@gmail.com>
6768 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
6769 (EmitArrayArgument): One routine for array arguments.
6770 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
6772 2007-08-17 Marek Safar <marek.safar@gmail.com>
6774 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
6776 2007-08-17 Marek Safar <marek.safar@gmail.com>
6778 * anonymous.cs: MemberLookupFinal update.
6780 * class.cs (ConstructorInitializer): Is expression based.
6782 * delegate.cs: MethodGroupExpr update.
6784 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
6786 (Error_MemberLookupFailed): Customizable error override.
6787 (MethodGroupExpr): Keep queried type for later usage.
6788 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
6791 * expression.cs: Error_MemberLookupFailed refactoring.
6792 (New.DoResolve): Resolve as much as possible.
6793 (ElementInitializer.Error_MemberLookupFailed): Object initializer
6794 customization for invalid member types.
6796 * statement.cs: MethodGroupExpr update.
6798 2007-08-16 Marek Safar <marek.safar@gmail.com>
6800 * modifier.cs (Check): Check all modifiers and not only accessibility
6803 2007-08-16 Marek Safar <marek.safar@gmail.com>
6805 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
6806 type and not an expression.
6808 2007-08-16 Marek Safar <marek.safar@gmail.com>
6810 * statement.cs (Catch.Clone): Type and variable can be null.
6812 2007-08-16 Marek Safar <marek.safar@gmail.com>
6814 A fix for bug #81979
6815 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
6816 I am really not sure whether this is the best fix.
6818 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
6821 2007-08-14 Marek Safar <marek.safar@gmail.com>
6823 ** C# 3.0 Object and collection initializers (major re-write)
6825 * assign.cs (DoResolve): Initializers are not assign related.
6827 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
6828 used during collection or object initialization.
6830 * expression.cs (Error_InvalidArguments): Add initializers specific
6831 messages. More will come later because it requires some general
6833 (New.DoResolve): Better error handling for unsafe types.
6834 (EmptyExpressionStatement): New class.
6835 (ElementInitializer): An object initializer expression.
6836 (CollectionElementInitializer): A collection initializer expression.
6837 (CollectionOrObjectInitializers): A block of object or collection
6839 (NewInitialize): New expression with element/object initializers.
6841 * statement.cs: Reverted object/collection initializer hacks.
6843 * typemanager.cs (CSharpName): Filter __arglist type.
6845 2007-08-09 Marek Safar <marek.safar@gmail.com>
6847 ** C# 3.0 Anonymous Types (update to the latest standard)
6849 * expression.cs (Binary.ResolveOperator): Threat all null based types
6851 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
6852 (AnonymousTypeParameter): Updated.
6854 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
6855 (AnonymousTypeClass): New anonymous type container.
6857 * class.cs (AddField): Return operation result.
6859 * generic.cs: Another empty TypeArguments overload.
6861 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
6862 are stored at top of normal hierarchy.
6864 * typemanager.cs (CSharpName): Filter anonymous types.
6866 2007-08-09 Marek Safar <marek.safar@gmail.com>
6868 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
6869 as single Concat call. How could we miss that :-(
6871 2007-08-08 Marek Safar <marek.safar@gmail.com>
6873 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
6875 2007-08-07 Miguel de Icaza <miguel@novell.com>
6877 * expression.cs: Fix the previous commit, the creation of the
6878 arguments array list needs also to be conditional on the arguments
6881 * class.cs: Add a little bit of help to help narrow down problems.
6883 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
6884 not try to copy in that case.
6886 * driver.cs: When building SMCS, include a new different set of
6887 default assemblies here. Do this here so we can control whether
6888 to include the default assemblies with /noconfig.
6890 2007-08-03 Marek Safar <marek.safar@gmail.com>
6892 A fix for bug #81979
6893 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
6896 2007-08-03 Marek Safar <marek.safar@gmail.com>
6898 A fix for bug #82300
6900 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
6901 we are in probing scope.
6903 2007-08-03 Marek Safar <marek.safar@gmail.com>
6905 A fix for bug #82301
6907 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
6908 (Statement.CloneTo): Clone and not map children blocks.
6910 2007-08-03 Marek Safar <marek.safar@gmail.com>
6912 A fix for bug #82299
6914 * expression.cs (LocalVariableReference.CloneTo): Remap local info
6917 * statement.cs (Statement.CloneTo): Clone variables before statements
6918 to allow remaping of local variables.
6920 2007-08-03 Marek Safar <marek.safar@gmail.com>
6922 A fix for bug #82296
6925 * report.cs: Log crash details for future clone problems.
6927 * statement.cs (Return.Clone): Don't clone non-existent expression.
6929 2007-08-03 Raja R Harinath <harinath@gmail.com>
6931 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
6932 (Class.AddBasesForPart): Move CS0537 check here from ...
6933 * cs-parser.jay (class_declaration): ... here. Move calling of
6934 'AddBasesForPart' to ...
6935 (class_bases): ... here.
6936 (struct_declaration, interface_declaration): Update to changes.
6938 2007-08-02 Marek Safar <marek.safar@gmail.com>
6940 A fix for bug #81923
6942 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
6943 conversion is allowed.
6945 2007-08-02 Marek Safar <marek.safar@gmail.com>
6947 A fix for bug #81564
6949 * ecore.cs (EventExpr): Add IsBase handling.
6951 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
6954 2007-08-02 Raja R Harinath <harinath@gmail.com>
6956 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
6957 * cs-parser.jay: Some whitespace cleanups.
6958 (current_delegate): New.
6960 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
6961 a dummy code block, and use 'type_name' instead of 'member_name'.
6962 (interface_declaration, class_declaration): Likewise.
6963 (delegate_declaration): Likewise. Rearrange slightly and use
6965 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
6966 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
6968 2007-08-02 Marek Safar <marek.safar@gmail.com>
6970 A fix for bug #82039
6972 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
6975 * typemanager.cs (CSharpName): Split to string overload.
6977 2007-08-02 Marek Safar <marek.safar@gmail.com>
6980 * report.cs: Updated warning CS0472.
6982 2007-08-01 Marek Safar <marek.safar@gmail.com>
6984 A fix for bug #82181
6986 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
6988 2007-08-01 Marek Safar <marek.safar@gmail.com>
6990 A fix for bug #82277
6991 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
6993 2007-08-01 Marek Safar <marek.safar@gmail.com>
6995 ** C# 3.0 Type Inference (major bits are working)
6997 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
6998 (.ImplicitStandardConversionExists): Uses compatible.
6999 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
7000 (.InferReturnType): New method.
7001 (.Compatible): Refactored.
7002 (.ResolveParameters): Uses factory to create resolved parameters.
7003 (.CompatibleMethod): Add probing mode support.
7004 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
7005 clearly distinguish between 2 different operations.
7006 (LambdaMethod): Moved to lambda.cs.
7007 (AnonymousMethod): Removed unused fields and methods.
7008 (AnonymousDelegate): Simplified.
7010 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
7012 * convert. cs (ImplicitConversionStandard): Compatible works differently.
7014 * delegate.cs (Delegate): New mehods to reduce code duplication.
7015 (.GetConstructor): New method.
7016 (.GetInvokeMethod): New method.
7017 (DelegateCreation): Updated.
7019 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
7021 (OverloadResolve): Made probing little bit faster.
7023 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
7026 * generic.cs (TypeInferenceContext): Dummy implementation.
7028 * iterators.cs: Updated after Resolve/Define rename.
7030 * lambda.cs (LambdaExpression)
7031 (.ResolveParameters): Handles both type of arguments and type inference too.
7033 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
7034 (InflateTypes): Updated.
7036 * support.cs (InflateTypes): Changed signature and updated.
7038 * typemanager.cs (LookupMemberCache): Better dynamic type check.
7039 (MemberLookup_FindMembers): More MS tricks.
7040 (GetParameterData): Ditto.
7041 (GetDelegateParameters): Uses quick path for dynamic types.
7043 2007-08-01 Marek Safar <marek.safar@gmail.com>
7045 * class.cs (MethodData.Define): EmitContext is required for generic stuff
7048 2007-07-31 Marek Safar <marek.safar@gmail.com>
7050 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
7053 2007-07-26 Jb Evain <jbevain@novell.com>
7055 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
7056 which takes a boolean 'report_errors', similar to the GetMethod.
7057 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
7058 in .net 2.1, do not report errors here.
7060 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
7061 System.Runtime.CompilerServices.RequiredAttributeAttribute and
7062 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
7065 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
7066 of the type InternalsVisibleToAttribute before the first call
7067 to CoreLookupType which is allowed to fail (third boolean parameter
7068 to true). Because, during the resolution for a type that is not
7069 immediately found, we try to check if the type is not defined in
7070 a friend assembly, and to do so, we need the
7071 InternalVisibleToAttribute.
7073 2007-07-23 Miguel de Icaza <miguel@novell.com>
7075 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
7076 feature that allows structs to be compared against null and inline
7077 the result as true or false.
7079 Notice that the same code is not permitted inside a generic block
7080 of code that would do:
7082 class Foo<T> where T : struct {
7089 It is only allowed if the type of T is not bound (no where
7090 clause). In my opinion, this CSC 2 behavior is broken but people
7091 seem to be using it (IronRuby does, a few bug reports on bugzilla
7092 have it and some people have complained about it).
7094 All of the users that depend on this behavior have code that is
7097 * report.cs (Warning, Error): make these take object arguments,
7098 not strings, as that allows us to take advantage of Format.
7100 2007-07-20 William Holmes <billholmes54@gmail.com>
7102 * decl.cs: Changed MemberName.CountTypeArguments to also check the
7103 Left member variable for the Count.
7104 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
7105 MemberName.CountTypeArguments to avoid a NRE.
7107 This code is contributed under the MIT X11 license
7109 2007-07-18 Marek Safar <marek.safar@gmail.com>
7111 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
7113 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7115 * doc.cs : generic method arguments are written as ``x while generic
7116 type arguments are `x. Combined with the previous change, fixed bug
7119 2007-07-18 Raja R Harinath <rharinath@novell.com>
7122 * expression.cs (Binary.ResolveOperator): When converting
7123 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
7125 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7127 * doc.cs : when T: or whatever x: is specified, it does not really
7128 check the doc comment's syntax correctness. Fixed bug #82006.
7130 2007-07-18 Marek Safar <marek.safar@gmail.com>
7132 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
7133 LambdaExpression better.
7135 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
7137 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
7139 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
7140 as it can be generated.
7142 * expression.cs (Invocation.Error_InvalidArguments): Show correct
7145 * lambda.cs (LambdaExpression): Refactored to share same code with
7146 AnonymousMethodExpression.
7148 2007-07-17 Marek Safar <marek.safar@gmail.com>
7150 * anonymous.cs (MakeName): Include host name for easier debugging.
7151 (LambdaMethod): New class for lambda spcecific stuff.
7153 * attribute.cs: Set EmitContext return type.
7155 * class.cs: Set EmitContext return type.
7157 * codegen.cs (EmitContext): Return type cannot be null to stop messing
7158 with null/void meaning.
7160 * iterators.cs (ContainerType): Implemented.
7162 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
7164 * statement.cs (Return): Updated to lambda expressions.
7165 (Block.CloneTo): Parent can be null.
7167 2007-07-13 Marek Safar <marek.safar@gmail.com>
7169 A fix for bug #81917
7170 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
7172 * class.cs (FixedField): Check whether field is in unsafe scope.
7174 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
7175 (FieldExpr.Emit): Fixed buffers cannot be volatile.
7177 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
7180 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
7182 2007-07-13 Marek Safar <marek.safar@gmail.com>
7184 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
7185 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
7188 2007-07-13 Marek Safar <marek.safar@gmail.com>
7190 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
7192 2007-07-13 Marek Safar <marek.safar@gmail.com>
7194 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
7195 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
7197 * codegen.cs(EmitContext): Add ProbingMode flag.
7199 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
7201 * driver.cs: For now set both warning values.
7203 * ecore.cs (SimpleName): Name is readonly.
7204 (MethodGroup.OverloadResolve): One quick path for probing.
7206 * expression.cs (Unary): Set Oper r/o.
7207 (Binary): Set Oper r/o.
7208 (ParameterReference): Set few instance variables as r/o.
7209 (ParameterReference.DoResolveBase): Don't capture aruments when
7211 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
7212 (Arglist): arguments are private.
7213 (SizeOf): type is private and r/o.
7214 (MemberAccess): arguments are private.
7216 * report.cs: Enhanced reporting on/off capabilities.
7218 * lambda.cs: Uses ec.IsInProbingMode.
7219 (ContextualReturn): Derives from return.
7221 * rootcontext.cs: For now set both warning values.
7223 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
7225 (Return.Resolve): Don't die immediately.
7226 (Block.Resolve): Speed-up probing.
7227 (Block.CloneTo): Clone only child blocks.
7229 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
7231 * iterators.cs: reverted Miguel's latest change (r81925) as it
7232 breaks the build in System.
7234 2007-07-13 Miguel de Icaza <miguel@novell.com>
7236 * iterators.cs (Yield.CheckContext): Check for the iterator type
7237 also here as we can call into Yield even in codepaths that are not
7239 (MethodOrOperator is the only path that was checked).
7241 In addition to the standard check, use a more specific check for
7242 constructors to report a more verbose error.
7244 2007-07-12 Miguel de Icaza <miguel@novell.com>
7246 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
7247 report the warning and continue
7249 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
7250 values on the stack on the call to Emit. Use EmitStatement if
7251 possible, or using Emit + Pop if not possible. Fixes #82064
7253 2007-07-12 Raja R Harinath <rharinath@novell.com>
7255 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
7256 avoid try...finally in some cases.
7258 2007-07-10 Marek Safar <marek.safar@gmail.com>
7260 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
7262 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
7263 instead of method. Re-use standard error handling.
7264 (ConstructorInitializer.Emit): Simplified.
7266 * delegate.cs: Updated after Invocation.EmitCall change.
7268 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
7269 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
7270 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
7271 method and don't permanently changing input arguments.
7272 (MethodGroupExpr): Introduced resolved best_candidate, when method group
7273 is resolved it has one of the candidates is the best one which is later
7274 used to emit. Removed a few unused method.
7275 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
7277 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
7278 (Binary.ResolveOperator): Ditto.
7279 (ConditionalLogicalOperator.DoResolve): Ditto.
7280 (Invocation): Uses method group.
7281 (Invocation.DoResolve): Simplified.
7282 (Invocation.EmitCall): Removed useless is_static.
7283 (Invocation.Emit): Delegate to method group.
7284 (Invocation.EmitStatement): Simplified.
7285 (New): Uses method group.
7286 (MemberAccess.DoResolve): Don't destroy original expression.
7288 * statement.cs (ForEach.Resolve): Use null for no method arguments.
7290 2007-07-04 Marek Safar <marek.safar@gmail.com>
7292 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
7295 * lambda.cs: Add custom error message type.
7297 2007-07-03 Marek Safar <marek.safar@gmail.com>
7299 * lambda.cs: Simplified little bit.
7301 * parameter.cs: Introduced ImplicitLambdaParameter.
7302 (Parameters.CreateFullyResolved): New factory instead of ctor.
7306 * delegate.cs: Updated parameter creation.
7308 2007-07-03 Marek Safar <marek.safar@gmail.com>
7310 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
7313 * generic.cs: Synchronized with gmcs.
7315 2007-07-03 Marek Safar <marek.safar@gmail.com>
7317 * class.cs (Indexer): Check return type as soon as possible.
7319 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
7322 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
7324 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
7326 * parameter.cs (Parameter): Use expression type when it is available.
7328 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
7329 method modifier for the first parameter only.
7331 2007-06-24 Marek Safar <marek.safar@gmail.com>
7333 A fix for bug #81938
7334 * typemanager.cs (ChangeType): Fixed couple of char conversions.
7336 * constant.cs: Tide up an exception message.
7338 2007-06-22 Marek Safar <marek.safar@gmail.com>
7340 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
7341 an uninitialized variable is used.
7343 * expression.cs (LocalVariableReference.DoResolve): Ditto.
7345 2007-06-22 Marek Safar <marek.safar@gmail.com>
7347 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
7348 not found error handling.
7350 * expression.cs (ArrayCreation): Removed redundant fields and little bit
7352 (ArrayCreation.ResolveArrayElement): To be ready to customization.
7353 (ArrayCreation.DoResolve): Simplified.
7354 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
7355 its own resolve process.
7356 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
7358 2007-06-20 Marek Safar <marek.safar@gmail.com>
7360 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
7363 2007-06-20 Marek Safar <marek.safar@gmail.com>
7365 * cs-tokenizer.cs: Removed var related stuff.
7367 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
7368 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
7369 a type and a keyword at same time.
7371 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
7374 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
7375 implicitly typed arrays, more changes will follow.
7377 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
7379 2007-06-19 Marek Safar <marek.safar@gmail.com>
7381 * ecore.cs (VarExpr): Removed Handled field.
7383 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
7384 build-in assign functionality.
7385 (ForEach.Resolve): Removed all implicitly typed local variable code and
7387 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
7388 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
7390 2007-06-18 Marek Safar <marek.safar@gmail.com>
7392 * assign.cs: Removed implicitly typed local variable check.
7394 * expression.cs (LocalVariableReference.DoResolve): Add check for self
7395 referencing implicitly typed local variable.
7396 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
7399 * statement.cs (Fixed): Removed unsupported implicitly typed local
7402 2007-06-15 Marek Safar <marek.safar@gmail.com>
7404 * decl.cs (MemberName): Moved all Unbound stuff to parser.
7406 2007-06-14 Marek Safar <marek.safar@gmail.com>
7408 A fix for bugs #81855 and #76274
7409 * attribute.cs (AttachTo): Always set owner for global attributes to
7412 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
7415 * cs-parser.jay: Assembly and module attributes must precede all other
7416 elements except using clauses and extern alias declarations.
7418 2007-06-13 Marek Safar <marek.safar@gmail.com>
7420 A fix for bug #81748
7422 * expression.cs: More checks for non ISO-1 features.
7424 2007-06-12 Marek Safar <marek.safar@gmail.com>
7426 A fix for bug #81807
7427 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
7428 present inside switch statement and it is required by nullable check.
7430 2007-06-12 Marek Safar <marek.safar@gmail.com>
7432 A fix for bug #81840
7433 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
7434 when type matching fails.
7436 * namespace.cs: Tiny error message change.
7438 2007-06-12 Marek Safar <marek.safar@gmail.com>
7440 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
7441 reporting. Added automatic property check.
7443 * class.cs: Updated after CheckAbstractAndExtern relocation.
7444 (AEventPropertyAccessor.GetSignatureForError): Customized.
7446 2007-06-11 Marek Safar <marek.safar@gmail.com>
7448 * class.cs (DefineBaseTypes): Base type can be undefined.
7450 * ecore.cs (TypeLookup): Minor refactoring.
7451 (DoResolveAsTypeStep): Removed redundant check.
7453 * namespace.cs (Lookup): Removed redundant check.
7455 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
7456 ResolveAsTypeTerminal step.
7457 (BootstrapCorlib_*): Simplified.
7458 (PopulateCoreType): Core types can be now external.
7460 2007-06-07 Marek Safar <marek.safar@gmail.com>
7462 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
7464 (InferTypeArguments): Infers anonymous expression type arguments.
7465 (Compatible): Split to Compatible and InferTypeArguments.
7467 * lambda.cs: Updated.
7469 2007-06-08 Marek Safar <marek.safar@gmail.com>
7471 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
7473 2007-06-07 Raja R Harinath <harinath@gmail.com>
7475 Fix #80477, cs0135-2.cs, cs0135-3.cs
7476 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
7477 names to the "known" variables list.
7478 (Block.CheckInvariantMeaningInBlock): Handle the fact the
7479 parameter names are also "known".
7480 (Block.CheckError136): Remove.
7481 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
7484 2007-06-07 Marek Safar <marek.safar@gmail.com>
7486 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
7488 2007-06-06 Marek Safar <marek.safar@gmail.com>
7490 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
7491 internal error not an user error.
7493 * expression.cs (IsApplicable): Refactored to make debugging easier.
7495 * support.cs: More tricks for non-mono runtimes.
7497 * typemanager.cs (CoreLookupType): Made public.
7498 (InitSystemCore): All linq specific stuff moved to linq.cs
7500 2007-06-05 Marek Safar <marek.safar@gmail.com>
7502 * typemanager.cs (CSharpSignature): One more missing build-in types
7504 More tricks for non-mono runtime.
7506 2007-06-05 Raja R Harinath <harinath@gmail.com>
7508 * statement.cs (Block.CheckError136_InParents): Remove.
7509 (Block.AddVariable): Use GetParameterInfo instead.
7510 (ToplevelBlock.ProcessArguments): Likewise.
7512 2007-06-04 Raja R Harinath <rharinath@novell.com>
7514 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
7516 (ToplevelBlock.GetParameterInfo): Split out of ...
7517 (ToplevelBlock.GetParameterRefernce): ... this.
7518 (ToplevelBlock.ParameterMap): Remove.
7519 * expression.cs (ParameterReference): Update to use
7520 ToplevelParameterInfo.
7522 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
7525 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
7526 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
7528 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
7529 (ToplevelBlock.ProcessParameters) ... here.
7530 (ToplevelBlock..ctor): Invoke it.
7532 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
7535 * statement.cs (IKnownVariable): New interface.
7536 (LocalInfo): Implement it.
7537 (ToplevelParameterInfo): New class.
7538 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
7539 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
7540 GetKnownVariableInfo.
7542 2007-06-03 Raja R Harinath <harinath@gmail.com>
7544 Partly speed up CS0136 error checks.
7545 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
7546 'recurse' parameter.
7547 (Block.DoCheckError136): Only check errors in parameters. Move
7548 local variable checks ...
7549 (Block.AddVariable): ... here, and ...
7550 (ToplevelBlock.ResolveMeta): ... here.
7552 2007-06-02 Raja R Harinath <harinath@gmail.com>
7554 * statement.cs (Block.IsChildOf): Remove.
7556 * statement.cs (Statement.Clone): Move special case code ...
7557 (Block.CloneTo): ... here.
7559 2007-05-29 Raja R Harinath <rharinath@novell.com>
7561 * statement.cs (ToplevelBlock.container): Remove field. It's
7562 redundant with 'Parent'.
7563 (ToplevelBlock.ContainerBlock): Remove accessor.
7564 (ToplevelBlock..ctor): Update to changes. Register anonymous
7565 child with parent here, ...
7566 * cs-parser.jay (end_anonymous): ... not here. Don't modify
7568 (start_anonymous): Don't save current_block.
7569 (top_current_block): Remove.
7571 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
7572 (Block.Resolve): Update to changes.
7573 (Block..ctor): Move setting of "correct" 'Toplevel'
7574 and 'Explicit' fields to ...
7575 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
7577 2007-05-27 Raja R Harinath <harinath@gmail.com>
7580 * statement.cs (Block.Implicit): Remove.
7581 (Block): Update to changes.
7582 * flowanalysis.cs: Likewise.
7584 Mildly speed up CheckInvariantMeaningInBlock
7585 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
7586 Recursively call AddKnownVariable to all enclosing blocks.
7587 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
7588 Remove recursive calls.
7589 (Block): Update to changes.
7591 New ExplicitBlock invariants
7592 * statement.cs (Block.Explicit): New field. It points to the
7593 immediately enclosing non-implicit block.
7594 (Block..ctor): Maintain the invariant.
7595 * cs-parser.jay: Take advantage of invariant.
7597 Introduce ExplicitBlock
7598 * statement.cs (ExplicitBlock): New.
7599 (ToplevelBlock): Derive from it.
7600 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
7602 (Block.Implicit): Update to changes.
7603 * cs-parser.jay: Update to changes.
7606 * codegen.cs (EmitContext.IsLastStatement): Remove.
7607 * statement.cs (Block.DoEmit): Update to changes.
7609 2007-05-25 Raja R Harinath <rharinath@novell.com>
7611 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
7612 modifying current_block directly.
7614 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
7616 * class.cs: Implemented automatic properties (C# 3.0)
7617 Thanks to Marek for the help.
7619 2007-05-23 Raja R Harinath <rharinath@novell.com>
7621 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
7622 variable as assigned, note also that all its components are
7624 (MyBitVector.SetRange): New. Function to set multiple bits to true.
7626 2007-05-19 Marek Safar <marek.safar@gmail.com>
7628 * anonymous.cs, class.cs: Emit Compiler generated attribute when
7629 member is marked as compiler generated.
7631 * decl.cs (MemberCore): Refactored ModFlags into property.
7633 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
7634 (Check): Check only accessibility modifiers.
7636 2007-05-18 Raja R Harinath <rharinath@novell.com>
7638 Track all assignable slots in one bit array
7639 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
7640 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
7641 logic from VariableMap constructor here. Use the same 'offset'
7642 variable that's later used for computing offsets of local
7644 * flowanalysis.cs (UsageVector.parameters): Remove.
7645 (UsageVector): Update to changes.
7646 (VariableMap): Remove.
7648 Avoid creating ParameterMap in every block
7649 * statement.cs (Block.ParameterMap): Move ...
7650 (ToplevelBlock.ParameterMap): ... here.
7651 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
7653 * flowanalysis.cs (FlowBranching.param_map): Remove.
7654 (FlowBranching.UsageVector): Update to changes.
7655 (FlowBranchingToplevel.CheckOutParameters): Likewise.
7657 * statement.cs (Block.CloneTo): Clone Toplevel field too.
7659 * expression.cs (ParameterReference): Distinguish between block
7660 where parameter was referenced and declared.
7662 2007-05-18 Marek Safar <marek.safar@gmail.com>
7664 * flowanalysis.cs, statement.cs: Put back improved error handling.
7666 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
7670 Imporved object and collection initialization (C# 3.0).
7672 2007-05-15 Marek Safar <marek.safar@gmail.com>
7674 A fix for bug #81380
7675 * expression.cs (Is.DoResolve): Only value types have constant `is'
7678 2007-05-15 Raja R Harinath <rharinath@novell.com>
7680 * statement.cs (ToplevelBlock.child): Remove.
7682 2007-05-15 Raja R Harinath <harinath@gmail.com>
7684 Rationalize ResolveMeta: refactoring
7685 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
7686 out constant handling code into ...
7687 (Block.DoResolveConstants): ... this.
7689 Rationalize ResolveMeta: kill local_map
7690 * statement.cs (Block.local_map, Block.LocalMap): Remove.
7691 (Block.AssignableSlots): New.
7692 (Block.ResolveMeta): Make protected. Don't create a VariableMap
7693 for locals -- move code from VariableMap here. Avoid unnecessary
7695 * flowanalysis.cs (FlowBranching.local_map): Remove.
7696 (FlowBranching..ctor): Use Block.AssignableSlots.
7697 (VariableMap): Remove unused constructors.
7699 2007-05-11 Raja R Harinath <rharinath@novell.com>
7701 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
7703 2007-05-11 Marek Safar <marek.safar@gmail.com>
7705 * typemanager.cs (IsFriendAssembly): Should not be called for building
7708 2007-05-09 Marek Safar <marek.safar@gmail.com>
7710 * literal.cs (NullConstant): Print null in all cases.
7712 * expression.cs (Binary.ResolveOperator): Implemented delegate
7713 comparison based on C# 2.0 changes.
7715 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
7717 This code is contributed under the MIT X11 license
7719 The following enables support for several C# 3.0 language features:
7721 * cs-tokenizer.cs: Added support for the "var" keyword.
7723 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
7724 Added VarExpr class to facilitate type inferencing.
7726 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
7727 to support anonymous types.
7729 * assign.cs: Added support for type inferencing and initialization.
7731 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
7733 * expression.cs: Added implicit array support to ArrayCreation.
7734 Added 5 types and 1 interface:
7736 IInitializable Implementing classes can inject initializing
7737 statements after object instantiation.
7739 Initializer Stores data for object initialization.
7741 AnonymousType An expression for anonymous types.
7743 AnonymousTypeParameter Stores data about an anonymous type's field.
7745 NewInitialize An expression for object initialization.
7747 CollectionInitialize An expression for collection initialization.
7749 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
7752 2007-05-06 Marek Safar <marek.safar@gmail.com>
7754 A fix for bug #81500
7755 * cs-tokenizer.cs: Add special handling for coalescing operator.
7757 2007-05-06 Marek Safar <marek.safar@gmail.com>
7759 A fix for bug #81529
7760 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
7761 its value from base class until it is redefined.
7763 2007-05-02 Raja R Harinath <rharinath@novell.com>
7765 Fix regression in cs0631-3.cs
7766 * cs-parser.jay (operator_declarator): Add opt_attributes to error
7767 fallback. Make error fallback catch more cases.
7769 2007-05-01 Miguel de Icaza <miguel@novell.com>
7771 * cs-parser.jay: Allow parameters in operator declarations to have
7774 2007-04-27 Miguel de Icaza <miguel@novell.com>
7776 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
7779 * lambda.cs (ContextualReturn.Resolve): An expression is valid
7780 inside the ContextualReturn, it does not have to be an
7781 ExpressionStatement.
7783 2007-04-24 Miguel de Icaza <miguel@novell.com>
7785 * lambda.cs (ContextualReturn.Resolve): if the return type is not
7788 2007-04-23 Miguel de Icaza <miguel@novell.com>
7790 * anonymous.cs (AnonymousContainer): split the virtual Resolve
7791 method in two methods: ResolveNoDefine and Resolve.
7793 ResolveNoDefine will stop just after ResolveTopBlock has been
7796 Resolve will then continue by creating a method and issuing the
7797 call to method.Define ().
7799 (AnonymousMethod): Split and implement the new Resolve and
7800 ResolveNoDefine as well.
7802 * lambda.cs (LambdaExpression): Split the anonymous method
7803 resolution code into a separate routine (CoreCompatibilityTest)
7804 from DoCompatibleTest.
7806 (LambdaExpression.TryBuild): New method, this method tries to
7807 build the LambdaExpression with the given set of types to be used
7808 as the types for the various parameters of the lambda expression.
7810 If the compilation succeed with the given types, the infered type
7811 of the Anonymous method is returned, otherwise null is returned.
7813 2007-04-23 Marek Safar <marek.safar@gmail.com>
7815 A fix for bug #81414
7816 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
7818 2007-04-22 Miguel de Icaza <miguel@novell.com>
7820 * cs-tokenizer.cs: Change various identifiers here from the
7821 camelCasing to the recommended Linux-like style for instance
7822 variables from the Coding Guidelines.
7824 2007-04-19 Martin Baulig <martin@ximian.com>
7827 (Convert.ImplicitReferenceConversionCore): Allow conversions from
7828 System.Enum to System.ValueType.
7830 2007-04-13 Martin Baulig <martin@ximian.com>
7832 Rewrote implicit reference conversions. We need to distinguish
7833 between implicit reference conversions (13.1.4) and implicit
7834 boxing conversions (13.1.5).
7836 According to the spec, there's an an implicit conversion
7837 "From a one-dimensional array-type S[] to IList<T> and base
7838 interfaces of this interface, provided there is an implicit
7839 reference conversion from S to T." Note that this does not
7840 include boxing conversions.
7843 (Convert.ImplicitTypeParameterBoxingConversion): New method.
7844 (Convert.ImplicitReferenceConversion): Split into
7845 ImplicitReferenceConversionCore() and
7846 ImplicitBoxingConversionExist().
7847 (Convert.ImplicitReferenceConversionExists): Use the new
7848 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
7850 2007-04-12 Martin Baulig <martin@ximian.com>
7852 * convert.cs (Convert.ImplicitReferenceConversion): Move the
7853 `TypeManager.null_type' checks up to the top of the method.
7855 2007-04-11 Marek Safar <marek.safar@gmail.com>
7857 A fix for bug #81350
7858 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
7861 2007-04-11 Martin Baulig <martin@ximian.com>
7863 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
7864 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
7865 to make this work for generic classes; fixes #79561.
7867 2007-04-11 Martin Baulig <martin@ximian.com>
7869 * expression.cs (As): Add support for nullable types; fixes #79371.
7871 2007-04-11 Martin Baulig <martin@ximian.com>
7873 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
7874 `type.FullName' is null; fixes #80243.
7876 2007-04-11 Martin Baulig <martin@ximian.com>
7878 * expression.cs (Invocation.IsApplicable): Don't modify the method
7879 if type inference succeeded, but the method was not applicable.
7882 2007-04-10 Marek Safar <marek.safar@gmail.com>
7884 A fix for bug #81324
7885 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
7886 internal and external namespaces containers.
7888 2007-04-10 Martin Baulig <martin@ximian.com>
7890 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
7891 TypeManager.DropGenericMethodArguments() so we also call
7892 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
7894 2007-04-10 Martin Baulig <martin@ximian.com>
7896 * iterators.cs (Iterator.CreateIterator): Don't crash if
7897 `method.ReturnType' is null. This happens if something went wrong
7898 while resolving that typ (we already reported an error in this case).
7900 2007-04-10 Martin Baulig <martin@ximian.com>
7902 * expression.cs (New.DoResolve): Don't call CheckComImport() on
7903 generic interfaces; report the CS0144 directly.
7905 2007-04-10 Martin Baulig <martin@ximian.com>
7907 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
7908 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
7910 2007-04-10 Martin Baulig <martin@ximian.com>
7912 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
7914 2007-04-09 Raja R Harinath <rharinath@novell.com>
7917 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
7918 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
7921 * statement.cs (For.Resolve): If resolution fails, use
7924 2007-04-08 Marek Safar <marek.safar@gmail.com>
7926 * anonymous.cs (MakeName): Make faster and zero-based.
7927 (VerifyExplicitParameterCompatibility): Back to mode where generic
7928 parameter is ignored.
7929 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
7931 * class.cs (EmitType): Method can emit another new method.
7933 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
7935 * driver.cs: Updated.
7937 * lambda.cs: Reuse predefined empty parameters.
7939 * parameter.cs: Updated
7941 * support.cs: Implemented InflateTypes.
7943 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
7944 (InitSystemCore): Introduced to isolate 3.0 dependencies.
7946 2007-04-03 Martin Baulig <martin@ximian.com>
7950 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
7951 version of TypeManager.IsOverride() which also works with generic
7954 2007-04-03 Martin Baulig <martin@ximian.com>
7959 (Convert.ExplicitReferenceConversion): We need to cast when
7960 converting from IList<T> to S[].
7962 2007-04-01 Marek Safar <marek.safar@gmail.com>
7964 * decl.cs (FindExtensionMethods): Consider all candidates with same name
7967 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
7969 2007-03-31 Marek Safar <marek.safar@gmail.com>
7971 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
7972 argument and return type inferring.
7974 * codegen.cs (InferReturnType): Flag whether return can be inferred.
7975 (ReturnType): Turned to property.
7977 * statement.cs (Return): Implemented return type inferring.
7979 * support.cs (ReflectionParameters): Use local types if possible.
7981 2007-03-30 Raja R Harinath <rharinath@novell.com>
7983 * flowanalysis.cs (FlowBranching.Reachability): Remove.
7984 (FlowBranching.UsageVector): Update to changes.
7986 Prepare to kill 'Reachability'
7987 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
7988 argument of constructor.
7990 2007-03-29 Raja R Harinath <rharinath@novell.com>
7992 Prepare to kill 'Reachability'
7993 * flowanalysis.cs (UsageVector.is_unreachable): New.
7994 (UsageVector): Update to maintain 'is_unreachable' in parallel to
7995 'reachability', and verify they're consistent.
7998 * expression.cs (New.EmitStatement): Handle type parameters here too.
8000 2007-03-29 Martin Baulig <martin@ximian.com>
8005 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
8006 CompilerGeneratedClass.
8007 (ScopeInfo.EmitScopeInstance): Make this protected.
8008 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
8009 `ec.CurrentAnonymousMethod.Scope == Scope'.
8011 * statement.cs (Block.ScopeInfo): Make this a property.
8013 2007-03-27 Raja R Harinath <harinath@gmail.com>
8015 Prepare to kill 'Reachability'
8016 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
8017 (FlowBranching.UsageVector.Reachability): Remove property.
8018 (FlowBranching.UsageVector.IsUnreachable): New property.
8019 (FlowBranching.UsageVector.ResetBarrier): New.
8020 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
8021 * codegen.cs, statement.cs: Update to changes.
8023 2007-03-27 Martin Baulig <martin@ximian.com>
8028 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
8031 2007-03-26 Raja R Harinath <rharinath@novell.com>
8033 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
8034 instead of TriState. Remove all mention of TriState.
8036 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
8037 replaced by a boolean. Add boolean 'is_unreachable' field, check
8038 and maintain invariants.
8040 2007-03-25 Marek Safar <marek.safar@gmail.com>
8042 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
8044 2007-03-25 Marek Safar <marek.safar@gmail.com>
8046 * expression.cs: Stop using obsolete 2.0 opcodes.
8048 2007-03-25 Marek Safar <marek.safar@gmail.com>
8050 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
8051 one of the latests Martin's fixes.
8053 2007-03-23 Miguel de Icaza <miguel@novell.com>
8055 * expression.cs: On BigEndian systems, swap the bytes, temporary
8056 solution until we get a new bitconverter class.
8058 2007-03-23 Martin Baulig <martin@ximian.com>
8062 * decl.cs (MemberCache.AddMembers): Add generic methods both as
8063 "Method" and "Method`1". Normally, a cache lookup is done on the
8064 "Method" form (ie. without the generic arity), but this one makes
8065 lookups on the full form work as well.
8067 2007-03-22 Raja R Harinath <rharinath@novell.com>
8069 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
8072 2007-03-20 Bill Holmes <billholmes54@gmail.com>
8074 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
8075 ordered_member_list, to TypeBuilder to store members to be defined
8076 in the order they were parsed in.
8077 - ordered_explicit_member_list contains all properties indexers
8078 and methods that are defined as explicit implementation of an
8079 interface or base class.
8080 - ordered_member_list contains all properties indexers and methods
8081 that are not defined as explicit implementation of an interface
8084 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
8085 functionality in these removed classes has been replaced with
8086 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
8087 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
8089 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
8090 to CheckForDuplications inside GetMethod and SetMethod Define Method
8091 to handle method property and indexer name conflicts.
8095 All code is contributed under the MIT/X11 license.
8097 2007-03-20 Martin Baulig <martin@ximian.com>
8099 * class.cs (TypeContainer.Interfaces): Removed; they're now
8100 included in `TypeContainer.Types'.
8102 2007-03-20 Martin Baulig <martin@ximian.com>
8104 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
8106 * class.cs (TypeContainer.CreateType): New public method. This is
8107 now called before DefineType() to create the TypeBuilders.
8108 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
8109 has already been created by CreateType().
8110 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
8111 don't resolve our base classes here; this has been moved into
8112 DefineBaseTypes(). We're now called from CreateType().
8113 (TypeContainer.DefineBaseTypes): New private method; resolve our
8114 base classes here. We're now called from DefineType().
8117 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
8118 our types first to create all the TypeBuilders. After that, call
8119 TypeContainer.DefineType() on all the types which'll resolve their
8120 base classes and setup the resolve order.
8122 2007-03-20 Martin Baulig <martin@ximian.com>
8124 * class.cs (TypeContainer.Enums): Removed; they're now included in
8125 `TypeContainer.Types'.
8127 2007-03-20 Martin Baulig <martin@ximian.com>
8130 (TypeContainer.DefineType): Don't call ResolveMembers() here.
8131 (TypeContainer.DoResolveMembers): Call DefineType() on our
8132 `compiler_generated' classes; moved here from DefineNestedTypes().
8135 (RootContext.ResolveTree): Call ResolveMembers() on all
8136 TypeContainer's in the `type_container_resolve_order'.
8138 2007-03-19 Marek Safar <marek.safar@gmail.com>
8140 * class.cs: Use corlib to handle InternalMethodImplAttribute.
8142 2007-03-17 Marek Safar <marek.safar@gmail.com>
8144 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
8145 implementation flags.
8147 2007-03-17 Marek Safar <marek.safar@gmail.com>
8149 * class.cs: More optimizations for type parameters.
8151 2007-03-15 Marek Safar <marek.safar@gmail.com>
8153 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
8155 * ecore.cs, parameter.cs: More common code for both corlibs.
8157 * typemanager.cs (IsGenericMethod): Simplified.
8159 2007-03-15 Raja R Harinath <rharinath@novell.com>
8161 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8163 * statement.cs, iterators.cs, lambda.cs: Update to changes.
8165 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
8166 unconditionally. Simplify explanation.
8167 (Try.Resolve, Using.Resolve): Likewise.
8169 2007-03-15 Martin Baulig <martin@ximian.com>
8173 * decl.cs (DeclSpace): If we're a partial class, use our
8174 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
8176 2007-03-15 Raja R Harinath <rharinath@novell.com>
8178 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8180 (FlowBranching.UsageVector): Update to changes.
8181 (FlowBranching.MergeSiblings): Likewise.
8182 * statement.cs: Likewise.
8184 2007-03-15 Martin Baulig <martin@ximian.com>
8189 (MemberCache): Added a special .ctor for type parameters.
8192 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
8195 2007-03-09 Martin Baulig <martin@ximian.com>
8197 * enum.cs (Enum): Make this a TypeContainer.
8198 (EnumMember): Derive from `Const'.
8201 (Const.DoResolveValue): New protected virtual method; move most of
8202 the functionality of ResolveValue() here so we can override it in
8204 (Const.CreateConstantReference): Make this virtual.
8206 * class.cs (Kind): Add `Kind.Enum'.
8207 (TypeContainer.Emit): Don't emit the enums here; they're already
8208 in the `RootContext.typecontainer_resolve_order'.
8210 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
8211 here; they're already in the `typecontainer_resolve_order'.
8213 * ecore.cs (EnumConstant.ConvertImplicitly): Add
8214 TypeManager.DropGenericTypeArguments().
8217 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
8218 (TypeManager.IsEnumType): Likewise.
8219 (TypeManager.EnumToUnderlying): Likewise.
8220 (TypeManager.IsEqual): Add support for enums.
8222 2007-03-12 Raja R Harinath <rharinath@novell.com>
8224 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
8225 DefaultParameterValueAttribute to be undefined, say if System.dll
8228 2007-03-11 Marek Safar <marek.safar@gmail.com>
8230 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
8233 2007-03-10 Marek Safar <marek.safar@gmail.com>
8235 * class.cs, parameter.cs: Unified parameters verification.
8237 2007-03-08 Martin Baulig <martin@ximian.com>
8239 * cs-parser.jay (constructor_header): Pass the location to the
8240 newly created TopLevelBlock.
8242 2007-03-07 Martin Baulig <martin@ximian.com>
8244 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
8246 2007-03-06 Miguel de Icaza <miguel@novell.com>
8248 * convert.cs (ExplicitReferenceConversionExists): Sync this method
8249 with the changes from David, fixes the build.
8251 2007-03-05 David Mitchell <dmitchell@logos.com>
8253 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
8254 and its base interfaces to a one-dimensional array type S[],
8255 provided there is an implicit or explicit reference conversion
8258 2007-03-03 Marek Safar <marek.safar@gmail.com>
8260 * cs-tokenizer.cs: Implemented basic linq grammar.
8262 * driver.cs: Set linq lang version on demand.
8264 2007-02-26 Marek Safar <marek.safar@gmail.com>
8266 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
8268 2007-02-25 Marek Safar <marek.safar@gmail.com>
8270 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
8273 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
8275 Check property and event extern attributes.
8277 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
8280 2007-02-24 Marek Safar <marek.safar@gmail.com>
8282 A fix for bug #80407
8283 * ecore.cs: Don't report ambiguity error when methods have same parent.
8285 2007-02-23 Marek Safar <marek.safar@gmail.com>
8287 A fix for bug #80878
8288 * class.cs, cs-parser.jay: Event property can host anonymous methods.
8290 2007-02-22 Marek Safar <marek.safar@gmail.com>
8292 * attribute.cs: Enable ExtensionAttribute presence test.
8294 2007-02-22 Marek Safar <marek.safar@gmail.com>
8296 * class.cs: Warn about missing GetHashCode only when Equals is override.
8298 * decl.cs: Check accessibility of type arguments.
8300 * typemanager.cs: Correctly report nullable array.
8302 2007-02-20 Marek Safar <marek.safar@gmail.com>
8304 * class.cs, report.cs: Capture more details when things go wrong.
8306 2007-02-20 Marek Safar <marek.safar@gmail.com>
8308 A fix for bug #80650
8309 * cs-parser.jay: Anonymous container starts at constructor declaration
8310 and not at block beginning because it has to be usable in constructor
8313 * statement.cs: Use context location and not block one for error reporting.
8315 2007-02-18 Marek Safar <marek.safar@gmail.com>
8317 A fix for bug #78712
8318 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
8321 2007-02-18 Marek Safar <marek.safar@gmail.com>
8323 A fix for bug #80493 by Atsushi Enomoto
8324 * cs-parser.jay: Ignore invalid attribute target.
8326 2007-02-18 Marek Safar <marek.safar@gmail.com>
8328 * cs-tokenizer.cs: Ignore '\0' as white space character.
8330 2007-02-17 Miguel de Icaza <miguel@novell.com>
8332 * cs-parser.jay: Add support for lambda expressions to the mcs
8335 * lambda.cs: Only clone when we are probing, not on the final call
8336 (Compatible is the final call).
8338 * statement.cs (CloneContext): Introduce class to provide block
8339 remapping during clone.
8341 All statements Clone themselves now.
8343 (Clone): special handling for blocks, when we clone a block, we
8344 register the block inside this routine, as children of the block
8345 might trigger a lookup.
8347 * expression.cs: Add support for CloneContext in all expressions.
8349 2007-02-17 Marek Safar <marek.safar@gmail.com>
8351 A fix for bug #80493
8352 * statement.cs: Report ambiguous warning when interfaces are not related.
8354 2007-02-15 Marek Safar <marek.safar@gmail.com>
8356 C# 3.0 extension methods.
8358 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
8359 cannot be used directly.
8361 * class.cs (Class.Emit): Emit extension attribute if any class method
8362 is extension method.
8363 (Method.Define): Add basic extension method validation conditions.
8364 (Method.Emit): Emit extension attribute for method.
8366 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
8367 extension method exists. Currently we follow same approach as Microsoft
8368 does, emit even if a method or a class are private but this can change
8371 * cs-parser.jay: Add handling of `this' keyword in method parameters
8374 * decl.cs (DeclSpace.IsStaticClass): New property.
8375 (MemberCache.FindExtensionMethods): Looks for extension methods with
8376 defined name and extension type.
8378 * doc.cs: Updated after OverloadResolve changes.
8380 * driver.cs: Add new soft reference to System.Core.dll.
8382 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
8383 (ExtensionMethodGroupExpr): Represents group of extension methods.
8385 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
8386 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
8387 to MethodGroupExpr and made non-static for easier customization.
8388 (Invocation.DoResolve): Add extension method lookup when no standard
8390 (MemberAccess.DoResolve): Try extension methods if no member exists.
8392 * modifiers.cs: Add METHOD_EXTENSION modifier.
8394 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
8395 as well as candidate extension type.
8396 (ComputeNamespaces): When assembly constains extension methods registers
8398 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
8399 extension method lookup.
8400 (Namespace.LookupExtensionMethod): Looks for extension method in this
8402 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
8403 find a method which matches name and extensionType.
8405 * parameter.cs (Parameter): Add This modifer.
8406 (HasExtensionMethodModifier): New property.
8407 (Resolve): Add extension parameter check.
8408 (ModFlags): turned to property to exclude this modifier as it is not real
8410 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
8412 * support.cs (ParameterData): Add ExtensionMethodType.
8413 (ReflectionParameters): Implemented ExtensionMethodType interface property.
8415 * typemanager.cs: Add type and ctor extension attribute type.
8417 2007-02-15 Miguel de Icaza <miguel@novell.com>
8419 * report.cs (DisableErrors, EnableErrors): used to prevent error
8420 output when we are "trying" to compile various methods with
8423 * ecore.cs (Expression): Add Clone method that calls the virtual
8424 CloneTo method. The current CloneTo method in Expression throws
8425 an exception so we can track down all the places where this must
8426 be implemented (not using abstract, because that would be a lot of
8427 up-front-work before we can start testing the implementation
8430 Important: we only need Clone capabilities for expressions created
8431 by the parser, as the expressions we will be cloning are
8432 expressions in the pre-resolved state. This vastly simplifies
8435 (SimpleName): Add CloneTo that does nothing.
8436 (EmptyCast): Add CloneTo.
8438 * expression.cs (Binary): Implement CloneTo.
8439 (Invocation.IsApplicable): Store the current ec in
8440 EmitContext.TempEc and restore it on return. This is used so we
8441 do not have to sprinkle hundres of methods with an extra
8442 EmitContext, we know that the only user is the lambda expression
8443 ImplicitConversionExists code.
8445 (Argument): Add Cloning capabilities.
8446 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
8447 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
8448 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
8449 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
8450 IndexerAccess): Add Clone capability.
8452 (LocalVariableReference, This): TODO: needs cloned Block mapping.
8454 (Argument): Add cloning capability.
8456 * assign.cs (Assign): Implement CloneTo.
8458 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
8460 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
8461 version by calling Convert with the EmitContext (that we are
8462 currently storing in ec, this is not great, but will do for now,
8463 to avoid passing EmitContext parameters to hundreds of functions
8464 that do not need them now).
8466 (SetExpression): Remove, it is not needed.
8468 (ContextualReturn): Implement CloneTo.
8470 * statement.cs (Statement): Implement cloning infrastructure,
8471 similar to expressions.
8473 (Block): Partial implementation of Clone for statements.
8475 (Return): Implement clone.
8477 * constant.cs (Constant.CloneTo): New method, does nothing.
8479 * codegen.cs (TempEc): Add a static EmitContext as a temporary
8480 solution, until we decide how to exactly do this.
8482 2007-02-14 Marek Safar <marek.safar@gmail.com>
8484 A fix for bug #80493
8485 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
8486 a property is override we need to use second accessor.
8488 2007-02-13 Marek Safar <marek.safar@gmail.com>
8490 A fix for bug #80418
8491 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
8494 2007-02-13 Marek Safar <marek.safar@gmail.com>
8496 Another fix for bug #80749
8497 * pending.cs: Abstract class has priority over interfaces.
8499 2007-02-13 Marek Safar <marek.safar@gmail.com>
8501 Another fix for bug #80749
8502 * pending.cs: Abstract class has priority over interfaces.
8504 2007-02-13 Marek Safar <marek.safar@gmail.com>
8506 Another fix for bug #80749
8507 * pending.cs: Abstract class has priority over interfaces.
8509 2007-02-13 Marek Safar <marek.safar@gmail.com>
8511 Another fix for bug #80749
8512 * pending.cs: Abstract class has priority over interfaces.
8514 2007-02-13 Marek Safar <marek.safar@gmail.com>
8516 * class.cs Better error message.
8518 * driver.cs: Add shorter versions of -optimize option.
8520 2007-02-13 Martin Baulig <martin@ximian.com>
8522 * class.cs (Constructor.Emit): Check the return value of
8523 ec.ResolveTopBlock() and return on error.
8525 2007-02-13 Raja R Harinath <rharinath@novell.com>
8527 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
8528 message to fix error message regression.
8530 2007-02-12 Marek Safar <marek.safar@gmail.com>
8532 * delegate.cs: Delegate creation expression cannot be of Nullable type.
8534 2007-02-12 Marek Safar <marek.safar@gmail.com>
8536 A fix for bug #80749
8537 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
8538 its parent container.
8540 * class.cs (DefineFieldInitializers): Each initializer can has different
8543 * const.cs: Updated.
8545 2007-02-11 Miguel de Icaza <miguel@novell.com>
8547 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
8548 now all the heavy lifting to check that embedded statements or
8549 expressions have the right form is done in the ContextualReturn.
8551 (ContextualReturn): New class.
8553 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
8554 method that can be invoked to report 201, so we do not replicate
8557 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
8559 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
8560 treating tabs as spaces.
8562 2007-02-09 Marek Safar <marek.safar@gmail.com>
8564 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
8565 * assign.cs: Use full implicit conversion for right side check.
8567 2007-02-09 Marek Safar <marek.safar@gmail.com>
8569 * statement.cs (Switch): Switch over boolean type is not standardized.
8571 2007-02-08 Marek Safar <marek.safar@gmail.com>
8573 A fix for bug #80755
8574 * decl.cs (FindBaseEvent): Don't use method cache for events.
8576 2007-02-07 Marek Safar <marek.safar@gmail.com>
8578 * cs-parser.jay: Better syntax error handling.
8580 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
8581 instead of underlying type value.
8583 2007-02-06 Marek Safar <marek.safar@gmail.com>
8585 * driver.cs: Check define identifier before is registered.
8587 * namespace.cs: Use existing error message.
8589 * report.cs: New warning.
8591 2007-02-06 Marek Safar <marek.safar@gmail.com>
8593 A fix for bug #80742
8594 * expression.cs: Delegate Invoke method can be called directly.
8596 2007-02-06 Marek Safar <marek.safar@gmail.com>
8598 A fix for bug #80676
8599 * class.cs (IsEntryPoint): The Main method can have params modifier.
8601 2007-02-04 Miguel de Icaza <miguel@novell.com>
8603 * parameter.cs (Parameter, Parameters): Add Clone method.
8605 * anonymous.cs (Compatible): Turn method into virtual method, so
8606 LambdaExpression can implement a different behavior.
8608 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
8609 out the basic checking here, so it can be used by
8612 * lambda.cs: Introduce "Compatible" function that will do the
8615 2007-02-02 Marek Safar <marek.safar@gmail.com>
8617 * attribute.cs: Unified one error message.
8619 * class.cs (Class): Use type attributes and not properties to test static
8621 (IsEntryPoint): Don's pass local variable.
8623 * convert.cs: Removed duplicate check.
8625 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
8627 * driver.cs: Don't crash when soft reference does not exist.
8629 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
8630 (UsingEntry): Removed redundant allocation.
8632 * parameter.cs: Add fast path for type parameters.
8634 * support.cs: Don't allocate attribute when it's not used.
8636 2007-01-30 Miguel de Icaza <miguel@novell.com>
8639 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
8640 this into a virtual method, so we can override it in LambdaExpression.
8642 * driver.cs: Improve diagnostics in case of failure.
8644 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
8645 write a function that is slightly more complex and that parses:
8647 type identifier [, type identifier]* )
8649 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
8652 (canEmpty ? i >= 0 : i > 0)
8654 2007-01-30 Raja R Harinath <rharinath@novell.com>
8656 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
8657 exception on possibly valid code.
8659 2007-01-29 Raja R Harinath <rharinath@novell.com>
8661 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
8663 (parse_opt_type_arguments): Remove. It's almost the same as
8665 (parse_namespace_or_typename): Use parse_less_than.
8667 2007-01-28 Miguel de Icaza <miguel@novell.com>
8669 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
8670 this bug took a few hours to find, because the state saved and
8671 restored by PushPosition and PopPosition was ignoring the state of
8672 parse_generic_less_than.
8674 I can also now remove the handling of OP_LT and OP_GT, this solves
8677 * cs-tokenizer.cs: store the location for the ARROW token, we use
8680 (PushPosition, PopPosition): save/restore also `current_token',
8681 restore `parse_generic_less_than' (was missing).
8683 (parse_opt_type_arguments): use parse_type, not
8684 parse_namespace_or_typename to parse types.
8686 * lambda.cs: Empty new file, will eventually have the lambda
8687 expression implementation.
8689 * lambda.test: used to test the internal tokenizer.
8691 * report.cs (FeatureIsNotISO1): Rename from
8692 FeatureIsNotStandardized, because it was about the language level
8693 (1 vs 2) it was not about standarization.
8695 (FeatureRequiresLINQ): New.
8697 * support.cs (SeekableStreamReader): Only require that the reader
8698 is a TextReader, not a StreamReader, so we can plug StringReader.
8700 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
8701 given position in the input stream the following tokens can be
8702 parsed as a type followed by an identifier.
8704 (is_punct): after a '(' if parse_type_and_parameter returns true,
8705 then return a special token OPEN_PARENS_LAMBDA which is used to
8706 avoid reduce/reduce errors in the grammar for the
8707 lambda_expression rules.
8709 (parse_type): implement a type parser inside the
8710 tokenizer, the parser only returns true or false depending on
8711 whether the input at a given position can be parsed as a type.
8713 (peek_token): new method used during type parsing.
8715 2007-01-28 Raja R Harinath <rharinath@novell.com>
8718 * anonymous.cs (ScopeInfo.InflateParameters): New.
8719 (AnonymousContainer.Resolve): Use it to redirect types of
8720 delegate parameters.
8722 2007-01-27 Raja R Harinath <rharinath@novell.com>
8725 * expression.cs (Error_InvalidArguments): Don't use two different
8726 messages for CS1503. Use ExtraInformation and
8727 SymbolRelatedToPreviousError instead.
8730 * decl.cs (DeclSpace.initialize_type_params): Don't access
8731 'type_params' of a partial class directly.
8733 2007-01-26 Miguel de Icaza <miguel@novell.com>
8735 * constant.cs: Removed a handful of out-of-range checks that were
8738 2007-01-25 Marek Safar <marek.safar@gmail.com>
8740 * expression.cs (CheckUselessComparison): Add additional check for char
8743 * namespace.cs: Fixed typo.
8745 2007-01-23 Miguel de Icaza <miguel@novell.com>
8747 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
8748 gone, instead we inline the test, preventing the needless casts to
8749 longs, ulongs and doubles for the parameters, avoiding calls to
8750 methods that overchecked stuff, and instead inlined things
8753 2007-01-20 Marek Safar <marek.safar@gmail.com>
8755 * cs-parser.jay: Better parameter error handling.
8757 2007-01-17 Marek Safar <marek.safar@gmail.com>
8759 A fix for bug #80368, #80522
8760 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
8761 whether array initializer contains constants only.
8762 (ArrayCreation.Emit): Use better formula to decide when
8763 are array initializers for static initialization.
8764 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
8765 have to emit even constants otherwise they are pre-initialized.
8767 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
8768 Raja R Harinath <rharinath@novell.com>
8770 Fix emit order of 'get' vs. 'set'.
8771 * support.cs (Accessors): New.
8772 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
8773 Note the order in which accessors are declared in the source.
8774 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
8775 Refactored from Property.Define and Indexer.Define.
8776 (PropertyBase.DefineAccessors): New helper that calls the above in
8777 appropriate order as noted by the parser.
8778 (Property.Define, Indexer.Define): Update to changes.
8779 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
8781 2007-01-17 Raja R Harinath <rharinath@novell.com>
8783 Fix cs0029-6.cs and gcs0029-2.cs (regression)
8784 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
8785 there's an implicit conversion from the current type to the target
8786 type before converting the underlying constant.
8788 2007-01-16 Marek Safar <marek.safar@gmail.com>
8790 * const.cs (ResolveValue): Updated after constant conversion was made more
8793 * constant.cs (GetAttributableValue): constant to object conversion is
8794 used for attributes only.
8795 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
8796 constant conversions.
8797 (LongConstant.ConvertImplicitly): Ditto.
8799 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
8800 (ImplicitConversionStandard): Handle constant conversion as extra step.
8801 It solves the issue when constant conversion was called indirectly like
8802 inside array initializer and constant folding was skipped.
8804 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
8807 * statement.cs(ImplicitConversionStandard): Updated after constant
8808 conversion was made more generic.
8810 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
8812 * expression.cs (As.DoResolve): Use GenericConstraints instead of
8813 Constraints, solves the problem where the compiler incorrectly
8814 reported that a type parameter was not constrained to a class (Bug
8817 2007-01-14 Marek Habersack <grendello@gmail.com>
8819 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
8821 2007-01-14 Marek Safar <marek.safar@gmail.com>
8823 A fix for bug #80368
8824 * assign.cs (FieldInitializer): New class implements field
8825 initializer statement.
8827 * attribute.cs: Update after FieldMember rename.
8829 * class.cs (PropertyBasedMember): New common class for property based
8831 (InterfaceMemberBase): New base class for all members which can be used as
8832 an interface members.
8833 (MethodCore): Moved really common code to InterfaceMemberBase.
8834 (Method.Define): Equal and GetHasCode detection is relevant for methods
8836 (MethodData.Define): Don't assume that public event implements an
8837 interface automatically.
8838 (MethodData.DefineMethodBuilder): Issue an error even if only extern
8840 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
8841 (FieldMember): Merged with FieldBase.
8842 (EventProperty.AEventPropertyAccessor): New specialization to check whether
8843 event extern modifier can be used.
8844 (EventField.EventFieldAccessor): Moved event field specific code here.
8845 (Event.AllowedModifiers): Even event can be extern.
8846 (Event.FindOutBaseMethod): New override specific to events.
8847 (Indexer.parameters): Reintroduce parameters because base class holds
8848 only properties common data.
8849 (Indexer.CheckForDuplications): Indexers are threated as methods so we
8850 need do extra parameters check.
8852 * const.cs: Update after FieldMember rename.
8854 * decl.cs (MemberCache.FindBaseEvent): New method.
8856 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
8857 to reflect that indexer is now derived from PropertyBased.
8859 * ecore.cs (GetMemberType): Made public.
8860 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
8863 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
8865 * typemanager.cs (CSharpSignature): Correctly print event accessors.
8866 (RegisterEvent): Removed.
8867 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
8868 (GetPrivateFieldOfEvent): Renamed to GetEventField.
8870 2007-01-11 Raja R Harinath <rharinath@novell.com>
8873 * statement.cs (CollectionForeach.TryType): Prefer generic
8874 GetEnumerator over non-generic variant. Fix code to follow comments.
8876 2007-01-09 Raja R Harinath <rharinath@novell.com>
8879 * support.cs (ReflectionParameter): Don't use an invalid index on
8880 the generic parameter data.
8882 2007-01-08 Miguel de Icaza <miguel@novell.com>
8884 * driver.cs: Just add a tiny bit of infrastructure.
8886 2007-01-02 Marek Safar <marek.safar@gmail.com>
8888 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
8889 where field type is struct from current assembly.
8891 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
8894 2007-01-02 Marek Safar <marek.safar@gmail.com>
8896 A fix for bug #80381
8897 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
8900 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
8902 (Namespace.LookupType): Always use core types from corlib when speficied.
8904 * report.cs: A new warning.
8906 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
8907 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
8908 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
8910 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
8911 (InitCoreTypes): Set expression type of object_type and value_type
8912 immediately after lookup.
8914 2007-01-01 Miguel de Icaza <miguel@novell.com>
8916 * cs-tokenizer.cs: Accept Pc class characters (Connector
8917 Punctuation) as valid identifiers. Fixes #78259
8919 * expression.cs (Invocation.DoResolve): Moved the check for the
8920 use of `this' for doing method calls to the Invocation resolution
8921 step, after overload resolution has taken place instead of doing
8922 the check at the low-level `This.DoResolve' level.
8924 The `This.DoResolve'(appens before overload resolution, so it has
8925 no way of knowing if the method that will be called will be
8926 instace or static, triggering an erroneous report for cs0188 (Bug
8929 We now do the check for instance method invocations after we know
8930 what method will be called.
8932 (This.CheckThisUsage): Move the actual use of this structure
8933 checking into its own method and expose it.
8935 * Everywhere that called Error_ValueCannotBeConverted: pass a new
8938 Exceptions: Null.ConvertImplicitly,
8939 Constant.ImplicitConversionRequired as there are too many call
8940 sites for passing the ec.
8942 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
8943 EmitContext, if the value is null, then we do not try to provide
8944 the extra information from the error (If a userdefined conversion
8945 exists, as UserDefinedConversion requires a non null-EmitContext).
8949 2006-12-30 Raja R Harinath <rharinath@novell.com>
8951 * flowanalysis.cs (MyBitVector): Document some invariants.
8952 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
8953 introduced below, and add a couple of others,
8955 2006-12-30 Marek Safar <marek.safar@gmail.com>
8957 * attribute.cs (GetMethodObsoleteAttribute): Uses new
8958 GetPropertyFromAccessor and GetEventFromAccessor.
8960 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
8961 overrides non-obsolete one.
8962 (Indexer.Define): Error message has been moved to the parser.
8964 * cs-parser.jay: Better syntax errors handling.
8966 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
8967 when an invocation has no arguments.
8969 * ecore.cs: Removed not used caching.
8971 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
8974 * report.cs: Add a new warning.
8976 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
8978 * typemanager.cs (enumeration_type): Removed.
8979 (CSharpSignature): Reuses IsSpecialMethod.
8980 (IsEqual): Hack for MS BCL.
8981 (GetPropertyFromAccessor): New method.
8982 (GetEventFromAccessor): New method.
8983 (IsSpecialMethod): Fixed to handle more cases.
8985 2006-12-30 Marek Safar <marek.safar@gmail.com>
8987 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
8988 Made white spaces array static.
8990 * ecore.cs (RemoveGenericArity): Optimized.
8992 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
8994 (MyBitVector.initialize_vector): Simplified.
8996 2006-12-22 Miguel de Icaza <miguel@novell.com>
8998 * ecore.cs: Am not entirely happy with this hack, but it seems to
8999 address the issue in 80257 (a small test case for
9002 I set the MethodGroupExpr.Type to an internal compiler type
9003 (itself in this case) to force the resolution to take place. Why
9004 it does not take place with a null is beyond me.
9006 2006-12-20 Marek Safar <marek.safar@gmail.com>
9008 A fix for bug #80288
9009 * expression.cs (ResolveOperator): Consider user defined conversion for
9010 logical and operator too.
9011 (EmitBranchable): Optimization for logical and when full constant folding
9012 could not be applied but one operand is constant.
9014 2006-12-19 Marek Safar <marek.safar@gmail.com>
9016 * class.cs (GetClassBases): Write 5 times every day, will never use
9017 FullName for error reporting.
9019 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
9021 2006-12-19 Martin Baulig <martin@ximian.com>
9023 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
9024 the symbol file info here.
9026 2006-12-18 Marek Safar <marek.safar@gmail.com>
9028 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
9029 of `elseif' is taking then following sections are not taking.
9030 Fixes an issue reported on mono mailing list.
9032 2006-12-18 Marek Safar <marek.safar@gmail.com>
9034 A fix for bug #80300
9035 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
9036 a caller is not taking.
9038 2006-12-18 Raja R Harinath <rharinath@novell.com>
9040 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
9041 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
9042 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
9043 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
9044 * class.cs: Update to changes.
9046 2006-12-17 Marek Safar <marek.safar@gmail.com>
9048 A fix for bug #79934
9049 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
9052 * class.cs (ResolveMembers): Register an iterator in current container and
9055 2006-12-16 Raja R Harinath <rharinath@novell.com>
9058 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
9059 satisfy a params annotated parameter.
9061 2006-12-16 Marek Safar <marek.safar@gmail.com>
9063 A fix for bug #77014
9064 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
9065 paramters correctly and not rely on hacks in Parameters class.
9066 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
9068 (Invocation.VerifyArgumentsCompat): Ditto.
9069 (Invocation.EmitArguments): Changed to correctly emit params arguments at
9072 * parameter.cs (HasParams): Don't assume that params is the last one.
9074 * support.cs (ReflectionParameters.ctor): Look for params attribute
9076 (ReflectionParameters.ParameterType): Removed hack when we returned last
9077 parameter for out of range parameters.
9078 (ParameterName, ParameterModifier): Ditto.
9080 2006-12-14 Marek Safar <marek.safar@gmail.com>
9082 A fix for bug #79987
9083 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
9084 when assembly is not CLS compliant but type is. I have no idea why is this
9087 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
9089 2006-12-13 Miguel de Icaza <miguel@novell.com>
9091 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
9092 in struct constructors, they are basically no-ops.
9094 2006-12-12 Marek Safar <marek.safar@gmail.com>
9096 * cs-tokenizer.cs (Position): Save preprocessor status too.
9098 2006-12-12 Marek Safar <marek.safar@gmail.com>
9100 A fix for bug #77794
9101 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
9103 2006-12-12 Marek Safar <marek.safar@gmail.com>
9105 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
9107 (pp_expr): Report error for an invalid expression.
9108 (handle_preprocessing_directive): Simplified; add more error checking.
9110 2006-12-11 Marek Safar <marek.safar@gmail.com>
9112 A fix for bug #74939
9113 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
9114 directives handling.
9116 2006-12-10 Marek Safar <marek.safar@gmail.com>
9118 A fix for bugs #80093, and #75984
9119 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
9120 logic, it seems to me as it worked before "by coincidence".
9121 (xtoken): Simplified to use reworked handle_preprocessing_directive.
9122 (cleanup): Enabled endif check.
9124 2006-12-09 Marek Safar <marek.safar@gmail.com>
9126 A fix for bug #80162
9127 * statement.cs (CollectionForeach.TryType): Generics and non-generics
9128 enumerators are never ambiguous.
9130 2006-12-08 Raja R Harinath <rharinath@novell.com>
9133 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
9135 2006-12-06 Marek Safar <marek.safar@gmail.com>
9137 A fix for bug #80144
9138 * class.cs (EventProperty.Define): Explicit implementation means
9139 that an even is used.
9141 2006-12-06 Marek Safar <marek.safar@gmail.com>
9143 Fixes the operators implementation (part II)
9145 * cfold.cs (DoConstantNumericPromotions): Renamed to
9146 DoBinaryNumericPromotions and simplified.
9147 (BinaryFold): Couple of conversion fixes; simplified.
9149 * constant.cs, ecore.cs, literal.cs
9150 (ToType): Renamed to ConvertImplicitly.
9151 (Reduce): Renamed to ConvertExplicitly.
9153 * class.cs, convert.cs: Updated.
9155 * expression.cs: TryReduce doesn't throw an exception.
9157 2006-12-01 Marek Safar <marek.safar@gmail.com>
9159 A fix for bug #80108
9160 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
9163 2006-11-30 Marek Safar <marek.safar@gmail.com>
9165 Fixes unary operators implementation (part I)
9168 * cfold.cs (Error_CompileTimeOverflow): Made internal
9170 * const.cs (IConstant): Changed to use reference to constant and
9171 not constant itself.
9172 Updated IConstant implementations.
9174 * constant.cs (CreateConstant): New factory method.
9175 Updated IConstant implementation.
9177 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
9179 * ecore.cs: Updated to use CreateConstantReference.
9181 * enum.cs: Reflects IConstant changes.
9183 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
9185 * literal.cs (NullConstant): Change to be independently usable.
9187 2006-11-29 Martin Baulig <martin@ximian.com>
9189 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
9190 we need to emit the scope initializer before calling the base .ctor.
9192 * anonymous.cs: Merged back from the new anonymous methods branch.
9193 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
9195 * expression.cs (ParameterReference.DoResolveBase): Create a
9196 "normal" ScopeInfo when capturing parameters rather than using the
9197 root scope; this makes things work with anonymous methods having
9201 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
9203 2006-11-22 Marek Safar <marek.safar@gmail.com>
9205 A fix for bug #79987
9206 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
9207 check to a base class.
9208 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
9209 only when assembly has missing attribute.
9210 * report.cs: Update.
9212 2006-11-21 Marek Safar <marek.safar@gmail.com>
9214 * cs-tokenizer.cs: Merged with gmcs version.
9216 2006-11-20 Marek Safar <marek.safar@gmail.com>
9219 * cs-parser.jay: Better error message when partial keyword is misplaced.
9221 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
9223 A fix for bug #79810
9224 report.cs: CS1058 only applies to 2.0 profile (gmcs).
9225 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
9226 a RuntimeWrappedException by default.
9228 2006-11-18 Marek Safar <marek.safar@gmail.com>
9230 A fix for bug #79843
9231 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
9233 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
9235 2006-11-18 Marek Safar <marek.safar@gmail.com>
9237 * driver.cs, namespace.cs: Uses faster IndexOf version.
9239 2006-11-17 Marek Safar <marek.safar@gmail.com>
9241 A fix for bug #79941
9242 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
9244 (Operator.Define): Implicit/Explicit operator of same type is duplicate
9245 even if internal name is different.
9246 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
9247 (UserDefinedConversion): Simplified as the operators cannot be internal.
9248 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
9250 (MethodLookup): Replaced EmitContext with parentType.
9251 * expression.cs: Updated.
9253 2006-11-09 Raja R Harinath <rharinath@novell.com>
9255 * driver.cs (BadAssembly): Handle all the ugliness of
9256 DefineDynamicAssembly.
9258 2006-11-08 Raja R Harinath <rharinath@novell.com>
9260 Address parts of #58244 -- most of what's left is in the runtime
9261 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
9262 CS1509 error checks, and handle them for all assembly loads, not
9263 just the first invocation.
9264 (LoadModule): Likewise. Move handling of 'adder_method' ...
9265 * codegen.cs (AssemblyClass.AddModule): ... here.
9267 2006-11-02 Marek Safar <marek.safar@gmail.com>
9269 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
9270 IEnumerable<T> is ambiguous.
9272 2006-10-31 Marek Safar <marek.safar@gmail.com>
9274 A fix for bug #67689
9275 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
9276 GetEnumerator is ambiguous.
9278 * report.cs: Add new warning.
9280 2006-10-29 Marek Safar <marek.safar@gmail.com>
9282 A fix for bug #78602
9283 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9284 to protected member can be nested type.
9286 2006-10-28 Marek Safar <marek.safar@gmail.com>
9288 A fix for bug #78965
9289 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9290 to protected member must derive from current type.
9292 2006-10-27 Marek Safar <marek.safar@gmail.com>
9294 assign.cs: Reuses error method.
9296 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
9297 instead of type for constants.
9298 (Expression.Error_ValueAssignment): Common error method.
9300 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
9303 2006-10-27 Marek Safar <marek.safar@gmail.com>
9305 A fix for bug #79081
9306 * expression.cs (MemberAccess.DoResolve): Check nested type
9309 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
9311 * doc.cs : nested delegates were not handled. Fixed bug #79754.
9313 2006-10-26 Marek Safar <marek.safar@gmail.com>
9315 A fix for bug #76591
9316 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
9318 2006-10-26 Marek Safar <marek.safar@gmail.com>
9320 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
9321 type forwarder of the same type multiple times.
9323 2006-10-26 Raja R Harinath <rharinath@novell.com>
9326 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
9327 instance as an rvalue, even when we later resolve as an lvalue.
9329 2006-10-25 Martin Baulig <martin@ximian.com>
9331 * anonymous.cs: Fix #79673.
9333 2006-10-24 Marek Safar <marek.safar@seznam.cz>
9335 A fix for bug #79666
9336 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
9337 ignored when is optimized (= default value) as its value is already set.
9339 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9341 A fix for bug #79724
9342 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
9343 TypeContainer for type lookup.
9345 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9347 A fix for bug #79231
9348 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
9349 * expression.cs (OverloadResolve): Always convert type name for
9351 (ResolveNamespaceOrType): Don't confuse a nested type with any
9354 2006-10-18 Martin Baulig <martin@ximian.com>
9356 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
9358 2006-10-17 Miguel de Icaza <miguel@novell.com>
9360 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
9361 an int32, but requesting an int64 from the conversion
9363 2006-10-12 Martin Baulig <martin@ximian.com>
9366 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
9368 2006-10-12 Martin Baulig <martin@ximian.com>
9371 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
9373 2006-10-11 Miguel de Icaza <miguel@novell.com>
9375 * convert.cs: Remove broken code: I was doing the "Existance"
9376 tests for Implicit conversions.
9378 2006-10-10 Miguel de Icaza <miguel@novell.com>
9380 * convert.cs: Added one missing case in
9381 ImplicitStandardConversionExists uint64 to intptr.
9385 * typemanager.cs (uintptr_type): another core known type.
9387 * ecore.cs (OperatorCast): routine used to do cast operations that
9388 depend on op_Explicit. We could change some of the Decimal
9389 conversions to use this.
9391 This one has a probe mechanism that checks both types for an op_
9392 which it coudl be used to eliminate two classes: CastToDecimal
9393 and CastFromDecimal.
9395 * convert.cs: Implement the conversions documented in #59800
9397 2006-10-10 Martin Baulig <martin@ximian.com>
9399 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
9400 before RootScope.ResolveMembers().
9402 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
9403 `CurrentType' if appropriate.
9405 2006-10-09 Marek Safar <marek.safar@seznam.cz>
9407 A fix for bug #78568
9408 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
9409 when contains binary operators.
9410 * cs-parser.jay: Updated.
9412 2006-10-09 Martin Baulig <martin@ximian.com>
9415 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
9416 moved that into Define() and also do the other type parameter
9417 checks there. Fixes #79094. Added gtest-292.cs.
9420 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
9421 since that doesn't include type parameters; don't use `Ldelema'
9422 for type parameters. Fixes #78980. Added gtest-293.cs.
9424 2006-10-08 Marek Safar <marek.safar@seznam.cz>
9427 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
9428 conversion is allowed.
9430 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9432 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
9433 error reporting when no error occurs.
9435 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9437 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
9440 2006-10-06 Raja R Harinath <rharinath@novell.com>
9443 * class.cs (DefineTypeBuilder): Check circular dependencies before
9444 setting the parent of the TypeBuilder.
9445 (CheckRecursiveDefinition): Don't use 'BaseType', since
9446 it may not be valid until after DefineTypeBuilder. Use
9447 'base_type' instead.
9449 2006-10-04 Martin Baulig <martin@ximian.com>
9451 Merged the Anonymous Methods patch.
9453 * anonymous.cs, iterators.cs: The new anonymous methods code.
9455 * statement.cs (Variable): New public abstract class.
9456 (LocalInfo.Variable): New public property.
9457 (LocalInfo.ResolveVariable): New public method.
9458 (Block.Flags): Add `IsIterator'.
9459 (Block.AddVariable): Improved the CS0136 check.
9460 (Block.AnonymousChildren): New public property.
9461 (Block.AddAnonymousChild): New public method.
9462 (ToplevelBlock): Update to use the new anonymous method framework.
9463 (ToplevelBlock.ctor): `container' is now a `Block' and not a
9464 `ToplevelBlock'; this is required to correctly implement the
9466 (Fixed, Using): Use `TemporaryVariable' instead of directly
9467 creating the `LocalBuilder'.
9469 * parameter.cs (Parameter.ResolveVariable): New public method.
9470 (Parameters.ResolveVariable): Likewise.
9472 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
9474 * class.cs (TypeContainer): Replaced the `iterators' list and
9475 corresponding methods with a list of `CompilerGeneratedClass'es.
9476 (TypeContainer.ResolveMembers): New public method.
9477 (Method): `IIteratorContainer' has been replaced by
9480 * expression.cs (VariableReference): New public abstract base
9481 class for `LocalVariableReference', `ParameterReference' and
9484 * codegen.cs (EmitContext): Removed `capture_context',
9485 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
9486 (EmitContext.EmitThis): Removed.
9488 * cs-parser.jay: Replace `iterator_container' with
9491 2006-10-04 Martin Baulig <martin@ximian.com>
9493 * generic.cs (GenericMethod): Don't make this abstract.
9494 (Constraints.Clone): Added dummy implementation.
9496 2006-10-04 Raja R Harinath <harinath@gmail.com>
9499 * namespace.cs (LookForAnyGenericType): Avoid nullref on
9500 'declspaces'. Avoid allocating arrays willy-nilly.
9503 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
9504 cases out of the switch.
9506 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9508 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
9509 message when non-generic type is used with the type arguments.
9510 * expression.cs: Updated.
9512 2006-09-28 Raja R Harinath <rharinath@novell.com>
9515 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
9516 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9517 Change semantics slightly. Don't insist on having only one
9518 temporary EmptyExpression -- just throttle the creation of new ones.
9521 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
9522 non-interfaces too. If no methods are found, don't try to create
9525 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9527 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
9530 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
9531 us produce better error message.
9533 2006-09-27 Marek Safar <marek.safar@seznam.cz>
9535 * expression.cs (Binary.ResolveOperator): Warn about a side effect
9536 of the `|' operator.
9538 * report.cs: A new warning added.
9540 2006-09-27 Martin Baulig <martin@ximian.com>
9542 * generic.cs (GenericMethod): Don't make this abstract.
9544 2006-09-27 Martin Baulig <martin@ximian.com>
9547 (InternalErrorException): Added overloaded ctor taking a params array.
9549 2006-09-26 Marek Safar <marek.safar@seznam.cz>
9551 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
9552 Fixed the cases when same error was reported twice.
9554 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
9555 now report symbol information.
9557 2006-09-25 Martin Baulig <martin@ximian.com>
9559 * class.cs: Completely unified with the gmcs version.
9561 2006-09-25 Martin Baulig <martin@ximian.com>
9563 * typemanager.cs (TypeManager.IsNullableType): New public function.
9564 (TypeManager.IsNullableTypeOf): Likewise.
9565 (TypeManager.IsNullableValueType): Likewise.
9567 * class.cs (MethodCore): Added the `GenericMethod' argument from
9568 gmcs and also unified all classes derived from `MethodCore' with gmcs.
9570 2006-09-24 Raja R Harinath <harinath@gmail.com>
9572 * convert.cs: Unify with gmcs version.
9574 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9576 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
9577 verify them as well.
9579 * report.cs: New warning.
9581 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9583 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
9584 for anonymous block with out argument.
9586 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9588 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
9589 not used private events only.
9591 2006-09-23 Marek Safar <marek.safar@seznam.cz>
9593 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
9595 * const.cs (Const.Define): Check for constant type.
9596 (Const.IsConstantTypeValid): Looks for valid constant types.
9598 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
9600 * ecore.cs (EmptyConstantCast): New common class for all constant based
9603 * expression.cs (Is.DoResolve): Handle null constant especially.
9604 (New.DoResolve): Check for new void().
9605 (MemberAccess.DoResolve): Cope with all kind of nulls.
9607 * literal.cs (NullConstant): Uses EmptyConstantCast.
9608 (NullDefault): Based on EmptyConstantCast.
9609 (NullLiteral): Uses EmptyConstantCast.
9611 * statement.cs (Block.ResolveMeta): Check for constant type.
9613 2006-09-22 Martin Baulig <martin@ximian.com>
9615 * delegate.cs, attribute.cs: Merged with the gmcs versions.
9617 2006-09-22 Raja R Harinath <rharinath@novell.com>
9619 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
9623 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
9624 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
9627 2006-09-22 Martin Baulig <martin@ximian.com>
9629 * ecore.cs: Merged with the gmcs version.
9631 * generic.cs (ConstructedType): New dummy class.
9632 (TypeArguments): Don't make this abstract.
9635 (TypeManager.IsGenericTypeDefinition): New method.
9636 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
9638 2006-09-22 Raja R Harinath <rharinath@novell.com>
9640 * expression.cs (ComposedCast): Check for arrays of TypedReference
9641 before creating the type, not after.
9643 2006-09-21 Marek Safar <marek.safar@seznam.cz>
9645 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
9646 after ToType change.
9648 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
9649 when constant must be implicitly convertible.
9651 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
9653 * ecore.cs (NullCast): Derives from NullConstant.
9655 * expression.cs (Is.DoResolve): Removed useless variables.
9656 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
9657 (New.Constantify): Add enum support.
9658 (MemberAccess.DoResolve): Add warning when accessing null constant or
9661 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
9664 * literal.cs (NullConstant): New abstract class with common
9665 functionality for all null specializations.
9666 (NullDefault): Represents default(X) when result can be
9668 (NullLiteral): Updated.
9670 * report.cs: Add new warning.
9672 2006-09-21 Martin Baulig <martin@ximian.com>
9674 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
9676 2006-09-21 Martin Baulig <martin@ximian.com>
9678 * generic.cs (GenericConstraints): New dummy class.
9679 (Constraints): Likewise.
9680 (TypeParameter): Likewise.
9681 (TypeParameterName): Likewise.
9682 (GenericMethod): Likewise.
9684 * typemanager.cs (TypeManager.GetGenericArguments): New method.
9686 * decl.cs: Merged with the gmcs version.
9688 2006-09-21 Raja R Harinath <rharinath@novell.com>
9690 * generic.cs (TypeParameter): Implement IMemberContainer.
9691 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
9693 * rootcontext.cs: Unify with gmcs version.
9695 * report.cs: Unify with gmcs version.
9696 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
9697 from gmcs/generics.cs.
9698 * generics.cs (TypeParameter): New dummy class.
9700 * support.cs: Unify with gmcs version.
9702 2006-09-20 Raja R Harinath <rharinath@novell.com>
9704 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
9705 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
9707 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
9708 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
9709 * mcs.exe.sources: Add generic.cs.
9711 * codegen.cs: Unify with gmcs version.
9713 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
9714 (EmitContext): Add GenericDeclContainer implementation.
9715 * decl.cs (MemberCore, DeclSpace): Likewise.
9716 * namespace.cs: Remove #ifdef GMCS_SOURCE.
9718 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
9719 MCS TypeManager has a corresponding dummy method.
9721 2006-09-19 Martin Baulig <martin@ximian.com>
9723 * expression.cs: Completely merged with the gmcs version.
9725 2006-09-19 Martin Baulig <martin@ximian.com>
9727 * expression.cs (Invocation): Merged with the gmcs version.
9728 (ArrayAccess.GetStoreOpcode): Likewise.
9730 2006-09-19 Martin Baulig <martin@ximian.com>
9733 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
9734 (TypeManager.IsGenericMethodDefinition): Likewise.
9736 2006-09-19 Martin Baulig <martin@ximian.com>
9739 (TypeManager.IsEqual): Moved the gmcs implementation here.
9740 (TypeManager.DropGenericTypeArguments): Likewise.
9741 (TypeManager.DropGenericMethodArguments): Likewise.
9742 (TypeManager.GetTypeArguments): Moved here from gmcs.
9743 (TypeManager.HasGenericArguments): Likewise.
9745 2006-09-19 Martin Baulig <martin@ximian.com>
9747 * expression.cs (Binary): Merged with the gmcs version.
9749 2006-09-19 Martin Baulig <martin@ximian.com>
9751 * expression.cs (Probe, As, Is): Merged with the gmcs version.
9753 2006-09-19 Martin Baulig <martin@ximian.com>
9755 * typemanager.cs: Merged with the gmcs version.
9757 2006-09-16 Raja R Harinath <rharinath@novell.com>
9759 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
9760 * driver.cs: Likewise.
9762 2006-09-16 Marek Safar <marek.safar@seznam.cz>
9765 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
9766 only if parent type is class.
9767 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
9770 2006-09-15 Marek Safar <marek.safar@seznam.cz>
9773 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
9775 * typemanager.cs(CSharpName): Converts NullType to null.
9777 2006-09-15 Martin Baulig <martin@ximian.com>
9780 (TypeManager.GetMethodName): Added mcs implementation.
9781 (TypeManager.IsEqual): Likewise.
9784 (SimpleName.RemoveGenericArity): Added dummy implementation.
9786 * pending.cs: Merged with the gmcs version.
9788 2006-09-15 Martin Baulig <martin@ximian.com>
9790 * statement.cs: Merge with the gmcs version.
9792 2006-09-15 Martin Baulig <martin@ximian.com>
9794 * statement.cs (Switch): Merge with the gmcs implementation
9795 (without nullables), which is newer.
9797 2006-09-15 Martin Baulig <martin@ximian.com>
9799 * statement.cs (Block.Variables): Make this public.
9800 (ToplevelBlock.Parameters): Make this a property.
9801 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
9803 2006-09-15 Martin Baulig <martin@ximian.com>
9805 * namespace.cs: Merge with the gmcs version.
9807 2006-09-15 Martin Baulig <martin@ximian.com>
9809 * decl.cs (MemberName): Minor code cleanups.
9811 2006-09-15 Martin Baulig <martin@ximian.com>
9813 * parameter.cs: Merge with the gmcs version.
9815 2006-09-15 Martin Baulig <martin@ximian.com>
9817 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
9818 and an error in mcs.
9820 2006-09-15 Martin Baulig <martin@ximian.com>
9822 * flowanalysis.cs: Merged from GMCS; added the generics code into
9823 a `GMCS_SOURCE' conditional so we can share this file.
9825 2006-09-08 Martin Baulig <martin@ximian.com>
9827 * typemanager.cs (TypeManager.interlocked_type): New public field.
9828 (TypeManager.int_interlocked_compare-exchange): New public field.
9829 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
9830 enumerator types here and call InitGenericCoreTypes().
9831 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
9832 after calling InitEnumUnderlyingTypes().
9835 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
9836 `classes_second_stage'.
9838 2006-09-14 Marek Safar <marek.safar@seznam.cz>
9840 * assign.cs, ecore.cs, expression.cs: Share error message text.
9841 * class.cs (FieldMember.Define): Check for varible of static type.
9842 * driver.cs (LoadAssembly): Uses error output for errors.
9843 * statement.cs: Updated.
9845 2006-09-08 Marek Safar <marek.safar@seznam.cz>
9847 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
9850 2006-09-07 Martin Baulig <martin@ximian.com>
9853 (MainDriver): Revert r62663 from Marek; see #70506 for details.
9855 2006-08-29 Miguel de Icaza <miguel@novell.com>
9857 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
9859 2006-08-17 Miguel de Icaza <miguel@novell.com>
9861 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
9862 #52019 and #79064, the use of the \uXXXX sequence in source code
9863 to represent unicode characters.
9865 2006-08-15 Marek Safar <marek.safar@seznam.cz>
9867 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
9869 * class.cs, ecore.cs, statement.cs: Merged to one error message.
9871 2006-08-13 Miguel de Icaza <miguel@novell.com>
9873 * assign.cs: Catch attempts to assign to a method groups in += and
9876 2006-08-13 Marek Safar <marek.safar@seznam.cz>
9879 * cs-parser.jay: Don't destroy current array type by typeof of array's.
9881 2006-08-12 Marek Safar <marek.safar@seznam.cz>
9883 * class.cs (Method.Define): Issue a warning when generic method looks like
9885 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
9888 2006-08-09 Marek Safar <marek.safar@seznam.cz>
9890 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
9892 * decl.cs (MemberCache.FindMembers): When container is interface we need to
9893 search all base interfaces as a member can be ambiguous.
9894 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
9895 Constructor member type filter.
9896 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
9897 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
9898 reporting for returned memberinfos.
9899 * report.cs: Updated.
9900 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
9901 version to work on all runtimes.
9902 (TypeManager.RealMemberLookup): Removed members filtering.
9904 2006-08-08 Raja R Harinath <rharinath@novell.com>
9906 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
9907 (PropertyExpr.EmitAssign): Likewise.
9908 * expression.cs (Indirection.EmitAssign): Likewise.
9909 (LocalVariableReference.EmitAssign): Likewise.
9910 (ParameterReference.EmitAssign): Likewise.
9911 (Invocation.EmitArguments): Likewise.
9912 (ArrayAccess.EmitAssign): Likewise.
9913 (IndexerAccess.EmitAssign): Likewise.
9914 (This.EmitAssign): Likewise.
9915 (ConditionalLogicalOperator.Emit): Likewise.
9918 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
9919 instead of ArrayList. If the hashtable has a LocalBuilder, don't
9920 leave it in after returning it.
9921 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
9923 2006-08-06 Marek Safar <marek.safar@seznam.cz>
9925 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
9928 2006-08-03 Raja R Harinath <rharinath@novell.com>
9930 Fix cs0146-3.cs and cs0146-4.cs.
9931 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
9932 enclosing types don't depend on the current type.
9934 2006-08-02 Raja R Harinath <rharinath@novell.com>
9937 * class.cs (TypeContainer.DoDefineMembers): Use
9938 FindBaseMemberWithSameName on Parent, since we're interested in
9939 whether we hide inherited members or not.
9940 (FindBaseMemberWithSameName): Make slightly more robust.
9942 Fix the non-generic testcase from #77396
9943 * decl.cs (DeclSpace.DeclContainer): Remove override.
9945 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
9946 declspaces for doppelgangers too.
9947 (UsingEntry): Implement IResolveContext.
9948 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
9949 'this' as the resolve context.
9950 (LocalAliasEntry): Likewise.
9952 Implement parts of #77403
9953 * roottypes.cs (RootDeclSpace): New. Used to represent the
9954 toplevel declaration space. Each namespace declaration introduces
9955 a "partial" root declaretion space.
9956 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
9957 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
9958 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
9959 from 'current_namespace.SlaveDeclSpace'.
9960 (namespace_declaration): Likewise.
9961 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
9962 check. It can't happen now.
9963 * decl.cs (DeclSpace.LookupType): Likewise.
9964 * driver.cs (MainDriver): Sanity check.
9966 2006-08-01 Raja R Harinath <rharinath@novell.com>
9968 * decl.cs (DeclSpace.FindNestedType): Remove.
9969 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
9970 LookupTypeContainer to get the container of the nested type.
9971 * class.cs (TypeContainer.FindNestedType): Make non-override.
9973 2006-07-31 Raja R Harinath <rharinath@novell.com>
9975 * decl.cs (DeclSpace.PartialContainer): Move field from ...
9976 * class.cs (TypeContainer.PartialContainer): ... here.
9977 (TypeContainer.AddBasesForPart): New helper.
9978 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
9980 * cs-parser.jay (current_class): Convert to DeclSpace.
9981 (struct_declaration, interface_declaration, class_declaration):
9982 Use AddBasesForPart instead of .Bases directly.
9983 * const.cs, iterators.cs: Update to changes.
9985 2006-07-28 Raja R Harinath <rharinath@novell.com>
9987 * class.cs (TypeContainer.AddMemberType): Rename from
9989 (TypeContainer.AddMember): Rename from AddToMemberContainer.
9990 (AddTypeContainer): New. Combine AddClassOrStruct and
9992 (AddPartial): Update. Add 'is_partial' argument.
9993 * roottypes.cs: Update to changes.
9994 * cs-parser.jay (push_current_class): New helper for handling
9995 current_container and current_class.
9996 (struct_declaration, interface_declaration, class_declaration):
9999 2006-07-26 Raja R Harinath <rharinath@novell.com>
10001 * roottypes.cs: Rename from tree.cs.
10003 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
10004 * tree.cs (Tree, ITreeDump): Remove types.
10005 * rootcontext.cs (tree, Tree): Remove fields.
10006 (root, ToplevelTypes): New.
10007 * *.cs: Update to rename.
10009 * tree.cs (Tree.RecordDecl): Remove.
10010 (RootTypes.AddToTypeContainer): Record the toplevel type in its
10012 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
10014 2006-07-23 Raja R Harinath <harinath@gmail.com>
10016 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
10017 DoFlowAnalysis and OmitStructFlowAnalysis here.
10018 (ec.With): Rename from WithUnsafe and generalize.
10019 (ec.WithCheckState): Remove. All users can be handled by 'With'.
10020 (ec.WithFlowAnalyis): New.
10021 * ecore.cs, expression.cs, statement.cs: Update.
10023 2006-07-22 Raja R Harinath <harinath@gmail.com>
10025 * statement.cs (Block.ResolveMeta): Simplify slightly.
10027 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
10028 multiple boolean fields. Convert InUnsafe, constant_check_state,
10029 check_state to flags.
10030 (CheckState, ConstantCheckState): Update.
10031 (InUnsafe): New read-only property.
10032 (FlagsHandle): Rename from CheckStateHandle and convert to handle
10034 (WithUnsafe): New helper similar to WithCheckState.
10035 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
10036 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
10038 2006-07-21 Raja R Harinath <rharinath@novell.com>
10040 Make comparisons use the same IL irrespective of whether they're
10041 in a 'checked' or 'unchecked' context: one of the issues in #78899
10042 * codegen.cs (EmitContext.CheckState): Make read-only property.
10043 (EmitContext.ConstantCheckState): Likewise.
10044 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
10045 helper that implement a save/restore stack for CheckState
10046 values. This is the only way to change check-state.
10047 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
10048 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
10049 (CheckedExpr.EmitBranchable): New forwarding method.
10050 (UnCheckedExpr): Likewise.
10051 * statement.cs (Block.ResolveMeta): Use WithCheckState.
10052 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
10053 (Checked.Resolve, checked.DoEmit): Likewise.
10055 2006-07-20 Miguel de Icaza <miguel@novell.com>
10057 * anonymous.cs: Cache the resolved anonymous delegate, and return
10058 this so that the ResolveTopBlock is only triggered once, not
10061 Currently we trigger ResolvetopBlock twice due to a first pass of
10062 argument check compatibility, and a second pass that does the
10065 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10067 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
10069 * rootcontext.cs (Reset): Add helper_classes.
10071 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10074 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
10077 2006-07-13 Miguel de Icaza <miguel@novell.com>
10079 * statement.cs (Lock): Handle expressions of type
10080 TypeManager.null_type specially. Fixes #78770
10082 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10084 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
10087 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10089 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
10090 for accessors as well.
10091 * ecore.cs (EventExpr): Add AccessorTable.
10093 2006-07-01 Marek Safar <marek.safar@seznam.cz>
10096 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
10097 for CS0122 where appropriate.
10098 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
10100 (Filter): Assembly can be null in the case of top level attributes.
10102 2006-06-25 Marek Safar <marek.safar@seznam.cz>
10106 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
10107 is done at global level.
10109 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10111 A fix for #77002, Implemented TypeForwarder support.
10113 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
10114 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
10115 * typemanager.cs (): Add type_forwarder_attr_type.
10117 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10119 * report.cs: Add CS0469 warning.
10121 2006-06-21 Martin Baulig <martin@ximian.com>
10123 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
10124 the `try'-block, so we also report CS0016 etc. there.
10126 2006-06-21 Martin Baulig <martin@ximian.com>
10129 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
10131 2006-06-21 Martin Baulig <martin@ximian.com>
10133 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
10134 also report CS1686 for parameters.
10136 2006-06-21 Martin Baulig <martin@ximian.com>
10138 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
10139 instead of an error if the value is not implicitly convertible to
10140 the switch types; fixes #77964.
10142 2006-06-21 Raja R Harinath <rharinath@novell.com>
10145 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
10146 FieldBuilder is null.
10149 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
10150 'left' and 'right' before error-checking.
10152 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
10154 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
10156 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
10157 (FieldExpr.DoResolve): likewise.
10158 (PropertyExpr.InstanceResolve): likewise.
10159 (EventExpr.InstanceResolve): likewise.
10161 2006-06-04 Marek Safar <marek.safar@seznam.cz>
10163 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
10164 attribute applicable tests for attribute argument.
10166 2006-06-02 Raja R Harinath <rharinath@novell.com>
10169 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
10170 (Binary.OverloadResolve_PredefinedIntegral): New.
10171 (Binary.OverloadResolve_PredefinedFloating): New.
10172 (Binary.OverloadResolve_PredefinedString): New.
10173 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
10174 Follow the standard more closely, and treat numeric promotions in
10175 terms of overload resolution.
10176 (Binary.CheckShiftArguments): Simplify.
10178 2006-06-01 Raja R Harinath <rharinath@novell.com>
10180 * flowanalysis.cs (MyBitVector): Simplify representation.
10181 (MyBitVector.Clone): Avoid allocating BitArray.
10182 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
10183 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
10184 (*): Update. Change all references to MyBitVector.And and
10185 MyBitVector.Or to &= and |=.
10187 2006-05-29 Raja R Harinath <rharinath@novell.com>
10189 Fix cs0231-[34].cs.
10190 * cs-parser.jay (formal_parameter_list): Extend the pattern below
10191 to param arguments too.
10193 2006-05-26 Miguel de Icaza <miguel@novell.com>
10195 * cs-parser.jay: Catch another parsing form for arglist being
10196 followed by other arguments. Fixes #78313.
10198 2006-05-24 Raja R Harinath <rharinath@novell.com>
10200 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
10201 checking of out parameters to ...
10202 (FlowBranchingToplevel.Merge): ... here.
10203 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
10204 set, propagate the origin upward, and only complain if there was
10206 (FlowBranchingException.AddContinueOrigin): Likewise.
10207 (FlowBranchingException.AddReturnOrigin): Likewise.
10208 (FlowBranchingException.AddGotoOrigin): Likewise.
10210 2006-05-23 Raja R Harinath <rharinath@novell.com>
10212 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
10213 unreachable, skip it.
10214 (FlowBranchingException.Merge): Always propagate jumps, even if
10215 the finally block renders subsequent code unreachable.
10217 2006-05-18 Raja R Harinath <rharinath@novell.com>
10220 * statement.cs (Goto.Resolve): Move responsibility for resolving
10221 'goto' to FlowBranching.AddGotoOrigin.
10222 (Goto.SetResolvedTarget): New. Callback to set the
10223 LabeledStatement that's the target of the goto.
10224 (Goto.DoEmit): Use Leave instead of Br when crossing an
10225 unwind-protect boundary.
10226 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
10227 LookupLabel and adjust to new semantics.
10228 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
10229 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
10230 Goto.SetResolvedTarget to update target.
10231 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
10232 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
10233 AddBreakOrigin & co. Delay propagation until ...
10234 (FlowBranchingException.Merge): ... this.
10236 * statement.cs (Block.Resolve): Always depend on flow-branching to
10237 determine unreachability. Kill workaround that originally emitted
10238 only one statement after an "unreachable" label (see infloop in
10241 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
10242 This is still "wrong", but anything better would probably need a
10243 multi-pass algorithm.
10244 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
10245 usage vector. Force current usage vector to be reachable, to
10246 optimistically signify backward jumps.
10247 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
10249 (FlowBranchingLabeled.Merge): New. If no backward jump was
10250 detected, return the original salted-away usage vector instead,
10251 updated with appropriate changes. Print unreachable warning if
10253 * statement.cs (Block.Resolve): Don't print unreachable warning on
10254 a labeled statement.
10256 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
10258 * driver.cs: Pass filename without path to AssemblyBuilder's
10259 AddResourceFile. Fixes bug #78407.
10261 2006-05-17 Raja R Harinath <rharinath@novell.com>
10263 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
10264 * flowanalysis.cs (FlowBranchingLabeled): ... here.
10265 (FlowBranching.MergeChild): Overwrite
10266 reachability information from Labeled branchings too.
10268 2006-05-16 Raja R Harinath <rharinath@novell.com>
10270 * statement.cs (Goto.Resolve): Merge jump origins here ...
10271 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
10273 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
10274 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
10275 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
10276 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
10278 * statement.cs (Goto.Resolve): ... not here.
10279 (Goto.Emit): Remove CS1632 check.
10281 2006-05-14 Marek Safar <marek.safar@seznam.cz>
10283 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
10286 2006-05-11 Raja R Harinath <rharinath@novell.com>
10288 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
10289 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
10290 (FlowBranchingException.Label): Likewise.
10292 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
10294 (MyBitVector.Or): Use it to avoid losing information (Count).
10295 (FlowBranching.MergeOrigins): Likewise.
10297 * flowanalysis.cs (UsageVector.IsDirty): Remove.
10298 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
10299 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
10300 (UsageVector.ToString): Simplify.
10301 (UsageVector.MergeSiblings): Move here from ...
10302 (FlowBranching.Merge): ... here.
10303 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
10306 2006-05-10 Raja R Harinath <rharinath@novell.com>
10308 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
10309 null bitvector is treated as all-true.
10311 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
10312 (MyBitVector): Rationalize invariants. 'vector != null' implies
10313 that we have our own copy of the bitvector. Otherwise,
10314 'InheritsFrom == null' implies all inherited bits are true.
10316 2006-05-09 Marek Safar <marek.safar@seznam.cz>
10318 * statement.cs (LocalInfo): Add IsConstant.
10319 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
10320 local variable for constants.
10322 2006-05-09 Raja R Harinath <rharinath@novell.com>
10324 * flowanalysis.cs (MyBitVector.Empty): New.
10325 (MyBitVector): Don't allow InheritedFrom to be null.
10326 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
10327 (UsageVector, FlowBranching): Update to changes.
10329 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
10330 recursion. The 'Parent == null' condition isn't sufficient for
10332 (FlowBranching.AddBreakOrigin): Likewise.
10333 (FlowBranching.AddContinueOrigin): Likewise.
10334 (FlowBranching.AddReturnOrigin): Likewise.
10335 (FlowBranching.StealFinallyClauses): Likewise.
10336 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
10337 (FlowBranching.CheckOutParameters): Likewise.
10338 (FlowBranchingToplevel): Terminate all the above recursions here.
10339 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
10340 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
10342 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
10344 (FlowBranchingToplevel): New. Empty for now.
10345 (FlowBranching.MergeTopBlock): Update.
10346 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
10347 branching for the anonymous delegate.
10348 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
10350 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
10351 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
10352 information at the start of the merge. Reorganize.
10354 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10356 * class.cs (MethodData.Define): Method cannot implement interface accessor.
10358 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10360 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
10361 to newly introduced ctor.
10363 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
10364 message to one place.
10365 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
10368 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10370 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
10372 * ecore.cs (Expression.ResolveAsConstant): Updated.
10374 * statement.cs (ResolveMeta): Updated.
10376 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10378 * cs-parser.jay: __arglist cannot be used in initializer.
10380 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10383 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
10386 2006-05-05 Raja R Harinath <rharinath@novell.com>
10388 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
10389 (LabeledStatement): Add 'name' parameter.
10390 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
10391 (Block.AddLabel): Update to changes.
10392 * cs-parser.jay (labeled_statement): Likewise.
10394 * flowanalysis.cs (BranchingType.Labeled): New.
10395 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
10396 (FlowBranchingLabeled): New. Does nothing for now, but will
10397 eventually handle 'goto' flows.
10398 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
10399 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
10400 that's terminated ...
10401 (Block.Resolve): ... here.
10403 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
10404 (UsageVector.MergeFinallyOrigins): Likewise.
10405 (FlowBranching.InTryOrCatch): Likewise.
10406 (FlowBranching.AddFinallyVector): Likewise.
10407 (FlowBranchingException): Update to changes.
10410 * statement.cs (Return.Resolve): Move error checking to ...
10411 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
10412 (FlowBranchingException): Handle return origins like break and
10414 (FlowBranching.UsageVector.CheckOutParameters): Remove.
10416 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10419 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
10422 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10425 * class.cs (MethodData.Define): Do public accessor check only when method
10426 implements an interface.
10428 2006-05-04 Raja R Harinath <rharinath@novell.com>
10430 Remove special handling of 'break'
10431 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
10432 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
10433 (UsageVector.Break): Remove.
10434 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
10436 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
10438 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
10439 UsageVector.Breaks (). Don't set NeedsReturnLabel.
10441 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10444 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
10445 be the interface member.
10447 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10450 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
10451 for emitting small (int) values.
10453 2006-05-03 Raja R Harinath <rharinath@novell.com>
10456 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
10457 control-flow passes through the 'finally' after merging-in all the
10458 control-flows from 'try' and the 'catch' clauses.
10460 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
10461 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
10462 always true at the only non-recursive entry point.
10463 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
10464 FlowBranchingBreakable.
10465 (FlowBranchingLoop): Remove.
10466 * statement.cs (Return.DoResolve): Update to changes.
10469 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
10470 (FlowBranching.CreateBranching): Handle it: create a
10471 FlowBranchingContinuable.
10472 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
10473 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
10474 except that it handles the 'continue' command.
10475 (FlowBranching.UsageVector.MergeOrigins): Rename from
10477 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
10478 except that it overrides AddContinueOrigin.
10479 (FlowBranchingException): Override AddContinueOrigin, similar to
10481 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
10482 Create a new branching around the embedded statement.
10483 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
10484 control flow after the embedded statement.
10485 (Continue.Resolve): Move all error checking to AddContinueOrigin.
10487 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
10488 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
10489 FlowBranchingBreakable.
10490 (FlowBranchingSwitch): Remove.
10493 * statement.cs (Break.Resolve): Simplify. Move responsibility for
10494 error reporting to ...
10495 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
10496 Rename from 'AddBreakVector'. Add new location argument. Return
10497 a bool indicating whether the 'break' crosses an unwind-protect.
10498 (FlowBranchingException.AddBreakOrigin): Add.
10499 (FlowBranchingException.Merge): Propagate 'break's to surrounding
10500 flowbranching after updating with the effects of the 'finally'
10502 (FlowBranchingBreakable): New common base class for
10503 FlowBranchingLoop and FlowBranchingSwitch.
10505 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
10506 embedded statement.
10507 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
10509 2006-05-02 Raja R Harinath <rharinath@novell.com>
10511 * statement.cs (Do.Resolve): If the loop is infinite, set the
10513 (While.Resolve, For.Resolve): Set a barrier after the embedded
10514 statement. There's no direct control flow that goes from the end
10515 of the embedded statement to the end of the loop.
10516 * flowanalysis.cs (FlowBranching.Infinite): Remove.
10517 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
10518 above ensure that the reachability is correctly computed.
10520 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
10521 (UsageVector.MergeBreakOrigins): If the current path is
10522 unreachable, treat it as if all parameters/locals are initialized.
10523 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
10524 infinite loops before merging-in break origins.
10526 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
10527 (Reachability.Reachable): Split part into ...
10528 (Reachability.Unreachable): ... this. Simplify.
10529 (Reachability.IsUnreachable): Use 'Unreachable' instead.
10531 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
10532 (Reachability.SetThrowsSometimes): Likewise.
10533 (FlowBranchingBlock.MergeTopBlock): Don't compare against
10534 TriState.Always, use corresponding property.
10535 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
10536 (Block.Resolve): Likewise. Remove some redundant checks.
10538 2006-05-02 Raja R Harinath <harinath@gmail.com>
10540 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
10541 (Reachability.Meet): Don't bother checking AlwaysThrows --
10542 barrier is always set.
10543 (FlowBranchingBlock.Merge): Likewise.
10545 2006-05-01 Raja R Harinath <harinath@gmail.com>
10547 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
10548 checks for unreachable.
10550 2006-05-01 Marek Safar <marek.safar@seznam.cz>
10553 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
10555 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
10556 whether field is really assigned.
10558 2006-04-30 Raja R Harinath <harinath@gmail.com>
10560 * flowanalysis.cs (Reachability): Make 4-argument constructor
10562 (Reachability.Meet): Rename from 'And'. Remove static variant.
10563 (Reachability.Always): Rename from the highly misleading
10564 'Reachability.Never'.
10565 (FlowBranching.Merge): Update to changes. Mark an impossible
10566 situation with a 'throw'.
10567 (*): Update to changes.
10569 2006-04-29 Raja R Harinath <harinath@gmail.com>
10571 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
10572 Remove 'Undefined'.
10573 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
10574 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
10575 (*): Update to changes.
10576 * statement.cs: Update to changes.
10578 2006-04-28 Marek Safar <marek.safar@seznam.cz>
10581 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
10583 2006-04-28 Raja R Harinath <harinath@gmail.com>
10585 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
10588 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
10589 argument to two arguments: an usage-vector and a bool. Move call
10590 to FlowBranching.Merge () ...
10591 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
10593 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
10594 handling of loop and switch reachability to ...
10595 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
10597 2006-04-27 Raja R Harinath <harinath@gmail.com>
10599 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
10600 handling to FlowBranchingLoop.InLoop.
10601 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
10603 2006-04-26 Marek Safar <marek.safar@seznam.cz>
10606 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
10607 anonymous method is allowed from AnonymousContainer here.
10609 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
10611 2006-04-24 Raja R Harinath <rharinath@novell.com>
10614 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
10616 2006-04-23 Marek Safar <marek.safar@seznam.cz>
10619 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
10620 (DoubleConstant.Reduce): Ditto.
10622 2006-04-23 Raja R Harinath <rharinath@novell.com>
10624 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
10625 Remove 'lvalue_right_side' argument. Move parts to ...
10626 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
10627 (LocalVariable.DoResolveLValue): ... these.
10629 2006-04-21 Raja R Harinath <rharinath@novell.com>
10632 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
10633 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
10634 (LocalVariableReference.DoResolveBase): Use it to implement new
10636 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
10637 (Argument.Resolve): Simplify. Move CS1510 check ...
10638 * ecore.cs (Expression.ResolveLValue): ... here.
10639 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
10640 (PropertyExpr.DoResolveLValue): Likewise.
10641 (FieldExpr.Report_AssignToReadonly): Likewise.
10642 (FieldExpr.DoResolve): Add 'out_access' argument. Use
10643 LValueMemberAccess or LValueMemberOutAccess on instance depending
10645 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
10646 DoResolve as appropriate.
10648 2006-04-20 Raja R Harinath <rharinath@novell.com>
10651 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
10652 implicit conversions on 'out' and 'ref' arguments.
10654 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
10655 improve clarity. Remove dead code.
10658 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
10659 (Catch.Resolve): Resolve VarBlock if it exists.
10661 2006-04-19 Miguel de Icaza <miguel@novell.com>
10663 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
10664 twice, this was some residual code, the enumerator was emitted
10665 properly in the two branche of if later.
10667 2006-04-19 Raja R Harinath <rharinath@novell.com>
10669 * expression.cs (Cast.ResolveLValue): Remove. The result of a
10670 cast is never an lvalue.
10671 (Cast.DoResolve, Cast.ResolveRest): Combine.
10672 (Argument.Emit): Simplify slightly. Move 'Expr is
10673 IMemoryLocation' check ...
10674 (Argument.Resolve): ... here.
10675 (Argument.Error_LValueRequired): Remove. Inline into only user.
10677 Simplifications. Fix cs0191-2.cs
10678 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
10679 CS1649 and CS1651 to ...
10680 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
10681 the actual selection of the error code and message to a lookup
10682 table. Add a dummy return value to simplify callsites.
10683 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
10684 readonly fields of other instances of the same type. Move CS0197
10686 * expression.cs (Argument.Resolve): ... here. Simplify code.
10687 Ensure that ec.InRefOutArgumentResolving is only set during LValue
10688 resolution of an out or ref argument. The code simplification
10689 above uses this invariant.
10691 2006-04-18 Raja R Harinath <rharinath@novell.com>
10693 Possibly fix #77752. Fix cs1690-[4-7].cs.
10694 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
10695 CheckMarshallByRefAccess. Drop parameter.
10696 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
10698 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
10699 InstanceExpression.
10700 * report.cs (AllWarnings): Add CS1690.
10701 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
10702 for ref access too.
10703 (LocalVariableReference.DoResolveBase): Update.
10705 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10707 * class.cs (MethodOrOperator): Moved common parts from method class.
10708 detect obsolete attributes.
10709 (Method.Define): Simplified as it reuses code from base.
10710 (Constructor.ValidAttributeTargets): Fixed issue found during
10712 (Destructor.ValidAttributeTargets): Fixed issue found during
10714 (Operator): Finished refactoring set off by #78020. Operator class is now
10715 ordinary method class.
10717 * anonymous.cs: Updated.
10719 * decl.cs (DeclSpace): Add IsGeneric
10721 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10723 * class.cs (Constructor.Emit): Don't emit the attributes twice.
10725 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10727 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
10728 detect obsolete attributes.
10729 (Method.CreateEmitContext): Moved to MethodOrOperator.
10731 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10734 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
10735 customized exception to make crash detection easier.
10736 (MethodOrOperator): Started to work on new base class for methods and
10738 (Method): Derives from MethodOrOperator.
10739 (Constructor.Emit): Emits its own attributes.
10740 (AbstractPropertyEventMethod.Emit): Ditto.
10741 (Operator): Derives from MethodOrOperator, will refactor fully in extra
10743 (Operator.Emit): It's temporary more tricky than should be.
10745 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
10747 * report.cs (InternalErrorException): Add ctor with inner exception.
10749 2006-04-08 Marek Safar <marek.safar@seznam.cz>
10752 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
10755 2006-04-07 Marek Safar <marek.safar@seznam.cz>
10758 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
10761 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10763 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
10764 attribute is present and Guid not.
10765 (Interface.ApplyAttributeBuilder): Ditto.
10767 * attribute.cs: Add error message.
10769 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10773 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
10774 sources (it's composite) so hold them in extra array as they are used in
10775 Emit phase only. It worked in the previous versions by mistake.
10776 (Attribute.Emit): Emit attribute for more owners when exist.
10778 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
10779 it has now different behaviour.
10781 2006-04-04 Marek Safar <marek.safar@seznam.cz>
10783 * constant.cs (Constant.IsDefaultInitializer): New method.
10785 * class.cs: Updated.
10787 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
10788 re-initialize default values. It saves KBs almost for every assembly.
10789 Thanks Zoltan for the idea.
10790 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
10791 (ArrayCreation.DoResolve): Resolve only once.
10792 (ArrayCreation.Emit): Emit static initializer only when it is faster.
10793 (ArrayCreation.GetAttributableValue): Cope with optimized values.
10795 2006-04-03 Zoltan Varga <vargaz@gmail.com>
10797 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
10800 2006-04-01 Marek Safar <marek.safar@seznam.cz>
10802 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
10803 in an embedded statement too.
10805 2006-04-01 Raja R Harinath <rharinath@novell.com>
10808 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
10810 2006-04-01 Marek Safar <marek.safar@seznam.cz>
10814 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
10817 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
10819 2006-03-31 Marek Safar <marek.safar@seznam.cz>
10821 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
10824 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
10825 LocalTemporary change.
10827 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
10829 (ClassOrStruct.DefineFieldInitializers): Implemented static field
10830 initializers optimization.
10831 (ClassOrStruct.TypeAttr): Moved from modifiers.
10832 (Constructor.CheckBase): Don't crash when static ctor has parameters.
10833 (FieldBase.ResolveInitializer): Resolves initializer.
10834 (FieldBase.HasDefaultInitializer): New property.
10836 * cs-parser.jay: Removed message.
10838 * expression.cs (CompilerGeneratedThis): New specialization.
10840 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
10842 2006-03-28 Marek Safar <marek.safar@seznam.cz>
10844 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
10846 2006-03-27 Marek Safar <marek.safar@seznam.cz>
10848 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
10849 be now EnumConstants only.
10851 2006-03-27 Marek Safar <marek.safar@seznam.cz>
10853 * attribute.cs, driver.cs: Reset more caches.
10855 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10857 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
10859 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10861 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
10862 for easier reuse. Updated all overrides.
10863 (IntegralConstant): New base class for all integral constants.
10864 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
10865 of the constant range, report custom error.
10866 (UIntConstant.Reduce): Fixed uint conversion.
10868 * ecore.cs, literal.cs: Reduce updates.
10870 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10874 * class.cs (Constructor.Define): Removed extra if for default ctors.
10875 A patch from Atsushi Enomoto.
10877 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10879 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
10880 GetAttributableValue.
10882 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
10885 * convert.cs (ImplicitConversionRequired): Error message moved to
10888 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
10889 automatic implicit conversion of an output value.
10890 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
10892 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
10894 (TypeOf.GetAttributableValue): Add extra handling for object type.
10896 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
10897 special error message.
10899 2006-03-25 Marek Safar <marek.safar@seznam.cz>
10901 * class.cs (Constructor.Emit): Don't crash when struct ctor is
10903 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
10904 compatible with MS runtime.
10906 2006-03-23 Marek Safar <marek.safar@seznam.cz>
10908 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
10909 attribute arguments here.
10911 * class.cs (Indexer.Define): The check was moved to attribute class.
10913 2006-03-22 Marek Safar <marek.safar@seznam.cz>
10915 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
10916 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
10919 2006-03-22 Raja R Harinath <rharinath@novell.com>
10921 Support ParameterDefaultValueAttribute in gmcs. Also applied to
10922 mcs to keep code differences small.
10923 * attribute.cs (Attribute.GetParameterDefaultValue): New.
10924 * typemanager.cs (parameter_default_value_attribute_type): New.
10925 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
10928 2006-03-21 Marek Safar <marek.safar@seznam.cz>
10930 * expression.cs (StringConcat.Append): Reverted back to no warning state.
10932 2006-03-21 Marek Safar <marek.safar@seznam.cz>
10934 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
10936 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
10939 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
10941 * doc-bootstrap.cs : fix build.
10943 2006-03-20 Marek Safar <marek.safar@seznam.cz>
10945 * expression.cs (StringConcat.Append): Issue a warning when empty string
10946 is going to append.
10948 2006-03-20 Marek Safar <marek.safar@seznam.cz>
10950 * assign.cs (CompoundAssign.ResolveSource): Removed.
10952 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
10955 * class.cs (TypeContainer.FindMethods): Removed.
10956 (TypeContainer.CheckMemberUsage): Made static.
10958 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
10960 * constant.cs (CheckRange): Removed unused type argument.
10961 (CheckUnsigned): Removed unused type argument.
10963 * cs-parser.jay: Updated after MemberAccess clean up.
10964 Uses Length for empty string test.
10966 * cs-tokenizer.cs: Uses Length for empty string test.
10967 (IsCastToken): Made static.
10968 (is_hex): Made static.
10969 (real_type_suffix): Made static.
10971 * decl.cs (SetupCache): Made static.
10972 (OnGenerateDocComment): Removed unused ds argument.
10974 * delegate.cs (VerifyDelegate): Removed unused argument.
10976 * doc.cs: Uses Length for empty string test.
10978 * driver.cs: Uses Length for empty string test.
10980 * enum.cs (IsValidEnumType): Made static
10982 * expression.cs (EnumLiftUp): Removed unused argument.
10983 (ResolveMethodGroup): Ditto.
10984 (BetterConversion): Ditto.
10985 (GetVarargsTypes): Ditto.
10986 (UpdateIndices): Ditto.
10987 (ValidateInitializers): Ditto.
10988 (MemberAccess.ctor): Ditto.
10989 (GetIndexersForType): Ditto.
10991 * flowanalysis.cs: (MergeFinally): Removed unused argument.
10993 * iterators.cs: Updated after MemberAccess clean up.
10995 * location.cs: Uses Length for empty string test.
10997 * namespace.cs: Uses Length for empty string test.
10999 * report.cs (CheckWarningCode): Made static.
11001 * statement.cs (LabeledStatement): Removed unused argument.
11003 * typemanager.cs (FilterNone): Removed.
11005 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11007 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
11010 * class.cs: Updated.
11012 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11014 * cs-parser.jay.cs: __arglist is not allowed for delegates.
11016 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11020 * expression.cs (VerifyArgumentsCompat): Reverted to double error
11021 reporting, it's more tricky than I thought.
11023 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11027 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
11029 (AnonymousMethod.ImplicitStandardConversionExists): New method.
11030 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
11031 Add more error reporting; Fixed issue with params.
11033 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
11035 * cs-parser.jay: AnonymousMethod requires host container.
11037 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
11039 2006-03-18 Raja R Harinath <harinath@gmail.com>
11041 * class.cs: Change 'TypeContainer ds' constructor argument to
11042 'DeclSpace parent'. Some classes were missed below due to
11043 different naming convention.
11045 * class.cs (MemberCore.Parent): Delete. This makes the
11046 ParentContainer changes below enforceable by the compiler.
11048 Treat pointers to enclosing declaration space as 'DeclSpace', not
11050 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
11051 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
11053 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
11055 (Block.AddThisVariable): Likewise.
11056 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
11057 (AbstractPropertyEventMethod.Emit): Likewise.
11058 (AbstractPropertyEventMethod.EmitMethod): Likewise.
11059 (GetMethod.Define, SetMethod.Define): Likewise.
11060 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
11061 (DelegateMethod.EmitMethod): Likewise.
11063 Fix regression test-partial-13.cs.
11064 Rationalize use of PartialContainer. Ensure that the partial
11065 class semantics can be tied to type-correctness, i.e., any
11066 violation will cause a compile error.
11067 * class.cs, const.cs: Access all fields that belong to class
11068 TypeContainer via ParentContainer. Arguments of EmitContexts and
11069 Resolve()-like functions still use 'Parent'.
11071 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
11072 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
11073 (PropertyMethod.CheckModifiers): Remove unused argument.
11074 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
11077 2006-03-17 Raja R Harinath <harinath@gmail.com>
11079 Make semantics of PartialContainer simpler.
11080 * decl.cs (DeclSpace.IsPartial): Remove.
11081 * class.cs (TypeContainer.IsPartial): Likewise.
11082 (TypeContainer..ctor): Set PartialContainer to point to self.
11083 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
11084 (TypeContainer.FindNestedType): Likewise.
11085 (MemberCore.ParentContainer): Simplify. Remove deprecation.
11087 2006-03-17 Marek Safar <marek.safar@seznam.cz>
11089 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
11091 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11093 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
11096 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11098 * class.cs (Operator.Define): An error for base conversion was not
11099 reported correctly.
11101 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
11103 * iterator.cs : yield break is allowed in try statement which has
11104 catch clauses. Fixed bug #77767.
11106 2006-03-13 Marek Safar <marek.safar@seznam.cz>
11108 A fix for #77593, #77574.
11110 * class.cs (MethodCore.CheckBase): Another if for operator.
11112 2006-03-09 Marek Safar <marek.safar@seznam.cz>
11114 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
11117 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
11118 (DelegateCreation.ImplicitStandardConversionExists): New method for just
11121 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
11124 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
11125 Updated after another emitcontext usage was clean up. It should help us to
11126 synchronize with gmcs easier.
11128 2006-03-04 Marek Safar <marek.safar@seznam.cz>
11132 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
11133 (Event.Define): ditto
11134 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
11136 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
11137 Removed redundant code and set NewSlot for Invoke method too.
11139 * parameter.cs (Parameters.ctor): Add custom, type ctor.
11140 (Parameters.MergeGenerated): New method. Use this method when you merge
11141 compiler generated argument with user arguments.
11143 2006-03-03 Marek Safar <marek.safar@seznam.cz>
11145 * attribute.cs (ResolveAsTypeTerminal): Removed.
11147 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
11148 specialization for predefined types; 30% speed up.
11149 Finally placed obsolete check to right place.
11150 (Expression.ResolveType): Removed.
11152 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
11153 Updated after ResolveType was removed.
11155 * expression.cs (Cast.ctor): Check void cast.
11156 (Binary.ResolveAsTypeTerminal): Is never type.
11157 (Conditional.ResolveAsTypeTerminal): Is never type.
11159 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
11161 2006-03-01 Raja R Harinath <rharinath@novell.com>
11164 * expression.cs (ParameterReference.DoResolveBase): Change return
11166 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
11170 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
11173 * typemanager.cs (GetFullNameSignature): Don't nullref on
11174 protected accessors.
11176 2006-02-27 Marek Safar <marek.safar@seznam.cz>
11178 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
11179 these two separated members to simplify the code.
11180 (Attribute.Resolve): Refactored to use new fields and methods.
11181 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
11182 implemented obsolete attribute checking.
11183 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
11184 implemented obsolete checking again. It look line never ending quest ;-)
11185 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
11187 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
11189 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
11191 *class.cs (Property.Define): Add RegisterProperty call.
11193 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
11194 argument groups (only 2).
11196 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
11197 encoding expression to arguments.
11198 (Expression.ExprClassToResolveFlags): Just turned to property.
11200 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
11201 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
11202 optimized as well as implemented support for zero-length attributes.
11204 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
11205 Add caching of PropertyInfo's.
11207 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11209 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
11210 error multiple times.
11212 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11214 New partial class implementation.
11215 A fix for #77027, #77029, #77403
11217 * attribute.cs (Attributable): Made attributes protected.
11219 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
11220 the replacements of ClassPart and PartialContainer.
11221 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
11222 (TypeContainer.AddInterface): Ditto.
11223 (TypeContainer.AddPartial): The main method for partial classes. It checks
11224 for errors and merges ModFlags and attributes. At the end class is added to
11225 partial_parts list.
11226 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
11228 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
11229 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
11230 from the rest of partial classes.
11231 (TypeContainer.GetClassBases): Simplified.
11232 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
11234 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
11235 (TypeContainer.HasExplicitLayout): Uses Flags now.
11236 (PartialContainer): Removed.
11237 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
11238 (StaticClass): Was merged with Class.
11239 (Class.GetClassBases): class and static class bases are verified here.
11240 (Class.TypeAttr): Added static attributes when class is static.
11241 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
11242 (MemberBase): In some cases we need to call parent container for partial
11243 class. It should be eliminated but it's not easy now.
11245 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
11247 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
11248 partial classed to accumulate class comments.
11249 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
11251 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
11253 * driver.cs (MainDriver): Tree.GetDecl was removed.
11255 * modifiers.cs (Modifiers): Add partial modifier.
11257 * tree.cs (Tree.decl): Removed.
11258 (RootTypes): Started to use this class more often for root types
11261 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11265 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
11266 external interface does not have an attribute.
11268 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11270 Another prerequisites for new partial classs implementation.
11272 * attribute.cs (Attribute.Equal): Implemented.
11273 (Attribute.Emit): Changed as attributes can be applied more than twice.
11274 (Attributes.Emit): Check for duplicate attributes here.
11276 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
11277 as a parameter, clean-up.
11279 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11283 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
11284 contains obsolete attribute check which can in some cases look for base
11285 type of current class which is not initialized yet.
11286 (TypeContainer.BaseType): Replacement of ptype.
11288 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
11290 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11292 First of prerequisites for new partial classs implemention.
11294 * attribute.cs (Attributable): Extended by ResolveContext;
11295 Attributes finally have correct context for resolving in all cases.
11296 (AttachTo): Attribute owner is assigned here.
11298 * codegen.cs (IResolveContext): Introduce new interface to hold
11299 all information needed in resolving phase.
11300 (EmitContext): Implements IResolveContext; more clean-up needed here.
11302 * decl.cs (MemberCore): Implemented IResolveContext.
11304 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
11305 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
11306 parameter.cs, statement.cs, tree.cs, typemanager.cs:
11307 Refactored to use new IResolveContext instead of EmitContext; cleanup
11309 2006-02-06 Miguel de Icaza <miguel@novell.com>
11311 * codegen.cs (EmitScopeInitFromBlock): check here the
11312 capture_context, there is no need to make two calls to the
11315 * anonymous.cs: Add some debugging messages that might help me
11316 track other instances of this problem in the future (the
11317 regression of test 467).
11319 * cs-parser.jay: track the variable block, as we need to initalize
11320 any captured variables declared in this block for the "catch"
11321 portion of the "Try" statement.
11323 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
11324 scope initialization for captured variables.
11326 Also, move the emit for the variables after the block location has
11329 2006-02-06 Marek Safar <marek.safar@seznam.cz>
11331 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
11333 2006-02-02 Miguel de Icaza <miguel@novell.com>
11335 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
11336 commit yesterday, the initialization for the roots is necessary.
11337 What is not necessary is the scope activation.
11339 2006-02-02 Raja R Harinath <rharinath@novell.com>
11341 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
11342 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
11344 (Argument.Resolve): Remove CS0206 checks.
11346 2006-02-01 Miguel de Icaza <miguel@novell.com>
11348 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
11349 scopes for all the roots, the scopes will now be emitted when the
11350 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
11352 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
11353 code. This reduces a lot of existing cruft.
11355 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
11356 that the ScopeInfo is generated as we enter the scope, not at the
11357 time of use, which is what we used to do before.
11359 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
11360 every time a Block is about to be emitted if we have a
11363 2006-02-01 Raja R Harinath <rharinath@novell.com>
11365 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
11367 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
11369 * typemanager.cs (cons_param_array_attribute): Make private.
11370 (Reset): Set it to null.
11371 (InitCoreHelpers): Don't initialize it.
11372 (ConsParamArrayAttribute): New. Initialize it as needed.
11373 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
11375 2006-01-31 Miguel de Icaza <miguel@novell.com>
11377 * expression.cs: There might be errors reported during the
11378 selection of applicable methods. If there are errors, do not
11379 continue execution as it will lead the compiler to crash.
11381 2006-01-30 Miguel de Icaza <miguel@novell.com>
11383 * expression.cs: Member access is not allowed on anonymous
11384 methods. Fixes #77402.
11386 2006-01-30 Raja R Harinath <rharinath@novell.com>
11389 * cs-parser.jay (VariableDeclaration): Don't set
11390 current_array_type to null.
11391 (field_declaration, event_declaration, declaration_statement):
11392 Set it to null here.
11394 2006-01-28 Raja R Harinath <harinath@gmail.com>
11396 * typemanager.cs (GenericParameterPosition): New.
11399 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
11401 * doc.cs : To process "include" elements, first we should create
11402 another list than XmlNodeList, because it could result in node
11403 removal, which could result in that the XmlNodeList gives up
11404 yielding next node.
11406 (Also made code identical to gmcs again.)
11408 2006-01-25 Miguel de Icaza <miguel@novell.com>
11410 * ecore.cs: Introduce an error report that we were not catching
11411 before, if not silent, we must report the error. Gonzalo ran into
11414 2006-01-23 Miguel de Icaza <miguel@novell.com>
11416 A fix for bug: #76957
11418 * iterators.cs (MoveNextMethod.CreateMethodHost): call
11419 ComputeMethodHost before creating the method, this is a new
11422 * anonymous.cs (AnonymousContainer): Now we track all the scopes
11423 that this method references (RegisterScope). The actual scope
11424 where the method is hosted is computed with the ComputeMethodHost
11425 before we create the method.
11427 Moved the Deepest routine here.
11429 (AnonymousContainer.ComputeMethodHost): New routine used to
11430 compute the proper ScopeInfo that will host the anonymous method.
11432 (ScopeInfo): Deal with multiple roots. The problem was that we
11433 did not have a unique root where all ScopeInfos could be hanged
11434 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
11437 Remove AdjustMethodScope which is now computed at the end. Remove
11438 LinkScope which did a partial link, instead link all ScopeInfos
11439 before code generation from the new "LinkScopes" routine.
11441 Simplify all the Add* routines as they no longer need to maintain
11442 the tree, they just need to record that they are using variables
11445 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
11446 routines to produce the forest of ScopeInfo trees.
11448 * class.cs (TypeContainer.AppendMethod): This is just like
11449 AddMethod, but ensures that an interface implementation method
11450 (IEnumerable.XXX) is not inserted at the beginning of the queue of
11451 methods, but at the end.
11453 We use this functionality to ensure that the generated MoveNext
11454 method in the iterator class is resolved/emitted before the
11455 enumerator methods created.
11457 This is required because the MoveNext method computes the right
11458 ScopeInfo for the method. And the other methods will eventually
11459 need to resolve and fetch information computed from the anonymous
11462 2006-01-21 Raja R Harinath <harinath@gmail.com>
11463 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11465 Fix rest of #76995.
11466 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
11467 the 'aliases' hash.
11468 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
11469 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
11471 2006-01-18 Raja R Harinath <rharinath@novell.com>
11473 Fix #76656, cs0231-2.cs.
11474 * cs-parser.jay (formal_parameter_list): Make error case catch
11476 (parenthesized_expression_0): Add CS1026 check.
11477 (invocation_expression): Remove unused { $$ = lexer.Location }.
11479 2006-01-17 Raja R Harinath <rharinath@novell.com>
11482 * cs-parser.jay (statement_expression): Don't list out the
11483 individual statement-expressions. Convert syntax error into
11486 2006-01-16 Raja R Harinath <rharinath@novell.com>
11489 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
11490 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
11491 CheckIntermediateModification.
11492 (FieldExpr.DoResolve): Add new two-argument version that
11493 allows us to resolve the InstanceExpression as an lvalue.
11494 The one-argument variant is now just a wrapper.
11495 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
11496 Resolve the lhs as an lvalue if the it has a value type.
11497 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
11498 from Assign.DoResolve.
11499 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
11500 resolved as an lvalue.
11501 (PropertyExpr.DoResolve): Update.
11502 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
11503 has a value type. Move CS1612 check here from
11504 CheckIntermediateModification.
11505 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
11506 * expression.cs (EmptyExpression.OutAccess): New. Used as the
11507 'right_side' of a ResolveLValue on an 'out' argument.
11508 (EmptyExpression.LValueMemberAccess): New. Used as the
11509 'right_side' of a propagated ResolveLValue on a value type.
11510 (LocalVariableReference.DoResolveBase): Recognize
11511 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
11513 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
11514 EmptyExpression.Null.
11516 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
11518 * typemanager.cs : added IsGenericParameter(). In mcs it always
11520 * doc.cs : for generic parameters, use GenericParameterPosition,
11523 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
11525 * expression.cs: Fix Console.WriteLine ((this = x).foo);
11527 2006-01-12 Miguel de Icaza <miguel@novell.com>
11529 This fixes the problem where we used ldfld instead of ldflda to
11530 load the "THIS" pointer on captured parameters, when THIS is a
11531 value type. See bug #77205.
11533 * iterators.cs (CapturedThisReference.Emit): Pass false to
11534 EmitThis (we do not need the address).
11536 * codegen.cs (EmitThis): it needs to know whether we need the
11537 address of `this' or not. This is used by value types.
11539 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
11540 every other call passes false.
11542 2006-01-12 Raja R Harinath <rharinath@novell.com>
11545 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
11547 * expression.cs (Invocation.OverloadResolve): Update.
11548 (Invocation.DoResolve): Avoid double resolution of invocation.
11550 2006-01-11 Raja R Harinath <rharinath@novell.com>
11553 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
11554 unary negation of floating point types as 0-expr; negation cannot
11555 overflow in floating point types.
11558 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
11559 on operands of 'void' type.
11562 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
11563 and ExclusiveOr for boolean constants too.
11565 2006-01-09 Raja R Harinath <rharinath@novell.com>
11568 * expression.cs (Invocation.OverloadResolve): Replace reflected
11569 override methods with their base virtual methods, rather than
11570 skipping over them.
11571 * typemanager.cs (TypeManager.GetOverride): New.
11573 2006-01-05 Jb Evain <jbevain@gmail.com>
11575 * class.cs (Property.Define, Indexer.Define): do not tag the
11576 properties as SpecialName | RTSpecialName.
11578 2006-01-04 Miguel de Icaza <miguel@novell.com>
11580 * class.cs (MethodCore.IsDuplicateImplementation): This method was
11581 doing a low-level comparission of parameter types. It was lacking
11582 a check for __argslist.
11584 2005-12-30 Miguel de Icaza <miguel@novell.com>
11586 * expression.cs (ParameterReference.DoResolveBase): Allow
11587 reference parameters if they are local to this block.
11589 This allows the ref and out parameters of a delegate to be used in
11590 an anonymous method, for example:
11592 delegate void set (out int x);
11594 set s = delegate (out int x){
11598 This is used by functionality introduced late in the C# language.
11600 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
11601 method that take ref and out parameters.
11603 Fixes #77119 which was a late change in the spec.
11605 2005-12-23 Miguel de Icaza <miguel@novell.com>
11607 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
11608 parent if its the same scope. Fixes #77060.
11610 2005-12-21 Miguel de Icaza <miguel@novell.com>
11612 * driver.cs: Report the case of no source files and no -out:
11615 2005-12-20 Raja R Harinath <rharinath@novell.com>
11618 * expression.cs (ComposedCast.GetSignatureForError): Define.
11620 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11624 * namespace.cs (NamespaceEntry): Add extern_aliases as a
11625 ListDictionary, to contain the ExternAliasEntry entries (in
11626 addition to the NamespaceEntry.aliases hashtable). This field is
11627 shared between the original entry and its doppelganger (bodyless
11629 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
11630 extern_aliases field.
11631 (NamespaceEntry.Lookup): Move the IsImplicit check after the
11632 lookup in extern_aliases.
11634 2005-12-16 Raja R Harinath <rharinath@novell.com>
11637 * class.cs (TypeContainer.Mark_HasEquals): New.
11638 (TypeContainer.Mark_HasGetHashCode): New.
11639 (ClassPart): Override them.
11640 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
11643 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
11644 'parent' argument to the base constructor.
11646 Remove all mention of TypeContainer from decl.cs.
11647 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
11648 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
11649 (DeclSpace.DeclSpace): Likewise.
11650 (DeclSpace.DefineMembers): Remove unused argument.
11651 * cs-parser.jay (pop_current_class): Update to changes. Simplify
11652 debugging check -- we don't care if the debug code throws an
11653 InvalidCastException instead of an InternalErrorException.
11654 * class.cs (TypeContainer.DefineMembers): Update to changes.
11655 (TypeContainer.DoDefineMembers): Likewise.
11656 (TypeContainer.GetMethods): Likewise.
11657 (PropertyMember.Define): Likewise.
11658 (MemberBase.Parent): New property that forwards to
11659 MemberCore.Parent, but ensures that we get a TypeContainer.
11660 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
11661 (RootContext.PopulateTypes): Likewise. Remove special case code
11662 for !RootContext.StdLib: DefineMembers is idempotent.
11664 2005-12-14 Miguel de Icaza <miguel@novell.com>
11666 * convert.cs (ExplicitConversionCore): Check the return value from
11667 ExplicitConversionCore which can return null on failure. Fixes #76914
11669 2005-12-13 Marek Safar <marek.safar@seznam.cz>
11671 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
11673 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
11675 * doc.cs : The search for referenced namespace was insufficient to
11676 get global one as it used to do. Fixed bug #76965.
11678 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
11680 * doc.cs : check name in cref in the last phase that whether it is
11683 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11685 * cs-tokenizer.cs : reverted the latest change: it somehow broke
11688 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11690 * doc.cs : so it turned out that we cannot skip override check for
11691 interface members. Fixed bug #76954.
11693 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11695 * cs-tokenizer.cs : fixed bug #75984:
11696 - #warning and #error should not be handled when the source line
11698 - #line is not checked strictly when the source line is disabled.
11699 - #define and #undef is on the other hand checked strictly at any
11702 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
11704 * cs-tokenizer.cs : missing Location (actually, filename) in one of
11707 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11709 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
11711 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
11712 event initializers.
11713 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
11714 (FieldBase.Initializer): Initializer is now optional.
11715 (EventField.Define): Only event field can have initializer.
11717 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
11719 * const.cs (Const): Reuse initializer.
11721 * cs-parser.jay: Updated after FieldBase changes.
11722 Added current_array_type to simplify array initializers.
11724 * ecore.cs (NullCast.IsDefaultValue): Implemented.
11726 * expression.cs, iterators.cs: Updated.
11728 * namespace.cs (NamespaceEntry): Made UsingFound private.
11730 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11732 * parameterCollection.cs: Obsolete, removed.
11733 * parser.cs: Obsolete, removed.
11735 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11738 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
11740 * enum.cs (Enum.Define): Set obsolete context here.
11742 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11745 - FindDocumentedMember() now expects 1) paramList as null
11746 when "we don't have to check the number of parameters" and
11747 2) Type.EmptyTypes when "there is no arguments".
11748 - Introduced FoundMember struct to hold the exact type which was
11749 used to find the documented member (the above change broke
11750 test-xml-044; it might be better just to use DeclaringType than
11751 what MS does, like this change does, but it depends on usage.)
11753 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11755 * doc.cs : documented member might be from DeclaringType for nested
11756 types. Fixed bug #76782.
11758 2005-12-03 Ben Maurer <bmaurer@ximian.com>
11760 * anonymous.cs: Have the param code handle leaving copies on the
11761 stack etc. Allows anonymous params to take part in the assignment
11762 code (++, +=, etc). Fixes bug #76550
11764 * expression.cs: Handle the prepare_for_load/leave_copy by passing
11765 it down to the anon code.
11767 * iterators.cs: Use dummy var here
11769 * codegen.cs: Handle new vars
11771 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11774 * class.cs (MethodData.Define): Set proper Obsolete context.
11776 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
11778 (FieldExpr.DoResolve): Ditto.
11780 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11783 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
11784 parent is not obsolete.
11786 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
11788 * doc.cs : (FindDocumentedMember) find parameterless members first
11789 and get CS0419 in the early stage. Fixed first case of bug #76727.
11791 2005-11-30 Marek Safar <marek.safar@seznam.cz>
11794 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
11795 no error was reported.
11797 *expression.cs (Binary.DoResolve): left can be null.
11799 2005-11-22 Marek Safar <marek.safar@seznam.cz>
11802 * class.cs (MethodData.Emit): Parameters should be labeled first.
11804 2005-11-21 Marek Safar <marek.safar@seznam.cz>
11807 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
11809 2005-11-18 Marek Safar <marek.safar@seznam.cz>
11811 * attribute.cs (AreParametersCompliant): Moved to Parameter.
11813 * class.cs (MethodCore): Parameter clean up.
11814 (IMethodData): Added ParameterInfo.
11815 (MethodData): Parameter clean up.
11816 (Indexer.Define): Parameter clean up.
11828 * typemanager.cs: Parameter clean up.
11830 * delegate.cs (Define): Get rid of duplicated code.
11832 * expression.cs (ParameterReference): Removed useless parameters
11834 (Invocation): Ditto.
11836 * parameter.cs (ParamsParameter): New class, params specialization.
11837 (ArglistParameter): Attemp to separate arglist.
11838 (Parameter): Refactored to be reusable and faster.
11839 (Parameter.Modifier): Made understandable.
11840 (Parameters): Changed to be used as a class for `this' assembly
11841 parameters. Refactored to use new specialized classes.
11843 * support.cs (ParameterData): Added Types property.
11844 (InternalParameters): Deleted.
11846 2005-08-20 Martin Baulig <martin@ximian.com>
11848 Merging this patch from GMCS to fix #75867.
11850 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11851 scope if we don't already have it.
11853 2005-11-17 Martin Baulig <martin@ximian.com>
11856 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
11857 inherit the scope from our parent. Fixes #76653.
11859 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11861 * doc.cs : the previous patch does not actually fix the bug.
11862 PropertyInfo override check is now implemented and really fixed it.
11863 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
11865 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11867 * doc.cs : apply "override filter" also to properties.
11870 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11872 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
11873 no need to check overrides. For classes, omit those results from
11874 interfaces since they must exist in the class. Fixed bug #76726.
11876 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11878 * typemanager.cs : (GetFullNameSignature) differentiate indexers
11879 with different parameters. Fixed the second problem in #76685.
11881 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11883 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
11884 get expected 'protected' access in CheckValidFamilyAccess()).
11887 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11889 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
11890 Fixed bug #76705. CS1569 was incorrectly commented out.
11892 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
11894 * doc.cs : use Invocation.IsOverride() to do real override check.
11895 * expression.cs : made Invocation.IsOverride() internal.
11897 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
11899 * doc.cs : use TypeManager.FindMembers() instead of (possible)
11900 TypeBuilder.FindMembers() and filter overriden base members out.
11903 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11905 * doc.cs : ref/out parameters are represented as '@' (instead of
11906 '&' in type FullName). Fixed bug #76630 (additionally crefs).
11908 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11910 * doc.cs : when there was no '.' in cref to methods in doc comment,
11911 then parameters were missing in the output. Fixed bug #76691.
11913 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11915 * driver.cs : don't output docs when there is an error.
11918 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11921 Now it should detect indexers. Fixed primary concern in bug #76685.
11922 Fixed CS0419 message to not show the identical member signature in
11925 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11927 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
11928 instead of Type.FindMembers() since it does not handle events.
11931 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
11933 * codegen.cs: Fixed typo (speficied -> specified).
11935 2005-11-11 Marek Safar <marek.safar@seznam.cz>
11938 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
11940 2005-11-11 Marek Safar <marek.safar@seznam.cz>
11942 * attribute.cs: Changed error message.
11944 * cs-tokenizer.cs: One more check.
11946 2005-11-10 Marek Safar <marek.safar@seznam.cz>
11948 * statement.cs (Block.Resolve): Ignore empty statement.
11950 2005-11-10 Marek Safar <marek.safar@seznam.cz>
11952 * report.cs: Made error/warning methods more strict to avoid
11955 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
11956 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
11957 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
11958 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
11960 2005-11-08 Marek Safar <marek.safar@seznam.cz>
11962 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
11963 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
11965 * class.cs (TypeContainer.IsComImport): New property.
11966 (Constructor.Define): Create proper ctor for ComImport types.
11968 * expression.cs (New.CheckComImport): Fixed.
11970 2005-11-07 Miguel de Icaza <miguel@novell.com>
11972 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
11973 that a parameter has been captured does not mean that we do not
11974 have to do the rest of the processing. This fixes the second part
11975 of #76592. If there was another anonymous method capturing
11976 values in the past, the Scope would never be set for the second
11977 method that captured the same parameter.
11979 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
11980 properly manipulate the stack. Second part of fix for #76592.
11982 * expression.cs (New): Add support for invoking "new" on
11983 interfaces that have been flagged with the ComImport attribute and
11984 the CoClass. Fixes #76637
11986 * statement.cs (Try.DoEmit): When a variable is captured, do not
11987 try to emit the vi.LocalBuilder variable as it has been captured.
11988 Create a temporary variable and store the results on the
11989 FieldBuilder. Fixes #76642
11991 2005-11-07 Marek Safar <marek.safar@seznam.cz>
11993 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
11995 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
11997 * expression.cs (Binary.DoResolve): Added && optimalization.
11999 * typemanager.cs (AddUserType): Removed useless argument.
12001 2005-11-04 Marek Safar <marek.safar@seznam.cz>
12003 * statement.cs (Block.variables): Uses ListDictionary.
12005 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12008 * class.cs (PartialContainer.EmitType): Customized to emit
12009 security attributes.
12010 (ClassPart.ApplyAttributeBuilder): Transform security attribute
12011 for partial classes.
12013 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12016 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
12017 access has to be fixed.
12019 * typemanager.cs (IsUnmanagedType): Wrong common field type.
12021 2005-11-01 Marek Safar <marek.safar@seznam.cz>
12024 * ecore.cs (NullCast.Reduce): Implemented.
12026 * expression.cs (ArrayCreation.CheckIndices): Correcly check
12029 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
12031 (Foreach.Resolve): Catch null properly.
12033 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12035 * cs-tokenizer.cs: Warning text fix.
12037 * driver.cs: AllWarningNumbers exposed on public interface.
12039 * report.cs (): Reviewed warning numbers.
12040 (IsValidWarning): Use binary search.
12042 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12044 * driver.cs: Implemeted resource visibility.
12045 (Resources): New class for code sharing between /res: and
12048 2005-10-28 Marek Safar <marek.safar@seznam.cz>
12051 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
12054 * convert (Convert.ImplicitReferenceConversion): NullCast holds
12057 * ecore.cs (NullCast): Child is contant only.
12059 * literal.cs (NullLiteral.Reduce): null can be converted to any
12062 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
12064 * driver.cs: Use Encoding.Default as default code page instead
12067 2005-10-27 Raja R Harinath <rharinath@novell.com>
12070 * expression.cs (Invocation.Error_InvalidArguments): Handle
12071 __arglist parameters.
12072 (Invocation.VerifyArgumentsCompat): Likewise.
12073 * support.cs (ReflectionParameters.GetSignatureForError): Print
12074 __arglist parameters.
12075 (InternalParamters.GetSignatureForError): Likewise.
12076 * parameter.cs (Parameters.GetSignatureForError): Likewise.
12078 2005-10-26 Marek Safar <marek.safar@seznam.cz>
12080 * attribute.cs (GetPropertyValue): Made public.
12082 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
12084 Add new property WrapNonExceptionThrows to handle 2.0 assembly
12086 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
12089 * driver.cs: Reflect method name change.
12091 * statement.cs (Try.Resolve): Warn when try has both general
12092 exception handlers.
12094 * typemanager.cs: runtime_compatibility_attr_type new predefined
12097 2005-10-26 Raja R Harinath <harinath@gmail.com>
12100 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
12101 treat it as an empty parameter list.
12103 2005-10-26 Raja R Harinath <rharinath@novell.com>
12106 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
12107 ResolveAsTypeStep silent.
12108 * statement.cs (Block.AddConstant): Mark block as used.
12109 (Block.ResolveMeta): Avoid piling on error messages
12110 if a constant initializer resolution fails.
12112 2005-10-25 Raja R Harinath <rharinath@novell.com>
12114 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
12116 (NamespaceEntry.VerifyAllUsing): New.
12117 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
12118 behaviour. Delegates actual resolution of alias to ...
12119 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
12120 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
12122 * driver.cs (Driver.MainDriver): Update.
12124 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
12125 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
12127 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
12129 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
12130 RootNamespace.DefineNamespacesForAll.
12132 2005-10-24 Raja R Harinath <harinath@gmail.com>
12134 * typemanager.cs (assemblies, external_aliases, modules)
12135 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
12136 (ComputeNamespaces, GetRootNamespace): Remove extra staging
12137 overhead. Move resposibility ...
12138 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
12139 * driver.cs, attribute.cs, codegen.cs: Update to changes.
12141 2005-10-23 Raja R Harinath <harinath@gmail.com>
12143 * namespace.cs (RootNamespace.all_namespaces): Renamed from
12144 cached_namespaces. Improve usage.
12145 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
12146 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
12147 Move from GlobalRootNamespace and simplify.
12148 (RootNamespace.Global): Make instance variable.
12149 (RootNamespace.RootNamespace): Add "alias name" parameter.
12150 (GlobalRootNamespace): Simplify drastically.
12151 (Namespace.Lookup): Don't use GetNamespace.
12152 * typemanager.cs (GetRootNamespace): Rename from
12153 ComputeNamespaceForAlias.
12154 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
12156 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12158 * anonymous.cs (AnonymousContainer): Don't crash when container
12161 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12163 * expression.cs (Binary.DoResolve): Warn when comparing same
12166 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12169 * expression.cs (Binary.DoResolve): It looks like there are no
12170 convetsion rules in enum context.
12172 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12174 Add support for extern alias qualifiers.
12175 * typemanager.cs: Move some LookupTypeReflection code
12176 to namespace.cs, to have cleaner code. Added some methods
12177 to help us keep track of the extern aliased references.
12178 * driver.cs: Add suport for extern alias assemblies on command
12179 line and check for their warnings/errors. Also keep track of the
12180 extern aliased assemblies.
12181 * namespace.cs: Move the global functionality of Namespace
12182 to GlobalRootNamespace/RootNamespace. Now the global namespace
12183 is GlobalRootNamespace.Globa. Also the code moved from
12184 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
12185 Finally added LocalAliasEntry (AliasEntry before) and
12186 ExternAliasEntry, to handle alias statements.
12187 * cs-parser.jay: Add support in the grammar for extern alias
12189 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
12190 Update callings to Namespace (now in GlobalRootNamespace).
12192 2005-10-18 Raja R Harinath <rharinath@novell.com>
12195 * class.cs (TypeContainer.DefineType): Move updating of
12196 topological sort earlier in the code.
12197 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
12199 2005-10-18 Marek Safar <marek.safar@seznam.cz>
12202 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
12204 * constant.cs (Constant.TryReduce): Moved from Cast class.
12205 (Reduce): Made little bit more OO and fixed missing conversions.
12207 * ecore.cs (Reduce): Implemented.
12208 (Binary.EnumLiftUp): New method to upgrade values to enum values.
12210 * literal.cs (Reduce): Implemented.
12212 * class.cs: Reverted Miguel's wrong commit.
12214 2005-10-14 Miguel de Icaza <miguel@novell.com>
12216 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
12218 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
12220 * cs-parser.jay, expression.cs : CS0214 was missing error location
12221 for constants. Fixed bug #76404.
12223 2005-10-11 Marek Safar <marek.safar@seznam.cz>
12226 * convert.cs (ExplicitConversionCore): Fixed object->enum
12229 2005-10-10 Raja R Harinath <rharinath@novell.com>
12231 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
12232 InstanceExpression.
12233 (PropertyExpr.EmitCall): Likewise.
12234 * expression.cs (Invocation.EmitArguments): Handle case where
12236 (Invocation.EmitCall): Avoid allocating temporary variable if
12237 there are no arguments.
12239 2005-10-07 Raja R Harinath <rharinath@novell.com>
12242 * convert.cs (ImplicitConversionStandard): Move conversion of
12243 void* to arbitrary pointer types ...
12244 (ExplicitConversionStandard): .. here.
12245 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
12246 error to always print typenames.
12248 2005-10-07 Raja R Harinath <rharinath@novell.com>
12250 * convert.cs (GetConversionOperator): Rename from
12251 GetConversionOperators. Move operator selection code from ...
12252 (UserDefinedConversion): ... here.
12254 2005-10-06 Marek Safar <marek.safar@seznam.cz>
12256 * convert.cs (ExplicitConversionCore): Removed duplicate enum
12259 2005-10-05 Marek Safar <marek.safar@seznam.cz>
12261 * assign.cs (Assign.DoResolve): Error method changed.
12263 * cfold.cs (DoConstantNumericPromotions): Error method changed.
12265 * const.cs (ResolveValue): Reset in_transit immediately.
12267 * constant.cs: Error method changed.
12269 * convert.cs: Removed useless location parameter.
12270 (ExplicitNumericConversion): Don't do double enum check.
12271 (ExplicitConversionCore): Renamed from ExplicitConversion.
12272 (ExplicitUnsafe): Extracted from ExplicitConversion.
12273 (ExplicitConversion): Uses for error reporting.
12275 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
12277 (ResolveBoolean): Uses common error method.
12278 (CastToDecimal): Get rid of ec.
12279 (CastFromDecimal): Optimized.
12280 (ConvCast): Get rid of ec.
12282 * enum.cs (ResolveValue): Reset in_transit immediately.
12283 (Emit): Return after first error.
12285 * expression.cs: Convert changes.
12287 * literal.cs: Error method changed.
12289 * statement.cs: Error method changed.
12291 2005-10-03 Raja R Harinath <rharinath@novell.com>
12293 * support.cs (SeekableStreamReader.Position): Don't error out when
12294 the requested position is just beyond the end of the current
12297 2005-09-28 Raja R Harinath <rharinath@novell.com>
12299 * support.cs (SeekableStreamReader): Simplify drastically. Don't
12300 try to keep in sync with the byte count of the underlying Stream.
12301 However, this limits us to a window size of 2048 characters: i.e.,
12302 the maximum lookahead of our lexer/parser can be 2048 characters.
12304 2005-09-28 Marek Safar <marek.safar@seznam.cz>
12307 * driver.cs: Fix compilation files with full root path.
12309 2005-09-25 Miguel de Icaza <miguel@novell.com>
12311 * report.cs (SymbolRelatedToPreviousError): Format the output so
12312 it does not use an open parenthesis that is never closed.
12314 * driver.cs: Follow coding guidelines
12316 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12319 * const.cs (Const.ResolveValue): Check for assigning non-null
12320 value to reference type.
12322 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12324 * anonymous.cs: Implemented ExprClassName.
12326 * assign.cs (Assign.DoResolve): Don't chrash when type is not
12329 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
12332 * class.cs (StaticClass.DefineContainerMembers): Report protected
12335 * codegen.cs: if(ed) PRODUCTION.
12337 * convert.cs (Error_CannotImplicitConversion): Better error
12340 * cs-parser.jay: More error checks.
12342 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
12344 * driver.cs (CSCParseOption): Enabled wrong option check.
12346 * ecore.cs (Expression.ExprClassName): Turned to property.
12347 (MemberExpr.CheckIntermediateModification): For checking boxed
12348 value types modification.
12350 * statement.cs (Fixed.Resolve): Expression type must be
12351 convertible to fixed type.
12352 (CollectionForeach.GetEnumeratorFilter,TryType):
12353 Small refactoring for easier error checking.
12355 2005-09-26 Marek Safar <marek.safar@seznam.cz>
12357 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
12360 * class.cs (GeneratedBaseInitializer): New class for customization
12361 compiler generated initializers.
12362 (MemberBase.DoDefine): Check Obsolete attribute here.
12363 (FieldMember.DoDefine): Ditto.
12365 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
12368 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
12369 (MemberCore.GetObsoleteAttribute): Removed argument.
12370 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
12371 (MemberCore.CheckObsoleteType): New helper.
12375 * statement.cs: Updates after MemberCore changes.
12377 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
12378 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
12380 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
12381 obsolete attribute for compiler construct.
12382 (As.DoResolve): Cache result.
12384 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
12386 2005-09-26 Raja R Harinath <rharinath@novell.com>
12389 * expression.cs (This.VerifyFixed): In a value type T, the type of
12390 'this' is T&, iow, 'this' is either an out or ref parameter. In a
12391 value type R, 'this' is treated as a value parameter.
12393 2005-09-22 Miguel de Icaza <miguel@novell.com>
12395 * statement.cs (Lock): Use the TemporaryVariable class instead of
12396 manually using local variables as those do not work when variables
12399 * ecore.cs: Moved the TemporaryVariable class from being a nested
12400 class inside Foreach to be a public class that can be employed in
12403 2005-09-19 Marek Safar <marek.safar@seznam.cz>
12405 * cs-parser.jay: interface_accessors replaced by
12406 accessor_declarations.
12408 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
12411 * statement.cs (GotoCase.Resolve): Convert null constant to
12413 (SwitchLabel.ResolveAndReduce): Ditto.
12414 (SwitchLabel.NullStringCase): Custom null stamp.
12415 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
12417 typemanager.cs (CSharpSignature): Don't skip first argument
12420 2005-09-18 Miguel de Icaza <miguel@novell.com>
12422 * driver.cs: Set InEmacs based on the environment variable EMACS.
12424 * location.cs (InEmacs): in this mode, do not report column
12425 location as it confuses Emacs.
12427 2005-09-16 Marek Safar <marek.safar@seznam.cz>
12429 * cfold.cs, constant.cs, convert.cs, ecore.cs,
12430 expression.cs, iterators.cs, literal.cs: Store constants and
12433 * class.cs (MemberBase.ShortName): Pass location.
12435 * cs-parser.jay: Some location fixes.
12437 * ecore.cs (Expression.Location): Made virtual.
12439 2005-09-05 Miguel de Icaza <miguel@novell.com>
12441 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
12442 if the underlying types are the same, otherwise we need to produce
12443 code that will do the proper cast.
12445 This was exposed by Marek's constant rewrite which produced
12446 invalid code for the call site:
12448 enum X : long { a }
12449 void Method (X v) {}
12453 This fixes test-49.cs
12455 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12457 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
12458 Type/Object should be allowed as well. Fixed bug #75968.
12460 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12462 * expression.cs : (Binary.DoResolve): when one is enum constant and
12463 another is constant 0, then return enum one *as enum type*.
12466 2005-09-02 Raja R Harinath <rharinath@novell.com>
12468 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
12472 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
12473 flow-branching for LocalVariableReferences in case we were invoked
12474 from a MemberAccess.
12475 * expression.cs (LocalVariableReference.VerifyAssigned): New.
12477 (LocalVariableReference.DoResolveBase): ... this.
12478 (MemberAccess.Resolve): Do the check that was disabled during
12481 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12484 (PartialContainer.Create): check abstract/sealed/static strictly
12485 but abstract/sealed can exist only at one side. Fixed bug #75883.
12487 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
12490 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
12491 specified, don't default to UnmanagedType.I4.
12493 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12495 * expression.cs : conditional operator should check possibly
12496 incorrect assign expression. Fixed bug #75946.
12498 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12500 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
12501 Reverting the change. gmcs is much complex than mcs on this matter.
12503 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12505 * cs-tokenizer.cs : To read another token ahead of the actual
12506 consumption, use new SavedToken and cache token instead of moving
12507 back the stream with SeekableStreamReader (it seemed problematic).
12509 driver.cs : Thus use StreamReader directly.
12510 * support.cs : Thus removed SeekableStreamReader.
12512 2005-08-30 Raja R Harinath <rharinath@novell.com>
12515 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
12516 (ScopeInfo.EmitScopeType): Use it to construct field names from
12517 names of captured locals.
12520 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
12521 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
12522 Pass 'target_type' to BoxedCast. Don't default to 'object'.
12523 (ExplicitConversion): Remove enum cases already handled by
12524 implicit conversion. Move implicit conversion check to the beginning.
12525 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
12526 * expression.cs (ArrayCreation.EmitDynamicInitializers):
12527 Don't treat System.Enum as a struct.
12529 2005-08-30 Jb Evain <jbevain@gmail.com>
12531 * attribute.cs: handles as expression in parameters.
12533 2005-08-30 Raja R Harinath <rharinath@novell.com>
12536 * class.cs (TypeContainer.VerifyClsName): Don't use a
12537 PartialContainer when verifying CLS compliance.
12538 (AbstractPropertyEventMethod): Set Parent here, ...
12539 (PropertyMethod): ... not here.
12541 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
12543 * attribute.cs : escaped attribute name should not be allowed to be
12544 resolved (e.g. @class as classAttribute). Fixed bug #75930.
12546 2005-08-29 Raja R Harinath <rharinath@novell.com>
12549 * convert.cs (ImplicitStandardConversionExists): Allow zero also
12550 when converting a long constant to unsigned long.
12551 * expression.cs (Invocation.OverloadResolve): Add sanity check to
12552 detect where IsApplicable and VerifyArgumentsCompat disagree.
12554 2005-08-29 Raja R Harinath <rharinath@novell.com>
12555 and Carlos Alberto Cortez <carlos@unixmexico.org>
12558 * class.cs (TypeContainer.CanElideInitializer): New helper.
12559 (TypeContainer.EmitFieldInitializers): Use it to determine if we
12560 can safely emitting the initializer of a field.
12562 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12564 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
12565 allowed inside a switch (without loop). Fixed bug #75433.
12567 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
12569 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
12570 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
12572 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12574 * driver.cs : kinda reverting the default encoding changes (not exact
12575 revert since I noticed that "codepage:reset" might not work fine).
12577 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12579 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
12580 Location. Now getter and setter store location correctly.
12581 (errors/cs0111-12.cs now reports the expected location.)
12583 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12585 * driver.cs : Use default encoding on the environment.
12586 Removed (now that) extra parameter for SeekableStreamReader.
12587 * support.cs : (SeekableStreamReader) third .ctor() argument for
12588 StreamReader is not required (always true). preamble size could
12589 be acquired in simpler and safe way.
12591 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
12593 * cs-parser.jay: report CS0642 at warning level 3
12594 and report CS0642 for an if else statement also
12595 fixes bug #74745. Patch by John Luke (and a bit
12597 Removed extra CS0642 warning check for "while",
12599 * statement.cs: In Block.Resolve(), CS0642 check
12600 is reimplemented to check a sequence of an empty
12601 statement and a block.
12603 Both fix bug #66777.
12605 2005-08-24 Marek Safar <marek.safar@seznam.cz>
12607 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
12608 detection until I fix it.
12610 * cs-tokenizer.cs: Changed error message.
12612 * cs-parser.jay: Fixed 2 error locations.
12614 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
12615 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
12618 * enum.cs (GetSignatureForError): Fixed.
12620 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
12624 * typemanager.cs (RegisterProperty): Removed.
12626 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
12628 2005-08-24 Raja R Harinath <rharinath@novell.com>
12631 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
12632 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
12634 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12636 * expression.cs : tiny fix is required for not warning positive ulong.
12639 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12641 * expression.cs : add CS0652 check for constant and integral
12642 expression. Fixed bug #53974.
12644 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12646 * expression.cs : in DoNumericPromotions(), check if there is implicit
12647 conversion overload for string (to check CS0034). Fixed bug #52492.
12649 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12651 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
12653 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12655 * ecore.cs : report location when it is *not* Null.
12657 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12663 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
12664 correctly. Fixed bug #75721.
12666 2005-08-23 Raja R Harinath <rharinath@novell.com>
12668 * support.cs (SeekableStreamReader.Position): Avoid an expensive
12669 loop that performs 'min (pos, char_count)'.
12672 * expression.cs (Unary.ResolveOperator): Don't discard implicit
12673 converted value in Operator.OnesComplement.
12675 2005-08-22 Ben Maurer <bmaurer@ximian.com>
12677 * anonymous.cs: If the anon method is pulled into a helper class,
12678 it needs to be `internal' not `private'. Fixes runtime behavior on
12681 2005-08-20 Martin Baulig <martin@ximian.com>
12683 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
12684 scope if we don't already have it.
12686 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
12687 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
12690 2005-08-17 Marek Safar <marek.safar@seznam.cz>
12693 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
12694 is a partial class.
12696 2005-08-16 Marek Safar <marek.safar@seznam.cz>
12698 The big constants rewrite
12699 Fix #75746, #75685 and more
12700 As a side effect saved 1MB for MWF ;-)
12702 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
12703 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
12704 enum based for corlib compilation.
12706 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
12709 * class.cs (FixedField.Define): Use ResolveAsConstant.
12711 * const.cs (IConstant): Interface constants and enums.
12712 (Const.ResolveValue): New method for constant resolvning.
12713 (ExternalConstant): Constants from imported assemblies.
12715 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
12716 conversion; like enums.
12717 (Constant.ToType): Converts this constant to different type.
12718 (Constant.Increment): Adds 1.
12720 * convert.cs (ImplicitConversionRequired): Simplified.
12722 * cs-parser.jay: Create EnumMember directly.
12724 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
12726 * doc.cs (GenerateEnumDocComment): Removed.
12728 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
12729 (ConvertIntLiteral): Removed.
12730 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
12732 * enum.cs (EnumMember): Implement IConstant.
12733 (Enum.IsValidEnumConstant): Removed.
12734 (Enum.GetNextDefaultValue): Removed.
12735 (Enum.FindMembers): Updated.
12736 (Enum.GenerateDocComment): Iterate enum members.
12738 * expression.cs (Cast.TryReduce): Handle enums correctly.
12739 (New.Constantify): Made public.
12740 (MemberAccess.DoResolve): Removed contant specific if(s).
12742 * literal.cs (NullLiteral): Implement new abstract methods.
12744 * statement.cs (GotoCase.Resolve): Use new constant methods.
12745 (SwitchLabel.ResolveAndReduce): Use new constant methods.
12747 * typemanager.cs (LookupEnum): Removed.
12748 (IsEnumType): Fixed to work with corlib.
12749 (RegisterConstant): Removed.
12750 (LookupConstant): Removed.
12751 (GetConstant): Changed to work with IConstant.
12753 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
12755 * location.cs : Fixed overflown (>255) column number.
12757 2005-08-03 Raja R Harinath <rharinath@novell.com>
12759 First cut of the qualified-alias-member feature.
12760 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
12762 * cs-parser.jay (DOUBLE_COLON): New token.
12763 (namespace_or_type_name): Add rule for recognizing
12764 qualified-alias-members.
12765 (primary_expression): Likewise.
12766 (element_access): Allow QualifiedAliasMember as a possible
12767 type-bearing expression.
12768 (local_variable_type, local_variable_pointer_type): Likewise.
12769 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
12770 aliases in the current and enclosing namespace declarations.
12771 (NamespaceEntry.UsingAlias): Add CS0440 warning.
12772 * decl.cs (MemberName.is_double_colon): New.
12773 (MemberName.MemberName): Add new constructor for alias-member.
12774 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
12775 * expression.cs (QualifiedAliasMember): New expression type.
12777 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12779 * location.cs : it borked when no argument was specified.
12781 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12783 * location.cs : tiny ToString() format fix.
12785 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12787 * statement.cs : oops, it was missing.
12789 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12791 A set of fixes for precise line/column location.
12794 "token" field now holds a file/line "delta", a line number offset
12795 from the segment, and a column number. See also:
12796 http://lists.ximian.com/pipermail/mono-devel-list/2004-
12797 December/009508.html
12798 Removed static IsNull. Use instance IsNull property instead.
12799 * cs-tokenizer.cs :
12800 For some tokens it stores Location. For Identifier it stores
12801 LocatedToken which is a pair of string name and location.
12802 Column numbers are adjusted only at getChar().
12804 Use Location.ToString() for reporting (it now contains column).
12806 Largely modified to use LocatedToken instead of
12807 string (IDENTIFIER), and to acquire Location from some tokens.
12808 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
12809 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
12811 Now MemberName holds Location. DeclSpace.ctor() receives Location
12812 as a parameter. Removed extra parameters to all derived classes.
12813 Replaced Location.IsNull() with instance property.
12814 * assign.cs, expression.cs :
12815 Added .ctor() overload that omits Location.
12817 Added "nameEscaped" flag that indicates the identifier was escaped
12818 in the source file. This fixes bug #57047.
12820 2005-08-02 Marek Safar <marek.safar@seznam.cz>
12822 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
12823 New method, looking for lo-case imported cls type.
12825 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
12828 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
12830 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
12832 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
12833 all_imported_types.
12834 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
12836 Optimized to save 3.5 MB for SWF compilation.
12838 2005-08-01 Marek Safar <marek.safar@seznam.cz>
12840 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
12841 (PartialContainer.Create): Moved logic AddToContainer.
12842 (PartialContainer.MarkForDuplicationCheck): Shares name.
12844 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
12847 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
12849 (Namespace.GetSignatureForError): New method.
12851 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
12852 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
12854 2005-08-01 Raja R Harinath <rharinath@novell.com>
12857 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
12858 member lookup rather than qualifier_type, since qualifier_type can
12861 2005-08-01 Marek Safar <marek.safar@seznam.cz>
12863 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
12866 2005-07-31 Miguel de Icaza <miguel@novell.com>
12868 * statement.cs: Copy the local exception into the exception
12869 captured local. Fixes 75674
12871 2005-07-31 Raja R Harinath <harinath@gmail.com>
12874 * expression.cs (Invocation.OverloadResolve): Don't report error
12875 CS1501 if error CS1502 has been reported.
12876 (New.DoResolve): Delegate CS1501 reporting to
12877 Invocation.OverloadResolve.
12880 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
12881 invariant-meaning-in-block property in an enclosing block if
12884 2005-07-29 Marek Safar <marek.safar@seznam.cz>
12886 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
12887 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
12888 (Switch.CheckSwitch): Just save 50kb for SWF.
12890 2005-07-27 Martin Baulig <martin@ximian.com>
12892 * anonymous.cs (CaptureContext.AddField): Added
12893 `AnonymousContainer am' argument; compute its toplevel scope if
12894 it's not already computed. Fixes #75649.
12896 2005-07-26 Raja R Harinath <rharinath@novell.com>
12899 * class.cs (Constructor.Emit): Reset block to null if the block
12902 2005-07-25 Marek Safar <marek.safar@seznam.cz>
12904 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
12906 2005-07-25 Marek Safar <marek.safar@seznam.cz>
12908 * class.cs (MethodData.Define): Check whether accessor implementing
12909 interface is public.
12911 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
12913 2005-07-22 Marek Safar <marek.safar@seznam.cz>
12916 * namespace.cs (LookupType): Moved same type check to...
12918 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
12919 with the same name.
12921 2005-07-21 Raja R Harinath <rharinath@novell.com>
12923 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
12924 already found a typebuilder.
12925 * class.cs (MethodCore.IsDuplicateImplementation): Compare
12926 MemberNames, not strings.
12928 * const.cs (Error_ExpressionMustBeConst):
12929 Rename from Error_EpressionMustBeConst.
12930 * const.cs, class.cs, statement.cd: Update.
12932 2005-07-21 Marek Safar <marek.safar@seznam.cz>
12936 * const.cs (Const.LookupConstantValue): Report missing contant expression
12938 (Error_EpressionMustBeConstant): Only one error method.
12940 * class.cs, statement.c: Updated.
12942 2005-07-20 Raja R Harinath <rharinath@novell.com>
12944 * statement.cs (Block.Flags): Add back HasVarargs.
12945 (Block.flags): Make protected.
12946 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
12948 * typemanager.cs (types, typecontainers, user_types): Remove.
12949 (UserTypes, TypeContainers): Likewise.
12950 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
12951 (CleanUp, Reset): Update.
12952 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
12953 (GetNestedType): Use Type.GetNestedType.
12954 (CoreLookupType): Take two arguments, the namespace and the
12955 basename of the type. Update to use the Namespace.Lookup
12957 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
12958 (RealMemberLookup): Use IsNestedChildOf instead of playing with
12959 string concatenation and substring matches.
12960 * class.cs, enum.cs, delegate.cs: Update to changes.
12962 2005-07-20 Marek Safar <marek.safar@seznam.cz>
12964 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
12965 Expression and made virtual.
12967 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
12968 (ImplicitStandardConversionExists): Fixed `byte' typo ?
12970 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
12972 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
12975 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
12978 2005-07-18 Marek Safar <marek.safar@seznam.cz>
12981 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
12982 AssemblyCultureAttribute is not used on executable.
12985 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
12987 2005-07-16 Raja R Harinath <rharinath@novell.com>
12990 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
12991 New. Reports CS0252/CS0253.
12992 Mostly taken from preliminary patch by Duncak Mak.
12993 (Binary.DoResolveOperator): Store results of operator lookup.
12994 Use them to detect if we need to warn about unintended reference
12997 2005-07-15 Raja R Harinath <rharinath@novell.com>
13000 * namespace.cs (Namespace.Lookup): Add back location parameter.
13001 (Namespace.LookupType): Add CS0436 report. Add location parameter.
13002 * delegate.cs, ecore.cs, expression.cs: Update to changes.
13004 * codegen.cs (EmitContext.DeclSpace): Make readonly.
13005 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
13006 (Namespace.LookupType): ... this.
13007 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
13009 * typemanager.cs (LookupTypeReflection): Remove buggy code that
13010 purported to handle pointers.
13011 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
13014 2005-07-15 Marek Safar <marek.safar@seznam.cz>
13016 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
13019 2005-07-15 Raja R Harinath <rharinath@novell.com>
13021 * namespace.cs (Namespace.Lookup): Drop location parameter.
13022 (NamespaceEntry.LookupAlias): Remove. Merge into ...
13023 (NamespaceEntry.Lookup): ... this.
13024 (NamespaceEntry.Error_AmbiguousTypeReference):
13025 Move here from DeclSpace.
13026 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
13028 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
13029 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
13030 Move to NamespaceEntry.
13031 * delegate.cs, expression.cs: Update to changes.
13033 2005-07-14 Marek Safar <marek.safar@seznam.cz>
13035 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
13036 CheckAttributeType and refactored.
13037 (Attribute.ResolvePossibleAttributeType): Changed to reuse
13038 ResolveAsTypeTerminal error handling.
13039 (ResolveAsTypeTerminal): Introduced because of global attributes extra
13041 (GetSignatureForError): Print errors in same way.
13044 * codegen.cs: Reflect attribute GetSignatureForError change.
13047 * expression.cs: Add silent parameter to ResolveAsTypeStep.
13049 * namespace.cs (UsingEntry): Refactored to make fields private.
13052 statement.cs: Error_UnexpectedKind has extra parameter.
13054 2005-07-14 Raja R Harinath <rharinath@novell.com>
13056 * ecore.cs (IAlias): Remove.
13057 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
13058 that implement the interface.
13059 * namespace.cs (Namespace): Likewise.
13060 (Namespace.declspaces): Renamed from 'defined_names'.
13061 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
13062 DeclSpace instead of an IAlias.
13063 * tree.cs (Tree.AddDecl): Update.
13065 2005-07-12 Raja R Harinath <rharinath@novell.com>
13067 * statement.cs (Block.Flags); Remove HasVarargs.
13068 (Block.HasVarargs): Move to ToplevelBlock.
13069 (Block.ThisVariable, Block.AddThisVariable): Likewise.
13070 (Block.Variables): Make protected. Initialize variable hashtable
13072 (Block.AddVariable): Update.
13073 (Block.Resolve): Update to changes.
13074 (ToplevelBlock.HasVarargs): New boolean.
13075 (ToplevelBlock.ThisVariable): Move here from Block.
13076 (ToplevelBlock.AddThisVariable): Likewise.
13077 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
13078 * expression.cs (This.ResolveBase): Update to changes.
13079 (ArglistAccess.DoResolve): Likewise.
13081 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13084 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
13086 * class.cs (TypeContainer.VerifyMembers): Distinguish between
13087 not used and not used & assigned.
13088 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
13090 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13093 * expression.cs (Is.DoResolve): null is never provided type.
13095 2005-07-08 Marek Safar <marek.safar@seznam.cz>
13098 * cs-parser.jay: Less strict event error rule to catch more errors.
13100 2005-07-08 Martin Baulig <martin@ximian.com>
13102 Fix test-iter-10.cs - distinguish whether we `yield' in a property
13103 gettter (allowed) or setter (not allowed).
13105 * class.cs (Accessor): Implement IIteratorContainer.
13106 (Accessor.Yields): New public field.
13107 (PropertyBase.PropertyMethod.Define): Handle iterators on a
13108 per-accessor basis.
13111 (get_accessor_declaration, set_accessor_declaration): Set the
13112 `yields' flag on the accessor, not the property.
13113 (property_declaration): Do the iterators check on a per-accessor
13114 basis and not for the whole property.
13116 2005-07-08 Martin Baulig <martin@ximian.com>
13118 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
13119 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
13121 2005-07-07 Marek Safar <marek.safar@seznam.cz>
13124 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
13125 (ExtractSecurityPermissionSet): Cope with self referencing security
13126 attributes properly.
13128 * driver.cs (SetOutputFile): Made public property OutputFile.
13130 2005-07-07 Raja R Harinath <rharinath@novell.com>
13133 * class.cs (TypeContainer.first_nonstatic_field): Rename from
13134 has_nonstatic_fields. Make into a FieldBase pointer.
13135 (TypeContainer.AddField): Add CS0282 check.
13136 (TypeContainer.EmitType): Update.
13138 2005-07-06 Miguel de Icaza <miguel@novell.com>
13140 * cs-tokenizer.cs (consume_identifier): Do not create strings to
13141 compare if they start with __.
13143 2005-07-06 Raja R Harinath <rharinath@novell.com>
13145 * statement.cs (Switch.SwitchGoverningType): Only look at
13146 UserCasts that don't need implicit standard conversions to one of
13147 the allowed switch types (Fixes test-322.cs).
13148 (LocalInfo.Resolve): Re-enable sanity-test.
13150 2005-07-06 Marek Safar <marek.safar@seznam.cz>
13152 * cs-tokenizer.cs (consume_identifier): Detect double undescores
13154 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
13156 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
13158 2005-07-06 Raja R Harinath <rharinath@novell.com>
13161 * ecore.cs (SimpleName.GetSignatureForError): Add.
13162 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
13163 (MemberAccess.GetSignatureForError): Add.
13165 2005-07-05 Marek Safar <marek.safar@seznam.cz>
13167 The big error and warning messages review.
13197 * typemanager.cs: Updated.
13199 * class.cs: (MethodCore.SetYields): Moved here to share.
13200 (PropertyMethod.Define): Moved iterator setup here.
13202 * iterators.cs: Add orig_method to have full access to parent
13205 2005-07-05 Raja R Harinath <rharinath@novell.com>
13207 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
13208 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
13209 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
13210 variable of struct type.
13211 * expression.cs (Unary.ResolveOperator): Update to change.
13212 (Indirection.VerifyFixed): Likewise.
13213 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
13214 (ParameterReference.VerifyFixed): Value parameters are fixed.
13215 (This.VerifyFixed): Treat 'this' as a value parameter.
13216 * statement.cs (LocalInfo.IsFixed): Remove.
13218 2005-07-01 Martin Baulig <martin@ximian.com>
13220 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
13221 `ec.EmitThis ()' to get the correct scope.
13223 2005-07-01 Martin Baulig <martin@ximian.com>
13225 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
13226 instance is a ParameterReference; fixes #75299.
13228 2005-07-01 Martin Baulig <martin@ximian.com>
13230 Reverted Marek's latest patch (r46725):
13231 - it contains structural changes which are neither mentioned in
13232 the ChangeLog nor explained anywhere; for example the additional
13233 argument of EmitContext's and Iterator's .ctor's and the
13234 TypeContainer.DefineMembers() change.
13235 - structural changes like this should go in in seperate patches
13236 and not be hidden in a huge patch which just seems to affect
13237 warnings and errors.
13238 a big and hard to understand patch.
13239 - it breaks iterators and causes regressions, for instance in
13242 2005-06-30 Raja R Harinath <rharinath@novell.com>
13245 * expression.cs (Indexers.map): Remove.
13246 (Indexers.Append): Filter out inaccessible setters and getters.
13247 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
13250 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
13251 Refactored from ...
13252 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
13253 (FieldExpr.Emit, PropertyExpr.Emit): Update.
13254 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
13255 * expression.cs (Invocation.EmitCall): Add CS0120 check.
13257 2005-06-30 Marek Safar <marek.safar@seznam.cz>
13260 * class.cs (FieldBase.GetInitializerExpression): One more field
13263 2005-06-28 Miguel de Icaza <miguel@novell.com>
13265 * pending.cs: Do not define a proxy if the base method is virtual,
13266 it will be picked up by the runtime (bug 75270).
13268 2005-06-08 Martin Baulig <martin@ximian.com>
13270 The big Iterators rewrite :-)
13272 * iterators.cs: Rewrite this to use the anonymous methods framework.
13274 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
13275 before the TypeContainers; see 2test-21.cs.
13278 (TypeContainer.DefineType): Don't create a new EmitContext if we
13279 already have one (this only happens if we're an Iterator).
13280 (TypeContainer.Define): Also call Define() on all our iterators.
13281 (Method.CreateEmitContext): Added support for iterators.
13284 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
13285 (AnonymousContainer.CreateMethodHost): Moved here from
13286 AnonymousMethod and made abstract.
13287 (AnonymousContainer.CreateScopeType): New abstract method.
13288 (AnonymousContainer.IsIterator): New public property.
13289 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
13290 get the ScopeTypeBuilder rather than manually defining it here.
13291 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
13294 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
13295 before RootContext.DefineTypes().
13297 * codegen.cs (EmitContext.RemapToProxy): Removed.
13298 (EmitContext.CurrentAnonymousMethod): Changed type from
13299 AnonymousMethod -> AnonymousContainer.
13300 (EmitContext.ResolveTopBlock): Protect from being called twice.
13301 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
13302 (EmitContext.EmitThis): Removed the iterators hacks; use the
13303 anonymous methods framework for that.
13306 (ToplevelBlock.Container): Make this a property, not a field.
13307 (ToplevelBlock.ReParent): New public method; move the
13308 ToplevelBlock into a new container.
13309 (Foreach.TemporaryVariable): Simplify.
13311 2005-06-05 Martin Baulig <martin@ximian.com>
13313 * statement.cs (LocalInfo.CompilerGenerated): New flag.
13314 (Block.AddTemporaryVariable): New public method; creates a new
13315 `LocalInfo' for a temporary variable.
13316 (Block.EmitMeta): Create the LocalBuilders for all the temporary
13318 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
13319 non-iterator variables.
13321 2005-06-05 Martin Baulig <martin@ximian.com>
13323 * statement.cs (Foreach.TemporaryVariable): Create the
13324 LocalBuilder in the Emit phase and not in Resolve since in some
13325 situations, we don't have an ILGenerator during Resolve; see
13326 2test-19.cs for an example.
13328 2005-06-04 Martin Baulig <martin@ximian.com>
13330 **** Merged r45395 from GCS ****
13332 The big Foreach rewrite - Part II.
13334 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
13335 with `PropertyInfo ienumerator_getcurrent'.
13337 * codegen.cs (VariableStorage): Removed.
13340 (Foreach): Derive from Statement, not ExceptionStatement.
13341 (Foreach.CollectionForeach): New nested class. Moved all the code
13342 dealing with collection foreach here.
13343 (Foreach.ForeachHelperMethods): Removed.
13344 (Foreach.TemporaryVariable): Implement IMemoryLocation.
13346 2005-05-23 Martin Baulig <martin@ximian.com>
13348 * statement.cs (Try.DoResolve): Don't create a `finally' if we
13349 don't need to. Fix #75014.
13351 2005-05-20 Martin Baulig <martin@ximian.com>
13353 Merged r44808 from GMCS.
13355 * class.cs (TypeContainer.CircularDepException): Removed.
13356 (TypeContainer.DefineType): Removed the `InTransit' stuff.
13357 (TypeContainer.CheckRecursiveDefinition): Check for circular class
13358 (CS0146) and interface (CS0529) dependencies here.
13360 2005-06-21 Raja R Harinath <rharinath@novell.com>
13362 * expression.cs (Invocation.EmitCall): Fix initialization
13363 'this_call' to reflect current behaviour. Fix indentation.
13365 * convert.cs (FindMostEncompassedType): Add two trivial special
13366 cases (number_of_types == 0 || number_of_types == 1).
13367 (FindMostEncompasingType): Likewise.
13369 2005-06-17 Raja R Harinath <rharinath@novell.com>
13371 Some cleanups preparing for the fix of #75283.
13372 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
13374 (EventExpr.InstanceResolve): Likewise.
13375 (EventExpr.DoResolve): Remove redundant checks.
13377 2005-06-10 Duncan Mak <duncan@novell.com>
13379 * cs-tokenizer.cs (process_directives): New flag for controlling
13380 the processing of preprocessor directives.
13381 (x_token): After seeing a '#', return Token.NONE instead of going
13382 to handle_preprocessing_directive() when not processing
13383 directives. This avoids unnecessary processing during the token peek in
13388 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
13389 the existing error reporting methods instead of Report.Error.
13391 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
13392 after Raja's rewrite.
13394 2005-06-08 Miguel de Icaza <miguel@novell.com>
13396 * class.cs: Small fix.
13398 2005-06-08 Raja R Harinath <rharinath@novell.com>
13401 * class.cs (GetPartialBases): Fix return value check of
13402 part.GetClassBases.
13404 2005-06-07 Raja R Harinath <rharinath@novell.com>
13406 Ensure that partial classes are registered in their enclosing
13407 namespace. Initial part of fix of #75160.
13408 * tree.cs (Tree.RecordDecl): Add new namespace argument.
13409 Register declspace with namespace here, not in
13410 DeclSpace.RecordDecl.
13411 * cs-parser.jay: Pass namespace to RecordDecl.
13412 * class.cs (PartialContainer.Create): Likewise.
13413 (ClassPart.DefineType): New sanity-check. Throws an exception if
13415 * decl.cs (Declspace.RecordDecl): Remove.
13416 * namespace.cs (NamespaceEntry.DefineName): Remove.
13418 2005-06-06 Marek Safar <marek.safar@seznam.cz>
13420 * rootcontext.cs: Reset TargetExt as well.
13422 2005-06-03 Raja R Harinath <rharinath@novell.com>
13424 * ecore.cs (Expression.Resolve): Emit CS0654 error when
13425 -langversion:ISO-1.
13427 2005-06-02 Raja R Harinath <rharinath@novell.com>
13429 Fix #75080, cs0119.cs.
13430 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
13432 (Expression.Resolve): ... this. Use it. Remove bogus code
13433 allowing ExprClass.Type and ExprClass.Namespace for
13434 ResolveFlags.VariableOrValue.
13435 (Expression.Resolve) [1-argument variant]: Change default resolve
13436 flags based on language version.
13437 (Expression.Error_UnexpectedKind): Use a simple string array
13438 rather than an ArrayList.
13439 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
13440 not ExprClass.Type.
13441 (TypeOfVoid.DoResolve): Likewise.
13442 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
13443 flags argument -- it always has the same value.
13445 2005-05-31 Raja R Harinath <rharinath@novell.com>
13448 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
13449 Use it in the error message.
13450 * assign.cs, expression.cs, statement.cs: Update.
13452 2005-05-30 Raja R Harinath <rharinath@novell.com>
13455 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
13456 the "almostMatchedMember" case too.
13457 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
13458 that failed the accessibility checks to 'almost_match'.
13460 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
13462 * attribute.cs: Use internal MethodBuilder methods to set
13463 ExactSpelling and SetLastError on PInvoke methods, instead
13464 of passing them via charset. Fixes #75060.
13466 2005-05-27 Raja R Harinath <rharinath@novell.com>
13468 * parameter.cs (Parameter): Remove TODO comment.
13469 (Parameter.DefineParameter): Remove Location parameter.
13470 (Parameters.LabelParameters): Likewise.
13471 * class.cs (Constructor.Emit): Update to change.
13472 (MethodData.Emit): Likewise.
13473 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
13474 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
13476 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
13479 Removed Parameters.Location and added Parameter.Location instead.
13480 Removed Location parameter from Emit() and GetSignature().
13487 Modified all related calls.
13489 2005-05-26 Raja R Harinath <rharinath@novell.com>
13491 Improve user-defined conversion handling.
13492 * convert.cs (GetConversionOperators): Rewrite. Return only the
13493 applicable operators.
13494 (AddConversionOperators): New. Helper for GetConversionOperators.
13495 (FindMostEncompassedType, FindMostEncompassingType): Verify that
13496 there is only one most encompassed/encompassing type.
13497 (FindMostSpecificSource, FindMostSpecificTarget): Remove
13498 "applicable operator" handling.
13499 (UserConversion): Move cache here from GetConversionOperators.
13500 Directly cache the chosen operator, rather than the whole
13502 (ExplicitNumericConversion): Fix buggy implementation of Decimal
13503 case. Allow conversion of decimal to sbyte and byte too.
13504 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
13505 New static methods. Used to avoid allocating EmptyExpressions in
13508 2005-05-24 Duncan Mak <duncan@novell.com>
13510 * ecore.cs (CastFromDecimal): New class for casting a decimal to
13511 another class, used in Convert.ExplicitNumericConversion.
13512 (CastToDecimal): New class, similar to above, but casts to
13513 System.Decimal, used in Convert.ImplicitNumericConversion and also
13514 in explicit convesion from double/float to decimal.
13516 * convert.cs (ImplicitNumericConversion): Handle implicit
13517 conversions to System.Decimal.
13518 (ExplicitNumericConversion): handle explicit conversions to
13523 2005-05-20 Miguel de Icaza <miguel@novell.com>
13525 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
13526 know the type at this stage, just break through. Fixes #75008
13528 2005-05-19 Martin Baulig <martin@ximian.com>
13531 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
13532 to disable error reporting.
13534 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
13535 here since we don't want to report an error; see the new test-336.cs.
13537 2005-05-19 Raja R Harinath <rharinath@novell.com>
13539 * statement.cs (ToplevelBlock.GetParameterReference)
13540 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
13541 Move here from class Block.
13542 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
13543 * expression.cs (ParameterReference.DoResolveBase): Likewise.
13545 2005-05-18 Martin Baulig <martin@ximian.com>
13550 (FlowBranching.Reachability): Add non-static public And() and Or()
13552 (FlowBranchingSwitch): New class; do the `break_origins' thing
13553 like in FlowBranchingLoop.
13554 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
13555 reachability, not just locals and parameters.
13556 (FlowBranching.MergeChild): Remove some of the hacks for loop and
13557 switch; MergeBreakOrigins() now takes care of that.
13559 2005-05-18 Martin Baulig <martin@ximian.com>
13561 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13562 a loop and may leave it, reset the barrier; fixes #74974.
13564 2005-05-17 Marek Safar <marek.safar@seznam.cz>
13566 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
13569 * cs-parser.jay: Catch more lexical errors.
13571 * report.cs: Add one more Error method.
13574 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
13576 2005-05-17 Martin Baulig <martin@ximian.com>
13578 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
13581 2005-05-16 Raja R Harinath <rharinath@novell.com>
13583 Fix test-382.cs. Emit values of decimal constants.
13584 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
13586 (TypeContainer.AddField): ... this.
13587 (TypeContainer.EmitFieldInitializers): Allow the list of fields
13588 with initializers to include 'Const's.
13589 (ClassPart.RegisterFieldForInitialization): Forward to
13591 * const.cs (Const.Const): Pass initializer to base class.
13592 (Const.Define): In case of decimal constants, register them for
13593 initialization in a static constructor.
13595 2005-05-14 Martin Baulig <martin@ximian.com>
13597 * statement.cs (Block.Resolve): Correctly handle unreachable code;
13598 do not call ResolveUnreachable() on unreachable statements in
13599 here, see the comment in the source code.
13601 2005-05-13 Raja R Harinath <rharinath@novell.com>
13604 * expression.cs (BinaryResolveOperator): If one of the operands of
13605 an equality comparison is 'null' and the other is a pointer type,
13606 convert the null to a NullPointer.
13607 * convert.cs (ImplicitReferenceConversion): If the expression is a
13608 NullLiteral and the target type is a pointer type, return a
13609 NullPointer instead.
13610 (ImplicitConversionStandard): Likewise.
13612 2005-05-13 Marek Safar <marek.safar@seznam.cz>
13614 * cs-parser.jay: Set readonly context based on special constructs.
13616 * expression.cs (LocalVariableReference.DoResolveBase): Improved
13617 readonly variable error handling.
13619 * rootcontext.cs (EmitCode): Don't verify members when error
13622 * statement.cs (LocalInfo): Add reaodnly context information.
13623 (SetReadOnlyContext, GetReadOnlyContext): New methods.
13625 2005-05-13 Raja R Harinath <rharinath@novell.com>
13627 * statement.cs (Block.Resolve): Revert change below. Modify fix
13628 for #74041 to initialize 'resolved' to false only for explicit
13629 blocks. Fixes #74873.
13631 2005-05-12 Raja R Harinath <harinath@gmail.com>
13634 * typemanager.cs (unmanaged_enclosing_types): New.
13635 (IsUnmanagedType): Avoid infloops by using
13636 'unmanaged_enclosing_types' to talk with recursive invocations.
13638 2005-05-13 Martin Baulig <martin@ximian.com>
13640 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
13641 instance variable, not a local. Fix #74873.
13642 (Block.ResolveUnreachable): Set it to true here.
13644 2005-05-11 Duncan Mak <duncan@novell.com>
13646 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
13647 continuing to process for 'arg'.
13648 (handle_preprocessing_directive): Check the argument of the #endif
13649 directive and report error CS1025 if there are any trailing
13652 According to the C# spec, having even whitespace after the #endif
13653 directive is illegal; however, because we call arg.TrimEnd ()
13654 beforehand, we have the same behavior as csc, allowing whitespace
13655 after the directive.
13659 2005-05-11 Marek Safar <marek.safar@seznam.cz>
13663 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
13664 (Constructor.GetObsoleteAttribute): Implemented correctly.
13666 2005-05-10 Martin Baulig <martin@ximian.com>
13668 * support.cs (ReflectionParameters.ParameterModifier): Use
13669 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
13670 and `ParameterAttributes.In'. Fixes #74884.
13672 2005-05-10 Marek Safar <marek.safar@seznam.cz>
13674 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
13676 * expression.cs (Argument.GetParameterModifier): Turned to property.
13677 (Invocation.Error_InvalidArguments): Add more descriptive errors.
13679 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
13682 2005-05-09 Raja R Harinath <rharinath@novell.com>
13685 * decl.cs (MemberCache.AddMethods): Register override methods,
13686 rather than non-override methods.
13687 * typemanager.cs (RegisterOverride): New.
13688 (IsOverride): Update.
13690 2005-05-09 Marek Safar <marek.safar@seznam.cz>
13694 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
13695 recursive declaration.
13697 * statement.cs (Block.ResolveMeta): Report any error in resolving.
13699 2005-05-06 Marek Safar <marek.safar@seznam.cz>
13701 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
13703 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
13705 2005-05-05 Raja R Harinath <rharinath@novell.com>
13708 * decl.cs (DeclSpace.FamilyAccessible):
13709 Use TypeManager.IsNestedFamilyAccessible.
13711 Fix reopened #64812.
13712 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
13715 2005-05-04 Raja R Harinath <rharinath@novell.com>
13716 Abin Thomas <projectmonokochi@rediffmail.com>
13717 Anoob V E <projectmonokochi@rediffmail.com>
13718 Harilal P R <projectmonokochi@rediffmail.com>
13721 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
13722 allow access to all static members.
13724 2005-05-04 Martin Baulig <martin@ximian.com>
13726 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
13728 2005-05-04 Martin Baulig <martin@ximian.com>
13732 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
13733 section at the end; make things work if `default' is not the last
13736 2005-05-04 Martin Baulig <martin@ximian.com>
13740 * statement.cs (Switch): Replaced the `got_default' field with a
13741 `default_section' one.
13742 (Switch.CheckSwitch): Set `default_section' here.
13743 (Switch.Resolve): If we're a constant switch and the constant is
13744 not found, use the default section.
13746 2005-05-03 Martin Baulig <martin@ximian.com>
13748 * expression.cs (ArrayAccess.EmitGetLength): New public method.
13750 * statement.cs (Foreach.ArrayForeach): New nested class.
13751 (Foreach.TemporaryVariable): New nested class.
13752 (Foreach.EmitArrayForeach): Removed; this is now in the new
13753 ArrayForeach class.
13755 2005-05-03 Raja R Harinath <rharinath@novell.com>
13757 * pending.cs (BaseImplements): Move the #74773 fix here. This is
13759 (VerifyPendingMethods): Revert change below.
13761 * typemanager.cs (IsOverride, RegisterNonOverride): New.
13762 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
13763 that used to trigger warning -28. Remove warning -28.
13764 * expression.cs (Invocation.OverloadResolve): Use
13765 TypeManager.IsOverride to distinguish override methods.
13768 * pending.cs (VerifyPendingMethods): If a base type implements the
13769 requested interface, don't bother checking individual methods of
13770 the base type. As a side-effect, this prevents the creation of
13771 unnecessary proxies.
13773 2005-05-02 Martin Baulig <martin@ximian.com>
13777 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13778 Also `And' the locals if the old vector is null.
13779 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
13780 null; in this case we basically reset all the variables.
13782 2005-05-02 Martin Baulig <martin@ximian.com>
13786 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
13787 Added `FlowBranching branching' argument; always `and' the
13788 variables instead of `or'ing them unless we're an infinite loop.
13790 * statement.cs (While.Resolve): Create a new sibling unless we're
13793 2005-05-02 Martin Baulig <martin@ximian.com>
13797 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
13798 arguments; use it instead of creating a new TopLevelBlock.
13799 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
13800 our ConstructorInitializer.
13803 (TopLevelBlock.TopLevelBranching): New public property.
13804 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
13805 and create our `TopLevelBranching'.
13807 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
13808 anonymous method host, use `block.TopLevelBranching' rather than
13809 creating a new branching.
13811 2005-04-20 Miguel de Icaza <miguel@novell.com>
13813 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
13814 a ScopeInfo, if any of the current children is a child of the new
13815 entry, move those children there.
13817 2005-04-30 Martin Baulig <martin@ximian.com>
13819 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
13820 at the beginning of a SwitchSection. Fix #73335.
13822 2005-04-27 Marek Safar <marek.safar@seznam.cz>
13825 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
13827 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
13828 (FieldExpr.DoResolve): Obsolete members are ignored for field
13831 2005-04-26 Marek Safar <marek.safar@seznam.cz>
13833 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
13834 of arrays detection.
13836 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
13838 (Field.VerifyClsCompliance): Volatile fields are not compliant.
13840 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
13843 2005-04-25 Ben Maurer <bmaurer@ximian.com>
13845 * cs-parser.jay: Use the prefered version of -unsafe in error
13848 2005-04-22 Marek Safar <marek.safar@seznam.cz>
13850 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
13853 2005-04-20 John Luke <john.luke@gmail.com>
13855 * driver.cs: fix typo in error message, --outout to --output
13857 2005-04-20 Marek Safar <marek.safar@seznam.cz>
13859 * codegen.cs (InRefOutArgumentResolving): New field.
13861 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
13862 fields outside contructor.
13864 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
13866 2005-04-19 Miguel de Icaza <miguel@novell.com>
13868 * anonymous.cs (CaptureContext.EmitParameterInstance): The
13869 parameter code was not completed ever, so it was not as up-to-date
13870 as local variables. Must finish it.
13872 The bug fix was to compare the Toplevel of the block, not the
13873 current block. Thanks for Ben for pointing this out.
13875 2005-04-19 Raja R Harinath <rharinath@novell.com>
13877 * decl.cs (AddMethods): Use the declaring type of the problem
13878 method to determine if we want to squash a warning.
13880 2005-04-19 Marek Safar <marek.safar@seznam.cz>
13882 * attribute.cs: Removed debug output.
13884 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
13886 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
13889 2005-04-18 Raja R Harinath <rharinath@novell.com>
13892 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
13893 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
13894 all null comparisons against reference types.
13896 2005-04-18 Marek Safar <marek.safar@seznam.cz>
13899 * class.cs (TypeContainer.CircularDepException) New nested
13901 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
13902 (TypeContainer.DefineType): Removed error, reset InTransit before
13904 (Class.DefineType): Throw exception when is in Transit.
13905 Catch exception and report error.
13906 (Struct.DefineType): Throw exception when is in Transit.
13907 Catch exception and report error.
13908 (Interface.DefineType): Throw exception when is in Transit.
13909 Catch exception and report error.
13911 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
13912 handle nested exception handlers.
13914 * flowanalysis.cs (InTryWithCatch): New method, search for try with
13917 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
13918 InFinally and InCatch storage.
13920 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
13921 (Catch.Resolve): Set and Restore ec.InCatch.
13922 (Try.Resolve): Set and Restore ec.InFinally.
13923 (Try.HasCatch): True when try has catch.
13925 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
13927 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
13928 for the same event member, so exclude such cases from warning 419.
13931 2005-04-16 Miguel de Icaza <miguel@novell.com>
13933 * expression.cs (Binary.ResolveOperator): Apply patch from John
13934 Luke to fix bug 59864: operators &, | and ^ on enumerations
13935 require that the same enum type on both sides.
13937 * driver.cs: Add warnings to old flag usage, this is to assist
13938 people who produce Makefiles and hope that the Makefiles will be
13941 * class.cs (TypeContainer.EmitType): Moved the definition of the
13942 special $PRIVATE$ field from the resolve phase to the Emit phase.
13943 During resolve we do not know if we are a struct with
13944 HasExplicitLayout, we know this only after the attributes for the
13947 Set the FieldOffset to zero on the dummy field that we create for
13948 the class. Fixes 74590.
13950 2005-04-16 Raja R Harinath <rharinath@novell.com>
13953 * ecore.cs (PropertyExpr.resolved): New.
13954 (DoResolve): Use it to handle a case of double resolution here.
13955 Handle a case of identical-name-and-type-name.
13956 * expression.cs (ArrayCreation.CheckIndices): Avoid double
13957 resolution by storing the results of expression resolution back
13958 into the "probes" array.
13960 2005-04-15 Raja R Harinath <rharinath@novell.com>
13962 Fix cs0208-7.cs and cs0208-8.cs.
13963 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
13964 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
13965 error reporting to point out the reason a struct is not unmanaged.
13967 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
13969 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
13970 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
13972 2005-04-13 Raja R Harinath <rharinath@novell.com>
13975 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
13976 IdenticalNameAndTypeName here.
13977 (EventExpr.InstanceResolve): Likewise.
13979 2005-04-13 Marek Safar <marek.safar@seznam.cz>
13981 C# 2.0 DefaultCharSetAttribute implementation
13983 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
13984 which allows us to set GlobalNamespace for every resolve.
13985 (Attribute.ResolveArguments): Cut from Resolve.
13986 (Attribute.GetCharSetValue): Returns CharSet named argument.
13987 (Attribute.DefinePInvokeMethod): Gets default charset from
13989 (GlobalAttribute.ResolveAsTypeStep): Override.
13990 (GlobalAttribute.ResolveArguments): Override.
13992 * class.cs (TypeAttr): Is protected.
13994 * codegen.cs (ModuleClass.DefaultCharSet): New member.
13995 (ModuleClass.DefaultCharSetType): New memeber.
13996 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
13998 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
13999 charset from module.
14001 * delegate.cs (TypeAttr): Override.
14002 (Delegate.DefineType): Use this TypeAttr.
14004 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
14005 at very early stage (before types are defined) to resolve model
14006 module attributes. It will probably not work with corlib but it
14009 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
14010 charset from module.
14012 * typemanager.cs (default_charset_type): New type.
14014 2005-04-13 Raja R Harinath <rharinath@novell.com>
14016 * decl.cs (MemberCache.AddMethods): Don't warn if
14017 System.Object.Finalize has buggy MethodAttributes.
14019 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
14022 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14024 * doc.cs : detect ambiguous reference to overloaded members.
14025 Fixed bug #71603. MS 1.1 csc does not detect it.
14027 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14029 * doc.cs : delegates must not be referenced with parameters.
14032 2005-04-12 Miguel de Icaza <miguel@novell.com>
14034 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
14036 2005-04-10 Miguel de Icaza <miguel@novell.com>
14038 * driver.cs (MainDriver): Stop processing if the CLS stage found
14041 (CompilerCallableEntryPoint.InvokeCompiler): Always
14042 reset after execution; Take a TextWriter argument for the
14045 * report.cs: Use the error stream instead of hardcoding stderr.
14047 2005-04-09 Miguel de Icaza <miguel@novell.com>
14049 * class.cs: Reduce code paths to test, too small of an
14050 optimization to make it worth the extra testing. Always perform
14053 2005-04-08 Raja R Harinath <rharinath@novell.com>
14056 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
14057 operators that had errors reported on them.
14059 2005-04-08 Marek Safar <marek.safar@seznam.cz>
14061 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
14063 (Attribute.Resolve): Add named argument type checking.
14065 * class.cs (FixedField.Define): Use IsPrimitiveType
14067 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
14069 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
14070 unsafe parameter types.
14072 * statement.cs (Using.ResolveExpression): Add better error description.
14074 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
14076 2005-04-08 Raja R Harinath <rharinath@novell.com>
14079 * attribute.cs (Attribute.GetAttributeUsage): Resolve
14080 AttributeUsageAttribute in the emitcontext of the attribute class,
14081 not in the emitcontext of the attributable entity it was attached to.
14082 * cs-parser.jay: Use 'current_class', not 'current_container',
14083 when creating a GlobalAttribute.
14085 2005-04-08 Alp Toker <alp@atoker.com>
14087 * pending.cs: The fix to #58413 failed to compile methods implementing
14088 interfaces with/without params modifiers and vice versa, even though
14089 params modifiers aren't part of the signature. Make the modifier check
14090 less strict as in csc.
14092 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
14093 Anoob V E <projectmonokochi@rediffmail.com>
14094 Harilal P R <projectmonokochi@rediffmail.com>
14097 * pending.cs (TypeAndMethods.mods): New. Store the parameter
14098 modifiers of pending methods.
14099 (PendingImplementation.PendingImplementation): Initialize it.
14100 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
14101 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
14102 with ParameterData. Add check for modifiers.
14103 * class.cs (MethodData.Define): Update to changes.
14105 2005-04-07 Raja R Harinath <rharinath@novell.com>
14107 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
14109 2005-04-07 Marek Safar <marek.safar@seznam.cz>
14111 * class.cs (PropertyMethod.Define): Check private accessor in abstract
14114 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
14117 * typemanager.cs: Registered RequiredAttributeAttribute.
14119 2005-04-06 Marek Safar <marek.safar@seznam.cz>
14121 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
14122 Warning CS0169 is back at level 3.
14123 (IMethodData.SetMemberIsUsed): New method.
14125 * decl.cs (IsUsed): New value; moved from FieldBase.Status
14126 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
14128 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
14130 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
14132 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
14135 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
14138 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
14139 to avoid the problems with nested types.
14141 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
14142 Anoob V.E <projectmonokochi@rediffmail.com>
14143 Harilal P.R <projectmonokochi@rediffmail.com>
14144 Raja R Harinath <rharinath@novell.com>
14147 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
14149 * typemanager (GetConstructor): Make public.
14151 2005-04-05 John Luke <john.luke@gmail.com>
14152 Raja R Harinath <rharinath@novell.com>
14155 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
14156 struct too. Return false quicker in a few cases.
14157 (VerifyUnManaged): Use it.
14159 2005-04-05 Raja R Harinath <rharinath@novell.com>
14162 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
14163 not 'unreachable_seen'.
14165 2005-04-04 Marek Safar <marek.safar@seznam.cz>
14167 * attribute.cs (Attribute.GetValue): Removed unused.
14169 * codegen.cs (CodeGen.TrimExt): Removed unused.
14171 * cs-parser.jay (output): Removed unused.
14173 * cs-tokenizer.cs (hex_digits): Removed unused.
14175 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
14177 * expression.cs (Indirection.LoadExprValue): Removed unused.
14178 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
14180 * iterators.cs (Iterator.param_types): Removed unused.
14182 * statement.cs (Goto.block): Removed unused.
14183 (ToplevelBlock.did): Removed unused.
14184 (Switch.ResolveConstantSwitch): Removed unused.
14186 2005-04-01 Ben Maurer <bmaurer@ximian.com>
14188 * rootcontext.cs: Allow mcs to bootstrap with the compilation
14191 2005-04-01 Raja R Harinath <rharinath@novell.com>
14193 Fix #74232 and cs0208-3.cs.
14194 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
14195 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
14196 unmanaged type. Don't use FieldBuilders when 't' is a
14197 TypeBuilder. Use ModFlags and MemberType fields.
14198 * class.cs (MemberBase.member_type): Rename from MemberType.
14199 (MemberBase.MemberType): New property. Determines member_type on
14201 (MemberBase.DoDefine): Don't initialize MemberType here.
14202 (FieldMember.Define): Likewise.
14204 2005-04-01 Marek Safar <marek.safar@seznam.cz>
14207 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
14208 Attributes are emitted there.
14210 2005-04-01 Raja R Harinath <rharinath@novell.com>
14212 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
14213 keyword in 'partial enum' too.
14214 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
14216 Report from Kamil Skalski <nazgul@omega.pl>.
14219 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
14220 have partial containers too.
14222 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
14223 in block' checks to Block.CheckInvariantMeaningInBlock.
14224 * statement.cs (Block.GetKnownVariableInfo): Make private.
14225 (Block.IsVariableUsedInChildBlock): Remove.
14226 (Block.IsVariableUsedInBlock): Likewise.
14227 (Block.CheckInvariantMeaningInBlock): New. Show location of
14228 conflicting declaration.
14229 (Block.AddVariable): Make error messages less long-winded and more
14230 specific. Show location of conflicting declaration.
14231 * parameter.cs (Parameters.Location): New readonly property.
14233 2005-03-31 Raja R Harinath <rharinath@novell.com>
14235 Clean up semantics of invoking ResolveMemberAccess.
14236 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
14237 can have an instance, ensure that we pass in a non-TypeExpression
14238 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
14239 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
14240 argument. Update to changes and simplify.
14241 (FieldExpr.Emitinstance): Remove CS0120 check.
14242 (PropertyExpr.EmitInstance): Likewise.
14243 * expression.cs (Argument.Resolve): Likewise.
14244 (Invocation.DoResolve): Update to changes in semantics of
14245 InstanceExpression.
14247 2005-03-31 Marek Safar <marek.safar@seznam.cz>
14250 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
14253 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
14255 2005-03-31 Raja R Harinath <rharinath@novell.com>
14257 Fix difference in behaviour with commandline invocation.
14258 * driver.cs (Driver.Reset): New.
14259 (CompilerCallableEntryPoint): Call it.
14261 * statement.cs (If.Resolve): Avoid spurious "uninitialized
14262 variable" warnings if the boolean expression failed to resolve.
14264 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
14266 * attribute.cs: Fix the union of several permissions when some of them
14267 are unrestricted (so the result isn't an unrestricted permission set).
14270 2005-03-30 Raja R Harinath <rharinath@novell.com>
14272 * ecore.cs (MemberExpr): New class. Convert from interface
14274 (MemberExpr.ResolveMemberAccess): Refactor and move here from
14275 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
14277 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
14278 (MethodGroupExpr.IsExplicitImpl): Remove.
14279 (Expression.GetFieldFromEvent): Remove.
14280 (SimpleName.MemberStaticCheck): Remove.
14281 (SimpleName.DoSimpleNameResolve): Update to changes.
14282 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
14283 (MemberAccess.IdenticalNameAndTypeName): Remove.
14284 (MemberAccess.error176): Move to MemberExpr.
14285 (MemberAccess.DoResolve): Update to changes.
14286 (BaseAccess.DoResolve): Likewise.
14288 2005-03-30 Marek Safar <marek.safar@seznam.cz>
14290 C# 2.0 Conditional attribute class implementation
14292 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
14293 Analyzes class whether it has attribute which has ConditionalAttribute
14294 and its condition is not defined.
14296 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
14297 (Class.IsExcluded): New method. Search for at least one defined
14298 condition in ConditionalAttribute of attribute class.
14300 2005-03-30 Raja R Harinath <rharinath@novell.com>
14302 * ecore.cs (PropertyExpr): Derive from Expression, not
14303 ExpressionStatement.
14304 (PropertyExpr.EmitStatement): Remove.
14306 2005-03-29 Raja R Harinath <rharinath@novell.com>
14309 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
14310 internal field "value__" of an enum be private. The examples for
14311 "value__" that I found on MSDN all used FieldAttributes.Private.
14313 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
14314 Don't mention IL method attribute names.
14316 Fix #47991. Remove a TODO.
14317 * statement.cs (Block.Toplevel): Make into a field.
14318 (Block.Parameters): Move into ToplevelBlock.
14319 (Block.known_variables): Rename from child_variable_names.
14320 (Block.Block): Remove variants that take Parameters. Initialize
14321 'Toplevel' with the immediately surrounding toplevel block.
14322 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
14323 LocalInfo parameter.
14324 (Block.GetKnownVariableInfo): New.
14325 (Block.IsVariableNameUsedInChildBlock): Update.
14326 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
14327 the block, even though it may not be in scope.
14328 (Block.AddVariable): Remove Parameters parameter. Use
14329 Toplevel.Parameters instead.
14330 (Block.AddConstant): Remove Parameters parameter.
14331 (Block.GetParameterReference): Update to use Toplevel.Parameters.
14332 (Block.IsParamaterReference): Likewise.
14333 (Block.IsLocalParameter): Likewise. Simplify a lot.
14334 (ToplevelBlock.Parameters): New. Moved from Block.
14335 (ToplevelBlock.ToplevelBlock): Update to changes. Always
14336 initialize Parameters to a non-null value.
14337 * cs-parser.jay: Update to changes.
14338 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
14339 simple names that mean different things in the same block. Use
14340 Block.IsVariableNameUsedInBlock.
14342 2005-03-28 Raja R Harinath <rharinath@novell.com>
14344 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
14345 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
14346 GetTypeHandle. It is possible for a reflected type to derive from
14347 a TypeBuilder (e.g., int[] derives from the TypeBuilder
14348 System.Array during mscorlib compilation).
14349 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
14350 contain a method_hash, don't create one either. Don't create a
14351 deep copy of the base cache's method_hash.
14352 (MemberCache.SetupCache): Rename back from DeepCopy.
14353 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
14354 already initialized. If we see an override function, add its
14355 underlying base virtual function to the member_hash too.
14357 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
14359 2005-03-26 Raja R Harinath <harinath@acm.org>
14362 * assign.cs (Assign.DoResolve): When the RHS of an assignment
14363 fails to resolve, ensure that the LHS is still resolved as an
14366 2005-03-25 Raja R Harinath <harinath@acm.org>
14368 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
14370 (Enum.current_ec): Remove.
14371 (Enum.LookupEnumValue): Remove EmitContext argument.
14372 Just uses the one created during DefineType.
14373 (Enum.FindMembers): Update.
14374 * expression.cs (MemberAccess.DoResolve): Update.
14376 2005-03-22 Marek Safar <marek.safar@seznam.cz>
14378 * assign.cs (Assign.DoResolve): Check for CS1717 when
14379 source and target are same (uses Equals).
14381 * expression.cs (LocalVariableReference, ParameterReference,
14382 This): Implemented Equals, GetHashCode.
14384 * statement.cs (Block.GetParameterReference): Removed useless
14387 2005-03-22 Raja R Harinath <rharinath@novell.com>
14390 * statement.cs (Block.AddVariable): Ensure that we skip implicit
14391 blocks before deciding whether the error is cs0136 or cs0128.
14393 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
14394 (using_alias_directive, using_namespace_directive): Pass
14395 MemberName, not an expression to Namespace.UsingAlias and
14397 (MakeName): Use the MemberName of the namespace.
14398 * namespace.cs (Namespace.MemberName): New.
14399 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
14400 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
14402 * decl.cs (MemberName.Name): Make readonly.
14403 (MemberName.FromDotted): New "constructor".
14404 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
14405 (MemberCore.Name): Compute from MemberName on demand.
14406 (MemberCore.SetMemberName): Provide a way to change the
14408 (MemberCore.AddToContainer): Don't take a fullname parameter.
14409 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
14410 fully qualified name of the container to the member name.
14411 (TypeContainer.AddToTypeContainer): Use a fully qualified name
14412 only if the type is a member of the root container.
14413 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
14414 MemberName.Left rather than searching for an embedded ".".
14415 (PartialContainer.CreatePart): Update to changes in RootContext.
14416 (MemberBase.ShortName): Turn into a property. Use
14417 MemberCore.SetMemberName.
14418 (MemberBase.ExplicitInterfaceName): Remove.
14419 (MemberBase.UpdateMemberName): Remove.
14420 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
14421 (PropertyBase.SetMemberName): New override.
14422 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
14423 (Tree.GetDecl): New.
14424 (Tree.AllDecls): Rename from Decls.
14425 * attribute.cs, enum.cs, report.cs: Update to changes.
14426 * driver.cs (MainDriver): Use MemberName.FromDotted on
14427 RootContext.MainClass.
14429 2005-03-21 Marek Safar <marek.safar@seznam.cz>
14431 * class.cs (FixedField.Define): Check for CS1664 and more sanity
14434 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
14436 2005-03-18 Marek Safar <marek.safar@seznam.cz>
14438 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
14439 property accessor modifiers.
14441 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
14442 fixed buffer attribute (CS1716).
14443 (PropertyMethod.HasCustomAccessModifier): When property accessor
14444 has custom modifier.
14446 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
14448 (PropertyExpr.DoResolveLValue): Add CS0272.
14450 2005-03-17 Miguel de Icaza <miguel@novell.com>
14452 * convert.cs: When converting to a pointer, use the proper Conv.U
14453 or Conv.I depending on the source data type.
14455 * cs-tokenizer.cs: Make the size for large decimal constants,
14458 2005-03-17 Martin Baulig <martin@ximian.com>
14460 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
14461 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
14463 2005-03-17 Martin Baulig <martin@ximian.com>
14465 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
14466 to bool so we can return an error condition.
14467 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
14470 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
14472 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
14475 2005-03-16 Raja R Harinath <rharinath@novell.com>
14477 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
14478 Refactor to avoid traversing the list of assemblies, and to avoid
14479 string concatenation.
14480 * typemanager.cs (guid_attr_type): Remove.
14481 (negative_hits, pointers, references): Remove hashes.
14483 (GetConstructedType): New. Uses type_hash to handle constructed
14484 types (arrays, references, pointers).
14485 (GetReferenceType, GetPointerType): Use it.
14486 (GetNestedType): New. Uses type_hash to handle nested types of
14488 (LookupType, LookupTypeDirect): Remove.
14489 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
14490 'types' hash and LookupTypeReflection directly.
14491 (params_string, params_object): Use GetConstructedType.
14492 * namespace.cs (Namespace.cached_types): New. Cache of reflected
14494 (Namespace.Lookup): Use cached_types.
14495 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
14496 provided by old TypeManager.LookupType.
14497 * rootcontext.cs (MakeFQN): Remove.
14498 * decl.cs (DeclSpace.MakeFQN): Likewise.
14499 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
14500 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
14501 TypeManager.GetConstructedType.
14502 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
14504 2005-03-15 Marek Safar <marek.safar@seznam.cz>
14506 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
14509 * cs-parser.jay: Reports CS1527 for any namespace element.
14511 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
14514 * expression.cs (ParameterReference.IsAssigned): Changed error to
14516 (Error_WrongNumArguments): Moved CS0245 detection here.
14518 * statement.cs (Return.Resolve): Add CS1622 report.
14520 2005-03-11 Marek Safar <marek.safar@seznam.cz>
14522 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
14524 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
14526 * attribute.cs expression.cs: Get rid of some allocations.
14528 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
14530 * doc.cs : just eliminate the latest change.
14532 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14534 * doc.cs : commented out the latest change. It breaks xml-030.cs
14536 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14538 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
14539 fail. So invoke CreateType() in FindDocumentedType().
14541 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14543 * cs-tokenizer.cs : added IsKeyword().
14544 * doc.cs : Detect keyword incorrectly used as identifier.
14545 Allow identifiers prefixed by @.
14547 2005-03-10 Marek Safar <marek.safar@seznam.cz>
14549 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
14550 It caused exception in namespace resolving (again!).
14552 * class.cs (Class.ctor): Removed exit.
14553 (PropertyMethod.ctor): ditto.
14555 * codegen.cs (Codegen.Reset): Reset static data.
14556 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
14558 * cs-tokenizer.cs (Cleanup): Removed.
14560 * driver.cs (GetSystemDir): Rewrote to one line command.
14561 It caused problem with unloaded dynamic modules.
14562 (UnixParseOption): Removed Exit.
14563 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
14564 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
14565 Now can be mcs used as library.
14567 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
14570 * location.cs (Reset): Reset static data.
14572 * namespace.cs (Reset): Reset static data.
14574 * report.cs (Report.Reset): Reset static data.
14576 * rootcontext.cs (RootContext.Reset): Reset static data.
14578 * tree.cs (RootTypes.ctor): Use Location.Null
14580 * typemanager.cs (TypeManager.Reset): Reset static data.
14581 (CoreLookupType): Removed Exit.
14582 (TypeHandle.Reset): Reset static data.
14584 2005-03-10 Raja R Harinath <rharinath@novell.com>
14587 * typemanager.cs (ComputeNamespaces): Import namespaces from
14588 referenced modules too.
14590 2005-03-09 Raja R Harinath <rharinath@novell.com>
14592 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
14595 2005-03-09 Raja R Harinath <rharinath@novell.com>
14597 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
14598 enclosing DeclSpace. This ensures that a name-lookup populates
14599 more caches and there are fewer 'TypeExpression's. Carve out
14600 nested type lookup into ...
14601 (LookupNestedTypeInHierarchy): ... this.
14603 2005-03-09 Raja R Harinath <rharinath@novell.com>
14605 Clean up a few partial-class semantics.
14606 Fixes test-357.cs and cs1618-2.cs.
14607 * cs-parser.jay (struct_declaration): Use 'current_class' as
14608 parent of newly-created struct. Remove call to Register ().
14609 Use 'pop_current_class' to complete handing the current struct.
14610 (interface_declaration): Likewise.
14611 (class_declaration): Likewise.
14612 (enum_declaration): Use 'current_class' as parent of newly created
14614 (delegate_declaration): Likewise.
14615 (pop_current_class): New function. This is used to handle closing
14616 up the 'current_class' and 'current_container', and pointing them
14617 to the enclosing class/container.
14618 (CSharpParser): Initialize 'current_class' too.
14619 * decl.cs (MemberCore): Add check for invariant: a partial
14620 container is not a parsed entity, and thus does not enclose any
14622 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
14623 (DeclSpace.BaseTypeExpr): Use it.
14624 (DeclSpace.LookupType): Add check for invariant.
14625 * class.cs (TypeContainer): Add check for invariant: a nested
14626 class should have the same NamespaceEntry as its enclosing class.
14627 (TypeContainer.EmitFieldInitializers): Make virtual.
14628 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
14630 (TypeContainer.Register): Remove.
14631 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
14632 null. Use TypeResolveEmitContext for resolving base types and
14633 interfaces. Move initialization of Parts.TypeBuilder here from
14635 (TypeContainer.DefineNestedTypes): ... here.
14636 (PartialContainer): Take a Namespace not a NamespaceEntry.
14637 (PartialContainer.Create): Don't use Register. Call the
14638 appropriate Add... function directly.
14639 (ClassPart): Take both the PartialContainer and the enclosing
14640 class as constructor arguments.
14641 (ClassPart.EmitFieldInitializers): Override.
14642 (ClassPart.PartFindNestedTypes): Remove.
14643 (FieldBase.GetInitializerExpression): Resolve the initializer
14644 expression in the emit context of the enclosing class.
14645 * tree.cs (RootTypes): Remove Register ().
14647 2005-03-08 Marek Safar <marek.safar@seznam.cz>
14649 * cs-parser.jay: Removed CS0134.
14651 * driver.cs: Removed CS1901.
14653 * expression.cs (SizeOf.DoResolve): Don't report CS0233
14654 for predefined types.
14656 2005-03-07 Duncan Mak <duncan@novell.com>
14658 * codegen.cs (Save): Catch UnauthorizedAccessException as
14659 well. Fixes bug #73454.
14661 2005-03-07 Marek Safar <marek.safar@seznam.cz>
14663 * cs-tokenizer.cs (xtoken): Add CS1035.
14665 * class.cs (MethodData.Define): Add CS0683.
14666 (FieldMember.ctor): Add CS0681.
14668 2005-03-07 Raja R Harinath <rharinath@novell.com>
14670 * ecore.cs (SimpleName.DoResolve): Rename from
14671 SimpleName.DoResolveAllowStatic.
14672 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
14673 Pass 'intermediate' flag to MemberStaticCheck.
14674 (SimpleName.MemberStaticCheck): Skip "static check" only in case
14675 of "intermediate" lookups via MemberAccess.
14676 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
14677 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
14679 2005-03-07 Raja R Harinath <rharinath@novell.com>
14682 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
14683 slipped in because of variable names that are identical to a
14684 builtin type's BCL equivalent ('string String;', 'int Int32;').
14685 (PropertyExpr.EmitInstance): Likewise.
14687 2005-03-04 Marek Safar <marek.safar@seznam.cz>
14689 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
14691 * report.cs (warning_ignore_table): Made public.
14693 2005-03-04 Raja R Harinath <rharinath@novell.com>
14696 * class.cs (MethodData.Emit): Pass 'container' to
14697 container.GetObsoleteAttribute instead of 'container.Parent'.
14699 2005-03-03 Marek Safar <marek.safar@seznam.cz>
14701 * cs-parser.jay: Add 1534 error test.
14703 * iterators.cs (Yield.CheckContext): Add error 1629.
14704 (Iterator.ctor): Save unsafe modifier.
14705 (MoveNextMethod.DoEmit): Restore unsafe context.
14707 * namespace.cs (UsingAlias): Better error message.
14709 2005-03-03 Dan Winship <danw@novell.com>
14711 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
14712 the warning message [#73219]
14714 2005-03-03 Raja R Harinath <rharinath@novell.com>
14716 Fix compile with MCS 1.0.0.0.
14717 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
14718 w_restore to not depend on string constant folding.
14720 2005-03-03 Raja R Harinath <rharinath@novell.com>
14722 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
14723 CS0246 check to users who passed 'silent = false'.
14724 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
14726 (SimpleName.SimpleNameResolve): Update.
14727 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
14728 (MemberAccess.IdenticalNameAndTypeName): Update.
14729 * doc.cs (FindDocumentedTypeNonArray): Update.
14731 2005-03-03 Raja R Harinath <rharinath@novell.com>
14733 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
14734 * parameters.cs (ComputeAndDefineParameters): Remove.
14735 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
14736 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
14737 Use GetParameterInfo.
14739 2005-03-02 Marek Safar <marek.safar@seznam.cz>
14741 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
14743 2005-03-02 Raja R Harinath <rharinath@novell.com>
14745 Unify DeclSpace.LookupType and DeclSpace.FindType.
14746 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
14747 is in charge of defining nested types on demand.
14748 (DeclSpace.LookupType): Use it when the current_type is a
14749 TypeBuilder. Use LookupTypeDirect for reflected types.
14750 (DeclSpace.FindType): Remove.
14751 (DeclSpace.LookupInterfaceOrClass): Likewise.
14752 (DeclSpace.DefineTypeAndParents): Likewise.
14753 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
14754 DeclSpace.LookupType.
14755 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
14756 * typemanager.cs (LookupType): Simplify.
14757 (AddUserType): Remove type from negative_hits.
14758 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
14759 * class.cs (TypeContainer.FindMembers): Move handling of nested
14761 (TypeContainer.FindMembers_NestedTypes): ... here.
14762 (TypeContainer.FindNestedType): Implement override.
14763 (ClassPart.FindNestedType): Delegate to PartialContainer.
14764 (ClassPart.PartFindNestedType): Looks up the nested types of the
14767 2005-03-02 Martin Baulig <martin@ximian.com>
14769 * class.cs (TypeContainer.DoDefineMembers): We also need a default
14770 static constructor in static classes.
14772 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
14774 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
14775 sizeParamIndex is not specified.
14777 2005-03-01 Marek Safar <marek.safar@seznam.cz>
14780 * report.cs (WarningMessage.IsEnabled): Missing null check.
14782 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14784 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
14785 in the fields and not in the properties.
14787 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
14789 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
14792 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14794 * attribute.cs: Small refactoring (improved robustness).
14795 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
14796 (ValidateGuid): Removed.
14797 (Resolve): Removed referenced to above mentioned.
14798 (GetAttributeUsage): Made private and changed to work without
14800 (GetIndexerAttributeValue): Don't crash.
14801 (GetConditionalAttributeValue): Ditto.
14802 (GetClsCompliantAttributeValue): Ditto.
14803 (ExtractSecurityPermissionSet): All attributes exceptions are
14805 (GetPropertyValue): New helper.
14806 (GetMethodImplOptions): New method.
14807 (DefinePInvokeMethod): Reuse common code. Implemented handling of
14808 some missing properties.
14810 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
14811 (Method.ApplyAttributeBuilder): Updated.
14813 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
14816 2005-02-28 Raja R Harinath <rharinath@novell.com>
14819 * report.cs (Report.SymbolRelatedToPreviousError): Handle
14820 non-simple types (array, pointer, reference).
14822 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14824 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
14826 * class.cs (MethodCore.IsDuplicateImplementation): Special error
14828 (Method.CheckBase): Catch wrong destructor here.
14829 (MethodData.Define): Add errors 550, 668.
14831 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
14833 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
14835 * pending.cs (VerifyPendingMethods): Add error 551.
14837 * typemanager.cs (CSharpName): Next error report helper.
14839 2005-02-25 Marek Safar <marek.safar@seznam.cz>
14841 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
14842 attributes. Removed useless attribute double check.
14843 It saves almost 2MBs for corlib.
14845 2005-02-25 Raja R Harinath <rharinath@novell.com>
14848 * statement.cs (ExpressionStatement.Resolve): Make robust to being
14849 called twice in case of error.
14851 2005-02-23 Chris Toshok <toshok@ximian.com>
14853 Fix compiler portions of #72827.
14854 * statement.cs (Block.Emit): call Begin/EndScope on the
14855 EmitContext instead of the ILGenerator.
14857 * codegen.cs (EmitContext.BeginScope): new method, call
14858 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
14860 (EmitContext.BeginScope): same, but EndScope and CloseScope
14862 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
14863 offset and call the superclass's OpenScope(int) with it.
14864 (SymbolWriter.CloseScope): get the current il
14865 offset and call superclass's CloseScope(int) with it.
14867 2005-02-23 Marek Safar <marek.safar@seznam.cz>
14869 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
14870 CS1677 for out and ref as well.
14872 * class.cs (Method.Define): Add error CS1599 detection.
14874 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
14876 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
14878 * delegate.cs (Delegate.Define): Add error CS1599 detection.
14880 * support.cs.cs (ModifierDesc): New helper method.
14882 2005-02-23 Raja R Harinath <rharinath@novell.com>
14883 Abin Thomas <projectmonokochi@rediffmail.com>
14884 Anoob V E <projectmonokochi@rediffmail.com>
14885 Harilal P R <projectmonokochi@rediffmail.com>
14887 Fix #57851, #72718.
14888 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
14889 MemberLookup (used for error reporting) actually returns a result.
14890 Fix error report number (122, not 112).
14892 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
14893 Anoob V E <projectmonokochi@rediffmail.com>
14894 Harilal P R <projectmonokochi@rediffmail.com>
14897 * pending.cs (PendingImplementation.GetAbstractMethods):
14898 Find NonPublic members too.
14900 2005-02-22 Marek Safar <marek.safar@seznam.cz>
14902 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
14905 * class.cs (MethodCore.CheckMethodAgainstBase):
14906 Add error 239 report.
14908 2005-02-21 Raja R Harinath <rharinath@novell.com>
14911 * expression.cs (Invocation.IsApplicable): Make public.
14912 (Invocation.IsParamsMethodApplicable): Likewise.
14913 * delegate.cs (Delegate.VerifyApplicability): Don't use
14914 Invocation.VerifyArgumentCompat for parameter applicability
14915 testing. Use Invocation.IsApplicable and
14916 Invocation.IsParamsMethodApplicable.
14918 2005-02-21 Marek Safar <marek.safar@seznam.cz>
14920 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
14922 * class.cs (Operator.Define): Add error 217 report.
14924 2005-02-21 Raja R Harinath <rharinath@novell.com>
14926 * namespace.cs (UsingEntry.Resolve): Undo change below.
14928 2005-02-21 Raja R Harinath <rharinath@novell.com>
14931 * ecore.cs (Expression.MemberLookupFailed): Add argument to
14932 disable the error message when the extended MemberLookup also
14934 (Expression.MemberLookupFinal): Update.
14935 (SimpleName.DoSimpleNameResolve): Update.
14936 * expression.cs (MemberAccess.ResolveNamespaceOrType):
14937 Don't use MemberLookupFinal.
14938 (New.DoResolve): Update.
14939 (BaseAccess.CommonResolve): Update.
14941 2005-02-21 Raja R Harinath <rharinath@novell.com>
14944 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
14945 occured previously, don't resolve again.
14947 2005-02-21 Marek Safar <marek.safar@seznam.cz>
14950 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
14951 argument. Call ResolveAttributeUsage for unresolved.
14952 when types doesn't match ctor arguments.
14954 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
14955 for nested attribute classes.
14956 (Class.attribute_usage): Removed.
14957 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
14958 for attribute class.
14960 * ecore.cs (IsAttribute): Removed.
14962 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
14964 * rootcontext.cs (RegisterAttribute): Removed, attributes are
14966 (attribute_types): Removed.
14967 (EmitCode): Global attributes are emited as the latest.
14969 2005-02-18 Marek Safar <marek.safar@seznam.cz>
14971 * class.cs (EmitFieldInitializers): Don't emit field initializer
14972 for default values when optimilization is on.
14974 * constant.cs (Constant.IsDefaultValue): New property.
14976 * driver.cs: Add /optimize handling.
14980 * literal.cs: Implement new IsDefaultValue property.
14982 * rootcontext.cs (Optimize): New field, holds /optimize option.
14984 2005-02-18 Raja R Harinath <rharinath@novell.com>
14986 Fix crasher in re-opened #72347.
14987 * namespace.cs (Namespace.Lookup): Return null if
14988 DeclSpace.DefineType returns null.
14991 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
14993 2005-02-18 Raja R Harinath <rharinath@novell.com>
14995 Fix remainder of #63202. Change semantics of DoResolveLValue: it
14996 now returns null if it cannot resolve to an lvalue.
14997 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
14998 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
14999 returned null. Remove check for SimpleName.
15000 (EventExpr.DoResolveLValue): New.
15001 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
15002 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
15004 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
15005 avoid CS0131 error.
15006 (Unary.ResolveOperator): Move CS0211 check ...
15007 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
15009 (Unary.DoResolveLValue): Simplify.
15010 (AddressOf.DoResolveLValue): New.
15011 (ArrayAccess.DoResolveLValue): New.
15013 2005-02-16 Marek Safar <marek.safar@seznam.cz>
15015 * attribute.cs (Attribute.Resolve): Add arguments casting for
15016 when types doesn't match ctor arguments.
15018 2005-02-16 Raja R Harinath <rharinath@novell.com>
15020 Fix parts of #63202.
15021 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
15022 lookup of operator in base type. Ensure that all checks happen
15023 when the operator resolves to an "op_..." method.
15025 2005-02-15 Raja R Harinath <rharinath@novell.com>
15028 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
15029 'ignore_cs0104' parameter. Pass it to ...
15030 (NamespaceEntry.Lookup): ... this.
15031 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
15032 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
15033 (TypeLookupExpression.DoResolveAsTypeStep): Update.
15034 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
15035 Update. Request that cs0104 errors be ignored.
15036 (ComposedCast.ResolveAsTypeStep): Update.
15038 2005-02-14 Raja R Harinath <rharinath@novell.com>
15041 * expression.cs (Invocation.BetterFunction): Remove support for
15042 comparing virtual functions and their overrides.
15043 (Invocation.IsOverride): New.
15044 (Invocation.OverloadResolve): Don't consider 'override' functions
15045 during candidate selection. Store them in a lookaside list.
15046 If the selected method is a 'virtual' function, use the list to
15047 find any overrides that are closer to the LHS type.
15049 2005-02-14 Marek Safar <marek.safar@seznam.cz>
15051 * expression.cs (New.DoResolve): Add complex core type reduction.
15052 (New.Constantify): Converts complex core type syntax like 'new int ()'
15053 to simple constant.
15055 2005-02-14 Raja R Harinath <rharinath@novell.com>
15057 * decl.cs (EntryType.EntryType): New constructor to create an
15058 updated copy of a cache entry.
15059 (MemberCache.AddMethods): Use it.
15060 (MemberCache.ClearDeclaredOnly): Remove.
15061 (MemberCache.MemberCache): Update.
15063 2005-02-11 Miguel de Icaza <miguel@novell.com>
15065 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
15066 variable. This one is represents the actual low-level declaration
15067 of the method, as opposed to the semantic level `IsStatic'.
15069 An anonymous method which is hosted into a static method might be
15070 actually an instance method. IsStatic would reflect the
15071 container, while MethodIsStatic represents the actual code
15074 * expression.cs (ParameterReference): Use the new MethodIsStatic
15075 instead of IsStatic.
15077 * anonymous.cs (AnonymousMethod.Compatible): Pass the
15078 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
15079 set on the current EmitContext.
15081 * expression.cs (Cast): Overload DoResolveLValue so we can pass
15082 resolve our casted expression as an LValue. This triggers the
15083 proper LValue processing that is later required by Assign.
15087 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
15089 2005-02-11 Marek Safar <marek.safar@seznam.cz>
15091 C# 2.0 Fixed buffer implementation
15093 * anonymous.cs: Update after RegisterHelperClass renaming.
15095 * attribute.cs (AttributeTester.fixed_buffer_cache):
15096 Cache of external fixed buffers.
15097 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
15098 implementation if field is fixed buffer else null.
15101 (TypeContainer.AddField): Accept FieldMember instead of Field.
15102 (FieldBase.IsFieldClsCompliant): Extracted code from
15103 VerifyClsCompliance descendant customization.
15104 (FixedField): New class handles fixed buffer fields.
15105 (FixedFieldExternal): Keeps information about imported fixed
15107 (IFixedField): Make access to internal or external fixed buffer
15110 * cs-parser.jay: Add fixed buffer parsing.
15112 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
15115 * expression.cs (Indirection): Extended implementation to accept
15116 fixed buffer field.
15117 (PointerArithmetic.Emit): Get element from fixed buffer as well.
15118 (ElementAccess.MakePointerAccess): Get type as parameter.
15119 (DoResolve): Add fixed buffer field expression conversion.
15120 (DoResolveLValue): Ditto.
15121 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
15122 (ArrayPtr): Derives from FixedBufferPtr.
15123 (ArrayPtr.Emit): Add extra emit for array elements.
15125 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
15127 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
15128 for compiler generated types.
15129 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
15131 * statement.cs (Fixed): Refactored to be easier add fixed buffer
15132 and consume less memory.
15133 (Fixed.Resolve): Add fixed buffer case.
15135 * typemanager.cs (compiler_generated_attr_ctor,
15136 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
15137 (HasElementType): Add our own implementation to work on every
15140 2005-02-11 Miguel de Icaza <miguel@novell.com>
15142 * anonymous.cs (CaptureContext): Track whether `this' has been
15145 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
15146 only captured `this' if it was implicitly done (instance
15147 methods/variables were used).
15149 * codegen.cs (EmitContext.CaptureThis): New method to flag that
15150 `this' must be captured.
15152 2005-01-30 Miguel de Icaza <miguel@novell.com>
15154 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
15155 is null it means that there has been no need to capture anything,
15156 so we just create a sibling.
15158 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
15160 Just a partial fix. The other half is fairly elusive.
15162 2005-02-10 Raja R Harinath <rharinath@novell.com>
15164 Fix #52586, cs0121-4.cs.
15165 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
15166 and return a hashtable.
15167 (MemberCache.ClearDeclaredOnly): New.
15168 (MemberCache.MemberCache): Update to change. Make a deep copy of
15169 the method_hash of a base type too.
15170 (MemberCache.AddMethods): Adapt to having a deep copy of the base
15171 type methods. Overwrite entries with the same MethodHandle so
15172 that the ReflectedType is correct. The process leaves in base
15173 virtual functions and their overrides as distinct entries.
15174 (CacheEntry): Now a class instead of a struct. It shouldn't alter
15175 matters since it was boxed in a ArrayList before.
15176 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
15178 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
15179 case of a virtual function and its override (choose the overload
15181 (Invocation.OverloadResolve): Avoid 'override' members during
15182 'applicable_type' calculation.
15184 2005-02-09 Raja R Harinath <rharinath@novell.com>
15186 Combine two near-redundant caches.
15187 * typemanager.cs (method_params): Rename from method_internal_params.
15188 (TypeManager.GetParameterData): New. Replace
15189 Invocation.GetParameterData.
15190 (TypeManager.LookupParametersByBuilder): Remove.
15191 * expression.cs (Invocation.method_parameter_cache): Remove.
15192 (Invocation.GetParameterData): Remove.
15194 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
15197 2005-02-08 Raja R Harinath <rharinath@novell.com>
15200 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
15201 TypeManager.multicast_delegate_type is null, resolve it by looking
15202 up "System.MulticastDelegate".
15203 * rootcontext.cs (RootContext.ResolveCore): Simplify.
15205 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
15206 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
15207 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
15210 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
15211 (LabeledStatement.AddReference): New. Set 'referenced'.
15212 (Goto.Resolve): Use it.
15214 2005-02-05 John Luke <john.luke@gmail.com>
15216 * driver.cs: remove duplicate -doc line in Usage ()
15218 2005-02-04 Raja R Harinath <rharinath@novell.com>
15220 * location.cs (Location.AddFile): Fix CS2002 error report.
15222 2005-02-02 Martin Baulig <martin@ximian.com>
15224 * delegate.cs (Delegate.DefineType): Report an internal error if
15225 TypeManager.multicast_delegate_type is null. See bug #72015 for
15228 2005-02-02 Raja R Harinath <rharinath@novell.com>
15230 Fix a crasher in a variant of #31984.
15231 * const.cs (Constant.CheckBase): New override that defers the
15232 new-or-override check in case the base type hasn't been populated
15234 (Constant.Define): Ensure the new-or-override check is performed.
15236 2005-02-01 Duncan Mak <duncan@ximian.com>
15238 * const.cs (LookupConstantValue): Check that `ce' is not null
15239 before calling GetValue ().
15241 2005-02-01 Raja R Harinath <rharinath@novell.com>
15243 Fix test-334.cs (#69519).
15244 * cs-parser.jay (using_alias_directive): Pass in an expression to
15245 NamespaceEntry.UsingAlias.
15246 (using_namespace_directive): Pass in an expression to
15247 NamespaceEntry.Using.
15248 (namespace_name): Don't flatten to a string.
15249 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
15250 (NamespaceEntry.AliasEntry.Resolve): Lookup using
15252 (NamespaceEntry.UsingEntry): Likewise.
15253 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
15255 (NamespaceEntry.LookupForUsing): Remove.
15256 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
15258 (NamespaceEntry.Lookup): Remove support for dotted names.
15260 2005-02-01 Raja R Harinath <rharinath@novell.com>
15262 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
15264 (NamespaceEntry.ImplicitParent): Compute on demand.
15265 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
15266 parallels the current.
15267 (NamespaceEntry.LookupForUsing): Use it.
15268 (NamespaceEntry.Lookup): If the current namespace-entry is
15269 implicit, don't search aliases and using tables.
15271 2005-02-01 Raja R Harinath <rharinath@novell.com>
15274 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
15276 (TypeContainer.BaseCache): Compute on demand.
15277 (TypeContainer.FindMembers): Define constants and types if they're
15278 not already created.
15279 (FieldMember.Define): Move resetting of ec.InUnsafe before error
15281 * const.cs (Constant.Define): Make idempotent.
15283 2005-01-29 Miguel de Icaza <miguel@novell.com>
15285 * pending.cs: Produce better code (no nops produced by using Ldarg
15288 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
15289 i - 1' it should be arg + 1.
15293 2005-01-28 Raja R Harinath <rharinath@novell.com>
15295 * attribute.cs (Attribute.CheckAttributeType): Make private
15297 (Attribute.ResolveType): Make virtual.
15298 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
15299 handling of RootContext.Tree.Types.
15301 2005-01-27 Raja R Harinath <rharinath@novell.com>
15303 Update attribute-handling to use the SimpleName/MemberAccess
15305 * cs-parser.jay (attribute): Pass in an expression to the
15306 constructors of Attribute and GlobalAttribute.
15307 * attribute.cs (Attribute): Take an expression for the name.
15308 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
15309 passed in attribute name expression.
15310 (Attribute.CheckAttributeType): Use it.
15311 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
15312 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
15313 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
15314 argument to prevent error messages if the lookup fails.
15316 2005-01-27 Marek Safar <marek.safar@seznam.cz>
15318 * expression.cs (Indirection): Implemented IVariable interface
15319 to support indirection in AddressOf operator.
15320 (PointerArithmetic.Emit): Add optimalization for case where
15321 result can be precomputed.
15323 2005-01-26 Martin Baulig <martin@ximian.com>
15325 * class.cs (TypeContainer.AttributeTargets): Return the correct
15326 AttributeTargets depending on our `Kind' instead of throwing an
15327 exception; fixes #71632.
15329 2005-01-26 Marek Safar <marek.safar@seznam.cz>
15332 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
15335 2005-01-25 Raja R Harinath <rharinath@novell.com>
15338 * expression.cs (MemberAccess.DoResolve): Don't complain with
15339 cs0572 when the LHS of a member access has identical name and type
15342 2005-01-25 Marek Safar <marek.safar@seznam.cz>
15345 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
15347 Create custom PermissionSet only for PermissionSetAttribute.
15349 2005-01-24 Marek Safar <marek.safar@seznam.cz>
15352 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
15353 delegates in static class.
15355 2005-01-24 Martin Baulig <martin@ximian.com>
15357 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15358 merging an implicit block, just use its reachability.
15360 * statement.cs (Block.Resolve): Make the unreachable code check
15361 work wrt. implicit blocks; see test-337 from #63842.
15363 2005-01-21 Alp Toker <alp@atoker.com>
15365 * cs-parser.jay: destructor_declaration's container is PartialContainer
15366 not Class when partial types are used, so use Kind prop instead of
15369 2005-01-22 Miguel de Icaza <miguel@ximian.com>
15371 * cs-parser.jay: Improve error reporting when an interface
15372 declares new types.
15374 2005-01-20 Dick Porter <dick@ximian.com>
15376 * support.cs: SeekableStreamReader fix from Sandor Dobos
15377 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
15378 chars are read. Fixes bug 70369.
15380 2005-01-20 Raja R Harinath <rharinath@novell.com>
15382 * cs-parser.jay (catch_clause): Simplify current_block handling
15385 2005-01-17 Miguel de Icaza <miguel@ximian.com>
15387 * convert.cs (ImplicitStandardConversionExists): Synchronize the
15388 code with ImplicitStandardConversion to handle the implicit
15389 conversion of method groups into valid delegate invocations.
15391 The problem is that in parameter handling we were using this code
15392 path. Fixes bug #64698
15394 2005-01-19 Raja R Harinath <rharinath@novell.com>
15396 * cs-parser.jay: Fix several infelicities.
15397 - Avoid assigning to the parser value stack. Code like
15398 '$3 = null' is unclean. Synthesize a value for the code block
15400 - Avoid using oob_stack for storing location information. Use ...
15401 (_mark_): ... this. New (empty) rule. Saves the current location
15403 (foreach_statement): Avoid using oob_stack for current_block
15404 handling. Use technique used in for_statement and
15405 using_statement. Synthesize a value for the code block to store
15406 additional intermediate information.
15408 2005-01-13 Miguel de Icaza <miguel@ximian.com>
15410 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
15411 of a different type is only allowed to private fields of a
15412 containing type, not on fields of a base class.
15414 See test-174.cs and error cs0122-9.cs
15416 2005-01-13 Raja R Harinath <rharinath@novell.com>
15418 Fix test-335.cs (bug #58126).
15419 * cs-parser.jay (argument): Split out non-expression parts of the
15420 rule into 'non_simple_argument'.
15421 (invocation_expression): Support parenthesized invocations with
15422 multiple arguments, and with single non-simple arguments.
15424 2005-01-13 Raja R Harinath <rharinath@novell.com>
15426 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
15429 2005-01-12 Raja R Harinath <rharinath@novell.com>
15431 Fix cs0038-1.cs, cs1640-6.cs.
15432 * ecore.cs (Expression.Resolve): Remove special-case for
15433 SimpleName in error-handling.
15434 (Expression.almostMatchedMembers): Relax access permission to
15436 (Expression.MemberLookupFailed): Handle duplicates in
15437 almostMatchedMembers list.
15438 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
15439 * expression.cs (New.DoResolve): Report CS1540 for more cases.
15440 * typemanager.cs (GetFullNameSignature): Use the MethodBase
15441 overload if the passed in MemberInfo is a MethodBase.
15443 2005-01-12 Marek Safar <marek.safar@seznam.cz>
15446 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
15447 for non-CAS & merge permission sets properly.
15449 2005-01-11 Raja R Harinath <rharinath@novell.com>
15451 Improve standard-compliance of simple name and member access
15452 resolution. Fixes bugs #52697, #57200, #67520, #69519.
15453 * ecore.cs (FullNamedExpression): New abstract base class
15454 for Namespaces and TypeExpressions.
15455 (ResolveFlags.SimpleName): Remove.
15456 (SimpleName): Remove support for dotted names.
15457 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
15458 DeclSpace.FindType and DeclSpace.LookupType.
15459 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
15460 (Expression.ExprClassName): Make member function.
15461 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
15462 a namespace. Remove creation of dotted "SimpleName"s.
15463 (MemberAccess.DoResolve): Likewise.
15464 * decl.cs (DeclSpace.Cache): Make private.
15465 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
15466 (DeclSpace.FindType): Update.
15467 (DeclSpace.LookupType): Move here from RootContext. Return a
15468 FullNamedExpression.
15469 * namespace.cs (Namespace): Derive from FullNamedExpression
15470 so that it can be part of expression resolution.
15471 (Namespace.Lookup): Return an FullNamedExpression.
15472 (NamespaceEntry.LookupAlias): Lookup aliases only in current
15474 * rootcontext.cs (NamespaceLookup): Remove.
15475 (LookupType): Move to DeclSpace.
15476 * attribute.cs (CheckAttributeType): Update.
15477 * doc.cs (FindDocumentedType): Remove allowAlias argument.
15478 (FindDocumentedTypeNonArray): Likewise.
15480 2005-01-11 Raja R Harinath <rharinath@novell.com>
15482 Fix cs0509.cs, cs1632.cs.
15483 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
15484 is the same as IsInterface.
15485 (TypeContainer.GetClassBases): Likewise.
15486 * statement.cs (LabeledStatement.ig): New field.
15487 (LabeledStatement.LabelTarget): Save ILGenerator which created the
15489 (LabeledStatement.DoEmit): Check that the label was created with
15490 the same ILGenerator.
15492 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15495 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
15496 accessors to its properties.
15498 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
15499 from accessors to property.
15501 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15504 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
15505 only for overrides.
15507 2005-01-08 Miguel de Icaza <miguel@ximian.com>
15509 * attribute.cs: Check for null and empty strings.
15511 I have lost another battle to Paolo.
15513 2005-01-07 Marek Safar <marek.safar@seznam.cz>
15516 * class.cs (PropertyMethod): Set Parent field in ctors.
15517 (SetMethod.InternalParameters): Add unsafe switch hack.
15518 Override MarkForDuplicationCheck where it is appropriate.
15520 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
15521 It says whether container allows members with the same name.
15522 Base default is no.
15523 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
15524 Removed is_method parameter.
15526 2005-01-06 Duncan Mak <duncan@ximian.com>
15528 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
15529 because the previous change led to incorrect reporting of CS1032
15530 ("Cannot define/undefine preprocessor symbols after first token in
15531 file"). Instead of using `tokens_seen' as the only flag that
15532 triggers CS1040, introduce `comments_seen'. This new flag is used
15533 to signify having seen comments on the current line, so it is
15534 unset after a newline.
15536 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15538 * doc.cs : When searching for a type, find nested type too.
15539 This fixes bug #71040.
15541 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15544 - Warn missing member comment on those classes which also does not
15545 have doc comments. Fixed bug #71041.
15546 - Don't warn missing doc comment on default constructor.
15549 2005-01-06 Duncan Mak <duncan@ximian.com>
15551 * cs-tokenizer.cs (xtoken): After handling traditional C-style
15552 comments, set `tokens_seen' to true. This allows us to detect
15553 misplaced preprocessor directives (i.e. not at the beginning of
15554 the a line, nor after whitespaces). In that case, report error
15555 CS1040. This fixes bug #56460.
15557 * cs-parser.jay (interface_member_declaration): Add checks for
15558 IsExplicitImpl, and report CS0541 error if an interface member is
15559 defined as an explicit interface declaration.
15561 2005-01-06 Marek Safar <marek.safar@seznam.cz>
15564 * class.cs (PropertyMethod): Set Parent field in ctors.
15565 (SetMethod.InternalParameters): Add unsafe switch hack.
15567 * decl.cs (MemberCore.Parent): Cannot be readonly.
15569 2005-01-06 Raja R Harinath <rharinath@novell.com>
15571 * decl.cs (DeclSpace.ResolveType): Remove.
15572 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
15573 Merge in code from ...
15574 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
15575 * class.cs, enum.cs: Update to changes.
15577 2005-01-06 Miguel de Icaza <miguel@ximian.com>
15579 * anonymous.cs: Ensure that we init the scope of our parent if it
15580 has not been initialized yet.
15582 2004-12-30 Duncan Mak <duncan@ximian.com>
15584 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
15585 if field.FieldBuilder is null. Fixes #70758.
15587 * convert.cs: Fixed some typos and updated some of the comments.
15588 (ImplicitStandardConversionExists):
15589 (TryImplicitIntConversion): If `target_type' is an interface and
15590 the type of `ic' implements this interface, return true or a new
15591 BoxedCast instead of null. This fixes #70468.
15593 2004-12-29 Duncan Mak <duncan@ximian.com>
15595 * expression.cs (Argument.Emit): Check that Expr is
15596 IMemoryLocation before casting to it, and report CS1510 otherwise.
15600 2004-12-21 Ben Maurer <bmaurer@ximian.com>
15602 * statement.cs (Block.ThisVariable): remove the recursion here, to
15603 make the --profile more sane.
15605 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
15607 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
15608 assembly, by JB Evain.
15610 2004-12-17 Raja R Harinath <rharinath@novell.com>
15612 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
15613 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
15614 "parent" refers to enclosing type/class. "base" refers to superclass.
15616 2004-12-17 Raja R Harinath <rharinath@novell.com>
15618 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15619 Ensure that we only have GlobalAttributes.
15620 * attribute.cs (Attribute.Emit): Make non-virtual.
15621 (GlobalAttribute.Emit): Remove.
15622 (Attribute.Resolve): Make virtual.
15623 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
15624 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
15625 the argument. Don't create one.
15626 (Attribute.GetObsoleteAttribute): Likewise.
15627 (Attribute.GetClsCompliantAttributeValue): Likewise.
15628 * class.cs, decl.cs: Update to changes.
15630 2004-12-17 Marek Safar <marek.safar@seznam.cz>
15632 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
15634 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
15636 * statement.cs (Foreach.Resolve): Add error 186 report.
15638 2004-12-16 Marek Safar <marek.safar@seznam.cz>
15640 * expression.cs (Conditional.DoResolve): Add warning 429.
15642 * statement.cs (If.Resolve): Add warning 665.
15644 2004-12-16 Raja R Harinath <rharinath@novell.com>
15646 New invariant: RootContext.Tree.Types.NamespaceEntry == null
15647 except when in the parser, and in GlobalAttribute.
15648 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
15649 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
15650 RootContext.Tree.Types.NamespaceEntry once work is done.
15651 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
15652 and resets RootContext.Tree.Types.NamespaceEntry.
15654 2004-12-15 Marek Safar <marek.safar@seznam.cz>
15656 * cs-parser.jay: Don't create a block for every variable.
15658 2004-12-14 Miguel de Icaza <miguel@ximian.com>
15660 * location.cs: Provide extra information.
15662 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
15663 variables from the captured environment, it is the ldarg_0.
15665 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15667 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
15670 * class.cs: Changed warning level for 169 to avoid developer
15671 displeasure from warning flooding. It will be changed back when they
15672 fix most of current BCL warnings.
15674 * RootContext.cs: Pushed default WarningLevel to 3.
15676 * statement.cs: Removed unused variable.
15678 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15680 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
15681 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
15682 Add error 502 report.
15683 (StaticClass.DefineType): Add error 441 report.
15684 (Class.AllowedModifiersProp): New virtual property as temporary
15685 extension to AllowedModifiers.
15686 (Class.DefineType): Add error 418 report. Moved ModFlags check here
15687 to share implementation with StaticClass and don't call virtual
15690 * driver.cs (MainDriver): Add error 1558 test.
15692 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
15693 report. Moved error 36 test here.
15695 * statement.cs (Throw.Resolve): Add error 724 report.
15697 * typemanager.cs: Add out_attribute_type core type.
15699 2004-12-13 Marek Safar <marek.safar@seznam.cz>
15701 * class.cs (TypeContainer.VerifyClsCompliance): Add error
15703 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
15705 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
15708 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
15710 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
15711 Add error 3023 report.
15712 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
15714 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
15717 2004-12-12 John Luke <john.luke@gmail.com>
15719 * driver.cs (AddArgs): take -- into account when
15720 adding arguments, fixes bug 65710
15722 2004-12-12 Martin Baulig <martin@ximian.com>
15724 * expression.cs (Unary.TryReduceNegative): Added support for
15725 SByteConstant and ByteConstant.
15726 (Unary.Reduce): Check error values from TryReduceNegative().
15728 2004-12-10 Marek Safar <marek.safar@seznam.cz>
15730 * attributes.cs (Attribute.Resolve): Avoid multiple error report
15731 and report exception as error 182.
15733 2004-12-10 Raja R Harinath <rharinath@novell.com>
15735 * driver.cs (Main): Fix message when there are warnings.
15737 2004-12-09 Miguel de Icaza <miguel@ximian.com>
15739 * delegate.cs: Fixed my fix from yesterday, sorry about that.
15741 2004-12-09 Marek Safar <marek.safar@seznam.cz>
15743 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
15744 Reduced number of warnings.
15746 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
15748 2004-12-08 Miguel de Icaza <miguel@ximian.com>
15750 * driver.cs: Removed message.
15752 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
15754 2004-12-08 <vargaz@freemail.hu>
15756 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
15758 2004-12-08 Martin Baulig <martin@ximian.com>
15760 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
15761 instead of a CS3002 for properties and indexer.
15763 2004-12-08 Martin Baulig <martin@ximian.com>
15765 * decl.cs (MemberName.ToString): Make this work again.
15767 2004-12-08 Marek Safar <marek.safar@seznam.cz>
15769 * attribute.cs (Resolve): Add error 591 detection.
15771 * class.cs (FieldMember.Define): Add error 1547 detection.
15772 (Indexer.Define): Add error 620 detection.
15773 (Operator.Define): Add error 590 detection.
15775 * ecore.cs: Missing argument for error 79.
15777 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
15780 2004-12-07 Marek Safar <marek.safar@seznam.cz>
15783 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
15786 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
15788 * cs-parser.jay : handle doc comments on implicit/explicit operators.
15789 Some operator comments were suppressed.
15790 * doc.cs : Implicit/explicit operator name in doc comments are like
15791 "op_Explicit(type)~returnType", so added suffix handling.
15793 2004-12-07 Martin Baulig <martin@ximian.com>
15796 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
15797 (MemberCore.GetClsCompliantAttributeValue): Likewise.
15798 (DeclSpace.ec): New protected field; store the EmitContext here.
15799 (DeclSpace.EmitContext): New public property; moved here from
15801 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
15804 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
15805 (Enum.Emit): Don't create a new EmitContext.
15807 * delegate.cs (Delegate.DefineType): Always create the
15810 * iterators.cs (Iterators.DefineIterator): Create a new
15811 EmitContext and store it in `ec'.
15813 2004-08-24 Martin Baulig <martin@ximian.com>
15816 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
15817 this for accessibility checks.
15818 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
15819 IsNestedFamilyAccessible.
15820 (TypeManager.IsSubclassOf): New method, do what the name actually
15823 2004-12-06 Raja R Harinath <rharinath@novell.com>
15825 Fix crash on cs0657-17.cs.
15826 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15827 Use RootContext.Tree.Types, not 'new RootTypes ()'.
15828 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
15829 the case where the NamespaceEntry gets overwritten.
15831 2004-12-06 Marek Safar <marek.safar@seznam.cz>
15833 Fixed #69195, #56821
15834 * ecore.cs (ResolveBoolean): Tiny refactoring.
15836 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
15837 of right expression resolving when left is false constant and
15838 operator is LogicalAnd OR true constant and operator is LogicalOr.
15840 * statement.cs (ResolveUnreachable): Always reports warning.
15842 2004-12-05 Miguel de Icaza <miguel@ximian.com>
15844 * class.cs: Distinguish between 1721 and 1722 (just a little help
15845 for the programmer).
15847 2004-12-03 Miguel de Icaza <miguel@ximian.com>
15849 * delegate.cs: Only allow this on new versions of the language.
15851 2004-12-02 Duncan Mak <duncan@ximian.com>
15853 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
15855 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
15856 here as a static method. Take an additional bool out parameter
15857 `must_do_cs1540_check' for signaling to InstanceResolve.
15858 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
15859 member field from PropertyExpr class and made it an argument of
15860 the method instead.
15861 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
15862 check for MarshalByRefObject, and report CS0122 instead of CS1540.
15863 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
15864 and `remove_accessor' as well as InstanceResolve: report CS0122
15869 2004-12-03 Raja R Harinath <rharinath@novell.com>
15871 Fix test-327.cs, test-328.cs, and put in early infrastructure
15872 for eventually fixing #52697.
15873 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
15874 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
15875 from other methods.
15876 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
15877 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
15878 (VerifyUsing, error246): Update.
15879 * rootcontext.cs (RootContext.NamespaceLookup): Just use
15880 'NamespaceEntry.LookupNamespaceOrType'.
15882 2004-12-03 Martin Baulig <martin@ximian.com>
15884 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
15885 method as our child, call AnonymousMethod.Compatible() on it.
15887 2004-12-03 Raja R Harinath <rharinath@novell.com>
15889 Disable XML documentation support in 'basic' profile.
15890 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
15891 Redirect XmlElement to System.Object.
15892 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
15893 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
15894 * mcs.exe.sources: Add doc-bootstrap.cs.
15895 * doc-bootstrap.cs: New file. Contains empty stub implementation
15898 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
15900 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
15901 comments are allowed.
15903 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
15905 * delegate.cs: Add checks for subtypes in paramaters and return values
15906 in VerifyMethod () to add support for Covariance/Contravariance
15909 2004-12-02 Miguel de Icaza <miguel@ximian.com>
15911 * report.cs: Remove extra closing parenthesis.
15913 * convert.cs (Error_CannotImplicitConversion): If the name of the
15914 types are the same, provide some extra information.
15916 * class.cs (FieldBase): Use an unused bit field from the field to
15917 encode the `has_offset' property from the FieldMember. This saves
15918 a couple of Ks on bootstrap compilation.
15920 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
15921 method as our child, return the AnonymousMethod resolved
15924 * expression.cs (New.DoResolve): Allow return values from
15925 NewDelegate to also include AnonymousMethods.
15929 2004-12-02 Marek Safar <marek.safar@seznam.cz>
15932 * attribute.cs (Resolve): Improved implementation of params
15933 attribute arguments.
15935 * support.cs (ParameterData): Add HasParams to be faster.
15937 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
15939 all things are for /doc support:
15941 * doc.cs: new file that supports XML documentation generation.
15942 * mcs.exe.sources: added doc.cs.
15944 Handle /doc command line option.
15945 Report error 2006 instead of 5 for missing file name for /doc.
15946 Generate XML documentation when required, after type resolution.
15948 Added support for picking up documentation (/// and /** ... */),
15949 including a new XmlCommentState enumeration.
15951 Added lines to fill Documentation element for field, constant,
15952 property, indexer, method, constructor, destructor, operator, event
15953 and class, struct, interface, delegate, enum.
15954 Added lines to warn incorrect comment.
15956 Added Documentation field (passed only when /doc was specified).
15958 Added DocComment, DocCommentHeader, GenerateDocComment() and
15959 OnGenerateDocComment() and some supporting private members for
15960 /doc feature to MemberCore.
15962 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
15964 Added overriden DocCommentHeader.
15966 Added overriden DocCommentHeader and GenerateDocComment().
15968 2004-12-01 Miguel de Icaza <miguel@ximian.com>
15970 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
15971 unwrapping the enumeration values, chain to
15972 DoConstantNumericPromotions again, so we can promote things to the
15973 fundamental types (takes care of enums that are bytes, sbytes).
15977 2004-12-01 Raja R Harinath <rharinath@novell.com>
15979 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
15980 Fix long-standing bug in type-lookup. Use FindType instead of
15981 LookupType when ec.ResolvingTypeTree.
15982 (Attribute.ResolveType, Attribute.Resolve)
15983 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
15985 (Attributes.Search): Remove internal version. Update.
15986 (Attributes.SearchMulti): Update.
15987 (Attributes.GetClsCompliantAttribute): Remove.
15988 (Attributes.GetIndexerNameAttribute): Remove.
15989 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
15990 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
15991 * class.cs (Indexer.Define): Likewise.
15993 2004-12-01 Marek Safar <marek.safar@seznam.cz>
15996 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
15997 MarshallByReference members access.
15999 * expression.cs: Use CheckMarshallByRefAccess;
16000 Better error CS0197 message.
16002 * report.cs: Print whole related error message.
16004 2004-11-30 Raja R Harinath <rharinath@novell.com>
16006 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
16007 the current directory to help debugging.
16009 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16011 * class (GetClassBases): Better error 60 report.
16012 (EventProperty): Disabled warning 67 detection.
16014 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16017 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
16019 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
16022 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16025 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
16027 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
16029 2004-11-26 Miguel de Icaza <miguel@ximian.com>
16031 * attribute.cs (Attribute.Resolve): Refine error reporting and
16032 report a cs0117 if the identifier does not exist, to distinguish
16033 from 0617 which is a miss-use of the actual identifier.
16035 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
16036 between cs0070 and cs0079.
16038 * class.cs (MemberBase.DoDefine): When reporting a wrong
16039 accessibility level, we use MethodCore to compare instead of
16040 Method (this was a regression in some refactoring effort).
16042 So now we correctly report cs0056 again.
16044 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
16045 testing the target_type (which was known to be object_type) and
16046 not the source type (which is anonymous_method).
16048 Fixed reporting of error cs1660.
16050 * expression.cs (UserCast.Source): Expose the underlying cast.
16052 * statement.cs (Switch.SwitchGoverningType): Sort the list of
16053 allowed types to find a match to int32 first (most common).
16055 In addition, it ignores any ImplicitUserConversions that did an
16056 internal implicit conversion (as the switch statement allows only
16057 one integral conversion to exist).
16059 * class.cs (PartialContainer.Create): rename `name' to
16060 `member_name' for clarity. Then replace the string calls with a
16061 call to MemberName.GetPartialName, as now using
16062 MemberName.ToString is an error (this is due to the side effects
16063 it had, that were fixed in the past).
16065 This will restore the error reporting on a number of partial class
16066 errors that were missusing this (and getting an exception as a
16067 results, which is now just a plain textual warning, because
16068 yyparse debug output would crash otherwise).
16070 2004-11-26 Raja R Harinath <rharinath@novell.com>
16072 * Makefile (PROGRAM_INSTALL_DIR): Remove.
16074 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16076 * rootcontext.cs (LookupType): Make sure to cache lookups that
16077 don't give us a negative result. This saves about 5% of corlib
16080 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16082 * report.cs (AbstractMessage.Print): messages are sent to stderr
16084 * class.cs (TypeContainer.GetClassBases): It is an error to have a
16085 non-interface in the list of interfaces (at this point, either
16086 parent was properly set, or a base class is being listed in the
16087 interfaces section).
16089 This flags error 1722, and resolves the crash from bug 69259.
16091 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16093 * statement.cs (Using.EmitExpressionFinally): make this work right
16094 for valuetypes. Fixes 69926.
16096 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16098 * const.cs (Const.ChangeType): Cope with the "0 literal can be
16099 converted to an enum" here, before we try to change the underlying
16100 type. This code exists, but it is a different code path than the
16101 one used while encoding constants.
16103 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
16104 old bug: when converting from the null literal to a pointer,
16105 return an EmptyCast, not the NullLiteral.
16107 This fixes #69921, the recent null_type changes probably made this
16108 bug more prominent.
16110 (ImplicitReferenceConversionExists): In addition, resynchronized
16111 the code here, so it matches the same code in
16112 ImplicitReferenceConversionExists for the `from any class-type S
16113 to any interface-type T'.
16116 2004-11-25 Marek Safar <marek.safar@seznam.cz>
16118 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
16120 2004-11-24 Miguel de Icaza <miguel@ximian.com>
16122 * cs-parser.jay: Use verbosity accordingly.
16124 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16126 * expression.cs (Unary.ResolveOperator): Do not report warning;
16127 AddressOf reads from variable.
16129 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
16131 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16135 * attribute.cs (Attributable): Removed CheckTargets.
16136 (Attributes.Emit): Explicit attribute targets are tested here.
16138 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
16139 not enabled for interfaces.
16141 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
16142 (GetAssemblyName): Ouch next bug there.
16144 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16146 * expression.cs: Error 275 added.
16148 2004-11-23 Marek Safar <marek.safar@seznam.cz>
16150 Fix bug #69177 (Implemented decimal constant support)
16152 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
16153 (BinaryFold): Add DecimalConstant.
16155 * const.cs (Define): Decimal constant
16157 (ChangeType): Add decimal type handling.
16158 (LookupConstantValue): Don't set value for decimal type but
16159 emit DecimalConstantAttribute. Needed for constant optimization.
16161 * constant.cs (ToDecimal): New method.
16162 (ConvertToDecimal): New method.
16163 (IntConstant): Implemented ConvertToDecimal.
16164 (DecimalConstant.Emit): Emit optimized version for decimals in
16167 * expression.cs (ResolveOperator): Changed order of constant
16168 reduction to work correctly with native types which have
16169 overloaded operators.
16170 (ResolveMemberAccess): Extract constant value from attribute
16173 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
16175 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
16176 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
16177 (ChangeType): Decimal is special.
16178 (TypeToCoreType): Add decimal type.
16180 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16182 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
16185 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16187 * class.cs (EventField.ApplyAttributeBuilder): Fix error
16190 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16192 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
16194 * pending.cs (PendingImplementation): Grab only interfaces.
16196 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16198 * statement.cs (ForeachHelperMethods): Add location member and
16199 error 202 detection.
16201 2004-11-19 Raja R Harinath <rharinath@novell.com>
16203 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
16204 automatically handled by executable.make.
16205 (PROGRAM): Make profile-specific.
16207 2004-11-18 Marek Safar <marek.safar@seznam.cz>
16209 * expression.cs (DoResolveBase): Fixed wrong warning for out
16212 2004-11-18 Martin Baulig <martin@ximian.com>
16214 Merged latest changes into gmcs. Please keep this comment in
16215 here, it makes it easier for me to see what changed in MCS since
16216 the last time I merged.
16218 2004-11-17 Raja R Harinath <rharinath@novell.com>
16220 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
16221 (TypeHandle.GetMemberCache): New.
16222 (TypeHandle.TypeHandle): Update.
16223 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
16224 (TypeManager.LookupParentInterfacesCache):
16225 Rename from LookupInterfaceCache. Optimize slightly.
16226 (TypeManager.MemberLookup_FindMembers): Update.
16227 * decl.cs (MemberCache.MemberCache): Set Container to null in the
16228 multi-type variant.
16229 (AddCacheContents): Rename from AddHashtable.
16230 * class.cs (TypeContainer.parent_container): Remove.
16231 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
16232 (TypeContainer.DoDefineMembers): Don't initialize it.
16233 Update to name changes.
16235 2004-11-17 Miguel de Icaza <miguel@ximian.com>
16237 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
16238 that factors the code to check access modifiers on override.
16240 (PropertyBase): Use the code here.
16242 Patch from Lluis S'anchez, fixes bug #69361.
16244 2004-11-15 Miguel de Icaza <miguel@ximian.com>
16246 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
16247 routine that is used to report the use of a captured variable
16248 whose address has been taken.
16250 There are two checks: one when variables are being captured and
16251 the other check is when the address of a variable is taken.
16253 (because an anonymous methods might be resolved before *or* after
16254 the address has been taken) and
16256 * expression.cs (Conditional.DoResolve): Remove the special
16257 casing that Martin added to trueExpr and falseExpr being both
16258 NullLiteral. We get the right behavior now just by introducing
16259 the null_type into the compiler.
16261 * convert.cs (ExplicitConversion): Change the code to use
16262 null_type instead of testing `expr is NullLiteral'.
16263 (ImplicitConversionStandard): use null_type too.
16264 (ImplicitReferenceConversionExists): use null_type too.
16265 (ImplicitReferenceConversion): use null_type too.
16267 * literal.cs: The type of `NullLiteral' is now null_type instead
16269 (Resolve): Set the type here.
16271 * typemanager.cs: Introduce null_type.
16273 2004-11-17 Martin Baulig <martin@ximian.com>
16275 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
16276 direction, like FindMembers() does. Fixes #69546, testcase is in
16279 2004-11-16 Martin Baulig <martin@ximian.com>
16281 This is based on a patch from Marek Safar, see bug #69082.
16282 Fixes bugs #63705 and #67130.
16284 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
16285 method; create a MemberCache for an interface type and cache the
16288 * decl.cs (IMemberContainer.ParentContainer): Removed.
16289 (IMemberContainer.ParentCache): New property.
16290 (MemberCache.SetupCacheForInterface): Removed.
16291 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
16292 to create a cache for an interface's "parent".
16294 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
16297 2004-11-16 Martin Baulig <martin@ximian.com>
16299 Merged back from gmcs; these changes already went into gmcs a
16300 couple of weeks ago.
16303 (TypeManager.AddUserType): Removed the `ifaces' argument.
16304 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
16306 (TypeManager.AddUserInterface): Removed.
16307 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
16309 (TypeManager.GetInterfaces): Likewise.
16310 (TypeManager.GetExplicitInterfaces): Likewise.
16312 * ecore.cs (TypeExpr.GetInterfaces): Removed.
16314 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
16315 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
16317 2004-11-14 Ben Maurer <bmaurer@ximian.com>
16319 * statement.cs: Avoid adding bools to a hashtable.
16321 2004-11-07 Miguel de Icaza <miguel@ximian.com>
16323 * expression.cs (Invocation.OverloadResolve): Flag error if we are
16324 calling an unsafe method from a safe location.
16326 2004-11-06 Marek Safar <marek.safar@seznam.cz>
16329 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
16331 2004-11-06 Miguel de Icaza <miguel@ximian.com>
16333 * namespace.cs (VerifyUsing): use GetPartialName instead of
16336 2004-11-05 Miguel de Icaza <miguel@ximian.com>
16338 * statement.cs (Return.Resolve): Fix regression in typo: if
16339 `in_exc', we have to request a NeedReturnLabel, this was a typo
16340 introduced in the anonymous method check-in. Fixes #69131.
16342 * Indexers were using the ShortName when defining themselves,
16343 causing a regression in the compiler bootstrap when applying the
16344 patch from 2004-11-02 (first part), now they use their full name
16345 and the bug is gone.
16347 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
16349 * driver.cs: Strip the path from the names of embedded resources. Fixes
16352 2004-11-04 Raja R Harinath <rharinath@novell.com>
16354 Fix error message regression: cs0104-2.cs.
16355 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
16356 (AliasEntry.Resolve): Update.
16357 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
16359 (RootContext.LookupType): Update.
16361 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
16363 * cs-parser.jay: Add support for handling accessor modifiers
16364 * class: Add support port accessor modifiers and error checking,
16365 define PropertyMethod.Define as virtual (not abstract anymore)
16366 * ecore.cs: Add checking for proeprties access with access modifiers
16367 * iterators.cs: Modify Accessor constructor call based in the modified
16369 2004-11-02 Ben Maurer <bmaurer@ximian.com>
16371 * expression.cs (StringConcat): Handle being called twice,
16372 as when we have a concat in a field init with more than two
16375 2004-11-02 Miguel de Icaza <miguel@ximian.com>
16377 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
16378 special case explicit implementations, we should always produce
16379 the .property or .event declaration.
16381 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
16382 since it will not return correct data if people use this
16383 unresolved in the presence of using statements (see test-313).
16385 * class.cs (MethodData.Define): If we are an explicit interface
16386 implementation, set the method name to the full name of the
16387 interface plus the name of the method.
16389 Notice that using the method.MethodName.GetFullName() does not
16390 work, as it will only contain the name as declared on the source
16391 file (it can be a shorthand in the presence of using statements)
16392 and not the fully qualifed type name, for example:
16396 class D : ICloneable {
16397 object ICloneable.Clone () {
16401 Would produce a method called `ICloneable.Clone' instead of
16402 `System.ICloneable.Clone'.
16404 * namespace.cs (Alias.Resolve): Use GetPartialName.
16406 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16408 * cs-parser.jay: Add error 1055 report.
16410 2004-11-01 Miguel de Icaza <miguel@ximian.com>
16412 * assign.cs (Assign.DoResolve): Only do the transform of
16413 assignment into a New if the types are compatible, if not, fall
16414 through and let the implicit code deal with the errors and with
16415 the necessary conversions.
16417 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16419 * cs-parser.jay: Add error 1031 report.
16421 * cs-tokenizer.cs: Add location for error 1038.
16423 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16425 * cs-parser.jay: Add error 1016 report.
16427 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16429 * cs-parser.jay: Add errors 1575,1611 report.
16431 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16433 * cs-parser.jay: Add error 1001 report.
16435 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16438 * attribute.cs (GetMarshal): Add method argument for
16439 caller identification.
16441 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
16442 agument for GetMarshal and RuntimeMissingSupport.
16444 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16446 * attribute.cs (ExtractSecurityPermissionSet): Removed
16447 TypeManager.code_access_permission_type.
16449 * typemanager.cs: Removed TypeManager.code_access_permission_type.
16451 2004-10-27 Miguel de Icaza <miguel@ximian.com>
16453 * expression.cs (LocalVariableReference.DoResolveLValue): Check
16454 for obsolete use of a variable here. Fixes regression on errors
16455 cs0619-25 and cs0619-26.
16457 2004-10-27 Marek Safar <marek.safar@seznam.cz>
16459 Fix #62358, implemented security attribute encoding.
16461 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
16462 Tests permitted SecurityAction for assembly or other types.
16463 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
16464 data from SecurityPermissionAttribute to PermisionSet class.
16466 * class.cs (ApplyAttributeBuilder): Added special handling
16467 for System.Security.Permissions.SecurityAttribute based types.
16469 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
16470 special handling for System.Security.Permissions.SecurityAttribute
16473 * enum.cs (ApplyAttributeBuilder): Added special handling
16474 for System.Security.Permissions.SecurityAttribute based types.
16476 * parameter.cs (ApplyAttributeBuilder): Added special handling
16477 for System.Security.Permissions.SecurityAttribute based types.
16479 * rootcontext.cs: Next 2 core types.
16481 * typemanager.cs (TypeManager.security_permission_attr_type):
16482 Built in type for the SecurityPermission Attribute.
16483 (code_access_permission_type): Build in type.
16485 2004-10-17 Miguel de Icaza <miguel@ximian.com>
16487 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
16488 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
16489 all of this information into
16490 EmitContext.EmitCapturedVariableInstance.
16492 * codegen.cs (EmitCapturedVariableInstance): move here the
16493 funcionality of emitting an ldarg.0 in the presence of a
16494 remapping. This centralizes the instance emit code.
16496 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
16497 then emit a load of this: it means that we have reached the
16498 topmost ScopeInfo: the one that contains the pointer to the
16499 instance of the class hosting the anonymous method.
16501 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
16502 captures to the topmost CaptureContext.
16504 2004-10-12 Miguel de Icaza <miguel@ximian.com>
16506 * expression.cs (LocalVariableReference): Move the knowledge about
16507 the iterators into codegen's EmitCapturedVariableInstance.
16509 2004-10-11 Miguel de Icaza <miguel@ximian.com>
16511 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
16512 all code paths return a value from an anonymous method (it is the
16513 same as the 161 error, but for anonymous methods).
16515 2004-10-08 Miguel de Icaza <miguel@ximian.com>
16517 The introduction of anonymous methods in the compiler changed
16518 various ways of doing things in the compiler. The most
16519 significant one is the hard split between the resolution phase
16520 and the emission phases of the compiler.
16522 For instance, routines that referenced local variables no
16523 longer can safely create temporary variables during the
16524 resolution phase: they must do so from the emission phase,
16525 since the variable might have been "captured", hence access to
16526 it can not be done with the local-variable operations from the runtime.
16530 (Block.Flags): New flag `IsTopLevel' to indicate that this block
16531 is a toplevel block.
16533 (ToplevelBlock): A new kind of Block, these are the blocks that
16534 are created by the parser for all toplevel method bodies. These
16535 include methods, accessors and anonymous methods.
16537 These contain some extra information not found in regular blocks:
16538 A pointer to an optional CaptureContext (for tracking captured
16539 local variables and parameters). A pointer to the parent
16542 (Return.Resolve): Catch missmatches when returning a value from an
16543 anonymous method (error 1662).
16544 Invoke NeedReturnLabel from the Resolve phase instead of the emit
16547 (Break.Resolve): ditto.
16549 (SwitchLabel): instead of defining the labels during the
16550 resolution phase, we now turned the public ILLabel and ILLabelCode
16551 labels into methods called GetILLabelCode() and GetILLabel() that
16552 only define the label during the Emit phase.
16554 (GotoCase): Track the SwitchLabel instead of the computed label
16555 (its contained therein). Emit the code by using
16556 SwitchLabel.GetILLabelCode ().
16558 (LocalInfo.Flags.Captured): A new flag has been introduce to track
16559 whether the Local has been captured or not.
16561 (LocalInfo.IsCaptured): New property, used to tell whether the
16562 local has been captured.
16564 * anonymous.cs: Vastly updated to contain the anonymous method
16567 The main classes here are: CaptureContext which tracks any
16568 captured information for a toplevel block and ScopeInfo used to
16569 track the activation frames for various local variables.
16571 Each toplevel block has an optional capture context associated
16572 with it. When a method contains an anonymous method both the
16573 toplevel method and the anonymous method will create a capture
16574 context. When variables or parameters are captured, they are
16575 recorded on the CaptureContext that owns them, for example:
16579 MyDelegate d = delegate {
16584 Here `a' will be recorded as captured on the toplevel
16585 CapturedContext, the inner captured context will not have anything
16586 (it will only have data if local variables or parameters from it
16587 are captured in a nested anonymous method.
16589 The ScopeInfo is used to track the activation frames for local
16590 variables, for example:
16592 for (int i = 0; i < 10; i++)
16593 for (int j = 0; j < 10; j++){
16594 MyDelegate d = delegate {
16599 At runtime this captures a single captured variable `i', but it
16600 captures 10 different versions of the variable `j'. The variable
16601 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
16602 recorded on a child.
16604 The toplevel ScopeInfo will also track information like the `this'
16605 pointer if instance variables were referenced (this is necessary
16606 as the anonymous method lives inside a nested class in the host
16607 type of the method).
16609 (AnonymousMethod): Expanded to track the Toplevel, implement
16610 `AnonymousMethod.Compatible' to tell whether an anonymous method
16611 can be converted to a target delegate type.
16613 The routine now also produces the anonymous method content
16615 (AnonymousDelegate): A helper class that derives from
16616 DelegateCreation, this is used to generate the code necessary to
16617 produce the delegate for the anonymous method that was created.
16619 * assign.cs: API adjustments for new changes in
16620 Convert.ImplicitStandardConversionExists.
16622 * class.cs: Adjustments to cope with the fact that now toplevel
16623 blocks are of type `ToplevelBlock'.
16625 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
16626 insteda of standard blocks.
16628 Flag errors if params arguments are passed to anonymous methods.
16630 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
16631 `CurrentAnonymousMethod' which points to the current Anonymous
16632 Method. The variable points to the AnonymousMethod class that
16633 holds the code being compiled. It is set in the new EmitContext
16634 created for the anonymous method.
16636 (EmitContext.Phase): Introduce a variable and an enumeration to
16637 assist in enforcing some rules about when and where we are allowed
16638 to invoke certain methods (EmitContext.NeedsReturnLabel is the
16639 only one that enfonces this right now).
16641 (EmitContext.HaveCaptureInfo): new helper method that returns
16642 whether we have a CapturedContext initialized.
16644 (EmitContext.CaptureVariable): New method used to register that a
16645 LocalInfo must be flagged for capturing.
16647 (EmitContext.CapturedParameter): New method used to register that a
16648 parameters must be flagged for capturing.
16650 (EmitContext.CapturedField): New method used to register that a
16651 field must be flagged for capturing.
16653 (EmitContext.HaveCapturedVariables,
16654 EmitContext.HaveCapturedFields): Return whether there are captured
16655 variables or fields.
16657 (EmitContext.EmitMethodHostInstance): This is used to emit the
16658 instance for the anonymous method. The instance might be null
16659 (static methods), this (for anonymous methods that capture nothing
16660 and happen to live side-by-side with the current method body) or a
16661 more complicated expression if the method has a CaptureContext.
16663 (EmitContext.EmitTopBlock): Routine that drives the emission of
16664 code: it will first resolve the top block, then emit any metadata
16665 and then emit the code. The split is done so that we can extract
16666 any anonymous methods and flag any captured variables/parameters.
16668 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
16669 during this phase, the ILGenerator should not be used as labels
16670 and local variables declared here might not be accessible to any
16671 code that is part of an anonymous method.
16673 Exceptions to this include the temporary variables that are
16674 created by some statements internally for holding temporary
16677 (EmitContext.EmitMeta): New routine, in charge of emitting all the
16680 (EmitContext.TemporaryReturn): This method is typically called
16681 from the Emit phase, and its the only place where we allow the
16682 ReturnLabel to be defined other than the EmitMeta. The reason is
16683 that otherwise we would have to duplicate a lot of logic in the
16684 Resolve phases of various methods that today is on the Emit
16687 (EmitContext.NeedReturnLabel): This no longer creates the label,
16688 as the ILGenerator is not valid during the resolve phase.
16690 (EmitContext.EmitThis): Extended the knowledge in this class to
16691 work in anonymous methods in addition to iterators.
16693 (EmitContext.EmitCapturedVariableInstance): This emits whatever
16694 code is necessary on the stack to access the instance to a local
16695 variable (the variable will be accessed as a field).
16697 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
16698 EmitContext.EmitAddressOfParameter): Routines to support
16699 parameters (not completed at this point).
16701 Removals: Removed RemapLocal and RemapLocalLValue. We probably
16702 will also remove the parameters.
16704 * convert.cs (Convert): Define a `ConstantEC' which points to a
16705 null. This is just to prefity some code that uses
16706 ImplicitStandardConversion code and do not have an EmitContext
16709 The idea is to flag explicitly that at that point in time, it is
16710 known that the conversion will not trigger the delegate checking
16711 code in implicit conversions (which requires a valid
16714 Everywhere: pass new EmitContext parameter since
16715 ImplicitStandardConversionExists now requires it to check for
16716 anonymous method conversions.
16718 (Convert.ImplicitStandardConversionExists): If the type of an
16719 expression is the anonymous_method_type, and the type is a
16720 delegate, we invoke the AnonymousMethod.Compatible method to check
16721 whether an implicit conversion is possible.
16723 (Convert.ImplicitConversionStandard): Only do implicit method
16724 group conversions if the language level is not ISO_1.
16726 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
16727 MethodInfo for the Invoke method. used by Delegate and
16730 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
16731 method conversions if the target type is a delegate.
16733 Removed extra debugging nops.
16735 (LocalVariableReference): Turn the `local_info' into a public
16738 Add `prepared' field, the same hack used for FieldExprs to cope
16739 with composed assignments, as Local variables do not necessarily
16740 operate purely on the stack as they used to: they can be captured
16743 Add `temp' for a temporary result, like fields.
16745 Refactor DoResolve and DoResolveLValue into DoResolveBase.
16747 It now copes with Local variables that are captured and emits the
16748 proper instance variable to load it from a field in the captured
16751 (ParameterReference.DoResolveBase): During the resolve phase,
16752 capture parameters if we are in an anonymous method.
16754 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
16755 anonymous method, use the EmitContext helper routines to emit the
16756 parameter reference.
16758 * iterators.cs: Set RemapToProxy to true/false during the
16761 * parameters.cs (GetParameterByName): New helper method.
16763 * typemanager.cs (anonymous_method_type) a new type that
16764 represents an anonyous method. This is always an internal type,
16765 used as a fencepost to test against the anonymous-methodness of an
16768 2004-10-20 Marek Safar <marek.safar@seznam.cz>
16770 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
16772 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
16774 2004-10-18 Martin Baulig <martin@ximian.com>
16776 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
16777 `Type' directly, but call ResolveType() on it.
16778 (Catch.Resolve): Likewise.
16779 (Foreach.Resolve): Likewise.
16781 2004-10-18 Martin Baulig <martin@ximian.com>
16783 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
16784 `Type' directly, but call ResolveType() on it.
16785 (Probe.DoResolve): Likewise.
16786 (ArrayCreation.LookupType): Likewise.
16787 (TypeOf.DoResolve): Likewise.
16788 (SizeOf.DoResolve): Likewise.
16790 2004-10-18 Martin Baulig <martin@ximian.com>
16792 * expression.cs (Invocation.BetterFunction): Put back
16793 TypeManager.TypeToCoreType().
16795 2004-10-18 Raja R Harinath <rharinath@novell.com>
16797 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
16800 2004-10-18 Martin Baulig <martin@ximian.com>
16802 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
16803 `Type' directly, but call ResolveType() on it.
16805 2004-10-18 Martin Baulig <martin@ximian.com>
16807 * class.cs (FieldMember.Define): Don't access the TypeExpr's
16808 `Type' directly, but call ResolveType() on it.
16809 (MemberBase.DoDefine): Likewise.
16811 * expression.cs (New.DoResolve): Don't access the TypeExpr's
16812 `Type' directly, but call ResolveType() on it.
16813 (ComposedCast.DoResolveAsTypeStep): Likewise.
16815 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
16816 `Type' directly, but call ResolveType() on it.
16818 2004-10-17 John Luke <john.luke@gmail.com>
16820 * class.cs (Operator.GetSignatureForError): use CSharpName
16822 * parameter.cs (Parameter.GetSignatureForError): Returns
16823 correct name even if was not defined.
16825 2004-10-13 Raja R Harinath <rharinath@novell.com>
16828 * class.cs (TypeContainer.EmitContext): New property.
16829 (DefineNestedTypes): Create an emitcontext for each part.
16830 (MethodCore.DoDefineParameters): Use container's emitcontext.
16831 Pass type array to InternalParameters.
16832 (MemberBase.DoDefine): Use container's emitcontext.
16833 (FieldMember.Define): Likewise.
16834 (Event.Define): Likewise.
16835 (SetMethod.GetParameterInfo): Change argument to EmitContext.
16836 Pass type array to InternalParameters.
16837 (SetIndexerMethod.GetParameterInfo): Likewise.
16838 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
16839 * delegate.cs (Define): Pass emitcontext to
16840 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
16841 array to InternalParameters.
16842 * expression.cs (ParameterReference.DoResolveBase): Pass
16843 emitcontext to GetParameterInfo.
16844 (ComposedCast.DoResolveAsTypeStep): Remove check on
16845 ec.ResolvingTypeTree.
16846 * parameter.cs (Parameter.Resolve): Change argument to
16847 EmitContext. Use ResolveAsTypeTerminal.
16848 (Parameter.GetSignature): Change argument to EmitContext.
16849 (Parameters.ComputeSignature): Likewise.
16850 (Parameters.ComputeParameterTypes): Likewise.
16851 (Parameters.GetParameterInfo): Likewise.
16852 (Parameters.ComputeAndDefineParameterTypes): Likewise.
16853 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
16854 * support.cs (InternalParameters..ctor): Remove variant that takes
16856 * typemanager.cs (system_intptr_expr): New.
16857 (InitExpressionTypes): Initialize it.
16859 2004-10-12 Chris Toshok <toshok@ximian.com>
16861 * cs-parser.jay: fix location for try_statement and catch_clause.
16863 2004-10-11 Martin Baulig <martin@ximian.com>
16865 * report.cs: Don't make --fatal abort on warnings, we have
16866 -warnaserror for that.
16868 2004-10-07 Raja R Harinath <rharinath@novell.com>
16870 More DeclSpace.ResolveType avoidance.
16871 * decl.cs (MemberCore.InUnsafe): New property.
16872 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
16873 with newly created EmitContext.
16874 (FieldMember.Define): Likewise.
16875 * delegate.cs (Delegate.Define): Likewise.
16876 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
16877 only if normal name-lookup fails.
16878 (TypeExpr.DoResolve): Enable error-checking.
16879 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
16880 (SizeOf.DoResolve): Likewise.
16881 (ComposedCast.DoResolveAsTypeStep): Likewise.
16882 (StackAlloc.DoResolve): Likewise.
16883 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
16884 (Block.Unsafe): New property.
16885 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
16886 (Unsafe): Set 'unsafe' flag of contained block.
16887 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
16888 (Fixed.Resolve): Likewise.
16889 (Catch.Resolve): Likewise.
16890 (Using.ResolveLocalVariableDecls): Likewise.
16891 (Foreach.Resolve): Likewise.
16893 2004-10-05 John Luke <john.luke@gmail.com>
16895 * cs-parser.jay: add location to error CS0175
16897 2004-10-04 Miguel de Icaza <miguel@ximian.com>
16899 * ecore.cs (Expression.Constantity): Add support for turning null
16902 * const.cs (Const.Define): Allow constants to be reference types
16903 as long as the value is Null.
16905 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
16907 * namespace.cs (NamespaceEntry.Using): No matter which warning
16908 level is set, check if this namespace name has already been added.
16910 2004-10-03 Ben Maurer <bmaurer@ximian.com>
16912 * expression.cs: reftype [!=]= null should always use br[true,false].
16915 2004-10-03 Marek Safar <marek.safar@seznam.cz>
16918 * attribute.cs: Enum conversion moved to
16919 GetAttributeArgumentExpression to be applied to the all
16922 2004-10-01 Raja R Harinath <rharinath@novell.com>
16924 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
16925 * class.c (TypeContainer.DefineType): Flag error if
16926 base types aren't accessible due to access permissions.
16927 * decl.cs (DeclSpace.ResolveType): Move logic to
16928 Expression.ResolveAsTypeTerminal.
16929 (DeclSpace.ResolveTypeExpr): Thin layer over
16930 Expression.ResolveAsTypeTerminal.
16931 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
16932 Refactor code into NestedAccess. Use it.
16933 (DeclSpace.NestedAccess): New.
16934 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
16935 argument to silence errors. Check access permissions.
16936 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
16937 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
16938 (Cast.DoResolve): Likewise.
16939 (New.DoResolve): Likewise.
16940 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
16941 (TypeOf.DoResolve): Likewise.
16943 * expression.cs (Invocation.BetterConversion): Return the Type of
16944 the better conversion. Implement section 14.4.2.3 more faithfully.
16945 (Invocation.BetterFunction): Make boolean. Make correspondence to
16946 section 14.4.2.2 explicit.
16947 (Invocation.OverloadResolve): Update.
16948 (Invocation): Remove is_base field.
16949 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
16950 (Invocation.Emit): Likewise.
16952 2004-09-27 Raja R Harinath <rharinath@novell.com>
16954 * README: Update to changes.
16956 2004-09-24 Marek Safar <marek.safar@seznam.cz>
16958 * cs-parser.jay: Reverted 642 warning fix.
16960 2004-09-23 Marek Safar <marek.safar@seznam.cz>
16963 * decl.cs (FindMemberWithSameName): Indexer can have more than
16966 2004-09-23 Marek Safar <marek.safar@seznam.cz>
16968 * expression.cs (LocalVariableReference.DoResolveLValue):
16969 Do not report warning 219 for out values.
16970 (EmptyExpression.Null): New member to avoid extra allocations.
16972 2004-09-23 Marek Safar <marek.safar@seznam.cz>
16974 * cs-parser.jay: Fix wrong warning 642 report.
16976 * cs-tokenizer.cs (CheckNextToken): New helper;
16977 Inspect next character if is same as expected.
16979 2004-09-23 Martin Baulig <martin@ximian.com>
16981 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
16982 (Convert.ImplicitReferenceConversionExists): Likewise.
16984 2004-09-23 Marek Safar <marek.safar@seznam.cz>
16986 * class.cs (Operator.Define): Add error 448 and 559 report.
16988 2004-09-22 Marek Safar <marek.safar@seznam.cz>
16990 * class.cs (MemberBase.IsTypePermitted): New protected
16991 method for checking error CS0610.
16993 2004-09-22 Marek Safar <marek.safar@seznam.cz>
16995 * class.cs (TypeContainer.HasExplicitLayout): New property
16996 Returns whether container has StructLayout attribute set Explicit.
16997 (FieldMember): New abstract class for consts and fields.
16998 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
16999 (Field): Reuse FieldMember.
17001 * const.cs (Const): Reuse FieldMember.
17003 * rootcontext.cs: EmitConstants call moved to class.
17005 2004-09-22 Martin Baulig <martin@ximian.com>
17007 Thanks to Peter Sestoft for this bug report.
17009 * expression.cs (Conditional): If both the `trueExpr' and the
17010 `falseExpr' is a NullLiteral, return a NullLiteral.
17012 2004-09-22 Martin Baulig <martin@ximian.com>
17014 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
17015 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
17016 for the "get_Current" call.
17018 2004-09-22 Martin Baulig <martin@ximian.com>
17020 Marek and me just fixed one of our oldest bugs: #28562 :-)
17022 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
17024 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
17025 we're an EnumConstant, just return that.
17026 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
17027 an EnumConstant. In this case, we need to use GetValueAsEnumType()
17028 to get the value which'll actually be written into the attribute.
17029 However, we have to use GetValue() to access the attribute's value
17032 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17034 * constant.cs (Constant.IsNegative): New abstract property
17037 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
17038 (StackAlloc.DoResolve): Reused IsNegative.
17040 2004-09-21 Martin Baulig <martin@ximian.com>
17042 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
17043 if we're used in an iterator, we may be called from different
17046 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
17047 we actually have an exception block.
17049 2004-09-20 John Luke <jluke@cfl.rr.com>
17051 * class.cs, cs-parser.jay: Improve the error report for 1520:
17052 report the actual line where the error happens, not where the
17053 class was declared.
17055 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
17056 Pass location information that was available elsewhere.
17058 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
17060 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
17061 runtime to delay sign assemblies.
17063 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17065 * cs-parser.jay: Do not report the stack trace, this is barely
17068 2004-08-22 John Luke <john.luke@gmail.com>
17070 * driver.cs : check that a resource id is not already used
17071 before adding it, report CS1508 if it is, bug #63637
17073 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17075 * ecore.cs: Removed dead code.
17077 2004-09-18 Marek Safar <marek.safar@seznam.cz>
17079 * class.cs: Do not report warning CS0067 on the interfaces.
17081 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17083 * cs-parser.jay: Add error 504 report.
17085 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17087 * rootcontext.cs: WarningLevel is 4 by default now.
17089 * statement.cs (Fixed.Resolve): Do not null
17092 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17095 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
17096 deep search when property is not virtual.
17097 (PropertyExpr.ResolveAccessors): Make one call for both
17100 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17103 * statement.cs: Error 152 report constains also location.
17105 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17108 * const.cs: Explicitly set constant as static.
17110 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17113 * cs-parser.jay: Add error 1017 report.
17115 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17117 Fixed bug #59980, #64224
17118 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
17120 * typemanager.cs (IsSpecialMethod): Simplified
17122 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17124 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
17125 condition with better params.
17127 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17130 * attribute.cs (Resolve): Property has to have both
17133 2004-09-14 Martin Baulig <martin@ximian.com>
17135 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
17137 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17140 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
17141 called and is obsolete then this member suppress message
17142 when call is inside next [Obsolete] method or type.
17144 * expression.cs: Use TestObsoleteMethodUsage member.
17146 2004-09-14 Martin Baulig <martin@ximian.com>
17148 * cs-parser.jay: Sync a bit with the GMCS version.
17150 2004-09-14 Martin Baulig <martin@ximian.com>
17152 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
17153 (CSharpParser.yacc_verbose_flag): New public field.
17155 * genericparser.cs: Removed.
17157 2004-09-14 Raja R Harinath <rharinath@novell.com>
17159 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
17161 2004-09-13 Marek Safar <marek.safar@seznam.cz>
17163 * class.cs (MethodCore.CheckBase): Fix bug #65757.
17165 2004-09-10 Martin Baulig <martin@ximian.com>
17167 Backported my MemberName changes from GMCS into MCS.
17169 - we are now using a special `MemberName' class instead of using
17170 strings; in GMCS, the `MemberName' also contains the type
17173 - changed the grammar rules a bit:
17174 * the old `member_name' is now a `namespace_or_type_name':
17175 The rule is that we use `namespace_or_type_name' everywhere
17176 where we expect either a "member name" (GetEnumerator) or a
17177 "member name" with an explicit interface name
17178 (IEnumerable.GetEnumerator).
17179 In GMCS, the explicit interface name may include type arguments
17180 (IEnumerable<T>.GetEnumerator).
17181 * we use `member_name' instead of just `IDENTIFIER' for
17183 The rule is that we use `member_name' wherever a member may
17184 have type parameters in GMCS.
17186 * decl.cs (MemberName): New public class.
17187 (MemberCore.MemberName): New public readonly field.
17188 (MemberCore.ctor): Take a `MemberName' argument, not a string.
17189 (DeclSpace): Likewise.
17191 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
17192 * enum.cs (Enum.ctor): Likewise.
17194 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
17196 (AliasEntry.ctor): Take a MemberName, not an Expression.
17197 (AliasEntry.UsingAlias): Likewise.
17199 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
17200 (IMethodData.MemberName): Changed type from string to MemberName.
17201 (MemberBase.ExplicitInterfaceName): Likewise.
17202 (AbstractPropertyEventMethod.SetupName): Make this private.
17203 (AbstractPropertyEventMethod.ctor): Added `string prefix'
17204 argument; compute the member name here.
17205 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
17206 on the `member.MemberName' and the `prefix'.
17208 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
17210 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
17211 thus, we get a `MemberName' instead of a `string'. These
17212 declarations may have type parameters in GMCS.
17213 (interface_method_declaration, delegate_declaration): Likewise.
17214 (class_declaration, interface_declaration): Likewise.
17215 (method_header): Use `namespace_or_type_name' instead of
17216 `member_name'. We may be an explicit interface implementation.
17217 (property_declaration, event_declaration): Likewise.
17218 (member_name): This is now just an `IDENTIFIER', not a
17219 `namespace_or_type_name'.
17220 (type_name, interface_type): Removed.
17221 (namespace_or_type_name): Return a MemberName, not an Expression.
17222 (primary_expression): Use `member_name' instead of `IDENTIFIER';
17223 call GetTypeExpression() on the MemberName to get an expression.
17224 (IndexerDeclaration.interface_type): Changed type from string to
17226 (MakeName): Operate on MemberName's instead of string's.
17228 2004-09-13 Raja R Harinath <rharinath@novell.com>
17231 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
17232 (NamespaceEntry.Lookup): Add new argument to flag if we want the
17233 lookup to avoid symbols introduced by 'using'.
17234 * rootcontext.cs (NamespaceLookup): Update.
17236 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17238 * class.cs (TypeContainer.DoDefineMembers): Do not call
17239 DefineDefaultConstructor for static classes.
17241 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17243 * attribute.cs (Attribute.Resolve): Add error 653 report.
17245 * class.cs (Class.ApplyAttributeBuilder): Add error 641
17247 (Method.ApplyAttributeBuilder): Add error 685 report.
17248 (Operator.Define): Add error 564 report.
17250 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
17252 * expression.cs (Invocation.DoResolve): Add error
17253 245 and 250 report.
17255 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
17258 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17260 * class.cs (ConstructorInitializer.Resolve):
17261 Wrong error number (515->516).
17263 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17265 * class.cs (Indexer.Define): Add error 631 report.
17267 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17269 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
17271 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17273 * expression.cs (Probe.DoResolve): Add error CS0241 report.
17275 2004-09-10 Marek Safar <marek.safar@seznam.cz>
17277 * cs-parser.jay: Added error CS0241 report.
17279 2004-09-10 Raja R Harinath <rharinath@novell.com>
17281 * cs-parser.jay (fixed_statement): Introduce a scope for the
17282 declaration in the 'fixed' statement.
17284 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17286 * cs-parser.jay: Added CS0230 error report.
17288 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17290 * cs-parser.jay: Added errors CS0231 and CS0257 report.
17292 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17294 * expression.cs (Argument.Resolve): Added error CS0192 and
17297 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17299 C# 2.0 #pragma warning feature
17301 * cs-tokenizer.cs (PreProcessPragma): New method;
17302 Handles #pragma directive.
17304 * report.cs (WarningRegions): New class; Support
17305 class for #pragma warning directive. It tests whether
17306 warning is enabled for a given line.
17308 2004-09-08 Miguel de Icaza <miguel@ximian.com>
17310 * const.cs: Add more descriptive error report, tahnks to
17313 2004-09-08 Marek Safar <marek.safar@seznam.cz>
17315 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
17317 2004-09-07 Miguel de Icaza <miguel@ximian.com>
17319 * expression.cs: Apply patch from Ben: Remove dead code from
17320 ArrayCreation, and remove the TurnintoConstant call in const.cs,
17321 as that code just threw an exception anwyays.
17323 * const.cs: Remove the call to the turnintoconstant, for details
17326 * literal.cs: The type of the null-literal is the null type; So
17327 we use a placeholder type (literal.cs:System.Null, defined here)
17330 * expression.cs (Conditional.DoResolve): Remove some old code that
17331 is no longer needed, conversions have been fixed.
17333 (ArrayCreationExpression.DoResolve): Return false if we fail to
17334 resolve the inner expression.
17336 2004-09-07 Raja R Harinath <rharinath@novell.com>
17339 * cs-parser.jay (delegate_declaration): Record a delegate
17340 declaration as a type declaration.
17341 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
17343 2004-09-06 Miguel de Icaza <miguel@ximian.com>
17345 * parameter.cs: Do not crash if the type can not be resolved.
17347 * expression.cs: Report errors with unsafe pointers, fixes #64896
17349 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
17351 * expression.cs: Pointer arith always needs to do a conv.i
17352 if the operand is a long. fix 65320
17354 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17356 Fixed cs0619-37.cs, cs0619-38.cs
17358 * enum.cs (GetObsoleteAttribute): Removed.
17360 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
17361 on Enum member is double staged. The first is tested member
17364 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17366 Fixed #56986, #63631, #65231
17368 * class.cs: (TypeContainer.AddToMemberContainer): New method,
17369 adds member to name container.
17370 (TypeContainer.AddToTypeContainer): New method, adds type to
17372 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
17373 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
17374 AddOperator): Simplified by reusing AddToMemberContainer.
17375 (TypeContainer.UserDefinedStaticConstructor): Changed to property
17377 (Method.CheckForDuplications): Fixed implementation to test all
17379 (MemberBase): Detection whether member is explicit interface
17380 implementation is now in constructor.
17381 (MemberBase.UpdateMemberName): Handles IndexerName.
17382 (Accessor): Changed to keep also location information.
17383 (AbstractPropertyEventMethod): Is derived from MemberCore.
17384 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
17385 will be emited or not.
17386 (PropertyBase.AreAccessorsDuplicateImplementation):
17387 Tests whether accessors are not in collision with some method.
17388 (Operator): Is derived from MethodCore to simplify common
17391 * decl.cs (Flags.TestMethodDuplication): Test for duplication
17393 (DeclSpace.AddToContainer): Adds the member to defined_names
17394 table. It tests for duplications and enclosing name conflicts.
17396 * enum.cs (EnumMember): Clean up to reuse the base structures
17398 2004-09-03 Martin Baulig <martin@ximian.com>
17400 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
17401 into TypeContainer, to make partial classes work again.
17403 2004-09-03 Martin Baulig <martin@ximian.com>
17405 * rootcontext.cs (RootContext.V2): Removed.
17407 2004-03-23 Martin Baulig <martin@ximian.com>
17409 * expression.cs (Invocation.OverloadResolve): Added `bool
17410 may_fail' argument and use it instead of the Location.IsNull() hack.
17412 2004-09-03 Martin Baulig <martin@ximian.com>
17414 Merged latest changes into gmcs. Please keep this comment in
17415 here, it makes it easier for me to see what changed in MCS since
17416 the last time I merged.
17418 2004-09-03 Raja R Harinath <rharinath@novell.com>
17421 * expression.cs (BetterConversion): Don't allow either conversion
17422 to be null. Remove redundant implicit conversion test when 'q ==
17423 null' -- when this function is invoked, we already know that the
17424 implicit conversion exists.
17425 (BetterFunction): Assume that 'best' is non-null. Remove
17426 redundant reimplementation of IsApplicable when 'best' is null.
17427 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
17428 number of arguments.
17429 (IsAncestralType): Extract from OverloadResolve.
17430 (OverloadResolve): Make robust to the MethodGroupExpr being
17431 unsorted. Implement all the logic of Section 14.5.5.1, and
17432 support overloading of methods from multiple applicable types.
17433 Clean up logic somewhat. Don't pass null methods to BetterFunction.
17435 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
17436 (RealError, Warning): Append type of report to related symbol.
17438 2004-09-03 Marek Safar <marek.safar@seznam.cz>
17440 * enum.cs: Fixed CLS-Compliance checks for enum members.
17441 Error tests cs3008-8.cs, cs3014-8.cs
17443 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17445 Fixed bug #62342, #63102
17446 * class.cs: ImplementIndexer uses member.IsExplicitImpl
17447 like ImplementMethod.
17449 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17451 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17454 2004-09-02 Martin Baulig <martin@ximian.com>
17456 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
17457 TypeManager.GetArgumentTypes() rather than calling GetParameters()
17460 2004-09-01 Marek Safar <marek.safar@seznam.cz>
17462 C# 2.0 Static classes implemented
17464 * class.cs (TypeContainer): instance_constructors,
17465 initialized_fields, initialized_static_fields,
17466 default_constructor, base_inteface_types are protected to be
17467 accessible from StaticClass.
17468 (TypeContainer.DefineDefaultConstructor): New virtual method
17469 for custom default constructor generating
17470 (StaticClass): New class to handle "Static classes" feature.
17472 * cs-parser.jay: Handle static keyword on class like instance
17475 * driver.cs: Added "/langversion" command line switch with two
17476 options (iso-1, default).
17478 2004-08-31 Marek Safar <marek.safar@seznam.cz>
17480 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
17482 2004-08-31 Miguel de Icaza <miguel@ximian.com>
17484 * delegate.cs: Style.
17486 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
17488 * delegate.cs: Add seperate instance expr field for miguel.
17490 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17492 * PointerArithmetic (Resolve): make sure we are not doing
17493 pointer arith on void*. Also, make sure we are resolved
17494 by not setting eclass until resolve.
17496 All callers: Make sure that PointerArithmetic gets resolved.
17498 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17500 * ArrayCreation (LookupType): If the type does not resolve
17501 to an array, give an error.
17503 2004-08-27 Marek Safar <marek.safar@seznam.cz>
17505 * statement.cs (Try.Resolve): Fixed bug #64222
17507 2004-08-27 Martin Baulig <martin@ximian.com>
17510 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
17513 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17515 * ecore.cs (Constantify): Get underlying type via
17516 System.Enum.GetUnderlyingType to avoid StackOverflow on the
17517 Windows in special cases.
17519 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17521 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
17522 for obtaining also private methods.
17523 (GetRemoveMethod): Used GetRemoveMethod (true)
17524 for obtaining also private methods.
17526 2004-08-24 Martin Baulig <martin@ximian.com>
17528 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
17529 MethodAttributes.HideBySig for operators.
17531 2004-08-23 Martin Baulig <martin@ximian.com>
17533 Back to the old error reporting system :-)
17535 * report.cs (Message): Removed.
17536 (Report.MessageData, ErrorData, WarningData): Removed.
17537 (Report.Error, Warning): Back to the old system.
17539 2004-08-23 Martin Baulig <martin@ximian.com>
17541 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
17543 * class.cs (TypeContainer.ParentContainer): New public virtual
17544 method; replaces the explicit interface implementation.
17545 (ClassPart.ParentContainer): Override.
17547 2004-08-23 Martin Baulig <martin@ximian.com>
17549 * statement.cs (Switch): Added support for constant switches; see
17550 #59428 or test-285.cs.
17552 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17555 * statement.cs (GetEnumeratorFilter): Removed useless
17556 logic because C# specs is strict. GetEnumerator must be
17559 2004-08-22 Martin Baulig <martin@ximian.com>
17561 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17562 a switch and may break, reset the barrier. Fixes #59867.
17564 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17566 CLS-Compliance speed up (~5% for corlib)
17568 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
17569 New method. Tests container for CLS-Compliant names
17571 * class.cs (TypeContainer.VerifyClsName): New method.
17572 Checks whether container name is CLS Compliant.
17573 (Constructor): Implements IMethodData.
17575 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
17576 low-case table for CLS Compliance test.
17577 (MemberCache.VerifyClsParameterConflict): New method.
17578 Checks method parameters for CS3006 error.
17580 * enum.cs (EnumMember): Is derived from MemberCore.
17581 (Enum.VerifyClsName): Optimized for better performance.
17583 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17585 * report.cs: Renamed Error_T to Error and changed all
17588 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17590 * class.cs (TypeContainer.IndexerArrayList): New inner class
17591 container for indexers.
17592 (TypeContainer.DefaultIndexerName): New constant for default
17593 indexer name. Replaced all "Item" with this constant.
17594 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
17596 * typemanager.cs (TypeManager.default_member_ctor): Cache here
17597 DefaultMemberAttribute constructor.
17599 2004-08-05 Martin Baulig <martin@ximian.com>
17601 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
17604 2004-08-05 Marek Safar <marek.safar@seznam.cz>
17606 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
17607 multi platforms problem.
17609 * compiler.csproj: Included shared files.
17611 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17613 Fix bug 60333, 55971 in the more general way
17614 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17615 Added arg_type argument for constant conversion.
17616 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
17618 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17621 * class.cs (TypeContainer ): New inner classes MethodArrayList,
17622 OperatorArrayList, MethodCoreArrayList for typecontainer
17623 containers. Changed class member types to these new types.
17624 (MethodArrayList.DefineMembers): Added test for CS0659.
17626 2004-08-04 Miguel de Icaza <miguel@ximian.com>
17628 * cfold.cs: Synchronize the folding with the code in expression.cs
17629 Binary.DoNumericPromotions for uint operands.
17631 * attribute.cs: Revert patch from Raja, it introduced a regression
17632 while building Blam-1.2.1 (hard to isolate a test case).
17634 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17638 (TypeContainer.Define): Renamed to DefineContainerMembers because of
17640 (MethodCore.parent_method): New member. The method we're overriding
17641 if this is an override method.
17642 (MethodCore.CheckBase): Moved from Method class and made common.
17643 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
17645 (MethodCore.CheckForDuplications): New abstract method. For custom
17646 member duplication search in a container
17647 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
17648 method and its return type.
17649 (Event.conflict_symbol): New member. Symbol with same name in the
17653 (MemberCache.FindMemberWithSameName): New method. The method
17654 is looking for conflict with inherited symbols.
17656 2004-08-04 Martin Baulig <martin@ximian.com>
17658 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
17660 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
17662 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17664 * report.cs (Message): New enum for better error, warning reference in
17666 (MessageData): New inner abstract class. It generally handles printing of
17667 error and warning messages.
17668 Removed unused Error, Warning, Message methods.
17670 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17672 Fix for cs0592-8.cs test
17674 (Attributable.ValidAttributeTargets): Made public.
17675 (Attribute.ExplicitTarget): New member for explicit target value.
17676 (Attribute.CheckTargets): Now we translate explicit attribute
17677 target to Target here.
17679 2004-08-03 Ben Maurer <bmaurer@ximian.com>
17681 * ecore.cs (MethodGroupExpr): new IsBase property.
17683 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
17685 * delegate.cs (DelegateCreation): store a MethodGroupExpr
17686 rather than an instance expr.
17688 (DelegateCreation.Emit): Use the method group rather than
17689 the instance expression. Also, if you have base.Foo as the
17690 method for a delegate, make sure to emit ldftn, not ldftnvirt.
17692 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
17694 (NewDelegate.DoResolve): Only check for the existance of Invoke
17695 if the method is going to be needed. Use MethodGroupExpr.
17697 (NewDelegate.Emit): Remove, DelegateCreation implements this.
17699 * expression.cs: For pointer arith., make sure to use
17700 the size of the type, not the size of the pointer to
17703 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17706 * class.cs (Class): Added error CS0502 test.
17708 2004-08-03 John Luke <jluke@cfl.rr.com>
17709 Raja R Harinath <rharinath@novell.com>
17712 * attribute.cs (Attribute.complained_before): New flag.
17713 (Attribute.ResolveType, Attribute.Resolve),
17714 (Attribute.DefinePInvokeMethod): Set it.
17715 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
17717 2004-08-03 Martin Baulig <martin@ximian.com>
17719 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
17720 use a user-defined operator; we still need to do numeric
17721 promotions in case one argument is a builtin type and the other
17722 one has an implicit conversion to that type. Fixes #62322.
17724 2004-08-02 Martin Baulig <martin@ximian.com>
17726 * statement.cs (LocalInfo.Flags): Added `IsThis'.
17727 (LocalInfo.IsThis): New public property.
17728 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
17730 2004-08-01 Martin Baulig <martin@ximian.com>
17732 * class.cs (TypeContainer.GetClassBases): Don't set the default
17733 here since we may get called from GetPartialBases().
17734 (TypeContainer.DefineType): If GetClassBases() didn't return a
17735 parent, use the default one.
17737 2004-07-30 Duncan Mak <duncan@ximian.com>
17739 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
17741 2004-07-30 Martin Baulig <martin@ximian.com>
17743 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
17745 * class.cs (SourceMethod): New public class, derive from the
17746 symbol writer's ISourceMethod.
17747 (Method): Use the new symbol writer API.
17749 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
17750 as argument and use the new symbol writer.
17753 (SourceFile): Implement the symbol writer's ISourceFile.
17754 (Location.SymbolDocument): Removed.
17755 (Location.SourceFile): New public property.
17757 * symbolwriter.cs: Use the new symbol writer API.
17759 2004-07-30 Raja R Harinath <rharinath@novell.com>
17761 * Makefile (install-local): Remove. Functionality moved to
17764 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
17766 * Makefile: Install mcs.exe.config file together with mcs.exe.
17767 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
17768 correct runtime version.
17770 2004-07-25 Martin Baulig <martin@ximian.com>
17773 (TypeContainer.RegisterOrder): Removed, this was unused.
17774 (TypeContainer, interface_order): Removed.
17775 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
17776 TypeContainer as argument since we can also be called with a
17777 `PartialContainer' for a partial class/struct/interface.
17778 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
17779 of checking whether we're an `Interface' - we could be a
17780 `PartialContainer'.
17781 (PartialContainer.Register): Override; call
17782 AddClass()/AddStruct()/AddInterface() on our parent.
17784 * cs-parser.jay (interface_member_declaration): Add things to the
17785 `current_container', not the `current_class'.
17787 * rootcontext.cs (RegisterOrder): The overloaded version which
17788 takes an `Interface' was unused, removed.
17790 * typemanager.cs (TypeManager.LookupInterface): Return a
17791 `TypeContainer', not an `Interface'.
17792 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
17793 contain a `PartialContainer' for an interface, so check it's
17794 `Kind' to figure out what it is.
17796 2004-07-25 Martin Baulig <martin@ximian.com>
17798 * class.cs (Class.DefaultTypeAttributes): New public constant.
17799 (Struct.DefaultTypeAttributes): Likewise.
17800 (Interface.DefaultTypeAttributes): Likewise.
17801 (PartialContainer.TypeAttr): Override this and add the
17802 DefaultTypeAttributes.
17804 2004-07-25 Martin Baulig <martin@ximian.com>
17806 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
17807 we can just use the `Parent' field instead.
17809 2004-07-25 Martin Baulig <martin@ximian.com>
17811 * class.cs (TypeContainer.Emit): Renamed to EmitType().
17813 2004-07-25 Martin Baulig <martin@ximian.com>
17815 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
17816 our parts before defining any methods.
17817 (TypeContainer.VerifyImplements): Make this virtual.
17818 (ClassPart.VerifyImplements): Override and call VerifyImplements()
17819 on our PartialContainer.
17821 2004-07-25 Martin Baulig <martin@ximian.com>
17823 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
17825 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
17826 argument, we can just use the `Parent' field instead.
17829 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
17830 (MemberBase.DoDefine): Likewise.
17832 2004-07-24 Martin Baulig <martin@ximian.com>
17834 * decl.cs (MemberCore.Parent): New public field.
17835 (DeclSpace.Parent): Moved to MemberCore.
17837 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
17838 (MemberBase.ctor): Added TypeContainer argument, pass it to our
17840 (FieldBase, Field, Operator): Likewise.
17841 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
17842 (EventField, Event): Likewise.
17844 2004-07-23 Martin Baulig <martin@ximian.com>
17846 * class.cs (PartialContainer): New public class.
17847 (ClassPart): New public class.
17848 (TypeContainer): Added support for partial classes.
17849 (TypeContainer.GetClassBases): Splitted some of the functionality
17850 out into GetNormalBases() and GetPartialBases().
17852 * cs-tokenizer.cs (Token.PARTIAL): New token.
17853 (Tokenizer.consume_identifier): Added some hacks to recognize
17854 `partial', but only if it's immediately followed by `class',
17855 `struct' or `interface'.
17857 * cs-parser.jay: Added support for partial clases.
17859 2004-07-23 Martin Baulig <martin@ximian.com>
17861 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
17862 a `DeclSpace' and also made it readonly.
17863 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
17864 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
17865 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
17867 * cs-parser.jay: Pass the `current_class', not the
17868 `current_container' (at the moment, this is still the same thing)
17869 to a new Method, Property, Event, Indexer or Constructor.
17871 2004-07-23 Martin Baulig <martin@ximian.com>
17873 * cs-parser.jay (CSharpParser): Added a new `current_class' field
17874 and removed the `current_interface' one.
17875 (struct_declaration, class_declaration, interface_declaration):
17876 Set `current_class' to the newly created class/struct/interface;
17877 set their `Bases' and call Register() before parsing their body.
17879 2004-07-23 Martin Baulig <martin@ximian.com>
17881 * class.cs (Kind): New public enum.
17882 (TypeContainer): Made this class abstract.
17883 (TypeContainer.Kind): New public readonly field.
17884 (TypeContainer.CheckDef): New public method; moved here from
17886 (TypeContainer.Register): New public abstract method.
17887 (TypeContainer.GetPendingImplementations): New public abstract
17889 (TypeContainer.GetClassBases): Removed the `is_class' and
17890 `is_iface' parameters.
17891 (TypeContainer.DefineNestedTypes): Formerly known as
17893 (ClassOrStruct): Made this class abstract.
17895 * tree.cs (RootTypes): New public type.
17897 2004-07-20 Martin Baulig <martin@ximian.com>
17899 * tree.cs (Tree.RecordNamespace): Removed.
17900 (Tree.Namespaces): Removed.
17902 * rootcontext.cs (RootContext.IsNamespace): Removed.
17904 * cs-parser.jay (namespace_declaration): Just create a new
17905 NamespaceEntry here.
17907 2004-07-20 Martin Baulig <martin@ximian.com>
17909 * statement.cs (ExceptionStatement): New abstract class. This is
17910 now used as a base class for everyone who's using `finally'.
17911 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
17912 our local variables before using them.
17914 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
17915 virtual method. This is used by Yield.Resolve() to "steal" an
17916 outer block's `finally' clauses.
17917 (FlowBranchingException): The .ctor now takes an ExceptionStatement
17920 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
17921 version which takes an ExceptionStatement. This version must be
17922 used to create exception branchings.
17925 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
17926 (Iterator.EmitMoveNext): Added exception support; protect the
17927 block with a `fault' clause, properly handle 'finally' clauses.
17928 (Iterator.EmitDispose): Run all the `finally' clauses here.
17930 2004-07-20 Martin Baulig <martin@ximian.com>
17932 * iterator.cs: This is the first of a set of changes in the
17933 iterator code. Match the spec more closely: if we're an
17934 IEnumerable, then GetEnumerator() must be called. The first time
17935 GetEnumerator() is called, it returns the current instance; all
17936 subsequent invocations (if any) must create a copy.
17938 2004-07-19 Miguel de Icaza <miguel@ximian.com>
17940 * expression.cs: Resolve the constant expression before returning
17943 2004-07-19 Martin Baulig <martin@ximian.com>
17945 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
17946 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
17947 the return type of the new EmitContext.
17949 2004-07-18 Martin Baulig <martin@ximian.com>
17951 * class.cs (Property.Define): Fix iterators.
17953 * iterators.cs (Iterator.Define): Moved the
17954 `container.AddInterator (this)' call here from the .ctor; only do
17955 it if we resolved successfully.
17957 2004-07-17 Miguel de Icaza <miguel@ximian.com>
17959 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
17960 `true' for preprocessing directives that we parse. The return
17961 value indicates whether we should return to regular tokenizing or
17962 not, not whether it was parsed successfully.
17964 In the past if we were in: #if false ... #line #endif, we would
17965 resume parsing after `#line'. See bug 61604.
17967 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
17968 building: IsEnumType should return true only for enums, not for
17969 enums or System.Enum itself. This fixes #61593.
17971 Likely what happened is that corlib was wrong: mcs depended on
17972 this bug in some places. The bug got fixed, we had to add the
17973 hack, which caused bug 61593.
17975 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
17976 that was a workaround for the older conditions.
17978 2004-07-16 Ben Maurer <bmaurer@ximian.com>
17980 * assign.cs: IAssignMethod has a new interface, as documented
17981 inline. All assignment code now uses this new api.
17983 * ecore.cs, expression.cs: All classes which implement
17984 IAssignMethod now use the new interface.
17986 * expression.cs (Invocation): add a hack to EmitCall so that
17987 IndexerAccess can be the target of a compound assignment without
17988 evaluating its arguments twice.
17990 * statement.cs: Handle changes in Invocation api.
17992 2004-07-16 Martin Baulig <martin@ximian.com>
17994 * iterators.cs: Rewrote this. We're now using one single Proxy
17995 class for both the IEnumerable and the IEnumerator interface and
17996 `Iterator' derives from Class so we can use the high-level API.
17998 * class.cs (TypeContainer.AddIterator): New method.
17999 (TypeContainer.DoDefineType): New protected virtual method, which
18000 is called from DefineType().
18001 (TypeContainer.DoDefineMembers): Call DefineType() and
18002 DefineMembers() on all our iterators.
18003 (TypeContainer.Emit): Call Emit() on all our iterators.
18004 (TypeContainer.CloseType): Call CloseType() on all our iterators.
18006 * codegen.cs (EmitContext.CurrentIterator): New public field.
18008 2004-07-15 Martin Baulig <martin@ximian.com>
18011 (TypeManager.not_supported_exception_type): New type.
18013 2004-07-14 Martin Baulig <martin@ximian.com>
18015 * iterators.cs: Use real error numbers.
18017 2004-07-14 Martin Baulig <martin@ximian.com>
18019 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
18020 requires this to be a System.Collection.IEnumerable and not a
18021 class implementing that interface.
18022 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
18024 2004-07-13 Marek Safar <marek.safar@seznam.cz>
18026 * class.cs: Fixed previous fix, it broke some error tests.
18028 2004-07-12 Martin Baulig <martin@ximian.com>
18030 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
18033 2004-07-09 Miguel de Icaza <miguel@ximian.com>
18035 * assign.cs (LocalTemporary): Add new argument: is_address,If
18036 `is_address' is true, then the value that we store is the address
18037 to the real value, and not the value itself.
18039 * ecore.cs (PropertyExpr): use the new local temporary
18040 stuff to allow us to handle X.Y += z (where X is a struct)
18042 2004-07-08 Martin Baulig <martin@ximian.com>
18044 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
18045 not always return, just like we're doing in Using.Resolve().
18047 2004-07-07 Miguel de Icaza <miguel@ximian.com>
18049 * cs-parser.jay (fixed_statement): flag this as Pinned.
18051 2004-07-06 Miguel de Icaza <miguel@ximian.com>
18053 * typemanager.cs (TypeManager): Removed MakePinned method, this
18054 mechanism is replaced with the .NET 2.x compatible mechanism of
18055 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
18057 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
18058 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
18059 `IsFixed' property which has a different meaning.
18061 2004-07-02 Raja R Harinath <rharinath@novell.com>
18063 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
18064 visible from inside a nested class, not just the names of the
18065 immediately enclosing class.
18066 Fix for bug #60730.
18068 2004-06-24 Raja R Harinath <rharinath@novell.com>
18070 * expression.cs (BetterConversion): Remove buggy special-case
18071 handling of "implicit constant expression conversions". At this
18072 point, we already know that the conversion is possible -- we're
18073 only checking to see which is better.
18075 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18077 * cs-parser.jay: Added error CS0210 test.
18079 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18081 * cs-parser.jay: Added error CS0134 test.
18083 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18086 * cs-parser.jay: Added error CS0145 test.
18088 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18090 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
18092 2004-06-23 Ben Maurer <bmaurer@ximian.com>
18094 * expression.cs (StackAlloc.Resolve): The argument may not
18095 be a constant; deal with this case.
18097 2004-06-23 Marek Safar <marek.safar@seznam.cz>
18099 * attribute.cs (IndexerName_GetIndexerName): Renamed to
18100 GetIndexerAttributeValue.
18101 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
18103 * class.cs (Indexer.Define): Added error tests for CS0415,
18106 2004-06-23 Miguel de Icaza <miguel@ximian.com>
18108 * attribute.cs (Attribute.Resolve): Keep field code in sync with
18111 2004-06-23 Martin Baulig <martin@ximian.com>
18113 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
18114 neither return nor throw, reset the barrier as well. Fixes #60457.
18116 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
18118 * class.cs : EventAttributes is now set to None by default.
18119 This fixes bug #60459.
18121 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18124 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18125 Don't throw exception but return null (it's sufficient now).
18127 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18129 * typemanager.cs (GetArgumentTypes): Faster implementation.
18131 2004-06-18 Martin Baulig <martin@ximian.com>
18133 * attribute.cs (Attribute.Resolve): Check whether we're an
18134 EmptyCast which a Constant child. Fixes #60333.
18136 2004-06-17 Ben Maurer <bmaurer@ximian.com>
18138 * statement.cs (EmitCollectionForeach): Account for the fact that
18139 not all valuetypes are in areas which we can take the address of.
18140 For these variables, we store to a temporary variable. Also, make
18141 sure that we dont emit a `callvirt' on a valuetype method.
18143 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18145 * expression.cs (StackAlloc.DoReSolve): Added test for
18146 negative parameter (CS0247).
18148 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18151 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
18153 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18156 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
18159 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18161 Fix bug #58254 & cs1555.cs, cs1556.cs
18162 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
18164 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18166 * cs-parser.jay: Added error CS1669 test for indexers.
18168 2004-06-11 Martin Baulig <martin@ximian.com>
18170 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
18171 call this twice: for params and varargs methods.
18173 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18176 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
18178 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18180 * attribute.cs (Attribute.GetValidTargets): Made public.
18183 (AbstractPropertyEventMethod): New class for better code sharing.
18184 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
18186 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
18188 2004-06-11 Raja R Harinath <rharinath@novell.com>
18191 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
18192 that the call to Resolve is part of a MemberAccess.
18193 (Expression.Resolve): Use it for SimpleName resolution.
18194 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
18195 Add 'intermediate' boolean argument.
18196 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
18197 error message when the SimpleName can be resolved ambiguously
18198 between an expression and a type.
18199 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
18201 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
18202 call on the left-side.
18204 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18207 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
18209 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18211 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
18213 2004-06-11 Martin Baulig <martin@ximian.com>
18215 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
18216 varargs methods if applicable.
18218 2004-06-11 Martin Baulig <martin@ximian.com>
18220 * expression.cs (Invocation.EmitCall): Don't use
18221 `method.CallingConvention == CallingConventions.VarArgs' since the
18222 method could also have `CallingConventions.HasThis'.
18224 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18226 * class.cs (Event.GetSignatureForError): Implemented.
18227 Fixed crash in error test cs3010.cs
18229 2004-06-10 Miguel de Icaza <miguel@ximian.com>
18231 * cs-tokenizer.cs: Change the way we track __arglist to be
18232 consistent with the other keywords.
18234 2004-06-09 Miguel de Icaza <miguel@ximian.com>
18236 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
18239 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
18241 * codegen.cs: Check that all referenced assemblies have a strongname
18242 before strongnaming the compiled assembly. If not report error CS1577.
18243 Fix bug #56563. Patch by Jackson Harper.
18244 * typemanager.cs: Added a method to return all referenced assemblies.
18245 Fix bug #56563. Patch by Jackson Harper.
18247 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18250 (Method.ApplyAttributeBuilder): Moved and added conditional
18251 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
18254 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
18256 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18259 * class.cs: (EventField.attribute_targets): Changed default target.
18261 2004-06-08 Martin Baulig <martin@ximian.com>
18263 * expression.cs (Invocation.EmitCall): Enable varargs methods.
18265 2004-06-08 Martin Baulig <martin@ximian.com>
18267 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
18269 2004-06-07 Martin Baulig <martin@ximian.com>
18271 Added support for varargs methods.
18273 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
18276 * cs-parser.jay: Added support for `__arglist'.
18278 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
18280 * expression.cs (Argument.AType): Added `ArgList'.
18281 (Invocation): Added support for varargs methods.
18282 (ArglistAccess): New public class.
18283 (Arglist): New public class.
18285 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
18287 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
18288 a method's top-level block if the method has varargs.
18290 * support.cs (ReflectionParameters, InternalParameters): Added
18291 support for varargs methods.
18293 2004-06-07 Miguel de Icaza <miguel@ximian.com>
18295 * class.cs: Provide location in indexer error report.
18297 * driver.cs: Use standard names.
18299 * namespace.cs: Catch the use of using after a namespace has been
18300 declared also on using aliases.
18302 2004-06-03 Raja R Harinath <rharinath@novell.com>
18305 * typemanager.cs (closure_private_ok, closure_invocation_type)
18306 (closure_qualifier_type, closure_invocation_assembly)
18307 (FilterWithClosure): Move to ...
18308 (Closure): New internal nested class.
18309 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
18310 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
18311 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
18312 (MemberLookup, MemberLookupFailed): Use it.
18313 * expression.cs (New.DoResolve): Treat the lookup for the
18314 constructor as being qualified by the 'new'ed type.
18315 (Indexers.GetIndexersForTypeOrInterface): Update.
18317 2004-06-03 Marek Safar <marek.safar@seznam.cz>
18320 (GetConditionalAttributeValue): New method. Returns
18321 condition of ConditionalAttribute.
18322 (SearchMulti): New method. Returns all attributes of type 't'.
18323 Use it when attribute is AllowMultiple = true.
18324 (IsConditionalMethodExcluded): New method.
18327 (Method.IsExcluded): Implemented. Returns true if method has conditional
18328 attribute and the conditions is not defined (method is excluded).
18329 (IMethodData): Extended interface for ConditionalAttribute support.
18330 (PropertyMethod.IsExcluded): Implemented.
18333 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
18336 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
18339 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
18341 * expression.cs (ArrayCreationExpression): Make this just an
18342 `expression'. It can't be a statement, so the code here was
18345 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18348 * typemanager.cs (GetFullNameSignature): New method for
18351 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18354 * class.cs (MemberBase.GetSignatureForError): New virtual method.
18355 Use this method when MethodBuilder is null.
18356 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
18357 Added test for error CS0626 (MONO reports error for this situation).
18358 (IMethodData.GetSignatureForError): Extended interface.
18360 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18363 (AttributeTester.GetObsoleteAttribute): Returns instance of
18364 ObsoleteAttribute when type is obsolete.
18367 (TypeContainer.VerifyObsoleteAttribute): Override.
18368 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
18369 (MethodCode.VerifyObsoleteAttribute): Override.
18370 (MemberBase.VerifyObsoleteAttribute): Override.
18373 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
18374 and report proper error.
18377 Delegate.VerifyObsoleteAttribute): Override.
18380 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
18381 and report proper error.
18382 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
18385 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
18389 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
18390 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
18391 Added test for ObsoleteAttribute.
18394 (Catch): Derived from Statement.
18396 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18398 Fixed bug #59071 & cs0160.cs
18400 * statement.cs (Try.Resolve): Check here whether order of catch
18401 clauses matches their dependencies.
18403 2004-05-31 Miguel de Icaza <miguel@ximian.com>
18405 * Reverted patch to namespace.cs (Use lookuptypedirect). This
18406 caused a regression: #59343. Referencing nested classes from an
18407 assembly stopped working.
18409 2004-05-31 Martin Baulig <martin@ximian.com>
18411 MCS is now frozen for beta 2.
18413 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18415 * convert.cs: add a trivial cache for overload operator resolution.
18417 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18419 * decl.cs: If possible, use lookuptypedirect here. We can only do
18420 this if there is no `.' after the namespace. Avoids using
18421 LookupType, which does lots of slow processing.
18422 (FindNestedType) New method, does what it says :-).
18423 * namespace.cs: use LookupTypeDirect.
18424 * rootcontext.cs: use membercache, if possible.
18425 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
18427 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18430 According to the spec,
18432 In a member access of the form E.I, if E is a single identifier,
18433 and if the meaning of E as a simple-name (§7.5.2) is a constant,
18434 field, property, localvariable, or parameter with the same type as
18435 the meaning of E as a type-name (§3.8), then both possible
18436 meanings of E are permitted.
18438 We did not check that E as a simple-name had the same type as E as
18441 This trivial check gives us 5-7% on bootstrap time.
18443 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18445 * expression.cs (Invocation.OverloadResolve): Avoid the
18446 use of hashtables and boxing here by allocating on demand.
18448 2004-05-30 Martin Baulig <martin@ximian.com>
18450 * rootcontext.cs (RootContext.LookupType): Don't cache things if
18451 we're doing a silent lookup. Don't try to lookup nested types in
18452 TypeManager.object_type (thanks to Ben Maurer).
18454 2004-05-30 Martin Baulig <martin@ximian.com>
18456 Committing a patch from Ben Maurer.
18458 * rootcontext.cs (RootContext.LookupType): Cache negative results.
18460 2004-05-29 Martin Baulig <martin@ximian.com>
18462 * class.cs (IMethodData.ShouldIgnore): New method.
18464 * typemanager.cs (TypeManager.MethodFlags): Don't take a
18465 `Location' argument, we don't need it anywhere. Use
18466 `IMethodData.ShouldIgnore ()' instead of
18467 `MethodData.GetMethodFlags ()'.
18468 (TypeManager.AddMethod): Removed.
18469 (TypeManager.AddMethod2): Renamed to AddMethod.
18471 2004-05-29 Martin Baulig <martin@ximian.com>
18473 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
18475 * convert.cs (Convert.ImplicitReferenceConversion): If we're
18476 converting from a class type S to an interface type and we already
18477 have an object on the stack, don't box it again. Fixes #52578.
18479 2004-05-29 Martin Baulig <martin@ximian.com>
18481 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18482 Added support for `params' parameters. Fixes #59267.
18484 2004-05-29 Martin Baulig <martin@ximian.com>
18486 * literal.cs (NullPointer): Provide a private .ctor which sets
18487 `type' to TypeManager.object_type. Fixes #59048.
18489 2004-05-29 Martin Baulig <martin@ximian.com>
18491 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
18492 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
18494 * ecore.cs (EventExpr.instance_expr): Make the field private.
18496 2004-05-26 Marek Safar <marek.safar@seznam.cz>
18498 Fixed bug #50080 & cs0214-2.cs
18499 * expression.cs (Cast.DoResolve): Check unsafe context here.
18501 * statement.cs (Resolve.DoResolve): Likewise.
18503 2004-05-26 Martin Baulig <martin@ximian.com>
18505 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
18507 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
18508 (RootContext.LookupType): Pass down the `silent' flag.
18510 2004-05-25 Martin Baulig <martin@ximian.com>
18513 (MethodGroupExpr.IdenticalTypeName): New public property.
18514 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
18515 expression actually refers to a type.
18517 2004-05-25 Martin Baulig <martin@ximian.com>
18519 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
18520 for #56176 and made it actually work.
18522 2004-05-25 Martin Baulig <martin@ximian.com>
18524 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
18525 (FieldExpr, PropertyExpr): Override and implement
18526 CacheTemporaries. Fixes #52279.
18528 2004-05-25 Miguel de Icaza <miguel@ximian.com>
18530 * location.cs: In the new compiler listing a file twice is a
18531 warning, not an error.
18533 2004-05-24 Martin Baulig <martin@ximian.com>
18535 * enum.cs (Enum.DefineType): For the `BaseType' to be a
18536 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
18538 2004-05-24 Martin Baulig <martin@ximian.com>
18540 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
18541 walking the `using' list. Fixes #53921.
18543 2004-05-24 Martin Baulig <martin@ximian.com>
18545 * const.cs (Const.LookupConstantValue): Added support for
18546 EmptyCast's; fixes #55251.
18548 2004-05-24 Martin Baulig <martin@ximian.com>
18550 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
18551 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
18552 which does the CS0135 check. The reason is that we first need to
18553 check whether the variable actually exists.
18555 2004-05-24 Martin Baulig <martin@ximian.com>
18557 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
18558 than RootContext.LookupType() to find the explicit interface
18559 type. Fixes #58584.
18561 2004-05-24 Raja R Harinath <rharinath@novell.com>
18563 * Makefile: Simplify. Use executable.make.
18564 * mcs.exe.sources: New file. List of sources of mcs.exe.
18566 2004-05-24 Anders Carlsson <andersca@gnome.org>
18570 Use the invariant culture when doing String.Compare for CLS case
18573 2004-05-23 Martin Baulig <martin@ximian.com>
18575 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
18576 don't have any dots. Fixes #52622, added cs0246-8.cs.
18578 * namespace.cs (NamespaceEntry.Lookup): Likewise.
18580 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18582 * class.cs (MemberBase.Define): Reuse MemberType member for
18583 resolved type. Other methods can use it too.
18585 2004-05-23 Martin Baulig <martin@ximian.com>
18587 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
18588 the variable also exists in the current block (otherwise, we need
18589 to report a CS0103). Fixes #58670.
18591 2004-05-23 Martin Baulig <martin@ximian.com>
18593 * flowanalysis.cs (Reachability.Reachable): Compute this
18594 on-the-fly rather than storing it as a field.
18596 2004-05-23 Martin Baulig <martin@ximian.com>
18598 * flowanalysis.cs (Reachability.And): Manually compute the
18599 resulting `barrier' from the reachability.
18601 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18604 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
18605 instance of ObsoleteAttribute when symbol is obsolete.
18608 (IMethodData): Extended interface for ObsoleteAttribute support.
18610 2004-05-22 Marek Safar <marek.safar@seznam.cz>
18612 * attribute.cs: Fix bug #55970
18614 2004-05-22 Marek Safar <marek.safar@seznam.cz>
18618 (GetObsoleteAttribute): New method. Creates the instance of
18620 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
18621 ObsoleteAttribute when member is obsolete.
18622 (AttributeTester.Report_ObsoleteMessage): Common method for
18623 Obsolete error/warning reporting.
18626 (TypeContainer.base_classs_type): New member for storing parent type.
18629 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
18630 for this MemberCore.
18632 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18634 * attribute.cs, const.cs: Fix bug #58590
18636 2004-05-21 Martin Baulig <martin@ximian.com>
18638 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
18639 out parameters if the end of the method is unreachable. Fixes
18642 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18644 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
18645 Hari was right, why extra method.
18647 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18649 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
18651 2004-05-20 Martin Baulig <martin@ximian.com>
18653 Merged this back from gmcs to keep the differences to a minumum.
18655 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
18656 instead of a Declspace.
18657 (Attribute.ResolveType): Likewise.
18658 (Attributes.Search): Likewise.
18659 (Attributes.Contains): Likewise.
18660 (Attributes.GetClsCompliantAttribute): Likewise.
18662 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
18664 (MethodData.ApplyAttributes): Take an EmitContext instead of a
18667 2004-05-19 Marek Safar <marek.safar@seznam.cz>
18669 Fix bug #58688 (MCS does not report error when the same attribute
18672 * attribute.cs (Attribute.Emit): Distinction between null and default.
18674 2004-05-19 Raja R Harinath <rharinath@novell.com>
18676 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
18677 of a top-level attribute without an attribute target.
18678 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
18680 (Attribute.Conditional_GetConditionName),
18681 (Attribute.Obsolete_GetObsoleteMessage): Update.
18682 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
18683 part of ScanForIndexerName.
18684 (Attribute.CanIgnoreInvalidAttribute): New function.
18685 (Attribute.ScanForIndexerName): Move to ...
18686 (Attributes.ScanForIndexerName): ... here.
18687 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
18688 (Attributes.Search): New internal variant that can choose not to
18689 complain if types aren't resolved. The original signature now
18691 (Attributes.GetClsCompliantAttribute): Use internal variant, with
18692 complaints suppressed.
18693 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
18694 only if it not useful.
18695 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
18696 top-level for attributes that are shared between the assembly
18697 and a top-level class.
18698 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
18699 * class.cs: Update to reflect changes.
18700 (DefineIndexers): Fuse loops.
18701 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
18702 a couple more variants of attribute names.
18704 2004-05-18 Marek Safar <marek.safar@seznam.cz>
18706 Fix bug #52585 (Implemented explicit attribute declaration)
18709 (Attributable.ValidAttributeTargets): New abstract method. It gets
18710 list of valid attribute targets for explicit target declaration.
18711 (Attribute.Target): It holds target itself.
18712 (AttributeSection): Removed.
18713 (Attribute.CheckTargets): New method. It checks whether attribute
18714 target is valid for the current element.
18717 (EventProperty): New class. For events that are declared like
18718 property (with add and remove accessors).
18719 (EventField): New class. For events that are declared like field.
18722 * cs-parser.jay: Implemented explicit attribute target declaration.
18724 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
18725 Override ValidAttributeTargets.
18728 (ReturnParameter): Class for applying custom attributes on
18730 (ParameterAtribute): New class. Class for applying custom
18731 attributes on the parameter type.
18733 2004-05-17 Miguel de Icaza <miguel@ximian.com>
18735 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
18738 (Method): Allow UNSAFE here.
18740 * modifiers.cs: Support unsafe reporting.
18742 2004-05-17 Marek Safar <marek.safar@seznam.cz>
18744 * decl.cs: Fix bug #58478.
18746 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18748 * statement.cs: When checking for unreachable code on an EmptyStatement,
18749 set the location. Fixes bug #58488.
18751 2004-05-13 Miguel de Icaza <miguel@ximian.com>
18753 * driver.cs: Add -pkg handling.
18755 From Gonzalo: UseShelLExecute=false
18757 2004-05-12 Marek Safar <marek.safar@seznam.cz>
18760 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
18762 (Attribute.IsClsCompliaceRequired): Moved to base for better
18764 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
18765 when attribute is AttributeUsageAttribute.
18766 (Attribute.GetValidTargets): Simplified.
18767 (Attribute.GetAttributeUsage): New method returns AttributeUsage
18768 attribute for this type.
18769 (Attribute.ApplyAttributes): Method renamed to Emit and make
18771 (GlobalAttributeSection): New class for special handling of global
18772 attributes (assembly, module).
18773 (AttributeSection.Emit): New method.
18775 * class.cs: Implemented Attributable abstract methods.
18776 (MethodCore.LabelParameters): Moved to Parameter class.
18777 (Accessor): Is back simple class.
18778 (PropertyMethod): Implemented Attributable abstract class.
18779 (DelegateMethod): Implemented Attributable abstract class.
18780 (Event): New constructor for disctintion between normal Event
18781 and Event with accessors.
18783 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
18785 * codegen.cs, const.cs, decl.cs, delegate.cs:
18786 (CommonAssemblyModulClass): Implemented Attributable abstract class
18789 * enum.cs: Implement IAttributeSupport interface.
18790 (EnumMember): New class for emum members. Implemented Attributable
18794 (ParameterBase): Is abstract.
18795 (ReturnParameter): New class for easier [return:] attribute handling.
18797 * typemanager.cs: Removed builder_to_attr.
18799 2004-05-11 Raja R Harinath <rharinath@novell.com>
18802 * attribute.cs (Attribute.GetPositionalValue): New function.
18803 * class.cs (TypeContainer.VerifyMembers): New function.
18804 (TypeContainer.Emit): Use it.
18805 (ClassOrStruct): New base class for Class and Struct.
18806 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
18807 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
18809 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
18810 then each non-static field should have a FieldOffset attribute.
18811 Otherwise, none of the fields should have a FieldOffset attribute.
18812 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
18813 and FieldOffset attributes.
18814 * typemanager.cs (TypeManager.struct_layout_attribute_type)
18815 (TypeManager.field_offset_attribute_type): New core types.
18816 (TypeManager.InitCoreTypes): Initialize them.
18818 2004-05-11 Michal Moskal <malekith@pld-linux.org>
18820 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
18821 Return correct type.
18824 2004-05-09 Miguel de Icaza <miguel@ximian.com>
18826 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
18827 be implicitly converted to ulong.
18829 * expression.cs: The logic for allowing operator &, | and ^ worked
18830 was wrong, it worked before because we did not report an error in
18831 an else branch. Fixes 57895.
18833 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
18834 allow volatile fields to be reference types.
18836 2004-05-07 Miguel de Icaza <miguel@ximian.com>
18838 * driver.cs: Add support for /debug-
18840 2004-05-07 Raja R Harinath <rharinath@novell.com>
18842 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
18843 Add a 'complain' parameter to silence errors.
18844 (Attribute.Resolve): Update to changes. Put in sanity check to catch
18845 silently overlooked type-resolutions.
18846 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
18847 to reflect changes.
18848 (Attributes.Search): New function.
18849 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
18850 (Attributes.GetAttributeFullName): Remove hack.
18851 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
18852 Update to reflect changes.
18853 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
18854 Use Attributes.Search instead of nested loops.
18856 2004-05-07 Marek Safar <marek.safar@seznam.cz>
18859 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
18860 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
18861 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
18863 * report.cs: (Report.Warning): Renamed to Warning_T because of
18864 parameter collision.
18866 2004-05-05 Raja R Harinath <rharinath@novell.com>
18868 * expression.cs (MemberAccess.ResolveMemberAccess):
18869 Exit with non-zero status after Report.Error.
18870 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
18872 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
18874 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
18876 * support.cs: Don't hang when the file is empty.
18878 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
18880 * support.cs: In SeekableStreamReader, compute the preamble size of the
18881 underlying stream. Position changes should take into account that initial
18884 2004-05-03 Todd Berman <tberman@sevenl.net>
18886 * driver.cs: remove unused GetSysVersion function.
18888 2004-05-03 Todd Berman <tberman@sevenl.net>
18890 * driver.cs: Remove the hack from saturday, as well as the hack
18891 from jackson (LoadAssemblyFromGac), also adds the CWD to the
18892 link_paths to get that bit proper.
18894 2004-05-01 Todd Berman <tberman@sevenl.net>
18896 * driver.cs: Try a LoadFrom before a Load, this checks the current
18897 path. This is currently a bug in mono that is be fixed, however, this
18898 provides a workaround for now. This will be removed when the bug
18901 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
18903 * CryptoConvert.cs: Updated to latest version. Fix issue with
18904 incomplete key pairs (#57941).
18906 2004-05-01 Todd Berman <tberman@sevenl.net>
18908 * driver.cs: Remove '.' from path_chars, now System.* loads properly
18911 2004-04-30 Jackson Harper <jackson@ximian.com>
18913 * codegen.cs: Open keys readonly.
18915 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18917 * typemanager.cs: don't report cyclic struct layout when a struct
18918 contains 2 or more fields of the same type. Failed for Pango.AttrShape
18919 which has 2 Pango.Rectangle fields.
18921 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
18923 * expression.cs: Handle IntPtr comparisons with IL code
18924 rather than a method call.
18926 2004-04-29 Martin Baulig <martin@ximian.com>
18928 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
18929 the list of PropertyInfo's in class hierarchy and find the
18930 accessor. Fixes #56013.
18932 2004-04-29 Martin Baulig <martin@ximian.com>
18934 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
18936 2004-04-29 Martin Baulig <martin@ximian.com>
18938 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
18940 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
18942 2004-04-29 Martin Baulig <martin@ximian.com>
18944 * class.cs (ConstructorInitializer.Resolve): Check whether the
18945 parent .ctor is accessible. Fixes #52146.
18947 2004-04-29 Martin Baulig <martin@ximian.com>
18949 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
18951 * statement.cs (Using.EmitLocalVariableDecls): Use
18952 TypeManager.idisposable_type, not typeof (IDisposable).
18953 (Foreach.EmitCollectionForeach): Added support for valuetypes.
18955 2004-04-29 Martin Baulig <martin@ximian.com>
18957 * class.cs (Event.Define): Don't emit the field and don't set
18958 RTSpecialName and SpecialName for events on interfaces. Fixes
18961 2004-04-29 Raja R Harinath <rharinath@novell.com>
18963 Refactor Attribute.ApplyAttributes.
18964 * attribute.cs (Attributable): New base class for objects that can
18965 have Attributes applied on them.
18966 (Attribute): Make AttributeUsage fields public.
18967 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
18968 (Attribute.IsInternalCall): New property.
18969 (Attribute.UsageAttr): Convert to a public read-only property.
18970 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
18971 (Attribute.ResolveType, Attribute.Resolve)
18972 (Attribute.ScanForIndexerName): Update to reflect changes.
18973 (Attribute.CheckAttributeTarget): Re-format.
18974 (Attribute.ApplyAttributes): Refactor, to various
18975 Attributable.ApplyAttributeBuilder methods.
18976 * decl.cs (MemberCore): Make Attributable.
18977 * class.cs (Accessor): Make Attributable.
18978 (MethodData.ApplyAttributes): Use proper attribute types, not
18980 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
18981 (TypeContainer.ApplyAttributeBuilder)
18982 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
18983 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
18984 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
18985 (Operator.ApplyAttributeBuilder): New factored-out methods.
18986 * const.cs (Const.ApplyAttributeBuilder): Likewise.
18987 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
18988 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
18989 * parameter.cs (ParameterBase): New Attributable base class
18990 that can also represent Return types.
18991 (Parameter): Update to the changes.
18993 2004-04-29 Jackson Harper <jackson@ximian.com>
18995 * driver.cs: Prefer the corlib system version when looking for
18996 assemblies in the GAC. This is still a hack, but its a better hack
18999 2004-04-29 Marek Safar <marek.safar@seznam.cz>
19001 * decl.cs, enum.cs: Improved error 3005 reporting.
19003 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
19004 (related_symbols): New private member for list of symbols
19005 related to reported error/warning.
19007 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
19009 2004-04-29 Martin Baulig <martin@ximian.com>
19011 * ecore.cs (Expression.Constantify): If we're an enum and
19012 TypeManager.TypeToCoreType() doesn't give us another type, use
19013 t.UnderlyingSystemType. Fixes #56178.
19015 2004-04-29 Martin Baulig <martin@ximian.com>
19017 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
19018 interfaces and for each interface, only add members directly
19019 declared in that interface. Fixes #53255.
19021 2004-04-28 Martin Baulig <martin@ximian.com>
19023 * expression.cs (ConditionalLogicalOperator): Use a temporary
19024 variable for `left' to avoid that we evaluate it more than once;
19027 2004-04-28 Martin Baulig <martin@ximian.com>
19029 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
19032 2004-04-28 Martin Baulig <martin@ximian.com>
19034 * statement.cs (LocalInfo.Resolve): Check whether the type is not
19037 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
19038 whether the type is not void (CS1547).
19040 2004-04-28 Martin Baulig <martin@ximian.com>
19042 * expression.cs (Unary.DoResolveLValue): Override this and report
19043 CS0131 for anything but Operator.Indirection.
19045 2004-04-28 Martin Baulig <martin@ximian.com>
19047 Committing a patch from Ben Maurer; see bug #50820.
19049 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19052 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19055 2004-04-28 Martin Baulig <martin@ximian.com>
19057 Committing a patch from Ben Maurer; see bug #50820.
19059 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19062 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19065 2004-04-28 Martin Baulig <martin@ximian.com>
19067 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
19068 (Block.AddLabel): Call DoLookupLabel() to only search in the
19071 2004-04-28 Martin Baulig <martin@ximian.com>
19073 * cfold.cs (ConstantFold.BinaryFold): Added special support for
19074 comparing StringConstants and NullLiterals in Equality and Inequality.
19076 2004-04-28 Jackson Harper <jackson@ximian.com>
19078 * driver.cs: Attempt to load referenced assemblies from the
19079 GAC. This is the quick and dirty version of this method that
19080 doesnt take into account versions and just takes the first
19081 canidate found. Will be good enough for now as we will not have more
19082 then one version installed into the GAC until I update this method.
19084 2004-04-28 Martin Baulig <martin@ximian.com>
19086 * typemanager.cs (TypeManager.CheckStructCycles): New public
19087 static method to check for cycles in the struct layout.
19089 * rootcontext.cs (RootContext.PopulateTypes): Call
19090 TypeManager.CheckStructCycles() for each TypeContainer.
19091 [Note: We only need to visit each type once.]
19093 2004-04-28 Martin Baulig <martin@ximian.com>
19095 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
19097 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
19098 success and added `out object value'. Use a `bool resolved' field
19099 to check whether we've already been called rather than
19100 `ConstantValue != null' since this breaks for NullLiterals.
19102 2004-04-28 Raja R Harinath <rharinath@novell.com>
19104 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
19105 setting of this flag, since the 'set' method may be non-public.
19107 2004-04-28 Raja R Harinath <rharinath@novell.com>
19109 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
19110 check on current_vector.Block.
19112 2004-04-27 Martin Baulig <martin@ximian.com>
19114 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
19115 a field initializer. Fixes #56459.
19117 2004-04-27 Martin Baulig <martin@ximian.com>
19119 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
19120 we're not attempting to use an indexer. Fixes #52154.
19122 2004-04-27 Martin Baulig <martin@ximian.com>
19124 * statement.cs (Return): Don't create a return label if we don't
19125 need it; reverts my change from January 20th. Thanks to Ben
19128 2004-04-27 Martin Baulig <martin@ximian.com>
19130 According to the spec, `goto' can only leave a nested scope, but
19133 * statement.cs (Block.LookupLabel): Only lookup in the current
19134 block, don't recurse into parent or child blocks.
19135 (Block.AddLabel): Check in parent and child blocks, report
19136 CS0140/CS0158 if we find a duplicate.
19137 (Block): Removed this indexer for label lookups.
19138 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
19139 this already does the error reporting for us.
19142 (FlowBranching.UsageVector.Block): New public variable; may be null.
19143 (FlowBranching.CreateSibling): Added `Block' argument.
19144 (FlowBranching.LookupLabel): New public virtual method. Lookup a
19145 label for the target of a `goto' and check whether we're not
19146 leaving a `finally'.
19148 2004-04-27 Martin Baulig <martin@ximian.com>
19150 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
19151 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
19154 2004-04-27 Martin Baulig <martin@ximian.com>
19156 * statement.cs (Block.AddLabel): Also check for implicit blocks
19157 and added a CS0158 check.
19159 2004-04-27 Martin Baulig <martin@ximian.com>
19161 * flowanalysis.cs (FlowBranchingLoop): New class.
19162 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
19163 UsageVector's instead of an ArrayList.
19164 (FlowBranching.Label): Likewise.
19165 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
19166 (FlowBranching.AddBreakVector): New method.
19168 2004-04-27 Miguel de Icaza <miguel@ximian.com>
19170 * attribute.cs: Small regression fix: only convert the type if we
19171 the type is different, fixes System.Drawing build.
19173 2004-04-27 Martin Baulig <martin@ximian.com>
19175 * attribute.cs (Attribute.Resolve): If we have a constant value
19176 for a named field or property, implicity convert it to the correct
19179 2004-04-27 Raja R Harinath <rharinath@novell.com>
19181 * statement.cs (Block.Block): Implicit blocks share
19182 'child_variable_names' fields with parent blocks.
19183 (Block.AddChildVariableNames): Remove.
19184 (Block.AddVariable): Mark variable as "used by a child block" in
19185 every surrounding block.
19186 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
19187 been used in a child block, complain about violation of "Invariant
19188 meaning in blocks" rule.
19189 * cs-parser.jay (declare_local_variables): Don't use
19190 AddChildVariableNames.
19191 (foreach_statement): Don't create an implicit block: 'foreach'
19192 introduces a scope.
19194 2004-04-23 Miguel de Icaza <miguel@ximian.com>
19196 * convert.cs (ImplicitNumericConversion): 0 is also positive when
19197 converting from 0L to ulong. Fixes 57522.
19199 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19201 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
19202 derived class hides via 'new' keyword field from base class (test-242.cs).
19203 TODO: Handle this in the more general way.
19205 * class.cs (CheckBase): Ditto.
19207 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19209 * decl.cs (caching_flags): New member for storing cached values
19211 (MemberCore.Flags): New enum where bit flags for caching_flags
19213 (MemberCore.cls_compliance): Moved to caching_flags.
19214 (DeclSpace.Created): Moved to caching_flags.
19216 * class.cs: Use caching_flags instead of DeclSpace.Created
19218 2004-04-21 Miguel de Icaza <miguel@ximian.com>
19220 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
19221 if we are only a derived class, not a nested class.
19223 * typemanager.cs: Same as above, but do this at the MemberLookup
19224 level (used by field and methods, properties are handled in
19225 PropertyExpr). Allow for the qualified access if we are a nested
19228 2004-04-21 Marek Safar <marek.safar@seznam.cz>
19230 * class.cs: Refactoring.
19231 (IMethodData): New inteface; Holds links to parent members
19232 to avoid member duplication (reduced memory allocation).
19233 (Method): Implemented IMethodData interface.
19234 (PropertyBase): New inner classes for get/set methods.
19235 (PropertyBase.PropertyMethod): Implemented IMethodData interface
19236 (Event): New inner classes for add/remove methods.
19237 (Event.DelegateMethod): Implemented IMethodData interface.
19239 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
19240 EmitContext (related to class.cs refactoring).
19242 2004-04-21 Raja R Harinath <rharinath@novell.com>
19244 * delegate.cs (Delegate.VerifyApplicability): If the number of
19245 arguments are the same as the number of parameters, first try to
19246 verify applicability ignoring any 'params' modifier on the last
19250 2004-04-16 Raja R Harinath <rharinath@novell.com>
19252 * class.cs (TypeContainer.AddIndexer): Use
19253 'ExplicitInterfaceName' to determine if interface name was
19254 explicitly specified. 'InterfaceType' is not initialized at this time.
19255 (TypeContainer.DefineIndexers): Remove use of temporary list. The
19256 Indexers array is already in the required order. Initialize
19257 'IndexerName' only if there are normal indexers.
19258 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
19259 (TypeContainer.Emit): Emit DefaultMember attribute only if
19260 IndexerName is initialized.
19263 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
19265 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
19268 2004-04-15 Raja R Harinath <rharinath@novell.com>
19270 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
19274 * attribute.cs (Attribute.Resolve): Check for duplicate named
19278 2004-04-15 Miguel de Icaza <miguel@ximian.com>
19280 * iterators.cs (MarkYield): track whether we are in an exception,
19281 and generate code accordingly. Use a temporary value to store the
19282 result for our state.
19284 I had ignored a bit the interaction of try/catch with iterators
19285 since their behavior was not entirely obvious, but now it is
19286 possible to verify that our behavior is the same as MS .NET 2.0
19290 2004-04-14 Miguel de Icaza <miguel@ximian.com>
19292 * iterators.cs: Avoid creating temporaries if there is no work to
19295 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
19296 Enumerations, use TypeManager.EnumToUnderlying and call
19299 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
19302 (This.Emit): Use EmitContext.EmitThis to emit our
19305 (This.EmitAssign): Ditto.
19307 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
19308 codepaths, we will move all the functionality into
19311 (FieldExpr.EmitAssign): Ditto.
19313 This fixes several hidden bugs that I uncovered while doing a code
19314 review of this today.
19316 * codegen.cs (EmitThis): reworked so the semantics are more clear
19317 and also support value types "this" instances.
19319 * iterators.cs: Changed so that for iterators in value types, we
19320 do not pass the value type as a parameter.
19322 Initialization of the enumerator helpers is now done in the caller
19323 instead of passing the parameters to the constructors and having
19324 the constructor set the fields.
19326 The fields have now `assembly' visibility instead of private.
19328 2004-04-11 Miguel de Icaza <miguel@ximian.com>
19330 * expression.cs (Argument.Resolve): Check if fields passed as ref
19331 or out are contained in a MarshalByRefObject.
19333 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
19334 another compiler type.
19336 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
19338 * class.cs (Indexer.Define): use the new name checking method.
19339 Also, return false on an error.
19340 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
19341 (is_identifier_[start/part]_character): make static.
19343 2004-04-10 Miguel de Icaza <miguel@ximian.com>
19345 * expression.cs (Binary.ResolveOperator): Do no append strings
19346 twice: since we can be invoked more than once (array evaluation)
19347 on the same concatenation, take care of this here. Based on a fix
19348 from Ben (bug #56454)
19350 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
19352 * codegen.cs: Fix another case where CS1548 must be reported (when
19353 delay-sign isn't specified and no private is available #56564). Fix
19354 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
19355 error when MCS is used on the MS runtime and we need to delay-sign
19356 (which seems unsupported by AssemblyBuilder - see #56621).
19358 2004-04-08 Marek Safar <marek.safar@seznam.cz>
19360 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
19361 (TypeManager.ComputeNamespaces): Faster implementation for
19364 * compiler.csproj: Updated AssemblyName to mcs.
19366 2004-04-07 Miguel de Icaza <miguel@ximian.com>
19368 * rootcontext.cs: Add new types to the boot resolution.
19370 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
19371 MulticastDelegate is not allowed.
19373 * typemanager.cs: Add new types to lookup: System.TypedReference
19376 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
19377 check for TypedReference or ArgIterator, they are not allowed.
19379 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
19380 makes us properly catch 1510 in some conditions (see bug 56016 for
19383 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
19385 * CryptoConvert.cs: update from corlib version
19388 2004-04-05 Miguel de Icaza <miguel@ximian.com>
19390 * class.cs (Indexer.Define): Check indexername declaration
19392 2004-04-05 Marek Safar <marek.safar@seznam.cz>
19394 * attribute.cs (IsClsCompliant): Fixed problem with handling
19395 all three states (compliant, not-compliant, undetected).
19397 2004-03-30 Marek Safar <marek.safar@seznam.cz>
19399 * attribute.cs (Attribute): Location is now public.
19400 (Resolve): Store resolved arguments (pos_values) in attribute class.
19401 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
19402 (GetClsCompliantAttributeValue): New method that gets
19403 CLSCompliantAttribute value.
19404 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
19405 if exists else null.
19406 (AttributeTester): New class for CLS-Compliant verification routines.
19408 * class.cs (Emit): Add CLS-Compliant verification.
19409 (Method.GetSignatureForError): Implemented.
19410 (Constructor.GetSignatureForError): Implemented
19411 (Constructor.HasCompliantArgs): Returns if constructor has
19412 CLS-Compliant arguments.
19413 (Constructor.Emit): Override.
19414 (Construcor.IsIdentifierClsCompliant): New method; For constructors
19415 is needed to test only parameters.
19416 (FieldBase.GetSignatureForError): Implemented.
19417 (TypeContainer): New member for storing base interfaces.
19418 (TypeContainer.FindMembers): Search in base interfaces too.
19420 * codegen.cs (GetClsComplianceAttribute): New method that gets
19421 assembly or module CLSCompliantAttribute value.
19422 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
19424 (ModuleClass.Emit): Add error 3012 test.
19426 * const.cs (Emit): Override and call base for CLS-Compliant tests.
19428 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
19429 state for all decl types.
19430 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
19431 if CLS-Compliant tests are required.
19432 (IsClsCompliaceRequired): New method. Analyze whether code
19433 must be CLS-Compliant.
19434 (IsExposedFromAssembly): New method. Returns true when MemberCore
19435 is exposed from assembly.
19436 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
19437 value or gets cached value.
19438 (HasClsCompliantAttribute): New method. Returns true if MemberCore
19439 is explicitly marked with CLSCompliantAttribute.
19440 (IsIdentifierClsCompliant): New abstract method. This method is
19441 used to testing error 3005.
19442 (IsIdentifierAndParamClsCompliant): New method. Common helper method
19443 for identifier and parameters CLS-Compliant testing.
19444 (VerifyClsCompliance): New method. The main virtual method for
19445 CLS-Compliant verifications.
19446 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
19447 null. I don't know why is null (too many public members !).
19448 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
19449 and get value of first CLSCompliantAttribute that found.
19451 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
19452 (VerifyClsCompliance): Override and add extra tests.
19454 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
19455 clscheck- disable CLS-Compliant verification event if assembly is has
19456 CLSCompliantAttribute(true).
19458 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
19459 ApllyAttribute is now called in emit section as in the other cases.
19460 Possible future Emit integration.
19461 (IsIdentifierClsCompliant): New override.
19462 (VerifyClsCompliance): New override.
19463 (GetEnumeratorName): Returns full enum name.
19465 * parameter.cs (GetSignatureForError): Implemented.
19467 * report.cs (WarningData): New struct for Warning message information.
19468 (LocationOfPreviousError): New method.
19469 (Warning): New method. Reports warning based on the warning table.
19470 (Error_T): New method. Reports error based on the error table.
19472 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
19473 verifications are done here.
19475 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
19477 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
19478 CLSCompliantAttribute.
19479 (all_imported_types): New member holds all imported types from other
19481 (LoadAllImportedTypes): New method fills static table with exported types
19482 from all referenced assemblies.
19483 (Modules): New property returns all assembly modules.
19485 2004-03-30 Miguel de Icaza <miguel@ximian.com>
19487 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
19488 throwing a parser error.
19490 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
19491 which removes the hardcoded get_/set_ prefixes for properties, as
19492 IL allows for the properties to be named something else.
19496 * expression.cs: Do not override operand before we know if it is
19497 non-null. Fix 56207
19499 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19501 * typemanager.cs: support for pinned variables.
19503 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19505 * decl.cs, typemanager.cs: Avoid using an arraylist
19506 as a buffer if there is only one result set.
19508 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19510 * expression.cs: Make sure you cant call a static method
19511 with an instance expression, bug #56174.
19513 2004-03-29 Miguel de Icaza <miguel@ximian.com>
19515 * class.cs (IsDuplicateImplementation): Improve error reporting to
19516 flag 663 (method only differs in parameter modifier).
19518 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
19519 in preprocessor directives.
19521 * location.cs (LookupFile): Allow for the empty path.
19523 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
19524 better approach for some of that patch, but its failing with the
19525 CharSet enumeration. For now try/catch will do.
19527 * typemanager.cs: Do not crash if a struct does not have fields.
19530 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19532 * expression.cs: cs0213, cant fix a fixed expression.
19535 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19537 * cs-parser.jay: detect invalid embeded statements gracefully.
19540 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19542 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
19545 the invocation type may not be a subclass of the tye of the item/
19546 The type of the item must be a subclass of the invocation item.
19551 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
19553 * attribute.cs: Added methods to get a string and a bool from an
19554 attribute. Required to information from AssemblyKeyFileAttribute,
19555 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
19556 * codegen.cs: Modified AssemblyName creation to include support for
19557 strongnames. Catch additional exceptions to report them as CS1548.
19558 * compiler.csproj: Updated include CryptoConvert.cs.
19559 * compiler.csproj.user: Removed file - user specific configuration.
19560 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
19561 Mono.Security assembly. The original class is maintained and tested in
19562 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
19563 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
19564 like CSC 8.0 (C# v2) supports.
19565 * Makefile: Added CryptoConvert.cs to mcs sources.
19566 * rootcontext.cs: Added new options for strongnames.
19568 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
19570 * driver.cs: For --expect-error, report error code `2'
19571 if the program compiled with no errors, error code `1' if
19572 it compiled with an error other than the one expected.
19574 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
19576 * compiler.csproj: Updated for Visual Studio .NET 2003.
19577 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
19578 * compiler.sln: Updated for Visual Studio .NET 2003.
19580 2004-03-24 Ravi Pratap M <ravi@ximian.com>
19582 * expression.cs: Fix bug #47234. We basically need to apply the
19583 rule that we prefer the conversion of null to a reference type
19584 when faced with a conversion to 'object' (csc behaviour).
19586 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19588 * statement.cs: Shorter form for foreach, eliminates
19589 a local variable. r=Martin.
19591 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19593 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
19594 checks if we can use brtrue/brfalse to test for 0.
19595 * expression.cs: use the above in the test for using brtrue/brfalse.
19596 cleanup code a bit.
19598 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19600 * expression.cs: Rewrite string concat stuff. Benefits:
19602 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
19603 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
19604 rather than a concat chain.
19606 * typemanager.cs: Add lookups for more concat overloads.
19608 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19610 * expression.cs: Emit shorter il code for array init.
19627 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
19629 * statement.cs: Before, two switch blocks would be merged if the
19630 total size of the blocks (end_item - begin_item + 1) was less than
19631 two times the combined sizes of the blocks.
19633 Now, it will only merge if after the merge at least half of the
19638 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
19640 * class.cs : csc build fix for GetMethods(). See bug #52503.
19642 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
19644 * expression.cs: Make sure fp comparisons work with NaN.
19645 This fixes bug #54303. Mig approved this patch a long
19646 time ago, but we were not able to test b/c the runtime
19649 2004-03-19 Miguel de Icaza <miguel@ximian.com>
19651 * ecore.cs (TypExpr.GetHashCode): implement this overload.
19653 2004-03-19 Martin Baulig <martin@ximian.com>
19655 * class.cs (MemberCore.IsDuplicateImplementation): Report the
19656 error here and not in our caller.
19658 2004-03-19 Martin Baulig <martin@ximian.com>
19660 * interface.cs: Completely killed this file.
19661 (Interface): We're now a TypeContainer and live in class.cs.
19663 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
19664 argument; we're now also called for interfaces.
19665 (TypeContainer.DefineMembers): Allow this method being called
19667 (TypeContainer.GetMethods): New public method; formerly known as
19668 Interface.GetMethod(). This is used by PendingImplementation.
19669 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
19670 it's now private and non-static.
19671 (Interface): Moved this here; it's now implemented similar to
19673 (Method, Property, Event, Indexer): Added `bool is_interface'
19674 argument to their .ctor's.
19675 (MemberBase.IsInterface): New public field.
19677 * cs-parser.jay: Create normal Method, Property, Event, Indexer
19678 instances instead of InterfaceMethod, InterfaceProperty, etc.
19679 (opt_interface_base): Removed; we now use `opt_class_base' instead.
19680 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
19682 2004-03-19 Martin Baulig <martin@ximian.com>
19684 * class.cs (MethodCore.IsDuplicateImplementation): New private
19685 method which does the CS0111 checking.
19686 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
19687 Use IsDuplicateImplementation().
19689 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
19691 * decl.cs (FindMemberToOverride): New method to find the correct
19692 method or property to override in the base class.
19694 - Make Method/Property use the above method to find the
19695 version in the base class.
19696 - Remove the InheritableMemberSignatureCompare as it is now
19699 This patch makes large code bases much faster to compile, as it is
19700 O(n) rather than O(n^2) to do this validation.
19702 Also, it fixes bug 52458 which is that nested classes are not
19703 taken into account when finding the base class member.
19705 Reviewed/Approved by Martin.
19707 2004-03-17 Marek Safar <marek.safar@seznam.cz>
19709 * interface.cs: In all interface classes removed redundant
19710 member initialization.
19712 2004-03-16 Martin Baulig <martin@ximian.com>
19714 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
19716 2004-03-15 Miguel de Icaza <miguel@ximian.com>
19718 * decl.cs (DefineTypeAndParents): New helper method to define a
19719 type's containers before the type itself is defined; This is a
19720 bug exposed by the recent changes to Windows.Forms when an
19721 implemented interface was defined inside a class that had not been
19724 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
19726 (Check): Loop correctly to report errors modifiers
19727 (UNSAFE was not in the loop, since it was the same as TOP).
19729 * interface.cs: Every interface member now takes a ModFlags,
19730 instead of a "is_new" bool, which we set on the base MemberCore.
19732 Every place where we called "UnsafeOk" in the interface, now we
19733 call the proper member (InterfaceMethod.UnsafeOK) instead to get
19734 the unsafe settings from the member declaration instead of the
19735 container interface.
19737 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
19739 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
19740 `set_indexer_name' to the pending bits (one per type).
19742 We fixed a bug today that was picking the wrong method to
19743 override, since for properties the existing InterfaceMethod code
19744 basically ignored the method name. Now we make sure that the
19745 method name is one of the valid indexer names.
19747 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
19749 * support.cs (SeekableStreamReader): Keep track of stream byte
19750 positions and don't mix them with character offsets to the buffer.
19752 Patch from Gustavo Giráldez
19754 2004-03-15 Marek Safar <marek.safar@seznam.cz>
19756 * interface.cs (InterfaceSetGetBase): Removed double member
19757 initialization, base class does it as well.
19759 2004-03-13 Martin Baulig <martin@ximian.com>
19761 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
19762 when compiling corlib.
19764 2004-03-13 Miguel de Icaza <miguel@ximian.com>
19766 * convert.cs (ExplicitConversion): We were reporting an error on
19767 certain conversions (object_type source to a value type, when the
19768 expression was `null') before we had a chance to pass it through
19769 the user defined conversions.
19771 * driver.cs: Replace / and \ in resource specifications to dots.
19774 * class.cs: Add check for duplicate operators. Fixes 52477
19776 2004-03-11 Miguel de Icaza <miguel@ximian.com>
19778 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
19779 that are in the middle of the statements, not only at the end.
19782 * class.cs (TypeContainer.AddField): No longer set the
19783 `HaveStaticConstructor' flag, now we call it
19784 `UserDefineStaticConstructor' to diferentiate the slightly
19785 semantic difference.
19787 The situation is that we were not adding BeforeFieldInit (from
19788 Modifiers.TypeAttr) to classes that could have it.
19789 BeforeFieldInit should be set to classes that have no static
19794 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
19796 And most importantly Zoltan's comment:
19798 http://bugzilla.ximian.com/show_bug.cgi?id=44229
19800 "I think beforefieldinit means 'it's ok to initialize the type sometime
19801 before its static fields are used', i.e. initialization does not need
19802 to be triggered by the first access to the type. Setting this flag
19803 helps the JIT to compile better code, since it can run the static
19804 constructor at JIT time, and does not need to generate code to call it
19805 (possibly lots of times) at runtime. Unfortunately, mcs does not set
19806 this flag for lots of classes like String.
19808 csc sets this flag if the type does not have an explicit static
19809 constructor. The reasoning seems to be that if there are only static
19810 initalizers for a type, and no static constructor, then the programmer
19811 does not care when this initialization happens, so beforefieldinit
19814 This bug prevents the AOT compiler from being usable, since it
19815 generates so many calls to mono_runtime_class_init that the AOT code
19816 is much slower than the JITted code. The JITted code is faster,
19817 because it does not generate these calls if the vtable is type is
19818 already initialized, which is true in the majority of cases. But the
19819 AOT compiler can't do this."
19821 2004-03-10 Miguel de Icaza <miguel@ximian.com>
19823 * class.cs (MethodData.Emit): Refactor the code so symbolic
19824 information is generated for destructors; For some reasons we
19825 were taking a code path that did not generate symbolic information
19828 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
19830 * class.cs: Create a Constructor.CheckBase method that
19831 takes care of all validation type code. The method
19832 contains some code that was moved from Define.
19834 It also includes new code that checks for duplicate ctors.
19835 This fixes bug #55148.
19837 2004-03-09 Joshua Tauberer <tauberer@for.net>
19839 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
19840 a { ... }-style array creation invokes EmitStaticInitializers
19841 which is not good for reference-type arrays. String, decimal
19842 and now null constants (NullCast) are not counted toward
19843 static initializers.
19845 2004-03-05 Martin Baulig <martin@ximian.com>
19847 * location.cs (SourceFile.HasLineDirective): New public field;
19848 specifies whether the file contains or is referenced by a "#line"
19850 (Location.DefineSymbolDocuments): Ignore source files which
19851 either contain or are referenced by a "#line" directive.
19853 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
19855 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
19856 direct access to our parent, so check the method inline there.
19858 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
19860 * expression.cs (Invocation.EmitCall): Miguel's last commit
19861 caused a regression. If you had:
19866 In Foo the implict this would be null.
19868 2004-02-27 Miguel de Icaza <miguel@ximian.com>
19870 * expression.cs (Invocation.EmitCall): If the method is not
19871 virtual, do not emit a CallVirt to it, use Call.
19873 * typemanager.cs (GetFullNameSignature): Improve the method to
19874 cope with ".ctor" and replace it with the type name.
19876 * class.cs (ConstructorInitializer.Resolve): Now the method takes
19877 as an argument the ConstructorBuilder where it is being defined,
19878 to catch the recursive constructor invocations.
19880 2004-02-26 Miguel de Icaza <miguel@ximian.com>
19882 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
19883 routines to check if a type is an enumerable/enumerator allow
19884 classes that implement the IEnumerable or IEnumerator interfaces.
19886 * class.cs (Property, Operator): Implement IIteratorContainer, and
19887 implement SetYields.
19889 (Property.Define): Do the block swapping for get_methods in the
19890 context of iterators. We need to check if Properties also
19891 include indexers or not.
19893 (Operator): Assign the Block before invoking the
19894 OperatorMethod.Define, so we can trigger the Iterator code
19897 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
19898 Property and Operator classes are not created when we parse the
19899 declarator but until we have the block completed, so we use a
19900 singleton SimpleIteratorContainer.Simple to flag whether the
19901 SetYields has been invoked.
19903 We propagate this setting then to the Property or the Operator to
19904 allow the `yield' to function.
19906 2004-02-25 Marek Safar <marek.safar@seznam.cz>
19908 * codegen.cs: Implemented attribute support for modules.
19909 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
19910 Assembly/Module functionality.
19912 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
19913 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
19914 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
19916 2004-02-16 Marek Safar <marek.safar@seznam.cz>
19918 * interface.cs (FindMembers): The operation is performed on all base
19919 interfaces and not only on the first. It is required for future CLS Compliance patch.
19921 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
19923 * statement.cs, codegen.cs:
19924 This patch deals with patterns such as:
19926 public class List : IEnumerable {
19928 public MyEnumerator GetEnumerator () {
19929 return new MyEnumerator(this);
19932 IEnumerator IEnumerable.GetEnumerator () {
19936 public struct MyEnumerator : IEnumerator {
19941 Before, there were a few things we did wrong:
19942 1) we would emit callvirt on a struct, which is illegal
19943 2) we emited ldarg when we needed to emit ldarga
19944 3) we would mistakenly call the interface methods on an enumerator
19945 type that derived from IEnumerator and was in another assembly. For example:
19947 public class MyEnumerator : IEnumerator
19949 Would have the interface methods called, even if there were public impls of the
19950 method. In a struct, this lead to invalid IL code.
19952 2004-02-11 Marek Safar <marek.safar@seznam.cz>
19954 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
19957 * delegate.cs (Define): Fixed crash when delegate type is undefined.
19959 2004-02-11 Miguel de Icaza <miguel@ximian.com>
19961 * cs-parser.jay: Fix small regression: we were not testing V2
19962 compiler features correctly.
19964 * interface.cs: If the emit context is null, then create one
19966 2004-02-09 Marek Safar <marek.safar@seznam.cz>
19968 * decl.cs (GetSignatureForError): New virtual method to get full name
19969 for error messages.
19971 * attribute.cs (IAttributeSupport): New interface for attribute setting.
19972 Now it is possible to rewrite ApplyAttributes method to be less if/else.
19974 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
19975 Duplicated members and code in these classes has been removed.
19976 Better encapsulation in these classes.
19978 2004-02-07 Miguel de Icaza <miguel@ximian.com>
19980 * assign.cs (Assign.DoResolve): When dealing with compound
19981 assignments, there is a new rule in ECMA C# 2.4 (might have been
19982 there before, but it is documented here) that states that in:
19986 If b is of type int, and the `op' is a shift-operator, then the
19987 above is evaluated as:
19991 * expression.cs (Binary.ResolveOperator): Instead of testing for
19992 int/uint/long/ulong, try to implicitly convert to any of those
19993 types and use that in pointer arithmetic.
19995 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
19996 method to print information for from the type, not from the
19997 null-method we were given.
19999 2004-02-01 Duncan Mak <duncan@ximian.com>
20001 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
20002 parsing for cmd, fixes bug #53694.
20004 2004-02-04 Marek Safar <marek.safar@seznam.cz>
20006 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
20007 in the member name duplication tests. Property and operator name duplication
20008 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
20010 2004-02-03 Marek Safar <marek.safar@seznam.cz>
20012 * interface.cs (PopulateMethod): Fixed crash when interface method
20013 returns not existing type (error test cs0246-3.cs).
20015 2004-02-02 Ravi Pratap M <ravi@ximian.com>
20017 * cs-parser.jay (interface_accessors): Re-write actions to also
20018 store attributes attached to get and set methods. Fix spelling
20021 (inteface_property_declaration): Modify accordingly.
20023 (InterfaceAccessorInfo): New helper class to store information to pass
20024 around between rules that use interface_accessors.
20026 * interface.cs (Emit): Apply attributes on the get and set
20027 accessors of properties and indexers too.
20029 * attribute.cs (ApplyAttributes): Modify accordingly to use the
20030 right MethodBuilder when applying attributes to the get and set accessors.
20032 2004-01-31 Miguel de Icaza <miguel@ximian.com>
20034 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
20036 2004-01-26 Miguel de Icaza <miguel@ximian.com>
20038 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
20040 2004-01-25 Miguel de Icaza <miguel@ximian.com>
20042 * cs-parser.jay: Remove YIELD token, instead use the new grammar
20043 changes that treat `yield' specially when present before `break'
20044 or `return' tokens.
20046 * cs-tokenizer.cs: yield is no longer a keyword.
20048 2004-01-23 Marek Safar <marek.safar@seznam.cz>
20050 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
20051 setting for default constructors.
20052 For default constructors are almost every time set wrong Modifier. The
20053 generated IL code has been alright. But inside mcs this values was
20054 wrong and this was reason why several of my CLS Compliance tests
20057 2004-01-22 Martin Baulig <martin@ximian.com>
20059 * cs-parser.jay (namespace_or_type_name): Return an Expression,
20060 not a QualifiedIdentifier. This is what `type_name_expression'
20061 was previously doing.
20062 (type_name_expression): Removed; the code is now in
20063 `namespace_or_type_name'.
20064 (qualified_identifier): Removed, use `namespace_or_type_name'
20066 (QualifiedIdentifier): Removed this class.
20068 2004-01-22 Martin Baulig <martin@ximian.com>
20070 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
20071 not a string as alias name.
20073 2004-01-21 Miguel de Icaza <miguel@ximian.com>
20075 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
20076 #52730 bug, and instead compute correctly the need to use a
20077 temporary variable when requesting an address based on the
20078 static/instace modified of the field and the constructor.
20080 2004-01-21 Martin Baulig <martin@ximian.com>
20082 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
20083 class and namespace before looking up aliases. Fixes #52517.
20085 2004-01-21 Martin Baulig <martin@ximian.com>
20087 * flowanalysis.cs (UsageVector.Merge): Allow variables being
20088 assinged in a 'try'; fixes exception4.cs.
20090 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20091 * class.cs : Implemented parameter-less constructor for TypeContainer
20093 * decl.cs: Attributes are now stored here. New property OptAttributes
20095 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
20097 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
20099 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20101 * typemanager.cs (CSharpSignature): Now reports also inner class name.
20102 (CSharpSignature): New method for indexer and property signature.
20104 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20106 * pending.cs (IsVirtualFilter): Faster implementation.
20108 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20110 * typemanager.cs: Avoid inclusion of same assembly more than once.
20112 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20114 * cs-parser.jay: Fixed problem where the last assembly attribute
20115 has been applied also to following declaration (class, struct, etc.)
20117 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20119 * class.cs: Added error CS0538, CS0539 reporting.
20120 Fixed crash on Microsoft runtime when field type is void.
20122 * cs-parser.jay: Added error CS0537 reporting.
20124 * pending.cs: Added error CS0535 reporting.
20125 Improved error report for errors CS0536, CS0534.
20127 2004-01-20 Miguel de Icaza <miguel@ximian.com>
20129 Merge a few bits from the Anonymous Method MCS tree.
20131 * statement.cs (ToplevelBlock): New class for toplevel methods,
20132 will hold anonymous methods, lifted variables.
20134 * cs-parser.jay: Create toplevel blocks for delegates and for
20135 regular blocks of code.
20137 2004-01-20 Martin Baulig <martin@ximian.com>
20139 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
20140 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
20141 and `NeedExplicitReturn'; added `IsLastStatement'.
20142 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
20143 have a `ReturnLabel' or we're not unreachable.
20145 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
20146 child's reachability; don't just override ours with it. Fixes
20147 #58058 (lluis's example).
20148 (FlowBranching): Added public InTryOrCatch(), InCatch(),
20149 InFinally(), InLoop(), InSwitch() and
20150 BreakCrossesTryCatchBoundary() methods.
20152 * statement.cs (Return): Do all error checking in Resolve().
20153 Unless we are the last statement in a top-level block, always
20154 create a return label and jump to it.
20155 (Break, Continue): Do all error checking in Resolve(); also make
20156 sure we aren't leaving a `finally'.
20157 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
20158 statement in a top-level block.
20159 (Block.Flags): Added `IsDestructor'.
20160 (Block.IsDestructor): New public property.
20162 2004-01-20 Martin Baulig <martin@ximian.com>
20164 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
20166 2004-01-20 Martin Baulig <martin@ximian.com>
20168 * statement.cs (Statement.ResolveUnreachable): New public method.
20169 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
20170 (Block.Resolve): Resolve unreachable statements.
20172 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20174 * expression.cs: We need to fix the case where we do
20175 not have a temp variable here.
20177 * assign.cs: Only expression compound assignments need
20178 temporary variables.
20180 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20182 * flowanalysis.cs: Reduce memory allocation in a few ways:
20183 - A block with no variables should not allocate a bit
20185 - A method with no out parameters does not need any tracking
20186 for assignment of the parameters, so we need not allocate
20189 public readonly Type[] VariableTypes;
20190 public readonly string[] VariableNames;
20191 Are redundant. The data is already stored in the variable
20192 map, so we need not allocate another array for it.
20193 - We need to add alot of checks for if (params | locals) == null
20194 due to the first two changes.
20196 2004-01-18 Miguel de Icaza <miguel@ximian.com>
20198 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
20199 implement IMemoryLocation, we store a copy on a local variable and
20200 take the address of it. Patch from Benjamin Jemlich
20202 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
20203 to use a special "type_name_expression" rule which reduces the
20204 number of "QualifiedIdentifier" classes created, and instead
20205 directly creates MemberAccess expressions.
20207 2004-01-17 Miguel de Icaza <miguel@ximian.com>
20209 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
20210 that fixes #52853. Null literal assignment to ValueType
20212 * class.cs (MethodData.Emit): Instead of checking the name of the
20213 method to determine if its a destructor, create a new derived
20214 class from Method called Destructor, and test for that.
20216 * cs-parser.jay: Create a Destructor object instead of a Method.
20218 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
20222 2004-01-16 Miguel de Icaza <miguel@ximian.com>
20224 * expression.cs (Binary.ResolveOperator): Perform an implicit
20225 conversion from MethodGroups to their delegate types on the
20226 Addition operation.
20228 * delegate.cs: Introduce a new class DelegateCreation that is the
20229 base class for `NewDelegate' and `ImplicitDelegateCreation',
20230 factor some code in here.
20232 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
20233 conversion from MethodGroups to compatible delegate types.
20235 * ecore.cs (Expression.Resolve): Do not flag error 654
20236 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
20237 we allow conversions from MethodGroups to delegate types now.
20239 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
20240 assignments in v2 either.
20242 2004-01-10 Miguel de Icaza <miguel@ximian.com>
20244 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
20245 static read-only fields in ctors.
20247 Applied patch from Benjamin Jemlich
20249 * expression.cs (UnaryMutator): Avoid leaking local variables.
20251 2004-01-09 Miguel de Icaza <miguel@ximian.com>
20253 * cs-tokenizer.cs (IsCastToken): Allow the various native types
20254 here to return true, as they can be used like this:
20256 (XXX) int.MEMBER ()
20258 Fixed 49836 and all the other dups
20260 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
20262 * driver.cs: Implement /win32res and /win32icon.
20264 2004-01-08 Miguel de Icaza <miguel@ximian.com>
20266 * cs-parser.jay: Add a rule to improve error handling for the
20267 common mistake of placing modifiers after the type.
20269 2004-01-07 Miguel de Icaza <miguel@ximian.com>
20271 * cs-parser.jay (interface_event_declaration): Catch
20272 initialization of events on interfaces, and report cs0068
20274 * cs-parser.jay (interface_event_declaration): Catch
20275 initialization of events.
20277 * ecore.cs: Better report missing constructors.
20279 * expression.cs (Binary.ResolveOperator): My previous bug fix had
20280 the error reporting done in the wrong place. Fix.
20282 * expression.cs (Binary.ResolveOperator): Catch the
20283 operator + (E x, E y) error earlier, and later allow for implicit
20284 conversions in operator +/- (E e, U x) from U to the underlying
20287 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
20288 52596, if the container class is abstract, the default constructor
20289 is protected otherwise its public (before, we were always public).
20291 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
20294 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
20295 Jemlich that fixes bug #52597, MCS was generating invalid code for
20296 idisposable structs. Thanks to Ben for following up with this
20299 2004-01-06 Miguel de Icaza <miguel@ximian.com>
20301 * driver.cs: Allow assemblies without code to be generated, fixes
20304 2004-01-07 Nick Drochak <ndrochak@gol.com>
20306 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
20308 2004-01-05 Miguel de Icaza <miguel@ximian.com>
20310 * cs-parser.jay: Add rules to improve error reporting if fields or
20311 methods are declared at the namespace level (error 116)
20313 * Add rules to catch event add/remove
20315 2004-01-04 David Sheldon <dave-mono@earth.li>
20317 * expression.cs: Added matching ")" to error message for
20320 2004-01-03 Todd Berman <tberman@gentoo.org>
20322 * ecore.cs, attribute.cs:
20323 Applying fix from #52429.
20325 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20327 * ecore.cs, expression.cs, statement.cs:
20328 Total rewrite of how we handle branching. We
20329 now handle complex boolean expressions with fewer
20330 jumps. As well if (x == 0) no longer emits a ceq.
20332 if (x is Foo) is much faster now, because we generate
20335 Overall, we get a pretty big improvement on our benchmark
20336 tests. The code we generate is smaller and more readable.
20338 I did a full two-stage bootstrap. The patch was reviewed
20339 by Martin and Miguel.
20341 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20343 * cs-parser.jay: Make primary_expression not take a QI.
20344 we dont need this because the member_access rule covers
20345 us here. So we replace the rule with just IDENTIFIER.
20347 This has two good effects. First, we remove a s/r conflict.
20348 Second, we allocate many fewer QualifiedIdentifier objects.
20350 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20352 * attribute.cs: Handle MarshalAs attributes as pseudo, and
20353 set the correct information via SRE. This prevents
20354 hanging on the MS runtime. Fixes #29374.
20356 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20358 * convert.cs: correctly handle conversions to value types
20359 from Enum and ValueType as unboxing conversions.
20361 Fixes bug #52569. Patch by Benjamin Jemlich.
20363 2004-01-02 Ravi Pratap <ravi@ximian.com>
20365 * expression.cs (BetterConversion): Prefer int -> uint
20366 over int -> ulong (csc's behaviour). This fixed bug #52046.
20368 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
20370 * decl.cs (MemberCache.FindMembers): now returns a
20373 * typemanager.cs: In general, go with with ^^.
20374 (CopyNewMethods): take an IList.
20375 (RealMemberLookup): Only allocate an arraylist
20376 if we copy from two sets of methods.
20378 This change basically does two things:
20379 1) Fewer array lists allocated due to CopyNewMethods.
20380 2) the explicit cast in MemberList costed ALOT.
20382 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
20384 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
20385 a hashtable to avoid needless string allocations when an identifier is
20386 used more than once (the common case).
20388 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20390 * pending.cs: MS's TypeBuilder.GetInterfaces ()
20391 is broken, it will not return anything. So, we
20392 have to use the information we have in mcs to
20395 * typemanager.cs: Add a cache for GetInterfaces,
20396 since this will now be used more often (due to ^^)
20398 (GetExplicitInterfaces) New method that gets the
20399 declared, not effective, interfaces on a type
20400 builder (eg, if you have interface IFoo, interface
20401 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
20404 This patch makes MCS able to bootstrap itself on
20407 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20409 * expression.cs: Remove the Nop's that Miguel put
20412 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20414 * report.cs, codegen.cs: Give the real stack trace to
20415 the error when an exception is thrown.
20417 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20419 * decl.cs: only allocate hashtables for ifaces if
20422 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20424 * expression.cs: fix the error from cs0121-2.cs
20425 (a parent interface has two child interfaces that
20426 have a function with the same name and 0 params
20427 and the function is called through the parent).
20429 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
20431 * class.cs, rootcontext.cs, typmanager.cs: do not
20434 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
20436 * codegen.cs: remove stack for the ec flow branching.
20437 It is already a linked list, so no need.
20439 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
20441 * Makefile: Allow custom profiler here.
20443 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20445 * typemanager.cs (LookupType):
20446 - Use a static char [], because split takes
20447 a param array for args, so it was allocating
20449 - Do not store true in a hashtable, it boxes.
20451 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20453 * flowanalysis.cs: bytify common enums.
20455 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20457 * modifiers.cs: Add a new set of flags for the
20458 flags allowed on explicit interface impls.
20459 * cs-parser.jay: catch the use of modifiers in
20460 interfaces correctly.
20461 * class.cs: catch private void IFoo.Blah ().
20463 All related to bug #50572.
20465 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20467 * decl.cs: Rewrite the consistant accessability checking.
20468 Accessability is not linear, it must be implemented in
20469 a tableish way. Fixes #49704.
20471 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20473 * expression.cs: Handle negation in a checked context.
20474 We must use subtraction from zero. Fixes #38674.
20476 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20478 * class.cs: Ignore static void main in DLLs.
20479 * rootcontext.cs: Handle the target type here,
20480 since we are have to access it from class.cs
20481 * driver.cs: account for the above.
20483 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20485 * report.cs: Give line numbers and files if available.
20487 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
20489 * driver.cs: Implement /addmodule.
20491 * typemanager.cs: Change 'modules' field so it now contains Modules not
20494 2003-12-20 Martin Baulig <martin@ximian.com>
20496 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
20497 (FieldBase.IsAssigned): Removed this field.
20498 (FieldBase.SetAssigned): New public method.
20499 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
20501 2003-12-20 Martin Baulig <martin@ximian.com>
20503 * expression.cs (LocalVariableReference.DoResolve): Don't set
20504 `vi.Used' if we're called from DoResolveLValue().
20506 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
20507 returns the usage vector it just merged into the current one -
20508 pass this one to UsageWarning().
20509 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
20510 of the `EmitContext', don't call this recursively on our children.
20512 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
20514 * driver.cs: Implement /target:module.
20516 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
20518 * support.cs (CharArrayHashtable): New helper class.
20520 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
20521 char arrays, not strings, so we can avoid creating a string in
20522 consume_identifier if the identifier is a keyword.
20524 2003-12-16 Martin Baulig <martin@ximian.com>
20526 * statement.cs (LocalInfo.Assigned): Removed this property.
20527 (LocalInfo.Flags): Removed `Assigned'.
20528 (LocalInfo.IsAssigned): New public method; takes the EmitContext
20529 and uses flow analysis.
20530 (Block.UsageWarning): Made this method private.
20531 (Block.Resolve): Call UsageWarning() if appropriate.
20533 * expression.cs (LocalVariableReference.DoResolve): Always set
20534 LocalInfo.Used here.
20536 2003-12-13 Martin Baulig <martin@ximian.com>
20538 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
20539 any value here; we're now using flow analysis to figure out
20540 whether a statement/block returns a value.
20542 2003-12-13 Martin Baulig <martin@ximian.com>
20544 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
20546 (FlowBranching.MergeFinally): Don't call
20547 `branching.CheckOutParameters()' here, this is called in
20549 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
20550 when adding the `finally' vector.
20552 2003-12-13 Martin Baulig <martin@ximian.com>
20555 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
20556 actually work and also fix #48962.
20558 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
20560 * decl.cs: Do not check System.Object for nested types,
20561 since we know it does not have any. Big bang for buck:
20564 Run 1: 8.35 seconds
20565 Run 2: 8.32 seconds
20566 corlib: 17.99 seconds
20568 Run 1: 8.17 seconds
20569 Run 2: 8.17 seconds
20570 corlib: 17.39 seconds
20572 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
20574 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
20575 time we are returning 0 members, so we save alot here.
20577 2003-12-11 Martin Baulig <martin@ximian.com>
20579 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
20580 `MergeChild()', also just take the `FlowBranching' as argument;
20581 call Merge() on it and return the result.
20582 (FlowBranching.Merge): We don't need to do anything if we just
20585 2003-12-11 Martin Baulig <martin@ximian.com>
20587 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
20588 them in an `ArrayList' to reduce memory usage. Thanks to Ben
20589 Maurer for this idea.
20591 2003-12-11 Martin Baulig <martin@ximian.com>
20593 * flowanalysis.cs (MergeResult): This class is now gone; we now
20594 use the `UsageVector' for this. The reason for this is that if a
20595 branching just has one sibling, we don't need to "merge" them at
20596 all - that's the next step to do.
20597 (FlowBranching.Merge): We now return a `UsageVector' instead of a
20600 2003-12-11 Martin Baulig <martin@ximian.com>
20602 Reworked flow analyis and made it more precise and bug-free. The
20603 most important change is that we're now using a special `Reachability'
20604 class instead of having "magic" meanings of `FlowReturns'. I'll
20605 do some more cleanups and optimizations and also add some more
20606 documentation this week.
20608 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
20609 largely reworked this class.
20610 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
20611 the new `Reachability' class instead of having "magic" values here.
20612 (FlowBranching): We're now using an instance of `Reachability'
20613 instead of having separate `Returns', `Breaks' etc. fields.
20615 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
20616 based on flow analysis; ignore the return value of block.Emit ().
20618 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
20620 * driver.cs typemanager.cs: Find the mono extensions to corlib even
20621 if they are private.
20623 2003-12-09 Martin Baulig <martin@ximian.com>
20625 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
20626 call them directly on the UsageVector.
20628 2003-12-09 Martin Baulig <martin@ximian.com>
20630 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
20631 Changed return type from `FlowReturns' to `Reachability'.
20633 2003-12-09 Martin Baulig <martin@ximian.com>
20635 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
20636 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
20637 `Reachable' fields with a single `Reachability' one.
20639 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20641 * class.cs (FindMembers): Remove foreach's.
20646 Run 1: 8.74 seconds
20647 Run 2: 8.71 seconds
20650 Run 1: 8.64 seconds
20651 Run 2: 8.58 seconds
20654 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20659 This patch does a few things:
20660 1. EmptyStatement is now a singleton, so it is never reallocated.
20661 2. All blah is EmptyStatement constructs have been changed to
20662 blah == EmptyStatement.Value, which is much faster and valid
20663 now that EmptyStatement is a singleton.
20664 3. When resolving a block, rather than allocating a new array for
20665 the non-empty statements, empty statements are replaced with
20666 EmptyStatement.Value
20667 4. Some recursive functions have been made non-recursive.
20668 Mainly the performance impact is from (3), however (1) and (2) are needed for
20669 this to work. (4) does not make a big difference in normal situations, however
20670 it makes the profile look saner.
20675 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20676 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20677 Total memory allocated: 56397 KB
20680 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
20681 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
20682 Total memory allocated: 55666 KB
20684 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20686 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
20687 than the hashtable in a hashtable version
20689 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
20690 we always end up concating a string. This results in a huge perf
20691 loss, because many strings have to be tracked by the GC. In this
20692 patch, we first use a hashtable that works with two keys, so that
20693 the strings do not need to be concat'ed.
20697 Run 1: 8.74 seconds
20698 Run 2: 8.71 seconds
20701 Run 1: 8.65 seconds
20702 Run 2: 8.56 seconds
20704 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20706 * Makefile: Add a new target `do-time' that does a quick and simple
20707 profile, leaving easy to parse output.
20709 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
20711 * codegen.cs (Init): Create the dynamic assembly with
20712 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
20714 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
20716 * support.cs: Make the PtrHashtable use only one
20717 instance of its comparer.
20719 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
20721 * typemanager.cs: Fix lookup of GetNamespaces.
20723 2003-11-29 Miguel de Icaza <miguel@ximian.com>
20725 * expression.cs: Removed redundant line.
20727 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
20728 ArrayLists, use for loops with bounds.
20730 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
20733 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
20734 arraylists, use for loop with bounds.
20736 The above three changes give us a 0.071 second performance
20737 improvement out of 3.294 seconds down to 3.223. On my machine
20738 the above changes reduced the memory usage by 1,387 KB during
20739 compiler bootstrap.
20741 * cs-parser.jay (QualifiedIdentifier): New class used to represent
20742 QualifiedIdentifiers. Before we created a new string through
20743 concatenation, and mostly later on, the result would be
20744 manipulated by DecomposeQI through string manipulation.
20746 This reduced the compiler memory usage for bootstrapping from
20747 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
20748 compile times in 0.05 seconds.
20750 2003-11-28 Dick Porter <dick@ximian.com>
20752 * support.cs: Do string compares with the Invariant culture.
20760 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
20761 the comparison is done with the Invariant culture.
20763 2003-11-27 Miguel de Icaza <miguel@ximian.com>
20765 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
20766 GetEnumerator method.
20768 (ProbeCollectionType): Iterate starting at the most specific type
20769 upwards looking for a GetEnumerator
20771 * expression.cs: Shift count can be up to 31 for int/uint and 63
20774 2003-11-26 Miguel de Icaza <miguel@ximian.com>
20776 * statement.cs (Block.LookupLabel): Also look for the label on the
20777 children blocks. Use a hash table to keep track of visited
20780 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
20781 we actually did transform the other operand, otherwise fall back
20782 to the common codepath that casts to long.
20784 * cs-tokenizer.cs: Use the same code pattern as the int case.
20785 Maybe I should do the parsing myself, and avoid depending on the
20786 Parse routines to get this done.
20788 2003-11-25 Miguel de Icaza <miguel@ximian.com>
20790 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
20791 which fixes bug 51347. This time test it.
20793 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
20794 attributes for example can not tell the difference between these.
20795 The difference was only a syntax feature of the language.
20797 * attribute.cs: Apply attributes to delegates.
20799 * delegate.cs: Call the apply attributes method.
20801 2003-11-24 Miguel de Icaza <miguel@ximian.com>
20803 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
20804 comparing 0 vs Byte.MinValue, not the value
20806 (ImplicitConversionRequired): When reporting a conversion error,
20807 use error 31 to print out the constant error instead of the
20810 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
20811 which fixes bug 51347.
20813 2003-11-22 Miguel de Icaza <miguel@ximian.com>
20815 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
20816 which fixes the -warnaserror command line option.
20818 2003-11-21 Miguel de Icaza <miguel@ximian.com>
20820 * cfold.cs (DoNumericPromotions): During constant folding of
20821 additions on UIntConstant, special case intconstants with
20822 IntConstants like we do on the expression binary operator.
20824 2003-11-12 Miguel de Icaza <miguel@ximian.com>
20826 * convert.cs (ImplicitReferenceConversion): We were missing a case
20827 (System.Enum are not value types or class types, so we need to
20828 classify them separatedly).
20830 * driver.cs: We do not support error 2007.
20832 2003-11-12 Jackson Harper <jackson@ximian.com>
20834 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
20835 system directory. Also use the full file name so users can
20836 libraries names mscorlib-o-tron.dll in a non system dir.
20838 2003-11-10 Martin Baulig <martin@ximian.com>
20840 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
20841 (TypeManager.InitCoreTypes): Initialize them here, but instead of
20842 calling `ResolveType()' on them, directly assign their `Type'.
20844 2003-11-08 Martin Baulig <martin@ximian.com>
20846 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
20847 return value and the `out parent' parameter.
20848 (TypeContainer.DefineType): Moved the CS0644 check into
20849 GetClassBases(). Don't pass the interface types to the
20850 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
20851 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
20853 * ecore.cs (TypeExpr.IsAttribute): New property.
20854 (TypeExpr.GetInterfaces): New method.
20856 * interface.cs (Interface.GetInterfaceTypeByName): Return a
20857 TypeExpr instead of a Type.
20858 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
20859 (Interface.DefineType): Don't pass the interface types to the
20860 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
20861 them later and then call `TypeBulider.AddInterfaceImplementation()'.
20863 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
20864 instead of a `Type[]'.
20865 (TypeManager.RegisterBuilder): Likewise.
20866 (TypeManager.AddUserInterface): Likewise.
20867 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
20868 `Type[]' and also return a `TypeExpr[]'.
20869 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
20871 2003-11-08 Martin Baulig <martin@ximian.com>
20873 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
20876 2003-11-08 Martin Baulig <martin@ximian.com>
20878 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
20879 TypeManager.ResolveExpressionTypes().
20881 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
20882 instead of an Expression.
20883 (TypeExpr): This is now an abstract base class for `TypeExpression'.
20884 (TypeExpression): New public class; formerly known as `TypeExpr'.
20886 * expression.cs (ComposedCast): Derive from TypeExpr.
20888 * typemanager.cs (TypeManager.system_*_expr): These are now
20889 TypExpr's instead of Expression's.
20890 (TypeManager.ResolveExpressionTypes): New public static function;
20891 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
20894 2003-11-06 Miguel de Icaza <miguel@ximian.com>
20896 * expression.cs (New.DoResolve): Do not dereference value that
20897 might be a null return.
20899 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
20900 sure that the constant value has the right type. Fixes an
20901 unreported bug, similar to 50425.
20903 * const.cs (Const.LookupConstantValue): Call
20904 ImplicitStandardConversionExists before doing a conversion to
20905 avoid havng the TypeManager.ChangeType do conversions.
20907 Reduced the number of casts used
20909 (Const.ChangeType): New routine to enable reuse of the constant
20910 type changing code from statement.
20912 * typemanager.cs (ChangeType): Move common initialization to
20913 static global variables.
20917 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
20918 every value type to go through, even if it was void. Fix that.
20920 * cs-tokenizer.cs: Use is_identifier_start_character on the start
20921 character of the define, and the is_identifier_part_character for
20922 the rest of the string.
20924 2003-11-05 Miguel de Icaza <miguel@ximian.com>
20926 * expression.cs (UnaryMutator.EmitCode): When I updated
20927 LocalVariableReference.DoResolve, I overdid it, and dropped an
20928 optimization done on local variable references.
20930 2003-11-04 Miguel de Icaza <miguel@ximian.com>
20932 * ecore.cs: Convert the return from Ldlen into an int.
20934 2003-10-20 Miguel de Icaza <miguel@ximian.com>
20936 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
20937 the accessibility, this is a special case for toplevel non-public
20938 classes (internal for instance).
20940 2003-10-20 Nick Drochak <ndrochak@gol.com>
20942 * ecore.cs: Fix typo and build. Needed another right paren.
20944 2003-10-19 Miguel de Icaza <miguel@ximian.com>
20946 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
20947 `internal' case regular and protected, but not allowing protected
20948 to be evaluated later. Bug 49840
20950 2003-10-15 Miguel de Icaza <miguel@ximian.com>
20952 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
20953 to kb.Nlast, and not the kb.nFirst to isolate the switch
20956 Extract the underlying type, so enumerations of long/ulong are
20957 treated like long/ulong.
20959 2003-10-14 Miguel de Icaza <miguel@ximian.com>
20961 * expression.cs (New): Overload the meaning of RequestedType to
20962 track the possible creation of the NewDelegate type, since
20963 DoResolve is invoked more than once for new constructors on field
20966 See bugs: #48800 and #37014
20968 * cs-parser.jay (declare_local_constants): Take an arraylist
20969 instead of a single constant.
20971 (local_constant_declaration): It should take a
20972 constant_declarators, not a constant_declarator. Fixes 49487
20974 * convert.cs: Fix error report.
20976 2003-10-13 Jackson Harper <jackson@ximian.com>
20978 * typemanager.cs (TypeToCoreType): Add float and double this fixes
20981 2003-10-09 Martin Baulig <martin@ximian.com>
20983 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
20985 (MethodCore.DoDefineParameters): Removed the TypeContainer
20986 argument; use the DeclSpace which was passed to the .ctor instead.
20987 (MethodCore.CheckParameter): Take a DeclSpace instead of a
20988 TypeContainer; we only need a DeclSpace here.
20990 2003-10-09 Martin Baulig <martin@ximian.com>
20992 * class.cs (MethodData): Added additional `DeclSpace ds' argument
20994 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
20995 EmitContext's .ctor.
20997 2003-10-09 Martin Baulig <martin@ximian.com>
20999 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
21000 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
21001 AsAccessible(), moved them as well.
21003 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
21005 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
21007 * cs-parser.jay : Renamed yyName to yyNames related to jay.
21009 2003-10-07 Miguel de Icaza <miguel@ximian.com>
21011 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
21012 generation for >=, as spotted by Paolo, bug 48679.
21013 Patch from David Waite.
21015 * cs-tokenizer.cs: Add handling for #pragma.
21017 * cs-parser.jay: Allow for both yield and yield return in the
21018 syntax. The anti-cobolization of C# fight will go on!
21020 * class.cs (TypeBuilder.DefineType): Catch error condition here
21021 (Parent.DefineType erroring out and returning null).
21023 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
21024 coping with enumerations variables, we were mistakenly processing
21025 them as a regular value type instead of built-in types. Fixes the
21028 * typemanager.cs (IsBuiltinOrEnum): New method.
21030 2003-09-30 Miguel de Icaza <miguel@ximian.com>
21032 * cs-parser.jay: Upgrade: yield now needs the return clause.
21034 2003-09-19 Martin Baulig <martin@ximian.com>
21036 * decl.cs (MemberCache.SetupCacheForInterface): Take a
21037 `MemberCache parent' argument. Normally, an interface doesn't
21038 have a parent type except System.Object, but we use this in gmcs
21039 for generic type parameters.
21041 2003-09-18 Martin Baulig <martin@ximian.com>
21043 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
21044 on `type.IsInterface'; don't check whether the type has a parent
21045 to determine whether it's an interface.
21047 2003-09-15 Martin Baulig <martin@ximian.com>
21049 * class.cs (TypeContainer.DefineType): Added an error flag to
21050 avoid reporting duplicate CS0146's ("class definition is
21053 * driver.cs (Driver.MainDriver): Abort if
21054 RootContext.ResolveTree() reported any errors.
21056 2003-09-07 Martin Baulig <martin@ximian.com>
21058 * report.cs (Error, Warning): Added overloaded versions which take
21059 a `params object[] args' and call String.Format().
21061 2003-09-07 Martin Baulig <martin@ximian.com>
21063 * decl.cs (DeclSpace..ctor): Don't call
21064 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
21065 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
21066 (DeclSpace.RecordDecl): New method.
21068 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
21070 2003-09-02 Ravi Pratap <ravi@ximian.com>
21072 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
21073 value attributes to be applied to ParameterBuilders.
21075 * class.cs (MethodCore.LabelParameters): Make static and more
21076 generic so that it can be used from other places - like interface
21077 methods, for instance.
21079 * interface.cs (Interface.Emit): Call LabelParameters before
21080 emitting attributes on the InterfaceMethod.
21082 2003-08-26 Martin Baulig <martin@ximian.com>
21084 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
21085 resolving aliases; fixes #47927.
21087 2003-08-26 Martin Baulig <martin@ximian.com>
21089 * statement.cs (Using.DoResolve): This is internally emitting a
21090 try/finally clause, so we need to set ec.NeedExplicitReturn if we
21091 do not always return. Fixes #47681.
21093 2003-08-26 Martin Baulig <martin@ximian.com>
21095 * decl.cs (MemberCore): Moved WarningNotHiding(),
21096 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
21098 (AdditionResult): Make this nested in DeclSpace.
21099 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
21100 argument; call NamespaceEntry.Define() unless we're nested in a
21103 * namespace.cs (Namespace.DefineName): New public function. This
21104 is called from DeclSpace's .ctor to add
21105 (Namespace.Lookup): Include DeclSpaces in the lookup.
21107 * class.cs (Operator): Derive from MemberBase, not MemberCore.
21109 * const.cs (Const): Derive from MemberBase, not MemberCore.
21111 2003-08-25 Martin Baulig <martin@ximian.com>
21113 * convert.cs (Convert.ExplicitReferenceConversion): When
21114 converting from an interface type to a class, unbox if the target
21115 type is a struct type. Fixes #47822.
21117 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21119 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
21122 2003-08-22 Martin Baulig <martin@ximian.com>
21124 * class.cs (TypeManager.DefineType): When defining a nested type,
21125 call DefineType() on our parent; fixes #47801.
21127 2003-08-22 Martin Baulig <martin@ximian.com>
21129 * class.cs (MethodData.Define): While checking if a method is an
21130 interface implementation, improve the test a bit more to fix #47654.
21132 2003-08-22 Martin Baulig <martin@ximian.com>
21134 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
21135 correctly; fixes #47722.
21137 2003-08-22 Martin Baulig <martin@ximian.com>
21139 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
21140 LocalVariableReference, ensure it's not read-only. Fixes #47536.
21142 * statement.cs (Fixed.DoResolve): Make all variables read-only.
21144 2003-08-22 Martin Baulig <martin@ximian.com>
21146 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
21147 can only be assigned in static constructors. Fixes #47161.
21149 2003-08-22 Martin Baulig <martin@ximian.com>
21151 Rewrote and improved the flow analysis code.
21153 * flowbranching.cs (FlowBranching): Make this class abstract.
21154 (FlowBranching.CreateBranching): New static function to create a
21155 new flow branching.
21156 (FlowBranchingBlock, FlowBranchingException): New classes.
21157 (FlowBranching.UsageVector.Type): New public readonly field.
21158 (FlowBranching.UsageVector.Breaks): Removed the setter.
21159 (FlowBranching.UsageVector.Returns): Removed the setter.
21160 (FlowBranching.UsageVector): Added Break(), Return(),
21161 NeverReachable() and Throw() methods to modify the reachability.
21162 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
21163 done by FlowBranching.Merge().
21164 (FlowBranching.UsageVector.MergeChild): New method; merges the
21165 merge result into the current vector.
21166 (FlowBranching.Merge): New abstract method to merge a branching.
21168 2003-08-12 Martin Baulig <martin@ximian.com>
21170 * expression.cs (Indirection.CacheTemporaries): Create the
21171 LocalTemporary with the pointer type, not its element type.
21173 2003-08-10 Miguel de Icaza <miguel@ximian.com>
21175 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
21176 token was a keyword or not.
21178 Add `error' options where an IDENTIFIER was expected; Provide
21179 CheckToken and CheckIdentifierToken convenience error reporting
21182 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
21184 * decl.cs: Rename `NamespaceEntry Namespace' public field into
21185 NameSpaceEntry NameSpaceEntry.
21187 (LookupInterfaceOrClass): Avoid creating a full qualified name
21188 from namespace and name: avoid doing lookups when we know the
21189 namespace is non-existant. Use new Tree.LookupByNamespace which
21190 looks up DeclSpaces based on their namespace, name pair.
21192 * driver.cs: Provide a new `parser verbose' to display the
21193 exception thrown during parsing. This is turned off by default
21194 now, so the output of a failure from mcs is more graceful.
21196 * namespace.cs: Track all the namespaces defined in a hashtable
21199 (IsNamespace): New method
21201 2003-08-09 Miguel de Icaza <miguel@ximian.com>
21203 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
21204 we know that we need to concatenate (full typename can never be
21209 * statement.cs: Use a bitfield; Do not initialize to null things
21210 which are done by the constructor by default.
21212 * cs-parser.jay: bug fix, parameter was 4, not 3.
21214 * expression.cs: Just use the property;
21216 * statement.cs: No need for GetVariableInfo method.
21218 2003-08-08 Martin Baulig <martin@ximian.com>
21220 * flowanalysis.cs (FlowReturns): This is now nested in the
21221 `FlowBranching' class.
21222 (MyBitVector): Moved this here from statement.cs.
21223 (FlowBranching.SiblingType): New enum type.
21224 (FlowBranching.CreateSibling): Added `SiblingType' argument.
21226 2003-08-07 Martin Baulig <martin@ximian.com>
21228 * flowanalysis.cs (FlowBranchingType): This is now nested in the
21229 `FlowBranching' class and called `BranchingType'.
21231 2003-08-07 Martin Baulig <martin@ximian.com>
21233 * flowanalysis.cs: Moved all the control flow analysis code into
21236 2003-08-07 Martin Baulig <martin@ximian.com>
21238 * assign.cs (Assign.DoResolve): `target' must either be an
21239 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
21242 2003-08-07 Miguel de Icaza <miguel@ximian.com>
21244 * expression.cs (BinaryMethod): This kind of expression is created by the
21245 Binary class if it determines that the operator has to be handled
21248 (BinaryDelegate): This kind of expression is created if we are
21249 dealing with a + or - operator on delegates.
21251 (Binary): remove method, argumetns, and DelegateOperator: when
21252 dealing with methods,
21254 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
21256 * statement.cs (Block): use bitfields for the three extra booleans
21257 we had in use. Remove unused topblock parameter.
21259 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
21261 * assign.cs: Drop extra unneeded tests.
21263 2003-08-06 Miguel de Icaza <miguel@ximian.com>
21265 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
21267 * statement.cs (Foreach): Use VariableStorage instead of
21270 * codegen.cs (VariableStorage): New class used by clients that
21271 require a variable stored: locals or fields for variables that
21272 need to live across yield.
21274 Maybe provide a convenience api for EmitThis+EmitLoad?
21276 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
21279 2003-08-05 Miguel de Icaza <miguel@ximian.com>
21281 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
21282 RemapParameterLValue): New methods that are used to turn a
21283 precomputed FieldInfo into an expression like this:
21287 The idea is to use this instead of making LocalVariableReference
21288 have more than one meaning.
21290 * cs-parser.jay: Add error production to BASE.
21292 * ecore.cs: Deal with TypeManager.GetField returning null, which
21293 is now a valid return value.
21295 (FieldExprNoAddress): New expression for Fields whose address can
21298 * expression.cs (LocalVariableReference): During the resolve
21299 phases, create new expressions if we are in a remapping context.
21300 Remove code that dealt with remapping here.
21302 (ParameterReference): same.
21304 (ProxyInstance): New expression, like the `This' expression, but
21305 it is born fully resolved. We know what we are doing, so remove
21306 the errors that are targeted to user-provided uses of `this'.
21308 * statement.cs (Foreach): our variable is now stored as an
21309 Expression; During resolution, follow the protocol, dont just
21310 assume it will return this.
21312 2003-08-06 Martin Baulig <martin@ximian.com>
21314 * support.cs (SeekableStreamReader.cs): New public class.
21316 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
21317 SeekableStreamReader instead of the normal StreamReader.
21319 2003-08-04 Martin Baulig <martin@ximian.com>
21321 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
21322 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
21323 deambiguate casts and delegate invocations.
21324 (parenthesized_expression): Use the new tokens to ensure this is
21325 not a cast of method invocation.
21327 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
21328 when reading a `)' and Deambiguate_CloseParens () was previously
21331 * expression.cs (ParenthesizedExpression): New class. This is
21332 just used for the CS0075 test.
21333 (Binary.DoResolve): Check for CS0075.
21335 2003-07-29 Ravi Pratap <ravi@ximian.com>
21337 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
21338 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
21339 reference comparison.
21341 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
21342 examine the ReturnType for equality - this is necessary in the
21343 cases of implicit and explicit operators whose signature also
21344 includes the return type.
21346 2003-07-26 Miguel de Icaza <miguel@ximian.com>
21348 * namespace.cs: Cache the result of the namespace computation,
21349 instead of computing it every time.
21351 2003-07-24 Miguel de Icaza <miguel@ximian.com>
21353 * decl.cs: Use a global arraylist that we reuse over invocations
21354 to avoid excesive memory consumption. Reduces memory usage on an
21355 mcs compile by one meg (45 average).
21357 * typemanager.cs (LookupTypeReflection): In .NET pointers are
21358 private, work around that.
21360 2003-07-23 Miguel de Icaza <miguel@ximian.com>
21362 * literal.cs (IntLiteral): Define Zero and One static literals.
21364 * cs-parser.jay (integer_literal): use static literals to reduce
21365 memory usage for the most used literals (0, 1 and -1). 211kb
21366 reduced in memory usage.
21368 Replace all calls to `new ArrayList' with `new
21369 ArrayList(4)' which is a good average number for most allocations,
21370 and also requires only 16 bytes of memory for its buffer by
21373 This reduced MCS memory usage in seven megabytes for the RSS after
21376 2003-07-28 Ravi Pratap <ravi@ximian.com>
21378 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
21379 handle params methods the correct way by forming only one
21380 applicable set with params and normal methods in them. Earlier we
21381 were looking at params methods only if we found no normal methods
21382 which was not the correct thing to do.
21384 (Invocation.BetterFunction): Take separate arguments indicating
21385 when candidate and the best method are params methods in their
21388 This fixes bugs #43367 and #46199.
21390 * attribute.cs: Documentation updates.
21392 (CheckAttribute): Rename to CheckAttributeTarget.
21393 (GetValidPlaces): Rename to GetValidTargets.
21395 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
21396 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
21400 2003-07-28 Martin Baulig <martin@ximian.com>
21402 * class.cs (TypeContainer.DefineMembers): Use the base type's full
21403 name when looking up the base class of a nested class. Fixes #46977.
21405 2003-07-26 Martin Baulig <martin@ximian.com>
21407 * expression.cs (Indexers.Indexer): New nested struct; contains
21408 getter, setter and the indexer's type.
21409 (Indexers.Properties): This is now an ArrayList of
21410 Indexers.Indexer's.
21411 (IndexerAccess.DoResolveLValue): Correctly set the type if the
21412 indexer doesn't have any getters.
21414 * assign.cs (Assign.DoResolve): Also do the implicit conversions
21415 for embedded property and indexer assignments.
21417 2003-07-26 Martin Baulig <martin@ximian.com>
21419 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
21420 preprocessor directive is not the first non-whitespace character
21423 2003-07-26 Martin Baulig <martin@ximian.com>
21425 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
21426 namespace parsing, follow the spec more closely.
21428 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
21429 NamespaceEntry.Lookup().
21431 2003-07-25 Martin Baulig <martin@ximian.com>
21433 * MethodCore.cs (OverridesSomething): New public field; it's set
21434 from TypeContainer.DefineMembers if this method overrides
21435 something (which doesn't need to be a method). Fix #39462.
21437 2003-07-25 Ravi Pratap <ravi@ximian.com>
21439 * typemanager.cs (GetMembers): Ensure that the list of members is
21440 reversed. This keeps things in sync.
21442 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
21443 find an AttributeUsage attribute.
21445 * expression.cs (Invocation.OverloadResolve): Perform the check
21446 which disallows Invoke to be directly called on a Delegate.
21448 (Error_InvokeOnDelegate): Report error cs1533.
21450 2003-07-25 Martin Baulig <martin@ximian.com>
21452 * expression.cs (Indexers.GetIndexersForType): Only look in the
21453 interface hierarchy if the requested type is already an
21454 interface. Fixes #46788 while keeping #46502 fixed.
21456 2003-07-25 Martin Baulig <martin@ximian.com>
21458 * class.cs (TypeContainer.DefineMembers): Check whether all
21459 readonly fields have been assigned and report warning CS0649 if
21462 * statement.cs (LocalInfo.IsFixed): Always return true if this is
21465 2003-07-24 Ravi Pratap <ravi@ximian.com>
21467 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
21468 returned from GetMethods to make things consistent with the
21469 assumptions MCS makes about ordering of methods.
21471 This should comprehensively fix bug #45127 and it does :-)
21473 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
21474 ordering is actually reverse.
21476 * Clean up some debug messages I left lying around.
21478 * interface.cs (Populate*): Get rid of code which emits attributes
21479 since the stage in which we emit attributes is the 'Emit' stage,
21480 not the define stage.
21482 (Emit): Move attribute emission for interface members here.
21484 2003-07-22 Ravi Pratap <ravi@ximian.com>
21486 * expression.cs (Invocation.OverloadResolve): Follow the spec more
21487 closely: we eliminate methods in base types when we have an
21488 applicable method in a top-level type.
21490 Please see section 14.5.5.1 for an exact description of what goes
21493 This fixes bug #45127 and a host of other related to corlib compilation.
21495 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
21496 array is the method corresponding to the top-level type (this is
21497 because of the changes made to icall.c) so we change this
21500 (MethodGroupExpr.Name): This too.
21502 * typemanager.cs (GetElementType): New method which does the right
21503 thing when compiling corlib.
21505 * everywhere: Make use of the above in the relevant places.
21507 2003-07-22 Martin Baulig <martin@ximian.com>
21509 * cs-parser.jay (invocation_expression): Moved
21510 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
21511 `cast_expression', but create a InvocationOrCast which later
21512 resolves to either an Invocation or a Cast.
21514 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
21515 method; call this before EmitStatement() to make sure that this
21516 expression can be used as a statement.
21518 * expression.cs (InvocationOrCast): New class; resolves to either
21519 an Invocation or a Cast.
21521 * statement.cs (StatementExpression): Call ResolveStatement() on
21522 the ExpressionStatement before emitting it.
21524 2003-07-21 Martin Baulig <martin@ximian.com>
21526 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
21527 `ref' and `out' attributes match; fixes #46220.
21528 (MemberAccess.ResolveMemberAccess): You can't reference a type
21529 through an expression; fixes #33180.
21530 (Indexers.GetIndexersForType): Don't return the indexers from
21531 interfaces the class implements; fixes #46502.
21533 2003-07-21 Martin Baulig <martin@ximian.com>
21535 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
21536 CS0661 checks; fixes bug #30442.
21538 2003-07-21 Martin Baulig <martin@ximian.com>
21540 * decl.cs (AdditionResult): Added `Error'.
21542 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
21544 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
21545 makes cs0031.cs actually work.
21547 2003-07-20 Martin Baulig <martin@ximian.com>
21549 * namespace.cs: Fixed that bug which caused a crash when compiling
21550 the debugger's GUI.
21552 2003-07-20 Miguel de Icaza <miguel@ximian.com>
21554 * typemanager.cs (LookupTypeReflection): Never expose types which
21555 are NotPublic, NestedPrivate, NestedAssembly, or
21556 NestedFamANDAssem. We used to return these, and later do a check
21557 that would report a meaningful error, but the problem is that we
21558 would not get the real match, if there was a name override.
21560 2003-07-18 Miguel de Icaza <miguel@ximian.com>
21562 * namespace.cs (Namespace, Name): Do not compute the namespace
21563 name dynamically, compute it in the constructor. This reduced
21564 memory usage by 1697 KB.
21566 * driver.cs: Use --pause to pause at the end.
21568 2003-07-17 Peter Williams <peter@newton.cx>
21570 * Makefile: Change the name of the test target so that it doesn't
21571 conflict with the recursive test target.
21573 2003-07-17 Miguel de Icaza <miguel@ximian.com>
21575 * expression.cs (LocalVariableReference.Emit, EmitAssign,
21576 AddressOf): Do not use EmitThis, that was wrong, use the actual
21579 2003-07-15 Miguel de Icaza <miguel@ximian.com>
21581 * class.cs (MethodData.Define): While checking if a method is an
21582 interface implementation, improve the test: If we are not public
21583 (use new test here: use the computed MethodAttributes directly,
21584 instead of the parsed modifier flags) check if the `implementing'
21585 method comes from an interface or not.
21587 * pending.cs (VerifyPendingMethods): Slightly better error
21590 * makefile: add test target that does the mcs bootstrap.
21592 2003-07-16 Ravi Pratap <ravi@ximian.com>
21594 * interface.cs (Define): Do nothing here since there are no
21595 members to populate etc. Move the attribute emission out of here
21596 since this was just totally the wrong place to put it. Attribute
21597 application happens during the 'Emit' phase, not in the 'Define'
21600 (Emit): Add this method and move the attribute emission here
21602 * rootcontext.cs (EmitCode): Call the Emit method on interface
21605 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21607 * expression.cs (OverloadResolve): Report error only if Location
21608 is not 'Null' which means that there was a probe going on.
21610 2003-07-14 Martin Baulig <martin@ximian.com>
21612 * expression.cs (ConditionalLogicalOperator): New public class to
21613 implement user defined conditional logical operators.
21614 This is section 14.11.2 in the spec and bug #40505.
21616 2003-07-14 Martin Baulig <martin@ximian.com>
21618 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
21620 2003-07-14 Martin Baulig <martin@ximian.com>
21622 * codegen.cs (EmitContext.InFixedInitializer): New public field.
21624 * ecore.cs (IVariable.VerifyFixed): New interface method.
21626 * expression.cs (Unary.ResolveOperator): When resolving the `&'
21627 operator, check whether the variable is actually fixed. Fixes bug
21628 #36055. Set a variable definitely assigned when taking its
21629 address as required by the spec.
21631 * statement.cs (LocalInfo.IsFixed): New field.
21632 (LocalInfo.MakePinned): Set `IsFixed' to true.
21634 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21636 * attribute.cs (Attribute.Resolve): While doing a Member lookup
21637 for .ctors, ensure that we only ask for members declared in the
21638 attribute type (BindingFlags.DeclaredOnly).
21642 * expression.cs (Error_WrongNumArguments): Report error 1501
21643 correctly the way CSC does.
21645 2003-07-13 Martin Baulig <martin@ximian.com>
21647 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
21648 lookup on the fully qualified name, to make things like "X.X" work
21649 where "X.X" is a fully qualified type name, but we also have a
21650 namespace "X" in the using list. Fixes #41975.
21652 2003-07-13 Martin Baulig <martin@ximian.com>
21654 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
21655 function. If we're a CompoundAssign, we need to create an embedded
21656 CompoundAssign, not an embedded Assign.
21657 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
21660 2003-07-13 Martin Baulig <martin@ximian.com>
21662 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
21663 work to fix bug #46088.
21665 2003-07-13 Ravi Pratap <ravi@ximian.com>
21667 * class.cs (Operator.Emit): Do not emit attributes here - it is
21668 taken care of by the Method class that we delegate too. This takes
21669 care of bug #45876.
21671 2003-07-10 Martin Baulig <martin@ximian.com>
21673 * expression.cs (TypeOfVoid): New class.
21674 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
21676 2003-07-10 Martin Baulig <martin@ximian.com>
21678 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
21681 2003-07-10 Martin Baulig <martin@ximian.com>
21683 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
21684 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
21686 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
21688 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
21690 2003-07-10 Martin Baulig <martin@ximian.com>
21692 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
21693 of decimal. Fixes #42850.
21695 NOTE: I also fixed the created byte blob, but this doesn't work on
21696 the MS runtime and csc never produces any byte blobs for decimal
21699 2003-07-10 Martin Baulig <martin@ximian.com>
21701 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
21702 structs; fixes #32068.
21703 (Block.AddChildVariableNames): Fixed #44302.
21705 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21707 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
21709 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21711 * attribute.cs: And this test is onger needed.
21713 2003-07-08 Martin Baulig <martin@ximian.com>
21715 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
21716 inaccessible types. Fixes #36313.
21718 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
21720 * namespace.cs (NamespaceEntry): Create implicit entries for all
21721 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
21722 implicit entries for N1.N2 and N1.
21724 2003-07-08 Martin Baulig <martin@ximian.com>
21726 Rewrote the handling of namespaces to fix a lot of the issues
21727 wrt. `using' aliases etc.
21729 * namespace.cs (Namespace): Splitted this class into a
21730 per-assembly `Namespace' and a per-file `NamespaceEntry'.
21732 * typemanager.cs (TypeManager.IsNamespace): Removed.
21733 (TypeManager.ComputeNamespaces): Only compute namespaces from
21734 loaded assemblies here, not the namespaces from the assembly we're
21735 currently compiling.
21737 2003-07-08 Martin Baulig <martin@ximian.com>
21739 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
21741 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21743 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
21746 I thought about the memory savings here, but LookupTypeReflection
21747 is used under already very constrained scenarios. Compiling
21748 corlib or mcs only exposes one hit, so it would not really reduce
21749 any memory consumption.
21751 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21753 * typemanager.cs: fixes bug #45889 by only adding public types from
21754 other assemblies to the list of known types.
21756 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21758 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
21759 on the type we resolved.
21761 2003-07-05 Martin Baulig <martin@ximian.com>
21763 * pending.cs (PendingImplementation.ParentImplements): Don't
21764 create the proxy if the parent is abstract.
21766 * class.cs (TypeContainer.DefineIndexers): Process explicit
21767 interface implementations first. Fixes #37714.
21769 2003-07-04 Miguel de Icaza <miguel@ximian.com>
21771 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
21772 defined recursively; but since we modify the input parameters
21773 (left is set to `this' temporarily), we reset this value if the
21774 left_is_explicit is false, which gives the original semantics to
21777 * literal.cs (NullPointer): new class used to represent a null
21778 literal in a pointer context.
21780 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
21781 type is a pointer, use a NullPointer object instead of a
21782 NullLiteral. Closes 43687
21784 (ExplicitConversion): Convert pointer values using
21785 the conv opcode to the proper type.
21787 * ecore.cs (New): change ValueTypeVariable property into a method,
21788 that returns whether the valuetype is suitable for being used.
21790 * expression.cs (Binary.DoNumericPromotions): Only return if we
21791 the int constant was a valid uint, and we can return both left and
21792 right as uints. If not, we continue processing, to trigger the
21793 type conversion. This fixes 39018.
21795 * statement.cs (Block.EmitMeta): During constant resolution, set
21796 the CurrentBlock property on the emitcontext, so that we resolve
21797 constants propertly.
21799 2003-07-02 Martin Baulig <martin@ximian.com>
21801 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
21802 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
21804 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
21805 than emitting it here.
21807 * statement.cs: Fixed some more flow analysis bugs.
21809 2003-07-02 Martin Baulig <martin@ximian.com>
21811 * class.cs (MethodData.Define): When implementing interface
21812 methods, set Final unless we're Virtual.
21814 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
21815 check work for interface methods.
21817 2003-07-01 Martin Baulig <martin@ximian.com>
21819 * ecore.cs (EmitContext.This): Replaced this property with a
21820 GetThis() method which takes a Location argument. This ensures
21821 that we get the correct error location for a CS0188.
21823 2003-07-01 Miguel de Icaza <miguel@ximian.com>
21825 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
21826 ImplicitStandardConversion.
21828 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
21830 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
21832 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
21835 2003-06-30 Miguel de Icaza <miguel@ximian.com>
21837 * class.cs (Constructor.Define): Turn off initlocals for unsafe
21840 (MethodData.Define): Turn off initlocals for unsafe methods.
21842 2003-06-29 Miguel de Icaza <miguel@ximian.com>
21844 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
21845 complete; Fixes #37521.
21847 * delegate.cs: Use Modifiers.TypeAttr to compute the
21848 TypeAttributes, instead of rolling our own. This makes the flags
21849 correct for the delegates.
21851 2003-06-28 Miguel de Icaza <miguel@ximian.com>
21853 * class.cs (Constructor.Define): Set the private flag for static
21854 constructors as well.
21856 * cs-parser.jay (statement_expression): Set the return value to
21857 null, to avoid a crash when we catch an error.
21859 2003-06-24 Miguel de Icaza <miguel@ximian.com>
21861 * cs-parser.jay: Applied patch from Jackson that adds support for
21862 extern and unsafe modifiers to destructor declarations.
21864 * expression.cs: Report error 21 if the user is trying to index a
21867 * driver.cs: Add an error message, suggested by the bug report.
21869 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
21870 if we do not have a ": this ()" constructor initializer. Fixes 45149
21872 2003-06-14 Miguel de Icaza <miguel@ximian.com>
21874 * namespace.cs: Add some information to reduce FAQs.
21876 2003-06-13 Miguel de Icaza <miguel@ximian.com>
21878 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
21879 underlying enumeration types. Fixes #43915.
21881 * expression.cs: Treat ushort/short as legal values to be used in
21882 bitwise operations.
21884 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
21886 * delegate.cs: transfer custom attributes for paramenters from
21887 the delegate declaration to Invoke and BeginInvoke.
21889 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
21891 * attribute.cs: handle custom marshalers and emit marshal info
21894 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
21896 * makefile.gnu: Added anonymous.cs to the compiler sources.
21898 2003-05-28 Miguel de Icaza <miguel@ximian.com>
21900 * iterators.cs: Change the name of the proxy class to include two
21903 * cs-parser.jay: Update grammar to include anonymous methods.
21905 * anonymous.cs: new file.
21907 2003-05-27 Miguel de Icaza <miguel@ximian.com>
21909 * class.cs (Field.Define): Add missing test for pointers and
21912 2003-05-27 Ravi Pratap <ravi@ximian.com>
21914 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
21915 we use the stobj opcode.
21917 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
21918 since it wasn't the correct fix.
21920 It still is puzzling that we are required to use stobj for IntPtr
21921 which seems to be a ValueType.
21923 2003-05-26 Miguel de Icaza <miguel@ximian.com>
21925 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
21926 during regular simple name resolution. Now, the trick is that
21927 instead of returning for processing the simplename, we do a
21928 TypeManager.LookupType (ie, a rooted lookup as opposed to a
21929 contextual lookup type). If a match is found, return that, if
21930 not, return for further composition.
21932 This fixes long-standing 30485.
21934 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
21935 using the address to initialize an object, do an Stobj instead of
21936 using the regular Stelem.
21938 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
21939 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
21940 Because if we are a BaseIndexerAccess that value will be true.
21943 * statement.cs (GotoCase.Resolve): Return after reporting an
21944 error, do not attempt to continue.
21946 * expression.cs (PointerArithmetic.Emit): If our operand is a
21947 long, convert our constants to match the operand before
21948 multiplying. Convert to I type before adding. Fixes 43670.
21950 2003-05-14 Ravi Pratap <ravi@ximian.com>
21952 * enum.cs (ImplicitConversionExists) : Rename to
21953 ImplicitEnumConversionExists to remove ambiguity.
21955 * ecore.cs (NullCast): New type of cast expression class which
21956 basically is very similar to EmptyCast with the difference being
21957 it still is a constant since it is used only to cast a null to
21959 (eg. (string) null)
21961 * convert.cs (ImplicitReferenceConversion): When casting a null
21962 literal, we return a NullCast.
21964 * literal.cs (NullLiteralTyped): Remove - I don't see why this
21965 should be around anymore.
21967 The renaming (reported was slightly wrong). Corrections:
21969 ConvertImplicitStandard -> ImplicitConversionStandard
21970 ConvertExplicitStandard -> ExplicitConversionStandard
21972 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
21973 before passing them in !
21975 * convert.cs (ImplicitConversionStandard): When comparing for
21976 equal expr and target types, ensure that expr is not a
21979 In general, we must not be checking (expr_type ==
21980 target_type) in the top level conversion methods
21981 (ImplicitConversion, ExplicitConversion etc). This checking is
21982 done in the methods that they delegate to.
21984 2003-05-20 Miguel de Icaza <miguel@ximian.com>
21986 * convert.cs: Move Error_CannotConvertType,
21987 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
21988 ImplicitNumericConversion, ImplicitConversionExists,
21989 ImplicitUserConversionExists, StandardConversionExists,
21990 FindMostEncompassedType, FindMostSpecificSource,
21991 FindMostSpecificTarget, ImplicitUserConversion,
21992 ExplicitUserConversion, GetConversionOperators,
21993 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
21994 TryImplicitIntConversion, Error_CannotConvertImplicit,
21995 ConvertImplicitRequired, ConvertNumericExplicit,
21996 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
21997 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
22000 Perform the following renames:
22002 StandardConversionExists -> ImplicitStandardConversionExists
22003 ConvertImplicit -> ImplicitConversion
22004 ConvertImplicitStandard -> ImplicitStandardConversion
22005 TryImplicitIntConversion -> ImplicitIntConversion
22006 ConvertImplicitRequired -> ImplicitConversionRequired
22007 ConvertNumericExplicit -> ExplicitNumericConversion
22008 ConvertReferenceExplicit -> ExplicitReferenceConversion
22009 ConvertExplicit -> ExplicitConversion
22010 ConvertExplicitStandard -> ExplicitStandardConversion
22012 2003-05-19 Martin Baulig <martin@ximian.com>
22014 * statement.cs (TypeInfo.StructInfo): Made this type protected.
22015 (TypeInfo): Added support for structs having structs as fields.
22017 * ecore.cs (FieldExpr): Implement IVariable.
22018 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
22019 VariableInfo for the field.
22021 2003-05-18 Martin Baulig <martin@ximian.com>
22023 * expression.cs (This.DoResolve): Report a CS0027 if we're
22024 emitting a field initializer.
22026 2003-05-18 Martin Baulig <martin@ximian.com>
22028 * expression.cs (This.ResolveBase): New public function.
22029 (This.DoResolve): Check for CS0188.
22031 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
22034 * ecore.cs (MethodGroupExpr.DoResolve): Set the
22035 `instance_expression' to null if we don't have any non-static
22038 2003-05-18 Martin Baulig <martin@ximian.com>
22040 Reworked the way how local variables and parameters are handled by
22041 the flow analysis code.
22043 * statement.cs (TypeInfo, VariableMap): New public classes.
22044 (VariableInfo): New public class. This is now responsible for
22045 checking whether a variable has been assigned. It is used for
22046 parameters and local variables.
22047 (Block.EmitMeta): Take the InternalParameters as argument; compute
22048 the layout of the flow vectors here.
22049 (Block.LocalMap, Block.ParameterMap): New public properties.
22050 (FlowBranching): The .ctor doesn't get the InternalParameters
22051 anymore since Block.EmitMeta() now computes the layout of the flow
22053 (MyStructInfo): This class is now known as `StructInfo' and nested
22054 in `TypeInfo'; we don't access this directly anymore.
22056 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
22057 property and removed IsAssigned(), IsFieldAssigned(),
22058 SetAssigned() and SetFieldAssigned(); we now call them on the
22059 VariableInfo so we don't need to duplicate this code everywhere.
22061 * expression.cs (ParameterReference): Added `Block block' argument
22063 (LocalVariableReference, ParameterReference, This): The new
22064 VariableInfo class is now responsible for all the definite
22067 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
22068 IsParameterAssigned, SetParameterAssigned): Removed.
22070 2003-05-18 Martin Baulig <martin@ximian.com>
22072 * typemanager.cs (InitCoreTypes): Try calling
22073 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
22074 the 3-args-version. Corlib now also needs our `void_type'.
22075 (GetMethod): Added overloaded version which takes an optional
22076 `bool report_errors' to allow lookups of optional methods.
22078 2003-05-12 Martin Baulig <martin@ximian.com>
22080 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
22081 only used for locals and not for parameters.
22083 2003-05-12 Miguel de Icaza <miguel@ximian.com>
22085 * support.cs (InternalParameters.ParameterType): Return the
22086 ExternalType of the parameter.
22088 * parameter.cs (Parameter.ExternalType): drop the two arguments,
22091 2003-05-11 Miguel de Icaza <miguel@ximian.com>
22093 * class.cs (MethodData.Define): Do not set the `newslot' on
22094 interface members, if they are also flagged as "override".
22096 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
22097 better code for ++i and i++. This only works for static fields
22098 and local variables.
22100 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
22101 want to pull the DeclSpace out of the builder_to_declspace instead
22102 of the TypeBuilder (like in TypeContainer.FindMembers).
22104 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
22105 instead of LookupTypeContainer. Fixes the crash on .NET for
22106 looking up interface members.
22108 * const.cs: Create our own emit context during the Definition
22109 stage, so that constants are evaluated in the proper context, when
22110 a recursive definition happens.
22112 2003-05-11 Martin Baulig <martin@ximian.com>
22114 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
22115 new block for a switch section.
22116 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
22117 the adding/lookup in the switch block. Fixes #39828.
22119 2003-05-09 Miguel de Icaza <miguel@ximian.com>
22121 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
22122 functionality: I needed to convert the data after I had performed
22123 the add/sub operation into the operands type size.
22125 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
22126 pass the type for the box operation, otherwise the resulting
22127 object would have been of type object.
22129 (BoxedCast): Add constructor to specify the type to box as.
22131 2003-05-07 Miguel de Icaza <miguel@ximian.com>
22133 * iterators.cs: I was reusing the `count' variable inadvertently,
22134 take steps to not allow this to happen.
22136 2003-05-06 Miguel de Icaza <miguel@ximian.com>
22138 * attribute.cs (Attribute.Resolve): Params attributes are encoded
22139 by creating an array at the point where the params starts and
22140 putting all those arguments there, then adjusting the size of the
22143 2003-05-05 Miguel de Icaza <miguel@ximian.com>
22145 * expression.cs (New.AddressOf): Implement interface
22146 IMemoryLocation. This is used when the `new' operator is used in
22147 the context of an invocation to a method on a value type.
22149 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
22152 * namespace.cs: Also check the using aliases here.
22154 * driver.cs: Move the test for using validity after the types have
22155 been entered, so we do a single pass that also includes the using
22158 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
22159 in the regular case. CreateSiblingForFinally is doing extra
22162 * attribute.cs (GetAttributeArgumentExpression): Store the result
22163 on an out value, and use the return value to indicate failure
22164 instead of using null (which is a valid return for Constant.GetValue).
22166 * statement.cs: Perform the analysis flow for the increment
22167 portion after the statement, because this will be the real flow of
22168 execution. Fixes #42385
22170 * codegen.cs (EmitContext.EmitArgument,
22171 EmitContext.EmitStoreArgument): New helper functions when the
22172 RemapToProxy flag is set.
22174 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
22177 Add support for remapping parameters.
22179 * iterators.cs: Propagate parameter values; Store parameter
22180 values in the proxy classes.
22182 2003-05-04 Miguel de Icaza <miguel@ximian.com>
22184 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
22185 need a proxy reference; I do not know what I was thinking
22187 * cs-parser.jay (constructor_initializer): catch another error,
22188 and display nice message.
22190 (field_declaration): catch void field declaration
22191 to flag a better error.
22193 * class.cs (MemberBase.CheckBase): Report an error instead of a
22194 warning if a new protected member is declared in a struct.
22195 (Field.Define): catch the error of readonly/volatile.
22197 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
22199 (FieldExpr.AddressOf): ditto. Catch error where the address of a
22200 volatile variable is taken
22202 2003-05-02 Miguel de Icaza <miguel@ximian.com>
22204 * statement.cs (Fixed.Resolve): Report an error if we are not in
22207 2003-05-01 Miguel de Icaza <miguel@ximian.com>
22209 * typemanager.cs: reuse the code that handles type clashes for
22210 delegates and enumerations.
22212 * class.cs (Report28): Always report.
22214 * expression.cs (EncodeAsAttribute): Allow nulls here.
22216 2003-04-28 Miguel de Icaza <miguel@ximian.com>
22218 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
22219 the functionality for testing whether an expression is valid for
22220 an attribute here. Also handle the case of arrays of elements
22223 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
22224 encoding a linear array into an array of objects that are suitable
22225 to be passed to an CustomAttributeBuilder.
22227 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
22229 * ecore.cs: (FieldExpr): Handle field remapping here.
22231 * iteratators.cs: Pass the instance variable (if the method is an
22232 instance method) to the constructors, so we can access the field
22233 variables on the class.
22235 TODO: Test this with structs. I think the THIS variable on
22236 structs might have to be a pointer, and not a refenrece
22238 2003-04-27 Miguel de Icaza <miguel@ximian.com>
22240 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
22241 local variables to fields in a proxy class.
22243 * iterators.cs (PopulateProxy): Rename our internal fields to
22245 Create a <THIS> field if we are an instance method, so we can
22246 reference our parent container variables.
22247 (MapVariable): Called back from the EmitContext code to enter a
22248 new variable to field mapping into the proxy class (we just create
22252 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
22253 for using the remapped locals to fields.
22255 I placed the code here, because that gives the same semantics to
22256 local variables, and only changes the Emit code.
22258 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
22259 statements inside iterators.
22260 (VariableInfo): Add a FieldBuilder for the cases when we are
22261 remapping local variables to fields in a proxy class
22263 * ecore.cs (SimpleNameResolve): Avoid testing two times for
22264 current_block != null.
22266 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
22267 not cope with strings, as it has been moved to the
22268 TableSwitchEmit. Fixed bug in switch generation.
22270 * expression.cs (New.DoResolve): Provide more context for the user
22271 when reporting an error.
22273 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
22276 * expression.cs (MemberAccess.DoResolve): When we get a type back,
22277 check the permissions for it. Note than in a type-resolution
22278 context the check was already present in DeclSpace.ResolveType,
22279 but was missing from the MemberAccess.
22281 (ArrayCreation.CheckIndices): warn if the user has
22282 more nested levels of expressions, but there are no more
22283 dimensions specified. Avoids crash on bug 41906.
22285 2003-04-26 Miguel de Icaza <miguel@ximian.com>
22287 * statement.cs (Block): replace Implicit bool, for a generic
22289 New flag: `Unchecked'. This is used during the EmitMeta phase
22290 (which is out-of-line with the regular Resolve/Emit process for a
22291 statement, as this is done ahead of time, but still gets a chance
22292 to call constant resolve).
22294 (Block.Flags): new enum for adding a new flag.
22296 (Block.EmitMeta): track the state of unchecked.
22298 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
22299 to enable constant resolution to work there as well.
22301 2003-04-22 Miguel de Icaza <miguel@ximian.com>
22303 * typemanager.cs (ienumerable_type): Also look up
22304 System.Collections.IEnumerable.
22306 2003-04-21 Miguel de Icaza <miguel@ximian.com>
22308 TODO: Test more than one conditional per method.
22310 * class.cs (Indexer.Define): Report the location where the user is
22311 referencing the unsupported feature.
22313 (MethodData): Overload the use of `conditionals' to
22314 minimize the creation of needless ArrayLists. This saves roughly
22315 212kb on my machine.
22317 (Method): Implement the new IIteratorContainer interface.
22318 (Method.SetYields): Implement the method by setting the ModFlags
22319 to contain METHOD_YIELDS.
22321 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
22322 which just got set to null.
22324 * iterators.cs: New file.
22326 (Yield, YieldBreak): New statements.
22328 * statement.cs (Return.Resolve): Flag an error if we are used in
22329 an iterator method.
22331 * codegen.cs (InIterator): New flag set if the code is being
22332 compiled in an iterator method.
22334 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
22335 internal modifier, and we just use it to avoid adding extra
22336 fields, as this is seldom used.
22338 * cs-parser.jay: Add yield_statement (yield and yield break).
22340 * driver.cs: New flag -v2 to turn on version 2 features.
22342 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
22343 hashtable when v2 is enabled.
22345 2003-04-20 Miguel de Icaza <miguel@ximian.com>
22347 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
22348 there is already a namespace defined with this name.
22350 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
22351 people upgraded their corlibs.
22353 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
22354 always use fully qualified types, no need to use the compiler
22357 (TypeManager.IsNamespace): Use binarysearch.
22359 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
22360 AddDelegate): I did not quite use the new IsValid API properly: I
22361 have to pass the short-name and the fullname. I was passing only
22362 the basename instead of the fullname sometimes.
22364 (TypeContainer.DefineType): call NamespaceClash.
22366 * interface.cs (Interface.DefineType): use NamespaceClash before
22369 * delegate.cs (Delegate.DefineType): use NamespaceClash before
22372 * enum.cs: (Enum.DefineType): use NamespaceClash before
22375 * typemanager.cs (: 3-line patch that gives us some tasty 11%
22376 speed increase. First, use the negative_hits cache when we get a
22377 negative. Second, add the type with its full original name
22378 instead of the new . and + encoded name (reflection uses + to
22379 separate type from a nested type). Use LookupTypeReflection
22380 directly which bypasses the type->name hashtable (that we already
22381 know does not contain the type.
22383 * decl.cs (DeclSpace.ResolveTypeExpr): track the
22384 location/container type.
22386 * driver.cs: When passing utf8, use directly the UTF8Encoding.
22388 2003-04-19 Miguel de Icaza <miguel@ximian.com>
22390 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
22392 * delegate.cs (NewDelegate.Resolve): Test whether an instance
22393 method is being referenced in the method group from a static
22394 context, and report error 120 if so.
22396 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
22399 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
22400 is created, we create the A namespace).
22402 * cs-parser.jay: A namespace also introduces a DeclarationFound.
22405 2003-04-18 Miguel de Icaza <miguel@ximian.com>
22407 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
22408 invocation to ModuleBuilder.GetType with the same values will
22409 return a new type instance, so we need to cache its return
22412 * expression.cs (Binary.ResolveOperator): Only allow the compare
22413 operators on enums if they are of the same type.
22415 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
22416 types of ValueType on their own case. Before we were giving them
22417 the same treatment as objects.
22419 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
22420 fullname. Short name is used to compare against container name.
22421 Fullname is used to check against defined namespace names.
22423 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
22424 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
22426 (Method.CheckBase): Call parent.
22427 (MemberBase.CheckBase): Check for protected members on sealed
22429 (PropertyBase.CheckBase): Call parent.
22430 (Field.Define): Call parent.
22432 * report.cs: Negative error codes are now mapped to 8000 - code,
22433 so that the display is render more nicely.
22435 * typemanager.cs: Do not use try/catch, instead report a regular
22438 (GetPointerType, GetReferenceType): These methods provide
22439 mechanisms to obtain the T* and T& from a T. We had the code
22440 previously scattered around the code base, and it also used
22441 TypeManager.LookupType that would go through plenty of caches.
22442 This one goes directly to the type source.
22444 In some places we did the Type.GetType followed by
22445 ModuleBuilder.GetType, but not in others, so this unifies the
22446 processing as well.
22448 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
22449 statements now that we have namespace information.
22451 * typemanager.cs (IsNamespace): New method, returns whether the
22452 string presented is a namespace or not.
22454 (ComputeNamespaces): New public entry point, computes the list of
22455 available namespaces, using the GetNamespaces API call in Mono, or
22456 the slower version in MS.NET.
22458 Now before we start the semantic analysis phase, we have a
22459 complete list of namespaces including everything that the user has
22462 Deleted old code to cache namespaces in .nsc files.
22464 2003-04-17 Miguel de Icaza <miguel@ximian.com>
22466 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
22467 class/struct location definition Location for the implicit
22468 constructor location.
22470 (Operator.Define): Use the location of the operator for the
22471 implicit Method definition.
22473 (Constructor.Emit): use the constructor location for the implicit
22474 base initializer constructor.
22476 * ecore.cs: Remove ITypeExpression. This interface is now gone,
22477 and the Expression class now contains two new methods:
22479 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
22480 isolate type lookup from the rest of the resolution process.
22482 Since we use Expressions to hold type definitions due to the way
22483 we parse the input we have historically overloaded Resolve to
22484 perform the Type lookups if a special flag is passed. Now this is
22485 eliminated and two methods take their place.
22487 The differences in the two methods between xStep and xTerminal is
22488 that xStep is involved in our current lookup system that uses
22489 SimpleNames to compose a name, while xTerminal is used just to
22490 catch the case where the simplename lookup failed.
22492 2003-04-16 Miguel de Icaza <miguel@ximian.com>
22494 * expression.cs (ResolveMemberAccess): Remove redundant code.
22495 TypeExpr expressions are always born fully resolved.
22497 * interface.cs (PopulateMethod): Do not lookup the types twice.
22498 We were doing it once during SemanticAnalysis and once during
22501 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
22502 in local variable type definitions, were being returned as a
22503 SimpleName (we decomposed everything into a string), that is
22504 because primary_expression was being used instead of a type in the
22505 grammar (reduce/reduce conflicts).
22507 The part that was wrong is that we converted the expression into a
22508 string (an oversimplification in one hand, compounded with primary
22509 expressions doing string concatenation).
22515 Would return "A.B.C[]" as a SimpleName. This stopped things like
22516 using clauses from working on this particular context. And a type
22517 was being matched directly against "A.B.C[]".
22519 We now use the correct approach, and allow for ComposedCast to be
22520 part of the unary expression. So the "A.B.C []" become a composed
22521 cast of "A.B.C" (as a nested group of MemberAccess with a
22522 SimpleName at the end) plus the rank composition "[]".
22526 2003-04-10 Miguel de Icaza <miguel@ximian.com>
22528 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
22529 for the access level checking.
22531 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
22532 `TypeContainer container', because I kept getting confused when I
22533 was debugging this code.
22535 * expression.cs (Indexers): Instead of tracking getters/setters,
22536 we now track them in parallel. We create one arraylist less, but
22537 most importantly it is possible now for the LValue code to find a
22538 matching get for a set.
22540 (IndexerAccess.DoResolveLValue): Update the code.
22541 GetIndexersForType has been modified already to extract all the
22542 indexers from a type. The code assumed it did not.
22544 Also make the code set the correct return type for the indexer.
22545 This was fixed a long time ago for properties, but was missing for
22546 indexers. It used to be void_type.
22548 (Binary.Emit): Test first for doubles instead of
22549 floats, as they are more common.
22551 (Binary.EmitBranchable): Use the .un version of the branch opcodes
22552 when dealing with floats and the <=, >= operators. This fixes bug
22555 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
22556 to load the array value by emitting a load on the foreach variable
22557 type. This was incorrect.
22559 We now emit the code to load an element using the the array
22560 variable type, and then we emit the conversion operator.
22564 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
22566 * attribute.cs: Avoid allocation of ArrayLists in the common case.
22568 2003-04-09 Miguel de Icaza <miguel@ximian.com>
22570 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
22571 test for protection before we test for signatures.
22573 (MethodSignature.ToString): implement.
22575 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
22576 to the case where we reduced into a LongConstant.
22578 * decl.cs (CheckAccessLevel): If the type is an array, we can not
22579 depend on whether the information is acurrate, because the
22580 Microsoft runtime will always claim that the array type is public,
22581 regardless of the real state.
22583 If the type is a pointer, another problem happens: the type is
22584 reported as non-public in Microsoft.
22586 In both cases we have to call CheckAccessLevel recursively with
22587 the underlying type as the argument to be tested.
22589 2003-04-08 Miguel de Icaza <miguel@ximian.com>
22591 * assign.cs (Assign.Emit): If we are dealing with a compound
22592 assignment expression, we should use the code path that stores the
22593 intermediate result in a temporary value. This fixes #40903.
22595 *expression.cs (Indirection.ToString): Provide ToString method for
22598 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
22600 * class.cs: Null out fields holding references to Block objects so
22601 they can be garbage collected.
22603 * expression.cs (OverloadResolve): Remove unused local.
22605 2003-04-07 Martin Baulig <martin@ximian.com>
22607 * codegen.cs (EmitContext.CurrentFile): New public field.
22608 (EmitContext.Mark): Use the CurrentFile to check whether the
22609 location is in the correct file.
22610 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
22612 2003-04-07 Martin Baulig <martin@ximian.com>
22614 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
22616 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
22617 location. [FIXME: The location argument which gets passed to this
22618 method is sometimes wrong!]
22620 2003-04-07 Nick Drochak <ndrochak@gol.com>
22622 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
22624 2003-04-07 Miguel de Icaza <miguel@ximian.com>
22626 * expression.cs (Indirection.EmitAssign): We were using the
22627 temporary, but returning immediately instead of continuing the
22630 2003-04-06 Martin Baulig <martin@ximian.com>
22632 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
22633 if it's a nested child, but also deriving from the outer class.
22636 * typemanager.cs (IsNestedChildOf): Make this work if it's a
22637 nested child, but also deriving from the outer class. See
22639 (FilterWithClosure): We may access private members of the outer
22640 class if we're a nested child and deriving from the outer class.
22641 (RealMemberLookup): Only set `closure_private_ok' if the
22642 `original_bf' contained BindingFlags.NonPublic.
22644 2003-04-05 Martin Baulig <martin@ximian.com>
22646 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
22648 2003-04-02 Miguel de Icaza <miguel@ximian.com>
22650 * class.cs (Event.Define): Do not allow abstract events to have
22653 2003-04-01 Miguel de Icaza <miguel@ximian.com>
22655 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
22656 block in event declarations.
22658 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
22659 value type, get its address.
22661 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
22662 leaving a class on the stack instead of a boolean value (int
22663 0/1). Change the code so we compare against null, and then the
22664 result against zero.
22666 * class.cs (TypeContainer.GetClassBases): We were checking for the
22667 parent class being sealed too late.
22669 * expression.cs (Binary.Emit): For <= and >= when dealing with
22670 floating point values, use cgt.un and clt.un instead of cgt and
22673 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
22675 * statement.cs: Apply the same optimization as MS: skip the
22676 GetEnumerator returning an IEnumerator, and use the one returning a
22677 CharEnumerator instead. This allows us to avoid the try-finally block
22680 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
22682 * cs-parser.jay: Attributes cannot be applied to
22683 namespaces. Fixes #40473
22685 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22688 (Add*): check if the name is valid using the full name for constants,
22689 fields, properties and events.
22691 2003-03-28 Miguel de Icaza <miguel@ximian.com>
22693 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
22694 char constants to be part of the enumeration.
22696 * expression.cs (Conditional.DoResolve): Add support for operator
22697 true. Implements the missing functionality from 14.12
22699 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
22700 operator true/false as required by the spec.
22702 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
22703 implicit conversion to boolean.
22705 * statement.cs (Statement.ResolveBoolean): A boolean expression is
22706 also one where the type implements `operator true'.
22708 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
22709 get an expression that will invoke operator true based on an
22712 (GetConversionOperators): Removed the hack that called op_True
22715 (Expression.ResolveBoolean): Move this from Statement.
22717 2003-03-17 Miguel de Icaza <miguel@ximian.com>
22719 * ecore.cs (FieldExpr): do not allow initialization of initonly
22720 fields on derived classes
22722 2003-03-13 Martin Baulig <martin@ximian.com>
22724 * statement.cs (Block.Emit): Call ig.BeginScope() and
22725 ig.EndScope() when compiling with debugging info; call
22726 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
22728 2003-03-08 Miguel de Icaza <miguel@ximian.com>
22730 * expression.cs (Indexers): Do not construct immediately, allow
22731 for new members to be appended as we go. Fixes 38143
22733 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22735 * expression.cs: save/restore context when resolving an unchecked
22738 2003-03-05 Miguel de Icaza <miguel@ximian.com>
22740 * cfold.cs: Catch division by zero in modulus operator during
22743 2003-03-03 Miguel de Icaza <miguel@ximian.com>
22745 * interface.cs (Interface.DefineMembers): Avoid defining members
22748 2003-02-27 Miguel de Icaza <miguel@ximian.com>
22750 * driver.cs: handle the +/- options for -noconfig
22752 * statement.cs (Unckeched.Resolve): Also track the state of
22753 unchecked in the Resolve phase.
22755 2003-02-27 Martin Baulig <martin@ximian.com>
22757 * ecore.cs (Expression.MemberLookup): Don't create a
22758 MethodGroupExpr for something which is not a method. Fixes #38291.
22760 2003-02-25 Miguel de Icaza <miguel@ximian.com>
22762 * class.cs (MemberBase.CheckParameters): Also check that the type
22763 is unmanaged if it is a pointer.
22765 * expression.cs (SizeOf.Resolve): Add location information.
22767 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
22768 a managed type is declared.
22770 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
22771 parameter modifiers as well. Fixes bug 38606
22773 * class.cs: Very sad. Am backing out the speed up changes
22774 introduced by the ArrayList -> Array in the TypeContainer, as they
22775 were not actually that much faster, and introduced a bug (no error
22776 reports on duplicated methods).
22778 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
22779 source first, this will guarantee that we have a valid expression
22780 before calling in lower levels functions that will require a
22781 resolved object. Then use this original_source in the
22782 target.ResolveLValue instead of the original source that was
22785 Another change. Use target.Resolve instead of LValueResolve.
22786 Although we are resolving for LValues, we will let the Assign code
22787 take care of that (it will be called again from Resolve). This
22788 basically allows code like this:
22790 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
22791 class Y { void A (X x) { x [0] += o; }
22793 The problem was that the indexer was trying to resolve for
22794 set_Item (idx, object o) and never finding one. The real set_Item
22795 was set_Item (idx, X). By delaying the process we get the right
22800 2003-02-23 Martin Baulig <martin@ximian.com>
22802 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
22803 while calling DoEmit ().
22805 * codegen.cs (EmitContext.Mark): Don't mark locations in other
22806 source files; if you use the #line directive inside a method, the
22807 compiler stops emitting line numbers for the debugger until it
22808 reaches the end of the method or another #line directive which
22809 restores the original file.
22811 2003-02-23 Martin Baulig <martin@ximian.com>
22813 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
22815 2003-02-23 Martin Baulig <martin@ximian.com>
22817 * statement.cs (Block.AddChildVariableNames): We need to call this
22818 recursively, not just for our immediate children.
22820 2003-02-23 Martin Baulig <martin@ximian.com>
22822 * class.cs (Event.Define): Always make the field private, like csc does.
22824 * typemanager.cs (TypeManager.RealMemberLookup): Make events
22825 actually work, fixes bug #37521.
22827 2003-02-23 Miguel de Icaza <miguel@ximian.com>
22829 * delegate.cs: When creating the various temporary "Parameters"
22830 classes, make sure that we call the ComputeAndDefineParameterTypes
22831 on those new parameters (just like we do with the formal ones), to
22832 allow them to be resolved in the context of the DeclSpace.
22834 This fixes the bug that Dick observed in Bugzilla #38530.
22836 2003-02-22 Miguel de Icaza <miguel@ximian.com>
22838 * expression.cs (ResolveMemberAccess): When resolving a constant,
22839 do not attempt to pull a constant if the value was not able to
22840 generate a valid constant.
22842 * const.cs (LookupConstantValue): Do not report more errors than required.
22844 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22846 * expression.cs: fixes bug #38328.
22848 2003-02-18 Miguel de Icaza <miguel@ximian.com>
22850 * class.cs: Changed all the various members that can be part of a
22851 class from being an ArrayList to be an Array of the right type.
22852 During the DefineType type_list, interface_list, delegate_list and
22853 enum_list are turned into types, interfaces, delegates and enums
22856 And during the member population, indexer_list, event_list,
22857 constant_list, field_list, instance_constructor_list, method_list,
22858 operator_list and property_list are turned into their real arrays.
22860 Although we could probably perform this operation earlier, for
22861 good error reporting we need to keep the lists and remove the
22862 lists for longer than required.
22864 This optimization was triggered by Paolo profiling the compiler
22865 speed on the output of `gen-sample-program.pl' perl script.
22867 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
22868 not crash in methods like MemberLookupFailed that use this field.
22870 This problem arises when the compiler fails to resolve a type
22871 during interface type definition for example.
22873 2003-02-18 Miguel de Icaza <miguel@ximian.com>
22875 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
22876 inherit from System.Object, so we have to stop at null, not only
22877 when reaching System.Object.
22879 2003-02-17 Miguel de Icaza <miguel@ximian.com>
22881 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
22882 DeclaredOnly because the parent indexer might have had a different
22883 name, but did not loop until the top of the hierarchy was reached.
22885 The problem this one fixes is 35492: when a class implemented an
22886 indexer from an interface, we were getting the interface method
22887 (which was abstract) and we were flagging an error (can not invoke
22890 This also keeps bug 33089 functioning, and test-148 functioning.
22892 * typemanager.cs (IsSpecialMethod): The correct way of figuring
22893 out if a method is special is to see if it is declared in a
22894 property or event, or whether it is one of the predefined operator
22895 names. This should fix correctly #36804.
22897 2003-02-15 Miguel de Icaza <miguel@ximian.com>
22899 The goal here is to remove the dependency on EmptyCast.Peel ().
22900 Killing it completely.
22902 The problem is that currently in a number of places where
22903 constants are expected, we have to "probe" for an EmptyCast, and
22904 Peel, which is not the correct thing to do, as this will be
22905 repetitive and will likely lead to errors.
22907 The idea is to remove any EmptyCasts that are used in casts that
22908 can be reduced to constants, so we only have to cope with
22911 This bug hunt was triggered by Bug 37363 and the desire to remove
22912 the duplicate pattern where we were "peeling" emptycasts to check
22913 whether they were constants. Now constants will always be
22916 * ecore.cs: Use an enumconstant here instead of wrapping with
22919 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
22920 throwing me off. By handling this we can get rid of a few hacks.
22922 * statement.cs (Switch): Removed Peel() code.
22924 2003-02-14 Miguel de Icaza <miguel@ximian.com>
22926 * class.cs: Location information for error 508
22928 * expression.cs (New.DoResolve): Add a guard against double
22929 resolution of an expression.
22931 The New DoResolve might be called twice when initializing field
22932 expressions (see EmitFieldInitializers, the call to
22933 GetInitializerExpression will perform a resolve on the expression,
22934 and later the assign will trigger another resolution
22936 This leads to bugs (#37014)
22938 * delegate.cs: The signature for EndInvoke should contain any ref
22939 or out parameters as well. We were not doing this in the past.
22941 * class.cs (Field.Define): Do not overwrite the type definition
22942 inside the `volatile' group. Turns out that volatile enumerations
22943 were changing the type here to perform a validity test, which
22946 2003-02-12 Miguel de Icaza <miguel@ximian.com>
22948 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
22949 and structs, we do not want to load the instance variable
22951 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
22952 enum_type has to be handled like an object reference (implicit
22953 conversions exists from this to object), but the regular IsClass
22954 and IsValueType tests will never return true for this one.
22956 Also we use TypeManager.IsValueType instead of type.IsValueType,
22957 just for consistency with the rest of the code (this is only
22958 needed if we ever use the construct exposed by test-180.cs inside
22959 corlib, which we dont today).
22961 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
22963 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
22966 2003-02-09 Martin Baulig <martin@ximian.com>
22968 * namespace.cs (Namespace..ctor): Added SourceFile argument.
22969 (Namespace.DefineNamespaces): New static public method; this is
22970 called when we're compiling with debugging to add all namespaces
22971 to the symbol file.
22973 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
22974 pass it to the Namespace's .ctor.
22976 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
22977 and MethodBase arguments; pass the namespace ID to the symwriter;
22978 pass the MethodBase instead of the token to the symwriter.
22979 (SymbolWriter.DefineNamespace): New method to add a namespace to
22982 2003-02-09 Martin Baulig <martin@ximian.com>
22984 * symbolwriter.cs: New file. This is a wrapper around
22985 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
22986 methods here in near future.
22988 2003-02-09 Martin Baulig <martin@ximian.com>
22990 * codegen.cs (EmitContext.Mark): Just pass the arguments to
22991 ILGenerator.MarkSequencePoint() which are actually used by the
22994 2003-02-09 Martin Baulig <martin@ximian.com>
22996 * location.cs (SourceFile): New public sealed class. This
22997 contains the name and an index which is used in the location's token.
22998 (Location): Reserve an appropriate number of bits in the token for
22999 the source file instead of walking over that list, this gives us a
23000 really huge performance improvement when compiling with debugging.
23002 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
23003 `SourceFile' argument instead of a string.
23004 (Driver.ProcessFile): Add all the files via Location.AddFile(),
23005 but don't parse/tokenize here, we need to generate the list of all
23006 source files before we do that.
23007 (Driver.ProcessFiles): New static function. Parses/tokenizes all
23010 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
23011 instead of a string.
23013 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
23016 2003-02-09 Martin Baulig <martin@ximian.com>
23018 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
23019 filename on `#line default'.
23021 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
23023 * statement.cs: don't clear the pinned var when the fixed statement
23024 returns from the method (fixes bug#37752).
23026 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
23028 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
23031 2003-02-07 Martin Baulig <martin@ximian.com>
23033 * driver.cs: Removed the `--debug-args' command line argument.
23035 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
23036 automatically by the AsssemblyBuilder.
23037 (CodeGen.InitializeSymbolWriter): We don't need to call any
23038 initialization function on the symbol writer anymore. This method
23039 doesn't take any arguments.
23041 2003-02-03 Miguel de Icaza <miguel@ximian.com>
23043 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
23044 from referenced assemblies as well.
23046 2003-02-02 Martin Baulig <martin@ximian.com>
23048 * class.cs (MethodData.Emit): Generate debugging info for external methods.
23050 2003-02-02 Martin Baulig <martin@ximian.com>
23052 * class.cs (Constructor.Emit): Open the symbol writer before
23053 emitting the constructor initializer.
23054 (ConstructorInitializer.Emit): Call ec.Mark() to allow
23055 single-stepping through constructor initializers.
23057 2003-01-30 Miguel de Icaza <miguel@ximian.com>
23059 * class.cs: Handle error 549: do not allow virtual methods in
23062 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
23064 * decl.cs: Check access levels when resolving types
23066 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
23068 * statement.cs: Add parameters and locals set in catch blocks that might
23069 return to set vector
23071 2003-01-29 Miguel de Icaza <miguel@ximian.com>
23073 * class.cs (Operator): Set the SpecialName flags for operators.
23075 * expression.cs (Invocation.DoResolve): Only block calls to
23076 accessors and operators on SpecialName methods.
23078 (Cast.TryReduce): Handle conversions from char constants.
23081 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
23083 * statement.cs: small memory and time optimization in FlowBranching.
23085 2003-01-28 Pedro Mart <yoros@wanadoo.es>
23087 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
23088 problem that the last fix but in the other sid (Set).
23090 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
23091 access when there is no indexer in the hierarchy.
23093 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
23095 * class.cs: Combine some if statements.
23097 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23099 * driver.cs: fixed bug #37187.
23101 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
23103 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
23104 any indexer, it's needed to build a list with all the indexers in the
23105 hierarchy (AllGetters), else we have problems. Fixes #35653.
23107 2003-01-23 Miguel de Icaza <miguel@ximian.com>
23109 * class.cs (MethodData.Define): It is wrong for an interface
23110 implementation to be static in both cases: explicit and implicit.
23111 We were only handling this in one case.
23113 Improve the if situation there to not have negations.
23115 * class.cs (Field.Define): Turns out that we do not need to check
23116 the unsafe bit on field definition, only on usage. Remove the test.
23118 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23120 * driver.cs: use assembly.Location instead of Codebase (the latest
23121 patch made mcs fail when using MS assemblies).
23123 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
23125 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
23126 get the path to *corlib.dll.
23128 2003-01-21 Nick Drochak <ndrochak@gol.com>
23132 * typemanager.cs: Remove compiler warnings
23134 2003-01-20 Duncan Mak <duncan@ximian.com>
23136 * AssemblyInfo.cs: Bump the version number to 0.19.
23138 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23140 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
23142 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
23144 * class.cs (Constructor::Emit): Emit debugging info for constructors.
23146 2003-01-17 Miguel de Icaza <miguel@ximian.com>
23148 * cs-parser.jay: Small fix: we were not comparing the constructor
23149 name correctly. Thanks to Zoltan for the initial pointer.
23151 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
23153 * cs-tokenizer.cs: Set file name when specified with #line
23155 2003-01-15 Miguel de Icaza <miguel@ximian.com>
23157 * cs-parser.jay: Only perform the constructor checks here if we
23158 are named like the class; This will help provider a better
23159 error. The constructor path is taken when a type definition is
23160 not found, but most likely the user forgot to add the type, so
23161 report that rather than the constructor error.
23163 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
23165 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
23168 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23170 * cs-parser.jay: Add cleanup call.
23172 2003-01-13 Duncan Mak <duncan@ximian.com>
23174 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
23175 consistent with other methods.
23177 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23179 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
23181 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
23183 * attribute.cs: only set GuidAttr to true when we have a
23186 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23190 * typemanager.cs: fixes to allow mcs compile corlib with the new
23191 Type.IsSubclassOf fix.
23193 2003-01-08 Miguel de Icaza <miguel@ximian.com>
23195 * expression.cs (LocalVariableReference.DoResolve): Classify a
23196 constant as a value, not as a variable. Also, set the type for
23199 * cs-parser.jay (fixed_statement): take a type instead of a
23200 pointer_type, so we can produce a better error message later.
23202 * statement.cs (Fixed.Resolve): Flag types that are not pointers
23205 (For.DoEmit): Make inifinite loops have a
23206 non-conditional branch back.
23208 (Fixed.DoEmit): First populate the pinned variables, then emit the
23209 statement, then clear the variables. Before I was emitting the
23210 code once for each fixed piece.
23213 2003-01-08 Martin Baulig <martin@ximian.com>
23215 * statement.cs (FlowBranching.MergeChild): A break in a
23216 SWITCH_SECTION does not leave a loop. Fixes #36155.
23218 2003-01-08 Martin Baulig <martin@ximian.com>
23220 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
23221 lives in the same number space than `param_map'. Fixes #36154.
23223 2003-01-07 Miguel de Icaza <miguel@ximian.com>
23225 * cs-parser.jay (constructor_declaration): Set the
23226 Constructor.ModFlags before probing for it. This makes the
23227 compiler report 514, 515 and 132 (the code was there, but got
23230 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
23231 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
23232 (GotoCase.Resolve): Set `Returns' to ALWAYS.
23234 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
23236 * enum.cs: create the enum static fields using the enum type.
23238 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
23240 * class.cs: don't try to create the ParamBuilder for the return
23241 type if it's not needed (and handle it breaking for the ms runtime
23244 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
23246 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
23248 2002-12-29 Miguel de Icaza <miguel@ximian.com>
23250 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
23251 the command. This showed up while compiling the JANET source
23252 code, which used \r as its only newline separator.
23254 2002-12-28 Miguel de Icaza <miguel@ximian.com>
23256 * class.cs (Method.Define): If we are an operator (because it
23257 reuses our code), then set the SpecialName and HideBySig. #36128
23259 2002-12-22 Miguel de Icaza <miguel@ximian.com>
23261 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
23262 exception, report error 120 `object reference required'.
23264 * driver.cs: Add --pause option, used during to measure the size
23265 of the process as it goes with --timestamp.
23267 * expression.cs (Invocation.DoResolve): Do not allow methods with
23268 SpecialName to be invoked.
23270 2002-12-21 Miguel de Icaza <miguel@ximian.com>
23272 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
23273 number before adding it.
23275 2002-12-21 Ravi Pratap <ravi@ximian.com>
23277 * ecore.cs (StandardImplicitConversion): When in an unsafe
23278 context, we allow conversion between void * to any other pointer
23279 type. This fixes bug #35973.
23281 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
23283 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
23284 is not thrown when extensionless outputs are used
23286 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23288 * rootcontext.cs: fixed compilation of corlib.
23290 2002-12-19 Miguel de Icaza <miguel@ximian.com>
23292 * attribute.cs (Attributes.Contains): Add new method.
23294 * class.cs (MethodCore.LabelParameters): if the parameter is an
23295 `out' parameter, check that no attribute `[In]' has been passed.
23297 * enum.cs: Handle the `value__' name in an enumeration.
23299 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
23301 * decl.cs: Added special case to allow overrides on "protected
23304 2002-12-18 Ravi Pratap <ravi@ximian.com>
23306 * attribute.cs (Attributes.AddAttributeSection): Rename to this
23307 since it makes much more sense.
23309 (Attributes.ctor): Don't require a Location parameter.
23311 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
23313 * attribute.cs (ApplyAttributes): Remove extra Location parameters
23314 since we already have that information per attribute.
23316 * everywhere : make appropriate changes.
23318 * class.cs (LabelParameters): Write the code which actually
23319 applies attributes to the return type. We can't do this on the MS
23320 .NET runtime so we flag a warning in the case an exception is
23323 2002-12-18 Miguel de Icaza <miguel@ximian.com>
23325 * const.cs: Handle implicit null conversions here too.
23327 2002-12-17 Ravi Pratap <ravi@ximian.com>
23329 * class.cs (MethodCore.LabelParameters): Remove the extra
23330 Type [] parameter since it is completely unnecessary. Instead
23331 pass in the method's attributes so that we can extract
23332 the "return" attribute.
23334 2002-12-17 Miguel de Icaza <miguel@ximian.com>
23336 * cs-parser.jay (parse): Use Report.Error to flag errors instead
23337 of ignoring it and letting the compile continue.
23339 * typemanager.cs (ChangeType): use an extra argument to return an
23340 error condition instead of throwing an exception.
23342 2002-12-15 Miguel de Icaza <miguel@ximian.com>
23344 * expression.cs (Unary.TryReduce): mimic the code for the regular
23345 code path. Perform an implicit cast in the cases where we can
23346 implicitly convert to one of the integral types, and then reduce
23347 based on that constant. This fixes bug #35483.
23349 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23351 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
23353 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23355 * namespace.cs: fixed bug #35489.
23357 2002-12-12 Miguel de Icaza <miguel@ximian.com>
23359 * class.cs: Remove some dead code.
23361 * cs-parser.jay: Estimate the number of methods needed
23362 (RootContext.MethodCount);
23364 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
23365 numbers instead of StringBuilders.
23367 * support.cs (PtrHashtable): Add constructor with initial size;
23368 We can now reduce reallocations of the method table.
23370 2002-12-10 Ravi Pratap <ravi@ximian.com>
23372 * attribute.cs (ApplyAttributes): Keep track of the emitted
23373 attributes on a per-target basis. This fixes bug #35413.
23375 2002-12-10 Miguel de Icaza <miguel@ximian.com>
23377 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
23378 default to the Windows 1252 encoding.
23380 (UnixParseOption): Support version, thanks to Alp for the missing
23383 * AssemblyInfo.cs: Add nice assembly information.
23385 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
23388 * cs-parser.jay: Allow a trailing comma before the close bracked
23389 in the attribute_section production.
23391 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
23392 address of the instance was being taken, I will take this out,
23393 because we take the address of the object immediately here.
23395 2002-12-09 Ravi Pratap <ravi@ximian.com>
23397 * typemanager.cs (AreMultipleAllowed): Take care of the most
23398 obvious case where attribute type is not in the current assembly -
23401 2002-12-08 Miguel de Icaza <miguel@ximian.com>
23403 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
23404 definitions, instead of doing that afterwards.
23406 Also we use a nice little hack, depending on the constructor, we
23407 know if we are a "composed" name or a simple name. Hence, we
23408 avoid the IndexOf test, and we avoid
23410 * codegen.cs: Add code to assist in a bug reporter to track down
23411 the source of a compiler crash.
23413 2002-12-07 Ravi Pratap <ravi@ximian.com>
23415 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
23416 types have been emitted for a given element and flag an error
23417 if something which does not have AllowMultiple set is used more
23420 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
23421 attribute types and their corresponding AllowMultiple properties
23423 (AreMultipleAllowed): Check the property for a given type.
23425 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
23426 property in the case we have a TypeContainer.
23428 (Attributes.AddAttribute): Detect duplicates and just skip on
23429 adding them. This trivial fix catches a pretty gross error in our
23430 attribute emission - global attributes were being emitted twice!
23432 Bugzilla bug #33187 is now fixed.
23434 2002-12-06 Miguel de Icaza <miguel@ximian.com>
23436 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
23437 instead of pp_and).
23439 * expression.cs (Binary.ResolveOperator): I can only use the
23440 Concat (string, string, string) and Concat (string, string,
23441 string, string) if the child is actually a concatenation of
23444 2002-12-04 Miguel de Icaza <miguel@ximian.com>
23446 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
23447 context where we need a 2-character lookahead.
23449 * pending.cs (PendingImplementation): Rework so we can keep track
23450 of interface types all the time, and flag those which were
23451 implemented by parents as optional.
23453 2002-12-03 Miguel de Icaza <miguel@ximian.com>
23455 * expression.cs (Binary.ResolveOperator): Use
23456 String.Concat(string,string,string) or
23457 String.Concat(string,string,string,string) when possible.
23459 * typemanager: More helper methods.
23462 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
23464 * pending.cs: remove the bogus return from GetMissingInterfaces()
23465 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
23467 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23469 * namespace.cs: avoid duplicated 'using xxx' being added to
23470 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
23471 when we get more than one 'using' statement for the same namespace.
23472 Report a CS0105 warning for it.
23474 2002-11-30 Miguel de Icaza <miguel@ximian.com>
23476 * cs-tokenizer.cs (consume_identifier): use read directly, instead
23477 of calling getChar/putback, uses internal knowledge of it.
23479 (xtoken): Reorder tokenizer so most common patterns are checked
23480 first. This reduces the compilation time in another 5% (from 8.11s
23481 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
23483 The parsing time is 22% of the compilation in mcs, and from that
23484 64% is spent on the tokenization process.
23486 I tried using a binary search for keywords, but this is slower
23487 than the hashtable. Another option would be to do a couple of
23490 * Not use a StringBuilder, instead use an array of chars,
23491 with a set value. Notice that this way we could catch
23492 the 645 error without having to do it *afterwards*.
23494 * We could write a hand-parser to avoid the hashtable
23495 compares altogether.
23497 The identifier consumption process takes 37% of the tokenization
23498 time. Another 15% is spent on is_number. 56% of the time spent
23499 on is_number is spent on Int64.Parse:
23501 * We could probably choose based on the string length to
23502 use Int32.Parse or Int64.Parse and avoid all the 64-bit
23505 Another 3% is spend on wrapping `xtoken' in the `token' function.
23507 Handle 0xa0 as whitespace (#34752)
23509 2002-11-26 Miguel de Icaza <miguel@ximian.com>
23511 * typemanager.cs (IsCLRType): New routine to tell whether a type
23512 is one of the builtin types.
23514 Maybe it needs to use TypeCodes to be faster. Maybe we could use
23515 typecode in more places instead of doing pointer comparissions.
23516 We could leverage some knowledge about the way the typecodes are
23519 New code to cache namespaces in assemblies, it is currently not
23520 invoked, to be used soon.
23522 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
23524 * expression.cs (Binary.ResolveOperator): specially handle
23525 strings, and do not perform user-defined operator overloading for
23528 2002-11-24 Miguel de Icaza <miguel@ximian.com>
23530 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
23531 internalcall as it is a pretty simple operation; Avoid whenever
23532 possible to call Char.IsLetter.
23534 (consume_identifier): Cut by half the number of
23535 hashtable calls by merging the is_keyword and GetKeyword behavior.
23537 Do not short-circuit, because if we do, we
23538 report errors (ie, #if false && true would produce an invalid
23542 2002-11-24 Martin Baulig <martin@ximian.com>
23544 * expression.cs (Cast.TryReduce): If we're in checked syntax,
23545 check constant ranges and report a CS0221. Fixes #33186.
23547 2002-11-24 Martin Baulig <martin@ximian.com>
23549 * cs-parser.jay: Make this work for uninitialized variable
23550 declarations in the `for' initializer. Fixes #32416.
23552 2002-11-24 Martin Baulig <martin@ximian.com>
23554 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
23555 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
23557 2002-11-24 Martin Baulig <martin@ximian.com>
23559 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
23560 argument; if true, we also check for user-defined conversions.
23561 This is only needed if both arguments are of a user-defined type.
23562 Fixes #30443, added test-175.cs.
23563 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
23565 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
23567 2002-11-24 Martin Baulig <martin@ximian.com>
23569 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
23570 function to get the store opcode.
23571 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
23572 only emit the Ldelema if the store opcode is Stobj. You must run
23573 both test-34 and test-167 to test this. Fixes #34529.
23575 2002-11-23 Martin Baulig <martin@ximian.com>
23577 * ecore.cs (Expression.MemberLookup): Added additional
23578 `qualifier_type' argument which is used when we're being called
23579 from MemberAccess.DoResolve() and null if we're called from a
23581 (Expression.MemberLookupFailed): New method to report errors; this
23582 does the CS1540 check and reports the correct error message.
23584 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
23585 argument for the CS1540 check and redone the way how we're dealing
23586 with private members. See the comment in the source code for details.
23587 (FilterWithClosure): Reverted this back to revision 1.197; renamed
23588 `closure_start_type' to `closure_qualifier_type' and check whether
23589 it's not null. It was not this filter being broken, it was just
23590 being called with the wrong arguments.
23592 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
23593 and pass it the correct `qualifier_type'; this also does the error
23596 2002-11-22 Miguel de Icaza <miguel@ximian.com>
23598 * expression.cs (Invocation.EmitParams): If the we are dealing
23599 with a non-built-in value type, load its address as well.
23601 (ArrayCreation): Use a a pretty constant instead
23602 of the hardcoded value 2. Use 6 instead of 2 for the number of
23603 static initializers.
23605 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
23606 because they are not really value types, just glorified integers.
23608 * driver.cs: Do not append .exe, the CSC compiler does not do it.
23610 * ecore.cs: Remove redundant code for enumerations, make them use
23611 the same code path as everything else, fixes the casting issue
23612 with enumerations in Windows.Forms.
23614 * attribute.cs: Do only cast to string if it is a string, the
23615 validation happens later.
23617 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
23618 people upgrade their corlibs.
23620 * ecore.cs: Oops, enumerations were not following the entire code path
23622 2002-11-21 Miguel de Icaza <miguel@ximian.com>
23624 * typemanager.cs (FilterWithClosure): Commented out the test for
23625 1540 in typemanager.cs, as it has problems when accessing
23626 protected methods from a parent class (see test-174.cs).
23628 * attribute.cs (Attribute.ValidateGuid): new method.
23629 (Attribute.Resolve): Use above.
23631 2002-11-19 Miguel de Icaza <miguel@ximian.com>
23633 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
23635 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
23636 handling for enumerations, as we only needed the TypeContainer
23637 functionality to begin with (this is required for the fix below to
23638 work for enums that reference constants in a container class for
23641 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
23643 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
23644 a valid TypeBuilder to perform lookups on.o
23646 * class.cs (InheritableMemberSignatureCompare): Use true in the
23647 call to GetGetMethod and GetSetMethod, because we are comparing
23648 the signature, and we need to get the methods *even* if they are
23651 (PropertyBase.CheckBase): ditto.
23653 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
23654 GotoCase.Resolve): Use Peel on EmpytCasts.
23656 * ecore.cs (EmptyCast): drop child, add Peel method.
23658 2002-11-17 Martin Baulig <martin@ximian.com>
23660 * ecore.cs (EmptyCast.Child): New public property.
23662 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
23663 label resolved to an EmptyCast. Fixes #34162.
23664 (GotoCase.Resolve): Likewise.
23665 (Block.EmitMeta): Likewise.
23667 2002-11-17 Martin Baulig <martin@ximian.com>
23669 * expression.cs (Invocation.BetterConversion): Prefer int over
23670 uint; short over ushort; long over ulong for integer literals.
23671 Use ImplicitConversionExists instead of StandardConversionExists
23672 since we also need to check for user-defined implicit conversions.
23673 Fixes #34165. Added test-173.cs.
23675 2002-11-16 Martin Baulig <martin@ximian.com>
23677 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
23678 with the `true' and `false' literals. Fixes #33151.
23680 2002-11-16 Martin Baulig <martin@ximian.com>
23682 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
23683 October 22nd; don't do the cs1540 check for static members.
23685 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
23686 now using our own filter here and doing the cs1540 check again.
23688 2002-11-16 Martin Baulig <martin@ximian.com>
23690 * support.cs (InternalParameters): Don't crash if we don't have
23691 any fixed parameters. Fixes #33532.
23693 2002-11-16 Martin Baulig <martin@ximian.com>
23695 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
23696 when looking up static methods to make this work on Windows.
23699 2002-11-16 Martin Baulig <martin@ximian.com>
23701 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
23702 a setter rather than using PropertyInfo.CanWrite.
23704 2002-11-15 Nick Drochak <ndrochak@gol.com>
23706 * class.cs: Allow acces to block member by subclasses. Fixes build
23709 2002-11-14 Martin Baulig <martin@ximian.com>
23711 * class.cs (Constructor.Emit): Added the extern/block check.
23714 2002-11-14 Martin Baulig <martin@ximian.com>
23716 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
23717 iteration while looking for indexers, this is needed because the
23718 indexer may have a different name in our base classes. Fixed the
23719 error reporting (no indexers at all, not get accessor, no
23720 overloaded match). Fixes bug #33089.
23721 (IndexerAccess.DoResolveLValue): Likewise.
23723 2002-11-14 Martin Baulig <martin@ximian.com>
23725 * class.cs (PropertyBase.CheckBase): Make this work for multiple
23726 indexers. Fixes the first part of bug #33089.
23727 (MethodSignature.InheritableMemberSignatureCompare): Added support
23730 2002-11-13 Ravi Pratap <ravi@ximian.com>
23732 * attribute.cs (Attribute.Resolve): Catch the
23733 NullReferenceException and report it since it isn't supposed to
23736 2002-11-12 Miguel de Icaza <miguel@ximian.com>
23738 * expression.cs (Binary.EmitBranchable): Also handle the cases for
23739 LogicalOr and LogicalAnd that can benefit from recursively
23740 handling EmitBranchable. The code now should be nice for Paolo.
23742 2002-11-08 Miguel de Icaza <miguel@ximian.com>
23744 * typemanager.cs (LookupType): Added a negative-hit hashtable for
23745 the Type lookups, as we perform quite a number of lookups on
23746 non-Types. This can be removed once we can deterministically tell
23747 whether we have a type or a namespace in advance.
23749 But this might require special hacks from our corlib.
23753 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
23754 and double which avoids a conversion from an integer to a double.
23756 * expression.cs: tiny optimization, avoid calling IsConstant,
23757 because it effectively performs the lookup twice.
23759 2002-11-06 Miguel de Icaza <miguel@ximian.com>
23761 But a bogus return here to keep the semantics of the old code
23762 until the Mono runtime is fixed.
23764 * pending.cs (GetMissingInterfaces): New method used to remove all
23765 the interfaces that are already implemented by our parent
23766 classes from the list of pending methods.
23768 * interface.cs: Add checks for calls after ResolveTypeExpr.
23770 2002-11-05 Miguel de Icaza <miguel@ximian.com>
23772 * class.cs (Class.Emit): Report warning 67: event not used if the
23773 warning level is beyond 3.
23775 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
23776 being a NullLiteral.
23778 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
23781 * class.cs (TypeContainer.GetClassBases): Cover a missing code
23782 path that might fail if a type can not be resolved.
23784 * expression.cs (Binary.Emit): Emit unsigned versions of the
23787 * driver.cs: use error 5.
23789 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
23791 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
23793 2002-11-01 Miguel de Icaza <miguel@ximian.com>
23795 * cs-parser.jay (switch_section): A beautiful patch from Martin
23796 Baulig that fixed 33094.
23798 2002-10-31 Miguel de Icaza <miguel@ximian.com>
23800 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
23801 Check whether the base is abstract and report an error if so.
23803 * expression.cs (IndexerAccess.DoResolveLValue,
23804 IndexerAccess.DoResolve): ditto.
23806 (Invocation.DoResolve): ditto.
23808 (Invocation.FullMethodDesc): Improve the report string.
23810 * statement.cs (Block): Eliminate IsVariableDefined as it is
23811 basically just a wrapper for GetVariableInfo.
23813 * ecore.cs (SimpleName): Use new
23815 * support.cs (ReflectionParamter.ParameterType): We unwrap the
23816 type, as we return the actual parameter ref/unref state on a
23819 2002-10-30 Miguel de Icaza <miguel@ximian.com>
23821 * support.cs: Return proper flags REF/OUT fixing the previous
23824 * expression.cs: Reverted last patch, that was wrong. Is_ref is
23825 not used to mean `ref' but `ref or out' in ParameterReference
23827 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
23828 full type signature instead of calling TypeManger.CSharpName
23831 * support.cs (InternalParameters.ParameterDesc): Do not compare
23832 directly to the modflags, because REF/OUT will actually be bitsets
23835 * delegate.cs (VerifyMethod): Check also the modifiers.
23837 * cs-tokenizer.cs: Fix bug where floating point values with an
23838 exponent where a sign was missing was ignored.
23840 * driver.cs: Allow multiple assemblies to be specified in a single
23843 2002-10-28 Miguel de Icaza <miguel@ximian.com>
23845 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
23846 because identifiers after a parenthesis would end up in this kind
23847 of production, and we needed to desamiguate it for having casts
23850 (UserDefinedType *) xxx
23852 2002-10-24 Miguel de Icaza <miguel@ximian.com>
23854 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
23855 we should set on the Bindingflags.NonPublic, but not turn on
23856 private_ok. private_ok controls whether a Private member is
23857 returned (this is chekced on the filter routine), while the
23858 BindingFlags.NonPublic just controls whether private/protected
23859 will be allowed. This fixes the problem part of the problem of
23860 private properties being allowed to be used in derived classes.
23862 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
23863 so we can call the children DoResolveLValue method (this will
23864 properly signal errors on lvalue assignments to base properties)
23866 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
23867 getter are null, and we have a property info, we know that this
23868 happened because the lookup failed, so we report an error 122 for
23869 protection level violation.
23871 We also silently return if setter and getter are null in the
23872 resolve functions, this condition only happens if we have flagged
23873 the error before. This is the other half of the problem.
23875 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
23876 not have accessibility information, that is why we were returning
23877 true in the filter function in typemanager.cs.
23879 To properly report 122 (property is inaccessible because of its
23880 protection level) correctly, we report this error in ResolveAccess
23881 by failing if both the setter and the getter are lacking (ie, the
23884 DoResolve and DoLResolve have been modified to check for both
23885 setter/getter being null and returning silently, the reason being
23886 that I did not want to put the knowledge about this error in upper
23889 int old = Report.Errors;
23890 x = new PropertyExpr (...);
23891 if (old != Report.Errors)
23896 So the property expr is returned, but it is invalid, so the error
23897 will be flagged during the resolve process.
23899 * class.cs: Remove InheritablePropertySignatureCompare from the
23900 class, as we no longer depend on the property signature to compute
23901 whether it is possible to implement a method or not.
23903 The reason is that calling PropertyInfo.GetGetMethod will return
23904 null (in .NET, in Mono it works, and we should change this), in
23905 cases where the Get Method does not exist in that particular
23910 class X { public virtual int A { get { return 1; } } }
23912 class Z : Y { public override int A { get { return 2; } } }
23914 Would fail in Z because the parent (Y) would not have the property
23915 defined. So we avoid this completely now (because the alternative
23916 fix was ugly and slow), and we now depend exclusively on the
23919 (PropertyBase.CheckBase): Use a method-base mechanism to find our
23920 reference method, instead of using the property.
23922 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
23923 routines are gone now.
23925 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
23926 names, they were incorrectly named.
23928 * cs-tokenizer.cs: Return are more gentle token on failure.
23930 * pending.cs (PendingImplementation.InterfaceMethod): This routine
23931 had an out-of-sync index variable, which caused it to remove from
23932 the list of pending methods the wrong method sometimes.
23934 2002-10-22 Miguel de Icaza <miguel@ximian.com>
23936 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
23937 CanWrite, because those refer to this particular instance of the
23938 property, and do not take into account the fact that we can
23939 override single members of a property.
23941 Constructor requires an EmitContext. The resolution process does
23942 not happen here, but we need to compute the accessors before,
23943 because the resolution does not always happen for properties.
23945 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
23946 subclass, before we did not update this flag, but we did update
23949 (GetAccessors): Drop this routine, as it did not work in the
23950 presence of partially overwritten set/get methods.
23952 Notice that this broke the cs1540 detection, but that will require
23955 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23959 * driver.cs: issue a warning instead of an error if we don't support
23960 debugging for the platform. Also ignore a couple of errors that may
23961 arise when trying to write the symbols. Undo my previous patch.
23963 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23965 * driver.cs: ignore /debug switch except for Unix platforms.
23967 2002-10-23 Nick Drochak <ndrochak@gol.com>
23969 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
23971 2002-10-21 Miguel de Icaza <miguel@ximian.com>
23973 * driver.cs: Do not make mcs-debug conditional, so we do not break
23974 builds that use it.
23976 * statement.cs (UsageVector.MergeChildren): I would like Martin to
23977 review this patch. But basically after all the children variables
23978 have been merged, the value of "Breaks" was not being set to
23979 new_breaks for Switch blocks. I think that it should be set after
23980 it has executed. Currently I set this to the value of new_breaks,
23981 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
23982 conservative, but I do not understand this code very well.
23984 I did not break anything in the build, so that is good ;-)
23986 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
23988 2002-10-20 Mark Crichton <crichton@gimp.org>
23990 * cfold.cs: Fixed compile blocker. Really fixed it this time.
23992 2002-10-20 Nick Drochak <ndrochak@gol.com>
23994 * cfold.cs: Fixed compile blocker.
23996 2002-10-20 Miguel de Icaza <miguel@ximian.com>
23998 * driver.cs: I was chekcing the key, not the file.
24000 2002-10-19 Ravi Pratap <ravi@ximian.com>
24002 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
24003 message that we were generating - we just need to silently return
24006 2002-10-19 Miguel de Icaza <miguel@ximian.com>
24008 * class.cs (Event.Define): Change my previous commit, as this
24009 breaks the debugger. This is a temporary hack, as it seems like
24010 the compiler is generating events incorrectly to begin with.
24012 * expression.cs (Binary.ResolveOperator): Added support for
24013 "U operator - (E x, E y)"
24015 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
24018 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
24019 init-only variables, but this path did not take into account that
24020 there might be also instance readonly variables. Correct this
24023 This fixes bug 32253
24025 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
24028 * driver.cs: Change the extension for modules to `netmodule'
24030 * cs-parser.jay: Improved slightly the location tracking for
24031 the debugger symbols.
24033 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
24034 modifiers that were specified instead of the hardcoded value
24035 (FamAndAssem). This was basically ignoring the static modifier,
24036 and others. Fixes 32429.
24038 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
24039 fixed a bug in the process (32476)
24041 * expression.cs (ArrayAccess.EmitAssign): Patch from
24042 hwang_rob@yahoo.ca that fixes bug 31834.3
24044 2002-10-18 Miguel de Icaza <miguel@ximian.com>
24046 * driver.cs: Make the module extension .netmodule.
24048 2002-10-16 Miguel de Icaza <miguel@ximian.com>
24050 * driver.cs: Report an error if the resource file is not found
24051 instead of crashing.
24053 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
24054 false, like Emit does.
24056 2002-10-16 Nick Drochak <ndrochak@gol.com>
24058 * typemanager.cs: Remove unused private member. Also reported mcs
24059 bug to report this as a warning like csc.
24061 2002-10-15 Martin Baulig <martin@gnome.org>
24063 * statement.cs (Statement.Emit): Made this a virtual method; emits
24064 the line number info and calls DoEmit().
24065 (Statement.DoEmit): New protected abstract method, formerly knows
24066 as Statement.Emit().
24068 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
24070 2002-10-11 Miguel de Icaza <miguel@ximian.com>
24072 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
24073 have fixed a remaining problem: not every AddXXXX was adding a
24074 fully qualified name.
24076 Now everyone registers a fully qualified name in the DeclSpace as
24077 being defined instead of the partial name.
24079 Downsides: we are slower than we need to be due to the excess
24080 copies and the names being registered this way.
24082 The reason for this is that we currently depend (on the corlib
24083 bootstrap for instance) that types are fully qualified, because
24084 we dump all the types in the namespace, and we should really have
24085 types inserted into the proper namespace, so we can only store the
24086 basenames in the defined_names array.
24088 2002-10-10 Martin Baulig <martin@gnome.org>
24090 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
24091 from bug #31834, see the bug report for a testcase which is
24094 2002-10-10 Martin Baulig <martin@gnome.org>
24096 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
24097 flow analysis code for this.
24099 * statement.cs (Do, While, For): Tell the flow analysis code about
24101 (FlowBranching.UsageVector): Added support for infinite loops.
24102 (Block.Resolve): Moved the dead code elimination here and use flow
24105 2002-10-09 Miguel de Icaza <miguel@ximian.com>
24107 * class.cs (Field.Define): Catch cycles on struct type
24110 * typemanager.cs (IsUnmanagedtype): Do not recursively check
24111 fields if the fields are static. We only need to check instance
24114 * expression.cs (As.DoResolve): Test for reference type.
24116 * statement.cs (Using.ResolveExpression): Use
24117 ConvertImplicitRequired, not ConvertImplicit which reports an
24119 (Using.ResolveLocalVariableDecls): ditto.
24121 * expression.cs (Binary.ResolveOperator): Report errors in a few
24122 places where we had to.
24124 * typemanager.cs (IsUnmanagedtype): Finish implementation.
24126 2002-10-08 Miguel de Icaza <miguel@ximian.com>
24128 * expression.cs: Use StoreFromPtr instead of extracting the type
24129 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
24131 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
24132 an enumeration value to a System.Enum, but System.Enum is not a
24133 value type, but an class type, so we need to box.
24135 (Expression.ConvertExplicit): One codepath could return
24136 errors but not flag them. Fix this. Fixes #31853
24138 * parameter.cs (Resolve): Do not allow void as a parameter type.
24140 2002-10-06 Martin Baulig <martin@gnome.org>
24142 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
24143 if it's a class type and not a struct. Fixes #31815.
24145 2002-10-06 Martin Baulig <martin@gnome.org>
24147 * statement.cs: Reworked the flow analysis code a bit to make it
24148 usable for dead code elimination.
24150 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24152 * cs-parser.jay: allow empty source files. Fixes bug #31781.
24154 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24156 * expression.cs (ComposedCast.DoResolveType): A quick workaround
24157 to fix the test 165, will investigate deeper.
24159 2002-10-04 Martin Baulig <martin@gnome.org>
24161 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
24162 finally blocks actually work.
24163 (Try.Resolve): We don't need to create a sibling for `finally' if
24164 there is no finally block.
24166 2002-10-04 Martin Baulig <martin@gnome.org>
24168 * class.cs (Constructor.Define): The default accessibility for a
24169 non-default constructor is private, not public.
24171 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24173 * class.cs (Constructor): Make AllowedModifiers public, add
24176 * cs-parser.jay: Perform the modifiers test here, as the
24177 constructor for the Constructor class usually receives a zero
24178 because of the way we create it (first we create, later we
24179 customize, and we were never checking the modifiers).
24181 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
24182 is a version of LookupTypeReflection that includes the type-name
24183 cache. This can be used as a fast path for functions that know
24184 the fully qualified name and are only calling into *.GetType() to
24185 obtain a composed type.
24187 This is also used by TypeManager.LookupType during its type
24190 (LookupType): We now also track the real type name, as sometimes
24191 we can get a quey for the real type name from things like
24192 ComposedCast. This fixes bug 31422.
24194 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
24195 complete type fullname, it does not have to go through the type
24196 resolution system to obtain the composed version of the type (for
24197 obtaining arrays or pointers).
24199 (Conditional.Emit): Use the EmitBoolExpression to
24200 generate nicer code, as requested by Paolo.
24202 (ArrayCreation.CheckIndices): Use the patch from
24203 hwang_rob@yahoo.ca to validate the array initializers.
24205 2002-10-03 Miguel de Icaza <miguel@ximian.com>
24207 * class.cs (ConstructorInitializer.Emit): simplify code by using
24208 Invocation.EmitCall, and at the same time, fix the bugs in calling
24209 parent constructors that took variable arguments.
24211 * ecore.cs (Expression.ConvertNumericExplicit,
24212 Expression.ImplicitNumericConversion): Remove the code that
24213 manually wrapped decimal (InternalTypeConstructor call is now gone
24216 * expression.cs (Cast.TryReduce): Also handle decimal types when
24217 trying to perform a constant fold on the type.
24219 * typemanager.cs (IsUnmanagedtype): Partially implemented.
24221 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
24222 that only turned off an error report, and did nothing else.
24224 2002-10-02 Miguel de Icaza <miguel@ximian.com>
24226 * driver.cs: Handle and ignore /fullpaths
24228 2002-10-01 Miguel de Icaza <miguel@ximian.com>
24230 * expression.cs (Binary.ResolveOperator): Catch the case where
24231 DoNumericPromotions returns true,
24233 (Binary.DoNumericPromotions): Simplify the code, and the tests.
24235 2002-09-27 Miguel de Icaza <miguel@ximian.com>
24237 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
24240 2002-09-26 Miguel de Icaza <miguel@ximian.com>
24242 * ecore.cs (ConvertNumericExplicit): It is not enough that the
24243 conversion exists, but it is also required that the conversion be
24244 performed. This manifested in "(Type64Enum) 2".
24246 * class.cs (TypeManager.AddMethod): The fix is not to change
24247 AddEnum, because that one was using a fully qualified name (every
24248 DeclSpace derivative does), but to change the AddMethod routine
24249 that was using an un-namespaced name. This now correctly reports
24250 the duplicated name.
24252 Revert patch until I can properly fix it. The issue
24253 is that we have a shared Type space across all namespaces
24254 currently, which is wrong.
24256 Options include making the Namespace a DeclSpace, and merge
24257 current_namespace/current_container in the parser.
24259 2002-09-25 Miguel de Icaza <miguel@ximian.com>
24261 * cs-parser.jay: Improve error reporting when we get a different
24262 kind of expression in local_variable_type and
24263 local_variable_pointer_type.
24265 Propagate this to avoid missleading errors being reported.
24267 * ecore.cs (ImplicitReferenceConversion): treat
24268 TypeManager.value_type as a target just like object_type. As
24273 Is valid, and needs to result in the int 1 being boxed before it
24274 is assigned to the value type v.
24276 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
24277 to validate the enumeration name.
24279 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
24280 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
24281 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
24283 * ecore.cs (TryImplicitIntConversion): When doing an
24284 implicit-enumeration-conversion, check if the type is 64-bits and
24285 perform a conversion before passing to EnumConstant.
24287 2002-09-23 Miguel de Icaza <miguel@ximian.com>
24289 * decl.cs (Error_AmbiguousTypeReference); New routine used to
24290 report ambiguous type references. Unlike the MS version, we
24291 report what the ambiguity is. Innovation at work ;-)
24293 (DeclSpace.FindType): Require a location argument to
24294 display when we display an ambiguous error.
24296 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
24298 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
24300 * expression.cs (EmitDynamicInitializers): Apply patch from
24301 hwang_rob@yahoo.ca that fixes the order in which we emit our
24304 2002-09-21 Martin Baulig <martin@gnome.org>
24306 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
24307 delegate takes no arguments.
24309 2002-09-20 Miguel de Icaza <miguel@ximian.com>
24311 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
24314 * expression.cs: Extract the underlying type.
24316 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
24318 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
24320 2002-09-19 Miguel de Icaza <miguel@ximian.com>
24322 * class.cs (TypeContainer.DefineType): We can not use the nice
24323 PackingSize with the size set to 1 DefineType method, because it
24324 will not allow us to define the interfaces that the struct
24327 This completes the fixing of bug 27287
24329 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
24330 means also structs. This fixes part of the problem.
24331 (Expresion.ImplicitReferenceConversionExists): ditto.
24333 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
24334 error if there were no errors reported during the type lookup
24335 process, to avoid duplicates or redundant errors. Without this
24336 you would get an ambiguous errors plus a type not found. We have
24337 beaten the user enough with the first error.
24339 (DeclSparce.FindType): Emit a warning if we have an ambiguous
24342 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
24343 during the resolution process, stop the lookup, this avoids
24344 repeated error reports (same error twice).
24346 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
24348 * typemanager.cs (LookupType): Redo the type lookup code to match
24349 the needs of System.Reflection.
24351 The issue is that System.Reflection requires references to nested
24352 types to begin with a "+" sign instead of a dot. So toplevel
24353 types look like: "NameSpace.TopLevelClass", and nested ones look
24354 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
24357 2002-09-19 Martin Baulig <martin@gnome.org>
24359 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
24360 says that a method always returns or always throws an exception,
24361 don't report the CS0161.
24363 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
24364 set `Returns = new_returns'.
24366 2002-09-19 Martin Baulig <martin@gnome.org>
24368 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
24369 to an enum constant, check for a CS0176.
24371 2002-09-18 Miguel de Icaza <miguel@ximian.com>
24373 * class.cs (TypeContainer.CheckPairedOperators): Now we check
24374 for operators that must be in pairs and report errors.
24376 * ecore.cs (SimpleName.DoResolveType): During the initial type
24377 resolution process, when we define types recursively, we must
24378 check first for types in our current scope before we perform
24379 lookups in the enclosing scopes.
24381 * expression.cs (MakeByteBlob): Handle Decimal blobs.
24383 (Invocation.VerifyArgumentsCompat): Call
24384 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
24385 I thought we were supposed to always call this, but there are a
24386 few places in the code where we dont do it.
24388 2002-09-17 Miguel de Icaza <miguel@ximian.com>
24390 * driver.cs: Add support in -linkres and -resource to specify the
24391 name of the identifier.
24393 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24395 * ecore.cs (StandardConversionExists): Sync with the conversion
24396 code: allow anything-* to void* conversions.
24398 (FindMostSpecificSource): Use an Expression argument
24399 instead of a Type, because we might be handed over a Literal which
24400 gets a few more implicit conversions that plain types do not. So
24401 this information was being lost.
24403 Also, we drop the temporary type-holder expression when not
24406 2002-09-17 Martin Baulig <martin@gnome.org>
24408 * class.cs (PropertyBase.CheckBase): Don't check the base class if
24409 this is an explicit interface implementation.
24411 2002-09-17 Martin Baulig <martin@gnome.org>
24413 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
24414 different `IndexerName' attributes.
24416 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
24417 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
24418 virtual CommonResolve().
24420 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24422 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
24423 and convert that to the UnderlyingType.
24425 * statement.cs (Foreach.Resolve): Indexers are just like variables
24426 or PropertyAccesses.
24428 * cs-tokenizer.cs (consume_string): Track line numbers and columns
24429 inside quoted strings, we were not doing this before.
24431 2002-09-16 Martin Baulig <martin@gnome.org>
24433 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
24434 resolve it. This is needed for the definite assignment check of the
24435 instance expression, fixes bug #29846.
24436 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
24438 2002-09-16 Nick Drochak <ndrochak@gol.com>
24440 * parameter.cs: Fix compile error. Cannot reference static member
24441 from an instance object. Is this an mcs bug?
24443 2002-09-14 Martin Baulig <martin@gnome.org>
24445 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
24446 multiple times. Fixes bug #30295, added test-166.cs.
24448 2002-09-14 Martin Baulig <martin@gnome.org>
24450 * statement.cs (Block.Emit): Don't emit unreachable code.
24451 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
24452 `break' statements.
24453 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
24455 2002-09-14 Martin Baulig <martin@gnome.org>
24457 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
24460 2002-09-14 Martin Baulig <martin@gnome.org>
24462 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
24463 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
24464 be false on the ms runtime.
24466 2002-09-13 Martin Baulig <martin@gnome.org>
24468 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
24469 the CS0038 error message.
24471 2002-09-12 Miguel de Icaza <miguel@ximian.com>
24473 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
24474 constant inside, return it.
24476 2002-09-12 Martin Baulig <martin@gnome.org>
24478 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
24479 implicit conversion can be done between enum types.
24481 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
24482 check whether an implicit conversion to the current enum's UnderlyingType
24483 exists and report an error if not.
24485 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
24486 without debugging support.
24488 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
24489 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
24491 2002-09-12 Martin Baulig <martin@gnome.org>
24493 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
24495 * ecore.cs (IMemberExpr.DeclaringType): New property.
24496 (SimpleName.SimpleNameResolve): Check whether we're accessing a
24497 nonstatic member of an outer type (CS0038).
24499 2002-09-11 Miguel de Icaza <miguel@ximian.com>
24501 * driver.cs: Activate the using-error detector at warning level
24502 4 (at least for MS-compatible APIs).
24504 * namespace.cs (VerifyUsing): Small buglett fix.
24506 * pending.cs (PendingImplementation): pass the container pointer.
24508 * interface.cs (GetMethods): Allow for recursive definition. Long
24509 term, I would like to move every type to support recursive
24510 definitions, not the current ordering mechanism that we have right
24513 The situation is this: Attributes are handled before interfaces,
24514 so we can apply attributes to interfaces. But some attributes
24515 implement interfaces, we will now handle the simple cases
24516 (recursive definitions will just get an error).
24518 * parameter.cs: Only invalidate types at the end if we fail to
24521 2002-09-09 Martin Baulig <martin@gnome.org>
24523 * ecore.cs (PropertyExpr.Emit): Also check for
24524 TypeManager.system_int_array_get_length so this'll also work when
24525 compiling corlib. Fixes #30003.
24527 2002-09-09 Martin Baulig <martin@gnome.org>
24529 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
24530 and throw an exception if we can't get the type's size. Fixed #30040,
24533 2002-09-09 Martin Baulig <martin@gnome.org>
24535 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
24537 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
24538 context. Fixes bug #30027.
24540 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
24541 virtual functions. Fixes bug #30043, added test-164.cs.
24543 2002-09-08 Ravi Pratap <ravi@ximian.com>
24545 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
24547 2002-09-08 Nick Drochak <ndrochak@gol.com>
24549 * driver.cs: Use an object to get the windows codepage since it's not a
24552 2002-09-08 Miguel de Icaza <miguel@ximian.com>
24554 * statement.cs (For.Emit): for infinite loops (test == null)
24555 return whether there is a break inside, not always "true".
24557 * namespace.cs (UsingEntry): New struct to hold the name of the
24558 using definition, the location where it is defined, and whether it
24559 has been used in a successful type lookup.
24561 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
24566 2002-09-06 Ravi Pratap <ravi@ximian.com>
24568 * attribute.cs : Fix incorrect code which relied on catching
24569 a NullReferenceException to detect a null being passed in
24570 where an object was expected.
24572 2002-09-06 Miguel de Icaza <miguel@ximian.com>
24574 * statement.cs (Try): flag the catch variable as assigned
24576 * expression.cs (Cast): Simplified by using ResolveType instead of
24577 manually resolving.
24579 * statement.cs (Catch): Fix bug by using ResolveType.
24581 2002-09-06 Ravi Pratap <ravi@ximian.com>
24583 * expression.cs (BetterConversion): Special case for when we have
24584 a NullLiteral as the argument and we have to choose between string
24585 and object types - we choose string the way csc does.
24587 * attribute.cs (Attribute.Resolve): Catch the
24588 NullReferenceException and report error #182 since the Mono
24589 runtime no more has the bug and having this exception raised means
24590 we tried to select a constructor which takes an object and is
24593 2002-09-05 Ravi Pratap <ravi@ximian.com>
24595 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
24596 message (1502, 1503) when we can't locate a method after overload
24597 resolution. This is much more informative and closes the bug
24600 * interface.cs (PopulateMethod): Return if there are no argument
24601 types. Fixes a NullReferenceException bug.
24603 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
24604 expressions too. Previously we were checking only in one place for
24605 positional arguments leaving out named arguments.
24607 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
24608 type to the enum type is not allowed. Remove code corresponding to
24611 (ConvertNumericExplicit): Allow explicit conversions from
24612 the underlying type to enum type. This precisely follows the spec
24613 and closes a bug filed by Gonzalo.
24615 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24618 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
24620 2002-09-03 Miguel de Icaza <miguel@ximian.com>
24622 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
24623 it was important that we stored the right value after the
24624 reduction in `converted'.
24626 2002-09-04 Martin Baulig <martin@gnome.org>
24628 * location.cs (Location.SymbolDocument): Use full pathnames for the
24631 2002-08-30 Miguel de Icaza <miguel@ximian.com>
24633 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
24634 of the expression resolve mechanism, because that will catch the
24635 SimpleName error failures.
24637 (Conditional): If we can not resolve the
24638 expression, return, do not crash.
24640 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24643 (location): display token name instead of its number.
24645 2002-08-28 Martin Baulig <martin@gnome.org>
24647 * expression.cs (Binary.ResolveOperator): Don't silently return
24648 but return an error if an operator cannot be applied between two
24651 2002-08-28 Martin Baulig <martin@gnome.org>
24653 * class.cs (Constructor.Define): Set the permission attributes
24654 correctly instead of making all constructors public.
24656 2002-08-28 Martin Baulig <martin@gnome.org>
24658 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
24659 for private members before reporting a CS0103; if we find anything,
24662 2002-08-28 Martin Baulig <martin@gnome.org>
24664 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
24665 to check whether `closure_start_type == closure_invocation_type',
24666 we also need to check whether `m.DeclaringType == closure_invocation_type'
24667 before bypassing the permission checks. We might be accessing
24668 protected/private members from the base class.
24669 (TypeManager.RealMemberLookup): Only set private_ok if private
24670 members were requested via BindingFlags.NonPublic.
24672 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
24674 * expression.cs (MemberAccess.ResolveMemberAccess): Set
24675 MethodGroupExpr.IsExplicitImpl if appropriate.
24676 (Invocation.DoResolve): Don't report the CS0120 for explicit
24677 interface implementations.
24679 2002-08-27 Martin Baulig <martin@gnome.org>
24681 * expression.cs (Invocation.DoResolve): If this is a static
24682 method and we don't have an InstanceExpression, we must report
24685 2002-08-25 Martin Baulig <martin@gnome.org>
24687 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
24688 `==' between a valuetype and an object.
24690 2002-08-25 Miguel de Icaza <miguel@ximian.com>
24692 * ecore.cs (TypeExpr): Provide a ToString method.
24694 2002-08-24 Martin Baulig <martin@gnome.org>
24696 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
24697 now called proggie.dbg and it's a binary file.
24699 2002-08-23 Martin Baulig <martin@gnome.org>
24701 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
24703 2002-08-23 Martin Baulig <martin@gnome.org>
24705 * struct.cs (MyStructInfo.ctor): Make this work with empty
24706 structs; it's not allowed to use foreach() on null.
24708 2002-08-23 Martin Baulig <martin@gnome.org>
24710 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
24711 writer the full pathname of the generated assembly.
24713 2002-08-23 Martin Baulig <martin@gnome.org>
24715 * statements.cs (FlowBranching.UsageVector.MergeChildren):
24716 A `finally' block never returns or breaks; improved handling of
24719 2002-08-23 Martin Baulig <martin@gnome.org>
24721 * statement.cs (Throw.Resolve): Allow `throw null'.
24723 2002-08-23 Martin Baulig <martin@gnome.org>
24725 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
24726 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
24727 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
24728 MemberLookup would return a wrong event if this is an explicit
24729 interface implementation and the class has an event with the same
24732 2002-08-23 Martin Baulig <martin@gnome.org>
24734 * statement.cs (Block.AddChildVariableNames): New public method.
24735 (Block.AddChildVariableName): Likewise.
24736 (Block.IsVariableNameUsedInChildBlock): Likewise.
24737 (Block.AddVariable): Check whether a variable name has already
24738 been used in a child block.
24740 * cs-parser.jay (declare_local_variables): Mark all variable names
24741 from the current block as being used in a child block in the
24744 2002-08-23 Martin Baulig <martin@gnome.org>
24746 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
24747 find the symbol writer.
24749 * driver.cs: csc also allows the arguments to /define being
24750 separated by commas, not only by semicolons.
24752 2002-08-23 Martin Baulig <martin@gnome.org>
24754 * interface.cs (Interface.GetMembers): Added static check for events.
24756 2002-08-15 Martin Baulig <martin@gnome.org>
24758 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
24759 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
24761 * ecore.cs (Expression.MemberLookup): Added documentation and explained
24762 why the MethodData.EmitDestructor() change was necessary.
24764 2002-08-20 Martin Baulig <martin@gnome.org>
24766 * class.cs (TypeContainer.FindMembers): Added static check for events.
24768 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
24770 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
24771 use Type.GetEvents(), not Type.FindMembers().
24773 2002-08-20 Martin Baulig <martin@gnome.org>
24775 * decl.cs (MemberCache): Added a special method cache which will
24776 be used for method-only searched. This ensures that a method
24777 search will return a MethodInfo with the correct ReflectedType for
24780 2002-08-20 Martin Baulig <martin@gnome.org>
24782 * decl.cs (DeclSpace.FindMembers): Made this public.
24784 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24786 * delegate.cs: fixed build on windows.
24787 [FIXME: Filed as bug #29150: MCS must report these errors.]
24789 2002-08-19 Ravi Pratap <ravi@ximian.com>
24791 * ecore.cs (StandardConversionExists): Return a false
24792 if we are trying to convert the void type to anything else
24793 since that is not allowed.
24795 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
24796 we flag error 70 in the event an event is trying to be accessed
24797 directly from outside the declaring type.
24799 2002-08-20 Martin Baulig <martin@gnome.org>
24801 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
24802 MemberCache from typemanager.cs to decl.cs.
24804 2002-08-19 Martin Baulig <martin@gnome.org>
24806 * class.cs (TypeContainer): Implement IMemberContainer.
24807 (TypeContainer.DefineMembers): Create the MemberCache.
24808 (TypeContainer.FindMembers): Do better BindingFlags checking; only
24809 return public members if BindingFlags.Public was given, check
24810 whether members are static.
24812 2002-08-16 Martin Baulig <martin@gnome.org>
24814 * decl.cs (DeclSpace.Define): Splitted this in Define and
24815 DefineMembers. DefineMembers is called first and initializes the
24818 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
24819 DefineMembers() on all our DeclSpaces.
24821 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
24822 but call DefineMembers() on all nested interfaces. We call their
24823 Define() in our new Define() function.
24825 * interface.cs (Interface): Implement IMemberContainer.
24826 (Interface.Define): Moved all code except the attribute stuf to
24828 (Interface.DefineMembers): Initialize the member cache.
24830 * typemanager.cs (IMemberFinder): Removed this interface, we don't
24831 need this anymore since we can use MemberCache.FindMembers directly.
24833 2002-08-19 Martin Baulig <martin@gnome.org>
24835 * typemanager.cs (MemberCache): When creating the cache for an
24836 interface type, add all inherited members.
24837 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
24838 to `out bool used_cache' and documented it.
24839 (TypeManager.MemberLookup): If we already used the cache in the first
24840 iteration, we don't need to do the interfaces check.
24842 2002-08-19 Martin Baulig <martin@gnome.org>
24844 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
24845 here from IMemberFinder and don't implement this interface anymore.
24846 (DeclSpace.MemberCache): Moved here from IMemberFinder.
24848 * typemanager.cs (IMemberFinder): This interface is now only used by
24849 classes which actually support the member cache.
24850 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
24851 since we only put DeclSpaces into this Hashtable.
24852 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
24853 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
24855 2002-08-16 Martin Baulig <martin@gnome.org>
24857 * typemanager.cs (ICachingMemberFinder): Removed.
24858 (IMemberFinder.MemberCache): New property.
24859 (TypeManager.FindMembers): Merged this with RealFindMembers().
24860 This function will never be called from TypeManager.MemberLookup()
24861 so we can't use the cache here, just the IMemberFinder.
24862 (TypeManager.MemberLookup_FindMembers): Check whether the
24863 IMemberFinder has a MemberCache and call the cache's FindMembers
24865 (MemberCache): Rewrote larger parts of this yet another time and
24866 cleaned it up a bit.
24868 2002-08-15 Miguel de Icaza <miguel@ximian.com>
24870 * driver.cs (LoadArgs): Support quoting.
24872 (Usage): Show the CSC-like command line arguments.
24874 Improved a few error messages.
24876 2002-08-15 Martin Baulig <martin@gnome.org>
24878 * typemanager.cs (IMemberContainer.Type): New property.
24879 (IMemberContainer.IsInterface): New property.
24881 The following changes are conditional to BROKEN_RUNTIME, which is
24882 defined at the top of the file.
24884 * typemanager.cs (MemberCache.MemberCache): Don't add the base
24885 class'es members, but add all members from TypeHandle.ObjectType
24886 if we're an interface.
24887 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
24888 is the current type.
24889 (MemberCache.CacheEntry.Container): Removed this field.
24890 (TypeHandle.GetMembers): Include inherited members.
24892 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24894 * typemanager.cs: fixed compilation and added a comment on a field that
24897 2002-08-15 Martin Baulig <martin@gnome.org>
24899 * class.cs (ConstructorInitializer.Resolve): In the
24900 Expression.MemberLookup call, use the queried_type as
24903 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
24904 declared' attribute, it's always true.
24905 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
24906 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
24907 temporary wrapper for FindMembers which tells MemberLookup whether
24908 members from the base classes are included in the return value.
24909 This will go away soon.
24910 (TypeManager.MemberLookup): Use this temporary hack here; once the
24911 new MemberCache is completed, we don't need to do the DeclaredOnly
24912 looping here anymore since the MemberCache will take care of this.
24913 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
24914 (MemberCache): When creating the MemberCache for a class, get
24915 members from the current class and all its base classes.
24916 (MemberCache.CacheEntry.Container): New field. This is a
24917 temporary hack until the Mono runtime is fixed to distinguish
24918 between ReflectedType and DeclaringType. It allows us to use MCS
24919 with both the MS runtime and the unfixed Mono runtime without
24920 problems and without accecting performance.
24921 (MemberCache.SearchMembers): The DeclaredOnly looping from
24922 TypeManager.MemberLookup is now done here.
24924 2002-08-14 Martin Baulig <martin@gnome.org>
24926 * statement.cs (MyStructInfo.MyStructInfo): Don't call
24927 Type.GetFields on dynamic types but get the fields from the
24928 corresponding TypeContainer.
24929 (MyStructInfo.GetStructInfo): Added check for enum types.
24931 * typemanager.cs (MemberList.IsSynchronized): Implemented.
24932 (MemberList.SyncRoot): Implemented.
24933 (TypeManager.FilterWithClosure): No need to check permissions if
24934 closure_start_type == closure_invocation_type, don't crash if
24935 closure_invocation_type is null.
24937 2002-08-13 Martin Baulig <martin@gnome.org>
24939 Rewrote TypeContainer.FindMembers to use a member cache. This
24940 gives us a speed increase of about 35% for the self-hosting MCS
24941 build and of about 15-20% for the class libs (both on GNU/Linux).
24943 * report.cs (Timer): New class to get enhanced profiling. This
24944 whole class is "TIMER" conditional since it remarkably slows down
24947 * class.cs (MemberList): New class. This is an IList wrapper
24948 which we're now using instead of passing MemberInfo[]'s around to
24949 avoid copying this array unnecessarily.
24950 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
24951 (ICachingMemberFinder, IMemberContainer): New interface.
24952 (TypeManager.FilterWithClosure): If `criteria' is null, the name
24953 has already been checked, otherwise use it for the name comparision.
24954 (TypeManager.FindMembers): Renamed to RealMemberFinder and
24955 provided wrapper which tries to use ICachingMemberFinder.FindMembers
24956 if possible. Returns a MemberList, not a MemberInfo [].
24957 (TypeHandle): New class, implements IMemberContainer. We create
24958 one instance of this class per type, it contains a MemberCache
24959 which is used to do the member lookups.
24960 (MemberCache): New class. Each instance of this class contains
24961 all members of a type and a name-based hash table.
24962 (MemberCache.FindMembers): This is our new member lookup
24963 function. First, it looks up all members of the requested name in
24964 the hash table. Then, it walks this list and sorts out all
24965 applicable members and returns them.
24967 2002-08-13 Martin Baulig <martin@gnome.org>
24969 In addition to a nice code cleanup, this gives us a performance
24970 increase of about 1.4% on GNU/Linux - not much, but it's already
24971 half a second for the self-hosting MCS compilation.
24973 * typemanager.cs (IMemberFinder): New interface. It is used by
24974 TypeManager.FindMembers to call FindMembers on a TypeContainer,
24975 Enum, Delegate or Interface.
24976 (TypeManager.finder_to_member_finder): New PtrHashtable.
24977 (TypeManager.finder_to_container): Removed.
24978 (TypeManager.finder_to_delegate): Removed.
24979 (TypeManager.finder_to_interface): Removed.
24980 (TypeManager.finder_to_enum): Removed.
24982 * interface.cs (Interface): Implement IMemberFinder.
24984 * delegate.cs (Delegate): Implement IMemberFinder.
24986 * enum.cs (Enum): Implement IMemberFinder.
24988 * class.cs (TypeContainer): Implement IMemberFinder.
24990 2002-08-12 Martin Baulig <martin@gnome.org>
24992 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
24994 2002-08-12 Martin Baulig <martin@gnome.org>
24996 * ecore.cs (ITypeExpression): New interface for expressions which
24998 (TypeExpression): Renamed to TypeLookupExpression.
24999 (Expression.DoResolve): If we're doing a types-only lookup, the
25000 expression must implement the ITypeExpression interface and we
25001 call DoResolveType() on it.
25002 (SimpleName): Implement the new ITypeExpression interface.
25003 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
25004 hack, the situation that we're only looking up types can't happen
25005 anymore when this method is called. Moved the type lookup code to
25006 DoResolveType() and call it.
25007 (SimpleName.DoResolveType): This ITypeExpression interface method
25008 is now doing the types-only lookup.
25009 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
25010 (ResolveFlags): Added MaskExprClass.
25012 * expression.cs (MemberAccess): Implement the ITypeExpression
25014 (MemberAccess.DoResolve): Added support for a types-only lookup
25015 when we're called via ITypeExpression.DoResolveType().
25016 (ComposedCast): Implement the ITypeExpression interface.
25018 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
25019 Expression.Resolve() with ResolveFlags.Type instead.
25021 2002-08-12 Martin Baulig <martin@gnome.org>
25023 * interface.cs (Interface.Define): Apply attributes.
25025 * attribute.cs (Attribute.ApplyAttributes): Added support for
25026 interface attributes.
25028 2002-08-11 Martin Baulig <martin@gnome.org>
25030 * statement.cs (Block.Emit): Only check the "this" variable if we
25031 do not always throw an exception.
25033 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
25034 whether the property has a set accessor.
25036 2002-08-11 Martin Baulig <martin@gnome.org>
25038 Added control flow analysis support for structs.
25040 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
25041 with control flow analysis turned off.
25042 (IVariable): New interface.
25043 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
25044 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
25045 (FieldExpr.DoResolve): Resolve the instance expression with flow
25046 analysis turned off and do the definite assignment check after the
25047 resolving when we know what the expression will resolve to.
25049 * expression.cs (LocalVariableReference, ParameterReference):
25050 Implement the new IVariable interface, only call the flow analysis
25051 code if ec.DoFlowAnalysis is true.
25052 (This): Added constructor which takes a Block argument. Implement
25053 the new IVariable interface.
25054 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
25055 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
25056 This does the definite assignment checks for struct members.
25058 * class.cs (Constructor.Emit): If this is a non-static `struct'
25059 constructor which doesn't have any initializer, call
25060 Block.AddThisVariable() to tell the flow analysis code that all
25061 struct elements must be initialized before control returns from
25064 * statement.cs (MyStructInfo): New public class.
25065 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
25066 argument to this indexer. If non-zero, check an individual struct
25067 member, not the whole struct.
25068 (FlowBranching.CheckOutParameters): Check struct members.
25069 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
25070 overloaded versions of these methods which take an additional
25071 `int field_idx' argument to check struct members.
25072 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
25073 overloaded versions of these methods which take an additional
25074 `string field_name' argument to check struct member.s
25075 (VariableInfo): Implement the IVariable interface.
25076 (VariableInfo.StructInfo): New public property. Returns the
25077 MyStructInfo instance of the variable if it's a struct or null.
25078 (Block.AddThisVariable): New public method. This is called from
25079 Constructor.Emit() for non-static `struct' constructor which do
25080 not have any initializer. It creates a special variable for the
25081 "this" instance variable which will be checked by the flow
25082 analysis code to ensure that all of the struct's fields are
25083 initialized before control returns from the constructor.
25084 (UsageVector): Added support for struct members. If a
25085 variable/parameter is a struct with N members, we reserve a slot
25086 in the usage vector for each member. A struct is considered fully
25087 initialized if either the struct itself (slot 0) or all its
25088 members are initialized.
25090 2002-08-08 Martin Baulig <martin@gnome.org>
25092 * driver.cs (Driver.MainDriver): Only report an error CS5001
25093 if there were no compilation errors.
25095 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
25096 `UnsafeContext' property to determine whether the parent is in
25097 unsafe context rather than checking the parent's ModFlags:
25098 classes nested in an unsafe class are unsafe as well.
25100 2002-08-08 Martin Baulig <martin@gnome.org>
25102 * statement.cs (UsageVector.MergeChildren): Distinguish between
25103 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
25104 we return. Added test17() and test18() to test-154.cs.
25106 2002-08-08 Martin Baulig <martin@gnome.org>
25108 * typemanager.cs (TypeManager.FilterWithClosure): If we have
25109 Family access, make sure the invoking type isn't a subclass of the
25110 queried type (that'd be a CS1540).
25112 * ecore.cs (Expression.MemberLookup): Added overloaded version of
25113 this method which takes an additional `Type invocation_type'.
25115 * expression.cs (BaseAccess.DoResolve): Use the base type as
25116 invocation and query type.
25117 (MemberAccess.DoResolve): If the lookup failed and we're about to
25118 report a CS0122, try a lookup with the ec.ContainerType - if this
25119 succeeds, we must report a CS1540.
25121 2002-08-08 Martin Baulig <martin@gnome.org>
25123 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
25124 (MethodGroupExpr): Implement the IMemberExpr interface.
25126 * expression (MemberAccess.ResolveMemberAccess): No need to have
25127 any special code for MethodGroupExprs anymore, they're now
25130 2002-08-08 Martin Baulig <martin@gnome.org>
25132 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
25133 Family, FamANDAssem and FamORAssem permissions.
25134 (TypeManager.IsSubclassOrNestedChildOf): New public method.
25136 2002-08-08 Martin Baulig <martin@gnome.org>
25138 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
25139 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
25142 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
25144 * driver.cs: implemented /resource option to embed managed resources.
25146 2002-08-07 Martin Baulig <martin@gnome.org>
25148 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
25149 (FieldBase.HasFieldInitializer): New public property.
25150 (FieldBase.GetInitializerExpression): New public method. Resolves and
25151 returns the field initializer and makes sure it is only resolved once.
25152 (TypeContainer.EmitFieldInitializers): Call
25153 FieldBase.GetInitializerExpression to get the initializer, this ensures
25154 that it isn't resolved multiple times.
25156 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
25157 the resolving process (SimpleName/MemberLookup) that we're currently
25158 emitting a field initializer (which must not access any instance members,
25159 this is an error CS0236).
25161 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
25162 argument, if the `IsFieldInitializer' flag is set, we must report and
25163 error CS0236 and not an error CS0120.
25165 2002-08-07 Martin Baulig <martin@gnome.org>
25167 * ecore.cs (IMemberExpr): New public interface.
25168 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
25169 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
25170 if the expression is an IMemberExpr.
25172 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
25173 to be null, implicitly default to `this' if we're non-static in
25174 this case. Simplified the code a lot by using the new IMemberExpr
25175 interface. Also fixed bug #28176 here.
25177 2002-08-06 Martin Baulig <martin@gnome.org>
25179 * cs-parser.jay (SimpleLookup): Removed. We need to create
25180 ParameterReferences during semantic analysis so that we can do a
25181 type-only search when resolving Cast, TypeOf and SizeOf.
25182 (block): Pass the `current_local_parameters' to the Block's
25185 * class.cs (ConstructorInitializer): Added `Parameters parameters'
25186 argument to the constructor.
25187 (ConstructorInitializer.Resolve): Create a temporary implicit
25188 block with the parameters.
25190 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
25191 references here if we aren't doing a type-only search.
25193 * statement.cs (Block): Added constructor which takes a
25194 `Parameters parameters' argument.
25195 (Block.Parameters): New public property.
25197 * support.cs (InternalParameters.Parameters): Renamed `parameters'
25198 to `Parameters' and made it public readonly.
25200 2002-08-06 Martin Baulig <martin@gnome.org>
25202 * ecore.cs (Expression.Warning): Made this public as well.
25204 * report.cs (Report.Debug): Print the contents of collections.
25206 2002-08-06 Martin Baulig <martin@gnome.org>
25208 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
25209 used to tell Resolve() which kinds of expressions it may return.
25210 (Expression.Resolve): Added overloaded version of this method which
25211 takes a `ResolveFlags flags' argument. This can be used to tell
25212 Resolve() which kinds of expressions it may return. Reports a
25214 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
25215 ResolveFlags.SimpleName.
25216 (Expression.Error118): Added overloaded version of this method which
25217 takes a `ResolveFlags flags' argument. It uses the flags to determine
25218 which kinds of expressions are allowed.
25220 * expression.cs (Argument.ResolveMethodGroup): New public method.
25221 Resolves an argument, but allows a MethodGroup to be returned.
25222 This is used when invoking a delegate.
25224 * TODO: Updated a bit.
25226 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25228 Fixed compilation with csc.
25230 * ecore.cs: Expression.Error made public. Is this correct? Should
25231 Warning be made public too?
25233 * expression.cs: use ea.Location instead of ea.loc.
25234 [FIXME: Filed as bug #28607: MCS must report these errors.]
25236 2002-08-06 Martin Baulig <martin@gnome.org>
25238 * ecore.cs (Expression.loc): Moved the location here instead of
25239 duplicating it in all derived classes.
25240 (Expression.Location): New public property.
25241 (Expression.Error, Expression.Warning): Made them non-static and
25242 removed the location argument.
25243 (Expression.Warning): Added overloaded version which takes an
25244 `int level' argument.
25245 (Expression.Error118): Make this non-static and removed the
25246 expression and location arguments.
25247 (TypeExpr): Added location argument to the constructor.
25249 * expression.cs (StaticCallExpr): Added location argument to
25251 (Indirection, PointerArithmetic): Likewise.
25252 (CheckedExpr, UnCheckedExpr): Likewise.
25253 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
25254 (StringPtr): Likewise.
25257 2002-08-05 Martin Baulig <martin@gnome.org>
25259 * expression.cs (BaseAccess.DoResolve): Actually report errors.
25261 * assign.cs (Assign.DoResolve): Check whether the source
25262 expression is a value or variable.
25264 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
25265 while resolving the corresponding blocks.
25267 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
25268 an error, don't silently return null.
25270 * statement.cs (Block.AddVariable): Do the error reporting here
25271 and distinguish between CS0128 and CS0136.
25272 (Block.DoResolve): Report all unused labels (warning CS0164).
25273 (LabeledStatement): Pass the location to the constructor.
25274 (LabeledStatement.HasBeenReferenced): New property.
25275 (LabeledStatement.Resolve): Set it to true here.
25277 * statement.cs (Return.Emit): Return success even after reporting
25278 a type mismatch error (CS0126 or CS0127), this is what csc does and
25279 it avoids confusing the users with any consecutive errors.
25281 2002-08-05 Martin Baulig <martin@gnome.org>
25283 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
25285 * const.cs (Const.LookupConstantValue): Catch circular definitions.
25287 * expression.cs (MemberAccess.DoResolve): Silently return if an
25288 error has already been reported.
25290 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
25291 error has already been reported.
25293 2002-08-05 Martin Baulig <martin@gnome.org>
25295 * statement.cs (UsageVector): Only initialize the `parameters'
25296 vector if we actually have any "out" parameters.
25298 2002-08-05 Martin Baulig <martin@gnome.org>
25300 * expression.cs (Binary.ResolveOperator): When combining delegates,
25301 they must have the same type.
25303 2002-08-05 Martin Baulig <martin@gnome.org>
25305 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
25306 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
25307 work with the ms runtime and we also don't need it: if we're a
25308 PropertyBuilder and not in the `indexer_arguments' hash, then we
25309 are a property and not an indexer.
25311 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
25312 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
25313 since the latter one doesn't work with the ms runtime.
25315 2002-08-03 Martin Baulig <martin@gnome.org>
25317 Fixed bugs #27998 and #22735.
25319 * class.cs (Method.IsOperator): New public field.
25320 (Method.CheckBase): Report CS0111 if there's already a method
25321 with the same parameters in the current class. Report CS0508 when
25322 attempting to change the return type of an inherited method.
25323 (MethodData.Emit): Report CS0179 if a method doesn't have a body
25324 and it's not marked abstract or extern.
25325 (PropertyBase): New abstract base class for Property and Indexer.
25326 (PropertyBase.CheckBase): Moved here from Property and made it work
25328 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
25329 the same so we can reuse it there.
25330 (Property, Indexer): Derive from PropertyBase.
25331 (MethodSignature.inheritable_property_signature_filter): New delegate
25332 to find properties and indexers.
25334 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
25335 argument and improved error reporting.
25337 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
25338 EmptyReadOnlyParameters and made it a property.
25340 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
25341 version of this method which takes a `PropertyInfo indexer'.
25342 (TypeManager.RegisterIndexer): New method.
25344 * class.cs: Added myself as author of this file :-)
25346 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25348 * class.cs: fixed compilation on windoze.
25350 2002-08-03 Martin Baulig <martin@gnome.org>
25352 * interface.cs (Interface.GetInterfaceBases): Check whether all
25353 base interfaces are at least as accessible than the current one.
25355 * class.cs (TypeContainer.GetClassBases): Check whether base types
25356 are at least as accessible than the current type.
25357 (TypeContainer.AsAccessible): Implemented and made non-static.
25358 (MemberBase.CheckParameters): Report errors if the accessibility
25361 * delegate.cs (Delegate.Delegate): The default visibility is
25362 internal for top-level types and private for nested types.
25363 (Delegate.Define): Report errors if the accessibility checks fail.
25365 * enum.cs (Enum.Enum): The default visibility is internal for
25366 top-level types and private for nested types.
25367 (Enum.DefineType): Compute the correct visibility.
25369 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
25370 function which takes a `bool is_toplevel' instead of a TypeContainer.
25372 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
25375 2002-08-02 Martin Baulig <martin@gnome.org>
25377 * expression.cs (LocalVariableReferenc): Added constructor which
25378 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
25379 (LocalVariableReference.IsReadOnly): New property.
25380 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
25381 variable is readonly, use our own readonly flag to do this; you can
25382 use the new constructor to get a writable reference to a read-only
25385 * cs-parser.jay (foreach_statement, using_statement): Get a writable
25386 reference to the local variable.
25388 2002-08-01 Miguel de Icaza <miguel@ximian.com>
25390 * rootcontext.cs (ResolveCore): Also include System.Exception
25392 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
25393 we reach an EmptyStatement.
25395 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
25398 * expression.cs (Binary.ResolveOperator): Check error result in
25401 use brtrue/brfalse directly and avoid compares to null.
25403 2002-08-02 Martin Baulig <martin@gnome.org>
25405 * class.cs (TypeContainer.Define): Define all nested interfaces here.
25406 Fixes bug #28407, added test-155.cs.
25408 2002-08-01 Martin Baulig <martin@gnome.org>
25410 * class.cs (Event.EmitDefaultMethod): Make this work with static
25411 events. Fixes #28311, added verify-3.cs.
25413 2002-08-01 Martin Baulig <martin@gnome.org>
25415 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
25416 `is_disposable' fields.
25417 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
25418 `hm.is_disposable' if we're using the collection pattern.
25419 (Foreach.EmitCollectionForeach): Use the correct type for the
25420 enumerator's local variable, only emit the try/finally block if
25421 necessary (fixes #27713).
25423 2002-08-01 Martin Baulig <martin@gnome.org>
25425 * ecore.cs (Expression.report118): Renamed to Error118 and made
25428 * statement.cs (Throw.Resolve): Check whether the expression is of
25429 the correct type (CS0118) and whether the type derives from
25430 System.Exception (CS0155).
25431 (Catch.Resolve): New method. Do the type lookup here and check
25432 whether it derives from System.Exception (CS0155).
25433 (Catch.CatchType, Catch.IsGeneral): New public properties.
25435 * typemanager.cs (TypeManager.exception_type): Added.
25437 2002-07-31 Miguel de Icaza <miguel@ximian.com>
25439 * driver.cs: Updated About function.
25441 2002-07-31 Martin Baulig <martin@gnome.org>
25443 Implemented Control Flow Analysis.
25445 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
25446 (EmitContext.CurrentBranching): Added.
25447 (EmitContext.StartFlowBranching): Added.
25448 (EmitContext.EndFlowBranching): Added.
25449 (EmitContext.KillFlowBranching): Added.
25450 (EmitContext.IsVariableAssigned): Added.
25451 (EmitContext.SetVariableAssigned): Added.
25452 (EmitContext.IsParameterAssigned): Added.
25453 (EmitContext.SetParameterAssigned): Added.
25454 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
25455 Added control flow analysis stuff here.
25457 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
25458 resolve the expression as lvalue.
25459 (LocalVariableReference.DoResolve): Check whether the variable has
25460 already been assigned.
25461 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
25462 the parameter as assigned here.
25463 (ParameterReference.DoResolve): Check whether the parameter has already
25465 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
25466 expression as lvalue.
25468 * statement.cs (FlowBranching): New class for the flow analysis code.
25469 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
25470 (LabeledStatement.IsDefined): New public property.
25471 (LabeledStatement.AddUsageVector): New public method to tell flow
25472 analyis that the label may be reached via a forward jump.
25473 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
25475 (VariableInfo.Number): New public field. This is used by flow analysis
25476 to number all locals of a block.
25477 (Block.CountVariables): New public property. This is the number of
25478 local variables in this block (including the locals from all parent
25480 (Block.EmitMeta): Number all the variables.
25482 * statement.cs: Added flow analysis support to all classes.
25484 2002-07-31 Martin Baulig <martin@gnome.org>
25486 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
25487 To get debugging messages, compile mcs with /define:MCS_DEBUG and
25488 then use this argument.
25490 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
25492 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
25493 use this to specify /define options.
25495 2002-07-29 Martin Baulig <martin@gnome.org>
25497 * statement.cs (Fixed): Moved all code that does variable lookups
25498 and resolvings from Emit to Resolve.
25500 * statement.cs (For): Moved all code that does variable lookups
25501 and resolvings from Emit to Resolve.
25503 * statement.cs (Using): Moved all code that does variable lookups
25504 and resolvings from Emit to Resolve.
25506 2002-07-29 Martin Baulig <martin@gnome.org>
25508 * attribute.cs (Attribute.Resolve): Explicitly catch a
25509 System.NullReferenceException when creating the
25510 CustromAttributeBuilder and report a different warning message.
25512 2002-07-29 Martin Baulig <martin@gnome.org>
25514 * support.cs (ParameterData.ParameterName): Added method to
25515 get the name of a parameter.
25517 * typemanager.cs (TypeManager.IsValueType): New public method.
25519 2002-07-29 Martin Baulig <martin@gnome.org>
25521 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
25522 is a flag which specifies that it's either ref or out.
25523 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
25524 the out parameter to `out Parameter.Modifier mod', also set the
25525 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
25527 * support.cs (InternalParameters.ParameterModifier): Distinguish
25528 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25529 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25531 * expression.cs (Argument.GetParameterModifier): Distinguish
25532 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25533 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25535 2002-07-29 Martin Baulig <martin@gnome.org>
25537 * expression.cs (ParameterReference.ParameterReference): Added
25538 `Location loc' argument to the constructor.
25540 * cs-parser.jay: Pass location to ParameterReference.
25542 2002-07-28 Miguel de Icaza <miguel@ximian.com>
25544 * statement.cs (Try): Initialize the location.
25546 * cs-parser.jay: pass location to Try.
25548 * expression.cs (Unary.Reduce): Change the prototype to return
25549 whether a constant fold could be performed or not. The result is
25550 returned in an out parameters. In the case of Indirection and
25551 AddressOf, we want to perform the full tests.
25553 2002-07-26 Miguel de Icaza <miguel@ximian.com>
25555 * statement.cs (Statement.Emit): Flag dead code.
25557 2002-07-27 Andrew Birkett <andy@nobugs.org>
25559 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
25561 2002-07-27 Martin Baulig <martin@gnome.org>
25563 * class.cs (MethodData.Define): Put back call to
25564 TypeManager.AddMethod(), accidentally commented this out.
25566 * report.cs (Debug): New public method to print debugging information,
25567 this is `[Conditional ("DEBUG")]'.
25569 2002-07-26 Martin Baulig <martin@gnome.org>
25571 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
25572 (switch_statement): Push the current_block to the switch_stack and
25573 pop it again when we're done with the switch.
25574 (switch_section): The new block is a child of the current_block.
25575 Fixes bug #24007, added test-152.cs.
25577 2002-07-27 Martin Baulig <martin@gnome.org>
25579 * expression.cs (Invocation.EmitArguments): When calling a varargs
25580 function with only its fixed arguments, we need to pass an empty
25583 2002-07-27 Martin Baulig <martin@gnome.org>
25585 Mono 0.13 has been released.
25587 2002-07-25 Miguel de Icaza <miguel@ximian.com>
25589 * driver.cs: Rename --resource to --linkres, because that is what
25590 we do currently, we dont support --resource yet.
25592 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
25594 2002-07-25 Martin Baulig <martin@gnome.org>
25596 * class.cs (MethodData): New public class. This is a `method builder'
25597 class for a method or one accessor of a Property/Indexer/Event.
25598 (MethodData.GetMethodFlags): Moved here from MemberBase.
25599 (MethodData.ApplyAttributes): Likewise.
25600 (MethodData.ApplyObsoleteAttribute): Likewise.
25601 (MethodData.ApplyConditionalAttribute): Likewise.
25602 (MethodData.ApplyDllImportAttribute): Likewise.
25603 (MethodData.CheckAbstractAndExternal): Likewise.
25604 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
25605 (MethodData.Emit): Formerly known as Method.Emit().
25606 (MemberBase): Moved everything which was specific to a single
25607 accessor/method to MethodData.
25608 (Method): Create a new MethodData and call Define() and Emit() on it.
25609 (Property, Indexer, Event): Create a new MethodData objects for each
25610 accessor and call Define() and Emit() on them.
25612 2002-07-25 Martin Baulig <martin@gnome.org>
25614 Made MethodCore derive from MemberBase to reuse the code from there.
25615 MemberBase now also checks for attributes.
25617 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
25618 (MemberBase.GetMethodFlags): Moved here from class Method and marked
25620 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
25621 `CallingConventions cc' and `Attributes opt_attrs' arguments.
25622 (MemberBase.ApplyAttributes): New virtual method; applies the
25623 attributes to a method or accessor.
25624 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
25625 (MemberBase.ApplyConditionalAttribute): Likewise.
25626 (MemberBase.ApplyDllImportAttribute): Likewise.
25627 (MemberBase.CheckAbstractAndExternal): Likewise.
25628 (MethodCore.ParameterTypes): This is now a property instead of a
25629 method, it's initialized from DoDefineParameters().
25630 (MethodCore.ParameterInfo): Removed the set accessor.
25631 (MethodCore.DoDefineParameters): New protected virtual method to
25632 initialize ParameterTypes and ParameterInfo.
25633 (Method.GetReturnType): We can now simply return the MemberType.
25634 (Method.GetMethodFlags): Override the MemberBase version and add
25635 the conditional flags.
25636 (Method.CheckBase): Moved some code from Define() here, call
25637 DoDefineParameters() here.
25638 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
25639 here to avoid some larger code duplication.
25640 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
25641 ensure that abstract and external accessors don't declare a body.
25643 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
25644 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
25645 lookup in the attribute's parent classes, so we need to abort as soon
25646 as we found the first match.
25647 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
25648 the attribute has no arguments.
25650 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
25653 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25655 * cs-parser.jay: reverted previous patch.
25657 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25659 * cs-parser.jay: fixed bug #22119.
25661 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25663 * attribute.cs: fixed compilation. The error was:
25664 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
25665 be assigned to before control leaves the current method."
25666 [FIXME: Filed as bug #28186: MCS must report this error.]
25668 2002-07-25 Martin Baulig <martin@gnome.org>
25670 * attribute.cs (Attribute.Conditional_GetConditionName): New static
25671 method to pull the condition name ouf of a Conditional attribute.
25672 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
25673 the obsolete message and error flag out of an Obsolete attribute.
25675 * class.cs (Method.GetMethodFlags): New public method to get the
25676 TypeManager.MethodFlags for this method.
25677 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
25679 (Method.Define): Get and apply the Obsolete and Conditional attributes;
25680 if we're overriding a virtual function, set the new private variable
25681 `parent_method'; call the new TypeManager.AddMethod().
25683 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
25684 the MethodBuilder and the Method in a PtrHashtable.
25685 (TypeManager.builder_to_method): Added for this purpose.
25686 (TypeManager.MethodFlags): Added IsObsoleteError.
25687 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
25688 Obsolete and Conditional arguments in MethodBuilders. If we discover
25689 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
25690 the message from the attribute.
25692 2002-07-24 Martin Baulig <martin@gnome.org>
25694 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
25695 preprocessor directives, ensure that the argument to #define/#undef is
25696 exactly one identifier and that it's actually an identifier.
25698 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
25701 2002-07-24 Martin Baulig <martin@gnome.org>
25703 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
25704 initialize it to TypeManager.object_type in the constructor.
25705 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
25706 of the `hm.get_current' method if we're using the collection pattern.
25707 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
25708 for the explicit conversion to make it work when we're using the collection
25709 pattern and the `Current' property has a different return type than `object'.
25712 2002-07-24 Martin Baulig <martin@gnome.org>
25714 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
25715 does not match, but don't report any errors. This method is called in
25716 order for all methods in a MethodGroupExpr until a matching method is
25717 found, so we don't want to bail out if the first method doesn't match.
25718 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
25719 matches, report the 123. Fixes #28070.
25721 2002-07-24 Martin Baulig <martin@gnome.org>
25723 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
25724 TypeManager.TypeToCoreType() to the top of the method so the
25725 following equality checks will work. Fixes #28107.
25727 2002-07-24 Martin Baulig <martin@gnome.org>
25729 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
25730 operand is of type uint, and the other operand is of type sbyte,
25731 short or int, the operands are converted to type long." -
25732 Actually do what this comment already told us. Fixes bug #28106,
25735 2002-07-24 Martin Baulig <martin@gnome.org>
25737 * class.cs (MethodBase): New abstract class. This is now a base
25738 class for Property, Indexer and Event to avoid some code duplication
25739 in their Define() and DefineMethods() methods.
25740 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
25741 generic methods for Define() and DefineMethods().
25742 (FieldBase): Derive from MemberBase, not MemberCore.
25743 (Property): Derive from MemberBase, not MemberCore.
25744 (Property.DefineMethod): Moved all the code from this method to the
25745 new MethodBase.DefineAccessor(), just call it with appropriate
25747 (Property.Define): Call the new Property.DoDefine(), this does some
25748 sanity checks and we don't need to duplicate the code everywhere.
25749 (Event): Derive from MemberBase, not MemberCore.
25750 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
25751 accessors, this will also make them work with interface events.
25752 (Indexer): Derive from MemberBase, not MemberCore.
25753 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
25754 (Indexer.Define): Use the new MethodBase functions.
25756 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
25757 argument to the constructor.
25758 (Interface.FindMembers): Added support for interface events.
25759 (Interface.PopluateEvent): Implemented.
25761 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
25763 2002-07-22 Miguel de Icaza <miguel@ximian.com>
25765 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
25766 but this is required to check for a method name being the same as
25767 the containing class.
25771 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25773 * interface.cs: initialize variable.
25775 2002-07-23 Martin Baulig <martin@gnome.org>
25777 Implemented the IndexerName attribute in interfaces.
25779 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
25780 name if this is an explicit interface implementation.
25781 (Indexer.InterfaceIndexerName): New public variable. If we're
25782 implementing an interface indexer, this is the IndexerName in that
25783 interface. Otherwise, it's the IndexerName.
25784 (Indexer.DefineMethod): If we're implementing interface indexer,
25785 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
25786 and Pending.ImplementIndexer methods.
25787 (Indexer.Define): Also define the PropertyBuilder if we're
25788 implementing an interface indexer and this is neither an explicit
25789 interface implementation nor do the IndexerName match the one in
25792 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
25793 If a method is defined here, then we always need to create a proxy
25794 for it. This is used when implementing interface indexers.
25795 (Pending.IsInterfaceIndexer): New public method.
25796 (Pending.ImplementIndexer): New public method.
25797 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
25798 This is used when implementing interface indexers to define a proxy
25800 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
25801 define a proxy if necessary.
25803 * interface.cs (Interface.IndexerName): New public variable.
25804 (Interface.PopulateIndexer): Set the IndexerName.
25805 (Interface.DefineIndexers): New private method. Populate all the
25806 indexers and make sure their IndexerNames match.
25808 * typemanager.cs (IndexerPropertyName): Added support for interface
25811 2002-07-22 Martin Baulig <martin@gnome.org>
25813 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
25814 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
25815 ret if HasReturnLabel.
25816 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
25819 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
25820 and set the ec.LoopBeginTryCatchLevel.
25821 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
25822 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
25823 the current ec.TryCatchLevel, the branch goes out of an exception
25824 block. In this case, we need to use Leave and not Br.
25826 2002-07-22 Martin Baulig <martin@gnome.org>
25828 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
25829 block unless the block does not always return or it is contained in
25830 another try { ... } catch { ... } block. Fixes bug #26506.
25831 Added verify-1.cs to the test suite.
25833 2002-07-22 Martin Baulig <martin@gnome.org>
25835 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
25836 then we do not always return. Fixes bug #24985.
25838 2002-07-22 Martin Baulig <martin@gnome.org>
25840 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
25841 lookup on a per-class level; ie. walk up the class hierarchy until we
25842 found at least one applicable method, then choose the best among them.
25843 Fixes bug #24463 and test-29.cs.
25845 2002-07-22 Martin Baulig <martin@gnome.org>
25847 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
25848 return types of the methods. The return type is not part of the
25849 signature and we must not check it to make the `new' modifier work.
25850 Fixes bug #27999, also added test-147.cs.
25851 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
25853 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
25854 on the method's return type.
25856 2002-07-21 Martin Baulig <martin@gnome.org>
25858 * assign.cs: Make this work if the rightmost source is a constant and
25859 we need to do an implicit type conversion. Also adding a few more tests
25860 to test-38.cs which should have caught this.
25862 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
25863 target in the makefile for this. The makefile.gnu is primarily intended
25864 for end-users who don't want to debug the compiler.
25866 2002-07-21 Martin Baulig <martin@gnome.org>
25868 * assign.cs: Improved the Assign class so it can now handle embedded
25869 assignments (X = Y = Z = something). As a side-effect this'll now also
25870 consume less local variables. test-38.cs now passes with MCS, added
25871 a few new test cases to that test.
25873 2002-07-20 Martin Baulig <martin@gnome.org>
25875 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
25876 instructions. Fixes bug #27977, also added test-146.cs.
25878 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25880 * cs-tokenizer.cs: fixed getHex ().
25882 2002-07-19 Martin Baulig <martin@gnome.org>
25884 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
25885 not Type.GetType() to lookup the array type. This is needed when
25886 we're constructing an array of a user-defined type.
25887 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
25888 single-dimensional arrays, but also for single-dimensial arrays of
25891 2002-07-19 Martin Baulig <martin@gnome.org>
25893 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
25894 this function is called, it's not allowed to share LocalBuilders
25895 among ILGenerators.
25897 2002-07-19 Martin Baulig <martin@gnome.org>
25899 * expression.cs (Argument.Resolve): Report an error 118 when trying
25900 to pass a type as argument.
25902 2002-07-18 Martin Baulig <martin@gnome.org>
25904 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
25905 Conv_R_Un for the signed `long' type.
25907 2002-07-15 Miguel de Icaza <miguel@ximian.com>
25909 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
25910 `expr' for the temporary result, as that will fail if we do
25911 multiple resolves on the same expression.
25913 2002-07-05 Miguel de Icaza <miguel@ximian.com>
25915 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
25916 ec.TypeContainer for looking up aliases.
25918 * class.cs (TypeContainer): Remove LookupAlias from here.
25920 * decl.cs (DeclSpace); Move here.
25922 2002-07-01 Miguel de Icaza <miguel@ximian.com>
25924 * class.cs (FindMembers): Only call filter if the constructor
25925 bulider is not null.
25927 Also handle delegates in `NestedTypes' now. Now we will perform
25928 type lookups using the standard resolution process. This also
25931 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
25932 This uses Expressions (the limited kind that can be parsed by the
25933 tree) instead of strings.
25935 * expression.cs (ComposedCast.ToString): Implement, used to flag
25936 errors since now we have to render expressions.
25938 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
25941 * ecore.cs (SimpleName.ToString): ditto.
25943 * cs-parser.jay: Instead of using strings to assemble types, use
25944 Expressions to assemble the type (using SimpleName, ComposedCast,
25945 MemberAccess). This should fix the type lookups in declarations,
25946 because we were using a different code path for this.
25948 * statement.cs (Block.Resolve): Continue processing statements
25949 even when there is an error.
25951 2002-07-17 Miguel de Icaza <miguel@ximian.com>
25953 * class.cs (Event.Define): Also remove the `remove' method from
25954 the list of pending items.
25956 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
25957 generate more compact code.
25959 2002-07-17 Martin Baulig <martin@gnome.org>
25961 * const.cs (Const.LookupConstantValue): Add support for constant
25962 `unchecked' and `checked' expressions.
25963 Also adding test case test-140.cs for this.
25965 2002-07-17 Martin Baulig <martin@gnome.org>
25967 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
25968 check whether mi.ReturnType implements the IEnumerator interface; the
25969 `==' and the IsAssignableFrom() will fail in this situation.
25971 2002-07-16 Ravi Pratap <ravi@ximian.com>
25973 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
25976 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25978 * expression.cs: fixed bug #27811.
25980 2002-07-14 Miguel de Icaza <miguel@ximian.com>
25982 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
25983 Molaro: when we are a ref, the value already contains a pointer
25984 value, do not take the address of it.
25986 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
25987 * removed mb-parser.jay and mb-tokenizer.cs
25989 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
25991 * expression.cs: check against the building corlib void type.
25993 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
25995 * ecore.cs: fix for valuetype static readonly fields: when
25996 initializing them, we need their address, not the address of a copy.
25998 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26000 * typemanager.cs: register also enum_type in corlib.
26002 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26004 * class.cs: allow calling this (but not base) initializers in structs.
26006 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
26008 * ecore.cs: make sure we compare against the building base types
26011 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26013 * typemanager.cs: fix TypeToCoreType() to handle void and object
26014 (corlib gets no more typerefs after this change).
26016 2002-07-12 Miguel de Icaza <miguel@ximian.com>
26018 * expression.cs (ArrayCreation.EmitArrayArguments): use
26019 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
26021 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
26022 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
26023 array indexes, the runtime actually forbids them.
26025 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
26026 for array arguments here.
26028 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
26029 instead of the default for ValueTypes.
26031 (New.DoEmit): Use IsValueType instead of
26032 IsSubclassOf (value_type)
26033 (New.DoResolve): ditto.
26034 (Invocation.EmitCall): ditto.
26036 * assign.cs (Assign): ditto.
26038 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
26039 Statements *are* currently doing part of their resolution during
26042 Expressions do always resolve during resolve, but statements are
26043 only required to propagate resolution to their children.
26045 2002-07-11 Miguel de Icaza <miguel@ximian.com>
26047 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
26049 (LoadAssembly): Do not add the dll if it is already specified
26051 (MainDriver): Add the System directory to the link path at the end,
26052 after all the other -L arguments.
26054 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
26055 wrong opcode for loading bytes and bools (ldelem.i1 instead of
26056 ldelem.u1) and using the opposite for sbytes.
26058 This fixes Digger, and we can finally run it.
26060 * driver.cs (UnixParseOption): Move the option parsing here.
26061 (CSCParseOption): Implement CSC-like parsing of options.
26063 We now support both modes of operation, the old Unix way, and the
26064 new CSC-like way. This should help those who wanted to make cross
26065 platform makefiles.
26067 The only thing broken is that /r:, /reference: and /lib: are not
26068 implemented, because I want to make those have the same semantics
26069 as the CSC compiler has, and kill once and for all the confussion
26070 around this. Will be doing this tomorrow.
26072 * statement.cs (Unsafe.Resolve): The state is checked during
26073 resolve, not emit, so we have to set the flags for IsUnsfe here.
26075 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26077 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
26078 not catch the Error_ObjectRefRequired in SimpleName (as it is
26079 possible to have a class/instance variable name that later gets
26080 deambiguated), we have to check this here.
26082 2002-07-10 Ravi Pratap <ravi@ximian.com>
26084 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
26085 make static and put into Expression.
26087 (Event.Define): Register the private field of the event with the
26088 TypeManager so that GetFieldFromEvent can get at it.
26090 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
26091 keep track of the private field associated with an event which
26094 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
26097 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
26099 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26101 * expression.cs (Binary.EmitBranchable): this routine emits the
26102 Binary expression in a branchable context. This basically means:
26103 we need to branch somewhere, not just get the value on the stack.
26105 This works together with Statement.EmitBoolExpression.
26107 * statement.cs (Statement.EmitBoolExpression): Use
26110 2002-07-09 Miguel de Icaza <miguel@ximian.com>
26112 * statement.cs (For): Reduce the number of jumps in loops.
26114 (For): Implement loop inversion for the For statement.
26116 (Break): We can be breaking out of a Try/Catch controlled section
26117 (foreach might have an implicit try/catch clause), so we need to
26118 use Leave instead of Br.
26120 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
26121 now). If the instace expression supports IMemoryLocation, we use
26122 the AddressOf method from the IMemoryLocation to extract the
26123 address instead of emitting the instance.
26125 This showed up with `This', as we were emitting the instance
26126 always (Emit) instead of the Address of This. Particularly
26127 interesting when This is a value type, as we dont want the Emit
26128 effect (which was to load the object).
26130 2002-07-08 Miguel de Icaza <miguel@ximian.com>
26132 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
26134 * statement.cs (Checked): Set the CheckedState during the resolve
26135 process too, as the ConvCast operations track the checked state on
26136 the resolve process, and not emit.
26138 * cs-parser.jay (namespace_member_declaration): Flag that we have
26139 found a declaration when we do. This is used to flag error 1529
26141 * driver.cs: Report ok when we display the help only.
26143 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
26145 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
26147 2002-07-04 Miguel de Icaza <miguel@ximian.com>
26149 * cs-tokenizer.cs (define): We also have to track locally the
26150 defines. AllDefines is just used for the Conditional Attribute,
26151 but we also need the local defines for the current source code.
26153 2002-07-03 Miguel de Icaza <miguel@ximian.com>
26155 * statement.cs (While, For, Do): These loops can exit through a
26156 Break statement, use this information to tell whether the
26157 statement is the last piece of code.
26159 (Break): Flag that we break.
26161 * codegen.cs (EmitContexts): New `Breaks' state variable.
26163 2002-07-03 Martin Baulig <martin@gnome.org>
26165 * class.cs (TypeContainer.MethodModifiersValid): Allow override
26166 modifiers in method declarations in structs. Otherwise, you won't
26167 be able to override things like Object.Equals().
26169 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26171 * class.cs (Method, Property, Indexer): Do not allow the public
26172 modifier to be used in explicit interface implementations.
26174 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
26175 override modifiers in method declarations in structs
26177 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
26179 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
26180 integer or real overflow, report an error
26182 2002-07-02 Martin Baulig <martin@gnome.org>
26184 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
26185 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
26186 to tell the runtime about our newly created System.Object and
26187 System.ValueType types.
26189 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26191 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
26192 struct instead of Ldarg/Starg.
26194 2002-07-02 Martin Baulig <martin@gnome.org>
26196 * expression.cs (Indirection.Indirection): Call
26197 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
26199 2002-07-02 Martin Baulig <martin@gnome.org>
26201 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
26202 ValueType, call TypeManager.TypeToCoreType() on it.
26203 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
26204 the OpCodes.Newarr argument.
26206 2002-07-02 Martin Baulig <martin@gnome.org>
26208 * expression.cs (Invocation.EmitCall): When compiling corlib,
26209 replace all calls to the system's System.Array type to calls to
26210 the newly created one.
26212 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
26213 System.Array methods.
26214 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
26215 from the system's System.Array type which must be replaced.
26217 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
26219 * typemanager.cs: load unverifiable_code_ctor so we can build
26220 corlib using the correct type. Avoid using GetTypeCode() with
26222 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
26223 TypeManager.object_type to allow building corlib.
26225 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26227 * ecore.cs: handle System.Enum separately in LoadFromPtr().
26229 2002-07-01 Martin Baulig <martin@gnome.org>
26231 * class.cs: Make the last change actually work, we need to check
26232 whether `ifaces != null' to avoid a crash.
26234 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26236 * class.cs: when we build structs without fields that implement
26237 interfaces, we need to add the interfaces separately, since there is
26238 no API to both set the size and add the interfaces at type creation
26241 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26243 * expression.cs: the dimension arguments to the array constructors
26244 need to be converted if they are a long.
26246 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
26248 * class.cs: don't emit ldarg.0 if there is no parent constructor
26249 (fixes showstopper for corlib).
26251 2002-06-29 Martin Baulig <martin@gnome.org>
26253 MCS now compiles corlib on GNU/Linux :-)
26255 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
26256 ie. check for MethodImplOptions.InternalCall.
26258 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
26259 and TypeManager.attribute_type are null, so we must explicitly check
26260 whether parent is not null to find out whether it's an attribute type.
26261 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
26262 and SetBuilder, not only if the property is neither abstract nor external.
26263 This is necessary to set the MethodImplOptions on the accessor methods.
26264 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
26265 SetBuilder, see Property.Emit().
26267 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
26268 populate "System.Object", "System.ValueType" and "System.Attribute" since
26269 they've already been populated from BootCorlib_PopulateCoreTypes().
26271 2002-06-29 Martin Baulig <martin@gnome.org>
26273 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
26274 is the NullLiteral, we also need to make sure that target_type is not
26277 2002-06-29 Martin Baulig <martin@gnome.org>
26279 * rootcontext.cs (RootContext.ResolveCore): We must initialize
26280 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
26281 before calling BootstrapCorlib_ResolveDelegate ().
26283 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26285 * statement.cs: fixed build-breaker. All tests passed ok.
26287 2002-06-27 Martin Baulig <martin@gnome.org>
26289 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
26290 for System.Decimal when compiling corlib.
26292 2002-06-27 Martin Baulig <martin@gnome.org>
26294 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
26295 switch blocks which contain nothing but a default clause.
26297 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
26299 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
26301 2002-06-27 Martin Baulig <martin@gnome.org>
26303 * ecore.cs (PropertyExpr.PropertyExpr): Call
26304 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
26306 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
26307 is already a TypeBuilder.
26309 2002-06-27 Martin Baulig <martin@gnome.org>
26311 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
26312 `target_type == TypeManager.array_type', not IsAssignableFrom() in
26313 the "from an array-type to System.Array" case. This makes it work
26314 when compiling corlib.
26316 2002-06-27 Martin Baulig <martin@gnome.org>
26318 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
26319 non-static PropertyExpr, set its InstanceExpression. This makes
26320 the `ICollection.Count' property work in System/Array.cs.
26322 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
26324 * driver.cs: Made error handling more consistent. Errors now
26325 tracked by Report class, so many methods which used to return int
26326 now return void. Main() now prints success/failure and
26327 errors/warnings message.
26329 Renamed '--probe' compiler argument to '--expect-error'. Removed
26330 the magic number return values (123 and 124). Now, if the
26331 expected error occurs, the compiler exits with success (exit value
26332 0). If the compilation completes without seeing that particular
26333 error, the compiler exits with failure (exit value 1). The
26334 makefile in mcs/errors has been changed to handle the new behaviour.
26336 * report.cs: Made 'expected error' number a property and renamed
26337 it from 'Probe' to 'ExpectedError'.
26339 * genericparser.cs: Removed error handling support, since it is
26340 now all done by Report class.
26342 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
26343 class, so parse() no longer returns an int.
26345 * namespace.cs: Use Report.Error instead of GenericParser.error
26347 2002-06-22 Miguel de Icaza <miguel@ximian.com>
26349 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
26350 TypeContainer.AddOperator): At the front of the list put the
26351 explicit implementations, so they get resolved/defined first.
26353 2002-06-21 Miguel de Icaza <miguel@ximian.com>
26355 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
26356 interface type is implemented by this TypeContainer. Used during
26357 explicit interface implementation.
26359 (Property.Define, Indexer.Define, Method.Define): Validate that
26360 the given interface in the explicit implementation is one of the
26361 base classes for the containing type.
26363 Also if we are explicitly implementing an interface, but there is
26364 no match in the pending implementation table, report an error.
26366 (Property.Define): Only define the property if we are
26367 not explicitly implementing a property from an interface. Use the
26368 correct name also for those properties (the same CSC uses,
26369 although that is really not needed).
26371 (Property.Emit): Do not emit attributes for explicitly implemented
26372 properties, as there is no TypeBuilder.
26374 (Indexer.Emit): ditto.
26376 Hiding then means that we do not really *implement* a pending
26377 implementation, which makes code fail.
26379 2002-06-22 Martin Baulig <martin@gnome.org>
26381 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
26382 the return value of Object.GetType(). [FIXME: we need to do this whenever
26383 we get a type back from the reflection library].
26385 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26387 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
26389 2002-06-20 Miguel de Icaza <miguel@ximian.com>
26391 * attribute.cs: Return null if we can not look up the type.
26393 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
26394 the interface types found.
26396 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
26397 interface types found.
26399 * typemanager.cs (GetInterfaces): Make this routine returns alll
26400 the interfaces and work around the lame differences between
26401 System.Type and System.Reflection.Emit.TypeBuilder in the results
26402 result for GetInterfaces.
26404 (ExpandInterfaces): Given an array of interface types, expand and
26405 eliminate repeated ocurrences of an interface. This expands in
26406 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
26409 2002-06-21 Martin Baulig <martin@gnome.org>
26411 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
26414 2002-06-21 Martin Baulig <martin@gnome.org>
26416 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
26417 and called with one of the core types, return the corresponding typebuilder for
26420 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
26423 2002-06-21 Martin Baulig <martin@gnome.org>
26425 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
26426 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
26427 (Expression.ConvertReferenceExplicit): Likewise.
26429 * expression.cs (ElementAccess.DoResolve): Likewise.
26430 (ElementAccess.DoResolveLValue): Likewise.
26432 2002-06-10 Martin Baulig <martin@gnome.org>
26434 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
26435 add the "value" parameter to the parameter list.
26437 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
26440 2002-06-19 Miguel de Icaza <miguel@ximian.com>
26442 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
26443 the argument to an int, uint, long or ulong, per the spec. Also
26444 catch negative constants in array creation.
26446 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
26448 * class.cs: do not allow the same interface to appear twice in
26449 the definition list.
26451 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26453 * ecore.cs: don't use ldlen with System.Array.
26455 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26457 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
26459 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
26461 * modifiers.cs: produce correct field attributes for protected
26462 internal. Easy fix so miguel can work on ther harder stuff:-)
26464 2002-06-18 Miguel de Icaza <miguel@ximian.com>
26466 * pending.cs: New file. Move the code from class.cs here.
26467 Support clearning the pending flag for all methods (when not doing
26468 explicit interface implementation).
26470 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26472 * rootcontext.cs: added a couple more types needed to bootstrap.
26474 2002-06-17 Miguel de Icaza <miguel@ximian.com>
26476 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
26477 constructor in the type, instead of any constructor in the type
26478 hierarchy. Thanks to Paolo for finding this bug (it showed up as
26479 a bug in the Mono runtime when applying the params attribute).
26481 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26482 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
26484 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
26486 * expression.cs (Unary.ResolveOperator): Use TypeManager
26487 to resolve the type.
26489 2002-06-13 Ravi Pratap <ravi@ximian.com>
26491 * cs-parser.jay (enum_member_declaration): Pass in the attributes
26494 * enum.cs (AddEnumMember): Add support to store the attributes associated
26495 with each member too.
26497 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
26498 field builders too - this takes care of the enum member case.
26500 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
26502 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
26503 address-of operator on both value types and pointers.
26505 2002-06-10 Martin Baulig <martin@gnome.org>
26507 * interface.cs (Interface.PopulateIndexer): Add the indexer's
26508 PropertyBuilder to the `property_builders' list.
26510 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
26511 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
26512 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
26513 find any indexers which are inherited from an interface.
26515 2002-06-09 Martin Baulig <martin@gnome.org>
26517 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
26518 the same type as the constant if necessary. There's also a test-130.cs
26521 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
26523 * typemanager.cs (TypeManager.ChangeType): Previously known as
26524 Enum.ChangeEnumType().
26526 2002-06-09 Martin Baulig <martin@gnome.org>
26528 * expression.cs (Cast.TryReduce): Added support for consts.
26530 2002-06-08 Ravi Pratap <ravi@ximian.com>
26532 * class.cs (Accessor): Hold attributes information so we can pass
26535 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
26536 Modify to pass in attributes attached to the methods.
26538 (add_accessor_declaration, remove_accessor_declaration): Ditto.
26540 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
26541 to handle the Accessor kind :-)
26543 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
26545 2002-06-08 Martin Baulig <martin@gnome.org>
26547 * expression.cs (Unary.TryReduceNegative): Added support for
26550 2002-06-08 Martin Baulig <martin@gnome.org>
26552 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
26553 name can't be found in the `defined_names' - the caller will do a
26554 MemberLookup in this case and thus find methods in System.Enum
26555 such as Enum.IsDefined().
26557 2002-06-08 Martin Baulig <martin@gnome.org>
26559 * enum.cs (Enum.ChangeEnumType): This is a custom version of
26560 Convert.ChangeType() which works with TypeBuilder created types.
26561 (Enum.LookupEnumValue, Enum.Define): Use it here.
26563 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
26564 `TypeBuilder.BaseType != null' check.
26565 (TypeContainer.FindMembers): Only lookup parent members if we
26566 actually have a parent.
26567 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
26568 (ConstructorInitializer.Resolve): Likewise.
26570 * interface.cs (Interface.FindMembers): Added
26571 `TypeBuilder.BaseType != null' check.
26573 * rootcontext.cs (RootContext.ResolveCore): Added
26574 "System.Runtime.CompilerServices.IndexerNameAttribute" to
26575 classes_second_stage.
26577 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
26578 debug_type and trace_type when compiling with --nostdlib.
26580 2002-06-07 Martin Baulig <martin@gnome.org>
26582 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
26583 (AddField): Set it to true when adding a non-static field.
26584 (DefineType): Use `have_nonstatic_fields' to find out whether we
26585 have non-static fields, not `Fields != null'.
26587 2002-06-02 Miguel de Icaza <miguel@ximian.com>
26589 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
26590 dereferencing a null on the static-field code path)
26592 2002-05-30 Martin Baulig <martin@gnome.org>
26594 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
26595 to take command line arguments. Use reflection to call the new
26596 custom `Initialize' function on the symbol writer and pass it the
26597 command line arguments.
26599 * driver.cs (--debug-args): New command line argument to pass command
26600 line arguments to the symbol writer.
26602 2002-05-28 Miguel de Icaza <miguel@ximian.com>
26604 * assign.cs (DoResolve): Forgot to do the implicit conversion to
26605 the target type for indexers and properties. Thanks to Joe for
26608 2002-05-27 Miguel de Icaza <miguel@ximian.com>
26610 * typemanager.cs (MethodFlags): returns the method flags
26611 (Obsolete/ShouldIgnore) that control warning emission and whether
26612 the invocation should be made, or ignored.
26614 * expression.cs (Invocation.Emit): Remove previous hack, we should
26615 not do this on matching a base type, we should do this based on an attribute
26617 Only emit calls to System.Diagnostics.Debug and
26618 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
26619 on the command line.
26621 * rootcontext.cs: Global settings for tracing and debugging.
26623 * cs-tokenizer.cs (define): New utility function to track
26624 defines. Set the global settings for TRACE and DEBUG if found.
26626 2002-05-25 Ravi Pratap <ravi@ximian.com>
26628 * interface.cs (Populate*): Pass in the TypeContainer as well as
26629 the DeclSpace as parameters so that we can create EmitContexts and
26630 then use that to apply attributes etc.
26632 (PopulateMethod, PopulateEvent, PopulateProperty)
26633 (PopulateIndexer): Apply attributes everywhere.
26635 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
26638 (ApplyAttributes): Update accordingly.
26640 We now apply interface attributes for all members too.
26642 2002-05-26 Miguel de Icaza <miguel@ximian.com>
26644 * class.cs (Indexer.Define); Correctly check if we are explicit
26645 implementation (instead of checking the Name for a ".", we
26646 directly look up if the InterfaceType was specified).
26648 Delay the creation of the PropertyBuilder.
26650 Only create the PropertyBuilder if we are not an explicit
26651 interface implementation. This means that explicit interface
26652 implementation members do not participate in regular function
26653 lookups, and hence fixes another major ambiguity problem in
26654 overload resolution (that was the visible effect).
26656 (DefineMethod): Return whether we are doing an interface
26659 * typemanager.cs: Temporary hack until we get attributes in
26660 interfaces (Ravi is working on that) and we get IndexerName
26661 support in interfaces.
26663 * interface.cs: Register the indexers as properties.
26665 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
26666 warning, I have verified that this is a bug in the .NET runtime
26667 (JavaScript suffers of the same problem).
26669 * typemanager.cs (MemberLookup): When looking up members for
26670 interfaces, the parent of an interface is the implicit
26671 System.Object (so we succeed in searches of Object methods in an
26672 interface method invocation. Example: IEnumerable x; x.ToString
26675 2002-05-25 Miguel de Icaza <miguel@ximian.com>
26677 * class.cs (Event): Events should also register if they do
26678 implement the methods that an interface requires.
26680 * typemanager.cs (MemberLookup); use the new GetInterfaces
26683 (GetInterfaces): The code used to lookup interfaces for a type is
26684 used in more than one place, factor it here.
26686 * driver.cs: Track the errors at the bottom of the file, we kept
26689 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
26690 instance if the method we are calling is static!
26692 2002-05-24 Miguel de Icaza <miguel@ximian.com>
26694 * attribute.cs (ApplyAttributes): Make this function filter out
26695 the IndexerName attribute (as that attribute in reality is never
26696 applied) and return the string constant for the IndexerName
26699 * class.cs (TypeContainer.Emit): Validate that all the indexers
26700 have the same IndexerName attribute, and if so, set the
26701 DefaultName attribute on the class.
26703 * typemanager.cs: The return value might contain other stuff (not
26704 only methods). For instance, consider a method with an "Item"
26705 property and an Item method.
26707 * class.cs: If there is a problem with the parameter types,
26710 2002-05-24 Ravi Pratap <ravi@ximian.com>
26712 * ecore.cs (ImplicitConversionExists): Wrapper function which also
26713 looks at user defined conversion after making a call to
26714 StandardConversionExists - we need this for overload resolution.
26716 * expression.cs : Update accordingly the various method calls.
26718 This fixes 2 bugs filed against implicit user defined conversions
26720 2002-05-22 Miguel de Icaza <miguel@ximian.com>
26722 * statement.cs: Track the result of the assignment.
26724 2002-05-21 Miguel de Icaza <miguel@ximian.com>
26726 * expression.cs (MemberAccess): Improved error reporting for
26727 inaccessible members.
26729 2002-05-22 Martin Baulig <martin@gnome.org>
26731 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
26732 itself with debugging support.
26734 2002-05-22 Martin Baulig <martin@gnome.org>
26736 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
26737 Removed, this isn't needed anymore.
26739 2002-05-20 Martin Baulig <martin@gnome.org>
26741 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
26742 be underlying type for an enum.
26744 2002-05-20 Miguel de Icaza <miguel@ximian.com>
26746 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
26747 that splits out the loading of just the core types.
26749 * rootcontext.cs (ResolveCore): Split the struct resolution in
26750 two, so we can load the enumeration underlying types before any
26753 * expression.cs (Is): Bandaid until we fix properly Switch (see
26754 bug #24985 for details).
26756 * typemanager.cs (ImplementsInterface): The hashtable will contain
26757 a null if there are no interfaces implemented.
26759 2002-05-18 Miguel de Icaza <miguel@ximian.com>
26761 * cs-parser.jay (indexer_declarator): It is fine to have array
26764 2002-05-17 Miguel de Icaza <miguel@ximian.com>
26766 * typemanager.cs: (RegisterBuilder): New function used to register
26767 TypeBuilders that implement interfaces. Since
26768 TypeBuilder.GetInterfaces (as usual) does not work with lame
26770 (AddUserType): register interfaces.
26772 (ImplementsInterface): Use the builder_to_ifaces hash if we are
26773 dealing with TypeBuilder. Also, arrays are showing up as
26774 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
26775 methods can not be invoked on them!
26777 * ecore.cs (ExplicitReferenceConversionExists): Made public.
26778 (ImplicitReferenceConversionExists): Split out from
26779 StandardConversionExists.
26781 * expression.cs (As): We were only implementing one of the three
26782 cases for the as operator. We now implement them all.
26783 (Is): Implement the various other cases for Is as well.
26785 * typemanager.cs (CACHE): New define used to control if we want or
26786 not the FindMembers cache. Seems to have a negative impact on
26787 performance currently
26789 (MemberLookup): Nested types have full acess to
26790 enclosing type members
26792 Remove code that coped with instance/static returns for events, we
26793 now catch this in RealFindMembers.
26795 (RealFindMembers): only perform static lookup if the instance
26796 lookup did not return a type or an event.
26798 2002-05-17 Miguel de Icaza <miguel@ximian.com>
26800 * assign.cs (CompoundAssign): We pass more semantic information
26801 now to Compound Assignments than we did before: now we have all
26802 the information at hand, and now we resolve the target *before* we
26803 do the expression expansion, which allows the "CacheValue" method
26804 to have the effect we intended (before, a [x] += 1 would generate
26805 two differen ArrayAccess expressions from the ElementAccess,
26806 during the resolution process).
26808 (CompoundAssign.DoResolve): Resolve target and original_source here.
26810 2002-05-16 Miguel de Icaza <miguel@ximian.com>
26812 * expression.cs (ArrayAccess): dropped debugging information.
26814 * typemanager.cs: Small bug fix: I was always returning i_members,
26815 instead of one of i_members or s_members (depending on which had
26818 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
26819 method is invoked before any code generation takes place, and it
26820 is a mechanism to inform that the expression will be invoked more
26821 than once, and that the method should use temporary values to
26822 avoid having side effects
26824 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
26826 * ecore.cs (Expression.CacheTemporaries): Provide empty default
26829 * expression.cs (Indirection, ArrayAccess): Add support for
26830 CacheTemporaries in these two bad boys.
26832 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
26833 ldobj or ldind_ref.
26834 (StoreFromPtr): Handle stobj as well.
26836 * expression.cs (UnaryMutator): Share more code.
26838 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
26839 down: I was not tracking the Filter function as well, which
26840 was affecting the results of the cache.
26842 2002-05-15 Miguel de Icaza <miguel@ximian.com>
26844 * attribute.cs: Remove the hack to handle the CharSet property on
26847 2002-05-14 Miguel de Icaza <miguel@ximian.com>
26849 * attribute.cs (DoResolve): More uglyness, we now only try to
26850 resolve the attribute partially, to extract the CharSet
26851 information (only if we are a StructLayout attribute). Otherwise
26853 (GetExtraTypeInfo): Add some code to conditionally kill in the
26854 future this. I am more and more convinced that the .NET
26855 framework has special code to handle the attribute setting on
26858 * expression.cs (IsParamsMethodApplicable): Revert my previous
26859 foreach change here, it was wrong.
26861 2002-05-13 Miguel de Icaza <miguel@ximian.com>
26863 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
26864 (pp_expr): do not abort on unknown input, just return.
26865 (eval): abort if there are pending chars.
26867 * attribute.cs (Attribute.Resolve): Positional parameters are
26868 optional. Deal with that case.
26870 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
26871 the Ansi/Unicode/Auto information for the type.
26873 (TypeContainer.DefineType): instantiate the EmitContext here, as
26874 we will be using it during the type definition (to resolve
26875 attributes) and during the emit phase.
26877 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
26878 to pull type information out of the attributes
26880 (Attribute.Resolve): track the constructor builder, and allow for
26881 multiple invocations (structs and classes will use this).
26883 * ecore.cs (MemberLookupFinal): new version with all the
26884 parameters customizable.
26886 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
26887 constructors. Return if the result value is null (as the error
26888 would have been flagged already by MemberLookupFinal)
26890 Do not allow instances of abstract classes or interfaces to be
26893 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
26894 We have to compare the assembly property here when dealing with
26895 FamANDAssem and Assembly access modifiers, because we might be
26896 creating an assembly from *modules* (that means that we are not
26897 getting TypeBuilders for types defined in other modules that are
26898 part of this assembly).
26900 (Method.Emit): If the method is marked abstract and has a body,
26903 (TypeContainer.DefineMembers): If both the defined member and the
26904 parent name match are methods, then do not emit any warnings: let
26905 the Method.Define routine take care of flagging warnings. But if
26906 there is a mismatch (method overrides something else, or method is
26907 overriwritten by something, then emit warning).
26909 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
26910 set to null, this means `do not check for the return type on the
26913 (Method.Define): set the return type for the method signature to
26914 null, so that we get methods with the same name and parameters and
26915 different return types. This is used to flag warning 114 (you are
26916 hiding a method, and you probably want to use the new/override
26919 * typemanager.cs (MemberLookup): Implemented proper access
26920 control, closing a long standing set of bug reports. The problem
26921 was that the Framework only has two bits: Public and NonPublic,
26922 and NonPublic includes private and protected methods, but we need
26923 to enforce the FamANDAssem, FamOrAssem and Family.
26925 2002-05-11 Miguel de Icaza <miguel@ximian.com>
26927 * statement.cs (GotoCase): Return true: Ammounts to giving up
26928 knowledge on whether we return or not, and letting the other case
26929 be responsible for it.
26931 2002-05-10 Miguel de Icaza <miguel@ximian.com>
26933 * driver.cs: Do not load directories for each file processed, only
26934 do it if there is a pattern.
26936 * ecore.cs: Report readonly assigns here as well, as we might have
26937 been resolved only by MemberAccess.
26939 (SimpleName.SimpleNameResolve): Also be useful for LValue
26940 resolution. We need this to propagate assign to local readonly variables
26942 * typemanager.cs: Use a ptrhashtable for the criteria, because we
26943 do not want to reuse potential criteria memory.
26945 * class.cs (MyEventBuilder): Set reflected_type;
26947 * ecore.cs (Constantify): Added support for constifying bools.
26949 (RootContext.LookupType): Added a cache for values looked up in
26950 the declaration space.
26952 * typemanager.cs (FindMembers): Now is a front-end to
26953 RealFindMembers, and provides a two-level hashtable-based cache to
26956 15% performance improvement: from 22.5 to 19.2 seconds.
26958 * expression.cs (IsParamsMethodApplicable): use foreach.
26959 (Invocation.DoResolve): ditto.
26960 (New.DoResolve): ditto.
26961 (ArrayCreation.DoResolve): ditto.
26963 * ecore.cs (FindMostEncompassingType): use foreach.
26965 * delegate.cs (NewDelegate.DoResolve): Use foreach
26967 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
26968 (RemoveMethods): use foreach.
26970 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
26971 nested foreach statements instead of for, and also break out of
26972 the inner loop once a match is found.
26974 (Invocation.OverloadResolve): Use foreach, simplify the code.
26976 2002-05-08 Miguel de Icaza <miguel@ximian.com>
26978 * cfold.cs (BinaryFold): During an enumeration evaluation context,
26979 we actually unwrap the expression to allow for extra information
26982 * expression.cs: Use Shr_Un on unsigned operations.
26984 2002-05-08 Ravi Pratap <ravi@ximian.com>
26986 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
26987 applicable operators was not being considered correctly. This closes
26988 the bug Miguel reported.
26990 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
26992 * attribute.cs: check that the type derives from System.Attribute
26993 and report the correct error in that case (moved the duplicate code to
26994 its own method, too).
26996 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
26998 * attribute.cs: lookup attribute type name as the spec says: first the
26999 bare attribute name and then name + "Attribute" (nant compiles with
27000 mcs after this fix).
27002 2002-05-07 Miguel de Icaza <miguel@ximian.com>
27004 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
27005 Because of the way we parse things, we should try to see if a
27006 UIntConstant can fit in an integer.
27008 2002-05-07 Ravi Pratap <ravi@ximian.com>
27010 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
27011 when we are in an explicit context.
27013 (ConvertReferenceExplicit): When converting from Iface type S to Class
27014 T make sure the rules are implemented as an OR.
27016 * parameter.cs (ParameterType): Make it a property for now although the
27017 purpose really isn't anything immediate.
27019 * expression.cs (Is*Applicable): Do better checking on the parameter type
27020 of a ref/out parameter. The ones from the system assemblies are already
27021 marked with the correct type so we don't need to do any correction.
27023 * ecore.cs (StandardConversionExists): Conversion from Interface types to
27024 the object type is standard too so include that.
27026 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27028 * ecore.cs (StandardConversionExists): Augment with missing code:
27029 deal with IntConstant, LongConstants and Enumerations.
27031 * assign.cs: Report the error, instead of failing silently
27033 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
27034 typecontainer that they are declared, because the
27035 typecontainer/namespace will have the list of using clauses that
27036 need to be applied.
27038 Assembly Attributes were escaping the normal registration
27041 (EmitCode): Apply attributes within an EmitContext that represents
27042 the container they were declared on.
27044 * cs-parser.jay: Track bases for structs. How did I get this wrong?
27046 2002-05-06 Ravi Pratap <ravi@ximian.com>
27048 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
27049 Revamp completely - make much cleaner as we now operate only
27052 (FindMostSpecificSource, FindMostSpecificTarget): New methods
27053 to implement the logic detailed in the spec more correctly.
27055 (UserDefinedConversion): Update accordingly.
27057 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27059 * statement.cs: Return flow analysis information up.
27061 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
27064 (token): Do not consume an extra character before calling
27067 2002-05-06 Piers Haken <piersh@friskit.com>
27069 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
27071 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27073 * class.cs (Constructor.Emit): Set the IsStatic flag in the
27074 EmitContext during the instance constructor initializer
27075 resolution, to stop access to instance variables.
27077 This is mandated by the spec, last paragraph of the `constructor
27078 initializers' section.
27080 2002-05-05 Miguel de Icaza <miguel@ximian.com>
27082 * cs-parser.jay, class.cs (Accessor): new class used to represent
27083 an accessor (get or set). In the past we used `null' to represent
27084 a missing accessor. But this is ambiguous because there was no
27085 way to tell in abstract indexers/properties if one of them was
27088 Now there is a way of addressing that.
27090 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
27091 instead of FindMembers.
27093 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
27094 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
27096 * attribute.cs: Treat indexers and properties as the same in terms
27097 of applying attributes
27099 * ecore.cs (FindMostEncompassedType): Use statically initialized
27100 EmptyExpressions()s like we do elsewhere to avoid creating useless
27101 objects (and we take this out of the tight loop).
27103 (GetConversionOperators): Move the code to extract the actual
27104 operators to a separate routine to clean things up.
27106 2002-05-04 Miguel de Icaza <miguel@ximian.com>
27108 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
27109 events are always registered FieldBuilders.
27111 * class.cs (FieldBase): New class shared by Fields
27113 * delegate.cs: If we are a toplevel delegate, use our full name.
27114 If we are a nested delegate, then only use our tail name.
27116 2002-05-02 Ravi Pratap <ravi@ximian.com>
27118 * expression.cs (IsApplicable): Ensure that we add the "&" to
27119 ref/out types before comparing it with the type of the argument.
27121 (IsParamsMethodApplicable): Ditto.
27123 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
27126 * delegate.cs : Handle the case when we have more than one applicable
27127 method. Flag an error only when we finish checking all.
27129 2002-05-02 Miguel de Icaza <miguel@ximian.com>
27131 * expression.cs: Add support for boolean static initializers.
27133 2002-05-01 Miguel de Icaza <miguel@ximian.com>
27135 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
27137 * parameter.cs (ComputeParameterTypes,
27138 ComputeAndDefineParameterTypes): Better error handling: now we
27139 clear the `types' cache if we fail during any of the type lookups.
27140 We also return the status code correctly to our caller
27142 * delegate.cs: If we fail to define a delegate, abort the extra
27145 * expression.cs (Binary.ResolveOperator): for
27146 operator==(object,object) and operator !=(object, object) we also
27147 have to verify that there is an implicit conversion from one to
27150 (ArrayAccess.DoResolve): Array Access can operate on
27153 2002-04-30 Miguel de Icaza <miguel@ximian.com>
27155 * assign.cs (CompoundAssign): A new class used as a "flag" that
27156 the assignment actually is happening as part of a compound
27157 assignment operator.
27159 During compound assignment, a few new rules exist to enable things
27166 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
27167 to the type of x) if y is implicitly convertible to the type of x,
27168 and the operator is a builtin operator and the return type of the
27169 operator is explicitly convertible to the type of x.
27171 * rootcontext.cs: Reset warning level to 2. 4 catches various
27172 "interesting" features in mcs, we must clean this up at some
27173 point, but currently am trying to kill other bugs ;-)
27175 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
27176 in container classes as well.
27178 * expression.cs (Binary.ResolveOperator): Handle string case
27179 before anything else (as operator overloading does emit an error
27180 before doing anything else).
27182 This code could go away when we move to a table driven model, but
27183 i could not come up with a good plan last night.
27185 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
27187 * typemanager.cs (CSharpName): reimplementation using regex.
27188 * class.cs: added null check for fields in Emit
27189 * rootcontext.cs: set warninglevel to 4
27191 2002-04-29 Miguel de Icaza <miguel@ximian.com>
27193 * typemanager.cs (CSharpName): reimplemented with Lupus
27196 2002-04-28 Miguel de Icaza <miguel@ximian.com>
27198 * statement.cs (If): correclty implement Resolve, because we were
27199 not catching sem errors in there. The same process is needed
27201 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
27204 (Statement.Warning_DeadCodeFound): Factorize code.
27205 (While): Report dead code here too.
27207 (Statement): Added Resolve virtual method to allow
27208 for resolution split from the emit code.
27210 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27212 * statement.cs (EmitBoolExpression): No longer try to resolve the
27214 (MakeBoolean): New utility function that resolve, implicitly
27215 converts to boolean and tags the expression.
27218 (If, Do): Implement dead code elimination.
27219 (While): Implement loop inversion
27221 (Do, While, For, If): Resolve the expression prior to calling our
27224 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
27227 - added method Report28 (warning: program has more than one entry point)
27228 - added method IsEntryPoint, implements paragraph 10.1 of the spec
27229 - modified method Method.Define, the part at the end of the method
27231 * rootcontext.cs: added static public Location EntryPointLocation;
27233 * ../errors/cs0028.cs : Add test case for the above warning.
27236 - modified method CSharpName to allow arrays of primitive type to
27237 be printed nicely (e.g. instead of System.Int32[][] it now prints
27239 - added method CSharpSignature: returns the signature of a method
27240 in string format to be used in reporting errors, warnings, etc.
27242 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
27245 2002-04-26 Ravi Pratap <ravi@ximian.com>
27247 * delegate.cs (Define): Fix extremely silly bug where I was
27248 setting the type of the 'object' parameter of the BeginInvoke
27249 method to System.IAsyncResult instead of System.Object ;-)
27251 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27253 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
27256 (Constructor.Emit): return if we fail to initialize the
27257 constructor. Another door closed!
27259 * expression.cs (New.DoResolve): Improve error message (from -6 to
27260 1501). Use DeclaredOnly lookup to find the exact constructor.
27262 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
27263 loop. This is useful.
27265 * cs-parser.jay: Adjust the default parameters so that destructors
27266 have the proper signature.
27268 2002-04-26 Martin Baulig <martin@gnome.org>
27270 * driver.cs (LoadAssembly): If `assembly' contains any characters
27271 which are only valid in path names and not in assembly names
27272 (currently slash, backslash and point), use Assembly.LoadFrom ()
27273 instead of Assembly.Load () on the `assembly' (before iteration
27274 over the link_paths).
27276 2002-04-26 Martin Baulig <martin@gnome.org>
27278 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
27280 2002-04-25 Miguel de Icaza <miguel@ximian.com>
27282 * class.cs (Property): use the new typemanager.MemberLookup
27284 (TypeContainer.MemberLookup): Implement using the
27285 TypeManager.MemberLookup now.
27287 * typemanager.cs: Make MemberLookup a function of the TypeManager,
27288 and return MemberInfos, so that these can be used without an
27289 EmitContext (what we had before).
27291 2002-04-24 Miguel de Icaza <miguel@ximian.com>
27293 * expression.cs: Fix the case where the argument to params if the
27294 type of the params. I omitted handling this before. Fixed
27296 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27298 * driver.cs: Call BootCorlib_PopulateCoreType
27300 * class.cs (Property.CheckBase): Check for properties only, not
27303 * interface.cs: Temporary hack: try/catch around the
27304 CustomAttributeBuilder, because I am getting an exception that I
27307 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
27308 types whose definitions are required to be there (attributes are
27309 defined before standard types).
27311 Compute definitions as we boot the various types, as they are used
27312 immediately (value_type class will need object_type, but if we do
27313 not initialize object_type, we will pass a null, which will let
27314 the runtime pick the System.Object from the existing corlib, which
27315 is not what we want).
27317 2002-04-22 Patrik Torstensson <totte@labs2.com>
27319 * cs-tokenizer.cs: fixed a number of trim() issues.
27321 2002-04-22 Ravi Pratap <ravi@ximian.com>
27323 * expression.cs (Argument.Type): Ensure that we return the correct
27324 type when we have out or ref parameters [in which case we
27327 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27329 * class.cs (Property, Indexer): Allow extern modifier in there.
27331 * typemanager.cs (InitBaseTypes): Initializes object_type and
27332 value_type, since those will be used early on during the bootstrap
27333 process to compile corlib.
27335 (InitCoreTypes): Move code from here to InitBaseTypes.
27337 2002-04-21 Miguel de Icaza <miguel@ximian.com>
27339 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
27340 single-dimension arrays as using the ldlen opcode.
27342 Daniel Lewis discovered this optimization.
27344 * typemanager.cs: Add signature for System.Array::get_Length
27346 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27348 * statement.cs: report the error when the foreach does not apply to an
27349 array nor a collection.
27351 2002-04-19 Miguel de Icaza <miguel@ximian.com>
27353 * expression.cs: Add implicit conversions to the operator ~.
27355 * constant.cs (DecimalConstant.Emit): Emit decimal value.
27357 * typemanager.cs: Locate the decimal constructor.
27359 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27361 * attribute.cs: use the new property of TypeOf.
27362 * expression.cs: added 'get' property around typearg.
27364 These changes fix a build breaker reported by NickD. Is this the
27365 correct way to fix? If not, please, revert my changes and make it
27368 2002-04-17 Miguel de Icaza <miguel@ximian.com>
27370 * attribute.cs: Add support for typeof in attribute invocations.
27371 I am not sure that this is right though.
27373 2002-04-14 Duncan Mak <duncan@ximian.com>
27375 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
27376 Binary.Operator.Division case.
27378 2002-04-13 Ravi Pratap <ravi@ximian.com>
27380 * class.cs (DefineType): Ensure that we do a proper check on
27381 attribute types and also register it with the TypeManager.
27383 (TypeContainer.Targets): The default for attribute types is
27384 AttributeTargets.All.
27386 * attribute.cs (ApplyAttributes): Registering the attribute type
27387 is done elsewhere, not when we discover we have a Usage attribute.
27389 2002-04-12 Ravi Pratap <ravi@ximian.com>
27391 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
27392 and get rid of is_delegate parameter.
27394 * everywhere : update.
27396 2002-04-12 Ravi Pratap <ravi@ximian.com>
27398 * cs-parser.jay (compilation_unit): Revamp completely to use
27399 some new ideas that I got from Rhys' grammar to solve the problems
27400 with assembly level attributes.
27402 (outer_declaration): New grammar production.
27404 (attribute_sections): Add.
27406 (opt_attributes): Base on attribute_sections
27408 (namespace_declaration): Allow opt_attributes to tackle the case
27409 when we have assembly level attributes - we are clever in this
27412 * attribute.cs (ApplyAttributes): Do not worry about assembly
27413 attributes in the non-global context.
27415 * rootcontext.cs (AddGlobalAttributes): Go back to using this
27416 instead of SetGlobalAttributes.
27418 * class.cs, rootcontext.cs : Ensure we define and generate
27419 attribute types before anything else.
27421 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
27422 and flag the new error -20 for the case when the attribute type
27423 does not have valid targets specified. csc does not catch this.
27425 * ../errors/errors.txt : update for error # -20
27427 2002-04-11 Ravi Pratap <ravi@ximian.com>
27429 * support.cs (InternalParameters.ParameterModifier): Do some null
27430 checking and return sane values.
27432 * class.cs (Method.Define): If we are a PInvoke method, ensure
27433 that we are static and extern. Report error # 601
27435 * ../errors/cs0601.cs : Add test case for the above error.
27437 2002-04-07 Ravi Pratap <ravi@ximian.com>
27439 * rootcontext.cs (attribute_types): We need to keep type of
27440 all attribute types separately and emit code for them first.
27442 (RegisterAttribute) : Implement.
27444 * class.cs (DefineType): Check if the current Type is a custom
27445 attribute type and register it accordingly.
27447 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
27448 adding the first attribute twice and rename to
27450 (SetGlobalAttributes): this.
27452 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
27455 * attribute.cs (ApplyAttributes): Take an additional argument telling us
27456 if we are processing global arguments. Hmm, I am unsure of this.
27458 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27460 * expression.cs: added static array of strings to avoid calling
27461 Enum.ToString () for Operator in Binary. Significant recover of
27464 2002-04-10 Miguel de Icaza <miguel@ximian.com>
27466 * class.cs (FindMembers): Allow the Builders of the various
27467 members to be null. If they are skip them. This only happens
27468 during the PInvoke declaration.
27470 2002-04-09 Miguel de Icaza <miguel@ximian.com>
27472 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
27473 failure, so we do not keep going afterwards.
27475 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
27476 wanted to pass `false' as the `is_delegate' argument. If this is
27477 the case, why not use delegate_type == null to mean `is_delegate =
27478 false' and anything else as is_delegate = true.
27480 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
27482 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
27483 code for the section, not the beginning of the tests.
27485 2002-04-08 Miguel de Icaza <miguel@ximian.com>
27487 * cfold.cs: Handle operator + (Enum x, Underlying x)
27489 * expression.cs (Binary): same. Warn about errors where we have
27490 Enum/Enum in operator + as well.
27492 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
27495 - added support for switch(bool)
27496 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
27497 - add TableSwitchEmit() to handle table-based switch statements
27499 2002-04-05 Ravi Pratap <ravi@ximian.com>
27501 * expression.cs (Invocation.OverloadResolve): Factor out code which
27502 does parameter compatibility checking with arguments so that we can
27503 re-use the code even from Delegate.VerifyApplicability
27505 (VerifyArgumentsCompat): Move above code here.
27507 * delegate.cs (VerifyApplicability): Get rid of duplicate code
27508 and instead make a call to the above method.
27510 2002-03-31 Ravi Pratap <ravi@ximian.com>
27512 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
27513 We use it to keep track of classes which are attribute types.
27515 2002-04-02 Miguel de Icaza <miguel@ximian.com>
27517 * delegate.cs (Delegate.Define): Correctly define the types in the
27518 presence of fixed and array parameters.
27520 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
27523 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
27524 include NonPublic after the first iteration.
27526 * class.cs (Indexer.CheckBase): Only check if both parents are
27529 * cs-parser.jay (accessor_body): If empty, set to null.
27531 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
27532 same code path here to resolve constants names that we did have in
27533 MemberAccess.DoResolve. There is too much code duplicated here.
27535 2002-04-01 Miguel de Icaza <miguel@ximian.com>
27537 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
27539 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
27542 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
27543 tokens, numbers and strings.
27545 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
27548 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
27549 asyncronous parameters and the regular parameters.
27551 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
27552 specify the target directory.
27554 * expression.cs: (This.DoResolve): Simplify
27555 (As.Emit): Optimize, do not generate IsInst if the expression is
27556 always of the given type.
27558 (Is.DoResolve): Bug fix, we were reporting both always/never for
27561 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
27562 creating too many unnecessary arrays.
27564 2002-03-31 Miguel de Icaza <miguel@ximian.com>
27566 * class.cs (EmitFieldInitializer): Use Assign expression to assign
27567 fields instead of rolling our own initializer. Takes care of all
27568 implicit conversions, and drops unnecessary static checks/argument.
27570 2002-03-31 Dick Porter <dick@ximian.com>
27572 * driver.cs: use the GetDirectories() return values properly, and
27573 use "/" as path separator.
27575 2002-03-30 Miguel de Icaza <miguel@ximian.com>
27577 * expression.cs (Unary): Optimize - - expr into expr.
27578 (Binary): Optimize a + (-b) into a -b.
27580 * codegen.cs (CodeGen): Made all methods static.
27582 2002-03-29 Miguel de Icaza <miguel@ximian.com>
27586 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
27587 TypeBuilder property.
27589 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
27592 * tree.cs: Removed the various RecordXXXX, and replaced with a
27593 single RecordDecl. Removed all the accessor methods, and just
27594 left a single access point Type
27596 * enum.cs: Rename DefineEnum to DefineType.
27598 * decl.cs: New abstract method `DefineType' used to unify the
27599 Defines for Enumerations, Interfaces, TypeContainers and
27602 (FindType): Moved LookupInterfaceOrClass here. Moved the
27603 LookupBaseClasses method that used to live in class.cs and
27604 interface.cs here, and renamed to FindType.
27606 * delegate.cs: Implement DefineType. Take advantage of the
27607 refactored pattern for locating the parent builder without taking
27608 the parent_builder argument (which we know does not work if we are
27609 nested, and triggering a toplevel definition).
27611 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27613 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
27614 accessibility of a member has changed during override and report
27617 * class.cs (Method.Define, Property.Define): Only complain on
27618 overrides if the method is private, any other accessibility is
27619 fine (and since we just checked the permission is the same, we are
27622 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
27623 and elif are processed always. The other pre-processing
27624 directives are only processed if we are "taking" the path
27626 2002-03-29 Martin Baulig <martin@gnome.org>
27628 * class.cs (Method.Emit): Only emit symbolic debugging info if the
27629 current location is not Null.
27631 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
27632 a separate method so we can profile it.
27634 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
27635 `span.Seconds' are just seconds, but no minutes or hours.
27636 (MainDriver): Profile the CodeGen.SaveSymbols calls.
27638 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27640 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
27641 Remove the gratuitous set of Final:
27643 // If an interface implementation, then we can set Final.
27644 if (((flags & MethodAttributes.Abstract) == 0) &&
27645 implementing.DeclaringType.IsInterface)
27646 flags |= MethodAttributes.Final;
27648 I do not know what I was smoking when I used that.
27651 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
27652 step into fixing the name resolution issues for delegates and
27653 unifying the toplevel name resolution.
27655 2002-03-28 Martin Baulig <martin@gnome.org>
27657 * class.cs (Method.Emit): If we have a symbol writer, call its
27658 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
27659 tell it about the current method.
27661 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
27662 writer that we're going to emit the first byte of IL code for a new
27663 statement (a new source line).
27664 (EmitContext.EmitTopBlock): If we have a symbol writer, call
27665 EmitContext.Mark() before emitting any code.
27667 * location.cs (SymbolDocument): Return null when we're Null.
27669 * statement.cs (Statement): Moved the `Location loc' variable here.
27670 (Statement.EmitBoolExpression): If we have a symbol writer, call
27671 ec.Mark() before emitting any code to tell it that we're at the
27672 beginning of a new statement.
27673 (StatementExpression): Added `Location' argument to the constructor.
27674 (Block): Added public readonly variable `StartLocation' and public
27675 variable `EndLocation'. The latter is to be set using SetEndLocation().
27676 (Block): Added constructor which takes a start and end location.
27677 (Block.SetEndLocation): New method. This sets the end location.
27678 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
27679 local variables we create.
27680 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
27681 each statement and do also mark the begin and end of the block.
27683 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
27684 tell it the current lexer.Location, use Location.Null for the end of the
27686 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
27687 current block, set its end location using SetEndLocation().
27688 (statement_expression): StatementExpression constructor now takes the
27689 lexer.Location as additional argument.
27690 (for_statement, declare_local_variables): Likewise.
27691 (declare_local_variables): When creating a new implicit block, use the
27692 new Block constructor and pass it the lexer.Location.
27694 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27696 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
27697 members also on the parent interfaces recursively.
27699 2002-03-27 Miguel de Icaza <miguel@ximian.com>
27701 * report.cs: Use new formats, since Gonzalo finished the missing
27704 * expression.cs (Binary.ResolveOperator): added missing operator|
27705 operator& and operator^ for bool/bool.
27707 * cs-parser.jay: CheckDef now takes a Location argument that is
27708 used to report errors more precisly (instead of reporting the end
27709 of a definition, we try to track something which is a lot closer
27710 to the source of the problem).
27712 * cs-tokenizer.cs: Track global token use, so we can properly flag
27713 the use of #define/#undef after the first token has been seen.
27715 Also, rename the reportXXXX to Error_DescriptiveName
27717 * decl.cs (DeclSpace.IsTopLevel): Move property here from
27718 TypeContainer, so that Enum and Interface can use this too.
27720 * class.cs (TypeContainer.LookupInterfaceOrClass,
27721 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
27722 `builder' argument. Typically this was used to pass the parent
27723 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
27726 The problem is that a nested class could trigger the definition of
27727 a toplevel class, and the builder would be obviously wrong in that
27730 So we drop this argument, and we compute dynamically the
27731 TypeBuilder/ModuleBuilder (the correct information was available
27732 to us anyways from DeclSpace.Parent)
27734 * interface.cs (Interface.DefineInterface): Drop builder
27735 parameter cleanup like class.cs
27737 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
27740 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
27743 (Try.Emit): Propagate the returns value from the statement.
27745 (Return.Emit): Even if we are leavning
27747 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
27749 * modifiers.cs: Fix the computation of MethodAttributes flags.
27751 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
27753 * driver.cs: allow compilation of files that start with '/'.
27754 Add a default case when checking the argument of --target.
27756 2002-03-25 Miguel de Icaza <miguel@ximian.com>
27758 * interface.cs: Implement the same search algorithm for types in
27759 the interface code.
27761 * delegate.cs: Do not allow multiple definition.
27763 * Recovered ChangeLog that got accidentally amputated
27765 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
27767 * rootcontext.cs: Load manually enum to allow core classes to
27768 contain enumerations.
27770 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
27771 Update to new static methods in TypeManager.
27773 * typemanager.cs (GetMethod, GetConstructor): Use our
27774 implementation of FindMembers to find the members, since during
27775 corlib compilation, the types are TypeBuilders and GetMethod and
27776 GetConstructor do not work.
27778 Make all methods in TypeManager static.
27780 (InitCodeHelpers): Split the functionality from
27781 the InitCodeTypes function.
27783 * driver.cs: Call InitCodeHelpers after we have populated the
27786 * cs-parser.jay (delegate_declaration): we did not used to compute
27787 the delegate name correctly for void delegates.
27789 2002-03-24 Miguel de Icaza <miguel@ximian.com>
27791 * rootcontext.cs (RootContext): Init the interface_resolve_order
27792 and type_container_resolve_order always.
27794 (ResolveCore, BootstrapCorlib_ResolveClass,
27795 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
27796 compiler when compiling with --nostdlib
27798 * class.cs (TypeContainer.DefineType): Check that our parent is
27799 not null. This test is most important when we are bootstraping
27802 * codegen.cs: Split out the symbol writing code.
27804 2002-03-25 Martin Baulig <martin@gnome.org>
27806 * driver.cs (-g): Made -g an alias for --debug.
27808 2002-03-24 Martin Baulig <martin@gnome.org>
27810 * codegen.cs (SymbolWriter): New public variable. Returns the
27811 current symbol writer.
27812 (CodeGen): Added `bool want_debugging_support' argument to the
27813 constructor. If true, tell the ModuleBuild that we want debugging
27814 support and ask it for the ISymbolWriter.
27815 (Save): If we have a symbol writer, call it's Close() method after
27816 saving the assembly.
27818 * driver.c (--debug): New command line argument to create a
27819 debugger information file.
27821 * location.cs (SymbolDocument): New public property. Returns an
27822 ISymbolDocumentWriter object for the current source file or null
27823 if we don't have a symbol writer.
27825 2002-03-21 Miguel de Icaza <miguel@ximian.com>
27827 * driver.cs (LoadAssembly): Correctly return when all the paths
27828 have been tried and not before.
27830 * statement.cs (Switch.Emit): return the actual coverage for this
27831 statement (returns/not-returns)
27833 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
27834 switch of the statement if we are the last switch section. That
27835 kills two problems: try/catch problems (we used to emit an empty
27836 nop at the end) and switch statements where all branches would
27839 2002-03-19 Miguel de Icaza <miguel@ximian.com>
27841 * driver.cs: Add default assemblies (the equivalent to the
27842 Microsoft CSC.RSP file)
27844 * cs-tokenizer.cs: When updating `cols and setting it to zero,
27845 also update tokens_seen and set it to false.
27847 * driver.cs: Implement --recurse for Mike.
27849 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
27850 correctly splitting out the paths.
27852 2002-03-18 Miguel de Icaza <miguel@ximian.com>
27854 * interface.cs (Interface.PopulateProperty): Instead of using
27855 `parent' as the declaration space for the set parameters, use
27858 * support.cs (InternalParameters): InternalParameters constructor
27859 takes a DeclSpace instead of a TypeContainer.
27861 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
27862 types are being initialized, load the address of it before calling
27865 (New): Provide a mechanism to disable the generation of local
27866 value type temporaries when the caller will be providing us with
27867 an address to store it.
27869 (ArrayCreation.EmitDynamicInitializers): Use it.
27871 2002-03-17 Miguel de Icaza <miguel@ximian.com>
27873 * expression.cs (Invocation.EmitArguments): Only probe for array
27874 property if there is more than one argument. Sorry about that.
27876 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
27877 empty param arrays.
27879 * class.cs (Method.LabelParameters): Fix incorrect code path that
27880 prevented the `ParamArrayAttribute' from being applied to the
27883 2002-03-16 Miguel de Icaza <miguel@ximian.com>
27885 * support.cs (ReflectionParameters): Correctly compute whether the
27886 last argument is a params array. Fixes the problem with
27889 * typemanager.cs: Make the assemblies array always be non-null
27890 (empty, but non-null)
27892 * tree.cs (RecordDecl): New function that abstracts the recording
27893 of names. This reports error 101, and provides a pointer to the
27894 previous declaration. Fixes a crash in the compiler.
27896 * cs-parser.jay (constructor_declaration): Update to new grammar,
27897 and provide a constructor_body that can be empty.
27899 2002-03-15 Miguel de Icaza <miguel@ximian.com>
27901 * driver.cs: Add support for --resources.
27903 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
27904 Make all types for the various array helper methods be integer.
27906 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
27907 CheckState to ConvCast.
27909 (ConvCast): Now it takes a `checked' state argument, to avoid
27910 depending on the emit context for the conversion, and just using
27911 the resolve time setting.
27913 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
27914 instead of Invocation.EmitArguments. We do not emit the original
27915 arguments, instead we emit those which have been converted to
27916 unsigned int expressions.
27918 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
27920 * codegen.cs: ditto.
27922 * expression.cs (LocalVariableReference): Drop the use of the
27923 Store function that depended on the variable index.
27925 * statement.cs (VariableInfo): Drop the `Idx' property from this
27926 class, as this is not taking into account the indexes for
27927 temporaries tat we generate during the execution, getting the
27930 * class.cs: First emit class initializers, then call the parent
27933 * expression.cs (Binary): Fix opcode emision.
27934 (UnaryMutator.EmitCode): Support checked code generation
27936 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
27937 matches for events for both the Static and Instance scans,
27938 pointing to the same element. Fix that.
27940 2002-03-14 Miguel de Icaza <miguel@ximian.com>
27942 * rootcontext.cs (ResolveTree): Always set the
27943 interface_resolve_order, because nested interfaces will be calling
27946 * class.cs (GetInterfaceOrClass): Track the same resolution
27947 process used by TypeManager.LookupType. This fixes the nested
27948 type lookups in class declarations (separate path from
27951 (TypeContainer.DefineType): Also define nested interfaces.
27952 (TypeContainer.RegisterOrder): New public function used to
27953 register the order in which child interfaces need to be closed.
27955 Nested interfaces need to be closed after their parents have been
27958 * interface.cs (InterfaceAttr): Put all the logic for computing
27959 the interface attribute here.
27961 (DefineInterface): Register our interface order with the
27962 RootContext or with the TypeContainer depending on the case.
27964 2002-03-12 Miguel de Icaza <miguel@ximian.com>
27966 * cs-parser.jay: rework foreach statement to work with the new
27967 changes to the policy on SimpleNames.
27969 * report.cs: support Stacktrace on warnings as well.
27971 * makefile: drop --unsafe and /unsafe from the compile.
27973 2002-03-13 Ravi Pratap <ravi@ximian.com>
27975 * ecore.cs (StandardConversionExists): Modify to take an Expression
27976 as the first parameter. Ensure we do null -> reference type conversion
27979 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
27980 temporary Expression objects.
27982 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
27984 * interface.cs: workaround bug in method overloading resolution
27985 (there is already a bugzilla bug for it).
27987 2002-03-12 Miguel de Icaza <miguel@ximian.com>
27989 We could also solve this problem by having a separate path for
27990 performing type lookups, instead of DoResolve, we could have a
27991 ResolveType entry point, and only participating pieces of the
27992 production (simplename, deref, array) would implement this.
27994 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
27995 signal SimpleName to only resolve type names and not attempt to
27996 resolve anything else.
27998 * expression.cs (Cast): Set the flag.
28000 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
28002 * class.cs: Only report 108 if there is no `new' modifier.
28004 * cs-parser.jay: rework foreach statement to work with the new
28005 changes to the policy on SimpleNames.
28007 * report.cs: support Stacktrace on warnings as well.
28009 * makefile: drop --unsafe and /unsafe from the compile.
28011 2002-03-11 Miguel de Icaza <miguel@ximian.com>
28013 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28014 lookups here, instead of doing that at parse time. This means
28015 that our grammar will not introduce `LocalVariableReferences' as
28016 expressions at this point. That solves the problem of code like
28020 static void Main ()
28024 This is only half the fix. The full fix requires parameters to
28025 also be handled in this way.
28027 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
28028 makes the use more obvious of the DeclSpace. The
28029 ec.TypeContainer.TypeBuilder is now only used to pull the
28030 TypeBuilder for it.
28032 My theory is that I can get rid of the TypeBuilder completely from
28033 the EmitContext, and have typecasts where it is used (from
28034 DeclSpace to where it matters).
28036 The only pending problem is that the code that implements Aliases
28037 is on TypeContainer, and probably should go in DeclSpace.
28039 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28040 lookups here, instead of doing that at parse time. This means
28041 that our grammar will not introduce `LocalVariableReferences' as
28042 expressions at this point. That solves the problem of code like
28046 static void Main ()
28050 This is only half the fix. The full fix requires parameters to
28051 also be handled in this way.
28053 * class.cs (Property.DefineMethod): When implementing an interface
28054 method, set newslot, when implementing an abstract method, do not
28055 set the flag (before we tried never setting it, or always setting
28056 it, which is the difference).
28057 (Indexer.DefineMethod): same.
28058 (Method.DefineMethod): same.
28060 * ecore.cs: Only set the status used flag if we get back a Field.
28062 * attribute.cs: Temporary hack, so Paolo can keep working.
28064 2002-03-08 Ravi Pratap <ravi@ximian.com>
28066 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
28067 the unmanaged type in the case we have a MarshalAs attribute.
28069 (Resolve): Handle the case when we are parsing the special MarshalAs
28070 attribute [we need to store the unmanaged type to use later]
28072 * typemanager.cs (marshal_as_attr_type): Built in type for the
28073 MarshalAs Attribute.
28075 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
28076 on parameters and accordingly set the marshalling info.
28078 2002-03-09 Miguel de Icaza <miguel@ximian.com>
28080 * class.cs: Optimizing slightly by removing redundant code after
28081 we switched to the `NoTypes' return value.
28082 (Property.DefineMethod): use NoTypes here too.
28084 This fixes the bug I introduced in my last batch of changes.
28086 2002-03-05 Ravi Pratap <ravi@ximian.com>
28088 * tree.cs (RecordEnum): Add. We now keep track of enums too.
28090 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
28091 Enums since those are types too.
28093 * cs-parser.jay (enum_declaration): Record enums as we parse them.
28095 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
28096 thanks to a call during the lookup process.
28098 2002-03-07 Miguel de Icaza <miguel@ximian.com>
28100 * statement.cs (Foreach): Lots of work to accomodate a particular
28101 kind of foreach statement that I had not kept in mind. It is
28102 possible to have foreachs on classes that provide a GetEnumerator
28103 method that return objects that implement the "pattern" for using
28104 a foreach, there is no need to support GetEnumerator
28107 This is needed to compile nant.
28109 * decl.cs: Only report 114 if the member is not `Finalize' and if
28110 the warning level is at least 2.
28112 * class.cs: Moved the compare function from Method to
28115 (MethodSignature.InheritableMemberSignatureCompare): Add new
28116 filter function that is used to extract inheritable methods from a
28119 (Method.Define): Use the new `inheritable_method_signature_filter'
28122 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
28125 2002-03-06 Miguel de Icaza <miguel@ximian.com>
28127 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
28129 * cs-parser.jay: Add opt_semicolon to the interface declaration.
28131 * expression.cs: Pass location information to
28132 ConvertImplicitStandard.
28134 * class.cs: Added debugging code to track return values from
28137 2002-03-05 Miguel de Icaza <miguel@ximian.com>
28139 * expression.cs (Is.DoResolve): If either side of the `is' is an
28140 interface, do not flag the warning.
28142 * ecore.cs (ImplicitReferenceConversion): We need a separate test
28145 * report.cs: Allow for --fatal to be used with --probe.
28147 * typemanager.cs (NoTypes): Move the definition for the empty Type
28150 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
28152 (TypeContainer.DefineProxy): New function used to proxy to parent
28153 implementations when implementing interfaces.
28154 (TypeContainer.ParentImplements): used to lookup if our parent
28155 implements a public function that is required by an interface.
28156 (TypeContainer.VerifyPendingMethods): Hook this up.
28158 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
28159 `modules' and `assemblies' arraylists into arrays. We only grow
28160 these are the very early start up of the program, so this improves
28161 the speedof LookupType (nicely measured).
28163 * expression.cs (MakeByteBlob): Replaced unsafe code with
28164 BitConverter, as suggested by Paolo.
28166 * cfold.cs (ConstantFold.Binary): Special case: perform constant
28167 folding of string concatenation, but if either side is a string,
28168 and the other is not, then return null, and let the runtime use
28169 the concatenation on the string plus the object (using
28170 `Object.ToString').
28172 2002-03-04 Miguel de Icaza <miguel@ximian.com>
28174 Constant Folding has been implemented now.
28176 * expression.cs (Unary.Reduce): Do not throw an exception, catch
28177 the error instead on types that are not supported in one's
28180 * constant.cs (Constant and all children): New set of functions to
28181 perform implict and explicit conversions.
28183 * ecore.cs (EnumConstant): Implement the new functions to perform
28184 conversion by proxying to the child expression.
28186 * codegen.cs: (ConstantCheckState): Constant evaluation has its
28187 own separate setting that can not be turned off from the command
28188 line using --unchecked or --checked and is only controlled using
28189 the checked/unchecked statements and expressions. This setting is
28190 used by the constant folder to flag errors.
28192 * expression.cs (CheckedExpr, UncheckedExpr): Set the
28193 ConstantCheckState as well.
28195 During Resolve, they also have to flag the state, because the
28196 constant folder runs completely in the Resolve phase.
28198 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
28201 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28203 * cfold.cs: New file, this file contains the constant folder.
28205 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
28206 argument to track whether we are using the resulting address to
28207 load or store a value and provide better error messages.
28209 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
28210 new AddressOf arguments.
28212 * statement.cs (Foreach.EmitCollectionForeach): Update
28214 * expression.cs (Argument.Emit): Call AddressOf with proper
28215 arguments to track usage.
28217 (New.DoEmit): Call AddressOf with new arguments.
28219 (Unary.Emit): Adjust AddressOf call.
28221 2002-03-01 Ravi Pratap <ravi@ximian.com>
28223 * cs-parser.jay (member_access): Change the case for pre-defined types
28224 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
28227 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
28230 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
28231 essentially like methods and apply attributes like MethodImplOptions to them too.
28233 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
28236 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
28237 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
28240 * Update code everywhere accordingly.
28242 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
28244 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
28246 2002-02-28 Ravi Pratap <ravi@ximian.com>
28248 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
28249 try performing lookups against those instead of jumping straight into using
28250 the 'using' clauses.
28252 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
28254 (LookupType): Perform lookups in implicit parents too.
28256 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
28257 sequence as RootContext.LookupType.
28259 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
28260 the various cases of namespace lookups into this method.
28262 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28264 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
28265 in positional arguments)
28267 * class.cs (Operator): Update the AllowedModifiers to contain
28270 * cs-parser.jay: Update operator declaration to allow for the
28271 operator body to be empty.
28273 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
28276 2002-02-27 Miguel de Icaza <miguel@ximian.com>
28278 * class.cs (Method.Emit): Label parameters.
28280 * driver.cs: Return 1 or 0 as the program exit code.
28282 2002-02-26 Miguel de Icaza <miguel@ximian.com>
28284 * expression.cs: Special case the `null' object when trying to
28285 auto-compute the type, as anything can be explicitly converted to
28288 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
28289 spotting this Paolo.
28291 (Expression.ImplicitNumericConversion): Perform comparissions of
28292 the type using the underlying type in the case of an enumeration
28293 rather than using the enumeration type for the compare.
28295 Cope with the underlying == type case, which is not possible to
28298 (Expression.ConvertNumericExplicit): Perform comparissions of
28299 the type using the underlying type in the case of an enumeration
28300 rather than using the enumeration type for the compare.
28302 * driver.cs: If the user does not supply an extension, assume .exe
28304 * cs-parser.jay (if_statement): Rewrote so that we can track the
28305 location for the if statement.
28307 * expression.cs (Binary.ConstantFold): Only concat strings when
28308 the operation is "+", not everything ;-)
28310 * statement.cs (Statement.EmitBoolExpression): Take a location
28312 (If, While, Do): Track location.
28314 * expression.cs (Binary.ResolveOperator): In the object + string
28315 case, I was missing a call to ConvertImplicit
28317 2002-02-25 Ravi Pratap <ravi@ximian.com>
28319 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
28320 Location arguments. Ensure we use RootContext.LookupType to do our work
28321 and not try to do a direct Type.GetType and ModuleBuilder.GetType
28323 * interface.cs (PopulateMethod): Handle the type of the parameter being
28326 * expression.cs (Invocation.BetterFunction): Handle the case when we
28327 have a params method with no fixed arguments and a call is made with no
28330 2002-02-25 Miguel de Icaza <miguel@ximian.com>
28332 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
28333 the verbatim-string-literal
28335 * support.cs (InternalParameters.ParameterModifier): handle null
28337 (InternalParameters.ParameterType): ditto.
28339 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
28340 duplicating the name of the variable parameter.
28341 (GetParameterByName): Fix bug where we were not looking up array
28342 paramters if they were the only present (thanks Paolo!).
28343 (GetParameterInfo): We only have an empty set of types if both
28344 fixed and array are set to null.
28345 (GetParameterInfo-idx): Handle FixedParameter == null
28347 * cs-parser.jay: Handle the case where there is no catch
28348 statements (missing null test).
28350 2002-02-22 Miguel de Icaza <miguel@ximian.com>
28352 * driver.cs (MainDriver): Be conservative on our command line
28355 Catch DirectoryNotFoundException when calling GetFiles.
28357 (SplitPathAndPattern): Used to split the input specification into
28358 a path and a pattern that we can feed to Directory.GetFiles.
28360 2002-02-21 Miguel de Icaza <miguel@ximian.com>
28362 * statement.cs (Fixed): Implement the last case of the Fixed
28363 statement (string handling).
28365 * expression.cs (StringPtr): New class used to return a char * to
28366 a string; Used by the Fixed statement.
28368 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
28370 * expression.cs (Binary.ResolveOperator): Remove redundant
28371 MemberLookup pn parent type.
28372 Optimize union call, we do not need a union if the types are the same.
28373 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
28376 Specialize the use of MemberLookup everywhere, instead of using
28377 the default settings.
28379 (StackAlloc): Implement stackalloc keyword.
28381 * cs-parser.jay: Add rule to parse stackalloc.
28383 * driver.cs: Handle /h, /help, /?
28385 * expression.cs (MakeByteBlob): Removed the hacks we had in place
28386 before we supported unsafe code.
28388 * makefile: add --unsafe to the self compilation of mcs.
28390 2002-02-20 Miguel de Icaza <miguel@ximian.com>
28392 * expression.cs (PointerArithmetic): New class that is used to
28393 perform pointer arithmetic.
28394 (Binary.Resolve): Handle pointer arithmetic
28395 Handle pointer comparission.
28396 (ArrayPtr): Utility expression class that is used to take the
28397 address of an array.
28399 (ElementAccess): Implement array access for pointers
28401 * statement.cs (Fixed): Implement fixed statement for arrays, we
28402 are missing one more case before we are done.
28404 * expression.cs (Indirection): Implement EmitAssign and set the
28405 ExprClass to Variable. This allows pointer dereferences to be
28406 treated as variables, and to have values assigned to them.
28408 * ecore.cs (Expression.StoreFromPtr): New utility function to
28409 store values dereferencing.
28411 2002-02-20 Ravi Pratap <ravi@ximian.com>
28413 * expression.cs (Binary.ResolveOperator): Ensure that we are
28414 not trying to operate on a void type - this fixes the reported
28417 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
28418 the parent implementation is sealed.
28420 * ../errors/cs0239.cs : Add.
28422 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
28424 * typemanager.cs (unverifiable_code_type): Corresponds to
28425 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
28426 which have unsafe code in them.
28428 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
28431 2002-02-19 Miguel de Icaza <miguel@ximian.com>
28433 * cs-tokenizer.cs: Add support for @"litreal strings"
28435 Make tokenizer accept pre-processor directives
28436 on any column (remove the old C-like limitation).
28438 * rootcontext.cs (EmitCode): Emit any global attributes.
28439 (AddGlobalAttributes): Used to keep track of assembly attributes.
28441 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
28443 * cs-parser.jay: Add support for global attributes.
28445 2002-02-17 Miguel de Icaza <miguel@ximian.com>
28447 * expression.cs (Indirection): New helper class. Unary will
28448 create Indirection classes to be able to implement the
28449 IMemoryLocation interface on it.
28451 2002-02-16 Miguel de Icaza <miguel@ximian.com>
28453 * cs-parser.jay (fixed_statement): reference the right statement.
28455 * statement.cs (Fixed.Emit): Finish implementing the fixed
28456 statement for the &x case.
28458 2002-02-14 Miguel de Icaza <miguel@ximian.com>
28460 * class.cs (Property.Define, Method.Define): Remove newslot when
28463 * modifiers.cs: My use of NewSlot when `Abstract' was set was
28464 wrong. NewSlot should only be used if the `new' keyword is present.
28466 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
28467 locating our system dir. Sorry about this.
28469 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28471 * driver.cs (GetSystemDir): Compute correctly the location of our
28472 system assemblies. I was using the compiler directory instead of
28473 the library directory.
28475 2002-02-13 Ravi Pratap <ravi@ximian.com>
28477 * expression.cs (BetterFunction): Put back in what Miguel commented out
28478 since it is the correct fix. The problem is elsewhere ;-)
28480 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
28481 parameters of the parms method are themselves compatible or not !
28483 (StandardConversionExists): Fix very dangerous bug where we were forgetting
28484 to check that a class implements an interface before saying that an implicit
28485 conversion was allowed. Use ImplementsInterface to do the checking.
28487 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28489 * class.cs (Method.Define): Track whether we are an explicit
28490 implementation or not. And only call DefineMethodOverride if we
28491 are an explicit implementation.
28493 (Property.DefineMethod): Ditto.
28495 2002-02-11 Ravi Pratap <ravi@ximian.com>
28497 * expression.cs (BetterFunction): Catch hideous bug which was
28498 preventing us from detecting ambiguous calls due to implicit casts i.e
28501 2002-01-29 Miguel de Icaza <miguel@ximian.com>
28503 * support.cs (Pair): Remove un-needed method. I figured why I was
28504 getting the error in cs-parser.jay, the variable in a foreach loop
28505 is readonly, and the compiler does not really treat this as a variable.
28507 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
28508 instead of EQUALS in grammar.
28510 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
28512 * expression.cs (Unary.DoResolve): Check whether the argument is
28515 2002-01-28 Miguel de Icaza <miguel@ximian.com>
28517 * support.cs: Api for Pair to set a value. Despite the fact that
28518 the variables are public the MS C# compiler refuses to compile
28519 code that accesses the field if the variable is part of a foreach
28522 * statement.cs (Fixed): Begin implementation of the fixed
28525 (Block.AddVariable): Return the VariableInfo on success and null
28526 on failure instead of true/false.
28528 * cs-parser.jay (foreach): Catch errors on variables already
28529 defined (we were ignoring this value before) and properly unwind
28530 the block hierarchy
28532 (fixed_statement): grammar for the fixed statement.
28534 2002-01-25 Miguel de Icaza <miguel@ximian.com>
28536 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
28537 pointer types to be incretemented.
28539 (SizeOf): Implement.
28541 * cs-parser.jay (pointer_member_access): Implement
28542 expr->IDENTIFIER production.
28544 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
28545 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
28548 (Unary): Implement indirection.
28550 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
28551 use in non-unsafe context).
28553 (SimpleName.DoResolve): Check for pointers in field access on safe
28556 (Expression.LoadFromPtr): Factor the load-indirect code in this
28557 function. This was duplicated in UnboxCast and ParameterReference
28559 2002-01-24 Miguel de Icaza <miguel@ximian.com>
28561 * expression.cs (ComposedCast): report an error if a pointer cast
28562 is used in a safe region.
28564 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
28565 pointer type casts in unsafe context.
28567 * codegen.cs (EmitContext): Set up IsUnsafe.
28569 * cs-parser.jay (non_expression_type): Add productions for pointer
28572 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
28573 code. We should not use force into static mode if the method is
28574 not virtual. Fixes bug in MIS
28576 * statement.cs (Do.Emit, While.Emit, For.Emit,
28577 Statement.EmitBoolExpression): Add support to Do and While to
28578 propagate infinite loop as `I do return' semantics.
28580 Improve the For case to also test for boolean constants.
28582 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
28583 to the list of attributes we can add.
28585 Remove `EmitContext' argument.
28587 * class.cs (Method.Define): Apply parameter attributes.
28588 (Constructor.Define): Apply parameter attributes.
28589 (MethodCore.LabelParameters): Move here the core of labeling
28592 * support.cs (ReflectionParameters.ParameterModifier,
28593 InternalParameters.ParameterModifier): Use IsByRef on the type and
28594 only return the OUT bit for these parameters instead of in/out/ref
28597 This is because I miss-understood things. The ParameterInfo.IsIn
28598 and IsOut represent whether the parameter has the [In] and [Out]
28601 2002-01-22 Miguel de Icaza <miguel@ximian.com>
28603 * ecore.cs (FieldExpr.Emit): Release temporaries.
28605 * assign.cs (LocalTemporary.Release): new function.
28607 * codegen.cs (EmitContext.GetTemporaryStorage,
28608 EmitContext.FreeTemporaryStorage): Rework the way we deal with
28609 temporary storage. Now we can "put back" localbuilders when we
28612 2002-01-21 Miguel de Icaza <miguel@ximian.com>
28614 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
28615 need to make a copy of the variable to generate verifiable code.
28617 2002-01-19 Miguel de Icaza <miguel@ximian.com>
28619 * driver.cs: Compute dynamically the system directory.
28621 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
28622 Slower, but more generally useful. Used by the abstract
28623 registering implementation.
28625 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
28626 the rules for the special rule on Type/instances. First check if
28627 we have the same name, and if so, try that special static path
28628 rather than the instance path.
28630 2002-01-18 Miguel de Icaza <miguel@ximian.com>
28632 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
28635 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
28636 Enum, ValueType, Delegate or Array for non-corlib compiles.
28638 * cs-tokenizer.cs: Catch long identifiers (645)
28640 * typemanager.cs (IndexerPropetyName): Ravi never tested this
28643 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
28644 fix, we were returning too early, so we were not registering
28645 pending methods from abstract classes.
28647 Do not register pending methods if the class is abstract.
28649 * expression.cs (Conditional.DoResolve): Report circular implicit
28650 conversions when we neecd to compute it for conditional
28653 (Is.DoResolve): If the expression is always of the provided type,
28654 flag warning 183. If the expression can not ever be of the
28655 provided type flag warning 184.
28657 * class.cs: Catch 169 as well.
28659 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
28662 2002-01-18 Nick Drochak <ndrochak@gol.com>
28664 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
28666 2002-01-17 Miguel de Icaza <miguel@ximian.com>
28668 * interface.cs: (PopulateMethod): Check for pointers being defined
28669 only if the unsafe context is active.
28670 (PopulateProperty): ditto.
28671 (PopulateIndexer): ditto.
28673 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
28674 specified. If pointers are present, make sure that they are
28675 present in an unsafe context.
28676 (Constructor, Constructor.Define): ditto.
28677 (Field, Field.Define): ditto.
28678 (Property, Property.Define): ditto.
28679 (Event, Event.Define): ditto.
28681 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
28682 hashtable if there are classes or structs defined.
28684 * expression.cs (LocalVariableReference.DoResolve): Simplify this
28685 code, as the constant resolution moved.
28687 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
28688 the metadata, so we can flag error 133.
28690 * decl.cs (MemberCore.UnsafeOK): New function to test that a
28691 pointer is being declared in an unsafe context.
28693 2002-01-16 Miguel de Icaza <miguel@ximian.com>
28695 * modifiers.cs (Modifiers.Check): Require a Location argument.
28696 Report error 227 for Unsafe use.
28698 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
28700 * statement.cs (For.Emit): If the test is null, then report that
28701 we do `return', as we wont reach anything afterwards.
28703 (Switch.SwitchGoverningType): Track the expression that matched
28706 * driver.cs: Allow negative numbers as an error code to flag.
28708 * cs-parser.jay: Handle 1551.
28710 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
28712 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28714 * cs-parser.jay: Report 1518 (type declaration can only contain
28715 class, struct, interface, enum or delegate)
28717 (switch_label): Report 1523 (keywords `case' or `default' must
28720 (opt_switch_sections): Report 1522 (empty switch)
28722 * driver.cs: Report 1515 (response file specified multiple times)
28723 Report 1516 (Source file specified multiple times).
28725 * expression.cs (Argument.Resolve): Signal 1510
28727 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
28728 access not allowed in static code)
28730 2002-01-11 Ravi Pratap <ravi@ximian.com>
28732 * typemanager.cs (IsPointerType): Utility method which we are going
28735 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
28736 the object type, so we take care of that.
28738 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
28740 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
28741 added to non-params parameters :-)
28743 * typemanager.cs (CSharpName): Include 'void' type too.
28745 (void_ptr_type): Include in the set of core types.
28747 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
28750 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
28753 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
28754 completely forgotten about it.
28756 2002-01-10 Ravi Pratap <ravi@ximian.com>
28758 * cs-parser.jay (pointer_type): Add. This begins our implementation
28759 of parsing rules for unsafe code.
28761 (unsafe_statement): Implement.
28763 (embedded_statement): Modify to include the above.
28765 * statement.cs (Unsafe): Implement new class for unsafe blocks.
28767 * codegen.cs (EmitContext.InUnsafe): Add. This determines
28768 if the current context is an unsafe one.
28770 * cs-parser.jay (local_variable_pointer_type): Since local variable types
28771 are handled differently, we need separate rules for them.
28773 (local_variable_declaration): Update to use local_variable_pointer_type
28774 to allow variable declarations of unmanaged pointer types.
28776 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
28777 in unsafe contexts.
28779 * ../errors/cs0214.cs : Add.
28781 2002-01-16 Nick Drochak <ndrochak@gol.com>
28783 * makefile: remove 'response' file when cleaning.
28785 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28787 * cs-parser.jay: Report 1524.
28789 2002-01-14 Miguel de Icaza <miguel@ximian.com>
28791 * typemanager.cs (RegisterMethod): drop checking if we have
28792 registered this from here
28794 2002-01-12 Miguel de Icaza <miguel@ximian.com>
28796 * class.cs (Method.EmitDestructor): Implement calling our base
28799 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
28800 value of InFinally.
28802 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
28803 this routine and will wrap the call in a try/catch block. Deal
28806 2002-01-11 Miguel de Icaza <miguel@ximian.com>
28808 * ecore.cs (Expression.MemberLookup): instead of taking a
28809 parameter `same_type' that was used to tell whether we could
28810 access private members we compute our containing type from the
28813 (FieldExpr): Added partial support for volatile fields. This does
28814 not work for volatile fields exposed from assemblies, as I can not
28815 figure out how to extract the modreq from it.
28817 Updated all the source files to use this.
28819 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
28820 because it is referenced by MemberLookup very often.
28822 2002-01-09 Ravi Pratap <ravi@ximian.com>
28824 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
28825 TypeBuilder.GetCustomAttributes to retrieve what we need.
28827 Get rid of redundant default_member_attr_type as this is the same as
28828 default_member_type which already exists.
28830 * interface.cs, attribute.cs : Update accordingly.
28832 2002-01-08 Miguel de Icaza <miguel@ximian.com>
28834 * typemanager.cs: Enable IndexerPropertyName again. It does not
28835 work for TYpeBuilders though. Ravi, can you please fix this?
28837 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
28839 * expression.cs (Argument.Emit): Handle the case of ref objects
28840 being passed to ref functions;
28842 (ParameterReference.EmitLoad): Loads the content of the pointer
28843 without dereferencing.
28845 2002-01-07 Miguel de Icaza <miguel@ximian.com>
28847 * cs-tokenizer.cs: Implemented the pre-processing expressions.
28849 2002-01-08 Ravi Pratap <ravi@ximian.com>
28851 * class.cs (Indexer.DefineMethod): Incorporate the interface
28852 type in the name of the method if we are doing explicit interface
28855 * expression.cs (ConversionExists): Remove as it is completely obsolete.
28857 (BetterConversion): Fix extremely trivial bug where we were referring to
28858 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
28861 * ../errors/bug16.cs : Add although we have fixed it.
28863 2002-01-07 Miguel de Icaza <miguel@ximian.com>
28865 * expression.cs (BaseIndexer): Begin implementation.
28867 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
28869 * cs-parser.jay (indexer_declarator): Use qualified_identifier
28870 production directly to remove a shift/reduce, and implement
28871 explicit interface implementation.
28873 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
28874 after a floating point suffix.
28876 * expression.cs (DoNumericPromotions): Improved the conversion for
28877 uint/uint. If we have a constant, we avoid doing a typecast to a
28880 * class.cs (Indexer): Implement explicit interface implementation
28883 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
28885 * class.cs: make the default instance constructor public and hidebysig.
28887 2001-01-03 Ravi Pratap <ravi@ximian.com>
28889 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
28890 so we can call it from elsewhere.
28892 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
28893 we emit it internally if the class has a defined indexer; otherwise the user
28894 emits it by decorating the class definition with the DefaultMemberAttribute.
28896 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
28897 attribute is not used on a type which defines an indexer.
28899 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
28900 character when we skip whitespace.
28902 * ../errors/cs0646.cs : Add.
28904 2002-01-03 Miguel de Icaza <miguel@ximian.com>
28906 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
28909 * makefile: Add practical target `mcs3.exe' which builds the third
28910 generation compiler.
28912 * expression.cs (New): Fix structures constructor calling.
28914 * class.cs (Property, Method, Indexer): Emit Final flag on the
28915 method if we are an interface implementation and we are not
28918 * ecore.cs (PropertyExpr): New public field `IsBase', tells
28919 whether this property is referencing a `base' method.
28921 * expression.cs (Invocation.EmitCall): take an extra argument:
28922 is_base, this is used to determine whether the `call' or
28923 `callvirt' opcode should be used.
28926 * delegate.cs: update EmitCall.
28928 * class.cs (Method.Define): Set NewSlot for the cases where we are
28929 not implementing an interface method.
28931 (Property.Define): ditto.
28933 2002-01-02 Miguel de Icaza <miguel@ximian.com>
28935 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
28936 'r'. Allows mcs to parse itself fully.
28938 2002-01-02 Ravi Pratap <ravi@ximian.com>
28940 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
28941 of the number of initializers that require the InitializeArray method.
28943 (CheckIndices): Store the Expression in all cases - not the plain value. Also
28944 update the above field where necessary.
28946 (MakeByteBlob): Update accordingly.
28948 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
28951 (EmitDynamicInitializers): Update in accordance with the new optimization.
28953 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
28954 same OpCode applies.
28956 * cs-parser.jay : Fix some glaring errors I introduced.
28958 2002-01-01 Ravi Pratap <ravi@ximian.com>
28960 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
28961 so that we can check for name clashes there too.
28963 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
28964 for interface indexers.
28966 * interfaces.cs (Define): Emit the default member attribute.
28968 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
28969 variable was being referred to while setting the value ;-)
28971 2002-01-01 Miguel de Icaza <miguel@ximian.com>
28973 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
28974 byte-by-byte information when we know the data is zero.
28976 Make the block always a multiple of 4, because
28977 DefineInitializedData has a bug.
28979 * assign.cs: Fix, we should assign from the temporary, not from
28982 * expression.cs (MakeByteBlob): Fix my incorrect code.
28984 2001-12-31 Miguel de Icaza <miguel@ximian.com>
28986 * typemanager.cs (EnumToUnderlying): This function is used to get
28987 the underlying type from an enumeration, because it does not
28990 * constant.cs: Use the I4_S form for values between -128 and 127.
28992 * statement.cs (Block.LookupLabel): Looks up a label.
28993 (Block): Drop support for labeled blocks.
28995 (LabeledStatement): New kind of statement that represents a label
28998 (Goto): Finally implement this bad boy.
29000 * cs-parser.jay: Update to reflect new mechanism to implement
29003 2001-12-30 Miguel de Icaza <miguel@ximian.com>
29005 * codegen.cs (EmitContext.This): a codegen property that keeps the
29006 a single instance of this instead of creating many different this
29009 * delegate.cs (Delegate.DoResolve): Update to use the property;
29011 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
29013 * expression.cs (BaseAccess.DoResolve): Ditto.
29015 2001-12-29 Ravi Pratap <ravi@ximian.com>
29017 * typemanager.cs (methodimpl_attr_type): Add to hold the type
29018 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
29020 (InitCoreTypes): Update accordingly.
29022 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
29023 so we can quickly store the state.
29025 (ApplyAttributes): Set the correct implementation flags
29026 for InternalCall methods.
29028 2001-12-29 Miguel de Icaza <miguel@ximian.com>
29030 * expression.cs (EmitCall): if a method is not virtual, then do
29031 not use callvirt on it.
29033 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
29034 user defined stuff) requires the use of stobj, which takes an
29035 address on the stack instead of an array and an index. So emit
29036 the Ldelema operation for it.
29038 (EmitStoreOpcode): Use stobj for valuetypes.
29040 (UnaryMutator.EmitCode): Use the right 1 value depending on
29041 whether we are dealing with int64/uint64, float or doubles.
29043 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
29044 constructors that I implemented last night.
29046 (Constructor.IsDefault): Fix to work properly for static
29049 * cs-parser.jay (CheckDef): report method signature errors.
29050 Update error number 103 to be 132.
29052 * decl.cs: New AdditionResult enumeration value: MethodExists.
29053 Although we do this check for methods later on in the semantic
29054 analysis, catching repeated default constructors is so easy that
29055 we catch these here.
29057 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
29060 (ParameterReference.EmitAssign, Emit): handle
29063 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
29064 (ArrayAccess.EmitStoreOpcode): ditto.
29066 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
29068 * expression.cs (MakeByteBlob): Complete all the missing types
29069 (uint, short, ushort, byte, sbyte)
29071 * class.cs: Only init instance field initializers on instance
29074 Rename `constructors' to instance_constructors.
29076 (TypeContainer.AddConstructor): Only add constructors to the list
29077 if it is not static.
29079 Make sure that we handle default_static_constructor independently
29080 everywhere where we handle instance_constructors
29082 2001-12-28 Miguel de Icaza <miguel@ximian.com>
29084 * class.cs: Do not lookup or create a base initializer for a
29085 static constructor.
29087 (ConstructorInitializer.Resolve): use the proper type to lookup
29090 * cs-parser.jay: Report error 1585 (modifiers between type and name).
29092 * enum.cs, interface.cs: Remove CloseType, this is taken care by
29095 * decl.cs: CloseType is now an virtual method, the default
29096 implementation just closes this type.
29098 2001-12-28 Ravi Pratap <ravi@ximian.com>
29100 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
29101 to PreserveSig by default. Also emit HideBySig on such methods.
29103 Basically, set the defaults to standard values.
29105 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
29106 argument, if candidate is better, it can't be worse than the best !
29108 (Invocation): Re-write bits to differentiate between methods being
29109 applicable in their expanded form and their normal form - for params
29112 Get rid of use_standard everywhere as only standard conversions are allowed
29113 in overload resolution.
29115 More spec conformance.
29117 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29119 * driver.cs: Add --timestamp, to see where the compiler spends
29122 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
29123 `this' in static code.
29125 (SimpleName.DoResolve): Implement in terms of a helper function
29126 that allows static-references to be passed upstream to
29129 (Expression.ResolveWithSimpleName): Resolve specially simple
29130 names when called by MemberAccess to implement the special
29133 (Expression.ImplicitReferenceConversion): Handle conversions from
29134 Null to reference types before others, as Null's type is
29137 * expression.cs (Invocation.EmitCall): Handle the special case of
29138 calling methods declared on a reference type from a ValueType
29139 (Base classes System.Object and System.Enum)
29141 (MemberAccess.Resolve): Only perform lookups on Enumerations if
29142 the left hand side is a TypeExpr, not on every enumeration.
29144 (Binary.Resolve): If types are reference types, then do a cast to
29145 object on operators != and == of both arguments.
29147 * typemanager.cs (FindMembers): Extract instance and static
29148 members if requested.
29150 * interface.cs (PopulateProperty): Use void_type instead of null
29151 as the return type for the setter method.
29153 (PopulateIndexer): ditto.
29155 2001-12-27 Ravi Pratap <ravi@ximian.com>
29157 * support.cs (ReflectionParameters): Fix minor bug where we
29158 were examining the wrong parameter for the ParamArray attribute.
29160 Cope with requests for the type of the parameter at position
29161 greater than the params parameter's. We now return the element
29162 type of the params array as that makes more sense.
29164 * expression.cs (Invocation.IsParamsMethodApplicable): Update
29165 accordingly as we no longer have to extract the element type
29168 (Invocation.OverloadResolve): Update.
29170 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29172 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
29173 against IEnumerator, test whether the return value is a descendant
29174 of the IEnumerator interface.
29176 * class.cs (Indexer.Define): Use an auxiliary method to implement
29177 the other bits of the method definition. Begin support for
29178 explicit interface implementation.
29180 (Property.DefineMethod): Use TypeManager.void_type instead of null
29181 for an empty return value.
29183 2001-12-26 Miguel de Icaza <miguel@ximian.com>
29185 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
29186 dealing with a FieldExpr which is composed of a FieldBuilder, in
29187 the code path we did extract the constant, but we should have
29188 obtained the underlying value to be able to cast it (otherwise we
29189 end up in an infinite loop, this is what Ravi was running into).
29191 (ArrayCreation.UpdateIndices): Arrays might be empty.
29193 (MemberAccess.ResolveMemberAccess): Add support for section
29194 14.5.4.1 that deals with the special case of E.I when E is a type
29195 and something else, that I can be a reference to a static member.
29197 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
29198 handle a particular array type to create byte blobs, it is just
29199 something we dont generate byteblobs for.
29201 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
29204 * location.cs (Push): remove the key from the hashtable that we
29205 are about to add. This happens for empty files.
29207 * driver.cs: Dispose files after we have parsed them.
29209 (tokenize): new function that only runs the tokenizer on its
29210 input, for speed testing.
29212 2001-12-26 Ravi Pratap <ravi@ximian.com>
29214 * class.cs (Event.Define): Define the private field only if there
29215 are no accessors defined.
29217 * expression.cs (ResolveMemberAccess): If there is no associated
29218 field with the event, that means we have an event defined with its
29219 own accessors and we should flag error cs0070 since transforming
29220 ourselves into a field is not valid in that case.
29222 * ecore.cs (SimpleName.DoResolve): Same as above.
29224 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
29225 and charset to sane values.
29227 2001-12-25 Ravi Pratap <ravi@ximian.com>
29229 * assign.cs (DoResolve): Perform check on events only if they
29230 are being accessed outside the declaring type.
29232 * cs-parser.jay (event_declarations): Update rules to correctly
29233 set the type of the implicit parameter etc.
29235 (add_accessor, remove_accessor): Set current local parameters.
29237 * expression.cs (Binary): For delegate addition and subtraction,
29238 cast the return value from the method into the appropriate delegate
29241 2001-12-24 Ravi Pratap <ravi@ximian.com>
29243 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
29244 of these as the workaround is unnecessary.
29246 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
29247 delegate data - none of that is needed at all.
29249 Re-write bits to extract the instance expression and the delegate method
29252 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
29255 * attribute.cs (ApplyAttributes): New method to take care of common tasks
29256 of attaching attributes instead of duplicating code everywhere.
29258 * everywhere : Update code to do attribute emission using the above method.
29260 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29262 * expression.cs (IsParamsMethodApplicable): if there are not
29263 parameters, return immediately.
29265 * ecore.cs: The 0 literal can be implicity converted to an enum
29268 (SimpleName.DoResolve): First lookup the type, then lookup the
29271 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
29272 want to get its address. If the InstanceExpression is not
29273 addressable, store the result in a temporary variable, then get
29276 * codegen.cs: Only display 219 errors on warning level or above.
29278 * expression.cs (ArrayAccess): Make it implement the
29279 IMemoryLocation interface.
29281 (Binary.DoResolve): handle the operator == (object a, object b)
29282 and operator != (object a, object b) without incurring into a
29283 BoxedCast (because 5 != o should never be performed).
29285 Handle binary enumerator operators.
29287 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
29288 value type, otherwise use Ldelem_ref.
29290 Use precomputed names;
29292 (AddressOf): Implement address of
29294 * cs-parser.jay (labeled_statement): Fix recursive block
29295 addition by reworking the production.
29297 * expression.cs (New.DoEmit): New has a special case:
29299 If we are dealing with a ValueType, we have a few
29300 situations to deal with:
29302 * The target of New is a ValueType variable, that is
29303 easy, we just pass this as the variable reference
29305 * The target of New is being passed as an argument,
29306 to a boxing operation or a function that takes a
29309 In this case, we need to create a temporary variable
29310 that is the argument of New.
29313 2001-12-23 Ravi Pratap <ravi@ximian.com>
29315 * rootcontext.cs (LookupType): Check that current_type is not null before
29316 going about looking at nested types.
29318 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
29319 not implement the IAssignMethod interface any more.
29321 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
29322 where we tranform them into FieldExprs if they are being resolved from within
29323 the declaring type.
29325 * ecore.cs (SimpleName.DoResolve): Do the same here.
29327 * assign.cs (DoResolve, Emit): Clean up code considerably.
29329 * ../errors/bug10.cs : Add.
29331 * ../errors/cs0070.cs : Add.
29333 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
29335 * assign.cs : Get rid of EventIsLocal everywhere.
29337 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29339 * ecore.cs (ConvertIntLiteral): finished the implementation.
29341 * statement.cs (SwitchLabel): Convert the value we are using as a
29342 key before looking up the table.
29344 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29346 * codegen.cs (EmitTopBlock): Require a Location argument now.
29348 * cs-parser.jay (constructor_declarator): We need to setup
29349 current_local_parameters before we parse the
29350 opt_constructor_initializer, to allow the variables to be bound
29351 to the constructor arguments.
29353 * rootcontext.cs (LookupType): First lookup nested classes in our
29354 class and our parents before we go looking outside our class.
29356 * expression.cs (ConstantFold): Extract/debox the values at the
29359 * rootcontext.cs (EmitCode): Resolve the constants first before we
29360 resolve the types. This is not really needed, but it helps debugging.
29362 * statement.cs: report location.
29364 * cs-parser.jay: pass location to throw statement.
29366 * driver.cs: Small bug fix.
29368 * report.cs: Updated format to be 4-zero filled digits.
29370 2001-12-22 Ravi Pratap <ravi@ximian.com>
29372 * expression.cs (CheckIndices): Fix minor bug where the wrong
29373 variable was being referred to ;-)
29375 (DoEmit): Do not call EmitStaticInitializers when the
29376 underlying type is System.Object.
29378 2001-12-21 Ravi Pratap <ravi@ximian.com>
29380 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
29381 and do the usual workaround for SRE.
29383 * class.cs (MyEventBuilder.EventType): New member to get at the type
29384 of the event, quickly.
29386 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
29388 * assign.cs (Assign.DoResolve): Handle the case when the target
29389 is an EventExpr and perform the necessary checks.
29391 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
29394 (SimpleName.MemberStaticCheck): Include check for EventExpr.
29396 (EventExpr): Set the type in the constructor itself since we
29397 are meant to be born fully resolved.
29399 (EventExpr.Define): Revert code I wrote earlier.
29401 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
29402 instance expression is null. The instance expression is a This in that case
29403 or a null, depending on whether it is a static method or not.
29405 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
29406 refers to more than one method.
29408 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
29409 and accordingly flag errors.
29411 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29413 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
29415 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29417 * location.cs (ToString): Provide useful rutine.
29419 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29421 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
29422 objects, return the actual integral boxed.
29424 * statement.cs (SwitchLabel): define an ILLabel for each
29427 (Switch.CheckSwitch): If the value is a Literal, extract
29428 the underlying literal.
29430 Also in the unused hashtable we had, add the SwitchLabel so we can
29431 quickly look this value up.
29433 * constant.cs: Implement a bunch of new constants. Rewrite
29434 Literal based on this. Made changes everywhere to adapt to this.
29436 * expression.cs (Expression.MakeByteBlob): Optimize routine by
29437 dereferencing array only once, and also copes with enumrations.
29439 bytes are two bytes wide, not one.
29441 (Cast): Perform constant conversions.
29443 * ecore.cs (TryImplicitIntConversion): Return literals instead of
29444 wrappers to the literals here.
29446 * expression.cs (DoNumericPromotions): long literals can converted
29447 to ulong implicity (this is taken care of elsewhere, but I was
29448 missing this spot).
29450 * ecore.cs (Expression.Literalize): Make the return type Literal,
29451 to improve type checking.
29453 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
29455 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29457 * literal.cs: Revert code from ravi that checked the bounds. The
29458 bounds are sane by the definition of the type itself.
29460 * typemanager.cs: Fix implementation of ImplementsInterface. We
29461 need to actually look up in our parent hierarchy for interfaces
29464 * const.cs: Use the underlying type for enumerations
29466 * delegate.cs: Compute the basename for the delegate creation,
29467 that should fix the delegate test case, and restore the correct
29468 Type Lookup semantics in rootcontext
29470 * rootcontext.cs: Revert Ravi's last patch. The correct way of
29471 referencing a nested type with the Reflection API is using the "+"
29474 * cs-parser.jay: Do not require EOF token at the end.
29476 2001-12-20 Ravi Pratap <ravi@ximian.com>
29478 * rootcontext.cs (LookupType): Concatenate type names with
29479 a '.' instead of a '+' The test suite passes again.
29481 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
29482 field of the enumeration.
29484 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
29485 the case when the member is an EventExpr.
29487 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
29488 static has an associated instance expression.
29490 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
29492 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
29494 * class.cs (Event.Define): Register event and perform appropriate checks
29497 We define the Add and Remove methods even if the use provides none because
29498 in that case, we provide default implementations ourselves.
29500 Define a private field of the type of the event. This is done by the CSC compiler
29501 and we should be doing it too ;-)
29503 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
29504 More methods we use in code we generate.
29506 (multicast_delegate_type, delegate_type): Two separate types since the distinction
29509 (InitCoreTypes): Update accordingly for the above.
29511 * class.cs (Event.Emit): Generate code for default accessors that we provide
29513 (EmitDefaultMethod): Do the job in the above.
29515 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
29518 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29520 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
29521 builders even if we were missing one.
29523 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
29524 pass the Basename as our class name instead of the Name. The
29525 basename will be correctly composed for us.
29527 * parameter.cs (Paramters): Now takes a Location argument.
29529 * decl.cs (DeclSpace.LookupType): Removed convenience function and
29530 make all the code call directly LookupType in RootContext and take
29531 this chance to pass the Location information everywhere.
29533 * Everywhere: pass Location information.
29535 2001-12-19 Miguel de Icaza <miguel@ximian.com>
29537 * class.cs (Constructor.Define): Updated way of detecting the
29538 length of the parameters.
29540 (TypeContainer.DefineType): Use basename as the type name for
29543 (TypeContainer.Define): Do not recursively define types here, as
29544 definition is taken care in order by the RootContext.
29546 * tree.cs: Keep track of namespaces in a per-file basis.
29548 * parameter.cs (Parameter.ComputeSignature): Update to use
29551 (Parameters.GetSignature): ditto.
29553 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
29554 instead of a TypeContainer.
29556 (Interface.SemanticAnalysis): Use `this' instead of our parent to
29557 resolve names. Because we need to be resolve in our context, not
29560 * driver.cs: Implement response files.
29562 * class.cs (TypeContainer.DefineType): If we are defined, do not
29563 redefine ourselves.
29565 (Event.Emit): Emit the code for add/remove handlers.
29566 (Event.Define): Save the MethodBuilders for add/remove.
29568 * typemanager.cs: Use pair here too.
29570 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
29571 DictionaryEntry requires the first argument to be non-null.
29573 (enum_declaration): Compute full name for registering the
29576 (delegate_declaration): Instead of using
29577 formal_parameter_list, use opt_formal_parameter_list as the list
29580 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
29581 (EventParsing): New property that controls whether `add' and
29582 `remove' are returned as tokens or identifiers (for events);
29584 2001-12-19 Ravi Pratap <ravi@ximian.com>
29586 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
29587 use MyEventBuilder only and let it wrap the real builder for us.
29589 (MyEventBuilder): Revamp constructor etc.
29591 Implement all operations that we perform on EventBuilder in precisely the same
29594 (FindMembers): Update to use the EventBuilder member.
29596 (Event.Emit): Update accordingly.
29598 2001-12-18 Ravi Pratap <ravi@ximian.com>
29600 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
29601 by calling the appropriate methods.
29603 (GetCustomAttributes): Make stubs as they cannot possibly do anything
29606 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
29608 2001-12-17 Ravi Pratap <ravi@ximian.com>
29610 * delegate.cs (Delegate.Populate): Check that the return type
29611 and various parameters types are indeed accessible.
29613 * class.cs (Constructor.Define): Same here.
29615 (Field.Define): Ditto.
29617 (Event.Define): Ditto.
29619 (Operator.Define): Check that the underlying Method defined itself
29620 correctly - so it's MethodBuilder should not be null.
29622 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
29623 expression happens to be null.
29625 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
29626 members but as of now we don't seem to be able to do anything really useful with it.
29628 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
29629 not the EventBuilder.
29631 2001-12-18 Miguel de Icaza <miguel@ximian.com>
29633 * cs-tokenizer.cs: Add support for defines.
29634 Add support for #if, #elif, #else, #endif
29636 (eval_var): evaluates a variable.
29637 (eval): stubbed for evaluating functions.
29639 * cs-parser.jay: Pass the defines information
29641 * driver.cs: Add --define command line option.
29643 * decl.cs: Move MemberCore here.
29645 Make it the base class for DeclSpace. This allows us to catch and
29646 report 108 and 109 for everything now.
29648 * class.cs (TypeContainer.Define): Extract all the members
29649 before populating and emit the warning 108 (new keyword required
29650 to override) instead of having each member implement this.
29652 (MemberCore.Define): New abstract method, we will be using this in
29653 the warning reporting engine in Populate.
29655 (Operator.Define): Adjust to new MemberCore protocol.
29657 * const.cs (Const): This does not derive from Expression, it is a
29658 temporary object we use to create fields, it is a MemberCore.
29660 * class.cs (Method.Define): Allow the entry point to be in a
29663 * driver.cs: Rewrite the argument handler to clean it up a bit.
29665 * rootcontext.cs: Made it just an auxiliary namespace feature by
29666 making everything static.
29668 * driver.cs: Adapt code to use RootContext type name instead of
29671 * delegate.cs: Remove RootContext argument.
29673 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
29676 * class.cs (Event.Define): The lookup can fail.
29678 * cs-tokenizer.cs: Begin implementation of pre-procesor.
29680 * expression.cs: Resolve the this instance before invoking the code.
29682 2001-12-17 Miguel de Icaza <miguel@ximian.com>
29684 * cs-parser.jay: Add a production in element_access that allows
29685 the thing to become a "type" reference. This way we can parse
29686 things like "(string [])" as a type.
29688 Note that this still does not handle the more complex rules of
29692 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
29694 * ecore.cs: (CopyNewMethods): new utility function used to
29695 assemble the list of methods from running FindMembers.
29697 (MemberLookup): Rework FindMembers so that
29699 2001-12-16 Miguel de Icaza <miguel@ximian.com>
29701 * class.cs (TypeContainer): Remove Delegates who fail to be
29704 * delegate.cs (Populate): Verify that we dont get null return
29705 values. TODO: Check for AsAccessible.
29707 * cs-parser.jay: Use basename to emit error 574 (destructor should
29708 have the same name as container class), not the full name.
29710 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
29711 possible representation.
29713 Also implements integer type suffixes U and L.
29715 2001-12-15 Miguel de Icaza <miguel@ximian.com>
29717 * expression.cs (ArrayCreation.DoResolve): We need to do the
29718 argument resolution *always*.
29720 * decl.cs: Make this hold the namespace. Hold the root context as
29722 (LookupType): Move here.
29724 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
29726 * location.cs (Row, Name): Fixed the code, it was always returning
29727 references to the first file.
29729 * interface.cs: Register properties defined through interfaces.
29731 * driver.cs: Add support for globbing on the command line
29733 * class.cs (Field): Make it derive from MemberCore as well.
29736 2001-12-15 Ravi Pratap <ravi@ximian.com>
29738 * class.cs (Event::Define): Check that the type of the event is a delegate
29739 type else flag error #66.
29741 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
29744 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
29745 values of EntryPoint, CharSet etc etc.
29747 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
29749 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
29750 be null and we should ignore this. I am not sure if this is really clean. Apparently,
29751 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
29752 which needs this to do its work.
29754 * ../errors/cs0066.cs : Add.
29756 2001-12-14 Miguel de Icaza <miguel@ximian.com>
29758 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
29761 * class.cs: (MethodSignature.MethodSignature): Removed hack that
29762 clears out the parameters field.
29763 (MemberSignatureCompare): Cleanup
29765 (MemberCore): New base class used to share code between MethodCore
29768 (RegisterRequiredImplementations) BindingFlags.Public requires
29769 either BindingFlags.Instace or Static. Use instance here.
29771 (Property): Refactored code to cope better with the full spec.
29773 * parameter.cs (GetParameterInfo): Return an empty array instead
29776 * class.cs (Property): Abstract or extern properties have no bodies.
29778 * parameter.cs (GetParameterInfo): return a zero-sized array.
29780 * class.cs (TypeContainer.MethodModifiersValid): Move all the
29781 method modifier validation to the typecontainer so we can reuse
29782 this on properties.
29784 (MethodCore.ParameterTypes): return an empty sized array of types.
29786 (Property.Define): Test property modifier validity.
29788 Add tests for sealed/override too.
29790 (Method.Emit): abstract or extern methods have no bodies.
29792 2001-12-14 Ravi Pratap <ravi@ximian.com>
29794 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
29797 (Method::Define, ::Emit): Modify accordingly.
29799 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
29801 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
29803 * makefile: Pass in /unsafe.
29805 2001-12-13 Miguel de Icaza <miguel@ximian.com>
29807 * class.cs (MakeKey): Kill routine.
29809 * class.cs (TypeContainer.Define): Correctly define explicit
29810 method implementations (they require the full interface name plus
29813 * typemanager.cs: Deply the PtrHashtable here and stop using the
29814 lame keys. Things work so much better.
29816 This of course broke everyone who depended on `RegisterMethod' to
29817 do the `test for existance' test. This has to be done elsewhere.
29819 * support.cs (PtrHashtable): A hashtable that avoid comparing with
29820 the object stupid Equals method (because, that like fails all over
29821 the place). We still do not use it.
29823 * class.cs (TypeContainer.SetRequiredInterface,
29824 TypeContainer.RequireMethods): Killed these two routines and moved
29825 all the functionality to RegisterRequiredImplementations.
29827 (TypeContainer.RegisterRequiredImplementations): This routine now
29828 registers all the implementations required in an array for the
29829 interfaces and abstract methods. We use an array of structures
29830 which can be computed ahead of time to reduce memory usage and we
29831 also assume that lookups are cheap as most classes will not
29832 implement too many interfaces.
29834 We also avoid creating too many MethodSignatures.
29836 (TypeContainer.IsInterfaceMethod): Update and optionally does not
29837 clear the "pending" bit if we find that there are problems with
29840 (TypeContainer.VerifyPendingMethods): Update to report errors of
29841 methods that look like implementations but are not.
29843 (TypeContainer.Define): Add support for explicit interface method
29846 2001-12-12 Miguel de Icaza <miguel@ximian.com>
29848 * typemanager.cs: Keep track of the parameters here instead of
29849 being a feature of the TypeContainer.
29851 * class.cs: Drop the registration of parameters here, as
29852 InterfaceMethods are also interface declarations.
29854 * delegate.cs: Register methods with the TypeManager not only with
29855 the TypeContainer. This code was buggy.
29857 * interface.cs: Full registation here.
29859 2001-12-11 Miguel de Icaza <miguel@ximian.com>
29861 * expression.cs: Remove reducer for binary expressions, it can not
29864 * const.cs: Put here the code that used to go into constant.cs
29866 * constant.cs: Put here the code for constants, this is a new base
29867 class for Literals.
29869 * literal.cs: Make Literal derive from Constant.
29871 2001-12-09 Miguel de Icaza <miguel@ximian.com>
29873 * statement.cs (Return.Emit): Report error 157 if the user
29874 attempts to return from a finally block.
29876 (Return.Emit): Instead of emitting a return, jump to the end of
29879 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
29880 LocalBuilder to store the result of the function. ReturnLabel is
29881 the target where we jump.
29884 2001-12-09 Radek Doulik <rodo@ximian.com>
29886 * cs-parser.jay: remember alias in current namespace
29888 * ecore.cs (SimpleName::DoResolve): use aliases for types or
29891 * class.cs (LookupAlias): lookup alias in my_namespace
29893 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
29895 (LookupAlias): lookup alias in this and if needed in parent
29898 2001-12-08 Miguel de Icaza <miguel@ximian.com>
29902 * rootcontext.cs: (ModuleBuilder) Made static, first step into
29903 making things static. I need this to avoid passing the
29904 TypeContainer when calling ParameterType.
29906 * support.cs (InternalParameters.ParameterType): Remove ugly hack
29907 that did string manipulation to compute the type and then call
29908 GetType. Use Parameter.ParameterType instead.
29910 * cs-tokenizer.cs: Consume the suffix for floating values.
29912 * expression.cs (ParameterReference): figure out whether this is a
29913 reference parameter or not. Kill an extra variable by computing
29914 the arg_idx during emission.
29916 * parameter.cs (Parameters.GetParameterInfo): New overloaded
29917 function that returns whether a parameter is an out/ref value or not.
29919 (Parameter.ParameterType): The type of the parameter (base,
29920 without ref/out applied).
29922 (Parameter.Resolve): Perform resolution here.
29923 (Parameter.ExternalType): The full type (with ref/out applied).
29925 * statement.cs (Using.Emit, Using.EmitExpression): Implement
29926 support for expressions on the using statement.
29928 2001-12-07 Miguel de Icaza <miguel@ximian.com>
29930 * statement.cs (Using.EmitLocalVariableDecls): Split the
29931 localvariable handling of the using statement.
29933 (Block.EmitMeta): Keep track of variable count across blocks. We
29934 were reusing slots on separate branches of blocks.
29936 (Try.Emit): Emit the general code block, we were not emitting it.
29938 Check the type of the declaration to be an IDisposable or
29939 something that can be implicity converted to it.
29941 Emit conversions if required.
29943 * ecore.cs (EmptyExpression): New utility class.
29944 (Expression.ImplicitConversionExists): New utility function.
29946 2001-12-06 Miguel de Icaza <miguel@ximian.com>
29948 * statement.cs (Using): Implement.
29950 * expression.cs (LocalVariableReference): Support read only variables.
29952 * statement.cs: Remove the explicit emit for the Leave opcode.
29953 (VariableInfo): Add a readonly field.
29955 2001-12-05 Miguel de Icaza <miguel@ximian.com>
29957 * ecore.cs (ConvCast): new class used to encapsulate the various
29958 explicit integer conversions that works in both checked and
29959 unchecked contexts.
29961 (Expression.ConvertNumericExplicit): Use new ConvCast class to
29962 properly generate the overflow opcodes.
29964 2001-12-04 Miguel de Icaza <miguel@ximian.com>
29966 * statement.cs: The correct type for the EmptyExpression is the
29967 element_type, not the variable type. Ravi pointed this out.
29969 2001-12-04 Ravi Pratap <ravi@ximian.com>
29971 * class.cs (Method::Define): Handle PInvoke methods specially
29972 by using DefinePInvokeMethod instead of the usual one.
29974 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
29975 above to do the task of extracting information and defining the method.
29977 2001-12-04 Ravi Pratap <ravi@ximian.com>
29979 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
29980 of the condition for string type.
29982 (Emit): Move that here.
29984 (ArrayCreation::CheckIndices): Keep string literals in their expression
29987 (EmitDynamicInitializers): Handle strings appropriately.
29989 2001-12-04 Miguel de Icaza <miguel@ximian.com>
29991 * codegen.cs (EmitContext): Replace multiple variables with a
29992 single pointer to the current Switch statement.
29994 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
29997 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30001 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
30004 (Foreach.Emit): Foreach on arrays was not setting
30005 up the loop variables (for break/continue).
30007 (GotoCase): Semi-implented.
30009 2001-12-03 Ravi Pratap <ravi@ximian.com>
30011 * attribute.cs (CheckAttribute): Handle system attributes by using
30012 Attribute.GetAttributes to examine information we need.
30014 (GetValidPlaces): Same here.
30016 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
30018 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
30020 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
30022 (Method::Define): Set appropriate flags if we have a DllImport attribute.
30024 (Method::Emit): Handle the case when we are a PInvoke method.
30026 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30028 * expression.cs: Use ResolveWithSimpleName on compound names.
30030 2001-12-02 Ravi Pratap <ravi@ximian.com>
30032 * constant.cs (EmitConstant): Make sure we resolve the associated expression
30033 before trying to reduce it.
30035 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
30037 * constant.cs (LookupConstantValue): Implement.
30039 (EmitConstant): Use the above in emitting the constant.
30041 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
30042 that are user-defined by doing a LookupConstantValue on them.
30044 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
30047 2001-11-29 Miguel de Icaza <miguel@ximian.com>
30049 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
30051 (BaseAccess.DoResolve): Implement.
30053 (MemberAccess.DoResolve): Split this routine into a
30054 ResolveMemberAccess routine that can be used independently
30056 2001-11-28 Miguel de Icaza <miguel@ximian.com>
30058 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
30059 As that share bits of the implementation. Is returns a boolean,
30060 while As returns the Type that is being probed.
30062 2001-12-01 Ravi Pratap <ravi@ximian.com>
30064 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
30065 instead of a Literal - much easier.
30067 (EnumInTransit): Remove - utterly useless :-)
30069 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
30071 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
30073 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
30074 chain when we have no associated expression.
30076 2001-11-30 Ravi Pratap <ravi@ximian.com>
30078 * constant.cs (Define): Use Location while reporting the errror.
30080 Also emit a warning when 'new' is used and there is no inherited
30083 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
30086 (LookupEnumValue): Implement to lookup an enum member's value and define it
30089 (Populate): Re-write accordingly to use the above routine.
30091 2001-11-27 Miguel de Icaza <miguel@ximian.com>
30093 * expression.cs (This): Fix prototype for DoResolveLValue to
30094 override the base class DoResolveLValue.
30096 * cs-parser.cs: Report errors cs574 and cs575 (destructor
30099 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
30100 (we need to load the address of the field here). This fixes
30103 (FieldExpr.DoResolveLValue): Call the DoResolve
30104 function to initialize the Instance expression.
30106 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
30107 correctly the GetEnumerator operation on a value type.
30109 * cs-parser.jay: Add more simple parsing error catches.
30111 * statement.cs (Switch): Add support for string switches.
30112 Handle null specially.
30114 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
30116 2001-11-28 Ravi Pratap <ravi@ximian.com>
30118 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
30120 (declare_local_constant): New helper function.
30122 * statement.cs (AddConstant): Keep a separate record of constants
30124 (IsConstant): Implement to determine if a variable is a constant.
30126 (GetConstantExpression): Implement.
30128 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
30130 * statement.cs (IsVariableDefined): Re-write.
30132 2001-11-27 Ravi Pratap <ravi@ximian.com>
30134 * class.cs (TypeContainer::FindMembers): Look for constants
30135 in the case when we are looking for MemberTypes.Field
30137 * expression.cs (MemberAccess::DoResolve): Check that in the
30138 case we are a FieldExpr and a Literal, we are not being accessed
30139 by an instance reference.
30141 * cs-parser.jay (local_constant_declaration): Implement.
30143 (declaration_statement): Implement for constant declarations.
30145 2001-11-26 Miguel de Icaza <miguel@ximian.com>
30147 * statement.cs (Switch): Catch double defaults.
30149 (Switch): More work on the switch() statement
30150 implementation. It works for integral values now, need to finish
30154 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30156 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
30157 integer literals into other integer literals. To be used by
30160 2001-11-24 Ravi Pratap <ravi@ximian.com>
30162 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
30165 (EmitDynamicInitializers): Cope with the above since we extract data
30166 directly from ArrayData now.
30168 (ExpectInitializers): Keep track of whether initializers are mandatory
30171 (Bounds): Make it a hashtable to prevent the same dimension being
30172 recorded for every element in that dimension.
30174 (EmitDynamicInitializers): Fix bug which prevented the Set array method
30177 Also fix bug which was causing the indices to be emitted in the reverse
30180 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30182 * expression.cs (ArrayCreation): Implement the bits that Ravi left
30183 unfinished. They do not work, because the underlying code is
30186 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30188 * cs-parser.jay: Remove bogus fixme.
30190 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
30191 on Switch statement.
30193 2001-11-23 Ravi Pratap <ravi@ximian.com>
30195 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
30198 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
30199 parameter. Apparently, any expression is allowed.
30201 (ValidateInitializers): Update accordingly.
30203 (CheckIndices): Fix some tricky bugs thanks to recursion.
30205 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
30206 I was being completely brain-dead.
30208 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
30209 and re-write acordingly.
30211 (DelegateInvocation): Re-write accordingly.
30213 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
30215 (MakeByteBlob): Handle types more correctly.
30217 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
30218 initialization from expressions but it is incomplete because I am a complete
30221 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30223 * statement.cs (If.Emit): Fix a bug that generated incorrect code
30224 on If. Basically, we have to return `true' (ie, we do return to
30225 our caller) only if both branches of the if return.
30227 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
30228 short-circuit operators, handle them as short circuit operators.
30230 (Cast.DoResolve): Resolve type.
30231 (Cast.Cast): Take an expression as the target type.
30233 * cs-parser.jay (cast_expression): Remove old hack that only
30234 allowed a limited set of types to be handled. Now we take a
30235 unary_expression and we resolve to a type during semantic
30238 Use the grammar productions from Rhys to handle casts (this is
30239 not complete like Rhys syntax yet, we fail to handle that corner
30240 case that C# has regarding (-x), but we will get there.
30242 2001-11-22 Ravi Pratap <ravi@ximian.com>
30244 * class.cs (EmitFieldInitializer): Take care of the case when we have a
30245 field which is an array type.
30247 * cs-parser.jay (declare_local_variables): Support array initialization too.
30249 * typemanager.cs (MakeKey): Implement.
30251 (everywhere): Use the above appropriately.
30253 * cs-parser.jay (for_statement): Update for array initialization while
30254 declaring variables.
30256 * ecore.cs : The error message was correct, it's the variable's names that
30257 were misleading ;-) Make the code more readable.
30259 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
30260 the correct type etc.
30262 (ConvertExplicit): Handle Enum types by examining the underlying type.
30264 2001-11-21 Ravi Pratap <ravi@ximian.com>
30266 * parameter.cs (GetCallingConvention): Always return
30267 CallingConventions.Standard for now.
30269 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30271 * expression.cs (Binary.ResolveOperator): Update the values of `l'
30272 and `r' after calling DoNumericPromotions.
30274 * ecore.cs: Fix error message (the types were in the wrong order).
30276 * statement.cs (Foreach.ProbeCollectionType): Need to pass
30277 BindingFlags.Instance as well
30279 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
30280 implicit int literal conversion in an empty cast so that we
30281 propagate the right type upstream.
30283 (UnboxCast): new class used to unbox value types.
30284 (Expression.ConvertExplicit): Add explicit type conversions done
30287 (Expression.ImplicitNumericConversion): Oops, forgot to test for
30288 the target type before applying the implicit LongLiterals to ULong
30291 2001-11-21 Miguel de Icaza <miguel@ximian.com>
30293 * cs-parser.jay (for_statement): Reworked the way For works: now
30294 we declare manually any variables that are introduced in
30295 for_initializer to solve the problem of having out-of-band code
30296 emition (that is what got for broken).
30298 (declaration_statement): Perform the actual variable declaration
30299 that used to be done in local_variable_declaration here.
30301 (local_variable_declaration): Do not declare anything, just pass
30302 the information on a DictionaryEntry
30304 2001-11-20 Ravi Pratap <ravi@ximian.com>
30306 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
30307 re-write of the logic to now make it recursive.
30309 (UpdateIndices): Re-write accordingly.
30311 Store element data in a separate ArrayData list in the above methods.
30313 (MakeByteBlob): Implement to dump the array data into a byte array.
30315 2001-11-19 Ravi Pratap <ravi@ximian.com>
30317 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
30320 * constant.cs (Define): Implement.
30322 (EmitConstant): Re-write fully.
30324 Pass in location info.
30326 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
30329 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
30330 DictionaryEntry since we need location info too.
30332 (constant_declaration): Update accordingly.
30334 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
30335 code into another method : UpdateIndices.
30337 2001-11-18 Ravi Pratap <ravi@ximian.com>
30339 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
30340 some type checking etc.
30342 2001-11-17 Ravi Pratap <ravi@ximian.com>
30344 * expression.cs (ArrayCreation::ValidateInitializers): Implement
30345 bits to provide dimension info if the user skips doing that.
30347 Update second constructor to store the rank correctly.
30349 2001-11-16 Ravi Pratap <ravi@ximian.com>
30351 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
30352 and try to implement.
30354 * ../errors/cs0150.cs : Add.
30356 * ../errors/cs0178.cs : Add.
30358 2001-11-16 Miguel de Icaza <miguel@ximian.com>
30360 * statement.cs: Implement foreach on multi-dimensional arrays.
30362 * parameter.cs (Parameters.GetParameterByName): Also lookup the
30363 name of the params argument.
30365 * expression.cs: Use EmitStoreOpcode to get the right opcode while
30366 initializing the array.
30368 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
30369 we can use this elsewhere.
30371 * statement.cs: Finish implementation of foreach for single
30374 * cs-parser.jay: Use an out-of-band stack to pass information
30375 around, I wonder why I need this.
30377 foreach_block: Make the new foreach_block the current_block.
30379 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
30380 function used to return a static Parameters structure. Used for
30381 empty parameters, as those are created very frequently.
30383 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
30385 2001-11-15 Ravi Pratap <ravi@ximian.com>
30387 * interface.cs : Default modifier is private, not public. The
30388 make verify test passes again.
30390 2001-11-15 Ravi Pratap <ravi@ximian.com>
30392 * support.cs (ReflectionParameters): Fix logic to determine
30393 whether the last parameter is a params one. Test 9 passes again.
30395 * delegate.cs (Populate): Register the builders we define with
30396 RegisterParameterForBuilder. Test 19 passes again.
30398 * cs-parser.jay (property_declaration): Reference $6 instead
30399 of $$ to get at the location.
30401 (indexer_declaration): Similar stuff.
30403 (attribute): Ditto.
30405 * class.cs (Property): Register parameters for the Get and Set methods
30406 if they exist. Test 23 passes again.
30408 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
30409 call to EmitArguments as we are sure there aren't any params arguments.
30410 Test 32 passes again.
30412 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
30413 IndexOutOfRangeException.
30415 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
30416 Test 33 now passes again.
30418 2001-11-15 Miguel de Icaza <miguel@ximian.com>
30420 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
30421 broke a bunch of things. Will have to come up with a better way
30422 of tracking locations.
30424 * statement.cs: Implemented foreach for single dimension arrays.
30426 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30428 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
30429 an error. This removes the lookup from the critical path.
30431 * cs-parser.jay: Removed use of temporary_loc, which is completely
30434 2001-11-14 Miguel de Icaza <miguel@ximian.com>
30436 * support.cs (ReflectionParameters.ParameterModifier): Report
30437 whether the argument is a PARAMS argument or not.
30439 * class.cs: Set the attribute `ParamArrayAttribute' on the
30440 parameter argument.
30442 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
30443 and cons_param_array_attribute (ConstructorInfo for
30444 ParamArrayAttribute).,
30446 * codegen.cs: Emit the return using the `Return' statement, that
30447 way we can report the error correctly for missing return values.
30449 * class.cs (Method.Emit): Clean up.
30451 * expression.cs (Argument.Resolve): Take another argument: the
30452 location where this argument is used. Notice that this is not
30453 part of the "Argument" class as to reduce the size of the
30454 structure (we know the approximate location anyways).
30456 Test if the argument is a variable-reference, if not, then
30457 complain with a 206.
30459 (Argument.Emit): Emit addresses of variables.
30461 (Argument.FullDesc): Simplify.
30463 (Invocation.DoResolve): Update for Argument.Resolve.
30465 (ElementAccess.DoResolve): ditto.
30467 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
30468 method should be virtual, as this method is always virtual.
30470 (NewDelegate.DoResolve): Update for Argument.Resolve.
30472 * class.cs (ConstructorInitializer.DoResolve): ditto.
30474 * attribute.cs (Attribute.Resolve): ditto.
30476 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30478 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
30480 * expression.cs (ParameterReference): Drop IStackStorage and implement
30481 IAssignMethod instead.
30483 (LocalVariableReference): ditto.
30485 * ecore.cs (FieldExpr): Drop IStackStorage and implement
30486 IAssignMethod instead.
30488 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30490 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
30491 enumerations that are used in heavily used structures derive from
30492 byte in a laughable and pathetic attempt to reduce memory usage.
30493 This is the kind of pre-optimzations that you should not do at
30494 home without adult supervision.
30496 * expression.cs (UnaryMutator): New class, used to handle ++ and
30497 -- separatedly from the other unary operators. Cleans up the
30498 code, and kills the ExpressionStatement dependency in Unary.
30500 (Unary): Removed `method' and `Arguments' from this class, making
30501 it smaller, and moving it all to SimpleCall, so I can reuse this
30502 code in other locations and avoid creating a lot of transient data
30503 strucutres when not required.
30505 * cs-parser.jay: Adjust for new changes.
30507 2001-11-11 Miguel de Icaza <miguel@ximian.com>
30509 * enum.cs (Enum.Populate): If there is a failure during
30512 * cs-parser.jay (opt_enum_base): we used to catch type errors
30513 here, but this is really incorrect. The type error should be
30514 catched during semantic analysis.
30516 2001-12-11 Ravi Pratap <ravi@ximian.com>
30518 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
30519 current_local_parameters as expected since I, in my stupidity, had forgotten
30522 * attribute.cs (GetValidPlaces): Fix stupid bug.
30524 * class.cs (Method::Emit): Perform check on applicability of attributes.
30526 (Constructor::Emit): Ditto.
30528 (Field::Emit): Ditto.
30530 (Field.Location): Store location information.
30532 (Property, Event, Indexer, Operator): Ditto.
30534 * cs-parser.jay (field_declaration): Pass in location for each field.
30536 * ../errors/cs0592.cs : Add.
30538 2001-11-12 Ravi Pratap <ravi@ximian.com>
30540 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
30542 (InitCoreTypes): Update accordingly.
30544 (RegisterAttrType, LookupAttr): Implement.
30546 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
30547 info about the same.
30549 (Resolve): Update to populate the above as necessary.
30551 (Error592): Helper.
30553 (GetValidPlaces): Helper to the above.
30555 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
30557 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
30559 2001-11-12 Ravi Pratap <ravi@ximian.com>
30561 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
30563 * ../errors/cs0617.cs : Add.
30565 2001-11-11 Ravi Pratap <ravi@ximian.com>
30567 * enum.cs (Emit): Rename to Populate to be more consistent with what
30568 we expect it to do and when exactly it is called.
30570 * class.cs, rootcontext.cs : Update accordingly.
30572 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
30573 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
30575 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
30577 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
30578 of a fieldinfo using the above, when dealing with a FieldBuilder.
30580 2001-11-10 Ravi Pratap <ravi@ximian.com>
30582 * ../errors/cs0031.cs : Add.
30584 * ../errors/cs1008.cs : Add.
30586 * ../errrors/cs0543.cs : Add.
30588 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
30591 (FindMembers): Implement.
30593 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
30594 enums and delegates too.
30596 (enum_types): Rename to builder_to_enum.
30598 (delegate_types): Rename to builder_to_delegate.
30600 * delegate.cs (FindMembers): Implement.
30602 2001-11-09 Ravi Pratap <ravi@ximian.com>
30604 * typemanager.cs (IsEnumType): Implement.
30606 * enum.cs (Emit): Re-write parts to account for the underlying type
30607 better and perform checking etc.
30609 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
30610 of the underlying type.
30612 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
30615 * enum.cs (error31): Helper to report error #31.
30617 * cs-parser.jay (enum_declaration): Store location of each member too.
30619 * enum.cs (member_to_location): New hashtable.
30621 (AddEnumMember): Update location hashtable.
30623 (Emit): Use the location of each member while reporting errors.
30625 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30627 * cs-parser.jay: A for_initializer if is a
30628 local_variable_declaration really ammount to have an implicit
30629 block with the variable declaration and no initializer for for.
30631 * statement.cs (For.Emit): Cope with null initializers.
30633 This fixes the infinite loop on for initializers.
30635 2001-11-08 Miguel de Icaza <miguel@ximian.com>
30637 * enum.cs: More cleanup.
30639 * ecore.cs: Remove dead code.
30641 * class.cs (Property.Emit): More simplification.
30642 (Event.Emit): ditto.
30644 Reworked to have less levels of indentation.
30646 2001-11-08 Ravi Pratap <ravi@ximian.com>
30648 * class.cs (Property): Emit attributes.
30658 * enum.cs (Emit): Ditto.
30660 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
30663 * class.cs (Field, Event, etc.): Move attribute generation into the
30664 Emit method everywhere.
30666 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
30667 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
30668 as we had no way of defining nested enums !
30670 * rootcontext.cs : Adjust code accordingly.
30672 * typemanager.cs (AddEnumType): To keep track of enum types separately.
30674 2001-11-07 Ravi Pratap <ravi@ximian.com>
30676 * expression.cs (EvalConstantExpression): Move into ecore.cs
30678 * enum.cs (Enum): Rename some members and make them public and readonly
30679 according to our convention.
30681 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
30684 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
30686 (Enum::Emit): Write a simple version for now which doesn't try to compute
30687 expressions. I shall modify this to be more robust in just a while.
30689 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
30691 (TypeContainer::CloseType): Create the Enum types too.
30693 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
30695 * expression.cs (EvalConstantExpression): Get rid of completely.
30697 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
30698 user-defined values and other cases.
30700 (IsValidEnumLiteral): Helper function.
30702 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
30703 out there in the case we had a literal FieldExpr.
30705 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
30707 (Literalize): Revamp a bit to take two arguments.
30709 (EnumLiteral): New class which derives from Literal to wrap enum literals.
30711 2001-11-06 Ravi Pratap <ravi@ximian.com>
30713 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
30715 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
30717 (Resolve): Use the above to ensure we have proper initializers.
30719 2001-11-05 Ravi Pratap <ravi@ximian.com>
30721 * expression.cs (Expression::EvalConstantExpression): New method to
30722 evaluate constant expressions.
30724 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
30726 2001-11-07 Miguel de Icaza <miguel@ximian.com>
30728 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
30731 (Binary.ResolveOperator): Handle operator != (object a, object b)
30732 and operator == (object a, object b);
30734 (Binary.DoNumericPromotions): Indicate whether the numeric
30735 promotion was possible.
30737 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
30740 Made the ArrayAccess implement interface IAssignMethod instead of
30741 IStackStore as the order in which arguments are passed reflects
30744 * assign.cs: Instead of using expr.ExprClass to select the way of
30745 assinging, probe for the IStackStore/IAssignMethod interfaces.
30747 * typemanager.cs: Load InitializeArray definition.
30749 * rootcontext.cs (RootContext.MakeStaticData): Used to define
30750 static data that can be used to initialize arrays.
30752 2001-11-05 Miguel de Icaza <miguel@ximian.com>
30754 * expression.cs: Handle operator== and operator!= for booleans.
30756 (Conditioal.Reduce): Implement reducer for the ?: operator.
30758 (Conditional.Resolve): Implement dead code elimination.
30760 (Binary.Resolve): Catch string literals and return a new
30761 concatenated string.
30763 (Unary.Reduce): Implement reduction of unary expressions.
30765 * ecore.cs: Split out the expression core handling here.
30767 (Expression.Reduce): New method used to perform constant folding
30768 and CSE. This is needed to support constant-expressions.
30770 * statement.cs (Statement.EmitBoolExpression): Pass true and false
30771 targets, and optimize for !x.
30773 2001-11-04 Ravi Pratap <ravi@ximian.com>
30775 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
30776 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
30777 set custom atttributes.
30779 * literal.cs (Literal::GetValue): New abstract method to return the actual
30780 value of the literal, cast as an object.
30782 (*Literal): Implement GetValue method.
30784 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
30785 expressions to the arraylist but objects of type Argument.
30787 * class.cs (TypeContainer::Emit): Emit our attributes too.
30789 (Method::Emit, Constructor::Emit): Ditto.
30791 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
30792 to be ignoring earlier.
30794 2001-11-03 Ravi Pratap <ravi@ximian.com>
30796 * attribute.cs (AttributeSection::Define): Implement to do the business
30797 of constructing a CustomAttributeBuilder.
30799 (Attribute): New trivial class. Increases readability of code.
30801 * cs-parser.jay : Update accordingly.
30803 (positional_argument_list, named_argument_list, named_argument): New rules
30805 (attribute_arguments): Use the above so that we are more correct.
30807 2001-11-02 Ravi Pratap <ravi@ximian.com>
30809 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
30810 to perform all checks for a method with a params parameter.
30812 (Invocation::OverloadResolve): Update to use the above method and therefore
30813 cope correctly with params method invocations.
30815 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
30818 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
30819 constructors in our parent too because we can't afford to miss out on
30822 * attribute.cs (AttributeSection): New name for the class Attribute
30824 Other trivial changes to improve readability.
30826 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
30827 use the new class names.
30829 2001-11-01 Ravi Pratap <ravi@ximian.com>
30831 * class.cs (Method::Define): Complete definition for params types too
30833 (Indexer::Define): Ditto.
30835 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
30836 Cope everywhere with a request for info about the array parameter.
30838 2001-11-01 Ravi Pratap <ravi@ximian.com>
30840 * tree.cs (RecordNamespace): Fix up to check for the correct key.
30842 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
30843 local_variable_type to extract the string corresponding to the type.
30845 (local_variable_type): Fixup the action to use the new helper method.
30847 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
30850 * expression.cs : Clean out code which uses the above.
30852 2001-10-31 Ravi Pratap <ravi@ximian.com>
30854 * typemanager.cs (RegisterMethod): Check if we already have an existing key
30855 and bale out if necessary by returning a false.
30857 (RegisterProperty): Ditto.
30859 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
30860 and print out appropriate error messages.
30862 * interface.cs (everywhere): Ditto.
30864 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
30865 location to constructor.
30867 * class.cs (Property, Event, Indexer): Update accordingly.
30869 * ../errors/cs111.cs : Added.
30871 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
30872 of a method, as laid down by the spec.
30874 (Invocation::OverloadResolve): Use the above method.
30876 2001-10-31 Ravi Pratap <ravi@ximian.com>
30878 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
30879 now take a TypeContainer and a Parameters object.
30881 (ParameterData): Modify return type of ParameterModifier method to be
30882 Parameter.Modifier and not a string.
30884 (ReflectionParameters, InternalParameters): Update accordingly.
30886 * expression.cs (Argument::GetParameterModifier): Same here.
30888 * support.cs (InternalParameters::ParameterType): Find a better way of determining
30889 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
30890 symbol in it at all so maybe this is only for now.
30892 2001-10-30 Ravi Pratap <ravi@ximian.com>
30894 * support.cs (InternalParameters): Constructor now takes an extra argument
30895 which is the actual Parameters class.
30897 (ParameterDesc): Update to provide info on ref/out modifiers.
30899 * class.cs (everywhere): Update call to InternalParameters to pass in
30900 the second argument too.
30902 * support.cs (ParameterData): Add ParameterModifier, which is a method
30903 to return the modifier info [ref/out etc]
30905 (InternalParameters, ReflectionParameters): Implement the above.
30907 * expression.cs (Argument::ParameterModifier): Similar function to return
30908 info about the argument's modifiers.
30910 (Invocation::OverloadResolve): Update to take into account matching modifiers
30913 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
30914 a new SetFormalParameters object which we pass to InternalParameters.
30916 2001-10-30 Ravi Pratap <ravi@ximian.com>
30918 * expression.cs (NewArray): Merge into the ArrayCreation class.
30920 2001-10-29 Ravi Pratap <ravi@ximian.com>
30922 * expression.cs (NewArray): Merge classes NewBuiltinArray and
30923 NewUserdefinedArray into one as there wasn't much of a use in having
30926 * expression.cs (Argument): Change field's name to ArgType from Type.
30928 (Type): New readonly property which returns the proper type, taking into
30929 account ref/out modifiers.
30931 (everywhere): Adjust code accordingly for the above.
30933 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
30934 whether we are emitting for a ref or out parameter.
30936 * expression.cs (Argument::Emit): Use the above field to set the state.
30938 (LocalVariableReference::Emit): Update to honour the flag and emit the
30941 * parameter.cs (Attributes): Set the correct flags for ref parameters.
30943 * expression.cs (Argument::FullDesc): New function to provide a full desc.
30945 * support.cs (ParameterData): Add method ParameterDesc to the interface.
30947 (ReflectionParameters, InternalParameters): Implement the above method.
30949 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
30952 (Invocation::FullMethodDesc): Ditto.
30954 2001-10-29 Miguel de Icaza <miguel@ximian.com>
30956 * cs-parser.jay: Add extra production for the second form of array
30959 * expression.cs (ArrayCreation): Update to reflect the above
30962 * Small changes to prepare for Array initialization.
30964 2001-10-28 Miguel de Icaza <miguel@ximian.com>
30966 * typemanager.cs (ImplementsInterface): interface might be null;
30967 Deal with this problem;
30969 Also, we do store negative hits on the cache (null values), so use
30970 this instead of calling t.GetInterfaces on the type everytime.
30972 2001-10-28 Ravi Pratap <ravi@ximian.com>
30974 * typemanager.cs (IsBuiltinType): New method to help determine the same.
30976 * expression.cs (New::DoResolve): Get rid of array creation code and instead
30977 split functionality out into different classes.
30979 (New::FormArrayType): Move into NewBuiltinArray.
30981 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
30984 (NewBuiltinArray): New class to handle creation of built-in arrays.
30986 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
30987 account creation of one-dimensional arrays.
30989 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
30991 (NewUserdefinedArray::DoResolve): Implement.
30993 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
30995 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
30996 we maintain inside the TypeManager. This is necessary to perform lookups on the
30999 (LookupType): Update to perform GetType on the module builders too.
31001 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
31003 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
31005 2001-10-23 Ravi Pratap <ravi@ximian.com>
31007 * expression.cs (New::DoResolve): Implement guts of array creation.
31009 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
31011 2001-10-27 Miguel de Icaza <miguel@ximian.com>
31013 * expression.cs: Fix bug I introduced lsat night that broke
31016 (Expression.Resolve): Report a 246 error (can not resolve name)
31017 if we find a SimpleName in the stream.
31019 (Expression.ResolveLValue): Ditto.
31021 (Expression.ResolveWithSimpleName): This function is a variant of
31022 ResolveName, this one allows SimpleNames to be returned without a
31023 warning. The only consumer of SimpleNames is MemberAccess
31025 2001-10-26 Miguel de Icaza <miguel@ximian.com>
31027 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
31028 might arrive here. I have my doubts that this is correct.
31030 * statement.cs (Lock): Implement lock statement.
31032 * cs-parser.jay: Small fixes to support `lock' and `using'
31034 * cs-tokenizer.cs: Remove extra space
31036 * driver.cs: New flag --checked, allows to turn on integer math
31039 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
31040 Threading.Monitor.Exit
31042 2001-10-23 Miguel de Icaza <miguel@ximian.com>
31044 * expression.cs (IndexerAccess::DoResolveLValue): Set the
31045 Expression Class to be IndexerAccess.
31047 Notice that Indexer::DoResolve sets the eclass to Value.
31049 2001-10-22 Miguel de Icaza <miguel@ximian.com>
31051 * class.cs (TypeContainer::Emit): Emit code for indexers.
31053 * assign.cs (IAssignMethod): New interface implemented by Indexers
31054 and Properties for handling assignment.
31056 (Assign::Emit): Simplify and reuse code.
31058 * expression.cs (IndexerAccess, PropertyExpr): Implement
31059 IAssignMethod, clean up old code.
31061 2001-10-22 Ravi Pratap <ravi@ximian.com>
31063 * typemanager.cs (ImplementsInterface): New method to determine if a type
31064 implements a given interface. Provides a nice cache too.
31066 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
31069 (ConvertReferenceExplicit): Ditto.
31071 * delegate.cs (Delegate::Populate): Update to define the parameters on the
31072 various methods, with correct names etc.
31074 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
31075 Operator.UnaryNegation.
31077 * cs-parser.jay (operator_declarator): Be a little clever in the case where
31078 we have a unary plus or minus operator.
31080 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
31083 * everywhere : update accordingly.
31085 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
31088 * class.cs (Method::Define): For the case where we are implementing a method
31089 inherited from an interface, we need to set the MethodAttributes.Final flag too.
31090 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
31092 2001-10-21 Ravi Pratap <ravi@ximian.com>
31094 * interface.cs (FindMembers): Implement to work around S.R.E
31097 * typemanager.cs (IsInterfaceType): Implement.
31099 (FindMembers): Update to handle interface types too.
31101 * expression.cs (ImplicitReferenceConversion): Re-write bits which
31102 use IsAssignableFrom as that is not correct - it doesn't work.
31104 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
31105 and accordingly override EmitStatement.
31107 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
31108 using the correct logic :-)
31110 2001-10-19 Ravi Pratap <ravi@ximian.com>
31112 * ../errors/cs-11.cs : Add to demonstrate error -11
31114 2001-10-17 Miguel de Icaza <miguel@ximian.com>
31116 * assign.cs (Assign::Resolve): Resolve right hand side first, and
31117 then pass this as a hint to ResolveLValue.
31119 * expression.cs (FieldExpr): Add Location information
31121 (FieldExpr::LValueResolve): Report assignment to readonly
31124 (Expression::ExprClassFromMemberInfo): Pass location information.
31126 (Expression::ResolveLValue): Add new method that resolves an
31129 (Expression::DoResolveLValue): Default invocation calls
31132 (Indexers): New class used to keep track of indexers in a given
31135 (IStackStore): Renamed from LValue, as it did not really describe
31136 what this did. Also ResolveLValue is gone from this interface and
31137 now is part of Expression.
31139 (ElementAccess): Depending on the element access type
31141 * typemanager.cs: Add `indexer_name_type' as a Core type
31142 (System.Runtime.CompilerServices.IndexerNameAttribute)
31144 * statement.cs (Goto): Take a location.
31146 2001-10-18 Ravi Pratap <ravi@ximian.com>
31148 * delegate.cs (Delegate::VerifyDelegate): New method to verify
31149 if two delegates are compatible.
31151 (NewDelegate::DoResolve): Update to take care of the case when
31152 we instantiate a delegate from another delegate.
31154 * typemanager.cs (FindMembers): Don't even try to look up members
31155 of Delegate types for now.
31157 2001-10-18 Ravi Pratap <ravi@ximian.com>
31159 * delegate.cs (NewDelegate): New class to take care of delegate
31162 * expression.cs (New): Split the delegate related code out into
31163 the NewDelegate class.
31165 * delegate.cs (DelegateInvocation): New class to handle delegate
31168 * expression.cs (Invocation): Split out delegate related code into
31169 the DelegateInvocation class.
31171 2001-10-17 Ravi Pratap <ravi@ximian.com>
31173 * expression.cs (New::DoResolve): Implement delegate creation fully
31174 and according to the spec.
31176 (New::DoEmit): Update to handle delegates differently.
31178 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
31179 because of which we were printing out arguments in reverse order !
31181 * delegate.cs (VerifyMethod): Implement to check if the given method
31182 matches the delegate.
31184 (FullDelegateDesc): Implement.
31186 (VerifyApplicability): Implement.
31188 * expression.cs (Invocation::DoResolve): Update to accordingly handle
31189 delegate invocations too.
31191 (Invocation::Emit): Ditto.
31193 * ../errors/cs1593.cs : Added.
31195 * ../errors/cs1594.cs : Added.
31197 * delegate.cs (InstanceExpression, TargetMethod): New properties.
31199 2001-10-16 Ravi Pratap <ravi@ximian.com>
31201 * typemanager.cs (intptr_type): Core type for System.IntPtr
31203 (InitCoreTypes): Update for the same.
31205 (iasyncresult_type, asynccallback_type): Ditto.
31207 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
31210 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
31213 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
31214 the builders for the 4 members of a delegate type :-)
31216 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
31219 * expression.cs (New::DoResolve): Implement guts for delegate creation.
31221 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
31223 2001-10-15 Miguel de Icaza <miguel@ximian.com>
31225 * statement.cs (Break::Emit): Implement.
31226 (Continue::Emit): Implement.
31228 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
31229 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
31230 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
31231 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
31234 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
31235 properties that track the label for the current loop (begin of the
31236 loop and end of the loop).
31238 2001-10-15 Ravi Pratap <ravi@ximian.com>
31240 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
31241 use of emitting anything at all.
31243 * class.cs, rootcontext.cs : Get rid of calls to the same.
31245 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
31247 (Populate): Define the constructor correctly and set the implementation
31250 * typemanager.cs (delegate_types): New hashtable to hold delegates that
31253 (AddDelegateType): Implement.
31255 (IsDelegateType): Implement helper method.
31257 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
31259 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
31260 and accordingly handle it.
31262 * delegate.cs (Populate): Take TypeContainer argument.
31263 Implement bits to define the Invoke method. However, I still haven't figured out
31264 how to take care of the native int bit :-(
31266 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
31267 Qualify the name of the delegate, not its return type !
31269 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
31272 (StandardConversionExists): Checking for array types turns out to be recursive.
31274 (ConvertReferenceExplicit): Implement array conversion.
31276 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
31278 2001-10-12 Ravi Pratap <ravi@ximian.com>
31280 * cs-parser.jay (delegate_declaration): Store the fully qualified
31281 name as it is a type declaration.
31283 * delegate.cs (ReturnType, Name): Rename members to these. Make them
31286 (DefineDelegate): Renamed from Define. Does the same thing essentially,
31287 as TypeContainer::DefineType.
31289 (Populate): Method in which all the definition of the various methods (Invoke)
31292 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
31295 (CloseDelegate): Finally creates the delegate.
31297 * class.cs (TypeContainer::DefineType): Update to define delegates.
31298 (Populate, Emit and CloseType): Do the same thing here too.
31300 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
31301 delegates in all these operations.
31303 2001-10-14 Miguel de Icaza <miguel@ximian.com>
31305 * expression.cs: LocalTemporary: a new expression used to
31306 reference a temporary that has been created.
31308 * assign.cs: Handle PropertyAccess back here, so that we can
31309 provide the proper semantic access to properties.
31311 * expression.cs (Expression::ConvertReferenceExplicit): Implement
31312 a few more explicit conversions.
31314 * modifiers.cs: `NEW' modifier maps to HideBySig.
31316 * expression.cs (PropertyExpr): Make this into an
31317 ExpressionStatement, and support the EmitStatement code path.
31319 Perform get/set error checking, clean up the interface.
31321 * assign.cs: recognize PropertyExprs as targets, and if so, turn
31322 them into toplevel access objects.
31324 2001-10-12 Miguel de Icaza <miguel@ximian.com>
31326 * expression.cs: PropertyExpr::PropertyExpr: use work around the
31329 * typemanager.cs: Keep track here of our PropertyBuilders again to
31330 work around lameness in SRE.
31332 2001-10-11 Miguel de Icaza <miguel@ximian.com>
31334 * expression.cs (LValue::LValueResolve): New method in the
31335 interface, used to perform a second resolution pass for LValues.
31337 (This::DoResolve): Catch the use of this in static methods.
31339 (This::LValueResolve): Implement.
31341 (This::Store): Remove warning, assigning to `this' in structures
31344 (Invocation::Emit): Deal with invocation of
31345 methods on value types. We need to pass the address to structure
31346 methods rather than the object itself. (The equivalent code to
31347 emit "this" for structures leaves the entire structure on the
31348 stack instead of a pointer to it).
31350 (ParameterReference::DoResolve): Compute the real index for the
31351 argument based on whether the method takes or not a `this' pointer
31352 (ie, the method is static).
31354 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
31355 value types returned from functions when we need to invoke a
31356 method on the sturcture.
31359 2001-10-11 Ravi Pratap <ravi@ximian.com>
31361 * class.cs (TypeContainer::DefineType): Method to actually do the business of
31362 defining the type in the Modulebuilder or Typebuilder. This is to take
31363 care of nested types which need to be defined on the TypeBuilder using
31364 DefineNestedMethod.
31366 (TypeContainer::GetClassBases): Implement. Essentially the code from the
31367 methods in RootContext, only ported to be part of TypeContainer.
31369 (TypeContainer::GetInterfaceOrClass): Ditto.
31371 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
31373 * interface.cs (Interface::DefineInterface): New method. Does exactly
31374 what RootContext.CreateInterface did earlier, only it takes care of nested types
31377 (Interface::GetInterfaces): Move from RootContext here and port.
31379 (Interface::GetInterfaceByName): Same here.
31381 * rootcontext.cs (ResolveTree): Re-write.
31383 (PopulateTypes): Re-write.
31385 * class.cs (TypeContainer::Populate): Populate nested types too.
31386 (TypeContainer::Emit): Emit nested members too.
31388 * typemanager.cs (AddUserType): Do not make use of the FullName property,
31389 instead just use the name argument passed in as it is already fully
31392 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
31393 to TypeContainer mapping to see if a type is user-defined.
31395 * class.cs (TypeContainer::CloseType): Implement.
31397 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
31398 the default constructor.
31400 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
31403 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
31405 * interface.cs (CloseType): Create the type here.
31407 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
31410 Remove all the methods which are now in TypeContainer.
31412 2001-10-10 Ravi Pratap <ravi@ximian.com>
31414 * delegate.cs (Define): Re-write bits to define the delegate
31417 2001-10-10 Miguel de Icaza <miguel@ximian.com>
31419 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
31421 * expression.cs (ImplicitReferenceConversion): handle null as well
31422 as a source to convert to any reference type.
31424 * statement.cs (Return): Perform any implicit conversions to
31425 expected return type.
31427 Validate use of return statement.
31429 * codegen.cs (EmitContext): Pass the expected return type here.
31431 * class.cs (Method, Constructor, Property): Pass expected return
31432 type to EmitContext.
31434 2001-10-09 Miguel de Icaza <miguel@ximian.com>
31436 * expression.cs: Make DoResolve take an EmitContext instead of a
31439 Replaced `l' and `location' for `loc', for consistency.
31441 (Error, Warning): Remove unneeded Tc argument.
31443 * assign.cs, literal.cs, constant.cs: Update to new calling
31446 * codegen.cs: EmitContext now contains a flag indicating whether
31447 code is being generated in a static method or not.
31449 * cs-parser.jay: DecomposeQI, new function that replaces the old
31450 QualifiedIdentifier. Now we always decompose the assembled
31451 strings from qualified_identifier productions into a group of
31454 2001-10-08 Miguel de Icaza <miguel@ximian.com>
31456 * rootcontext.cs: Deal with field-less struct types correctly now
31457 by passing the size option to Define Type.
31459 * class.cs: Removed hack that created one static field.
31461 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31463 * statement.cs: Moved most of the code generation here.
31465 2001-10-09 Ravi Pratap <ravi@ximian.com>
31467 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
31470 (ElementAccess): Remove useless bits for now - keep checks as the spec
31473 2001-10-08 Ravi Pratap <ravi@ximian.com>
31475 * expression.cs (ElementAccess::DoResolve): Remove my crap code
31476 and start performing checks according to the spec.
31478 2001-10-07 Ravi Pratap <ravi@ximian.com>
31480 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
31481 rank_specifiers instead.
31483 (rank_specifiers): Change the order in which the rank specifiers are stored
31485 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
31487 * expression.cs (ElementAccess): Implement the LValue interface too.
31489 2001-10-06 Ravi Pratap <ravi@ximian.com>
31491 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
31492 except that user defined conversions are not included.
31494 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
31495 perform the conversion of the return type, if necessary.
31497 (New::DoResolve): Check whether we are creating an array or an object
31498 and accordingly do the needful.
31500 (New::Emit): Same here.
31502 (New::DoResolve): Implement guts of array creation.
31504 (New::FormLookupType): Helper function.
31506 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31508 * codegen.cs: Removed most of the code generation here, and move the
31509 corresponding code generation bits to the statement classes.
31511 Added support for try/catch/finalize and throw.
31513 * cs-parser.jay: Added support for try/catch/finalize.
31515 * class.cs: Catch static methods having the flags override,
31516 virtual or abstract.
31518 * expression.cs (UserCast): This user cast was not really doing
31519 what it was supposed to do. Which is to be born in fully resolved
31520 state. Parts of the resolution were being performed at Emit time!
31524 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31526 * expression.cs: Implicity convert the result from UserCast.
31528 2001-10-05 Ravi Pratap <ravi@ximian.com>
31530 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
31531 prevented it from working correctly.
31533 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
31534 merely ConvertImplicit.
31536 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31538 * typemanager.cs: Make the LookupTypeContainer function static,
31539 and not per-instance.
31541 * class.cs: Make static FindMembers (the one that takes a Type
31544 * codegen.cs: Add EmitForeach here.
31546 * cs-parser.jay: Make foreach a toplevel object instead of the
31547 inline expansion, as we need to perform semantic analysis on it.
31549 2001-10-05 Ravi Pratap <ravi@ximian.com>
31551 * expression.cs (Expression::ImplicitUserConversion): Rename to
31552 UserDefinedConversion.
31554 (Expression::UserDefinedConversion): Take an extra argument specifying
31555 whether we look for explicit user conversions too.
31557 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
31559 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
31561 (ExplicitUserConversion): Make it a call to UserDefinedConversion
31562 with the appropriate arguments.
31564 * cs-parser.jay (cast_expression): Record location too.
31566 * expression.cs (Cast): Record location info.
31568 (Expression::ConvertExplicit): Take location argument.
31570 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
31571 to determine if we are doing explicit conversions.
31573 (UserCast::Emit): Update accordingly.
31575 (Expression::ConvertExplicit): Report an error if everything fails.
31577 * ../errors/cs0030.cs : Add.
31579 2001-10-04 Miguel de Icaza <miguel@ximian.com>
31581 * modifiers.cs: If the ABSTRACT keyword is present, also set the
31582 virtual and newslot bits.
31584 * class.cs (TypeContainer::RegisterRequiredImplementations):
31585 Record methods we need.
31587 (TypeContainer::MakeKey): Helper function to make keys for
31588 MethodBases, since the Methodbase key is useless.
31590 (TypeContainer::Populate): Call RegisterRequiredImplementations
31591 before defining the methods.
31593 Create a mapping for method_builders_to_methods ahead of time
31594 instead of inside a tight loop.
31596 (::RequireMethods): Accept an object as the data to set into the
31597 hashtable so we can report interface vs abstract method mismatch.
31599 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31601 * report.cs: Make all of it static.
31603 * rootcontext.cs: Drop object_type and value_type computations, as
31604 we have those in the TypeManager anyways.
31606 Drop report instance variable too, now it is a global.
31608 * driver.cs: Use try/catch on command line handling.
31610 Add --probe option to debug the error reporting system with a test
31613 * report.cs: Add support for exiting program when a probe
31614 condition is reached.
31616 2001-10-03 Ravi Pratap <ravi@ximian.com>
31618 * expression.cs (Binary::DoNumericPromotions): Fix the case when
31619 we do a forcible conversion regardless of type, to check if
31620 ForceConversion returns a null.
31622 (Binary::error19): Use location to report error.
31624 (Unary::error23): Use location here too.
31626 * ../errors/cs0019.cs : Check in.
31628 * ../errors/cs0023.cs : Check in.
31630 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
31631 case of a non-null MethodInfo object with a length of 0 !
31633 (Binary::ResolveOperator): Flag error if overload resolution fails to find
31634 an applicable member - according to the spec :-)
31635 Also fix logic to find members in base types.
31637 (Unary::ResolveOperator): Same here.
31639 (Unary::report23): Change name to error23 and make first argument a TypeContainer
31640 as I was getting thoroughly confused between this and error19 :-)
31642 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
31643 (::FindMostEncompassedType): Implement.
31644 (::FindMostEncompassingType): Implement.
31645 (::StandardConversionExists): Implement.
31647 (UserImplicitCast): Re-vamp. We now need info about most specific
31648 source and target types so that we can do the necessary conversions.
31650 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
31651 mathematical union with no duplicates.
31653 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31655 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
31656 in order from base classes to child classes, so that we can in
31657 child classes look up in our parent for method names and
31658 attributes (required for handling abstract, virtual, new, override
31659 constructs: we need to instrospect our base class, and if we dont
31660 populate the classes in order, the introspection might be
31661 incorrect. For example, a method could query its parent before
31662 the parent has any methods and would determine that the parent has
31663 no abstract methods (while it could have had them)).
31665 (RootContext::CreateType): Record the order in which we define the
31668 2001-10-02 Miguel de Icaza <miguel@ximian.com>
31670 * class.cs (TypeContainer::Populate): Also method definitions can
31671 fail now, keep track of this.
31673 (TypeContainer::FindMembers): Implement support for
31674 DeclaredOnly/noDeclaredOnly flag.
31676 (Constructor::Emit) Return the ConstructorBuilder.
31678 (Method::Emit) Return the MethodBuilder.
31679 Check for abstract or virtual methods to be public.
31681 * rootcontext.cs (RootContext::CreateType): Register all the
31682 abstract methods required for the class to be complete and the
31683 interface methods that must be implemented.
31685 * cs-parser.jay: Report error 501 (method requires body if it is
31686 not marked abstract or extern).
31688 * expression.cs (TypeOf::Emit): Implement.
31690 * typemanager.cs: runtime_handle_type, new global type.
31692 * class.cs (Property::Emit): Generate code for properties.
31694 2001-10-02 Ravi Pratap <ravi@ximian.com>
31696 * expression.cs (Unary::ResolveOperator): Find operators on base type
31697 too - we now conform exactly to the spec.
31699 (Binary::ResolveOperator): Same here.
31701 * class.cs (Operator::Define): Fix minor quirk in the tests.
31703 * ../errors/cs0215.cs : Added.
31705 * ../errors/cs0556.cs : Added.
31707 * ../errors/cs0555.cs : Added.
31709 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31711 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
31712 single integer which is really efficient
31714 2001-10-01 Ravi Pratap <ravi@ximian.com>
31716 * expression.cs (Expression::ImplicitUserConversion): Use location
31717 even in the case when we are examining True operators.
31719 * class.cs (Operator::Define): Perform extensive checks to conform
31720 with the rules for operator overloading in the spec.
31722 * expression.cs (Expression::ImplicitReferenceConversion): Implement
31723 some of the other conversions mentioned in the spec.
31725 * typemanager.cs (array_type): New static member for the System.Array built-in
31728 (cloneable_interface): For System.ICloneable interface.
31730 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
31731 we start resolving the tree and populating types.
31733 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
31735 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31737 * expression.cs (Expression::ExprClassFromMemberInfo,
31738 Expression::Literalize): Create literal expressions from
31739 FieldInfos which are literals.
31741 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
31742 type casts, because they were wrong. The test suite in tests
31745 (ImplicitNumericConversion): ushort to ulong requires a widening
31748 Int32 constant to long requires widening cast as well.
31750 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
31751 for integers because the type on the stack is not i4.
31753 2001-09-30 Miguel de Icaza <miguel@ximian.com>
31755 * expression.cs (report118): require location argument.
31757 * parameter.cs: Do not dereference potential null value.
31759 * class.cs: Catch methods that lack the `new' keyword when
31760 overriding a name. Report warnings when `new' is used without
31761 anything being there to override.
31763 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
31765 * class.cs: Only add constructor to hashtable if it is non-null
31766 (as now constructors can fail on define).
31768 (TypeManager, Class, Struct): Take location arguments.
31770 Catch field instance initialization in structs as errors.
31772 accepting_filter: a new filter for FindMembers that is static so
31773 that we dont create an instance per invocation.
31775 (Constructor::Define): Catch errors where a struct constructor is
31778 * cs-parser.jay: Pass location information for various new
31781 * delegate.cs (Delegate): take a location argument.
31783 * driver.cs: Do not call EmitCode if there were problesm in the
31784 Definition of the types, as many Builders wont be there.
31786 * decl.cs (Decl::Decl): Require a location argument.
31788 * cs-tokenizer.cs: Handle properly hex constants that can not fit
31789 into integers, and find the most appropiate integer for it.
31791 * literal.cs: Implement ULongLiteral.
31793 * rootcontext.cs: Provide better information about the location of
31794 failure when CreateType fails.
31796 2001-09-29 Miguel de Icaza <miguel@ximian.com>
31798 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
31801 * expression.cs (Binary::CheckShiftArguments): Add missing type
31803 (Binary::ResolveOperator): Add type to the logical and and logical
31804 or, Bitwise And/Or and Exclusive Or code paths, it was missing
31807 (Binary::DoNumericPromotions): In the case where either argument
31808 is ulong (and most signed types combined with ulong cause an
31809 error) perform implicit integer constant conversions as well.
31811 2001-09-28 Miguel de Icaza <miguel@ximian.com>
31813 * expression.cs (UserImplicitCast): Method should always be
31815 (Invocation::BetterConversion): Simplified test for IntLiteral.
31817 (Expression::ImplicitNumericConversion): Split this routine out.
31818 Put the code that performs implicit constant integer conversions
31821 (Expression::Resolve): Become a wrapper around DoResolve so we can
31822 check eclass and type being set after resolve.
31824 (Invocation::Badness): Remove this dead function
31826 (Binary::ResolveOperator): Do not compute the expensive argumnets
31827 unless we have a union for it.
31829 (Probe::Emit): Is needs to do an isinst and then
31830 compare against null.
31832 (::CanConvert): Added Location argument. If the Location argument
31833 is null (Location.Null), then we do not report errors. This is
31834 used by the `probe' mechanism of the Explicit conversion. We do
31835 not want to generate an error for something that the user
31836 explicitly requested to be casted. But the pipeline for an
31837 explicit cast first tests for potential implicit casts.
31839 So for now, if the Location is null, it means `Probe only' to
31840 avoid adding another argument. Might have to revise this
31843 (ClassCast): New class used to type cast objects into arbitrary
31844 classes (used in Explicit Reference Conversions).
31846 Implement `as' as well.
31848 Reverted all the patches from Ravi below: they were broken:
31850 * The use of `level' as a mechanism to stop recursive
31851 invocations is wrong. That was there just to catch the
31852 bug with a strack trace but not as a way of addressing
31855 To fix the problem we have to *understand* what is going
31856 on and the interactions and come up with a plan, not
31857 just get things going.
31859 * The use of the type conversion cache that I proposed
31860 last night had an open topic: How does this work across
31861 protection domains. A user defined conversion might not
31862 be public in the location where we are applying the
31863 conversion, a different conversion might be selected
31864 (ie, private A->B (better) but public B->A (worse),
31865 inside A, A->B applies, but outside it, B->A will
31868 * On top of that (ie, even if the above is solved),
31869 conversions in a cache need to be abstract. Ie, `To
31870 convert from an Int to a Short use an OpcodeCast', not
31871 `To convert from an Int to a Short use the OpcodeCast on
31872 the variable 5' (which is what this patch was doing).
31874 2001-09-28 Ravi Pratap <ravi@ximian.com>
31876 * expression.cs (Invocation::ConversionExists): Re-write to use
31877 the conversion cache
31879 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
31880 cache all conversions done, not just user-defined ones.
31882 (Invocation::BetterConversion): The real culprit. Use ConversionExists
31883 to determine if a conversion exists instead of acutually trying to
31884 perform the conversion. It's faster too.
31886 (Expression::ConvertExplicit): Modify to use ConversionExists to check
31887 and only then attempt the implicit conversion.
31889 2001-09-28 Ravi Pratap <ravi@ximian.com>
31891 * expression.cs (ConvertImplicit): Use a cache for conversions
31892 already found. Check level of recursion and bail out if necessary.
31894 2001-09-28 Miguel de Icaza <miguel@ximian.com>
31896 * typemanager.cs (string_concat_string_string, string_concat_object_object):
31897 Export standard methods that we expect for string operations.
31899 * statement.cs (Block::UsageWarning): Track usage of variables and
31900 report the errors for not used variables.
31902 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
31905 2001-09-27 Miguel de Icaza <miguel@ximian.com>
31907 * codegen.cs: remove unnneded code
31909 * expression.cs: Removed BuiltinTypeAccess class
31911 Fix the order in which implicit conversions are
31914 The previous fixed dropped support for boxed conversions (adding a
31915 test to the test suite now)
31917 (UserImplicitCast::CanConvert): Remove test for source being null,
31918 that code is broken. We should not feed a null to begin with, if
31919 we do, then we should track the bug where the problem originates
31920 and not try to cover it up here.
31922 Return a resolved expression of type UserImplicitCast on success
31923 rather than true/false. Ravi: this is what I was talking about,
31924 the pattern is to use a static method as a "constructor" for
31927 Also, do not create arguments until the very last minute,
31928 otherwise we always create the arguments even for lookups that
31929 will never be performed.
31931 (UserImplicitCast::Resolve): Eliminate, objects of type
31932 UserImplicitCast are born in a fully resolved state.
31934 * typemanager.cs (InitCoreTypes): Init also value_type
31935 (System.ValueType).
31937 * expression.cs (Cast::Resolve): First resolve the child expression.
31939 (LValue): Add new method AddressOf to be used by
31942 Change the argument of Store to take an EmitContext instead of an
31943 ILGenerator, because things like FieldExpr need to be able to call
31944 their children expression to generate the instance code.
31946 (Expression::Error, Expression::Warning): Sugar functions for
31949 (Expression::MemberLookup): Accept a TypeContainer instead of a
31950 Report as the first argument.
31952 (Expression::ResolvePrimary): Killed. I still want to improve
31953 this as currently the code is just not right.
31955 (Expression::ResolveMemberAccess): Simplify, but it is still
31958 (Unary::Resolve): Catch errors in AddressOf operators.
31960 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
31961 index to a byte for the short-version, or the compiler will choose
31962 the wrong Emit call, which generates the wrong data.
31964 (ParameterReference::Emit, ::Store): same.
31966 (FieldExpr::AddressOf): Implement.
31968 * typemanager.cs: TypeManager: made public variable instead of
31971 * driver.cs: document --fatal.
31973 * report.cs (ErrorMessage, WarningMessage): new names for the old
31974 Error and Warning classes.
31976 * cs-parser.jay (member_access): Turn built-in access to types
31977 into a normal simplename
31979 2001-09-27 Ravi Pratap <ravi@ximian.com>
31981 * expression.cs (Invocation::BetterConversion): Fix to cope
31982 with q being null, since this was introducing a bug.
31984 * expression.cs (ConvertImplicit): Do built-in conversions first.
31986 2001-09-27 Ravi Pratap <ravi@ximian.com>
31988 * expression.cs (UserImplicitCast::Resolve): Fix bug.
31990 2001-09-27 Ravi Pratap <ravi@ximian.com>
31992 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
31993 I had introduced long ago (what's new ?).
31995 * expression.cs (UserImplicitCast::CanConvert): Static method to do
31996 the work of all the checking.
31997 (ConvertImplicit): Call CanConvert and only then create object if necessary.
31998 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
32000 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
32001 that is the right way.
32003 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
32004 overloading resolution. Use everywhere instead of cutting and pasting code.
32006 (Binary::ResolveOperator): Use MakeUnionSet.
32008 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
32009 we have to convert to bool types. Not complete yet.
32011 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32013 * typemanager.cs (TypeManager::CSharpName): support ushort.
32015 * expression.cs (Expression::TryImplicitIntConversion): Attempts
32016 to provide an expression that performsn an implicit constant int
32017 conversion (section 6.1.6).
32018 (Expression::ConvertImplicitRequired): Reworked to include
32019 implicit constant expression conversions.
32021 (Expression::ConvertNumericExplicit): Finished.
32023 (Invocation::Emit): If InstanceExpression is null, then it means
32024 that we perform a call on this.
32026 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32028 * expression.cs (Unary::Emit): Remove some dead code.
32029 (Probe): Implement Resolve and Emit for `is'.
32030 (Expression::ConvertImplicitRequired): Attempt to do constant
32031 expression conversions here. Maybe should be moved to
32032 ConvertImplicit, but I am not sure.
32033 (Expression::ImplicitLongConstantConversionPossible,
32034 Expression::ImplicitIntConstantConversionPossible): New functions
32035 that tell whether is it possible to apply an implicit constant
32036 expression conversion.
32038 (ConvertNumericExplicit): Started work on explicit numeric
32041 * cs-parser.jay: Update operator constants.
32043 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
32044 (Parameters::GetSignature): Hook up VerifyArgs here.
32045 (Parameters::VerifyArgs): Verifies that no two arguments have the
32048 * class.cs (Operator): Update the operator names to reflect the
32049 ones that the spec expects (as we are just stringizing the
32052 * expression.cs (Unary::ResolveOperator): Fix bug: Use
32053 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
32054 previous usage did only work for our methods.
32055 (Expression::ConvertImplicit): Handle decimal implicit numeric
32056 conversions as well.
32057 (Expression::InternalTypeConstructor): Used to invoke constructors
32058 on internal types for default promotions.
32060 (Unary::Emit): Implement special handling for the pre/post
32061 increment/decrement for overloaded operators, as they need to have
32062 the same semantics as the other operators.
32064 (Binary::ResolveOperator): ditto.
32065 (Invocation::ConversionExists): ditto.
32066 (UserImplicitCast::Resolve): ditto.
32068 2001-09-26 Ravi Pratap <ravi@ximian.com>
32070 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
32071 operator, return after emitting body. Regression tests pass again !
32073 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
32074 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
32075 (Invocation::OverloadResolve): Ditto.
32076 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
32078 * everywhere : update calls to the above methods accordingly.
32080 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32082 * assign.cs (Assign): Make it inherit from ExpressionStatement.
32084 * expression.cs (ExpressionStatement): New base class used for
32085 expressions that can appear in statements, so that we can provide
32086 an alternate path to generate expression that do not leave a value
32089 (Expression::Emit, and all the derivatives): We no longer return
32090 whether a value is left on the stack or not. Every expression
32091 after being emitted leaves a single value on the stack.
32093 * codegen.cs (EmitContext::EmitStatementExpression): Use the
32094 facilties of ExpressionStatement if possible.
32096 * cs-parser.jay: Update statement_expression.
32098 2001-09-25 Miguel de Icaza <miguel@ximian.com>
32100 * driver.cs: Change the wording of message
32102 2001-09-25 Ravi Pratap <ravi@ximian.com>
32104 * expression.cs (Binary::ResolveOperator): Had forgottten to set
32105 the type of the expression to the return type of the method if
32106 we have an overloaded operator match ! The regression tests pass again !
32107 (Unary::ResolveOperator): Ditto.
32109 * expression.cs (Invocation::ConversionExists): Correct the member lookup
32110 to find "op_Implicit", not "implicit" ;-)
32111 (UserImplicitCast): New class to take care of user-defined implicit conversions.
32112 (ConvertImplicit, ForceConversion): Take TypeContainer argument
32114 * everywhere : Correct calls to the above accordingly.
32116 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
32117 (ConvertImplicit): Do user-defined conversion if it exists.
32119 2001-09-24 Miguel de Icaza <miguel@ximian.com>
32121 * assign.cs: track location.
32122 (Resolve): Use implicit conversions on assignment.
32124 * literal.cs: Oops. Not good, Emit of short access values should
32125 pass (Bytes) or the wrong argument will be selected.
32127 * expression.cs (Unary::Emit): Emit code for -expr.
32129 (Unary::ResolveOperator): Handle `Substract' for non-constants
32130 (substract from zero from the non-constants).
32131 Deal with Doubles as well.
32133 (Expression::ConvertImplicitRequired): New routine that reports an
32134 error if no implicit conversion exists.
32136 (Invocation::OverloadResolve): Store the converted implicit
32137 expressions if we make them
32139 2001-09-24 Ravi Pratap <ravi@ximian.com>
32141 * class.cs (ConstructorInitializer): Take a Location argument.
32142 (ConstructorBaseInitializer): Same here.
32143 (ConstructorThisInitializer): Same here.
32145 * cs-parser.jay : Update all calls accordingly.
32147 * expression.cs (Unary, Binary, New): Take location argument.
32148 Update accordingly everywhere.
32150 * cs-parser.jay : Update all calls to the above to take a location
32153 * class.cs : Ditto.
32155 2001-09-24 Ravi Pratap <ravi@ximian.com>
32157 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
32158 (Invocation::BetterConversion): Same here
32159 (Invocation::ConversionExists): Ditto.
32161 (Invocation::ConversionExists): Implement.
32163 2001-09-22 Ravi Pratap <ravi@ximian.com>
32165 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
32166 Also take an additional TypeContainer argument.
32168 * All over : Pass in TypeContainer as argument to OverloadResolve.
32170 * typemanager.cs (CSharpName): Update to check for the string type and return
32173 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
32176 2001-09-21 Ravi Pratap <ravi@ximian.com>
32178 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
32179 (Invocation::BetterFunction): Implement.
32180 (Invocation::BetterConversion): Implement.
32181 (Invocation::ConversionExists): Skeleton, no implementation yet.
32183 Okay, things work fine !
32185 2001-09-21 Miguel de Icaza <miguel@ximian.com>
32187 * typemanager.cs: declare and load enum_type, delegate_type and
32190 * expression.cs (Expression::Emit): Now emit returns a value that
32191 tells whether a value is left on the stack or not. This strategy
32192 might be reveted tomorrow with a mechanism that would address
32193 multiple assignments.
32194 (Expression::report118): Utility routine to report mismatches on
32197 (Unary::Report23): Report impossible type/operator combination
32200 (Unary::IsIncrementableNumber): Whether the type can be
32201 incremented or decremented with add.
32202 (Unary::ResolveOperator): Also allow enumerations to be bitwise
32204 (Unary::ResolveOperator): Implement ++, !, ~,
32206 (Invocation::Emit): Deal with new Emit convetion.
32208 * All Expression derivatives: Updated their Emit method to return
32209 whether they leave values on the stack or not.
32211 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
32212 stack for expressions that are statements.
32214 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32216 * expression.cs (LValue): New interface. Must be implemented by
32218 (LocalVariableReference, ParameterReference, FieldExpr): Implement
32221 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
32222 interface for generating code, simplifies the code.
32224 2001-09-20 Ravi Pratap <ravi@ximian.com>
32226 * expression.cs (everywhere): Comment out return statements in ::Resolve
32227 methods to avoid the warnings.
32229 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32231 * driver.cs (parse): Report error 2001 if we can not open the
32234 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
32237 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
32240 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
32241 otherwise nested blocks end up with the same index.
32243 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
32245 * expression.cs: Instead of having FIXMEs in the Resolve
32246 functions, throw exceptions so it is obvious that we are facing a
32249 * cs-parser.jay (invocation_expression): Pass Location information.
32251 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
32252 Use a basename for those routines because .NET does not like paths
32255 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
32258 2001-09-19 Miguel de Icaza <miguel@ximian.com>
32260 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
32261 are loading the correct data types (throws an exception if not).
32262 (TypeManager::InitCoreTypes): Use CoreLookupType
32264 * expression.cs (Unary::ResolveOperator): return the child
32265 expression for expressions which are just +expr.
32266 (Unary::ResolveOperator): Return negative literals for -LITERAL
32267 expressions (otherwise they are Unary {Literal}).
32268 (Invocation::Badness): Take into account `Implicit constant
32269 expression conversions'.
32271 * literal.cs (LongLiteral): Implement long literal class.
32272 (IntLiteral): export the `Value' of the intliteral.
32274 2001-09-19 Ravi Pratap <ravi@ximian.com>
32276 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
32278 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
32279 instead of 'Operator'
32281 * expression.cs (Binary::ResolveOperator): Update accordingly.
32282 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
32285 * cs-parser.jay (unary_expression): Update to use the new names.
32287 * gen-treedump.cs (GetUnary): Same here.
32289 * expression.cs (Unary::Resolve): Implement.
32290 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
32291 operators are found instead of making noise ;-)
32292 (Unary::ResolveOperator): New method to do precisely the same thing which
32293 Binary::ResolveOperator does for Binary expressions.
32294 (Unary.method, .Arguments): Add.
32295 (Unary::OperName): Implement.
32296 (Unary::ForceConversion): Copy and Paste !
32298 * class.cs (Operator::Define): Fix a small bug for the case when we have
32301 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
32302 for the inbuilt operators. Only overloading works for now ;-)
32304 2001-09-18 Miguel de Icaza <miguel@ximian.com>
32306 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
32307 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
32309 * expression.cs (This::Emit): Implement.
32310 (This::Resolve): Implement.
32311 (TypeOf:Resolve): Implement.
32312 (Expression::ResolveSimpleName): Add an implicit this to instance
32314 (MemberAccess::Resolve): Deal with Parameters and Fields.
32315 Bind instance variable to Field expressions.
32316 (FieldExpr::Instance): New field used to track the expression that
32317 represents the object instance.
32318 (FieldExpr::Resolve): Track potential errors from MemberLookup not
32320 (FieldExpr::Emit): Implement.
32322 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
32323 the last instruction contains a return opcode to avoid generating
32324 the last `ret' instruction (this generates correct code, and it is
32325 nice to pass the peverify output).
32327 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
32328 initializer for static and instance variables.
32329 (Constructor::Emit): Allow initializer to be null in the case of
32330 static constructors. Only emit initializer for instance
32333 (TypeContainer::FindMembers): Return a null array if there are no
32336 Also fix the code for the MemberTypes.Method branch, as it was not
32337 scanning that for operators (or tried to access null variables before).
32339 * assign.cs (Assign::Emit): Handle instance and static fields.
32343 * driver.cs: Stop compilation if there are parse errors.
32345 * cs-parser.jay (constructor_declaration): Provide default base
32346 initializer for non-static constructors.
32347 (constructor_declarator): Do not provide a default base
32348 initializers if none was specified.
32349 Catch the fact that constructors should not have parameters.
32351 * class.cs: Do not emit parent class initializers for static
32352 constructors, that should be flagged as an error.
32354 2001-09-18 Ravi Pratap <ravi@ximian.com>
32356 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
32357 Move back code into TypeContainer::Populate.
32359 2001-09-18 Ravi Pratap <ravi@ximian.com>
32361 * class.cs (TypeContainer::AddConstructor): Fix the check to
32362 compare against Name, not Basename.
32363 (Operator::OpType): Change Plus and Minus to Add and Subtract.
32365 * cs-parser.jay : Update accordingly.
32367 * class.cs (TypeContainer::FindMembers): For the case where we are searching
32368 for methods, don't forget to look into the operators too.
32369 (RegisterMethodBuilder): Helper method to take care of this for
32370 methods, constructors and operators.
32371 (Operator::Define): Completely revamp.
32372 (Operator.OperatorMethod, MethodName): New fields.
32373 (TypeContainer::Populate): Move the registering of builders into
32374 RegisterMethodBuilder.
32375 (Operator::Emit): Re-write.
32377 * expression.cs (Binary::Emit): Comment out code path to emit method
32378 invocation stuff for the case when we have a user defined operator. I am
32379 just not able to get it right !
32381 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32383 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
32386 (Expression::MemberLookup): Provide a version that allows to
32387 specify the MemberTypes and BindingFlags.
32389 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
32390 so it was not fetching variable information from outer blocks.
32392 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
32393 Beforefieldinit as it was buggy.
32395 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
32396 that Ravi put here.
32398 * class.cs (Constructor::Emit): Only emit if block is not null.
32399 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
32400 deal with this by semantically definining it as if the user had
32403 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
32404 constructors as we now "emit" them at a higher level.
32406 (TypeContainer::DefineDefaultConstructor): Used to define the
32407 default constructors if none was provided.
32409 (ConstructorInitializer): Add methods Resolve and Emit.
32411 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
32413 2001-09-17 Ravi Pratap <ravi@ximian.com>
32415 * class.cs (TypeContainer::EmitDefaultConstructor): Register
32416 the default constructor builder with our hashtable for methodbuilders
32419 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
32420 and argument_count is 0 in which case we have a match.
32421 (Binary::ResolveOperator): More null checking and miscellaneous coding
32424 2001-09-17 Ravi Pratap <ravi@ximian.com>
32426 * rootcontext.cs (IsNameSpace): Compare against null.
32428 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
32430 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
32431 and Unary::Operator.
32433 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
32436 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
32437 we have overloaded operators.
32438 (Binary::ResolveOperator): Implement the part which does the operator overload
32441 * class.cs (Operator::Emit): Implement.
32442 (TypeContainer::Emit): Emit the operators we have too.
32444 * expression.cs (Binary::Emit): Update to emit the appropriate code for
32445 the case when we have a user-defined operator.
32447 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32449 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
32451 2001-09-16 Ravi Pratap <ravi@ximian.com>
32453 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
32454 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
32455 (Constructor::Emit): Implement.
32456 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
32457 if we have no work to do.
32458 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
32461 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
32462 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
32464 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
32467 2001-09-15 Ravi Pratap <ravi@ximian.com>
32469 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
32471 (Tree::RecordNamespace): Method to do what the name says ;-)
32472 (Tree::Namespaces): Property to get at the namespaces hashtable.
32474 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
32477 * rootcontext.cs (IsNamespace): Fixed it :-)
32479 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32481 * class.cs (TypeContainer::FindMembers): Add support for
32483 (MethodCore): New class that encapsulates both the shared aspects
32484 of a Constructor and a Method.
32485 (Method, Constructor): Factored pieces into MethodCore.
32487 * driver.cs: Added --fatal which makes errors throw exceptions.
32488 Load System assembly as well as part of the standard library.
32490 * report.cs: Allow throwing exceptions on errors for debugging.
32492 * modifiers.cs: Do not use `parent', instead use the real type
32493 container to evaluate permission settings.
32495 * class.cs: Put Ravi's patch back in. He is right, and we will
32496 have to cope with the
32498 2001-09-14 Ravi Pratap <ravi@ximian.com>
32500 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
32501 FamORAssem, not FamANDAssem.
32503 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32505 * driver.cs: Added --parse option that only parses its input files
32508 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
32509 incorrect. IsTopLevel is not used to tell whether an object is
32510 root_types or not (that can be achieved by testing this ==
32511 root_types). But to see if this is a top-level *class* (not
32512 necessarly our "toplevel" container).
32514 2001-09-14 Ravi Pratap <ravi@ximian.com>
32516 * enum.cs (Enum::Define): Modify to call the Lookup method on the
32517 parent instead of a direct call to GetType.
32519 2001-09-14 Ravi Pratap <ravi@ximian.com>
32521 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
32522 Modifiers.TypeAttr. This should just be a call to that method.
32524 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
32525 object so that we can determine if we are top-level or not.
32527 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
32530 * enum.cs (Enum::Define): Ditto.
32532 * modifiers.cs (FieldAttr): Re-write.
32534 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
32535 (TypeContainer::HaveStaticConstructor): New property to provide access
32536 to precisely that info.
32538 * modifiers.cs (MethodAttr): Re-write.
32539 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
32541 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
32542 of top-level types as claimed.
32544 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32546 * expression.cs (MemberLookup): Fruitless attempt to lookup
32547 constructors. Maybe I need to emit default constructors? That
32548 might be it (currently .NET emits this for me automatically).
32549 (Invocation::OverloadResolve): Cope with Arguments == null.
32550 (Invocation::EmitArguments): new function, shared by the new
32551 constructor and us.
32552 (Invocation::Emit): Handle static and instance methods. Emit
32553 proper call instruction for virtual or non-virtual invocations.
32554 (New::Emit): Implement.
32555 (New::Resolve): Implement.
32556 (MemberAccess:Resolve): Implement.
32557 (MethodGroupExpr::InstanceExpression): used conforming to the spec
32558 to track instances.
32559 (FieldExpr::Resolve): Set type.
32561 * support.cs: Handle empty arguments.
32563 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
32564 SimpleLookup): Auxiliary routines to help parse a qualifier
32567 Update qualifier_identifier rule.
32569 * codegen.cs: Removed debugging messages.
32571 * class.cs: Make this a global thing, this acts just as a "key" to
32572 objects that we might have around.
32574 (Populate): Only initialize method_builders_to_methods once.
32576 * expression.cs (PropertyExpr): Initialize type from the
32579 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
32580 Resolve pattern. Attempt to implicitly convert value to boolean.
32583 * expression.cs: Set the type for the int32/int32 argument case.
32584 (Binary::ResolveOperator): Set the return type to boolean for
32585 comparission operators
32587 * typemanager.cs: Remove debugging print code.
32589 (Invocation::Resolve): resolve type.
32591 * class.cs: Allocate a MemberInfo of the correct size, as the code
32592 elsewhere depends on the test to reflect the correct contents.
32594 (Method::) Keep track of parameters, due to System.Reflection holes
32596 (TypeContainer::Populate): Keep track of MethodBuilders to Method
32599 (TypeContainer::FindMembers): Use ArrayList and then copy an array
32600 of the exact size and return that.
32602 (Class::LookupMethodByBuilder): New function that maps
32603 MethodBuilders to its methods. Required to locate the information
32604 on methods because System.Reflection bit us again.
32606 * support.cs: New file, contains an interface ParameterData and
32607 two implementations: ReflectionParameters and InternalParameters
32608 used to access Parameter information. We will need to grow this
32611 * expression.cs (Invocation::GetParameterData): implement a cache
32612 and a wrapper around the ParameterData creation for methods.
32613 (Invocation::OverloadResolve): Use new code.
32615 2001-09-13 Ravi Pratap <ravi@ximian.com>
32617 * class.cs (TypeContainer::EmitField): Remove and move into
32618 (Field::Define): here and modify accordingly.
32619 (Field.FieldBuilder): New member.
32620 (TypeContainer::Populate): Update accordingly.
32621 (TypeContainer::FindMembers): Implement.
32623 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32625 * statement.cs: (VariableInfo::VariableType): New field to be
32626 initialized with the full type once it is resolved.
32628 2001-09-12 Miguel de Icaza <miguel@ximian.com>
32630 * parameter.cs (GetParameterInfo): Use a type cache to compute
32631 things only once, and to reuse this information
32633 * expression.cs (LocalVariableReference::Emit): Implement.
32634 (OpcodeCast::Emit): fix.
32636 (ParameterReference::Resolve): Implement.
32637 (ParameterReference::Emit): Implement.
32639 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
32640 that are expressions need to stay as Expressions.
32642 * typemanager.cs (CSharpName): Returns the C# name of a type if
32645 * expression.cs (Expression::ConvertImplicit): New function that
32646 implements implicit type conversions.
32648 (Expression::ImplicitReferenceConversion): Implements implicit
32649 reference conversions.
32651 (EmptyCast): New type for transparent casts.
32653 (OpcodeCast): New type for casts of types that are performed with
32654 a sequence of bytecodes.
32656 (BoxedCast): New type used for casting value types into reference
32657 types. Emits a box opcode.
32659 (Binary::DoNumericPromotions): Implements numeric promotions of
32660 and computation of the Binary::Type.
32662 (Binary::EmitBranchable): Optimization.
32664 (Binary::Emit): Implement code emission for expressions.
32666 * typemanager.cs (TypeManager): Added two new core types: sbyte
32669 2001-09-12 Ravi Pratap <ravi@ximian.com>
32671 * class.cs (TypeContainer::FindMembers): Method which does exactly
32672 what Type.FindMembers does, only we don't have to use reflection. No
32673 implementation yet.
32675 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
32676 typecontainer objects as we need to get at them.
32677 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
32679 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
32680 typecontainer object.
32682 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
32683 of just a Report object.
32685 2001-09-11 Ravi Pratap <ravi@ximian.com>
32687 * class.cs (Event::Define): Go back to using the prefixes "add_" and
32689 (TypeContainer::Populate): Now define the delegates of the type too.
32690 (TypeContainer.Delegates): Property to access the list of delegates defined
32693 * delegates.cs (Delegate::Define): Implement partially.
32695 * modifiers.cs (TypeAttr): Handle more flags.
32697 2001-09-11 Ravi Pratap <ravi@ximian.com>
32699 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
32701 (Operator::Define): Re-write logic to get types by using the LookupType method
32702 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
32703 (Indexer::Define): Ditto.
32704 (Event::Define): Ditto.
32705 (Property::Define): Ditto.
32707 2001-09-10 Ravi Pratap <ravi@ximian.com>
32709 * class.cs (TypeContainer::Populate): Now define operators too.
32710 (TypeContainer.Operators): New property to access the list of operators
32712 (Operator.OperatorMethodBuilder): New member to hold the method builder
32713 for the operator we are defining.
32714 (Operator::Define): Implement.
32716 2001-09-10 Ravi Pratap <ravi@ximian.com>
32718 * class.cs (Event::Define): Make the prefixes of the accessor methods
32719 addOn_ and removeOn_
32721 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
32722 of the location being passed in too. Ideally, this should go later since all
32723 error reporting should be done through the Report object.
32725 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
32726 (Populate): Iterate thru the indexers we have and define them too.
32727 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
32728 for the get and set accessors.
32729 (Indexer::Define): Implement.
32731 2001-09-09 Miguel de Icaza <miguel@ximian.com>
32733 * expression.cs (Binary::Resolve): Beginning of it. I scratched
32734 my previous implementation, did not work.
32736 * typemanager.cs: Add a couple of missing types (the longs).
32738 * literal.cs: Use TypeManager.bool_type instead of getting it.
32740 * expression.cs (EventExpr): New kind of expressions.
32741 (Expressio::ExprClassFromMemberInfo): finish
32743 2001-09-08 Miguel de Icaza <miguel@ximian.com>
32745 * assign.cs: Emit stores to static fields differently.
32747 2001-09-08 Ravi Pratap <ravi@ximian.com>
32749 * Merge in changes and adjust code to tackle conflicts. Backed out my
32750 code in Assign::Resolve ;-)
32752 2001-09-08 Ravi Pratap <ravi@ximian.com>
32754 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
32755 instead Report.Error and also pass in the location.
32756 (CSharpParser::Lexer): New readonly property to return the reference
32757 to the Tokenizer object.
32758 (declare_local_variables): Use Report.Error with location instead of plain
32762 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
32763 (Operator.CheckBinaryOperator): Ditto.
32765 * cs-parser.jay (operator_declarator): Update accordingly.
32767 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
32768 (CheckBinaryOperator): Same here.
32770 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
32771 on the name without any prefixes of namespace names etc. This is because we
32772 already might have something already fully qualified like
32773 'System.Console.WriteLine'
32775 * assign.cs (Resolve): Begin implementation. Stuck ;-)
32777 2001-09-07 Ravi Pratap <ravi@ximian.com>
32779 * cs-tokenizer.cs (location): Return a string which also contains
32782 * expression.cs (ElementAccess): New class for expressions of the
32783 type 'element access.'
32784 (BaseAccess): New class for expressions of the type 'base access.'
32785 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
32788 * cs-parser.jay (element_access): Implement action.
32789 (base_access): Implement actions.
32790 (checked_expression, unchecked_expression): Implement.
32792 * cs-parser.jay (local_variable_type): Correct and implement.
32793 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
32795 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
32797 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
32798 name and the specifiers.
32800 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
32802 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
32803 making them all public ;-)
32805 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
32808 2001-09-07 Miguel de Icaza <miguel@ximian.com>
32810 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
32812 (FieldExpr, PropertyExprs): New resolved expressions.
32813 (SimpleName::MemberStaticCheck): Perform static checks for access
32814 to non-static fields on static methods. Maybe this should be
32815 generalized for MemberAccesses.
32816 (SimpleName::ResolveSimpleName): More work on simple name
32819 * cs-parser.jay (primary_expression/qualified_identifier): track
32820 the parameter index.
32822 * codegen.cs (CodeGen::Save): Catch save exception, report error.
32823 (EmitContext::EmitBoolExpression): Chain to expression generation
32824 instead of temporary hack.
32825 (::EmitStatementExpression): Put generic expression code generation.
32827 * assign.cs (Assign::Emit): Implement variable assignments to
32828 local variables, parameters and fields.
32830 2001-09-06 Miguel de Icaza <miguel@ximian.com>
32832 * statement.cs (Block::GetVariableInfo): New method, returns the
32833 VariableInfo for a variable name in a block.
32834 (Block::GetVariableType): Implement in terms of GetVariableInfo
32836 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
32837 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
32839 2001-09-06 Ravi Pratap <ravi@ximian.com>
32841 * cs-parser.jay (operator_declaration): Continue on my quest : update
32842 to take attributes argument.
32843 (event_declaration): Ditto.
32844 (enum_declaration): Ditto.
32845 (indexer_declaration): Ditto.
32847 * class.cs (Operator::Operator): Update constructor accordingly.
32848 (Event::Event): Ditto.
32850 * delegate.cs (Delegate::Delegate): Same here.
32852 * enum.cs (Enum::Enum): Same here.
32854 2001-09-05 Ravi Pratap <ravi@ximian.com>
32856 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
32858 * ../tests/cs0658.cs : New file to demonstrate error 0658.
32860 * attribute.cs (Attributes): New class to encapsulate all attributes which were
32861 being passed around as an arraylist.
32862 (Attributes::AddAttribute): Method to add attribute sections.
32864 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
32865 (struct_declaration): Update accordingly.
32866 (constant_declaration): Update.
32867 (field_declaration): Update.
32868 (method_header): Update.
32869 (fixed_parameter): Update.
32870 (parameter_array): Ditto.
32871 (property_declaration): Ditto.
32872 (destructor_declaration): Ditto.
32874 * class.cs (Struct::Struct): Update constructors accordingly.
32875 (Class::Class): Ditto.
32876 (Field::Field): Ditto.
32877 (Method::Method): Ditto.
32878 (Property::Property): Ditto.
32879 (TypeContainer::OptAttribute): update property's return type.
32881 * interface.cs (Interface.opt_attributes): New member.
32882 (Interface::Interface): Update to take the extra Attributes argument.
32884 * parameter.cs (Parameter::Parameter): Ditto.
32886 * constant.cs (Constant::Constant): Ditto.
32888 * interface.cs (InterfaceMemberBase): New OptAttributes field.
32889 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
32890 the attributes as a parameter.
32891 (InterfaceProperty): Update constructor call.
32892 (InterfaceEvent): Ditto.
32893 (InterfaceMethod): Ditto.
32894 (InterfaceIndexer): Ditto.
32896 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
32897 pass the attributes too.
32898 (interface_event_declaration): Ditto.
32899 (interface_property_declaration): Ditto.
32900 (interface_method_declaration): Ditto.
32901 (interface_declaration): Ditto.
32903 2001-09-05 Miguel de Icaza <miguel@ximian.com>
32905 * class.cs (Method::Define): Track the "static Main" definition to
32906 create an entry point.
32908 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
32909 EntryPoint if we find it.
32911 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
32912 (EmitContext::ig): Make this variable public.
32914 * driver.cs: Make the default output file be the first file name
32915 with the .exe extension.
32917 Detect empty compilations
32919 Handle various kinds of output targets. Handle --target and
32920 rename -t to --dumper.
32922 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
32923 methods inherited from Expression return now an Expression. This
32924 will is used during the tree rewriting as we resolve them during
32927 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
32928 the spec. Missing entirely is the information about
32929 accessability of elements of it.
32931 (Expression::ExprClassFromMemberInfo): New constructor for
32932 Expressions that creates a fully initialized Expression based on
32933 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
32936 (Invocation::Resolve): Begin implementing resolution of invocations.
32938 * literal.cs (StringLiteral): Implement Emit.
32940 2001-09-05 Ravi Pratap <ravi@ximian.com>
32942 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
32945 2001-09-04 Ravi Pratap <ravi@ximian.com>
32947 * cs-parser.jay (attribute_arguments): Implement actions.
32948 (attribute): Fix bug in production. Implement action.
32949 (attribute_list): Implement.
32950 (attribute_target): Implement.
32951 (attribute_target_specifier, opt_target_specifier): Implement
32952 (CheckAttributeTarget): New method to check if the attribute target
32954 (attribute_section): Implement.
32955 (opt_attributes): Implement.
32957 * attribute.cs : New file to handle attributes.
32958 (Attribute): Class to hold attribute info.
32960 * cs-parser.jay (opt_attribute_target_specifier): Remove production
32961 (attribute_section): Modify production to use 2 different rules to
32962 achieve the same thing. 1 s/r conflict down !
32963 Clean out commented, useless, non-reducing dimension_separator rules.
32965 * class.cs (TypeContainer.attributes): New member to hold list
32966 of attributes for a type.
32967 (Struct::Struct): Modify to take one more argument, the attribute list.
32968 (Class::Class): Ditto.
32969 (Field::Field): Ditto.
32970 (Method::Method): Ditto.
32971 (Property::Property): Ditto.
32973 * cs-parser.jay (struct_declaration): Update constructor call to
32974 pass in the attributes too.
32975 (class_declaration): Ditto.
32976 (constant_declaration): Ditto.
32977 (field_declaration): Ditto.
32978 (method_header): Ditto.
32979 (fixed_parameter): Ditto.
32980 (parameter_array): Ditto.
32981 (property_declaration): Ditto.
32983 * constant.cs (Constant::Constant): Update constructor similarly.
32984 Use System.Collections.
32986 * parameter.cs (Parameter::Parameter): Update as above.
32988 2001-09-02 Ravi Pratap <ravi@ximian.com>
32990 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
32991 (TypeContainer.delegates): New member to hold list of delegates.
32993 * cs-parser.jay (delegate_declaration): Implement the action correctly
32994 this time as I seem to be on crack ;-)
32996 2001-09-02 Miguel de Icaza <miguel@ximian.com>
32998 * rootcontext.cs (RootContext::IsNamespace): new function, used to
32999 tell whether an identifier represents a namespace.
33001 * expression.cs (NamespaceExpr): A namespace expression, used only
33002 temporarly during expression resolution.
33003 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
33004 utility functions to resolve names on expressions.
33006 2001-09-01 Miguel de Icaza <miguel@ximian.com>
33008 * codegen.cs: Add hook for StatementExpressions.
33010 * class.cs: Fix inverted test for static flag in methods.
33012 2001-09-02 Ravi Pratap <ravi@ximian.com>
33014 * class.cs (Operator::CheckUnaryOperator): Correct error number used
33015 to make it coincide with MS' number.
33016 (Operator::CheckBinaryOperator): Ditto.
33018 * ../errors/errors.txt : Remove error numbers added earlier.
33020 * ../errors/cs1019.cs : Test case for error # 1019
33022 * ../errros/cs1020.cs : Test case for error # 1020
33024 * cs-parser.jay : Clean out commented cruft.
33025 (dimension_separators, dimension_separator): Comment out. Ostensibly not
33026 used anywhere - non-reducing rule.
33027 (namespace_declarations): Non-reducing rule - comment out.
33029 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
33030 with TypeContainer::AddEnum.
33032 * delegate.cs : New file for delegate handling classes.
33033 (Delegate): Class for declaring delegates.
33035 * makefile : Update.
33037 * cs-parser.jay (delegate_declaration): Implement.
33039 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
33041 * class.cs (Event::Define): Implement.
33042 (Event.EventBuilder): New member.
33044 * class.cs (TypeContainer::Populate): Update to define all enums and events
33046 (Events): New property for the events arraylist we hold. Shouldn't we move to using
33047 readonly fields for all these cases ?
33049 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33051 * class.cs (Property): Revamp to use the convention of making fields readonly.
33052 Accordingly modify code elsewhere.
33054 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
33055 the Define method of the Property class.
33057 * class.cs : Clean up applied patch and update references to variables etc. Fix
33059 (TypeContainer::Populate): Update to define all the properties we have. Also
33060 define all enumerations.
33062 * enum.cs (Define): Implement.
33064 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33066 * cs-parser.jay (overloadable_operator): The semantic value is an
33067 enum of the Operator class.
33068 (operator_declarator): Implement actions.
33069 (operator_declaration): Implement.
33071 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
33072 validity of definitions.
33073 (Operator::CheckBinaryOperator): Static method to check for binary operators
33074 (TypeContainer::AddOperator): New method to add an operator to a type.
33076 * cs-parser.jay (indexer_declaration): Added line to actually call the
33077 AddIndexer method so it gets added ;-)
33079 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
33080 already taken care of by the MS compiler ?
33082 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33084 * class.cs (Operator): New class for operator declarations.
33085 (Operator::OpType): Enum for the various operators.
33087 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33089 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
33090 ostensibly handle this in semantic analysis.
33092 * cs-parser.jay (general_catch_clause): Comment out
33093 (specific_catch_clauses, specific_catch_clause): Ditto.
33094 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
33095 (catch_args, opt_catch_args): New productions.
33096 (catch_clause): Rewrite to use the new productions above
33097 (catch_clauses): Modify accordingly.
33098 (opt_catch_clauses): New production to use in try_statement
33099 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
33100 and re-write the code in the actions to extract the specific and
33101 general catch clauses by being a little smart ;-)
33103 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
33104 Hooray, try and catch statements parse fine !
33106 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33108 * statement.cs (Block::GetVariableType): Fix logic to extract the type
33109 string from the hashtable of variables.
33111 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
33112 I end up making that mistake ;-)
33113 (catch_clauses): Fixed gross error which made Key and Value of the
33114 DictionaryEntry the same : $1 !!
33116 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33118 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
33120 * cs-parser.jay (event_declaration): Correct to remove the semicolon
33121 when the add and remove accessors are specified.
33123 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33125 * cs-parser.jay (IndexerDeclaration): New helper class to hold
33126 information about indexer_declarator.
33127 (indexer_declarator): Implement actions.
33128 (parsing_indexer): New local boolean used to keep track of whether
33129 we are parsing indexers or properties. This is necessary because
33130 implicit_parameters come into picture even for the get accessor in the
33131 case of an indexer.
33132 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
33134 * class.cs (Indexer): New class for indexer declarations.
33135 (TypeContainer::AddIndexer): New method to add an indexer to a type.
33136 (TypeContainer::indexers): New member to hold list of indexers for the
33139 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33141 * cs-parser.jay (add_accessor_declaration): Implement action.
33142 (remove_accessor_declaration): Implement action.
33143 (event_accessors_declaration): Implement
33144 (variable_declarators): swap statements for first rule - trivial.
33146 * class.cs (Event): New class to hold information about event
33148 (TypeContainer::AddEvent): New method to add an event to a type
33149 (TypeContainer::events): New member to hold list of events.
33151 * cs-parser.jay (event_declaration): Implement actions.
33153 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33155 * cs-parser.jay (dim_separators): Implement. Make it a string
33156 concatenating all the commas together, just as they appear.
33157 (opt_dim_separators): Modify accordingly
33158 (rank_specifiers): Update accordingly. Basically do the same
33159 thing - instead, collect the brackets here.
33160 (opt_rank_sepcifiers): Modify accordingly.
33161 (array_type): Modify to actually return the complete type string
33162 instead of ignoring the rank_specifiers.
33163 (expression_list): Implement to collect the expressions
33164 (variable_initializer): Implement. We make it a list of expressions
33165 essentially so that we can handle the array_initializer case neatly too.
33166 (variable_initializer_list): Implement.
33167 (array_initializer): Make it a list of variable_initializers
33168 (opt_array_initializer): Modify accordingly.
33170 * expression.cs (New::NType): Add enumeration to help us
33171 keep track of whether we have an object/delegate creation
33172 or an array creation.
33173 (New:NewType, New::Rank, New::Indices, New::Initializers): New
33174 members to hold data about array creation.
33175 (New:New): Modify to update NewType
33176 (New:New): New Overloaded contructor for the array creation
33179 * cs-parser.jay (array_creation_expression): Implement to call
33180 the overloaded New constructor.
33182 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
33184 * class.cs (TypeContainer::Constructors): Return member
33185 constructors instead of returning null.
33187 2001-08-26 Miguel de Icaza <miguel@ximian.com>
33189 * typemanager.cs (InitCoreTypes): Initialize the various core
33190 types after we have populated the type manager with the user
33191 defined types (this distinction will be important later while
33192 compiling corlib.dll)
33194 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
33195 on Expression Classification. Now all expressions have a method
33196 `Resolve' and a method `Emit'.
33198 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
33199 generation from working. Also add some temporary debugging
33202 2001-08-24 Miguel de Icaza <miguel@ximian.com>
33204 * codegen.cs: Lots of code generation pieces. This is only the
33205 beginning, will continue tomorrow with more touches of polish. We
33206 handle the fundamentals of if, while, do, for, return. Others are
33207 trickier and I need to start working on invocations soon.
33209 * gen-treedump.cs: Bug fix, use s.Increment here instead of
33212 * codegen.cs (EmitContext): New struct, used during code
33213 emission to keep a context. Most of the code generation will be
33216 * cs-parser.jay: Add embedded blocks to the list of statements of
33217 this block. So code generation proceeds in a top down fashion.
33219 2001-08-23 Miguel de Icaza <miguel@ximian.com>
33221 * statement.cs: Add support for multiple child blocks.
33223 2001-08-22 Miguel de Icaza <miguel@ximian.com>
33225 * codegen.cs (EmitCode): New function, will emit the code for a
33226 Block of code given a TypeContainer and its ILGenerator.
33228 * statement.cs (Block): Standard public readonly optimization.
33229 (Block::Block constructors): Link children.
33230 (Block::Child): Child Linker.
33231 (Block::EmitVariables): Emits IL variable declarations.
33233 * class.cs: Drop support for MethodGroups here, delay until
33235 (Method::): Applied the same simplification that I did before, and
33236 move from Properties to public readonly fields.
33237 (Method::ParameterTypes): Returns the parameter types for the
33238 function, and implements a cache that will be useful later when I
33239 do error checking and the semantic analysis on the methods is
33241 (Constructor::GetCallingConvention): Renamed from CallingConvetion
33242 and made a method, optional argument tells whether this is a class
33243 or a structure to apply the `has-this' bit.
33244 (Method::GetCallingConvention): Implement, returns the calling
33246 (Method::Define): Defines the type, a second pass is performed
33247 later to populate the methods.
33249 (Constructor::ParameterTypes): implement a cache similar to the
33250 one on Method::ParameterTypes, useful later when we do semantic
33253 (TypeContainer::EmitMethod): New method. Emits methods.
33255 * expression.cs: Removed MethodGroup class from here.
33257 * parameter.cs (Parameters::GetCallingConvention): new method.
33259 2001-08-21 Miguel de Icaza <miguel@ximian.com>
33261 * class.cs (TypeContainer::Populate): Drop RootContext from the
33264 (Constructor::CallingConvention): Returns the calling convention.
33265 (Constructor::ParameterTypes): Returns the constructor parameter
33268 (TypeContainer::AddConstructor): Keep track of default constructor
33269 and the default static constructor.
33271 (Constructor::) Another class that starts using `public readonly'
33272 instead of properties.
33274 (Constructor::IsDefault): Whether this is a default constructor.
33276 (Field::) use readonly public fields instead of properties also.
33278 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
33279 track of static constructors; If none is used, turn on
33280 BeforeFieldInit in the TypeAttributes.
33282 * cs-parser.jay (opt_argument_list): now the return can be null
33283 for the cases where there are no arguments.
33285 (constructor_declarator): If there is no implicit `base' or
33286 `this', then invoke the default parent constructor.
33288 * modifiers.cs (MethodAttr): New static function maps a set of
33289 modifiers flags into a MethodAttributes enum
33290 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
33291 MethodAttr, TypeAttr to represent the various mappings where the
33292 modifiers are used.
33293 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
33295 2001-08-19 Miguel de Icaza <miguel@ximian.com>
33297 * parameter.cs (GetParameterInfo): Fix bug where there would be no
33300 * interface.cs (PopulateIndexer): Implemented the code generator
33301 for interface indexers.
33303 2001-08-17 Miguel de Icaza <miguel@ximian.com>
33305 * interface.cs (InterfaceMemberBase): Now we track the new status
33308 (PopulateProperty): Implement property population. Woohoo! Got
33309 Methods and Properties going today.
33311 Removed all the properties for interfaces, and replaced them with
33312 `public readonly' fields.
33314 2001-08-16 Miguel de Icaza <miguel@ximian.com>
33316 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
33317 initialize their hashtables/arraylists only when they are needed
33318 instead of doing this always.
33320 * parameter.cs: Handle refs and out parameters.
33322 * cs-parser.jay: Use an ArrayList to construct the arguments
33323 instead of the ParameterCollection, and then cast that to a
33326 * parameter.cs: Drop the use of ParameterCollection and use
33327 instead arrays of Parameters.
33329 (GetParameterInfo): Use the Type, not the Name when resolving
33332 2001-08-13 Miguel de Icaza <miguel@ximian.com>
33334 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
33335 and instead use public readonly fields.
33337 * class.cs: Put back walking code for type containers.
33339 2001-08-11 Miguel de Icaza <miguel@ximian.com>
33341 * class.cs (MakeConstant): Code to define constants.
33343 * rootcontext.cs (LookupType): New function. Used to locate types
33346 2001-08-08 Miguel de Icaza <miguel@ximian.com>
33348 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
33349 this System.Reflection code is. Kudos to Microsoft
33351 * typemanager.cs: Implement a type cache and avoid loading all
33352 types at boot time. Wrap in LookupType the internals. This made
33353 the compiler so much faster. Wow. I rule!
33355 * driver.cs: Make sure we always load mscorlib first (for
33356 debugging purposes, nothing really important).
33358 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
33359 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
33361 * rootcontext.cs: Lookup types on their namespace; Lookup types
33362 on namespaces that have been imported using the `using' keyword.
33364 * class.cs (TypeContainer::TypeAttr): Virtualize.
33365 (Class::TypeAttr): Return attributes suitable for this bad boy.
33366 (Struct::TypeAttr): ditto.
33367 Handle nested classes.
33368 (TypeContainer::) Remove all the type visiting code, it is now
33369 replaced with the rootcontext.cs code
33371 * rootcontext.cs (GetClassBases): Added support for structs.
33373 2001-08-06 Miguel de Icaza <miguel@ximian.com>
33375 * interface.cs, statement.cs, class.cs, parameter.cs,
33376 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
33377 Drop use of TypeRefs, and use strings instead.
33379 2001-08-04 Miguel de Icaza <miguel@ximian.com>
33383 * class.cs (Struct::Struct): set the SEALED flags after
33384 checking the modifiers.
33385 (TypeContainer::TypeAttr): new property, returns the
33386 TypeAttributes for a class.
33388 * cs-parser.jay (type_list): Oops, list production was creating a
33389 new list of base types.
33391 * rootcontext.cs (StdLib): New property.
33392 (GetInterfaceTypeByName): returns an interface by type name, and
33393 encapsulates error handling here.
33394 (GetInterfaces): simplified.
33395 (ResolveTree): Encapsulated all the tree resolution here.
33396 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
33399 * driver.cs: Add support for --nostdlib, to avoid loading the
33400 default assemblies.
33401 (Main): Do not put tree resolution here.
33403 * rootcontext.cs: Beginning of the class resolution.
33405 2001-08-03 Miguel de Icaza <miguel@ximian.com>
33407 * rootcontext.cs: Provide better error reporting.
33409 * cs-parser.jay (interface_base): set our $$ to be interfaces.
33411 * rootcontext.cs (CreateInterface): Handle the case where there
33412 are no parent interfaces.
33414 (CloseTypes): Routine to flush types at the end.
33415 (CreateInterface): Track types.
33416 (GetInterfaces): Returns an array of Types from the list of
33417 defined interfaces.
33419 * typemanager.c (AddUserType): Mechanism to track user types (puts
33420 the type on the global type hash, and allows us to close it at the
33423 2001-08-02 Miguel de Icaza <miguel@ximian.com>
33425 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
33426 RecordInterface instead.
33428 * cs-parser.jay: Updated to reflect changes above.
33430 * decl.cs (Definition): Keep track of the TypeBuilder type that
33431 represents this type here. Not sure we will use it in the long
33432 run, but wont hurt for now.
33434 * driver.cs: Smaller changes to accomodate the new code.
33436 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
33439 * rootcontext.cs (CreateInterface): New method, used to create
33440 the System.TypeBuilder type for interfaces.
33441 (ResolveInterfaces): new entry point to resolve the interface
33443 (CodeGen): Property, used to keep track of the code generator.
33445 2001-07-26 Miguel de Icaza <miguel@ximian.com>
33447 * cs-parser.jay: Add a second production for delegate_declaration
33450 (enum_body): Put an opt_comma here instead of putting it on
33451 enum_body or enum_member_declarations so we can handle trailing
33452 commas on enumeration members. Gets rid of a shift/reduce.
33454 (type_list): Need a COMMA in the middle.
33456 (indexer_declaration): Tell tokenizer to recognize get/set
33458 * Remove old targets.
33460 * Re-add the parser target.
33462 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33464 * cs-parser.jay: Add precendence rules for a number of operators
33465 ot reduce the number of shift/reduce conflicts in the grammar.
33467 2001-07-17 Miguel de Icaza <miguel@ximian.com>
33469 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
33472 Get rid of old crufty code.
33474 * rootcontext.cs: Use this to keep track of the parsed
33475 representation and the defined types available to the program.
33477 * gen-treedump.cs: adjust for new convention.
33479 * type.cs: Split out the type manager, and the assembly builder
33482 * typemanager.cs: the type manager will live here now.
33484 * cil-codegen.cs: And the code generator here.
33486 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
33488 * makefile: Fixed up for easy making.
33490 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33492 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
33495 (unary_expression): Expand pre_increment_expression and
33496 post_decrement_expression to reduce a shift/reduce.
33498 2001-07-11 Simon Cozens
33500 * cs-tokenizer.cs: Hex numbers should begin with a 0.
33502 Improve allow_keyword_as_indent name.
33504 2001-06-19 Miguel de Icaza <miguel@ximian.com>
33506 * Adjustments for Beta2.
33508 2001-06-13 Miguel de Icaza <miguel@ximian.com>
33510 * decl.cs: Added `Define' abstract method.
33511 (InTransit): new property, used to catch recursive definitions.
33513 * interface.cs: Implement `Define'.
33515 * modifiers.cs: Map Modifiers.constants to
33516 System.Reflection.TypeAttribute flags.
33518 * class.cs: Keep track of types and user-defined types.
33519 (BuilderInit): New method for creating an assembly
33520 (ResolveType): New function to launch the resolution process, only
33521 used by interfaces for now.
33523 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
33524 that are inserted into the name space.
33526 2001-06-08 Miguel de Icaza <miguel@ximian.com>
33528 * ARGH. I have screwed up my tree so many times due to the use of
33529 rsync rather than using CVS. Going to fix this at once.
33531 * driver.cs: Objetify driver. Load assemblies, use assemblies to
33534 2001-06-07 Miguel de Icaza <miguel@ximian.com>
33536 * Experiment successful: Use System.Type rather that our own
33539 2001-05-25 Miguel de Icaza <miguel@ximian.com>
33541 * cs-parser.jay: Removed nsAliases from here.
33543 Use new namespaces, handle `using XXX;'
33545 * namespace.cs: Reimplemented namespace handling, use a recursive
33546 definition of the class. Now we can keep track of using clauses
33547 and catch invalid using clauses.
33549 2001-05-24 Miguel de Icaza <miguel@ximian.com>
33551 * gen-treedump.cs: Adapted for all the renaming.
33553 * expression.cs (Expression): this class now has a Type property
33554 which returns an expression Type.
33556 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
33557 `Type', as this has a different meaning now in the base
33559 2001-05-22 Miguel de Icaza <miguel@ximian.com>
33561 * interface.cs, class.cs: Removed from all the sources the
33562 references to signature computation, as we can not do method
33563 signature computation during the parsing time, as we are not
33564 trying to solve at that point distinguishing:
33568 void a (NS.Blah x) {}
33571 Which depending on the context might be valid or not, as we do not
33572 know if Blah is the same thing as NS.Blah at that point.
33574 * Redid everything so the code uses TypeRefs now instead of
33575 Types. TypeRefs are just temporary type placeholders, that need
33576 to be resolved. They initially have a pointer to a string and the
33577 current scope in which they are used. This is used later by the
33578 compiler to resolve the reference to an actual Type.
33580 * DeclSpace is no longer a CIR.Type, and neither are
33581 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
33582 are all DeclSpaces, but no Types.
33584 * type.cs (TypeRefManager): This implements the TypeRef manager,
33585 which keeps track of all the types that need to be resolved after
33586 the parsing has finished.
33588 2001-05-13 Miguel de Icaza <miguel@ximian.com>
33590 * ARGH. We are going to have to store `foreach' as a class rather
33591 than resolving it, as we need to verify error 1579 after name
33592 resolution. *OR* we could keep a flag that says `This request to
33593 IEnumerator comes from a foreach statement' which we can then use
33594 to generate the error.
33596 2001-05-10 Miguel de Icaza <miguel@ximian.com>
33598 * class.cs (TypeContainer.AddMethod): we now add methods to the
33599 MethodGroup instead of the method hashtable.
33601 * expression.cs: Add MethodGroup abstraction, which gets us one
33602 step closer to the specification in the way we handle method
33605 * cs-parser.jay (primary_expression): qualified_identifier now
33606 tried to match up an identifier to a local variable reference or
33607 to a parameter reference.
33609 current_local_parameters is now a parser global variable that
33610 points to the current parameters for the block, used during name
33613 (property_declaration): Now creates an implicit `value' argument to
33616 2001-05-09 Miguel de Icaza <miguel@ximian.com>
33618 * parameter.cs: Do not use `param' arguments as part of the
33619 signature, per the spec.
33621 2001-05-08 Miguel de Icaza <miguel@ximian.com>
33623 * decl.cs: Base class for classes, structs and interfaces. This
33624 is the "Declaration Space"
33626 * cs-parser.jay: Use CheckDef for checking declaration errors
33627 instead of having one on each function.
33629 * class.cs: Factor out some code for handling error handling in
33630 accordance to the "Declarations" section in the "Basic Concepts"
33631 chapter in the ECMA C# spec.
33633 * interface.cs: Make all interface member classes derive from
33634 InterfaceMemberBase.
33636 2001-05-07 Miguel de Icaza <miguel@ximian.com>
33638 * Many things: all interfaces are parsed and generated in
33639 gen-treedump. Support for member variables, constructors,
33640 destructors, properties, constants is there.
33642 Beginning of the IL backend, but very little done, just there for
33645 2001-04-29 Miguel de Icaza <miguel@ximian.com>
33647 * cs-parser.jay: Fix labeled statement.
33649 * cs-tokenizer.cs (escape): Escape " and ' always.
33650 ref_line, ref_name: keep track of the line/filename as instructed
33651 by #line by the compiler.
33654 2001-04-27 Miguel de Icaza <miguel@ximian.com>
33656 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
33657 to match the values in System.CodeDOM.
33659 Divid renamed to Divide.
33661 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
33663 (Statements.set): remove.
33665 * System.CodeDOM/CodeCatchClause.cs: always have a valid
33668 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
33669 falseStatements always have valid values.
33671 * cs-parser.jay: Use System.CodeDOM now.