1 2010-06-17 Marek Safar <marek.safar@gmail.com>
3 * generic.cs, method.cs: Inflate copied type parameters from base
4 class or explicit interfaces.
6 * convert.cs: Fixed conversion between two type parameters.
9 2010-06-16 Marek Safar <marek.safar@gmail.com>
11 * membercache.cs, convert.cs: Correctly resize an array used by
14 2010-06-15 Marek Safar <marek.safar@gmail.com>
17 * dynamic.cs, ecore.cs: A new flag for dynamic resolver to ignore
18 generated member access left expression.
20 2010-06-16 Marek Safar <marek.safar@gmail.com>
22 * expression.cs: Dispatch dynamic invocation solely on left
25 2010-06-16 Marek Safar <marek.safar@gmail.com>
27 * expression.cs, statement.cs: Always persist explicit cast
28 semantic at expression level.
30 2010-06-15 Marek Safar <marek.safar@gmail.com>
32 * expression.cs, attribute.cs: Enable generic type parameters
35 2010-06-15 Marek Safar <marek.safar@gmail.com>
38 * generic.cs: Don't use fixed array for inflated type parameter
39 interface constraints.
41 2010-06-15 Marek Safar <marek.safar@gmail.com>
43 * typespec.cs: ElementTypeSpec has to use its own ITypeDefinition.
45 * report.cs: Unwrap elements for related symbols reporting.
47 2010-06-15 Marek Safar <marek.safar@gmail.com>
50 * cs-tokenizer.cs: Offset correctly keywords the first character
53 2010-06-15 Marek Safar <marek.safar@gmail.com>
56 * expression.cs: Removed too aggressive object initializers
59 2010-06-15 Marek Safar <marek.safar@gmail.com>
61 * parameter.cs, property.cs, membercache.cs, decl.cs, iterators.cs,
62 anonymous.cs, expression.cs, support.cs, method.cs, pending.cs,
63 class.cs, cs-parser.jay: Simplify parsing of accessors by removing
64 any intermediate steps and fake nodes, also saves few MBs of memory.
66 2010-06-11 Marek Safar <marek.safar@gmail.com>
68 * modifiers.cs, rootcontext.cs, location.cs, cs-parser.jay: More
69 precise modifiers parsing.
71 2010-06-09 Marek Safar <marek.safar@gmail.com>
73 * cs-tokenizer.cs, anonymous.cs, expression.cs, cs-parser.jay:
74 Fixed few shift/reduce conflicts.
76 2010-06-09 Marek Safar <marek.safar@gmail.com>
78 * typemanager.cs, parameter.cs, dynamic.cs, typespec.cs,
79 expression.cs, ecore.cs, cs-parser.jay: Fully parse composed type
80 specifiers and stop using string in AST.
82 2010-06-07 Marek Safar <marek.safar@gmail.com>
84 * typemanager.cs, eval.cs, iterators.cs, anonymous.cs, expression.cs
85 method.cs, class.cs, delegate.cs, cs-parser.jay, driver.cs, visit.cs
86 enum.cs: Hold location of predefined types.
88 2010-06-07 Marek Safar <marek.safar@gmail.com>
91 * pending.cs: Clone cached list before modifying.
93 2010-06-04 Marek Safar <marek.safar@gmail.com>
95 * convert.cs, typespec.cs, expression.cs: Start using array member
96 kind for better conversion checks.
98 * import.cs, report.cs: Report better error message for runtime
101 2010-06-04 Marek Safar <marek.safar@gmail.com>
103 * membercache.cs, convert.cs, nullable.cs, expression.cs: Optimize
104 user defined conversion probing and simplify user conversion for
105 nullabe types. Fixes #610940.
107 2010-06-03 Marek Safar <marek.safar@gmail.com>
109 A fix for bug #610919
110 * parameter.cs, property.cs, cs-parser.jay: Use independent implicit
111 parameters for explicit event accessors. Anonymous method capturing
112 won't otherwise work for event implicit parameter.
114 2010-06-02 Marek Safar <marek.safar@gmail.com>
116 A fix for bug #610088
117 * nullable.cs, expression.cs, statement.cs, method.cs, ecore.cs:
118 Ignore overrides for base overload resolution as for non-base
119 expressions and convert the best candidate to closest override
122 2010-06-01 Marek Safar <marek.safar@gmail.com>
124 A fix for bug #610139
125 * generic.cs, convert.cs: Recursively check effective base interface
127 2010-06-01 Marek Safar <marek.safar@gmail.com>
129 * statement.cs: Handle nullable types and type parameters in using
130 statement, avoid boxing value types. Also fixes #571010
132 2010-06-01 Marek Safar <marek.safar@gmail.com>
134 * convert.cs, expression.cs: Emit unbox for underlying nullable
137 2010-05-29 Marek Safar <marek.safar@gmail.com>
139 A fix for bug #610126
140 * expression.cs: Don't use branch optimization for types bigger than
143 2010-05-28 Marek Safar <marek.safar@gmail.com>
145 A fix for bug #609088
146 * import.cs: Check private modifier correctly.
148 2010-05-28 Marek Safar <marek.safar@gmail.com>
150 A fix for bug #609049
151 * ecore.cs: Don't ignore override methods when looking for base
154 2010-05-27 Marek Safar <marek.safar@gmail.com>
156 A fix for bugs #608007, #572540, #566130, #476358
158 * generic.cs, linq.cs, expression.cs, statement.cs, cs-parser.jay:
159 More tricky refactoring of implicit linq blocks.
161 2010-05-25 Marek Safar <marek.safar@gmail.com>
163 * linq.cs, cs-parser.jay: Keep location for all linq clauses.
165 2010-05-25 Marek Safar <marek.safar@gmail.com>
167 * context.cs, expression.cs, cs-parser.jay: Don't store current
168 block in This expression (it's too early for linq blocks).
170 2010-05-21 Marek Safar <marek.safar@gmail.com>
172 * expression.cs: Use constrained prefix more broadly to avoid boxing.
174 2010-05-20 Marek Safar <marek.safar@gmail.com>
176 A fix for bug #591149
177 * nullable.cs: Don't double wrap same expression.
179 2010-05-20 Marek Safar <marek.safar@gmail.com>
181 A fix for bug #569827
182 * anonymous.cs: Any issued error in probing mode means no match.
184 2010-05-20 Marek Safar <marek.safar@gmail.com>
186 * expression.cs: Search for base indexer using the closest match
189 2010-05-20 Marek Safar <marek.safar@gmail.com>
191 A fix for bug #572071
192 * method.cs: Set override constraints using unexpanded interface
195 2010-05-20 Marek Safar <marek.safar@gmail.com>
197 A fix for bug #572071
198 * ecore.cs: Include secondary extension method lookup in probing
201 2010-05-19 Marek Safar <marek.safar@gmail.com>
203 A fix for bug #515801
204 * typespec.cs (MayBecomeEqualGenericTypes): Recursively check
207 2010-05-19 Marek Safar <marek.safar@gmail.com>
209 A fix for bug #515801
210 * pending.cs: Advance counter correctly.
212 2010-05-19 Marek Safar <marek.safar@gmail.com>
214 A fix for bug #480139
215 * method.cs, pending.cs: Indexer override uses base name.
217 2010-05-19 Marek Safar <marek.safar@gmail.com>
219 A fix for bug #424064
220 * generic.cs: Replace original with inflated type parameter on
223 2010-05-19 Marek Safar <marek.safar@gmail.com>
225 A fix for bug #359733
226 * parameter.cs: Extension attribute can be defined in each assembly.
228 2010-05-18 Marek Safar <marek.safar@gmail.com>
230 A fix for bug #446507
231 * method.cs: Only one method can implement an interface.
233 2010-05-18 Marek Safar <marek.safar@gmail.com>
235 A fix for bug #594905
236 * convert.cs, constant.cs, expression.cs, literal.cs, ecore.cs:
237 Typed null can be used as a source for expression methods.
239 2010-05-18 Marek Safar <marek.safar@gmail.com>
241 A fix for bug #606551
242 * namespace.cs: Using directive imports only types and not nested
245 2010-05-17 Marek Safar <marek.safar@gmail.com>
247 * typespec.cs, expression.cs, statement.cs, ecore.cs, complete.cs,
248 delegate.cs: Member instance is resolved after member overload
249 definitely resolves static/instance property of member expression.
250 Fixes #545047, #358848, #456605, #460016, #603299
252 2010-05-12 Marek Safar <marek.safar@gmail.com>
254 A fix for bug #604981
255 * generic.cs, decl.cs, anonymous.cs: Reset more type arguments
256 details for nested anonymous methods stories.
258 2010-05-11 Marek Safar <marek.safar@gmail.com>
260 A fix for bug #604735
261 * namespace.cs: Don't report namespace collision.
263 2010-05-11 Marek Safar <marek.safar@gmail.com>
265 A fix for bug #604748
266 * class.cs, typespec.cs: Search full imported attribute hierarchy
269 2010-05-11 Marek Safar <marek.safar@gmail.com>
271 * namespace.cs: Ignore missing dependencies failure at
274 2010-05-11 Marek Safar <marek.safar@gmail.com>
276 A fix for bug #604640
277 * namespace.cs: Don't resolve using constraints too early.
279 2010-05-11 Marek Safar <marek.safar@gmail.com>
281 A fix for bug #604239
282 * generic.cs: Copy partial type constraints to partial container.
284 2010-05-10 Marek Safar <marek.safar@gmail.com>
286 A fix for bug #557210
287 * import.cs: Relax underlying enum field rules.
289 2010-05-10 Marek Safar <marek.safar@gmail.com>
291 A fix for bug #603476
292 * property.cs: Implement IParametersMember for indexer accessors.
294 2010-05-07 Marek Safar <marek.safar@gmail.com>
296 A fix for bug #601141
297 * class.cs: Update all partial modifiers.
299 2010-05-06 Marek Safar <marek.safar@gmail.com>
301 A fix for bug #601708
302 * method.cs, membercache.cs: Destructors cannot be hidden.
304 2010-05-06 Marek Safar <marek.safar@gmail.com>
306 A fix for bug #602551
307 * class.cs: Resursive reference of type definition is allowed.
309 2010-05-06 Marek Safar <marek.safar@gmail.com>
311 * anonymous.cs: Mutate cached storey instance types too.
313 2010-05-06 Marek Safar <marek.safar@gmail.com>
315 A fix for bug #602443
316 * convert.cs: Explicit enum conversion cannot involve user operators
318 2010-05-05 Miguel de Icaza <miguel@novell.com>
320 * class.cs (TypeContainer.DefineBaseTypes)
321 (TypeContainer.CheckRecursiveDefinition): check for the iface not
322 being null, as we could have failed resolution and crashed;
325 * cs-parser.jay: Productions to catch common mistakes when other
326 punctuation operators are used instead of comma. Fixes 571702
328 2010-05-05 Marek Safar <marek.safar@gmail.com>
330 * anonymous.cs: Mutate correct set of constraints.
332 2010-05-05 Marek Safar <marek.safar@gmail.com>
334 A fix for bug #602842
335 * expression.cs: Resolve all array bound arguments.
337 2010-05-05 Marek Safar <marek.safar@gmail.com>
339 * import.cs: Don't import private fields.
341 2010-04-30 Marek Safar <marek.safar@gmail.com>
343 Partially based on patch by <sami.lamti@gmail.com>
345 * eval.cs, ecore.cs: Fixed eval show methods.
347 2010-04-30 Marek Safar <marek.safar@gmail.com>
349 * generic.cs, delegate.cs: Implement output type inference of
350 methodgroup now when the specification was cleared at least little
353 2010-04-29 Marek Safar <marek.safar@gmail.com>
355 A fix for bug #575611
356 * class.cs: Fix recursive unmanaged recursice sruct check.
358 2010-04-29 Marek Safar <marek.safar@gmail.com>
360 A fix for bug #479776
361 * expression.cs: Implement typeof unbounded nested generic types.
363 2010-04-29 Marek Safar <marek.safar@gmail.com>
365 A fix for bug #474953
366 * class.cs: Fix valid recursive base type definition.
368 2010-04-29 Marek Safar <marek.safar@gmail.com>
370 A fix for bug #421737
371 * convert.cs, expression.cs: A boxing conversion exists from a
372 nullable-type to a reference type, if a boxing conversion exists
373 from the underlying non-nullable-value-type to the reference type.
375 2010-04-29 Marek Safar <marek.safar@gmail.com>
377 A fix for bug #376875
378 * import.cs: Import volatile modifier.
380 2010-04-29 Marek Safar <marek.safar@gmail.com>
382 A fix for bug #372412
383 * typespec.cs, expression.cs, codegen.cs: Emit readonly prefix for
386 2010-04-29 Marek Safar <marek.safar@gmail.com>
388 A fix for bug #568955
389 * statements.cs: Handle recursive scope initializers.
391 2010-04-28 Marek Safar <marek.safar@gmail.com>
393 A fix for bug #566511
394 * anonymous.cs: Always get inflated version of hoisted variable
395 on generic type definition.
397 2010-04-28 Marek Safar <marek.safar@gmail.com>
399 * import.cs, membercache.cs: Relax rules for valid properties.
401 2010-04-28 Marek Safar <marek.safar@gmail.com>
403 * import.cs: Intern arrays used in generic arguments.
405 2010-04-28 Marek Safar <marek.safar@gmail.com>
407 A fix for bug #600398
408 * convert.cs: Actually use effective base type for the comparison.
410 2010-04-28 Marek Safar <marek.safar@gmail.com>
412 A fix for bug #600326
413 * ecore.cs: Pass arity to base member lookup.
415 2010-04-28 Marek Safar <marek.safar@gmail.com>
417 A fix for bug #573385
418 * expression.cs: MemberAccess is of generic type based on right
421 2010-05-28 Marek Safar <marek.safar@gmail.com>
423 * cs-tokenizer.cs: Made tab size configurable.
425 2010-05-27 Marek Safar <marek.safar@gmail.com>
427 * attribute.cs: Ensure Obsolete members are defined before doing
430 2010-05-27 Marek Safar <marek.safar@gmail.com>
432 * visit.cs: Add DOM visitor skeleton.
436 2010-05-27 Marek Safar <marek.safar@gmail.com>
438 * attribute.cs, codegen.cs: Drop COMPILER_ACCESS hack.
440 2010-05-27 Marek Safar <marek.safar@gmail.com>
442 * *.cs: Major rewrite of compiler internals to better work with
443 unmodified System.Reflection.Emit. Some of the key changes are
444 - TypeSpec replaces reflection specific System.Type.
445 - All Type(TypeSpec) operations are now done in compiler therefore
446 no dependency on SRE to inflate generic members and types or to
447 query unclosed types.
448 - MemberCache is now the only and full hierarchical topology.
449 - Generic constraints are implemented properly.
450 - And as a bonus compilation is on average 30% faster.
452 2010-04-15 Jb Evain <jbevain@novell.com>
454 * dmcs.exe.config: update the runtime version to .net 4.0 RTM.
456 2010-04-12 Marek Safar <marek.safar@gmail.com>
458 * expression.cs, attribute.cs, parameter.cs: More attribute type
461 2010-04-12 Marek Safar <marek.safar@gmail.com>
463 A fix for bug #593342
465 * generic.cs, parameter.cs, argument.cs, field.cs, property.cs,
466 decl.cs, roottypes.cs, constant.cs, nullable.cs, expression.cs,
467 method.cs, ecore.cs, class.cs, delegate.cs, attribute.cs,
468 codegen.cs: Add custom attribute encoder to deal with unfinished
469 types and easier corlib bootstrap from its own types.
471 2010-03-26 Marek Safar <marek.safar@gmail.com>
473 * cs-parser.jay: Report invalid constraint types.
475 2010-03-16 Jb Evain <jbevain@novell.com>
477 * Makefile: rename the net_2_1 profile to moonlight.
479 2010-03-11 Marek Safar <marek.safar@gmail.com>
481 * statement.cs, cs-parser.jay: Use correct location for empty
484 2010-03-11 Marek Safar <marek.safar@gmail.com>
486 * cs-parser.jay: Disable Location from expression.
488 * generic.cs: Check constraints for overrides in the parser.
490 2010-03-09 Marek Safar <marek.safar@gmail.com>
492 * cs-parser.jay (GetLocation): Use an expression when available.
494 2010-03-04 Marek Safar <marek.safar@gmail.com>
496 A fix for bug #582579
497 * ecore.cs (FieldExpr): Don't optimize cross reference loads.
499 2010-03-04 Marek Safar <marek.safar@gmail.com>
501 A patch by kornelpal@gmail.com
503 * dynamic.cs, anonymous.cs, rootcontext.cs, class.cs: Don't make
504 compiler generated classes sealed by default. Emit and close top
505 level compiler generated classes as well.
507 * support.cs: Use RuntimeHelpers.GetHashCode.
509 2010-03-03 Rolf Bjarne Kvinge <RKvinge@novell.com>
511 * Makefile: We need to use the internal bootstrapping gmcs for
512 net_2_1_bootstrap too now.
514 2010-03-02 Raja R Harinath <harinath@hurrynot.org>
516 * expression.cs (IndexerAccess.ResolveAccessor): Add CS1540 check.
518 2010-03-02 Marek Safar <marek.safar@gmail.com>
520 * cs-tokenizer.cs: Missed few locations in previous fix.
522 2010-03-02 Marek Safar <marek.safar@gmail.com>
524 * cs-tokenizer.cs, argument.cs, dynamic.cs, assign.cs, anonymous.cs,
525 nullable.cs, expression.cs, statement.cs, cs-parser.jay, cfold.cs:
526 Report correct location for operator errors.
528 2010-03-02 Marek Safar <marek.safar@gmail.com>
530 * typemanager.cs (IsDynamicType): Don't check external types when
531 the attribute is not external.
533 2010-02-24 Marek Safar <marek.safar@gmail.com>
535 A fix for bug #582579
536 * decl.cs (IsExposedFromAssembly): Use PartialContainer for parent
539 2010-02-24 Marek Safar <marek.safar@gmail.com>
541 A fix for bug #581804
542 * ecore.cs: Fixed type comparison.
544 2010-02-08 Miguel de Icaza <miguel@novell.com>
546 * namespace.cs (CompletionGetTypesStartingWith): Do not include
547 private types in the completion results.
549 * cs-parser.jay: Bubble completions after "from x in ?" and "from x
552 2010-02-17 Marek Safar <marek.safar@gmail.com>
554 * generic.cs, field.cs, decl.cs, cs-parser.jay: Simplify special
557 2010-02-14 Miguel de Icaza <miguel@novell.com>
559 * eval.cs: Do not do the report printer dance unless the user has
560 set the DescribeTypes feature.
562 2010-02-10 Marek Safar <marek.safar@gmail.com>
564 * argument.cs, dynamic.cs, expression.cs: Track RC API changes.
566 2010-02-08 Marek Safar <marek.safar@gmail.com>
568 A fix for bug #577029
569 * anonymous.cs: Fixed TypeBuilder* check.
571 2010-02-06 Miguel de Icaza <miguel@novell.com>
573 * eval.cs (CompileBlock): Also undo if there are problems during
574 semantic analysis, fixes various cases where invalid C# code would
575 be reported, but the internal changes would not be undone.
577 2010-02-03 Miguel de Icaza <miguel@novell.com>
579 * driver.cs: Change the --fatal flag to allow a number to be
580 passed, this ignores the first N fatal errors. Useful to debug
581 errors that do not happen on the first hit.
583 * cs-parser.jay (invocation_expression): accept both the
584 CLOSE_PARENS and COMPLETE_COMPLETION, this allows completions
585 inside an invocation.
587 * driver.cs: Expose FatalErrors.
589 * eval.cs: Initialize the printer's Fatal property from the
590 Driver's FatalError flag, this allows csharp --fatal to work
593 Add support for calling Describe (typeof (TYPE)) if the expression
596 2010-02-02 Marek Safar <marek.safar@gmail.com>
598 A fix for bug #574991
599 * rootcontext.cs, class.cs, driver.cs: Hide enhanced warnings behind
602 2010-02-02 Marek Safar <marek.safar@gmail.com>
604 A fix for bug #575986
605 * expression.cs: Don't mutate typeof type definitions.
607 2010-01-28 Marek Safar <marek.safar@gmail.com>
609 * decl.cs: Use only one set of modifiers.
611 2010-01-26 Marek Safar <marek.safar@gmail.com>
613 A fix for bug #573329
614 * eval.cs: Don't disable error reporting completely on silent mode.
616 2010-01-25 Marek Safar <marek.safar@gmail.com>
618 A fix for bug #573312
619 * constant.cs, expression.cs, ecore.cs: Emit correct offset for
620 pointer index of unknown size types greater than 2.
622 2010-01-15 Marek Safar <marek.safar@gmail.com>
624 * *.cs: Use only 1 member kind enum.
626 2010-01-15 Marek Safar <marek.safar@gmail.com>
628 * *.cs: Add event specification.
630 2010-01-14 Marek Safar <marek.safar@gmail.com>
632 * membercache.cs: Extracted from decl.cs.
634 * *.cs: Put more infrastructure in place.
636 2010-01-13 Marek Safar <marek.safar@gmail.com>
638 * *.cs: Add property specification, unused yet.
640 2010-01-13 Marek Safar <marek.safar@gmail.com>
642 * property.cs: Move all property based declarations into a new file.
644 2010-01-13 Marek Safar <marek.safar at gmail.com>
646 * expression.cs (Conditional): Resolve reduced expression.
648 2010-01-13 Marek Safar <marek.safar at gmail.com>
650 * *.cs: Introduced non-generic method specification.
652 2010-01-07 Marek Safar <marek.safar@gmail.com>
654 * method.cs: Move all method based declarations into a new file.
656 2010-01-07 Marek Safar <marek.safar@gmail.com>
658 * *.cs: Extract field specification.
660 2009-12-17 Marek Safar <marek.safar@gmail.com>
662 * field.cs: Extracted from class.cs
664 2009-12-15 Marek Safar <marek.safar@gmail.com>
666 * attribute.cs (GetFixedBuffer): Work on field definition only.
668 2009-12-15 Marek Safar <marek.safar@gmail.com>
670 * *.cs: Clean up NET_4_0 conditional where possible.
672 2009-12-14 Rodrigo Kumpera <rkumpera@novell.com>
674 support.cs (DynamicType): Assembly property returns the assembly builder.
675 This is required due to how compiler context works in corlib.
677 2009-12-14 Marek Safar <marek.safar@gmail.com>
679 A fix for bug #564376
680 * assign.cs (LocalTemporary): Removed no longer needed special
683 2009-12-11 Marek Safar <marek.safar@gmail.com>
685 * modifiers.cs, decl.cs, iterators.cs, const.cs, anonymous.cs,
686 class.cs, delegate.cs, cs-parser.jay, enum.cs: Turn modifiers into
687 enum for easier debugging.
689 2009-12-10 Marek Safar <marek.safar@gmail.com>
691 * decl.cs, anonymous.cs, class.cs: Sealed Define it's now main entry
694 * parameter.cs, delegate.cs, dynamic.cs: Don't use builder methods
697 2009-12-10 Marek Safar <marek.safar@gmail.com>
699 * cs-parser.jay, statement.cs: Handle parser error in code
702 2009-12-10 Marek Safar <marek.safar@gmail.com>
704 * ecore.cs: Ignore base imported methods when they are already
707 * eval.cs: Handle non-existent keys.
709 * report.cs, driver.cs: Make fatal work with console printer only.
711 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
713 * typemanager.cs (MakeGenericMethod): Fix stupid mistake.
715 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
717 * typemanager.cs: Add MakeGenericMethod that checks if the method
718 is really the generic method definition.
720 ecore.cs (MethodGroupExpr:IsApplicable): Use new TypeManager function
721 to inflate generic methods.
723 2009-12-08 Marek Safar <marek.safar@gmail.com>
725 A fix for bug #561149
726 * anonymous.cs: Use actual type parameters when checking for generic
729 2009-12-08 Marek Safar <marek.safar@gmail.com>
731 A fix for bug #561369
732 * expression.cs (DoNumericPromotion): Fixed typo.
734 2009-12-08 Marek Safar <marek.safar@gmail.com>
736 *.cs: Moving to generics world.
738 cs-parser.jay: Removed current_array_type.
740 2009-12-07 Marek Safar <marek.safar@gmail.com>
742 *.cs: Moving to generics world.
744 2009-12-04 Marek Safar <marek.safar@gmail.com>
746 *.cs: Moving to generics world (day 2).
748 2009-12-03 Marek Safar <marek.safar@gmail.com>
750 *.cs: Moving to generics world.
752 2009-12-02 Marek Safar <marek.safar@gmail.com>
754 * typemanager.cs, parameter.cs, class.cs, delegate.cs, attribute.cs:
755 Encode dynamic type attribute for elements where attributes cannot
758 2009-12-01 Marek Safar <marek.safar@gmail.com>
760 argument.cs, assign.cs, expression.cs, cs-parser.jay: Named
763 2009-12-01 Marek Safar <marek.safar@gmail.com>
765 A fix for bug #360455
766 * class.cs: Never report a unused warning for generic events to
767 workaround wrong expression type.
769 2009-11-30 Marek Safar <marek.safar@gmail.com>
771 A fix for bug #558305
772 * decl.cs, class.cs: Check partial method definitions using correct
775 2009-11-30 Marek Safar <marek.safar@gmail.com>
777 * argument.cs: Don't cache rarely used dynamic flag.
779 2009-11-27 Marek Safar <marek.safar@gmail.com>
781 * cs-parser.jay: Use jay global stacks (saves over 3MB for corlib).
783 2009-11-27 Marek Safar <marek.safar@gmail.com>
785 * ecore.cs (SimpleName): Removed no longer needed in_transit as
786 Resolve is now non-reentrant (saves ~0.6MB for corlib).
788 2009-11-26 Marek Safar <marek.safar@gmail.com>
790 A fix for bug #545081
791 * decl.cs: Check private nested types of nested types recursively.
793 2009-11-26 Marek Safar <marek.safar@gmail.com>
795 A fix for bug #558305
796 * location.cs: Ignore self referencing #line directive
798 2009-11-26 Marek Safar <marek.safar@gmail.com>
800 A fix for bug #558292
801 * class.cs: Allow single unsafe fixed buffer fields.
803 2009-11-26 Marek Safar <marek.safar@gmail.com>
805 * expression: Optimize few more zero-based operations.
807 2009-11-26 Marek Safar <marek.safar@gmail.com>
809 * cs-tokenizer.cs, cs-parser.jay: Simplify literal parsing, also
810 avoids boxing of literal values.
812 2009-11-26 Marek Safar <marek.safar@gmail.com>
814 * cs-tokenizer.cs, argument.cs, eval.cs, linq.cs, decl.cs,
815 expression.cs, ecore.cs, location.cs, cs-parser.jay, attribute.cs,
816 codegen.cs: LocatedToken redesing to avoid excessive allocation and
817 boxing (saves ~7MB for corlib). Also fixes presise token location.
819 2009-11-25 Marek Safar <marek.safar@gmail.com>
821 * ecore.cs, cs-parser.jay: Keep parser structures local. Share
824 2009-11-24 Marek Safar <marek.safar@gmail.com>
826 * expression.cs: Lower static array initializer barrier.
828 * support.cs, driver.cs: Share reader buffer.
830 2009-11-23 Marek Safar <marek.safar@gmail.com>
832 * cs-tokenizer.cs, support.cs: Some tokenizer optimizations.
834 2009-11-23 Marek Safar <marek.safar@gmail.com>
836 * cs-tokenizer.cs, support.cs: Use Dictionary instead of Hashtable,
837 cleanup some obsolete code.
839 2009-11-20 Marek Safar <marek.safar@gmail.com>
841 * context.cs, expression.cs, ecore.cs, complete.cs: Cleaned up
844 2009-11-20 Marek Safar <marek.safar@gmail.com>
846 * *.cs: Resolved expressions are never resolved again, this helps to
847 uncover some not easy to find bugs and improve the performance.
849 2009-11-19 Marek Safar <marek.safar@gmail.com>
851 * *.cs: Made constant expressions fully compatible with any other
854 2009-11-19 Marek Safar <marek.safar@gmail.com>
856 * *.cs: DoResolve is a worker method and has to be protected.
858 2009-11-18 Marek Safar <marek.safar@gmail.com>
860 * *.cs: More context specific handling.
862 2009-11-17 Marek Safar <marek.safar@gmail.com>
864 * *.cs: More context specific handling.
866 2009-11-16 Marek Safar <marek.safar@gmail.com>
868 * dynamic.cs, class.cs: Removed few fixed user types conversions.
870 * symbolwriter.cs: Uses public ILOffset.
872 2009-11-13 Marek Safar <marek.safar@gmail.com>
874 A fix for bug #553650
875 * generic.cs: Another missing TypeToCoreType, still too many to fix.
877 2009-11-13 Marek Safar <marek.safar@gmail.com>
879 A fix for bug #555170
881 * class.cs, delegate.cs, enum.cs: Constants have to be available
882 for parameters resolve.
884 2009-11-12 Marek Safar <marek.safar@gmail.com>
886 * typemanager.cs, argument.cs, support.cs, delegate.cs: Dynamic
889 2009-11-12 Marek Safar <marek.safar@gmail.com>
891 * argument.cs, context.cs, expression.cs, ecore.cs: Dynamic binding
892 with a statically known candidate set.
894 2009-11-11 Scott Peterson <lunchtimemama@gmail.com>
896 * generic.cs: Made type inflation for generic constraint checks
897 recursive. This fixes BGO #553655.
899 2009-11-11 Marek Safar <marek.safar@gmail.com>
901 * dynamic.cs, decl.cs, expression.cs, ecore.cs: More dynamic type
904 2009-11-10 Marek Safar <marek.safar@gmail.com>
906 * typemanager.cs, generic.cs, parameter.cs, argument.cs, dynamic.cs,
907 linq.cs, rootcontext.cs, ecore.cs, class.cs, delegate.cs,
908 attribute.cs: Add some dynamic error checking.
910 2009-11-07 Marek Safar <marek.safar@gmail.com>
912 A fix for bug #553465
914 * expression.cs: Fixed mixed version of expression tree anonymous
917 2009-11-06 Marek Safar <marek.safar@gmail.com>
919 A fix for bug #553031
921 * linq.cs, expression.cs, class.cs, cs-parser.jay: Initialize
922 expression tree version of anonymous type with members declaration.
924 2009-11-05 Marek Safar <marek.safar@gmail.com>
926 * parameter.cs: Handle nullable parameter default expression.
928 * argument.cs, dynamic.cs, expression.cs, support.cs, ecore.cs,
929 class.cs, attribute.cs: Check for wrong dynamic arguments.
931 2009-11-05 Marek Safar <marek.safar@gmail.com>
933 * statement.cs: Dynamic statements.
935 2009-11-04 Marek Safar <marek.safar@gmail.com>
937 * dynamic.cs, assign.cs, context.cs, expression.cs, ecore.cs:
938 Compound assignments over dynamic type.
940 2009-11-03 Marek Safar <marek.safar@gmail.com>
942 * argument.cs, dynamic.cs, expression.cs, delegate.cs: Dynamic
943 constructor arguments.
945 2009-10-30 Marek Safar <marek.safar@gmail.com>
947 * dynamic.cs, convert.cs, assign.cs, constant.cs, expression.cs,
948 codegen.cs: Unary mutator on dynamic member access expression.
950 2009-10-29 Marek Safar <marek.safar@gmail.com>
952 A fix for bug #550580
953 * convert.cs: Don't eliminate explicit precission casts.
955 2009-10-28 Marek Safar <marek.safar@gmail.com>
957 A fix for bug #550404
959 * parameter.cs, iterators.cs, context.cs, anonymous.cs,
960 expression.cs, statement.cs, ecore.cs: Quote any nested expression
963 2009-10-27 Marek Safar <marek.safar@gmail.com>
965 * constant.cs, nullable.cs: Create nullable-null as LiftedNull
968 * class.cs: Allow nullable binary user operators.
970 2009-10-26 Marek Safar <marek.safar@gmail.com>
972 * expression.cs: Move binary expression optimization at the end of
975 2009-10-23 Marek Safar <marek.safar@gmail.com>
977 * constant.cs, nullable.cs, expression.cs, literal.cs, cfold.cs:
978 Separate NullConstant from NullLiteral.
980 2009-10-23 Marek Safar <marek.safar@gmail.com>
982 * typemanager.cs, eval.cs, decl.cs, roottypes.cs, context.cs,
983 anonymous.cs, expression.cs, rootcontext.cs, ecore.cs, class.cs,
984 flowanalysis.cs, cs-parser.jay, driver.cs, codegen.cs: Split
985 ModuleContainer. Add common unclosed member check routine.
987 2009-10-22 Marek Safar <marek.safar@gmail.com>
989 * argument.cs: Use literal flag for real literals only.
991 * dynamic.cs: Use correct return type for custom delegates.
993 2009-10-22 Marek Safar <marek.safar@gmail.com>
995 * dynamic.cs, expression.cs: Pass logical binary flag to dynamic
998 2009-10-22 Marek Safar <marek.safar@gmail.com>
1000 * dynamic.cs, ecore.cs: Dynamic invocation with void return type.
1002 2009-10-21 Marek Safar <marek.safar@gmail.com>
1004 * dynamic.cs, convert.cs, expression.cs, ecore.cs: Wrap array index
1007 2009-10-21 Marek Safar <marek.safar@gmail.com>
1009 * typemanager.cs, dynamic.cs, expression.cs: Don't resolve runtime
1012 2009-10-20 Marek Safar <marek.safar@gmail.com>
1014 * argument.cs, dynamic.cs, expression.cs: Latest API update.
1016 2009-10-19 Marek Safar <marek.safar@gmail.com>
1018 * typemanager.cs, expression.cs: Dynamic array initializer.
1020 2009-10-16 Marek Safar <marek.safar@gmail.com>
1022 * typemanager.cs, rootcontext.cs: Clear -nostdlib flag when object
1025 2009-10-16 Marek Safar <marek.safar@gmail.com>
1027 A fix for bug #493523, #507067
1028 * convert.cs, nullable.cs, expression.cs: Do implicit and explicit
1029 standard nullable conversion using underlying standard conversion
1030 and not full conversion.
1032 2009-10-15 Marek Safar <marek.safar@gmail.com>
1034 * dynamic.cs, expression.cs, ecore.cs, delegate.cs: Check return
1035 type in VerifyArgumentsCompat.
1037 2009-10-15 Marek Safar <marek.safar@gmail.com>
1039 * nullable.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
1040 Reject variable used with type arguments.
1042 2009-10-14 Marek Safar <marek.safar@gmail.com>
1044 * argument.cs, dynamic.cs, assign.cs, expression.cs, ecore.cs:
1045 Implement dynamic expressions assignment.
1047 2009-10-14 Marek Safar <marek.safar@gmail.com>
1049 * expression.cs: Build underlying expression when resolving unary
1052 2009-10-14 Marek Safar <marek.safar@gmail.com>
1054 * expression.cs: Emit enum array initializer using binary blob.
1056 2009-10-08 Marek Safar <marek.safar@gmail.com>
1058 * typemanager.cs, constant.cs: Optimize decimal constants which fit
1061 2009-10-07 Marek Safar <marek.safar@gmail.com>
1063 * typemanager.cs: Reset object_type.
1065 * assign: Made SimpleAssign public.
1067 2009-10-06 Marek Safar <marek.safar@gmail.com>
1069 * typemanager.cs, decl.cs, namespace.cs, ecore.cs, class.cs: Pass
1070 invocation assembly to IsThisOrFriendAssembly.
1072 2009-10-05 Marek Safar <marek.safar@gmail.com>
1074 * expression.cs: Equality comparison of generic parameter with
1077 2009-10-05 Marek Safar <marek.safar@gmail.com>
1079 A fix for bug #543570
1080 * generic.cs: Import predefined constraints correctly.
1082 2009-10-02 Marek Safar <marek.safar@gmail.com>
1084 * ecore.cs: Don't crash on overloads with optional paremeters where
1085 arguments count overflows.
1087 * parameter.cs: Import optional parameter constants using optional
1090 2009-10-01 Marek Safar <marek.safar@gmail.com>
1092 * Makefile: Default is gmcs compiler.
1094 2009-10-01 Marek Safar <marek.safar@gmail.com>
1096 * cs-parser.jay: Fixed few NRE.
1098 2009-10-01 Marek Safar <marek.safar@gmail.com>
1100 * cs-parser.jay, driver.cs: Expose parser exception in verbose mode.
1102 2009-09-30 Marek Safar <marek.safar@gmail.com>
1104 * linq.cs, convert.cs, assign.cs, expression.cs, ecore.cs: Add
1105 ShimExpression, ImplicitCast.
1107 2009-09-30 Marek Safar <marek.safar@gmail.com>
1109 A fix for bug #542959
1110 * delegate.cs: Emit correct delegate instance variable when there
1111 are static and non-static overloads.
1113 2009-09-29 Marek Safar <marek.safar@gmail.com>
1115 * dynamic.cs, linq.cs, anonymous.cs, expression.cs, statement.cs,
1116 ecore.cs, cs-parser.jay: Unary expression dynamic compiler.
1118 2009-09-28 Marek Safar <marek.safar@gmail.com>
1120 A fix for bug #542487
1121 * ecore.cs: Resolve extension methods hidden by properties.
1123 2009-09-25 Marek Safar <marek.safar@gmail.com>
1125 * expression.cs, ecore.cs: More dynamic binary expressions.
1127 2009-09-22 Marek Safar <marek.safar@gmail.com>
1129 * nullable.cs, expression.cs: Fixed null lifted conversion for
1130 bitwise enum operations.
1132 2009-09-22 Marek Safar <marek.safar@gmail.com>
1134 * convert.cs, ecore.cs: Fixed explicit unsafe coversion of long
1135 values in checked context.
1137 2009-09-22 Marek Safar <marek.safar@gmail.com>
1139 * expression.cs, ecore.cs: Fixed array index constant conversion.
1141 2009-09-20 Miguel de Icaza <miguel@novell.com>
1143 * expression.cs: Do not crash when MemberLookup returns something
1144 that is not a MemberExpr here. Report error 582 instead.
1148 2009-09-18 Marek Safar <marek.safar@gmail.com>
1150 * decl.cs, class.cs: Check protected property accessors.
1152 2009-09-18 Marek Safar <marek.safar@gmail.com>
1154 * dynamic.cs, assign.cs: Dynamic compound assignment.
1156 2009-09-17 Marek Safar <marek.safar@gmail.com>
1158 * expression.cs: Fixed compound assignment explicit conversion.
1160 2009-09-17 Marek Safar <marek.safar@gmail.com>
1162 * expression.cs, ecore.cs: Cannot infer variables from method group.
1164 2009-09-16 Marek Safar <marek.safar@gmail.com>
1166 * argument.cs, dynamic.cs, convert.cs, context.cs, anonymous.cs,
1167 constant.cs, nullable.cs, expression.cs, literal.cs, ecore.cs,
1168 codegen.cs: Dynamic binary operations scaffolding.
1170 2009-09-15 Marek Safar <marek.safar@gmail.com>
1172 * expression.cs: Fixes nullable promotion for enum type variables.
1174 2009-09-11 Marek Safar <marek.safar@gmail.com>
1176 * driver.cs, dynamic.cs: Reset more static variables.
1178 2009-09-11 Marek Safar <marek.safar@gmail.com>
1180 * dynamic.cs, expression.cs, rootcontext.cs, namespace.cs, ecore.cs,
1181 driver.cs: Introduced Expression::MakeExpression.
1183 2009-09-11 Marek Safar <marek.safar@gmail.com>
1185 * eval.cs: Exposed MessageOutput instead of cleaning up eval API.
1187 2009-09-09 Marek Safar <marek.safar@gmail.com>
1189 * eval.cs, report.cs: Use Console.Out for all eval error or warning
1192 2009-09-09 Marek Safar <marek.safar@gmail.com>
1194 A fix for bug #518707
1195 * expression.cs (Is): Optimize only generic parameter type
1196 expression probing value type generic parameter.
1198 2009-09-09 Marek Safar <marek.safar@gmail.com>
1200 A fix for bug #532571
1201 * ecore.cs: Check for simple name type arguments used with
1204 2009-09-08 Marek Safar <marek.safar@gmail.com>
1206 A fix for bug #497421
1207 * generic.cs (CheckConstraint): Don't use buildin types to check for
1208 parameterless constructor.
1210 2009-09-08 Marek Safar <marek.safar@gmail.com>
1212 A fix for bug #537402
1213 * generic.cs (CheckConstraint): Correctly inflate generic type
1214 arguments when checking generic method.
1216 2009-09-08 Marek Safar <marek.safar@gmail.com>
1218 A fix for bug #536463
1219 * decl.cs (AddToContainer): Don't report collision between explicit
1220 and parameterless non-explicit members.
1222 2009-09-08 Marek Safar <marek.safar@gmail.com>
1224 * eval.cs: Reset more static stuff.
1226 2009-09-07 Marek Safar <marek.safar@gmail.com>
1228 A fix for bug #324625
1229 * expression.cs, ecore.cs: Create nested generic type expression
1230 using declaring and not current type.
1232 2009-09-07 Marek Safar <marek.safar@gmail.com>
1234 * *.cs: Changed Report class to accept various output printers and
1235 be an instance class. An expression resolver can now use different
1236 message reporter for each call and Report.Error can safely throw
1237 an exception. Part of ongoing work to turn mcs into proper library.
1239 2009-09-04 Marek Safar <marek.safar@gmail.com>
1241 * statement.cs, ecore.cs: Removed error reporting from emit code.
1243 2009-09-04 Marek Safar <marek.safar@gmail.com>
1245 * cs-parser.jay, parameter.cs: Moved parser check out of constructor
1247 2009-09-03 Marek Safar <marek.safar@gmail.com>
1249 * anonymous.cs, expression.cs, statement.cs, cs-parser.jay: Moved
1250 parser checks out of constructors.
1252 2009-09-02 Marek Safar <marek.safar@gmail.com>
1254 * expression.cs, statement.cs, ecore.cs: Use common Report.Error.
1256 2009-09-02 Marek Safar <marek.safar@gmail.com>
1258 A fix for bug #535448
1259 * anonymous.cs, class.cs: Copy return label between all contexts.
1261 2009-09-02 Marek Safar <marek.safar@gmail.com>
1263 A fix for bug #535395
1264 * namespace.cs: Resolve context can be null.
1266 2009-08-25 Marek Safar <marek.safar@gmail.com>
1268 A fix for bug #533912
1269 * generic.cs: Use correct context for constraints resolving.
1271 2009-08-25 Marek Safar <marek.safar@gmail.com>
1273 A fix for bug #532630
1274 * driver.cs: Trim conditional symbols.
1276 2009-08-25 Marek Safar <marek.safar@gmail.com>
1278 * context.cs: New file.
1280 * *.exe.sources, *.csproj: Updated.
1282 2009-08-25 Marek Safar <marek.safar@gmail.com>
1284 * generic.cs, parameter.cs, decl.cs, statement.cs, namespace.cs,
1285 class.cs, generic-mcs.cs, codegen.cs: Add GetSignatureForError to
1286 IMembercontext, some small cleanups.
1288 2009-08-24 Marek Safar <marek.safar@gmail.com>
1290 * *.cs: Split ResolveContext and EmitContext.
1292 2009-08-24 Marek Safar <marek.safar@gmail.com>
1294 * *.cs: Only ResolveContext implements IMemberContext.
1296 2009-08-21 Marek Safar <marek.safar@gmail.com>
1298 * *.cs: Renamed IResolveContext to IMemberContext.
1300 2009-08-21 Marek Safar <marek.safar@gmail.com>
1302 * *.cs: Detached ResolveContext from EmitContext.
1304 2009-08-21 Marek Safar <marek.safar@gmail.com>
1306 * codegen.cs: Moved flow-analysis to BlockContext.
1308 2009-08-21 Marek Safar <marek.safar@gmail.com>
1310 * *.cs: Detached BlockContext from EmitContext.
1312 2009-08-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1314 * statement.cs: avoid nullref when the return value of GetEnumerator()
1315 does not contain any MoveNext() method.
1317 2009-08-19 Marek Safar <marek.safar@gmail.com>
1319 * *.cs: Removed IResolveContext::GenericDeclContainer.
1321 2009-08-19 Marek Safar <marek.safar@gmail.com>
1323 * class.cs, delegate.cs: Changed Delegate to be TypeContainer based.
1325 2009-08-19 Marek Safar <marek.safar@gmail.com>
1327 * generic.cs, iterators.cs, expression.cs, statement.cs, ecore.cs,
1328 cs-parser.jay, attribute.cs, codegen.cs: Better error reports.
1330 2009-08-18 Marek Safar <marek.safar@gmail.com>
1332 * *.cs: Removed boolean fields from EmitContext.
1334 2009-08-18 Marek Safar <marek.safar@gmail.com>
1336 * *.cs: Add IResolveContext::IsStatic.
1338 2009-08-18 Marek Safar <marek.safar@gmail.com>
1340 * *.cs: Moved TopBlock's methods from EmitContext to TopBlock.
1342 2009-08-17 Marek Safar <marek.safar@gmail.com>
1344 * *.cs: Removed DeclContainer from EmitContext.
1346 2009-08-17 Marek Safar <marek.safar@gmail.com>
1348 * *.cs: Add IResolveContext::CurrentTypeParameters.
1350 2009-08-14 Marek Safar <marek.safar@gmail.com>
1352 * *.cs: Removed TypeContainer and ContainerType from EmitContext.
1354 2009-08-14 Marek Safar <marek.safar@gmail.com>
1356 * decl.cs, expression.cs, namespace.cs, ecore.cs, class.cs,
1357 codegen.cs: Add IResolveContext::LookupExtensionMethod.
1359 2009-08-13 Marek Safar <marek.safar@gmail.com>
1361 * decl.cs: Look in PartialContainer for parent type parameters.
1363 2009-08-13 Marek Safar <marek.safar@gmail.com>
1365 * decl.cs, namespace.cs, ecore.cs, class.cs, attribute.cs,
1366 codegen.cs: Add IResolveContext::LookupTypeParameter.
1368 2009-08-13 Marek Safar <marek.safar@gmail.com>
1370 * lambda.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
1371 Moved resolved logic from Emit to Resolve.
1373 2009-08-13 Marek Safar <marek.safar@gmail.com>
1375 * parameter.cs, decl.cs, roottypes.cs, class.cs, attribute.cs,
1376 codegen.cs: Reworked atttributes handling of ResolveContext.
1378 2009-08-12 Marek Safar <marek.safar@gmail.com>
1380 * decl.cs, ecore.cs, class.cs, attribute.cs, codegen.cs: Pushed
1381 LookupNamespaceOrType to ResolveContext.
1383 2009-08-12 Marek Safar <marek.safar@gmail.com>
1385 * typemanager.cs, decl.cs, expression.cs, namespace.cs, ecore.cs,
1386 class.cs: Removed unused parameters and methods.
1388 2009-08-11 Marek Safar <marek.safar@gmail.com>
1390 * generic.cs, lambda.cs, anonymous.cs, statement.cs, generic-mcs.cs,
1391 codegen.cs: Finding the best common type of a set of expressions for
1394 2009-08-07 Marek Safar <marek.safar@gmail.com>
1396 * dynamic.cs, expression.cs: More dynamic conversions.
1398 2009-08-06 Miguel de Icaza <miguel@novell.com>
1400 * generic.cs: This loop was incorrect, it was increment ii, but
1401 checking for `i'. This was a change introduced to fix #327497,
1404 * class.cs: Catch another case for cs0533 error, fixes #324782.
1406 2009-08-06 Rodrigo Kumpera <rkumpera@novell.com>
1408 * typemanager.cs (GetGenericArguments): SRE returns null for
1409 generic methods on type builder instances if they are not generic
1410 themselves. For example, for Foo<int>::Bar() it returns null, but
1411 not for Foo<int>::Bar<>() or Foo<int>::Bar<double>().
1413 2009-08-05 Marek Safar <marek.safar@gmail.com>
1415 * argument.cs, dynamic.cs, expression.cs, ecore.cs, class.cs,
1416 delegate.cs: Work on dynamic binding.
1418 2009-08-04 Marek Safar <marek.safar@gmail.com>
1420 A second fix for bug #525342
1421 * class.cs: Attach partial method attributes to method
1424 2009-08-03 Marek Safar <marek.safar@gmail.com>
1426 * typemanager.cs, parameter.cs, support.cs, class.cs: Dynamic type
1429 * rootcontext.cs: Default to langversion v4.
1431 2009-08-03 Marek Safar <marek.safar@gmail.com>
1433 * pending.cs: Check return type before member info is set.
1435 2009-08-03 Marek Safar <marek.safar@gmail.com>
1437 * anonymous.cs: Fully initialize generic hoisted field expression.
1439 2009-08-02 Miguel de Icaza <miguel@novell.com>
1441 * cs-parser.jay: Flag variables declared on the interactive shell
1442 as used to prevent the 168 warning about local variable not being
1445 2009-07-31 Marek Safar <marek.safar@gmail.com>
1447 * parameter.cs, dynamic.cs, support.cs, class.cs, delegate.cs,
1448 attribute.cs: Emit dynamic export attribute.
1450 2009-07-30 Marek Safar <marek.safar@gmail.com>
1452 * expression.cs: More verifier work.
1454 2009-07-29 Marek Safar <marek.safar@gmail.com>
1456 * nullable.cs: Fixed SRE crash during corlib compilation.
1458 2009-07-29 Marek Safar <marek.safar@gmail.com>
1460 * generic.cs, typemanager.cs, decl.cs, iterators.cs, convert.cs,
1461 nullable.cs, expression.cs, ecore.cs, class.cs, attribute.cs:
1462 More TypeManager.TypeToCoreType needed.
1464 2009-07-29 Marek Safar <marek.safar@gmail.com>
1466 * anonymous.cs: Update after recent SRE fixes.
1468 2009-07-28 Marek Safar <marek.safar@gmail.com>
1470 * typemanager.cs, expression.cs, ecore.cs, delegate.cs: Use correct
1471 version of GetFieldHandle for fields of generic types.
1473 2009-07-27 Marek Safar <marek.safar@gmail.com>
1475 * typemanager.cs, argument.cs, convert.cs, assign.cs, expression.cs,
1476 ecore.cs: Add TypeManager.IsDynamicType,
1477 PredefinedAttributes.Dynamic.
1479 2009-07-27 Marek Safar <marek.safar@gmail.com>
1481 A fix for bug #415375
1482 * expression.cs: Fixed object and reference type parameter
1485 2009-07-27 Marek Safar <marek.safar@gmail.com>
1487 A fix for bug #525342
1488 * class.cs: Attach partial method attributes to method
1491 2009-07-24 Marek Safar <marek.safar@gmail.com>
1493 * argument.cs, dynamic.cs, expression.cs, class.cs, attribute.cs:
1496 2009-07-24 Marek Safar <marek.safar@gmail.com>
1498 * anonymous.cs (MutateField): Add imported types handling.
1500 2009-07-23 Marek Safar <marek.safar@gmail.com>
1502 * expression.cs, delegate.cs: Moved arguments resolve into their
1503 counterparts expressions. Removed argument resolve from
1504 CollectionElementInitializer.
1506 2009-07-23 Marek Safar <marek.safar@gmail.com>
1508 A fix for bug #523683
1509 * convert.cs, delegate.cs: Use common overload mechanism for method
1510 group conversion check.
1512 2009-07-22 Marek Safar <marek.safar@gmail.com>
1514 A fix for bug #523899
1515 * generics.cs: Exact type inference with other bound types.
1517 2009-07-22 Raja R Harinath <harinath@hurrynot.org>
1519 Don't complain when the same type is implemented by the output
1520 assembly as well as multiple referenced assemblies
1521 * namespace.cs (RootNamespace.LookupTypeReflection): Add
1522 'must_be_unique' flag.
1523 (GlobalRootNamespace): Update to changes.
1524 (Namespace.LookupType): Pass 'must_be_unique' only when we don't
1525 already have a type in hand.
1527 2009-07-22 Marek Safar <marek.safar@gmail.com>
1529 * expression.cs: More verifier instrumentation.
1531 * statement.cs: Do proper throw expression conversion.
1533 2009-07-22 Marek Safar <marek.safar@gmail.com>
1535 A fix for bug #522789
1536 * expression.cs: Mutate invocation return type.
1538 2009-07-16 Marek Safar <marek.safar@gmail.com>
1540 * anonymous.cs: Split assignable and readonly generated variable
1543 2009-07-16 Marek Safar <marek.safar@gmail.com>
1545 A fix for bug #521671
1546 * statement.cs: Fixed crash when checking missing type.
1548 2009-07-16 Marek Safar <marek.safar@gmail.com>
1550 * typemanager.cs, generic.cs, argument.cs, linq.cs, convert.cs,
1551 assign.cs, expression.cs, statement.cs, support.cs, ecore.cs,
1552 class.cs, driver.cs: Work on dynamic binding.
1554 * dynamic.cs: New file.
1556 * *.sources, *.proj: Updated.
1558 2009-07-15 Marek Safar <marek.safar@gmail.com>
1560 * expression.cs (Conditional): Avoid double Resolve.
1562 2009-07-13 Marcus Griep <marcus@griep.us>
1564 * ecore.cs: Fix obscure bug with resolving members of interfaces
1565 that hide parent interface members. Fixes bug #444388 and corrects
1568 2009-07-13 Marek Safar <marek.safar@gmail.com>
1570 * expression.cs (LocalVariableReference): Bounce resolve.
1572 2009-07-10 Marek Safar <marek.safar@gmail.com>
1574 * typemanager.cs, lambda.cs, parameter.cs, convert.cs, anonymous.cs,
1575 expression.cs, literal.cs, ecore.cs, complete.cs: Moved internal
1578 * support.cs: New dynamic type wrapper.
1580 2009-07-08 Marek Safar <marek.safar@gmail.com>
1582 * ecore.cs, cs-parser.jay: Better error reporting for implicitly
1583 typed local variable.
1585 2009-07-06 Marek Safar <marek.safar@gmail.com>
1587 A fix for bug #519005
1588 * anonymous.cs: Use null_type as no return type placeholder.
1590 2009-07-02 Marek Safar <marek.safar@gmail.com>
1592 * generic.cs: Handle type inference of identical type parameters
1593 with different bounds.
1595 2009-07-01 Marek Safar <marek.safar@gmail.com>
1597 * expression.cs, class.cs: Events variance.
1599 * cs-parser.jay: Interface events error messages.
1601 2009-07-01 Marek Safar <marek.safar@gmail.com>
1603 * generic.cs, argument.cs: Updated type inference logic to C# 4.0.
1605 2009-06-29 Marek Safar <marek.safar@gmail.com>
1607 * parameter.cs, convert.cs, expression.cs, class.cs: Default
1608 parameter expression can be value-type New.
1610 * cs-parser.jay: Clean up too many parameter modifier boolean flags.
1612 2009-06-26 Marek Safar <marek.safar@gmail.com>
1614 * generic.cs, argument.cs, expression.cs, ecore.cs, cs-parser.jay:
1615 Implemented C# 4.0 named arguments.
1617 2009-06-24 Marek Safar <marek.safar@gmail.com>
1619 * typemanager.cs, parameter.cs, iterators.cs, convert.cs,
1620 expression.cs, ecore.cs, delegate.cs: Removed unnecessary ArgList
1621 parameter modifier. Also fixes bug #515497.
1623 2009-06-24 Marek Safar <marek.safar@gmail.com>
1625 * *.cs: Replaced ArrayList with Arguments in need of a nonsequential
1626 arguments expression to be implemented.
1628 *.sources: Add argument.cs
1630 2009-06-23 Marek Safar <marek.safar@gmail.com>
1632 * parameter.cs: Moved GetParameterIndexByName to base class.
1634 * expression.cs, statement.cs, ecore.cs, delegate.cs: Removed
1635 unused AType. Use argument's version of GetExpressionTree.
1637 2009-06-22 Marek Safar <marek.safar@gmail.com>
1639 * expression.cs, cs-parser.jay, attribute.cs, codegen.cs: Named
1642 2009-06-17 Marek Safar <marek.safar@gmail.com>
1644 A fix for bug #514096
1645 * class.cs: Allow IntPtr/UIntPtr fields to be volatile.
1647 2009-06-17 Marek Safar <marek.safar@gmail.com>
1649 * expression.cs: The first multi-dimensional array nested array
1650 initializers was not checked.
1652 * statement.cs (Switch): Fixed error message to reflect 2.0 changes.
1654 2009-06-17 Marek Safar <marek.safar@gmail.com>
1656 A fix for bug #513400
1657 * nullable.cs (EmitEquality): Operands emit could be simplified for
1658 built-in types when we now emit user operators differently.
1660 2009-06-16 Marek Safar <marek.safar@gmail.com>
1662 * ecore.cs: Report inaccessible delegate methods correctly.
1664 2009-06-16 Marek Safar <marek.safar@gmail.com>
1666 * parameter.cs, expression.cs, ecore.cs, class.cs, delegate.cs,
1667 cs-parser.jay: Implemented C# 4.0 optional parameters.
1669 2009-06-16 Marek Safar <marek.safar@gmail.com>
1671 * driver.cs: Removed broken DefineManifestResource.
1673 2009-06-16 Raja R Harinath <harinath@hurrynot.org>
1675 * Makefile [net_2_0_bootstrap]: Don't explicitly mention net_1_1.
1676 Use $(BOOTSTRAP_PROFILE) instead.
1678 2009-06-12 Jb Evain <jbevain@novell.com>
1680 * rootcontext.cs: add a Platform field.
1681 * driver.cs: handle /platform.
1682 * codegen.cs: pass the proper flags according to
1683 the platform when saving the assembly.
1685 2009-06-11 Marek Safar <marek.safar@gmail.com>
1687 * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
1688 Add optional parameters grammar.
1690 2009-06-10 Marek Safar <marek.safar@gmail.com>
1692 * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
1693 driver.cs: Split lang version and metadata version.
1695 2009-06-10 Marek Safar <marek.safar@gmail.com>
1697 * decl.cs: Better overload ctor collision error message.
1699 2009-06-05 Jb Evain <jbevain@novell.com>
1701 * driver.cs (EmbededResource): avoid using an internal method
1702 in gmcs to embed manifest resources.
1704 2009-06-04 Sebastien Pouliot <sebastien@ximian.com>
1706 * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
1707 the compiler from older mono versions (like moon's bots)
1709 2009-06-04 Marek Safar <marek.safar@gmail.com>
1711 * namespace.cs (LookupTypeReflection): Ignore collisions between
1714 2009-06-04 Marek Safar <marek.safar@gmail.com>
1716 * codegen.cs: Enabled generic type forwarders.
1718 2009-06-04 Marek Safar <marek.safar@gmail.com>
1720 * dmcs.*: Add another version of SRE compiler.
1722 2009-06-03 Marek Safar <marek.safar@gmail.com>
1724 * generic.cs, typemanager.cs, parameter.cs, convert.cs,
1725 generic-mcs.cs: Fixed variant type conversions.
1727 2009-06-02 Marek Safar <marek.safar@gmail.com>
1729 A fix for bug #507863
1730 * codegen.cs: Fixes a crash on invalid string value attribute.
1732 2009-06-01 Marek Safar <marek.safar@gmail.com>
1734 A fix for bug #508334
1735 * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
1736 cs-parser.jay: Fully import __arglist modifier.
1738 2009-05-29 Marek Safar <marek.safar@gmail.com>
1740 * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
1741 delegate.cs, generic-mcs.cs: Rewrote type variance checks to
1742 actually work with closed generic types.
1744 2009-05-27 Alan McGovern <amcgovern@novell.com>
1746 * class.cs, decl.cs, delegate.cs, parameter.cs:
1747 Fix the build by replacing the use of 'var' with the actual type.
1749 2009-05-27 Marek Safar <marek.safar@gmail.com>
1751 * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
1752 cs-parser.jay, generic-mcs.cs: Report wrong variant types
1755 * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
1758 2009-05-26 Rodrigo Kumpera <rkumpera@novell.com>
1759 Marek Safar <marek.safar@gmail.com>
1761 A fix for bug #377509
1762 * parameter.cs: Use predefined and not empty name for implicit
1765 2009-05-21 Marek Safar <marek.safar@gmail.com>
1767 * class.cs: Don't report wrong warnings for event fields.
1769 2009-05-21 Marek Safar <marek.safar@gmail.com>
1771 A fix for bug #504667
1772 * class.cs: Check for static class using parent container instead of
1775 2009-05-08 Marek Safar <marek.safar@gmail.com>
1777 A fix for bug #496922
1778 * expression.cs: Always use temporary variable when using object
1781 2009-04-28 Marek Safar <marek.safar@gmail.com>
1783 A fix for bug #495112
1784 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
1787 2009-04-27 Miguel de Icaza <miguel@novell.com>
1789 * driver.cs: Add a flag to work as a replacement for CSC in VS.
1791 2009-04-24 Miguel de Icaza <miguel@novell.com>
1793 * complete.cs: No idea how gonzalo got a null in the list, but
1796 2009-04-24 Miguel de Icaza <miguel@novell.com>
1798 * complete.cs (CompletionElementInitializer): New completion class
1799 to support completing inside a C# 3 element initializer, so this
1800 allows completion for Silverlight situations where it is very
1803 new TextBlock () { Fo<TAB>
1805 (CompletionSimpleName): Expose the prefix that was
1806 passed to the simple name.
1808 * cs-parser.jay (object_or_collection_initializer): Add support
1809 for element_initializers.
1811 * expression.cs (CollectionOrObjectInitializers.DoResolve):
1812 special case completion expressions as this method aggressively
1813 collects data before it operates, and errors were being thrown
1814 earlier than we were able to complete.
1816 2009-04-23 Miguel de Icaza <miguel@novell.com>
1818 * eval.cs: Make getcompletions silent and enable debugging output
1819 if the -v option is passed.
1821 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
1822 Consider looking up the namespace that matches the prefix being
1825 This is part of the support for allowing completions like:
1826 `System.Co<TAB>' to complete to System.Console.
1828 * complete.cs (CompletionSimpleName.AppendResults): Make this
1831 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
1833 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
1834 COMPLETE_COMPLETION as internal.
1836 2009-04-17 Miguel de Icaza <miguel@novell.com>
1838 * complete.cs: Include namespace resolution in simple names as
1839 well as global types and types in the using scope in the
1842 * namespace.cs: Supporting infrastrcture to provide completions
1843 based on the current using scope.
1845 * eval.cs: Introduce an entry point that allows for initialization
1846 to return a list of the files passed on the command line.
1848 2009-04-14 Marek Safar <marek.safar@gmail.com>
1850 A fix for bug #494243
1851 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
1853 2009-04-13 Marek Safar <marek.safar@gmail.com>
1855 A fix for bug #493887
1856 * statement.cs: Don't skip string multi-section with default or
1857 null label when populating string hashtable.
1859 2009-04-06 Marek Safar <marek.safar@gmail.com>
1861 A fix for bug #492329
1862 * expression.cs (New): Load variable when assigning type parameter
1865 2009-04-06 Marek Safar <marek.safar@gmail.com>
1867 A fix for bug #488960
1868 * decl.cs: Compare MVAR types using non-null values.
1870 2009-03-27 Marek Safar <marek.safar@gmail.com>
1872 * typemanager.cs, expression.cs: Removed unused nullable checks.
1874 2009-03-27 Marek Safar <marek.safar@gmail.com>
1876 * *.cs: Removed some gmcs conditionals.
1878 2009-03-26 Marek Safar <marek.safar@gmail.com>
1880 * generic.cs, support.cs: Moved generics stuff out of support.cs
1882 2009-03-24 Marek Safar <marek.safar@gmail.com>
1884 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
1887 2009-03-23 Marek Safar <marek.safar@gmail.com>
1889 * attribute.cs: Consider all members for error reporting when
1890 checking named arguments.
1892 2009-03-23 Marek Safar <marek.safar@gmail.com>
1894 A fix for bug #487625
1895 * namespace.cs: Use a warning for all predefined type conflicts.
1897 2009-03-23 Marek Safar <marek.safar@gmail.com>
1899 A fix for bug #485706
1900 * statement.cs: Explicitly type catch type argument to pass verifier
1903 2009-03-22 Miguel de Icaza <miguel@novell.com>
1905 Initial support to provide code completion facilities to consumers
1906 of the evaluator API.
1908 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
1909 support the completion engine. When we reach the end of the
1910 input stream instead of returning EOF, when this flag is true the
1911 tokenizer instead produces:
1913 One GENERATE_COMPLETION token: this token then must be
1914 handled in the grammar at every point where the user
1915 would likely request a completion.
1917 As many COMPLETE_COMPLETION tokens as necessary. These
1918 tokens are generated to assist the parser in unwinding and
1919 producing a valid parse tree.
1921 The parser rules do not have to be perfect, the parser needs to be
1922 augmented with judicious use of GENERATE_COMPLETION tokens to
1923 improve the areas where we can provide completion and the parser
1924 needs to add support for COMPLETE_COMPLETION tokens in productions
1927 It is common to not have enough support for COMPLETE_COMPLETION
1928 under certain rules and that even if we generated the
1929 GENERATE_COMPLETION token that the resulting tree will be invalid
1930 due to the missing rules that support COMPLETE_COMPLETION.
1932 The final EOF token is produced by having the parser notify the
1933 tokenizer when it reaches the root production that the next token
1936 * support.cs (CompletionResult): New Exception. This exception
1937 is thrown to return the completion results when one of the special
1938 completion expressions is reached.
1940 This exception is thrown by the completing ExpressionStatements
1941 classes that live in complete.cs
1943 * complete.cs (CompletingExpression): a new base class for
1944 completing expressions. This derives from the
1945 ExpressionStatement class and not from Expression as it allows
1946 completion to happen not only where expressions are expected in
1947 the grammar, but also where statements are expected.
1949 (CompletionSimpleName): A new class used to provide completions
1950 for SimpleNames. This currently only resolves to local
1951 variables from the evaluator context (GetVars call).
1953 (CompletionMemberAccess): Implements support for completing member
1956 * cs-parser.jay: Add support for completion in a few places.
1958 * eval.cs (GetCompletions): New public API for the evaluator that
1959 returns a list of possible completions given the input. The
1960 return value is an array of completions
1962 * anonymous.cs (Compatible): If the exception thrown from the
1963 resolved expression is a CompletionResult exception let that one
1964 through instead of printing a diagnostic error in the try/catch.
1966 2009-03-22 Miguel de Icaza <miguel@novell.com>
1970 * driver.cs (Main): Use Environment.Exit to quit quickly and
1971 prevent the compiler from doing the usual wait for helper thread
1974 This is to prevent a slowdown that was reported by Gonzalo on
1977 2009-03-19 Marek Safar <marek.safar@gmail.com>
1979 * ecore.cs: Load build-in types directly instead of accessing
1982 2009-03-18 Marek Safar <marek.safar@gmail.com>
1984 * ecore.cs: Always use unbox.any when available.
1986 2009-03-18 Marek Safar <marek.safar@gmail.com>
1988 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
1990 2009-03-17 Marek Safar <marek.safar@gmail.com>
1992 * generic.cs: Removed obsolete version of type inference.
1994 2009-03-16 Marek Safar <marek.safar@gmail.com>
1996 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
1997 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
1998 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
1999 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
2001 2009-03-11 Marek Safar <marek.safar@gmail.com>
2003 A fix for bug #482996
2004 * anonymous.cs: Make sure we are not infering return type when
2005 checking type compatibility.
2007 2009-03-11 Marek Safar <marek.safar@gmail.com>
2009 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
2010 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
2011 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
2012 attributes in their own structure. Needed when accessing their
2013 properties before they are resolved.
2015 2009-03-09 Marek Safar <marek.safar@gmail.com>
2017 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
2018 hashtable (~10x faster).
2020 * driver.cs: Removed wrong Reset.
2022 2009-03-08 Marek Safar <marek.safar@gmail.com>
2024 * class.cs: Use correct common base type for unmanaged delayed
2027 * rootcontext.cs: Wrap unhandled exception.
2029 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
2031 Make SeekableStreamReader self-tuning and arbitrarily seekable
2032 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
2034 (SeekableStreamReader.Position.set): Use it. Simplify logic
2035 which, as a side-effect, makes it arbitrarily-seekable. Tune the
2036 buffer size when the stream needs to be re-read from the beginning.
2038 2009-03-05 Marek Safar <marek.safar@gmail.com>
2040 A fix for bug #480100
2041 * parameter.cs: A parameter is not hoisted when used directly as ET.
2043 2009-03-04 Marek Safar <marek.safar@gmail.com>
2045 * statement.cs: Fixed an issue when using variable is of interface
2048 2009-03-03 Marek Safar <marek.safar@gmail.com>
2050 A fix for bug #480319
2051 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
2053 2009-03-03 Marek Safar <marek.safar@gmail.com>
2055 A fix for bug #480867
2056 * typemanager.cs, expression.cs, ecore.cs: Changed method group
2057 expression to have no valid type.
2059 2009-03-03 Marek Safar <marek.safar@gmail.com>
2061 A fix for bug #481258
2062 * class.cs: Set extension method flag in partial container.
2064 2009-03-03 Marek Safar <marek.safar@gmail.com>
2066 * statement.cs, typemanager.cs: Use expression for StringEmitter.
2068 * attribute.cs: Add sanity check.
2070 2009-02-27 Marek Safar <marek.safar@gmail.com>
2072 * class.cs: Add external constructor error.
2074 2009-02-26 Marek Safar <marek.safar@gmail.com>
2076 A fix for bug #475354
2077 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
2078 correctly user defined nullable equality operators.
2080 2009-02-25 Marek Safar <marek.safar@gmail.com>
2082 A fix for bug #479532
2083 * expression.cs: Implement NewInitialize::AddressOf.
2085 2009-02-25 Marek Safar <marek.safar@gmail.com>
2087 A fix for bug #413633
2088 * expression.cs: Iterate all base class-constraint types.
2090 2009-02-24 Marek Safar <marek.safar@gmail.com>
2092 A fix for bug #479209
2093 * literal.cs: Mutate null underlying type.
2095 2009-02-24 Marek Safar <marek.safar@gmail.com>
2097 A fix for bug #476295
2098 * convert.cs: Avoid wrapping implicitly convertible reference type.
2100 2009-02-23 Marek Safar <marek.safar@gmail.com>
2102 * iterators.cs: Create MemberName correctly.
2104 2009-02-23 Marek Safar <marek.safar@gmail.com>
2106 A fix for bug #478655
2107 * literal.cs: Check also underlying null type conversion.
2109 2009-02-21 Marek Safar <marek.safar@gmail.com>
2111 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
2113 2009-02-20 Marek Safar <marek.safar@gmail.com>
2115 A fix for bug #477447
2116 * statement.cs: Add reference to correct parent storey when this
2117 is accessible from deep children storey (more than 1 level).
2119 2009-02-19 Marek Safar <marek.safar@gmail.com>
2121 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
2122 * class.cs: Define base type members before setting up member cache.
2124 2009-02-18 Marek Safar <marek.safar@gmail.com>
2126 A fix for bug #477378
2127 * nullable.cs, expression.cs, statement.cs: More precise null type
2130 2009-02-18 Marek Safar <marek.safar@gmail.com>
2132 A fix for bug #472805
2133 * typemanager.cs, namespace.cs: Import only visible extension method
2136 2009-02-18 Marek Safar <marek.safar@gmail.com>
2138 A fix for bug #476895
2139 * attribute.cs: Use correct resolve context for attribute type.
2141 2009-02-18 Marek Safar <marek.safar@gmail.com>
2143 A fix for bug #476266
2144 * anonymous.cs: Mutate multi-dimensional arrays.
2146 2009-02-18 Marek Safar <marek.safar@gmail.com>
2148 A fix for bug #476400
2149 * statement.cs, expression.cs: Removed wrong Dispose optimization.
2151 2009-02-18 Marek Safar <marek.safar@gmail.com>
2153 A fix for bug #476811
2154 * generics.cs: Fixed null-literal check.
2156 2009-02-17 Marek Safar <marek.safar@gmail.com>
2158 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
2159 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
2160 messing with static variables.
2162 2009-02-16 Marek Safar <marek.safar@gmail.com>
2164 A fix for bug #475965
2165 * generics.cs: Check generic parameter type after extracting from
2168 2009-02-16 Marek Safar <marek.safar@gmail.com>
2170 A fix for bug #475823
2171 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
2174 2009-02-14 Marek Safar <marek.safar@gmail.com>
2176 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
2177 Simplified event field definition using backing field and not
2178 field builder directly.
2180 * expression.cs (EmitLdArg): Optimize fast paths.
2182 2009-02-13 Marek Safar <marek.safar@gmail.com>
2184 A fix for bug #475327
2185 * expression.cs (ArrayCreation): Don't mutate values optimized away.
2187 2009-02-13 Marek Safar <marek.safar@gmail.com>
2189 A fix for bug #475342
2190 * cs-parser.jay: Using 'super' instead of 'base' to call base
2191 constructor crashes compiler.
2193 2009-02-13 Marek Safar <marek.safar@gmail.com>
2195 A fix for bug #475354
2196 * expression.cs (Constantify): Add nullable types.
2198 * const.cs (EmitDecimalConstant): Avoid explicit cast.
2200 2009-02-12 Marek Safar <marek.safar@gmail.com>
2202 A fix for bug #475246
2203 * expression.cs: More broken flowanalysis hacking needed.
2205 2009-02-12 Marek Safar <marek.safar@gmail.com>
2207 * attribute.cs: Compare only ref/out array modifiers.
2209 2009-02-11 Marek Safar <marek.safar@gmail.com>
2211 * statement.cs: Use member cache when looking for foreach members.
2213 2009-02-11 Marek Safar <marek.safar@gmail.com>
2215 * expression.cs: Don't expose internal initializer types.
2217 * statement.cs: Check also explicit conversions for goto case.
2219 2009-02-11 Marek Safar <marek.safar@gmail.com>
2221 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
2223 2009-02-10 Marek Safar <marek.safar@gmail.com>
2225 * *.cs: Replace null-type with NullLiteral where appropriate.
2227 2009-02-09 Marek Safar <marek.safar@gmail.com>
2229 * expression.cs: Initializer of reference argument use temporary
2230 variable to be verifiable.
2232 * parameter.cs: Share EmitLdArg.
2234 2009-02-09 Marek Safar <marek.safar@gmail.com>
2236 A fix for bug #473559
2237 * class.cs: Fixed: Not reporting error about nested class with the
2240 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
2242 Contributed under the MIT/X11 license.
2244 * generic.cs: Added VerifyVariantTypeParameters which performs new
2245 variance verification logic. The old logic, based on the spec, was
2246 wrong because the spec is full of LIES!
2248 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
2250 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
2253 * ecore.cs: Added calls to the new variance verification logic.
2256 * delegate.cs: Removed calls to the old variance verification logic.
2258 2009-02-06 Marek Safar <marek.safar@gmail.com>
2260 * delegate.cs: Use cached Invoke method directly.
2262 2009-02-06 Marek Safar <marek.safar@gmail.com>
2264 * expression.cs: Emit expression tree for hoisted variable access.
2266 2009-02-04 Marek Safar <marek.safar@gmail.com>
2268 * namespace.cs: Add better extension class check.
2270 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
2272 * generic.cs: Fixed typeo (TypeParameter.Variacne).
2274 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
2276 This patch adds initial generic variance support to the compiler.
2277 It is contributed under the MIT/X11 license.
2279 * typemanager.cs: Modified ImplementsInterface to check variance.
2280 Added VerifyVariantTypeParameters which checks the specified type to see
2281 if it uses a variant type parameter as a type argument (which is not
2282 allowed). Added IsVariantOf which determins if the first type is a
2283 variant of the second. NOTE: This only supports reference types at
2284 the moment to conform with the current level of VM support. When the
2285 VM supports value types, this will follow step.
2287 * generic.cs: Added the Variance enum. Added a Variance property to
2288 TypeParameter and added variance support to definition phase. Added a
2289 Variance property to TypeParameterName. Also check to make sure that
2290 no variant types appear in generic method parameters.
2292 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
2293 keywords if the langversion supports it.
2295 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
2296 that variant types are only used in legal positions. Also added
2297 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
2300 * decl.cs: Construct TypeParameter with the variance information.
2302 * convert.cs: Checks variance in ImplicitReferenceConversionExists
2303 and ImplicitConversionStandard.
2305 * rootcontext.cs: Added new "Future" language version.
2307 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
2308 type parameters are not used as type arguments in interface inheritance.
2309 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
2310 parameters are not used as method return types. In MemberBase.
2311 ResolveMemberType, ensure that variant type parameters are not used
2312 as type arguments. Also call VerifyNoVariantTypeParameters on every
2313 set of parameters which are resolved.
2315 * delegate.cs: Modified Delegate.Define to ensure that variant
2316 parameters are not used as type arguments and that a contravariant
2317 parameter is not used as the return type. Also call
2318 VerifyNoVariantTypeParameters on the delegate parameters.
2320 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
2321 to specify generic variance.
2323 * driver.cs: Added support for LanguageVersion.Future in the form of
2324 "-langversion:future".
2326 * generic-mcs.cs: Stubbed out new members in generic.cs.
2328 2009-02-03 Marek Safar <marek.safar@gmail.com>
2330 * class.cs, generic.cs: Emit type parameter constraints for nested
2333 2009-02-02 Marek Safar <marek.safar@gmail.com>
2335 A fix for bug #471213
2336 * class.cs: Avoid emitting backing field for abstract event fields.
2338 2009-02-01 Marek Safar <marek.safar@gmail.com>
2340 A fix for bug #359731
2341 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
2344 2009-01-30 Marek Safar <marek.safar@gmail.com>
2346 A fix for bug #470767
2347 * statement.cs: Introduced BlockScopeExpression, needed when
2348 expression tree conversion has to emit scope variables.
2350 2009-01-29 Marek Safar <marek.safar@gmail.com>
2352 * class.cs: Remove duplicate CallingConvention.
2354 2009-01-29 Marek Safar <marek.safar@gmail.com>
2356 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
2357 when I finally found the right naming convention.
2359 2009-01-29 Marek Safar <marek.safar@gmail.com>
2361 * cs-tokenizer.cs: Put back different open parens optimization.
2363 2009-01-28 Marek Safar <marek.safar@gmail.com>
2365 A fix for bug #470227
2366 * cs-tokenizer.cs: Remove too agressive parser optimization.
2368 2009-01-28 Marek Safar <marek.safar@gmail.com>
2370 A fix for bug #324319
2371 * class.cs: Remove too early base type resolve.
2373 2009-01-27 Marek Safar <marek.safar@gmail.com>
2375 A fix for bug #324319
2376 * ecore.cs: Explicitly type null when assigning to type argument to
2377 make pass verifier check.
2379 2009-01-27 Marek Safar <marek.safar@gmail.com>
2381 * anonymous.cs: Fixed recent regression when initializing captured
2384 2009-01-26 Marek Safar <marek.safar@gmail.com>
2386 A fix for bug #469019
2387 * anonymous.cs: Use all parent type parameters when instantiating
2388 nested generic storey.
2390 2009-01-26 Marek Safar <marek.safar@gmail.com>
2392 * expression.cs: Check for null instance methodgroup expression.
2394 2009-01-26 Marek Safar <marek.safar@gmail.com>
2396 A fix for bug #469244
2397 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
2398 instance inside a conditional expression.
2400 2009-01-23 Marek Safar <marek.safar@gmail.com>
2402 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
2403 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
2404 GetElementType and HasElementType. IsValueType clean up.
2406 2009-01-23 Marek Safar <marek.safar@gmail.com>
2408 * nullable.cs: Use common EmitCall.
2410 * expression.cs: Emit constraint. for virtual calls only.
2412 2009-01-23 Marek Safar <marek.safar@gmail.com>
2414 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
2415 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
2416 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
2419 2009-01-22 Jb Evain <jbevain@novell.com>
2421 * anonymous.cs: make anonymous types' ToString implementation
2422 match what csc outputs.
2424 2009-01-21 Marek Safar <marek.safar@gmail.com>
2426 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
2429 2009-01-17 Marek Safar <marek.safar@gmail.com>
2431 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
2434 2009-01-16 Marek Safar <marek.safar@gmail.com>
2436 * nullable.cs (LiftedBinaryOperator): Check for all possible null
2439 2009-01-15 Marek Safar <marek.safar@gmail.com>
2441 A fix for bug #466634
2442 * statement.cs: Add reference for nested storey when only this
2445 2009-01-15 Marek Safar <marek.safar@gmail.com>
2447 A fix for bug #466474
2448 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
2451 2009-01-15 Marek Safar <marek.safar@gmail.com>
2453 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
2454 Fixed nested stories parent referencing process. Also fixes #463985.
2456 2009-01-06 Marek Safar <marek.safar@gmail.com>
2458 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
2459 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
2460 implementation. Also fixes #463108.
2462 2009-01-05 Marek Safar <marek.safar@gmail.com>
2464 A fix for bug #416109
2465 * decl.cs: Issue correct CLSAttribute warning location.
2467 2009-01-05 Marek Safar <marek.safar@gmail.com>
2469 A fix for bug #456775
2470 * attribute.cs: Use attribute owner scope when resolving attribute
2473 2009-01-05 Marek Safar <marek.safar@gmail.com>
2475 A fix for bug #457257
2476 * decl.cs: Fixed incorrect member declaring type comparison.
2478 2009-01-05 Marek Safar <marek.safar@gmail.com>
2480 A fix for bug #460896
2481 * driver.cs: Handle /RES resources as embeddable.
2483 2009-01-05 Marek Safar <marek.safar@gmail.com>
2485 A fix for bug #462515
2486 * ecore.cs: Report inacessible members upwards.
2488 2009-01-05 Marek Safar <marek.safar@gmail.com>
2490 A fix for bug #463190, #463192
2491 * decl.cs, namespace.cs: Also import internal extension classes.
2493 2009-01-04 Marek Safar <marek.safar@gmail.com>
2495 A fix for bug #463415
2496 * generic.cs: Use right index for RemoveDependentTypes.
2498 2009-01-02 Marek Safar <marek.safar@gmail.com>
2500 A fix for bug #463196
2501 * expression.cs: Fixed enum to null comparison.
2503 2009-01-02 Marek Safar <marek.safar@gmail.com>
2505 A fix for bug #463121
2506 * nullable.cs: Fixed nullable user equality operator comparison.
2508 2009-01-02 Marek Safar <marek.safar@gmail.com>
2510 A fix for bug #462950
2511 * class.cs, decl.cs: Use full explicit name when defining automatic
2512 property backing field.
2514 2009-01-02 Marek Safar <marek.safar@gmail.com>
2516 A fix for bug #462592
2517 * pending.cs: Emit type arguments for generic proxy method.
2519 2008-12-30 Marek Safar <marek.safar@gmail.com>
2521 * expression.cs (As): Mutate all type arguments.
2523 2008-12-29 Marek Safar <marek.safar@gmail.com>
2525 A fix for bug #462622
2526 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
2529 2008-12-29 Marek Safar <marek.safar@gmail.com>
2531 A fix for bug #450782
2532 * ecore.cs: Consider more variables of form V.I to be fixed.
2534 2008-12-29 Marek Safar <marek.safar@gmail.com>
2536 A fix for bug #460712
2537 * typemanager.cs: Core types could be imported.
2539 2008-12-28 Marek Safar <marek.safar@gmail.com>
2541 A fix for bugs #460847, #460772, #458049, #457339, #447807
2542 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
2543 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
2544 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
2545 user lambdas used inside query clauses.
2547 2008-12-18 Marek Safar <marek.safar@gmail.com>
2549 A fix for bug #460229
2550 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
2552 2008-12-18 Marek Safar <marek.safar@gmail.com>
2554 A fix for bug #459952
2555 * decl.cs, namespace.cs: Use common CheckAccessLevel.
2557 2008-12-18 Marek Safar <marek.safar@gmail.com>
2559 A fix for bug #459630
2560 * convert.cs: Enum to valuetype conversion is not allowed.
2562 2008-12-18 Marek Safar <marek.safar@gmail.com>
2564 A fix for bug #457087
2565 * generic.cs: Don't crash when constraint comes from type
2568 2008-12-16 Marek Safar <marek.safar@gmail.com>
2570 A fix for bug #459221
2571 * anonymous.cs, statement.cs: Delay only captured this
2574 2008-12-12 Marek Safar <marek.safar@gmail.com>
2576 A fix for bug #457489
2577 * anonymous.cs, statement.cs: Split anonymous storey instantiation
2578 and initialization to capture scope initializers correctly.
2580 2008-12-11 Marek Safar <marek.safar@gmail.com>
2582 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
2583 ParameterReference refactoring.
2585 2008-12-03 Marek Safar <marek.safar@gmail.com>
2587 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
2588 to be imported from any assembly.
2590 2008-12-03 Marek Safar <marek.safar@gmail.com>
2592 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
2593 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
2594 from anonymous method and lambda expression.
2596 2008-12-01 Marek Safar <marek.safar@gmail.com>
2598 A fix for bug #448560
2599 * expression.cs (As): Box any generic type arguments to be
2602 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2604 Add tripwire for implicit conversion bugs
2605 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
2607 (MethodGroupExpr.OverloadResolve): Add sanity check between
2608 IsApplicable and VerifyArgumentsCompat.
2609 (VerifyArgumentsCompat): Report CS1501 where appropriate.
2611 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2613 Fix build break in System.Data_test
2614 * convert.cs (ImplicitConversionExists): Move NullLiteral
2616 (ImplicitStandardConversionExists): ... here.
2618 2008-11-28 Marek Safar <marek.safar@gmail.com>
2620 * literal.cs: Emit correctly explicit null to nullable cast.
2622 2008-11-28 Marek Safar <marek.safar@gmail.com>
2624 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
2627 2008-11-28 Marek Safar <marek.safar@gmail.com>
2629 A fix for bug #449005
2630 * convert.cs, nullable.cs: Use only one implicit nullable
2633 2008-11-27 Marek Safar <marek.safar@gmail.com>
2635 * convert.cs, literal.cs: More Convert cleanup is needed.
2637 2008-11-27 Marek Safar <marek.safar@gmail.com>
2639 * decl.cs, class.cs: Fixed misleading error message.
2641 2008-11-26 Marek Safar <marek.safar@gmail.com>
2643 A fix for bug #449005
2644 * nullable.cs (EmitEquality): Disable optimization for user operator
2647 2008-11-25 Marek Safar <marek.safar@gmail.com>
2649 A fix for bug #447027
2650 * anonymous.cs (HoistedVariable): Cache also outer access to deal
2651 with context variables stored as expression instances.
2653 2008-11-25 Marek Safar <marek.safar@gmail.com>
2655 A fix for bug #447027
2656 * delegate.cs: Fixed delegate VerifyMethod logic.
2658 2008-11-24 Marek Safar <marek.safar@gmail.com>
2660 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
2663 2008-11-21 Marek Safar <marek.safar@gmail.com>
2665 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
2666 member type resolve to follow normal flow, instead of random
2669 2008-11-21 Marek Safar <marek.safar@gmail.com>
2671 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
2674 2008-11-21 Marek Safar <marek.safar@gmail.com>
2676 * const.cs: Emit decimal array constant as literal.
2678 2008-11-20 Marek Safar <marek.safar@gmail.com>
2680 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
2682 2008-11-19 Marek Safar <marek.safar@gmail.com>
2684 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
2685 into real property (saves 8 MB for corlib compilation).
2687 2008-11-19 Marek Safar <marek.safar@gmail.com>
2689 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
2690 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
2691 generic-mcs.cs: Small cleanup of TypeArguments.
2693 2008-11-18 Marek Safar <marek.safar@gmail.com>
2695 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
2696 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
2697 of ConstructedType expression, renamed to GenericTypeExpr.
2699 2008-11-17 Marek Safar <marek.safar@gmail.com>
2701 A fix for bug #445303
2702 * location.cs (IsConditionalDefined): Handle undefined global
2705 2008-11-17 Marek Safar <marek.safar@gmail.com>
2707 A fix for bug #444678
2708 * expression.cs (TryReduceConstant): Always create new constant
2711 2008-11-17 Marek Safar <marek.safar@gmail.com>
2713 A fix for bug #444673
2714 * ecore.cs: Ignore open generic types when used as generic type
2717 2008-11-17 Marek Safar <marek.safar@gmail.com>
2719 A fix for bug #445458
2720 * expression.cs, cs-parser.jay: Don't crash when an expression
2723 2008-11-17 Marek Safar <marek.safar@gmail.com>
2725 A fix for bug #445464
2726 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
2727 inside unbound type.
2729 2008-11-14 Jb Evain <jbevain@novell.com>
2731 * driver.cs: ignore empty -nowarn argument such as
2732 the one in -nowarn:12,13,,.
2734 2008-11-13 Marek Safar <marek.safar@gmail.com>
2736 A fix for bug #444271
2737 * anonymous.cs: Rescan parent storeys when best candidate was
2740 2008-11-13 Marek Safar <marek.safar@gmail.com>
2742 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
2743 useless UnboundTypeExpression.
2745 * attribute.cs: Do check obsolete attribute on generic types.
2747 2008-11-12 Marek Safar <marek.safar@gmail.com>
2749 A fix for bugs #425680, #400139
2750 * ecore.cs, expression.cs: Trying to do some almost_matched_members
2753 2008-11-11 Marek Safar <marek.safar@gmail.com>
2755 A fix for bug #435747
2756 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
2757 compound value types assignment. Few micro optimizations added.
2759 2008-11-10 Marek Safar <marek.safar@gmail.com>
2761 A fix for bug #442610
2762 * anonymous.cs (MutateConstructor): More SRE hacking.
2764 2008-11-10 Marek Safar <marek.safar@gmail.com>
2766 A fix for bug #442579
2767 * ecore.cs: Also initialize expanded form of a method with 1 params
2770 2008-11-06 Marek Safar <marek.safar@gmail.com>
2772 * expression.cs (UnaryMutator): Do early l-side check.
2774 2008-11-05 Miguel de Icaza <miguel@novell.com>
2776 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
2777 Init, otherwise we would crash later on when checking for friend
2780 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
2781 Otherwise we never get any meaningful information as to what
2784 2008-11-05 Marek Safar <marek.safar@gmail.com>
2786 A fix for bug #436318
2787 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
2789 2008-11-05 Miguel de Icaza <miguel@novell.com>
2791 * namespace.cs: Turns out that it was a really bad idea to hide
2792 the errors for namespaces not found here in eval mode.
2794 * eval.cs: When we process using clauses, only enter those into
2795 the list of valid using clauses after they have been validated.
2797 The above change gives the proper semantics: it does not
2798 senselessly report the same errors with broken using statements by
2799 never storing them in the first place when they are invalid.
2801 2008-11-05 Marek Safar <marek.safar@gmail.com>
2803 A fix for bug #421839
2804 * cs-parser.jay: Remove expression from coalesce rule to force lower
2805 priority than the assignment operator.
2807 2008-11-05 Marek Safar <marek.safar@gmail.com>
2809 A fix for bug #437875
2810 * nullable.cs: Compile correctly method group operand used with null
2811 coalescing operator.
2813 2008-11-04 Marek Safar <marek.safar@gmail.com>
2815 A fix for bug #434589
2816 * expression.cs (Binary): Ignore lifted conversions when at least
2817 one operand is of reference type.
2819 2008-11-04 Marek Safar <marek.safar@gmail.com>
2821 * cs-parser.jay: Better syntax error report.
2823 2008-11-03 Marek Safar <marek.safar@gmail.com>
2825 A fix for bug #436792
2826 * cs-parser.jay: Use GetLocation to access location.
2828 2008-11-03 Marek Safar <marek.safar@gmail.com>
2830 A fix for bug #440774
2831 * cs-parser.jay: Also set current_array_type when parsing local
2834 2008-11-03 Marek Safar <marek.safar@gmail.com>
2836 A fix for bug #440785
2837 * expression.cs (As): Don't resolve self modifing expression
2840 2008-11-03 Marek Safar <marek.safar@gmail.com>
2842 A fix for bug #439447
2843 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
2845 2008-11-03 Marek Safar <marek.safar@gmail.com>
2847 A fix for bug #437571
2848 * cs-parser.jay: Fixes internal error for invalid expression
2851 2008-10-17 Marek Safar <marek.safar@gmail.com>
2853 * ecore.cs: Resolve correctly ambiguous params delegate methods.
2855 2008-10-17 Marek Safar <marek.safar@gmail.com>
2857 * generic.cs, anonymous.cs: Simplified GetDeclarations.
2859 2008-10-17 Marek Safar <marek.safar@gmail.com>
2861 * cs-tokenizer.cs: More precise cast parsing.
2863 2008-10-16 Martin Baulig <martin@ximian.com>
2865 * anonymous.cs (AnonymousMethodStorey): Put back the
2866 `hoisted_locals' hashtable and use it in EmitType().
2868 2008-10-15 Marek Safar <marek.safar@gmail.com>
2870 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
2871 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
2874 2008-10-14 Marek Safar <marek.safar@gmail.com>
2876 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
2878 2008-10-14 Marek Safar <marek.safar@gmail.com>
2880 * statement.cs: Mutate scope initializers.
2882 2008-10-14 Marek Safar <marek.safar@gmail.com>
2884 * expression.cs: Use typeless value for This constant.
2886 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
2888 2008-10-14 Marek Safar <marek.safar@gmail.com>
2890 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
2893 2008-10-13 Marek Safar <marek.safar@gmail.com>
2895 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
2898 2008-10-13 Marek Safar <marek.safar@gmail.com>
2900 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
2901 parser and tokenizer. Fixes many ambiguities including #433258.
2903 2008-10-10 Marek Safar <marek.safar@gmail.com>
2905 * cs-parser.jay: Fixed missing accessor recovery.
2907 2008-10-10 Marek Safar <marek.safar@gmail.com>
2909 A fix for bug #433701
2910 * expression.cs: Better error message.
2912 2008-10-10 Marek Safar <marek.safar@gmail.com>
2914 * cs-parser.jay, expression.cs: Start reporting real parser errors.
2916 * Makefile: Disabled unused debug symbols.
2918 Also fixes: #320556, #321097, #321656, #321876, #351316
2920 2008-10-09 Miguel de Icaza <miguel@novell.com>
2922 * eval.cs: rename "<interactive>" to "{interactive}", to work
2923 around a requirement in the compiler that this be a valid
2924 filename, and in Windows it is not (433886).
2926 2008-10-09 Marek Safar <marek.safar@gmail.com>
2928 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
2930 2008-10-08 Marek Safar <marek.safar@gmail.com>
2932 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
2933 cs-parser.jay: Generic type declaration and type arguments cleanup.
2935 2008-10-05 Marek Safar <marek.safar@gmail.com>
2937 * cs-parser.jay: Allow parsing weird array creation construct.
2939 2008-10-05 Marek Safar <marek.safar@gmail.com>
2941 * cs-parser.jay: Conflicts reduction.
2943 2008-10-04 Marek Safar <marek.safar@gmail.com>
2945 * cs-parser.jay: Conflicts reduction.
2947 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
2950 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
2951 property. Add a 'count' hint about the use of the shared vector.
2952 Ensure that we don't leak out dirty bits.
2953 (UsageVector.MergeChild): Throw away information about variables
2955 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
2957 2008-10-03 Marek Safar <marek.safar@gmail.com>
2959 A fix for bug #431746
2960 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
2961 parameters when iterator is created.
2963 2008-10-03 Marek Safar <marek.safar@gmail.com>
2965 A fix for bug #431827
2966 * expression.cs: Fixed right based pointer arithmetic operations
2969 2008-10-03 Marek Safar <marek.safar@gmail.com>
2971 A fix for bug #353779
2972 * assign.cs, expression.cs: Fixed compound assignment conversions.
2974 2008-10-02 Marek Safar <marek.safar@gmail.com>
2976 A fix for bug #375262
2977 * statement.cs: Refactor ArrayForeach to be usable with string
2978 indexer. Optimized single dimentional arrays foreach.
2980 2008-10-02 Marek Safar <marek.safar@gmail.com>
2982 A fix for bug #431255
2983 * anonymous.cs, expression.cs: Removed broken optimization.
2985 2008-10-01 Marek Safar <marek.safar@gmail.com>
2987 * anonymous.cs: Use full type parameters of parent generic
2988 containers. Removed unnecessary AddParentStoreyReference call.
2990 2008-10-01 Marek Safar <marek.safar@gmail.com>
2992 A fix for bug #324702
2993 * class.cs: Use better shorter names for explicit interface member
2996 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
2998 2008-10-01 Marek Safar <marek.safar@gmail.com>
3000 * expression.cs: Use new interface to check fixed expression.
3002 2008-10-01 Marek Safar <marek.safar@gmail.com>
3004 A fix for bug #421101
3005 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
3006 interface to check for fixed fixed-buffers.
3008 2008-10-01 Marek Safar <marek.safar@gmail.com>
3010 A fix for bug #429264
3011 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
3013 * delegate.cs: Removed unnecessary casts.
3015 2008-09-30 Marek Safar <marek.safar@gmail.com>
3017 A fix for bug #352151
3018 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
3019 class.cs: Fixed already defined explicit interface members check.
3021 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
3023 cs-tokenizer.cs: Fix typo.
3025 2008-09-28 Miguel de Icaza <miguel@novell.com>
3027 * eval.cs (InteractiveBase): The quit command now just sets a
3028 flag, instead of calling Environment.Exit(), it is milder on
3031 CompiledMethod is now in Mono.CSharp, not nested inside
3032 the Evaluator, it was inconvenient to use.
3034 2008-09-27 Miguel de Icaza <miguel@novell.com>
3036 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
3037 code to be invoked without having to reparse.
3039 2008-09-27 Miguel de Icaza <miguel@novell.com>
3041 * ecore.cs: The recent changes to FieldExpr broke this as well.
3042 Fixes LINQ queries in the interactive shell.
3044 * Multiple files: indentation fixing for the Mono coding
3045 guidelines for the switch statement.
3047 * eval.cs: Make the Evaluator API thread safe.
3049 2008-09-26 Marek Safar <marek.safar@gmail.com>
3051 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
3052 constructor parsing.
3054 2008-09-26 Marek Safar <marek.safar@gmail.com>
3056 A fix for bug #325326
3057 * statement.cs: Check possible mistaken empty statement using
3058 explicit blocks only.
3060 2008-09-25 Miguel de Icaza <miguel@novell.com>
3062 * eval.cs (LoadAssembly, ReferenceAssembly): Call
3063 RootNamespace.ComputeNamespaces to update the internal list of
3064 namespaces, this is no longer done for us.
3066 (InteractiveBase): Use the Evaluator APIs instead of calling into
3069 2008-09-25 Marek Safar <marek.safar@gmail.com>
3071 A fix for bug #429264
3072 * expression.cs: Missing mutator for access to multidimensional
3075 2008-09-25 Marek Safar <marek.safar@gmail.com>
3077 * class.cs, statement: Emit DebuggerHidden attribute for iterator
3080 * driver.cs: Missing input argument check.
3082 2008-09-25 Marek Safar <marek.safar@gmail.com>
3084 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
3085 expression.cs, statement.cs, rootcontext.cs, class.cs,
3086 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
3089 2008-09-24 Miguel de Icaza <miguel@novell.com>
3091 * ecore.cs (FieldExpr): Only initialize eclass when we return a
3092 fully constructed FieldExpr, fixes the regression introduced in
3095 * ecore.cs, expression.cs: Plug back the eclass initialization as
3096 otherwise it regresses `csharp'.
3098 2008-09-24 Marek Safar <marek.safar@gmail.com>
3100 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
3101 ecore.cs, attribute.cs: Moved obsolete method checks from emit
3102 phase to resolve phase. It resolves problems with expression trees
3103 and fixes bugs #323796, #325156.
3105 2008-09-23 Marek Safar <marek.safar@gmail.com>
3107 * codegen.cs: Report better error when symbol writer is missing.
3109 2008-09-23 Marek Safar <marek.safar@gmail.com>
3111 * codegen.cs: Set .NET symbol writer.
3113 * decl.cs: Guard against null generic arguments.
3115 * report.cs: Don't report exactly same additional details.
3117 2008-09-22 Marek Safar <marek.safar@gmail.com>
3119 A fix for bug #324917
3120 * cs-parser.jay: Add missing multidimensional non-expression type
3123 2008-09-22 Marek Safar <marek.safar@gmail.com>
3125 A fix for bug #428191
3126 * anonymous.cs: Create an outer generic fields also for non-storey
3129 2008-09-22 Marek Safar <marek.safar@gmail.com>
3131 A fix for bug #378294
3132 * class.cs: Make fixed size buffers gmcs feature only.
3134 2008-09-22 Marek Safar <marek.safar@gmail.com>
3136 A fix for bug #355622, #324993
3137 * assign.cs, const.cs, class.cs: Create new EmitContext for each
3140 2008-09-19 Marek Safar <marek.safar@gmail.com>
3142 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
3145 2008-09-19 Marek Safar <marek.safar@gmail.com>
3147 A fix for bug #416110
3148 * generic.cs: Struct constraint results in default ctor and
3149 ValueType base type constraint to be set.
3151 2008-09-19 Marek Safar <marek.safar@gmail.com>
3153 A fix for bug #423791
3154 * generic.cs: Fixed params output type type-inference.
3156 2008-09-19 Marek Safar <marek.safar@gmail.com>
3158 * cs-parser.jay, expression.cs: Fixed few expression crashes.
3160 2008-09-19 Marek Safar <marek.safar@gmail.com>
3162 * cs-tokenizer.cs: Don't break on extra partial modifier.
3164 2008-09-19 Marek Safar <marek.safar@gmail.com>
3166 A fix for bug #427592
3167 * generic.cs: Use common parameter resolve method.
3169 2008-09-18 Marek Safar <marek.safar@gmail.com>
3171 A fix for bug #414758
3172 * expression.cs, ecore.cs: Fixed crash when accessing non-static
3175 2008-09-18 Marek Safar <marek.safar@gmail.com>
3177 * driver.cs, namespace.cs: Read types and namespaces after all
3178 requested assemblies are loaded, fixes issues with System.Core
3179 auto-reference, and #419888.
3181 2008-09-18 Marek Safar <marek.safar@gmail.com>
3183 A fix for bug #417705
3184 * cs-parser.jay: Fixed as/is operator expression split.
3186 2008-09-18 Marek Safar <marek.safar@gmail.com>
3188 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
3189 Fixed expression tree representation of empty new expression and
3190 new initializer expression.
3192 2008-09-18 Miguel de Icaza <miguel@novell.com>
3194 * eval.cs: Remove warning, keep reference to driver around.
3196 * Hide fields that do not need to be public.
3198 2008-09-17 Marek Safar <marek.safar@gmail.com>
3200 A fix for bug #426385
3201 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
3202 conversion for array elements.
3204 2008-09-17 Marek Safar <marek.safar@gmail.com>
3206 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
3207 void parsing conflicts.
3209 2008-09-15 Marek Safar <marek.safar@gmail.com>
3211 A fix for bug #425601
3212 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
3213 System.Core only when there is no custom ExtensionAttribute
3216 2008-09-15 Miguel de Icaza <miguel@novell.com>
3218 * namespace.cs: Do not report CS0246 (name
3220 2008-09-12 Marek Safar <marek.safar@gmail.com>
3222 A fix for bug #425669
3223 * generic.cs: Don't cache generic static anonymous method
3226 2008-09-12 Marek Safar <marek.safar@gmail.com>
3228 * generic.cs, class.cs, delegate.cs: Check recursive inherited
3229 conflicting constraints.
3231 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
3233 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
3236 2008-09-12 Marek Safar <marek.safar@gmail.com>
3238 * literal.cs, convert.cs, expression.cs, statement.cs: More null
3239 to null pointer conversion fixes.
3241 2008-09-11 Marek Safar <marek.safar@gmail.com>
3243 * cs-parser.jay, expression.cs: An implicitly typed local variable
3244 declarator cannot use an array initializer.
3246 2008-09-11 Marek Safar <marek.safar@gmail.com>
3248 * cs-parser.jay: Reduced number of printed tokens, add sorting.
3250 2008-09-11 Marek Safar <marek.safar@gmail.com>
3252 * generic.cs (InflatedConstraints): Don't crash when constraints
3255 * cs-parser.jay: const_declarator is a block.
3257 * constant.cs: Check for not allowed NaN conversions.
3259 2008-09-10 Miguel de Icaza <miguel@novell.com>
3261 * driver.cs: Drop --shell argument, the compiler is no longer a
3264 * eval.cs: Move most of the code that deals with evaluation into
3265 this file and document the public API from repl.cs
3267 * repl.cs: Remove from here.
3269 2008-09-10 Marek Safar <marek.safar@gmail.com>
3271 A fix for bug #424684
3272 * generic.cs: Generic class constraints must come first.
3274 2008-09-09 Miguel de Icaza <miguel@novell.com>
3276 * cs-parser.jay: Improve error reporting for syntax errors in
3277 statements and expressions, we now report the expected tokens
3278 instead of reporting the useless "; expected".
3280 Drop the strings from the token declaration, it turns out that
3281 they did not do what I thought they did. Instead they were adding
3282 two sets of tokens to the tables.
3284 2008-09-09 Marek Safar <marek.safar@gmail.com>
3286 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
3287 delegate.cs: Share special type check.
3289 2008-09-09 Marek Safar <marek.safar@gmail.com>
3291 A fix for bug #423981
3292 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
3294 2008-09-09 Marek Safar <marek.safar@gmail.com>
3296 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
3299 2008-09-09 Marek Safar <marek.safar@gmail.com>
3301 A fix for bugs: #324750, #335946
3302 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
3303 lookup rule to determine ?-based tokens.
3305 2008-09-08 Miguel de Icaza <miguel@novell.com>
3307 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
3308 expressions (like event adding or removing) end up here, so we
3309 need to treat those as statements.
3311 Add LoadAssembly method.
3313 2008-09-04 Miguel de Icaza <miguel@novell.com>
3315 * repl.cs: Add Time method.
3317 2008-09-05 Marek Safar <marek.safar@gmail.com>
3319 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
3321 2008-09-05 Miguel de Icaza <miguel@novell.com>
3323 * repl.cs: Add workaround for old compilers.
3325 2008-09-04 Jb Evain <jbevain@novell.com>
3327 * repl.cs (PrettyPrint): pretty print everything that
3328 implements IDictionary, as well as IEnumerables. Also,
3329 add a quit helper property.
3331 2008-09-04 Marek Safar <marek.safar@gmail.com>
3333 * constant.cs: Better error reporting for decimal literals.
3335 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
3338 2008-09-04 Marek Safar <marek.safar@gmail.com>
3339 Miguel de Icaza <miguel@novell.com>
3341 A fix for bug #422951
3342 * assign.cs (Assign.DoResolve): Perform the type conversions
3343 checks before we attempt to initialize `New' initializers.
3345 2008-09-04 Marek Safar <marek.safar@gmail.com>
3347 A fix for bug #422853
3348 * delegate.cs (DelegateCreation): Add special handling for
3349 EmptyExpression.Null instance expression which is just another
3350 hack for undecided member instance exression.
3352 2008-09-04 Marek Safar <marek.safar@gmail.com>
3354 * expression.cs, ecore.cs: Emit full expression tree for reduced
3357 2008-09-04 Marek Safar <marek.safar@gmail.com>
3359 * expression.cs (This): Guard against multi-resolving.
3361 * ecore.cs, statement.cs (Throw): Simplified.
3363 * flowanalysis.cs: Also verify event fields.
3365 2008-09-04 Miguel de Icaza <miguel@novell.com>
3367 * assign.cs (Assign.DoResolve): Perform the type conversions
3368 checks before we attempt to initialize `New' initializers.
3370 * repl.cs (PrettyPrint): Add Hashtable prettyprint
3372 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
3375 * repl.cs: Update help.
3377 2008-09-03 Miguel de Icaza <miguel@novell.com>
3379 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
3380 handling of the default config handling, including the special
3381 treatment of System.Core assembly.
3383 Fixes the REPL processing for LINQ.
3385 2008-09-03 Marek Safar <marek.safar@gmail.com>
3387 A fix for bug #422507
3388 * expression.cs (UnboxCast): Add missing child expression mutator.
3390 2008-09-03 Marek Safar <marek.safar@gmail.com>
3392 * driver.cs: Don't self reference System.Core assembly.
3394 2008-09-03 Marek Safar <marek.safar@gmail.com>
3396 A fix for bug #422507
3397 * expression.cs (StringConcat): Add missing type mutator.
3399 2008-09-03 Marek Safar <marek.safar@gmail.com>
3401 * generic.cs (TypeInferenceContext): Follow equality rule for
3402 constructed type lower bound type inference.
3404 2008-09-02 Miguel de Icaza <miguel@novell.com>
3406 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
3407 <dblank@cs.brynmawr.edu> which updates the cursor position on
3410 2008-09-02 Marek Safar <marek.safar@gmail.com>
3412 A fix for bug #367145
3413 * driver.cs: Fixed import of extension methods when using -noconfig
3416 2008-09-02 Marek Safar <marek.safar@gmail.com>
3418 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
3419 version from non-generic implementation instead.
3421 2008-09-01 Marek Safar <marek.safar@gmail.com>
3423 A fix for bug #418908
3424 * class.cs: Use AddScopeStatement for field initializers.
3426 2008-09-01 Marek Safar <marek.safar@gmail.com>
3428 A fix for bug #415385
3429 * ecore.cs, convert.cs: Do method group conversion for equal group types.
3431 2008-09-01 Marek Safar <marek.safar@gmail.com>
3433 A fix for bug #421736
3434 * iterators.cs: Don't crash on unreachable iterators.
3436 2008-09-01 Marek Safar <marek.safar@gmail.com>
3438 A fix for bug #421628
3439 * parameter.cs, attribute.cs: Clone also parameter attributes.
3441 2008-08-30 Miguel de Icaza <miguel@novell.com>
3443 * namespace.cs (LookupType): In EvalMode, try to replace
3444 the TypeBuilder from our cache with a Type as Reflection.Emit does
3445 not like to mix code from older assemblies emitted and new
3448 This sounds like a serious Mono bug that prevents multiple
3449 assemblies to be generated and consumed at the same time.
3451 * cs-parser.jay (push_current_class): Do not make interactive
3452 classes internal or private, make them public as we currently
3453 generate each new class in a new assembly.
3455 2008-08-29 Miguel de Icaza <miguel@novell.com>
3457 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
3458 remove types that are entered into the global namespace during
3459 parsing so that we can remove them on failure.
3461 * cs-parser.jay: Parsing: we now keep track of types that are
3462 entered into global variables and queue those in case the parsing
3465 This happens in a few situations: during partial-input, we invoke
3466 the parser repeatedly for example with the string "class X", this
3467 would cause X to be registed, and we need to remove this
3468 registration so that another parse attempt later with say "class X {"
3469 would actually work.
3471 Additionally, if there is an error in the resolution phase, for
3472 example: "class X : NonExistant {}" th
3474 * cs-parser.jay: Be more precise with the errors being raised,
3475 instead of flagging all exceptions during parsing to be attributed
3476 to the parsing process, distinguish those from errors happening in
3477 the actions and hint that using -v would produce the actual
3480 * repl.cs: Do not load all compiler references on each reset,
3481 doing the partial reset takes care of this.
3483 2008-08-28 Miguel de Icaza <miguel@novell.com>
3485 * repl.cs: Add support for loading all the files from
3486 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
3489 Introduce a micro-parser that is able to deambiguate on its input
3490 whether we are dealing with a compilation unit (namespace, class,
3491 interface, struct, delegate) declaration or a statement. This
3492 allows both declarations and statements to be entered.
3494 Set history size by default to 300 lines.
3496 Instead of distinguishing based on the parser.InteractiveResult,
3497 have only two cases: statements were parsed, or a compilation unit
3498 was. Always pull the Using statement additions from the
3499 compilation unit parse.
3501 * cs-tokenizer.cs: Rename tokens to better describe their intent
3502 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
3504 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
3505 EvalMode is used to trigger the lookup of global variables while
3506 StatementMode is used turn variable declarations into static
3509 * getline.cs: Allow history size to be set.
3511 2008-08-29 Marek Safar <marek.safar@gmail.com>
3513 A fix for bug #360755
3514 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
3516 2008-08-29 Marek Safar <marek.safar@gmail.com>
3518 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
3520 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
3521 member name, it is too confusing
3523 * decl.cs, class.cs: Don't report unused fields with attached attribute.
3525 * rootcontext.cs: Finally default to warning level 4.
3527 2008-08-28 Marek Safar <marek.safar@gmail.com>
3529 * class.cs (CheckBase): Ignore overloaded operators.
3531 2008-08-28 Marek Safar <marek.safar@gmail.com>
3533 A fix for bug #420830
3534 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
3536 2008-08-28 Marek Safar <marek.safar@gmail.com>
3538 A fix for bug #420832
3539 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
3541 2008-08-28 Marek Safar <marek.safar@gmail.com>
3543 A fix for bug #420386
3544 * nullables.cs: Fixed logic of nullable user comparison operators involving
3547 2008-08-28 Marek Safar <marek.safar@gmail.com>
3549 * attribute (IsClsCompliant): Use FALSE value for pointer types.
3551 2008-08-27 Miguel de Icaza <miguel@novell.com>
3553 * repl.cs: Add support for aborting the running code with C-c.
3555 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
3557 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
3559 2008-08-27 Miguel de Icaza <miguel@novell.com>
3561 * cs-parser.jay (interactive_statement_list): A new set of rules
3562 for hosting statements that uses the "interactive_" prefix.
3564 * repl.cs: Add support for parsing `using' as a statement or as a
3565 directive. Deambiguating before passing this to the parser.
3567 We need to distinguish statement_expressions that occur at the
3568 toplevel vs those that occur embedded into expressions.
3570 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
3571 that fixes the cursor key handling, and a history bug.
3573 2008-08-26 Miguel de Icaza <miguel@novell.com>
3575 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
3576 limitations in Console, instead the 2.0 bootstrap libraries now
3577 include the Console bits.
3579 Also, remove the use of Nullables from getline.cs
3583 Interactive support for the C# compiler. Use gmcs --shell to
3584 enter a read-eval-print loop shell.
3586 Docs: http://www.mono-project.com/CsharpRepl
3588 * sources: include repl.cs here and getline.cs for gmcs.exe,
3589 everything else is getline.cs impaired.
3591 * Makefile: when bootstrapping pass a special flag
3592 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
3593 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
3594 This distinguishes those two cases.
3596 * repl.cs: Support for a read-eval-print loop. Will be soon
3597 refactored into eval support and then REPL on top of it.
3599 * ecore.cs: If a simplename lookup fails, before erroring out,
3600 if we are in EvalMode to resolve the name to a declaration in the
3603 This means that variable declarations that happened in previous
3604 classes (as repl puts every statement in a separate class) are
3605 made visible in this way.
3607 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
3608 triggered an error due to the end of file being reached. This is
3609 used to do multi-line input, and notify the caller that the user
3610 needs to provide more text before a successful parse.
3612 Add new grammar rules after the INTERACTIVE_PARSER token is seen
3613 to drive the evaluation with a custom wrapper.
3615 * driver.cs: Add support for --shell, and refactor some code to be
3618 * namespace.cs: Add support for serializing the contents of the
3619 namespaces and reloading them.
3621 * getline.cs: A managed implementation of ReadLine under
3622 X11/Apache2 license terms. Easy to embed in other applications as
3625 * namespace.cs: Add some functions to save and restore the
3628 * rootcontext.cs: New public field.
3630 * cs-tokenizer.cs: Add support for one of the possible characters
3631 we introduce into the token stream.
3633 This patch does not affect the regular tokenization process, the
3634 only performance hit would happen if there is an invalid character
3635 on the input string.
3637 * support.cs: Move isatty helper routine here.
3639 * codegen.cs: Small cleanup, and add a mechanism to initialize the
3640 code generator for in-memory assemblies.
3642 2008-08-26 Marek Safar <marek.safar@gmail.com>
3644 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
3645 parameter cannot be always used as a type.
3647 2008-08-21 Marek Safar <marek.safar@gmail.com>
3649 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
3651 2008-08-21 Marek Safar <marek.safar@gmail.com>
3653 * convert.cs: Implement explicit array to IList<T> conversion.
3655 2008-08-20 Marek Safar <marek.safar@gmail.com>
3657 A fix for bug #362740
3658 * cs-tokenizer.cs: Handle UTF-16 surrogates.
3660 2008-08-20 Marek Safar <marek.safar@gmail.com>
3662 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
3663 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
3664 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
3665 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
3666 handling to use just one type of infrastructure and deal with generics
3669 2008-07-23 Martin Baulig <martin@ximian.com>
3671 *** Merged this from trunk revision 108527 ***
3674 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
3675 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
3678 2008-08-15 Marek Safar <marek.safar@gmail.com>
3680 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
3683 2008-08-15 Marek Safar <marek.safar@gmail.com>
3685 * delegate.cs: Fixed compiler crash when creating delegate using partial
3688 * typemanager.cs: MulticastDelegate is not a delegate.
3690 2008-08-14 Marek Safar <marek.safar@gmail.com>
3692 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
3695 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
3697 * cs-parser.jay (type): Allow 'var' in mcs too.
3698 (local_variable_type): Likewise.
3700 2008-08-14 Marek Safar <marek.safar@gmail.com>
3702 * driver.cs: Removed broken -noconfig variants.
3704 2008-08-14 Marek Safar <marek.safar@gmail.com>
3706 A fix for bug #417078
3707 * expression.cs: Emit correctly left side pointer operators.
3709 2008-08-13 Marek Safar <marek.safar@gmail.com>
3711 * generic.cs, lambda.cs: Inflate method generic arguments only.
3713 2008-08-12 Marek Safar <marek.safar@gmail.com>
3715 * class.cs: Fixed struct layout check regression.
3717 2008-08-12 Marek Safar <marek.safar@gmail.com>
3719 * cs-parser.jay, enum.cs: Simplified enum parsing.
3721 * decl.cs: Check all type parameters conflicts.
3723 * expression.cs, statement.cs, attribute.cs: More expression checks.
3725 2008-08-11 Marek Safar <marek.safar@gmail.com>
3727 * generic.cs: Add type inference types restriction.
3729 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
3730 anonymous.cs, expression.cs: Allocate less accessor parameters.
3732 2008-08-08 Marek Safar <marek.safar@gmail.com>
3734 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
3737 2008-08-08 Marek Safar <marek.safar@gmail.com>
3739 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
3741 2008-08-07 Marek Safar <marek.safar@gmail.com>
3743 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
3744 Also fixes #362146 and #381592.
3746 2008-08-07 Marek Safar <marek.safar@gmail.com>
3748 * ecore.cs: Reduced constant cannot be used as an attribute value.
3750 * cs-parser.jay: Base expression has to be a type.
3752 * expression.cs (Conditional): Uses ReducedExpression.
3754 2008-08-06 Marek Safar <marek.safar@gmail.com>
3756 A fix for bug #376826
3757 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
3758 address of hoisted local variable or parameter cannot be taken.
3760 2008-08-05 Marek Safar <marek.safar@gmail.com>
3762 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
3763 anonymous method inside checked/unchecked expression.
3765 2008-08-05 Marek Safar <marek.safar@gmail.com>
3767 * typemanager.cs (IsEqual): Guard against null.
3769 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
3770 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
3771 routine. Fixed few misleading conversion errors.
3773 2008-08-04 Marek Safar <marek.safar@gmail.com>
3775 * class.cs: Consider generics when checking cycles in struct layout.
3777 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
3779 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
3781 2008-08-04 Marek Safar <marek.safar@gmail.com>
3783 A fix for bug #414165
3784 * anonymous.cs: Use same anonymous implementation method for all anonymous
3787 2008-08-04 Marek Safar <marek.safar@gmail.com>
3789 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
3792 2008-08-04 Marek Safar <marek.safar@gmail.com>
3794 * cs-parser.jay: Typeof argument has to be a type expression.
3796 * namespace.cs: Check alias and namespace definitions collisions.
3798 * class.cs, pending.cs: Moved explicit interface accessor implementation
3801 * delegate.cs, expression.cs: Verify special name invocations.
3803 2008-08-01 Marek Safar <marek.safar@gmail.com>
3805 * cs-parser.jay: Don't choke on empty generic type arguments.
3807 * cs-tokenizer.cs: Handle escaped preprocessor directives.
3809 * expression.cs, ecore.cs: Minor expressions bugs.
3811 2008-08-01 Marek Safar <marek.safar@gmail.com>
3813 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
3814 and added more error handling.
3816 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
3818 * modifiers.cs, enum.cs: Fixed.
3820 2008-07-31 Jb Evain <jbevain@novell.com>
3822 * driver.cs: remove -pkg ability of smcs.
3824 2008-07-30 Marek Safar <marek.safar@gmail.com>
3826 * statement.cs (Switch): Correctly set empty default target for single
3829 2008-07-30 Marek Safar <marek.safar@gmail.com>
3831 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
3832 string switch statement implementation to use string dictionary which
3833 significantly (2-8x) improves performance of generated code.
3835 2008-07-29 Marek Safar <marek.safar@gmail.com>
3837 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
3838 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
3840 2008-07-29 Marek Safar <marek.safar@gmail.com>
3842 A fix for bug #412595
3843 * typemanager.cs, convert.cs, expression.cs: Some types are never
3844 convertible to each other.
3846 2008-07-29 Marek Safar <marek.safar@gmail.com>
3848 * nullable.cs (CreateNullConstant): An error messages update.
3850 2008-07-29 Marek Safar <marek.safar@gmail.com>
3852 A fix for bug #412595
3853 * cfold.cs: Don't cast undefined bool constant.
3855 2008-07-29 Martin Baulig <martin@ximian.com>
3858 (SymbolWriter.Reset): New public static method.
3861 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
3863 2008-07-28 Marek Safar <marek.safar@gmail.com>
3865 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
3867 * expression.cs (ElementAccess): Exact size allocation.
3869 2008-07-26 Marek Safar <marek.safar@gmail.com>
3871 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
3873 2008-07-25 Marek Safar <marek.safar@gmail.com>
3875 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
3877 * class.cs: Removed $PRIVATE$ field hack which caused problems during
3880 2008-07-25 Marek Safar <marek.safar@gmail.com>
3882 A fix for bug #412217
3883 * assign.cs: Mutate also assignment type.
3885 2008-07-25 Marek Safar <marek.safar@gmail.com>
3887 A fix for bug #323644
3888 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
3891 2008-07-25 Marek Safar <marek.safar@gmail.com>
3893 A fix for bug #412134
3894 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
3895 non-enumerable operands when overloading equality or bitwise operators.
3897 2008-07-25 Marek Safar <marek.safar@gmail.com>
3899 * anonymous.cs: Cache closed generic anonymous method delegates.
3901 2008-07-24 Marek Safar <marek.safar@gmail.com>
3903 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
3904 anonymous.cs, statement.cs: Always emit anonymous method as static method
3905 when is instance free. Use nesting for nested anynomous methods blocks.
3907 2008-07-23 Marek Safar <marek.safar@gmail.com>
3909 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
3912 2008-07-23 Marek Safar <marek.safar@gmail.com>
3914 * expression.cs: Removed MakeSimpleCall.
3916 2008-07-23 Marek Safar <marek.safar@gmail.com>
3918 A fix for bug #323012
3919 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
3920 Base method implementing interface has to be public.
3922 2008-07-23 Marek Safar <marek.safar@gmail.com>
3924 * cs-parser.jay: Don't break on missing argument.
3926 2008-07-22 Marek Safar <marek.safar@gmail.com>
3928 A fix for bug #320993
3929 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
3930 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
3932 2008-07-22 Marek Safar <marek.safar@gmail.com>
3934 A fix for bug #320748
3935 * convert.cs: Implicit user operators cannot convert to interfaces
3937 2008-07-22 Marek Safar <marek.safar@gmail.com>
3939 A fix for bug #312686
3940 * driver.cs: Ignore empty assembly references.
3942 2008-07-22 Marek Safar <marek.safar@gmail.com>
3944 A fix for bug #387040
3945 * ecore.cs: Skip constrains check for an explicit implementation.
3947 2008-07-21 Marek Safar <marek.safar@gmail.com>
3949 A fix for bug #409045
3950 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
3951 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
3952 identifiers are file specific unless passed as input arguments.
3954 2008-07-21 Marek Safar <marek.safar@gmail.com>
3956 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
3957 to emit UnmanagedMarshal data under 2.0 profile.
3959 2008-07-21 Marek Safar <marek.safar@gmail.com>
3961 A fix for bug #410369
3962 * parameter.cs: Clone correctly ParamsParameter.
3964 2008-07-21 Marek Safar <marek.safar@gmail.com>
3966 * expression.cs (Argument): Always report type for type based expressions
3969 2008-07-18 Marek Safar <marek.safar@gmail.com>
3971 A fix for bug #410666
3972 * anonymous.cs: Correctly initialize generic storey reference.
3974 2008-07-18 Marek Safar <marek.safar@gmail.com>
3976 * convert.cs: Don't box same type arguments.
3978 2008-07-18 Marek Safar <marek.safar@gmail.com>
3980 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
3981 Finished missing generic type mutators.
3983 2008-07-18 Marek Safar <marek.safar@gmail.com>
3985 * iterators.cs, statement.cs: Finished statements CloneTo.
3987 2008-07-18 Marek Safar <marek.safar@gmail.com>
3989 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
3991 * expression.cs: Emit optimized default value expressions in expression tree
3994 2008-07-18 Marek Safar <marek.safar@gmail.com>
3996 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
3998 2008-07-17 Marek Safar <marek.safar@gmail.com>
4000 A fix for bug #367536
4001 * cs-parser.jay: Check static constructor of generic types for an access
4004 2008-07-17 Marek Safar <marek.safar@gmail.com>
4006 A fix for bug #353800
4007 * lambda.cs: Emit ret for contextual statements.
4009 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
4010 up emitting redundant ret for all anonymous methods with return.
4012 2008-07-17 Marek Safar <marek.safar@gmail.com>
4014 A fix for bug #365188
4015 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
4016 create anonymous method storey in unreachable block.
4018 2008-07-17 Marek Safar <marek.safar@gmail.com>
4020 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
4021 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
4022 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
4023 statement.cs: Fixed relevant defects found by Gendarme.
4025 2008-07-17 Marek Safar <marek.safar@gmail.com>
4027 A fix for bug #325291
4028 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
4029 statement.cs: Replaced IAnonymousHost with top level block flag.
4031 2008-07-17 Marek Safar <marek.safar@gmail.com>
4033 * cs-parser.jay: Clean up unused open_parens.
4035 2008-07-17 Marek Safar <marek.safar@gmail.com>
4037 * ecore.cs: Custom error message for a range variable assignment.
4039 2008-07-16 Marek Safar <marek.safar@gmail.com>
4041 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
4044 2008-07-16 Marek Safar <marek.safar@gmail.com>
4046 * literal.cs: Null literal is of object type.
4048 2008-07-16 Marek Safar <marek.safar@gmail.com>
4050 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
4051 expression of nullable equality comparison.
4053 2008-07-15 Marek Safar <marek.safar@gmail.com>
4055 * expression.cs(PointerArithmetic): Removed redundant assignment.
4057 2008-07-15 Marek Safar <marek.safar@gmail.com>
4059 * decl.cs (GetSignatureForError): Report full namespace name for containers.
4061 2008-07-14 Marek Safar <marek.safar@gmail.com>
4063 A fix for bug #408361
4064 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
4065 they are replaced by GetMethod.
4067 2008-07-14 Marek Safar <marek.safar@gmail.com>
4069 A fix for bug #408721 by jeremie.laval@gmail.com
4070 * expression.cs (Indirection): Implemented CloneTo.
4072 2008-07-14 Marek Safar <marek.safar@gmail.com>
4074 * statement.cs (AssignableSlots): Temporary disabled variable initialization
4077 2008-07-14 Marek Safar <marek.safar@gmail.com>
4079 * report.cs (EnableReporting): Don't reinitialize 0-based values.
4081 2008-07-11 Marek Safar <marek.safar@gmail.com>
4083 * linq.cs: Reset tranparent parameter counter in probing mode.
4085 2008-07-11 Marek Safar <marek.safar@gmail.com>
4087 * anonymous.cs: Mutate anonymous method type.
4089 2008-07-11 Marek Safar <marek.safar@gmail.com>
4091 * ecore.cs, anonymous.cs: Mutate field expressions.
4093 2008-07-10 Marek Safar <marek.safar@gmail.com>
4095 A fix for bug #369670
4096 * linq.cs, statement.cs: Use explicit block for query expressions variables.
4098 2008-07-10 Marek Safar <marek.safar@gmail.com>
4100 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
4102 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
4105 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
4106 only one '>', and finds a '>>', abort the generic lookahead.
4108 2008-07-10 Marek Safar <marek.safar@gmail.com>
4110 A fix for bug #319902
4111 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
4113 2008-07-10 Marek Safar <marek.safar@gmail.com>
4115 A fix for bug #406371
4116 * statement.cs: Moved EmitSymbolInfo to Block.
4118 2008-07-09 Marek Safar <marek.safar@gmail.com>
4120 * ecore.cs: Report better error for extension method overload failures.
4122 2008-07-09 Marek Safar <marek.safar@gmail.com>
4124 * expression.cs (Is): No need to box reference values.
4126 2008-07-09 Marek Safar <marek.safar@gmail.com>
4128 * class.cs: Use event resolve context when initializing CreateEmitContext.
4130 2008-07-09 Marek Safar <marek.safar@gmail.com>
4132 A fix for bug #394436
4133 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
4134 method used inside expression trees. Added more LINQ to expression tree
4137 2008-07-08 Marek Safar <marek.safar@gmail.com>
4139 A fix for bug #378189, #370577
4140 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
4143 2008-07-08 Marek Safar <marek.safar@gmail.com>
4145 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
4148 2008-07-08 Marek Safar <marek.safar@gmail.com>
4150 A fix for bug #406702
4151 * anonymous.cs: Always park anonymous method in the nearest parent storey.
4153 2008-07-07 Marek Safar <marek.safar@gmail.com>
4155 A fix for bug #406648
4156 * cs-parser.jay: Report nullable use in mcs for some cases.
4158 2008-07-07 Marek Safar <marek.safar@gmail.com>
4160 * ecore.cs: Improved argument mismatch error messages.
4162 2008-07-07 Marek Safar <marek.safar@gmail.com>
4164 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
4166 2008-07-07 Marek Safar <marek.safar@gmail.com>
4168 * expression.cs (TypeOf): Mutate type argument.
4170 2008-07-04 Marek Safar <marek.safar@gmail.com>
4172 * class.cs: Report missing partial modifier for correct type.
4174 2008-07-04 Marek Safar <marek.safar@gmail.com>
4176 * ecore.cs, expression.cs (VariableReference): Variable property is
4179 2008-07-04 Marek Safar <marek.safar@gmail.com>
4181 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
4183 2008-07-04 Marek Safar <marek.safar@gmail.com>
4185 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
4188 2008-07-04 Marek Safar <marek.safar@gmail.com>
4190 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
4191 anonymous method storey to an instance method when only "this" is hoisted.
4193 2008-07-03 Marek Safar <marek.safar@gmail.com>
4195 A fix for bug #321615
4196 * expression.cs: Pointer comparisons use unsigned operator.
4198 2008-07-03 Marek Safar <marek.safar@gmail.com>
4200 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
4202 2008-07-02 Marek Safar <marek.safar@gmail.com>
4204 A fix for bug #404905
4205 * class.cs: Always initialize local unsafe variables.
4207 2008-06-30 Marek Safar <marek.safar@gmail.com>
4209 A fix for bug #396987
4210 * expression.cs (NewInitialize): Clear local temporary variable for next run
4212 2008-06-27 Marek Safar <marek.safar@gmail.com>
4214 A fix for bug #401020
4215 * ecore.cs: Both types and modifiers have to match for ref and out arguments
4217 2008-06-27 Marek Safar <marek.safar@gmail.com>
4219 A fix for bug #398319
4220 * cs-parser.jay: Implemented undocumented base access expression inside
4223 2008-06-26 Marek Safar <marek.safar@gmail.com>
4225 A fix for bug #404227
4226 * cs-parser.jay: Parse namespace declaration using qualified identifier.
4228 2008-06-26 Marek Safar <marek.safar@gmail.com>
4230 A fix for bug #404227
4231 * convert.cs: Fixed explicit array to interface cast.
4233 2008-06-26 Marek Safar <marek.safar@gmail.com>
4235 A fix for bug #403894
4236 * delegate.cs: Mutate DelegateInvocation type.
4238 2008-06-26 Marek Safar <marek.safar@gmail.com>
4240 A fix for bug #379348
4241 * delegate.cs: Box a load of generic parameters.
4243 2008-06-26 Marek Safar <marek.safar@gmail.com>
4245 * expression.cs: Add an array creation arguments mutate.
4247 2008-06-26 Marek Safar <marek.safar@gmail.com>
4249 A fix for bug #386068
4250 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
4253 2008-06-25 Marek Safar <marek.safar@gmail.com>
4255 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
4258 2008-06-25 Marek Safar <marek.safar@gmail.com>
4260 A fix for bug #403518
4261 * delegate.cs: Type correctly anonymous method new invocation.
4263 2008-06-24 Marek Safar <marek.safar@gmail.com>
4265 A fix for bug #394826
4266 * anonymous.cs: Fully qualify members when resolving anonymous type internal
4269 2008-06-24 Marek Safar <marek.safar@gmail.com>
4271 A fix for bug #394826
4272 * anonymous.cs, iterators.cs: Construct generic storey only when is really
4275 2008-06-24 Marek Safar <marek.safar@gmail.com>
4277 * class.cs: Clone indexer parameters for localized capturing.
4279 2008-06-24 Marek Safar <marek.safar@gmail.com>
4281 A fix for bug #402379
4282 * expression.cs: Don't crash when an object initializer resolve fails.
4284 2008-06-24 Marek Safar <marek.safar@gmail.com>
4286 A fix for bug #402888
4287 * expression.cs: Mutate conditional expression.
4289 2008-06-24 Marek Safar <marek.safar@gmail.com>
4291 A fix for bug #401012
4292 * class.cs: Keep StructLayout in shared container.
4294 2008-06-24 Marek Safar <marek.safar@gmail.com>
4296 A fix for bug #400438
4297 * decl.cs, class.cs: Only properties can be automatically implemented.
4299 2008-06-24 Marek Safar <marek.safar@gmail.com>
4301 * statement.cs (ChangeToIterator): Copy also labels.
4303 2008-06-23 Marek Safar <marek.safar@gmail.com>
4305 * ecore.cs: Pass type argument details to parent extension method.
4307 2008-06-23 Marek Safar <marek.safar@gmail.com>
4309 A fix for bug #375966
4310 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
4312 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
4314 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
4316 2008-06-22 Marek Safar <marek.safar@gmail.com>
4318 A fix for bug #394347
4319 * anonymous.cs: Cache compatible delegates as compatibility check produces
4320 a new method every time.
4322 2008-06-20 Marek Safar <marek.safar@gmail.com>
4324 * anonymous.cs: Propagate storey reference for single references.
4326 2008-06-20 Marek Safar <marek.safar@gmail.com>
4328 A fix for bug #387615
4329 * assign.cs, expression.cs: Correctly clone compound assignment.
4331 2008-06-19 Marek Safar <marek.safar@gmail.com>
4333 A fix for bug #359611, #359604
4334 * anonymous.cs: Mutate all types of hoisted parameters.
4336 2008-06-19 Marek Safar <marek.safar@gmail.com>
4338 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
4339 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
4340 expression.cs, codegen.cs, statement.cs
4342 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
4343 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
4345 ** Anonymous methods, lambda expressions rewrite **
4347 Anonymous expressions are now resolved when an explicit block is resolved
4348 and they don't require any registration procedure anymore. Further,
4349 anonymous methods are defined when explicit block is emitted which allows
4350 better control of whole process and opens possibilities for more
4351 optimizations as well as alternative to reverse whole process.
4353 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
4354 process consistent and to correctly emit hoisted generic methods when they
4355 have at least 1 hoisted variable.
4357 2008-06-17 Martin Baulig <martin@ximian.com>
4359 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
4361 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
4362 virtual property; check it in Emit().
4363 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
4365 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
4367 (Indexer.Define): Likewise.
4369 2008-06-17 Marek Safar <marek.safar@gmail.com>
4371 * convert.cs: Don't use IsInterface on type arguments.
4373 * delegate.cs: DelegateInvocation uses MethodInfo.
4375 * parameter.cs: Removed IsTypeParameter.
4377 * generic-mcs.cs: More missing stuff.
4379 2008-06-16 Martin Baulig <martin@ximian.com>
4382 (Modifiers.DEBUGGER_HIDDEN): New public const.
4385 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
4388 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
4389 (AbstractPropertyEventMethod): Likewise.
4390 (Constructor.Emit): Likewise.
4391 (SourceMethod.SetCompilerGenerated): Removed.
4393 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
4397 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
4398 if we're an `IteratorHost'.
4399 (AnonymousMethodMethod..ctor): Don't set
4400 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
4403 2008-06-16 Marek Safar <marek.safar@gmail.com>
4405 * statement.cs: Clean-up foreach statements.
4407 2008-06-12 Marek Safar <marek.safar@gmail.com>
4409 * class.cs: Stop using public method which should not exist
4410 (MethodBuilder.SetGenericMethodSignature).
4412 2008-06-11 Martin Baulig <martin@ximian.com>
4415 (Location.LookupFile): Add `CompilationUnit' argument; when given
4416 a relative file name, make it relative to the directory the .cs
4417 file is located in instead of using the current directory.
4419 2008-06-11 Martin Baulig <martin@ximian.com>
4422 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
4423 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
4424 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
4425 (SourceMethod.SetCompilerGenerated): Likewise.
4427 2008-06-11 Marek Safar <marek.safar@gmail.com>
4429 * codegen.cs, driver: Only write symbol file when it's asked for.
4431 2008-06-11 Marek Safar <marek.safar@gmail.com>
4433 * codegen.cs: Don't use assembly writer error handling for symbol writer.
4435 2008-06-10 Martin Baulig <martin@ximian.com>
4437 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
4439 2008-06-09 Marek Safar <marek.safar@gmail.com>
4441 A fix for bug #316290
4442 * expression.cs: Include decimal operators in predefined table.
4444 * parameters.cs: More readonlyness.
4446 2008-06-09 Marek Safar <marek.safar@gmail.com>
4448 A fix for bug #397213
4449 * cs-parser.jay: One more missing current_local_parameters reset.
4451 2008-06-09 Marek Safar <marek.safar@gmail.com>
4453 A fix for bug #396633
4454 * class.cs: Host backing field in partial container.
4456 2008-06-09 Marek Safar <marek.safar@gmail.com>
4458 A fix for bug #397068
4459 * expression.cs: Check both operand types when predefined operator is used.
4461 2008-06-05 Martin Baulig <martin@ximian.com>
4463 Merged the `debugger-kahalo' branch.
4466 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
4467 we're an iterator method.
4468 (SourceMethod): Reflect latest symbol writer changes;
4469 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
4470 now `start_row' and `end_row'.
4471 (Constructor.Emit): Fix the logic whether to emit symbol information.
4473 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
4477 (CompilationUnit): New public class; derives from `SourceFile'.
4478 (SourceFileEntry.DefineSymbolInfo): New public method.
4479 (SourceFileEntry.SetChecksum): New public method.
4480 (Location): Encode hidden line numbers by using `column == 255';
4481 the .ctor now accepts `column == -1' to mark a hidden line number.
4482 (Location.Hidden): New public property.
4483 (Location.CheckPoint): Add `CompilationUnit'.
4484 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
4485 (Location.Push): Add `CompilationUnit compile_unit' argument.
4486 (Location.CompilationUnit): New public property.
4489 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
4491 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
4493 * driver.cs: `SourceFile' -> `CompilationUnit'.
4495 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
4497 * namespace.cs: `SourceFile' -> `CompilationUnit'.
4499 * cs-tokenizer.cs: Add support for `#pragma checksum' and
4503 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
4504 new symbol writer API to also pass the file.
4506 2008-06-05 Marek Safar <marek.safar@gmail.com>
4508 * statement.cs: Emit catch variable assignment using variable expression.
4510 2008-06-05 Marek Safar <marek.safar@gmail.com>
4512 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
4513 with other variable types.
4515 2008-06-04 Marek Safar <marek.safar@gmail.com>
4517 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
4518 GetLength method emit, it breaks resolve rules.
4520 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
4521 Marek Safar <marek.safar@gmail.com>
4523 A fix for bug #395542
4524 * cs-parser.jay: The trailing comma is allowed in anonymous type member
4527 2008-06-02 Marek Safar <marek.safar@gmail.com>
4529 A fix for bug #395287
4530 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
4532 2008-05-31 Marek Safar <marek.safar@gmail.com>
4534 A fix for bug #395845
4535 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
4536 non-nullable parameter type.
4538 2008-05-31 Marek Safar <marek.safar@gmail.com>
4540 * class.cs: Handle contructor initializer as a statement in top-level block.
4542 2008-05-30 Marek Safar <marek.safar@gmail.com>
4544 * attribute.cs: Don't mix old and new corlib types when emitting corlib
4545 security attributes.
4547 2008-05-24 Marek Safar <marek.safar@gmail.com>
4549 * ecore.cs, expression.cs: Small IVariable refactoring.
4551 2008-05-22 Marek Safar <marek.safar@gmail.com>
4553 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
4555 2008-05-21 Marek Safar <marek.safar@gmail.com>
4557 * cs-parser.jay: Removed redundant catch type check.
4559 2008-05-21 Marek Safar <marek.safar@gmail.com>
4561 A fix for bug #390372
4562 * nullable.cs: Set correct return type.
4564 2008-05-21 Marek Safar <marek.safar@gmail.com>
4566 A fix for bug #391062
4567 * typemanager.cs: Fixed crash when comparing null types.
4569 2008-05-21 Marek Safar <marek.safar@gmail.com>
4571 A fix for bug #391871
4572 * cs-parser.jay: Better error handling for invalid catch type.
4574 2008-05-20 Marek Safar <marek.safar@gmail.com>
4576 A fix for bug #392155
4577 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
4579 2008-05-15 Marek Safar <marek.safar@gmail.com>
4581 A fix for bug #390666
4582 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
4585 2008-05-15 Marek Safar <marek.safar@gmail.com>
4587 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
4590 2008-05-13 Marek Safar <marek.safar@gmail.com>
4592 A fix for bug #389625
4593 * delegate.cs, generic.cs: Some progress on method group return type
4596 2008-05-13 Marek Safar <marek.safar@gmail.com>
4598 A fix for bug #378419
4599 * namespace.cs: Inspect also parent namespaces not only namespace entries.
4601 2008-05-12 Marek Safar <marek.safar@gmail.com>
4603 * class.cs (Constructor): Added IsCompilerGenerated.
4605 2008-05-12 Marek Safar <marek.safar@gmail.com>
4607 * expression.cs: Enum binary operators can accept non-enum operand only when
4608 is implicitly convertible to underlying type.
4610 2008-05-12 Marek Safar <marek.safar@gmail.com>
4612 A fix for bug #389272
4613 * support.cs: Workaround System.InvalidOperationException for enums.
4615 2008-05-12 Marek Safar <marek.safar@gmail.com>
4617 A fix for bug #389073
4618 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
4620 2008-05-10 Marek Safar <marek.safar@gmail.com>
4622 * driver.cs: Split Parse.
4624 * location.cs (LookupFile): Uses string.Empty.
4626 2008-05-07 Marek Safar <marek.safar@gmail.com>
4628 * expression.cs, parameter.cs: Small ParameterReference clean up.
4630 2008-05-07 Marek Safar <marek.safar@gmail.com>
4632 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
4633 hack. Fixes #387502.
4635 2008-05-06 Martin Baulig <martin@ximian.com>
4637 * class.cs (Constructor.Emit): Fix the logic whether to emit
4640 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
4643 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
4644 InvalidOperationException when the iterator is before the start or
4647 2008-05-06 Marek Safar <marek.safar@gmail.com>
4649 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
4650 when left is nullable type.
4652 2008-05-06 Marek Safar <marek.safar@gmail.com>
4654 A fix for bug #386628
4655 * expression.cs (LocalVariableReference): Continue in resolving when
4656 variable is not assigned.
4658 2008-05-05 Marek Safar <marek.safar@gmail.com>
4660 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
4661 nullable operations.
4663 2008-05-04 Marek Safar <marek.safar@gmail.com>
4665 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
4666 it saves many redundant temporary variables for nullable operations.
4668 2008-05-03 Marek Safar <marek.safar@gmail.com>
4670 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
4672 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
4675 * nullable.cs: Constant coalescing operator optimizations.
4677 2008-05-03 Marek Safar <marek.safar@gmail.com>
4679 * constant.cs: Use unsigned conversion for values which are unsigned only.
4681 2008-05-03 Marek Safar <marek.safar@gmail.com>
4683 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
4684 coalescing operator as it should be.
4686 2008-05-02 Marek Safar <marek.safar@gmail.com>
4688 A fix for bug #371016
4689 * expression.cs: All predefined delegate operators require implicit method
4692 2008-05-02 Marek Safar <marek.safar@gmail.com>
4694 * constant.cs: Emit long constant as uint when fits the range.
4696 * convert.cs, expression.cs: Fixed few unsafe conversions.
4698 2008-05-02 Marek Safar <marek.safar@gmail.com>
4700 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
4702 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
4705 * convert.cs (ImplicitNumericConversion): Don't modify the type of
4707 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
4709 2008-05-01 Marek Safar <marek.safar@gmail.com>
4711 * constant.cs, literal.cs: IsLiteral property for error reporting.
4713 * ecore.cs, expression.cs: Implemented Property expression.
4715 2008-05-01 Marek Safar <marek.safar@gmail.com>
4717 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
4719 * nullable.cs: Implemented nullable coalescing null operator.
4721 * ecore.cs, expression.cs: Expression trees work.
4723 2008-05-01 Marek Safar <marek.safar@gmail.com>
4725 * ecore.cs: CreateExpressionTree is finally abstract.
4727 * expression.cs, linq.cs: Updated.
4729 2008-05-01 Marek Safar <marek.safar@gmail.com>
4731 * expression.cs, ecore.cs: Block base access expression inside expression
4734 2008-05-01 Marek Safar <marek.safar@gmail.com>
4736 A fix for bug #385058
4737 * expression.cs: User-defined operator implementations always take
4738 precedence over predefined operator implementations.
4740 2008-04-30 Marek Safar <marek.safar@gmail.com>
4742 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
4743 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
4744 expression tree conversions.
4746 2008-04-30 Marek Safar <marek.safar@gmail.com>
4748 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
4749 operators method details to Operator class.
4751 2008-04-30 Marek Safar <marek.safar@gmail.com>
4753 * anonymous.cs: Pass unsafe flags to anonymous container.
4755 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
4756 inside expression tree.
4758 2008-04-29 Martin Baulig <martin@ximian.com>
4760 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
4761 (Tokenizer.PopPosition): Also restore the `line'.
4763 2008-04-29 Marek Safar <marek.safar@gmail.com>
4765 * delegate.cs: Implemented Invoke expression.
4767 2008-04-29 Marek Safar <marek.safar@gmail.com>
4769 * expression.cs: Fixed equality reference comparison regression.
4771 2008-04-29 Marek Safar <marek.safar@gmail.com>
4773 * ecore.cs: Clean up EmptyCast hack.
4775 * expression.cs, nullable.cs: Implemented enum binary and unary operations
4776 using correct conversion rules. Also fixes #383993.
4778 2008-04-28 Martin Baulig <martin@ximian.com>
4780 * class.cs (Constructor.Emit): Don't emit debugging information
4781 for generated default .ctor's.
4783 2008-04-28 Marek Safar <marek.safar@gmail.com>
4785 * convert.cs: Empty-cast ushort to int conversion.
4787 2008-04-28 Marek Safar <marek.safar@gmail.com>
4789 A fix for bug #384191
4790 * ecore.cs, expression.cs: Fixed expression cloning.
4792 2008-04-28 Marek Safar <marek.safar@gmail.com>
4794 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
4796 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
4798 Fix #381559, test-638.cs, test-639.cs
4799 * assign.cs (CompoundAssign.Helper): New wrapper.
4800 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
4802 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
4803 Pass unconverted expressions to the params array creation expression.
4804 (FieldExpr.EmitAssign): Don't special-case StringConcat.
4805 (PropertyExpr.EmitAssign): Likewise.
4806 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
4807 element if it is of kind CompoundAssign.Helper.
4808 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
4809 first before anything else.
4810 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
4811 (ArrayAccess.LoadArrayAndArguments): Simplify.
4813 2008-04-27 Marek Safar <marek.safar@gmail.com>
4815 * expression.cs: Fixed cloning of typeof(void).
4817 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
4819 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
4820 (Assign.Emit): Likewise. Move it to ...
4821 (CompoundAssign.DoResolve): ... here and ...
4822 (CompoundAssign.Emit): ... here.
4823 (EventAddOrRemove): New helper to handle += and -= on events, and
4824 avoid the use of BinaryDelegates.
4825 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
4826 (EventExpr.EmitAddOrRemove): Improve.
4827 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
4829 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
4830 create VarExprs for 'foo.bar.var'.
4831 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
4832 is a highly inappropriate name for its functionality.
4834 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4836 Simplify handling of multiple assignments
4837 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
4839 (SimpleAssign): New. Class to be used for normal assignments.
4840 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
4841 * expression.cs, parameter.cs, statement.cs: Likewise.
4843 2008-04-25 Marek Safar <marek.safar@gmail.com>
4845 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
4846 for incompatible underlying types, more to come, uff.
4848 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4851 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
4852 Handle 'leave_copy'.
4854 2008-04-25 Marek Safar <marek.safar@gmail.com>
4856 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
4858 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
4860 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
4861 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
4862 * statement.cs (While, Do, For): Allow test to have side effects.
4863 (For.DoEmit): Always emit InitStatement.
4866 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
4867 Always create SideEffectConstant.
4868 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
4869 of type EnumConstant.
4871 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4872 Handle 'right' being SideEffectConstant of type 'bool'.
4874 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4875 Use left.EmitBranchable instead of open coding it, so as to
4876 improve optimization opportunities.
4878 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
4880 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
4882 (Expression.EmitSideEffect): Document.
4884 2008-04-23 Marek Safar <marek.safar@gmail.com>
4886 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
4888 2008-04-23 Marek Safar <marek.safar@gmail.com>
4890 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
4892 2008-04-23 Marek Safar <marek.safar@gmail.com>
4894 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
4895 conversion to expression tree.
4897 2008-04-23 Marek Safar <marek.safar@gmail.com>
4899 * ecore.cs: Removed unused expression.
4901 2008-04-22 Marek Safar <marek.safar@gmail.com>
4903 * expression.cs: Implemented NegateChecked and New expressions.
4905 2008-04-22 Marek Safar <marek.safar@gmail.com>
4907 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
4909 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
4912 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
4913 needing final 'ret' instruction.
4915 2008-04-22 Marek Safar <marek.safar@gmail.com>
4917 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
4919 2008-04-21 Marek Safar <marek.safar@gmail.com>
4921 * expression.cs: Emit ldnull and not null expression as an instance argument
4922 of static method expression calls.
4924 2008-04-21 Marek Safar <marek.safar@gmail.com>
4926 A fix for bug #378200
4927 * expression.cs: Fixed crash when creating parameterless expression tree
4930 2008-04-21 Marek Safar <marek.safar@gmail.com>
4932 A fix for bug #375297
4933 * anonymous.cs: Fixed crash when inferring from null argument anonymous
4936 2008-04-21 Marek Safar <marek.safar@gmail.com>
4938 A fix for bug #377596
4939 * decl.cs, class.cs: Emit delegate type argument attributes.
4941 2008-04-21 Marek Safar <marek.safar@gmail.com>
4943 A fix for bug #365314
4944 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
4946 2008-04-21 Marek Safar <marek.safar@gmail.com>
4948 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
4951 2008-04-21 Marek Safar <marek.safar@gmail.com>
4953 * generic.cs (TypeParameter): Removed redundant location.
4955 2008-04-19 Marek Safar <marek.safar@gmail.com>
4957 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
4958 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
4959 FullNamedExpression in all declaration type expression, statements will come
4962 2008-04-18 Marek Safar <marek.safar@gmail.com>
4964 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
4965 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
4967 2008-04-18 Marek Safar <marek.safar@gmail.com>
4969 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
4972 2008-04-17 Marek Safar <marek.safar@gmail.com>
4974 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
4977 2008-04-17 Marek Safar <marek.safar@gmail.com>
4979 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
4983 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
4985 Hook up 'EmitSideEffect'
4986 * constant.cs (Constant.EmitSideEffect): New.
4987 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
4988 (SideEffectConstant.EmitSideEffect): New.
4989 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
4990 unconditional branch in EmitBranchable.
4991 (FieldExpr.EmitBranchable): New.
4992 * expression.cs (Unary.EmitSideEffect): New.
4993 (Binary.EmitSideEffect): New.
4994 (VariableReference.EmitSideEffect): New. Do nothing.
4996 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
4998 Introduce 'EmitSideEffect'
4999 * ecore.cs (Expression.EmitSideEffect): New.
5000 (TypeCast): Rename from EmptyCast.
5002 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
5003 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
5004 * convert.cs, nullable.cs: Update to changes.
5006 2008-04-16 Marek Safar <marek.safar@gmail.com>
5008 * class.cs, cs-parser.jay: Early check for base types expression.
5010 2008-04-16 Marek Safar <marek.safar@gmail.com>
5012 * decl.cs (MemberName): Declare PrettyName as obsolete.
5014 2008-04-16 Marek Safar <marek.safar@gmail.com>
5016 * namespace.cs: Use MemberName comparison.
5018 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
5021 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
5023 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
5024 (MemberName.FullyQualifiedName): New. Provides the functionality
5025 that users assume FullName would have.
5026 * ecore.cs, namespace.cs: Update to changes.
5028 * statement.cs (Using.assign): Make into ExpressionStatement.
5029 (Using.EmitPreTryBody): Simplify.
5031 2008-04-16 Marek Safar <marek.safar@gmail.com>
5033 * report.cs: ColorFormat is protected.
5035 * rootcontext.cs: Unused fields clean-up.
5037 * namespace.cs: Made UsingEntry name private.
5039 2008-04-16 Marek Safar <marek.safar@gmail.com>
5041 * cs-tokenizer.cs, location.cs: Removed unused field.
5043 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
5044 Raja R Harinath <harinath@hurrynot.org>
5047 * constant.cs (SideEffectConstant.value): Rename from 'left'.
5048 (SideEffectConstant.side_effect): Rename from 'right'.
5049 (SideEffectConstant..ctor): Normalize 'side_effect'.
5050 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
5051 value of this constant.
5052 * cfold.cs: Update to changes.
5054 2008-04-15 Marek Safar <marek.safar@gmail.com>
5056 * cs-paser.jay: Removed unused variable.
5058 * driver.cs: Made Compile instance method.
5060 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
5062 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
5064 2008-04-15 Marek Safar <marek.safar@gmail.com>
5066 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
5068 2008-04-13 Jb Evain <jbevain@novell.com>
5070 * namespace.cs: update the System.Core fullname for 2.1
5071 * driver.cs: update the list of required assemblies for 2.1.
5072 Merged from the Moonlight 2 branch.
5074 2008-04-11 Marek Safar <marek.safar@gmail.com>
5076 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
5077 types and user defined operators. User operators arguments has to be checked
5078 for null value before invocation, which also means no operator is called
5079 when any argument is not convertible to unwrapped nullable type.
5081 2008-04-09 Marek Safar <marek.safar@gmail.com>
5083 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
5084 of Unary expressions to follow operator overloading rules precisely.
5085 Also fixes #321794, #323794
5087 2008-04-08 Marek Safar <marek.safar@gmail.com>
5089 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
5092 2008-04-08 Marek Safar <marek.safar@gmail.com>
5094 * expression.cs, ecore.cs: Implemented MemberInit expression.
5096 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
5098 Fix mono/tests/exception4.cs
5099 * statement.cs (ExceptionStatement, TryCatch): Revert to using
5100 ec.NeedReturnLabel () rather emitting a 'nop'.
5102 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
5104 (TryCatch.SomeCodeFollows): Likewise.
5105 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
5106 for 'break', 'continue' and 'return' statements inside a try.
5107 We're fairly sure that the generated IL stream will have more
5108 instructions textually following the try.
5109 (FlowBranchingTryCatch): Likewise.
5111 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
5112 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
5115 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
5116 wrapper -- forward everything to CollectionForeach.
5117 (CollectionForeach.NonDisposableWrapper): New.
5118 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
5119 instead of a pop + branch to end.
5121 2008-04-07 Marek Safar <marek.safar@gmail.com>
5123 A fix for bug #377485
5124 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
5125 Propagate location for extension method groups. Report conversion failure at
5128 2008-04-07 Marek Safar <marek.safar@gmail.com>
5130 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
5131 ListInit and Field expressions.
5133 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
5135 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
5136 Since $PC is always -1 inside the body of MoveNext, the fault
5138 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
5139 * statement.cs (ExceptionStatement.emit_finally): Likewise.
5140 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
5142 The denouement! Fix #324708
5143 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
5144 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
5145 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
5146 'finally' inside the finally clause.
5148 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
5149 inside an iterator. Don't emit the body of the 'finally' inside
5150 the finally clause yet.
5152 Use the ResumableStatement infrastructure for MoveNext ()
5153 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
5154 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
5155 'old_resume_points'. Move dispatcher upfront.
5156 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
5157 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
5158 in an enumerator. This encodes the main fix in this patch series
5159 -- we can only jump into the first instruction of a try from the
5160 outside, but we want to emit try/finally regions in iterators and
5161 resume in the middle of them.
5163 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
5165 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
5166 of NeedReturnLabel here.
5168 Introduce a common point for emitting try/finally to IL
5169 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
5170 features of the various subclasses, which are now driven by ...
5171 (ExceptionStatement.EmitPreTryBody): ... this and ...
5172 (ExceptionStatement.EmitTryBody): ... this and the original
5174 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
5175 Remove DoEmit and update to follow above protocol.
5177 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
5178 of the dispatcher are the same, skip emitting the 'switch'.
5179 * iterator.cs (Iterator.EmitDispose): Update to changes.
5181 Clean up handling of 'using' statement
5182 * statement.cs (UsingTemporary): New. Carved out of ...
5183 (Using): ... this. Simplify drastically. Handle exactly
5185 * cs-parser.jay (using_statement): Split. Create UsingTemporary
5186 or Using as appropriate. If there are multiple variable declared,
5187 create nested Using statements.
5188 (resource_acquisition): Kill.
5190 * statement.cs (ExceptionStatement.EmitForDispose): Use
5191 EmitFinallyBody, not EmitFinally.
5193 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
5194 * iterator.cs: Update to changes.
5196 Start using the ResumableStatement infrastructure
5197 * statement.cs (ResumeableStatement.PrepareForDispose): New.
5198 (ResumableStatement.EmitForDispose): New.
5199 (ExceptionStatement): Override them.
5200 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
5201 EmitForDispose to create the body of the Dispose method. Don't
5204 * iterator.cs (Iterator.AddResumePoint): Move here from ...
5205 * statement.cs (Toplevel.AddResumePoint): ... here.
5206 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
5207 * flowanalysis.cs (FlowBranchingIterator): New.
5208 * codegen.cs (EmitContext): Update to changes.
5210 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
5211 (Iterator.old_resume_points): Rename from 'resume_points'.
5212 (Iterator.MoveNextStatement): Remove unused class.
5214 New infrastructure for try/finally in iterators (still unused)
5215 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
5216 (FlowBranchingToplevel.AddResumePoint): Hook into
5217 ToplevelBlock.AddResumePoint.
5218 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
5219 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
5220 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
5221 resume points and assign program-counter values.
5222 (ExceptionBlock.AddResumePoint): Collect resume points for
5223 de-muxer at the top of try block.
5224 * iterators.cs (Yield.CheckContext): Simplify.
5225 (Yield.Resolve): Use FlowBranching.AddResumePoint.
5227 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
5229 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
5230 argument to an ExitStatement.
5231 (FlowBranchingException): Refactor saved origins code.
5232 * statement.cs (ExitStatement): Update to cahges.
5233 * iterator.cs (YieldBreak): Likewise.
5235 * statement.cs (ResumableStatement): New. Common base class for
5236 YieldReturn and ExceptionStatement.
5237 (ExitStatement): New. Common base class for Return and YieldBreak.
5238 (Return): Update to changes.
5239 * iterator.cs (YieldBreak): Likewise.
5240 * lambda.cs (ContextualReturn): Likewise.
5243 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
5244 emit a meaningful error message.
5246 Fix #324765, #319508
5247 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
5248 (VariableInfo.SetAssigned): Set it.
5249 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
5250 determine if CS0219 or CS0168 is appropriate. Don't use
5251 flow-analysis information.
5252 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
5253 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
5254 (EmitContext.EndFlowBranching): ... this.
5256 2008-04-03 Marek Safar <marek.safar@gmail.com>
5258 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
5260 2008-04-03 Marek Safar <marek.safar@gmail.com>
5262 A fix for bug #376508
5263 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
5264 ImplicitConversionExists.
5266 2008-04-03 Marek Safar <marek.safar@gmail.com>
5268 * expression.cs (Binary): Added remaining binary operators to expression
5271 * nullable.cs: Optimize shift with null argument.
5273 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
5275 Fix minor IL regression
5276 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
5277 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
5278 * cs-parser.jay (try_statement): Update to changes.
5280 * statement.cs (TryFinally.need_exc_block): Delete.
5281 (TryFinally): Update to changes.
5283 Now all ExceptionStatements are unconditional
5284 * statement.cs (CollectionForeach.DisposableWrapper): New.
5285 Extract out the try/finally code into a new wrapper.
5286 (CollectionForeach.Resolve): Use it to simplify the code.
5288 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
5290 Start at simplifying ExceptionStatement semantics a bit
5291 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
5292 * cs-parser.jay (try_statement): Update to changes.
5293 (opt_catch_clauses): Remove.
5294 * flowanalysis.cs: Update to changes.
5295 (FlowBranching.BranchingType.TryCatch): New.
5296 (FlowBranchingTryCatch): New.
5298 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
5299 (FlowBranching.CreateBranching): Update to changes.
5300 (FlowBranchingBlock.AddSibling): Add sanity check.
5301 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
5304 * iterators.cs (Iterator.MarkFinally): Remove.
5305 * statement.cs (ExceptionStatement): Update to changes.
5307 Add support for skipping over finally blocks at runtime. First
5308 in a series to fix #324708
5309 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
5310 (Iterator.EmitMoveNext): Initialize it.
5311 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
5312 branch over the body of the 'finally' clause.
5314 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
5316 Avoid lopsided use of Foo/DoFoo names
5317 * statement.cs (ExpressionStatement.EmitFinallyBody):
5318 Rename from EmitFinally.
5319 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
5320 * iterator.cs: Update to changes.
5322 2008-04-02 Marek Safar <marek.safar@gmail.com>
5324 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
5325 based on UserOperatorCall. More binary nullable operators clean up.
5327 2008-04-02 Martin Baulig <martin@ximian.com>
5329 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
5331 2008-04-02 Marek Safar <marek.safar@gmail.com>
5333 * nullable.cs: Merge user and empty conversions when lifting expression
5336 * expression.cs (StringConcat): Implemented expression tree representation.
5338 2008-04-01 Marek Safar <marek.safar@gmail.com>
5340 * nullable.cs: When lifting null literal and a user operator exists, no call
5343 2008-04-01 Marek Safar <marek.safar@gmail.com>
5345 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
5348 2008-04-01 Marek Safar <marek.safar@gmail.com>
5350 * nullable.cs, expression.cs: Use namespace instead heavily nested
5351 monster abstract class.
5353 2008-04-01 Marek Safar <marek.safar@gmail.com>
5355 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
5356 lifting of null literal and user operators. Clean up of some temporary
5359 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
5361 Fix #368224, test-629.cs
5362 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
5363 if it crossed an unwind-protect boundary.
5364 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
5365 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
5366 inside an unwind-protected region.
5367 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
5368 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
5369 'leave' instead of a 'br' if unwind-protected.
5370 (Iterator.EmitYieldBreak): Likewise.
5372 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
5374 * driver.cs: Only define versioninfo resources if no win32 resource
5377 2008-03-28 Marek Safar <marek.safar@gmail.com>
5379 A fix for bug #372375
5380 * convert.cs: Fixed boxing of nullable types.
5382 2008-03-28 Marek Safar <marek.safar@gmail.com>
5384 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
5387 2008-03-28 Marek Safar <marek.safar@gmail.com>
5389 A fix for bug #374619
5390 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
5392 2008-03-27 Marek Safar <marek.safar@gmail.com>
5394 * lambda.cs: Check return type only for invocation.
5396 2008-03-27 Marek Safar <marek.safar@gmail.com>
5398 A fix for bug #374214
5399 * ecore.cs: Correctly report argument type mismatch.
5401 2008-03-27 Marek Safar <marek.safar@gmail.com>
5403 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
5404 and not rely on broken IsEnum.
5406 2008-03-27 Marek Safar <marek.safar@gmail.com>
5408 * nullable.cs: New file, extracted from generic.cs.
5410 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
5412 2008-03-27 Marek Safar <marek.safar@gmail.com>
5414 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
5415 predefined comparison operators and null literals.
5417 * report.cs: New warning ID.
5419 2008-03-25 Marek Safar <marek.safar@gmail.com>
5421 A fix for bug #370577
5422 * lambda.cs: Check return type too.
5424 2008-03-25 Marek Safar <marek.safar@gmail.com>
5426 A fix for bug #372846
5427 * class.cs: Automatic properties can be declared as unsafe.
5429 2008-03-20 Marek Safar <marek.safar@gmail.com>
5431 * location.cs: Use string based concatenation.
5433 * expression.cs: LiftedBinaryOperator is gmcs only.
5435 2008-03-20 Marek Safar <marek.safar@gmail.com>
5437 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
5438 conversions rules and expression trees.
5440 2008-03-19 Marek Safar <marek.safar@gmail.com>
5442 * delegate.cs: Use extension method source as delegate target.
5444 2008-03-19 Marek Safar <marek.safar@gmail.com>
5446 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
5447 binary operations to be purely based on binary operations and optimized
5448 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
5449 and other ET refactoring.
5451 * typemanager.cs: Fixed warning.
5453 2008-03-17 Marek Safar <marek.safar@gmail.com>
5455 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
5457 * symbolwriter.cs: Fixed.
5459 2008-03-17 Marek Safar <marek.safar@gmail.com>
5461 * anonymous.cs, driver.cs: Reset anonymous types counters.
5463 2008-03-17 Marek Safar <marek.safar@gmail.com>
5465 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
5467 * class.cs: Use fullname for all type member definitions.
5469 2008-02-19 Martin Baulig <martin@ximian.com>
5472 (IMethodData.EmitExtraSymbolInfo): New interface method.
5473 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
5474 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
5475 interface method here as an empty public virtual method.
5478 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
5479 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
5480 CodeGen.SymbolWriter.SetRealMethodName().
5482 2008-02-18 Martin Baulig <martin@ximian.com>
5485 (ScopeInfo.EmitType): Override this and emit debugging
5486 information for captured variables.
5487 (RootScopeInfo.EmitType): Override this and emit symbol
5488 information for a captured `this'.
5490 2008-02-15 Martin Baulig <martin@ximian.com>
5492 * iterators.cs: Emit debugging info.
5495 (EmitContext.Flags): Add `OmitDebuggingInfo'.
5496 (EmitContext.OmitDebuggingInfo): New public property.
5499 (While): Override Emit() and don't emit symbol info there; do it
5500 inside DoEmit() instead.
5501 (Block.Emit): Omit symbol information while emitting the scope
5502 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
5504 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
5505 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
5506 .ctor to make `IsIterator' work.
5508 2008-03-14 Martin Baulig <martin@ximian.com>
5510 * symbolwriter.cs: Added the new symbol writer function from the
5511 debugger's `terrania' branch; temporarily enclose them inside
5512 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
5515 2008-03-14 Martin Baulig <martin@ximian.com>
5518 (SymbolWriter): Make this a public static class.
5521 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
5522 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
5524 2008-03-14 Marek Safar <marek.safar@gmail.com>
5526 A fix for bug #370577
5527 * statement.cs, lambda.cs: Added extra limitations when dealing with void
5530 2008-03-14 Marek Safar <marek.safar@gmail.com>
5532 * typemanager.cs (CSharpName): Made 250 times faster.
5534 2008-03-13 Marek Safar <marek.safar@gmail.com>
5536 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
5538 2008-03-12 Marek Safar <marek.safar@gmail.com>
5540 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
5541 crash when predefined field does not exist.
5543 2008-03-12 Marek Safar <marek.safar@gmail.com>
5545 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
5547 2008-03-12 Marek Safar <marek.safar@gmail.com>
5549 * class.cs (FixedField): Don't crash when contructors are missing.
5551 2008-03-11 Marek Safar <marek.safar@gmail.com>
5553 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
5554 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
5555 check internal types accessibility for internal and external types.
5556 Replaced EnumToUnderlying by GetEnumUnderlyingType.
5558 2008-03-11 Marek Safar <marek.safar@gmail.com>
5560 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
5561 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
5562 attribute.cs, statement: Use corect instance of predefined types (work
5563 related to #364674).
5565 2008-03-07 Marek Safar <marek.safar@gmail.com>
5567 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
5569 2008-03-07 Marek Safar <marek.safar@gmail.com>
5571 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
5572 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
5573 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
5574 predefined types clean up, delayed predefined types members initialization
5575 (work related to #364674).
5577 2008-03-05 Marek Safar <marek.safar@gmail.com>
5579 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
5581 2008-03-05 Marek Safar <marek.safar@gmail.com>
5583 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
5584 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
5585 predefined types clean up (work related to #364674).
5587 2008-03-04 Marek Safar <marek.safar@gmail.com>
5589 * ecore.cs: Print an error message instead of throwing exception.
5591 2008-03-04 Marek Safar <marek.safar@gmail.com>
5593 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
5594 expression.cs, statement.cs: Unififed null literal representation.
5596 2008-03-03 Marek Safar <marek.safar@gmail.com>
5598 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
5599 expression.cs: Refactored binary operators resolve phase and improved speed.
5600 The nullable code is still missing and won't work correctly, more fixes
5603 It also fixes #323726, #324312, #324248, and many other unreported issues.
5605 2008-02-29 Zoltan Varga <vargaz@gmail.com>
5607 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
5610 2008-02-27 Marek Safar <marek.safar@gmail.com>
5612 * ecore.cs: Clean-up and split BetterConversion.
5614 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
5617 * enum.cs (EnumMember.Value): Only access 'value' if
5618 ResolveValue says it's ok.
5619 (EnumMember.DoResolveValue): Don't set prev_member.value.
5620 (Enum.GetDefinition): Reverse arguments of Equals --
5621 EnumMember.Value can return 'null'.
5623 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
5625 2008-02-22 Marek Safar <marek.safar@gmail.com>
5627 * generic.cs, expression.cs: More ongoing work on expression trees.
5629 2008-02-21 Marek Safar <marek.safar@gmail.com>
5631 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
5632 handle missing matches when mutiple operators exist.
5634 2008-02-20 Marek Safar <marek.safar@gmail.com>
5636 A fix for bug #363218
5637 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
5640 2008-02-20 Marek Safar <marek.safar@gmail.com>
5642 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
5643 update. This time to deal correctly with SideEffectConstant expression used
5644 as an argument for another constant folding.
5646 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
5648 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
5651 2008-02-19 Marek Safar <marek.safar@gmail.com>
5653 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
5655 2008-02-19 Marek Safar <marek.safar@gmail.com>
5657 A fix for bug #328136
5658 * expression.cs: Do not fold immediately LogicalAnd operators when the left
5659 side is a false constant, because we still need to evaluate the right-hand
5662 * statement.cs (If): Emit two types of boolean constants (simple constant,
5663 side-effect constant).
5665 2008-02-19 Marek Safar <marek.safar@gmail.com>
5667 * constant.cs (SideEffectConstant): Don't emit boolean constant.
5669 * expression.cs: Fold immediately LogicalAnd operators when both sides are
5672 2008-02-18 Marek Safar <marek.safar@gmail.com>
5674 A fix for bug #361457
5675 * ecore.cs (IsApplicable): Params methods have lower priority.
5677 * support.cs: Return correct parameter modifier for params types.
5679 2008-02-18 Marek Safar <marek.safar@gmail.com>
5681 * generic.cs (TypeParameter): Cache attribute target name.
5683 * support.cs: Removed unused variable.
5685 * typemanager.cs: Removed debugging leftover.
5687 * ecore.cs: Use local type instead of a property;
5689 * class.cs (VerifyMembers): Consider also parent to test whether type member
5692 * expression.cs (FullMethodDesc): Removed.
5694 * attribute.cs (IsValidArgumentType): Made static.
5696 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
5698 Cleanup to be more readable.
5699 * Makefile (GMCS_PROFILE): Remove.
5700 (COMPILER_NAME): New helper.
5702 2008-02-15 Miguel de Icaza <miguel@novell.com>
5704 * cs-tokenizer.cs: if a conditional expression happens inside a
5705 (...) this also means that we do not need to de-ambiguate between
5706 an parenthesized expression and a cast.
5710 * constant.cs (SideEffectConstant): a constant value that happens
5711 to have a side effect.
5713 Fixes the build regressions introduced by the fix for #359789
5715 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
5717 * expression.cs (Conditional.Emit): when emitting the ternary
5718 operator, use local variables to generate code verifiable code.
5720 The verifier cannot infer that the type on stack before the
5721 stloc.0 is executed is of type ParentB. This happens because the
5722 stack merge algorithm uses only parent types when deciding which
5723 is the common type. This is described in Part III 1.8.1.3 of ECMA
5726 This code compiled with mcs is not verifiable under MS. The MS
5727 verifier picks the first common interface of Foo and Bar, which is
5728 wrong, but doesn't use a full join type of the 2 interfaces.
5730 CSC uses a clever hack to compile such code in a verifiable
5731 way. It stores the intermediate values in a local variable with
5736 2008-02-14 Miguel de Icaza <miguel@novell.com>
5738 * expression.cs: Do not fold BitwiseAnd operators when the left
5739 side is a false constant, because we still need to evaluate the
5744 * support.cs: Instead of throwing an InternalErrorException when
5745 the position of the stream is outside the boundary of our buffer,
5746 reset the state of the reader, and restart the reading from the
5747 beginning of the file.
5749 2008-02-14 Marek Safar <marek.safar@gmail.com>
5751 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
5753 2008-02-14 Marek Safar <marek.safar@gmail.com>
5755 A fix for bug #361686
5756 * decl.cs: A protected types used inside a private class which parents
5757 derives from the protected class are accessible.
5759 2008-02-13 Marek Safar <marek.safar@gmail.com>
5761 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
5762 the parameterless constructor.
5764 2008-02-13 Marek Safar <marek.safar@gmail.com>
5766 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
5767 lookup methods to use standard member cache when doing member lookup.
5769 2008-02-12 Marek Safar <marek.safar@gmail.com>
5771 * driver.cs: Don't report full path for referenced module as assembly error.
5773 2008-02-12 Marek Safar <marek.safar@gmail.com>
5775 * Makefile: Fixed `qh' target to work on all machines.
5777 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
5778 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
5779 and HasElementType with TypeManager implementation.
5781 2008-02-08 Marek Safar <marek.safar@gmail.com>
5783 A fix for bugs #325134, #359749
5784 * expression.cs, ecore.cs: Try to resolve an extension method even if the
5785 first binds point to non-method member expression.
5787 2008-02-08 Marek Safar <marek.safar@gmail.com>
5789 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
5791 2008-02-08 Marek Safar <marek.safar@gmail.com>
5793 A fix for bugs #321394, #323028
5794 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
5795 Reworked naive IsAccessibleAs implementation to handle nested types.
5797 2008-02-05 Jb Evain <jbevain@novell.com>
5799 * class.cs: use generic type comparison for parameters
5802 2008-02-05 Marek Safar <marek.safar@gmail.com>
5804 A fix for bug #325372
5805 * class.cs: Use generic type comparison when testing method signatures.
5807 2008-02-05 Marek Safar <marek.safar@gmail.com>
5809 A fix for bug #357047
5810 * ecore.cs: Applied C# 3.0 changes to better conversion.
5812 2008-02-05 Marek Safar <marek.safar@gmail.com>
5814 A fix for bug #358374
5815 * cs-parser.jay: Correctly set modifiers for all constructor types.
5817 2008-02-04 Marek Safar <marek.safar@gmail.com>
5819 A fix for bug #355251
5820 * generic.cs: Added base class constraint based type inference.
5822 2008-02-01 Marek Safar <marek.safar@gmail.com>
5824 A fix for bug #357255
5825 * decl.cs: One more missing visibility check.
5827 2008-02-01 Marek Safar <marek.safar@gmail.com>
5829 * support.cs: Fixed broken return.
5831 2008-01-25 Marek Safar <marek.safar@gmail.com>
5833 * report.cs: Correctly reset warnings count after probing.
5835 2008-01-25 Martin Baulig <martin@ximian.com>
5838 (NamespaceEntry.SymbolFileID): Make this work again after
5839 MemberName.ToString() is gone.
5841 2008-01-25 Marek Safar <marek.safar@gmail.com>
5843 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
5846 2008-01-25 Marek Safar <marek.safar@gmail.com>
5848 * generic.cs: Use full implicit conversion for type inference fixing.
5850 2008-01-24 Marek Safar <marek.safar@gmail.com>
5852 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
5853 Fixed user operator conversions.
5855 2008-01-24 Marek Safar <marek.safar@gmail.com>
5857 * generic.cs: Do nullable type to null comparison optimization during
5860 2008-01-24 Marek Safar <marek.safar@gmail.com>
5862 A fix for bug #355163
5863 * generic.cs: Enabled l-value resolve on nullable expressions.
5865 2008-01-24 Marek Safar <marek.safar@gmail.com>
5867 A fix for bug #353986
5868 * class.cs: Ingore static ctors with parameters for any further checks.
5870 2008-01-24 Marek Safar <marek.safar@gmail.com>
5872 A fix for bug #354310
5873 * namespace.cs: Removed redundant check.
5875 2008-01-24 Marek Safar <marek.safar@gmail.com>
5877 A fix for bug #354928
5878 * expression.cs: ElementInitializers can be resolved only once.
5880 2008-01-24 Marek Safar <marek.safar@gmail.com>
5882 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
5883 Condition expressions.
5885 2008-01-23 Marek Safar <marek.safar@gmail.com>
5887 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
5889 2008-01-22 Marek Safar <marek.safar@gmail.com>
5891 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
5894 * generic.cs: Implemented coalesce expression.
5896 2008-01-22 Marek Safar <marek.safar@gmail.com>
5898 A fix for bug #355145
5899 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
5900 expression tree type inference.
5902 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
5905 * expression.cs (Binary.IsUnsignedType): Fix typo.
5907 2008-01-22 Marek Safar <marek.safar@gmail.com>
5909 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
5911 2008-01-22 Marek Safar <marek.safar@gmail.com>
5913 A fix for bug #355161
5914 * ecore.cs, expression.cs: Wider range of extension method supported
5917 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
5919 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
5920 AssemblyBuilder to operate in compiler context. Fixes mcs part of
5923 2008-01-22 Marek Safar <marek.safar@gmail.com>
5925 A fix for bug #355148
5926 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
5928 2008-01-22 Miguel de Icaza <miguel@novell.com>
5930 * expression.cs (CreateExpressionTree): Add support for or and
5931 logical or, and indent following the coding conventions.
5933 * typemanager.cs (LinqExpression): renamed from
5934 ExpressionTreeManager, for a shorter name.
5936 Use TypeManager.CoreLookupType to lookup types from our core
5937 assemblies and turn those into "Type" variables.
5939 Consumers that previously used "Namespace" and "Type" from this
5940 class should instead use the TypeExpression which is a type that
5941 is fully resolved (without involving the regular C# resolution
5944 This typically looks like this:
5946 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
5947 new MemberAccess (texpr, name, type_arguments, loc)
5949 This avoids the problem in: #355178
5951 2008-01-21 Marek Safar <marek.safar@gmail.com>
5953 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
5954 feature in parser only as we do in other cases.
5956 2008-01-21 Marek Safar <marek.safar@gmail.com>
5958 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
5959 typemanager.cs: A refactoring of params arguments to reuse existing
5960 expressions (params -> array initializer) to emit params argument instead
5961 of specialized handling.
5962 It was required by expression tree implementation and it has other benefits
5963 as well, we now apply same optimization for params arguments as we do for
5966 2008-01-18 Marek Safar <marek.safar@gmail.com>
5968 A fix for bug #353526
5969 * generic.cs: A type inference of params arguments may not required any
5970 temporary array creation.
5972 2008-01-18 Marek Safar <marek.safar@gmail.com>
5974 A fix for bug #353534
5975 * generic.cs, ecore.cs, expression.cs: A method group type inference is
5976 supported for delegates only.
5978 2008-01-18 Marek Safar <marek.safar@gmail.com>
5980 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
5981 type for more than 1 candidates.
5983 2008-01-18 Marek Safar <marek.safar@gmail.com>
5985 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
5988 2008-01-16 Marek Safar <marek.safar@gmail.com>
5990 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
5991 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
5992 operator) expressions.
5994 2008-01-16 Zoltan Varga <vargaz@gmail.com>
5996 * statement.cs: Avoid declaring an IL variable for this_variable since it is
5997 not accessed from the generated IL.
5999 2008-01-14 Marek Safar <marek.safar@gmail.com>
6001 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
6002 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
6003 statement.cs: The first expression tree implementation drop, mostly
6004 infrastructure work.
6006 2008-01-14 Marek Safar <marek.safar@gmail.com>
6008 * ecore.cs (IsNestedChild): Refactored.
6010 2008-01-11 Marek Safar <marek.safar@gmail.com>
6012 * lambda.cs: Don't use a cast on unknown expression statement.
6014 2008-01-10 Geoff Norton <gnorton@novell.com>
6016 * cs-tokenizer.cs: One more token to distinguish between method and lambda
6019 2008-01-09 Marek Safar <marek.safar@gmail.com>
6021 * doc.cs: Report better /doc crash details.
6023 2008-01-09 Marek Safar <marek.safar@gmail.com>
6025 A fix for bug #352536
6026 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
6028 2008-01-08 Marek Safar <marek.safar@gmail.com>
6030 A fix for bug #352287
6031 * ecore.cs, expression.cs: Do `this' access checking in all member access
6034 2008-01-08 Marek Safar <marek.safar@gmail.com>
6036 * rootcontext.cs, driver.cs: Switch to linq mode by default.
6038 * report.cs: Reset message stacks.
6040 2008-01-08 Marek Safar <marek.safar@gmail.com>
6042 * generic.cs (InferInPhases): Correctly calculate params position.
6044 2008-01-08 Marek Safar <marek.safar@gmail.com>
6046 * cs-tokenizer.cs: No need to parse full string when parsing lambda
6049 2008-01-07 Marek Safar <marek.safar@gmail.com>
6051 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
6053 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
6055 * driver.cs: Updated --help option.
6057 2008-01-07 Marek Safar <marek.safar@gmail.com>
6059 * generic.cs (InferParamsTypeArguments): Removed.
6060 (InferInPhases): Add params type inference.
6061 (LowerBoundInference): Fixed scoring mechanism.
6063 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
6065 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
6067 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
6068 byte array for unsigned "baked" assemblies.
6070 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
6072 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
6073 array for assemblies that are not strongnamed.
6075 2008-01-04 Marek Safar <marek.safar@gmail.com>
6077 A fix for bug #351481
6078 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
6079 declaring type for nested generic types.
6081 2008-01-04 Marek Safar <marek.safar@gmail.com>
6083 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
6084 instead of ToString.
6086 2008-01-03 Marek Safar <marek.safar@gmail.com>
6088 A fix for bug #351047
6089 * expression.cs (Binary.ResolveOperator): Allow equality operators between
6090 null and structs only when equality and inequality operators are defined
6091 either as an user-operators or predefined operators.
6093 2008-01-03 Marek Safar <marek.safar@gmail.com>
6095 A fix for bug #351047
6096 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
6098 2008-01-03 Marek Safar <marek.safar@gmail.com>
6100 A fix for bug #351257
6101 * cs-tokenizer.cs: Advance line number for '\r' correctly.
6103 2008-01-03 Marek Safar <marek.safar@gmail.com>
6105 A fix for bug #351157
6106 * class.cs (Using): Fixed yet another broken cloning.
6108 (Block): Put back more sensible default value for statements.
6110 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
6112 * codegen.cs: Allow AssemblyVersion with only major version component.
6115 2007-12-29 Marek Safar <marek.safar@gmail.com>
6117 A fix for bug #324654
6118 * class.cs: Use FullName property as member name.
6120 2007-12-28 Marek Safar <marek.safar@gmail.com>
6122 A fix for bug #342117
6123 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
6124 constructor constraint.
6126 2007-12-28 Marek Safar <marek.safar@gmail.com>
6128 A fix for bug #338273
6129 * class.cs (ProbertyBase): Access modifier checks are required for overrides
6132 2007-12-28 Marek Safar <marek.safar@gmail.com>
6134 A fix for bug #350839
6135 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
6137 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
6139 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
6142 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
6144 * statement.cs: Changed some Hashtables to use HybridDictionaries
6145 instead. It was observed that some HashTables only contained a few
6146 items in the vast majority of cases. Since HybridDictionary is
6147 more efficient on small sets (<10 elements), "known_variables"
6148 from class ExplicitBlock as well as "labels" and "constants " from
6149 class Block were changed to HybridDictionaries.
6151 Atsai results: (56216kb->54987kb)
6153 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
6156 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
6158 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
6161 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
6163 * expression.cs: foreach loop to for loop, saved on allocation of
6164 enumerator (59333kb->59141kb)
6166 * statement.cs. Changed foreach loops to for loops, saved on
6167 allocation of enumerator (59141kb->59006kb)
6169 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
6170 when constructed with no specified capacity. This was causing a
6171 few ArrayLists to allocate more memory than they would potentially
6172 need in the Block class and MemberCache class. Setting the
6173 ArrayLists to construct with a capacity of 1 saves some
6174 memory. (56216kb->55585kb)
6176 2007-12-27 Marek Safar <marek.safar@gmail.com>
6178 A fix for bug #347189 (2nd issue)
6179 * expression.cs (MemberAccess): Nested type can be found in base non-generic
6182 2007-12-27 Miguel de Icaza <miguel@novell.com>
6184 * report.cs: Do not use colors if stdout and stderr are not a
6187 2007-12-27 Marek Safar <marek.safar@gmail.com>
6189 A fix for bug #346998
6190 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
6193 2007-12-27 Marek Safar <marek.safar@gmail.com>
6195 A fix for bug #343465
6196 * class.cs: Explicit method name for nested types uses dots only.
6198 2007-12-27 Marek Safar <marek.safar@gmail.com>
6200 A fix for bug #343707
6201 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
6203 2007-12-27 Marek Safar <marek.safar@gmail.com>
6205 * ecore.cs: Report type inference errors only when arguments count matches
6208 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
6210 * expression.cs, report.cs: New warning.
6212 * typemanager.cs: Catch anonymous method type too.
6214 2007-12-23 Marek Safar <marek.safar@gmail.com>
6216 A fix for bug #346379
6217 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
6219 2007-12-23 Marek Safar <marek.safar@gmail.com>
6221 A fix for bug #347359
6222 * expression.cs (Invocation): Don't resolve already resolved expression.
6224 2007-12-23 Marek Safar <marek.safar@gmail.com>
6226 A fix for bug #347189
6227 * class.cs (FixedField): Use non-dependent code only in the define phase.
6229 2007-12-23 Marek Safar <marek.safar@gmail.com>
6231 A fix for bug #348076
6232 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
6234 2007-12-22 Marek Safar <marek.safar@gmail.com>
6236 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
6237 discovered extension methods.
6239 2007-12-22 Marek Safar <marek.safar@gmail.com>
6241 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
6244 2007-12-21 Miguel de Icaza <miguel@novell.com>
6246 * report.cs (ErrorMessage): Add support for using colors on
6247 terminals that support it.
6249 2007-12-21 Marek Safar <marek.safar@gmail.com>
6251 * ecore.cs: Use information about expanded params for error reporting.
6253 2007-12-21 Marek Safar <marek.safar@gmail.com>
6255 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
6256 and logic for params overloads.
6258 2007-12-15 Miguel de Icaza <miguel@novell.com>
6260 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
6261 as this is also created from the parser. Fixes #349034
6263 2007-12-12 Miguel de Icaza <miguel@novell.com>
6265 * statement.cs (Throw.CloneTo): it is valid to have empty
6266 expressions for throw.
6268 2007-12-03 Marek Safar <marek.safar@gmail.com>
6270 * cs-parser.jay: Set delegate constraint parsing region correctly.
6272 2007-12-03 Marek Safar <marek.safar@gmail.com>
6274 A fix for bug #345467
6275 * typemanager.cs (IsEqual): Compare generic parameters position only.
6277 2007-11-28 Marek Safar <marek.safar@gmail.com>
6279 * expression.cs (BaseAccess): Type arguments can be null.
6281 2007-11-27 Raja R Harinath <harinath@gmail.com>
6283 * statement.cs (Block.Resolve): Ensure flow-branching tree is
6284 consistent even when an error has occured.
6285 (Switch.Resolve): Likewise.
6287 2007-11-22 Marek Safar <marek.safar@gmail.com>
6289 A fix for bug #334505
6290 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
6293 2007-11-22 Marek Safar <marek.safar@gmail.com>
6295 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
6296 refactorings required to resolve extension methods correctly when mixing
6297 generics and non-generics members.
6299 2007-11-20 Marek Safar <marek.safar@gmail.com>
6301 A fix for bug #342584
6302 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
6305 2007-11-19 Marek Safar <marek.safar@gmail.com>
6307 A fix for bug #342512
6308 * delegate.cs: Use delegate argument expression when is available. Don't
6309 emit virtual call when class is sealed.
6311 2007-11-16 Marek Safar <marek.safar@gmail.com>
6313 A fix for bug #325423
6314 * assign.cs (FieldInitializer): Use resolved expression for emit.
6316 * class.cs: Print less confusing error message.
6318 2007-11-16 Marek Safar <marek.safar@gmail.com>
6320 * cs-tokenizer.cs: Removed GMCS ifdefs.
6322 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
6325 * cs-parser.jay: Disabled nullable check.
6327 * generic-mcs: Copied more generic stuff.
6329 2007-11-16 Marek Safar <marek.safar@gmail.com>
6331 * gcs-parser.jay: Merged to cs-parser.jay.
6333 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
6334 * *.csproj, *.sources: Updated to use only jay parser file.
6336 2007-11-16 Marek Safar <marek.safar@gmail.com>
6338 * gcs-parser.jay: Added nullable and default expression feature checks.
6340 2007-11-16 Marek Safar <marek.safar@gmail.com>
6342 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
6343 it fixes many TODOs and hidden bugs.
6345 * expression: Removed duplicate error check.
6347 2007-11-15 Marek Safar <marek.safar@gmail.com>
6349 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
6350 implicitly type local variable only when it is used in a declaration.
6352 2007-11-15 Marek Safar <marek.safar@gmail.com>
6354 * attribute.cs: Use CS0612 for empty strings.
6356 2007-11-14 Marek Safar <marek.safar@gmail.com>
6358 * lambda.cs, statement.cs: Contextual return may act as a statement.
6360 2007-11-14 Marek Safar <marek.safar@gmail.com>
6362 A fix for a regression cause by #324222
6363 * class.cs: Don't report unused even when it implements an interface.
6365 2007-11-13 Marek Safar <marek.safar@gmail.com>
6367 A fix for bug #341205
6368 * ecore.cs, expression.cs: Method group expression cannot do static
6369 method access with an instance reference check before overloading takes
6372 2007-11-13 Marek Safar <marek.safar@gmail.com>
6374 A fix for bug #325359
6375 * class.cs: Use predictable name for automatically generated property.
6377 2007-11-12 Marek Safar <marek.safar@gmail.com>
6379 A fix for bug #324996
6380 * expression.cs (Is): Handle case where D is nullable and T is not
6383 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
6385 2007-11-12 Marek Safar <marek.safar@gmail.com>
6387 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
6388 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
6389 Flush small error reporting changes.
6391 2007-11-09 Marek Safar <marek.safar@gmail.com>
6393 A fix for bug #324996
6394 * expression.cs: Rewrote Is expression implementation to work with
6395 generics, nullable types, anonymous method. A const result expression
6396 uses existing infrastructure instead of custom not fully-featured one.
6398 2007-11-08 Marek Safar <marek.safar@gmail.com>
6400 A fix for bug #340202
6401 * class.cs: Consider generics for volatile field.
6403 2007-11-08 Marek Safar <marek.safar@gmail.com>
6405 A fix for bug #335594
6406 * expression.cs: Use conversion rules when handling string addition.
6408 2007-11-07 Marek Safar <marek.safar@gmail.com>
6410 A fix for bug #336651
6411 * expression.cs: Fixed a crash when probing is on.
6413 2007-11-07 Marek Safar <marek.safar@gmail.com>
6415 A fix for bug #324242
6416 * covert.cs: Added a conversion from any nullable-type with an
6417 underlying enum-type to the type System.Enum.
6419 2007-11-07 Marek Safar <marek.safar@gmail.com>
6421 A fix for bug #324222
6422 * class.cs: Report all non-used event fields.
6424 2007-11-07 Marek Safar <marek.safar@gmail.com>
6426 A fix for bug #325161
6427 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
6428 qualifier for generic types.
6430 2007-11-07 Marek Safar <marek.safar@gmail.com>
6432 A fix for bug #322971
6433 * expression.cs, ecore.cs: Added intermediate result value check for
6436 2007-11-07 Marek Safar <marek.safar@gmail.com>
6438 A fix for bug #324754
6439 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
6440 when it was requested.
6442 2007-11-07 Marek Safar <marek.safar@gmail.com>
6444 A fix for bug #325101
6445 * expression.cs: Do type not value comparison for `is' expression.
6447 2007-11-07 Marek Safar <marek.safar@gmail.com>
6449 A fix for bug #320236
6450 * convert.cs: Don't apply user conversion on underlying target type.
6452 2007-11-06 Marek Safar <marek.safar@gmail.com>
6454 * expression.cs: Don't use unresolved expression for error reporting.
6456 2007-11-06 Marek Safar <marek.safar@gmail.com>
6458 A fix for bugs #337712, #324490
6459 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
6460 overloading resolution too.
6462 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
6463 the process consistent and more robust.
6465 * expression.cs, linq.cs, report.cs: Update.
6467 2007-11-02 Marek Safar <marek.safar@gmail.com>
6469 A fix for bug #332909
6470 * attribute.cs: Resolve attributes in correct context using error
6473 * rootcontext.cs: Define Obsolete attribute members as core members.
6475 2007-11-02 Marek Safar <marek.safar@gmail.com>
6477 * statement.cs: Removed unused methods.
6479 2007-10-31 Wade Berrier <wberrier@novell.com>
6481 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
6482 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
6485 2007-10-31 Marek Safar <marek.safar@gmail.com>
6487 A fix for bug #338102
6488 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
6489 methods registered as non-generics.
6491 2007-10-31 Marek Safar <marek.safar@gmail.com>
6493 A fix for bugs #337712, #324490
6494 * delegate.cs: Delegate covariance and contravariance is not allowed for
6497 2007-10-31 Marek Safar <marek.safar@gmail.com>
6499 A fix for bug #337719
6500 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
6503 2007-10-30 Marek Safar <marek.safar@gmail.com>
6505 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
6507 2007-10-29 Marek Safar <marek.safar@gmail.com>
6509 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
6512 2007-10-29 Raja R Harinath <rharinath@novell.com>
6514 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
6516 2007-10-29 Marek Safar <marek.safar@gmail.com>
6518 A fix for bug #334652
6519 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
6520 extension methods when we have not found the best candidate in normal
6523 2007-10-27 Marek Safar <marek.safar@gmail.com>
6525 * AssemblyInfo.cs: Keep up-to-date.
6527 2007-10-27 Marek Safar <marek.safar@gmail.com>
6529 * Makefile: Fixed generics compiler name.
6531 2007-10-27 Marek Safar <marek.safar@gmail.com>
6533 * lambda.test: removed, lambda parsing is done differently.
6535 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
6537 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
6539 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
6541 2007-10-27 Marek Safar <marek.safar@gmail.com>
6543 * Makefile, *.sources : All C# compilers are in mcs folder.
6545 * *.cs: Use existing 2_1 define for smcs.
6547 2007-10-26 Marek Safar <marek.safar@gmail.com>
6549 A fix for bug #335847
6550 * assign.cs, expression.cs: Couple of changes to avoid creating a
6551 temporary variable for each object initializer assignment statement. It
6552 simplifies struct initialization too, otherwise two temporary variables
6554 Implemented optimization of redundant default element initializers.
6556 2007-10-25 Marek Safar <marek.safar@gmail.com>
6558 A fix for bug #336766
6559 * expression.cs (Class.CheckBase): Use generic name when method is
6562 2007-10-25 Marek Safar <marek.safar@gmail.com>
6564 A fix for bug #334737
6565 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
6566 variable and not variable argument for prepared copies.
6568 2007-10-24 Marek Safar <marek.safar@gmail.com>
6570 A fix for bug #325110
6571 * class.cs, expression.cs, attribute.cs: Use open generic method when
6572 checking conditional attribute.
6574 2007-10-24 Marek Safar <marek.safar@gmail.com>
6576 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
6577 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
6578 FeatureIsNotAvailable.
6580 2007-10-24 Marek Safar <marek.safar@gmail.com>
6582 ** C# 3.0 Partial methods
6584 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
6585 methods support. Because of member cache issue with generics only
6586 non-generics partial methods are fully supported.
6588 2007-10-23 Marek Safar <marek.safar@gmail.com>
6590 * class.cs, decl.cs: Rewrote member overloads check to cope with
6591 generics and to use member cache for member checking. It also improves
6592 performance and fixes remaining overloads issues.
6594 2007-10-20 Marek Safar <marek.safar@gmail.com>
6596 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
6597 roottypes.cs, typemanager.cs:
6599 A member cache creation logic changed to add members immediately and
6600 not rely on fallback. The member cache is now only prefered way
6601 how to access and find type declaration members. It saves 5 MB of memory
6602 during MWF compilation and makes code ready for more optimizations and
6603 clean-ups, it's also a pre-requirement for partial methods.
6605 2007-10-18 Raja R Harinath <harinath@gmail.com>
6607 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
6608 handling for generic parameters.
6610 2007-10-15 Marek Safar <marek.safar@gmail.com>
6612 * class.cs (FixedField): Removed redundant volatile check.
6614 2007-10-15 Marek Safar <marek.safar@gmail.com>
6616 * class.cs, decl.cs: Fixed overload members verification to do only one
6617 check per possible collision.
6619 2007-10-13 Marek Safar <marek.safar@gmail.com>
6621 A fix for bug #325478
6622 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
6623 and create only one disposable flags container.
6625 2007-10-12 Marek Safar <marek.safar@gmail.com>
6627 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
6628 * statement.cs (Fixed): Fixed variables cloning.
6630 2007-10-12 Marek Safar <marek.safar@gmail.com>
6632 A fix for bug #333342
6633 * class.cs (EventField): Don't mark value type event as synchronized.
6635 2007-10-12 Marek Safar <marek.safar@gmail.com>
6637 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
6638 inference to identify best candidate method correctly.
6639 (ProperyExpr): A range variable is read only and cannot be modified.
6641 2007-10-11 Marek Safar <marek.safar@gmail.com>
6643 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
6644 logic to identify best candidate method correctly.
6646 2007-10-11 Marek Safar <marek.safar@gmail.com>
6648 * location.cs (Equals, GetHashCode): Removed.
6650 2007-10-11 Marek Safar <marek.safar@gmail.com>
6652 * report.cs: Implemented message recorder. It is used mainly for lambda
6653 expressions to capture otherwise swallowed error messages.
6655 * anonymous.cs, lambda.cs.cs: Do full parameters check.
6657 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
6659 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
6661 * expression.cs (MemberAccess): Always report lookup failure.
6663 * location.cs: Implemented Equals, GetHashCode.
6665 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
6667 2007-10-10 Jb Evain <jbevain@novell.com>
6669 * codegen.cs: re-enable assembly version check.
6671 2007-10-09 Marek Safar <marek.safar@gmail.com>
6673 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
6676 * namespace.cs (UsingAlias): Do correct version check.
6678 2007-10-08 Marek Safar <marek.safar@gmail.com>
6680 * expresison.cs, ecore.cs: Issue extension method error message when
6683 * rootcontext.cs: Added ISO_2 compiler mode option.
6685 2007-10-08 Marek Safar <marek.safar@gmail.com>
6687 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
6690 2007-10-08 Marek Safar <marek.safar@gmail.com>
6692 * attribute.cs (GetString, GetBoolean): Work with both literal and
6695 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
6696 Moved method overload specific methods to MethodGroupExpr.
6698 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
6699 it should be less memory consuming.
6701 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
6703 * codegen.cs: remove the assembly version check until the buildbot is
6706 2007-10-07 Jb Evain <jbevain@novell.com>
6708 * attribute.cs (Attribute.GetString): if the value
6709 expression is a StringConstant, return its string value.
6711 2007-10-07 Jb Evain <jbevain@novell.com>
6713 * typemanager.cs: add `assembly_version_attribute_type`.
6714 * codegen.cs: on attribute emission, check that the
6715 AssemblyVersionAttribute doesn't overflow.
6717 2007-10-05 Marek Safar <marek.safar@gmail.com>
6719 A fix for bug #324677
6720 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
6721 parent container of a scope container with currently resolved one.
6723 2007-10-05 Marek Safar <marek.safar@gmail.com>
6725 A fix for bug #325534
6726 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
6729 2007-10-05 Marek Safar <marek.safar@gmail.com>
6731 A fix for bug #327504
6732 * class.cs (Operator.Define): Refactored implicit and explicit user
6733 operator conversion rules.
6735 2007-10-05 Marek Safar <marek.safar@gmail.com>
6737 A fix for bug #327520
6738 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
6740 2007-10-04 Marek Safar <marek.safar@gmail.com>
6742 A fix for bug #328022
6743 * class.cs (MethodData.Define): Use correct method to check whether
6744 a method implementents an accessor.
6746 2007-10-04 Marek Safar <marek.safar@gmail.com>
6748 A fix for bug #330069
6749 * statement.cs (Fixed.Resolve): Read the first array element only when
6750 an array is instantiated.
6752 2007-10-04 Marek Safar <marek.safar@gmail.com>
6754 * expression.cs, assign.cs, generics.cs: Print correct operator when
6755 compound assignment is used.
6757 2007-10-04 Marek Safar <marek.safar@gmail.com>
6759 A fix for bug #325841
6760 * expression.cs (ArrayAccess): Use full argument cloning only for
6761 string compound concatenation.
6763 2007-10-03 Marek Safar <marek.safar@gmail.com>
6765 A fix for bug #328774
6766 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
6768 (PropertyExpr.EmitAssign): Fixed string concatenation compound
6771 2007-10-03 Raja R Harinath <rharinath@novell.com>
6774 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
6775 Event accessibility checks here. Remove some bogus code that
6776 accidently made GenericMethods work.
6777 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
6779 2007-09-25 Marek Safar <marek.safar@gmail.com>
6781 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
6783 * statement.cs (Block): Refactored AddVariable to allow error handling
6786 * generic.cs: New stub.
6788 2007-09-23 Marek Safar <marek.safar@gmail.com>
6790 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
6793 2007-09-17 Marek Safar <marek.safar@gmail.com>
6795 * class.cs: Use partial container to record whether any partial part
6796 contains static field initializer and therefore default contructor has
6799 2007-09-14 Marek Safar <marek.safar@gmail.com>
6801 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
6802 mono-list when only one of two partial parts has defined accessibility
6805 2007-09-14 Marek Safar <marek.safar@gmail.com>
6807 A fix for bug #82845
6809 * class.cs (TypeContainer): Set correct resolve context for all field
6812 2007-09-13 Marek Safar <marek.safar@gmail.com>
6814 * assign.cs: Fixed a crash when field is resolved twice with an error.
6816 * codegen.cs: Changed InFieldInitializer to be flag.
6818 * anonymous.cs, ecore.cs, expression.cs: Update after
6819 IsInFieldInitializer rename.
6821 * const.cs: Removed unused parameter.
6823 * class.cs: Changed the way how we resolve and emit field initializers.
6824 The field initilizers have to have access to contructor block to emit
6825 compiler generated code.
6827 2007-09-13 Marek Safar <marek.safar@gmail.com>
6829 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
6830 generics use TypeContainer instead.
6832 2007-09-12 Marek Safar <marek.safar@gmail.com>
6834 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
6836 * lambda.cs (ResolveParameters): Use more powerful
6837 InflateGenericArgument.
6839 * parameters.cs: Better exception message.
6841 2007-09-10 Marek Safar <marek.safar@gmail.com>
6843 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
6844 correct expression block type.
6846 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
6848 * expression.cs (Invocation): Extracted method group resolve to
6851 2007-09-07 Marek Safar <marek.safar@gmail.com>
6853 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
6854 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
6856 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
6857 generic extension methods.
6859 2007-09-06 Marek Safar <marek.safar@gmail.com>
6861 A fix for bug #82676 (Do I get it right now?)
6862 * convert.cs (Binary.ResolveOperator): An interface is converted to the
6863 object before a standard conversion is applied.
6865 2007-09-06 Marek Safar <marek.safar@gmail.com>
6867 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
6870 2007-09-05 Marek Safar <marek.safar@gmail.com>
6872 A fix for bug #82676
6873 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
6874 non-generic interface types.
6876 2007-09-05 Marek Safar <marek.safar@gmail.com>
6878 A fix for bug #82690
6879 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
6881 2007-09-05 Marek Safar <marek.safar@gmail.com>
6883 A fix for bug #82571
6884 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
6885 modifier for container based methods.
6887 2007-09-05 Marek Safar <marek.safar@gmail.com>
6889 A fix for bug #82676
6890 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
6891 any interface-type T means to any of interface type T.
6893 2007-09-04 Marek Safar <marek.safar@gmail.com>
6895 * namespace.cs: We have 2 versions of System.Core assembly.
6897 2007-09-04 Marek Safar <marek.safar@gmail.com>
6899 A fix for bug #82652
6900 * class.cs (Class.GetClassBases): Compare types and not expressions.
6902 2007-09-04 Marek Safar <marek.safar@gmail.com>
6904 A fix for bug #82620
6905 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
6906 actually never worked before.
6907 (IndexerAccess): Emit prepared arguments before they are modified.
6909 2007-09-04 Marek Safar <marek.safar@gmail.com>
6911 A fix for bug #82563
6912 * assign.cs: Revert wrong fix.
6914 * expression.cs (VariableReference.EmitAssign): Handle ref reference
6916 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
6917 Instead of ldelema/stdind we have to use temporary variables to handle
6918 cases like String.Concat (params string[]).
6920 2007-08-31 Marek Safar <marek.safar@gmail.com>
6922 * class.cs: EmitAttributes to Emit rename.
6924 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
6926 (MemberCore.HasClsCompliantAttribute): Don't depend on
6927 GetClsCompliantAttributeValue execution.
6929 2007-08-31 Marek Safar <marek.safar@gmail.com>
6931 * anonymous.cs: Use shorter type prefix.
6933 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
6936 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
6937 variables when probing is on.
6939 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
6940 unresolved variables.
6941 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
6942 handle transparent identifiers.
6944 2007-08-26 Marek Safar <marek.safar@gmail.com>
6946 * attribute.cs (IsClsCompliant): Add nullable types test.
6948 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
6950 * doc.cs : catch other types of exception than XmlException to
6951 report CS1570. Fixed bug #82565.
6953 2007-08-23 Marek Safar <marek.safar@gmail.com>
6955 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
6956 The number of delegate parameters has to match.
6957 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
6960 2007-08-21 Marek Safar <marek.safar@gmail.com>
6962 * anonymous.cs (AnonymousMethod): Generate private anonymous method
6963 to fix problem with private arguments.
6965 2007-08-20 Marek Safar <marek.safar@gmail.com>
6967 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
6969 * decl.cs (MemberName): Ignore generic type with no generic arguments.
6971 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
6972 empty. Add cloning suport.
6974 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
6976 2007-08-20 Marek Safar <marek.safar@gmail.com>
6978 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
6979 to create EmptyCast. It handles EmptyConstantCast specialization for
6982 2007-08-18 Marek Safar <marek.safar@gmail.com>
6984 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
6985 (EmitArrayArgument): One routine for array arguments.
6986 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
6988 2007-08-17 Marek Safar <marek.safar@gmail.com>
6990 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
6992 2007-08-17 Marek Safar <marek.safar@gmail.com>
6994 * anonymous.cs: MemberLookupFinal update.
6996 * class.cs (ConstructorInitializer): Is expression based.
6998 * delegate.cs: MethodGroupExpr update.
7000 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
7002 (Error_MemberLookupFailed): Customizable error override.
7003 (MethodGroupExpr): Keep queried type for later usage.
7004 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
7007 * expression.cs: Error_MemberLookupFailed refactoring.
7008 (New.DoResolve): Resolve as much as possible.
7009 (ElementInitializer.Error_MemberLookupFailed): Object initializer
7010 customization for invalid member types.
7012 * statement.cs: MethodGroupExpr update.
7014 2007-08-16 Marek Safar <marek.safar@gmail.com>
7016 * modifier.cs (Check): Check all modifiers and not only accessibility
7019 2007-08-16 Marek Safar <marek.safar@gmail.com>
7021 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
7022 type and not an expression.
7024 2007-08-16 Marek Safar <marek.safar@gmail.com>
7026 * statement.cs (Catch.Clone): Type and variable can be null.
7028 2007-08-16 Marek Safar <marek.safar@gmail.com>
7030 A fix for bug #81979
7031 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
7032 I am really not sure whether this is the best fix.
7034 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
7037 2007-08-14 Marek Safar <marek.safar@gmail.com>
7039 ** C# 3.0 Object and collection initializers (major re-write)
7041 * assign.cs (DoResolve): Initializers are not assign related.
7043 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
7044 used during collection or object initialization.
7046 * expression.cs (Error_InvalidArguments): Add initializers specific
7047 messages. More will come later because it requires some general
7049 (New.DoResolve): Better error handling for unsafe types.
7050 (EmptyExpressionStatement): New class.
7051 (ElementInitializer): An object initializer expression.
7052 (CollectionElementInitializer): A collection initializer expression.
7053 (CollectionOrObjectInitializers): A block of object or collection
7055 (NewInitialize): New expression with element/object initializers.
7057 * statement.cs: Reverted object/collection initializer hacks.
7059 * typemanager.cs (CSharpName): Filter __arglist type.
7061 2007-08-09 Marek Safar <marek.safar@gmail.com>
7063 ** C# 3.0 Anonymous Types (update to the latest standard)
7065 * expression.cs (Binary.ResolveOperator): Threat all null based types
7067 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
7068 (AnonymousTypeParameter): Updated.
7070 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
7071 (AnonymousTypeClass): New anonymous type container.
7073 * class.cs (AddField): Return operation result.
7075 * generic.cs: Another empty TypeArguments overload.
7077 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
7078 are stored at top of normal hierarchy.
7080 * typemanager.cs (CSharpName): Filter anonymous types.
7082 2007-08-09 Marek Safar <marek.safar@gmail.com>
7084 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
7085 as single Concat call. How could we miss that :-(
7087 2007-08-08 Marek Safar <marek.safar@gmail.com>
7089 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
7091 2007-08-07 Miguel de Icaza <miguel@novell.com>
7093 * expression.cs: Fix the previous commit, the creation of the
7094 arguments array list needs also to be conditional on the arguments
7097 * class.cs: Add a little bit of help to help narrow down problems.
7099 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
7100 not try to copy in that case.
7102 * driver.cs: When building SMCS, include a new different set of
7103 default assemblies here. Do this here so we can control whether
7104 to include the default assemblies with /noconfig.
7106 2007-08-03 Marek Safar <marek.safar@gmail.com>
7108 A fix for bug #81979
7109 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
7112 2007-08-03 Marek Safar <marek.safar@gmail.com>
7114 A fix for bug #82300
7116 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
7117 we are in probing scope.
7119 2007-08-03 Marek Safar <marek.safar@gmail.com>
7121 A fix for bug #82301
7123 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
7124 (Statement.CloneTo): Clone and not map children blocks.
7126 2007-08-03 Marek Safar <marek.safar@gmail.com>
7128 A fix for bug #82299
7130 * expression.cs (LocalVariableReference.CloneTo): Remap local info
7133 * statement.cs (Statement.CloneTo): Clone variables before statements
7134 to allow remaping of local variables.
7136 2007-08-03 Marek Safar <marek.safar@gmail.com>
7138 A fix for bug #82296
7141 * report.cs: Log crash details for future clone problems.
7143 * statement.cs (Return.Clone): Don't clone non-existent expression.
7145 2007-08-03 Raja R Harinath <harinath@gmail.com>
7147 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
7148 (Class.AddBasesForPart): Move CS0537 check here from ...
7149 * cs-parser.jay (class_declaration): ... here. Move calling of
7150 'AddBasesForPart' to ...
7151 (class_bases): ... here.
7152 (struct_declaration, interface_declaration): Update to changes.
7154 2007-08-02 Marek Safar <marek.safar@gmail.com>
7156 A fix for bug #81923
7158 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
7159 conversion is allowed.
7161 2007-08-02 Marek Safar <marek.safar@gmail.com>
7163 A fix for bug #81564
7165 * ecore.cs (EventExpr): Add IsBase handling.
7167 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
7170 2007-08-02 Raja R Harinath <harinath@gmail.com>
7172 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
7173 * cs-parser.jay: Some whitespace cleanups.
7174 (current_delegate): New.
7176 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
7177 a dummy code block, and use 'type_name' instead of 'member_name'.
7178 (interface_declaration, class_declaration): Likewise.
7179 (delegate_declaration): Likewise. Rearrange slightly and use
7181 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
7182 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
7184 2007-08-02 Marek Safar <marek.safar@gmail.com>
7186 A fix for bug #82039
7188 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
7191 * typemanager.cs (CSharpName): Split to string overload.
7193 2007-08-02 Marek Safar <marek.safar@gmail.com>
7196 * report.cs: Updated warning CS0472.
7198 2007-08-01 Marek Safar <marek.safar@gmail.com>
7200 A fix for bug #82181
7202 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
7204 2007-08-01 Marek Safar <marek.safar@gmail.com>
7206 A fix for bug #82277
7207 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
7209 2007-08-01 Marek Safar <marek.safar@gmail.com>
7211 ** C# 3.0 Type Inference (major bits are working)
7213 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
7214 (.ImplicitStandardConversionExists): Uses compatible.
7215 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
7216 (.InferReturnType): New method.
7217 (.Compatible): Refactored.
7218 (.ResolveParameters): Uses factory to create resolved parameters.
7219 (.CompatibleMethod): Add probing mode support.
7220 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
7221 clearly distinguish between 2 different operations.
7222 (LambdaMethod): Moved to lambda.cs.
7223 (AnonymousMethod): Removed unused fields and methods.
7224 (AnonymousDelegate): Simplified.
7226 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
7228 * convert. cs (ImplicitConversionStandard): Compatible works differently.
7230 * delegate.cs (Delegate): New mehods to reduce code duplication.
7231 (.GetConstructor): New method.
7232 (.GetInvokeMethod): New method.
7233 (DelegateCreation): Updated.
7235 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
7237 (OverloadResolve): Made probing little bit faster.
7239 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
7242 * generic.cs (TypeInferenceContext): Dummy implementation.
7244 * iterators.cs: Updated after Resolve/Define rename.
7246 * lambda.cs (LambdaExpression)
7247 (.ResolveParameters): Handles both type of arguments and type inference too.
7249 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
7250 (InflateTypes): Updated.
7252 * support.cs (InflateTypes): Changed signature and updated.
7254 * typemanager.cs (LookupMemberCache): Better dynamic type check.
7255 (MemberLookup_FindMembers): More MS tricks.
7256 (GetParameterData): Ditto.
7257 (GetDelegateParameters): Uses quick path for dynamic types.
7259 2007-08-01 Marek Safar <marek.safar@gmail.com>
7261 * class.cs (MethodData.Define): EmitContext is required for generic stuff
7264 2007-07-31 Marek Safar <marek.safar@gmail.com>
7266 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
7269 2007-07-26 Jb Evain <jbevain@novell.com>
7271 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
7272 which takes a boolean 'report_errors', similar to the GetMethod.
7273 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
7274 in .net 2.1, do not report errors here.
7276 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
7277 System.Runtime.CompilerServices.RequiredAttributeAttribute and
7278 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
7281 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
7282 of the type InternalsVisibleToAttribute before the first call
7283 to CoreLookupType which is allowed to fail (third boolean parameter
7284 to true). Because, during the resolution for a type that is not
7285 immediately found, we try to check if the type is not defined in
7286 a friend assembly, and to do so, we need the
7287 InternalVisibleToAttribute.
7289 2007-07-23 Miguel de Icaza <miguel@novell.com>
7291 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
7292 feature that allows structs to be compared against null and inline
7293 the result as true or false.
7295 Notice that the same code is not permitted inside a generic block
7296 of code that would do:
7298 class Foo<T> where T : struct {
7305 It is only allowed if the type of T is not bound (no where
7306 clause). In my opinion, this CSC 2 behavior is broken but people
7307 seem to be using it (IronRuby does, a few bug reports on bugzilla
7308 have it and some people have complained about it).
7310 All of the users that depend on this behavior have code that is
7313 * report.cs (Warning, Error): make these take object arguments,
7314 not strings, as that allows us to take advantage of Format.
7316 2007-07-20 William Holmes <billholmes54@gmail.com>
7318 * decl.cs: Changed MemberName.CountTypeArguments to also check the
7319 Left member variable for the Count.
7320 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
7321 MemberName.CountTypeArguments to avoid a NRE.
7323 This code is contributed under the MIT X11 license
7325 2007-07-18 Marek Safar <marek.safar@gmail.com>
7327 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
7329 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7331 * doc.cs : generic method arguments are written as ``x while generic
7332 type arguments are `x. Combined with the previous change, fixed bug
7335 2007-07-18 Raja R Harinath <rharinath@novell.com>
7338 * expression.cs (Binary.ResolveOperator): When converting
7339 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
7341 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7343 * doc.cs : when T: or whatever x: is specified, it does not really
7344 check the doc comment's syntax correctness. Fixed bug #82006.
7346 2007-07-18 Marek Safar <marek.safar@gmail.com>
7348 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
7349 LambdaExpression better.
7351 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
7353 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
7355 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
7356 as it can be generated.
7358 * expression.cs (Invocation.Error_InvalidArguments): Show correct
7361 * lambda.cs (LambdaExpression): Refactored to share same code with
7362 AnonymousMethodExpression.
7364 2007-07-17 Marek Safar <marek.safar@gmail.com>
7366 * anonymous.cs (MakeName): Include host name for easier debugging.
7367 (LambdaMethod): New class for lambda spcecific stuff.
7369 * attribute.cs: Set EmitContext return type.
7371 * class.cs: Set EmitContext return type.
7373 * codegen.cs (EmitContext): Return type cannot be null to stop messing
7374 with null/void meaning.
7376 * iterators.cs (ContainerType): Implemented.
7378 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
7380 * statement.cs (Return): Updated to lambda expressions.
7381 (Block.CloneTo): Parent can be null.
7383 2007-07-13 Marek Safar <marek.safar@gmail.com>
7385 A fix for bug #81917
7386 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
7388 * class.cs (FixedField): Check whether field is in unsafe scope.
7390 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
7391 (FieldExpr.Emit): Fixed buffers cannot be volatile.
7393 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
7396 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
7398 2007-07-13 Marek Safar <marek.safar@gmail.com>
7400 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
7401 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
7404 2007-07-13 Marek Safar <marek.safar@gmail.com>
7406 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
7408 2007-07-13 Marek Safar <marek.safar@gmail.com>
7410 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
7411 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
7413 * codegen.cs(EmitContext): Add ProbingMode flag.
7415 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
7417 * driver.cs: For now set both warning values.
7419 * ecore.cs (SimpleName): Name is readonly.
7420 (MethodGroup.OverloadResolve): One quick path for probing.
7422 * expression.cs (Unary): Set Oper r/o.
7423 (Binary): Set Oper r/o.
7424 (ParameterReference): Set few instance variables as r/o.
7425 (ParameterReference.DoResolveBase): Don't capture aruments when
7427 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
7428 (Arglist): arguments are private.
7429 (SizeOf): type is private and r/o.
7430 (MemberAccess): arguments are private.
7432 * report.cs: Enhanced reporting on/off capabilities.
7434 * lambda.cs: Uses ec.IsInProbingMode.
7435 (ContextualReturn): Derives from return.
7437 * rootcontext.cs: For now set both warning values.
7439 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
7441 (Return.Resolve): Don't die immediately.
7442 (Block.Resolve): Speed-up probing.
7443 (Block.CloneTo): Clone only child blocks.
7445 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
7447 * iterators.cs: reverted Miguel's latest change (r81925) as it
7448 breaks the build in System.
7450 2007-07-13 Miguel de Icaza <miguel@novell.com>
7452 * iterators.cs (Yield.CheckContext): Check for the iterator type
7453 also here as we can call into Yield even in codepaths that are not
7455 (MethodOrOperator is the only path that was checked).
7457 In addition to the standard check, use a more specific check for
7458 constructors to report a more verbose error.
7460 2007-07-12 Miguel de Icaza <miguel@novell.com>
7462 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
7463 report the warning and continue
7465 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
7466 values on the stack on the call to Emit. Use EmitStatement if
7467 possible, or using Emit + Pop if not possible. Fixes #82064
7469 2007-07-12 Raja R Harinath <rharinath@novell.com>
7471 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
7472 avoid try...finally in some cases.
7474 2007-07-10 Marek Safar <marek.safar@gmail.com>
7476 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
7478 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
7479 instead of method. Re-use standard error handling.
7480 (ConstructorInitializer.Emit): Simplified.
7482 * delegate.cs: Updated after Invocation.EmitCall change.
7484 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
7485 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
7486 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
7487 method and don't permanently changing input arguments.
7488 (MethodGroupExpr): Introduced resolved best_candidate, when method group
7489 is resolved it has one of the candidates is the best one which is later
7490 used to emit. Removed a few unused method.
7491 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
7493 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
7494 (Binary.ResolveOperator): Ditto.
7495 (ConditionalLogicalOperator.DoResolve): Ditto.
7496 (Invocation): Uses method group.
7497 (Invocation.DoResolve): Simplified.
7498 (Invocation.EmitCall): Removed useless is_static.
7499 (Invocation.Emit): Delegate to method group.
7500 (Invocation.EmitStatement): Simplified.
7501 (New): Uses method group.
7502 (MemberAccess.DoResolve): Don't destroy original expression.
7504 * statement.cs (ForEach.Resolve): Use null for no method arguments.
7506 2007-07-04 Marek Safar <marek.safar@gmail.com>
7508 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
7511 * lambda.cs: Add custom error message type.
7513 2007-07-03 Marek Safar <marek.safar@gmail.com>
7515 * lambda.cs: Simplified little bit.
7517 * parameter.cs: Introduced ImplicitLambdaParameter.
7518 (Parameters.CreateFullyResolved): New factory instead of ctor.
7522 * delegate.cs: Updated parameter creation.
7524 2007-07-03 Marek Safar <marek.safar@gmail.com>
7526 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
7529 * generic.cs: Synchronized with gmcs.
7531 2007-07-03 Marek Safar <marek.safar@gmail.com>
7533 * class.cs (Indexer): Check return type as soon as possible.
7535 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
7538 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
7540 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
7542 * parameter.cs (Parameter): Use expression type when it is available.
7544 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
7545 method modifier for the first parameter only.
7547 2007-06-24 Marek Safar <marek.safar@gmail.com>
7549 A fix for bug #81938
7550 * typemanager.cs (ChangeType): Fixed couple of char conversions.
7552 * constant.cs: Tide up an exception message.
7554 2007-06-22 Marek Safar <marek.safar@gmail.com>
7556 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
7557 an uninitialized variable is used.
7559 * expression.cs (LocalVariableReference.DoResolve): Ditto.
7561 2007-06-22 Marek Safar <marek.safar@gmail.com>
7563 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
7564 not found error handling.
7566 * expression.cs (ArrayCreation): Removed redundant fields and little bit
7568 (ArrayCreation.ResolveArrayElement): To be ready to customization.
7569 (ArrayCreation.DoResolve): Simplified.
7570 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
7571 its own resolve process.
7572 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
7574 2007-06-20 Marek Safar <marek.safar@gmail.com>
7576 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
7579 2007-06-20 Marek Safar <marek.safar@gmail.com>
7581 * cs-tokenizer.cs: Removed var related stuff.
7583 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
7584 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
7585 a type and a keyword at same time.
7587 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
7590 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
7591 implicitly typed arrays, more changes will follow.
7593 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
7595 2007-06-19 Marek Safar <marek.safar@gmail.com>
7597 * ecore.cs (VarExpr): Removed Handled field.
7599 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
7600 build-in assign functionality.
7601 (ForEach.Resolve): Removed all implicitly typed local variable code and
7603 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
7604 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
7606 2007-06-18 Marek Safar <marek.safar@gmail.com>
7608 * assign.cs: Removed implicitly typed local variable check.
7610 * expression.cs (LocalVariableReference.DoResolve): Add check for self
7611 referencing implicitly typed local variable.
7612 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
7615 * statement.cs (Fixed): Removed unsupported implicitly typed local
7618 2007-06-15 Marek Safar <marek.safar@gmail.com>
7620 * decl.cs (MemberName): Moved all Unbound stuff to parser.
7622 2007-06-14 Marek Safar <marek.safar@gmail.com>
7624 A fix for bugs #81855 and #76274
7625 * attribute.cs (AttachTo): Always set owner for global attributes to
7628 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
7631 * cs-parser.jay: Assembly and module attributes must precede all other
7632 elements except using clauses and extern alias declarations.
7634 2007-06-13 Marek Safar <marek.safar@gmail.com>
7636 A fix for bug #81748
7638 * expression.cs: More checks for non ISO-1 features.
7640 2007-06-12 Marek Safar <marek.safar@gmail.com>
7642 A fix for bug #81807
7643 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
7644 present inside switch statement and it is required by nullable check.
7646 2007-06-12 Marek Safar <marek.safar@gmail.com>
7648 A fix for bug #81840
7649 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
7650 when type matching fails.
7652 * namespace.cs: Tiny error message change.
7654 2007-06-12 Marek Safar <marek.safar@gmail.com>
7656 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
7657 reporting. Added automatic property check.
7659 * class.cs: Updated after CheckAbstractAndExtern relocation.
7660 (AEventPropertyAccessor.GetSignatureForError): Customized.
7662 2007-06-11 Marek Safar <marek.safar@gmail.com>
7664 * class.cs (DefineBaseTypes): Base type can be undefined.
7666 * ecore.cs (TypeLookup): Minor refactoring.
7667 (DoResolveAsTypeStep): Removed redundant check.
7669 * namespace.cs (Lookup): Removed redundant check.
7671 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
7672 ResolveAsTypeTerminal step.
7673 (BootstrapCorlib_*): Simplified.
7674 (PopulateCoreType): Core types can be now external.
7676 2007-06-07 Marek Safar <marek.safar@gmail.com>
7678 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
7680 (InferTypeArguments): Infers anonymous expression type arguments.
7681 (Compatible): Split to Compatible and InferTypeArguments.
7683 * lambda.cs: Updated.
7685 2007-06-08 Marek Safar <marek.safar@gmail.com>
7687 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
7689 2007-06-07 Raja R Harinath <harinath@gmail.com>
7691 Fix #80477, cs0135-2.cs, cs0135-3.cs
7692 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
7693 names to the "known" variables list.
7694 (Block.CheckInvariantMeaningInBlock): Handle the fact the
7695 parameter names are also "known".
7696 (Block.CheckError136): Remove.
7697 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
7700 2007-06-07 Marek Safar <marek.safar@gmail.com>
7702 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
7704 2007-06-06 Marek Safar <marek.safar@gmail.com>
7706 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
7707 internal error not an user error.
7709 * expression.cs (IsApplicable): Refactored to make debugging easier.
7711 * support.cs: More tricks for non-mono runtimes.
7713 * typemanager.cs (CoreLookupType): Made public.
7714 (InitSystemCore): All linq specific stuff moved to linq.cs
7716 2007-06-05 Marek Safar <marek.safar@gmail.com>
7718 * typemanager.cs (CSharpSignature): One more missing build-in types
7720 More tricks for non-mono runtime.
7722 2007-06-05 Raja R Harinath <harinath@gmail.com>
7724 * statement.cs (Block.CheckError136_InParents): Remove.
7725 (Block.AddVariable): Use GetParameterInfo instead.
7726 (ToplevelBlock.ProcessArguments): Likewise.
7728 2007-06-04 Raja R Harinath <rharinath@novell.com>
7730 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
7732 (ToplevelBlock.GetParameterInfo): Split out of ...
7733 (ToplevelBlock.GetParameterRefernce): ... this.
7734 (ToplevelBlock.ParameterMap): Remove.
7735 * expression.cs (ParameterReference): Update to use
7736 ToplevelParameterInfo.
7738 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
7741 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
7742 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
7744 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
7745 (ToplevelBlock.ProcessParameters) ... here.
7746 (ToplevelBlock..ctor): Invoke it.
7748 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
7751 * statement.cs (IKnownVariable): New interface.
7752 (LocalInfo): Implement it.
7753 (ToplevelParameterInfo): New class.
7754 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
7755 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
7756 GetKnownVariableInfo.
7758 2007-06-03 Raja R Harinath <harinath@gmail.com>
7760 Partly speed up CS0136 error checks.
7761 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
7762 'recurse' parameter.
7763 (Block.DoCheckError136): Only check errors in parameters. Move
7764 local variable checks ...
7765 (Block.AddVariable): ... here, and ...
7766 (ToplevelBlock.ResolveMeta): ... here.
7768 2007-06-02 Raja R Harinath <harinath@gmail.com>
7770 * statement.cs (Block.IsChildOf): Remove.
7772 * statement.cs (Statement.Clone): Move special case code ...
7773 (Block.CloneTo): ... here.
7775 2007-05-29 Raja R Harinath <rharinath@novell.com>
7777 * statement.cs (ToplevelBlock.container): Remove field. It's
7778 redundant with 'Parent'.
7779 (ToplevelBlock.ContainerBlock): Remove accessor.
7780 (ToplevelBlock..ctor): Update to changes. Register anonymous
7781 child with parent here, ...
7782 * cs-parser.jay (end_anonymous): ... not here. Don't modify
7784 (start_anonymous): Don't save current_block.
7785 (top_current_block): Remove.
7787 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
7788 (Block.Resolve): Update to changes.
7789 (Block..ctor): Move setting of "correct" 'Toplevel'
7790 and 'Explicit' fields to ...
7791 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
7793 2007-05-27 Raja R Harinath <harinath@gmail.com>
7796 * statement.cs (Block.Implicit): Remove.
7797 (Block): Update to changes.
7798 * flowanalysis.cs: Likewise.
7800 Mildly speed up CheckInvariantMeaningInBlock
7801 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
7802 Recursively call AddKnownVariable to all enclosing blocks.
7803 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
7804 Remove recursive calls.
7805 (Block): Update to changes.
7807 New ExplicitBlock invariants
7808 * statement.cs (Block.Explicit): New field. It points to the
7809 immediately enclosing non-implicit block.
7810 (Block..ctor): Maintain the invariant.
7811 * cs-parser.jay: Take advantage of invariant.
7813 Introduce ExplicitBlock
7814 * statement.cs (ExplicitBlock): New.
7815 (ToplevelBlock): Derive from it.
7816 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
7818 (Block.Implicit): Update to changes.
7819 * cs-parser.jay: Update to changes.
7822 * codegen.cs (EmitContext.IsLastStatement): Remove.
7823 * statement.cs (Block.DoEmit): Update to changes.
7825 2007-05-25 Raja R Harinath <rharinath@novell.com>
7827 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
7828 modifying current_block directly.
7830 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
7832 * class.cs: Implemented automatic properties (C# 3.0)
7833 Thanks to Marek for the help.
7835 2007-05-23 Raja R Harinath <rharinath@novell.com>
7837 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
7838 variable as assigned, note also that all its components are
7840 (MyBitVector.SetRange): New. Function to set multiple bits to true.
7842 2007-05-19 Marek Safar <marek.safar@gmail.com>
7844 * anonymous.cs, class.cs: Emit Compiler generated attribute when
7845 member is marked as compiler generated.
7847 * decl.cs (MemberCore): Refactored ModFlags into property.
7849 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
7850 (Check): Check only accessibility modifiers.
7852 2007-05-18 Raja R Harinath <rharinath@novell.com>
7854 Track all assignable slots in one bit array
7855 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
7856 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
7857 logic from VariableMap constructor here. Use the same 'offset'
7858 variable that's later used for computing offsets of local
7860 * flowanalysis.cs (UsageVector.parameters): Remove.
7861 (UsageVector): Update to changes.
7862 (VariableMap): Remove.
7864 Avoid creating ParameterMap in every block
7865 * statement.cs (Block.ParameterMap): Move ...
7866 (ToplevelBlock.ParameterMap): ... here.
7867 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
7869 * flowanalysis.cs (FlowBranching.param_map): Remove.
7870 (FlowBranching.UsageVector): Update to changes.
7871 (FlowBranchingToplevel.CheckOutParameters): Likewise.
7873 * statement.cs (Block.CloneTo): Clone Toplevel field too.
7875 * expression.cs (ParameterReference): Distinguish between block
7876 where parameter was referenced and declared.
7878 2007-05-18 Marek Safar <marek.safar@gmail.com>
7880 * flowanalysis.cs, statement.cs: Put back improved error handling.
7882 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
7886 Imporved object and collection initialization (C# 3.0).
7888 2007-05-15 Marek Safar <marek.safar@gmail.com>
7890 A fix for bug #81380
7891 * expression.cs (Is.DoResolve): Only value types have constant `is'
7894 2007-05-15 Raja R Harinath <rharinath@novell.com>
7896 * statement.cs (ToplevelBlock.child): Remove.
7898 2007-05-15 Raja R Harinath <harinath@gmail.com>
7900 Rationalize ResolveMeta: refactoring
7901 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
7902 out constant handling code into ...
7903 (Block.DoResolveConstants): ... this.
7905 Rationalize ResolveMeta: kill local_map
7906 * statement.cs (Block.local_map, Block.LocalMap): Remove.
7907 (Block.AssignableSlots): New.
7908 (Block.ResolveMeta): Make protected. Don't create a VariableMap
7909 for locals -- move code from VariableMap here. Avoid unnecessary
7911 * flowanalysis.cs (FlowBranching.local_map): Remove.
7912 (FlowBranching..ctor): Use Block.AssignableSlots.
7913 (VariableMap): Remove unused constructors.
7915 2007-05-11 Raja R Harinath <rharinath@novell.com>
7917 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
7919 2007-05-11 Marek Safar <marek.safar@gmail.com>
7921 * typemanager.cs (IsFriendAssembly): Should not be called for building
7924 2007-05-09 Marek Safar <marek.safar@gmail.com>
7926 * literal.cs (NullConstant): Print null in all cases.
7928 * expression.cs (Binary.ResolveOperator): Implemented delegate
7929 comparison based on C# 2.0 changes.
7931 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
7933 This code is contributed under the MIT X11 license
7935 The following enables support for several C# 3.0 language features:
7937 * cs-tokenizer.cs: Added support for the "var" keyword.
7939 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
7940 Added VarExpr class to facilitate type inferencing.
7942 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
7943 to support anonymous types.
7945 * assign.cs: Added support for type inferencing and initialization.
7947 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
7949 * expression.cs: Added implicit array support to ArrayCreation.
7950 Added 5 types and 1 interface:
7952 IInitializable Implementing classes can inject initializing
7953 statements after object instantiation.
7955 Initializer Stores data for object initialization.
7957 AnonymousType An expression for anonymous types.
7959 AnonymousTypeParameter Stores data about an anonymous type's field.
7961 NewInitialize An expression for object initialization.
7963 CollectionInitialize An expression for collection initialization.
7965 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
7968 2007-05-06 Marek Safar <marek.safar@gmail.com>
7970 A fix for bug #81500
7971 * cs-tokenizer.cs: Add special handling for coalescing operator.
7973 2007-05-06 Marek Safar <marek.safar@gmail.com>
7975 A fix for bug #81529
7976 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
7977 its value from base class until it is redefined.
7979 2007-05-02 Raja R Harinath <rharinath@novell.com>
7981 Fix regression in cs0631-3.cs
7982 * cs-parser.jay (operator_declarator): Add opt_attributes to error
7983 fallback. Make error fallback catch more cases.
7985 2007-05-01 Miguel de Icaza <miguel@novell.com>
7987 * cs-parser.jay: Allow parameters in operator declarations to have
7990 2007-04-27 Miguel de Icaza <miguel@novell.com>
7992 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
7995 * lambda.cs (ContextualReturn.Resolve): An expression is valid
7996 inside the ContextualReturn, it does not have to be an
7997 ExpressionStatement.
7999 2007-04-24 Miguel de Icaza <miguel@novell.com>
8001 * lambda.cs (ContextualReturn.Resolve): if the return type is not
8004 2007-04-23 Miguel de Icaza <miguel@novell.com>
8006 * anonymous.cs (AnonymousContainer): split the virtual Resolve
8007 method in two methods: ResolveNoDefine and Resolve.
8009 ResolveNoDefine will stop just after ResolveTopBlock has been
8012 Resolve will then continue by creating a method and issuing the
8013 call to method.Define ().
8015 (AnonymousMethod): Split and implement the new Resolve and
8016 ResolveNoDefine as well.
8018 * lambda.cs (LambdaExpression): Split the anonymous method
8019 resolution code into a separate routine (CoreCompatibilityTest)
8020 from DoCompatibleTest.
8022 (LambdaExpression.TryBuild): New method, this method tries to
8023 build the LambdaExpression with the given set of types to be used
8024 as the types for the various parameters of the lambda expression.
8026 If the compilation succeed with the given types, the infered type
8027 of the Anonymous method is returned, otherwise null is returned.
8029 2007-04-23 Marek Safar <marek.safar@gmail.com>
8031 A fix for bug #81414
8032 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
8034 2007-04-22 Miguel de Icaza <miguel@novell.com>
8036 * cs-tokenizer.cs: Change various identifiers here from the
8037 camelCasing to the recommended Linux-like style for instance
8038 variables from the Coding Guidelines.
8040 2007-04-19 Martin Baulig <martin@ximian.com>
8043 (Convert.ImplicitReferenceConversionCore): Allow conversions from
8044 System.Enum to System.ValueType.
8046 2007-04-13 Martin Baulig <martin@ximian.com>
8048 Rewrote implicit reference conversions. We need to distinguish
8049 between implicit reference conversions (13.1.4) and implicit
8050 boxing conversions (13.1.5).
8052 According to the spec, there's an an implicit conversion
8053 "From a one-dimensional array-type S[] to IList<T> and base
8054 interfaces of this interface, provided there is an implicit
8055 reference conversion from S to T." Note that this does not
8056 include boxing conversions.
8059 (Convert.ImplicitTypeParameterBoxingConversion): New method.
8060 (Convert.ImplicitReferenceConversion): Split into
8061 ImplicitReferenceConversionCore() and
8062 ImplicitBoxingConversionExist().
8063 (Convert.ImplicitReferenceConversionExists): Use the new
8064 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
8066 2007-04-12 Martin Baulig <martin@ximian.com>
8068 * convert.cs (Convert.ImplicitReferenceConversion): Move the
8069 `TypeManager.null_type' checks up to the top of the method.
8071 2007-04-11 Marek Safar <marek.safar@gmail.com>
8073 A fix for bug #81350
8074 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
8077 2007-04-11 Martin Baulig <martin@ximian.com>
8079 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
8080 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
8081 to make this work for generic classes; fixes #79561.
8083 2007-04-11 Martin Baulig <martin@ximian.com>
8085 * expression.cs (As): Add support for nullable types; fixes #79371.
8087 2007-04-11 Martin Baulig <martin@ximian.com>
8089 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
8090 `type.FullName' is null; fixes #80243.
8092 2007-04-11 Martin Baulig <martin@ximian.com>
8094 * expression.cs (Invocation.IsApplicable): Don't modify the method
8095 if type inference succeeded, but the method was not applicable.
8098 2007-04-10 Marek Safar <marek.safar@gmail.com>
8100 A fix for bug #81324
8101 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
8102 internal and external namespaces containers.
8104 2007-04-10 Martin Baulig <martin@ximian.com>
8106 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
8107 TypeManager.DropGenericMethodArguments() so we also call
8108 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
8110 2007-04-10 Martin Baulig <martin@ximian.com>
8112 * iterators.cs (Iterator.CreateIterator): Don't crash if
8113 `method.ReturnType' is null. This happens if something went wrong
8114 while resolving that typ (we already reported an error in this case).
8116 2007-04-10 Martin Baulig <martin@ximian.com>
8118 * expression.cs (New.DoResolve): Don't call CheckComImport() on
8119 generic interfaces; report the CS0144 directly.
8121 2007-04-10 Martin Baulig <martin@ximian.com>
8123 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
8124 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
8126 2007-04-10 Martin Baulig <martin@ximian.com>
8128 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
8130 2007-04-09 Raja R Harinath <rharinath@novell.com>
8133 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
8134 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
8137 * statement.cs (For.Resolve): If resolution fails, use
8140 2007-04-08 Marek Safar <marek.safar@gmail.com>
8142 * anonymous.cs (MakeName): Make faster and zero-based.
8143 (VerifyExplicitParameterCompatibility): Back to mode where generic
8144 parameter is ignored.
8145 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
8147 * class.cs (EmitType): Method can emit another new method.
8149 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
8151 * driver.cs: Updated.
8153 * lambda.cs: Reuse predefined empty parameters.
8155 * parameter.cs: Updated
8157 * support.cs: Implemented InflateTypes.
8159 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
8160 (InitSystemCore): Introduced to isolate 3.0 dependencies.
8162 2007-04-03 Martin Baulig <martin@ximian.com>
8166 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
8167 version of TypeManager.IsOverride() which also works with generic
8170 2007-04-03 Martin Baulig <martin@ximian.com>
8175 (Convert.ExplicitReferenceConversion): We need to cast when
8176 converting from IList<T> to S[].
8178 2007-04-01 Marek Safar <marek.safar@gmail.com>
8180 * decl.cs (FindExtensionMethods): Consider all candidates with same name
8183 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
8185 2007-03-31 Marek Safar <marek.safar@gmail.com>
8187 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
8188 argument and return type inferring.
8190 * codegen.cs (InferReturnType): Flag whether return can be inferred.
8191 (ReturnType): Turned to property.
8193 * statement.cs (Return): Implemented return type inferring.
8195 * support.cs (ReflectionParameters): Use local types if possible.
8197 2007-03-30 Raja R Harinath <rharinath@novell.com>
8199 * flowanalysis.cs (FlowBranching.Reachability): Remove.
8200 (FlowBranching.UsageVector): Update to changes.
8202 Prepare to kill 'Reachability'
8203 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
8204 argument of constructor.
8206 2007-03-29 Raja R Harinath <rharinath@novell.com>
8208 Prepare to kill 'Reachability'
8209 * flowanalysis.cs (UsageVector.is_unreachable): New.
8210 (UsageVector): Update to maintain 'is_unreachable' in parallel to
8211 'reachability', and verify they're consistent.
8214 * expression.cs (New.EmitStatement): Handle type parameters here too.
8216 2007-03-29 Martin Baulig <martin@ximian.com>
8221 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
8222 CompilerGeneratedClass.
8223 (ScopeInfo.EmitScopeInstance): Make this protected.
8224 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
8225 `ec.CurrentAnonymousMethod.Scope == Scope'.
8227 * statement.cs (Block.ScopeInfo): Make this a property.
8229 2007-03-27 Raja R Harinath <harinath@gmail.com>
8231 Prepare to kill 'Reachability'
8232 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
8233 (FlowBranching.UsageVector.Reachability): Remove property.
8234 (FlowBranching.UsageVector.IsUnreachable): New property.
8235 (FlowBranching.UsageVector.ResetBarrier): New.
8236 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
8237 * codegen.cs, statement.cs: Update to changes.
8239 2007-03-27 Martin Baulig <martin@ximian.com>
8244 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
8247 2007-03-26 Raja R Harinath <rharinath@novell.com>
8249 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
8250 instead of TriState. Remove all mention of TriState.
8252 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
8253 replaced by a boolean. Add boolean 'is_unreachable' field, check
8254 and maintain invariants.
8256 2007-03-25 Marek Safar <marek.safar@gmail.com>
8258 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
8260 2007-03-25 Marek Safar <marek.safar@gmail.com>
8262 * expression.cs: Stop using obsolete 2.0 opcodes.
8264 2007-03-25 Marek Safar <marek.safar@gmail.com>
8266 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
8267 one of the latests Martin's fixes.
8269 2007-03-23 Miguel de Icaza <miguel@novell.com>
8271 * expression.cs: On BigEndian systems, swap the bytes, temporary
8272 solution until we get a new bitconverter class.
8274 2007-03-23 Martin Baulig <martin@ximian.com>
8278 * decl.cs (MemberCache.AddMembers): Add generic methods both as
8279 "Method" and "Method`1". Normally, a cache lookup is done on the
8280 "Method" form (ie. without the generic arity), but this one makes
8281 lookups on the full form work as well.
8283 2007-03-22 Raja R Harinath <rharinath@novell.com>
8285 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
8288 2007-03-20 Bill Holmes <billholmes54@gmail.com>
8290 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
8291 ordered_member_list, to TypeBuilder to store members to be defined
8292 in the order they were parsed in.
8293 - ordered_explicit_member_list contains all properties indexers
8294 and methods that are defined as explicit implementation of an
8295 interface or base class.
8296 - ordered_member_list contains all properties indexers and methods
8297 that are not defined as explicit implementation of an interface
8300 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
8301 functionality in these removed classes has been replaced with
8302 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
8303 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
8305 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
8306 to CheckForDuplications inside GetMethod and SetMethod Define Method
8307 to handle method property and indexer name conflicts.
8311 All code is contributed under the MIT/X11 license.
8313 2007-03-20 Martin Baulig <martin@ximian.com>
8315 * class.cs (TypeContainer.Interfaces): Removed; they're now
8316 included in `TypeContainer.Types'.
8318 2007-03-20 Martin Baulig <martin@ximian.com>
8320 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
8322 * class.cs (TypeContainer.CreateType): New public method. This is
8323 now called before DefineType() to create the TypeBuilders.
8324 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
8325 has already been created by CreateType().
8326 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
8327 don't resolve our base classes here; this has been moved into
8328 DefineBaseTypes(). We're now called from CreateType().
8329 (TypeContainer.DefineBaseTypes): New private method; resolve our
8330 base classes here. We're now called from DefineType().
8333 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
8334 our types first to create all the TypeBuilders. After that, call
8335 TypeContainer.DefineType() on all the types which'll resolve their
8336 base classes and setup the resolve order.
8338 2007-03-20 Martin Baulig <martin@ximian.com>
8340 * class.cs (TypeContainer.Enums): Removed; they're now included in
8341 `TypeContainer.Types'.
8343 2007-03-20 Martin Baulig <martin@ximian.com>
8346 (TypeContainer.DefineType): Don't call ResolveMembers() here.
8347 (TypeContainer.DoResolveMembers): Call DefineType() on our
8348 `compiler_generated' classes; moved here from DefineNestedTypes().
8351 (RootContext.ResolveTree): Call ResolveMembers() on all
8352 TypeContainer's in the `type_container_resolve_order'.
8354 2007-03-19 Marek Safar <marek.safar@gmail.com>
8356 * class.cs: Use corlib to handle InternalMethodImplAttribute.
8358 2007-03-17 Marek Safar <marek.safar@gmail.com>
8360 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
8361 implementation flags.
8363 2007-03-17 Marek Safar <marek.safar@gmail.com>
8365 * class.cs: More optimizations for type parameters.
8367 2007-03-15 Marek Safar <marek.safar@gmail.com>
8369 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
8371 * ecore.cs, parameter.cs: More common code for both corlibs.
8373 * typemanager.cs (IsGenericMethod): Simplified.
8375 2007-03-15 Raja R Harinath <rharinath@novell.com>
8377 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8379 * statement.cs, iterators.cs, lambda.cs: Update to changes.
8381 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
8382 unconditionally. Simplify explanation.
8383 (Try.Resolve, Using.Resolve): Likewise.
8385 2007-03-15 Martin Baulig <martin@ximian.com>
8389 * decl.cs (DeclSpace): If we're a partial class, use our
8390 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
8392 2007-03-15 Raja R Harinath <rharinath@novell.com>
8394 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8396 (FlowBranching.UsageVector): Update to changes.
8397 (FlowBranching.MergeSiblings): Likewise.
8398 * statement.cs: Likewise.
8400 2007-03-15 Martin Baulig <martin@ximian.com>
8405 (MemberCache): Added a special .ctor for type parameters.
8408 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
8411 2007-03-09 Martin Baulig <martin@ximian.com>
8413 * enum.cs (Enum): Make this a TypeContainer.
8414 (EnumMember): Derive from `Const'.
8417 (Const.DoResolveValue): New protected virtual method; move most of
8418 the functionality of ResolveValue() here so we can override it in
8420 (Const.CreateConstantReference): Make this virtual.
8422 * class.cs (Kind): Add `Kind.Enum'.
8423 (TypeContainer.Emit): Don't emit the enums here; they're already
8424 in the `RootContext.typecontainer_resolve_order'.
8426 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
8427 here; they're already in the `typecontainer_resolve_order'.
8429 * ecore.cs (EnumConstant.ConvertImplicitly): Add
8430 TypeManager.DropGenericTypeArguments().
8433 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
8434 (TypeManager.IsEnumType): Likewise.
8435 (TypeManager.EnumToUnderlying): Likewise.
8436 (TypeManager.IsEqual): Add support for enums.
8438 2007-03-12 Raja R Harinath <rharinath@novell.com>
8440 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
8441 DefaultParameterValueAttribute to be undefined, say if System.dll
8444 2007-03-11 Marek Safar <marek.safar@gmail.com>
8446 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
8449 2007-03-10 Marek Safar <marek.safar@gmail.com>
8451 * class.cs, parameter.cs: Unified parameters verification.
8453 2007-03-08 Martin Baulig <martin@ximian.com>
8455 * cs-parser.jay (constructor_header): Pass the location to the
8456 newly created TopLevelBlock.
8458 2007-03-07 Martin Baulig <martin@ximian.com>
8460 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
8462 2007-03-06 Miguel de Icaza <miguel@novell.com>
8464 * convert.cs (ExplicitReferenceConversionExists): Sync this method
8465 with the changes from David, fixes the build.
8467 2007-03-05 David Mitchell <dmitchell@logos.com>
8469 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
8470 and its base interfaces to a one-dimensional array type S[],
8471 provided there is an implicit or explicit reference conversion
8474 2007-03-03 Marek Safar <marek.safar@gmail.com>
8476 * cs-tokenizer.cs: Implemented basic linq grammar.
8478 * driver.cs: Set linq lang version on demand.
8480 2007-02-26 Marek Safar <marek.safar@gmail.com>
8482 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
8484 2007-02-25 Marek Safar <marek.safar@gmail.com>
8486 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
8489 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
8491 Check property and event extern attributes.
8493 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
8496 2007-02-24 Marek Safar <marek.safar@gmail.com>
8498 A fix for bug #80407
8499 * ecore.cs: Don't report ambiguity error when methods have same parent.
8501 2007-02-23 Marek Safar <marek.safar@gmail.com>
8503 A fix for bug #80878
8504 * class.cs, cs-parser.jay: Event property can host anonymous methods.
8506 2007-02-22 Marek Safar <marek.safar@gmail.com>
8508 * attribute.cs: Enable ExtensionAttribute presence test.
8510 2007-02-22 Marek Safar <marek.safar@gmail.com>
8512 * class.cs: Warn about missing GetHashCode only when Equals is override.
8514 * decl.cs: Check accessibility of type arguments.
8516 * typemanager.cs: Correctly report nullable array.
8518 2007-02-20 Marek Safar <marek.safar@gmail.com>
8520 * class.cs, report.cs: Capture more details when things go wrong.
8522 2007-02-20 Marek Safar <marek.safar@gmail.com>
8524 A fix for bug #80650
8525 * cs-parser.jay: Anonymous container starts at constructor declaration
8526 and not at block beginning because it has to be usable in constructor
8529 * statement.cs: Use context location and not block one for error reporting.
8531 2007-02-18 Marek Safar <marek.safar@gmail.com>
8533 A fix for bug #78712
8534 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
8537 2007-02-18 Marek Safar <marek.safar@gmail.com>
8539 A fix for bug #80493 by Atsushi Enomoto
8540 * cs-parser.jay: Ignore invalid attribute target.
8542 2007-02-18 Marek Safar <marek.safar@gmail.com>
8544 * cs-tokenizer.cs: Ignore '\0' as white space character.
8546 2007-02-17 Miguel de Icaza <miguel@novell.com>
8548 * cs-parser.jay: Add support for lambda expressions to the mcs
8551 * lambda.cs: Only clone when we are probing, not on the final call
8552 (Compatible is the final call).
8554 * statement.cs (CloneContext): Introduce class to provide block
8555 remapping during clone.
8557 All statements Clone themselves now.
8559 (Clone): special handling for blocks, when we clone a block, we
8560 register the block inside this routine, as children of the block
8561 might trigger a lookup.
8563 * expression.cs: Add support for CloneContext in all expressions.
8565 2007-02-17 Marek Safar <marek.safar@gmail.com>
8567 A fix for bug #80493
8568 * statement.cs: Report ambiguous warning when interfaces are not related.
8570 2007-02-15 Marek Safar <marek.safar@gmail.com>
8572 C# 3.0 extension methods.
8574 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
8575 cannot be used directly.
8577 * class.cs (Class.Emit): Emit extension attribute if any class method
8578 is extension method.
8579 (Method.Define): Add basic extension method validation conditions.
8580 (Method.Emit): Emit extension attribute for method.
8582 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
8583 extension method exists. Currently we follow same approach as Microsoft
8584 does, emit even if a method or a class are private but this can change
8587 * cs-parser.jay: Add handling of `this' keyword in method parameters
8590 * decl.cs (DeclSpace.IsStaticClass): New property.
8591 (MemberCache.FindExtensionMethods): Looks for extension methods with
8592 defined name and extension type.
8594 * doc.cs: Updated after OverloadResolve changes.
8596 * driver.cs: Add new soft reference to System.Core.dll.
8598 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
8599 (ExtensionMethodGroupExpr): Represents group of extension methods.
8601 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
8602 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
8603 to MethodGroupExpr and made non-static for easier customization.
8604 (Invocation.DoResolve): Add extension method lookup when no standard
8606 (MemberAccess.DoResolve): Try extension methods if no member exists.
8608 * modifiers.cs: Add METHOD_EXTENSION modifier.
8610 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
8611 as well as candidate extension type.
8612 (ComputeNamespaces): When assembly constains extension methods registers
8614 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
8615 extension method lookup.
8616 (Namespace.LookupExtensionMethod): Looks for extension method in this
8618 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
8619 find a method which matches name and extensionType.
8621 * parameter.cs (Parameter): Add This modifer.
8622 (HasExtensionMethodModifier): New property.
8623 (Resolve): Add extension parameter check.
8624 (ModFlags): turned to property to exclude this modifier as it is not real
8626 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
8628 * support.cs (ParameterData): Add ExtensionMethodType.
8629 (ReflectionParameters): Implemented ExtensionMethodType interface property.
8631 * typemanager.cs: Add type and ctor extension attribute type.
8633 2007-02-15 Miguel de Icaza <miguel@novell.com>
8635 * report.cs (DisableErrors, EnableErrors): used to prevent error
8636 output when we are "trying" to compile various methods with
8639 * ecore.cs (Expression): Add Clone method that calls the virtual
8640 CloneTo method. The current CloneTo method in Expression throws
8641 an exception so we can track down all the places where this must
8642 be implemented (not using abstract, because that would be a lot of
8643 up-front-work before we can start testing the implementation
8646 Important: we only need Clone capabilities for expressions created
8647 by the parser, as the expressions we will be cloning are
8648 expressions in the pre-resolved state. This vastly simplifies
8651 (SimpleName): Add CloneTo that does nothing.
8652 (EmptyCast): Add CloneTo.
8654 * expression.cs (Binary): Implement CloneTo.
8655 (Invocation.IsApplicable): Store the current ec in
8656 EmitContext.TempEc and restore it on return. This is used so we
8657 do not have to sprinkle hundres of methods with an extra
8658 EmitContext, we know that the only user is the lambda expression
8659 ImplicitConversionExists code.
8661 (Argument): Add Cloning capabilities.
8662 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
8663 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
8664 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
8665 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
8666 IndexerAccess): Add Clone capability.
8668 (LocalVariableReference, This): TODO: needs cloned Block mapping.
8670 (Argument): Add cloning capability.
8672 * assign.cs (Assign): Implement CloneTo.
8674 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
8676 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
8677 version by calling Convert with the EmitContext (that we are
8678 currently storing in ec, this is not great, but will do for now,
8679 to avoid passing EmitContext parameters to hundreds of functions
8680 that do not need them now).
8682 (SetExpression): Remove, it is not needed.
8684 (ContextualReturn): Implement CloneTo.
8686 * statement.cs (Statement): Implement cloning infrastructure,
8687 similar to expressions.
8689 (Block): Partial implementation of Clone for statements.
8691 (Return): Implement clone.
8693 * constant.cs (Constant.CloneTo): New method, does nothing.
8695 * codegen.cs (TempEc): Add a static EmitContext as a temporary
8696 solution, until we decide how to exactly do this.
8698 2007-02-14 Marek Safar <marek.safar@gmail.com>
8700 A fix for bug #80493
8701 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
8702 a property is override we need to use second accessor.
8704 2007-02-13 Marek Safar <marek.safar@gmail.com>
8706 A fix for bug #80418
8707 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
8710 2007-02-13 Marek Safar <marek.safar@gmail.com>
8712 Another fix for bug #80749
8713 * pending.cs: Abstract class has priority over interfaces.
8715 2007-02-13 Marek Safar <marek.safar@gmail.com>
8717 Another fix for bug #80749
8718 * pending.cs: Abstract class has priority over interfaces.
8720 2007-02-13 Marek Safar <marek.safar@gmail.com>
8722 Another fix for bug #80749
8723 * pending.cs: Abstract class has priority over interfaces.
8725 2007-02-13 Marek Safar <marek.safar@gmail.com>
8727 Another fix for bug #80749
8728 * pending.cs: Abstract class has priority over interfaces.
8730 2007-02-13 Marek Safar <marek.safar@gmail.com>
8732 * class.cs Better error message.
8734 * driver.cs: Add shorter versions of -optimize option.
8736 2007-02-13 Martin Baulig <martin@ximian.com>
8738 * class.cs (Constructor.Emit): Check the return value of
8739 ec.ResolveTopBlock() and return on error.
8741 2007-02-13 Raja R Harinath <rharinath@novell.com>
8743 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
8744 message to fix error message regression.
8746 2007-02-12 Marek Safar <marek.safar@gmail.com>
8748 * delegate.cs: Delegate creation expression cannot be of Nullable type.
8750 2007-02-12 Marek Safar <marek.safar@gmail.com>
8752 A fix for bug #80749
8753 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
8754 its parent container.
8756 * class.cs (DefineFieldInitializers): Each initializer can has different
8759 * const.cs: Updated.
8761 2007-02-11 Miguel de Icaza <miguel@novell.com>
8763 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
8764 now all the heavy lifting to check that embedded statements or
8765 expressions have the right form is done in the ContextualReturn.
8767 (ContextualReturn): New class.
8769 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
8770 method that can be invoked to report 201, so we do not replicate
8773 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
8775 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
8776 treating tabs as spaces.
8778 2007-02-09 Marek Safar <marek.safar@gmail.com>
8780 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
8781 * assign.cs: Use full implicit conversion for right side check.
8783 2007-02-09 Marek Safar <marek.safar@gmail.com>
8785 * statement.cs (Switch): Switch over boolean type is not standardized.
8787 2007-02-08 Marek Safar <marek.safar@gmail.com>
8789 A fix for bug #80755
8790 * decl.cs (FindBaseEvent): Don't use method cache for events.
8792 2007-02-07 Marek Safar <marek.safar@gmail.com>
8794 * cs-parser.jay: Better syntax error handling.
8796 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
8797 instead of underlying type value.
8799 2007-02-06 Marek Safar <marek.safar@gmail.com>
8801 * driver.cs: Check define identifier before is registered.
8803 * namespace.cs: Use existing error message.
8805 * report.cs: New warning.
8807 2007-02-06 Marek Safar <marek.safar@gmail.com>
8809 A fix for bug #80742
8810 * expression.cs: Delegate Invoke method can be called directly.
8812 2007-02-06 Marek Safar <marek.safar@gmail.com>
8814 A fix for bug #80676
8815 * class.cs (IsEntryPoint): The Main method can have params modifier.
8817 2007-02-04 Miguel de Icaza <miguel@novell.com>
8819 * parameter.cs (Parameter, Parameters): Add Clone method.
8821 * anonymous.cs (Compatible): Turn method into virtual method, so
8822 LambdaExpression can implement a different behavior.
8824 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
8825 out the basic checking here, so it can be used by
8828 * lambda.cs: Introduce "Compatible" function that will do the
8831 2007-02-02 Marek Safar <marek.safar@gmail.com>
8833 * attribute.cs: Unified one error message.
8835 * class.cs (Class): Use type attributes and not properties to test static
8837 (IsEntryPoint): Don's pass local variable.
8839 * convert.cs: Removed duplicate check.
8841 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
8843 * driver.cs: Don't crash when soft reference does not exist.
8845 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
8846 (UsingEntry): Removed redundant allocation.
8848 * parameter.cs: Add fast path for type parameters.
8850 * support.cs: Don't allocate attribute when it's not used.
8852 2007-01-30 Miguel de Icaza <miguel@novell.com>
8855 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
8856 this into a virtual method, so we can override it in LambdaExpression.
8858 * driver.cs: Improve diagnostics in case of failure.
8860 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
8861 write a function that is slightly more complex and that parses:
8863 type identifier [, type identifier]* )
8865 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
8868 (canEmpty ? i >= 0 : i > 0)
8870 2007-01-30 Raja R Harinath <rharinath@novell.com>
8872 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
8873 exception on possibly valid code.
8875 2007-01-29 Raja R Harinath <rharinath@novell.com>
8877 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
8879 (parse_opt_type_arguments): Remove. It's almost the same as
8881 (parse_namespace_or_typename): Use parse_less_than.
8883 2007-01-28 Miguel de Icaza <miguel@novell.com>
8885 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
8886 this bug took a few hours to find, because the state saved and
8887 restored by PushPosition and PopPosition was ignoring the state of
8888 parse_generic_less_than.
8890 I can also now remove the handling of OP_LT and OP_GT, this solves
8893 * cs-tokenizer.cs: store the location for the ARROW token, we use
8896 (PushPosition, PopPosition): save/restore also `current_token',
8897 restore `parse_generic_less_than' (was missing).
8899 (parse_opt_type_arguments): use parse_type, not
8900 parse_namespace_or_typename to parse types.
8902 * lambda.cs: Empty new file, will eventually have the lambda
8903 expression implementation.
8905 * lambda.test: used to test the internal tokenizer.
8907 * report.cs (FeatureIsNotISO1): Rename from
8908 FeatureIsNotStandardized, because it was about the language level
8909 (1 vs 2) it was not about standarization.
8911 (FeatureRequiresLINQ): New.
8913 * support.cs (SeekableStreamReader): Only require that the reader
8914 is a TextReader, not a StreamReader, so we can plug StringReader.
8916 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
8917 given position in the input stream the following tokens can be
8918 parsed as a type followed by an identifier.
8920 (is_punct): after a '(' if parse_type_and_parameter returns true,
8921 then return a special token OPEN_PARENS_LAMBDA which is used to
8922 avoid reduce/reduce errors in the grammar for the
8923 lambda_expression rules.
8925 (parse_type): implement a type parser inside the
8926 tokenizer, the parser only returns true or false depending on
8927 whether the input at a given position can be parsed as a type.
8929 (peek_token): new method used during type parsing.
8931 2007-01-28 Raja R Harinath <rharinath@novell.com>
8934 * anonymous.cs (ScopeInfo.InflateParameters): New.
8935 (AnonymousContainer.Resolve): Use it to redirect types of
8936 delegate parameters.
8938 2007-01-27 Raja R Harinath <rharinath@novell.com>
8941 * expression.cs (Error_InvalidArguments): Don't use two different
8942 messages for CS1503. Use ExtraInformation and
8943 SymbolRelatedToPreviousError instead.
8946 * decl.cs (DeclSpace.initialize_type_params): Don't access
8947 'type_params' of a partial class directly.
8949 2007-01-26 Miguel de Icaza <miguel@novell.com>
8951 * constant.cs: Removed a handful of out-of-range checks that were
8954 2007-01-25 Marek Safar <marek.safar@gmail.com>
8956 * expression.cs (CheckUselessComparison): Add additional check for char
8959 * namespace.cs: Fixed typo.
8961 2007-01-23 Miguel de Icaza <miguel@novell.com>
8963 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
8964 gone, instead we inline the test, preventing the needless casts to
8965 longs, ulongs and doubles for the parameters, avoiding calls to
8966 methods that overchecked stuff, and instead inlined things
8969 2007-01-20 Marek Safar <marek.safar@gmail.com>
8971 * cs-parser.jay: Better parameter error handling.
8973 2007-01-17 Marek Safar <marek.safar@gmail.com>
8975 A fix for bug #80368, #80522
8976 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
8977 whether array initializer contains constants only.
8978 (ArrayCreation.Emit): Use better formula to decide when
8979 are array initializers for static initialization.
8980 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
8981 have to emit even constants otherwise they are pre-initialized.
8983 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
8984 Raja R Harinath <rharinath@novell.com>
8986 Fix emit order of 'get' vs. 'set'.
8987 * support.cs (Accessors): New.
8988 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
8989 Note the order in which accessors are declared in the source.
8990 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
8991 Refactored from Property.Define and Indexer.Define.
8992 (PropertyBase.DefineAccessors): New helper that calls the above in
8993 appropriate order as noted by the parser.
8994 (Property.Define, Indexer.Define): Update to changes.
8995 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
8997 2007-01-17 Raja R Harinath <rharinath@novell.com>
8999 Fix cs0029-6.cs and gcs0029-2.cs (regression)
9000 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
9001 there's an implicit conversion from the current type to the target
9002 type before converting the underlying constant.
9004 2007-01-16 Marek Safar <marek.safar@gmail.com>
9006 * const.cs (ResolveValue): Updated after constant conversion was made more
9009 * constant.cs (GetAttributableValue): constant to object conversion is
9010 used for attributes only.
9011 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
9012 constant conversions.
9013 (LongConstant.ConvertImplicitly): Ditto.
9015 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
9016 (ImplicitConversionStandard): Handle constant conversion as extra step.
9017 It solves the issue when constant conversion was called indirectly like
9018 inside array initializer and constant folding was skipped.
9020 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
9023 * statement.cs(ImplicitConversionStandard): Updated after constant
9024 conversion was made more generic.
9026 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
9028 * expression.cs (As.DoResolve): Use GenericConstraints instead of
9029 Constraints, solves the problem where the compiler incorrectly
9030 reported that a type parameter was not constrained to a class (Bug
9033 2007-01-14 Marek Habersack <grendello@gmail.com>
9035 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
9037 2007-01-14 Marek Safar <marek.safar@gmail.com>
9039 A fix for bug #80368
9040 * assign.cs (FieldInitializer): New class implements field
9041 initializer statement.
9043 * attribute.cs: Update after FieldMember rename.
9045 * class.cs (PropertyBasedMember): New common class for property based
9047 (InterfaceMemberBase): New base class for all members which can be used as
9048 an interface members.
9049 (MethodCore): Moved really common code to InterfaceMemberBase.
9050 (Method.Define): Equal and GetHasCode detection is relevant for methods
9052 (MethodData.Define): Don't assume that public event implements an
9053 interface automatically.
9054 (MethodData.DefineMethodBuilder): Issue an error even if only extern
9056 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
9057 (FieldMember): Merged with FieldBase.
9058 (EventProperty.AEventPropertyAccessor): New specialization to check whether
9059 event extern modifier can be used.
9060 (EventField.EventFieldAccessor): Moved event field specific code here.
9061 (Event.AllowedModifiers): Even event can be extern.
9062 (Event.FindOutBaseMethod): New override specific to events.
9063 (Indexer.parameters): Reintroduce parameters because base class holds
9064 only properties common data.
9065 (Indexer.CheckForDuplications): Indexers are threated as methods so we
9066 need do extra parameters check.
9068 * const.cs: Update after FieldMember rename.
9070 * decl.cs (MemberCache.FindBaseEvent): New method.
9072 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
9073 to reflect that indexer is now derived from PropertyBased.
9075 * ecore.cs (GetMemberType): Made public.
9076 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
9079 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
9081 * typemanager.cs (CSharpSignature): Correctly print event accessors.
9082 (RegisterEvent): Removed.
9083 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
9084 (GetPrivateFieldOfEvent): Renamed to GetEventField.
9086 2007-01-11 Raja R Harinath <rharinath@novell.com>
9089 * statement.cs (CollectionForeach.TryType): Prefer generic
9090 GetEnumerator over non-generic variant. Fix code to follow comments.
9092 2007-01-09 Raja R Harinath <rharinath@novell.com>
9095 * support.cs (ReflectionParameter): Don't use an invalid index on
9096 the generic parameter data.
9098 2007-01-08 Miguel de Icaza <miguel@novell.com>
9100 * driver.cs: Just add a tiny bit of infrastructure.
9102 2007-01-02 Marek Safar <marek.safar@gmail.com>
9104 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
9105 where field type is struct from current assembly.
9107 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
9110 2007-01-02 Marek Safar <marek.safar@gmail.com>
9112 A fix for bug #80381
9113 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
9116 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
9118 (Namespace.LookupType): Always use core types from corlib when speficied.
9120 * report.cs: A new warning.
9122 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
9123 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
9124 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
9126 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
9127 (InitCoreTypes): Set expression type of object_type and value_type
9128 immediately after lookup.
9130 2007-01-01 Miguel de Icaza <miguel@novell.com>
9132 * cs-tokenizer.cs: Accept Pc class characters (Connector
9133 Punctuation) as valid identifiers. Fixes #78259
9135 * expression.cs (Invocation.DoResolve): Moved the check for the
9136 use of `this' for doing method calls to the Invocation resolution
9137 step, after overload resolution has taken place instead of doing
9138 the check at the low-level `This.DoResolve' level.
9140 The `This.DoResolve'(appens before overload resolution, so it has
9141 no way of knowing if the method that will be called will be
9142 instace or static, triggering an erroneous report for cs0188 (Bug
9145 We now do the check for instance method invocations after we know
9146 what method will be called.
9148 (This.CheckThisUsage): Move the actual use of this structure
9149 checking into its own method and expose it.
9151 * Everywhere that called Error_ValueCannotBeConverted: pass a new
9154 Exceptions: Null.ConvertImplicitly,
9155 Constant.ImplicitConversionRequired as there are too many call
9156 sites for passing the ec.
9158 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
9159 EmitContext, if the value is null, then we do not try to provide
9160 the extra information from the error (If a userdefined conversion
9161 exists, as UserDefinedConversion requires a non null-EmitContext).
9165 2006-12-30 Raja R Harinath <rharinath@novell.com>
9167 * flowanalysis.cs (MyBitVector): Document some invariants.
9168 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
9169 introduced below, and add a couple of others,
9171 2006-12-30 Marek Safar <marek.safar@gmail.com>
9173 * attribute.cs (GetMethodObsoleteAttribute): Uses new
9174 GetPropertyFromAccessor and GetEventFromAccessor.
9176 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
9177 overrides non-obsolete one.
9178 (Indexer.Define): Error message has been moved to the parser.
9180 * cs-parser.jay: Better syntax errors handling.
9182 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
9183 when an invocation has no arguments.
9185 * ecore.cs: Removed not used caching.
9187 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
9190 * report.cs: Add a new warning.
9192 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
9194 * typemanager.cs (enumeration_type): Removed.
9195 (CSharpSignature): Reuses IsSpecialMethod.
9196 (IsEqual): Hack for MS BCL.
9197 (GetPropertyFromAccessor): New method.
9198 (GetEventFromAccessor): New method.
9199 (IsSpecialMethod): Fixed to handle more cases.
9201 2006-12-30 Marek Safar <marek.safar@gmail.com>
9203 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
9204 Made white spaces array static.
9206 * ecore.cs (RemoveGenericArity): Optimized.
9208 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
9210 (MyBitVector.initialize_vector): Simplified.
9212 2006-12-22 Miguel de Icaza <miguel@novell.com>
9214 * ecore.cs: Am not entirely happy with this hack, but it seems to
9215 address the issue in 80257 (a small test case for
9218 I set the MethodGroupExpr.Type to an internal compiler type
9219 (itself in this case) to force the resolution to take place. Why
9220 it does not take place with a null is beyond me.
9222 2006-12-20 Marek Safar <marek.safar@gmail.com>
9224 A fix for bug #80288
9225 * expression.cs (ResolveOperator): Consider user defined conversion for
9226 logical and operator too.
9227 (EmitBranchable): Optimization for logical and when full constant folding
9228 could not be applied but one operand is constant.
9230 2006-12-19 Marek Safar <marek.safar@gmail.com>
9232 * class.cs (GetClassBases): Write 5 times every day, will never use
9233 FullName for error reporting.
9235 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
9237 2006-12-19 Martin Baulig <martin@ximian.com>
9239 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
9240 the symbol file info here.
9242 2006-12-18 Marek Safar <marek.safar@gmail.com>
9244 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
9245 of `elseif' is taking then following sections are not taking.
9246 Fixes an issue reported on mono mailing list.
9248 2006-12-18 Marek Safar <marek.safar@gmail.com>
9250 A fix for bug #80300
9251 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
9252 a caller is not taking.
9254 2006-12-18 Raja R Harinath <rharinath@novell.com>
9256 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
9257 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
9258 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
9259 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
9260 * class.cs: Update to changes.
9262 2006-12-17 Marek Safar <marek.safar@gmail.com>
9264 A fix for bug #79934
9265 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
9268 * class.cs (ResolveMembers): Register an iterator in current container and
9271 2006-12-16 Raja R Harinath <rharinath@novell.com>
9274 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
9275 satisfy a params annotated parameter.
9277 2006-12-16 Marek Safar <marek.safar@gmail.com>
9279 A fix for bug #77014
9280 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
9281 paramters correctly and not rely on hacks in Parameters class.
9282 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
9284 (Invocation.VerifyArgumentsCompat): Ditto.
9285 (Invocation.EmitArguments): Changed to correctly emit params arguments at
9288 * parameter.cs (HasParams): Don't assume that params is the last one.
9290 * support.cs (ReflectionParameters.ctor): Look for params attribute
9292 (ReflectionParameters.ParameterType): Removed hack when we returned last
9293 parameter for out of range parameters.
9294 (ParameterName, ParameterModifier): Ditto.
9296 2006-12-14 Marek Safar <marek.safar@gmail.com>
9298 A fix for bug #79987
9299 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
9300 when assembly is not CLS compliant but type is. I have no idea why is this
9303 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
9305 2006-12-13 Miguel de Icaza <miguel@novell.com>
9307 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
9308 in struct constructors, they are basically no-ops.
9310 2006-12-12 Marek Safar <marek.safar@gmail.com>
9312 * cs-tokenizer.cs (Position): Save preprocessor status too.
9314 2006-12-12 Marek Safar <marek.safar@gmail.com>
9316 A fix for bug #77794
9317 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
9319 2006-12-12 Marek Safar <marek.safar@gmail.com>
9321 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
9323 (pp_expr): Report error for an invalid expression.
9324 (handle_preprocessing_directive): Simplified; add more error checking.
9326 2006-12-11 Marek Safar <marek.safar@gmail.com>
9328 A fix for bug #74939
9329 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
9330 directives handling.
9332 2006-12-10 Marek Safar <marek.safar@gmail.com>
9334 A fix for bugs #80093, and #75984
9335 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
9336 logic, it seems to me as it worked before "by coincidence".
9337 (xtoken): Simplified to use reworked handle_preprocessing_directive.
9338 (cleanup): Enabled endif check.
9340 2006-12-09 Marek Safar <marek.safar@gmail.com>
9342 A fix for bug #80162
9343 * statement.cs (CollectionForeach.TryType): Generics and non-generics
9344 enumerators are never ambiguous.
9346 2006-12-08 Raja R Harinath <rharinath@novell.com>
9349 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
9351 2006-12-06 Marek Safar <marek.safar@gmail.com>
9353 A fix for bug #80144
9354 * class.cs (EventProperty.Define): Explicit implementation means
9355 that an even is used.
9357 2006-12-06 Marek Safar <marek.safar@gmail.com>
9359 Fixes the operators implementation (part II)
9361 * cfold.cs (DoConstantNumericPromotions): Renamed to
9362 DoBinaryNumericPromotions and simplified.
9363 (BinaryFold): Couple of conversion fixes; simplified.
9365 * constant.cs, ecore.cs, literal.cs
9366 (ToType): Renamed to ConvertImplicitly.
9367 (Reduce): Renamed to ConvertExplicitly.
9369 * class.cs, convert.cs: Updated.
9371 * expression.cs: TryReduce doesn't throw an exception.
9373 2006-12-01 Marek Safar <marek.safar@gmail.com>
9375 A fix for bug #80108
9376 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
9379 2006-11-30 Marek Safar <marek.safar@gmail.com>
9381 Fixes unary operators implementation (part I)
9384 * cfold.cs (Error_CompileTimeOverflow): Made internal
9386 * const.cs (IConstant): Changed to use reference to constant and
9387 not constant itself.
9388 Updated IConstant implementations.
9390 * constant.cs (CreateConstant): New factory method.
9391 Updated IConstant implementation.
9393 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
9395 * ecore.cs: Updated to use CreateConstantReference.
9397 * enum.cs: Reflects IConstant changes.
9399 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
9401 * literal.cs (NullConstant): Change to be independently usable.
9403 2006-11-29 Martin Baulig <martin@ximian.com>
9405 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
9406 we need to emit the scope initializer before calling the base .ctor.
9408 * anonymous.cs: Merged back from the new anonymous methods branch.
9409 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
9411 * expression.cs (ParameterReference.DoResolveBase): Create a
9412 "normal" ScopeInfo when capturing parameters rather than using the
9413 root scope; this makes things work with anonymous methods having
9417 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
9419 2006-11-22 Marek Safar <marek.safar@gmail.com>
9421 A fix for bug #79987
9422 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
9423 check to a base class.
9424 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
9425 only when assembly has missing attribute.
9426 * report.cs: Update.
9428 2006-11-21 Marek Safar <marek.safar@gmail.com>
9430 * cs-tokenizer.cs: Merged with gmcs version.
9432 2006-11-20 Marek Safar <marek.safar@gmail.com>
9435 * cs-parser.jay: Better error message when partial keyword is misplaced.
9437 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
9439 A fix for bug #79810
9440 report.cs: CS1058 only applies to 2.0 profile (gmcs).
9441 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
9442 a RuntimeWrappedException by default.
9444 2006-11-18 Marek Safar <marek.safar@gmail.com>
9446 A fix for bug #79843
9447 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
9449 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
9451 2006-11-18 Marek Safar <marek.safar@gmail.com>
9453 * driver.cs, namespace.cs: Uses faster IndexOf version.
9455 2006-11-17 Marek Safar <marek.safar@gmail.com>
9457 A fix for bug #79941
9458 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
9460 (Operator.Define): Implicit/Explicit operator of same type is duplicate
9461 even if internal name is different.
9462 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
9463 (UserDefinedConversion): Simplified as the operators cannot be internal.
9464 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
9466 (MethodLookup): Replaced EmitContext with parentType.
9467 * expression.cs: Updated.
9469 2006-11-09 Raja R Harinath <rharinath@novell.com>
9471 * driver.cs (BadAssembly): Handle all the ugliness of
9472 DefineDynamicAssembly.
9474 2006-11-08 Raja R Harinath <rharinath@novell.com>
9476 Address parts of #58244 -- most of what's left is in the runtime
9477 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
9478 CS1509 error checks, and handle them for all assembly loads, not
9479 just the first invocation.
9480 (LoadModule): Likewise. Move handling of 'adder_method' ...
9481 * codegen.cs (AssemblyClass.AddModule): ... here.
9483 2006-11-02 Marek Safar <marek.safar@gmail.com>
9485 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
9486 IEnumerable<T> is ambiguous.
9488 2006-10-31 Marek Safar <marek.safar@gmail.com>
9490 A fix for bug #67689
9491 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
9492 GetEnumerator is ambiguous.
9494 * report.cs: Add new warning.
9496 2006-10-29 Marek Safar <marek.safar@gmail.com>
9498 A fix for bug #78602
9499 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9500 to protected member can be nested type.
9502 2006-10-28 Marek Safar <marek.safar@gmail.com>
9504 A fix for bug #78965
9505 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9506 to protected member must derive from current type.
9508 2006-10-27 Marek Safar <marek.safar@gmail.com>
9510 assign.cs: Reuses error method.
9512 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
9513 instead of type for constants.
9514 (Expression.Error_ValueAssignment): Common error method.
9516 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
9519 2006-10-27 Marek Safar <marek.safar@gmail.com>
9521 A fix for bug #79081
9522 * expression.cs (MemberAccess.DoResolve): Check nested type
9525 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
9527 * doc.cs : nested delegates were not handled. Fixed bug #79754.
9529 2006-10-26 Marek Safar <marek.safar@gmail.com>
9531 A fix for bug #76591
9532 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
9534 2006-10-26 Marek Safar <marek.safar@gmail.com>
9536 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
9537 type forwarder of the same type multiple times.
9539 2006-10-26 Raja R Harinath <rharinath@novell.com>
9542 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
9543 instance as an rvalue, even when we later resolve as an lvalue.
9545 2006-10-25 Martin Baulig <martin@ximian.com>
9547 * anonymous.cs: Fix #79673.
9549 2006-10-24 Marek Safar <marek.safar@seznam.cz>
9551 A fix for bug #79666
9552 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
9553 ignored when is optimized (= default value) as its value is already set.
9555 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9557 A fix for bug #79724
9558 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
9559 TypeContainer for type lookup.
9561 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9563 A fix for bug #79231
9564 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
9565 * expression.cs (OverloadResolve): Always convert type name for
9567 (ResolveNamespaceOrType): Don't confuse a nested type with any
9570 2006-10-18 Martin Baulig <martin@ximian.com>
9572 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
9574 2006-10-17 Miguel de Icaza <miguel@novell.com>
9576 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
9577 an int32, but requesting an int64 from the conversion
9579 2006-10-12 Martin Baulig <martin@ximian.com>
9582 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
9584 2006-10-12 Martin Baulig <martin@ximian.com>
9587 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
9589 2006-10-11 Miguel de Icaza <miguel@novell.com>
9591 * convert.cs: Remove broken code: I was doing the "Existance"
9592 tests for Implicit conversions.
9594 2006-10-10 Miguel de Icaza <miguel@novell.com>
9596 * convert.cs: Added one missing case in
9597 ImplicitStandardConversionExists uint64 to intptr.
9601 * typemanager.cs (uintptr_type): another core known type.
9603 * ecore.cs (OperatorCast): routine used to do cast operations that
9604 depend on op_Explicit. We could change some of the Decimal
9605 conversions to use this.
9607 This one has a probe mechanism that checks both types for an op_
9608 which it coudl be used to eliminate two classes: CastToDecimal
9609 and CastFromDecimal.
9611 * convert.cs: Implement the conversions documented in #59800
9613 2006-10-10 Martin Baulig <martin@ximian.com>
9615 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
9616 before RootScope.ResolveMembers().
9618 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
9619 `CurrentType' if appropriate.
9621 2006-10-09 Marek Safar <marek.safar@seznam.cz>
9623 A fix for bug #78568
9624 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
9625 when contains binary operators.
9626 * cs-parser.jay: Updated.
9628 2006-10-09 Martin Baulig <martin@ximian.com>
9631 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
9632 moved that into Define() and also do the other type parameter
9633 checks there. Fixes #79094. Added gtest-292.cs.
9636 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
9637 since that doesn't include type parameters; don't use `Ldelema'
9638 for type parameters. Fixes #78980. Added gtest-293.cs.
9640 2006-10-08 Marek Safar <marek.safar@seznam.cz>
9643 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
9644 conversion is allowed.
9646 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9648 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
9649 error reporting when no error occurs.
9651 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9653 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
9656 2006-10-06 Raja R Harinath <rharinath@novell.com>
9659 * class.cs (DefineTypeBuilder): Check circular dependencies before
9660 setting the parent of the TypeBuilder.
9661 (CheckRecursiveDefinition): Don't use 'BaseType', since
9662 it may not be valid until after DefineTypeBuilder. Use
9663 'base_type' instead.
9665 2006-10-04 Martin Baulig <martin@ximian.com>
9667 Merged the Anonymous Methods patch.
9669 * anonymous.cs, iterators.cs: The new anonymous methods code.
9671 * statement.cs (Variable): New public abstract class.
9672 (LocalInfo.Variable): New public property.
9673 (LocalInfo.ResolveVariable): New public method.
9674 (Block.Flags): Add `IsIterator'.
9675 (Block.AddVariable): Improved the CS0136 check.
9676 (Block.AnonymousChildren): New public property.
9677 (Block.AddAnonymousChild): New public method.
9678 (ToplevelBlock): Update to use the new anonymous method framework.
9679 (ToplevelBlock.ctor): `container' is now a `Block' and not a
9680 `ToplevelBlock'; this is required to correctly implement the
9682 (Fixed, Using): Use `TemporaryVariable' instead of directly
9683 creating the `LocalBuilder'.
9685 * parameter.cs (Parameter.ResolveVariable): New public method.
9686 (Parameters.ResolveVariable): Likewise.
9688 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
9690 * class.cs (TypeContainer): Replaced the `iterators' list and
9691 corresponding methods with a list of `CompilerGeneratedClass'es.
9692 (TypeContainer.ResolveMembers): New public method.
9693 (Method): `IIteratorContainer' has been replaced by
9696 * expression.cs (VariableReference): New public abstract base
9697 class for `LocalVariableReference', `ParameterReference' and
9700 * codegen.cs (EmitContext): Removed `capture_context',
9701 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
9702 (EmitContext.EmitThis): Removed.
9704 * cs-parser.jay: Replace `iterator_container' with
9707 2006-10-04 Martin Baulig <martin@ximian.com>
9709 * generic.cs (GenericMethod): Don't make this abstract.
9710 (Constraints.Clone): Added dummy implementation.
9712 2006-10-04 Raja R Harinath <harinath@gmail.com>
9715 * namespace.cs (LookForAnyGenericType): Avoid nullref on
9716 'declspaces'. Avoid allocating arrays willy-nilly.
9719 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
9720 cases out of the switch.
9722 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9724 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
9725 message when non-generic type is used with the type arguments.
9726 * expression.cs: Updated.
9728 2006-09-28 Raja R Harinath <rharinath@novell.com>
9731 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
9732 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9733 Change semantics slightly. Don't insist on having only one
9734 temporary EmptyExpression -- just throttle the creation of new ones.
9737 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
9738 non-interfaces too. If no methods are found, don't try to create
9741 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9743 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
9746 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
9747 us produce better error message.
9749 2006-09-27 Marek Safar <marek.safar@seznam.cz>
9751 * expression.cs (Binary.ResolveOperator): Warn about a side effect
9752 of the `|' operator.
9754 * report.cs: A new warning added.
9756 2006-09-27 Martin Baulig <martin@ximian.com>
9758 * generic.cs (GenericMethod): Don't make this abstract.
9760 2006-09-27 Martin Baulig <martin@ximian.com>
9763 (InternalErrorException): Added overloaded ctor taking a params array.
9765 2006-09-26 Marek Safar <marek.safar@seznam.cz>
9767 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
9768 Fixed the cases when same error was reported twice.
9770 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
9771 now report symbol information.
9773 2006-09-25 Martin Baulig <martin@ximian.com>
9775 * class.cs: Completely unified with the gmcs version.
9777 2006-09-25 Martin Baulig <martin@ximian.com>
9779 * typemanager.cs (TypeManager.IsNullableType): New public function.
9780 (TypeManager.IsNullableTypeOf): Likewise.
9781 (TypeManager.IsNullableValueType): Likewise.
9783 * class.cs (MethodCore): Added the `GenericMethod' argument from
9784 gmcs and also unified all classes derived from `MethodCore' with gmcs.
9786 2006-09-24 Raja R Harinath <harinath@gmail.com>
9788 * convert.cs: Unify with gmcs version.
9790 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9792 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
9793 verify them as well.
9795 * report.cs: New warning.
9797 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9799 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
9800 for anonymous block with out argument.
9802 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9804 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
9805 not used private events only.
9807 2006-09-23 Marek Safar <marek.safar@seznam.cz>
9809 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
9811 * const.cs (Const.Define): Check for constant type.
9812 (Const.IsConstantTypeValid): Looks for valid constant types.
9814 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
9816 * ecore.cs (EmptyConstantCast): New common class for all constant based
9819 * expression.cs (Is.DoResolve): Handle null constant especially.
9820 (New.DoResolve): Check for new void().
9821 (MemberAccess.DoResolve): Cope with all kind of nulls.
9823 * literal.cs (NullConstant): Uses EmptyConstantCast.
9824 (NullDefault): Based on EmptyConstantCast.
9825 (NullLiteral): Uses EmptyConstantCast.
9827 * statement.cs (Block.ResolveMeta): Check for constant type.
9829 2006-09-22 Martin Baulig <martin@ximian.com>
9831 * delegate.cs, attribute.cs: Merged with the gmcs versions.
9833 2006-09-22 Raja R Harinath <rharinath@novell.com>
9835 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
9839 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
9840 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
9843 2006-09-22 Martin Baulig <martin@ximian.com>
9845 * ecore.cs: Merged with the gmcs version.
9847 * generic.cs (ConstructedType): New dummy class.
9848 (TypeArguments): Don't make this abstract.
9851 (TypeManager.IsGenericTypeDefinition): New method.
9852 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
9854 2006-09-22 Raja R Harinath <rharinath@novell.com>
9856 * expression.cs (ComposedCast): Check for arrays of TypedReference
9857 before creating the type, not after.
9859 2006-09-21 Marek Safar <marek.safar@seznam.cz>
9861 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
9862 after ToType change.
9864 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
9865 when constant must be implicitly convertible.
9867 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
9869 * ecore.cs (NullCast): Derives from NullConstant.
9871 * expression.cs (Is.DoResolve): Removed useless variables.
9872 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
9873 (New.Constantify): Add enum support.
9874 (MemberAccess.DoResolve): Add warning when accessing null constant or
9877 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
9880 * literal.cs (NullConstant): New abstract class with common
9881 functionality for all null specializations.
9882 (NullDefault): Represents default(X) when result can be
9884 (NullLiteral): Updated.
9886 * report.cs: Add new warning.
9888 2006-09-21 Martin Baulig <martin@ximian.com>
9890 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
9892 2006-09-21 Martin Baulig <martin@ximian.com>
9894 * generic.cs (GenericConstraints): New dummy class.
9895 (Constraints): Likewise.
9896 (TypeParameter): Likewise.
9897 (TypeParameterName): Likewise.
9898 (GenericMethod): Likewise.
9900 * typemanager.cs (TypeManager.GetGenericArguments): New method.
9902 * decl.cs: Merged with the gmcs version.
9904 2006-09-21 Raja R Harinath <rharinath@novell.com>
9906 * generic.cs (TypeParameter): Implement IMemberContainer.
9907 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
9909 * rootcontext.cs: Unify with gmcs version.
9911 * report.cs: Unify with gmcs version.
9912 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
9913 from gmcs/generics.cs.
9914 * generics.cs (TypeParameter): New dummy class.
9916 * support.cs: Unify with gmcs version.
9918 2006-09-20 Raja R Harinath <rharinath@novell.com>
9920 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
9921 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
9923 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
9924 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
9925 * mcs.exe.sources: Add generic.cs.
9927 * codegen.cs: Unify with gmcs version.
9929 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
9930 (EmitContext): Add GenericDeclContainer implementation.
9931 * decl.cs (MemberCore, DeclSpace): Likewise.
9932 * namespace.cs: Remove #ifdef GMCS_SOURCE.
9934 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
9935 MCS TypeManager has a corresponding dummy method.
9937 2006-09-19 Martin Baulig <martin@ximian.com>
9939 * expression.cs: Completely merged with the gmcs version.
9941 2006-09-19 Martin Baulig <martin@ximian.com>
9943 * expression.cs (Invocation): Merged with the gmcs version.
9944 (ArrayAccess.GetStoreOpcode): Likewise.
9946 2006-09-19 Martin Baulig <martin@ximian.com>
9949 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
9950 (TypeManager.IsGenericMethodDefinition): Likewise.
9952 2006-09-19 Martin Baulig <martin@ximian.com>
9955 (TypeManager.IsEqual): Moved the gmcs implementation here.
9956 (TypeManager.DropGenericTypeArguments): Likewise.
9957 (TypeManager.DropGenericMethodArguments): Likewise.
9958 (TypeManager.GetTypeArguments): Moved here from gmcs.
9959 (TypeManager.HasGenericArguments): Likewise.
9961 2006-09-19 Martin Baulig <martin@ximian.com>
9963 * expression.cs (Binary): Merged with the gmcs version.
9965 2006-09-19 Martin Baulig <martin@ximian.com>
9967 * expression.cs (Probe, As, Is): Merged with the gmcs version.
9969 2006-09-19 Martin Baulig <martin@ximian.com>
9971 * typemanager.cs: Merged with the gmcs version.
9973 2006-09-16 Raja R Harinath <rharinath@novell.com>
9975 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
9976 * driver.cs: Likewise.
9978 2006-09-16 Marek Safar <marek.safar@seznam.cz>
9981 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
9982 only if parent type is class.
9983 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
9986 2006-09-15 Marek Safar <marek.safar@seznam.cz>
9989 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
9991 * typemanager.cs(CSharpName): Converts NullType to null.
9993 2006-09-15 Martin Baulig <martin@ximian.com>
9996 (TypeManager.GetMethodName): Added mcs implementation.
9997 (TypeManager.IsEqual): Likewise.
10000 (SimpleName.RemoveGenericArity): Added dummy implementation.
10002 * pending.cs: Merged with the gmcs version.
10004 2006-09-15 Martin Baulig <martin@ximian.com>
10006 * statement.cs: Merge with the gmcs version.
10008 2006-09-15 Martin Baulig <martin@ximian.com>
10010 * statement.cs (Switch): Merge with the gmcs implementation
10011 (without nullables), which is newer.
10013 2006-09-15 Martin Baulig <martin@ximian.com>
10015 * statement.cs (Block.Variables): Make this public.
10016 (ToplevelBlock.Parameters): Make this a property.
10017 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
10019 2006-09-15 Martin Baulig <martin@ximian.com>
10021 * namespace.cs: Merge with the gmcs version.
10023 2006-09-15 Martin Baulig <martin@ximian.com>
10025 * decl.cs (MemberName): Minor code cleanups.
10027 2006-09-15 Martin Baulig <martin@ximian.com>
10029 * parameter.cs: Merge with the gmcs version.
10031 2006-09-15 Martin Baulig <martin@ximian.com>
10033 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
10034 and an error in mcs.
10036 2006-09-15 Martin Baulig <martin@ximian.com>
10038 * flowanalysis.cs: Merged from GMCS; added the generics code into
10039 a `GMCS_SOURCE' conditional so we can share this file.
10041 2006-09-08 Martin Baulig <martin@ximian.com>
10043 * typemanager.cs (TypeManager.interlocked_type): New public field.
10044 (TypeManager.int_interlocked_compare-exchange): New public field.
10045 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
10046 enumerator types here and call InitGenericCoreTypes().
10047 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
10048 after calling InitEnumUnderlyingTypes().
10051 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
10052 `classes_second_stage'.
10054 2006-09-14 Marek Safar <marek.safar@seznam.cz>
10056 * assign.cs, ecore.cs, expression.cs: Share error message text.
10057 * class.cs (FieldMember.Define): Check for varible of static type.
10058 * driver.cs (LoadAssembly): Uses error output for errors.
10059 * statement.cs: Updated.
10061 2006-09-08 Marek Safar <marek.safar@seznam.cz>
10063 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
10066 2006-09-07 Martin Baulig <martin@ximian.com>
10069 (MainDriver): Revert r62663 from Marek; see #70506 for details.
10071 2006-08-29 Miguel de Icaza <miguel@novell.com>
10073 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
10075 2006-08-17 Miguel de Icaza <miguel@novell.com>
10077 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
10078 #52019 and #79064, the use of the \uXXXX sequence in source code
10079 to represent unicode characters.
10081 2006-08-15 Marek Safar <marek.safar@seznam.cz>
10083 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
10085 * class.cs, ecore.cs, statement.cs: Merged to one error message.
10087 2006-08-13 Miguel de Icaza <miguel@novell.com>
10089 * assign.cs: Catch attempts to assign to a method groups in += and
10092 2006-08-13 Marek Safar <marek.safar@seznam.cz>
10095 * cs-parser.jay: Don't destroy current array type by typeof of array's.
10097 2006-08-12 Marek Safar <marek.safar@seznam.cz>
10099 * class.cs (Method.Define): Issue a warning when generic method looks like
10101 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
10104 2006-08-09 Marek Safar <marek.safar@seznam.cz>
10106 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
10108 * decl.cs (MemberCache.FindMembers): When container is interface we need to
10109 search all base interfaces as a member can be ambiguous.
10110 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
10111 Constructor member type filter.
10112 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
10113 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
10114 reporting for returned memberinfos.
10115 * report.cs: Updated.
10116 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
10117 version to work on all runtimes.
10118 (TypeManager.RealMemberLookup): Removed members filtering.
10120 2006-08-08 Raja R Harinath <rharinath@novell.com>
10122 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
10123 (PropertyExpr.EmitAssign): Likewise.
10124 * expression.cs (Indirection.EmitAssign): Likewise.
10125 (LocalVariableReference.EmitAssign): Likewise.
10126 (ParameterReference.EmitAssign): Likewise.
10127 (Invocation.EmitArguments): Likewise.
10128 (ArrayAccess.EmitAssign): Likewise.
10129 (IndexerAccess.EmitAssign): Likewise.
10130 (This.EmitAssign): Likewise.
10131 (ConditionalLogicalOperator.Emit): Likewise.
10134 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
10135 instead of ArrayList. If the hashtable has a LocalBuilder, don't
10136 leave it in after returning it.
10137 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
10139 2006-08-06 Marek Safar <marek.safar@seznam.cz>
10141 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
10144 2006-08-03 Raja R Harinath <rharinath@novell.com>
10146 Fix cs0146-3.cs and cs0146-4.cs.
10147 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
10148 enclosing types don't depend on the current type.
10150 2006-08-02 Raja R Harinath <rharinath@novell.com>
10153 * class.cs (TypeContainer.DoDefineMembers): Use
10154 FindBaseMemberWithSameName on Parent, since we're interested in
10155 whether we hide inherited members or not.
10156 (FindBaseMemberWithSameName): Make slightly more robust.
10158 Fix the non-generic testcase from #77396
10159 * decl.cs (DeclSpace.DeclContainer): Remove override.
10161 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
10162 declspaces for doppelgangers too.
10163 (UsingEntry): Implement IResolveContext.
10164 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
10165 'this' as the resolve context.
10166 (LocalAliasEntry): Likewise.
10168 Implement parts of #77403
10169 * roottypes.cs (RootDeclSpace): New. Used to represent the
10170 toplevel declaration space. Each namespace declaration introduces
10171 a "partial" root declaretion space.
10172 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
10173 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
10174 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
10175 from 'current_namespace.SlaveDeclSpace'.
10176 (namespace_declaration): Likewise.
10177 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
10178 check. It can't happen now.
10179 * decl.cs (DeclSpace.LookupType): Likewise.
10180 * driver.cs (MainDriver): Sanity check.
10182 2006-08-01 Raja R Harinath <rharinath@novell.com>
10184 * decl.cs (DeclSpace.FindNestedType): Remove.
10185 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
10186 LookupTypeContainer to get the container of the nested type.
10187 * class.cs (TypeContainer.FindNestedType): Make non-override.
10189 2006-07-31 Raja R Harinath <rharinath@novell.com>
10191 * decl.cs (DeclSpace.PartialContainer): Move field from ...
10192 * class.cs (TypeContainer.PartialContainer): ... here.
10193 (TypeContainer.AddBasesForPart): New helper.
10194 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
10196 * cs-parser.jay (current_class): Convert to DeclSpace.
10197 (struct_declaration, interface_declaration, class_declaration):
10198 Use AddBasesForPart instead of .Bases directly.
10199 * const.cs, iterators.cs: Update to changes.
10201 2006-07-28 Raja R Harinath <rharinath@novell.com>
10203 * class.cs (TypeContainer.AddMemberType): Rename from
10204 AddToTypeContainer.
10205 (TypeContainer.AddMember): Rename from AddToMemberContainer.
10206 (AddTypeContainer): New. Combine AddClassOrStruct and
10208 (AddPartial): Update. Add 'is_partial' argument.
10209 * roottypes.cs: Update to changes.
10210 * cs-parser.jay (push_current_class): New helper for handling
10211 current_container and current_class.
10212 (struct_declaration, interface_declaration, class_declaration):
10215 2006-07-26 Raja R Harinath <rharinath@novell.com>
10217 * roottypes.cs: Rename from tree.cs.
10219 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
10220 * tree.cs (Tree, ITreeDump): Remove types.
10221 * rootcontext.cs (tree, Tree): Remove fields.
10222 (root, ToplevelTypes): New.
10223 * *.cs: Update to rename.
10225 * tree.cs (Tree.RecordDecl): Remove.
10226 (RootTypes.AddToTypeContainer): Record the toplevel type in its
10228 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
10230 2006-07-23 Raja R Harinath <harinath@gmail.com>
10232 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
10233 DoFlowAnalysis and OmitStructFlowAnalysis here.
10234 (ec.With): Rename from WithUnsafe and generalize.
10235 (ec.WithCheckState): Remove. All users can be handled by 'With'.
10236 (ec.WithFlowAnalyis): New.
10237 * ecore.cs, expression.cs, statement.cs: Update.
10239 2006-07-22 Raja R Harinath <harinath@gmail.com>
10241 * statement.cs (Block.ResolveMeta): Simplify slightly.
10243 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
10244 multiple boolean fields. Convert InUnsafe, constant_check_state,
10245 check_state to flags.
10246 (CheckState, ConstantCheckState): Update.
10247 (InUnsafe): New read-only property.
10248 (FlagsHandle): Rename from CheckStateHandle and convert to handle
10250 (WithUnsafe): New helper similar to WithCheckState.
10251 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
10252 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
10254 2006-07-21 Raja R Harinath <rharinath@novell.com>
10256 Make comparisons use the same IL irrespective of whether they're
10257 in a 'checked' or 'unchecked' context: one of the issues in #78899
10258 * codegen.cs (EmitContext.CheckState): Make read-only property.
10259 (EmitContext.ConstantCheckState): Likewise.
10260 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
10261 helper that implement a save/restore stack for CheckState
10262 values. This is the only way to change check-state.
10263 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
10264 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
10265 (CheckedExpr.EmitBranchable): New forwarding method.
10266 (UnCheckedExpr): Likewise.
10267 * statement.cs (Block.ResolveMeta): Use WithCheckState.
10268 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
10269 (Checked.Resolve, checked.DoEmit): Likewise.
10271 2006-07-20 Miguel de Icaza <miguel@novell.com>
10273 * anonymous.cs: Cache the resolved anonymous delegate, and return
10274 this so that the ResolveTopBlock is only triggered once, not
10277 Currently we trigger ResolvetopBlock twice due to a first pass of
10278 argument check compatibility, and a second pass that does the
10281 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10283 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
10285 * rootcontext.cs (Reset): Add helper_classes.
10287 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10290 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
10293 2006-07-13 Miguel de Icaza <miguel@novell.com>
10295 * statement.cs (Lock): Handle expressions of type
10296 TypeManager.null_type specially. Fixes #78770
10298 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10300 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
10303 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10305 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
10306 for accessors as well.
10307 * ecore.cs (EventExpr): Add AccessorTable.
10309 2006-07-01 Marek Safar <marek.safar@seznam.cz>
10312 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
10313 for CS0122 where appropriate.
10314 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
10316 (Filter): Assembly can be null in the case of top level attributes.
10318 2006-06-25 Marek Safar <marek.safar@seznam.cz>
10322 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
10323 is done at global level.
10325 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10327 A fix for #77002, Implemented TypeForwarder support.
10329 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
10330 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
10331 * typemanager.cs (): Add type_forwarder_attr_type.
10333 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10335 * report.cs: Add CS0469 warning.
10337 2006-06-21 Martin Baulig <martin@ximian.com>
10339 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
10340 the `try'-block, so we also report CS0016 etc. there.
10342 2006-06-21 Martin Baulig <martin@ximian.com>
10345 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
10347 2006-06-21 Martin Baulig <martin@ximian.com>
10349 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
10350 also report CS1686 for parameters.
10352 2006-06-21 Martin Baulig <martin@ximian.com>
10354 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
10355 instead of an error if the value is not implicitly convertible to
10356 the switch types; fixes #77964.
10358 2006-06-21 Raja R Harinath <rharinath@novell.com>
10361 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
10362 FieldBuilder is null.
10365 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
10366 'left' and 'right' before error-checking.
10368 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
10370 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
10372 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
10373 (FieldExpr.DoResolve): likewise.
10374 (PropertyExpr.InstanceResolve): likewise.
10375 (EventExpr.InstanceResolve): likewise.
10377 2006-06-04 Marek Safar <marek.safar@seznam.cz>
10379 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
10380 attribute applicable tests for attribute argument.
10382 2006-06-02 Raja R Harinath <rharinath@novell.com>
10385 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
10386 (Binary.OverloadResolve_PredefinedIntegral): New.
10387 (Binary.OverloadResolve_PredefinedFloating): New.
10388 (Binary.OverloadResolve_PredefinedString): New.
10389 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
10390 Follow the standard more closely, and treat numeric promotions in
10391 terms of overload resolution.
10392 (Binary.CheckShiftArguments): Simplify.
10394 2006-06-01 Raja R Harinath <rharinath@novell.com>
10396 * flowanalysis.cs (MyBitVector): Simplify representation.
10397 (MyBitVector.Clone): Avoid allocating BitArray.
10398 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
10399 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
10400 (*): Update. Change all references to MyBitVector.And and
10401 MyBitVector.Or to &= and |=.
10403 2006-05-29 Raja R Harinath <rharinath@novell.com>
10405 Fix cs0231-[34].cs.
10406 * cs-parser.jay (formal_parameter_list): Extend the pattern below
10407 to param arguments too.
10409 2006-05-26 Miguel de Icaza <miguel@novell.com>
10411 * cs-parser.jay: Catch another parsing form for arglist being
10412 followed by other arguments. Fixes #78313.
10414 2006-05-24 Raja R Harinath <rharinath@novell.com>
10416 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
10417 checking of out parameters to ...
10418 (FlowBranchingToplevel.Merge): ... here.
10419 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
10420 set, propagate the origin upward, and only complain if there was
10422 (FlowBranchingException.AddContinueOrigin): Likewise.
10423 (FlowBranchingException.AddReturnOrigin): Likewise.
10424 (FlowBranchingException.AddGotoOrigin): Likewise.
10426 2006-05-23 Raja R Harinath <rharinath@novell.com>
10428 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
10429 unreachable, skip it.
10430 (FlowBranchingException.Merge): Always propagate jumps, even if
10431 the finally block renders subsequent code unreachable.
10433 2006-05-18 Raja R Harinath <rharinath@novell.com>
10436 * statement.cs (Goto.Resolve): Move responsibility for resolving
10437 'goto' to FlowBranching.AddGotoOrigin.
10438 (Goto.SetResolvedTarget): New. Callback to set the
10439 LabeledStatement that's the target of the goto.
10440 (Goto.DoEmit): Use Leave instead of Br when crossing an
10441 unwind-protect boundary.
10442 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
10443 LookupLabel and adjust to new semantics.
10444 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
10445 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
10446 Goto.SetResolvedTarget to update target.
10447 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
10448 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
10449 AddBreakOrigin & co. Delay propagation until ...
10450 (FlowBranchingException.Merge): ... this.
10452 * statement.cs (Block.Resolve): Always depend on flow-branching to
10453 determine unreachability. Kill workaround that originally emitted
10454 only one statement after an "unreachable" label (see infloop in
10457 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
10458 This is still "wrong", but anything better would probably need a
10459 multi-pass algorithm.
10460 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
10461 usage vector. Force current usage vector to be reachable, to
10462 optimistically signify backward jumps.
10463 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
10465 (FlowBranchingLabeled.Merge): New. If no backward jump was
10466 detected, return the original salted-away usage vector instead,
10467 updated with appropriate changes. Print unreachable warning if
10469 * statement.cs (Block.Resolve): Don't print unreachable warning on
10470 a labeled statement.
10472 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
10474 * driver.cs: Pass filename without path to AssemblyBuilder's
10475 AddResourceFile. Fixes bug #78407.
10477 2006-05-17 Raja R Harinath <rharinath@novell.com>
10479 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
10480 * flowanalysis.cs (FlowBranchingLabeled): ... here.
10481 (FlowBranching.MergeChild): Overwrite
10482 reachability information from Labeled branchings too.
10484 2006-05-16 Raja R Harinath <rharinath@novell.com>
10486 * statement.cs (Goto.Resolve): Merge jump origins here ...
10487 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
10489 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
10490 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
10491 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
10492 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
10494 * statement.cs (Goto.Resolve): ... not here.
10495 (Goto.Emit): Remove CS1632 check.
10497 2006-05-14 Marek Safar <marek.safar@seznam.cz>
10499 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
10502 2006-05-11 Raja R Harinath <rharinath@novell.com>
10504 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
10505 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
10506 (FlowBranchingException.Label): Likewise.
10508 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
10510 (MyBitVector.Or): Use it to avoid losing information (Count).
10511 (FlowBranching.MergeOrigins): Likewise.
10513 * flowanalysis.cs (UsageVector.IsDirty): Remove.
10514 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
10515 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
10516 (UsageVector.ToString): Simplify.
10517 (UsageVector.MergeSiblings): Move here from ...
10518 (FlowBranching.Merge): ... here.
10519 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
10522 2006-05-10 Raja R Harinath <rharinath@novell.com>
10524 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
10525 null bitvector is treated as all-true.
10527 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
10528 (MyBitVector): Rationalize invariants. 'vector != null' implies
10529 that we have our own copy of the bitvector. Otherwise,
10530 'InheritsFrom == null' implies all inherited bits are true.
10532 2006-05-09 Marek Safar <marek.safar@seznam.cz>
10534 * statement.cs (LocalInfo): Add IsConstant.
10535 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
10536 local variable for constants.
10538 2006-05-09 Raja R Harinath <rharinath@novell.com>
10540 * flowanalysis.cs (MyBitVector.Empty): New.
10541 (MyBitVector): Don't allow InheritedFrom to be null.
10542 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
10543 (UsageVector, FlowBranching): Update to changes.
10545 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
10546 recursion. The 'Parent == null' condition isn't sufficient for
10548 (FlowBranching.AddBreakOrigin): Likewise.
10549 (FlowBranching.AddContinueOrigin): Likewise.
10550 (FlowBranching.AddReturnOrigin): Likewise.
10551 (FlowBranching.StealFinallyClauses): Likewise.
10552 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
10553 (FlowBranching.CheckOutParameters): Likewise.
10554 (FlowBranchingToplevel): Terminate all the above recursions here.
10555 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
10556 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
10558 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
10560 (FlowBranchingToplevel): New. Empty for now.
10561 (FlowBranching.MergeTopBlock): Update.
10562 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
10563 branching for the anonymous delegate.
10564 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
10566 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
10567 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
10568 information at the start of the merge. Reorganize.
10570 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10572 * class.cs (MethodData.Define): Method cannot implement interface accessor.
10574 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10576 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
10577 to newly introduced ctor.
10579 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
10580 message to one place.
10581 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
10584 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10586 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
10588 * ecore.cs (Expression.ResolveAsConstant): Updated.
10590 * statement.cs (ResolveMeta): Updated.
10592 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10594 * cs-parser.jay: __arglist cannot be used in initializer.
10596 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10599 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
10602 2006-05-05 Raja R Harinath <rharinath@novell.com>
10604 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
10605 (LabeledStatement): Add 'name' parameter.
10606 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
10607 (Block.AddLabel): Update to changes.
10608 * cs-parser.jay (labeled_statement): Likewise.
10610 * flowanalysis.cs (BranchingType.Labeled): New.
10611 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
10612 (FlowBranchingLabeled): New. Does nothing for now, but will
10613 eventually handle 'goto' flows.
10614 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
10615 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
10616 that's terminated ...
10617 (Block.Resolve): ... here.
10619 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
10620 (UsageVector.MergeFinallyOrigins): Likewise.
10621 (FlowBranching.InTryOrCatch): Likewise.
10622 (FlowBranching.AddFinallyVector): Likewise.
10623 (FlowBranchingException): Update to changes.
10626 * statement.cs (Return.Resolve): Move error checking to ...
10627 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
10628 (FlowBranchingException): Handle return origins like break and
10630 (FlowBranching.UsageVector.CheckOutParameters): Remove.
10632 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10635 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
10638 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10641 * class.cs (MethodData.Define): Do public accessor check only when method
10642 implements an interface.
10644 2006-05-04 Raja R Harinath <rharinath@novell.com>
10646 Remove special handling of 'break'
10647 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
10648 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
10649 (UsageVector.Break): Remove.
10650 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
10652 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
10654 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
10655 UsageVector.Breaks (). Don't set NeedsReturnLabel.
10657 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10660 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
10661 be the interface member.
10663 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10666 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
10667 for emitting small (int) values.
10669 2006-05-03 Raja R Harinath <rharinath@novell.com>
10672 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
10673 control-flow passes through the 'finally' after merging-in all the
10674 control-flows from 'try' and the 'catch' clauses.
10676 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
10677 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
10678 always true at the only non-recursive entry point.
10679 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
10680 FlowBranchingBreakable.
10681 (FlowBranchingLoop): Remove.
10682 * statement.cs (Return.DoResolve): Update to changes.
10685 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
10686 (FlowBranching.CreateBranching): Handle it: create a
10687 FlowBranchingContinuable.
10688 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
10689 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
10690 except that it handles the 'continue' command.
10691 (FlowBranching.UsageVector.MergeOrigins): Rename from
10693 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
10694 except that it overrides AddContinueOrigin.
10695 (FlowBranchingException): Override AddContinueOrigin, similar to
10697 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
10698 Create a new branching around the embedded statement.
10699 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
10700 control flow after the embedded statement.
10701 (Continue.Resolve): Move all error checking to AddContinueOrigin.
10703 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
10704 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
10705 FlowBranchingBreakable.
10706 (FlowBranchingSwitch): Remove.
10709 * statement.cs (Break.Resolve): Simplify. Move responsibility for
10710 error reporting to ...
10711 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
10712 Rename from 'AddBreakVector'. Add new location argument. Return
10713 a bool indicating whether the 'break' crosses an unwind-protect.
10714 (FlowBranchingException.AddBreakOrigin): Add.
10715 (FlowBranchingException.Merge): Propagate 'break's to surrounding
10716 flowbranching after updating with the effects of the 'finally'
10718 (FlowBranchingBreakable): New common base class for
10719 FlowBranchingLoop and FlowBranchingSwitch.
10721 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
10722 embedded statement.
10723 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
10725 2006-05-02 Raja R Harinath <rharinath@novell.com>
10727 * statement.cs (Do.Resolve): If the loop is infinite, set the
10729 (While.Resolve, For.Resolve): Set a barrier after the embedded
10730 statement. There's no direct control flow that goes from the end
10731 of the embedded statement to the end of the loop.
10732 * flowanalysis.cs (FlowBranching.Infinite): Remove.
10733 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
10734 above ensure that the reachability is correctly computed.
10736 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
10737 (UsageVector.MergeBreakOrigins): If the current path is
10738 unreachable, treat it as if all parameters/locals are initialized.
10739 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
10740 infinite loops before merging-in break origins.
10742 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
10743 (Reachability.Reachable): Split part into ...
10744 (Reachability.Unreachable): ... this. Simplify.
10745 (Reachability.IsUnreachable): Use 'Unreachable' instead.
10747 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
10748 (Reachability.SetThrowsSometimes): Likewise.
10749 (FlowBranchingBlock.MergeTopBlock): Don't compare against
10750 TriState.Always, use corresponding property.
10751 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
10752 (Block.Resolve): Likewise. Remove some redundant checks.
10754 2006-05-02 Raja R Harinath <harinath@gmail.com>
10756 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
10757 (Reachability.Meet): Don't bother checking AlwaysThrows --
10758 barrier is always set.
10759 (FlowBranchingBlock.Merge): Likewise.
10761 2006-05-01 Raja R Harinath <harinath@gmail.com>
10763 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
10764 checks for unreachable.
10766 2006-05-01 Marek Safar <marek.safar@seznam.cz>
10769 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
10771 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
10772 whether field is really assigned.
10774 2006-04-30 Raja R Harinath <harinath@gmail.com>
10776 * flowanalysis.cs (Reachability): Make 4-argument constructor
10778 (Reachability.Meet): Rename from 'And'. Remove static variant.
10779 (Reachability.Always): Rename from the highly misleading
10780 'Reachability.Never'.
10781 (FlowBranching.Merge): Update to changes. Mark an impossible
10782 situation with a 'throw'.
10783 (*): Update to changes.
10785 2006-04-29 Raja R Harinath <harinath@gmail.com>
10787 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
10788 Remove 'Undefined'.
10789 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
10790 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
10791 (*): Update to changes.
10792 * statement.cs: Update to changes.
10794 2006-04-28 Marek Safar <marek.safar@seznam.cz>
10797 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
10799 2006-04-28 Raja R Harinath <harinath@gmail.com>
10801 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
10804 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
10805 argument to two arguments: an usage-vector and a bool. Move call
10806 to FlowBranching.Merge () ...
10807 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
10809 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
10810 handling of loop and switch reachability to ...
10811 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
10813 2006-04-27 Raja R Harinath <harinath@gmail.com>
10815 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
10816 handling to FlowBranchingLoop.InLoop.
10817 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
10819 2006-04-26 Marek Safar <marek.safar@seznam.cz>
10822 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
10823 anonymous method is allowed from AnonymousContainer here.
10825 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
10827 2006-04-24 Raja R Harinath <rharinath@novell.com>
10830 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
10832 2006-04-23 Marek Safar <marek.safar@seznam.cz>
10835 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
10836 (DoubleConstant.Reduce): Ditto.
10838 2006-04-23 Raja R Harinath <rharinath@novell.com>
10840 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
10841 Remove 'lvalue_right_side' argument. Move parts to ...
10842 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
10843 (LocalVariable.DoResolveLValue): ... these.
10845 2006-04-21 Raja R Harinath <rharinath@novell.com>
10848 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
10849 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
10850 (LocalVariableReference.DoResolveBase): Use it to implement new
10852 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
10853 (Argument.Resolve): Simplify. Move CS1510 check ...
10854 * ecore.cs (Expression.ResolveLValue): ... here.
10855 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
10856 (PropertyExpr.DoResolveLValue): Likewise.
10857 (FieldExpr.Report_AssignToReadonly): Likewise.
10858 (FieldExpr.DoResolve): Add 'out_access' argument. Use
10859 LValueMemberAccess or LValueMemberOutAccess on instance depending
10861 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
10862 DoResolve as appropriate.
10864 2006-04-20 Raja R Harinath <rharinath@novell.com>
10867 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
10868 implicit conversions on 'out' and 'ref' arguments.
10870 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
10871 improve clarity. Remove dead code.
10874 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
10875 (Catch.Resolve): Resolve VarBlock if it exists.
10877 2006-04-19 Miguel de Icaza <miguel@novell.com>
10879 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
10880 twice, this was some residual code, the enumerator was emitted
10881 properly in the two branche of if later.
10883 2006-04-19 Raja R Harinath <rharinath@novell.com>
10885 * expression.cs (Cast.ResolveLValue): Remove. The result of a
10886 cast is never an lvalue.
10887 (Cast.DoResolve, Cast.ResolveRest): Combine.
10888 (Argument.Emit): Simplify slightly. Move 'Expr is
10889 IMemoryLocation' check ...
10890 (Argument.Resolve): ... here.
10891 (Argument.Error_LValueRequired): Remove. Inline into only user.
10893 Simplifications. Fix cs0191-2.cs
10894 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
10895 CS1649 and CS1651 to ...
10896 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
10897 the actual selection of the error code and message to a lookup
10898 table. Add a dummy return value to simplify callsites.
10899 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
10900 readonly fields of other instances of the same type. Move CS0197
10902 * expression.cs (Argument.Resolve): ... here. Simplify code.
10903 Ensure that ec.InRefOutArgumentResolving is only set during LValue
10904 resolution of an out or ref argument. The code simplification
10905 above uses this invariant.
10907 2006-04-18 Raja R Harinath <rharinath@novell.com>
10909 Possibly fix #77752. Fix cs1690-[4-7].cs.
10910 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
10911 CheckMarshallByRefAccess. Drop parameter.
10912 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
10914 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
10915 InstanceExpression.
10916 * report.cs (AllWarnings): Add CS1690.
10917 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
10918 for ref access too.
10919 (LocalVariableReference.DoResolveBase): Update.
10921 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10923 * class.cs (MethodOrOperator): Moved common parts from method class.
10924 detect obsolete attributes.
10925 (Method.Define): Simplified as it reuses code from base.
10926 (Constructor.ValidAttributeTargets): Fixed issue found during
10928 (Destructor.ValidAttributeTargets): Fixed issue found during
10930 (Operator): Finished refactoring set off by #78020. Operator class is now
10931 ordinary method class.
10933 * anonymous.cs: Updated.
10935 * decl.cs (DeclSpace): Add IsGeneric
10937 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10939 * class.cs (Constructor.Emit): Don't emit the attributes twice.
10941 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10943 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
10944 detect obsolete attributes.
10945 (Method.CreateEmitContext): Moved to MethodOrOperator.
10947 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10950 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
10951 customized exception to make crash detection easier.
10952 (MethodOrOperator): Started to work on new base class for methods and
10954 (Method): Derives from MethodOrOperator.
10955 (Constructor.Emit): Emits its own attributes.
10956 (AbstractPropertyEventMethod.Emit): Ditto.
10957 (Operator): Derives from MethodOrOperator, will refactor fully in extra
10959 (Operator.Emit): It's temporary more tricky than should be.
10961 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
10963 * report.cs (InternalErrorException): Add ctor with inner exception.
10965 2006-04-08 Marek Safar <marek.safar@seznam.cz>
10968 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
10971 2006-04-07 Marek Safar <marek.safar@seznam.cz>
10974 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
10977 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10979 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
10980 attribute is present and Guid not.
10981 (Interface.ApplyAttributeBuilder): Ditto.
10983 * attribute.cs: Add error message.
10985 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10989 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
10990 sources (it's composite) so hold them in extra array as they are used in
10991 Emit phase only. It worked in the previous versions by mistake.
10992 (Attribute.Emit): Emit attribute for more owners when exist.
10994 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
10995 it has now different behaviour.
10997 2006-04-04 Marek Safar <marek.safar@seznam.cz>
10999 * constant.cs (Constant.IsDefaultInitializer): New method.
11001 * class.cs: Updated.
11003 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
11004 re-initialize default values. It saves KBs almost for every assembly.
11005 Thanks Zoltan for the idea.
11006 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
11007 (ArrayCreation.DoResolve): Resolve only once.
11008 (ArrayCreation.Emit): Emit static initializer only when it is faster.
11009 (ArrayCreation.GetAttributableValue): Cope with optimized values.
11011 2006-04-03 Zoltan Varga <vargaz@gmail.com>
11013 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
11016 2006-04-01 Marek Safar <marek.safar@seznam.cz>
11018 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
11019 in an embedded statement too.
11021 2006-04-01 Raja R Harinath <rharinath@novell.com>
11024 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
11026 2006-04-01 Marek Safar <marek.safar@seznam.cz>
11030 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
11033 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
11035 2006-03-31 Marek Safar <marek.safar@seznam.cz>
11037 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
11040 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
11041 LocalTemporary change.
11043 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
11045 (ClassOrStruct.DefineFieldInitializers): Implemented static field
11046 initializers optimization.
11047 (ClassOrStruct.TypeAttr): Moved from modifiers.
11048 (Constructor.CheckBase): Don't crash when static ctor has parameters.
11049 (FieldBase.ResolveInitializer): Resolves initializer.
11050 (FieldBase.HasDefaultInitializer): New property.
11052 * cs-parser.jay: Removed message.
11054 * expression.cs (CompilerGeneratedThis): New specialization.
11056 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
11058 2006-03-28 Marek Safar <marek.safar@seznam.cz>
11060 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
11062 2006-03-27 Marek Safar <marek.safar@seznam.cz>
11064 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
11065 be now EnumConstants only.
11067 2006-03-27 Marek Safar <marek.safar@seznam.cz>
11069 * attribute.cs, driver.cs: Reset more caches.
11071 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11073 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
11075 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11077 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
11078 for easier reuse. Updated all overrides.
11079 (IntegralConstant): New base class for all integral constants.
11080 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
11081 of the constant range, report custom error.
11082 (UIntConstant.Reduce): Fixed uint conversion.
11084 * ecore.cs, literal.cs: Reduce updates.
11086 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11090 * class.cs (Constructor.Define): Removed extra if for default ctors.
11091 A patch from Atsushi Enomoto.
11093 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11095 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
11096 GetAttributableValue.
11098 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
11101 * convert.cs (ImplicitConversionRequired): Error message moved to
11104 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
11105 automatic implicit conversion of an output value.
11106 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
11108 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
11110 (TypeOf.GetAttributableValue): Add extra handling for object type.
11112 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
11113 special error message.
11115 2006-03-25 Marek Safar <marek.safar@seznam.cz>
11117 * class.cs (Constructor.Emit): Don't crash when struct ctor is
11119 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
11120 compatible with MS runtime.
11122 2006-03-23 Marek Safar <marek.safar@seznam.cz>
11124 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
11125 attribute arguments here.
11127 * class.cs (Indexer.Define): The check was moved to attribute class.
11129 2006-03-22 Marek Safar <marek.safar@seznam.cz>
11131 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
11132 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
11135 2006-03-22 Raja R Harinath <rharinath@novell.com>
11137 Support ParameterDefaultValueAttribute in gmcs. Also applied to
11138 mcs to keep code differences small.
11139 * attribute.cs (Attribute.GetParameterDefaultValue): New.
11140 * typemanager.cs (parameter_default_value_attribute_type): New.
11141 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
11144 2006-03-21 Marek Safar <marek.safar@seznam.cz>
11146 * expression.cs (StringConcat.Append): Reverted back to no warning state.
11148 2006-03-21 Marek Safar <marek.safar@seznam.cz>
11150 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
11152 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
11155 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
11157 * doc-bootstrap.cs : fix build.
11159 2006-03-20 Marek Safar <marek.safar@seznam.cz>
11161 * expression.cs (StringConcat.Append): Issue a warning when empty string
11162 is going to append.
11164 2006-03-20 Marek Safar <marek.safar@seznam.cz>
11166 * assign.cs (CompoundAssign.ResolveSource): Removed.
11168 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
11171 * class.cs (TypeContainer.FindMethods): Removed.
11172 (TypeContainer.CheckMemberUsage): Made static.
11174 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
11176 * constant.cs (CheckRange): Removed unused type argument.
11177 (CheckUnsigned): Removed unused type argument.
11179 * cs-parser.jay: Updated after MemberAccess clean up.
11180 Uses Length for empty string test.
11182 * cs-tokenizer.cs: Uses Length for empty string test.
11183 (IsCastToken): Made static.
11184 (is_hex): Made static.
11185 (real_type_suffix): Made static.
11187 * decl.cs (SetupCache): Made static.
11188 (OnGenerateDocComment): Removed unused ds argument.
11190 * delegate.cs (VerifyDelegate): Removed unused argument.
11192 * doc.cs: Uses Length for empty string test.
11194 * driver.cs: Uses Length for empty string test.
11196 * enum.cs (IsValidEnumType): Made static
11198 * expression.cs (EnumLiftUp): Removed unused argument.
11199 (ResolveMethodGroup): Ditto.
11200 (BetterConversion): Ditto.
11201 (GetVarargsTypes): Ditto.
11202 (UpdateIndices): Ditto.
11203 (ValidateInitializers): Ditto.
11204 (MemberAccess.ctor): Ditto.
11205 (GetIndexersForType): Ditto.
11207 * flowanalysis.cs: (MergeFinally): Removed unused argument.
11209 * iterators.cs: Updated after MemberAccess clean up.
11211 * location.cs: Uses Length for empty string test.
11213 * namespace.cs: Uses Length for empty string test.
11215 * report.cs (CheckWarningCode): Made static.
11217 * statement.cs (LabeledStatement): Removed unused argument.
11219 * typemanager.cs (FilterNone): Removed.
11221 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11223 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
11226 * class.cs: Updated.
11228 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11230 * cs-parser.jay.cs: __arglist is not allowed for delegates.
11232 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11236 * expression.cs (VerifyArgumentsCompat): Reverted to double error
11237 reporting, it's more tricky than I thought.
11239 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11243 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
11245 (AnonymousMethod.ImplicitStandardConversionExists): New method.
11246 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
11247 Add more error reporting; Fixed issue with params.
11249 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
11251 * cs-parser.jay: AnonymousMethod requires host container.
11253 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
11255 2006-03-18 Raja R Harinath <harinath@gmail.com>
11257 * class.cs: Change 'TypeContainer ds' constructor argument to
11258 'DeclSpace parent'. Some classes were missed below due to
11259 different naming convention.
11261 * class.cs (MemberCore.Parent): Delete. This makes the
11262 ParentContainer changes below enforceable by the compiler.
11264 Treat pointers to enclosing declaration space as 'DeclSpace', not
11266 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
11267 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
11269 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
11271 (Block.AddThisVariable): Likewise.
11272 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
11273 (AbstractPropertyEventMethod.Emit): Likewise.
11274 (AbstractPropertyEventMethod.EmitMethod): Likewise.
11275 (GetMethod.Define, SetMethod.Define): Likewise.
11276 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
11277 (DelegateMethod.EmitMethod): Likewise.
11279 Fix regression test-partial-13.cs.
11280 Rationalize use of PartialContainer. Ensure that the partial
11281 class semantics can be tied to type-correctness, i.e., any
11282 violation will cause a compile error.
11283 * class.cs, const.cs: Access all fields that belong to class
11284 TypeContainer via ParentContainer. Arguments of EmitContexts and
11285 Resolve()-like functions still use 'Parent'.
11287 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
11288 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
11289 (PropertyMethod.CheckModifiers): Remove unused argument.
11290 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
11293 2006-03-17 Raja R Harinath <harinath@gmail.com>
11295 Make semantics of PartialContainer simpler.
11296 * decl.cs (DeclSpace.IsPartial): Remove.
11297 * class.cs (TypeContainer.IsPartial): Likewise.
11298 (TypeContainer..ctor): Set PartialContainer to point to self.
11299 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
11300 (TypeContainer.FindNestedType): Likewise.
11301 (MemberCore.ParentContainer): Simplify. Remove deprecation.
11303 2006-03-17 Marek Safar <marek.safar@seznam.cz>
11305 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
11307 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11309 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
11312 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11314 * class.cs (Operator.Define): An error for base conversion was not
11315 reported correctly.
11317 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
11319 * iterator.cs : yield break is allowed in try statement which has
11320 catch clauses. Fixed bug #77767.
11322 2006-03-13 Marek Safar <marek.safar@seznam.cz>
11324 A fix for #77593, #77574.
11326 * class.cs (MethodCore.CheckBase): Another if for operator.
11328 2006-03-09 Marek Safar <marek.safar@seznam.cz>
11330 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
11333 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
11334 (DelegateCreation.ImplicitStandardConversionExists): New method for just
11337 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
11340 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
11341 Updated after another emitcontext usage was clean up. It should help us to
11342 synchronize with gmcs easier.
11344 2006-03-04 Marek Safar <marek.safar@seznam.cz>
11348 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
11349 (Event.Define): ditto
11350 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
11352 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
11353 Removed redundant code and set NewSlot for Invoke method too.
11355 * parameter.cs (Parameters.ctor): Add custom, type ctor.
11356 (Parameters.MergeGenerated): New method. Use this method when you merge
11357 compiler generated argument with user arguments.
11359 2006-03-03 Marek Safar <marek.safar@seznam.cz>
11361 * attribute.cs (ResolveAsTypeTerminal): Removed.
11363 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
11364 specialization for predefined types; 30% speed up.
11365 Finally placed obsolete check to right place.
11366 (Expression.ResolveType): Removed.
11368 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
11369 Updated after ResolveType was removed.
11371 * expression.cs (Cast.ctor): Check void cast.
11372 (Binary.ResolveAsTypeTerminal): Is never type.
11373 (Conditional.ResolveAsTypeTerminal): Is never type.
11375 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
11377 2006-03-01 Raja R Harinath <rharinath@novell.com>
11380 * expression.cs (ParameterReference.DoResolveBase): Change return
11382 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
11386 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
11389 * typemanager.cs (GetFullNameSignature): Don't nullref on
11390 protected accessors.
11392 2006-02-27 Marek Safar <marek.safar@seznam.cz>
11394 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
11395 these two separated members to simplify the code.
11396 (Attribute.Resolve): Refactored to use new fields and methods.
11397 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
11398 implemented obsolete attribute checking.
11399 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
11400 implemented obsolete checking again. It look line never ending quest ;-)
11401 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
11403 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
11405 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
11407 *class.cs (Property.Define): Add RegisterProperty call.
11409 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
11410 argument groups (only 2).
11412 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
11413 encoding expression to arguments.
11414 (Expression.ExprClassToResolveFlags): Just turned to property.
11416 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
11417 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
11418 optimized as well as implemented support for zero-length attributes.
11420 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
11421 Add caching of PropertyInfo's.
11423 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11425 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
11426 error multiple times.
11428 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11430 New partial class implementation.
11431 A fix for #77027, #77029, #77403
11433 * attribute.cs (Attributable): Made attributes protected.
11435 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
11436 the replacements of ClassPart and PartialContainer.
11437 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
11438 (TypeContainer.AddInterface): Ditto.
11439 (TypeContainer.AddPartial): The main method for partial classes. It checks
11440 for errors and merges ModFlags and attributes. At the end class is added to
11441 partial_parts list.
11442 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
11444 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
11445 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
11446 from the rest of partial classes.
11447 (TypeContainer.GetClassBases): Simplified.
11448 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
11450 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
11451 (TypeContainer.HasExplicitLayout): Uses Flags now.
11452 (PartialContainer): Removed.
11453 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
11454 (StaticClass): Was merged with Class.
11455 (Class.GetClassBases): class and static class bases are verified here.
11456 (Class.TypeAttr): Added static attributes when class is static.
11457 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
11458 (MemberBase): In some cases we need to call parent container for partial
11459 class. It should be eliminated but it's not easy now.
11461 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
11463 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
11464 partial classed to accumulate class comments.
11465 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
11467 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
11469 * driver.cs (MainDriver): Tree.GetDecl was removed.
11471 * modifiers.cs (Modifiers): Add partial modifier.
11473 * tree.cs (Tree.decl): Removed.
11474 (RootTypes): Started to use this class more often for root types
11477 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11481 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
11482 external interface does not have an attribute.
11484 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11486 Another prerequisites for new partial classs implementation.
11488 * attribute.cs (Attribute.Equal): Implemented.
11489 (Attribute.Emit): Changed as attributes can be applied more than twice.
11490 (Attributes.Emit): Check for duplicate attributes here.
11492 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
11493 as a parameter, clean-up.
11495 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11499 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
11500 contains obsolete attribute check which can in some cases look for base
11501 type of current class which is not initialized yet.
11502 (TypeContainer.BaseType): Replacement of ptype.
11504 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
11506 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11508 First of prerequisites for new partial classs implemention.
11510 * attribute.cs (Attributable): Extended by ResolveContext;
11511 Attributes finally have correct context for resolving in all cases.
11512 (AttachTo): Attribute owner is assigned here.
11514 * codegen.cs (IResolveContext): Introduce new interface to hold
11515 all information needed in resolving phase.
11516 (EmitContext): Implements IResolveContext; more clean-up needed here.
11518 * decl.cs (MemberCore): Implemented IResolveContext.
11520 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
11521 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
11522 parameter.cs, statement.cs, tree.cs, typemanager.cs:
11523 Refactored to use new IResolveContext instead of EmitContext; cleanup
11525 2006-02-06 Miguel de Icaza <miguel@novell.com>
11527 * codegen.cs (EmitScopeInitFromBlock): check here the
11528 capture_context, there is no need to make two calls to the
11531 * anonymous.cs: Add some debugging messages that might help me
11532 track other instances of this problem in the future (the
11533 regression of test 467).
11535 * cs-parser.jay: track the variable block, as we need to initalize
11536 any captured variables declared in this block for the "catch"
11537 portion of the "Try" statement.
11539 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
11540 scope initialization for captured variables.
11542 Also, move the emit for the variables after the block location has
11545 2006-02-06 Marek Safar <marek.safar@seznam.cz>
11547 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
11549 2006-02-02 Miguel de Icaza <miguel@novell.com>
11551 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
11552 commit yesterday, the initialization for the roots is necessary.
11553 What is not necessary is the scope activation.
11555 2006-02-02 Raja R Harinath <rharinath@novell.com>
11557 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
11558 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
11560 (Argument.Resolve): Remove CS0206 checks.
11562 2006-02-01 Miguel de Icaza <miguel@novell.com>
11564 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
11565 scopes for all the roots, the scopes will now be emitted when the
11566 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
11568 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
11569 code. This reduces a lot of existing cruft.
11571 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
11572 that the ScopeInfo is generated as we enter the scope, not at the
11573 time of use, which is what we used to do before.
11575 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
11576 every time a Block is about to be emitted if we have a
11579 2006-02-01 Raja R Harinath <rharinath@novell.com>
11581 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
11583 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
11585 * typemanager.cs (cons_param_array_attribute): Make private.
11586 (Reset): Set it to null.
11587 (InitCoreHelpers): Don't initialize it.
11588 (ConsParamArrayAttribute): New. Initialize it as needed.
11589 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
11591 2006-01-31 Miguel de Icaza <miguel@novell.com>
11593 * expression.cs: There might be errors reported during the
11594 selection of applicable methods. If there are errors, do not
11595 continue execution as it will lead the compiler to crash.
11597 2006-01-30 Miguel de Icaza <miguel@novell.com>
11599 * expression.cs: Member access is not allowed on anonymous
11600 methods. Fixes #77402.
11602 2006-01-30 Raja R Harinath <rharinath@novell.com>
11605 * cs-parser.jay (VariableDeclaration): Don't set
11606 current_array_type to null.
11607 (field_declaration, event_declaration, declaration_statement):
11608 Set it to null here.
11610 2006-01-28 Raja R Harinath <harinath@gmail.com>
11612 * typemanager.cs (GenericParameterPosition): New.
11615 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
11617 * doc.cs : To process "include" elements, first we should create
11618 another list than XmlNodeList, because it could result in node
11619 removal, which could result in that the XmlNodeList gives up
11620 yielding next node.
11622 (Also made code identical to gmcs again.)
11624 2006-01-25 Miguel de Icaza <miguel@novell.com>
11626 * ecore.cs: Introduce an error report that we were not catching
11627 before, if not silent, we must report the error. Gonzalo ran into
11630 2006-01-23 Miguel de Icaza <miguel@novell.com>
11632 A fix for bug: #76957
11634 * iterators.cs (MoveNextMethod.CreateMethodHost): call
11635 ComputeMethodHost before creating the method, this is a new
11638 * anonymous.cs (AnonymousContainer): Now we track all the scopes
11639 that this method references (RegisterScope). The actual scope
11640 where the method is hosted is computed with the ComputeMethodHost
11641 before we create the method.
11643 Moved the Deepest routine here.
11645 (AnonymousContainer.ComputeMethodHost): New routine used to
11646 compute the proper ScopeInfo that will host the anonymous method.
11648 (ScopeInfo): Deal with multiple roots. The problem was that we
11649 did not have a unique root where all ScopeInfos could be hanged
11650 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
11653 Remove AdjustMethodScope which is now computed at the end. Remove
11654 LinkScope which did a partial link, instead link all ScopeInfos
11655 before code generation from the new "LinkScopes" routine.
11657 Simplify all the Add* routines as they no longer need to maintain
11658 the tree, they just need to record that they are using variables
11661 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
11662 routines to produce the forest of ScopeInfo trees.
11664 * class.cs (TypeContainer.AppendMethod): This is just like
11665 AddMethod, but ensures that an interface implementation method
11666 (IEnumerable.XXX) is not inserted at the beginning of the queue of
11667 methods, but at the end.
11669 We use this functionality to ensure that the generated MoveNext
11670 method in the iterator class is resolved/emitted before the
11671 enumerator methods created.
11673 This is required because the MoveNext method computes the right
11674 ScopeInfo for the method. And the other methods will eventually
11675 need to resolve and fetch information computed from the anonymous
11678 2006-01-21 Raja R Harinath <harinath@gmail.com>
11679 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11681 Fix rest of #76995.
11682 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
11683 the 'aliases' hash.
11684 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
11685 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
11687 2006-01-18 Raja R Harinath <rharinath@novell.com>
11689 Fix #76656, cs0231-2.cs.
11690 * cs-parser.jay (formal_parameter_list): Make error case catch
11692 (parenthesized_expression_0): Add CS1026 check.
11693 (invocation_expression): Remove unused { $$ = lexer.Location }.
11695 2006-01-17 Raja R Harinath <rharinath@novell.com>
11698 * cs-parser.jay (statement_expression): Don't list out the
11699 individual statement-expressions. Convert syntax error into
11702 2006-01-16 Raja R Harinath <rharinath@novell.com>
11705 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
11706 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
11707 CheckIntermediateModification.
11708 (FieldExpr.DoResolve): Add new two-argument version that
11709 allows us to resolve the InstanceExpression as an lvalue.
11710 The one-argument variant is now just a wrapper.
11711 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
11712 Resolve the lhs as an lvalue if the it has a value type.
11713 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
11714 from Assign.DoResolve.
11715 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
11716 resolved as an lvalue.
11717 (PropertyExpr.DoResolve): Update.
11718 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
11719 has a value type. Move CS1612 check here from
11720 CheckIntermediateModification.
11721 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
11722 * expression.cs (EmptyExpression.OutAccess): New. Used as the
11723 'right_side' of a ResolveLValue on an 'out' argument.
11724 (EmptyExpression.LValueMemberAccess): New. Used as the
11725 'right_side' of a propagated ResolveLValue on a value type.
11726 (LocalVariableReference.DoResolveBase): Recognize
11727 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
11729 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
11730 EmptyExpression.Null.
11732 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
11734 * typemanager.cs : added IsGenericParameter(). In mcs it always
11736 * doc.cs : for generic parameters, use GenericParameterPosition,
11739 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
11741 * expression.cs: Fix Console.WriteLine ((this = x).foo);
11743 2006-01-12 Miguel de Icaza <miguel@novell.com>
11745 This fixes the problem where we used ldfld instead of ldflda to
11746 load the "THIS" pointer on captured parameters, when THIS is a
11747 value type. See bug #77205.
11749 * iterators.cs (CapturedThisReference.Emit): Pass false to
11750 EmitThis (we do not need the address).
11752 * codegen.cs (EmitThis): it needs to know whether we need the
11753 address of `this' or not. This is used by value types.
11755 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
11756 every other call passes false.
11758 2006-01-12 Raja R Harinath <rharinath@novell.com>
11761 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
11763 * expression.cs (Invocation.OverloadResolve): Update.
11764 (Invocation.DoResolve): Avoid double resolution of invocation.
11766 2006-01-11 Raja R Harinath <rharinath@novell.com>
11769 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
11770 unary negation of floating point types as 0-expr; negation cannot
11771 overflow in floating point types.
11774 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
11775 on operands of 'void' type.
11778 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
11779 and ExclusiveOr for boolean constants too.
11781 2006-01-09 Raja R Harinath <rharinath@novell.com>
11784 * expression.cs (Invocation.OverloadResolve): Replace reflected
11785 override methods with their base virtual methods, rather than
11786 skipping over them.
11787 * typemanager.cs (TypeManager.GetOverride): New.
11789 2006-01-05 Jb Evain <jbevain@gmail.com>
11791 * class.cs (Property.Define, Indexer.Define): do not tag the
11792 properties as SpecialName | RTSpecialName.
11794 2006-01-04 Miguel de Icaza <miguel@novell.com>
11796 * class.cs (MethodCore.IsDuplicateImplementation): This method was
11797 doing a low-level comparission of parameter types. It was lacking
11798 a check for __argslist.
11800 2005-12-30 Miguel de Icaza <miguel@novell.com>
11802 * expression.cs (ParameterReference.DoResolveBase): Allow
11803 reference parameters if they are local to this block.
11805 This allows the ref and out parameters of a delegate to be used in
11806 an anonymous method, for example:
11808 delegate void set (out int x);
11810 set s = delegate (out int x){
11814 This is used by functionality introduced late in the C# language.
11816 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
11817 method that take ref and out parameters.
11819 Fixes #77119 which was a late change in the spec.
11821 2005-12-23 Miguel de Icaza <miguel@novell.com>
11823 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
11824 parent if its the same scope. Fixes #77060.
11826 2005-12-21 Miguel de Icaza <miguel@novell.com>
11828 * driver.cs: Report the case of no source files and no -out:
11831 2005-12-20 Raja R Harinath <rharinath@novell.com>
11834 * expression.cs (ComposedCast.GetSignatureForError): Define.
11836 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11840 * namespace.cs (NamespaceEntry): Add extern_aliases as a
11841 ListDictionary, to contain the ExternAliasEntry entries (in
11842 addition to the NamespaceEntry.aliases hashtable). This field is
11843 shared between the original entry and its doppelganger (bodyless
11845 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
11846 extern_aliases field.
11847 (NamespaceEntry.Lookup): Move the IsImplicit check after the
11848 lookup in extern_aliases.
11850 2005-12-16 Raja R Harinath <rharinath@novell.com>
11853 * class.cs (TypeContainer.Mark_HasEquals): New.
11854 (TypeContainer.Mark_HasGetHashCode): New.
11855 (ClassPart): Override them.
11856 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
11859 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
11860 'parent' argument to the base constructor.
11862 Remove all mention of TypeContainer from decl.cs.
11863 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
11864 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
11865 (DeclSpace.DeclSpace): Likewise.
11866 (DeclSpace.DefineMembers): Remove unused argument.
11867 * cs-parser.jay (pop_current_class): Update to changes. Simplify
11868 debugging check -- we don't care if the debug code throws an
11869 InvalidCastException instead of an InternalErrorException.
11870 * class.cs (TypeContainer.DefineMembers): Update to changes.
11871 (TypeContainer.DoDefineMembers): Likewise.
11872 (TypeContainer.GetMethods): Likewise.
11873 (PropertyMember.Define): Likewise.
11874 (MemberBase.Parent): New property that forwards to
11875 MemberCore.Parent, but ensures that we get a TypeContainer.
11876 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
11877 (RootContext.PopulateTypes): Likewise. Remove special case code
11878 for !RootContext.StdLib: DefineMembers is idempotent.
11880 2005-12-14 Miguel de Icaza <miguel@novell.com>
11882 * convert.cs (ExplicitConversionCore): Check the return value from
11883 ExplicitConversionCore which can return null on failure. Fixes #76914
11885 2005-12-13 Marek Safar <marek.safar@seznam.cz>
11887 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
11889 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
11891 * doc.cs : The search for referenced namespace was insufficient to
11892 get global one as it used to do. Fixed bug #76965.
11894 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
11896 * doc.cs : check name in cref in the last phase that whether it is
11899 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11901 * cs-tokenizer.cs : reverted the latest change: it somehow broke
11904 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11906 * doc.cs : so it turned out that we cannot skip override check for
11907 interface members. Fixed bug #76954.
11909 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11911 * cs-tokenizer.cs : fixed bug #75984:
11912 - #warning and #error should not be handled when the source line
11914 - #line is not checked strictly when the source line is disabled.
11915 - #define and #undef is on the other hand checked strictly at any
11918 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
11920 * cs-tokenizer.cs : missing Location (actually, filename) in one of
11923 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11925 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
11927 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
11928 event initializers.
11929 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
11930 (FieldBase.Initializer): Initializer is now optional.
11931 (EventField.Define): Only event field can have initializer.
11933 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
11935 * const.cs (Const): Reuse initializer.
11937 * cs-parser.jay: Updated after FieldBase changes.
11938 Added current_array_type to simplify array initializers.
11940 * ecore.cs (NullCast.IsDefaultValue): Implemented.
11942 * expression.cs, iterators.cs: Updated.
11944 * namespace.cs (NamespaceEntry): Made UsingFound private.
11946 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11948 * parameterCollection.cs: Obsolete, removed.
11949 * parser.cs: Obsolete, removed.
11951 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11954 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
11956 * enum.cs (Enum.Define): Set obsolete context here.
11958 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11961 - FindDocumentedMember() now expects 1) paramList as null
11962 when "we don't have to check the number of parameters" and
11963 2) Type.EmptyTypes when "there is no arguments".
11964 - Introduced FoundMember struct to hold the exact type which was
11965 used to find the documented member (the above change broke
11966 test-xml-044; it might be better just to use DeclaringType than
11967 what MS does, like this change does, but it depends on usage.)
11969 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11971 * doc.cs : documented member might be from DeclaringType for nested
11972 types. Fixed bug #76782.
11974 2005-12-03 Ben Maurer <bmaurer@ximian.com>
11976 * anonymous.cs: Have the param code handle leaving copies on the
11977 stack etc. Allows anonymous params to take part in the assignment
11978 code (++, +=, etc). Fixes bug #76550
11980 * expression.cs: Handle the prepare_for_load/leave_copy by passing
11981 it down to the anon code.
11983 * iterators.cs: Use dummy var here
11985 * codegen.cs: Handle new vars
11987 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11990 * class.cs (MethodData.Define): Set proper Obsolete context.
11992 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
11994 (FieldExpr.DoResolve): Ditto.
11996 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11999 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
12000 parent is not obsolete.
12002 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
12004 * doc.cs : (FindDocumentedMember) find parameterless members first
12005 and get CS0419 in the early stage. Fixed first case of bug #76727.
12007 2005-11-30 Marek Safar <marek.safar@seznam.cz>
12010 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
12011 no error was reported.
12013 *expression.cs (Binary.DoResolve): left can be null.
12015 2005-11-22 Marek Safar <marek.safar@seznam.cz>
12018 * class.cs (MethodData.Emit): Parameters should be labeled first.
12020 2005-11-21 Marek Safar <marek.safar@seznam.cz>
12023 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
12025 2005-11-18 Marek Safar <marek.safar@seznam.cz>
12027 * attribute.cs (AreParametersCompliant): Moved to Parameter.
12029 * class.cs (MethodCore): Parameter clean up.
12030 (IMethodData): Added ParameterInfo.
12031 (MethodData): Parameter clean up.
12032 (Indexer.Define): Parameter clean up.
12044 * typemanager.cs: Parameter clean up.
12046 * delegate.cs (Define): Get rid of duplicated code.
12048 * expression.cs (ParameterReference): Removed useless parameters
12050 (Invocation): Ditto.
12052 * parameter.cs (ParamsParameter): New class, params specialization.
12053 (ArglistParameter): Attemp to separate arglist.
12054 (Parameter): Refactored to be reusable and faster.
12055 (Parameter.Modifier): Made understandable.
12056 (Parameters): Changed to be used as a class for `this' assembly
12057 parameters. Refactored to use new specialized classes.
12059 * support.cs (ParameterData): Added Types property.
12060 (InternalParameters): Deleted.
12062 2005-08-20 Martin Baulig <martin@ximian.com>
12064 Merging this patch from GMCS to fix #75867.
12066 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
12067 scope if we don't already have it.
12069 2005-11-17 Martin Baulig <martin@ximian.com>
12072 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
12073 inherit the scope from our parent. Fixes #76653.
12075 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
12077 * doc.cs : the previous patch does not actually fix the bug.
12078 PropertyInfo override check is now implemented and really fixed it.
12079 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
12081 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
12083 * doc.cs : apply "override filter" also to properties.
12086 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
12088 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
12089 no need to check overrides. For classes, omit those results from
12090 interfaces since they must exist in the class. Fixed bug #76726.
12092 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
12094 * typemanager.cs : (GetFullNameSignature) differentiate indexers
12095 with different parameters. Fixed the second problem in #76685.
12097 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
12099 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
12100 get expected 'protected' access in CheckValidFamilyAccess()).
12103 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
12105 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
12106 Fixed bug #76705. CS1569 was incorrectly commented out.
12108 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
12110 * doc.cs : use Invocation.IsOverride() to do real override check.
12111 * expression.cs : made Invocation.IsOverride() internal.
12113 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
12115 * doc.cs : use TypeManager.FindMembers() instead of (possible)
12116 TypeBuilder.FindMembers() and filter overriden base members out.
12119 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12121 * doc.cs : ref/out parameters are represented as '@' (instead of
12122 '&' in type FullName). Fixed bug #76630 (additionally crefs).
12124 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12126 * doc.cs : when there was no '.' in cref to methods in doc comment,
12127 then parameters were missing in the output. Fixed bug #76691.
12129 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12131 * driver.cs : don't output docs when there is an error.
12134 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12137 Now it should detect indexers. Fixed primary concern in bug #76685.
12138 Fixed CS0419 message to not show the identical member signature in
12141 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12143 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
12144 instead of Type.FindMembers() since it does not handle events.
12147 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
12149 * codegen.cs: Fixed typo (speficied -> specified).
12151 2005-11-11 Marek Safar <marek.safar@seznam.cz>
12154 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
12156 2005-11-11 Marek Safar <marek.safar@seznam.cz>
12158 * attribute.cs: Changed error message.
12160 * cs-tokenizer.cs: One more check.
12162 2005-11-10 Marek Safar <marek.safar@seznam.cz>
12164 * statement.cs (Block.Resolve): Ignore empty statement.
12166 2005-11-10 Marek Safar <marek.safar@seznam.cz>
12168 * report.cs: Made error/warning methods more strict to avoid
12171 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
12172 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
12173 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
12174 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
12176 2005-11-08 Marek Safar <marek.safar@seznam.cz>
12178 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
12179 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
12181 * class.cs (TypeContainer.IsComImport): New property.
12182 (Constructor.Define): Create proper ctor for ComImport types.
12184 * expression.cs (New.CheckComImport): Fixed.
12186 2005-11-07 Miguel de Icaza <miguel@novell.com>
12188 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
12189 that a parameter has been captured does not mean that we do not
12190 have to do the rest of the processing. This fixes the second part
12191 of #76592. If there was another anonymous method capturing
12192 values in the past, the Scope would never be set for the second
12193 method that captured the same parameter.
12195 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
12196 properly manipulate the stack. Second part of fix for #76592.
12198 * expression.cs (New): Add support for invoking "new" on
12199 interfaces that have been flagged with the ComImport attribute and
12200 the CoClass. Fixes #76637
12202 * statement.cs (Try.DoEmit): When a variable is captured, do not
12203 try to emit the vi.LocalBuilder variable as it has been captured.
12204 Create a temporary variable and store the results on the
12205 FieldBuilder. Fixes #76642
12207 2005-11-07 Marek Safar <marek.safar@seznam.cz>
12209 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
12211 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
12213 * expression.cs (Binary.DoResolve): Added && optimalization.
12215 * typemanager.cs (AddUserType): Removed useless argument.
12217 2005-11-04 Marek Safar <marek.safar@seznam.cz>
12219 * statement.cs (Block.variables): Uses ListDictionary.
12221 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12224 * class.cs (PartialContainer.EmitType): Customized to emit
12225 security attributes.
12226 (ClassPart.ApplyAttributeBuilder): Transform security attribute
12227 for partial classes.
12229 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12232 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
12233 access has to be fixed.
12235 * typemanager.cs (IsUnmanagedType): Wrong common field type.
12237 2005-11-01 Marek Safar <marek.safar@seznam.cz>
12240 * ecore.cs (NullCast.Reduce): Implemented.
12242 * expression.cs (ArrayCreation.CheckIndices): Correcly check
12245 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
12247 (Foreach.Resolve): Catch null properly.
12249 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12251 * cs-tokenizer.cs: Warning text fix.
12253 * driver.cs: AllWarningNumbers exposed on public interface.
12255 * report.cs (): Reviewed warning numbers.
12256 (IsValidWarning): Use binary search.
12258 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12260 * driver.cs: Implemeted resource visibility.
12261 (Resources): New class for code sharing between /res: and
12264 2005-10-28 Marek Safar <marek.safar@seznam.cz>
12267 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
12270 * convert (Convert.ImplicitReferenceConversion): NullCast holds
12273 * ecore.cs (NullCast): Child is contant only.
12275 * literal.cs (NullLiteral.Reduce): null can be converted to any
12278 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
12280 * driver.cs: Use Encoding.Default as default code page instead
12283 2005-10-27 Raja R Harinath <rharinath@novell.com>
12286 * expression.cs (Invocation.Error_InvalidArguments): Handle
12287 __arglist parameters.
12288 (Invocation.VerifyArgumentsCompat): Likewise.
12289 * support.cs (ReflectionParameters.GetSignatureForError): Print
12290 __arglist parameters.
12291 (InternalParamters.GetSignatureForError): Likewise.
12292 * parameter.cs (Parameters.GetSignatureForError): Likewise.
12294 2005-10-26 Marek Safar <marek.safar@seznam.cz>
12296 * attribute.cs (GetPropertyValue): Made public.
12298 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
12300 Add new property WrapNonExceptionThrows to handle 2.0 assembly
12302 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
12305 * driver.cs: Reflect method name change.
12307 * statement.cs (Try.Resolve): Warn when try has both general
12308 exception handlers.
12310 * typemanager.cs: runtime_compatibility_attr_type new predefined
12313 2005-10-26 Raja R Harinath <harinath@gmail.com>
12316 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
12317 treat it as an empty parameter list.
12319 2005-10-26 Raja R Harinath <rharinath@novell.com>
12322 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
12323 ResolveAsTypeStep silent.
12324 * statement.cs (Block.AddConstant): Mark block as used.
12325 (Block.ResolveMeta): Avoid piling on error messages
12326 if a constant initializer resolution fails.
12328 2005-10-25 Raja R Harinath <rharinath@novell.com>
12330 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
12332 (NamespaceEntry.VerifyAllUsing): New.
12333 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
12334 behaviour. Delegates actual resolution of alias to ...
12335 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
12336 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
12338 * driver.cs (Driver.MainDriver): Update.
12340 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
12341 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
12343 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
12345 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
12346 RootNamespace.DefineNamespacesForAll.
12348 2005-10-24 Raja R Harinath <harinath@gmail.com>
12350 * typemanager.cs (assemblies, external_aliases, modules)
12351 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
12352 (ComputeNamespaces, GetRootNamespace): Remove extra staging
12353 overhead. Move resposibility ...
12354 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
12355 * driver.cs, attribute.cs, codegen.cs: Update to changes.
12357 2005-10-23 Raja R Harinath <harinath@gmail.com>
12359 * namespace.cs (RootNamespace.all_namespaces): Renamed from
12360 cached_namespaces. Improve usage.
12361 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
12362 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
12363 Move from GlobalRootNamespace and simplify.
12364 (RootNamespace.Global): Make instance variable.
12365 (RootNamespace.RootNamespace): Add "alias name" parameter.
12366 (GlobalRootNamespace): Simplify drastically.
12367 (Namespace.Lookup): Don't use GetNamespace.
12368 * typemanager.cs (GetRootNamespace): Rename from
12369 ComputeNamespaceForAlias.
12370 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
12372 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12374 * anonymous.cs (AnonymousContainer): Don't crash when container
12377 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12379 * expression.cs (Binary.DoResolve): Warn when comparing same
12382 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12385 * expression.cs (Binary.DoResolve): It looks like there are no
12386 convetsion rules in enum context.
12388 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12390 Add support for extern alias qualifiers.
12391 * typemanager.cs: Move some LookupTypeReflection code
12392 to namespace.cs, to have cleaner code. Added some methods
12393 to help us keep track of the extern aliased references.
12394 * driver.cs: Add suport for extern alias assemblies on command
12395 line and check for their warnings/errors. Also keep track of the
12396 extern aliased assemblies.
12397 * namespace.cs: Move the global functionality of Namespace
12398 to GlobalRootNamespace/RootNamespace. Now the global namespace
12399 is GlobalRootNamespace.Globa. Also the code moved from
12400 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
12401 Finally added LocalAliasEntry (AliasEntry before) and
12402 ExternAliasEntry, to handle alias statements.
12403 * cs-parser.jay: Add support in the grammar for extern alias
12405 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
12406 Update callings to Namespace (now in GlobalRootNamespace).
12408 2005-10-18 Raja R Harinath <rharinath@novell.com>
12411 * class.cs (TypeContainer.DefineType): Move updating of
12412 topological sort earlier in the code.
12413 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
12415 2005-10-18 Marek Safar <marek.safar@seznam.cz>
12418 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
12420 * constant.cs (Constant.TryReduce): Moved from Cast class.
12421 (Reduce): Made little bit more OO and fixed missing conversions.
12423 * ecore.cs (Reduce): Implemented.
12424 (Binary.EnumLiftUp): New method to upgrade values to enum values.
12426 * literal.cs (Reduce): Implemented.
12428 * class.cs: Reverted Miguel's wrong commit.
12430 2005-10-14 Miguel de Icaza <miguel@novell.com>
12432 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
12434 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
12436 * cs-parser.jay, expression.cs : CS0214 was missing error location
12437 for constants. Fixed bug #76404.
12439 2005-10-11 Marek Safar <marek.safar@seznam.cz>
12442 * convert.cs (ExplicitConversionCore): Fixed object->enum
12445 2005-10-10 Raja R Harinath <rharinath@novell.com>
12447 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
12448 InstanceExpression.
12449 (PropertyExpr.EmitCall): Likewise.
12450 * expression.cs (Invocation.EmitArguments): Handle case where
12452 (Invocation.EmitCall): Avoid allocating temporary variable if
12453 there are no arguments.
12455 2005-10-07 Raja R Harinath <rharinath@novell.com>
12458 * convert.cs (ImplicitConversionStandard): Move conversion of
12459 void* to arbitrary pointer types ...
12460 (ExplicitConversionStandard): .. here.
12461 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
12462 error to always print typenames.
12464 2005-10-07 Raja R Harinath <rharinath@novell.com>
12466 * convert.cs (GetConversionOperator): Rename from
12467 GetConversionOperators. Move operator selection code from ...
12468 (UserDefinedConversion): ... here.
12470 2005-10-06 Marek Safar <marek.safar@seznam.cz>
12472 * convert.cs (ExplicitConversionCore): Removed duplicate enum
12475 2005-10-05 Marek Safar <marek.safar@seznam.cz>
12477 * assign.cs (Assign.DoResolve): Error method changed.
12479 * cfold.cs (DoConstantNumericPromotions): Error method changed.
12481 * const.cs (ResolveValue): Reset in_transit immediately.
12483 * constant.cs: Error method changed.
12485 * convert.cs: Removed useless location parameter.
12486 (ExplicitNumericConversion): Don't do double enum check.
12487 (ExplicitConversionCore): Renamed from ExplicitConversion.
12488 (ExplicitUnsafe): Extracted from ExplicitConversion.
12489 (ExplicitConversion): Uses for error reporting.
12491 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
12493 (ResolveBoolean): Uses common error method.
12494 (CastToDecimal): Get rid of ec.
12495 (CastFromDecimal): Optimized.
12496 (ConvCast): Get rid of ec.
12498 * enum.cs (ResolveValue): Reset in_transit immediately.
12499 (Emit): Return after first error.
12501 * expression.cs: Convert changes.
12503 * literal.cs: Error method changed.
12505 * statement.cs: Error method changed.
12507 2005-10-03 Raja R Harinath <rharinath@novell.com>
12509 * support.cs (SeekableStreamReader.Position): Don't error out when
12510 the requested position is just beyond the end of the current
12513 2005-09-28 Raja R Harinath <rharinath@novell.com>
12515 * support.cs (SeekableStreamReader): Simplify drastically. Don't
12516 try to keep in sync with the byte count of the underlying Stream.
12517 However, this limits us to a window size of 2048 characters: i.e.,
12518 the maximum lookahead of our lexer/parser can be 2048 characters.
12520 2005-09-28 Marek Safar <marek.safar@seznam.cz>
12523 * driver.cs: Fix compilation files with full root path.
12525 2005-09-25 Miguel de Icaza <miguel@novell.com>
12527 * report.cs (SymbolRelatedToPreviousError): Format the output so
12528 it does not use an open parenthesis that is never closed.
12530 * driver.cs: Follow coding guidelines
12532 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12535 * const.cs (Const.ResolveValue): Check for assigning non-null
12536 value to reference type.
12538 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12540 * anonymous.cs: Implemented ExprClassName.
12542 * assign.cs (Assign.DoResolve): Don't chrash when type is not
12545 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
12548 * class.cs (StaticClass.DefineContainerMembers): Report protected
12551 * codegen.cs: if(ed) PRODUCTION.
12553 * convert.cs (Error_CannotImplicitConversion): Better error
12556 * cs-parser.jay: More error checks.
12558 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
12560 * driver.cs (CSCParseOption): Enabled wrong option check.
12562 * ecore.cs (Expression.ExprClassName): Turned to property.
12563 (MemberExpr.CheckIntermediateModification): For checking boxed
12564 value types modification.
12566 * statement.cs (Fixed.Resolve): Expression type must be
12567 convertible to fixed type.
12568 (CollectionForeach.GetEnumeratorFilter,TryType):
12569 Small refactoring for easier error checking.
12571 2005-09-26 Marek Safar <marek.safar@seznam.cz>
12573 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
12576 * class.cs (GeneratedBaseInitializer): New class for customization
12577 compiler generated initializers.
12578 (MemberBase.DoDefine): Check Obsolete attribute here.
12579 (FieldMember.DoDefine): Ditto.
12581 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
12584 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
12585 (MemberCore.GetObsoleteAttribute): Removed argument.
12586 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
12587 (MemberCore.CheckObsoleteType): New helper.
12591 * statement.cs: Updates after MemberCore changes.
12593 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
12594 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
12596 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
12597 obsolete attribute for compiler construct.
12598 (As.DoResolve): Cache result.
12600 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
12602 2005-09-26 Raja R Harinath <rharinath@novell.com>
12605 * expression.cs (This.VerifyFixed): In a value type T, the type of
12606 'this' is T&, iow, 'this' is either an out or ref parameter. In a
12607 value type R, 'this' is treated as a value parameter.
12609 2005-09-22 Miguel de Icaza <miguel@novell.com>
12611 * statement.cs (Lock): Use the TemporaryVariable class instead of
12612 manually using local variables as those do not work when variables
12615 * ecore.cs: Moved the TemporaryVariable class from being a nested
12616 class inside Foreach to be a public class that can be employed in
12619 2005-09-19 Marek Safar <marek.safar@seznam.cz>
12621 * cs-parser.jay: interface_accessors replaced by
12622 accessor_declarations.
12624 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
12627 * statement.cs (GotoCase.Resolve): Convert null constant to
12629 (SwitchLabel.ResolveAndReduce): Ditto.
12630 (SwitchLabel.NullStringCase): Custom null stamp.
12631 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
12633 typemanager.cs (CSharpSignature): Don't skip first argument
12636 2005-09-18 Miguel de Icaza <miguel@novell.com>
12638 * driver.cs: Set InEmacs based on the environment variable EMACS.
12640 * location.cs (InEmacs): in this mode, do not report column
12641 location as it confuses Emacs.
12643 2005-09-16 Marek Safar <marek.safar@seznam.cz>
12645 * cfold.cs, constant.cs, convert.cs, ecore.cs,
12646 expression.cs, iterators.cs, literal.cs: Store constants and
12649 * class.cs (MemberBase.ShortName): Pass location.
12651 * cs-parser.jay: Some location fixes.
12653 * ecore.cs (Expression.Location): Made virtual.
12655 2005-09-05 Miguel de Icaza <miguel@novell.com>
12657 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
12658 if the underlying types are the same, otherwise we need to produce
12659 code that will do the proper cast.
12661 This was exposed by Marek's constant rewrite which produced
12662 invalid code for the call site:
12664 enum X : long { a }
12665 void Method (X v) {}
12669 This fixes test-49.cs
12671 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12673 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
12674 Type/Object should be allowed as well. Fixed bug #75968.
12676 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12678 * expression.cs : (Binary.DoResolve): when one is enum constant and
12679 another is constant 0, then return enum one *as enum type*.
12682 2005-09-02 Raja R Harinath <rharinath@novell.com>
12684 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
12688 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
12689 flow-branching for LocalVariableReferences in case we were invoked
12690 from a MemberAccess.
12691 * expression.cs (LocalVariableReference.VerifyAssigned): New.
12693 (LocalVariableReference.DoResolveBase): ... this.
12694 (MemberAccess.Resolve): Do the check that was disabled during
12697 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12700 (PartialContainer.Create): check abstract/sealed/static strictly
12701 but abstract/sealed can exist only at one side. Fixed bug #75883.
12703 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
12706 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
12707 specified, don't default to UnmanagedType.I4.
12709 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12711 * expression.cs : conditional operator should check possibly
12712 incorrect assign expression. Fixed bug #75946.
12714 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12716 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
12717 Reverting the change. gmcs is much complex than mcs on this matter.
12719 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12721 * cs-tokenizer.cs : To read another token ahead of the actual
12722 consumption, use new SavedToken and cache token instead of moving
12723 back the stream with SeekableStreamReader (it seemed problematic).
12725 driver.cs : Thus use StreamReader directly.
12726 * support.cs : Thus removed SeekableStreamReader.
12728 2005-08-30 Raja R Harinath <rharinath@novell.com>
12731 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
12732 (ScopeInfo.EmitScopeType): Use it to construct field names from
12733 names of captured locals.
12736 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
12737 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
12738 Pass 'target_type' to BoxedCast. Don't default to 'object'.
12739 (ExplicitConversion): Remove enum cases already handled by
12740 implicit conversion. Move implicit conversion check to the beginning.
12741 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
12742 * expression.cs (ArrayCreation.EmitDynamicInitializers):
12743 Don't treat System.Enum as a struct.
12745 2005-08-30 Jb Evain <jbevain@gmail.com>
12747 * attribute.cs: handles as expression in parameters.
12749 2005-08-30 Raja R Harinath <rharinath@novell.com>
12752 * class.cs (TypeContainer.VerifyClsName): Don't use a
12753 PartialContainer when verifying CLS compliance.
12754 (AbstractPropertyEventMethod): Set Parent here, ...
12755 (PropertyMethod): ... not here.
12757 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
12759 * attribute.cs : escaped attribute name should not be allowed to be
12760 resolved (e.g. @class as classAttribute). Fixed bug #75930.
12762 2005-08-29 Raja R Harinath <rharinath@novell.com>
12765 * convert.cs (ImplicitStandardConversionExists): Allow zero also
12766 when converting a long constant to unsigned long.
12767 * expression.cs (Invocation.OverloadResolve): Add sanity check to
12768 detect where IsApplicable and VerifyArgumentsCompat disagree.
12770 2005-08-29 Raja R Harinath <rharinath@novell.com>
12771 and Carlos Alberto Cortez <carlos@unixmexico.org>
12774 * class.cs (TypeContainer.CanElideInitializer): New helper.
12775 (TypeContainer.EmitFieldInitializers): Use it to determine if we
12776 can safely emitting the initializer of a field.
12778 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12780 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
12781 allowed inside a switch (without loop). Fixed bug #75433.
12783 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
12785 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
12786 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
12788 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12790 * driver.cs : kinda reverting the default encoding changes (not exact
12791 revert since I noticed that "codepage:reset" might not work fine).
12793 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12795 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
12796 Location. Now getter and setter store location correctly.
12797 (errors/cs0111-12.cs now reports the expected location.)
12799 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12801 * driver.cs : Use default encoding on the environment.
12802 Removed (now that) extra parameter for SeekableStreamReader.
12803 * support.cs : (SeekableStreamReader) third .ctor() argument for
12804 StreamReader is not required (always true). preamble size could
12805 be acquired in simpler and safe way.
12807 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
12809 * cs-parser.jay: report CS0642 at warning level 3
12810 and report CS0642 for an if else statement also
12811 fixes bug #74745. Patch by John Luke (and a bit
12813 Removed extra CS0642 warning check for "while",
12815 * statement.cs: In Block.Resolve(), CS0642 check
12816 is reimplemented to check a sequence of an empty
12817 statement and a block.
12819 Both fix bug #66777.
12821 2005-08-24 Marek Safar <marek.safar@seznam.cz>
12823 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
12824 detection until I fix it.
12826 * cs-tokenizer.cs: Changed error message.
12828 * cs-parser.jay: Fixed 2 error locations.
12830 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
12831 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
12834 * enum.cs (GetSignatureForError): Fixed.
12836 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
12840 * typemanager.cs (RegisterProperty): Removed.
12842 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
12844 2005-08-24 Raja R Harinath <rharinath@novell.com>
12847 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
12848 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
12850 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12852 * expression.cs : tiny fix is required for not warning positive ulong.
12855 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12857 * expression.cs : add CS0652 check for constant and integral
12858 expression. Fixed bug #53974.
12860 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12862 * expression.cs : in DoNumericPromotions(), check if there is implicit
12863 conversion overload for string (to check CS0034). Fixed bug #52492.
12865 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12867 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
12869 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12871 * ecore.cs : report location when it is *not* Null.
12873 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12879 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
12880 correctly. Fixed bug #75721.
12882 2005-08-23 Raja R Harinath <rharinath@novell.com>
12884 * support.cs (SeekableStreamReader.Position): Avoid an expensive
12885 loop that performs 'min (pos, char_count)'.
12888 * expression.cs (Unary.ResolveOperator): Don't discard implicit
12889 converted value in Operator.OnesComplement.
12891 2005-08-22 Ben Maurer <bmaurer@ximian.com>
12893 * anonymous.cs: If the anon method is pulled into a helper class,
12894 it needs to be `internal' not `private'. Fixes runtime behavior on
12897 2005-08-20 Martin Baulig <martin@ximian.com>
12899 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
12900 scope if we don't already have it.
12902 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
12903 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
12906 2005-08-17 Marek Safar <marek.safar@seznam.cz>
12909 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
12910 is a partial class.
12912 2005-08-16 Marek Safar <marek.safar@seznam.cz>
12914 The big constants rewrite
12915 Fix #75746, #75685 and more
12916 As a side effect saved 1MB for MWF ;-)
12918 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
12919 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
12920 enum based for corlib compilation.
12922 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
12925 * class.cs (FixedField.Define): Use ResolveAsConstant.
12927 * const.cs (IConstant): Interface constants and enums.
12928 (Const.ResolveValue): New method for constant resolvning.
12929 (ExternalConstant): Constants from imported assemblies.
12931 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
12932 conversion; like enums.
12933 (Constant.ToType): Converts this constant to different type.
12934 (Constant.Increment): Adds 1.
12936 * convert.cs (ImplicitConversionRequired): Simplified.
12938 * cs-parser.jay: Create EnumMember directly.
12940 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
12942 * doc.cs (GenerateEnumDocComment): Removed.
12944 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
12945 (ConvertIntLiteral): Removed.
12946 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
12948 * enum.cs (EnumMember): Implement IConstant.
12949 (Enum.IsValidEnumConstant): Removed.
12950 (Enum.GetNextDefaultValue): Removed.
12951 (Enum.FindMembers): Updated.
12952 (Enum.GenerateDocComment): Iterate enum members.
12954 * expression.cs (Cast.TryReduce): Handle enums correctly.
12955 (New.Constantify): Made public.
12956 (MemberAccess.DoResolve): Removed contant specific if(s).
12958 * literal.cs (NullLiteral): Implement new abstract methods.
12960 * statement.cs (GotoCase.Resolve): Use new constant methods.
12961 (SwitchLabel.ResolveAndReduce): Use new constant methods.
12963 * typemanager.cs (LookupEnum): Removed.
12964 (IsEnumType): Fixed to work with corlib.
12965 (RegisterConstant): Removed.
12966 (LookupConstant): Removed.
12967 (GetConstant): Changed to work with IConstant.
12969 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
12971 * location.cs : Fixed overflown (>255) column number.
12973 2005-08-03 Raja R Harinath <rharinath@novell.com>
12975 First cut of the qualified-alias-member feature.
12976 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
12978 * cs-parser.jay (DOUBLE_COLON): New token.
12979 (namespace_or_type_name): Add rule for recognizing
12980 qualified-alias-members.
12981 (primary_expression): Likewise.
12982 (element_access): Allow QualifiedAliasMember as a possible
12983 type-bearing expression.
12984 (local_variable_type, local_variable_pointer_type): Likewise.
12985 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
12986 aliases in the current and enclosing namespace declarations.
12987 (NamespaceEntry.UsingAlias): Add CS0440 warning.
12988 * decl.cs (MemberName.is_double_colon): New.
12989 (MemberName.MemberName): Add new constructor for alias-member.
12990 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
12991 * expression.cs (QualifiedAliasMember): New expression type.
12993 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12995 * location.cs : it borked when no argument was specified.
12997 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12999 * location.cs : tiny ToString() format fix.
13001 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
13003 * statement.cs : oops, it was missing.
13005 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
13007 A set of fixes for precise line/column location.
13010 "token" field now holds a file/line "delta", a line number offset
13011 from the segment, and a column number. See also:
13012 http://lists.ximian.com/pipermail/mono-devel-list/2004-
13013 December/009508.html
13014 Removed static IsNull. Use instance IsNull property instead.
13015 * cs-tokenizer.cs :
13016 For some tokens it stores Location. For Identifier it stores
13017 LocatedToken which is a pair of string name and location.
13018 Column numbers are adjusted only at getChar().
13020 Use Location.ToString() for reporting (it now contains column).
13022 Largely modified to use LocatedToken instead of
13023 string (IDENTIFIER), and to acquire Location from some tokens.
13024 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
13025 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
13027 Now MemberName holds Location. DeclSpace.ctor() receives Location
13028 as a parameter. Removed extra parameters to all derived classes.
13029 Replaced Location.IsNull() with instance property.
13030 * assign.cs, expression.cs :
13031 Added .ctor() overload that omits Location.
13033 Added "nameEscaped" flag that indicates the identifier was escaped
13034 in the source file. This fixes bug #57047.
13036 2005-08-02 Marek Safar <marek.safar@seznam.cz>
13038 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
13039 New method, looking for lo-case imported cls type.
13041 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
13044 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
13046 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
13048 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
13049 all_imported_types.
13050 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
13052 Optimized to save 3.5 MB for SWF compilation.
13054 2005-08-01 Marek Safar <marek.safar@seznam.cz>
13056 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
13057 (PartialContainer.Create): Moved logic AddToContainer.
13058 (PartialContainer.MarkForDuplicationCheck): Shares name.
13060 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
13063 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
13065 (Namespace.GetSignatureForError): New method.
13067 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
13068 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
13070 2005-08-01 Raja R Harinath <rharinath@novell.com>
13073 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
13074 member lookup rather than qualifier_type, since qualifier_type can
13077 2005-08-01 Marek Safar <marek.safar@seznam.cz>
13079 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
13082 2005-07-31 Miguel de Icaza <miguel@novell.com>
13084 * statement.cs: Copy the local exception into the exception
13085 captured local. Fixes 75674
13087 2005-07-31 Raja R Harinath <harinath@gmail.com>
13090 * expression.cs (Invocation.OverloadResolve): Don't report error
13091 CS1501 if error CS1502 has been reported.
13092 (New.DoResolve): Delegate CS1501 reporting to
13093 Invocation.OverloadResolve.
13096 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
13097 invariant-meaning-in-block property in an enclosing block if
13100 2005-07-29 Marek Safar <marek.safar@seznam.cz>
13102 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
13103 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
13104 (Switch.CheckSwitch): Just save 50kb for SWF.
13106 2005-07-27 Martin Baulig <martin@ximian.com>
13108 * anonymous.cs (CaptureContext.AddField): Added
13109 `AnonymousContainer am' argument; compute its toplevel scope if
13110 it's not already computed. Fixes #75649.
13112 2005-07-26 Raja R Harinath <rharinath@novell.com>
13115 * class.cs (Constructor.Emit): Reset block to null if the block
13118 2005-07-25 Marek Safar <marek.safar@seznam.cz>
13120 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
13122 2005-07-25 Marek Safar <marek.safar@seznam.cz>
13124 * class.cs (MethodData.Define): Check whether accessor implementing
13125 interface is public.
13127 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
13129 2005-07-22 Marek Safar <marek.safar@seznam.cz>
13132 * namespace.cs (LookupType): Moved same type check to...
13134 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
13135 with the same name.
13137 2005-07-21 Raja R Harinath <rharinath@novell.com>
13139 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
13140 already found a typebuilder.
13141 * class.cs (MethodCore.IsDuplicateImplementation): Compare
13142 MemberNames, not strings.
13144 * const.cs (Error_ExpressionMustBeConst):
13145 Rename from Error_EpressionMustBeConst.
13146 * const.cs, class.cs, statement.cd: Update.
13148 2005-07-21 Marek Safar <marek.safar@seznam.cz>
13152 * const.cs (Const.LookupConstantValue): Report missing contant expression
13154 (Error_EpressionMustBeConstant): Only one error method.
13156 * class.cs, statement.c: Updated.
13158 2005-07-20 Raja R Harinath <rharinath@novell.com>
13160 * statement.cs (Block.Flags): Add back HasVarargs.
13161 (Block.flags): Make protected.
13162 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
13164 * typemanager.cs (types, typecontainers, user_types): Remove.
13165 (UserTypes, TypeContainers): Likewise.
13166 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
13167 (CleanUp, Reset): Update.
13168 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
13169 (GetNestedType): Use Type.GetNestedType.
13170 (CoreLookupType): Take two arguments, the namespace and the
13171 basename of the type. Update to use the Namespace.Lookup
13173 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
13174 (RealMemberLookup): Use IsNestedChildOf instead of playing with
13175 string concatenation and substring matches.
13176 * class.cs, enum.cs, delegate.cs: Update to changes.
13178 2005-07-20 Marek Safar <marek.safar@seznam.cz>
13180 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
13181 Expression and made virtual.
13183 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
13184 (ImplicitStandardConversionExists): Fixed `byte' typo ?
13186 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
13188 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
13191 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
13194 2005-07-18 Marek Safar <marek.safar@seznam.cz>
13197 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
13198 AssemblyCultureAttribute is not used on executable.
13201 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
13203 2005-07-16 Raja R Harinath <rharinath@novell.com>
13206 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
13207 New. Reports CS0252/CS0253.
13208 Mostly taken from preliminary patch by Duncak Mak.
13209 (Binary.DoResolveOperator): Store results of operator lookup.
13210 Use them to detect if we need to warn about unintended reference
13213 2005-07-15 Raja R Harinath <rharinath@novell.com>
13216 * namespace.cs (Namespace.Lookup): Add back location parameter.
13217 (Namespace.LookupType): Add CS0436 report. Add location parameter.
13218 * delegate.cs, ecore.cs, expression.cs: Update to changes.
13220 * codegen.cs (EmitContext.DeclSpace): Make readonly.
13221 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
13222 (Namespace.LookupType): ... this.
13223 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
13225 * typemanager.cs (LookupTypeReflection): Remove buggy code that
13226 purported to handle pointers.
13227 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
13230 2005-07-15 Marek Safar <marek.safar@seznam.cz>
13232 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
13235 2005-07-15 Raja R Harinath <rharinath@novell.com>
13237 * namespace.cs (Namespace.Lookup): Drop location parameter.
13238 (NamespaceEntry.LookupAlias): Remove. Merge into ...
13239 (NamespaceEntry.Lookup): ... this.
13240 (NamespaceEntry.Error_AmbiguousTypeReference):
13241 Move here from DeclSpace.
13242 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
13244 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
13245 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
13246 Move to NamespaceEntry.
13247 * delegate.cs, expression.cs: Update to changes.
13249 2005-07-14 Marek Safar <marek.safar@seznam.cz>
13251 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
13252 CheckAttributeType and refactored.
13253 (Attribute.ResolvePossibleAttributeType): Changed to reuse
13254 ResolveAsTypeTerminal error handling.
13255 (ResolveAsTypeTerminal): Introduced because of global attributes extra
13257 (GetSignatureForError): Print errors in same way.
13260 * codegen.cs: Reflect attribute GetSignatureForError change.
13263 * expression.cs: Add silent parameter to ResolveAsTypeStep.
13265 * namespace.cs (UsingEntry): Refactored to make fields private.
13268 statement.cs: Error_UnexpectedKind has extra parameter.
13270 2005-07-14 Raja R Harinath <rharinath@novell.com>
13272 * ecore.cs (IAlias): Remove.
13273 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
13274 that implement the interface.
13275 * namespace.cs (Namespace): Likewise.
13276 (Namespace.declspaces): Renamed from 'defined_names'.
13277 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
13278 DeclSpace instead of an IAlias.
13279 * tree.cs (Tree.AddDecl): Update.
13281 2005-07-12 Raja R Harinath <rharinath@novell.com>
13283 * statement.cs (Block.Flags); Remove HasVarargs.
13284 (Block.HasVarargs): Move to ToplevelBlock.
13285 (Block.ThisVariable, Block.AddThisVariable): Likewise.
13286 (Block.Variables): Make protected. Initialize variable hashtable
13288 (Block.AddVariable): Update.
13289 (Block.Resolve): Update to changes.
13290 (ToplevelBlock.HasVarargs): New boolean.
13291 (ToplevelBlock.ThisVariable): Move here from Block.
13292 (ToplevelBlock.AddThisVariable): Likewise.
13293 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
13294 * expression.cs (This.ResolveBase): Update to changes.
13295 (ArglistAccess.DoResolve): Likewise.
13297 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13300 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
13302 * class.cs (TypeContainer.VerifyMembers): Distinguish between
13303 not used and not used & assigned.
13304 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
13306 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13309 * expression.cs (Is.DoResolve): null is never provided type.
13311 2005-07-08 Marek Safar <marek.safar@seznam.cz>
13314 * cs-parser.jay: Less strict event error rule to catch more errors.
13316 2005-07-08 Martin Baulig <martin@ximian.com>
13318 Fix test-iter-10.cs - distinguish whether we `yield' in a property
13319 gettter (allowed) or setter (not allowed).
13321 * class.cs (Accessor): Implement IIteratorContainer.
13322 (Accessor.Yields): New public field.
13323 (PropertyBase.PropertyMethod.Define): Handle iterators on a
13324 per-accessor basis.
13327 (get_accessor_declaration, set_accessor_declaration): Set the
13328 `yields' flag on the accessor, not the property.
13329 (property_declaration): Do the iterators check on a per-accessor
13330 basis and not for the whole property.
13332 2005-07-08 Martin Baulig <martin@ximian.com>
13334 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
13335 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
13337 2005-07-07 Marek Safar <marek.safar@seznam.cz>
13340 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
13341 (ExtractSecurityPermissionSet): Cope with self referencing security
13342 attributes properly.
13344 * driver.cs (SetOutputFile): Made public property OutputFile.
13346 2005-07-07 Raja R Harinath <rharinath@novell.com>
13349 * class.cs (TypeContainer.first_nonstatic_field): Rename from
13350 has_nonstatic_fields. Make into a FieldBase pointer.
13351 (TypeContainer.AddField): Add CS0282 check.
13352 (TypeContainer.EmitType): Update.
13354 2005-07-06 Miguel de Icaza <miguel@novell.com>
13356 * cs-tokenizer.cs (consume_identifier): Do not create strings to
13357 compare if they start with __.
13359 2005-07-06 Raja R Harinath <rharinath@novell.com>
13361 * statement.cs (Switch.SwitchGoverningType): Only look at
13362 UserCasts that don't need implicit standard conversions to one of
13363 the allowed switch types (Fixes test-322.cs).
13364 (LocalInfo.Resolve): Re-enable sanity-test.
13366 2005-07-06 Marek Safar <marek.safar@seznam.cz>
13368 * cs-tokenizer.cs (consume_identifier): Detect double undescores
13370 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
13372 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
13374 2005-07-06 Raja R Harinath <rharinath@novell.com>
13377 * ecore.cs (SimpleName.GetSignatureForError): Add.
13378 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
13379 (MemberAccess.GetSignatureForError): Add.
13381 2005-07-05 Marek Safar <marek.safar@seznam.cz>
13383 The big error and warning messages review.
13413 * typemanager.cs: Updated.
13415 * class.cs: (MethodCore.SetYields): Moved here to share.
13416 (PropertyMethod.Define): Moved iterator setup here.
13418 * iterators.cs: Add orig_method to have full access to parent
13421 2005-07-05 Raja R Harinath <rharinath@novell.com>
13423 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
13424 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
13425 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
13426 variable of struct type.
13427 * expression.cs (Unary.ResolveOperator): Update to change.
13428 (Indirection.VerifyFixed): Likewise.
13429 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
13430 (ParameterReference.VerifyFixed): Value parameters are fixed.
13431 (This.VerifyFixed): Treat 'this' as a value parameter.
13432 * statement.cs (LocalInfo.IsFixed): Remove.
13434 2005-07-01 Martin Baulig <martin@ximian.com>
13436 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
13437 `ec.EmitThis ()' to get the correct scope.
13439 2005-07-01 Martin Baulig <martin@ximian.com>
13441 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
13442 instance is a ParameterReference; fixes #75299.
13444 2005-07-01 Martin Baulig <martin@ximian.com>
13446 Reverted Marek's latest patch (r46725):
13447 - it contains structural changes which are neither mentioned in
13448 the ChangeLog nor explained anywhere; for example the additional
13449 argument of EmitContext's and Iterator's .ctor's and the
13450 TypeContainer.DefineMembers() change.
13451 - structural changes like this should go in in seperate patches
13452 and not be hidden in a huge patch which just seems to affect
13453 warnings and errors.
13454 a big and hard to understand patch.
13455 - it breaks iterators and causes regressions, for instance in
13458 2005-06-30 Raja R Harinath <rharinath@novell.com>
13461 * expression.cs (Indexers.map): Remove.
13462 (Indexers.Append): Filter out inaccessible setters and getters.
13463 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
13466 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
13467 Refactored from ...
13468 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
13469 (FieldExpr.Emit, PropertyExpr.Emit): Update.
13470 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
13471 * expression.cs (Invocation.EmitCall): Add CS0120 check.
13473 2005-06-30 Marek Safar <marek.safar@seznam.cz>
13476 * class.cs (FieldBase.GetInitializerExpression): One more field
13479 2005-06-28 Miguel de Icaza <miguel@novell.com>
13481 * pending.cs: Do not define a proxy if the base method is virtual,
13482 it will be picked up by the runtime (bug 75270).
13484 2005-06-08 Martin Baulig <martin@ximian.com>
13486 The big Iterators rewrite :-)
13488 * iterators.cs: Rewrite this to use the anonymous methods framework.
13490 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
13491 before the TypeContainers; see 2test-21.cs.
13494 (TypeContainer.DefineType): Don't create a new EmitContext if we
13495 already have one (this only happens if we're an Iterator).
13496 (TypeContainer.Define): Also call Define() on all our iterators.
13497 (Method.CreateEmitContext): Added support for iterators.
13500 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
13501 (AnonymousContainer.CreateMethodHost): Moved here from
13502 AnonymousMethod and made abstract.
13503 (AnonymousContainer.CreateScopeType): New abstract method.
13504 (AnonymousContainer.IsIterator): New public property.
13505 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
13506 get the ScopeTypeBuilder rather than manually defining it here.
13507 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
13510 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
13511 before RootContext.DefineTypes().
13513 * codegen.cs (EmitContext.RemapToProxy): Removed.
13514 (EmitContext.CurrentAnonymousMethod): Changed type from
13515 AnonymousMethod -> AnonymousContainer.
13516 (EmitContext.ResolveTopBlock): Protect from being called twice.
13517 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
13518 (EmitContext.EmitThis): Removed the iterators hacks; use the
13519 anonymous methods framework for that.
13522 (ToplevelBlock.Container): Make this a property, not a field.
13523 (ToplevelBlock.ReParent): New public method; move the
13524 ToplevelBlock into a new container.
13525 (Foreach.TemporaryVariable): Simplify.
13527 2005-06-05 Martin Baulig <martin@ximian.com>
13529 * statement.cs (LocalInfo.CompilerGenerated): New flag.
13530 (Block.AddTemporaryVariable): New public method; creates a new
13531 `LocalInfo' for a temporary variable.
13532 (Block.EmitMeta): Create the LocalBuilders for all the temporary
13534 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
13535 non-iterator variables.
13537 2005-06-05 Martin Baulig <martin@ximian.com>
13539 * statement.cs (Foreach.TemporaryVariable): Create the
13540 LocalBuilder in the Emit phase and not in Resolve since in some
13541 situations, we don't have an ILGenerator during Resolve; see
13542 2test-19.cs for an example.
13544 2005-06-04 Martin Baulig <martin@ximian.com>
13546 **** Merged r45395 from GCS ****
13548 The big Foreach rewrite - Part II.
13550 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
13551 with `PropertyInfo ienumerator_getcurrent'.
13553 * codegen.cs (VariableStorage): Removed.
13556 (Foreach): Derive from Statement, not ExceptionStatement.
13557 (Foreach.CollectionForeach): New nested class. Moved all the code
13558 dealing with collection foreach here.
13559 (Foreach.ForeachHelperMethods): Removed.
13560 (Foreach.TemporaryVariable): Implement IMemoryLocation.
13562 2005-05-23 Martin Baulig <martin@ximian.com>
13564 * statement.cs (Try.DoResolve): Don't create a `finally' if we
13565 don't need to. Fix #75014.
13567 2005-05-20 Martin Baulig <martin@ximian.com>
13569 Merged r44808 from GMCS.
13571 * class.cs (TypeContainer.CircularDepException): Removed.
13572 (TypeContainer.DefineType): Removed the `InTransit' stuff.
13573 (TypeContainer.CheckRecursiveDefinition): Check for circular class
13574 (CS0146) and interface (CS0529) dependencies here.
13576 2005-06-21 Raja R Harinath <rharinath@novell.com>
13578 * expression.cs (Invocation.EmitCall): Fix initialization
13579 'this_call' to reflect current behaviour. Fix indentation.
13581 * convert.cs (FindMostEncompassedType): Add two trivial special
13582 cases (number_of_types == 0 || number_of_types == 1).
13583 (FindMostEncompasingType): Likewise.
13585 2005-06-17 Raja R Harinath <rharinath@novell.com>
13587 Some cleanups preparing for the fix of #75283.
13588 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
13590 (EventExpr.InstanceResolve): Likewise.
13591 (EventExpr.DoResolve): Remove redundant checks.
13593 2005-06-10 Duncan Mak <duncan@novell.com>
13595 * cs-tokenizer.cs (process_directives): New flag for controlling
13596 the processing of preprocessor directives.
13597 (x_token): After seeing a '#', return Token.NONE instead of going
13598 to handle_preprocessing_directive() when not processing
13599 directives. This avoids unnecessary processing during the token peek in
13604 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
13605 the existing error reporting methods instead of Report.Error.
13607 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
13608 after Raja's rewrite.
13610 2005-06-08 Miguel de Icaza <miguel@novell.com>
13612 * class.cs: Small fix.
13614 2005-06-08 Raja R Harinath <rharinath@novell.com>
13617 * class.cs (GetPartialBases): Fix return value check of
13618 part.GetClassBases.
13620 2005-06-07 Raja R Harinath <rharinath@novell.com>
13622 Ensure that partial classes are registered in their enclosing
13623 namespace. Initial part of fix of #75160.
13624 * tree.cs (Tree.RecordDecl): Add new namespace argument.
13625 Register declspace with namespace here, not in
13626 DeclSpace.RecordDecl.
13627 * cs-parser.jay: Pass namespace to RecordDecl.
13628 * class.cs (PartialContainer.Create): Likewise.
13629 (ClassPart.DefineType): New sanity-check. Throws an exception if
13631 * decl.cs (Declspace.RecordDecl): Remove.
13632 * namespace.cs (NamespaceEntry.DefineName): Remove.
13634 2005-06-06 Marek Safar <marek.safar@seznam.cz>
13636 * rootcontext.cs: Reset TargetExt as well.
13638 2005-06-03 Raja R Harinath <rharinath@novell.com>
13640 * ecore.cs (Expression.Resolve): Emit CS0654 error when
13641 -langversion:ISO-1.
13643 2005-06-02 Raja R Harinath <rharinath@novell.com>
13645 Fix #75080, cs0119.cs.
13646 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
13648 (Expression.Resolve): ... this. Use it. Remove bogus code
13649 allowing ExprClass.Type and ExprClass.Namespace for
13650 ResolveFlags.VariableOrValue.
13651 (Expression.Resolve) [1-argument variant]: Change default resolve
13652 flags based on language version.
13653 (Expression.Error_UnexpectedKind): Use a simple string array
13654 rather than an ArrayList.
13655 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
13656 not ExprClass.Type.
13657 (TypeOfVoid.DoResolve): Likewise.
13658 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
13659 flags argument -- it always has the same value.
13661 2005-05-31 Raja R Harinath <rharinath@novell.com>
13664 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
13665 Use it in the error message.
13666 * assign.cs, expression.cs, statement.cs: Update.
13668 2005-05-30 Raja R Harinath <rharinath@novell.com>
13671 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
13672 the "almostMatchedMember" case too.
13673 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
13674 that failed the accessibility checks to 'almost_match'.
13676 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
13678 * attribute.cs: Use internal MethodBuilder methods to set
13679 ExactSpelling and SetLastError on PInvoke methods, instead
13680 of passing them via charset. Fixes #75060.
13682 2005-05-27 Raja R Harinath <rharinath@novell.com>
13684 * parameter.cs (Parameter): Remove TODO comment.
13685 (Parameter.DefineParameter): Remove Location parameter.
13686 (Parameters.LabelParameters): Likewise.
13687 * class.cs (Constructor.Emit): Update to change.
13688 (MethodData.Emit): Likewise.
13689 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
13690 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
13692 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
13695 Removed Parameters.Location and added Parameter.Location instead.
13696 Removed Location parameter from Emit() and GetSignature().
13703 Modified all related calls.
13705 2005-05-26 Raja R Harinath <rharinath@novell.com>
13707 Improve user-defined conversion handling.
13708 * convert.cs (GetConversionOperators): Rewrite. Return only the
13709 applicable operators.
13710 (AddConversionOperators): New. Helper for GetConversionOperators.
13711 (FindMostEncompassedType, FindMostEncompassingType): Verify that
13712 there is only one most encompassed/encompassing type.
13713 (FindMostSpecificSource, FindMostSpecificTarget): Remove
13714 "applicable operator" handling.
13715 (UserConversion): Move cache here from GetConversionOperators.
13716 Directly cache the chosen operator, rather than the whole
13718 (ExplicitNumericConversion): Fix buggy implementation of Decimal
13719 case. Allow conversion of decimal to sbyte and byte too.
13720 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
13721 New static methods. Used to avoid allocating EmptyExpressions in
13724 2005-05-24 Duncan Mak <duncan@novell.com>
13726 * ecore.cs (CastFromDecimal): New class for casting a decimal to
13727 another class, used in Convert.ExplicitNumericConversion.
13728 (CastToDecimal): New class, similar to above, but casts to
13729 System.Decimal, used in Convert.ImplicitNumericConversion and also
13730 in explicit convesion from double/float to decimal.
13732 * convert.cs (ImplicitNumericConversion): Handle implicit
13733 conversions to System.Decimal.
13734 (ExplicitNumericConversion): handle explicit conversions to
13739 2005-05-20 Miguel de Icaza <miguel@novell.com>
13741 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
13742 know the type at this stage, just break through. Fixes #75008
13744 2005-05-19 Martin Baulig <martin@ximian.com>
13747 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
13748 to disable error reporting.
13750 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
13751 here since we don't want to report an error; see the new test-336.cs.
13753 2005-05-19 Raja R Harinath <rharinath@novell.com>
13755 * statement.cs (ToplevelBlock.GetParameterReference)
13756 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
13757 Move here from class Block.
13758 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
13759 * expression.cs (ParameterReference.DoResolveBase): Likewise.
13761 2005-05-18 Martin Baulig <martin@ximian.com>
13766 (FlowBranching.Reachability): Add non-static public And() and Or()
13768 (FlowBranchingSwitch): New class; do the `break_origins' thing
13769 like in FlowBranchingLoop.
13770 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
13771 reachability, not just locals and parameters.
13772 (FlowBranching.MergeChild): Remove some of the hacks for loop and
13773 switch; MergeBreakOrigins() now takes care of that.
13775 2005-05-18 Martin Baulig <martin@ximian.com>
13777 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13778 a loop and may leave it, reset the barrier; fixes #74974.
13780 2005-05-17 Marek Safar <marek.safar@seznam.cz>
13782 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
13785 * cs-parser.jay: Catch more lexical errors.
13787 * report.cs: Add one more Error method.
13790 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
13792 2005-05-17 Martin Baulig <martin@ximian.com>
13794 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
13797 2005-05-16 Raja R Harinath <rharinath@novell.com>
13799 Fix test-382.cs. Emit values of decimal constants.
13800 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
13802 (TypeContainer.AddField): ... this.
13803 (TypeContainer.EmitFieldInitializers): Allow the list of fields
13804 with initializers to include 'Const's.
13805 (ClassPart.RegisterFieldForInitialization): Forward to
13807 * const.cs (Const.Const): Pass initializer to base class.
13808 (Const.Define): In case of decimal constants, register them for
13809 initialization in a static constructor.
13811 2005-05-14 Martin Baulig <martin@ximian.com>
13813 * statement.cs (Block.Resolve): Correctly handle unreachable code;
13814 do not call ResolveUnreachable() on unreachable statements in
13815 here, see the comment in the source code.
13817 2005-05-13 Raja R Harinath <rharinath@novell.com>
13820 * expression.cs (BinaryResolveOperator): If one of the operands of
13821 an equality comparison is 'null' and the other is a pointer type,
13822 convert the null to a NullPointer.
13823 * convert.cs (ImplicitReferenceConversion): If the expression is a
13824 NullLiteral and the target type is a pointer type, return a
13825 NullPointer instead.
13826 (ImplicitConversionStandard): Likewise.
13828 2005-05-13 Marek Safar <marek.safar@seznam.cz>
13830 * cs-parser.jay: Set readonly context based on special constructs.
13832 * expression.cs (LocalVariableReference.DoResolveBase): Improved
13833 readonly variable error handling.
13835 * rootcontext.cs (EmitCode): Don't verify members when error
13838 * statement.cs (LocalInfo): Add reaodnly context information.
13839 (SetReadOnlyContext, GetReadOnlyContext): New methods.
13841 2005-05-13 Raja R Harinath <rharinath@novell.com>
13843 * statement.cs (Block.Resolve): Revert change below. Modify fix
13844 for #74041 to initialize 'resolved' to false only for explicit
13845 blocks. Fixes #74873.
13847 2005-05-12 Raja R Harinath <harinath@gmail.com>
13850 * typemanager.cs (unmanaged_enclosing_types): New.
13851 (IsUnmanagedType): Avoid infloops by using
13852 'unmanaged_enclosing_types' to talk with recursive invocations.
13854 2005-05-13 Martin Baulig <martin@ximian.com>
13856 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
13857 instance variable, not a local. Fix #74873.
13858 (Block.ResolveUnreachable): Set it to true here.
13860 2005-05-11 Duncan Mak <duncan@novell.com>
13862 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
13863 continuing to process for 'arg'.
13864 (handle_preprocessing_directive): Check the argument of the #endif
13865 directive and report error CS1025 if there are any trailing
13868 According to the C# spec, having even whitespace after the #endif
13869 directive is illegal; however, because we call arg.TrimEnd ()
13870 beforehand, we have the same behavior as csc, allowing whitespace
13871 after the directive.
13875 2005-05-11 Marek Safar <marek.safar@seznam.cz>
13879 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
13880 (Constructor.GetObsoleteAttribute): Implemented correctly.
13882 2005-05-10 Martin Baulig <martin@ximian.com>
13884 * support.cs (ReflectionParameters.ParameterModifier): Use
13885 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
13886 and `ParameterAttributes.In'. Fixes #74884.
13888 2005-05-10 Marek Safar <marek.safar@seznam.cz>
13890 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
13892 * expression.cs (Argument.GetParameterModifier): Turned to property.
13893 (Invocation.Error_InvalidArguments): Add more descriptive errors.
13895 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
13898 2005-05-09 Raja R Harinath <rharinath@novell.com>
13901 * decl.cs (MemberCache.AddMethods): Register override methods,
13902 rather than non-override methods.
13903 * typemanager.cs (RegisterOverride): New.
13904 (IsOverride): Update.
13906 2005-05-09 Marek Safar <marek.safar@seznam.cz>
13910 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
13911 recursive declaration.
13913 * statement.cs (Block.ResolveMeta): Report any error in resolving.
13915 2005-05-06 Marek Safar <marek.safar@seznam.cz>
13917 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
13919 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
13921 2005-05-05 Raja R Harinath <rharinath@novell.com>
13924 * decl.cs (DeclSpace.FamilyAccessible):
13925 Use TypeManager.IsNestedFamilyAccessible.
13927 Fix reopened #64812.
13928 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
13931 2005-05-04 Raja R Harinath <rharinath@novell.com>
13932 Abin Thomas <projectmonokochi@rediffmail.com>
13933 Anoob V E <projectmonokochi@rediffmail.com>
13934 Harilal P R <projectmonokochi@rediffmail.com>
13937 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
13938 allow access to all static members.
13940 2005-05-04 Martin Baulig <martin@ximian.com>
13942 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
13944 2005-05-04 Martin Baulig <martin@ximian.com>
13948 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
13949 section at the end; make things work if `default' is not the last
13952 2005-05-04 Martin Baulig <martin@ximian.com>
13956 * statement.cs (Switch): Replaced the `got_default' field with a
13957 `default_section' one.
13958 (Switch.CheckSwitch): Set `default_section' here.
13959 (Switch.Resolve): If we're a constant switch and the constant is
13960 not found, use the default section.
13962 2005-05-03 Martin Baulig <martin@ximian.com>
13964 * expression.cs (ArrayAccess.EmitGetLength): New public method.
13966 * statement.cs (Foreach.ArrayForeach): New nested class.
13967 (Foreach.TemporaryVariable): New nested class.
13968 (Foreach.EmitArrayForeach): Removed; this is now in the new
13969 ArrayForeach class.
13971 2005-05-03 Raja R Harinath <rharinath@novell.com>
13973 * pending.cs (BaseImplements): Move the #74773 fix here. This is
13975 (VerifyPendingMethods): Revert change below.
13977 * typemanager.cs (IsOverride, RegisterNonOverride): New.
13978 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
13979 that used to trigger warning -28. Remove warning -28.
13980 * expression.cs (Invocation.OverloadResolve): Use
13981 TypeManager.IsOverride to distinguish override methods.
13984 * pending.cs (VerifyPendingMethods): If a base type implements the
13985 requested interface, don't bother checking individual methods of
13986 the base type. As a side-effect, this prevents the creation of
13987 unnecessary proxies.
13989 2005-05-02 Martin Baulig <martin@ximian.com>
13993 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13994 Also `And' the locals if the old vector is null.
13995 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
13996 null; in this case we basically reset all the variables.
13998 2005-05-02 Martin Baulig <martin@ximian.com>
14002 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
14003 Added `FlowBranching branching' argument; always `and' the
14004 variables instead of `or'ing them unless we're an infinite loop.
14006 * statement.cs (While.Resolve): Create a new sibling unless we're
14009 2005-05-02 Martin Baulig <martin@ximian.com>
14013 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
14014 arguments; use it instead of creating a new TopLevelBlock.
14015 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
14016 our ConstructorInitializer.
14019 (TopLevelBlock.TopLevelBranching): New public property.
14020 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
14021 and create our `TopLevelBranching'.
14023 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
14024 anonymous method host, use `block.TopLevelBranching' rather than
14025 creating a new branching.
14027 2005-04-20 Miguel de Icaza <miguel@novell.com>
14029 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
14030 a ScopeInfo, if any of the current children is a child of the new
14031 entry, move those children there.
14033 2005-04-30 Martin Baulig <martin@ximian.com>
14035 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
14036 at the beginning of a SwitchSection. Fix #73335.
14038 2005-04-27 Marek Safar <marek.safar@seznam.cz>
14041 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
14043 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
14044 (FieldExpr.DoResolve): Obsolete members are ignored for field
14047 2005-04-26 Marek Safar <marek.safar@seznam.cz>
14049 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
14050 of arrays detection.
14052 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
14054 (Field.VerifyClsCompliance): Volatile fields are not compliant.
14056 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
14059 2005-04-25 Ben Maurer <bmaurer@ximian.com>
14061 * cs-parser.jay: Use the prefered version of -unsafe in error
14064 2005-04-22 Marek Safar <marek.safar@seznam.cz>
14066 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
14069 2005-04-20 John Luke <john.luke@gmail.com>
14071 * driver.cs: fix typo in error message, --outout to --output
14073 2005-04-20 Marek Safar <marek.safar@seznam.cz>
14075 * codegen.cs (InRefOutArgumentResolving): New field.
14077 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
14078 fields outside contructor.
14080 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
14082 2005-04-19 Miguel de Icaza <miguel@novell.com>
14084 * anonymous.cs (CaptureContext.EmitParameterInstance): The
14085 parameter code was not completed ever, so it was not as up-to-date
14086 as local variables. Must finish it.
14088 The bug fix was to compare the Toplevel of the block, not the
14089 current block. Thanks for Ben for pointing this out.
14091 2005-04-19 Raja R Harinath <rharinath@novell.com>
14093 * decl.cs (AddMethods): Use the declaring type of the problem
14094 method to determine if we want to squash a warning.
14096 2005-04-19 Marek Safar <marek.safar@seznam.cz>
14098 * attribute.cs: Removed debug output.
14100 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
14102 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
14105 2005-04-18 Raja R Harinath <rharinath@novell.com>
14108 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
14109 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
14110 all null comparisons against reference types.
14112 2005-04-18 Marek Safar <marek.safar@seznam.cz>
14115 * class.cs (TypeContainer.CircularDepException) New nested
14117 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
14118 (TypeContainer.DefineType): Removed error, reset InTransit before
14120 (Class.DefineType): Throw exception when is in Transit.
14121 Catch exception and report error.
14122 (Struct.DefineType): Throw exception when is in Transit.
14123 Catch exception and report error.
14124 (Interface.DefineType): Throw exception when is in Transit.
14125 Catch exception and report error.
14127 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
14128 handle nested exception handlers.
14130 * flowanalysis.cs (InTryWithCatch): New method, search for try with
14133 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
14134 InFinally and InCatch storage.
14136 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
14137 (Catch.Resolve): Set and Restore ec.InCatch.
14138 (Try.Resolve): Set and Restore ec.InFinally.
14139 (Try.HasCatch): True when try has catch.
14141 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
14143 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
14144 for the same event member, so exclude such cases from warning 419.
14147 2005-04-16 Miguel de Icaza <miguel@novell.com>
14149 * expression.cs (Binary.ResolveOperator): Apply patch from John
14150 Luke to fix bug 59864: operators &, | and ^ on enumerations
14151 require that the same enum type on both sides.
14153 * driver.cs: Add warnings to old flag usage, this is to assist
14154 people who produce Makefiles and hope that the Makefiles will be
14157 * class.cs (TypeContainer.EmitType): Moved the definition of the
14158 special $PRIVATE$ field from the resolve phase to the Emit phase.
14159 During resolve we do not know if we are a struct with
14160 HasExplicitLayout, we know this only after the attributes for the
14163 Set the FieldOffset to zero on the dummy field that we create for
14164 the class. Fixes 74590.
14166 2005-04-16 Raja R Harinath <rharinath@novell.com>
14169 * ecore.cs (PropertyExpr.resolved): New.
14170 (DoResolve): Use it to handle a case of double resolution here.
14171 Handle a case of identical-name-and-type-name.
14172 * expression.cs (ArrayCreation.CheckIndices): Avoid double
14173 resolution by storing the results of expression resolution back
14174 into the "probes" array.
14176 2005-04-15 Raja R Harinath <rharinath@novell.com>
14178 Fix cs0208-7.cs and cs0208-8.cs.
14179 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
14180 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
14181 error reporting to point out the reason a struct is not unmanaged.
14183 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14185 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
14186 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
14188 2005-04-13 Raja R Harinath <rharinath@novell.com>
14191 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
14192 IdenticalNameAndTypeName here.
14193 (EventExpr.InstanceResolve): Likewise.
14195 2005-04-13 Marek Safar <marek.safar@seznam.cz>
14197 C# 2.0 DefaultCharSetAttribute implementation
14199 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
14200 which allows us to set GlobalNamespace for every resolve.
14201 (Attribute.ResolveArguments): Cut from Resolve.
14202 (Attribute.GetCharSetValue): Returns CharSet named argument.
14203 (Attribute.DefinePInvokeMethod): Gets default charset from
14205 (GlobalAttribute.ResolveAsTypeStep): Override.
14206 (GlobalAttribute.ResolveArguments): Override.
14208 * class.cs (TypeAttr): Is protected.
14210 * codegen.cs (ModuleClass.DefaultCharSet): New member.
14211 (ModuleClass.DefaultCharSetType): New memeber.
14212 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
14214 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
14215 charset from module.
14217 * delegate.cs (TypeAttr): Override.
14218 (Delegate.DefineType): Use this TypeAttr.
14220 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
14221 at very early stage (before types are defined) to resolve model
14222 module attributes. It will probably not work with corlib but it
14225 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
14226 charset from module.
14228 * typemanager.cs (default_charset_type): New type.
14230 2005-04-13 Raja R Harinath <rharinath@novell.com>
14232 * decl.cs (MemberCache.AddMethods): Don't warn if
14233 System.Object.Finalize has buggy MethodAttributes.
14235 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
14238 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14240 * doc.cs : detect ambiguous reference to overloaded members.
14241 Fixed bug #71603. MS 1.1 csc does not detect it.
14243 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14245 * doc.cs : delegates must not be referenced with parameters.
14248 2005-04-12 Miguel de Icaza <miguel@novell.com>
14250 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
14252 2005-04-10 Miguel de Icaza <miguel@novell.com>
14254 * driver.cs (MainDriver): Stop processing if the CLS stage found
14257 (CompilerCallableEntryPoint.InvokeCompiler): Always
14258 reset after execution; Take a TextWriter argument for the
14261 * report.cs: Use the error stream instead of hardcoding stderr.
14263 2005-04-09 Miguel de Icaza <miguel@novell.com>
14265 * class.cs: Reduce code paths to test, too small of an
14266 optimization to make it worth the extra testing. Always perform
14269 2005-04-08 Raja R Harinath <rharinath@novell.com>
14272 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
14273 operators that had errors reported on them.
14275 2005-04-08 Marek Safar <marek.safar@seznam.cz>
14277 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
14279 (Attribute.Resolve): Add named argument type checking.
14281 * class.cs (FixedField.Define): Use IsPrimitiveType
14283 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
14285 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
14286 unsafe parameter types.
14288 * statement.cs (Using.ResolveExpression): Add better error description.
14290 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
14292 2005-04-08 Raja R Harinath <rharinath@novell.com>
14295 * attribute.cs (Attribute.GetAttributeUsage): Resolve
14296 AttributeUsageAttribute in the emitcontext of the attribute class,
14297 not in the emitcontext of the attributable entity it was attached to.
14298 * cs-parser.jay: Use 'current_class', not 'current_container',
14299 when creating a GlobalAttribute.
14301 2005-04-08 Alp Toker <alp@atoker.com>
14303 * pending.cs: The fix to #58413 failed to compile methods implementing
14304 interfaces with/without params modifiers and vice versa, even though
14305 params modifiers aren't part of the signature. Make the modifier check
14306 less strict as in csc.
14308 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
14309 Anoob V E <projectmonokochi@rediffmail.com>
14310 Harilal P R <projectmonokochi@rediffmail.com>
14313 * pending.cs (TypeAndMethods.mods): New. Store the parameter
14314 modifiers of pending methods.
14315 (PendingImplementation.PendingImplementation): Initialize it.
14316 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
14317 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
14318 with ParameterData. Add check for modifiers.
14319 * class.cs (MethodData.Define): Update to changes.
14321 2005-04-07 Raja R Harinath <rharinath@novell.com>
14323 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
14325 2005-04-07 Marek Safar <marek.safar@seznam.cz>
14327 * class.cs (PropertyMethod.Define): Check private accessor in abstract
14330 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
14333 * typemanager.cs: Registered RequiredAttributeAttribute.
14335 2005-04-06 Marek Safar <marek.safar@seznam.cz>
14337 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
14338 Warning CS0169 is back at level 3.
14339 (IMethodData.SetMemberIsUsed): New method.
14341 * decl.cs (IsUsed): New value; moved from FieldBase.Status
14342 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
14344 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
14346 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
14348 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
14351 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
14354 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
14355 to avoid the problems with nested types.
14357 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
14358 Anoob V.E <projectmonokochi@rediffmail.com>
14359 Harilal P.R <projectmonokochi@rediffmail.com>
14360 Raja R Harinath <rharinath@novell.com>
14363 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
14365 * typemanager (GetConstructor): Make public.
14367 2005-04-05 John Luke <john.luke@gmail.com>
14368 Raja R Harinath <rharinath@novell.com>
14371 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
14372 struct too. Return false quicker in a few cases.
14373 (VerifyUnManaged): Use it.
14375 2005-04-05 Raja R Harinath <rharinath@novell.com>
14378 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
14379 not 'unreachable_seen'.
14381 2005-04-04 Marek Safar <marek.safar@seznam.cz>
14383 * attribute.cs (Attribute.GetValue): Removed unused.
14385 * codegen.cs (CodeGen.TrimExt): Removed unused.
14387 * cs-parser.jay (output): Removed unused.
14389 * cs-tokenizer.cs (hex_digits): Removed unused.
14391 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
14393 * expression.cs (Indirection.LoadExprValue): Removed unused.
14394 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
14396 * iterators.cs (Iterator.param_types): Removed unused.
14398 * statement.cs (Goto.block): Removed unused.
14399 (ToplevelBlock.did): Removed unused.
14400 (Switch.ResolveConstantSwitch): Removed unused.
14402 2005-04-01 Ben Maurer <bmaurer@ximian.com>
14404 * rootcontext.cs: Allow mcs to bootstrap with the compilation
14407 2005-04-01 Raja R Harinath <rharinath@novell.com>
14409 Fix #74232 and cs0208-3.cs.
14410 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
14411 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
14412 unmanaged type. Don't use FieldBuilders when 't' is a
14413 TypeBuilder. Use ModFlags and MemberType fields.
14414 * class.cs (MemberBase.member_type): Rename from MemberType.
14415 (MemberBase.MemberType): New property. Determines member_type on
14417 (MemberBase.DoDefine): Don't initialize MemberType here.
14418 (FieldMember.Define): Likewise.
14420 2005-04-01 Marek Safar <marek.safar@seznam.cz>
14423 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
14424 Attributes are emitted there.
14426 2005-04-01 Raja R Harinath <rharinath@novell.com>
14428 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
14429 keyword in 'partial enum' too.
14430 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
14432 Report from Kamil Skalski <nazgul@omega.pl>.
14435 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
14436 have partial containers too.
14438 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
14439 in block' checks to Block.CheckInvariantMeaningInBlock.
14440 * statement.cs (Block.GetKnownVariableInfo): Make private.
14441 (Block.IsVariableUsedInChildBlock): Remove.
14442 (Block.IsVariableUsedInBlock): Likewise.
14443 (Block.CheckInvariantMeaningInBlock): New. Show location of
14444 conflicting declaration.
14445 (Block.AddVariable): Make error messages less long-winded and more
14446 specific. Show location of conflicting declaration.
14447 * parameter.cs (Parameters.Location): New readonly property.
14449 2005-03-31 Raja R Harinath <rharinath@novell.com>
14451 Clean up semantics of invoking ResolveMemberAccess.
14452 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
14453 can have an instance, ensure that we pass in a non-TypeExpression
14454 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
14455 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
14456 argument. Update to changes and simplify.
14457 (FieldExpr.Emitinstance): Remove CS0120 check.
14458 (PropertyExpr.EmitInstance): Likewise.
14459 * expression.cs (Argument.Resolve): Likewise.
14460 (Invocation.DoResolve): Update to changes in semantics of
14461 InstanceExpression.
14463 2005-03-31 Marek Safar <marek.safar@seznam.cz>
14466 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
14469 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
14471 2005-03-31 Raja R Harinath <rharinath@novell.com>
14473 Fix difference in behaviour with commandline invocation.
14474 * driver.cs (Driver.Reset): New.
14475 (CompilerCallableEntryPoint): Call it.
14477 * statement.cs (If.Resolve): Avoid spurious "uninitialized
14478 variable" warnings if the boolean expression failed to resolve.
14480 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
14482 * attribute.cs: Fix the union of several permissions when some of them
14483 are unrestricted (so the result isn't an unrestricted permission set).
14486 2005-03-30 Raja R Harinath <rharinath@novell.com>
14488 * ecore.cs (MemberExpr): New class. Convert from interface
14490 (MemberExpr.ResolveMemberAccess): Refactor and move here from
14491 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
14493 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
14494 (MethodGroupExpr.IsExplicitImpl): Remove.
14495 (Expression.GetFieldFromEvent): Remove.
14496 (SimpleName.MemberStaticCheck): Remove.
14497 (SimpleName.DoSimpleNameResolve): Update to changes.
14498 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
14499 (MemberAccess.IdenticalNameAndTypeName): Remove.
14500 (MemberAccess.error176): Move to MemberExpr.
14501 (MemberAccess.DoResolve): Update to changes.
14502 (BaseAccess.DoResolve): Likewise.
14504 2005-03-30 Marek Safar <marek.safar@seznam.cz>
14506 C# 2.0 Conditional attribute class implementation
14508 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
14509 Analyzes class whether it has attribute which has ConditionalAttribute
14510 and its condition is not defined.
14512 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
14513 (Class.IsExcluded): New method. Search for at least one defined
14514 condition in ConditionalAttribute of attribute class.
14516 2005-03-30 Raja R Harinath <rharinath@novell.com>
14518 * ecore.cs (PropertyExpr): Derive from Expression, not
14519 ExpressionStatement.
14520 (PropertyExpr.EmitStatement): Remove.
14522 2005-03-29 Raja R Harinath <rharinath@novell.com>
14525 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
14526 internal field "value__" of an enum be private. The examples for
14527 "value__" that I found on MSDN all used FieldAttributes.Private.
14529 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
14530 Don't mention IL method attribute names.
14532 Fix #47991. Remove a TODO.
14533 * statement.cs (Block.Toplevel): Make into a field.
14534 (Block.Parameters): Move into ToplevelBlock.
14535 (Block.known_variables): Rename from child_variable_names.
14536 (Block.Block): Remove variants that take Parameters. Initialize
14537 'Toplevel' with the immediately surrounding toplevel block.
14538 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
14539 LocalInfo parameter.
14540 (Block.GetKnownVariableInfo): New.
14541 (Block.IsVariableNameUsedInChildBlock): Update.
14542 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
14543 the block, even though it may not be in scope.
14544 (Block.AddVariable): Remove Parameters parameter. Use
14545 Toplevel.Parameters instead.
14546 (Block.AddConstant): Remove Parameters parameter.
14547 (Block.GetParameterReference): Update to use Toplevel.Parameters.
14548 (Block.IsParamaterReference): Likewise.
14549 (Block.IsLocalParameter): Likewise. Simplify a lot.
14550 (ToplevelBlock.Parameters): New. Moved from Block.
14551 (ToplevelBlock.ToplevelBlock): Update to changes. Always
14552 initialize Parameters to a non-null value.
14553 * cs-parser.jay: Update to changes.
14554 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
14555 simple names that mean different things in the same block. Use
14556 Block.IsVariableNameUsedInBlock.
14558 2005-03-28 Raja R Harinath <rharinath@novell.com>
14560 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
14561 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
14562 GetTypeHandle. It is possible for a reflected type to derive from
14563 a TypeBuilder (e.g., int[] derives from the TypeBuilder
14564 System.Array during mscorlib compilation).
14565 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
14566 contain a method_hash, don't create one either. Don't create a
14567 deep copy of the base cache's method_hash.
14568 (MemberCache.SetupCache): Rename back from DeepCopy.
14569 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
14570 already initialized. If we see an override function, add its
14571 underlying base virtual function to the member_hash too.
14573 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
14575 2005-03-26 Raja R Harinath <harinath@acm.org>
14578 * assign.cs (Assign.DoResolve): When the RHS of an assignment
14579 fails to resolve, ensure that the LHS is still resolved as an
14582 2005-03-25 Raja R Harinath <harinath@acm.org>
14584 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
14586 (Enum.current_ec): Remove.
14587 (Enum.LookupEnumValue): Remove EmitContext argument.
14588 Just uses the one created during DefineType.
14589 (Enum.FindMembers): Update.
14590 * expression.cs (MemberAccess.DoResolve): Update.
14592 2005-03-22 Marek Safar <marek.safar@seznam.cz>
14594 * assign.cs (Assign.DoResolve): Check for CS1717 when
14595 source and target are same (uses Equals).
14597 * expression.cs (LocalVariableReference, ParameterReference,
14598 This): Implemented Equals, GetHashCode.
14600 * statement.cs (Block.GetParameterReference): Removed useless
14603 2005-03-22 Raja R Harinath <rharinath@novell.com>
14606 * statement.cs (Block.AddVariable): Ensure that we skip implicit
14607 blocks before deciding whether the error is cs0136 or cs0128.
14609 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
14610 (using_alias_directive, using_namespace_directive): Pass
14611 MemberName, not an expression to Namespace.UsingAlias and
14613 (MakeName): Use the MemberName of the namespace.
14614 * namespace.cs (Namespace.MemberName): New.
14615 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
14616 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
14618 * decl.cs (MemberName.Name): Make readonly.
14619 (MemberName.FromDotted): New "constructor".
14620 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
14621 (MemberCore.Name): Compute from MemberName on demand.
14622 (MemberCore.SetMemberName): Provide a way to change the
14624 (MemberCore.AddToContainer): Don't take a fullname parameter.
14625 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
14626 fully qualified name of the container to the member name.
14627 (TypeContainer.AddToTypeContainer): Use a fully qualified name
14628 only if the type is a member of the root container.
14629 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
14630 MemberName.Left rather than searching for an embedded ".".
14631 (PartialContainer.CreatePart): Update to changes in RootContext.
14632 (MemberBase.ShortName): Turn into a property. Use
14633 MemberCore.SetMemberName.
14634 (MemberBase.ExplicitInterfaceName): Remove.
14635 (MemberBase.UpdateMemberName): Remove.
14636 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
14637 (PropertyBase.SetMemberName): New override.
14638 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
14639 (Tree.GetDecl): New.
14640 (Tree.AllDecls): Rename from Decls.
14641 * attribute.cs, enum.cs, report.cs: Update to changes.
14642 * driver.cs (MainDriver): Use MemberName.FromDotted on
14643 RootContext.MainClass.
14645 2005-03-21 Marek Safar <marek.safar@seznam.cz>
14647 * class.cs (FixedField.Define): Check for CS1664 and more sanity
14650 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
14652 2005-03-18 Marek Safar <marek.safar@seznam.cz>
14654 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
14655 property accessor modifiers.
14657 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
14658 fixed buffer attribute (CS1716).
14659 (PropertyMethod.HasCustomAccessModifier): When property accessor
14660 has custom modifier.
14662 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
14664 (PropertyExpr.DoResolveLValue): Add CS0272.
14666 2005-03-17 Miguel de Icaza <miguel@novell.com>
14668 * convert.cs: When converting to a pointer, use the proper Conv.U
14669 or Conv.I depending on the source data type.
14671 * cs-tokenizer.cs: Make the size for large decimal constants,
14674 2005-03-17 Martin Baulig <martin@ximian.com>
14676 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
14677 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
14679 2005-03-17 Martin Baulig <martin@ximian.com>
14681 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
14682 to bool so we can return an error condition.
14683 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
14686 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
14688 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
14691 2005-03-16 Raja R Harinath <rharinath@novell.com>
14693 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
14694 Refactor to avoid traversing the list of assemblies, and to avoid
14695 string concatenation.
14696 * typemanager.cs (guid_attr_type): Remove.
14697 (negative_hits, pointers, references): Remove hashes.
14699 (GetConstructedType): New. Uses type_hash to handle constructed
14700 types (arrays, references, pointers).
14701 (GetReferenceType, GetPointerType): Use it.
14702 (GetNestedType): New. Uses type_hash to handle nested types of
14704 (LookupType, LookupTypeDirect): Remove.
14705 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
14706 'types' hash and LookupTypeReflection directly.
14707 (params_string, params_object): Use GetConstructedType.
14708 * namespace.cs (Namespace.cached_types): New. Cache of reflected
14710 (Namespace.Lookup): Use cached_types.
14711 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
14712 provided by old TypeManager.LookupType.
14713 * rootcontext.cs (MakeFQN): Remove.
14714 * decl.cs (DeclSpace.MakeFQN): Likewise.
14715 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
14716 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
14717 TypeManager.GetConstructedType.
14718 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
14720 2005-03-15 Marek Safar <marek.safar@seznam.cz>
14722 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
14725 * cs-parser.jay: Reports CS1527 for any namespace element.
14727 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
14730 * expression.cs (ParameterReference.IsAssigned): Changed error to
14732 (Error_WrongNumArguments): Moved CS0245 detection here.
14734 * statement.cs (Return.Resolve): Add CS1622 report.
14736 2005-03-11 Marek Safar <marek.safar@seznam.cz>
14738 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
14740 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
14742 * attribute.cs expression.cs: Get rid of some allocations.
14744 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
14746 * doc.cs : just eliminate the latest change.
14748 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14750 * doc.cs : commented out the latest change. It breaks xml-030.cs
14752 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14754 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
14755 fail. So invoke CreateType() in FindDocumentedType().
14757 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14759 * cs-tokenizer.cs : added IsKeyword().
14760 * doc.cs : Detect keyword incorrectly used as identifier.
14761 Allow identifiers prefixed by @.
14763 2005-03-10 Marek Safar <marek.safar@seznam.cz>
14765 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
14766 It caused exception in namespace resolving (again!).
14768 * class.cs (Class.ctor): Removed exit.
14769 (PropertyMethod.ctor): ditto.
14771 * codegen.cs (Codegen.Reset): Reset static data.
14772 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
14774 * cs-tokenizer.cs (Cleanup): Removed.
14776 * driver.cs (GetSystemDir): Rewrote to one line command.
14777 It caused problem with unloaded dynamic modules.
14778 (UnixParseOption): Removed Exit.
14779 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
14780 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
14781 Now can be mcs used as library.
14783 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
14786 * location.cs (Reset): Reset static data.
14788 * namespace.cs (Reset): Reset static data.
14790 * report.cs (Report.Reset): Reset static data.
14792 * rootcontext.cs (RootContext.Reset): Reset static data.
14794 * tree.cs (RootTypes.ctor): Use Location.Null
14796 * typemanager.cs (TypeManager.Reset): Reset static data.
14797 (CoreLookupType): Removed Exit.
14798 (TypeHandle.Reset): Reset static data.
14800 2005-03-10 Raja R Harinath <rharinath@novell.com>
14803 * typemanager.cs (ComputeNamespaces): Import namespaces from
14804 referenced modules too.
14806 2005-03-09 Raja R Harinath <rharinath@novell.com>
14808 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
14811 2005-03-09 Raja R Harinath <rharinath@novell.com>
14813 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
14814 enclosing DeclSpace. This ensures that a name-lookup populates
14815 more caches and there are fewer 'TypeExpression's. Carve out
14816 nested type lookup into ...
14817 (LookupNestedTypeInHierarchy): ... this.
14819 2005-03-09 Raja R Harinath <rharinath@novell.com>
14821 Clean up a few partial-class semantics.
14822 Fixes test-357.cs and cs1618-2.cs.
14823 * cs-parser.jay (struct_declaration): Use 'current_class' as
14824 parent of newly-created struct. Remove call to Register ().
14825 Use 'pop_current_class' to complete handing the current struct.
14826 (interface_declaration): Likewise.
14827 (class_declaration): Likewise.
14828 (enum_declaration): Use 'current_class' as parent of newly created
14830 (delegate_declaration): Likewise.
14831 (pop_current_class): New function. This is used to handle closing
14832 up the 'current_class' and 'current_container', and pointing them
14833 to the enclosing class/container.
14834 (CSharpParser): Initialize 'current_class' too.
14835 * decl.cs (MemberCore): Add check for invariant: a partial
14836 container is not a parsed entity, and thus does not enclose any
14838 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
14839 (DeclSpace.BaseTypeExpr): Use it.
14840 (DeclSpace.LookupType): Add check for invariant.
14841 * class.cs (TypeContainer): Add check for invariant: a nested
14842 class should have the same NamespaceEntry as its enclosing class.
14843 (TypeContainer.EmitFieldInitializers): Make virtual.
14844 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
14846 (TypeContainer.Register): Remove.
14847 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
14848 null. Use TypeResolveEmitContext for resolving base types and
14849 interfaces. Move initialization of Parts.TypeBuilder here from
14851 (TypeContainer.DefineNestedTypes): ... here.
14852 (PartialContainer): Take a Namespace not a NamespaceEntry.
14853 (PartialContainer.Create): Don't use Register. Call the
14854 appropriate Add... function directly.
14855 (ClassPart): Take both the PartialContainer and the enclosing
14856 class as constructor arguments.
14857 (ClassPart.EmitFieldInitializers): Override.
14858 (ClassPart.PartFindNestedTypes): Remove.
14859 (FieldBase.GetInitializerExpression): Resolve the initializer
14860 expression in the emit context of the enclosing class.
14861 * tree.cs (RootTypes): Remove Register ().
14863 2005-03-08 Marek Safar <marek.safar@seznam.cz>
14865 * cs-parser.jay: Removed CS0134.
14867 * driver.cs: Removed CS1901.
14869 * expression.cs (SizeOf.DoResolve): Don't report CS0233
14870 for predefined types.
14872 2005-03-07 Duncan Mak <duncan@novell.com>
14874 * codegen.cs (Save): Catch UnauthorizedAccessException as
14875 well. Fixes bug #73454.
14877 2005-03-07 Marek Safar <marek.safar@seznam.cz>
14879 * cs-tokenizer.cs (xtoken): Add CS1035.
14881 * class.cs (MethodData.Define): Add CS0683.
14882 (FieldMember.ctor): Add CS0681.
14884 2005-03-07 Raja R Harinath <rharinath@novell.com>
14886 * ecore.cs (SimpleName.DoResolve): Rename from
14887 SimpleName.DoResolveAllowStatic.
14888 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
14889 Pass 'intermediate' flag to MemberStaticCheck.
14890 (SimpleName.MemberStaticCheck): Skip "static check" only in case
14891 of "intermediate" lookups via MemberAccess.
14892 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
14893 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
14895 2005-03-07 Raja R Harinath <rharinath@novell.com>
14898 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
14899 slipped in because of variable names that are identical to a
14900 builtin type's BCL equivalent ('string String;', 'int Int32;').
14901 (PropertyExpr.EmitInstance): Likewise.
14903 2005-03-04 Marek Safar <marek.safar@seznam.cz>
14905 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
14907 * report.cs (warning_ignore_table): Made public.
14909 2005-03-04 Raja R Harinath <rharinath@novell.com>
14912 * class.cs (MethodData.Emit): Pass 'container' to
14913 container.GetObsoleteAttribute instead of 'container.Parent'.
14915 2005-03-03 Marek Safar <marek.safar@seznam.cz>
14917 * cs-parser.jay: Add 1534 error test.
14919 * iterators.cs (Yield.CheckContext): Add error 1629.
14920 (Iterator.ctor): Save unsafe modifier.
14921 (MoveNextMethod.DoEmit): Restore unsafe context.
14923 * namespace.cs (UsingAlias): Better error message.
14925 2005-03-03 Dan Winship <danw@novell.com>
14927 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
14928 the warning message [#73219]
14930 2005-03-03 Raja R Harinath <rharinath@novell.com>
14932 Fix compile with MCS 1.0.0.0.
14933 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
14934 w_restore to not depend on string constant folding.
14936 2005-03-03 Raja R Harinath <rharinath@novell.com>
14938 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
14939 CS0246 check to users who passed 'silent = false'.
14940 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
14942 (SimpleName.SimpleNameResolve): Update.
14943 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
14944 (MemberAccess.IdenticalNameAndTypeName): Update.
14945 * doc.cs (FindDocumentedTypeNonArray): Update.
14947 2005-03-03 Raja R Harinath <rharinath@novell.com>
14949 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
14950 * parameters.cs (ComputeAndDefineParameters): Remove.
14951 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
14952 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
14953 Use GetParameterInfo.
14955 2005-03-02 Marek Safar <marek.safar@seznam.cz>
14957 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
14959 2005-03-02 Raja R Harinath <rharinath@novell.com>
14961 Unify DeclSpace.LookupType and DeclSpace.FindType.
14962 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
14963 is in charge of defining nested types on demand.
14964 (DeclSpace.LookupType): Use it when the current_type is a
14965 TypeBuilder. Use LookupTypeDirect for reflected types.
14966 (DeclSpace.FindType): Remove.
14967 (DeclSpace.LookupInterfaceOrClass): Likewise.
14968 (DeclSpace.DefineTypeAndParents): Likewise.
14969 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
14970 DeclSpace.LookupType.
14971 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
14972 * typemanager.cs (LookupType): Simplify.
14973 (AddUserType): Remove type from negative_hits.
14974 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
14975 * class.cs (TypeContainer.FindMembers): Move handling of nested
14977 (TypeContainer.FindMembers_NestedTypes): ... here.
14978 (TypeContainer.FindNestedType): Implement override.
14979 (ClassPart.FindNestedType): Delegate to PartialContainer.
14980 (ClassPart.PartFindNestedType): Looks up the nested types of the
14983 2005-03-02 Martin Baulig <martin@ximian.com>
14985 * class.cs (TypeContainer.DoDefineMembers): We also need a default
14986 static constructor in static classes.
14988 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
14990 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
14991 sizeParamIndex is not specified.
14993 2005-03-01 Marek Safar <marek.safar@seznam.cz>
14996 * report.cs (WarningMessage.IsEnabled): Missing null check.
14998 2005-02-28 Marek Safar <marek.safar@seznam.cz>
15000 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
15001 in the fields and not in the properties.
15003 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
15005 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
15008 2005-02-28 Marek Safar <marek.safar@seznam.cz>
15010 * attribute.cs: Small refactoring (improved robustness).
15011 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
15012 (ValidateGuid): Removed.
15013 (Resolve): Removed referenced to above mentioned.
15014 (GetAttributeUsage): Made private and changed to work without
15016 (GetIndexerAttributeValue): Don't crash.
15017 (GetConditionalAttributeValue): Ditto.
15018 (GetClsCompliantAttributeValue): Ditto.
15019 (ExtractSecurityPermissionSet): All attributes exceptions are
15021 (GetPropertyValue): New helper.
15022 (GetMethodImplOptions): New method.
15023 (DefinePInvokeMethod): Reuse common code. Implemented handling of
15024 some missing properties.
15026 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
15027 (Method.ApplyAttributeBuilder): Updated.
15029 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
15032 2005-02-28 Raja R Harinath <rharinath@novell.com>
15035 * report.cs (Report.SymbolRelatedToPreviousError): Handle
15036 non-simple types (array, pointer, reference).
15038 2005-02-28 Marek Safar <marek.safar@seznam.cz>
15040 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
15042 * class.cs (MethodCore.IsDuplicateImplementation): Special error
15044 (Method.CheckBase): Catch wrong destructor here.
15045 (MethodData.Define): Add errors 550, 668.
15047 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
15049 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
15051 * pending.cs (VerifyPendingMethods): Add error 551.
15053 * typemanager.cs (CSharpName): Next error report helper.
15055 2005-02-25 Marek Safar <marek.safar@seznam.cz>
15057 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
15058 attributes. Removed useless attribute double check.
15059 It saves almost 2MBs for corlib.
15061 2005-02-25 Raja R Harinath <rharinath@novell.com>
15064 * statement.cs (ExpressionStatement.Resolve): Make robust to being
15065 called twice in case of error.
15067 2005-02-23 Chris Toshok <toshok@ximian.com>
15069 Fix compiler portions of #72827.
15070 * statement.cs (Block.Emit): call Begin/EndScope on the
15071 EmitContext instead of the ILGenerator.
15073 * codegen.cs (EmitContext.BeginScope): new method, call
15074 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
15076 (EmitContext.BeginScope): same, but EndScope and CloseScope
15078 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
15079 offset and call the superclass's OpenScope(int) with it.
15080 (SymbolWriter.CloseScope): get the current il
15081 offset and call superclass's CloseScope(int) with it.
15083 2005-02-23 Marek Safar <marek.safar@seznam.cz>
15085 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
15086 CS1677 for out and ref as well.
15088 * class.cs (Method.Define): Add error CS1599 detection.
15090 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
15092 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
15094 * delegate.cs (Delegate.Define): Add error CS1599 detection.
15096 * support.cs.cs (ModifierDesc): New helper method.
15098 2005-02-23 Raja R Harinath <rharinath@novell.com>
15099 Abin Thomas <projectmonokochi@rediffmail.com>
15100 Anoob V E <projectmonokochi@rediffmail.com>
15101 Harilal P R <projectmonokochi@rediffmail.com>
15103 Fix #57851, #72718.
15104 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
15105 MemberLookup (used for error reporting) actually returns a result.
15106 Fix error report number (122, not 112).
15108 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
15109 Anoob V E <projectmonokochi@rediffmail.com>
15110 Harilal P R <projectmonokochi@rediffmail.com>
15113 * pending.cs (PendingImplementation.GetAbstractMethods):
15114 Find NonPublic members too.
15116 2005-02-22 Marek Safar <marek.safar@seznam.cz>
15118 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
15121 * class.cs (MethodCore.CheckMethodAgainstBase):
15122 Add error 239 report.
15124 2005-02-21 Raja R Harinath <rharinath@novell.com>
15127 * expression.cs (Invocation.IsApplicable): Make public.
15128 (Invocation.IsParamsMethodApplicable): Likewise.
15129 * delegate.cs (Delegate.VerifyApplicability): Don't use
15130 Invocation.VerifyArgumentCompat for parameter applicability
15131 testing. Use Invocation.IsApplicable and
15132 Invocation.IsParamsMethodApplicable.
15134 2005-02-21 Marek Safar <marek.safar@seznam.cz>
15136 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
15138 * class.cs (Operator.Define): Add error 217 report.
15140 2005-02-21 Raja R Harinath <rharinath@novell.com>
15142 * namespace.cs (UsingEntry.Resolve): Undo change below.
15144 2005-02-21 Raja R Harinath <rharinath@novell.com>
15147 * ecore.cs (Expression.MemberLookupFailed): Add argument to
15148 disable the error message when the extended MemberLookup also
15150 (Expression.MemberLookupFinal): Update.
15151 (SimpleName.DoSimpleNameResolve): Update.
15152 * expression.cs (MemberAccess.ResolveNamespaceOrType):
15153 Don't use MemberLookupFinal.
15154 (New.DoResolve): Update.
15155 (BaseAccess.CommonResolve): Update.
15157 2005-02-21 Raja R Harinath <rharinath@novell.com>
15160 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
15161 occured previously, don't resolve again.
15163 2005-02-21 Marek Safar <marek.safar@seznam.cz>
15166 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
15167 argument. Call ResolveAttributeUsage for unresolved.
15168 when types doesn't match ctor arguments.
15170 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
15171 for nested attribute classes.
15172 (Class.attribute_usage): Removed.
15173 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
15174 for attribute class.
15176 * ecore.cs (IsAttribute): Removed.
15178 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
15180 * rootcontext.cs (RegisterAttribute): Removed, attributes are
15182 (attribute_types): Removed.
15183 (EmitCode): Global attributes are emited as the latest.
15185 2005-02-18 Marek Safar <marek.safar@seznam.cz>
15187 * class.cs (EmitFieldInitializers): Don't emit field initializer
15188 for default values when optimilization is on.
15190 * constant.cs (Constant.IsDefaultValue): New property.
15192 * driver.cs: Add /optimize handling.
15196 * literal.cs: Implement new IsDefaultValue property.
15198 * rootcontext.cs (Optimize): New field, holds /optimize option.
15200 2005-02-18 Raja R Harinath <rharinath@novell.com>
15202 Fix crasher in re-opened #72347.
15203 * namespace.cs (Namespace.Lookup): Return null if
15204 DeclSpace.DefineType returns null.
15207 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
15209 2005-02-18 Raja R Harinath <rharinath@novell.com>
15211 Fix remainder of #63202. Change semantics of DoResolveLValue: it
15212 now returns null if it cannot resolve to an lvalue.
15213 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
15214 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
15215 returned null. Remove check for SimpleName.
15216 (EventExpr.DoResolveLValue): New.
15217 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
15218 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
15220 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
15221 avoid CS0131 error.
15222 (Unary.ResolveOperator): Move CS0211 check ...
15223 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
15225 (Unary.DoResolveLValue): Simplify.
15226 (AddressOf.DoResolveLValue): New.
15227 (ArrayAccess.DoResolveLValue): New.
15229 2005-02-16 Marek Safar <marek.safar@seznam.cz>
15231 * attribute.cs (Attribute.Resolve): Add arguments casting for
15232 when types doesn't match ctor arguments.
15234 2005-02-16 Raja R Harinath <rharinath@novell.com>
15236 Fix parts of #63202.
15237 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
15238 lookup of operator in base type. Ensure that all checks happen
15239 when the operator resolves to an "op_..." method.
15241 2005-02-15 Raja R Harinath <rharinath@novell.com>
15244 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
15245 'ignore_cs0104' parameter. Pass it to ...
15246 (NamespaceEntry.Lookup): ... this.
15247 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
15248 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
15249 (TypeLookupExpression.DoResolveAsTypeStep): Update.
15250 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
15251 Update. Request that cs0104 errors be ignored.
15252 (ComposedCast.ResolveAsTypeStep): Update.
15254 2005-02-14 Raja R Harinath <rharinath@novell.com>
15257 * expression.cs (Invocation.BetterFunction): Remove support for
15258 comparing virtual functions and their overrides.
15259 (Invocation.IsOverride): New.
15260 (Invocation.OverloadResolve): Don't consider 'override' functions
15261 during candidate selection. Store them in a lookaside list.
15262 If the selected method is a 'virtual' function, use the list to
15263 find any overrides that are closer to the LHS type.
15265 2005-02-14 Marek Safar <marek.safar@seznam.cz>
15267 * expression.cs (New.DoResolve): Add complex core type reduction.
15268 (New.Constantify): Converts complex core type syntax like 'new int ()'
15269 to simple constant.
15271 2005-02-14 Raja R Harinath <rharinath@novell.com>
15273 * decl.cs (EntryType.EntryType): New constructor to create an
15274 updated copy of a cache entry.
15275 (MemberCache.AddMethods): Use it.
15276 (MemberCache.ClearDeclaredOnly): Remove.
15277 (MemberCache.MemberCache): Update.
15279 2005-02-11 Miguel de Icaza <miguel@novell.com>
15281 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
15282 variable. This one is represents the actual low-level declaration
15283 of the method, as opposed to the semantic level `IsStatic'.
15285 An anonymous method which is hosted into a static method might be
15286 actually an instance method. IsStatic would reflect the
15287 container, while MethodIsStatic represents the actual code
15290 * expression.cs (ParameterReference): Use the new MethodIsStatic
15291 instead of IsStatic.
15293 * anonymous.cs (AnonymousMethod.Compatible): Pass the
15294 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
15295 set on the current EmitContext.
15297 * expression.cs (Cast): Overload DoResolveLValue so we can pass
15298 resolve our casted expression as an LValue. This triggers the
15299 proper LValue processing that is later required by Assign.
15303 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
15305 2005-02-11 Marek Safar <marek.safar@seznam.cz>
15307 C# 2.0 Fixed buffer implementation
15309 * anonymous.cs: Update after RegisterHelperClass renaming.
15311 * attribute.cs (AttributeTester.fixed_buffer_cache):
15312 Cache of external fixed buffers.
15313 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
15314 implementation if field is fixed buffer else null.
15317 (TypeContainer.AddField): Accept FieldMember instead of Field.
15318 (FieldBase.IsFieldClsCompliant): Extracted code from
15319 VerifyClsCompliance descendant customization.
15320 (FixedField): New class handles fixed buffer fields.
15321 (FixedFieldExternal): Keeps information about imported fixed
15323 (IFixedField): Make access to internal or external fixed buffer
15326 * cs-parser.jay: Add fixed buffer parsing.
15328 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
15331 * expression.cs (Indirection): Extended implementation to accept
15332 fixed buffer field.
15333 (PointerArithmetic.Emit): Get element from fixed buffer as well.
15334 (ElementAccess.MakePointerAccess): Get type as parameter.
15335 (DoResolve): Add fixed buffer field expression conversion.
15336 (DoResolveLValue): Ditto.
15337 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
15338 (ArrayPtr): Derives from FixedBufferPtr.
15339 (ArrayPtr.Emit): Add extra emit for array elements.
15341 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
15343 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
15344 for compiler generated types.
15345 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
15347 * statement.cs (Fixed): Refactored to be easier add fixed buffer
15348 and consume less memory.
15349 (Fixed.Resolve): Add fixed buffer case.
15351 * typemanager.cs (compiler_generated_attr_ctor,
15352 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
15353 (HasElementType): Add our own implementation to work on every
15356 2005-02-11 Miguel de Icaza <miguel@novell.com>
15358 * anonymous.cs (CaptureContext): Track whether `this' has been
15361 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
15362 only captured `this' if it was implicitly done (instance
15363 methods/variables were used).
15365 * codegen.cs (EmitContext.CaptureThis): New method to flag that
15366 `this' must be captured.
15368 2005-01-30 Miguel de Icaza <miguel@novell.com>
15370 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
15371 is null it means that there has been no need to capture anything,
15372 so we just create a sibling.
15374 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
15376 Just a partial fix. The other half is fairly elusive.
15378 2005-02-10 Raja R Harinath <rharinath@novell.com>
15380 Fix #52586, cs0121-4.cs.
15381 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
15382 and return a hashtable.
15383 (MemberCache.ClearDeclaredOnly): New.
15384 (MemberCache.MemberCache): Update to change. Make a deep copy of
15385 the method_hash of a base type too.
15386 (MemberCache.AddMethods): Adapt to having a deep copy of the base
15387 type methods. Overwrite entries with the same MethodHandle so
15388 that the ReflectedType is correct. The process leaves in base
15389 virtual functions and their overrides as distinct entries.
15390 (CacheEntry): Now a class instead of a struct. It shouldn't alter
15391 matters since it was boxed in a ArrayList before.
15392 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
15394 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
15395 case of a virtual function and its override (choose the overload
15397 (Invocation.OverloadResolve): Avoid 'override' members during
15398 'applicable_type' calculation.
15400 2005-02-09 Raja R Harinath <rharinath@novell.com>
15402 Combine two near-redundant caches.
15403 * typemanager.cs (method_params): Rename from method_internal_params.
15404 (TypeManager.GetParameterData): New. Replace
15405 Invocation.GetParameterData.
15406 (TypeManager.LookupParametersByBuilder): Remove.
15407 * expression.cs (Invocation.method_parameter_cache): Remove.
15408 (Invocation.GetParameterData): Remove.
15410 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
15413 2005-02-08 Raja R Harinath <rharinath@novell.com>
15416 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
15417 TypeManager.multicast_delegate_type is null, resolve it by looking
15418 up "System.MulticastDelegate".
15419 * rootcontext.cs (RootContext.ResolveCore): Simplify.
15421 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
15422 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
15423 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
15426 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
15427 (LabeledStatement.AddReference): New. Set 'referenced'.
15428 (Goto.Resolve): Use it.
15430 2005-02-05 John Luke <john.luke@gmail.com>
15432 * driver.cs: remove duplicate -doc line in Usage ()
15434 2005-02-04 Raja R Harinath <rharinath@novell.com>
15436 * location.cs (Location.AddFile): Fix CS2002 error report.
15438 2005-02-02 Martin Baulig <martin@ximian.com>
15440 * delegate.cs (Delegate.DefineType): Report an internal error if
15441 TypeManager.multicast_delegate_type is null. See bug #72015 for
15444 2005-02-02 Raja R Harinath <rharinath@novell.com>
15446 Fix a crasher in a variant of #31984.
15447 * const.cs (Constant.CheckBase): New override that defers the
15448 new-or-override check in case the base type hasn't been populated
15450 (Constant.Define): Ensure the new-or-override check is performed.
15452 2005-02-01 Duncan Mak <duncan@ximian.com>
15454 * const.cs (LookupConstantValue): Check that `ce' is not null
15455 before calling GetValue ().
15457 2005-02-01 Raja R Harinath <rharinath@novell.com>
15459 Fix test-334.cs (#69519).
15460 * cs-parser.jay (using_alias_directive): Pass in an expression to
15461 NamespaceEntry.UsingAlias.
15462 (using_namespace_directive): Pass in an expression to
15463 NamespaceEntry.Using.
15464 (namespace_name): Don't flatten to a string.
15465 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
15466 (NamespaceEntry.AliasEntry.Resolve): Lookup using
15468 (NamespaceEntry.UsingEntry): Likewise.
15469 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
15471 (NamespaceEntry.LookupForUsing): Remove.
15472 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
15474 (NamespaceEntry.Lookup): Remove support for dotted names.
15476 2005-02-01 Raja R Harinath <rharinath@novell.com>
15478 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
15480 (NamespaceEntry.ImplicitParent): Compute on demand.
15481 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
15482 parallels the current.
15483 (NamespaceEntry.LookupForUsing): Use it.
15484 (NamespaceEntry.Lookup): If the current namespace-entry is
15485 implicit, don't search aliases and using tables.
15487 2005-02-01 Raja R Harinath <rharinath@novell.com>
15490 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
15492 (TypeContainer.BaseCache): Compute on demand.
15493 (TypeContainer.FindMembers): Define constants and types if they're
15494 not already created.
15495 (FieldMember.Define): Move resetting of ec.InUnsafe before error
15497 * const.cs (Constant.Define): Make idempotent.
15499 2005-01-29 Miguel de Icaza <miguel@novell.com>
15501 * pending.cs: Produce better code (no nops produced by using Ldarg
15504 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
15505 i - 1' it should be arg + 1.
15509 2005-01-28 Raja R Harinath <rharinath@novell.com>
15511 * attribute.cs (Attribute.CheckAttributeType): Make private
15513 (Attribute.ResolveType): Make virtual.
15514 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
15515 handling of RootContext.Tree.Types.
15517 2005-01-27 Raja R Harinath <rharinath@novell.com>
15519 Update attribute-handling to use the SimpleName/MemberAccess
15521 * cs-parser.jay (attribute): Pass in an expression to the
15522 constructors of Attribute and GlobalAttribute.
15523 * attribute.cs (Attribute): Take an expression for the name.
15524 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
15525 passed in attribute name expression.
15526 (Attribute.CheckAttributeType): Use it.
15527 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
15528 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
15529 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
15530 argument to prevent error messages if the lookup fails.
15532 2005-01-27 Marek Safar <marek.safar@seznam.cz>
15534 * expression.cs (Indirection): Implemented IVariable interface
15535 to support indirection in AddressOf operator.
15536 (PointerArithmetic.Emit): Add optimalization for case where
15537 result can be precomputed.
15539 2005-01-26 Martin Baulig <martin@ximian.com>
15541 * class.cs (TypeContainer.AttributeTargets): Return the correct
15542 AttributeTargets depending on our `Kind' instead of throwing an
15543 exception; fixes #71632.
15545 2005-01-26 Marek Safar <marek.safar@seznam.cz>
15548 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
15551 2005-01-25 Raja R Harinath <rharinath@novell.com>
15554 * expression.cs (MemberAccess.DoResolve): Don't complain with
15555 cs0572 when the LHS of a member access has identical name and type
15558 2005-01-25 Marek Safar <marek.safar@seznam.cz>
15561 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
15563 Create custom PermissionSet only for PermissionSetAttribute.
15565 2005-01-24 Marek Safar <marek.safar@seznam.cz>
15568 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
15569 delegates in static class.
15571 2005-01-24 Martin Baulig <martin@ximian.com>
15573 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15574 merging an implicit block, just use its reachability.
15576 * statement.cs (Block.Resolve): Make the unreachable code check
15577 work wrt. implicit blocks; see test-337 from #63842.
15579 2005-01-21 Alp Toker <alp@atoker.com>
15581 * cs-parser.jay: destructor_declaration's container is PartialContainer
15582 not Class when partial types are used, so use Kind prop instead of
15585 2005-01-22 Miguel de Icaza <miguel@ximian.com>
15587 * cs-parser.jay: Improve error reporting when an interface
15588 declares new types.
15590 2005-01-20 Dick Porter <dick@ximian.com>
15592 * support.cs: SeekableStreamReader fix from Sandor Dobos
15593 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
15594 chars are read. Fixes bug 70369.
15596 2005-01-20 Raja R Harinath <rharinath@novell.com>
15598 * cs-parser.jay (catch_clause): Simplify current_block handling
15601 2005-01-17 Miguel de Icaza <miguel@ximian.com>
15603 * convert.cs (ImplicitStandardConversionExists): Synchronize the
15604 code with ImplicitStandardConversion to handle the implicit
15605 conversion of method groups into valid delegate invocations.
15607 The problem is that in parameter handling we were using this code
15608 path. Fixes bug #64698
15610 2005-01-19 Raja R Harinath <rharinath@novell.com>
15612 * cs-parser.jay: Fix several infelicities.
15613 - Avoid assigning to the parser value stack. Code like
15614 '$3 = null' is unclean. Synthesize a value for the code block
15616 - Avoid using oob_stack for storing location information. Use ...
15617 (_mark_): ... this. New (empty) rule. Saves the current location
15619 (foreach_statement): Avoid using oob_stack for current_block
15620 handling. Use technique used in for_statement and
15621 using_statement. Synthesize a value for the code block to store
15622 additional intermediate information.
15624 2005-01-13 Miguel de Icaza <miguel@ximian.com>
15626 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
15627 of a different type is only allowed to private fields of a
15628 containing type, not on fields of a base class.
15630 See test-174.cs and error cs0122-9.cs
15632 2005-01-13 Raja R Harinath <rharinath@novell.com>
15634 Fix test-335.cs (bug #58126).
15635 * cs-parser.jay (argument): Split out non-expression parts of the
15636 rule into 'non_simple_argument'.
15637 (invocation_expression): Support parenthesized invocations with
15638 multiple arguments, and with single non-simple arguments.
15640 2005-01-13 Raja R Harinath <rharinath@novell.com>
15642 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
15645 2005-01-12 Raja R Harinath <rharinath@novell.com>
15647 Fix cs0038-1.cs, cs1640-6.cs.
15648 * ecore.cs (Expression.Resolve): Remove special-case for
15649 SimpleName in error-handling.
15650 (Expression.almostMatchedMembers): Relax access permission to
15652 (Expression.MemberLookupFailed): Handle duplicates in
15653 almostMatchedMembers list.
15654 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
15655 * expression.cs (New.DoResolve): Report CS1540 for more cases.
15656 * typemanager.cs (GetFullNameSignature): Use the MethodBase
15657 overload if the passed in MemberInfo is a MethodBase.
15659 2005-01-12 Marek Safar <marek.safar@seznam.cz>
15662 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
15663 for non-CAS & merge permission sets properly.
15665 2005-01-11 Raja R Harinath <rharinath@novell.com>
15667 Improve standard-compliance of simple name and member access
15668 resolution. Fixes bugs #52697, #57200, #67520, #69519.
15669 * ecore.cs (FullNamedExpression): New abstract base class
15670 for Namespaces and TypeExpressions.
15671 (ResolveFlags.SimpleName): Remove.
15672 (SimpleName): Remove support for dotted names.
15673 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
15674 DeclSpace.FindType and DeclSpace.LookupType.
15675 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
15676 (Expression.ExprClassName): Make member function.
15677 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
15678 a namespace. Remove creation of dotted "SimpleName"s.
15679 (MemberAccess.DoResolve): Likewise.
15680 * decl.cs (DeclSpace.Cache): Make private.
15681 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
15682 (DeclSpace.FindType): Update.
15683 (DeclSpace.LookupType): Move here from RootContext. Return a
15684 FullNamedExpression.
15685 * namespace.cs (Namespace): Derive from FullNamedExpression
15686 so that it can be part of expression resolution.
15687 (Namespace.Lookup): Return an FullNamedExpression.
15688 (NamespaceEntry.LookupAlias): Lookup aliases only in current
15690 * rootcontext.cs (NamespaceLookup): Remove.
15691 (LookupType): Move to DeclSpace.
15692 * attribute.cs (CheckAttributeType): Update.
15693 * doc.cs (FindDocumentedType): Remove allowAlias argument.
15694 (FindDocumentedTypeNonArray): Likewise.
15696 2005-01-11 Raja R Harinath <rharinath@novell.com>
15698 Fix cs0509.cs, cs1632.cs.
15699 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
15700 is the same as IsInterface.
15701 (TypeContainer.GetClassBases): Likewise.
15702 * statement.cs (LabeledStatement.ig): New field.
15703 (LabeledStatement.LabelTarget): Save ILGenerator which created the
15705 (LabeledStatement.DoEmit): Check that the label was created with
15706 the same ILGenerator.
15708 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15711 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
15712 accessors to its properties.
15714 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
15715 from accessors to property.
15717 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15720 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
15721 only for overrides.
15723 2005-01-08 Miguel de Icaza <miguel@ximian.com>
15725 * attribute.cs: Check for null and empty strings.
15727 I have lost another battle to Paolo.
15729 2005-01-07 Marek Safar <marek.safar@seznam.cz>
15732 * class.cs (PropertyMethod): Set Parent field in ctors.
15733 (SetMethod.InternalParameters): Add unsafe switch hack.
15734 Override MarkForDuplicationCheck where it is appropriate.
15736 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
15737 It says whether container allows members with the same name.
15738 Base default is no.
15739 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
15740 Removed is_method parameter.
15742 2005-01-06 Duncan Mak <duncan@ximian.com>
15744 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
15745 because the previous change led to incorrect reporting of CS1032
15746 ("Cannot define/undefine preprocessor symbols after first token in
15747 file"). Instead of using `tokens_seen' as the only flag that
15748 triggers CS1040, introduce `comments_seen'. This new flag is used
15749 to signify having seen comments on the current line, so it is
15750 unset after a newline.
15752 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15754 * doc.cs : When searching for a type, find nested type too.
15755 This fixes bug #71040.
15757 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15760 - Warn missing member comment on those classes which also does not
15761 have doc comments. Fixed bug #71041.
15762 - Don't warn missing doc comment on default constructor.
15765 2005-01-06 Duncan Mak <duncan@ximian.com>
15767 * cs-tokenizer.cs (xtoken): After handling traditional C-style
15768 comments, set `tokens_seen' to true. This allows us to detect
15769 misplaced preprocessor directives (i.e. not at the beginning of
15770 the a line, nor after whitespaces). In that case, report error
15771 CS1040. This fixes bug #56460.
15773 * cs-parser.jay (interface_member_declaration): Add checks for
15774 IsExplicitImpl, and report CS0541 error if an interface member is
15775 defined as an explicit interface declaration.
15777 2005-01-06 Marek Safar <marek.safar@seznam.cz>
15780 * class.cs (PropertyMethod): Set Parent field in ctors.
15781 (SetMethod.InternalParameters): Add unsafe switch hack.
15783 * decl.cs (MemberCore.Parent): Cannot be readonly.
15785 2005-01-06 Raja R Harinath <rharinath@novell.com>
15787 * decl.cs (DeclSpace.ResolveType): Remove.
15788 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
15789 Merge in code from ...
15790 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
15791 * class.cs, enum.cs: Update to changes.
15793 2005-01-06 Miguel de Icaza <miguel@ximian.com>
15795 * anonymous.cs: Ensure that we init the scope of our parent if it
15796 has not been initialized yet.
15798 2004-12-30 Duncan Mak <duncan@ximian.com>
15800 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
15801 if field.FieldBuilder is null. Fixes #70758.
15803 * convert.cs: Fixed some typos and updated some of the comments.
15804 (ImplicitStandardConversionExists):
15805 (TryImplicitIntConversion): If `target_type' is an interface and
15806 the type of `ic' implements this interface, return true or a new
15807 BoxedCast instead of null. This fixes #70468.
15809 2004-12-29 Duncan Mak <duncan@ximian.com>
15811 * expression.cs (Argument.Emit): Check that Expr is
15812 IMemoryLocation before casting to it, and report CS1510 otherwise.
15816 2004-12-21 Ben Maurer <bmaurer@ximian.com>
15818 * statement.cs (Block.ThisVariable): remove the recursion here, to
15819 make the --profile more sane.
15821 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
15823 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
15824 assembly, by JB Evain.
15826 2004-12-17 Raja R Harinath <rharinath@novell.com>
15828 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
15829 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
15830 "parent" refers to enclosing type/class. "base" refers to superclass.
15832 2004-12-17 Raja R Harinath <rharinath@novell.com>
15834 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15835 Ensure that we only have GlobalAttributes.
15836 * attribute.cs (Attribute.Emit): Make non-virtual.
15837 (GlobalAttribute.Emit): Remove.
15838 (Attribute.Resolve): Make virtual.
15839 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
15840 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
15841 the argument. Don't create one.
15842 (Attribute.GetObsoleteAttribute): Likewise.
15843 (Attribute.GetClsCompliantAttributeValue): Likewise.
15844 * class.cs, decl.cs: Update to changes.
15846 2004-12-17 Marek Safar <marek.safar@seznam.cz>
15848 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
15850 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
15852 * statement.cs (Foreach.Resolve): Add error 186 report.
15854 2004-12-16 Marek Safar <marek.safar@seznam.cz>
15856 * expression.cs (Conditional.DoResolve): Add warning 429.
15858 * statement.cs (If.Resolve): Add warning 665.
15860 2004-12-16 Raja R Harinath <rharinath@novell.com>
15862 New invariant: RootContext.Tree.Types.NamespaceEntry == null
15863 except when in the parser, and in GlobalAttribute.
15864 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
15865 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
15866 RootContext.Tree.Types.NamespaceEntry once work is done.
15867 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
15868 and resets RootContext.Tree.Types.NamespaceEntry.
15870 2004-12-15 Marek Safar <marek.safar@seznam.cz>
15872 * cs-parser.jay: Don't create a block for every variable.
15874 2004-12-14 Miguel de Icaza <miguel@ximian.com>
15876 * location.cs: Provide extra information.
15878 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
15879 variables from the captured environment, it is the ldarg_0.
15881 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15883 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
15886 * class.cs: Changed warning level for 169 to avoid developer
15887 displeasure from warning flooding. It will be changed back when they
15888 fix most of current BCL warnings.
15890 * RootContext.cs: Pushed default WarningLevel to 3.
15892 * statement.cs: Removed unused variable.
15894 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15896 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
15897 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
15898 Add error 502 report.
15899 (StaticClass.DefineType): Add error 441 report.
15900 (Class.AllowedModifiersProp): New virtual property as temporary
15901 extension to AllowedModifiers.
15902 (Class.DefineType): Add error 418 report. Moved ModFlags check here
15903 to share implementation with StaticClass and don't call virtual
15906 * driver.cs (MainDriver): Add error 1558 test.
15908 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
15909 report. Moved error 36 test here.
15911 * statement.cs (Throw.Resolve): Add error 724 report.
15913 * typemanager.cs: Add out_attribute_type core type.
15915 2004-12-13 Marek Safar <marek.safar@seznam.cz>
15917 * class.cs (TypeContainer.VerifyClsCompliance): Add error
15919 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
15921 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
15924 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
15926 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
15927 Add error 3023 report.
15928 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
15930 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
15933 2004-12-12 John Luke <john.luke@gmail.com>
15935 * driver.cs (AddArgs): take -- into account when
15936 adding arguments, fixes bug 65710
15938 2004-12-12 Martin Baulig <martin@ximian.com>
15940 * expression.cs (Unary.TryReduceNegative): Added support for
15941 SByteConstant and ByteConstant.
15942 (Unary.Reduce): Check error values from TryReduceNegative().
15944 2004-12-10 Marek Safar <marek.safar@seznam.cz>
15946 * attributes.cs (Attribute.Resolve): Avoid multiple error report
15947 and report exception as error 182.
15949 2004-12-10 Raja R Harinath <rharinath@novell.com>
15951 * driver.cs (Main): Fix message when there are warnings.
15953 2004-12-09 Miguel de Icaza <miguel@ximian.com>
15955 * delegate.cs: Fixed my fix from yesterday, sorry about that.
15957 2004-12-09 Marek Safar <marek.safar@seznam.cz>
15959 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
15960 Reduced number of warnings.
15962 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
15964 2004-12-08 Miguel de Icaza <miguel@ximian.com>
15966 * driver.cs: Removed message.
15968 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
15970 2004-12-08 <vargaz@freemail.hu>
15972 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
15974 2004-12-08 Martin Baulig <martin@ximian.com>
15976 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
15977 instead of a CS3002 for properties and indexer.
15979 2004-12-08 Martin Baulig <martin@ximian.com>
15981 * decl.cs (MemberName.ToString): Make this work again.
15983 2004-12-08 Marek Safar <marek.safar@seznam.cz>
15985 * attribute.cs (Resolve): Add error 591 detection.
15987 * class.cs (FieldMember.Define): Add error 1547 detection.
15988 (Indexer.Define): Add error 620 detection.
15989 (Operator.Define): Add error 590 detection.
15991 * ecore.cs: Missing argument for error 79.
15993 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
15996 2004-12-07 Marek Safar <marek.safar@seznam.cz>
15999 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
16002 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
16004 * cs-parser.jay : handle doc comments on implicit/explicit operators.
16005 Some operator comments were suppressed.
16006 * doc.cs : Implicit/explicit operator name in doc comments are like
16007 "op_Explicit(type)~returnType", so added suffix handling.
16009 2004-12-07 Martin Baulig <martin@ximian.com>
16012 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
16013 (MemberCore.GetClsCompliantAttributeValue): Likewise.
16014 (DeclSpace.ec): New protected field; store the EmitContext here.
16015 (DeclSpace.EmitContext): New public property; moved here from
16017 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
16020 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
16021 (Enum.Emit): Don't create a new EmitContext.
16023 * delegate.cs (Delegate.DefineType): Always create the
16026 * iterators.cs (Iterators.DefineIterator): Create a new
16027 EmitContext and store it in `ec'.
16029 2004-08-24 Martin Baulig <martin@ximian.com>
16032 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
16033 this for accessibility checks.
16034 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
16035 IsNestedFamilyAccessible.
16036 (TypeManager.IsSubclassOf): New method, do what the name actually
16039 2004-12-06 Raja R Harinath <rharinath@novell.com>
16041 Fix crash on cs0657-17.cs.
16042 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16043 Use RootContext.Tree.Types, not 'new RootTypes ()'.
16044 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
16045 the case where the NamespaceEntry gets overwritten.
16047 2004-12-06 Marek Safar <marek.safar@seznam.cz>
16049 Fixed #69195, #56821
16050 * ecore.cs (ResolveBoolean): Tiny refactoring.
16052 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
16053 of right expression resolving when left is false constant and
16054 operator is LogicalAnd OR true constant and operator is LogicalOr.
16056 * statement.cs (ResolveUnreachable): Always reports warning.
16058 2004-12-05 Miguel de Icaza <miguel@ximian.com>
16060 * class.cs: Distinguish between 1721 and 1722 (just a little help
16061 for the programmer).
16063 2004-12-03 Miguel de Icaza <miguel@ximian.com>
16065 * delegate.cs: Only allow this on new versions of the language.
16067 2004-12-02 Duncan Mak <duncan@ximian.com>
16069 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
16071 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
16072 here as a static method. Take an additional bool out parameter
16073 `must_do_cs1540_check' for signaling to InstanceResolve.
16074 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
16075 member field from PropertyExpr class and made it an argument of
16076 the method instead.
16077 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
16078 check for MarshalByRefObject, and report CS0122 instead of CS1540.
16079 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
16080 and `remove_accessor' as well as InstanceResolve: report CS0122
16085 2004-12-03 Raja R Harinath <rharinath@novell.com>
16087 Fix test-327.cs, test-328.cs, and put in early infrastructure
16088 for eventually fixing #52697.
16089 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
16090 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
16091 from other methods.
16092 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
16093 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
16094 (VerifyUsing, error246): Update.
16095 * rootcontext.cs (RootContext.NamespaceLookup): Just use
16096 'NamespaceEntry.LookupNamespaceOrType'.
16098 2004-12-03 Martin Baulig <martin@ximian.com>
16100 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
16101 method as our child, call AnonymousMethod.Compatible() on it.
16103 2004-12-03 Raja R Harinath <rharinath@novell.com>
16105 Disable XML documentation support in 'basic' profile.
16106 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
16107 Redirect XmlElement to System.Object.
16108 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
16109 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
16110 * mcs.exe.sources: Add doc-bootstrap.cs.
16111 * doc-bootstrap.cs: New file. Contains empty stub implementation
16114 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
16116 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
16117 comments are allowed.
16119 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16121 * delegate.cs: Add checks for subtypes in paramaters and return values
16122 in VerifyMethod () to add support for Covariance/Contravariance
16125 2004-12-02 Miguel de Icaza <miguel@ximian.com>
16127 * report.cs: Remove extra closing parenthesis.
16129 * convert.cs (Error_CannotImplicitConversion): If the name of the
16130 types are the same, provide some extra information.
16132 * class.cs (FieldBase): Use an unused bit field from the field to
16133 encode the `has_offset' property from the FieldMember. This saves
16134 a couple of Ks on bootstrap compilation.
16136 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
16137 method as our child, return the AnonymousMethod resolved
16140 * expression.cs (New.DoResolve): Allow return values from
16141 NewDelegate to also include AnonymousMethods.
16145 2004-12-02 Marek Safar <marek.safar@seznam.cz>
16148 * attribute.cs (Resolve): Improved implementation of params
16149 attribute arguments.
16151 * support.cs (ParameterData): Add HasParams to be faster.
16153 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
16155 all things are for /doc support:
16157 * doc.cs: new file that supports XML documentation generation.
16158 * mcs.exe.sources: added doc.cs.
16160 Handle /doc command line option.
16161 Report error 2006 instead of 5 for missing file name for /doc.
16162 Generate XML documentation when required, after type resolution.
16164 Added support for picking up documentation (/// and /** ... */),
16165 including a new XmlCommentState enumeration.
16167 Added lines to fill Documentation element for field, constant,
16168 property, indexer, method, constructor, destructor, operator, event
16169 and class, struct, interface, delegate, enum.
16170 Added lines to warn incorrect comment.
16172 Added Documentation field (passed only when /doc was specified).
16174 Added DocComment, DocCommentHeader, GenerateDocComment() and
16175 OnGenerateDocComment() and some supporting private members for
16176 /doc feature to MemberCore.
16178 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
16180 Added overriden DocCommentHeader.
16182 Added overriden DocCommentHeader and GenerateDocComment().
16184 2004-12-01 Miguel de Icaza <miguel@ximian.com>
16186 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
16187 unwrapping the enumeration values, chain to
16188 DoConstantNumericPromotions again, so we can promote things to the
16189 fundamental types (takes care of enums that are bytes, sbytes).
16193 2004-12-01 Raja R Harinath <rharinath@novell.com>
16195 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
16196 Fix long-standing bug in type-lookup. Use FindType instead of
16197 LookupType when ec.ResolvingTypeTree.
16198 (Attribute.ResolveType, Attribute.Resolve)
16199 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
16201 (Attributes.Search): Remove internal version. Update.
16202 (Attributes.SearchMulti): Update.
16203 (Attributes.GetClsCompliantAttribute): Remove.
16204 (Attributes.GetIndexerNameAttribute): Remove.
16205 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
16206 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
16207 * class.cs (Indexer.Define): Likewise.
16209 2004-12-01 Marek Safar <marek.safar@seznam.cz>
16212 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
16213 MarshallByReference members access.
16215 * expression.cs: Use CheckMarshallByRefAccess;
16216 Better error CS0197 message.
16218 * report.cs: Print whole related error message.
16220 2004-11-30 Raja R Harinath <rharinath@novell.com>
16222 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
16223 the current directory to help debugging.
16225 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16227 * class (GetClassBases): Better error 60 report.
16228 (EventProperty): Disabled warning 67 detection.
16230 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16233 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
16235 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
16238 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16241 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
16243 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
16245 2004-11-26 Miguel de Icaza <miguel@ximian.com>
16247 * attribute.cs (Attribute.Resolve): Refine error reporting and
16248 report a cs0117 if the identifier does not exist, to distinguish
16249 from 0617 which is a miss-use of the actual identifier.
16251 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
16252 between cs0070 and cs0079.
16254 * class.cs (MemberBase.DoDefine): When reporting a wrong
16255 accessibility level, we use MethodCore to compare instead of
16256 Method (this was a regression in some refactoring effort).
16258 So now we correctly report cs0056 again.
16260 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
16261 testing the target_type (which was known to be object_type) and
16262 not the source type (which is anonymous_method).
16264 Fixed reporting of error cs1660.
16266 * expression.cs (UserCast.Source): Expose the underlying cast.
16268 * statement.cs (Switch.SwitchGoverningType): Sort the list of
16269 allowed types to find a match to int32 first (most common).
16271 In addition, it ignores any ImplicitUserConversions that did an
16272 internal implicit conversion (as the switch statement allows only
16273 one integral conversion to exist).
16275 * class.cs (PartialContainer.Create): rename `name' to
16276 `member_name' for clarity. Then replace the string calls with a
16277 call to MemberName.GetPartialName, as now using
16278 MemberName.ToString is an error (this is due to the side effects
16279 it had, that were fixed in the past).
16281 This will restore the error reporting on a number of partial class
16282 errors that were missusing this (and getting an exception as a
16283 results, which is now just a plain textual warning, because
16284 yyparse debug output would crash otherwise).
16286 2004-11-26 Raja R Harinath <rharinath@novell.com>
16288 * Makefile (PROGRAM_INSTALL_DIR): Remove.
16290 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16292 * rootcontext.cs (LookupType): Make sure to cache lookups that
16293 don't give us a negative result. This saves about 5% of corlib
16296 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16298 * report.cs (AbstractMessage.Print): messages are sent to stderr
16300 * class.cs (TypeContainer.GetClassBases): It is an error to have a
16301 non-interface in the list of interfaces (at this point, either
16302 parent was properly set, or a base class is being listed in the
16303 interfaces section).
16305 This flags error 1722, and resolves the crash from bug 69259.
16307 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16309 * statement.cs (Using.EmitExpressionFinally): make this work right
16310 for valuetypes. Fixes 69926.
16312 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16314 * const.cs (Const.ChangeType): Cope with the "0 literal can be
16315 converted to an enum" here, before we try to change the underlying
16316 type. This code exists, but it is a different code path than the
16317 one used while encoding constants.
16319 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
16320 old bug: when converting from the null literal to a pointer,
16321 return an EmptyCast, not the NullLiteral.
16323 This fixes #69921, the recent null_type changes probably made this
16324 bug more prominent.
16326 (ImplicitReferenceConversionExists): In addition, resynchronized
16327 the code here, so it matches the same code in
16328 ImplicitReferenceConversionExists for the `from any class-type S
16329 to any interface-type T'.
16332 2004-11-25 Marek Safar <marek.safar@seznam.cz>
16334 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
16336 2004-11-24 Miguel de Icaza <miguel@ximian.com>
16338 * cs-parser.jay: Use verbosity accordingly.
16340 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16342 * expression.cs (Unary.ResolveOperator): Do not report warning;
16343 AddressOf reads from variable.
16345 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
16347 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16351 * attribute.cs (Attributable): Removed CheckTargets.
16352 (Attributes.Emit): Explicit attribute targets are tested here.
16354 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
16355 not enabled for interfaces.
16357 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
16358 (GetAssemblyName): Ouch next bug there.
16360 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16362 * expression.cs: Error 275 added.
16364 2004-11-23 Marek Safar <marek.safar@seznam.cz>
16366 Fix bug #69177 (Implemented decimal constant support)
16368 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
16369 (BinaryFold): Add DecimalConstant.
16371 * const.cs (Define): Decimal constant
16373 (ChangeType): Add decimal type handling.
16374 (LookupConstantValue): Don't set value for decimal type but
16375 emit DecimalConstantAttribute. Needed for constant optimization.
16377 * constant.cs (ToDecimal): New method.
16378 (ConvertToDecimal): New method.
16379 (IntConstant): Implemented ConvertToDecimal.
16380 (DecimalConstant.Emit): Emit optimized version for decimals in
16383 * expression.cs (ResolveOperator): Changed order of constant
16384 reduction to work correctly with native types which have
16385 overloaded operators.
16386 (ResolveMemberAccess): Extract constant value from attribute
16389 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
16391 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
16392 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
16393 (ChangeType): Decimal is special.
16394 (TypeToCoreType): Add decimal type.
16396 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16398 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
16401 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16403 * class.cs (EventField.ApplyAttributeBuilder): Fix error
16406 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16408 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
16410 * pending.cs (PendingImplementation): Grab only interfaces.
16412 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16414 * statement.cs (ForeachHelperMethods): Add location member and
16415 error 202 detection.
16417 2004-11-19 Raja R Harinath <rharinath@novell.com>
16419 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
16420 automatically handled by executable.make.
16421 (PROGRAM): Make profile-specific.
16423 2004-11-18 Marek Safar <marek.safar@seznam.cz>
16425 * expression.cs (DoResolveBase): Fixed wrong warning for out
16428 2004-11-18 Martin Baulig <martin@ximian.com>
16430 Merged latest changes into gmcs. Please keep this comment in
16431 here, it makes it easier for me to see what changed in MCS since
16432 the last time I merged.
16434 2004-11-17 Raja R Harinath <rharinath@novell.com>
16436 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
16437 (TypeHandle.GetMemberCache): New.
16438 (TypeHandle.TypeHandle): Update.
16439 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
16440 (TypeManager.LookupParentInterfacesCache):
16441 Rename from LookupInterfaceCache. Optimize slightly.
16442 (TypeManager.MemberLookup_FindMembers): Update.
16443 * decl.cs (MemberCache.MemberCache): Set Container to null in the
16444 multi-type variant.
16445 (AddCacheContents): Rename from AddHashtable.
16446 * class.cs (TypeContainer.parent_container): Remove.
16447 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
16448 (TypeContainer.DoDefineMembers): Don't initialize it.
16449 Update to name changes.
16451 2004-11-17 Miguel de Icaza <miguel@ximian.com>
16453 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
16454 that factors the code to check access modifiers on override.
16456 (PropertyBase): Use the code here.
16458 Patch from Lluis S'anchez, fixes bug #69361.
16460 2004-11-15 Miguel de Icaza <miguel@ximian.com>
16462 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
16463 routine that is used to report the use of a captured variable
16464 whose address has been taken.
16466 There are two checks: one when variables are being captured and
16467 the other check is when the address of a variable is taken.
16469 (because an anonymous methods might be resolved before *or* after
16470 the address has been taken) and
16472 * expression.cs (Conditional.DoResolve): Remove the special
16473 casing that Martin added to trueExpr and falseExpr being both
16474 NullLiteral. We get the right behavior now just by introducing
16475 the null_type into the compiler.
16477 * convert.cs (ExplicitConversion): Change the code to use
16478 null_type instead of testing `expr is NullLiteral'.
16479 (ImplicitConversionStandard): use null_type too.
16480 (ImplicitReferenceConversionExists): use null_type too.
16481 (ImplicitReferenceConversion): use null_type too.
16483 * literal.cs: The type of `NullLiteral' is now null_type instead
16485 (Resolve): Set the type here.
16487 * typemanager.cs: Introduce null_type.
16489 2004-11-17 Martin Baulig <martin@ximian.com>
16491 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
16492 direction, like FindMembers() does. Fixes #69546, testcase is in
16495 2004-11-16 Martin Baulig <martin@ximian.com>
16497 This is based on a patch from Marek Safar, see bug #69082.
16498 Fixes bugs #63705 and #67130.
16500 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
16501 method; create a MemberCache for an interface type and cache the
16504 * decl.cs (IMemberContainer.ParentContainer): Removed.
16505 (IMemberContainer.ParentCache): New property.
16506 (MemberCache.SetupCacheForInterface): Removed.
16507 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
16508 to create a cache for an interface's "parent".
16510 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
16513 2004-11-16 Martin Baulig <martin@ximian.com>
16515 Merged back from gmcs; these changes already went into gmcs a
16516 couple of weeks ago.
16519 (TypeManager.AddUserType): Removed the `ifaces' argument.
16520 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
16522 (TypeManager.AddUserInterface): Removed.
16523 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
16525 (TypeManager.GetInterfaces): Likewise.
16526 (TypeManager.GetExplicitInterfaces): Likewise.
16528 * ecore.cs (TypeExpr.GetInterfaces): Removed.
16530 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
16531 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
16533 2004-11-14 Ben Maurer <bmaurer@ximian.com>
16535 * statement.cs: Avoid adding bools to a hashtable.
16537 2004-11-07 Miguel de Icaza <miguel@ximian.com>
16539 * expression.cs (Invocation.OverloadResolve): Flag error if we are
16540 calling an unsafe method from a safe location.
16542 2004-11-06 Marek Safar <marek.safar@seznam.cz>
16545 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
16547 2004-11-06 Miguel de Icaza <miguel@ximian.com>
16549 * namespace.cs (VerifyUsing): use GetPartialName instead of
16552 2004-11-05 Miguel de Icaza <miguel@ximian.com>
16554 * statement.cs (Return.Resolve): Fix regression in typo: if
16555 `in_exc', we have to request a NeedReturnLabel, this was a typo
16556 introduced in the anonymous method check-in. Fixes #69131.
16558 * Indexers were using the ShortName when defining themselves,
16559 causing a regression in the compiler bootstrap when applying the
16560 patch from 2004-11-02 (first part), now they use their full name
16561 and the bug is gone.
16563 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
16565 * driver.cs: Strip the path from the names of embedded resources. Fixes
16568 2004-11-04 Raja R Harinath <rharinath@novell.com>
16570 Fix error message regression: cs0104-2.cs.
16571 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
16572 (AliasEntry.Resolve): Update.
16573 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
16575 (RootContext.LookupType): Update.
16577 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
16579 * cs-parser.jay: Add support for handling accessor modifiers
16580 * class: Add support port accessor modifiers and error checking,
16581 define PropertyMethod.Define as virtual (not abstract anymore)
16582 * ecore.cs: Add checking for proeprties access with access modifiers
16583 * iterators.cs: Modify Accessor constructor call based in the modified
16585 2004-11-02 Ben Maurer <bmaurer@ximian.com>
16587 * expression.cs (StringConcat): Handle being called twice,
16588 as when we have a concat in a field init with more than two
16591 2004-11-02 Miguel de Icaza <miguel@ximian.com>
16593 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
16594 special case explicit implementations, we should always produce
16595 the .property or .event declaration.
16597 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
16598 since it will not return correct data if people use this
16599 unresolved in the presence of using statements (see test-313).
16601 * class.cs (MethodData.Define): If we are an explicit interface
16602 implementation, set the method name to the full name of the
16603 interface plus the name of the method.
16605 Notice that using the method.MethodName.GetFullName() does not
16606 work, as it will only contain the name as declared on the source
16607 file (it can be a shorthand in the presence of using statements)
16608 and not the fully qualifed type name, for example:
16612 class D : ICloneable {
16613 object ICloneable.Clone () {
16617 Would produce a method called `ICloneable.Clone' instead of
16618 `System.ICloneable.Clone'.
16620 * namespace.cs (Alias.Resolve): Use GetPartialName.
16622 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16624 * cs-parser.jay: Add error 1055 report.
16626 2004-11-01 Miguel de Icaza <miguel@ximian.com>
16628 * assign.cs (Assign.DoResolve): Only do the transform of
16629 assignment into a New if the types are compatible, if not, fall
16630 through and let the implicit code deal with the errors and with
16631 the necessary conversions.
16633 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16635 * cs-parser.jay: Add error 1031 report.
16637 * cs-tokenizer.cs: Add location for error 1038.
16639 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16641 * cs-parser.jay: Add error 1016 report.
16643 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16645 * cs-parser.jay: Add errors 1575,1611 report.
16647 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16649 * cs-parser.jay: Add error 1001 report.
16651 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16654 * attribute.cs (GetMarshal): Add method argument for
16655 caller identification.
16657 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
16658 agument for GetMarshal and RuntimeMissingSupport.
16660 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16662 * attribute.cs (ExtractSecurityPermissionSet): Removed
16663 TypeManager.code_access_permission_type.
16665 * typemanager.cs: Removed TypeManager.code_access_permission_type.
16667 2004-10-27 Miguel de Icaza <miguel@ximian.com>
16669 * expression.cs (LocalVariableReference.DoResolveLValue): Check
16670 for obsolete use of a variable here. Fixes regression on errors
16671 cs0619-25 and cs0619-26.
16673 2004-10-27 Marek Safar <marek.safar@seznam.cz>
16675 Fix #62358, implemented security attribute encoding.
16677 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
16678 Tests permitted SecurityAction for assembly or other types.
16679 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
16680 data from SecurityPermissionAttribute to PermisionSet class.
16682 * class.cs (ApplyAttributeBuilder): Added special handling
16683 for System.Security.Permissions.SecurityAttribute based types.
16685 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
16686 special handling for System.Security.Permissions.SecurityAttribute
16689 * enum.cs (ApplyAttributeBuilder): Added special handling
16690 for System.Security.Permissions.SecurityAttribute based types.
16692 * parameter.cs (ApplyAttributeBuilder): Added special handling
16693 for System.Security.Permissions.SecurityAttribute based types.
16695 * rootcontext.cs: Next 2 core types.
16697 * typemanager.cs (TypeManager.security_permission_attr_type):
16698 Built in type for the SecurityPermission Attribute.
16699 (code_access_permission_type): Build in type.
16701 2004-10-17 Miguel de Icaza <miguel@ximian.com>
16703 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
16704 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
16705 all of this information into
16706 EmitContext.EmitCapturedVariableInstance.
16708 * codegen.cs (EmitCapturedVariableInstance): move here the
16709 funcionality of emitting an ldarg.0 in the presence of a
16710 remapping. This centralizes the instance emit code.
16712 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
16713 then emit a load of this: it means that we have reached the
16714 topmost ScopeInfo: the one that contains the pointer to the
16715 instance of the class hosting the anonymous method.
16717 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
16718 captures to the topmost CaptureContext.
16720 2004-10-12 Miguel de Icaza <miguel@ximian.com>
16722 * expression.cs (LocalVariableReference): Move the knowledge about
16723 the iterators into codegen's EmitCapturedVariableInstance.
16725 2004-10-11 Miguel de Icaza <miguel@ximian.com>
16727 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
16728 all code paths return a value from an anonymous method (it is the
16729 same as the 161 error, but for anonymous methods).
16731 2004-10-08 Miguel de Icaza <miguel@ximian.com>
16733 The introduction of anonymous methods in the compiler changed
16734 various ways of doing things in the compiler. The most
16735 significant one is the hard split between the resolution phase
16736 and the emission phases of the compiler.
16738 For instance, routines that referenced local variables no
16739 longer can safely create temporary variables during the
16740 resolution phase: they must do so from the emission phase,
16741 since the variable might have been "captured", hence access to
16742 it can not be done with the local-variable operations from the runtime.
16746 (Block.Flags): New flag `IsTopLevel' to indicate that this block
16747 is a toplevel block.
16749 (ToplevelBlock): A new kind of Block, these are the blocks that
16750 are created by the parser for all toplevel method bodies. These
16751 include methods, accessors and anonymous methods.
16753 These contain some extra information not found in regular blocks:
16754 A pointer to an optional CaptureContext (for tracking captured
16755 local variables and parameters). A pointer to the parent
16758 (Return.Resolve): Catch missmatches when returning a value from an
16759 anonymous method (error 1662).
16760 Invoke NeedReturnLabel from the Resolve phase instead of the emit
16763 (Break.Resolve): ditto.
16765 (SwitchLabel): instead of defining the labels during the
16766 resolution phase, we now turned the public ILLabel and ILLabelCode
16767 labels into methods called GetILLabelCode() and GetILLabel() that
16768 only define the label during the Emit phase.
16770 (GotoCase): Track the SwitchLabel instead of the computed label
16771 (its contained therein). Emit the code by using
16772 SwitchLabel.GetILLabelCode ().
16774 (LocalInfo.Flags.Captured): A new flag has been introduce to track
16775 whether the Local has been captured or not.
16777 (LocalInfo.IsCaptured): New property, used to tell whether the
16778 local has been captured.
16780 * anonymous.cs: Vastly updated to contain the anonymous method
16783 The main classes here are: CaptureContext which tracks any
16784 captured information for a toplevel block and ScopeInfo used to
16785 track the activation frames for various local variables.
16787 Each toplevel block has an optional capture context associated
16788 with it. When a method contains an anonymous method both the
16789 toplevel method and the anonymous method will create a capture
16790 context. When variables or parameters are captured, they are
16791 recorded on the CaptureContext that owns them, for example:
16795 MyDelegate d = delegate {
16800 Here `a' will be recorded as captured on the toplevel
16801 CapturedContext, the inner captured context will not have anything
16802 (it will only have data if local variables or parameters from it
16803 are captured in a nested anonymous method.
16805 The ScopeInfo is used to track the activation frames for local
16806 variables, for example:
16808 for (int i = 0; i < 10; i++)
16809 for (int j = 0; j < 10; j++){
16810 MyDelegate d = delegate {
16815 At runtime this captures a single captured variable `i', but it
16816 captures 10 different versions of the variable `j'. The variable
16817 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
16818 recorded on a child.
16820 The toplevel ScopeInfo will also track information like the `this'
16821 pointer if instance variables were referenced (this is necessary
16822 as the anonymous method lives inside a nested class in the host
16823 type of the method).
16825 (AnonymousMethod): Expanded to track the Toplevel, implement
16826 `AnonymousMethod.Compatible' to tell whether an anonymous method
16827 can be converted to a target delegate type.
16829 The routine now also produces the anonymous method content
16831 (AnonymousDelegate): A helper class that derives from
16832 DelegateCreation, this is used to generate the code necessary to
16833 produce the delegate for the anonymous method that was created.
16835 * assign.cs: API adjustments for new changes in
16836 Convert.ImplicitStandardConversionExists.
16838 * class.cs: Adjustments to cope with the fact that now toplevel
16839 blocks are of type `ToplevelBlock'.
16841 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
16842 insteda of standard blocks.
16844 Flag errors if params arguments are passed to anonymous methods.
16846 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
16847 `CurrentAnonymousMethod' which points to the current Anonymous
16848 Method. The variable points to the AnonymousMethod class that
16849 holds the code being compiled. It is set in the new EmitContext
16850 created for the anonymous method.
16852 (EmitContext.Phase): Introduce a variable and an enumeration to
16853 assist in enforcing some rules about when and where we are allowed
16854 to invoke certain methods (EmitContext.NeedsReturnLabel is the
16855 only one that enfonces this right now).
16857 (EmitContext.HaveCaptureInfo): new helper method that returns
16858 whether we have a CapturedContext initialized.
16860 (EmitContext.CaptureVariable): New method used to register that a
16861 LocalInfo must be flagged for capturing.
16863 (EmitContext.CapturedParameter): New method used to register that a
16864 parameters must be flagged for capturing.
16866 (EmitContext.CapturedField): New method used to register that a
16867 field must be flagged for capturing.
16869 (EmitContext.HaveCapturedVariables,
16870 EmitContext.HaveCapturedFields): Return whether there are captured
16871 variables or fields.
16873 (EmitContext.EmitMethodHostInstance): This is used to emit the
16874 instance for the anonymous method. The instance might be null
16875 (static methods), this (for anonymous methods that capture nothing
16876 and happen to live side-by-side with the current method body) or a
16877 more complicated expression if the method has a CaptureContext.
16879 (EmitContext.EmitTopBlock): Routine that drives the emission of
16880 code: it will first resolve the top block, then emit any metadata
16881 and then emit the code. The split is done so that we can extract
16882 any anonymous methods and flag any captured variables/parameters.
16884 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
16885 during this phase, the ILGenerator should not be used as labels
16886 and local variables declared here might not be accessible to any
16887 code that is part of an anonymous method.
16889 Exceptions to this include the temporary variables that are
16890 created by some statements internally for holding temporary
16893 (EmitContext.EmitMeta): New routine, in charge of emitting all the
16896 (EmitContext.TemporaryReturn): This method is typically called
16897 from the Emit phase, and its the only place where we allow the
16898 ReturnLabel to be defined other than the EmitMeta. The reason is
16899 that otherwise we would have to duplicate a lot of logic in the
16900 Resolve phases of various methods that today is on the Emit
16903 (EmitContext.NeedReturnLabel): This no longer creates the label,
16904 as the ILGenerator is not valid during the resolve phase.
16906 (EmitContext.EmitThis): Extended the knowledge in this class to
16907 work in anonymous methods in addition to iterators.
16909 (EmitContext.EmitCapturedVariableInstance): This emits whatever
16910 code is necessary on the stack to access the instance to a local
16911 variable (the variable will be accessed as a field).
16913 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
16914 EmitContext.EmitAddressOfParameter): Routines to support
16915 parameters (not completed at this point).
16917 Removals: Removed RemapLocal and RemapLocalLValue. We probably
16918 will also remove the parameters.
16920 * convert.cs (Convert): Define a `ConstantEC' which points to a
16921 null. This is just to prefity some code that uses
16922 ImplicitStandardConversion code and do not have an EmitContext
16925 The idea is to flag explicitly that at that point in time, it is
16926 known that the conversion will not trigger the delegate checking
16927 code in implicit conversions (which requires a valid
16930 Everywhere: pass new EmitContext parameter since
16931 ImplicitStandardConversionExists now requires it to check for
16932 anonymous method conversions.
16934 (Convert.ImplicitStandardConversionExists): If the type of an
16935 expression is the anonymous_method_type, and the type is a
16936 delegate, we invoke the AnonymousMethod.Compatible method to check
16937 whether an implicit conversion is possible.
16939 (Convert.ImplicitConversionStandard): Only do implicit method
16940 group conversions if the language level is not ISO_1.
16942 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
16943 MethodInfo for the Invoke method. used by Delegate and
16946 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
16947 method conversions if the target type is a delegate.
16949 Removed extra debugging nops.
16951 (LocalVariableReference): Turn the `local_info' into a public
16954 Add `prepared' field, the same hack used for FieldExprs to cope
16955 with composed assignments, as Local variables do not necessarily
16956 operate purely on the stack as they used to: they can be captured
16959 Add `temp' for a temporary result, like fields.
16961 Refactor DoResolve and DoResolveLValue into DoResolveBase.
16963 It now copes with Local variables that are captured and emits the
16964 proper instance variable to load it from a field in the captured
16967 (ParameterReference.DoResolveBase): During the resolve phase,
16968 capture parameters if we are in an anonymous method.
16970 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
16971 anonymous method, use the EmitContext helper routines to emit the
16972 parameter reference.
16974 * iterators.cs: Set RemapToProxy to true/false during the
16977 * parameters.cs (GetParameterByName): New helper method.
16979 * typemanager.cs (anonymous_method_type) a new type that
16980 represents an anonyous method. This is always an internal type,
16981 used as a fencepost to test against the anonymous-methodness of an
16984 2004-10-20 Marek Safar <marek.safar@seznam.cz>
16986 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
16988 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
16990 2004-10-18 Martin Baulig <martin@ximian.com>
16992 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
16993 `Type' directly, but call ResolveType() on it.
16994 (Catch.Resolve): Likewise.
16995 (Foreach.Resolve): Likewise.
16997 2004-10-18 Martin Baulig <martin@ximian.com>
16999 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
17000 `Type' directly, but call ResolveType() on it.
17001 (Probe.DoResolve): Likewise.
17002 (ArrayCreation.LookupType): Likewise.
17003 (TypeOf.DoResolve): Likewise.
17004 (SizeOf.DoResolve): Likewise.
17006 2004-10-18 Martin Baulig <martin@ximian.com>
17008 * expression.cs (Invocation.BetterFunction): Put back
17009 TypeManager.TypeToCoreType().
17011 2004-10-18 Raja R Harinath <rharinath@novell.com>
17013 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
17016 2004-10-18 Martin Baulig <martin@ximian.com>
17018 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
17019 `Type' directly, but call ResolveType() on it.
17021 2004-10-18 Martin Baulig <martin@ximian.com>
17023 * class.cs (FieldMember.Define): Don't access the TypeExpr's
17024 `Type' directly, but call ResolveType() on it.
17025 (MemberBase.DoDefine): Likewise.
17027 * expression.cs (New.DoResolve): Don't access the TypeExpr's
17028 `Type' directly, but call ResolveType() on it.
17029 (ComposedCast.DoResolveAsTypeStep): Likewise.
17031 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
17032 `Type' directly, but call ResolveType() on it.
17034 2004-10-17 John Luke <john.luke@gmail.com>
17036 * class.cs (Operator.GetSignatureForError): use CSharpName
17038 * parameter.cs (Parameter.GetSignatureForError): Returns
17039 correct name even if was not defined.
17041 2004-10-13 Raja R Harinath <rharinath@novell.com>
17044 * class.cs (TypeContainer.EmitContext): New property.
17045 (DefineNestedTypes): Create an emitcontext for each part.
17046 (MethodCore.DoDefineParameters): Use container's emitcontext.
17047 Pass type array to InternalParameters.
17048 (MemberBase.DoDefine): Use container's emitcontext.
17049 (FieldMember.Define): Likewise.
17050 (Event.Define): Likewise.
17051 (SetMethod.GetParameterInfo): Change argument to EmitContext.
17052 Pass type array to InternalParameters.
17053 (SetIndexerMethod.GetParameterInfo): Likewise.
17054 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
17055 * delegate.cs (Define): Pass emitcontext to
17056 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
17057 array to InternalParameters.
17058 * expression.cs (ParameterReference.DoResolveBase): Pass
17059 emitcontext to GetParameterInfo.
17060 (ComposedCast.DoResolveAsTypeStep): Remove check on
17061 ec.ResolvingTypeTree.
17062 * parameter.cs (Parameter.Resolve): Change argument to
17063 EmitContext. Use ResolveAsTypeTerminal.
17064 (Parameter.GetSignature): Change argument to EmitContext.
17065 (Parameters.ComputeSignature): Likewise.
17066 (Parameters.ComputeParameterTypes): Likewise.
17067 (Parameters.GetParameterInfo): Likewise.
17068 (Parameters.ComputeAndDefineParameterTypes): Likewise.
17069 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
17070 * support.cs (InternalParameters..ctor): Remove variant that takes
17072 * typemanager.cs (system_intptr_expr): New.
17073 (InitExpressionTypes): Initialize it.
17075 2004-10-12 Chris Toshok <toshok@ximian.com>
17077 * cs-parser.jay: fix location for try_statement and catch_clause.
17079 2004-10-11 Martin Baulig <martin@ximian.com>
17081 * report.cs: Don't make --fatal abort on warnings, we have
17082 -warnaserror for that.
17084 2004-10-07 Raja R Harinath <rharinath@novell.com>
17086 More DeclSpace.ResolveType avoidance.
17087 * decl.cs (MemberCore.InUnsafe): New property.
17088 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
17089 with newly created EmitContext.
17090 (FieldMember.Define): Likewise.
17091 * delegate.cs (Delegate.Define): Likewise.
17092 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
17093 only if normal name-lookup fails.
17094 (TypeExpr.DoResolve): Enable error-checking.
17095 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
17096 (SizeOf.DoResolve): Likewise.
17097 (ComposedCast.DoResolveAsTypeStep): Likewise.
17098 (StackAlloc.DoResolve): Likewise.
17099 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
17100 (Block.Unsafe): New property.
17101 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
17102 (Unsafe): Set 'unsafe' flag of contained block.
17103 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
17104 (Fixed.Resolve): Likewise.
17105 (Catch.Resolve): Likewise.
17106 (Using.ResolveLocalVariableDecls): Likewise.
17107 (Foreach.Resolve): Likewise.
17109 2004-10-05 John Luke <john.luke@gmail.com>
17111 * cs-parser.jay: add location to error CS0175
17113 2004-10-04 Miguel de Icaza <miguel@ximian.com>
17115 * ecore.cs (Expression.Constantity): Add support for turning null
17118 * const.cs (Const.Define): Allow constants to be reference types
17119 as long as the value is Null.
17121 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
17123 * namespace.cs (NamespaceEntry.Using): No matter which warning
17124 level is set, check if this namespace name has already been added.
17126 2004-10-03 Ben Maurer <bmaurer@ximian.com>
17128 * expression.cs: reftype [!=]= null should always use br[true,false].
17131 2004-10-03 Marek Safar <marek.safar@seznam.cz>
17134 * attribute.cs: Enum conversion moved to
17135 GetAttributeArgumentExpression to be applied to the all
17138 2004-10-01 Raja R Harinath <rharinath@novell.com>
17140 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
17141 * class.c (TypeContainer.DefineType): Flag error if
17142 base types aren't accessible due to access permissions.
17143 * decl.cs (DeclSpace.ResolveType): Move logic to
17144 Expression.ResolveAsTypeTerminal.
17145 (DeclSpace.ResolveTypeExpr): Thin layer over
17146 Expression.ResolveAsTypeTerminal.
17147 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
17148 Refactor code into NestedAccess. Use it.
17149 (DeclSpace.NestedAccess): New.
17150 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
17151 argument to silence errors. Check access permissions.
17152 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
17153 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
17154 (Cast.DoResolve): Likewise.
17155 (New.DoResolve): Likewise.
17156 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
17157 (TypeOf.DoResolve): Likewise.
17159 * expression.cs (Invocation.BetterConversion): Return the Type of
17160 the better conversion. Implement section 14.4.2.3 more faithfully.
17161 (Invocation.BetterFunction): Make boolean. Make correspondence to
17162 section 14.4.2.2 explicit.
17163 (Invocation.OverloadResolve): Update.
17164 (Invocation): Remove is_base field.
17165 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
17166 (Invocation.Emit): Likewise.
17168 2004-09-27 Raja R Harinath <rharinath@novell.com>
17170 * README: Update to changes.
17172 2004-09-24 Marek Safar <marek.safar@seznam.cz>
17174 * cs-parser.jay: Reverted 642 warning fix.
17176 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17179 * decl.cs (FindMemberWithSameName): Indexer can have more than
17182 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17184 * expression.cs (LocalVariableReference.DoResolveLValue):
17185 Do not report warning 219 for out values.
17186 (EmptyExpression.Null): New member to avoid extra allocations.
17188 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17190 * cs-parser.jay: Fix wrong warning 642 report.
17192 * cs-tokenizer.cs (CheckNextToken): New helper;
17193 Inspect next character if is same as expected.
17195 2004-09-23 Martin Baulig <martin@ximian.com>
17197 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
17198 (Convert.ImplicitReferenceConversionExists): Likewise.
17200 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17202 * class.cs (Operator.Define): Add error 448 and 559 report.
17204 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17206 * class.cs (MemberBase.IsTypePermitted): New protected
17207 method for checking error CS0610.
17209 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17211 * class.cs (TypeContainer.HasExplicitLayout): New property
17212 Returns whether container has StructLayout attribute set Explicit.
17213 (FieldMember): New abstract class for consts and fields.
17214 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
17215 (Field): Reuse FieldMember.
17217 * const.cs (Const): Reuse FieldMember.
17219 * rootcontext.cs: EmitConstants call moved to class.
17221 2004-09-22 Martin Baulig <martin@ximian.com>
17223 Thanks to Peter Sestoft for this bug report.
17225 * expression.cs (Conditional): If both the `trueExpr' and the
17226 `falseExpr' is a NullLiteral, return a NullLiteral.
17228 2004-09-22 Martin Baulig <martin@ximian.com>
17230 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
17231 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
17232 for the "get_Current" call.
17234 2004-09-22 Martin Baulig <martin@ximian.com>
17236 Marek and me just fixed one of our oldest bugs: #28562 :-)
17238 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
17240 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
17241 we're an EnumConstant, just return that.
17242 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
17243 an EnumConstant. In this case, we need to use GetValueAsEnumType()
17244 to get the value which'll actually be written into the attribute.
17245 However, we have to use GetValue() to access the attribute's value
17248 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17250 * constant.cs (Constant.IsNegative): New abstract property
17253 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
17254 (StackAlloc.DoResolve): Reused IsNegative.
17256 2004-09-21 Martin Baulig <martin@ximian.com>
17258 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
17259 if we're used in an iterator, we may be called from different
17262 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
17263 we actually have an exception block.
17265 2004-09-20 John Luke <jluke@cfl.rr.com>
17267 * class.cs, cs-parser.jay: Improve the error report for 1520:
17268 report the actual line where the error happens, not where the
17269 class was declared.
17271 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
17272 Pass location information that was available elsewhere.
17274 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
17276 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
17277 runtime to delay sign assemblies.
17279 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17281 * cs-parser.jay: Do not report the stack trace, this is barely
17284 2004-08-22 John Luke <john.luke@gmail.com>
17286 * driver.cs : check that a resource id is not already used
17287 before adding it, report CS1508 if it is, bug #63637
17289 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17291 * ecore.cs: Removed dead code.
17293 2004-09-18 Marek Safar <marek.safar@seznam.cz>
17295 * class.cs: Do not report warning CS0067 on the interfaces.
17297 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17299 * cs-parser.jay: Add error 504 report.
17301 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17303 * rootcontext.cs: WarningLevel is 4 by default now.
17305 * statement.cs (Fixed.Resolve): Do not null
17308 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17311 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
17312 deep search when property is not virtual.
17313 (PropertyExpr.ResolveAccessors): Make one call for both
17316 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17319 * statement.cs: Error 152 report constains also location.
17321 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17324 * const.cs: Explicitly set constant as static.
17326 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17329 * cs-parser.jay: Add error 1017 report.
17331 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17333 Fixed bug #59980, #64224
17334 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
17336 * typemanager.cs (IsSpecialMethod): Simplified
17338 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17340 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
17341 condition with better params.
17343 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17346 * attribute.cs (Resolve): Property has to have both
17349 2004-09-14 Martin Baulig <martin@ximian.com>
17351 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
17353 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17356 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
17357 called and is obsolete then this member suppress message
17358 when call is inside next [Obsolete] method or type.
17360 * expression.cs: Use TestObsoleteMethodUsage member.
17362 2004-09-14 Martin Baulig <martin@ximian.com>
17364 * cs-parser.jay: Sync a bit with the GMCS version.
17366 2004-09-14 Martin Baulig <martin@ximian.com>
17368 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
17369 (CSharpParser.yacc_verbose_flag): New public field.
17371 * genericparser.cs: Removed.
17373 2004-09-14 Raja R Harinath <rharinath@novell.com>
17375 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
17377 2004-09-13 Marek Safar <marek.safar@seznam.cz>
17379 * class.cs (MethodCore.CheckBase): Fix bug #65757.
17381 2004-09-10 Martin Baulig <martin@ximian.com>
17383 Backported my MemberName changes from GMCS into MCS.
17385 - we are now using a special `MemberName' class instead of using
17386 strings; in GMCS, the `MemberName' also contains the type
17389 - changed the grammar rules a bit:
17390 * the old `member_name' is now a `namespace_or_type_name':
17391 The rule is that we use `namespace_or_type_name' everywhere
17392 where we expect either a "member name" (GetEnumerator) or a
17393 "member name" with an explicit interface name
17394 (IEnumerable.GetEnumerator).
17395 In GMCS, the explicit interface name may include type arguments
17396 (IEnumerable<T>.GetEnumerator).
17397 * we use `member_name' instead of just `IDENTIFIER' for
17399 The rule is that we use `member_name' wherever a member may
17400 have type parameters in GMCS.
17402 * decl.cs (MemberName): New public class.
17403 (MemberCore.MemberName): New public readonly field.
17404 (MemberCore.ctor): Take a `MemberName' argument, not a string.
17405 (DeclSpace): Likewise.
17407 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
17408 * enum.cs (Enum.ctor): Likewise.
17410 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
17412 (AliasEntry.ctor): Take a MemberName, not an Expression.
17413 (AliasEntry.UsingAlias): Likewise.
17415 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
17416 (IMethodData.MemberName): Changed type from string to MemberName.
17417 (MemberBase.ExplicitInterfaceName): Likewise.
17418 (AbstractPropertyEventMethod.SetupName): Make this private.
17419 (AbstractPropertyEventMethod.ctor): Added `string prefix'
17420 argument; compute the member name here.
17421 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
17422 on the `member.MemberName' and the `prefix'.
17424 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
17426 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
17427 thus, we get a `MemberName' instead of a `string'. These
17428 declarations may have type parameters in GMCS.
17429 (interface_method_declaration, delegate_declaration): Likewise.
17430 (class_declaration, interface_declaration): Likewise.
17431 (method_header): Use `namespace_or_type_name' instead of
17432 `member_name'. We may be an explicit interface implementation.
17433 (property_declaration, event_declaration): Likewise.
17434 (member_name): This is now just an `IDENTIFIER', not a
17435 `namespace_or_type_name'.
17436 (type_name, interface_type): Removed.
17437 (namespace_or_type_name): Return a MemberName, not an Expression.
17438 (primary_expression): Use `member_name' instead of `IDENTIFIER';
17439 call GetTypeExpression() on the MemberName to get an expression.
17440 (IndexerDeclaration.interface_type): Changed type from string to
17442 (MakeName): Operate on MemberName's instead of string's.
17444 2004-09-13 Raja R Harinath <rharinath@novell.com>
17447 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
17448 (NamespaceEntry.Lookup): Add new argument to flag if we want the
17449 lookup to avoid symbols introduced by 'using'.
17450 * rootcontext.cs (NamespaceLookup): Update.
17452 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17454 * class.cs (TypeContainer.DoDefineMembers): Do not call
17455 DefineDefaultConstructor for static classes.
17457 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17459 * attribute.cs (Attribute.Resolve): Add error 653 report.
17461 * class.cs (Class.ApplyAttributeBuilder): Add error 641
17463 (Method.ApplyAttributeBuilder): Add error 685 report.
17464 (Operator.Define): Add error 564 report.
17466 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
17468 * expression.cs (Invocation.DoResolve): Add error
17469 245 and 250 report.
17471 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
17474 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17476 * class.cs (ConstructorInitializer.Resolve):
17477 Wrong error number (515->516).
17479 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17481 * class.cs (Indexer.Define): Add error 631 report.
17483 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17485 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
17487 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17489 * expression.cs (Probe.DoResolve): Add error CS0241 report.
17491 2004-09-10 Marek Safar <marek.safar@seznam.cz>
17493 * cs-parser.jay: Added error CS0241 report.
17495 2004-09-10 Raja R Harinath <rharinath@novell.com>
17497 * cs-parser.jay (fixed_statement): Introduce a scope for the
17498 declaration in the 'fixed' statement.
17500 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17502 * cs-parser.jay: Added CS0230 error report.
17504 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17506 * cs-parser.jay: Added errors CS0231 and CS0257 report.
17508 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17510 * expression.cs (Argument.Resolve): Added error CS0192 and
17513 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17515 C# 2.0 #pragma warning feature
17517 * cs-tokenizer.cs (PreProcessPragma): New method;
17518 Handles #pragma directive.
17520 * report.cs (WarningRegions): New class; Support
17521 class for #pragma warning directive. It tests whether
17522 warning is enabled for a given line.
17524 2004-09-08 Miguel de Icaza <miguel@ximian.com>
17526 * const.cs: Add more descriptive error report, tahnks to
17529 2004-09-08 Marek Safar <marek.safar@seznam.cz>
17531 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
17533 2004-09-07 Miguel de Icaza <miguel@ximian.com>
17535 * expression.cs: Apply patch from Ben: Remove dead code from
17536 ArrayCreation, and remove the TurnintoConstant call in const.cs,
17537 as that code just threw an exception anwyays.
17539 * const.cs: Remove the call to the turnintoconstant, for details
17542 * literal.cs: The type of the null-literal is the null type; So
17543 we use a placeholder type (literal.cs:System.Null, defined here)
17546 * expression.cs (Conditional.DoResolve): Remove some old code that
17547 is no longer needed, conversions have been fixed.
17549 (ArrayCreationExpression.DoResolve): Return false if we fail to
17550 resolve the inner expression.
17552 2004-09-07 Raja R Harinath <rharinath@novell.com>
17555 * cs-parser.jay (delegate_declaration): Record a delegate
17556 declaration as a type declaration.
17557 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
17559 2004-09-06 Miguel de Icaza <miguel@ximian.com>
17561 * parameter.cs: Do not crash if the type can not be resolved.
17563 * expression.cs: Report errors with unsafe pointers, fixes #64896
17565 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
17567 * expression.cs: Pointer arith always needs to do a conv.i
17568 if the operand is a long. fix 65320
17570 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17572 Fixed cs0619-37.cs, cs0619-38.cs
17574 * enum.cs (GetObsoleteAttribute): Removed.
17576 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
17577 on Enum member is double staged. The first is tested member
17580 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17582 Fixed #56986, #63631, #65231
17584 * class.cs: (TypeContainer.AddToMemberContainer): New method,
17585 adds member to name container.
17586 (TypeContainer.AddToTypeContainer): New method, adds type to
17588 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
17589 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
17590 AddOperator): Simplified by reusing AddToMemberContainer.
17591 (TypeContainer.UserDefinedStaticConstructor): Changed to property
17593 (Method.CheckForDuplications): Fixed implementation to test all
17595 (MemberBase): Detection whether member is explicit interface
17596 implementation is now in constructor.
17597 (MemberBase.UpdateMemberName): Handles IndexerName.
17598 (Accessor): Changed to keep also location information.
17599 (AbstractPropertyEventMethod): Is derived from MemberCore.
17600 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
17601 will be emited or not.
17602 (PropertyBase.AreAccessorsDuplicateImplementation):
17603 Tests whether accessors are not in collision with some method.
17604 (Operator): Is derived from MethodCore to simplify common
17607 * decl.cs (Flags.TestMethodDuplication): Test for duplication
17609 (DeclSpace.AddToContainer): Adds the member to defined_names
17610 table. It tests for duplications and enclosing name conflicts.
17612 * enum.cs (EnumMember): Clean up to reuse the base structures
17614 2004-09-03 Martin Baulig <martin@ximian.com>
17616 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
17617 into TypeContainer, to make partial classes work again.
17619 2004-09-03 Martin Baulig <martin@ximian.com>
17621 * rootcontext.cs (RootContext.V2): Removed.
17623 2004-03-23 Martin Baulig <martin@ximian.com>
17625 * expression.cs (Invocation.OverloadResolve): Added `bool
17626 may_fail' argument and use it instead of the Location.IsNull() hack.
17628 2004-09-03 Martin Baulig <martin@ximian.com>
17630 Merged latest changes into gmcs. Please keep this comment in
17631 here, it makes it easier for me to see what changed in MCS since
17632 the last time I merged.
17634 2004-09-03 Raja R Harinath <rharinath@novell.com>
17637 * expression.cs (BetterConversion): Don't allow either conversion
17638 to be null. Remove redundant implicit conversion test when 'q ==
17639 null' -- when this function is invoked, we already know that the
17640 implicit conversion exists.
17641 (BetterFunction): Assume that 'best' is non-null. Remove
17642 redundant reimplementation of IsApplicable when 'best' is null.
17643 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
17644 number of arguments.
17645 (IsAncestralType): Extract from OverloadResolve.
17646 (OverloadResolve): Make robust to the MethodGroupExpr being
17647 unsorted. Implement all the logic of Section 14.5.5.1, and
17648 support overloading of methods from multiple applicable types.
17649 Clean up logic somewhat. Don't pass null methods to BetterFunction.
17651 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
17652 (RealError, Warning): Append type of report to related symbol.
17654 2004-09-03 Marek Safar <marek.safar@seznam.cz>
17656 * enum.cs: Fixed CLS-Compliance checks for enum members.
17657 Error tests cs3008-8.cs, cs3014-8.cs
17659 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17661 Fixed bug #62342, #63102
17662 * class.cs: ImplementIndexer uses member.IsExplicitImpl
17663 like ImplementMethod.
17665 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17667 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17670 2004-09-02 Martin Baulig <martin@ximian.com>
17672 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
17673 TypeManager.GetArgumentTypes() rather than calling GetParameters()
17676 2004-09-01 Marek Safar <marek.safar@seznam.cz>
17678 C# 2.0 Static classes implemented
17680 * class.cs (TypeContainer): instance_constructors,
17681 initialized_fields, initialized_static_fields,
17682 default_constructor, base_inteface_types are protected to be
17683 accessible from StaticClass.
17684 (TypeContainer.DefineDefaultConstructor): New virtual method
17685 for custom default constructor generating
17686 (StaticClass): New class to handle "Static classes" feature.
17688 * cs-parser.jay: Handle static keyword on class like instance
17691 * driver.cs: Added "/langversion" command line switch with two
17692 options (iso-1, default).
17694 2004-08-31 Marek Safar <marek.safar@seznam.cz>
17696 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
17698 2004-08-31 Miguel de Icaza <miguel@ximian.com>
17700 * delegate.cs: Style.
17702 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
17704 * delegate.cs: Add seperate instance expr field for miguel.
17706 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17708 * PointerArithmetic (Resolve): make sure we are not doing
17709 pointer arith on void*. Also, make sure we are resolved
17710 by not setting eclass until resolve.
17712 All callers: Make sure that PointerArithmetic gets resolved.
17714 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17716 * ArrayCreation (LookupType): If the type does not resolve
17717 to an array, give an error.
17719 2004-08-27 Marek Safar <marek.safar@seznam.cz>
17721 * statement.cs (Try.Resolve): Fixed bug #64222
17723 2004-08-27 Martin Baulig <martin@ximian.com>
17726 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
17729 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17731 * ecore.cs (Constantify): Get underlying type via
17732 System.Enum.GetUnderlyingType to avoid StackOverflow on the
17733 Windows in special cases.
17735 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17737 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
17738 for obtaining also private methods.
17739 (GetRemoveMethod): Used GetRemoveMethod (true)
17740 for obtaining also private methods.
17742 2004-08-24 Martin Baulig <martin@ximian.com>
17744 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
17745 MethodAttributes.HideBySig for operators.
17747 2004-08-23 Martin Baulig <martin@ximian.com>
17749 Back to the old error reporting system :-)
17751 * report.cs (Message): Removed.
17752 (Report.MessageData, ErrorData, WarningData): Removed.
17753 (Report.Error, Warning): Back to the old system.
17755 2004-08-23 Martin Baulig <martin@ximian.com>
17757 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
17759 * class.cs (TypeContainer.ParentContainer): New public virtual
17760 method; replaces the explicit interface implementation.
17761 (ClassPart.ParentContainer): Override.
17763 2004-08-23 Martin Baulig <martin@ximian.com>
17765 * statement.cs (Switch): Added support for constant switches; see
17766 #59428 or test-285.cs.
17768 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17771 * statement.cs (GetEnumeratorFilter): Removed useless
17772 logic because C# specs is strict. GetEnumerator must be
17775 2004-08-22 Martin Baulig <martin@ximian.com>
17777 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17778 a switch and may break, reset the barrier. Fixes #59867.
17780 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17782 CLS-Compliance speed up (~5% for corlib)
17784 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
17785 New method. Tests container for CLS-Compliant names
17787 * class.cs (TypeContainer.VerifyClsName): New method.
17788 Checks whether container name is CLS Compliant.
17789 (Constructor): Implements IMethodData.
17791 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
17792 low-case table for CLS Compliance test.
17793 (MemberCache.VerifyClsParameterConflict): New method.
17794 Checks method parameters for CS3006 error.
17796 * enum.cs (EnumMember): Is derived from MemberCore.
17797 (Enum.VerifyClsName): Optimized for better performance.
17799 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17801 * report.cs: Renamed Error_T to Error and changed all
17804 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17806 * class.cs (TypeContainer.IndexerArrayList): New inner class
17807 container for indexers.
17808 (TypeContainer.DefaultIndexerName): New constant for default
17809 indexer name. Replaced all "Item" with this constant.
17810 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
17812 * typemanager.cs (TypeManager.default_member_ctor): Cache here
17813 DefaultMemberAttribute constructor.
17815 2004-08-05 Martin Baulig <martin@ximian.com>
17817 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
17820 2004-08-05 Marek Safar <marek.safar@seznam.cz>
17822 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
17823 multi platforms problem.
17825 * compiler.csproj: Included shared files.
17827 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17829 Fix bug 60333, 55971 in the more general way
17830 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17831 Added arg_type argument for constant conversion.
17832 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
17834 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17837 * class.cs (TypeContainer ): New inner classes MethodArrayList,
17838 OperatorArrayList, MethodCoreArrayList for typecontainer
17839 containers. Changed class member types to these new types.
17840 (MethodArrayList.DefineMembers): Added test for CS0659.
17842 2004-08-04 Miguel de Icaza <miguel@ximian.com>
17844 * cfold.cs: Synchronize the folding with the code in expression.cs
17845 Binary.DoNumericPromotions for uint operands.
17847 * attribute.cs: Revert patch from Raja, it introduced a regression
17848 while building Blam-1.2.1 (hard to isolate a test case).
17850 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17854 (TypeContainer.Define): Renamed to DefineContainerMembers because of
17856 (MethodCore.parent_method): New member. The method we're overriding
17857 if this is an override method.
17858 (MethodCore.CheckBase): Moved from Method class and made common.
17859 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
17861 (MethodCore.CheckForDuplications): New abstract method. For custom
17862 member duplication search in a container
17863 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
17864 method and its return type.
17865 (Event.conflict_symbol): New member. Symbol with same name in the
17869 (MemberCache.FindMemberWithSameName): New method. The method
17870 is looking for conflict with inherited symbols.
17872 2004-08-04 Martin Baulig <martin@ximian.com>
17874 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
17876 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
17878 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17880 * report.cs (Message): New enum for better error, warning reference in
17882 (MessageData): New inner abstract class. It generally handles printing of
17883 error and warning messages.
17884 Removed unused Error, Warning, Message methods.
17886 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17888 Fix for cs0592-8.cs test
17890 (Attributable.ValidAttributeTargets): Made public.
17891 (Attribute.ExplicitTarget): New member for explicit target value.
17892 (Attribute.CheckTargets): Now we translate explicit attribute
17893 target to Target here.
17895 2004-08-03 Ben Maurer <bmaurer@ximian.com>
17897 * ecore.cs (MethodGroupExpr): new IsBase property.
17899 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
17901 * delegate.cs (DelegateCreation): store a MethodGroupExpr
17902 rather than an instance expr.
17904 (DelegateCreation.Emit): Use the method group rather than
17905 the instance expression. Also, if you have base.Foo as the
17906 method for a delegate, make sure to emit ldftn, not ldftnvirt.
17908 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
17910 (NewDelegate.DoResolve): Only check for the existance of Invoke
17911 if the method is going to be needed. Use MethodGroupExpr.
17913 (NewDelegate.Emit): Remove, DelegateCreation implements this.
17915 * expression.cs: For pointer arith., make sure to use
17916 the size of the type, not the size of the pointer to
17919 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17922 * class.cs (Class): Added error CS0502 test.
17924 2004-08-03 John Luke <jluke@cfl.rr.com>
17925 Raja R Harinath <rharinath@novell.com>
17928 * attribute.cs (Attribute.complained_before): New flag.
17929 (Attribute.ResolveType, Attribute.Resolve),
17930 (Attribute.DefinePInvokeMethod): Set it.
17931 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
17933 2004-08-03 Martin Baulig <martin@ximian.com>
17935 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
17936 use a user-defined operator; we still need to do numeric
17937 promotions in case one argument is a builtin type and the other
17938 one has an implicit conversion to that type. Fixes #62322.
17940 2004-08-02 Martin Baulig <martin@ximian.com>
17942 * statement.cs (LocalInfo.Flags): Added `IsThis'.
17943 (LocalInfo.IsThis): New public property.
17944 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
17946 2004-08-01 Martin Baulig <martin@ximian.com>
17948 * class.cs (TypeContainer.GetClassBases): Don't set the default
17949 here since we may get called from GetPartialBases().
17950 (TypeContainer.DefineType): If GetClassBases() didn't return a
17951 parent, use the default one.
17953 2004-07-30 Duncan Mak <duncan@ximian.com>
17955 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
17957 2004-07-30 Martin Baulig <martin@ximian.com>
17959 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
17961 * class.cs (SourceMethod): New public class, derive from the
17962 symbol writer's ISourceMethod.
17963 (Method): Use the new symbol writer API.
17965 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
17966 as argument and use the new symbol writer.
17969 (SourceFile): Implement the symbol writer's ISourceFile.
17970 (Location.SymbolDocument): Removed.
17971 (Location.SourceFile): New public property.
17973 * symbolwriter.cs: Use the new symbol writer API.
17975 2004-07-30 Raja R Harinath <rharinath@novell.com>
17977 * Makefile (install-local): Remove. Functionality moved to
17980 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
17982 * Makefile: Install mcs.exe.config file together with mcs.exe.
17983 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
17984 correct runtime version.
17986 2004-07-25 Martin Baulig <martin@ximian.com>
17989 (TypeContainer.RegisterOrder): Removed, this was unused.
17990 (TypeContainer, interface_order): Removed.
17991 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
17992 TypeContainer as argument since we can also be called with a
17993 `PartialContainer' for a partial class/struct/interface.
17994 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
17995 of checking whether we're an `Interface' - we could be a
17996 `PartialContainer'.
17997 (PartialContainer.Register): Override; call
17998 AddClass()/AddStruct()/AddInterface() on our parent.
18000 * cs-parser.jay (interface_member_declaration): Add things to the
18001 `current_container', not the `current_class'.
18003 * rootcontext.cs (RegisterOrder): The overloaded version which
18004 takes an `Interface' was unused, removed.
18006 * typemanager.cs (TypeManager.LookupInterface): Return a
18007 `TypeContainer', not an `Interface'.
18008 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
18009 contain a `PartialContainer' for an interface, so check it's
18010 `Kind' to figure out what it is.
18012 2004-07-25 Martin Baulig <martin@ximian.com>
18014 * class.cs (Class.DefaultTypeAttributes): New public constant.
18015 (Struct.DefaultTypeAttributes): Likewise.
18016 (Interface.DefaultTypeAttributes): Likewise.
18017 (PartialContainer.TypeAttr): Override this and add the
18018 DefaultTypeAttributes.
18020 2004-07-25 Martin Baulig <martin@ximian.com>
18022 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
18023 we can just use the `Parent' field instead.
18025 2004-07-25 Martin Baulig <martin@ximian.com>
18027 * class.cs (TypeContainer.Emit): Renamed to EmitType().
18029 2004-07-25 Martin Baulig <martin@ximian.com>
18031 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
18032 our parts before defining any methods.
18033 (TypeContainer.VerifyImplements): Make this virtual.
18034 (ClassPart.VerifyImplements): Override and call VerifyImplements()
18035 on our PartialContainer.
18037 2004-07-25 Martin Baulig <martin@ximian.com>
18039 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
18041 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
18042 argument, we can just use the `Parent' field instead.
18045 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
18046 (MemberBase.DoDefine): Likewise.
18048 2004-07-24 Martin Baulig <martin@ximian.com>
18050 * decl.cs (MemberCore.Parent): New public field.
18051 (DeclSpace.Parent): Moved to MemberCore.
18053 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
18054 (MemberBase.ctor): Added TypeContainer argument, pass it to our
18056 (FieldBase, Field, Operator): Likewise.
18057 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
18058 (EventField, Event): Likewise.
18060 2004-07-23 Martin Baulig <martin@ximian.com>
18062 * class.cs (PartialContainer): New public class.
18063 (ClassPart): New public class.
18064 (TypeContainer): Added support for partial classes.
18065 (TypeContainer.GetClassBases): Splitted some of the functionality
18066 out into GetNormalBases() and GetPartialBases().
18068 * cs-tokenizer.cs (Token.PARTIAL): New token.
18069 (Tokenizer.consume_identifier): Added some hacks to recognize
18070 `partial', but only if it's immediately followed by `class',
18071 `struct' or `interface'.
18073 * cs-parser.jay: Added support for partial clases.
18075 2004-07-23 Martin Baulig <martin@ximian.com>
18077 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
18078 a `DeclSpace' and also made it readonly.
18079 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
18080 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
18081 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
18083 * cs-parser.jay: Pass the `current_class', not the
18084 `current_container' (at the moment, this is still the same thing)
18085 to a new Method, Property, Event, Indexer or Constructor.
18087 2004-07-23 Martin Baulig <martin@ximian.com>
18089 * cs-parser.jay (CSharpParser): Added a new `current_class' field
18090 and removed the `current_interface' one.
18091 (struct_declaration, class_declaration, interface_declaration):
18092 Set `current_class' to the newly created class/struct/interface;
18093 set their `Bases' and call Register() before parsing their body.
18095 2004-07-23 Martin Baulig <martin@ximian.com>
18097 * class.cs (Kind): New public enum.
18098 (TypeContainer): Made this class abstract.
18099 (TypeContainer.Kind): New public readonly field.
18100 (TypeContainer.CheckDef): New public method; moved here from
18102 (TypeContainer.Register): New public abstract method.
18103 (TypeContainer.GetPendingImplementations): New public abstract
18105 (TypeContainer.GetClassBases): Removed the `is_class' and
18106 `is_iface' parameters.
18107 (TypeContainer.DefineNestedTypes): Formerly known as
18109 (ClassOrStruct): Made this class abstract.
18111 * tree.cs (RootTypes): New public type.
18113 2004-07-20 Martin Baulig <martin@ximian.com>
18115 * tree.cs (Tree.RecordNamespace): Removed.
18116 (Tree.Namespaces): Removed.
18118 * rootcontext.cs (RootContext.IsNamespace): Removed.
18120 * cs-parser.jay (namespace_declaration): Just create a new
18121 NamespaceEntry here.
18123 2004-07-20 Martin Baulig <martin@ximian.com>
18125 * statement.cs (ExceptionStatement): New abstract class. This is
18126 now used as a base class for everyone who's using `finally'.
18127 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
18128 our local variables before using them.
18130 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
18131 virtual method. This is used by Yield.Resolve() to "steal" an
18132 outer block's `finally' clauses.
18133 (FlowBranchingException): The .ctor now takes an ExceptionStatement
18136 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
18137 version which takes an ExceptionStatement. This version must be
18138 used to create exception branchings.
18141 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
18142 (Iterator.EmitMoveNext): Added exception support; protect the
18143 block with a `fault' clause, properly handle 'finally' clauses.
18144 (Iterator.EmitDispose): Run all the `finally' clauses here.
18146 2004-07-20 Martin Baulig <martin@ximian.com>
18148 * iterator.cs: This is the first of a set of changes in the
18149 iterator code. Match the spec more closely: if we're an
18150 IEnumerable, then GetEnumerator() must be called. The first time
18151 GetEnumerator() is called, it returns the current instance; all
18152 subsequent invocations (if any) must create a copy.
18154 2004-07-19 Miguel de Icaza <miguel@ximian.com>
18156 * expression.cs: Resolve the constant expression before returning
18159 2004-07-19 Martin Baulig <martin@ximian.com>
18161 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
18162 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
18163 the return type of the new EmitContext.
18165 2004-07-18 Martin Baulig <martin@ximian.com>
18167 * class.cs (Property.Define): Fix iterators.
18169 * iterators.cs (Iterator.Define): Moved the
18170 `container.AddInterator (this)' call here from the .ctor; only do
18171 it if we resolved successfully.
18173 2004-07-17 Miguel de Icaza <miguel@ximian.com>
18175 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
18176 `true' for preprocessing directives that we parse. The return
18177 value indicates whether we should return to regular tokenizing or
18178 not, not whether it was parsed successfully.
18180 In the past if we were in: #if false ... #line #endif, we would
18181 resume parsing after `#line'. See bug 61604.
18183 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
18184 building: IsEnumType should return true only for enums, not for
18185 enums or System.Enum itself. This fixes #61593.
18187 Likely what happened is that corlib was wrong: mcs depended on
18188 this bug in some places. The bug got fixed, we had to add the
18189 hack, which caused bug 61593.
18191 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
18192 that was a workaround for the older conditions.
18194 2004-07-16 Ben Maurer <bmaurer@ximian.com>
18196 * assign.cs: IAssignMethod has a new interface, as documented
18197 inline. All assignment code now uses this new api.
18199 * ecore.cs, expression.cs: All classes which implement
18200 IAssignMethod now use the new interface.
18202 * expression.cs (Invocation): add a hack to EmitCall so that
18203 IndexerAccess can be the target of a compound assignment without
18204 evaluating its arguments twice.
18206 * statement.cs: Handle changes in Invocation api.
18208 2004-07-16 Martin Baulig <martin@ximian.com>
18210 * iterators.cs: Rewrote this. We're now using one single Proxy
18211 class for both the IEnumerable and the IEnumerator interface and
18212 `Iterator' derives from Class so we can use the high-level API.
18214 * class.cs (TypeContainer.AddIterator): New method.
18215 (TypeContainer.DoDefineType): New protected virtual method, which
18216 is called from DefineType().
18217 (TypeContainer.DoDefineMembers): Call DefineType() and
18218 DefineMembers() on all our iterators.
18219 (TypeContainer.Emit): Call Emit() on all our iterators.
18220 (TypeContainer.CloseType): Call CloseType() on all our iterators.
18222 * codegen.cs (EmitContext.CurrentIterator): New public field.
18224 2004-07-15 Martin Baulig <martin@ximian.com>
18227 (TypeManager.not_supported_exception_type): New type.
18229 2004-07-14 Martin Baulig <martin@ximian.com>
18231 * iterators.cs: Use real error numbers.
18233 2004-07-14 Martin Baulig <martin@ximian.com>
18235 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
18236 requires this to be a System.Collection.IEnumerable and not a
18237 class implementing that interface.
18238 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
18240 2004-07-13 Marek Safar <marek.safar@seznam.cz>
18242 * class.cs: Fixed previous fix, it broke some error tests.
18244 2004-07-12 Martin Baulig <martin@ximian.com>
18246 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
18249 2004-07-09 Miguel de Icaza <miguel@ximian.com>
18251 * assign.cs (LocalTemporary): Add new argument: is_address,If
18252 `is_address' is true, then the value that we store is the address
18253 to the real value, and not the value itself.
18255 * ecore.cs (PropertyExpr): use the new local temporary
18256 stuff to allow us to handle X.Y += z (where X is a struct)
18258 2004-07-08 Martin Baulig <martin@ximian.com>
18260 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
18261 not always return, just like we're doing in Using.Resolve().
18263 2004-07-07 Miguel de Icaza <miguel@ximian.com>
18265 * cs-parser.jay (fixed_statement): flag this as Pinned.
18267 2004-07-06 Miguel de Icaza <miguel@ximian.com>
18269 * typemanager.cs (TypeManager): Removed MakePinned method, this
18270 mechanism is replaced with the .NET 2.x compatible mechanism of
18271 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
18273 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
18274 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
18275 `IsFixed' property which has a different meaning.
18277 2004-07-02 Raja R Harinath <rharinath@novell.com>
18279 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
18280 visible from inside a nested class, not just the names of the
18281 immediately enclosing class.
18282 Fix for bug #60730.
18284 2004-06-24 Raja R Harinath <rharinath@novell.com>
18286 * expression.cs (BetterConversion): Remove buggy special-case
18287 handling of "implicit constant expression conversions". At this
18288 point, we already know that the conversion is possible -- we're
18289 only checking to see which is better.
18291 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18293 * cs-parser.jay: Added error CS0210 test.
18295 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18297 * cs-parser.jay: Added error CS0134 test.
18299 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18302 * cs-parser.jay: Added error CS0145 test.
18304 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18306 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
18308 2004-06-23 Ben Maurer <bmaurer@ximian.com>
18310 * expression.cs (StackAlloc.Resolve): The argument may not
18311 be a constant; deal with this case.
18313 2004-06-23 Marek Safar <marek.safar@seznam.cz>
18315 * attribute.cs (IndexerName_GetIndexerName): Renamed to
18316 GetIndexerAttributeValue.
18317 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
18319 * class.cs (Indexer.Define): Added error tests for CS0415,
18322 2004-06-23 Miguel de Icaza <miguel@ximian.com>
18324 * attribute.cs (Attribute.Resolve): Keep field code in sync with
18327 2004-06-23 Martin Baulig <martin@ximian.com>
18329 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
18330 neither return nor throw, reset the barrier as well. Fixes #60457.
18332 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
18334 * class.cs : EventAttributes is now set to None by default.
18335 This fixes bug #60459.
18337 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18340 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18341 Don't throw exception but return null (it's sufficient now).
18343 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18345 * typemanager.cs (GetArgumentTypes): Faster implementation.
18347 2004-06-18 Martin Baulig <martin@ximian.com>
18349 * attribute.cs (Attribute.Resolve): Check whether we're an
18350 EmptyCast which a Constant child. Fixes #60333.
18352 2004-06-17 Ben Maurer <bmaurer@ximian.com>
18354 * statement.cs (EmitCollectionForeach): Account for the fact that
18355 not all valuetypes are in areas which we can take the address of.
18356 For these variables, we store to a temporary variable. Also, make
18357 sure that we dont emit a `callvirt' on a valuetype method.
18359 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18361 * expression.cs (StackAlloc.DoReSolve): Added test for
18362 negative parameter (CS0247).
18364 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18367 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
18369 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18372 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
18375 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18377 Fix bug #58254 & cs1555.cs, cs1556.cs
18378 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
18380 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18382 * cs-parser.jay: Added error CS1669 test for indexers.
18384 2004-06-11 Martin Baulig <martin@ximian.com>
18386 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
18387 call this twice: for params and varargs methods.
18389 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18392 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
18394 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18396 * attribute.cs (Attribute.GetValidTargets): Made public.
18399 (AbstractPropertyEventMethod): New class for better code sharing.
18400 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
18402 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
18404 2004-06-11 Raja R Harinath <rharinath@novell.com>
18407 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
18408 that the call to Resolve is part of a MemberAccess.
18409 (Expression.Resolve): Use it for SimpleName resolution.
18410 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
18411 Add 'intermediate' boolean argument.
18412 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
18413 error message when the SimpleName can be resolved ambiguously
18414 between an expression and a type.
18415 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
18417 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
18418 call on the left-side.
18420 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18423 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
18425 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18427 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
18429 2004-06-11 Martin Baulig <martin@ximian.com>
18431 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
18432 varargs methods if applicable.
18434 2004-06-11 Martin Baulig <martin@ximian.com>
18436 * expression.cs (Invocation.EmitCall): Don't use
18437 `method.CallingConvention == CallingConventions.VarArgs' since the
18438 method could also have `CallingConventions.HasThis'.
18440 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18442 * class.cs (Event.GetSignatureForError): Implemented.
18443 Fixed crash in error test cs3010.cs
18445 2004-06-10 Miguel de Icaza <miguel@ximian.com>
18447 * cs-tokenizer.cs: Change the way we track __arglist to be
18448 consistent with the other keywords.
18450 2004-06-09 Miguel de Icaza <miguel@ximian.com>
18452 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
18455 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
18457 * codegen.cs: Check that all referenced assemblies have a strongname
18458 before strongnaming the compiled assembly. If not report error CS1577.
18459 Fix bug #56563. Patch by Jackson Harper.
18460 * typemanager.cs: Added a method to return all referenced assemblies.
18461 Fix bug #56563. Patch by Jackson Harper.
18463 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18466 (Method.ApplyAttributeBuilder): Moved and added conditional
18467 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
18470 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
18472 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18475 * class.cs: (EventField.attribute_targets): Changed default target.
18477 2004-06-08 Martin Baulig <martin@ximian.com>
18479 * expression.cs (Invocation.EmitCall): Enable varargs methods.
18481 2004-06-08 Martin Baulig <martin@ximian.com>
18483 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
18485 2004-06-07 Martin Baulig <martin@ximian.com>
18487 Added support for varargs methods.
18489 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
18492 * cs-parser.jay: Added support for `__arglist'.
18494 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
18496 * expression.cs (Argument.AType): Added `ArgList'.
18497 (Invocation): Added support for varargs methods.
18498 (ArglistAccess): New public class.
18499 (Arglist): New public class.
18501 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
18503 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
18504 a method's top-level block if the method has varargs.
18506 * support.cs (ReflectionParameters, InternalParameters): Added
18507 support for varargs methods.
18509 2004-06-07 Miguel de Icaza <miguel@ximian.com>
18511 * class.cs: Provide location in indexer error report.
18513 * driver.cs: Use standard names.
18515 * namespace.cs: Catch the use of using after a namespace has been
18516 declared also on using aliases.
18518 2004-06-03 Raja R Harinath <rharinath@novell.com>
18521 * typemanager.cs (closure_private_ok, closure_invocation_type)
18522 (closure_qualifier_type, closure_invocation_assembly)
18523 (FilterWithClosure): Move to ...
18524 (Closure): New internal nested class.
18525 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
18526 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
18527 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
18528 (MemberLookup, MemberLookupFailed): Use it.
18529 * expression.cs (New.DoResolve): Treat the lookup for the
18530 constructor as being qualified by the 'new'ed type.
18531 (Indexers.GetIndexersForTypeOrInterface): Update.
18533 2004-06-03 Marek Safar <marek.safar@seznam.cz>
18536 (GetConditionalAttributeValue): New method. Returns
18537 condition of ConditionalAttribute.
18538 (SearchMulti): New method. Returns all attributes of type 't'.
18539 Use it when attribute is AllowMultiple = true.
18540 (IsConditionalMethodExcluded): New method.
18543 (Method.IsExcluded): Implemented. Returns true if method has conditional
18544 attribute and the conditions is not defined (method is excluded).
18545 (IMethodData): Extended interface for ConditionalAttribute support.
18546 (PropertyMethod.IsExcluded): Implemented.
18549 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
18552 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
18555 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
18557 * expression.cs (ArrayCreationExpression): Make this just an
18558 `expression'. It can't be a statement, so the code here was
18561 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18564 * typemanager.cs (GetFullNameSignature): New method for
18567 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18570 * class.cs (MemberBase.GetSignatureForError): New virtual method.
18571 Use this method when MethodBuilder is null.
18572 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
18573 Added test for error CS0626 (MONO reports error for this situation).
18574 (IMethodData.GetSignatureForError): Extended interface.
18576 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18579 (AttributeTester.GetObsoleteAttribute): Returns instance of
18580 ObsoleteAttribute when type is obsolete.
18583 (TypeContainer.VerifyObsoleteAttribute): Override.
18584 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
18585 (MethodCode.VerifyObsoleteAttribute): Override.
18586 (MemberBase.VerifyObsoleteAttribute): Override.
18589 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
18590 and report proper error.
18593 Delegate.VerifyObsoleteAttribute): Override.
18596 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
18597 and report proper error.
18598 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
18601 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
18605 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
18606 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
18607 Added test for ObsoleteAttribute.
18610 (Catch): Derived from Statement.
18612 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18614 Fixed bug #59071 & cs0160.cs
18616 * statement.cs (Try.Resolve): Check here whether order of catch
18617 clauses matches their dependencies.
18619 2004-05-31 Miguel de Icaza <miguel@ximian.com>
18621 * Reverted patch to namespace.cs (Use lookuptypedirect). This
18622 caused a regression: #59343. Referencing nested classes from an
18623 assembly stopped working.
18625 2004-05-31 Martin Baulig <martin@ximian.com>
18627 MCS is now frozen for beta 2.
18629 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18631 * convert.cs: add a trivial cache for overload operator resolution.
18633 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18635 * decl.cs: If possible, use lookuptypedirect here. We can only do
18636 this if there is no `.' after the namespace. Avoids using
18637 LookupType, which does lots of slow processing.
18638 (FindNestedType) New method, does what it says :-).
18639 * namespace.cs: use LookupTypeDirect.
18640 * rootcontext.cs: use membercache, if possible.
18641 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
18643 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18646 According to the spec,
18648 In a member access of the form E.I, if E is a single identifier,
18649 and if the meaning of E as a simple-name (§7.5.2) is a constant,
18650 field, property, localvariable, or parameter with the same type as
18651 the meaning of E as a type-name (§3.8), then both possible
18652 meanings of E are permitted.
18654 We did not check that E as a simple-name had the same type as E as
18657 This trivial check gives us 5-7% on bootstrap time.
18659 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18661 * expression.cs (Invocation.OverloadResolve): Avoid the
18662 use of hashtables and boxing here by allocating on demand.
18664 2004-05-30 Martin Baulig <martin@ximian.com>
18666 * rootcontext.cs (RootContext.LookupType): Don't cache things if
18667 we're doing a silent lookup. Don't try to lookup nested types in
18668 TypeManager.object_type (thanks to Ben Maurer).
18670 2004-05-30 Martin Baulig <martin@ximian.com>
18672 Committing a patch from Ben Maurer.
18674 * rootcontext.cs (RootContext.LookupType): Cache negative results.
18676 2004-05-29 Martin Baulig <martin@ximian.com>
18678 * class.cs (IMethodData.ShouldIgnore): New method.
18680 * typemanager.cs (TypeManager.MethodFlags): Don't take a
18681 `Location' argument, we don't need it anywhere. Use
18682 `IMethodData.ShouldIgnore ()' instead of
18683 `MethodData.GetMethodFlags ()'.
18684 (TypeManager.AddMethod): Removed.
18685 (TypeManager.AddMethod2): Renamed to AddMethod.
18687 2004-05-29 Martin Baulig <martin@ximian.com>
18689 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
18691 * convert.cs (Convert.ImplicitReferenceConversion): If we're
18692 converting from a class type S to an interface type and we already
18693 have an object on the stack, don't box it again. Fixes #52578.
18695 2004-05-29 Martin Baulig <martin@ximian.com>
18697 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18698 Added support for `params' parameters. Fixes #59267.
18700 2004-05-29 Martin Baulig <martin@ximian.com>
18702 * literal.cs (NullPointer): Provide a private .ctor which sets
18703 `type' to TypeManager.object_type. Fixes #59048.
18705 2004-05-29 Martin Baulig <martin@ximian.com>
18707 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
18708 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
18710 * ecore.cs (EventExpr.instance_expr): Make the field private.
18712 2004-05-26 Marek Safar <marek.safar@seznam.cz>
18714 Fixed bug #50080 & cs0214-2.cs
18715 * expression.cs (Cast.DoResolve): Check unsafe context here.
18717 * statement.cs (Resolve.DoResolve): Likewise.
18719 2004-05-26 Martin Baulig <martin@ximian.com>
18721 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
18723 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
18724 (RootContext.LookupType): Pass down the `silent' flag.
18726 2004-05-25 Martin Baulig <martin@ximian.com>
18729 (MethodGroupExpr.IdenticalTypeName): New public property.
18730 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
18731 expression actually refers to a type.
18733 2004-05-25 Martin Baulig <martin@ximian.com>
18735 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
18736 for #56176 and made it actually work.
18738 2004-05-25 Martin Baulig <martin@ximian.com>
18740 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
18741 (FieldExpr, PropertyExpr): Override and implement
18742 CacheTemporaries. Fixes #52279.
18744 2004-05-25 Miguel de Icaza <miguel@ximian.com>
18746 * location.cs: In the new compiler listing a file twice is a
18747 warning, not an error.
18749 2004-05-24 Martin Baulig <martin@ximian.com>
18751 * enum.cs (Enum.DefineType): For the `BaseType' to be a
18752 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
18754 2004-05-24 Martin Baulig <martin@ximian.com>
18756 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
18757 walking the `using' list. Fixes #53921.
18759 2004-05-24 Martin Baulig <martin@ximian.com>
18761 * const.cs (Const.LookupConstantValue): Added support for
18762 EmptyCast's; fixes #55251.
18764 2004-05-24 Martin Baulig <martin@ximian.com>
18766 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
18767 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
18768 which does the CS0135 check. The reason is that we first need to
18769 check whether the variable actually exists.
18771 2004-05-24 Martin Baulig <martin@ximian.com>
18773 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
18774 than RootContext.LookupType() to find the explicit interface
18775 type. Fixes #58584.
18777 2004-05-24 Raja R Harinath <rharinath@novell.com>
18779 * Makefile: Simplify. Use executable.make.
18780 * mcs.exe.sources: New file. List of sources of mcs.exe.
18782 2004-05-24 Anders Carlsson <andersca@gnome.org>
18786 Use the invariant culture when doing String.Compare for CLS case
18789 2004-05-23 Martin Baulig <martin@ximian.com>
18791 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
18792 don't have any dots. Fixes #52622, added cs0246-8.cs.
18794 * namespace.cs (NamespaceEntry.Lookup): Likewise.
18796 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18798 * class.cs (MemberBase.Define): Reuse MemberType member for
18799 resolved type. Other methods can use it too.
18801 2004-05-23 Martin Baulig <martin@ximian.com>
18803 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
18804 the variable also exists in the current block (otherwise, we need
18805 to report a CS0103). Fixes #58670.
18807 2004-05-23 Martin Baulig <martin@ximian.com>
18809 * flowanalysis.cs (Reachability.Reachable): Compute this
18810 on-the-fly rather than storing it as a field.
18812 2004-05-23 Martin Baulig <martin@ximian.com>
18814 * flowanalysis.cs (Reachability.And): Manually compute the
18815 resulting `barrier' from the reachability.
18817 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18820 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
18821 instance of ObsoleteAttribute when symbol is obsolete.
18824 (IMethodData): Extended interface for ObsoleteAttribute support.
18826 2004-05-22 Marek Safar <marek.safar@seznam.cz>
18828 * attribute.cs: Fix bug #55970
18830 2004-05-22 Marek Safar <marek.safar@seznam.cz>
18834 (GetObsoleteAttribute): New method. Creates the instance of
18836 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
18837 ObsoleteAttribute when member is obsolete.
18838 (AttributeTester.Report_ObsoleteMessage): Common method for
18839 Obsolete error/warning reporting.
18842 (TypeContainer.base_classs_type): New member for storing parent type.
18845 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
18846 for this MemberCore.
18848 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18850 * attribute.cs, const.cs: Fix bug #58590
18852 2004-05-21 Martin Baulig <martin@ximian.com>
18854 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
18855 out parameters if the end of the method is unreachable. Fixes
18858 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18860 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
18861 Hari was right, why extra method.
18863 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18865 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
18867 2004-05-20 Martin Baulig <martin@ximian.com>
18869 Merged this back from gmcs to keep the differences to a minumum.
18871 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
18872 instead of a Declspace.
18873 (Attribute.ResolveType): Likewise.
18874 (Attributes.Search): Likewise.
18875 (Attributes.Contains): Likewise.
18876 (Attributes.GetClsCompliantAttribute): Likewise.
18878 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
18880 (MethodData.ApplyAttributes): Take an EmitContext instead of a
18883 2004-05-19 Marek Safar <marek.safar@seznam.cz>
18885 Fix bug #58688 (MCS does not report error when the same attribute
18888 * attribute.cs (Attribute.Emit): Distinction between null and default.
18890 2004-05-19 Raja R Harinath <rharinath@novell.com>
18892 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
18893 of a top-level attribute without an attribute target.
18894 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
18896 (Attribute.Conditional_GetConditionName),
18897 (Attribute.Obsolete_GetObsoleteMessage): Update.
18898 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
18899 part of ScanForIndexerName.
18900 (Attribute.CanIgnoreInvalidAttribute): New function.
18901 (Attribute.ScanForIndexerName): Move to ...
18902 (Attributes.ScanForIndexerName): ... here.
18903 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
18904 (Attributes.Search): New internal variant that can choose not to
18905 complain if types aren't resolved. The original signature now
18907 (Attributes.GetClsCompliantAttribute): Use internal variant, with
18908 complaints suppressed.
18909 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
18910 only if it not useful.
18911 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
18912 top-level for attributes that are shared between the assembly
18913 and a top-level class.
18914 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
18915 * class.cs: Update to reflect changes.
18916 (DefineIndexers): Fuse loops.
18917 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
18918 a couple more variants of attribute names.
18920 2004-05-18 Marek Safar <marek.safar@seznam.cz>
18922 Fix bug #52585 (Implemented explicit attribute declaration)
18925 (Attributable.ValidAttributeTargets): New abstract method. It gets
18926 list of valid attribute targets for explicit target declaration.
18927 (Attribute.Target): It holds target itself.
18928 (AttributeSection): Removed.
18929 (Attribute.CheckTargets): New method. It checks whether attribute
18930 target is valid for the current element.
18933 (EventProperty): New class. For events that are declared like
18934 property (with add and remove accessors).
18935 (EventField): New class. For events that are declared like field.
18938 * cs-parser.jay: Implemented explicit attribute target declaration.
18940 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
18941 Override ValidAttributeTargets.
18944 (ReturnParameter): Class for applying custom attributes on
18946 (ParameterAtribute): New class. Class for applying custom
18947 attributes on the parameter type.
18949 2004-05-17 Miguel de Icaza <miguel@ximian.com>
18951 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
18954 (Method): Allow UNSAFE here.
18956 * modifiers.cs: Support unsafe reporting.
18958 2004-05-17 Marek Safar <marek.safar@seznam.cz>
18960 * decl.cs: Fix bug #58478.
18962 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18964 * statement.cs: When checking for unreachable code on an EmptyStatement,
18965 set the location. Fixes bug #58488.
18967 2004-05-13 Miguel de Icaza <miguel@ximian.com>
18969 * driver.cs: Add -pkg handling.
18971 From Gonzalo: UseShelLExecute=false
18973 2004-05-12 Marek Safar <marek.safar@seznam.cz>
18976 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
18978 (Attribute.IsClsCompliaceRequired): Moved to base for better
18980 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
18981 when attribute is AttributeUsageAttribute.
18982 (Attribute.GetValidTargets): Simplified.
18983 (Attribute.GetAttributeUsage): New method returns AttributeUsage
18984 attribute for this type.
18985 (Attribute.ApplyAttributes): Method renamed to Emit and make
18987 (GlobalAttributeSection): New class for special handling of global
18988 attributes (assembly, module).
18989 (AttributeSection.Emit): New method.
18991 * class.cs: Implemented Attributable abstract methods.
18992 (MethodCore.LabelParameters): Moved to Parameter class.
18993 (Accessor): Is back simple class.
18994 (PropertyMethod): Implemented Attributable abstract class.
18995 (DelegateMethod): Implemented Attributable abstract class.
18996 (Event): New constructor for disctintion between normal Event
18997 and Event with accessors.
18999 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
19001 * codegen.cs, const.cs, decl.cs, delegate.cs:
19002 (CommonAssemblyModulClass): Implemented Attributable abstract class
19005 * enum.cs: Implement IAttributeSupport interface.
19006 (EnumMember): New class for emum members. Implemented Attributable
19010 (ParameterBase): Is abstract.
19011 (ReturnParameter): New class for easier [return:] attribute handling.
19013 * typemanager.cs: Removed builder_to_attr.
19015 2004-05-11 Raja R Harinath <rharinath@novell.com>
19018 * attribute.cs (Attribute.GetPositionalValue): New function.
19019 * class.cs (TypeContainer.VerifyMembers): New function.
19020 (TypeContainer.Emit): Use it.
19021 (ClassOrStruct): New base class for Class and Struct.
19022 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
19023 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
19025 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
19026 then each non-static field should have a FieldOffset attribute.
19027 Otherwise, none of the fields should have a FieldOffset attribute.
19028 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
19029 and FieldOffset attributes.
19030 * typemanager.cs (TypeManager.struct_layout_attribute_type)
19031 (TypeManager.field_offset_attribute_type): New core types.
19032 (TypeManager.InitCoreTypes): Initialize them.
19034 2004-05-11 Michal Moskal <malekith@pld-linux.org>
19036 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
19037 Return correct type.
19040 2004-05-09 Miguel de Icaza <miguel@ximian.com>
19042 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
19043 be implicitly converted to ulong.
19045 * expression.cs: The logic for allowing operator &, | and ^ worked
19046 was wrong, it worked before because we did not report an error in
19047 an else branch. Fixes 57895.
19049 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
19050 allow volatile fields to be reference types.
19052 2004-05-07 Miguel de Icaza <miguel@ximian.com>
19054 * driver.cs: Add support for /debug-
19056 2004-05-07 Raja R Harinath <rharinath@novell.com>
19058 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
19059 Add a 'complain' parameter to silence errors.
19060 (Attribute.Resolve): Update to changes. Put in sanity check to catch
19061 silently overlooked type-resolutions.
19062 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
19063 to reflect changes.
19064 (Attributes.Search): New function.
19065 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
19066 (Attributes.GetAttributeFullName): Remove hack.
19067 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
19068 Update to reflect changes.
19069 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
19070 Use Attributes.Search instead of nested loops.
19072 2004-05-07 Marek Safar <marek.safar@seznam.cz>
19075 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
19076 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
19077 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
19079 * report.cs: (Report.Warning): Renamed to Warning_T because of
19080 parameter collision.
19082 2004-05-05 Raja R Harinath <rharinath@novell.com>
19084 * expression.cs (MemberAccess.ResolveMemberAccess):
19085 Exit with non-zero status after Report.Error.
19086 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
19088 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
19090 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
19092 * support.cs: Don't hang when the file is empty.
19094 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
19096 * support.cs: In SeekableStreamReader, compute the preamble size of the
19097 underlying stream. Position changes should take into account that initial
19100 2004-05-03 Todd Berman <tberman@sevenl.net>
19102 * driver.cs: remove unused GetSysVersion function.
19104 2004-05-03 Todd Berman <tberman@sevenl.net>
19106 * driver.cs: Remove the hack from saturday, as well as the hack
19107 from jackson (LoadAssemblyFromGac), also adds the CWD to the
19108 link_paths to get that bit proper.
19110 2004-05-01 Todd Berman <tberman@sevenl.net>
19112 * driver.cs: Try a LoadFrom before a Load, this checks the current
19113 path. This is currently a bug in mono that is be fixed, however, this
19114 provides a workaround for now. This will be removed when the bug
19117 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
19119 * CryptoConvert.cs: Updated to latest version. Fix issue with
19120 incomplete key pairs (#57941).
19122 2004-05-01 Todd Berman <tberman@sevenl.net>
19124 * driver.cs: Remove '.' from path_chars, now System.* loads properly
19127 2004-04-30 Jackson Harper <jackson@ximian.com>
19129 * codegen.cs: Open keys readonly.
19131 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19133 * typemanager.cs: don't report cyclic struct layout when a struct
19134 contains 2 or more fields of the same type. Failed for Pango.AttrShape
19135 which has 2 Pango.Rectangle fields.
19137 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
19139 * expression.cs: Handle IntPtr comparisons with IL code
19140 rather than a method call.
19142 2004-04-29 Martin Baulig <martin@ximian.com>
19144 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
19145 the list of PropertyInfo's in class hierarchy and find the
19146 accessor. Fixes #56013.
19148 2004-04-29 Martin Baulig <martin@ximian.com>
19150 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
19152 2004-04-29 Martin Baulig <martin@ximian.com>
19154 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
19156 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
19158 2004-04-29 Martin Baulig <martin@ximian.com>
19160 * class.cs (ConstructorInitializer.Resolve): Check whether the
19161 parent .ctor is accessible. Fixes #52146.
19163 2004-04-29 Martin Baulig <martin@ximian.com>
19165 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
19167 * statement.cs (Using.EmitLocalVariableDecls): Use
19168 TypeManager.idisposable_type, not typeof (IDisposable).
19169 (Foreach.EmitCollectionForeach): Added support for valuetypes.
19171 2004-04-29 Martin Baulig <martin@ximian.com>
19173 * class.cs (Event.Define): Don't emit the field and don't set
19174 RTSpecialName and SpecialName for events on interfaces. Fixes
19177 2004-04-29 Raja R Harinath <rharinath@novell.com>
19179 Refactor Attribute.ApplyAttributes.
19180 * attribute.cs (Attributable): New base class for objects that can
19181 have Attributes applied on them.
19182 (Attribute): Make AttributeUsage fields public.
19183 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
19184 (Attribute.IsInternalCall): New property.
19185 (Attribute.UsageAttr): Convert to a public read-only property.
19186 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
19187 (Attribute.ResolveType, Attribute.Resolve)
19188 (Attribute.ScanForIndexerName): Update to reflect changes.
19189 (Attribute.CheckAttributeTarget): Re-format.
19190 (Attribute.ApplyAttributes): Refactor, to various
19191 Attributable.ApplyAttributeBuilder methods.
19192 * decl.cs (MemberCore): Make Attributable.
19193 * class.cs (Accessor): Make Attributable.
19194 (MethodData.ApplyAttributes): Use proper attribute types, not
19196 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
19197 (TypeContainer.ApplyAttributeBuilder)
19198 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
19199 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
19200 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
19201 (Operator.ApplyAttributeBuilder): New factored-out methods.
19202 * const.cs (Const.ApplyAttributeBuilder): Likewise.
19203 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
19204 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
19205 * parameter.cs (ParameterBase): New Attributable base class
19206 that can also represent Return types.
19207 (Parameter): Update to the changes.
19209 2004-04-29 Jackson Harper <jackson@ximian.com>
19211 * driver.cs: Prefer the corlib system version when looking for
19212 assemblies in the GAC. This is still a hack, but its a better hack
19215 2004-04-29 Marek Safar <marek.safar@seznam.cz>
19217 * decl.cs, enum.cs: Improved error 3005 reporting.
19219 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
19220 (related_symbols): New private member for list of symbols
19221 related to reported error/warning.
19223 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
19225 2004-04-29 Martin Baulig <martin@ximian.com>
19227 * ecore.cs (Expression.Constantify): If we're an enum and
19228 TypeManager.TypeToCoreType() doesn't give us another type, use
19229 t.UnderlyingSystemType. Fixes #56178.
19231 2004-04-29 Martin Baulig <martin@ximian.com>
19233 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
19234 interfaces and for each interface, only add members directly
19235 declared in that interface. Fixes #53255.
19237 2004-04-28 Martin Baulig <martin@ximian.com>
19239 * expression.cs (ConditionalLogicalOperator): Use a temporary
19240 variable for `left' to avoid that we evaluate it more than once;
19243 2004-04-28 Martin Baulig <martin@ximian.com>
19245 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
19248 2004-04-28 Martin Baulig <martin@ximian.com>
19250 * statement.cs (LocalInfo.Resolve): Check whether the type is not
19253 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
19254 whether the type is not void (CS1547).
19256 2004-04-28 Martin Baulig <martin@ximian.com>
19258 * expression.cs (Unary.DoResolveLValue): Override this and report
19259 CS0131 for anything but Operator.Indirection.
19261 2004-04-28 Martin Baulig <martin@ximian.com>
19263 Committing a patch from Ben Maurer; see bug #50820.
19265 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19268 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19271 2004-04-28 Martin Baulig <martin@ximian.com>
19273 Committing a patch from Ben Maurer; see bug #50820.
19275 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19278 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19281 2004-04-28 Martin Baulig <martin@ximian.com>
19283 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
19284 (Block.AddLabel): Call DoLookupLabel() to only search in the
19287 2004-04-28 Martin Baulig <martin@ximian.com>
19289 * cfold.cs (ConstantFold.BinaryFold): Added special support for
19290 comparing StringConstants and NullLiterals in Equality and Inequality.
19292 2004-04-28 Jackson Harper <jackson@ximian.com>
19294 * driver.cs: Attempt to load referenced assemblies from the
19295 GAC. This is the quick and dirty version of this method that
19296 doesnt take into account versions and just takes the first
19297 canidate found. Will be good enough for now as we will not have more
19298 then one version installed into the GAC until I update this method.
19300 2004-04-28 Martin Baulig <martin@ximian.com>
19302 * typemanager.cs (TypeManager.CheckStructCycles): New public
19303 static method to check for cycles in the struct layout.
19305 * rootcontext.cs (RootContext.PopulateTypes): Call
19306 TypeManager.CheckStructCycles() for each TypeContainer.
19307 [Note: We only need to visit each type once.]
19309 2004-04-28 Martin Baulig <martin@ximian.com>
19311 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
19313 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
19314 success and added `out object value'. Use a `bool resolved' field
19315 to check whether we've already been called rather than
19316 `ConstantValue != null' since this breaks for NullLiterals.
19318 2004-04-28 Raja R Harinath <rharinath@novell.com>
19320 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
19321 setting of this flag, since the 'set' method may be non-public.
19323 2004-04-28 Raja R Harinath <rharinath@novell.com>
19325 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
19326 check on current_vector.Block.
19328 2004-04-27 Martin Baulig <martin@ximian.com>
19330 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
19331 a field initializer. Fixes #56459.
19333 2004-04-27 Martin Baulig <martin@ximian.com>
19335 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
19336 we're not attempting to use an indexer. Fixes #52154.
19338 2004-04-27 Martin Baulig <martin@ximian.com>
19340 * statement.cs (Return): Don't create a return label if we don't
19341 need it; reverts my change from January 20th. Thanks to Ben
19344 2004-04-27 Martin Baulig <martin@ximian.com>
19346 According to the spec, `goto' can only leave a nested scope, but
19349 * statement.cs (Block.LookupLabel): Only lookup in the current
19350 block, don't recurse into parent or child blocks.
19351 (Block.AddLabel): Check in parent and child blocks, report
19352 CS0140/CS0158 if we find a duplicate.
19353 (Block): Removed this indexer for label lookups.
19354 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
19355 this already does the error reporting for us.
19358 (FlowBranching.UsageVector.Block): New public variable; may be null.
19359 (FlowBranching.CreateSibling): Added `Block' argument.
19360 (FlowBranching.LookupLabel): New public virtual method. Lookup a
19361 label for the target of a `goto' and check whether we're not
19362 leaving a `finally'.
19364 2004-04-27 Martin Baulig <martin@ximian.com>
19366 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
19367 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
19370 2004-04-27 Martin Baulig <martin@ximian.com>
19372 * statement.cs (Block.AddLabel): Also check for implicit blocks
19373 and added a CS0158 check.
19375 2004-04-27 Martin Baulig <martin@ximian.com>
19377 * flowanalysis.cs (FlowBranchingLoop): New class.
19378 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
19379 UsageVector's instead of an ArrayList.
19380 (FlowBranching.Label): Likewise.
19381 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
19382 (FlowBranching.AddBreakVector): New method.
19384 2004-04-27 Miguel de Icaza <miguel@ximian.com>
19386 * attribute.cs: Small regression fix: only convert the type if we
19387 the type is different, fixes System.Drawing build.
19389 2004-04-27 Martin Baulig <martin@ximian.com>
19391 * attribute.cs (Attribute.Resolve): If we have a constant value
19392 for a named field or property, implicity convert it to the correct
19395 2004-04-27 Raja R Harinath <rharinath@novell.com>
19397 * statement.cs (Block.Block): Implicit blocks share
19398 'child_variable_names' fields with parent blocks.
19399 (Block.AddChildVariableNames): Remove.
19400 (Block.AddVariable): Mark variable as "used by a child block" in
19401 every surrounding block.
19402 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
19403 been used in a child block, complain about violation of "Invariant
19404 meaning in blocks" rule.
19405 * cs-parser.jay (declare_local_variables): Don't use
19406 AddChildVariableNames.
19407 (foreach_statement): Don't create an implicit block: 'foreach'
19408 introduces a scope.
19410 2004-04-23 Miguel de Icaza <miguel@ximian.com>
19412 * convert.cs (ImplicitNumericConversion): 0 is also positive when
19413 converting from 0L to ulong. Fixes 57522.
19415 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19417 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
19418 derived class hides via 'new' keyword field from base class (test-242.cs).
19419 TODO: Handle this in the more general way.
19421 * class.cs (CheckBase): Ditto.
19423 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19425 * decl.cs (caching_flags): New member for storing cached values
19427 (MemberCore.Flags): New enum where bit flags for caching_flags
19429 (MemberCore.cls_compliance): Moved to caching_flags.
19430 (DeclSpace.Created): Moved to caching_flags.
19432 * class.cs: Use caching_flags instead of DeclSpace.Created
19434 2004-04-21 Miguel de Icaza <miguel@ximian.com>
19436 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
19437 if we are only a derived class, not a nested class.
19439 * typemanager.cs: Same as above, but do this at the MemberLookup
19440 level (used by field and methods, properties are handled in
19441 PropertyExpr). Allow for the qualified access if we are a nested
19444 2004-04-21 Marek Safar <marek.safar@seznam.cz>
19446 * class.cs: Refactoring.
19447 (IMethodData): New inteface; Holds links to parent members
19448 to avoid member duplication (reduced memory allocation).
19449 (Method): Implemented IMethodData interface.
19450 (PropertyBase): New inner classes for get/set methods.
19451 (PropertyBase.PropertyMethod): Implemented IMethodData interface
19452 (Event): New inner classes for add/remove methods.
19453 (Event.DelegateMethod): Implemented IMethodData interface.
19455 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
19456 EmitContext (related to class.cs refactoring).
19458 2004-04-21 Raja R Harinath <rharinath@novell.com>
19460 * delegate.cs (Delegate.VerifyApplicability): If the number of
19461 arguments are the same as the number of parameters, first try to
19462 verify applicability ignoring any 'params' modifier on the last
19466 2004-04-16 Raja R Harinath <rharinath@novell.com>
19468 * class.cs (TypeContainer.AddIndexer): Use
19469 'ExplicitInterfaceName' to determine if interface name was
19470 explicitly specified. 'InterfaceType' is not initialized at this time.
19471 (TypeContainer.DefineIndexers): Remove use of temporary list. The
19472 Indexers array is already in the required order. Initialize
19473 'IndexerName' only if there are normal indexers.
19474 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
19475 (TypeContainer.Emit): Emit DefaultMember attribute only if
19476 IndexerName is initialized.
19479 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
19481 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
19484 2004-04-15 Raja R Harinath <rharinath@novell.com>
19486 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
19490 * attribute.cs (Attribute.Resolve): Check for duplicate named
19494 2004-04-15 Miguel de Icaza <miguel@ximian.com>
19496 * iterators.cs (MarkYield): track whether we are in an exception,
19497 and generate code accordingly. Use a temporary value to store the
19498 result for our state.
19500 I had ignored a bit the interaction of try/catch with iterators
19501 since their behavior was not entirely obvious, but now it is
19502 possible to verify that our behavior is the same as MS .NET 2.0
19506 2004-04-14 Miguel de Icaza <miguel@ximian.com>
19508 * iterators.cs: Avoid creating temporaries if there is no work to
19511 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
19512 Enumerations, use TypeManager.EnumToUnderlying and call
19515 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
19518 (This.Emit): Use EmitContext.EmitThis to emit our
19521 (This.EmitAssign): Ditto.
19523 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
19524 codepaths, we will move all the functionality into
19527 (FieldExpr.EmitAssign): Ditto.
19529 This fixes several hidden bugs that I uncovered while doing a code
19530 review of this today.
19532 * codegen.cs (EmitThis): reworked so the semantics are more clear
19533 and also support value types "this" instances.
19535 * iterators.cs: Changed so that for iterators in value types, we
19536 do not pass the value type as a parameter.
19538 Initialization of the enumerator helpers is now done in the caller
19539 instead of passing the parameters to the constructors and having
19540 the constructor set the fields.
19542 The fields have now `assembly' visibility instead of private.
19544 2004-04-11 Miguel de Icaza <miguel@ximian.com>
19546 * expression.cs (Argument.Resolve): Check if fields passed as ref
19547 or out are contained in a MarshalByRefObject.
19549 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
19550 another compiler type.
19552 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
19554 * class.cs (Indexer.Define): use the new name checking method.
19555 Also, return false on an error.
19556 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
19557 (is_identifier_[start/part]_character): make static.
19559 2004-04-10 Miguel de Icaza <miguel@ximian.com>
19561 * expression.cs (Binary.ResolveOperator): Do no append strings
19562 twice: since we can be invoked more than once (array evaluation)
19563 on the same concatenation, take care of this here. Based on a fix
19564 from Ben (bug #56454)
19566 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
19568 * codegen.cs: Fix another case where CS1548 must be reported (when
19569 delay-sign isn't specified and no private is available #56564). Fix
19570 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
19571 error when MCS is used on the MS runtime and we need to delay-sign
19572 (which seems unsupported by AssemblyBuilder - see #56621).
19574 2004-04-08 Marek Safar <marek.safar@seznam.cz>
19576 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
19577 (TypeManager.ComputeNamespaces): Faster implementation for
19580 * compiler.csproj: Updated AssemblyName to mcs.
19582 2004-04-07 Miguel de Icaza <miguel@ximian.com>
19584 * rootcontext.cs: Add new types to the boot resolution.
19586 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
19587 MulticastDelegate is not allowed.
19589 * typemanager.cs: Add new types to lookup: System.TypedReference
19592 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
19593 check for TypedReference or ArgIterator, they are not allowed.
19595 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
19596 makes us properly catch 1510 in some conditions (see bug 56016 for
19599 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
19601 * CryptoConvert.cs: update from corlib version
19604 2004-04-05 Miguel de Icaza <miguel@ximian.com>
19606 * class.cs (Indexer.Define): Check indexername declaration
19608 2004-04-05 Marek Safar <marek.safar@seznam.cz>
19610 * attribute.cs (IsClsCompliant): Fixed problem with handling
19611 all three states (compliant, not-compliant, undetected).
19613 2004-03-30 Marek Safar <marek.safar@seznam.cz>
19615 * attribute.cs (Attribute): Location is now public.
19616 (Resolve): Store resolved arguments (pos_values) in attribute class.
19617 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
19618 (GetClsCompliantAttributeValue): New method that gets
19619 CLSCompliantAttribute value.
19620 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
19621 if exists else null.
19622 (AttributeTester): New class for CLS-Compliant verification routines.
19624 * class.cs (Emit): Add CLS-Compliant verification.
19625 (Method.GetSignatureForError): Implemented.
19626 (Constructor.GetSignatureForError): Implemented
19627 (Constructor.HasCompliantArgs): Returns if constructor has
19628 CLS-Compliant arguments.
19629 (Constructor.Emit): Override.
19630 (Construcor.IsIdentifierClsCompliant): New method; For constructors
19631 is needed to test only parameters.
19632 (FieldBase.GetSignatureForError): Implemented.
19633 (TypeContainer): New member for storing base interfaces.
19634 (TypeContainer.FindMembers): Search in base interfaces too.
19636 * codegen.cs (GetClsComplianceAttribute): New method that gets
19637 assembly or module CLSCompliantAttribute value.
19638 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
19640 (ModuleClass.Emit): Add error 3012 test.
19642 * const.cs (Emit): Override and call base for CLS-Compliant tests.
19644 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
19645 state for all decl types.
19646 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
19647 if CLS-Compliant tests are required.
19648 (IsClsCompliaceRequired): New method. Analyze whether code
19649 must be CLS-Compliant.
19650 (IsExposedFromAssembly): New method. Returns true when MemberCore
19651 is exposed from assembly.
19652 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
19653 value or gets cached value.
19654 (HasClsCompliantAttribute): New method. Returns true if MemberCore
19655 is explicitly marked with CLSCompliantAttribute.
19656 (IsIdentifierClsCompliant): New abstract method. This method is
19657 used to testing error 3005.
19658 (IsIdentifierAndParamClsCompliant): New method. Common helper method
19659 for identifier and parameters CLS-Compliant testing.
19660 (VerifyClsCompliance): New method. The main virtual method for
19661 CLS-Compliant verifications.
19662 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
19663 null. I don't know why is null (too many public members !).
19664 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
19665 and get value of first CLSCompliantAttribute that found.
19667 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
19668 (VerifyClsCompliance): Override and add extra tests.
19670 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
19671 clscheck- disable CLS-Compliant verification event if assembly is has
19672 CLSCompliantAttribute(true).
19674 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
19675 ApllyAttribute is now called in emit section as in the other cases.
19676 Possible future Emit integration.
19677 (IsIdentifierClsCompliant): New override.
19678 (VerifyClsCompliance): New override.
19679 (GetEnumeratorName): Returns full enum name.
19681 * parameter.cs (GetSignatureForError): Implemented.
19683 * report.cs (WarningData): New struct for Warning message information.
19684 (LocationOfPreviousError): New method.
19685 (Warning): New method. Reports warning based on the warning table.
19686 (Error_T): New method. Reports error based on the error table.
19688 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
19689 verifications are done here.
19691 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
19693 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
19694 CLSCompliantAttribute.
19695 (all_imported_types): New member holds all imported types from other
19697 (LoadAllImportedTypes): New method fills static table with exported types
19698 from all referenced assemblies.
19699 (Modules): New property returns all assembly modules.
19701 2004-03-30 Miguel de Icaza <miguel@ximian.com>
19703 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
19704 throwing a parser error.
19706 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
19707 which removes the hardcoded get_/set_ prefixes for properties, as
19708 IL allows for the properties to be named something else.
19712 * expression.cs: Do not override operand before we know if it is
19713 non-null. Fix 56207
19715 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19717 * typemanager.cs: support for pinned variables.
19719 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19721 * decl.cs, typemanager.cs: Avoid using an arraylist
19722 as a buffer if there is only one result set.
19724 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19726 * expression.cs: Make sure you cant call a static method
19727 with an instance expression, bug #56174.
19729 2004-03-29 Miguel de Icaza <miguel@ximian.com>
19731 * class.cs (IsDuplicateImplementation): Improve error reporting to
19732 flag 663 (method only differs in parameter modifier).
19734 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
19735 in preprocessor directives.
19737 * location.cs (LookupFile): Allow for the empty path.
19739 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
19740 better approach for some of that patch, but its failing with the
19741 CharSet enumeration. For now try/catch will do.
19743 * typemanager.cs: Do not crash if a struct does not have fields.
19746 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19748 * expression.cs: cs0213, cant fix a fixed expression.
19751 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19753 * cs-parser.jay: detect invalid embeded statements gracefully.
19756 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19758 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
19761 the invocation type may not be a subclass of the tye of the item/
19762 The type of the item must be a subclass of the invocation item.
19767 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
19769 * attribute.cs: Added methods to get a string and a bool from an
19770 attribute. Required to information from AssemblyKeyFileAttribute,
19771 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
19772 * codegen.cs: Modified AssemblyName creation to include support for
19773 strongnames. Catch additional exceptions to report them as CS1548.
19774 * compiler.csproj: Updated include CryptoConvert.cs.
19775 * compiler.csproj.user: Removed file - user specific configuration.
19776 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
19777 Mono.Security assembly. The original class is maintained and tested in
19778 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
19779 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
19780 like CSC 8.0 (C# v2) supports.
19781 * Makefile: Added CryptoConvert.cs to mcs sources.
19782 * rootcontext.cs: Added new options for strongnames.
19784 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
19786 * driver.cs: For --expect-error, report error code `2'
19787 if the program compiled with no errors, error code `1' if
19788 it compiled with an error other than the one expected.
19790 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
19792 * compiler.csproj: Updated for Visual Studio .NET 2003.
19793 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
19794 * compiler.sln: Updated for Visual Studio .NET 2003.
19796 2004-03-24 Ravi Pratap M <ravi@ximian.com>
19798 * expression.cs: Fix bug #47234. We basically need to apply the
19799 rule that we prefer the conversion of null to a reference type
19800 when faced with a conversion to 'object' (csc behaviour).
19802 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19804 * statement.cs: Shorter form for foreach, eliminates
19805 a local variable. r=Martin.
19807 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19809 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
19810 checks if we can use brtrue/brfalse to test for 0.
19811 * expression.cs: use the above in the test for using brtrue/brfalse.
19812 cleanup code a bit.
19814 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19816 * expression.cs: Rewrite string concat stuff. Benefits:
19818 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
19819 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
19820 rather than a concat chain.
19822 * typemanager.cs: Add lookups for more concat overloads.
19824 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19826 * expression.cs: Emit shorter il code for array init.
19843 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
19845 * statement.cs: Before, two switch blocks would be merged if the
19846 total size of the blocks (end_item - begin_item + 1) was less than
19847 two times the combined sizes of the blocks.
19849 Now, it will only merge if after the merge at least half of the
19854 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
19856 * class.cs : csc build fix for GetMethods(). See bug #52503.
19858 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
19860 * expression.cs: Make sure fp comparisons work with NaN.
19861 This fixes bug #54303. Mig approved this patch a long
19862 time ago, but we were not able to test b/c the runtime
19865 2004-03-19 Miguel de Icaza <miguel@ximian.com>
19867 * ecore.cs (TypExpr.GetHashCode): implement this overload.
19869 2004-03-19 Martin Baulig <martin@ximian.com>
19871 * class.cs (MemberCore.IsDuplicateImplementation): Report the
19872 error here and not in our caller.
19874 2004-03-19 Martin Baulig <martin@ximian.com>
19876 * interface.cs: Completely killed this file.
19877 (Interface): We're now a TypeContainer and live in class.cs.
19879 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
19880 argument; we're now also called for interfaces.
19881 (TypeContainer.DefineMembers): Allow this method being called
19883 (TypeContainer.GetMethods): New public method; formerly known as
19884 Interface.GetMethod(). This is used by PendingImplementation.
19885 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
19886 it's now private and non-static.
19887 (Interface): Moved this here; it's now implemented similar to
19889 (Method, Property, Event, Indexer): Added `bool is_interface'
19890 argument to their .ctor's.
19891 (MemberBase.IsInterface): New public field.
19893 * cs-parser.jay: Create normal Method, Property, Event, Indexer
19894 instances instead of InterfaceMethod, InterfaceProperty, etc.
19895 (opt_interface_base): Removed; we now use `opt_class_base' instead.
19896 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
19898 2004-03-19 Martin Baulig <martin@ximian.com>
19900 * class.cs (MethodCore.IsDuplicateImplementation): New private
19901 method which does the CS0111 checking.
19902 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
19903 Use IsDuplicateImplementation().
19905 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
19907 * decl.cs (FindMemberToOverride): New method to find the correct
19908 method or property to override in the base class.
19910 - Make Method/Property use the above method to find the
19911 version in the base class.
19912 - Remove the InheritableMemberSignatureCompare as it is now
19915 This patch makes large code bases much faster to compile, as it is
19916 O(n) rather than O(n^2) to do this validation.
19918 Also, it fixes bug 52458 which is that nested classes are not
19919 taken into account when finding the base class member.
19921 Reviewed/Approved by Martin.
19923 2004-03-17 Marek Safar <marek.safar@seznam.cz>
19925 * interface.cs: In all interface classes removed redundant
19926 member initialization.
19928 2004-03-16 Martin Baulig <martin@ximian.com>
19930 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
19932 2004-03-15 Miguel de Icaza <miguel@ximian.com>
19934 * decl.cs (DefineTypeAndParents): New helper method to define a
19935 type's containers before the type itself is defined; This is a
19936 bug exposed by the recent changes to Windows.Forms when an
19937 implemented interface was defined inside a class that had not been
19940 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
19942 (Check): Loop correctly to report errors modifiers
19943 (UNSAFE was not in the loop, since it was the same as TOP).
19945 * interface.cs: Every interface member now takes a ModFlags,
19946 instead of a "is_new" bool, which we set on the base MemberCore.
19948 Every place where we called "UnsafeOk" in the interface, now we
19949 call the proper member (InterfaceMethod.UnsafeOK) instead to get
19950 the unsafe settings from the member declaration instead of the
19951 container interface.
19953 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
19955 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
19956 `set_indexer_name' to the pending bits (one per type).
19958 We fixed a bug today that was picking the wrong method to
19959 override, since for properties the existing InterfaceMethod code
19960 basically ignored the method name. Now we make sure that the
19961 method name is one of the valid indexer names.
19963 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
19965 * support.cs (SeekableStreamReader): Keep track of stream byte
19966 positions and don't mix them with character offsets to the buffer.
19968 Patch from Gustavo Giráldez
19970 2004-03-15 Marek Safar <marek.safar@seznam.cz>
19972 * interface.cs (InterfaceSetGetBase): Removed double member
19973 initialization, base class does it as well.
19975 2004-03-13 Martin Baulig <martin@ximian.com>
19977 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
19978 when compiling corlib.
19980 2004-03-13 Miguel de Icaza <miguel@ximian.com>
19982 * convert.cs (ExplicitConversion): We were reporting an error on
19983 certain conversions (object_type source to a value type, when the
19984 expression was `null') before we had a chance to pass it through
19985 the user defined conversions.
19987 * driver.cs: Replace / and \ in resource specifications to dots.
19990 * class.cs: Add check for duplicate operators. Fixes 52477
19992 2004-03-11 Miguel de Icaza <miguel@ximian.com>
19994 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
19995 that are in the middle of the statements, not only at the end.
19998 * class.cs (TypeContainer.AddField): No longer set the
19999 `HaveStaticConstructor' flag, now we call it
20000 `UserDefineStaticConstructor' to diferentiate the slightly
20001 semantic difference.
20003 The situation is that we were not adding BeforeFieldInit (from
20004 Modifiers.TypeAttr) to classes that could have it.
20005 BeforeFieldInit should be set to classes that have no static
20010 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
20012 And most importantly Zoltan's comment:
20014 http://bugzilla.ximian.com/show_bug.cgi?id=44229
20016 "I think beforefieldinit means 'it's ok to initialize the type sometime
20017 before its static fields are used', i.e. initialization does not need
20018 to be triggered by the first access to the type. Setting this flag
20019 helps the JIT to compile better code, since it can run the static
20020 constructor at JIT time, and does not need to generate code to call it
20021 (possibly lots of times) at runtime. Unfortunately, mcs does not set
20022 this flag for lots of classes like String.
20024 csc sets this flag if the type does not have an explicit static
20025 constructor. The reasoning seems to be that if there are only static
20026 initalizers for a type, and no static constructor, then the programmer
20027 does not care when this initialization happens, so beforefieldinit
20030 This bug prevents the AOT compiler from being usable, since it
20031 generates so many calls to mono_runtime_class_init that the AOT code
20032 is much slower than the JITted code. The JITted code is faster,
20033 because it does not generate these calls if the vtable is type is
20034 already initialized, which is true in the majority of cases. But the
20035 AOT compiler can't do this."
20037 2004-03-10 Miguel de Icaza <miguel@ximian.com>
20039 * class.cs (MethodData.Emit): Refactor the code so symbolic
20040 information is generated for destructors; For some reasons we
20041 were taking a code path that did not generate symbolic information
20044 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
20046 * class.cs: Create a Constructor.CheckBase method that
20047 takes care of all validation type code. The method
20048 contains some code that was moved from Define.
20050 It also includes new code that checks for duplicate ctors.
20051 This fixes bug #55148.
20053 2004-03-09 Joshua Tauberer <tauberer@for.net>
20055 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
20056 a { ... }-style array creation invokes EmitStaticInitializers
20057 which is not good for reference-type arrays. String, decimal
20058 and now null constants (NullCast) are not counted toward
20059 static initializers.
20061 2004-03-05 Martin Baulig <martin@ximian.com>
20063 * location.cs (SourceFile.HasLineDirective): New public field;
20064 specifies whether the file contains or is referenced by a "#line"
20066 (Location.DefineSymbolDocuments): Ignore source files which
20067 either contain or are referenced by a "#line" directive.
20069 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
20071 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
20072 direct access to our parent, so check the method inline there.
20074 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
20076 * expression.cs (Invocation.EmitCall): Miguel's last commit
20077 caused a regression. If you had:
20082 In Foo the implict this would be null.
20084 2004-02-27 Miguel de Icaza <miguel@ximian.com>
20086 * expression.cs (Invocation.EmitCall): If the method is not
20087 virtual, do not emit a CallVirt to it, use Call.
20089 * typemanager.cs (GetFullNameSignature): Improve the method to
20090 cope with ".ctor" and replace it with the type name.
20092 * class.cs (ConstructorInitializer.Resolve): Now the method takes
20093 as an argument the ConstructorBuilder where it is being defined,
20094 to catch the recursive constructor invocations.
20096 2004-02-26 Miguel de Icaza <miguel@ximian.com>
20098 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
20099 routines to check if a type is an enumerable/enumerator allow
20100 classes that implement the IEnumerable or IEnumerator interfaces.
20102 * class.cs (Property, Operator): Implement IIteratorContainer, and
20103 implement SetYields.
20105 (Property.Define): Do the block swapping for get_methods in the
20106 context of iterators. We need to check if Properties also
20107 include indexers or not.
20109 (Operator): Assign the Block before invoking the
20110 OperatorMethod.Define, so we can trigger the Iterator code
20113 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
20114 Property and Operator classes are not created when we parse the
20115 declarator but until we have the block completed, so we use a
20116 singleton SimpleIteratorContainer.Simple to flag whether the
20117 SetYields has been invoked.
20119 We propagate this setting then to the Property or the Operator to
20120 allow the `yield' to function.
20122 2004-02-25 Marek Safar <marek.safar@seznam.cz>
20124 * codegen.cs: Implemented attribute support for modules.
20125 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
20126 Assembly/Module functionality.
20128 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
20129 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
20130 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
20132 2004-02-16 Marek Safar <marek.safar@seznam.cz>
20134 * interface.cs (FindMembers): The operation is performed on all base
20135 interfaces and not only on the first. It is required for future CLS Compliance patch.
20137 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
20139 * statement.cs, codegen.cs:
20140 This patch deals with patterns such as:
20142 public class List : IEnumerable {
20144 public MyEnumerator GetEnumerator () {
20145 return new MyEnumerator(this);
20148 IEnumerator IEnumerable.GetEnumerator () {
20152 public struct MyEnumerator : IEnumerator {
20157 Before, there were a few things we did wrong:
20158 1) we would emit callvirt on a struct, which is illegal
20159 2) we emited ldarg when we needed to emit ldarga
20160 3) we would mistakenly call the interface methods on an enumerator
20161 type that derived from IEnumerator and was in another assembly. For example:
20163 public class MyEnumerator : IEnumerator
20165 Would have the interface methods called, even if there were public impls of the
20166 method. In a struct, this lead to invalid IL code.
20168 2004-02-11 Marek Safar <marek.safar@seznam.cz>
20170 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
20173 * delegate.cs (Define): Fixed crash when delegate type is undefined.
20175 2004-02-11 Miguel de Icaza <miguel@ximian.com>
20177 * cs-parser.jay: Fix small regression: we were not testing V2
20178 compiler features correctly.
20180 * interface.cs: If the emit context is null, then create one
20182 2004-02-09 Marek Safar <marek.safar@seznam.cz>
20184 * decl.cs (GetSignatureForError): New virtual method to get full name
20185 for error messages.
20187 * attribute.cs (IAttributeSupport): New interface for attribute setting.
20188 Now it is possible to rewrite ApplyAttributes method to be less if/else.
20190 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
20191 Duplicated members and code in these classes has been removed.
20192 Better encapsulation in these classes.
20194 2004-02-07 Miguel de Icaza <miguel@ximian.com>
20196 * assign.cs (Assign.DoResolve): When dealing with compound
20197 assignments, there is a new rule in ECMA C# 2.4 (might have been
20198 there before, but it is documented here) that states that in:
20202 If b is of type int, and the `op' is a shift-operator, then the
20203 above is evaluated as:
20207 * expression.cs (Binary.ResolveOperator): Instead of testing for
20208 int/uint/long/ulong, try to implicitly convert to any of those
20209 types and use that in pointer arithmetic.
20211 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
20212 method to print information for from the type, not from the
20213 null-method we were given.
20215 2004-02-01 Duncan Mak <duncan@ximian.com>
20217 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
20218 parsing for cmd, fixes bug #53694.
20220 2004-02-04 Marek Safar <marek.safar@seznam.cz>
20222 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
20223 in the member name duplication tests. Property and operator name duplication
20224 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
20226 2004-02-03 Marek Safar <marek.safar@seznam.cz>
20228 * interface.cs (PopulateMethod): Fixed crash when interface method
20229 returns not existing type (error test cs0246-3.cs).
20231 2004-02-02 Ravi Pratap M <ravi@ximian.com>
20233 * cs-parser.jay (interface_accessors): Re-write actions to also
20234 store attributes attached to get and set methods. Fix spelling
20237 (inteface_property_declaration): Modify accordingly.
20239 (InterfaceAccessorInfo): New helper class to store information to pass
20240 around between rules that use interface_accessors.
20242 * interface.cs (Emit): Apply attributes on the get and set
20243 accessors of properties and indexers too.
20245 * attribute.cs (ApplyAttributes): Modify accordingly to use the
20246 right MethodBuilder when applying attributes to the get and set accessors.
20248 2004-01-31 Miguel de Icaza <miguel@ximian.com>
20250 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
20252 2004-01-26 Miguel de Icaza <miguel@ximian.com>
20254 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
20256 2004-01-25 Miguel de Icaza <miguel@ximian.com>
20258 * cs-parser.jay: Remove YIELD token, instead use the new grammar
20259 changes that treat `yield' specially when present before `break'
20260 or `return' tokens.
20262 * cs-tokenizer.cs: yield is no longer a keyword.
20264 2004-01-23 Marek Safar <marek.safar@seznam.cz>
20266 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
20267 setting for default constructors.
20268 For default constructors are almost every time set wrong Modifier. The
20269 generated IL code has been alright. But inside mcs this values was
20270 wrong and this was reason why several of my CLS Compliance tests
20273 2004-01-22 Martin Baulig <martin@ximian.com>
20275 * cs-parser.jay (namespace_or_type_name): Return an Expression,
20276 not a QualifiedIdentifier. This is what `type_name_expression'
20277 was previously doing.
20278 (type_name_expression): Removed; the code is now in
20279 `namespace_or_type_name'.
20280 (qualified_identifier): Removed, use `namespace_or_type_name'
20282 (QualifiedIdentifier): Removed this class.
20284 2004-01-22 Martin Baulig <martin@ximian.com>
20286 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
20287 not a string as alias name.
20289 2004-01-21 Miguel de Icaza <miguel@ximian.com>
20291 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
20292 #52730 bug, and instead compute correctly the need to use a
20293 temporary variable when requesting an address based on the
20294 static/instace modified of the field and the constructor.
20296 2004-01-21 Martin Baulig <martin@ximian.com>
20298 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
20299 class and namespace before looking up aliases. Fixes #52517.
20301 2004-01-21 Martin Baulig <martin@ximian.com>
20303 * flowanalysis.cs (UsageVector.Merge): Allow variables being
20304 assinged in a 'try'; fixes exception4.cs.
20306 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20307 * class.cs : Implemented parameter-less constructor for TypeContainer
20309 * decl.cs: Attributes are now stored here. New property OptAttributes
20311 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
20313 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
20315 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20317 * typemanager.cs (CSharpSignature): Now reports also inner class name.
20318 (CSharpSignature): New method for indexer and property signature.
20320 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20322 * pending.cs (IsVirtualFilter): Faster implementation.
20324 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20326 * typemanager.cs: Avoid inclusion of same assembly more than once.
20328 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20330 * cs-parser.jay: Fixed problem where the last assembly attribute
20331 has been applied also to following declaration (class, struct, etc.)
20333 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20335 * class.cs: Added error CS0538, CS0539 reporting.
20336 Fixed crash on Microsoft runtime when field type is void.
20338 * cs-parser.jay: Added error CS0537 reporting.
20340 * pending.cs: Added error CS0535 reporting.
20341 Improved error report for errors CS0536, CS0534.
20343 2004-01-20 Miguel de Icaza <miguel@ximian.com>
20345 Merge a few bits from the Anonymous Method MCS tree.
20347 * statement.cs (ToplevelBlock): New class for toplevel methods,
20348 will hold anonymous methods, lifted variables.
20350 * cs-parser.jay: Create toplevel blocks for delegates and for
20351 regular blocks of code.
20353 2004-01-20 Martin Baulig <martin@ximian.com>
20355 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
20356 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
20357 and `NeedExplicitReturn'; added `IsLastStatement'.
20358 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
20359 have a `ReturnLabel' or we're not unreachable.
20361 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
20362 child's reachability; don't just override ours with it. Fixes
20363 #58058 (lluis's example).
20364 (FlowBranching): Added public InTryOrCatch(), InCatch(),
20365 InFinally(), InLoop(), InSwitch() and
20366 BreakCrossesTryCatchBoundary() methods.
20368 * statement.cs (Return): Do all error checking in Resolve().
20369 Unless we are the last statement in a top-level block, always
20370 create a return label and jump to it.
20371 (Break, Continue): Do all error checking in Resolve(); also make
20372 sure we aren't leaving a `finally'.
20373 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
20374 statement in a top-level block.
20375 (Block.Flags): Added `IsDestructor'.
20376 (Block.IsDestructor): New public property.
20378 2004-01-20 Martin Baulig <martin@ximian.com>
20380 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
20382 2004-01-20 Martin Baulig <martin@ximian.com>
20384 * statement.cs (Statement.ResolveUnreachable): New public method.
20385 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
20386 (Block.Resolve): Resolve unreachable statements.
20388 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20390 * expression.cs: We need to fix the case where we do
20391 not have a temp variable here.
20393 * assign.cs: Only expression compound assignments need
20394 temporary variables.
20396 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20398 * flowanalysis.cs: Reduce memory allocation in a few ways:
20399 - A block with no variables should not allocate a bit
20401 - A method with no out parameters does not need any tracking
20402 for assignment of the parameters, so we need not allocate
20405 public readonly Type[] VariableTypes;
20406 public readonly string[] VariableNames;
20407 Are redundant. The data is already stored in the variable
20408 map, so we need not allocate another array for it.
20409 - We need to add alot of checks for if (params | locals) == null
20410 due to the first two changes.
20412 2004-01-18 Miguel de Icaza <miguel@ximian.com>
20414 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
20415 implement IMemoryLocation, we store a copy on a local variable and
20416 take the address of it. Patch from Benjamin Jemlich
20418 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
20419 to use a special "type_name_expression" rule which reduces the
20420 number of "QualifiedIdentifier" classes created, and instead
20421 directly creates MemberAccess expressions.
20423 2004-01-17 Miguel de Icaza <miguel@ximian.com>
20425 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
20426 that fixes #52853. Null literal assignment to ValueType
20428 * class.cs (MethodData.Emit): Instead of checking the name of the
20429 method to determine if its a destructor, create a new derived
20430 class from Method called Destructor, and test for that.
20432 * cs-parser.jay: Create a Destructor object instead of a Method.
20434 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
20438 2004-01-16 Miguel de Icaza <miguel@ximian.com>
20440 * expression.cs (Binary.ResolveOperator): Perform an implicit
20441 conversion from MethodGroups to their delegate types on the
20442 Addition operation.
20444 * delegate.cs: Introduce a new class DelegateCreation that is the
20445 base class for `NewDelegate' and `ImplicitDelegateCreation',
20446 factor some code in here.
20448 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
20449 conversion from MethodGroups to compatible delegate types.
20451 * ecore.cs (Expression.Resolve): Do not flag error 654
20452 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
20453 we allow conversions from MethodGroups to delegate types now.
20455 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
20456 assignments in v2 either.
20458 2004-01-10 Miguel de Icaza <miguel@ximian.com>
20460 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
20461 static read-only fields in ctors.
20463 Applied patch from Benjamin Jemlich
20465 * expression.cs (UnaryMutator): Avoid leaking local variables.
20467 2004-01-09 Miguel de Icaza <miguel@ximian.com>
20469 * cs-tokenizer.cs (IsCastToken): Allow the various native types
20470 here to return true, as they can be used like this:
20472 (XXX) int.MEMBER ()
20474 Fixed 49836 and all the other dups
20476 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
20478 * driver.cs: Implement /win32res and /win32icon.
20480 2004-01-08 Miguel de Icaza <miguel@ximian.com>
20482 * cs-parser.jay: Add a rule to improve error handling for the
20483 common mistake of placing modifiers after the type.
20485 2004-01-07 Miguel de Icaza <miguel@ximian.com>
20487 * cs-parser.jay (interface_event_declaration): Catch
20488 initialization of events on interfaces, and report cs0068
20490 * cs-parser.jay (interface_event_declaration): Catch
20491 initialization of events.
20493 * ecore.cs: Better report missing constructors.
20495 * expression.cs (Binary.ResolveOperator): My previous bug fix had
20496 the error reporting done in the wrong place. Fix.
20498 * expression.cs (Binary.ResolveOperator): Catch the
20499 operator + (E x, E y) error earlier, and later allow for implicit
20500 conversions in operator +/- (E e, U x) from U to the underlying
20503 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
20504 52596, if the container class is abstract, the default constructor
20505 is protected otherwise its public (before, we were always public).
20507 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
20510 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
20511 Jemlich that fixes bug #52597, MCS was generating invalid code for
20512 idisposable structs. Thanks to Ben for following up with this
20515 2004-01-06 Miguel de Icaza <miguel@ximian.com>
20517 * driver.cs: Allow assemblies without code to be generated, fixes
20520 2004-01-07 Nick Drochak <ndrochak@gol.com>
20522 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
20524 2004-01-05 Miguel de Icaza <miguel@ximian.com>
20526 * cs-parser.jay: Add rules to improve error reporting if fields or
20527 methods are declared at the namespace level (error 116)
20529 * Add rules to catch event add/remove
20531 2004-01-04 David Sheldon <dave-mono@earth.li>
20533 * expression.cs: Added matching ")" to error message for
20536 2004-01-03 Todd Berman <tberman@gentoo.org>
20538 * ecore.cs, attribute.cs:
20539 Applying fix from #52429.
20541 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20543 * ecore.cs, expression.cs, statement.cs:
20544 Total rewrite of how we handle branching. We
20545 now handle complex boolean expressions with fewer
20546 jumps. As well if (x == 0) no longer emits a ceq.
20548 if (x is Foo) is much faster now, because we generate
20551 Overall, we get a pretty big improvement on our benchmark
20552 tests. The code we generate is smaller and more readable.
20554 I did a full two-stage bootstrap. The patch was reviewed
20555 by Martin and Miguel.
20557 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20559 * cs-parser.jay: Make primary_expression not take a QI.
20560 we dont need this because the member_access rule covers
20561 us here. So we replace the rule with just IDENTIFIER.
20563 This has two good effects. First, we remove a s/r conflict.
20564 Second, we allocate many fewer QualifiedIdentifier objects.
20566 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20568 * attribute.cs: Handle MarshalAs attributes as pseudo, and
20569 set the correct information via SRE. This prevents
20570 hanging on the MS runtime. Fixes #29374.
20572 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20574 * convert.cs: correctly handle conversions to value types
20575 from Enum and ValueType as unboxing conversions.
20577 Fixes bug #52569. Patch by Benjamin Jemlich.
20579 2004-01-02 Ravi Pratap <ravi@ximian.com>
20581 * expression.cs (BetterConversion): Prefer int -> uint
20582 over int -> ulong (csc's behaviour). This fixed bug #52046.
20584 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
20586 * decl.cs (MemberCache.FindMembers): now returns a
20589 * typemanager.cs: In general, go with with ^^.
20590 (CopyNewMethods): take an IList.
20591 (RealMemberLookup): Only allocate an arraylist
20592 if we copy from two sets of methods.
20594 This change basically does two things:
20595 1) Fewer array lists allocated due to CopyNewMethods.
20596 2) the explicit cast in MemberList costed ALOT.
20598 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
20600 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
20601 a hashtable to avoid needless string allocations when an identifier is
20602 used more than once (the common case).
20604 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20606 * pending.cs: MS's TypeBuilder.GetInterfaces ()
20607 is broken, it will not return anything. So, we
20608 have to use the information we have in mcs to
20611 * typemanager.cs: Add a cache for GetInterfaces,
20612 since this will now be used more often (due to ^^)
20614 (GetExplicitInterfaces) New method that gets the
20615 declared, not effective, interfaces on a type
20616 builder (eg, if you have interface IFoo, interface
20617 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
20620 This patch makes MCS able to bootstrap itself on
20623 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20625 * expression.cs: Remove the Nop's that Miguel put
20628 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20630 * report.cs, codegen.cs: Give the real stack trace to
20631 the error when an exception is thrown.
20633 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20635 * decl.cs: only allocate hashtables for ifaces if
20638 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20640 * expression.cs: fix the error from cs0121-2.cs
20641 (a parent interface has two child interfaces that
20642 have a function with the same name and 0 params
20643 and the function is called through the parent).
20645 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
20647 * class.cs, rootcontext.cs, typmanager.cs: do not
20650 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
20652 * codegen.cs: remove stack for the ec flow branching.
20653 It is already a linked list, so no need.
20655 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
20657 * Makefile: Allow custom profiler here.
20659 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20661 * typemanager.cs (LookupType):
20662 - Use a static char [], because split takes
20663 a param array for args, so it was allocating
20665 - Do not store true in a hashtable, it boxes.
20667 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20669 * flowanalysis.cs: bytify common enums.
20671 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20673 * modifiers.cs: Add a new set of flags for the
20674 flags allowed on explicit interface impls.
20675 * cs-parser.jay: catch the use of modifiers in
20676 interfaces correctly.
20677 * class.cs: catch private void IFoo.Blah ().
20679 All related to bug #50572.
20681 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20683 * decl.cs: Rewrite the consistant accessability checking.
20684 Accessability is not linear, it must be implemented in
20685 a tableish way. Fixes #49704.
20687 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20689 * expression.cs: Handle negation in a checked context.
20690 We must use subtraction from zero. Fixes #38674.
20692 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20694 * class.cs: Ignore static void main in DLLs.
20695 * rootcontext.cs: Handle the target type here,
20696 since we are have to access it from class.cs
20697 * driver.cs: account for the above.
20699 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20701 * report.cs: Give line numbers and files if available.
20703 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
20705 * driver.cs: Implement /addmodule.
20707 * typemanager.cs: Change 'modules' field so it now contains Modules not
20710 2003-12-20 Martin Baulig <martin@ximian.com>
20712 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
20713 (FieldBase.IsAssigned): Removed this field.
20714 (FieldBase.SetAssigned): New public method.
20715 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
20717 2003-12-20 Martin Baulig <martin@ximian.com>
20719 * expression.cs (LocalVariableReference.DoResolve): Don't set
20720 `vi.Used' if we're called from DoResolveLValue().
20722 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
20723 returns the usage vector it just merged into the current one -
20724 pass this one to UsageWarning().
20725 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
20726 of the `EmitContext', don't call this recursively on our children.
20728 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
20730 * driver.cs: Implement /target:module.
20732 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
20734 * support.cs (CharArrayHashtable): New helper class.
20736 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
20737 char arrays, not strings, so we can avoid creating a string in
20738 consume_identifier if the identifier is a keyword.
20740 2003-12-16 Martin Baulig <martin@ximian.com>
20742 * statement.cs (LocalInfo.Assigned): Removed this property.
20743 (LocalInfo.Flags): Removed `Assigned'.
20744 (LocalInfo.IsAssigned): New public method; takes the EmitContext
20745 and uses flow analysis.
20746 (Block.UsageWarning): Made this method private.
20747 (Block.Resolve): Call UsageWarning() if appropriate.
20749 * expression.cs (LocalVariableReference.DoResolve): Always set
20750 LocalInfo.Used here.
20752 2003-12-13 Martin Baulig <martin@ximian.com>
20754 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
20755 any value here; we're now using flow analysis to figure out
20756 whether a statement/block returns a value.
20758 2003-12-13 Martin Baulig <martin@ximian.com>
20760 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
20762 (FlowBranching.MergeFinally): Don't call
20763 `branching.CheckOutParameters()' here, this is called in
20765 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
20766 when adding the `finally' vector.
20768 2003-12-13 Martin Baulig <martin@ximian.com>
20771 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
20772 actually work and also fix #48962.
20774 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
20776 * decl.cs: Do not check System.Object for nested types,
20777 since we know it does not have any. Big bang for buck:
20780 Run 1: 8.35 seconds
20781 Run 2: 8.32 seconds
20782 corlib: 17.99 seconds
20784 Run 1: 8.17 seconds
20785 Run 2: 8.17 seconds
20786 corlib: 17.39 seconds
20788 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
20790 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
20791 time we are returning 0 members, so we save alot here.
20793 2003-12-11 Martin Baulig <martin@ximian.com>
20795 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
20796 `MergeChild()', also just take the `FlowBranching' as argument;
20797 call Merge() on it and return the result.
20798 (FlowBranching.Merge): We don't need to do anything if we just
20801 2003-12-11 Martin Baulig <martin@ximian.com>
20803 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
20804 them in an `ArrayList' to reduce memory usage. Thanks to Ben
20805 Maurer for this idea.
20807 2003-12-11 Martin Baulig <martin@ximian.com>
20809 * flowanalysis.cs (MergeResult): This class is now gone; we now
20810 use the `UsageVector' for this. The reason for this is that if a
20811 branching just has one sibling, we don't need to "merge" them at
20812 all - that's the next step to do.
20813 (FlowBranching.Merge): We now return a `UsageVector' instead of a
20816 2003-12-11 Martin Baulig <martin@ximian.com>
20818 Reworked flow analyis and made it more precise and bug-free. The
20819 most important change is that we're now using a special `Reachability'
20820 class instead of having "magic" meanings of `FlowReturns'. I'll
20821 do some more cleanups and optimizations and also add some more
20822 documentation this week.
20824 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
20825 largely reworked this class.
20826 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
20827 the new `Reachability' class instead of having "magic" values here.
20828 (FlowBranching): We're now using an instance of `Reachability'
20829 instead of having separate `Returns', `Breaks' etc. fields.
20831 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
20832 based on flow analysis; ignore the return value of block.Emit ().
20834 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
20836 * driver.cs typemanager.cs: Find the mono extensions to corlib even
20837 if they are private.
20839 2003-12-09 Martin Baulig <martin@ximian.com>
20841 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
20842 call them directly on the UsageVector.
20844 2003-12-09 Martin Baulig <martin@ximian.com>
20846 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
20847 Changed return type from `FlowReturns' to `Reachability'.
20849 2003-12-09 Martin Baulig <martin@ximian.com>
20851 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
20852 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
20853 `Reachable' fields with a single `Reachability' one.
20855 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20857 * class.cs (FindMembers): Remove foreach's.
20862 Run 1: 8.74 seconds
20863 Run 2: 8.71 seconds
20866 Run 1: 8.64 seconds
20867 Run 2: 8.58 seconds
20870 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20875 This patch does a few things:
20876 1. EmptyStatement is now a singleton, so it is never reallocated.
20877 2. All blah is EmptyStatement constructs have been changed to
20878 blah == EmptyStatement.Value, which is much faster and valid
20879 now that EmptyStatement is a singleton.
20880 3. When resolving a block, rather than allocating a new array for
20881 the non-empty statements, empty statements are replaced with
20882 EmptyStatement.Value
20883 4. Some recursive functions have been made non-recursive.
20884 Mainly the performance impact is from (3), however (1) and (2) are needed for
20885 this to work. (4) does not make a big difference in normal situations, however
20886 it makes the profile look saner.
20891 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20892 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20893 Total memory allocated: 56397 KB
20896 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
20897 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
20898 Total memory allocated: 55666 KB
20900 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20902 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
20903 than the hashtable in a hashtable version
20905 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
20906 we always end up concating a string. This results in a huge perf
20907 loss, because many strings have to be tracked by the GC. In this
20908 patch, we first use a hashtable that works with two keys, so that
20909 the strings do not need to be concat'ed.
20913 Run 1: 8.74 seconds
20914 Run 2: 8.71 seconds
20917 Run 1: 8.65 seconds
20918 Run 2: 8.56 seconds
20920 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20922 * Makefile: Add a new target `do-time' that does a quick and simple
20923 profile, leaving easy to parse output.
20925 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
20927 * codegen.cs (Init): Create the dynamic assembly with
20928 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
20930 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
20932 * support.cs: Make the PtrHashtable use only one
20933 instance of its comparer.
20935 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
20937 * typemanager.cs: Fix lookup of GetNamespaces.
20939 2003-11-29 Miguel de Icaza <miguel@ximian.com>
20941 * expression.cs: Removed redundant line.
20943 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
20944 ArrayLists, use for loops with bounds.
20946 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
20949 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
20950 arraylists, use for loop with bounds.
20952 The above three changes give us a 0.071 second performance
20953 improvement out of 3.294 seconds down to 3.223. On my machine
20954 the above changes reduced the memory usage by 1,387 KB during
20955 compiler bootstrap.
20957 * cs-parser.jay (QualifiedIdentifier): New class used to represent
20958 QualifiedIdentifiers. Before we created a new string through
20959 concatenation, and mostly later on, the result would be
20960 manipulated by DecomposeQI through string manipulation.
20962 This reduced the compiler memory usage for bootstrapping from
20963 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
20964 compile times in 0.05 seconds.
20966 2003-11-28 Dick Porter <dick@ximian.com>
20968 * support.cs: Do string compares with the Invariant culture.
20976 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
20977 the comparison is done with the Invariant culture.
20979 2003-11-27 Miguel de Icaza <miguel@ximian.com>
20981 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
20982 GetEnumerator method.
20984 (ProbeCollectionType): Iterate starting at the most specific type
20985 upwards looking for a GetEnumerator
20987 * expression.cs: Shift count can be up to 31 for int/uint and 63
20990 2003-11-26 Miguel de Icaza <miguel@ximian.com>
20992 * statement.cs (Block.LookupLabel): Also look for the label on the
20993 children blocks. Use a hash table to keep track of visited
20996 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
20997 we actually did transform the other operand, otherwise fall back
20998 to the common codepath that casts to long.
21000 * cs-tokenizer.cs: Use the same code pattern as the int case.
21001 Maybe I should do the parsing myself, and avoid depending on the
21002 Parse routines to get this done.
21004 2003-11-25 Miguel de Icaza <miguel@ximian.com>
21006 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
21007 which fixes bug 51347. This time test it.
21009 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
21010 attributes for example can not tell the difference between these.
21011 The difference was only a syntax feature of the language.
21013 * attribute.cs: Apply attributes to delegates.
21015 * delegate.cs: Call the apply attributes method.
21017 2003-11-24 Miguel de Icaza <miguel@ximian.com>
21019 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
21020 comparing 0 vs Byte.MinValue, not the value
21022 (ImplicitConversionRequired): When reporting a conversion error,
21023 use error 31 to print out the constant error instead of the
21026 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
21027 which fixes bug 51347.
21029 2003-11-22 Miguel de Icaza <miguel@ximian.com>
21031 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
21032 which fixes the -warnaserror command line option.
21034 2003-11-21 Miguel de Icaza <miguel@ximian.com>
21036 * cfold.cs (DoNumericPromotions): During constant folding of
21037 additions on UIntConstant, special case intconstants with
21038 IntConstants like we do on the expression binary operator.
21040 2003-11-12 Miguel de Icaza <miguel@ximian.com>
21042 * convert.cs (ImplicitReferenceConversion): We were missing a case
21043 (System.Enum are not value types or class types, so we need to
21044 classify them separatedly).
21046 * driver.cs: We do not support error 2007.
21048 2003-11-12 Jackson Harper <jackson@ximian.com>
21050 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
21051 system directory. Also use the full file name so users can
21052 libraries names mscorlib-o-tron.dll in a non system dir.
21054 2003-11-10 Martin Baulig <martin@ximian.com>
21056 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
21057 (TypeManager.InitCoreTypes): Initialize them here, but instead of
21058 calling `ResolveType()' on them, directly assign their `Type'.
21060 2003-11-08 Martin Baulig <martin@ximian.com>
21062 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
21063 return value and the `out parent' parameter.
21064 (TypeContainer.DefineType): Moved the CS0644 check into
21065 GetClassBases(). Don't pass the interface types to the
21066 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
21067 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
21069 * ecore.cs (TypeExpr.IsAttribute): New property.
21070 (TypeExpr.GetInterfaces): New method.
21072 * interface.cs (Interface.GetInterfaceTypeByName): Return a
21073 TypeExpr instead of a Type.
21074 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
21075 (Interface.DefineType): Don't pass the interface types to the
21076 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
21077 them later and then call `TypeBulider.AddInterfaceImplementation()'.
21079 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
21080 instead of a `Type[]'.
21081 (TypeManager.RegisterBuilder): Likewise.
21082 (TypeManager.AddUserInterface): Likewise.
21083 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
21084 `Type[]' and also return a `TypeExpr[]'.
21085 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
21087 2003-11-08 Martin Baulig <martin@ximian.com>
21089 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
21092 2003-11-08 Martin Baulig <martin@ximian.com>
21094 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
21095 TypeManager.ResolveExpressionTypes().
21097 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
21098 instead of an Expression.
21099 (TypeExpr): This is now an abstract base class for `TypeExpression'.
21100 (TypeExpression): New public class; formerly known as `TypeExpr'.
21102 * expression.cs (ComposedCast): Derive from TypeExpr.
21104 * typemanager.cs (TypeManager.system_*_expr): These are now
21105 TypExpr's instead of Expression's.
21106 (TypeManager.ResolveExpressionTypes): New public static function;
21107 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
21110 2003-11-06 Miguel de Icaza <miguel@ximian.com>
21112 * expression.cs (New.DoResolve): Do not dereference value that
21113 might be a null return.
21115 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
21116 sure that the constant value has the right type. Fixes an
21117 unreported bug, similar to 50425.
21119 * const.cs (Const.LookupConstantValue): Call
21120 ImplicitStandardConversionExists before doing a conversion to
21121 avoid havng the TypeManager.ChangeType do conversions.
21123 Reduced the number of casts used
21125 (Const.ChangeType): New routine to enable reuse of the constant
21126 type changing code from statement.
21128 * typemanager.cs (ChangeType): Move common initialization to
21129 static global variables.
21133 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
21134 every value type to go through, even if it was void. Fix that.
21136 * cs-tokenizer.cs: Use is_identifier_start_character on the start
21137 character of the define, and the is_identifier_part_character for
21138 the rest of the string.
21140 2003-11-05 Miguel de Icaza <miguel@ximian.com>
21142 * expression.cs (UnaryMutator.EmitCode): When I updated
21143 LocalVariableReference.DoResolve, I overdid it, and dropped an
21144 optimization done on local variable references.
21146 2003-11-04 Miguel de Icaza <miguel@ximian.com>
21148 * ecore.cs: Convert the return from Ldlen into an int.
21150 2003-10-20 Miguel de Icaza <miguel@ximian.com>
21152 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
21153 the accessibility, this is a special case for toplevel non-public
21154 classes (internal for instance).
21156 2003-10-20 Nick Drochak <ndrochak@gol.com>
21158 * ecore.cs: Fix typo and build. Needed another right paren.
21160 2003-10-19 Miguel de Icaza <miguel@ximian.com>
21162 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
21163 `internal' case regular and protected, but not allowing protected
21164 to be evaluated later. Bug 49840
21166 2003-10-15 Miguel de Icaza <miguel@ximian.com>
21168 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
21169 to kb.Nlast, and not the kb.nFirst to isolate the switch
21172 Extract the underlying type, so enumerations of long/ulong are
21173 treated like long/ulong.
21175 2003-10-14 Miguel de Icaza <miguel@ximian.com>
21177 * expression.cs (New): Overload the meaning of RequestedType to
21178 track the possible creation of the NewDelegate type, since
21179 DoResolve is invoked more than once for new constructors on field
21182 See bugs: #48800 and #37014
21184 * cs-parser.jay (declare_local_constants): Take an arraylist
21185 instead of a single constant.
21187 (local_constant_declaration): It should take a
21188 constant_declarators, not a constant_declarator. Fixes 49487
21190 * convert.cs: Fix error report.
21192 2003-10-13 Jackson Harper <jackson@ximian.com>
21194 * typemanager.cs (TypeToCoreType): Add float and double this fixes
21197 2003-10-09 Martin Baulig <martin@ximian.com>
21199 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
21201 (MethodCore.DoDefineParameters): Removed the TypeContainer
21202 argument; use the DeclSpace which was passed to the .ctor instead.
21203 (MethodCore.CheckParameter): Take a DeclSpace instead of a
21204 TypeContainer; we only need a DeclSpace here.
21206 2003-10-09 Martin Baulig <martin@ximian.com>
21208 * class.cs (MethodData): Added additional `DeclSpace ds' argument
21210 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
21211 EmitContext's .ctor.
21213 2003-10-09 Martin Baulig <martin@ximian.com>
21215 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
21216 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
21217 AsAccessible(), moved them as well.
21219 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
21221 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
21223 * cs-parser.jay : Renamed yyName to yyNames related to jay.
21225 2003-10-07 Miguel de Icaza <miguel@ximian.com>
21227 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
21228 generation for >=, as spotted by Paolo, bug 48679.
21229 Patch from David Waite.
21231 * cs-tokenizer.cs: Add handling for #pragma.
21233 * cs-parser.jay: Allow for both yield and yield return in the
21234 syntax. The anti-cobolization of C# fight will go on!
21236 * class.cs (TypeBuilder.DefineType): Catch error condition here
21237 (Parent.DefineType erroring out and returning null).
21239 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
21240 coping with enumerations variables, we were mistakenly processing
21241 them as a regular value type instead of built-in types. Fixes the
21244 * typemanager.cs (IsBuiltinOrEnum): New method.
21246 2003-09-30 Miguel de Icaza <miguel@ximian.com>
21248 * cs-parser.jay: Upgrade: yield now needs the return clause.
21250 2003-09-19 Martin Baulig <martin@ximian.com>
21252 * decl.cs (MemberCache.SetupCacheForInterface): Take a
21253 `MemberCache parent' argument. Normally, an interface doesn't
21254 have a parent type except System.Object, but we use this in gmcs
21255 for generic type parameters.
21257 2003-09-18 Martin Baulig <martin@ximian.com>
21259 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
21260 on `type.IsInterface'; don't check whether the type has a parent
21261 to determine whether it's an interface.
21263 2003-09-15 Martin Baulig <martin@ximian.com>
21265 * class.cs (TypeContainer.DefineType): Added an error flag to
21266 avoid reporting duplicate CS0146's ("class definition is
21269 * driver.cs (Driver.MainDriver): Abort if
21270 RootContext.ResolveTree() reported any errors.
21272 2003-09-07 Martin Baulig <martin@ximian.com>
21274 * report.cs (Error, Warning): Added overloaded versions which take
21275 a `params object[] args' and call String.Format().
21277 2003-09-07 Martin Baulig <martin@ximian.com>
21279 * decl.cs (DeclSpace..ctor): Don't call
21280 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
21281 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
21282 (DeclSpace.RecordDecl): New method.
21284 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
21286 2003-09-02 Ravi Pratap <ravi@ximian.com>
21288 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
21289 value attributes to be applied to ParameterBuilders.
21291 * class.cs (MethodCore.LabelParameters): Make static and more
21292 generic so that it can be used from other places - like interface
21293 methods, for instance.
21295 * interface.cs (Interface.Emit): Call LabelParameters before
21296 emitting attributes on the InterfaceMethod.
21298 2003-08-26 Martin Baulig <martin@ximian.com>
21300 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
21301 resolving aliases; fixes #47927.
21303 2003-08-26 Martin Baulig <martin@ximian.com>
21305 * statement.cs (Using.DoResolve): This is internally emitting a
21306 try/finally clause, so we need to set ec.NeedExplicitReturn if we
21307 do not always return. Fixes #47681.
21309 2003-08-26 Martin Baulig <martin@ximian.com>
21311 * decl.cs (MemberCore): Moved WarningNotHiding(),
21312 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
21314 (AdditionResult): Make this nested in DeclSpace.
21315 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
21316 argument; call NamespaceEntry.Define() unless we're nested in a
21319 * namespace.cs (Namespace.DefineName): New public function. This
21320 is called from DeclSpace's .ctor to add
21321 (Namespace.Lookup): Include DeclSpaces in the lookup.
21323 * class.cs (Operator): Derive from MemberBase, not MemberCore.
21325 * const.cs (Const): Derive from MemberBase, not MemberCore.
21327 2003-08-25 Martin Baulig <martin@ximian.com>
21329 * convert.cs (Convert.ExplicitReferenceConversion): When
21330 converting from an interface type to a class, unbox if the target
21331 type is a struct type. Fixes #47822.
21333 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21335 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
21338 2003-08-22 Martin Baulig <martin@ximian.com>
21340 * class.cs (TypeManager.DefineType): When defining a nested type,
21341 call DefineType() on our parent; fixes #47801.
21343 2003-08-22 Martin Baulig <martin@ximian.com>
21345 * class.cs (MethodData.Define): While checking if a method is an
21346 interface implementation, improve the test a bit more to fix #47654.
21348 2003-08-22 Martin Baulig <martin@ximian.com>
21350 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
21351 correctly; fixes #47722.
21353 2003-08-22 Martin Baulig <martin@ximian.com>
21355 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
21356 LocalVariableReference, ensure it's not read-only. Fixes #47536.
21358 * statement.cs (Fixed.DoResolve): Make all variables read-only.
21360 2003-08-22 Martin Baulig <martin@ximian.com>
21362 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
21363 can only be assigned in static constructors. Fixes #47161.
21365 2003-08-22 Martin Baulig <martin@ximian.com>
21367 Rewrote and improved the flow analysis code.
21369 * flowbranching.cs (FlowBranching): Make this class abstract.
21370 (FlowBranching.CreateBranching): New static function to create a
21371 new flow branching.
21372 (FlowBranchingBlock, FlowBranchingException): New classes.
21373 (FlowBranching.UsageVector.Type): New public readonly field.
21374 (FlowBranching.UsageVector.Breaks): Removed the setter.
21375 (FlowBranching.UsageVector.Returns): Removed the setter.
21376 (FlowBranching.UsageVector): Added Break(), Return(),
21377 NeverReachable() and Throw() methods to modify the reachability.
21378 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
21379 done by FlowBranching.Merge().
21380 (FlowBranching.UsageVector.MergeChild): New method; merges the
21381 merge result into the current vector.
21382 (FlowBranching.Merge): New abstract method to merge a branching.
21384 2003-08-12 Martin Baulig <martin@ximian.com>
21386 * expression.cs (Indirection.CacheTemporaries): Create the
21387 LocalTemporary with the pointer type, not its element type.
21389 2003-08-10 Miguel de Icaza <miguel@ximian.com>
21391 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
21392 token was a keyword or not.
21394 Add `error' options where an IDENTIFIER was expected; Provide
21395 CheckToken and CheckIdentifierToken convenience error reporting
21398 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
21400 * decl.cs: Rename `NamespaceEntry Namespace' public field into
21401 NameSpaceEntry NameSpaceEntry.
21403 (LookupInterfaceOrClass): Avoid creating a full qualified name
21404 from namespace and name: avoid doing lookups when we know the
21405 namespace is non-existant. Use new Tree.LookupByNamespace which
21406 looks up DeclSpaces based on their namespace, name pair.
21408 * driver.cs: Provide a new `parser verbose' to display the
21409 exception thrown during parsing. This is turned off by default
21410 now, so the output of a failure from mcs is more graceful.
21412 * namespace.cs: Track all the namespaces defined in a hashtable
21415 (IsNamespace): New method
21417 2003-08-09 Miguel de Icaza <miguel@ximian.com>
21419 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
21420 we know that we need to concatenate (full typename can never be
21425 * statement.cs: Use a bitfield; Do not initialize to null things
21426 which are done by the constructor by default.
21428 * cs-parser.jay: bug fix, parameter was 4, not 3.
21430 * expression.cs: Just use the property;
21432 * statement.cs: No need for GetVariableInfo method.
21434 2003-08-08 Martin Baulig <martin@ximian.com>
21436 * flowanalysis.cs (FlowReturns): This is now nested in the
21437 `FlowBranching' class.
21438 (MyBitVector): Moved this here from statement.cs.
21439 (FlowBranching.SiblingType): New enum type.
21440 (FlowBranching.CreateSibling): Added `SiblingType' argument.
21442 2003-08-07 Martin Baulig <martin@ximian.com>
21444 * flowanalysis.cs (FlowBranchingType): This is now nested in the
21445 `FlowBranching' class and called `BranchingType'.
21447 2003-08-07 Martin Baulig <martin@ximian.com>
21449 * flowanalysis.cs: Moved all the control flow analysis code into
21452 2003-08-07 Martin Baulig <martin@ximian.com>
21454 * assign.cs (Assign.DoResolve): `target' must either be an
21455 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
21458 2003-08-07 Miguel de Icaza <miguel@ximian.com>
21460 * expression.cs (BinaryMethod): This kind of expression is created by the
21461 Binary class if it determines that the operator has to be handled
21464 (BinaryDelegate): This kind of expression is created if we are
21465 dealing with a + or - operator on delegates.
21467 (Binary): remove method, argumetns, and DelegateOperator: when
21468 dealing with methods,
21470 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
21472 * statement.cs (Block): use bitfields for the three extra booleans
21473 we had in use. Remove unused topblock parameter.
21475 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
21477 * assign.cs: Drop extra unneeded tests.
21479 2003-08-06 Miguel de Icaza <miguel@ximian.com>
21481 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
21483 * statement.cs (Foreach): Use VariableStorage instead of
21486 * codegen.cs (VariableStorage): New class used by clients that
21487 require a variable stored: locals or fields for variables that
21488 need to live across yield.
21490 Maybe provide a convenience api for EmitThis+EmitLoad?
21492 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
21495 2003-08-05 Miguel de Icaza <miguel@ximian.com>
21497 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
21498 RemapParameterLValue): New methods that are used to turn a
21499 precomputed FieldInfo into an expression like this:
21503 The idea is to use this instead of making LocalVariableReference
21504 have more than one meaning.
21506 * cs-parser.jay: Add error production to BASE.
21508 * ecore.cs: Deal with TypeManager.GetField returning null, which
21509 is now a valid return value.
21511 (FieldExprNoAddress): New expression for Fields whose address can
21514 * expression.cs (LocalVariableReference): During the resolve
21515 phases, create new expressions if we are in a remapping context.
21516 Remove code that dealt with remapping here.
21518 (ParameterReference): same.
21520 (ProxyInstance): New expression, like the `This' expression, but
21521 it is born fully resolved. We know what we are doing, so remove
21522 the errors that are targeted to user-provided uses of `this'.
21524 * statement.cs (Foreach): our variable is now stored as an
21525 Expression; During resolution, follow the protocol, dont just
21526 assume it will return this.
21528 2003-08-06 Martin Baulig <martin@ximian.com>
21530 * support.cs (SeekableStreamReader.cs): New public class.
21532 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
21533 SeekableStreamReader instead of the normal StreamReader.
21535 2003-08-04 Martin Baulig <martin@ximian.com>
21537 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
21538 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
21539 deambiguate casts and delegate invocations.
21540 (parenthesized_expression): Use the new tokens to ensure this is
21541 not a cast of method invocation.
21543 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
21544 when reading a `)' and Deambiguate_CloseParens () was previously
21547 * expression.cs (ParenthesizedExpression): New class. This is
21548 just used for the CS0075 test.
21549 (Binary.DoResolve): Check for CS0075.
21551 2003-07-29 Ravi Pratap <ravi@ximian.com>
21553 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
21554 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
21555 reference comparison.
21557 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
21558 examine the ReturnType for equality - this is necessary in the
21559 cases of implicit and explicit operators whose signature also
21560 includes the return type.
21562 2003-07-26 Miguel de Icaza <miguel@ximian.com>
21564 * namespace.cs: Cache the result of the namespace computation,
21565 instead of computing it every time.
21567 2003-07-24 Miguel de Icaza <miguel@ximian.com>
21569 * decl.cs: Use a global arraylist that we reuse over invocations
21570 to avoid excesive memory consumption. Reduces memory usage on an
21571 mcs compile by one meg (45 average).
21573 * typemanager.cs (LookupTypeReflection): In .NET pointers are
21574 private, work around that.
21576 2003-07-23 Miguel de Icaza <miguel@ximian.com>
21578 * literal.cs (IntLiteral): Define Zero and One static literals.
21580 * cs-parser.jay (integer_literal): use static literals to reduce
21581 memory usage for the most used literals (0, 1 and -1). 211kb
21582 reduced in memory usage.
21584 Replace all calls to `new ArrayList' with `new
21585 ArrayList(4)' which is a good average number for most allocations,
21586 and also requires only 16 bytes of memory for its buffer by
21589 This reduced MCS memory usage in seven megabytes for the RSS after
21592 2003-07-28 Ravi Pratap <ravi@ximian.com>
21594 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
21595 handle params methods the correct way by forming only one
21596 applicable set with params and normal methods in them. Earlier we
21597 were looking at params methods only if we found no normal methods
21598 which was not the correct thing to do.
21600 (Invocation.BetterFunction): Take separate arguments indicating
21601 when candidate and the best method are params methods in their
21604 This fixes bugs #43367 and #46199.
21606 * attribute.cs: Documentation updates.
21608 (CheckAttribute): Rename to CheckAttributeTarget.
21609 (GetValidPlaces): Rename to GetValidTargets.
21611 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
21612 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
21616 2003-07-28 Martin Baulig <martin@ximian.com>
21618 * class.cs (TypeContainer.DefineMembers): Use the base type's full
21619 name when looking up the base class of a nested class. Fixes #46977.
21621 2003-07-26 Martin Baulig <martin@ximian.com>
21623 * expression.cs (Indexers.Indexer): New nested struct; contains
21624 getter, setter and the indexer's type.
21625 (Indexers.Properties): This is now an ArrayList of
21626 Indexers.Indexer's.
21627 (IndexerAccess.DoResolveLValue): Correctly set the type if the
21628 indexer doesn't have any getters.
21630 * assign.cs (Assign.DoResolve): Also do the implicit conversions
21631 for embedded property and indexer assignments.
21633 2003-07-26 Martin Baulig <martin@ximian.com>
21635 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
21636 preprocessor directive is not the first non-whitespace character
21639 2003-07-26 Martin Baulig <martin@ximian.com>
21641 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
21642 namespace parsing, follow the spec more closely.
21644 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
21645 NamespaceEntry.Lookup().
21647 2003-07-25 Martin Baulig <martin@ximian.com>
21649 * MethodCore.cs (OverridesSomething): New public field; it's set
21650 from TypeContainer.DefineMembers if this method overrides
21651 something (which doesn't need to be a method). Fix #39462.
21653 2003-07-25 Ravi Pratap <ravi@ximian.com>
21655 * typemanager.cs (GetMembers): Ensure that the list of members is
21656 reversed. This keeps things in sync.
21658 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
21659 find an AttributeUsage attribute.
21661 * expression.cs (Invocation.OverloadResolve): Perform the check
21662 which disallows Invoke to be directly called on a Delegate.
21664 (Error_InvokeOnDelegate): Report error cs1533.
21666 2003-07-25 Martin Baulig <martin@ximian.com>
21668 * expression.cs (Indexers.GetIndexersForType): Only look in the
21669 interface hierarchy if the requested type is already an
21670 interface. Fixes #46788 while keeping #46502 fixed.
21672 2003-07-25 Martin Baulig <martin@ximian.com>
21674 * class.cs (TypeContainer.DefineMembers): Check whether all
21675 readonly fields have been assigned and report warning CS0649 if
21678 * statement.cs (LocalInfo.IsFixed): Always return true if this is
21681 2003-07-24 Ravi Pratap <ravi@ximian.com>
21683 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
21684 returned from GetMethods to make things consistent with the
21685 assumptions MCS makes about ordering of methods.
21687 This should comprehensively fix bug #45127 and it does :-)
21689 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
21690 ordering is actually reverse.
21692 * Clean up some debug messages I left lying around.
21694 * interface.cs (Populate*): Get rid of code which emits attributes
21695 since the stage in which we emit attributes is the 'Emit' stage,
21696 not the define stage.
21698 (Emit): Move attribute emission for interface members here.
21700 2003-07-22 Ravi Pratap <ravi@ximian.com>
21702 * expression.cs (Invocation.OverloadResolve): Follow the spec more
21703 closely: we eliminate methods in base types when we have an
21704 applicable method in a top-level type.
21706 Please see section 14.5.5.1 for an exact description of what goes
21709 This fixes bug #45127 and a host of other related to corlib compilation.
21711 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
21712 array is the method corresponding to the top-level type (this is
21713 because of the changes made to icall.c) so we change this
21716 (MethodGroupExpr.Name): This too.
21718 * typemanager.cs (GetElementType): New method which does the right
21719 thing when compiling corlib.
21721 * everywhere: Make use of the above in the relevant places.
21723 2003-07-22 Martin Baulig <martin@ximian.com>
21725 * cs-parser.jay (invocation_expression): Moved
21726 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
21727 `cast_expression', but create a InvocationOrCast which later
21728 resolves to either an Invocation or a Cast.
21730 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
21731 method; call this before EmitStatement() to make sure that this
21732 expression can be used as a statement.
21734 * expression.cs (InvocationOrCast): New class; resolves to either
21735 an Invocation or a Cast.
21737 * statement.cs (StatementExpression): Call ResolveStatement() on
21738 the ExpressionStatement before emitting it.
21740 2003-07-21 Martin Baulig <martin@ximian.com>
21742 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
21743 `ref' and `out' attributes match; fixes #46220.
21744 (MemberAccess.ResolveMemberAccess): You can't reference a type
21745 through an expression; fixes #33180.
21746 (Indexers.GetIndexersForType): Don't return the indexers from
21747 interfaces the class implements; fixes #46502.
21749 2003-07-21 Martin Baulig <martin@ximian.com>
21751 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
21752 CS0661 checks; fixes bug #30442.
21754 2003-07-21 Martin Baulig <martin@ximian.com>
21756 * decl.cs (AdditionResult): Added `Error'.
21758 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
21760 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
21761 makes cs0031.cs actually work.
21763 2003-07-20 Martin Baulig <martin@ximian.com>
21765 * namespace.cs: Fixed that bug which caused a crash when compiling
21766 the debugger's GUI.
21768 2003-07-20 Miguel de Icaza <miguel@ximian.com>
21770 * typemanager.cs (LookupTypeReflection): Never expose types which
21771 are NotPublic, NestedPrivate, NestedAssembly, or
21772 NestedFamANDAssem. We used to return these, and later do a check
21773 that would report a meaningful error, but the problem is that we
21774 would not get the real match, if there was a name override.
21776 2003-07-18 Miguel de Icaza <miguel@ximian.com>
21778 * namespace.cs (Namespace, Name): Do not compute the namespace
21779 name dynamically, compute it in the constructor. This reduced
21780 memory usage by 1697 KB.
21782 * driver.cs: Use --pause to pause at the end.
21784 2003-07-17 Peter Williams <peter@newton.cx>
21786 * Makefile: Change the name of the test target so that it doesn't
21787 conflict with the recursive test target.
21789 2003-07-17 Miguel de Icaza <miguel@ximian.com>
21791 * expression.cs (LocalVariableReference.Emit, EmitAssign,
21792 AddressOf): Do not use EmitThis, that was wrong, use the actual
21795 2003-07-15 Miguel de Icaza <miguel@ximian.com>
21797 * class.cs (MethodData.Define): While checking if a method is an
21798 interface implementation, improve the test: If we are not public
21799 (use new test here: use the computed MethodAttributes directly,
21800 instead of the parsed modifier flags) check if the `implementing'
21801 method comes from an interface or not.
21803 * pending.cs (VerifyPendingMethods): Slightly better error
21806 * makefile: add test target that does the mcs bootstrap.
21808 2003-07-16 Ravi Pratap <ravi@ximian.com>
21810 * interface.cs (Define): Do nothing here since there are no
21811 members to populate etc. Move the attribute emission out of here
21812 since this was just totally the wrong place to put it. Attribute
21813 application happens during the 'Emit' phase, not in the 'Define'
21816 (Emit): Add this method and move the attribute emission here
21818 * rootcontext.cs (EmitCode): Call the Emit method on interface
21821 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21823 * expression.cs (OverloadResolve): Report error only if Location
21824 is not 'Null' which means that there was a probe going on.
21826 2003-07-14 Martin Baulig <martin@ximian.com>
21828 * expression.cs (ConditionalLogicalOperator): New public class to
21829 implement user defined conditional logical operators.
21830 This is section 14.11.2 in the spec and bug #40505.
21832 2003-07-14 Martin Baulig <martin@ximian.com>
21834 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
21836 2003-07-14 Martin Baulig <martin@ximian.com>
21838 * codegen.cs (EmitContext.InFixedInitializer): New public field.
21840 * ecore.cs (IVariable.VerifyFixed): New interface method.
21842 * expression.cs (Unary.ResolveOperator): When resolving the `&'
21843 operator, check whether the variable is actually fixed. Fixes bug
21844 #36055. Set a variable definitely assigned when taking its
21845 address as required by the spec.
21847 * statement.cs (LocalInfo.IsFixed): New field.
21848 (LocalInfo.MakePinned): Set `IsFixed' to true.
21850 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21852 * attribute.cs (Attribute.Resolve): While doing a Member lookup
21853 for .ctors, ensure that we only ask for members declared in the
21854 attribute type (BindingFlags.DeclaredOnly).
21858 * expression.cs (Error_WrongNumArguments): Report error 1501
21859 correctly the way CSC does.
21861 2003-07-13 Martin Baulig <martin@ximian.com>
21863 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
21864 lookup on the fully qualified name, to make things like "X.X" work
21865 where "X.X" is a fully qualified type name, but we also have a
21866 namespace "X" in the using list. Fixes #41975.
21868 2003-07-13 Martin Baulig <martin@ximian.com>
21870 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
21871 function. If we're a CompoundAssign, we need to create an embedded
21872 CompoundAssign, not an embedded Assign.
21873 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
21876 2003-07-13 Martin Baulig <martin@ximian.com>
21878 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
21879 work to fix bug #46088.
21881 2003-07-13 Ravi Pratap <ravi@ximian.com>
21883 * class.cs (Operator.Emit): Do not emit attributes here - it is
21884 taken care of by the Method class that we delegate too. This takes
21885 care of bug #45876.
21887 2003-07-10 Martin Baulig <martin@ximian.com>
21889 * expression.cs (TypeOfVoid): New class.
21890 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
21892 2003-07-10 Martin Baulig <martin@ximian.com>
21894 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
21897 2003-07-10 Martin Baulig <martin@ximian.com>
21899 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
21900 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
21902 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
21904 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
21906 2003-07-10 Martin Baulig <martin@ximian.com>
21908 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
21909 of decimal. Fixes #42850.
21911 NOTE: I also fixed the created byte blob, but this doesn't work on
21912 the MS runtime and csc never produces any byte blobs for decimal
21915 2003-07-10 Martin Baulig <martin@ximian.com>
21917 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
21918 structs; fixes #32068.
21919 (Block.AddChildVariableNames): Fixed #44302.
21921 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21923 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
21925 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21927 * attribute.cs: And this test is onger needed.
21929 2003-07-08 Martin Baulig <martin@ximian.com>
21931 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
21932 inaccessible types. Fixes #36313.
21934 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
21936 * namespace.cs (NamespaceEntry): Create implicit entries for all
21937 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
21938 implicit entries for N1.N2 and N1.
21940 2003-07-08 Martin Baulig <martin@ximian.com>
21942 Rewrote the handling of namespaces to fix a lot of the issues
21943 wrt. `using' aliases etc.
21945 * namespace.cs (Namespace): Splitted this class into a
21946 per-assembly `Namespace' and a per-file `NamespaceEntry'.
21948 * typemanager.cs (TypeManager.IsNamespace): Removed.
21949 (TypeManager.ComputeNamespaces): Only compute namespaces from
21950 loaded assemblies here, not the namespaces from the assembly we're
21951 currently compiling.
21953 2003-07-08 Martin Baulig <martin@ximian.com>
21955 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
21957 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21959 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
21962 I thought about the memory savings here, but LookupTypeReflection
21963 is used under already very constrained scenarios. Compiling
21964 corlib or mcs only exposes one hit, so it would not really reduce
21965 any memory consumption.
21967 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21969 * typemanager.cs: fixes bug #45889 by only adding public types from
21970 other assemblies to the list of known types.
21972 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21974 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
21975 on the type we resolved.
21977 2003-07-05 Martin Baulig <martin@ximian.com>
21979 * pending.cs (PendingImplementation.ParentImplements): Don't
21980 create the proxy if the parent is abstract.
21982 * class.cs (TypeContainer.DefineIndexers): Process explicit
21983 interface implementations first. Fixes #37714.
21985 2003-07-04 Miguel de Icaza <miguel@ximian.com>
21987 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
21988 defined recursively; but since we modify the input parameters
21989 (left is set to `this' temporarily), we reset this value if the
21990 left_is_explicit is false, which gives the original semantics to
21993 * literal.cs (NullPointer): new class used to represent a null
21994 literal in a pointer context.
21996 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
21997 type is a pointer, use a NullPointer object instead of a
21998 NullLiteral. Closes 43687
22000 (ExplicitConversion): Convert pointer values using
22001 the conv opcode to the proper type.
22003 * ecore.cs (New): change ValueTypeVariable property into a method,
22004 that returns whether the valuetype is suitable for being used.
22006 * expression.cs (Binary.DoNumericPromotions): Only return if we
22007 the int constant was a valid uint, and we can return both left and
22008 right as uints. If not, we continue processing, to trigger the
22009 type conversion. This fixes 39018.
22011 * statement.cs (Block.EmitMeta): During constant resolution, set
22012 the CurrentBlock property on the emitcontext, so that we resolve
22013 constants propertly.
22015 2003-07-02 Martin Baulig <martin@ximian.com>
22017 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
22018 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
22020 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
22021 than emitting it here.
22023 * statement.cs: Fixed some more flow analysis bugs.
22025 2003-07-02 Martin Baulig <martin@ximian.com>
22027 * class.cs (MethodData.Define): When implementing interface
22028 methods, set Final unless we're Virtual.
22030 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
22031 check work for interface methods.
22033 2003-07-01 Martin Baulig <martin@ximian.com>
22035 * ecore.cs (EmitContext.This): Replaced this property with a
22036 GetThis() method which takes a Location argument. This ensures
22037 that we get the correct error location for a CS0188.
22039 2003-07-01 Miguel de Icaza <miguel@ximian.com>
22041 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
22042 ImplicitStandardConversion.
22044 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
22046 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
22048 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
22051 2003-06-30 Miguel de Icaza <miguel@ximian.com>
22053 * class.cs (Constructor.Define): Turn off initlocals for unsafe
22056 (MethodData.Define): Turn off initlocals for unsafe methods.
22058 2003-06-29 Miguel de Icaza <miguel@ximian.com>
22060 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
22061 complete; Fixes #37521.
22063 * delegate.cs: Use Modifiers.TypeAttr to compute the
22064 TypeAttributes, instead of rolling our own. This makes the flags
22065 correct for the delegates.
22067 2003-06-28 Miguel de Icaza <miguel@ximian.com>
22069 * class.cs (Constructor.Define): Set the private flag for static
22070 constructors as well.
22072 * cs-parser.jay (statement_expression): Set the return value to
22073 null, to avoid a crash when we catch an error.
22075 2003-06-24 Miguel de Icaza <miguel@ximian.com>
22077 * cs-parser.jay: Applied patch from Jackson that adds support for
22078 extern and unsafe modifiers to destructor declarations.
22080 * expression.cs: Report error 21 if the user is trying to index a
22083 * driver.cs: Add an error message, suggested by the bug report.
22085 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
22086 if we do not have a ": this ()" constructor initializer. Fixes 45149
22088 2003-06-14 Miguel de Icaza <miguel@ximian.com>
22090 * namespace.cs: Add some information to reduce FAQs.
22092 2003-06-13 Miguel de Icaza <miguel@ximian.com>
22094 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
22095 underlying enumeration types. Fixes #43915.
22097 * expression.cs: Treat ushort/short as legal values to be used in
22098 bitwise operations.
22100 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
22102 * delegate.cs: transfer custom attributes for paramenters from
22103 the delegate declaration to Invoke and BeginInvoke.
22105 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
22107 * attribute.cs: handle custom marshalers and emit marshal info
22110 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
22112 * makefile.gnu: Added anonymous.cs to the compiler sources.
22114 2003-05-28 Miguel de Icaza <miguel@ximian.com>
22116 * iterators.cs: Change the name of the proxy class to include two
22119 * cs-parser.jay: Update grammar to include anonymous methods.
22121 * anonymous.cs: new file.
22123 2003-05-27 Miguel de Icaza <miguel@ximian.com>
22125 * class.cs (Field.Define): Add missing test for pointers and
22128 2003-05-27 Ravi Pratap <ravi@ximian.com>
22130 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
22131 we use the stobj opcode.
22133 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
22134 since it wasn't the correct fix.
22136 It still is puzzling that we are required to use stobj for IntPtr
22137 which seems to be a ValueType.
22139 2003-05-26 Miguel de Icaza <miguel@ximian.com>
22141 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
22142 during regular simple name resolution. Now, the trick is that
22143 instead of returning for processing the simplename, we do a
22144 TypeManager.LookupType (ie, a rooted lookup as opposed to a
22145 contextual lookup type). If a match is found, return that, if
22146 not, return for further composition.
22148 This fixes long-standing 30485.
22150 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
22151 using the address to initialize an object, do an Stobj instead of
22152 using the regular Stelem.
22154 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
22155 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
22156 Because if we are a BaseIndexerAccess that value will be true.
22159 * statement.cs (GotoCase.Resolve): Return after reporting an
22160 error, do not attempt to continue.
22162 * expression.cs (PointerArithmetic.Emit): If our operand is a
22163 long, convert our constants to match the operand before
22164 multiplying. Convert to I type before adding. Fixes 43670.
22166 2003-05-14 Ravi Pratap <ravi@ximian.com>
22168 * enum.cs (ImplicitConversionExists) : Rename to
22169 ImplicitEnumConversionExists to remove ambiguity.
22171 * ecore.cs (NullCast): New type of cast expression class which
22172 basically is very similar to EmptyCast with the difference being
22173 it still is a constant since it is used only to cast a null to
22175 (eg. (string) null)
22177 * convert.cs (ImplicitReferenceConversion): When casting a null
22178 literal, we return a NullCast.
22180 * literal.cs (NullLiteralTyped): Remove - I don't see why this
22181 should be around anymore.
22183 The renaming (reported was slightly wrong). Corrections:
22185 ConvertImplicitStandard -> ImplicitConversionStandard
22186 ConvertExplicitStandard -> ExplicitConversionStandard
22188 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
22189 before passing them in !
22191 * convert.cs (ImplicitConversionStandard): When comparing for
22192 equal expr and target types, ensure that expr is not a
22195 In general, we must not be checking (expr_type ==
22196 target_type) in the top level conversion methods
22197 (ImplicitConversion, ExplicitConversion etc). This checking is
22198 done in the methods that they delegate to.
22200 2003-05-20 Miguel de Icaza <miguel@ximian.com>
22202 * convert.cs: Move Error_CannotConvertType,
22203 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
22204 ImplicitNumericConversion, ImplicitConversionExists,
22205 ImplicitUserConversionExists, StandardConversionExists,
22206 FindMostEncompassedType, FindMostSpecificSource,
22207 FindMostSpecificTarget, ImplicitUserConversion,
22208 ExplicitUserConversion, GetConversionOperators,
22209 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
22210 TryImplicitIntConversion, Error_CannotConvertImplicit,
22211 ConvertImplicitRequired, ConvertNumericExplicit,
22212 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
22213 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
22216 Perform the following renames:
22218 StandardConversionExists -> ImplicitStandardConversionExists
22219 ConvertImplicit -> ImplicitConversion
22220 ConvertImplicitStandard -> ImplicitStandardConversion
22221 TryImplicitIntConversion -> ImplicitIntConversion
22222 ConvertImplicitRequired -> ImplicitConversionRequired
22223 ConvertNumericExplicit -> ExplicitNumericConversion
22224 ConvertReferenceExplicit -> ExplicitReferenceConversion
22225 ConvertExplicit -> ExplicitConversion
22226 ConvertExplicitStandard -> ExplicitStandardConversion
22228 2003-05-19 Martin Baulig <martin@ximian.com>
22230 * statement.cs (TypeInfo.StructInfo): Made this type protected.
22231 (TypeInfo): Added support for structs having structs as fields.
22233 * ecore.cs (FieldExpr): Implement IVariable.
22234 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
22235 VariableInfo for the field.
22237 2003-05-18 Martin Baulig <martin@ximian.com>
22239 * expression.cs (This.DoResolve): Report a CS0027 if we're
22240 emitting a field initializer.
22242 2003-05-18 Martin Baulig <martin@ximian.com>
22244 * expression.cs (This.ResolveBase): New public function.
22245 (This.DoResolve): Check for CS0188.
22247 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
22250 * ecore.cs (MethodGroupExpr.DoResolve): Set the
22251 `instance_expression' to null if we don't have any non-static
22254 2003-05-18 Martin Baulig <martin@ximian.com>
22256 Reworked the way how local variables and parameters are handled by
22257 the flow analysis code.
22259 * statement.cs (TypeInfo, VariableMap): New public classes.
22260 (VariableInfo): New public class. This is now responsible for
22261 checking whether a variable has been assigned. It is used for
22262 parameters and local variables.
22263 (Block.EmitMeta): Take the InternalParameters as argument; compute
22264 the layout of the flow vectors here.
22265 (Block.LocalMap, Block.ParameterMap): New public properties.
22266 (FlowBranching): The .ctor doesn't get the InternalParameters
22267 anymore since Block.EmitMeta() now computes the layout of the flow
22269 (MyStructInfo): This class is now known as `StructInfo' and nested
22270 in `TypeInfo'; we don't access this directly anymore.
22272 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
22273 property and removed IsAssigned(), IsFieldAssigned(),
22274 SetAssigned() and SetFieldAssigned(); we now call them on the
22275 VariableInfo so we don't need to duplicate this code everywhere.
22277 * expression.cs (ParameterReference): Added `Block block' argument
22279 (LocalVariableReference, ParameterReference, This): The new
22280 VariableInfo class is now responsible for all the definite
22283 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
22284 IsParameterAssigned, SetParameterAssigned): Removed.
22286 2003-05-18 Martin Baulig <martin@ximian.com>
22288 * typemanager.cs (InitCoreTypes): Try calling
22289 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
22290 the 3-args-version. Corlib now also needs our `void_type'.
22291 (GetMethod): Added overloaded version which takes an optional
22292 `bool report_errors' to allow lookups of optional methods.
22294 2003-05-12 Martin Baulig <martin@ximian.com>
22296 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
22297 only used for locals and not for parameters.
22299 2003-05-12 Miguel de Icaza <miguel@ximian.com>
22301 * support.cs (InternalParameters.ParameterType): Return the
22302 ExternalType of the parameter.
22304 * parameter.cs (Parameter.ExternalType): drop the two arguments,
22307 2003-05-11 Miguel de Icaza <miguel@ximian.com>
22309 * class.cs (MethodData.Define): Do not set the `newslot' on
22310 interface members, if they are also flagged as "override".
22312 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
22313 better code for ++i and i++. This only works for static fields
22314 and local variables.
22316 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
22317 want to pull the DeclSpace out of the builder_to_declspace instead
22318 of the TypeBuilder (like in TypeContainer.FindMembers).
22320 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
22321 instead of LookupTypeContainer. Fixes the crash on .NET for
22322 looking up interface members.
22324 * const.cs: Create our own emit context during the Definition
22325 stage, so that constants are evaluated in the proper context, when
22326 a recursive definition happens.
22328 2003-05-11 Martin Baulig <martin@ximian.com>
22330 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
22331 new block for a switch section.
22332 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
22333 the adding/lookup in the switch block. Fixes #39828.
22335 2003-05-09 Miguel de Icaza <miguel@ximian.com>
22337 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
22338 functionality: I needed to convert the data after I had performed
22339 the add/sub operation into the operands type size.
22341 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
22342 pass the type for the box operation, otherwise the resulting
22343 object would have been of type object.
22345 (BoxedCast): Add constructor to specify the type to box as.
22347 2003-05-07 Miguel de Icaza <miguel@ximian.com>
22349 * iterators.cs: I was reusing the `count' variable inadvertently,
22350 take steps to not allow this to happen.
22352 2003-05-06 Miguel de Icaza <miguel@ximian.com>
22354 * attribute.cs (Attribute.Resolve): Params attributes are encoded
22355 by creating an array at the point where the params starts and
22356 putting all those arguments there, then adjusting the size of the
22359 2003-05-05 Miguel de Icaza <miguel@ximian.com>
22361 * expression.cs (New.AddressOf): Implement interface
22362 IMemoryLocation. This is used when the `new' operator is used in
22363 the context of an invocation to a method on a value type.
22365 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
22368 * namespace.cs: Also check the using aliases here.
22370 * driver.cs: Move the test for using validity after the types have
22371 been entered, so we do a single pass that also includes the using
22374 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
22375 in the regular case. CreateSiblingForFinally is doing extra
22378 * attribute.cs (GetAttributeArgumentExpression): Store the result
22379 on an out value, and use the return value to indicate failure
22380 instead of using null (which is a valid return for Constant.GetValue).
22382 * statement.cs: Perform the analysis flow for the increment
22383 portion after the statement, because this will be the real flow of
22384 execution. Fixes #42385
22386 * codegen.cs (EmitContext.EmitArgument,
22387 EmitContext.EmitStoreArgument): New helper functions when the
22388 RemapToProxy flag is set.
22390 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
22393 Add support for remapping parameters.
22395 * iterators.cs: Propagate parameter values; Store parameter
22396 values in the proxy classes.
22398 2003-05-04 Miguel de Icaza <miguel@ximian.com>
22400 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
22401 need a proxy reference; I do not know what I was thinking
22403 * cs-parser.jay (constructor_initializer): catch another error,
22404 and display nice message.
22406 (field_declaration): catch void field declaration
22407 to flag a better error.
22409 * class.cs (MemberBase.CheckBase): Report an error instead of a
22410 warning if a new protected member is declared in a struct.
22411 (Field.Define): catch the error of readonly/volatile.
22413 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
22415 (FieldExpr.AddressOf): ditto. Catch error where the address of a
22416 volatile variable is taken
22418 2003-05-02 Miguel de Icaza <miguel@ximian.com>
22420 * statement.cs (Fixed.Resolve): Report an error if we are not in
22423 2003-05-01 Miguel de Icaza <miguel@ximian.com>
22425 * typemanager.cs: reuse the code that handles type clashes for
22426 delegates and enumerations.
22428 * class.cs (Report28): Always report.
22430 * expression.cs (EncodeAsAttribute): Allow nulls here.
22432 2003-04-28 Miguel de Icaza <miguel@ximian.com>
22434 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
22435 the functionality for testing whether an expression is valid for
22436 an attribute here. Also handle the case of arrays of elements
22439 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
22440 encoding a linear array into an array of objects that are suitable
22441 to be passed to an CustomAttributeBuilder.
22443 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
22445 * ecore.cs: (FieldExpr): Handle field remapping here.
22447 * iteratators.cs: Pass the instance variable (if the method is an
22448 instance method) to the constructors, so we can access the field
22449 variables on the class.
22451 TODO: Test this with structs. I think the THIS variable on
22452 structs might have to be a pointer, and not a refenrece
22454 2003-04-27 Miguel de Icaza <miguel@ximian.com>
22456 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
22457 local variables to fields in a proxy class.
22459 * iterators.cs (PopulateProxy): Rename our internal fields to
22461 Create a <THIS> field if we are an instance method, so we can
22462 reference our parent container variables.
22463 (MapVariable): Called back from the EmitContext code to enter a
22464 new variable to field mapping into the proxy class (we just create
22468 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
22469 for using the remapped locals to fields.
22471 I placed the code here, because that gives the same semantics to
22472 local variables, and only changes the Emit code.
22474 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
22475 statements inside iterators.
22476 (VariableInfo): Add a FieldBuilder for the cases when we are
22477 remapping local variables to fields in a proxy class
22479 * ecore.cs (SimpleNameResolve): Avoid testing two times for
22480 current_block != null.
22482 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
22483 not cope with strings, as it has been moved to the
22484 TableSwitchEmit. Fixed bug in switch generation.
22486 * expression.cs (New.DoResolve): Provide more context for the user
22487 when reporting an error.
22489 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
22492 * expression.cs (MemberAccess.DoResolve): When we get a type back,
22493 check the permissions for it. Note than in a type-resolution
22494 context the check was already present in DeclSpace.ResolveType,
22495 but was missing from the MemberAccess.
22497 (ArrayCreation.CheckIndices): warn if the user has
22498 more nested levels of expressions, but there are no more
22499 dimensions specified. Avoids crash on bug 41906.
22501 2003-04-26 Miguel de Icaza <miguel@ximian.com>
22503 * statement.cs (Block): replace Implicit bool, for a generic
22505 New flag: `Unchecked'. This is used during the EmitMeta phase
22506 (which is out-of-line with the regular Resolve/Emit process for a
22507 statement, as this is done ahead of time, but still gets a chance
22508 to call constant resolve).
22510 (Block.Flags): new enum for adding a new flag.
22512 (Block.EmitMeta): track the state of unchecked.
22514 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
22515 to enable constant resolution to work there as well.
22517 2003-04-22 Miguel de Icaza <miguel@ximian.com>
22519 * typemanager.cs (ienumerable_type): Also look up
22520 System.Collections.IEnumerable.
22522 2003-04-21 Miguel de Icaza <miguel@ximian.com>
22524 TODO: Test more than one conditional per method.
22526 * class.cs (Indexer.Define): Report the location where the user is
22527 referencing the unsupported feature.
22529 (MethodData): Overload the use of `conditionals' to
22530 minimize the creation of needless ArrayLists. This saves roughly
22531 212kb on my machine.
22533 (Method): Implement the new IIteratorContainer interface.
22534 (Method.SetYields): Implement the method by setting the ModFlags
22535 to contain METHOD_YIELDS.
22537 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
22538 which just got set to null.
22540 * iterators.cs: New file.
22542 (Yield, YieldBreak): New statements.
22544 * statement.cs (Return.Resolve): Flag an error if we are used in
22545 an iterator method.
22547 * codegen.cs (InIterator): New flag set if the code is being
22548 compiled in an iterator method.
22550 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
22551 internal modifier, and we just use it to avoid adding extra
22552 fields, as this is seldom used.
22554 * cs-parser.jay: Add yield_statement (yield and yield break).
22556 * driver.cs: New flag -v2 to turn on version 2 features.
22558 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
22559 hashtable when v2 is enabled.
22561 2003-04-20 Miguel de Icaza <miguel@ximian.com>
22563 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
22564 there is already a namespace defined with this name.
22566 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
22567 people upgraded their corlibs.
22569 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
22570 always use fully qualified types, no need to use the compiler
22573 (TypeManager.IsNamespace): Use binarysearch.
22575 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
22576 AddDelegate): I did not quite use the new IsValid API properly: I
22577 have to pass the short-name and the fullname. I was passing only
22578 the basename instead of the fullname sometimes.
22580 (TypeContainer.DefineType): call NamespaceClash.
22582 * interface.cs (Interface.DefineType): use NamespaceClash before
22585 * delegate.cs (Delegate.DefineType): use NamespaceClash before
22588 * enum.cs: (Enum.DefineType): use NamespaceClash before
22591 * typemanager.cs (: 3-line patch that gives us some tasty 11%
22592 speed increase. First, use the negative_hits cache when we get a
22593 negative. Second, add the type with its full original name
22594 instead of the new . and + encoded name (reflection uses + to
22595 separate type from a nested type). Use LookupTypeReflection
22596 directly which bypasses the type->name hashtable (that we already
22597 know does not contain the type.
22599 * decl.cs (DeclSpace.ResolveTypeExpr): track the
22600 location/container type.
22602 * driver.cs: When passing utf8, use directly the UTF8Encoding.
22604 2003-04-19 Miguel de Icaza <miguel@ximian.com>
22606 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
22608 * delegate.cs (NewDelegate.Resolve): Test whether an instance
22609 method is being referenced in the method group from a static
22610 context, and report error 120 if so.
22612 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
22615 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
22616 is created, we create the A namespace).
22618 * cs-parser.jay: A namespace also introduces a DeclarationFound.
22621 2003-04-18 Miguel de Icaza <miguel@ximian.com>
22623 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
22624 invocation to ModuleBuilder.GetType with the same values will
22625 return a new type instance, so we need to cache its return
22628 * expression.cs (Binary.ResolveOperator): Only allow the compare
22629 operators on enums if they are of the same type.
22631 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
22632 types of ValueType on their own case. Before we were giving them
22633 the same treatment as objects.
22635 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
22636 fullname. Short name is used to compare against container name.
22637 Fullname is used to check against defined namespace names.
22639 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
22640 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
22642 (Method.CheckBase): Call parent.
22643 (MemberBase.CheckBase): Check for protected members on sealed
22645 (PropertyBase.CheckBase): Call parent.
22646 (Field.Define): Call parent.
22648 * report.cs: Negative error codes are now mapped to 8000 - code,
22649 so that the display is render more nicely.
22651 * typemanager.cs: Do not use try/catch, instead report a regular
22654 (GetPointerType, GetReferenceType): These methods provide
22655 mechanisms to obtain the T* and T& from a T. We had the code
22656 previously scattered around the code base, and it also used
22657 TypeManager.LookupType that would go through plenty of caches.
22658 This one goes directly to the type source.
22660 In some places we did the Type.GetType followed by
22661 ModuleBuilder.GetType, but not in others, so this unifies the
22662 processing as well.
22664 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
22665 statements now that we have namespace information.
22667 * typemanager.cs (IsNamespace): New method, returns whether the
22668 string presented is a namespace or not.
22670 (ComputeNamespaces): New public entry point, computes the list of
22671 available namespaces, using the GetNamespaces API call in Mono, or
22672 the slower version in MS.NET.
22674 Now before we start the semantic analysis phase, we have a
22675 complete list of namespaces including everything that the user has
22678 Deleted old code to cache namespaces in .nsc files.
22680 2003-04-17 Miguel de Icaza <miguel@ximian.com>
22682 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
22683 class/struct location definition Location for the implicit
22684 constructor location.
22686 (Operator.Define): Use the location of the operator for the
22687 implicit Method definition.
22689 (Constructor.Emit): use the constructor location for the implicit
22690 base initializer constructor.
22692 * ecore.cs: Remove ITypeExpression. This interface is now gone,
22693 and the Expression class now contains two new methods:
22695 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
22696 isolate type lookup from the rest of the resolution process.
22698 Since we use Expressions to hold type definitions due to the way
22699 we parse the input we have historically overloaded Resolve to
22700 perform the Type lookups if a special flag is passed. Now this is
22701 eliminated and two methods take their place.
22703 The differences in the two methods between xStep and xTerminal is
22704 that xStep is involved in our current lookup system that uses
22705 SimpleNames to compose a name, while xTerminal is used just to
22706 catch the case where the simplename lookup failed.
22708 2003-04-16 Miguel de Icaza <miguel@ximian.com>
22710 * expression.cs (ResolveMemberAccess): Remove redundant code.
22711 TypeExpr expressions are always born fully resolved.
22713 * interface.cs (PopulateMethod): Do not lookup the types twice.
22714 We were doing it once during SemanticAnalysis and once during
22717 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
22718 in local variable type definitions, were being returned as a
22719 SimpleName (we decomposed everything into a string), that is
22720 because primary_expression was being used instead of a type in the
22721 grammar (reduce/reduce conflicts).
22723 The part that was wrong is that we converted the expression into a
22724 string (an oversimplification in one hand, compounded with primary
22725 expressions doing string concatenation).
22731 Would return "A.B.C[]" as a SimpleName. This stopped things like
22732 using clauses from working on this particular context. And a type
22733 was being matched directly against "A.B.C[]".
22735 We now use the correct approach, and allow for ComposedCast to be
22736 part of the unary expression. So the "A.B.C []" become a composed
22737 cast of "A.B.C" (as a nested group of MemberAccess with a
22738 SimpleName at the end) plus the rank composition "[]".
22742 2003-04-10 Miguel de Icaza <miguel@ximian.com>
22744 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
22745 for the access level checking.
22747 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
22748 `TypeContainer container', because I kept getting confused when I
22749 was debugging this code.
22751 * expression.cs (Indexers): Instead of tracking getters/setters,
22752 we now track them in parallel. We create one arraylist less, but
22753 most importantly it is possible now for the LValue code to find a
22754 matching get for a set.
22756 (IndexerAccess.DoResolveLValue): Update the code.
22757 GetIndexersForType has been modified already to extract all the
22758 indexers from a type. The code assumed it did not.
22760 Also make the code set the correct return type for the indexer.
22761 This was fixed a long time ago for properties, but was missing for
22762 indexers. It used to be void_type.
22764 (Binary.Emit): Test first for doubles instead of
22765 floats, as they are more common.
22767 (Binary.EmitBranchable): Use the .un version of the branch opcodes
22768 when dealing with floats and the <=, >= operators. This fixes bug
22771 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
22772 to load the array value by emitting a load on the foreach variable
22773 type. This was incorrect.
22775 We now emit the code to load an element using the the array
22776 variable type, and then we emit the conversion operator.
22780 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
22782 * attribute.cs: Avoid allocation of ArrayLists in the common case.
22784 2003-04-09 Miguel de Icaza <miguel@ximian.com>
22786 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
22787 test for protection before we test for signatures.
22789 (MethodSignature.ToString): implement.
22791 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
22792 to the case where we reduced into a LongConstant.
22794 * decl.cs (CheckAccessLevel): If the type is an array, we can not
22795 depend on whether the information is acurrate, because the
22796 Microsoft runtime will always claim that the array type is public,
22797 regardless of the real state.
22799 If the type is a pointer, another problem happens: the type is
22800 reported as non-public in Microsoft.
22802 In both cases we have to call CheckAccessLevel recursively with
22803 the underlying type as the argument to be tested.
22805 2003-04-08 Miguel de Icaza <miguel@ximian.com>
22807 * assign.cs (Assign.Emit): If we are dealing with a compound
22808 assignment expression, we should use the code path that stores the
22809 intermediate result in a temporary value. This fixes #40903.
22811 *expression.cs (Indirection.ToString): Provide ToString method for
22814 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
22816 * class.cs: Null out fields holding references to Block objects so
22817 they can be garbage collected.
22819 * expression.cs (OverloadResolve): Remove unused local.
22821 2003-04-07 Martin Baulig <martin@ximian.com>
22823 * codegen.cs (EmitContext.CurrentFile): New public field.
22824 (EmitContext.Mark): Use the CurrentFile to check whether the
22825 location is in the correct file.
22826 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
22828 2003-04-07 Martin Baulig <martin@ximian.com>
22830 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
22832 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
22833 location. [FIXME: The location argument which gets passed to this
22834 method is sometimes wrong!]
22836 2003-04-07 Nick Drochak <ndrochak@gol.com>
22838 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
22840 2003-04-07 Miguel de Icaza <miguel@ximian.com>
22842 * expression.cs (Indirection.EmitAssign): We were using the
22843 temporary, but returning immediately instead of continuing the
22846 2003-04-06 Martin Baulig <martin@ximian.com>
22848 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
22849 if it's a nested child, but also deriving from the outer class.
22852 * typemanager.cs (IsNestedChildOf): Make this work if it's a
22853 nested child, but also deriving from the outer class. See
22855 (FilterWithClosure): We may access private members of the outer
22856 class if we're a nested child and deriving from the outer class.
22857 (RealMemberLookup): Only set `closure_private_ok' if the
22858 `original_bf' contained BindingFlags.NonPublic.
22860 2003-04-05 Martin Baulig <martin@ximian.com>
22862 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
22864 2003-04-02 Miguel de Icaza <miguel@ximian.com>
22866 * class.cs (Event.Define): Do not allow abstract events to have
22869 2003-04-01 Miguel de Icaza <miguel@ximian.com>
22871 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
22872 block in event declarations.
22874 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
22875 value type, get its address.
22877 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
22878 leaving a class on the stack instead of a boolean value (int
22879 0/1). Change the code so we compare against null, and then the
22880 result against zero.
22882 * class.cs (TypeContainer.GetClassBases): We were checking for the
22883 parent class being sealed too late.
22885 * expression.cs (Binary.Emit): For <= and >= when dealing with
22886 floating point values, use cgt.un and clt.un instead of cgt and
22889 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
22891 * statement.cs: Apply the same optimization as MS: skip the
22892 GetEnumerator returning an IEnumerator, and use the one returning a
22893 CharEnumerator instead. This allows us to avoid the try-finally block
22896 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
22898 * cs-parser.jay: Attributes cannot be applied to
22899 namespaces. Fixes #40473
22901 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22904 (Add*): check if the name is valid using the full name for constants,
22905 fields, properties and events.
22907 2003-03-28 Miguel de Icaza <miguel@ximian.com>
22909 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
22910 char constants to be part of the enumeration.
22912 * expression.cs (Conditional.DoResolve): Add support for operator
22913 true. Implements the missing functionality from 14.12
22915 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
22916 operator true/false as required by the spec.
22918 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
22919 implicit conversion to boolean.
22921 * statement.cs (Statement.ResolveBoolean): A boolean expression is
22922 also one where the type implements `operator true'.
22924 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
22925 get an expression that will invoke operator true based on an
22928 (GetConversionOperators): Removed the hack that called op_True
22931 (Expression.ResolveBoolean): Move this from Statement.
22933 2003-03-17 Miguel de Icaza <miguel@ximian.com>
22935 * ecore.cs (FieldExpr): do not allow initialization of initonly
22936 fields on derived classes
22938 2003-03-13 Martin Baulig <martin@ximian.com>
22940 * statement.cs (Block.Emit): Call ig.BeginScope() and
22941 ig.EndScope() when compiling with debugging info; call
22942 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
22944 2003-03-08 Miguel de Icaza <miguel@ximian.com>
22946 * expression.cs (Indexers): Do not construct immediately, allow
22947 for new members to be appended as we go. Fixes 38143
22949 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22951 * expression.cs: save/restore context when resolving an unchecked
22954 2003-03-05 Miguel de Icaza <miguel@ximian.com>
22956 * cfold.cs: Catch division by zero in modulus operator during
22959 2003-03-03 Miguel de Icaza <miguel@ximian.com>
22961 * interface.cs (Interface.DefineMembers): Avoid defining members
22964 2003-02-27 Miguel de Icaza <miguel@ximian.com>
22966 * driver.cs: handle the +/- options for -noconfig
22968 * statement.cs (Unckeched.Resolve): Also track the state of
22969 unchecked in the Resolve phase.
22971 2003-02-27 Martin Baulig <martin@ximian.com>
22973 * ecore.cs (Expression.MemberLookup): Don't create a
22974 MethodGroupExpr for something which is not a method. Fixes #38291.
22976 2003-02-25 Miguel de Icaza <miguel@ximian.com>
22978 * class.cs (MemberBase.CheckParameters): Also check that the type
22979 is unmanaged if it is a pointer.
22981 * expression.cs (SizeOf.Resolve): Add location information.
22983 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
22984 a managed type is declared.
22986 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
22987 parameter modifiers as well. Fixes bug 38606
22989 * class.cs: Very sad. Am backing out the speed up changes
22990 introduced by the ArrayList -> Array in the TypeContainer, as they
22991 were not actually that much faster, and introduced a bug (no error
22992 reports on duplicated methods).
22994 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
22995 source first, this will guarantee that we have a valid expression
22996 before calling in lower levels functions that will require a
22997 resolved object. Then use this original_source in the
22998 target.ResolveLValue instead of the original source that was
23001 Another change. Use target.Resolve instead of LValueResolve.
23002 Although we are resolving for LValues, we will let the Assign code
23003 take care of that (it will be called again from Resolve). This
23004 basically allows code like this:
23006 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
23007 class Y { void A (X x) { x [0] += o; }
23009 The problem was that the indexer was trying to resolve for
23010 set_Item (idx, object o) and never finding one. The real set_Item
23011 was set_Item (idx, X). By delaying the process we get the right
23016 2003-02-23 Martin Baulig <martin@ximian.com>
23018 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
23019 while calling DoEmit ().
23021 * codegen.cs (EmitContext.Mark): Don't mark locations in other
23022 source files; if you use the #line directive inside a method, the
23023 compiler stops emitting line numbers for the debugger until it
23024 reaches the end of the method or another #line directive which
23025 restores the original file.
23027 2003-02-23 Martin Baulig <martin@ximian.com>
23029 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
23031 2003-02-23 Martin Baulig <martin@ximian.com>
23033 * statement.cs (Block.AddChildVariableNames): We need to call this
23034 recursively, not just for our immediate children.
23036 2003-02-23 Martin Baulig <martin@ximian.com>
23038 * class.cs (Event.Define): Always make the field private, like csc does.
23040 * typemanager.cs (TypeManager.RealMemberLookup): Make events
23041 actually work, fixes bug #37521.
23043 2003-02-23 Miguel de Icaza <miguel@ximian.com>
23045 * delegate.cs: When creating the various temporary "Parameters"
23046 classes, make sure that we call the ComputeAndDefineParameterTypes
23047 on those new parameters (just like we do with the formal ones), to
23048 allow them to be resolved in the context of the DeclSpace.
23050 This fixes the bug that Dick observed in Bugzilla #38530.
23052 2003-02-22 Miguel de Icaza <miguel@ximian.com>
23054 * expression.cs (ResolveMemberAccess): When resolving a constant,
23055 do not attempt to pull a constant if the value was not able to
23056 generate a valid constant.
23058 * const.cs (LookupConstantValue): Do not report more errors than required.
23060 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23062 * expression.cs: fixes bug #38328.
23064 2003-02-18 Miguel de Icaza <miguel@ximian.com>
23066 * class.cs: Changed all the various members that can be part of a
23067 class from being an ArrayList to be an Array of the right type.
23068 During the DefineType type_list, interface_list, delegate_list and
23069 enum_list are turned into types, interfaces, delegates and enums
23072 And during the member population, indexer_list, event_list,
23073 constant_list, field_list, instance_constructor_list, method_list,
23074 operator_list and property_list are turned into their real arrays.
23076 Although we could probably perform this operation earlier, for
23077 good error reporting we need to keep the lists and remove the
23078 lists for longer than required.
23080 This optimization was triggered by Paolo profiling the compiler
23081 speed on the output of `gen-sample-program.pl' perl script.
23083 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
23084 not crash in methods like MemberLookupFailed that use this field.
23086 This problem arises when the compiler fails to resolve a type
23087 during interface type definition for example.
23089 2003-02-18 Miguel de Icaza <miguel@ximian.com>
23091 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
23092 inherit from System.Object, so we have to stop at null, not only
23093 when reaching System.Object.
23095 2003-02-17 Miguel de Icaza <miguel@ximian.com>
23097 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
23098 DeclaredOnly because the parent indexer might have had a different
23099 name, but did not loop until the top of the hierarchy was reached.
23101 The problem this one fixes is 35492: when a class implemented an
23102 indexer from an interface, we were getting the interface method
23103 (which was abstract) and we were flagging an error (can not invoke
23106 This also keeps bug 33089 functioning, and test-148 functioning.
23108 * typemanager.cs (IsSpecialMethod): The correct way of figuring
23109 out if a method is special is to see if it is declared in a
23110 property or event, or whether it is one of the predefined operator
23111 names. This should fix correctly #36804.
23113 2003-02-15 Miguel de Icaza <miguel@ximian.com>
23115 The goal here is to remove the dependency on EmptyCast.Peel ().
23116 Killing it completely.
23118 The problem is that currently in a number of places where
23119 constants are expected, we have to "probe" for an EmptyCast, and
23120 Peel, which is not the correct thing to do, as this will be
23121 repetitive and will likely lead to errors.
23123 The idea is to remove any EmptyCasts that are used in casts that
23124 can be reduced to constants, so we only have to cope with
23127 This bug hunt was triggered by Bug 37363 and the desire to remove
23128 the duplicate pattern where we were "peeling" emptycasts to check
23129 whether they were constants. Now constants will always be
23132 * ecore.cs: Use an enumconstant here instead of wrapping with
23135 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
23136 throwing me off. By handling this we can get rid of a few hacks.
23138 * statement.cs (Switch): Removed Peel() code.
23140 2003-02-14 Miguel de Icaza <miguel@ximian.com>
23142 * class.cs: Location information for error 508
23144 * expression.cs (New.DoResolve): Add a guard against double
23145 resolution of an expression.
23147 The New DoResolve might be called twice when initializing field
23148 expressions (see EmitFieldInitializers, the call to
23149 GetInitializerExpression will perform a resolve on the expression,
23150 and later the assign will trigger another resolution
23152 This leads to bugs (#37014)
23154 * delegate.cs: The signature for EndInvoke should contain any ref
23155 or out parameters as well. We were not doing this in the past.
23157 * class.cs (Field.Define): Do not overwrite the type definition
23158 inside the `volatile' group. Turns out that volatile enumerations
23159 were changing the type here to perform a validity test, which
23162 2003-02-12 Miguel de Icaza <miguel@ximian.com>
23164 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
23165 and structs, we do not want to load the instance variable
23167 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
23168 enum_type has to be handled like an object reference (implicit
23169 conversions exists from this to object), but the regular IsClass
23170 and IsValueType tests will never return true for this one.
23172 Also we use TypeManager.IsValueType instead of type.IsValueType,
23173 just for consistency with the rest of the code (this is only
23174 needed if we ever use the construct exposed by test-180.cs inside
23175 corlib, which we dont today).
23177 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
23179 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
23182 2003-02-09 Martin Baulig <martin@ximian.com>
23184 * namespace.cs (Namespace..ctor): Added SourceFile argument.
23185 (Namespace.DefineNamespaces): New static public method; this is
23186 called when we're compiling with debugging to add all namespaces
23187 to the symbol file.
23189 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
23190 pass it to the Namespace's .ctor.
23192 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
23193 and MethodBase arguments; pass the namespace ID to the symwriter;
23194 pass the MethodBase instead of the token to the symwriter.
23195 (SymbolWriter.DefineNamespace): New method to add a namespace to
23198 2003-02-09 Martin Baulig <martin@ximian.com>
23200 * symbolwriter.cs: New file. This is a wrapper around
23201 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
23202 methods here in near future.
23204 2003-02-09 Martin Baulig <martin@ximian.com>
23206 * codegen.cs (EmitContext.Mark): Just pass the arguments to
23207 ILGenerator.MarkSequencePoint() which are actually used by the
23210 2003-02-09 Martin Baulig <martin@ximian.com>
23212 * location.cs (SourceFile): New public sealed class. This
23213 contains the name and an index which is used in the location's token.
23214 (Location): Reserve an appropriate number of bits in the token for
23215 the source file instead of walking over that list, this gives us a
23216 really huge performance improvement when compiling with debugging.
23218 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
23219 `SourceFile' argument instead of a string.
23220 (Driver.ProcessFile): Add all the files via Location.AddFile(),
23221 but don't parse/tokenize here, we need to generate the list of all
23222 source files before we do that.
23223 (Driver.ProcessFiles): New static function. Parses/tokenizes all
23226 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
23227 instead of a string.
23229 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
23232 2003-02-09 Martin Baulig <martin@ximian.com>
23234 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
23235 filename on `#line default'.
23237 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
23239 * statement.cs: don't clear the pinned var when the fixed statement
23240 returns from the method (fixes bug#37752).
23242 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
23244 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
23247 2003-02-07 Martin Baulig <martin@ximian.com>
23249 * driver.cs: Removed the `--debug-args' command line argument.
23251 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
23252 automatically by the AsssemblyBuilder.
23253 (CodeGen.InitializeSymbolWriter): We don't need to call any
23254 initialization function on the symbol writer anymore. This method
23255 doesn't take any arguments.
23257 2003-02-03 Miguel de Icaza <miguel@ximian.com>
23259 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
23260 from referenced assemblies as well.
23262 2003-02-02 Martin Baulig <martin@ximian.com>
23264 * class.cs (MethodData.Emit): Generate debugging info for external methods.
23266 2003-02-02 Martin Baulig <martin@ximian.com>
23268 * class.cs (Constructor.Emit): Open the symbol writer before
23269 emitting the constructor initializer.
23270 (ConstructorInitializer.Emit): Call ec.Mark() to allow
23271 single-stepping through constructor initializers.
23273 2003-01-30 Miguel de Icaza <miguel@ximian.com>
23275 * class.cs: Handle error 549: do not allow virtual methods in
23278 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
23280 * decl.cs: Check access levels when resolving types
23282 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
23284 * statement.cs: Add parameters and locals set in catch blocks that might
23285 return to set vector
23287 2003-01-29 Miguel de Icaza <miguel@ximian.com>
23289 * class.cs (Operator): Set the SpecialName flags for operators.
23291 * expression.cs (Invocation.DoResolve): Only block calls to
23292 accessors and operators on SpecialName methods.
23294 (Cast.TryReduce): Handle conversions from char constants.
23297 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
23299 * statement.cs: small memory and time optimization in FlowBranching.
23301 2003-01-28 Pedro Mart <yoros@wanadoo.es>
23303 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
23304 problem that the last fix but in the other sid (Set).
23306 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
23307 access when there is no indexer in the hierarchy.
23309 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
23311 * class.cs: Combine some if statements.
23313 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23315 * driver.cs: fixed bug #37187.
23317 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
23319 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
23320 any indexer, it's needed to build a list with all the indexers in the
23321 hierarchy (AllGetters), else we have problems. Fixes #35653.
23323 2003-01-23 Miguel de Icaza <miguel@ximian.com>
23325 * class.cs (MethodData.Define): It is wrong for an interface
23326 implementation to be static in both cases: explicit and implicit.
23327 We were only handling this in one case.
23329 Improve the if situation there to not have negations.
23331 * class.cs (Field.Define): Turns out that we do not need to check
23332 the unsafe bit on field definition, only on usage. Remove the test.
23334 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23336 * driver.cs: use assembly.Location instead of Codebase (the latest
23337 patch made mcs fail when using MS assemblies).
23339 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
23341 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
23342 get the path to *corlib.dll.
23344 2003-01-21 Nick Drochak <ndrochak@gol.com>
23348 * typemanager.cs: Remove compiler warnings
23350 2003-01-20 Duncan Mak <duncan@ximian.com>
23352 * AssemblyInfo.cs: Bump the version number to 0.19.
23354 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23356 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
23358 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
23360 * class.cs (Constructor::Emit): Emit debugging info for constructors.
23362 2003-01-17 Miguel de Icaza <miguel@ximian.com>
23364 * cs-parser.jay: Small fix: we were not comparing the constructor
23365 name correctly. Thanks to Zoltan for the initial pointer.
23367 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
23369 * cs-tokenizer.cs: Set file name when specified with #line
23371 2003-01-15 Miguel de Icaza <miguel@ximian.com>
23373 * cs-parser.jay: Only perform the constructor checks here if we
23374 are named like the class; This will help provider a better
23375 error. The constructor path is taken when a type definition is
23376 not found, but most likely the user forgot to add the type, so
23377 report that rather than the constructor error.
23379 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
23381 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
23384 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23386 * cs-parser.jay: Add cleanup call.
23388 2003-01-13 Duncan Mak <duncan@ximian.com>
23390 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
23391 consistent with other methods.
23393 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23395 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
23397 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
23399 * attribute.cs: only set GuidAttr to true when we have a
23402 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23406 * typemanager.cs: fixes to allow mcs compile corlib with the new
23407 Type.IsSubclassOf fix.
23409 2003-01-08 Miguel de Icaza <miguel@ximian.com>
23411 * expression.cs (LocalVariableReference.DoResolve): Classify a
23412 constant as a value, not as a variable. Also, set the type for
23415 * cs-parser.jay (fixed_statement): take a type instead of a
23416 pointer_type, so we can produce a better error message later.
23418 * statement.cs (Fixed.Resolve): Flag types that are not pointers
23421 (For.DoEmit): Make inifinite loops have a
23422 non-conditional branch back.
23424 (Fixed.DoEmit): First populate the pinned variables, then emit the
23425 statement, then clear the variables. Before I was emitting the
23426 code once for each fixed piece.
23429 2003-01-08 Martin Baulig <martin@ximian.com>
23431 * statement.cs (FlowBranching.MergeChild): A break in a
23432 SWITCH_SECTION does not leave a loop. Fixes #36155.
23434 2003-01-08 Martin Baulig <martin@ximian.com>
23436 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
23437 lives in the same number space than `param_map'. Fixes #36154.
23439 2003-01-07 Miguel de Icaza <miguel@ximian.com>
23441 * cs-parser.jay (constructor_declaration): Set the
23442 Constructor.ModFlags before probing for it. This makes the
23443 compiler report 514, 515 and 132 (the code was there, but got
23446 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
23447 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
23448 (GotoCase.Resolve): Set `Returns' to ALWAYS.
23450 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
23452 * enum.cs: create the enum static fields using the enum type.
23454 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
23456 * class.cs: don't try to create the ParamBuilder for the return
23457 type if it's not needed (and handle it breaking for the ms runtime
23460 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
23462 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
23464 2002-12-29 Miguel de Icaza <miguel@ximian.com>
23466 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
23467 the command. This showed up while compiling the JANET source
23468 code, which used \r as its only newline separator.
23470 2002-12-28 Miguel de Icaza <miguel@ximian.com>
23472 * class.cs (Method.Define): If we are an operator (because it
23473 reuses our code), then set the SpecialName and HideBySig. #36128
23475 2002-12-22 Miguel de Icaza <miguel@ximian.com>
23477 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
23478 exception, report error 120 `object reference required'.
23480 * driver.cs: Add --pause option, used during to measure the size
23481 of the process as it goes with --timestamp.
23483 * expression.cs (Invocation.DoResolve): Do not allow methods with
23484 SpecialName to be invoked.
23486 2002-12-21 Miguel de Icaza <miguel@ximian.com>
23488 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
23489 number before adding it.
23491 2002-12-21 Ravi Pratap <ravi@ximian.com>
23493 * ecore.cs (StandardImplicitConversion): When in an unsafe
23494 context, we allow conversion between void * to any other pointer
23495 type. This fixes bug #35973.
23497 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
23499 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
23500 is not thrown when extensionless outputs are used
23502 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23504 * rootcontext.cs: fixed compilation of corlib.
23506 2002-12-19 Miguel de Icaza <miguel@ximian.com>
23508 * attribute.cs (Attributes.Contains): Add new method.
23510 * class.cs (MethodCore.LabelParameters): if the parameter is an
23511 `out' parameter, check that no attribute `[In]' has been passed.
23513 * enum.cs: Handle the `value__' name in an enumeration.
23515 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
23517 * decl.cs: Added special case to allow overrides on "protected
23520 2002-12-18 Ravi Pratap <ravi@ximian.com>
23522 * attribute.cs (Attributes.AddAttributeSection): Rename to this
23523 since it makes much more sense.
23525 (Attributes.ctor): Don't require a Location parameter.
23527 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
23529 * attribute.cs (ApplyAttributes): Remove extra Location parameters
23530 since we already have that information per attribute.
23532 * everywhere : make appropriate changes.
23534 * class.cs (LabelParameters): Write the code which actually
23535 applies attributes to the return type. We can't do this on the MS
23536 .NET runtime so we flag a warning in the case an exception is
23539 2002-12-18 Miguel de Icaza <miguel@ximian.com>
23541 * const.cs: Handle implicit null conversions here too.
23543 2002-12-17 Ravi Pratap <ravi@ximian.com>
23545 * class.cs (MethodCore.LabelParameters): Remove the extra
23546 Type [] parameter since it is completely unnecessary. Instead
23547 pass in the method's attributes so that we can extract
23548 the "return" attribute.
23550 2002-12-17 Miguel de Icaza <miguel@ximian.com>
23552 * cs-parser.jay (parse): Use Report.Error to flag errors instead
23553 of ignoring it and letting the compile continue.
23555 * typemanager.cs (ChangeType): use an extra argument to return an
23556 error condition instead of throwing an exception.
23558 2002-12-15 Miguel de Icaza <miguel@ximian.com>
23560 * expression.cs (Unary.TryReduce): mimic the code for the regular
23561 code path. Perform an implicit cast in the cases where we can
23562 implicitly convert to one of the integral types, and then reduce
23563 based on that constant. This fixes bug #35483.
23565 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23567 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
23569 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23571 * namespace.cs: fixed bug #35489.
23573 2002-12-12 Miguel de Icaza <miguel@ximian.com>
23575 * class.cs: Remove some dead code.
23577 * cs-parser.jay: Estimate the number of methods needed
23578 (RootContext.MethodCount);
23580 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
23581 numbers instead of StringBuilders.
23583 * support.cs (PtrHashtable): Add constructor with initial size;
23584 We can now reduce reallocations of the method table.
23586 2002-12-10 Ravi Pratap <ravi@ximian.com>
23588 * attribute.cs (ApplyAttributes): Keep track of the emitted
23589 attributes on a per-target basis. This fixes bug #35413.
23591 2002-12-10 Miguel de Icaza <miguel@ximian.com>
23593 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
23594 default to the Windows 1252 encoding.
23596 (UnixParseOption): Support version, thanks to Alp for the missing
23599 * AssemblyInfo.cs: Add nice assembly information.
23601 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
23604 * cs-parser.jay: Allow a trailing comma before the close bracked
23605 in the attribute_section production.
23607 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
23608 address of the instance was being taken, I will take this out,
23609 because we take the address of the object immediately here.
23611 2002-12-09 Ravi Pratap <ravi@ximian.com>
23613 * typemanager.cs (AreMultipleAllowed): Take care of the most
23614 obvious case where attribute type is not in the current assembly -
23617 2002-12-08 Miguel de Icaza <miguel@ximian.com>
23619 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
23620 definitions, instead of doing that afterwards.
23622 Also we use a nice little hack, depending on the constructor, we
23623 know if we are a "composed" name or a simple name. Hence, we
23624 avoid the IndexOf test, and we avoid
23626 * codegen.cs: Add code to assist in a bug reporter to track down
23627 the source of a compiler crash.
23629 2002-12-07 Ravi Pratap <ravi@ximian.com>
23631 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
23632 types have been emitted for a given element and flag an error
23633 if something which does not have AllowMultiple set is used more
23636 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
23637 attribute types and their corresponding AllowMultiple properties
23639 (AreMultipleAllowed): Check the property for a given type.
23641 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
23642 property in the case we have a TypeContainer.
23644 (Attributes.AddAttribute): Detect duplicates and just skip on
23645 adding them. This trivial fix catches a pretty gross error in our
23646 attribute emission - global attributes were being emitted twice!
23648 Bugzilla bug #33187 is now fixed.
23650 2002-12-06 Miguel de Icaza <miguel@ximian.com>
23652 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
23653 instead of pp_and).
23655 * expression.cs (Binary.ResolveOperator): I can only use the
23656 Concat (string, string, string) and Concat (string, string,
23657 string, string) if the child is actually a concatenation of
23660 2002-12-04 Miguel de Icaza <miguel@ximian.com>
23662 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
23663 context where we need a 2-character lookahead.
23665 * pending.cs (PendingImplementation): Rework so we can keep track
23666 of interface types all the time, and flag those which were
23667 implemented by parents as optional.
23669 2002-12-03 Miguel de Icaza <miguel@ximian.com>
23671 * expression.cs (Binary.ResolveOperator): Use
23672 String.Concat(string,string,string) or
23673 String.Concat(string,string,string,string) when possible.
23675 * typemanager: More helper methods.
23678 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
23680 * pending.cs: remove the bogus return from GetMissingInterfaces()
23681 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
23683 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23685 * namespace.cs: avoid duplicated 'using xxx' being added to
23686 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
23687 when we get more than one 'using' statement for the same namespace.
23688 Report a CS0105 warning for it.
23690 2002-11-30 Miguel de Icaza <miguel@ximian.com>
23692 * cs-tokenizer.cs (consume_identifier): use read directly, instead
23693 of calling getChar/putback, uses internal knowledge of it.
23695 (xtoken): Reorder tokenizer so most common patterns are checked
23696 first. This reduces the compilation time in another 5% (from 8.11s
23697 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
23699 The parsing time is 22% of the compilation in mcs, and from that
23700 64% is spent on the tokenization process.
23702 I tried using a binary search for keywords, but this is slower
23703 than the hashtable. Another option would be to do a couple of
23706 * Not use a StringBuilder, instead use an array of chars,
23707 with a set value. Notice that this way we could catch
23708 the 645 error without having to do it *afterwards*.
23710 * We could write a hand-parser to avoid the hashtable
23711 compares altogether.
23713 The identifier consumption process takes 37% of the tokenization
23714 time. Another 15% is spent on is_number. 56% of the time spent
23715 on is_number is spent on Int64.Parse:
23717 * We could probably choose based on the string length to
23718 use Int32.Parse or Int64.Parse and avoid all the 64-bit
23721 Another 3% is spend on wrapping `xtoken' in the `token' function.
23723 Handle 0xa0 as whitespace (#34752)
23725 2002-11-26 Miguel de Icaza <miguel@ximian.com>
23727 * typemanager.cs (IsCLRType): New routine to tell whether a type
23728 is one of the builtin types.
23730 Maybe it needs to use TypeCodes to be faster. Maybe we could use
23731 typecode in more places instead of doing pointer comparissions.
23732 We could leverage some knowledge about the way the typecodes are
23735 New code to cache namespaces in assemblies, it is currently not
23736 invoked, to be used soon.
23738 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
23740 * expression.cs (Binary.ResolveOperator): specially handle
23741 strings, and do not perform user-defined operator overloading for
23744 2002-11-24 Miguel de Icaza <miguel@ximian.com>
23746 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
23747 internalcall as it is a pretty simple operation; Avoid whenever
23748 possible to call Char.IsLetter.
23750 (consume_identifier): Cut by half the number of
23751 hashtable calls by merging the is_keyword and GetKeyword behavior.
23753 Do not short-circuit, because if we do, we
23754 report errors (ie, #if false && true would produce an invalid
23758 2002-11-24 Martin Baulig <martin@ximian.com>
23760 * expression.cs (Cast.TryReduce): If we're in checked syntax,
23761 check constant ranges and report a CS0221. Fixes #33186.
23763 2002-11-24 Martin Baulig <martin@ximian.com>
23765 * cs-parser.jay: Make this work for uninitialized variable
23766 declarations in the `for' initializer. Fixes #32416.
23768 2002-11-24 Martin Baulig <martin@ximian.com>
23770 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
23771 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
23773 2002-11-24 Martin Baulig <martin@ximian.com>
23775 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
23776 argument; if true, we also check for user-defined conversions.
23777 This is only needed if both arguments are of a user-defined type.
23778 Fixes #30443, added test-175.cs.
23779 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
23781 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
23783 2002-11-24 Martin Baulig <martin@ximian.com>
23785 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
23786 function to get the store opcode.
23787 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
23788 only emit the Ldelema if the store opcode is Stobj. You must run
23789 both test-34 and test-167 to test this. Fixes #34529.
23791 2002-11-23 Martin Baulig <martin@ximian.com>
23793 * ecore.cs (Expression.MemberLookup): Added additional
23794 `qualifier_type' argument which is used when we're being called
23795 from MemberAccess.DoResolve() and null if we're called from a
23797 (Expression.MemberLookupFailed): New method to report errors; this
23798 does the CS1540 check and reports the correct error message.
23800 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
23801 argument for the CS1540 check and redone the way how we're dealing
23802 with private members. See the comment in the source code for details.
23803 (FilterWithClosure): Reverted this back to revision 1.197; renamed
23804 `closure_start_type' to `closure_qualifier_type' and check whether
23805 it's not null. It was not this filter being broken, it was just
23806 being called with the wrong arguments.
23808 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
23809 and pass it the correct `qualifier_type'; this also does the error
23812 2002-11-22 Miguel de Icaza <miguel@ximian.com>
23814 * expression.cs (Invocation.EmitParams): If the we are dealing
23815 with a non-built-in value type, load its address as well.
23817 (ArrayCreation): Use a a pretty constant instead
23818 of the hardcoded value 2. Use 6 instead of 2 for the number of
23819 static initializers.
23821 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
23822 because they are not really value types, just glorified integers.
23824 * driver.cs: Do not append .exe, the CSC compiler does not do it.
23826 * ecore.cs: Remove redundant code for enumerations, make them use
23827 the same code path as everything else, fixes the casting issue
23828 with enumerations in Windows.Forms.
23830 * attribute.cs: Do only cast to string if it is a string, the
23831 validation happens later.
23833 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
23834 people upgrade their corlibs.
23836 * ecore.cs: Oops, enumerations were not following the entire code path
23838 2002-11-21 Miguel de Icaza <miguel@ximian.com>
23840 * typemanager.cs (FilterWithClosure): Commented out the test for
23841 1540 in typemanager.cs, as it has problems when accessing
23842 protected methods from a parent class (see test-174.cs).
23844 * attribute.cs (Attribute.ValidateGuid): new method.
23845 (Attribute.Resolve): Use above.
23847 2002-11-19 Miguel de Icaza <miguel@ximian.com>
23849 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
23851 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
23852 handling for enumerations, as we only needed the TypeContainer
23853 functionality to begin with (this is required for the fix below to
23854 work for enums that reference constants in a container class for
23857 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
23859 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
23860 a valid TypeBuilder to perform lookups on.o
23862 * class.cs (InheritableMemberSignatureCompare): Use true in the
23863 call to GetGetMethod and GetSetMethod, because we are comparing
23864 the signature, and we need to get the methods *even* if they are
23867 (PropertyBase.CheckBase): ditto.
23869 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
23870 GotoCase.Resolve): Use Peel on EmpytCasts.
23872 * ecore.cs (EmptyCast): drop child, add Peel method.
23874 2002-11-17 Martin Baulig <martin@ximian.com>
23876 * ecore.cs (EmptyCast.Child): New public property.
23878 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
23879 label resolved to an EmptyCast. Fixes #34162.
23880 (GotoCase.Resolve): Likewise.
23881 (Block.EmitMeta): Likewise.
23883 2002-11-17 Martin Baulig <martin@ximian.com>
23885 * expression.cs (Invocation.BetterConversion): Prefer int over
23886 uint; short over ushort; long over ulong for integer literals.
23887 Use ImplicitConversionExists instead of StandardConversionExists
23888 since we also need to check for user-defined implicit conversions.
23889 Fixes #34165. Added test-173.cs.
23891 2002-11-16 Martin Baulig <martin@ximian.com>
23893 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
23894 with the `true' and `false' literals. Fixes #33151.
23896 2002-11-16 Martin Baulig <martin@ximian.com>
23898 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
23899 October 22nd; don't do the cs1540 check for static members.
23901 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
23902 now using our own filter here and doing the cs1540 check again.
23904 2002-11-16 Martin Baulig <martin@ximian.com>
23906 * support.cs (InternalParameters): Don't crash if we don't have
23907 any fixed parameters. Fixes #33532.
23909 2002-11-16 Martin Baulig <martin@ximian.com>
23911 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
23912 when looking up static methods to make this work on Windows.
23915 2002-11-16 Martin Baulig <martin@ximian.com>
23917 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
23918 a setter rather than using PropertyInfo.CanWrite.
23920 2002-11-15 Nick Drochak <ndrochak@gol.com>
23922 * class.cs: Allow acces to block member by subclasses. Fixes build
23925 2002-11-14 Martin Baulig <martin@ximian.com>
23927 * class.cs (Constructor.Emit): Added the extern/block check.
23930 2002-11-14 Martin Baulig <martin@ximian.com>
23932 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
23933 iteration while looking for indexers, this is needed because the
23934 indexer may have a different name in our base classes. Fixed the
23935 error reporting (no indexers at all, not get accessor, no
23936 overloaded match). Fixes bug #33089.
23937 (IndexerAccess.DoResolveLValue): Likewise.
23939 2002-11-14 Martin Baulig <martin@ximian.com>
23941 * class.cs (PropertyBase.CheckBase): Make this work for multiple
23942 indexers. Fixes the first part of bug #33089.
23943 (MethodSignature.InheritableMemberSignatureCompare): Added support
23946 2002-11-13 Ravi Pratap <ravi@ximian.com>
23948 * attribute.cs (Attribute.Resolve): Catch the
23949 NullReferenceException and report it since it isn't supposed to
23952 2002-11-12 Miguel de Icaza <miguel@ximian.com>
23954 * expression.cs (Binary.EmitBranchable): Also handle the cases for
23955 LogicalOr and LogicalAnd that can benefit from recursively
23956 handling EmitBranchable. The code now should be nice for Paolo.
23958 2002-11-08 Miguel de Icaza <miguel@ximian.com>
23960 * typemanager.cs (LookupType): Added a negative-hit hashtable for
23961 the Type lookups, as we perform quite a number of lookups on
23962 non-Types. This can be removed once we can deterministically tell
23963 whether we have a type or a namespace in advance.
23965 But this might require special hacks from our corlib.
23969 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
23970 and double which avoids a conversion from an integer to a double.
23972 * expression.cs: tiny optimization, avoid calling IsConstant,
23973 because it effectively performs the lookup twice.
23975 2002-11-06 Miguel de Icaza <miguel@ximian.com>
23977 But a bogus return here to keep the semantics of the old code
23978 until the Mono runtime is fixed.
23980 * pending.cs (GetMissingInterfaces): New method used to remove all
23981 the interfaces that are already implemented by our parent
23982 classes from the list of pending methods.
23984 * interface.cs: Add checks for calls after ResolveTypeExpr.
23986 2002-11-05 Miguel de Icaza <miguel@ximian.com>
23988 * class.cs (Class.Emit): Report warning 67: event not used if the
23989 warning level is beyond 3.
23991 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
23992 being a NullLiteral.
23994 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
23997 * class.cs (TypeContainer.GetClassBases): Cover a missing code
23998 path that might fail if a type can not be resolved.
24000 * expression.cs (Binary.Emit): Emit unsigned versions of the
24003 * driver.cs: use error 5.
24005 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
24007 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
24009 2002-11-01 Miguel de Icaza <miguel@ximian.com>
24011 * cs-parser.jay (switch_section): A beautiful patch from Martin
24012 Baulig that fixed 33094.
24014 2002-10-31 Miguel de Icaza <miguel@ximian.com>
24016 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
24017 Check whether the base is abstract and report an error if so.
24019 * expression.cs (IndexerAccess.DoResolveLValue,
24020 IndexerAccess.DoResolve): ditto.
24022 (Invocation.DoResolve): ditto.
24024 (Invocation.FullMethodDesc): Improve the report string.
24026 * statement.cs (Block): Eliminate IsVariableDefined as it is
24027 basically just a wrapper for GetVariableInfo.
24029 * ecore.cs (SimpleName): Use new
24031 * support.cs (ReflectionParamter.ParameterType): We unwrap the
24032 type, as we return the actual parameter ref/unref state on a
24035 2002-10-30 Miguel de Icaza <miguel@ximian.com>
24037 * support.cs: Return proper flags REF/OUT fixing the previous
24040 * expression.cs: Reverted last patch, that was wrong. Is_ref is
24041 not used to mean `ref' but `ref or out' in ParameterReference
24043 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
24044 full type signature instead of calling TypeManger.CSharpName
24047 * support.cs (InternalParameters.ParameterDesc): Do not compare
24048 directly to the modflags, because REF/OUT will actually be bitsets
24051 * delegate.cs (VerifyMethod): Check also the modifiers.
24053 * cs-tokenizer.cs: Fix bug where floating point values with an
24054 exponent where a sign was missing was ignored.
24056 * driver.cs: Allow multiple assemblies to be specified in a single
24059 2002-10-28 Miguel de Icaza <miguel@ximian.com>
24061 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
24062 because identifiers after a parenthesis would end up in this kind
24063 of production, and we needed to desamiguate it for having casts
24066 (UserDefinedType *) xxx
24068 2002-10-24 Miguel de Icaza <miguel@ximian.com>
24070 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
24071 we should set on the Bindingflags.NonPublic, but not turn on
24072 private_ok. private_ok controls whether a Private member is
24073 returned (this is chekced on the filter routine), while the
24074 BindingFlags.NonPublic just controls whether private/protected
24075 will be allowed. This fixes the problem part of the problem of
24076 private properties being allowed to be used in derived classes.
24078 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
24079 so we can call the children DoResolveLValue method (this will
24080 properly signal errors on lvalue assignments to base properties)
24082 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
24083 getter are null, and we have a property info, we know that this
24084 happened because the lookup failed, so we report an error 122 for
24085 protection level violation.
24087 We also silently return if setter and getter are null in the
24088 resolve functions, this condition only happens if we have flagged
24089 the error before. This is the other half of the problem.
24091 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
24092 not have accessibility information, that is why we were returning
24093 true in the filter function in typemanager.cs.
24095 To properly report 122 (property is inaccessible because of its
24096 protection level) correctly, we report this error in ResolveAccess
24097 by failing if both the setter and the getter are lacking (ie, the
24100 DoResolve and DoLResolve have been modified to check for both
24101 setter/getter being null and returning silently, the reason being
24102 that I did not want to put the knowledge about this error in upper
24105 int old = Report.Errors;
24106 x = new PropertyExpr (...);
24107 if (old != Report.Errors)
24112 So the property expr is returned, but it is invalid, so the error
24113 will be flagged during the resolve process.
24115 * class.cs: Remove InheritablePropertySignatureCompare from the
24116 class, as we no longer depend on the property signature to compute
24117 whether it is possible to implement a method or not.
24119 The reason is that calling PropertyInfo.GetGetMethod will return
24120 null (in .NET, in Mono it works, and we should change this), in
24121 cases where the Get Method does not exist in that particular
24126 class X { public virtual int A { get { return 1; } } }
24128 class Z : Y { public override int A { get { return 2; } } }
24130 Would fail in Z because the parent (Y) would not have the property
24131 defined. So we avoid this completely now (because the alternative
24132 fix was ugly and slow), and we now depend exclusively on the
24135 (PropertyBase.CheckBase): Use a method-base mechanism to find our
24136 reference method, instead of using the property.
24138 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
24139 routines are gone now.
24141 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
24142 names, they were incorrectly named.
24144 * cs-tokenizer.cs: Return are more gentle token on failure.
24146 * pending.cs (PendingImplementation.InterfaceMethod): This routine
24147 had an out-of-sync index variable, which caused it to remove from
24148 the list of pending methods the wrong method sometimes.
24150 2002-10-22 Miguel de Icaza <miguel@ximian.com>
24152 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
24153 CanWrite, because those refer to this particular instance of the
24154 property, and do not take into account the fact that we can
24155 override single members of a property.
24157 Constructor requires an EmitContext. The resolution process does
24158 not happen here, but we need to compute the accessors before,
24159 because the resolution does not always happen for properties.
24161 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
24162 subclass, before we did not update this flag, but we did update
24165 (GetAccessors): Drop this routine, as it did not work in the
24166 presence of partially overwritten set/get methods.
24168 Notice that this broke the cs1540 detection, but that will require
24171 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24175 * driver.cs: issue a warning instead of an error if we don't support
24176 debugging for the platform. Also ignore a couple of errors that may
24177 arise when trying to write the symbols. Undo my previous patch.
24179 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24181 * driver.cs: ignore /debug switch except for Unix platforms.
24183 2002-10-23 Nick Drochak <ndrochak@gol.com>
24185 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
24187 2002-10-21 Miguel de Icaza <miguel@ximian.com>
24189 * driver.cs: Do not make mcs-debug conditional, so we do not break
24190 builds that use it.
24192 * statement.cs (UsageVector.MergeChildren): I would like Martin to
24193 review this patch. But basically after all the children variables
24194 have been merged, the value of "Breaks" was not being set to
24195 new_breaks for Switch blocks. I think that it should be set after
24196 it has executed. Currently I set this to the value of new_breaks,
24197 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
24198 conservative, but I do not understand this code very well.
24200 I did not break anything in the build, so that is good ;-)
24202 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
24204 2002-10-20 Mark Crichton <crichton@gimp.org>
24206 * cfold.cs: Fixed compile blocker. Really fixed it this time.
24208 2002-10-20 Nick Drochak <ndrochak@gol.com>
24210 * cfold.cs: Fixed compile blocker.
24212 2002-10-20 Miguel de Icaza <miguel@ximian.com>
24214 * driver.cs: I was chekcing the key, not the file.
24216 2002-10-19 Ravi Pratap <ravi@ximian.com>
24218 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
24219 message that we were generating - we just need to silently return
24222 2002-10-19 Miguel de Icaza <miguel@ximian.com>
24224 * class.cs (Event.Define): Change my previous commit, as this
24225 breaks the debugger. This is a temporary hack, as it seems like
24226 the compiler is generating events incorrectly to begin with.
24228 * expression.cs (Binary.ResolveOperator): Added support for
24229 "U operator - (E x, E y)"
24231 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
24234 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
24235 init-only variables, but this path did not take into account that
24236 there might be also instance readonly variables. Correct this
24239 This fixes bug 32253
24241 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
24244 * driver.cs: Change the extension for modules to `netmodule'
24246 * cs-parser.jay: Improved slightly the location tracking for
24247 the debugger symbols.
24249 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
24250 modifiers that were specified instead of the hardcoded value
24251 (FamAndAssem). This was basically ignoring the static modifier,
24252 and others. Fixes 32429.
24254 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
24255 fixed a bug in the process (32476)
24257 * expression.cs (ArrayAccess.EmitAssign): Patch from
24258 hwang_rob@yahoo.ca that fixes bug 31834.3
24260 2002-10-18 Miguel de Icaza <miguel@ximian.com>
24262 * driver.cs: Make the module extension .netmodule.
24264 2002-10-16 Miguel de Icaza <miguel@ximian.com>
24266 * driver.cs: Report an error if the resource file is not found
24267 instead of crashing.
24269 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
24270 false, like Emit does.
24272 2002-10-16 Nick Drochak <ndrochak@gol.com>
24274 * typemanager.cs: Remove unused private member. Also reported mcs
24275 bug to report this as a warning like csc.
24277 2002-10-15 Martin Baulig <martin@gnome.org>
24279 * statement.cs (Statement.Emit): Made this a virtual method; emits
24280 the line number info and calls DoEmit().
24281 (Statement.DoEmit): New protected abstract method, formerly knows
24282 as Statement.Emit().
24284 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
24286 2002-10-11 Miguel de Icaza <miguel@ximian.com>
24288 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
24289 have fixed a remaining problem: not every AddXXXX was adding a
24290 fully qualified name.
24292 Now everyone registers a fully qualified name in the DeclSpace as
24293 being defined instead of the partial name.
24295 Downsides: we are slower than we need to be due to the excess
24296 copies and the names being registered this way.
24298 The reason for this is that we currently depend (on the corlib
24299 bootstrap for instance) that types are fully qualified, because
24300 we dump all the types in the namespace, and we should really have
24301 types inserted into the proper namespace, so we can only store the
24302 basenames in the defined_names array.
24304 2002-10-10 Martin Baulig <martin@gnome.org>
24306 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
24307 from bug #31834, see the bug report for a testcase which is
24310 2002-10-10 Martin Baulig <martin@gnome.org>
24312 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
24313 flow analysis code for this.
24315 * statement.cs (Do, While, For): Tell the flow analysis code about
24317 (FlowBranching.UsageVector): Added support for infinite loops.
24318 (Block.Resolve): Moved the dead code elimination here and use flow
24321 2002-10-09 Miguel de Icaza <miguel@ximian.com>
24323 * class.cs (Field.Define): Catch cycles on struct type
24326 * typemanager.cs (IsUnmanagedtype): Do not recursively check
24327 fields if the fields are static. We only need to check instance
24330 * expression.cs (As.DoResolve): Test for reference type.
24332 * statement.cs (Using.ResolveExpression): Use
24333 ConvertImplicitRequired, not ConvertImplicit which reports an
24335 (Using.ResolveLocalVariableDecls): ditto.
24337 * expression.cs (Binary.ResolveOperator): Report errors in a few
24338 places where we had to.
24340 * typemanager.cs (IsUnmanagedtype): Finish implementation.
24342 2002-10-08 Miguel de Icaza <miguel@ximian.com>
24344 * expression.cs: Use StoreFromPtr instead of extracting the type
24345 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
24347 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
24348 an enumeration value to a System.Enum, but System.Enum is not a
24349 value type, but an class type, so we need to box.
24351 (Expression.ConvertExplicit): One codepath could return
24352 errors but not flag them. Fix this. Fixes #31853
24354 * parameter.cs (Resolve): Do not allow void as a parameter type.
24356 2002-10-06 Martin Baulig <martin@gnome.org>
24358 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
24359 if it's a class type and not a struct. Fixes #31815.
24361 2002-10-06 Martin Baulig <martin@gnome.org>
24363 * statement.cs: Reworked the flow analysis code a bit to make it
24364 usable for dead code elimination.
24366 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24368 * cs-parser.jay: allow empty source files. Fixes bug #31781.
24370 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24372 * expression.cs (ComposedCast.DoResolveType): A quick workaround
24373 to fix the test 165, will investigate deeper.
24375 2002-10-04 Martin Baulig <martin@gnome.org>
24377 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
24378 finally blocks actually work.
24379 (Try.Resolve): We don't need to create a sibling for `finally' if
24380 there is no finally block.
24382 2002-10-04 Martin Baulig <martin@gnome.org>
24384 * class.cs (Constructor.Define): The default accessibility for a
24385 non-default constructor is private, not public.
24387 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24389 * class.cs (Constructor): Make AllowedModifiers public, add
24392 * cs-parser.jay: Perform the modifiers test here, as the
24393 constructor for the Constructor class usually receives a zero
24394 because of the way we create it (first we create, later we
24395 customize, and we were never checking the modifiers).
24397 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
24398 is a version of LookupTypeReflection that includes the type-name
24399 cache. This can be used as a fast path for functions that know
24400 the fully qualified name and are only calling into *.GetType() to
24401 obtain a composed type.
24403 This is also used by TypeManager.LookupType during its type
24406 (LookupType): We now also track the real type name, as sometimes
24407 we can get a quey for the real type name from things like
24408 ComposedCast. This fixes bug 31422.
24410 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
24411 complete type fullname, it does not have to go through the type
24412 resolution system to obtain the composed version of the type (for
24413 obtaining arrays or pointers).
24415 (Conditional.Emit): Use the EmitBoolExpression to
24416 generate nicer code, as requested by Paolo.
24418 (ArrayCreation.CheckIndices): Use the patch from
24419 hwang_rob@yahoo.ca to validate the array initializers.
24421 2002-10-03 Miguel de Icaza <miguel@ximian.com>
24423 * class.cs (ConstructorInitializer.Emit): simplify code by using
24424 Invocation.EmitCall, and at the same time, fix the bugs in calling
24425 parent constructors that took variable arguments.
24427 * ecore.cs (Expression.ConvertNumericExplicit,
24428 Expression.ImplicitNumericConversion): Remove the code that
24429 manually wrapped decimal (InternalTypeConstructor call is now gone
24432 * expression.cs (Cast.TryReduce): Also handle decimal types when
24433 trying to perform a constant fold on the type.
24435 * typemanager.cs (IsUnmanagedtype): Partially implemented.
24437 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
24438 that only turned off an error report, and did nothing else.
24440 2002-10-02 Miguel de Icaza <miguel@ximian.com>
24442 * driver.cs: Handle and ignore /fullpaths
24444 2002-10-01 Miguel de Icaza <miguel@ximian.com>
24446 * expression.cs (Binary.ResolveOperator): Catch the case where
24447 DoNumericPromotions returns true,
24449 (Binary.DoNumericPromotions): Simplify the code, and the tests.
24451 2002-09-27 Miguel de Icaza <miguel@ximian.com>
24453 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
24456 2002-09-26 Miguel de Icaza <miguel@ximian.com>
24458 * ecore.cs (ConvertNumericExplicit): It is not enough that the
24459 conversion exists, but it is also required that the conversion be
24460 performed. This manifested in "(Type64Enum) 2".
24462 * class.cs (TypeManager.AddMethod): The fix is not to change
24463 AddEnum, because that one was using a fully qualified name (every
24464 DeclSpace derivative does), but to change the AddMethod routine
24465 that was using an un-namespaced name. This now correctly reports
24466 the duplicated name.
24468 Revert patch until I can properly fix it. The issue
24469 is that we have a shared Type space across all namespaces
24470 currently, which is wrong.
24472 Options include making the Namespace a DeclSpace, and merge
24473 current_namespace/current_container in the parser.
24475 2002-09-25 Miguel de Icaza <miguel@ximian.com>
24477 * cs-parser.jay: Improve error reporting when we get a different
24478 kind of expression in local_variable_type and
24479 local_variable_pointer_type.
24481 Propagate this to avoid missleading errors being reported.
24483 * ecore.cs (ImplicitReferenceConversion): treat
24484 TypeManager.value_type as a target just like object_type. As
24489 Is valid, and needs to result in the int 1 being boxed before it
24490 is assigned to the value type v.
24492 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
24493 to validate the enumeration name.
24495 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
24496 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
24497 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
24499 * ecore.cs (TryImplicitIntConversion): When doing an
24500 implicit-enumeration-conversion, check if the type is 64-bits and
24501 perform a conversion before passing to EnumConstant.
24503 2002-09-23 Miguel de Icaza <miguel@ximian.com>
24505 * decl.cs (Error_AmbiguousTypeReference); New routine used to
24506 report ambiguous type references. Unlike the MS version, we
24507 report what the ambiguity is. Innovation at work ;-)
24509 (DeclSpace.FindType): Require a location argument to
24510 display when we display an ambiguous error.
24512 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
24514 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
24516 * expression.cs (EmitDynamicInitializers): Apply patch from
24517 hwang_rob@yahoo.ca that fixes the order in which we emit our
24520 2002-09-21 Martin Baulig <martin@gnome.org>
24522 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
24523 delegate takes no arguments.
24525 2002-09-20 Miguel de Icaza <miguel@ximian.com>
24527 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
24530 * expression.cs: Extract the underlying type.
24532 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
24534 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
24536 2002-09-19 Miguel de Icaza <miguel@ximian.com>
24538 * class.cs (TypeContainer.DefineType): We can not use the nice
24539 PackingSize with the size set to 1 DefineType method, because it
24540 will not allow us to define the interfaces that the struct
24543 This completes the fixing of bug 27287
24545 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
24546 means also structs. This fixes part of the problem.
24547 (Expresion.ImplicitReferenceConversionExists): ditto.
24549 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
24550 error if there were no errors reported during the type lookup
24551 process, to avoid duplicates or redundant errors. Without this
24552 you would get an ambiguous errors plus a type not found. We have
24553 beaten the user enough with the first error.
24555 (DeclSparce.FindType): Emit a warning if we have an ambiguous
24558 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
24559 during the resolution process, stop the lookup, this avoids
24560 repeated error reports (same error twice).
24562 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
24564 * typemanager.cs (LookupType): Redo the type lookup code to match
24565 the needs of System.Reflection.
24567 The issue is that System.Reflection requires references to nested
24568 types to begin with a "+" sign instead of a dot. So toplevel
24569 types look like: "NameSpace.TopLevelClass", and nested ones look
24570 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
24573 2002-09-19 Martin Baulig <martin@gnome.org>
24575 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
24576 says that a method always returns or always throws an exception,
24577 don't report the CS0161.
24579 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
24580 set `Returns = new_returns'.
24582 2002-09-19 Martin Baulig <martin@gnome.org>
24584 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
24585 to an enum constant, check for a CS0176.
24587 2002-09-18 Miguel de Icaza <miguel@ximian.com>
24589 * class.cs (TypeContainer.CheckPairedOperators): Now we check
24590 for operators that must be in pairs and report errors.
24592 * ecore.cs (SimpleName.DoResolveType): During the initial type
24593 resolution process, when we define types recursively, we must
24594 check first for types in our current scope before we perform
24595 lookups in the enclosing scopes.
24597 * expression.cs (MakeByteBlob): Handle Decimal blobs.
24599 (Invocation.VerifyArgumentsCompat): Call
24600 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
24601 I thought we were supposed to always call this, but there are a
24602 few places in the code where we dont do it.
24604 2002-09-17 Miguel de Icaza <miguel@ximian.com>
24606 * driver.cs: Add support in -linkres and -resource to specify the
24607 name of the identifier.
24609 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24611 * ecore.cs (StandardConversionExists): Sync with the conversion
24612 code: allow anything-* to void* conversions.
24614 (FindMostSpecificSource): Use an Expression argument
24615 instead of a Type, because we might be handed over a Literal which
24616 gets a few more implicit conversions that plain types do not. So
24617 this information was being lost.
24619 Also, we drop the temporary type-holder expression when not
24622 2002-09-17 Martin Baulig <martin@gnome.org>
24624 * class.cs (PropertyBase.CheckBase): Don't check the base class if
24625 this is an explicit interface implementation.
24627 2002-09-17 Martin Baulig <martin@gnome.org>
24629 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
24630 different `IndexerName' attributes.
24632 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
24633 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
24634 virtual CommonResolve().
24636 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24638 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
24639 and convert that to the UnderlyingType.
24641 * statement.cs (Foreach.Resolve): Indexers are just like variables
24642 or PropertyAccesses.
24644 * cs-tokenizer.cs (consume_string): Track line numbers and columns
24645 inside quoted strings, we were not doing this before.
24647 2002-09-16 Martin Baulig <martin@gnome.org>
24649 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
24650 resolve it. This is needed for the definite assignment check of the
24651 instance expression, fixes bug #29846.
24652 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
24654 2002-09-16 Nick Drochak <ndrochak@gol.com>
24656 * parameter.cs: Fix compile error. Cannot reference static member
24657 from an instance object. Is this an mcs bug?
24659 2002-09-14 Martin Baulig <martin@gnome.org>
24661 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
24662 multiple times. Fixes bug #30295, added test-166.cs.
24664 2002-09-14 Martin Baulig <martin@gnome.org>
24666 * statement.cs (Block.Emit): Don't emit unreachable code.
24667 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
24668 `break' statements.
24669 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
24671 2002-09-14 Martin Baulig <martin@gnome.org>
24673 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
24676 2002-09-14 Martin Baulig <martin@gnome.org>
24678 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
24679 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
24680 be false on the ms runtime.
24682 2002-09-13 Martin Baulig <martin@gnome.org>
24684 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
24685 the CS0038 error message.
24687 2002-09-12 Miguel de Icaza <miguel@ximian.com>
24689 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
24690 constant inside, return it.
24692 2002-09-12 Martin Baulig <martin@gnome.org>
24694 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
24695 implicit conversion can be done between enum types.
24697 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
24698 check whether an implicit conversion to the current enum's UnderlyingType
24699 exists and report an error if not.
24701 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
24702 without debugging support.
24704 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
24705 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
24707 2002-09-12 Martin Baulig <martin@gnome.org>
24709 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
24711 * ecore.cs (IMemberExpr.DeclaringType): New property.
24712 (SimpleName.SimpleNameResolve): Check whether we're accessing a
24713 nonstatic member of an outer type (CS0038).
24715 2002-09-11 Miguel de Icaza <miguel@ximian.com>
24717 * driver.cs: Activate the using-error detector at warning level
24718 4 (at least for MS-compatible APIs).
24720 * namespace.cs (VerifyUsing): Small buglett fix.
24722 * pending.cs (PendingImplementation): pass the container pointer.
24724 * interface.cs (GetMethods): Allow for recursive definition. Long
24725 term, I would like to move every type to support recursive
24726 definitions, not the current ordering mechanism that we have right
24729 The situation is this: Attributes are handled before interfaces,
24730 so we can apply attributes to interfaces. But some attributes
24731 implement interfaces, we will now handle the simple cases
24732 (recursive definitions will just get an error).
24734 * parameter.cs: Only invalidate types at the end if we fail to
24737 2002-09-09 Martin Baulig <martin@gnome.org>
24739 * ecore.cs (PropertyExpr.Emit): Also check for
24740 TypeManager.system_int_array_get_length so this'll also work when
24741 compiling corlib. Fixes #30003.
24743 2002-09-09 Martin Baulig <martin@gnome.org>
24745 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
24746 and throw an exception if we can't get the type's size. Fixed #30040,
24749 2002-09-09 Martin Baulig <martin@gnome.org>
24751 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
24753 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
24754 context. Fixes bug #30027.
24756 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
24757 virtual functions. Fixes bug #30043, added test-164.cs.
24759 2002-09-08 Ravi Pratap <ravi@ximian.com>
24761 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
24763 2002-09-08 Nick Drochak <ndrochak@gol.com>
24765 * driver.cs: Use an object to get the windows codepage since it's not a
24768 2002-09-08 Miguel de Icaza <miguel@ximian.com>
24770 * statement.cs (For.Emit): for infinite loops (test == null)
24771 return whether there is a break inside, not always "true".
24773 * namespace.cs (UsingEntry): New struct to hold the name of the
24774 using definition, the location where it is defined, and whether it
24775 has been used in a successful type lookup.
24777 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
24782 2002-09-06 Ravi Pratap <ravi@ximian.com>
24784 * attribute.cs : Fix incorrect code which relied on catching
24785 a NullReferenceException to detect a null being passed in
24786 where an object was expected.
24788 2002-09-06 Miguel de Icaza <miguel@ximian.com>
24790 * statement.cs (Try): flag the catch variable as assigned
24792 * expression.cs (Cast): Simplified by using ResolveType instead of
24793 manually resolving.
24795 * statement.cs (Catch): Fix bug by using ResolveType.
24797 2002-09-06 Ravi Pratap <ravi@ximian.com>
24799 * expression.cs (BetterConversion): Special case for when we have
24800 a NullLiteral as the argument and we have to choose between string
24801 and object types - we choose string the way csc does.
24803 * attribute.cs (Attribute.Resolve): Catch the
24804 NullReferenceException and report error #182 since the Mono
24805 runtime no more has the bug and having this exception raised means
24806 we tried to select a constructor which takes an object and is
24809 2002-09-05 Ravi Pratap <ravi@ximian.com>
24811 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
24812 message (1502, 1503) when we can't locate a method after overload
24813 resolution. This is much more informative and closes the bug
24816 * interface.cs (PopulateMethod): Return if there are no argument
24817 types. Fixes a NullReferenceException bug.
24819 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
24820 expressions too. Previously we were checking only in one place for
24821 positional arguments leaving out named arguments.
24823 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
24824 type to the enum type is not allowed. Remove code corresponding to
24827 (ConvertNumericExplicit): Allow explicit conversions from
24828 the underlying type to enum type. This precisely follows the spec
24829 and closes a bug filed by Gonzalo.
24831 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24834 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
24836 2002-09-03 Miguel de Icaza <miguel@ximian.com>
24838 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
24839 it was important that we stored the right value after the
24840 reduction in `converted'.
24842 2002-09-04 Martin Baulig <martin@gnome.org>
24844 * location.cs (Location.SymbolDocument): Use full pathnames for the
24847 2002-08-30 Miguel de Icaza <miguel@ximian.com>
24849 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
24850 of the expression resolve mechanism, because that will catch the
24851 SimpleName error failures.
24853 (Conditional): If we can not resolve the
24854 expression, return, do not crash.
24856 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24859 (location): display token name instead of its number.
24861 2002-08-28 Martin Baulig <martin@gnome.org>
24863 * expression.cs (Binary.ResolveOperator): Don't silently return
24864 but return an error if an operator cannot be applied between two
24867 2002-08-28 Martin Baulig <martin@gnome.org>
24869 * class.cs (Constructor.Define): Set the permission attributes
24870 correctly instead of making all constructors public.
24872 2002-08-28 Martin Baulig <martin@gnome.org>
24874 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
24875 for private members before reporting a CS0103; if we find anything,
24878 2002-08-28 Martin Baulig <martin@gnome.org>
24880 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
24881 to check whether `closure_start_type == closure_invocation_type',
24882 we also need to check whether `m.DeclaringType == closure_invocation_type'
24883 before bypassing the permission checks. We might be accessing
24884 protected/private members from the base class.
24885 (TypeManager.RealMemberLookup): Only set private_ok if private
24886 members were requested via BindingFlags.NonPublic.
24888 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
24890 * expression.cs (MemberAccess.ResolveMemberAccess): Set
24891 MethodGroupExpr.IsExplicitImpl if appropriate.
24892 (Invocation.DoResolve): Don't report the CS0120 for explicit
24893 interface implementations.
24895 2002-08-27 Martin Baulig <martin@gnome.org>
24897 * expression.cs (Invocation.DoResolve): If this is a static
24898 method and we don't have an InstanceExpression, we must report
24901 2002-08-25 Martin Baulig <martin@gnome.org>
24903 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
24904 `==' between a valuetype and an object.
24906 2002-08-25 Miguel de Icaza <miguel@ximian.com>
24908 * ecore.cs (TypeExpr): Provide a ToString method.
24910 2002-08-24 Martin Baulig <martin@gnome.org>
24912 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
24913 now called proggie.dbg and it's a binary file.
24915 2002-08-23 Martin Baulig <martin@gnome.org>
24917 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
24919 2002-08-23 Martin Baulig <martin@gnome.org>
24921 * struct.cs (MyStructInfo.ctor): Make this work with empty
24922 structs; it's not allowed to use foreach() on null.
24924 2002-08-23 Martin Baulig <martin@gnome.org>
24926 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
24927 writer the full pathname of the generated assembly.
24929 2002-08-23 Martin Baulig <martin@gnome.org>
24931 * statements.cs (FlowBranching.UsageVector.MergeChildren):
24932 A `finally' block never returns or breaks; improved handling of
24935 2002-08-23 Martin Baulig <martin@gnome.org>
24937 * statement.cs (Throw.Resolve): Allow `throw null'.
24939 2002-08-23 Martin Baulig <martin@gnome.org>
24941 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
24942 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
24943 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
24944 MemberLookup would return a wrong event if this is an explicit
24945 interface implementation and the class has an event with the same
24948 2002-08-23 Martin Baulig <martin@gnome.org>
24950 * statement.cs (Block.AddChildVariableNames): New public method.
24951 (Block.AddChildVariableName): Likewise.
24952 (Block.IsVariableNameUsedInChildBlock): Likewise.
24953 (Block.AddVariable): Check whether a variable name has already
24954 been used in a child block.
24956 * cs-parser.jay (declare_local_variables): Mark all variable names
24957 from the current block as being used in a child block in the
24960 2002-08-23 Martin Baulig <martin@gnome.org>
24962 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
24963 find the symbol writer.
24965 * driver.cs: csc also allows the arguments to /define being
24966 separated by commas, not only by semicolons.
24968 2002-08-23 Martin Baulig <martin@gnome.org>
24970 * interface.cs (Interface.GetMembers): Added static check for events.
24972 2002-08-15 Martin Baulig <martin@gnome.org>
24974 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
24975 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
24977 * ecore.cs (Expression.MemberLookup): Added documentation and explained
24978 why the MethodData.EmitDestructor() change was necessary.
24980 2002-08-20 Martin Baulig <martin@gnome.org>
24982 * class.cs (TypeContainer.FindMembers): Added static check for events.
24984 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
24986 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
24987 use Type.GetEvents(), not Type.FindMembers().
24989 2002-08-20 Martin Baulig <martin@gnome.org>
24991 * decl.cs (MemberCache): Added a special method cache which will
24992 be used for method-only searched. This ensures that a method
24993 search will return a MethodInfo with the correct ReflectedType for
24996 2002-08-20 Martin Baulig <martin@gnome.org>
24998 * decl.cs (DeclSpace.FindMembers): Made this public.
25000 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25002 * delegate.cs: fixed build on windows.
25003 [FIXME: Filed as bug #29150: MCS must report these errors.]
25005 2002-08-19 Ravi Pratap <ravi@ximian.com>
25007 * ecore.cs (StandardConversionExists): Return a false
25008 if we are trying to convert the void type to anything else
25009 since that is not allowed.
25011 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
25012 we flag error 70 in the event an event is trying to be accessed
25013 directly from outside the declaring type.
25015 2002-08-20 Martin Baulig <martin@gnome.org>
25017 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
25018 MemberCache from typemanager.cs to decl.cs.
25020 2002-08-19 Martin Baulig <martin@gnome.org>
25022 * class.cs (TypeContainer): Implement IMemberContainer.
25023 (TypeContainer.DefineMembers): Create the MemberCache.
25024 (TypeContainer.FindMembers): Do better BindingFlags checking; only
25025 return public members if BindingFlags.Public was given, check
25026 whether members are static.
25028 2002-08-16 Martin Baulig <martin@gnome.org>
25030 * decl.cs (DeclSpace.Define): Splitted this in Define and
25031 DefineMembers. DefineMembers is called first and initializes the
25034 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
25035 DefineMembers() on all our DeclSpaces.
25037 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
25038 but call DefineMembers() on all nested interfaces. We call their
25039 Define() in our new Define() function.
25041 * interface.cs (Interface): Implement IMemberContainer.
25042 (Interface.Define): Moved all code except the attribute stuf to
25044 (Interface.DefineMembers): Initialize the member cache.
25046 * typemanager.cs (IMemberFinder): Removed this interface, we don't
25047 need this anymore since we can use MemberCache.FindMembers directly.
25049 2002-08-19 Martin Baulig <martin@gnome.org>
25051 * typemanager.cs (MemberCache): When creating the cache for an
25052 interface type, add all inherited members.
25053 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
25054 to `out bool used_cache' and documented it.
25055 (TypeManager.MemberLookup): If we already used the cache in the first
25056 iteration, we don't need to do the interfaces check.
25058 2002-08-19 Martin Baulig <martin@gnome.org>
25060 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
25061 here from IMemberFinder and don't implement this interface anymore.
25062 (DeclSpace.MemberCache): Moved here from IMemberFinder.
25064 * typemanager.cs (IMemberFinder): This interface is now only used by
25065 classes which actually support the member cache.
25066 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
25067 since we only put DeclSpaces into this Hashtable.
25068 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
25069 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
25071 2002-08-16 Martin Baulig <martin@gnome.org>
25073 * typemanager.cs (ICachingMemberFinder): Removed.
25074 (IMemberFinder.MemberCache): New property.
25075 (TypeManager.FindMembers): Merged this with RealFindMembers().
25076 This function will never be called from TypeManager.MemberLookup()
25077 so we can't use the cache here, just the IMemberFinder.
25078 (TypeManager.MemberLookup_FindMembers): Check whether the
25079 IMemberFinder has a MemberCache and call the cache's FindMembers
25081 (MemberCache): Rewrote larger parts of this yet another time and
25082 cleaned it up a bit.
25084 2002-08-15 Miguel de Icaza <miguel@ximian.com>
25086 * driver.cs (LoadArgs): Support quoting.
25088 (Usage): Show the CSC-like command line arguments.
25090 Improved a few error messages.
25092 2002-08-15 Martin Baulig <martin@gnome.org>
25094 * typemanager.cs (IMemberContainer.Type): New property.
25095 (IMemberContainer.IsInterface): New property.
25097 The following changes are conditional to BROKEN_RUNTIME, which is
25098 defined at the top of the file.
25100 * typemanager.cs (MemberCache.MemberCache): Don't add the base
25101 class'es members, but add all members from TypeHandle.ObjectType
25102 if we're an interface.
25103 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
25104 is the current type.
25105 (MemberCache.CacheEntry.Container): Removed this field.
25106 (TypeHandle.GetMembers): Include inherited members.
25108 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25110 * typemanager.cs: fixed compilation and added a comment on a field that
25113 2002-08-15 Martin Baulig <martin@gnome.org>
25115 * class.cs (ConstructorInitializer.Resolve): In the
25116 Expression.MemberLookup call, use the queried_type as
25119 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
25120 declared' attribute, it's always true.
25121 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
25122 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
25123 temporary wrapper for FindMembers which tells MemberLookup whether
25124 members from the base classes are included in the return value.
25125 This will go away soon.
25126 (TypeManager.MemberLookup): Use this temporary hack here; once the
25127 new MemberCache is completed, we don't need to do the DeclaredOnly
25128 looping here anymore since the MemberCache will take care of this.
25129 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
25130 (MemberCache): When creating the MemberCache for a class, get
25131 members from the current class and all its base classes.
25132 (MemberCache.CacheEntry.Container): New field. This is a
25133 temporary hack until the Mono runtime is fixed to distinguish
25134 between ReflectedType and DeclaringType. It allows us to use MCS
25135 with both the MS runtime and the unfixed Mono runtime without
25136 problems and without accecting performance.
25137 (MemberCache.SearchMembers): The DeclaredOnly looping from
25138 TypeManager.MemberLookup is now done here.
25140 2002-08-14 Martin Baulig <martin@gnome.org>
25142 * statement.cs (MyStructInfo.MyStructInfo): Don't call
25143 Type.GetFields on dynamic types but get the fields from the
25144 corresponding TypeContainer.
25145 (MyStructInfo.GetStructInfo): Added check for enum types.
25147 * typemanager.cs (MemberList.IsSynchronized): Implemented.
25148 (MemberList.SyncRoot): Implemented.
25149 (TypeManager.FilterWithClosure): No need to check permissions if
25150 closure_start_type == closure_invocation_type, don't crash if
25151 closure_invocation_type is null.
25153 2002-08-13 Martin Baulig <martin@gnome.org>
25155 Rewrote TypeContainer.FindMembers to use a member cache. This
25156 gives us a speed increase of about 35% for the self-hosting MCS
25157 build and of about 15-20% for the class libs (both on GNU/Linux).
25159 * report.cs (Timer): New class to get enhanced profiling. This
25160 whole class is "TIMER" conditional since it remarkably slows down
25163 * class.cs (MemberList): New class. This is an IList wrapper
25164 which we're now using instead of passing MemberInfo[]'s around to
25165 avoid copying this array unnecessarily.
25166 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
25167 (ICachingMemberFinder, IMemberContainer): New interface.
25168 (TypeManager.FilterWithClosure): If `criteria' is null, the name
25169 has already been checked, otherwise use it for the name comparision.
25170 (TypeManager.FindMembers): Renamed to RealMemberFinder and
25171 provided wrapper which tries to use ICachingMemberFinder.FindMembers
25172 if possible. Returns a MemberList, not a MemberInfo [].
25173 (TypeHandle): New class, implements IMemberContainer. We create
25174 one instance of this class per type, it contains a MemberCache
25175 which is used to do the member lookups.
25176 (MemberCache): New class. Each instance of this class contains
25177 all members of a type and a name-based hash table.
25178 (MemberCache.FindMembers): This is our new member lookup
25179 function. First, it looks up all members of the requested name in
25180 the hash table. Then, it walks this list and sorts out all
25181 applicable members and returns them.
25183 2002-08-13 Martin Baulig <martin@gnome.org>
25185 In addition to a nice code cleanup, this gives us a performance
25186 increase of about 1.4% on GNU/Linux - not much, but it's already
25187 half a second for the self-hosting MCS compilation.
25189 * typemanager.cs (IMemberFinder): New interface. It is used by
25190 TypeManager.FindMembers to call FindMembers on a TypeContainer,
25191 Enum, Delegate or Interface.
25192 (TypeManager.finder_to_member_finder): New PtrHashtable.
25193 (TypeManager.finder_to_container): Removed.
25194 (TypeManager.finder_to_delegate): Removed.
25195 (TypeManager.finder_to_interface): Removed.
25196 (TypeManager.finder_to_enum): Removed.
25198 * interface.cs (Interface): Implement IMemberFinder.
25200 * delegate.cs (Delegate): Implement IMemberFinder.
25202 * enum.cs (Enum): Implement IMemberFinder.
25204 * class.cs (TypeContainer): Implement IMemberFinder.
25206 2002-08-12 Martin Baulig <martin@gnome.org>
25208 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
25210 2002-08-12 Martin Baulig <martin@gnome.org>
25212 * ecore.cs (ITypeExpression): New interface for expressions which
25214 (TypeExpression): Renamed to TypeLookupExpression.
25215 (Expression.DoResolve): If we're doing a types-only lookup, the
25216 expression must implement the ITypeExpression interface and we
25217 call DoResolveType() on it.
25218 (SimpleName): Implement the new ITypeExpression interface.
25219 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
25220 hack, the situation that we're only looking up types can't happen
25221 anymore when this method is called. Moved the type lookup code to
25222 DoResolveType() and call it.
25223 (SimpleName.DoResolveType): This ITypeExpression interface method
25224 is now doing the types-only lookup.
25225 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
25226 (ResolveFlags): Added MaskExprClass.
25228 * expression.cs (MemberAccess): Implement the ITypeExpression
25230 (MemberAccess.DoResolve): Added support for a types-only lookup
25231 when we're called via ITypeExpression.DoResolveType().
25232 (ComposedCast): Implement the ITypeExpression interface.
25234 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
25235 Expression.Resolve() with ResolveFlags.Type instead.
25237 2002-08-12 Martin Baulig <martin@gnome.org>
25239 * interface.cs (Interface.Define): Apply attributes.
25241 * attribute.cs (Attribute.ApplyAttributes): Added support for
25242 interface attributes.
25244 2002-08-11 Martin Baulig <martin@gnome.org>
25246 * statement.cs (Block.Emit): Only check the "this" variable if we
25247 do not always throw an exception.
25249 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
25250 whether the property has a set accessor.
25252 2002-08-11 Martin Baulig <martin@gnome.org>
25254 Added control flow analysis support for structs.
25256 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
25257 with control flow analysis turned off.
25258 (IVariable): New interface.
25259 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
25260 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
25261 (FieldExpr.DoResolve): Resolve the instance expression with flow
25262 analysis turned off and do the definite assignment check after the
25263 resolving when we know what the expression will resolve to.
25265 * expression.cs (LocalVariableReference, ParameterReference):
25266 Implement the new IVariable interface, only call the flow analysis
25267 code if ec.DoFlowAnalysis is true.
25268 (This): Added constructor which takes a Block argument. Implement
25269 the new IVariable interface.
25270 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
25271 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
25272 This does the definite assignment checks for struct members.
25274 * class.cs (Constructor.Emit): If this is a non-static `struct'
25275 constructor which doesn't have any initializer, call
25276 Block.AddThisVariable() to tell the flow analysis code that all
25277 struct elements must be initialized before control returns from
25280 * statement.cs (MyStructInfo): New public class.
25281 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
25282 argument to this indexer. If non-zero, check an individual struct
25283 member, not the whole struct.
25284 (FlowBranching.CheckOutParameters): Check struct members.
25285 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
25286 overloaded versions of these methods which take an additional
25287 `int field_idx' argument to check struct members.
25288 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
25289 overloaded versions of these methods which take an additional
25290 `string field_name' argument to check struct member.s
25291 (VariableInfo): Implement the IVariable interface.
25292 (VariableInfo.StructInfo): New public property. Returns the
25293 MyStructInfo instance of the variable if it's a struct or null.
25294 (Block.AddThisVariable): New public method. This is called from
25295 Constructor.Emit() for non-static `struct' constructor which do
25296 not have any initializer. It creates a special variable for the
25297 "this" instance variable which will be checked by the flow
25298 analysis code to ensure that all of the struct's fields are
25299 initialized before control returns from the constructor.
25300 (UsageVector): Added support for struct members. If a
25301 variable/parameter is a struct with N members, we reserve a slot
25302 in the usage vector for each member. A struct is considered fully
25303 initialized if either the struct itself (slot 0) or all its
25304 members are initialized.
25306 2002-08-08 Martin Baulig <martin@gnome.org>
25308 * driver.cs (Driver.MainDriver): Only report an error CS5001
25309 if there were no compilation errors.
25311 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
25312 `UnsafeContext' property to determine whether the parent is in
25313 unsafe context rather than checking the parent's ModFlags:
25314 classes nested in an unsafe class are unsafe as well.
25316 2002-08-08 Martin Baulig <martin@gnome.org>
25318 * statement.cs (UsageVector.MergeChildren): Distinguish between
25319 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
25320 we return. Added test17() and test18() to test-154.cs.
25322 2002-08-08 Martin Baulig <martin@gnome.org>
25324 * typemanager.cs (TypeManager.FilterWithClosure): If we have
25325 Family access, make sure the invoking type isn't a subclass of the
25326 queried type (that'd be a CS1540).
25328 * ecore.cs (Expression.MemberLookup): Added overloaded version of
25329 this method which takes an additional `Type invocation_type'.
25331 * expression.cs (BaseAccess.DoResolve): Use the base type as
25332 invocation and query type.
25333 (MemberAccess.DoResolve): If the lookup failed and we're about to
25334 report a CS0122, try a lookup with the ec.ContainerType - if this
25335 succeeds, we must report a CS1540.
25337 2002-08-08 Martin Baulig <martin@gnome.org>
25339 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
25340 (MethodGroupExpr): Implement the IMemberExpr interface.
25342 * expression (MemberAccess.ResolveMemberAccess): No need to have
25343 any special code for MethodGroupExprs anymore, they're now
25346 2002-08-08 Martin Baulig <martin@gnome.org>
25348 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
25349 Family, FamANDAssem and FamORAssem permissions.
25350 (TypeManager.IsSubclassOrNestedChildOf): New public method.
25352 2002-08-08 Martin Baulig <martin@gnome.org>
25354 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
25355 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
25358 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
25360 * driver.cs: implemented /resource option to embed managed resources.
25362 2002-08-07 Martin Baulig <martin@gnome.org>
25364 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
25365 (FieldBase.HasFieldInitializer): New public property.
25366 (FieldBase.GetInitializerExpression): New public method. Resolves and
25367 returns the field initializer and makes sure it is only resolved once.
25368 (TypeContainer.EmitFieldInitializers): Call
25369 FieldBase.GetInitializerExpression to get the initializer, this ensures
25370 that it isn't resolved multiple times.
25372 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
25373 the resolving process (SimpleName/MemberLookup) that we're currently
25374 emitting a field initializer (which must not access any instance members,
25375 this is an error CS0236).
25377 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
25378 argument, if the `IsFieldInitializer' flag is set, we must report and
25379 error CS0236 and not an error CS0120.
25381 2002-08-07 Martin Baulig <martin@gnome.org>
25383 * ecore.cs (IMemberExpr): New public interface.
25384 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
25385 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
25386 if the expression is an IMemberExpr.
25388 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
25389 to be null, implicitly default to `this' if we're non-static in
25390 this case. Simplified the code a lot by using the new IMemberExpr
25391 interface. Also fixed bug #28176 here.
25393 2002-08-06 Martin Baulig <martin@gnome.org>
25395 * cs-parser.jay (SimpleLookup): Removed. We need to create
25396 ParameterReferences during semantic analysis so that we can do a
25397 type-only search when resolving Cast, TypeOf and SizeOf.
25398 (block): Pass the `current_local_parameters' to the Block's
25401 * class.cs (ConstructorInitializer): Added `Parameters parameters'
25402 argument to the constructor.
25403 (ConstructorInitializer.Resolve): Create a temporary implicit
25404 block with the parameters.
25406 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
25407 references here if we aren't doing a type-only search.
25409 * statement.cs (Block): Added constructor which takes a
25410 `Parameters parameters' argument.
25411 (Block.Parameters): New public property.
25413 * support.cs (InternalParameters.Parameters): Renamed `parameters'
25414 to `Parameters' and made it public readonly.
25416 2002-08-06 Martin Baulig <martin@gnome.org>
25418 * ecore.cs (Expression.Warning): Made this public as well.
25420 * report.cs (Report.Debug): Print the contents of collections.
25422 2002-08-06 Martin Baulig <martin@gnome.org>
25424 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
25425 used to tell Resolve() which kinds of expressions it may return.
25426 (Expression.Resolve): Added overloaded version of this method which
25427 takes a `ResolveFlags flags' argument. This can be used to tell
25428 Resolve() which kinds of expressions it may return. Reports a
25430 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
25431 ResolveFlags.SimpleName.
25432 (Expression.Error118): Added overloaded version of this method which
25433 takes a `ResolveFlags flags' argument. It uses the flags to determine
25434 which kinds of expressions are allowed.
25436 * expression.cs (Argument.ResolveMethodGroup): New public method.
25437 Resolves an argument, but allows a MethodGroup to be returned.
25438 This is used when invoking a delegate.
25440 * TODO: Updated a bit.
25442 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25444 Fixed compilation with csc.
25446 * ecore.cs: Expression.Error made public. Is this correct? Should
25447 Warning be made public too?
25449 * expression.cs: use ea.Location instead of ea.loc.
25450 [FIXME: Filed as bug #28607: MCS must report these errors.]
25452 2002-08-06 Martin Baulig <martin@gnome.org>
25454 * ecore.cs (Expression.loc): Moved the location here instead of
25455 duplicating it in all derived classes.
25456 (Expression.Location): New public property.
25457 (Expression.Error, Expression.Warning): Made them non-static and
25458 removed the location argument.
25459 (Expression.Warning): Added overloaded version which takes an
25460 `int level' argument.
25461 (Expression.Error118): Make this non-static and removed the
25462 expression and location arguments.
25463 (TypeExpr): Added location argument to the constructor.
25465 * expression.cs (StaticCallExpr): Added location argument to
25467 (Indirection, PointerArithmetic): Likewise.
25468 (CheckedExpr, UnCheckedExpr): Likewise.
25469 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
25470 (StringPtr): Likewise.
25473 2002-08-05 Martin Baulig <martin@gnome.org>
25475 * expression.cs (BaseAccess.DoResolve): Actually report errors.
25477 * assign.cs (Assign.DoResolve): Check whether the source
25478 expression is a value or variable.
25480 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
25481 while resolving the corresponding blocks.
25483 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
25484 an error, don't silently return null.
25486 * statement.cs (Block.AddVariable): Do the error reporting here
25487 and distinguish between CS0128 and CS0136.
25488 (Block.DoResolve): Report all unused labels (warning CS0164).
25489 (LabeledStatement): Pass the location to the constructor.
25490 (LabeledStatement.HasBeenReferenced): New property.
25491 (LabeledStatement.Resolve): Set it to true here.
25493 * statement.cs (Return.Emit): Return success even after reporting
25494 a type mismatch error (CS0126 or CS0127), this is what csc does and
25495 it avoids confusing the users with any consecutive errors.
25497 2002-08-05 Martin Baulig <martin@gnome.org>
25499 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
25501 * const.cs (Const.LookupConstantValue): Catch circular definitions.
25503 * expression.cs (MemberAccess.DoResolve): Silently return if an
25504 error has already been reported.
25506 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
25507 error has already been reported.
25509 2002-08-05 Martin Baulig <martin@gnome.org>
25511 * statement.cs (UsageVector): Only initialize the `parameters'
25512 vector if we actually have any "out" parameters.
25514 2002-08-05 Martin Baulig <martin@gnome.org>
25516 * expression.cs (Binary.ResolveOperator): When combining delegates,
25517 they must have the same type.
25519 2002-08-05 Martin Baulig <martin@gnome.org>
25521 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
25522 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
25523 work with the ms runtime and we also don't need it: if we're a
25524 PropertyBuilder and not in the `indexer_arguments' hash, then we
25525 are a property and not an indexer.
25527 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
25528 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
25529 since the latter one doesn't work with the ms runtime.
25531 2002-08-03 Martin Baulig <martin@gnome.org>
25533 Fixed bugs #27998 and #22735.
25535 * class.cs (Method.IsOperator): New public field.
25536 (Method.CheckBase): Report CS0111 if there's already a method
25537 with the same parameters in the current class. Report CS0508 when
25538 attempting to change the return type of an inherited method.
25539 (MethodData.Emit): Report CS0179 if a method doesn't have a body
25540 and it's not marked abstract or extern.
25541 (PropertyBase): New abstract base class for Property and Indexer.
25542 (PropertyBase.CheckBase): Moved here from Property and made it work
25544 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
25545 the same so we can reuse it there.
25546 (Property, Indexer): Derive from PropertyBase.
25547 (MethodSignature.inheritable_property_signature_filter): New delegate
25548 to find properties and indexers.
25550 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
25551 argument and improved error reporting.
25553 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
25554 EmptyReadOnlyParameters and made it a property.
25556 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
25557 version of this method which takes a `PropertyInfo indexer'.
25558 (TypeManager.RegisterIndexer): New method.
25560 * class.cs: Added myself as author of this file :-)
25562 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25564 * class.cs: fixed compilation on windoze.
25566 2002-08-03 Martin Baulig <martin@gnome.org>
25568 * interface.cs (Interface.GetInterfaceBases): Check whether all
25569 base interfaces are at least as accessible than the current one.
25571 * class.cs (TypeContainer.GetClassBases): Check whether base types
25572 are at least as accessible than the current type.
25573 (TypeContainer.AsAccessible): Implemented and made non-static.
25574 (MemberBase.CheckParameters): Report errors if the accessibility
25577 * delegate.cs (Delegate.Delegate): The default visibility is
25578 internal for top-level types and private for nested types.
25579 (Delegate.Define): Report errors if the accessibility checks fail.
25581 * enum.cs (Enum.Enum): The default visibility is internal for
25582 top-level types and private for nested types.
25583 (Enum.DefineType): Compute the correct visibility.
25585 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
25586 function which takes a `bool is_toplevel' instead of a TypeContainer.
25588 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
25591 2002-08-02 Martin Baulig <martin@gnome.org>
25593 * expression.cs (LocalVariableReferenc): Added constructor which
25594 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
25595 (LocalVariableReference.IsReadOnly): New property.
25596 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
25597 variable is readonly, use our own readonly flag to do this; you can
25598 use the new constructor to get a writable reference to a read-only
25601 * cs-parser.jay (foreach_statement, using_statement): Get a writable
25602 reference to the local variable.
25604 2002-08-01 Miguel de Icaza <miguel@ximian.com>
25606 * rootcontext.cs (ResolveCore): Also include System.Exception
25608 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
25609 we reach an EmptyStatement.
25611 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
25614 * expression.cs (Binary.ResolveOperator): Check error result in
25617 use brtrue/brfalse directly and avoid compares to null.
25619 2002-08-02 Martin Baulig <martin@gnome.org>
25621 * class.cs (TypeContainer.Define): Define all nested interfaces here.
25622 Fixes bug #28407, added test-155.cs.
25624 2002-08-01 Martin Baulig <martin@gnome.org>
25626 * class.cs (Event.EmitDefaultMethod): Make this work with static
25627 events. Fixes #28311, added verify-3.cs.
25629 2002-08-01 Martin Baulig <martin@gnome.org>
25631 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
25632 `is_disposable' fields.
25633 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
25634 `hm.is_disposable' if we're using the collection pattern.
25635 (Foreach.EmitCollectionForeach): Use the correct type for the
25636 enumerator's local variable, only emit the try/finally block if
25637 necessary (fixes #27713).
25639 2002-08-01 Martin Baulig <martin@gnome.org>
25641 * ecore.cs (Expression.report118): Renamed to Error118 and made
25644 * statement.cs (Throw.Resolve): Check whether the expression is of
25645 the correct type (CS0118) and whether the type derives from
25646 System.Exception (CS0155).
25647 (Catch.Resolve): New method. Do the type lookup here and check
25648 whether it derives from System.Exception (CS0155).
25649 (Catch.CatchType, Catch.IsGeneral): New public properties.
25651 * typemanager.cs (TypeManager.exception_type): Added.
25653 2002-07-31 Miguel de Icaza <miguel@ximian.com>
25655 * driver.cs: Updated About function.
25657 2002-07-31 Martin Baulig <martin@gnome.org>
25659 Implemented Control Flow Analysis.
25661 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
25662 (EmitContext.CurrentBranching): Added.
25663 (EmitContext.StartFlowBranching): Added.
25664 (EmitContext.EndFlowBranching): Added.
25665 (EmitContext.KillFlowBranching): Added.
25666 (EmitContext.IsVariableAssigned): Added.
25667 (EmitContext.SetVariableAssigned): Added.
25668 (EmitContext.IsParameterAssigned): Added.
25669 (EmitContext.SetParameterAssigned): Added.
25670 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
25671 Added control flow analysis stuff here.
25673 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
25674 resolve the expression as lvalue.
25675 (LocalVariableReference.DoResolve): Check whether the variable has
25676 already been assigned.
25677 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
25678 the parameter as assigned here.
25679 (ParameterReference.DoResolve): Check whether the parameter has already
25681 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
25682 expression as lvalue.
25684 * statement.cs (FlowBranching): New class for the flow analysis code.
25685 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
25686 (LabeledStatement.IsDefined): New public property.
25687 (LabeledStatement.AddUsageVector): New public method to tell flow
25688 analyis that the label may be reached via a forward jump.
25689 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
25691 (VariableInfo.Number): New public field. This is used by flow analysis
25692 to number all locals of a block.
25693 (Block.CountVariables): New public property. This is the number of
25694 local variables in this block (including the locals from all parent
25696 (Block.EmitMeta): Number all the variables.
25698 * statement.cs: Added flow analysis support to all classes.
25700 2002-07-31 Martin Baulig <martin@gnome.org>
25702 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
25703 To get debugging messages, compile mcs with /define:MCS_DEBUG and
25704 then use this argument.
25706 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
25708 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
25709 use this to specify /define options.
25711 2002-07-29 Martin Baulig <martin@gnome.org>
25713 * statement.cs (Fixed): Moved all code that does variable lookups
25714 and resolvings from Emit to Resolve.
25716 * statement.cs (For): Moved all code that does variable lookups
25717 and resolvings from Emit to Resolve.
25719 * statement.cs (Using): Moved all code that does variable lookups
25720 and resolvings from Emit to Resolve.
25722 2002-07-29 Martin Baulig <martin@gnome.org>
25724 * attribute.cs (Attribute.Resolve): Explicitly catch a
25725 System.NullReferenceException when creating the
25726 CustromAttributeBuilder and report a different warning message.
25728 2002-07-29 Martin Baulig <martin@gnome.org>
25730 * support.cs (ParameterData.ParameterName): Added method to
25731 get the name of a parameter.
25733 * typemanager.cs (TypeManager.IsValueType): New public method.
25735 2002-07-29 Martin Baulig <martin@gnome.org>
25737 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
25738 is a flag which specifies that it's either ref or out.
25739 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
25740 the out parameter to `out Parameter.Modifier mod', also set the
25741 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
25743 * support.cs (InternalParameters.ParameterModifier): Distinguish
25744 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25745 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25747 * expression.cs (Argument.GetParameterModifier): Distinguish
25748 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25749 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25751 2002-07-29 Martin Baulig <martin@gnome.org>
25753 * expression.cs (ParameterReference.ParameterReference): Added
25754 `Location loc' argument to the constructor.
25756 * cs-parser.jay: Pass location to ParameterReference.
25758 2002-07-28 Miguel de Icaza <miguel@ximian.com>
25760 * statement.cs (Try): Initialize the location.
25762 * cs-parser.jay: pass location to Try.
25764 * expression.cs (Unary.Reduce): Change the prototype to return
25765 whether a constant fold could be performed or not. The result is
25766 returned in an out parameters. In the case of Indirection and
25767 AddressOf, we want to perform the full tests.
25769 2002-07-26 Miguel de Icaza <miguel@ximian.com>
25771 * statement.cs (Statement.Emit): Flag dead code.
25773 2002-07-27 Andrew Birkett <andy@nobugs.org>
25775 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
25777 2002-07-27 Martin Baulig <martin@gnome.org>
25779 * class.cs (MethodData.Define): Put back call to
25780 TypeManager.AddMethod(), accidentally commented this out.
25782 * report.cs (Debug): New public method to print debugging information,
25783 this is `[Conditional ("DEBUG")]'.
25785 2002-07-26 Martin Baulig <martin@gnome.org>
25787 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
25788 (switch_statement): Push the current_block to the switch_stack and
25789 pop it again when we're done with the switch.
25790 (switch_section): The new block is a child of the current_block.
25791 Fixes bug #24007, added test-152.cs.
25793 2002-07-27 Martin Baulig <martin@gnome.org>
25795 * expression.cs (Invocation.EmitArguments): When calling a varargs
25796 function with only its fixed arguments, we need to pass an empty
25799 2002-07-27 Martin Baulig <martin@gnome.org>
25801 Mono 0.13 has been released.
25803 2002-07-25 Miguel de Icaza <miguel@ximian.com>
25805 * driver.cs: Rename --resource to --linkres, because that is what
25806 we do currently, we dont support --resource yet.
25808 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
25810 2002-07-25 Martin Baulig <martin@gnome.org>
25812 * class.cs (MethodData): New public class. This is a `method builder'
25813 class for a method or one accessor of a Property/Indexer/Event.
25814 (MethodData.GetMethodFlags): Moved here from MemberBase.
25815 (MethodData.ApplyAttributes): Likewise.
25816 (MethodData.ApplyObsoleteAttribute): Likewise.
25817 (MethodData.ApplyConditionalAttribute): Likewise.
25818 (MethodData.ApplyDllImportAttribute): Likewise.
25819 (MethodData.CheckAbstractAndExternal): Likewise.
25820 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
25821 (MethodData.Emit): Formerly known as Method.Emit().
25822 (MemberBase): Moved everything which was specific to a single
25823 accessor/method to MethodData.
25824 (Method): Create a new MethodData and call Define() and Emit() on it.
25825 (Property, Indexer, Event): Create a new MethodData objects for each
25826 accessor and call Define() and Emit() on them.
25828 2002-07-25 Martin Baulig <martin@gnome.org>
25830 Made MethodCore derive from MemberBase to reuse the code from there.
25831 MemberBase now also checks for attributes.
25833 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
25834 (MemberBase.GetMethodFlags): Moved here from class Method and marked
25836 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
25837 `CallingConventions cc' and `Attributes opt_attrs' arguments.
25838 (MemberBase.ApplyAttributes): New virtual method; applies the
25839 attributes to a method or accessor.
25840 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
25841 (MemberBase.ApplyConditionalAttribute): Likewise.
25842 (MemberBase.ApplyDllImportAttribute): Likewise.
25843 (MemberBase.CheckAbstractAndExternal): Likewise.
25844 (MethodCore.ParameterTypes): This is now a property instead of a
25845 method, it's initialized from DoDefineParameters().
25846 (MethodCore.ParameterInfo): Removed the set accessor.
25847 (MethodCore.DoDefineParameters): New protected virtual method to
25848 initialize ParameterTypes and ParameterInfo.
25849 (Method.GetReturnType): We can now simply return the MemberType.
25850 (Method.GetMethodFlags): Override the MemberBase version and add
25851 the conditional flags.
25852 (Method.CheckBase): Moved some code from Define() here, call
25853 DoDefineParameters() here.
25854 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
25855 here to avoid some larger code duplication.
25856 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
25857 ensure that abstract and external accessors don't declare a body.
25859 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
25860 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
25861 lookup in the attribute's parent classes, so we need to abort as soon
25862 as we found the first match.
25863 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
25864 the attribute has no arguments.
25866 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
25869 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25871 * cs-parser.jay: reverted previous patch.
25873 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25875 * cs-parser.jay: fixed bug #22119.
25877 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25879 * attribute.cs: fixed compilation. The error was:
25880 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
25881 be assigned to before control leaves the current method."
25882 [FIXME: Filed as bug #28186: MCS must report this error.]
25884 2002-07-25 Martin Baulig <martin@gnome.org>
25886 * attribute.cs (Attribute.Conditional_GetConditionName): New static
25887 method to pull the condition name ouf of a Conditional attribute.
25888 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
25889 the obsolete message and error flag out of an Obsolete attribute.
25891 * class.cs (Method.GetMethodFlags): New public method to get the
25892 TypeManager.MethodFlags for this method.
25893 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
25895 (Method.Define): Get and apply the Obsolete and Conditional attributes;
25896 if we're overriding a virtual function, set the new private variable
25897 `parent_method'; call the new TypeManager.AddMethod().
25899 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
25900 the MethodBuilder and the Method in a PtrHashtable.
25901 (TypeManager.builder_to_method): Added for this purpose.
25902 (TypeManager.MethodFlags): Added IsObsoleteError.
25903 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
25904 Obsolete and Conditional arguments in MethodBuilders. If we discover
25905 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
25906 the message from the attribute.
25908 2002-07-24 Martin Baulig <martin@gnome.org>
25910 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
25911 preprocessor directives, ensure that the argument to #define/#undef is
25912 exactly one identifier and that it's actually an identifier.
25914 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
25917 2002-07-24 Martin Baulig <martin@gnome.org>
25919 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
25920 initialize it to TypeManager.object_type in the constructor.
25921 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
25922 of the `hm.get_current' method if we're using the collection pattern.
25923 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
25924 for the explicit conversion to make it work when we're using the collection
25925 pattern and the `Current' property has a different return type than `object'.
25928 2002-07-24 Martin Baulig <martin@gnome.org>
25930 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
25931 does not match, but don't report any errors. This method is called in
25932 order for all methods in a MethodGroupExpr until a matching method is
25933 found, so we don't want to bail out if the first method doesn't match.
25934 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
25935 matches, report the 123. Fixes #28070.
25937 2002-07-24 Martin Baulig <martin@gnome.org>
25939 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
25940 TypeManager.TypeToCoreType() to the top of the method so the
25941 following equality checks will work. Fixes #28107.
25943 2002-07-24 Martin Baulig <martin@gnome.org>
25945 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
25946 operand is of type uint, and the other operand is of type sbyte,
25947 short or int, the operands are converted to type long." -
25948 Actually do what this comment already told us. Fixes bug #28106,
25951 2002-07-24 Martin Baulig <martin@gnome.org>
25953 * class.cs (MethodBase): New abstract class. This is now a base
25954 class for Property, Indexer and Event to avoid some code duplication
25955 in their Define() and DefineMethods() methods.
25956 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
25957 generic methods for Define() and DefineMethods().
25958 (FieldBase): Derive from MemberBase, not MemberCore.
25959 (Property): Derive from MemberBase, not MemberCore.
25960 (Property.DefineMethod): Moved all the code from this method to the
25961 new MethodBase.DefineAccessor(), just call it with appropriate
25963 (Property.Define): Call the new Property.DoDefine(), this does some
25964 sanity checks and we don't need to duplicate the code everywhere.
25965 (Event): Derive from MemberBase, not MemberCore.
25966 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
25967 accessors, this will also make them work with interface events.
25968 (Indexer): Derive from MemberBase, not MemberCore.
25969 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
25970 (Indexer.Define): Use the new MethodBase functions.
25972 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
25973 argument to the constructor.
25974 (Interface.FindMembers): Added support for interface events.
25975 (Interface.PopluateEvent): Implemented.
25977 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
25979 2002-07-22 Miguel de Icaza <miguel@ximian.com>
25981 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
25982 but this is required to check for a method name being the same as
25983 the containing class.
25987 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25989 * interface.cs: initialize variable.
25991 2002-07-23 Martin Baulig <martin@gnome.org>
25993 Implemented the IndexerName attribute in interfaces.
25995 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
25996 name if this is an explicit interface implementation.
25997 (Indexer.InterfaceIndexerName): New public variable. If we're
25998 implementing an interface indexer, this is the IndexerName in that
25999 interface. Otherwise, it's the IndexerName.
26000 (Indexer.DefineMethod): If we're implementing interface indexer,
26001 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
26002 and Pending.ImplementIndexer methods.
26003 (Indexer.Define): Also define the PropertyBuilder if we're
26004 implementing an interface indexer and this is neither an explicit
26005 interface implementation nor do the IndexerName match the one in
26008 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
26009 If a method is defined here, then we always need to create a proxy
26010 for it. This is used when implementing interface indexers.
26011 (Pending.IsInterfaceIndexer): New public method.
26012 (Pending.ImplementIndexer): New public method.
26013 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
26014 This is used when implementing interface indexers to define a proxy
26016 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
26017 define a proxy if necessary.
26019 * interface.cs (Interface.IndexerName): New public variable.
26020 (Interface.PopulateIndexer): Set the IndexerName.
26021 (Interface.DefineIndexers): New private method. Populate all the
26022 indexers and make sure their IndexerNames match.
26024 * typemanager.cs (IndexerPropertyName): Added support for interface
26027 2002-07-22 Martin Baulig <martin@gnome.org>
26029 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
26030 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
26031 ret if HasReturnLabel.
26032 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
26035 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
26036 and set the ec.LoopBeginTryCatchLevel.
26037 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
26038 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
26039 the current ec.TryCatchLevel, the branch goes out of an exception
26040 block. In this case, we need to use Leave and not Br.
26042 2002-07-22 Martin Baulig <martin@gnome.org>
26044 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
26045 block unless the block does not always return or it is contained in
26046 another try { ... } catch { ... } block. Fixes bug #26506.
26047 Added verify-1.cs to the test suite.
26049 2002-07-22 Martin Baulig <martin@gnome.org>
26051 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
26052 then we do not always return. Fixes bug #24985.
26054 2002-07-22 Martin Baulig <martin@gnome.org>
26056 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
26057 lookup on a per-class level; ie. walk up the class hierarchy until we
26058 found at least one applicable method, then choose the best among them.
26059 Fixes bug #24463 and test-29.cs.
26061 2002-07-22 Martin Baulig <martin@gnome.org>
26063 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
26064 return types of the methods. The return type is not part of the
26065 signature and we must not check it to make the `new' modifier work.
26066 Fixes bug #27999, also added test-147.cs.
26067 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
26069 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
26070 on the method's return type.
26072 2002-07-21 Martin Baulig <martin@gnome.org>
26074 * assign.cs: Make this work if the rightmost source is a constant and
26075 we need to do an implicit type conversion. Also adding a few more tests
26076 to test-38.cs which should have caught this.
26078 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
26079 target in the makefile for this. The makefile.gnu is primarily intended
26080 for end-users who don't want to debug the compiler.
26082 2002-07-21 Martin Baulig <martin@gnome.org>
26084 * assign.cs: Improved the Assign class so it can now handle embedded
26085 assignments (X = Y = Z = something). As a side-effect this'll now also
26086 consume less local variables. test-38.cs now passes with MCS, added
26087 a few new test cases to that test.
26089 2002-07-20 Martin Baulig <martin@gnome.org>
26091 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
26092 instructions. Fixes bug #27977, also added test-146.cs.
26094 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26096 * cs-tokenizer.cs: fixed getHex ().
26098 2002-07-19 Martin Baulig <martin@gnome.org>
26100 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
26101 not Type.GetType() to lookup the array type. This is needed when
26102 we're constructing an array of a user-defined type.
26103 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
26104 single-dimensional arrays, but also for single-dimensial arrays of
26107 2002-07-19 Martin Baulig <martin@gnome.org>
26109 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
26110 this function is called, it's not allowed to share LocalBuilders
26111 among ILGenerators.
26113 2002-07-19 Martin Baulig <martin@gnome.org>
26115 * expression.cs (Argument.Resolve): Report an error 118 when trying
26116 to pass a type as argument.
26118 2002-07-18 Martin Baulig <martin@gnome.org>
26120 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
26121 Conv_R_Un for the signed `long' type.
26123 2002-07-15 Miguel de Icaza <miguel@ximian.com>
26125 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
26126 `expr' for the temporary result, as that will fail if we do
26127 multiple resolves on the same expression.
26129 2002-07-05 Miguel de Icaza <miguel@ximian.com>
26131 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
26132 ec.TypeContainer for looking up aliases.
26134 * class.cs (TypeContainer): Remove LookupAlias from here.
26136 * decl.cs (DeclSpace); Move here.
26138 2002-07-01 Miguel de Icaza <miguel@ximian.com>
26140 * class.cs (FindMembers): Only call filter if the constructor
26141 bulider is not null.
26143 Also handle delegates in `NestedTypes' now. Now we will perform
26144 type lookups using the standard resolution process. This also
26147 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
26148 This uses Expressions (the limited kind that can be parsed by the
26149 tree) instead of strings.
26151 * expression.cs (ComposedCast.ToString): Implement, used to flag
26152 errors since now we have to render expressions.
26154 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
26157 * ecore.cs (SimpleName.ToString): ditto.
26159 * cs-parser.jay: Instead of using strings to assemble types, use
26160 Expressions to assemble the type (using SimpleName, ComposedCast,
26161 MemberAccess). This should fix the type lookups in declarations,
26162 because we were using a different code path for this.
26164 * statement.cs (Block.Resolve): Continue processing statements
26165 even when there is an error.
26167 2002-07-17 Miguel de Icaza <miguel@ximian.com>
26169 * class.cs (Event.Define): Also remove the `remove' method from
26170 the list of pending items.
26172 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
26173 generate more compact code.
26175 2002-07-17 Martin Baulig <martin@gnome.org>
26177 * const.cs (Const.LookupConstantValue): Add support for constant
26178 `unchecked' and `checked' expressions.
26179 Also adding test case test-140.cs for this.
26181 2002-07-17 Martin Baulig <martin@gnome.org>
26183 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
26184 check whether mi.ReturnType implements the IEnumerator interface; the
26185 `==' and the IsAssignableFrom() will fail in this situation.
26187 2002-07-16 Ravi Pratap <ravi@ximian.com>
26189 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
26192 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26194 * expression.cs: fixed bug #27811.
26196 2002-07-14 Miguel de Icaza <miguel@ximian.com>
26198 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
26199 Molaro: when we are a ref, the value already contains a pointer
26200 value, do not take the address of it.
26202 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26203 * removed mb-parser.jay and mb-tokenizer.cs
26205 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26207 * expression.cs: check against the building corlib void type.
26209 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
26211 * ecore.cs: fix for valuetype static readonly fields: when
26212 initializing them, we need their address, not the address of a copy.
26214 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26216 * typemanager.cs: register also enum_type in corlib.
26218 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26220 * class.cs: allow calling this (but not base) initializers in structs.
26222 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
26224 * ecore.cs: make sure we compare against the building base types
26227 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26229 * typemanager.cs: fix TypeToCoreType() to handle void and object
26230 (corlib gets no more typerefs after this change).
26232 2002-07-12 Miguel de Icaza <miguel@ximian.com>
26234 * expression.cs (ArrayCreation.EmitArrayArguments): use
26235 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
26237 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
26238 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
26239 array indexes, the runtime actually forbids them.
26241 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
26242 for array arguments here.
26244 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
26245 instead of the default for ValueTypes.
26247 (New.DoEmit): Use IsValueType instead of
26248 IsSubclassOf (value_type)
26249 (New.DoResolve): ditto.
26250 (Invocation.EmitCall): ditto.
26252 * assign.cs (Assign): ditto.
26254 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
26255 Statements *are* currently doing part of their resolution during
26258 Expressions do always resolve during resolve, but statements are
26259 only required to propagate resolution to their children.
26261 2002-07-11 Miguel de Icaza <miguel@ximian.com>
26263 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
26265 (LoadAssembly): Do not add the dll if it is already specified
26267 (MainDriver): Add the System directory to the link path at the end,
26268 after all the other -L arguments.
26270 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
26271 wrong opcode for loading bytes and bools (ldelem.i1 instead of
26272 ldelem.u1) and using the opposite for sbytes.
26274 This fixes Digger, and we can finally run it.
26276 * driver.cs (UnixParseOption): Move the option parsing here.
26277 (CSCParseOption): Implement CSC-like parsing of options.
26279 We now support both modes of operation, the old Unix way, and the
26280 new CSC-like way. This should help those who wanted to make cross
26281 platform makefiles.
26283 The only thing broken is that /r:, /reference: and /lib: are not
26284 implemented, because I want to make those have the same semantics
26285 as the CSC compiler has, and kill once and for all the confussion
26286 around this. Will be doing this tomorrow.
26288 * statement.cs (Unsafe.Resolve): The state is checked during
26289 resolve, not emit, so we have to set the flags for IsUnsfe here.
26291 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26293 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
26294 not catch the Error_ObjectRefRequired in SimpleName (as it is
26295 possible to have a class/instance variable name that later gets
26296 deambiguated), we have to check this here.
26298 2002-07-10 Ravi Pratap <ravi@ximian.com>
26300 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
26301 make static and put into Expression.
26303 (Event.Define): Register the private field of the event with the
26304 TypeManager so that GetFieldFromEvent can get at it.
26306 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
26307 keep track of the private field associated with an event which
26310 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
26313 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
26315 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26317 * expression.cs (Binary.EmitBranchable): this routine emits the
26318 Binary expression in a branchable context. This basically means:
26319 we need to branch somewhere, not just get the value on the stack.
26321 This works together with Statement.EmitBoolExpression.
26323 * statement.cs (Statement.EmitBoolExpression): Use
26326 2002-07-09 Miguel de Icaza <miguel@ximian.com>
26328 * statement.cs (For): Reduce the number of jumps in loops.
26330 (For): Implement loop inversion for the For statement.
26332 (Break): We can be breaking out of a Try/Catch controlled section
26333 (foreach might have an implicit try/catch clause), so we need to
26334 use Leave instead of Br.
26336 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
26337 now). If the instace expression supports IMemoryLocation, we use
26338 the AddressOf method from the IMemoryLocation to extract the
26339 address instead of emitting the instance.
26341 This showed up with `This', as we were emitting the instance
26342 always (Emit) instead of the Address of This. Particularly
26343 interesting when This is a value type, as we dont want the Emit
26344 effect (which was to load the object).
26346 2002-07-08 Miguel de Icaza <miguel@ximian.com>
26348 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
26350 * statement.cs (Checked): Set the CheckedState during the resolve
26351 process too, as the ConvCast operations track the checked state on
26352 the resolve process, and not emit.
26354 * cs-parser.jay (namespace_member_declaration): Flag that we have
26355 found a declaration when we do. This is used to flag error 1529
26357 * driver.cs: Report ok when we display the help only.
26359 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
26361 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
26363 2002-07-04 Miguel de Icaza <miguel@ximian.com>
26365 * cs-tokenizer.cs (define): We also have to track locally the
26366 defines. AllDefines is just used for the Conditional Attribute,
26367 but we also need the local defines for the current source code.
26369 2002-07-03 Miguel de Icaza <miguel@ximian.com>
26371 * statement.cs (While, For, Do): These loops can exit through a
26372 Break statement, use this information to tell whether the
26373 statement is the last piece of code.
26375 (Break): Flag that we break.
26377 * codegen.cs (EmitContexts): New `Breaks' state variable.
26379 2002-07-03 Martin Baulig <martin@gnome.org>
26381 * class.cs (TypeContainer.MethodModifiersValid): Allow override
26382 modifiers in method declarations in structs. Otherwise, you won't
26383 be able to override things like Object.Equals().
26385 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26387 * class.cs (Method, Property, Indexer): Do not allow the public
26388 modifier to be used in explicit interface implementations.
26390 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
26391 override modifiers in method declarations in structs
26393 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
26395 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
26396 integer or real overflow, report an error
26398 2002-07-02 Martin Baulig <martin@gnome.org>
26400 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
26401 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
26402 to tell the runtime about our newly created System.Object and
26403 System.ValueType types.
26405 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26407 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
26408 struct instead of Ldarg/Starg.
26410 2002-07-02 Martin Baulig <martin@gnome.org>
26412 * expression.cs (Indirection.Indirection): Call
26413 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
26415 2002-07-02 Martin Baulig <martin@gnome.org>
26417 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
26418 ValueType, call TypeManager.TypeToCoreType() on it.
26419 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
26420 the OpCodes.Newarr argument.
26422 2002-07-02 Martin Baulig <martin@gnome.org>
26424 * expression.cs (Invocation.EmitCall): When compiling corlib,
26425 replace all calls to the system's System.Array type to calls to
26426 the newly created one.
26428 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
26429 System.Array methods.
26430 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
26431 from the system's System.Array type which must be replaced.
26433 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
26435 * typemanager.cs: load unverifiable_code_ctor so we can build
26436 corlib using the correct type. Avoid using GetTypeCode() with
26438 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
26439 TypeManager.object_type to allow building corlib.
26441 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26443 * ecore.cs: handle System.Enum separately in LoadFromPtr().
26445 2002-07-01 Martin Baulig <martin@gnome.org>
26447 * class.cs: Make the last change actually work, we need to check
26448 whether `ifaces != null' to avoid a crash.
26450 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26452 * class.cs: when we build structs without fields that implement
26453 interfaces, we need to add the interfaces separately, since there is
26454 no API to both set the size and add the interfaces at type creation
26457 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26459 * expression.cs: the dimension arguments to the array constructors
26460 need to be converted if they are a long.
26462 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
26464 * class.cs: don't emit ldarg.0 if there is no parent constructor
26465 (fixes showstopper for corlib).
26467 2002-06-29 Martin Baulig <martin@gnome.org>
26469 MCS now compiles corlib on GNU/Linux :-)
26471 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
26472 ie. check for MethodImplOptions.InternalCall.
26474 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
26475 and TypeManager.attribute_type are null, so we must explicitly check
26476 whether parent is not null to find out whether it's an attribute type.
26477 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
26478 and SetBuilder, not only if the property is neither abstract nor external.
26479 This is necessary to set the MethodImplOptions on the accessor methods.
26480 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
26481 SetBuilder, see Property.Emit().
26483 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
26484 populate "System.Object", "System.ValueType" and "System.Attribute" since
26485 they've already been populated from BootCorlib_PopulateCoreTypes().
26487 2002-06-29 Martin Baulig <martin@gnome.org>
26489 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
26490 is the NullLiteral, we also need to make sure that target_type is not
26493 2002-06-29 Martin Baulig <martin@gnome.org>
26495 * rootcontext.cs (RootContext.ResolveCore): We must initialize
26496 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
26497 before calling BootstrapCorlib_ResolveDelegate ().
26499 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26501 * statement.cs: fixed build-breaker. All tests passed ok.
26503 2002-06-27 Martin Baulig <martin@gnome.org>
26505 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
26506 for System.Decimal when compiling corlib.
26508 2002-06-27 Martin Baulig <martin@gnome.org>
26510 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
26511 switch blocks which contain nothing but a default clause.
26513 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
26515 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
26517 2002-06-27 Martin Baulig <martin@gnome.org>
26519 * ecore.cs (PropertyExpr.PropertyExpr): Call
26520 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
26522 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
26523 is already a TypeBuilder.
26525 2002-06-27 Martin Baulig <martin@gnome.org>
26527 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
26528 `target_type == TypeManager.array_type', not IsAssignableFrom() in
26529 the "from an array-type to System.Array" case. This makes it work
26530 when compiling corlib.
26532 2002-06-27 Martin Baulig <martin@gnome.org>
26534 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
26535 non-static PropertyExpr, set its InstanceExpression. This makes
26536 the `ICollection.Count' property work in System/Array.cs.
26538 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
26540 * driver.cs: Made error handling more consistent. Errors now
26541 tracked by Report class, so many methods which used to return int
26542 now return void. Main() now prints success/failure and
26543 errors/warnings message.
26545 Renamed '--probe' compiler argument to '--expect-error'. Removed
26546 the magic number return values (123 and 124). Now, if the
26547 expected error occurs, the compiler exits with success (exit value
26548 0). If the compilation completes without seeing that particular
26549 error, the compiler exits with failure (exit value 1). The
26550 makefile in mcs/errors has been changed to handle the new behaviour.
26552 * report.cs: Made 'expected error' number a property and renamed
26553 it from 'Probe' to 'ExpectedError'.
26555 * genericparser.cs: Removed error handling support, since it is
26556 now all done by Report class.
26558 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
26559 class, so parse() no longer returns an int.
26561 * namespace.cs: Use Report.Error instead of GenericParser.error
26563 2002-06-22 Miguel de Icaza <miguel@ximian.com>
26565 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
26566 TypeContainer.AddOperator): At the front of the list put the
26567 explicit implementations, so they get resolved/defined first.
26569 2002-06-21 Miguel de Icaza <miguel@ximian.com>
26571 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
26572 interface type is implemented by this TypeContainer. Used during
26573 explicit interface implementation.
26575 (Property.Define, Indexer.Define, Method.Define): Validate that
26576 the given interface in the explicit implementation is one of the
26577 base classes for the containing type.
26579 Also if we are explicitly implementing an interface, but there is
26580 no match in the pending implementation table, report an error.
26582 (Property.Define): Only define the property if we are
26583 not explicitly implementing a property from an interface. Use the
26584 correct name also for those properties (the same CSC uses,
26585 although that is really not needed).
26587 (Property.Emit): Do not emit attributes for explicitly implemented
26588 properties, as there is no TypeBuilder.
26590 (Indexer.Emit): ditto.
26592 Hiding then means that we do not really *implement* a pending
26593 implementation, which makes code fail.
26595 2002-06-22 Martin Baulig <martin@gnome.org>
26597 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
26598 the return value of Object.GetType(). [FIXME: we need to do this whenever
26599 we get a type back from the reflection library].
26601 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26603 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
26605 2002-06-20 Miguel de Icaza <miguel@ximian.com>
26607 * attribute.cs: Return null if we can not look up the type.
26609 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
26610 the interface types found.
26612 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
26613 interface types found.
26615 * typemanager.cs (GetInterfaces): Make this routine returns alll
26616 the interfaces and work around the lame differences between
26617 System.Type and System.Reflection.Emit.TypeBuilder in the results
26618 result for GetInterfaces.
26620 (ExpandInterfaces): Given an array of interface types, expand and
26621 eliminate repeated ocurrences of an interface. This expands in
26622 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
26625 2002-06-21 Martin Baulig <martin@gnome.org>
26627 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
26630 2002-06-21 Martin Baulig <martin@gnome.org>
26632 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
26633 and called with one of the core types, return the corresponding typebuilder for
26636 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
26639 2002-06-21 Martin Baulig <martin@gnome.org>
26641 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
26642 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
26643 (Expression.ConvertReferenceExplicit): Likewise.
26645 * expression.cs (ElementAccess.DoResolve): Likewise.
26646 (ElementAccess.DoResolveLValue): Likewise.
26648 2002-06-10 Martin Baulig <martin@gnome.org>
26650 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
26651 add the "value" parameter to the parameter list.
26653 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
26656 2002-06-19 Miguel de Icaza <miguel@ximian.com>
26658 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
26659 the argument to an int, uint, long or ulong, per the spec. Also
26660 catch negative constants in array creation.
26662 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
26664 * class.cs: do not allow the same interface to appear twice in
26665 the definition list.
26667 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26669 * ecore.cs: don't use ldlen with System.Array.
26671 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26673 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
26675 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
26677 * modifiers.cs: produce correct field attributes for protected
26678 internal. Easy fix so miguel can work on ther harder stuff:-)
26680 2002-06-18 Miguel de Icaza <miguel@ximian.com>
26682 * pending.cs: New file. Move the code from class.cs here.
26683 Support clearning the pending flag for all methods (when not doing
26684 explicit interface implementation).
26686 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26688 * rootcontext.cs: added a couple more types needed to bootstrap.
26690 2002-06-17 Miguel de Icaza <miguel@ximian.com>
26692 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
26693 constructor in the type, instead of any constructor in the type
26694 hierarchy. Thanks to Paolo for finding this bug (it showed up as
26695 a bug in the Mono runtime when applying the params attribute).
26697 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26698 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
26700 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
26702 * expression.cs (Unary.ResolveOperator): Use TypeManager
26703 to resolve the type.
26705 2002-06-13 Ravi Pratap <ravi@ximian.com>
26707 * cs-parser.jay (enum_member_declaration): Pass in the attributes
26710 * enum.cs (AddEnumMember): Add support to store the attributes associated
26711 with each member too.
26713 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
26714 field builders too - this takes care of the enum member case.
26716 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
26718 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
26719 address-of operator on both value types and pointers.
26721 2002-06-10 Martin Baulig <martin@gnome.org>
26723 * interface.cs (Interface.PopulateIndexer): Add the indexer's
26724 PropertyBuilder to the `property_builders' list.
26726 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
26727 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
26728 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
26729 find any indexers which are inherited from an interface.
26731 2002-06-09 Martin Baulig <martin@gnome.org>
26733 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
26734 the same type as the constant if necessary. There's also a test-130.cs
26737 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
26739 * typemanager.cs (TypeManager.ChangeType): Previously known as
26740 Enum.ChangeEnumType().
26742 2002-06-09 Martin Baulig <martin@gnome.org>
26744 * expression.cs (Cast.TryReduce): Added support for consts.
26746 2002-06-08 Ravi Pratap <ravi@ximian.com>
26748 * class.cs (Accessor): Hold attributes information so we can pass
26751 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
26752 Modify to pass in attributes attached to the methods.
26754 (add_accessor_declaration, remove_accessor_declaration): Ditto.
26756 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
26757 to handle the Accessor kind :-)
26759 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
26761 2002-06-08 Martin Baulig <martin@gnome.org>
26763 * expression.cs (Unary.TryReduceNegative): Added support for
26766 2002-06-08 Martin Baulig <martin@gnome.org>
26768 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
26769 name can't be found in the `defined_names' - the caller will do a
26770 MemberLookup in this case and thus find methods in System.Enum
26771 such as Enum.IsDefined().
26773 2002-06-08 Martin Baulig <martin@gnome.org>
26775 * enum.cs (Enum.ChangeEnumType): This is a custom version of
26776 Convert.ChangeType() which works with TypeBuilder created types.
26777 (Enum.LookupEnumValue, Enum.Define): Use it here.
26779 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
26780 `TypeBuilder.BaseType != null' check.
26781 (TypeContainer.FindMembers): Only lookup parent members if we
26782 actually have a parent.
26783 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
26784 (ConstructorInitializer.Resolve): Likewise.
26786 * interface.cs (Interface.FindMembers): Added
26787 `TypeBuilder.BaseType != null' check.
26789 * rootcontext.cs (RootContext.ResolveCore): Added
26790 "System.Runtime.CompilerServices.IndexerNameAttribute" to
26791 classes_second_stage.
26793 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
26794 debug_type and trace_type when compiling with --nostdlib.
26796 2002-06-07 Martin Baulig <martin@gnome.org>
26798 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
26799 (AddField): Set it to true when adding a non-static field.
26800 (DefineType): Use `have_nonstatic_fields' to find out whether we
26801 have non-static fields, not `Fields != null'.
26803 2002-06-02 Miguel de Icaza <miguel@ximian.com>
26805 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
26806 dereferencing a null on the static-field code path)
26808 2002-05-30 Martin Baulig <martin@gnome.org>
26810 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
26811 to take command line arguments. Use reflection to call the new
26812 custom `Initialize' function on the symbol writer and pass it the
26813 command line arguments.
26815 * driver.cs (--debug-args): New command line argument to pass command
26816 line arguments to the symbol writer.
26818 2002-05-28 Miguel de Icaza <miguel@ximian.com>
26820 * assign.cs (DoResolve): Forgot to do the implicit conversion to
26821 the target type for indexers and properties. Thanks to Joe for
26824 2002-05-27 Miguel de Icaza <miguel@ximian.com>
26826 * typemanager.cs (MethodFlags): returns the method flags
26827 (Obsolete/ShouldIgnore) that control warning emission and whether
26828 the invocation should be made, or ignored.
26830 * expression.cs (Invocation.Emit): Remove previous hack, we should
26831 not do this on matching a base type, we should do this based on an attribute
26833 Only emit calls to System.Diagnostics.Debug and
26834 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
26835 on the command line.
26837 * rootcontext.cs: Global settings for tracing and debugging.
26839 * cs-tokenizer.cs (define): New utility function to track
26840 defines. Set the global settings for TRACE and DEBUG if found.
26842 2002-05-25 Ravi Pratap <ravi@ximian.com>
26844 * interface.cs (Populate*): Pass in the TypeContainer as well as
26845 the DeclSpace as parameters so that we can create EmitContexts and
26846 then use that to apply attributes etc.
26848 (PopulateMethod, PopulateEvent, PopulateProperty)
26849 (PopulateIndexer): Apply attributes everywhere.
26851 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
26854 (ApplyAttributes): Update accordingly.
26856 We now apply interface attributes for all members too.
26858 2002-05-26 Miguel de Icaza <miguel@ximian.com>
26860 * class.cs (Indexer.Define); Correctly check if we are explicit
26861 implementation (instead of checking the Name for a ".", we
26862 directly look up if the InterfaceType was specified).
26864 Delay the creation of the PropertyBuilder.
26866 Only create the PropertyBuilder if we are not an explicit
26867 interface implementation. This means that explicit interface
26868 implementation members do not participate in regular function
26869 lookups, and hence fixes another major ambiguity problem in
26870 overload resolution (that was the visible effect).
26872 (DefineMethod): Return whether we are doing an interface
26875 * typemanager.cs: Temporary hack until we get attributes in
26876 interfaces (Ravi is working on that) and we get IndexerName
26877 support in interfaces.
26879 * interface.cs: Register the indexers as properties.
26881 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
26882 warning, I have verified that this is a bug in the .NET runtime
26883 (JavaScript suffers of the same problem).
26885 * typemanager.cs (MemberLookup): When looking up members for
26886 interfaces, the parent of an interface is the implicit
26887 System.Object (so we succeed in searches of Object methods in an
26888 interface method invocation. Example: IEnumerable x; x.ToString
26891 2002-05-25 Miguel de Icaza <miguel@ximian.com>
26893 * class.cs (Event): Events should also register if they do
26894 implement the methods that an interface requires.
26896 * typemanager.cs (MemberLookup); use the new GetInterfaces
26899 (GetInterfaces): The code used to lookup interfaces for a type is
26900 used in more than one place, factor it here.
26902 * driver.cs: Track the errors at the bottom of the file, we kept
26905 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
26906 instance if the method we are calling is static!
26908 2002-05-24 Miguel de Icaza <miguel@ximian.com>
26910 * attribute.cs (ApplyAttributes): Make this function filter out
26911 the IndexerName attribute (as that attribute in reality is never
26912 applied) and return the string constant for the IndexerName
26915 * class.cs (TypeContainer.Emit): Validate that all the indexers
26916 have the same IndexerName attribute, and if so, set the
26917 DefaultName attribute on the class.
26919 * typemanager.cs: The return value might contain other stuff (not
26920 only methods). For instance, consider a method with an "Item"
26921 property and an Item method.
26923 * class.cs: If there is a problem with the parameter types,
26926 2002-05-24 Ravi Pratap <ravi@ximian.com>
26928 * ecore.cs (ImplicitConversionExists): Wrapper function which also
26929 looks at user defined conversion after making a call to
26930 StandardConversionExists - we need this for overload resolution.
26932 * expression.cs : Update accordingly the various method calls.
26934 This fixes 2 bugs filed against implicit user defined conversions
26936 2002-05-22 Miguel de Icaza <miguel@ximian.com>
26938 * statement.cs: Track the result of the assignment.
26940 2002-05-21 Miguel de Icaza <miguel@ximian.com>
26942 * expression.cs (MemberAccess): Improved error reporting for
26943 inaccessible members.
26945 2002-05-22 Martin Baulig <martin@gnome.org>
26947 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
26948 itself with debugging support.
26950 2002-05-22 Martin Baulig <martin@gnome.org>
26952 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
26953 Removed, this isn't needed anymore.
26955 2002-05-20 Martin Baulig <martin@gnome.org>
26957 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
26958 be underlying type for an enum.
26960 2002-05-20 Miguel de Icaza <miguel@ximian.com>
26962 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
26963 that splits out the loading of just the core types.
26965 * rootcontext.cs (ResolveCore): Split the struct resolution in
26966 two, so we can load the enumeration underlying types before any
26969 * expression.cs (Is): Bandaid until we fix properly Switch (see
26970 bug #24985 for details).
26972 * typemanager.cs (ImplementsInterface): The hashtable will contain
26973 a null if there are no interfaces implemented.
26975 2002-05-18 Miguel de Icaza <miguel@ximian.com>
26977 * cs-parser.jay (indexer_declarator): It is fine to have array
26980 2002-05-17 Miguel de Icaza <miguel@ximian.com>
26982 * typemanager.cs: (RegisterBuilder): New function used to register
26983 TypeBuilders that implement interfaces. Since
26984 TypeBuilder.GetInterfaces (as usual) does not work with lame
26986 (AddUserType): register interfaces.
26988 (ImplementsInterface): Use the builder_to_ifaces hash if we are
26989 dealing with TypeBuilder. Also, arrays are showing up as
26990 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
26991 methods can not be invoked on them!
26993 * ecore.cs (ExplicitReferenceConversionExists): Made public.
26994 (ImplicitReferenceConversionExists): Split out from
26995 StandardConversionExists.
26997 * expression.cs (As): We were only implementing one of the three
26998 cases for the as operator. We now implement them all.
26999 (Is): Implement the various other cases for Is as well.
27001 * typemanager.cs (CACHE): New define used to control if we want or
27002 not the FindMembers cache. Seems to have a negative impact on
27003 performance currently
27005 (MemberLookup): Nested types have full acess to
27006 enclosing type members
27008 Remove code that coped with instance/static returns for events, we
27009 now catch this in RealFindMembers.
27011 (RealFindMembers): only perform static lookup if the instance
27012 lookup did not return a type or an event.
27014 2002-05-17 Miguel de Icaza <miguel@ximian.com>
27016 * assign.cs (CompoundAssign): We pass more semantic information
27017 now to Compound Assignments than we did before: now we have all
27018 the information at hand, and now we resolve the target *before* we
27019 do the expression expansion, which allows the "CacheValue" method
27020 to have the effect we intended (before, a [x] += 1 would generate
27021 two differen ArrayAccess expressions from the ElementAccess,
27022 during the resolution process).
27024 (CompoundAssign.DoResolve): Resolve target and original_source here.
27026 2002-05-16 Miguel de Icaza <miguel@ximian.com>
27028 * expression.cs (ArrayAccess): dropped debugging information.
27030 * typemanager.cs: Small bug fix: I was always returning i_members,
27031 instead of one of i_members or s_members (depending on which had
27034 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
27035 method is invoked before any code generation takes place, and it
27036 is a mechanism to inform that the expression will be invoked more
27037 than once, and that the method should use temporary values to
27038 avoid having side effects
27040 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
27042 * ecore.cs (Expression.CacheTemporaries): Provide empty default
27045 * expression.cs (Indirection, ArrayAccess): Add support for
27046 CacheTemporaries in these two bad boys.
27048 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
27049 ldobj or ldind_ref.
27050 (StoreFromPtr): Handle stobj as well.
27052 * expression.cs (UnaryMutator): Share more code.
27054 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
27055 down: I was not tracking the Filter function as well, which
27056 was affecting the results of the cache.
27058 2002-05-15 Miguel de Icaza <miguel@ximian.com>
27060 * attribute.cs: Remove the hack to handle the CharSet property on
27063 2002-05-14 Miguel de Icaza <miguel@ximian.com>
27065 * attribute.cs (DoResolve): More uglyness, we now only try to
27066 resolve the attribute partially, to extract the CharSet
27067 information (only if we are a StructLayout attribute). Otherwise
27069 (GetExtraTypeInfo): Add some code to conditionally kill in the
27070 future this. I am more and more convinced that the .NET
27071 framework has special code to handle the attribute setting on
27074 * expression.cs (IsParamsMethodApplicable): Revert my previous
27075 foreach change here, it was wrong.
27077 2002-05-13 Miguel de Icaza <miguel@ximian.com>
27079 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
27080 (pp_expr): do not abort on unknown input, just return.
27081 (eval): abort if there are pending chars.
27083 * attribute.cs (Attribute.Resolve): Positional parameters are
27084 optional. Deal with that case.
27086 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
27087 the Ansi/Unicode/Auto information for the type.
27089 (TypeContainer.DefineType): instantiate the EmitContext here, as
27090 we will be using it during the type definition (to resolve
27091 attributes) and during the emit phase.
27093 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
27094 to pull type information out of the attributes
27096 (Attribute.Resolve): track the constructor builder, and allow for
27097 multiple invocations (structs and classes will use this).
27099 * ecore.cs (MemberLookupFinal): new version with all the
27100 parameters customizable.
27102 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
27103 constructors. Return if the result value is null (as the error
27104 would have been flagged already by MemberLookupFinal)
27106 Do not allow instances of abstract classes or interfaces to be
27109 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
27110 We have to compare the assembly property here when dealing with
27111 FamANDAssem and Assembly access modifiers, because we might be
27112 creating an assembly from *modules* (that means that we are not
27113 getting TypeBuilders for types defined in other modules that are
27114 part of this assembly).
27116 (Method.Emit): If the method is marked abstract and has a body,
27119 (TypeContainer.DefineMembers): If both the defined member and the
27120 parent name match are methods, then do not emit any warnings: let
27121 the Method.Define routine take care of flagging warnings. But if
27122 there is a mismatch (method overrides something else, or method is
27123 overriwritten by something, then emit warning).
27125 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
27126 set to null, this means `do not check for the return type on the
27129 (Method.Define): set the return type for the method signature to
27130 null, so that we get methods with the same name and parameters and
27131 different return types. This is used to flag warning 114 (you are
27132 hiding a method, and you probably want to use the new/override
27135 * typemanager.cs (MemberLookup): Implemented proper access
27136 control, closing a long standing set of bug reports. The problem
27137 was that the Framework only has two bits: Public and NonPublic,
27138 and NonPublic includes private and protected methods, but we need
27139 to enforce the FamANDAssem, FamOrAssem and Family.
27141 2002-05-11 Miguel de Icaza <miguel@ximian.com>
27143 * statement.cs (GotoCase): Return true: Ammounts to giving up
27144 knowledge on whether we return or not, and letting the other case
27145 be responsible for it.
27147 2002-05-10 Miguel de Icaza <miguel@ximian.com>
27149 * driver.cs: Do not load directories for each file processed, only
27150 do it if there is a pattern.
27152 * ecore.cs: Report readonly assigns here as well, as we might have
27153 been resolved only by MemberAccess.
27155 (SimpleName.SimpleNameResolve): Also be useful for LValue
27156 resolution. We need this to propagate assign to local readonly variables
27158 * typemanager.cs: Use a ptrhashtable for the criteria, because we
27159 do not want to reuse potential criteria memory.
27161 * class.cs (MyEventBuilder): Set reflected_type;
27163 * ecore.cs (Constantify): Added support for constifying bools.
27165 (RootContext.LookupType): Added a cache for values looked up in
27166 the declaration space.
27168 * typemanager.cs (FindMembers): Now is a front-end to
27169 RealFindMembers, and provides a two-level hashtable-based cache to
27172 15% performance improvement: from 22.5 to 19.2 seconds.
27174 * expression.cs (IsParamsMethodApplicable): use foreach.
27175 (Invocation.DoResolve): ditto.
27176 (New.DoResolve): ditto.
27177 (ArrayCreation.DoResolve): ditto.
27179 * ecore.cs (FindMostEncompassingType): use foreach.
27181 * delegate.cs (NewDelegate.DoResolve): Use foreach
27183 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
27184 (RemoveMethods): use foreach.
27186 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
27187 nested foreach statements instead of for, and also break out of
27188 the inner loop once a match is found.
27190 (Invocation.OverloadResolve): Use foreach, simplify the code.
27192 2002-05-08 Miguel de Icaza <miguel@ximian.com>
27194 * cfold.cs (BinaryFold): During an enumeration evaluation context,
27195 we actually unwrap the expression to allow for extra information
27198 * expression.cs: Use Shr_Un on unsigned operations.
27200 2002-05-08 Ravi Pratap <ravi@ximian.com>
27202 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
27203 applicable operators was not being considered correctly. This closes
27204 the bug Miguel reported.
27206 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
27208 * attribute.cs: check that the type derives from System.Attribute
27209 and report the correct error in that case (moved the duplicate code to
27210 its own method, too).
27212 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
27214 * attribute.cs: lookup attribute type name as the spec says: first the
27215 bare attribute name and then name + "Attribute" (nant compiles with
27216 mcs after this fix).
27218 2002-05-07 Miguel de Icaza <miguel@ximian.com>
27220 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
27221 Because of the way we parse things, we should try to see if a
27222 UIntConstant can fit in an integer.
27224 2002-05-07 Ravi Pratap <ravi@ximian.com>
27226 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
27227 when we are in an explicit context.
27229 (ConvertReferenceExplicit): When converting from Iface type S to Class
27230 T make sure the rules are implemented as an OR.
27232 * parameter.cs (ParameterType): Make it a property for now although the
27233 purpose really isn't anything immediate.
27235 * expression.cs (Is*Applicable): Do better checking on the parameter type
27236 of a ref/out parameter. The ones from the system assemblies are already
27237 marked with the correct type so we don't need to do any correction.
27239 * ecore.cs (StandardConversionExists): Conversion from Interface types to
27240 the object type is standard too so include that.
27242 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27244 * ecore.cs (StandardConversionExists): Augment with missing code:
27245 deal with IntConstant, LongConstants and Enumerations.
27247 * assign.cs: Report the error, instead of failing silently
27249 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
27250 typecontainer that they are declared, because the
27251 typecontainer/namespace will have the list of using clauses that
27252 need to be applied.
27254 Assembly Attributes were escaping the normal registration
27257 (EmitCode): Apply attributes within an EmitContext that represents
27258 the container they were declared on.
27260 * cs-parser.jay: Track bases for structs. How did I get this wrong?
27262 2002-05-06 Ravi Pratap <ravi@ximian.com>
27264 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
27265 Revamp completely - make much cleaner as we now operate only
27268 (FindMostSpecificSource, FindMostSpecificTarget): New methods
27269 to implement the logic detailed in the spec more correctly.
27271 (UserDefinedConversion): Update accordingly.
27273 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27275 * statement.cs: Return flow analysis information up.
27277 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
27280 (token): Do not consume an extra character before calling
27283 2002-05-06 Piers Haken <piersh@friskit.com>
27285 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
27287 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27289 * class.cs (Constructor.Emit): Set the IsStatic flag in the
27290 EmitContext during the instance constructor initializer
27291 resolution, to stop access to instance variables.
27293 This is mandated by the spec, last paragraph of the `constructor
27294 initializers' section.
27296 2002-05-05 Miguel de Icaza <miguel@ximian.com>
27298 * cs-parser.jay, class.cs (Accessor): new class used to represent
27299 an accessor (get or set). In the past we used `null' to represent
27300 a missing accessor. But this is ambiguous because there was no
27301 way to tell in abstract indexers/properties if one of them was
27304 Now there is a way of addressing that.
27306 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
27307 instead of FindMembers.
27309 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
27310 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
27312 * attribute.cs: Treat indexers and properties as the same in terms
27313 of applying attributes
27315 * ecore.cs (FindMostEncompassedType): Use statically initialized
27316 EmptyExpressions()s like we do elsewhere to avoid creating useless
27317 objects (and we take this out of the tight loop).
27319 (GetConversionOperators): Move the code to extract the actual
27320 operators to a separate routine to clean things up.
27322 2002-05-04 Miguel de Icaza <miguel@ximian.com>
27324 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
27325 events are always registered FieldBuilders.
27327 * class.cs (FieldBase): New class shared by Fields
27329 * delegate.cs: If we are a toplevel delegate, use our full name.
27330 If we are a nested delegate, then only use our tail name.
27332 2002-05-02 Ravi Pratap <ravi@ximian.com>
27334 * expression.cs (IsApplicable): Ensure that we add the "&" to
27335 ref/out types before comparing it with the type of the argument.
27337 (IsParamsMethodApplicable): Ditto.
27339 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
27342 * delegate.cs : Handle the case when we have more than one applicable
27343 method. Flag an error only when we finish checking all.
27345 2002-05-02 Miguel de Icaza <miguel@ximian.com>
27347 * expression.cs: Add support for boolean static initializers.
27349 2002-05-01 Miguel de Icaza <miguel@ximian.com>
27351 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
27353 * parameter.cs (ComputeParameterTypes,
27354 ComputeAndDefineParameterTypes): Better error handling: now we
27355 clear the `types' cache if we fail during any of the type lookups.
27356 We also return the status code correctly to our caller
27358 * delegate.cs: If we fail to define a delegate, abort the extra
27361 * expression.cs (Binary.ResolveOperator): for
27362 operator==(object,object) and operator !=(object, object) we also
27363 have to verify that there is an implicit conversion from one to
27366 (ArrayAccess.DoResolve): Array Access can operate on
27369 2002-04-30 Miguel de Icaza <miguel@ximian.com>
27371 * assign.cs (CompoundAssign): A new class used as a "flag" that
27372 the assignment actually is happening as part of a compound
27373 assignment operator.
27375 During compound assignment, a few new rules exist to enable things
27382 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
27383 to the type of x) if y is implicitly convertible to the type of x,
27384 and the operator is a builtin operator and the return type of the
27385 operator is explicitly convertible to the type of x.
27387 * rootcontext.cs: Reset warning level to 2. 4 catches various
27388 "interesting" features in mcs, we must clean this up at some
27389 point, but currently am trying to kill other bugs ;-)
27391 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
27392 in container classes as well.
27394 * expression.cs (Binary.ResolveOperator): Handle string case
27395 before anything else (as operator overloading does emit an error
27396 before doing anything else).
27398 This code could go away when we move to a table driven model, but
27399 i could not come up with a good plan last night.
27401 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
27403 * typemanager.cs (CSharpName): reimplementation using regex.
27404 * class.cs: added null check for fields in Emit
27405 * rootcontext.cs: set warninglevel to 4
27407 2002-04-29 Miguel de Icaza <miguel@ximian.com>
27409 * typemanager.cs (CSharpName): reimplemented with Lupus
27412 2002-04-28 Miguel de Icaza <miguel@ximian.com>
27414 * statement.cs (If): correclty implement Resolve, because we were
27415 not catching sem errors in there. The same process is needed
27417 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
27420 (Statement.Warning_DeadCodeFound): Factorize code.
27421 (While): Report dead code here too.
27423 (Statement): Added Resolve virtual method to allow
27424 for resolution split from the emit code.
27426 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27428 * statement.cs (EmitBoolExpression): No longer try to resolve the
27430 (MakeBoolean): New utility function that resolve, implicitly
27431 converts to boolean and tags the expression.
27434 (If, Do): Implement dead code elimination.
27435 (While): Implement loop inversion
27437 (Do, While, For, If): Resolve the expression prior to calling our
27440 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
27443 - added method Report28 (warning: program has more than one entry point)
27444 - added method IsEntryPoint, implements paragraph 10.1 of the spec
27445 - modified method Method.Define, the part at the end of the method
27447 * rootcontext.cs: added static public Location EntryPointLocation;
27449 * ../errors/cs0028.cs : Add test case for the above warning.
27452 - modified method CSharpName to allow arrays of primitive type to
27453 be printed nicely (e.g. instead of System.Int32[][] it now prints
27455 - added method CSharpSignature: returns the signature of a method
27456 in string format to be used in reporting errors, warnings, etc.
27458 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
27461 2002-04-26 Ravi Pratap <ravi@ximian.com>
27463 * delegate.cs (Define): Fix extremely silly bug where I was
27464 setting the type of the 'object' parameter of the BeginInvoke
27465 method to System.IAsyncResult instead of System.Object ;-)
27467 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27469 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
27472 (Constructor.Emit): return if we fail to initialize the
27473 constructor. Another door closed!
27475 * expression.cs (New.DoResolve): Improve error message (from -6 to
27476 1501). Use DeclaredOnly lookup to find the exact constructor.
27478 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
27479 loop. This is useful.
27481 * cs-parser.jay: Adjust the default parameters so that destructors
27482 have the proper signature.
27484 2002-04-26 Martin Baulig <martin@gnome.org>
27486 * driver.cs (LoadAssembly): If `assembly' contains any characters
27487 which are only valid in path names and not in assembly names
27488 (currently slash, backslash and point), use Assembly.LoadFrom ()
27489 instead of Assembly.Load () on the `assembly' (before iteration
27490 over the link_paths).
27492 2002-04-26 Martin Baulig <martin@gnome.org>
27494 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
27496 2002-04-25 Miguel de Icaza <miguel@ximian.com>
27498 * class.cs (Property): use the new typemanager.MemberLookup
27500 (TypeContainer.MemberLookup): Implement using the
27501 TypeManager.MemberLookup now.
27503 * typemanager.cs: Make MemberLookup a function of the TypeManager,
27504 and return MemberInfos, so that these can be used without an
27505 EmitContext (what we had before).
27507 2002-04-24 Miguel de Icaza <miguel@ximian.com>
27509 * expression.cs: Fix the case where the argument to params if the
27510 type of the params. I omitted handling this before. Fixed
27512 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27514 * driver.cs: Call BootCorlib_PopulateCoreType
27516 * class.cs (Property.CheckBase): Check for properties only, not
27519 * interface.cs: Temporary hack: try/catch around the
27520 CustomAttributeBuilder, because I am getting an exception that I
27523 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
27524 types whose definitions are required to be there (attributes are
27525 defined before standard types).
27527 Compute definitions as we boot the various types, as they are used
27528 immediately (value_type class will need object_type, but if we do
27529 not initialize object_type, we will pass a null, which will let
27530 the runtime pick the System.Object from the existing corlib, which
27531 is not what we want).
27533 2002-04-22 Patrik Torstensson <totte@labs2.com>
27535 * cs-tokenizer.cs: fixed a number of trim() issues.
27537 2002-04-22 Ravi Pratap <ravi@ximian.com>
27539 * expression.cs (Argument.Type): Ensure that we return the correct
27540 type when we have out or ref parameters [in which case we
27543 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27545 * class.cs (Property, Indexer): Allow extern modifier in there.
27547 * typemanager.cs (InitBaseTypes): Initializes object_type and
27548 value_type, since those will be used early on during the bootstrap
27549 process to compile corlib.
27551 (InitCoreTypes): Move code from here to InitBaseTypes.
27553 2002-04-21 Miguel de Icaza <miguel@ximian.com>
27555 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
27556 single-dimension arrays as using the ldlen opcode.
27558 Daniel Lewis discovered this optimization.
27560 * typemanager.cs: Add signature for System.Array::get_Length
27562 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27564 * statement.cs: report the error when the foreach does not apply to an
27565 array nor a collection.
27567 2002-04-19 Miguel de Icaza <miguel@ximian.com>
27569 * expression.cs: Add implicit conversions to the operator ~.
27571 * constant.cs (DecimalConstant.Emit): Emit decimal value.
27573 * typemanager.cs: Locate the decimal constructor.
27575 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27577 * attribute.cs: use the new property of TypeOf.
27578 * expression.cs: added 'get' property around typearg.
27580 These changes fix a build breaker reported by NickD. Is this the
27581 correct way to fix? If not, please, revert my changes and make it
27584 2002-04-17 Miguel de Icaza <miguel@ximian.com>
27586 * attribute.cs: Add support for typeof in attribute invocations.
27587 I am not sure that this is right though.
27589 2002-04-14 Duncan Mak <duncan@ximian.com>
27591 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
27592 Binary.Operator.Division case.
27594 2002-04-13 Ravi Pratap <ravi@ximian.com>
27596 * class.cs (DefineType): Ensure that we do a proper check on
27597 attribute types and also register it with the TypeManager.
27599 (TypeContainer.Targets): The default for attribute types is
27600 AttributeTargets.All.
27602 * attribute.cs (ApplyAttributes): Registering the attribute type
27603 is done elsewhere, not when we discover we have a Usage attribute.
27605 2002-04-12 Ravi Pratap <ravi@ximian.com>
27607 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
27608 and get rid of is_delegate parameter.
27610 * everywhere : update.
27612 2002-04-12 Ravi Pratap <ravi@ximian.com>
27614 * cs-parser.jay (compilation_unit): Revamp completely to use
27615 some new ideas that I got from Rhys' grammar to solve the problems
27616 with assembly level attributes.
27618 (outer_declaration): New grammar production.
27620 (attribute_sections): Add.
27622 (opt_attributes): Base on attribute_sections
27624 (namespace_declaration): Allow opt_attributes to tackle the case
27625 when we have assembly level attributes - we are clever in this
27628 * attribute.cs (ApplyAttributes): Do not worry about assembly
27629 attributes in the non-global context.
27631 * rootcontext.cs (AddGlobalAttributes): Go back to using this
27632 instead of SetGlobalAttributes.
27634 * class.cs, rootcontext.cs : Ensure we define and generate
27635 attribute types before anything else.
27637 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
27638 and flag the new error -20 for the case when the attribute type
27639 does not have valid targets specified. csc does not catch this.
27641 * ../errors/errors.txt : update for error # -20
27643 2002-04-11 Ravi Pratap <ravi@ximian.com>
27645 * support.cs (InternalParameters.ParameterModifier): Do some null
27646 checking and return sane values.
27648 * class.cs (Method.Define): If we are a PInvoke method, ensure
27649 that we are static and extern. Report error # 601
27651 * ../errors/cs0601.cs : Add test case for the above error.
27653 2002-04-07 Ravi Pratap <ravi@ximian.com>
27655 * rootcontext.cs (attribute_types): We need to keep type of
27656 all attribute types separately and emit code for them first.
27658 (RegisterAttribute) : Implement.
27660 * class.cs (DefineType): Check if the current Type is a custom
27661 attribute type and register it accordingly.
27663 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
27664 adding the first attribute twice and rename to
27666 (SetGlobalAttributes): this.
27668 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
27671 * attribute.cs (ApplyAttributes): Take an additional argument telling us
27672 if we are processing global arguments. Hmm, I am unsure of this.
27674 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27676 * expression.cs: added static array of strings to avoid calling
27677 Enum.ToString () for Operator in Binary. Significant recover of
27680 2002-04-10 Miguel de Icaza <miguel@ximian.com>
27682 * class.cs (FindMembers): Allow the Builders of the various
27683 members to be null. If they are skip them. This only happens
27684 during the PInvoke declaration.
27686 2002-04-09 Miguel de Icaza <miguel@ximian.com>
27688 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
27689 failure, so we do not keep going afterwards.
27691 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
27692 wanted to pass `false' as the `is_delegate' argument. If this is
27693 the case, why not use delegate_type == null to mean `is_delegate =
27694 false' and anything else as is_delegate = true.
27696 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
27698 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
27699 code for the section, not the beginning of the tests.
27701 2002-04-08 Miguel de Icaza <miguel@ximian.com>
27703 * cfold.cs: Handle operator + (Enum x, Underlying x)
27705 * expression.cs (Binary): same. Warn about errors where we have
27706 Enum/Enum in operator + as well.
27708 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
27711 - added support for switch(bool)
27712 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
27713 - add TableSwitchEmit() to handle table-based switch statements
27715 2002-04-05 Ravi Pratap <ravi@ximian.com>
27717 * expression.cs (Invocation.OverloadResolve): Factor out code which
27718 does parameter compatibility checking with arguments so that we can
27719 re-use the code even from Delegate.VerifyApplicability
27721 (VerifyArgumentsCompat): Move above code here.
27723 * delegate.cs (VerifyApplicability): Get rid of duplicate code
27724 and instead make a call to the above method.
27726 2002-03-31 Ravi Pratap <ravi@ximian.com>
27728 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
27729 We use it to keep track of classes which are attribute types.
27731 2002-04-02 Miguel de Icaza <miguel@ximian.com>
27733 * delegate.cs (Delegate.Define): Correctly define the types in the
27734 presence of fixed and array parameters.
27736 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
27739 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
27740 include NonPublic after the first iteration.
27742 * class.cs (Indexer.CheckBase): Only check if both parents are
27745 * cs-parser.jay (accessor_body): If empty, set to null.
27747 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
27748 same code path here to resolve constants names that we did have in
27749 MemberAccess.DoResolve. There is too much code duplicated here.
27751 2002-04-01 Miguel de Icaza <miguel@ximian.com>
27753 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
27755 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
27758 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
27759 tokens, numbers and strings.
27761 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
27764 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
27765 asyncronous parameters and the regular parameters.
27767 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
27768 specify the target directory.
27770 * expression.cs: (This.DoResolve): Simplify
27771 (As.Emit): Optimize, do not generate IsInst if the expression is
27772 always of the given type.
27774 (Is.DoResolve): Bug fix, we were reporting both always/never for
27777 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
27778 creating too many unnecessary arrays.
27780 2002-03-31 Miguel de Icaza <miguel@ximian.com>
27782 * class.cs (EmitFieldInitializer): Use Assign expression to assign
27783 fields instead of rolling our own initializer. Takes care of all
27784 implicit conversions, and drops unnecessary static checks/argument.
27786 2002-03-31 Dick Porter <dick@ximian.com>
27788 * driver.cs: use the GetDirectories() return values properly, and
27789 use "/" as path separator.
27791 2002-03-30 Miguel de Icaza <miguel@ximian.com>
27793 * expression.cs (Unary): Optimize - - expr into expr.
27794 (Binary): Optimize a + (-b) into a -b.
27796 * codegen.cs (CodeGen): Made all methods static.
27798 2002-03-29 Miguel de Icaza <miguel@ximian.com>
27802 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
27803 TypeBuilder property.
27805 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
27808 * tree.cs: Removed the various RecordXXXX, and replaced with a
27809 single RecordDecl. Removed all the accessor methods, and just
27810 left a single access point Type
27812 * enum.cs: Rename DefineEnum to DefineType.
27814 * decl.cs: New abstract method `DefineType' used to unify the
27815 Defines for Enumerations, Interfaces, TypeContainers and
27818 (FindType): Moved LookupInterfaceOrClass here. Moved the
27819 LookupBaseClasses method that used to live in class.cs and
27820 interface.cs here, and renamed to FindType.
27822 * delegate.cs: Implement DefineType. Take advantage of the
27823 refactored pattern for locating the parent builder without taking
27824 the parent_builder argument (which we know does not work if we are
27825 nested, and triggering a toplevel definition).
27827 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27829 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
27830 accessibility of a member has changed during override and report
27833 * class.cs (Method.Define, Property.Define): Only complain on
27834 overrides if the method is private, any other accessibility is
27835 fine (and since we just checked the permission is the same, we are
27838 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
27839 and elif are processed always. The other pre-processing
27840 directives are only processed if we are "taking" the path
27842 2002-03-29 Martin Baulig <martin@gnome.org>
27844 * class.cs (Method.Emit): Only emit symbolic debugging info if the
27845 current location is not Null.
27847 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
27848 a separate method so we can profile it.
27850 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
27851 `span.Seconds' are just seconds, but no minutes or hours.
27852 (MainDriver): Profile the CodeGen.SaveSymbols calls.
27854 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27856 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
27857 Remove the gratuitous set of Final:
27859 // If an interface implementation, then we can set Final.
27860 if (((flags & MethodAttributes.Abstract) == 0) &&
27861 implementing.DeclaringType.IsInterface)
27862 flags |= MethodAttributes.Final;
27864 I do not know what I was smoking when I used that.
27867 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
27868 step into fixing the name resolution issues for delegates and
27869 unifying the toplevel name resolution.
27871 2002-03-28 Martin Baulig <martin@gnome.org>
27873 * class.cs (Method.Emit): If we have a symbol writer, call its
27874 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
27875 tell it about the current method.
27877 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
27878 writer that we're going to emit the first byte of IL code for a new
27879 statement (a new source line).
27880 (EmitContext.EmitTopBlock): If we have a symbol writer, call
27881 EmitContext.Mark() before emitting any code.
27883 * location.cs (SymbolDocument): Return null when we're Null.
27885 * statement.cs (Statement): Moved the `Location loc' variable here.
27886 (Statement.EmitBoolExpression): If we have a symbol writer, call
27887 ec.Mark() before emitting any code to tell it that we're at the
27888 beginning of a new statement.
27889 (StatementExpression): Added `Location' argument to the constructor.
27890 (Block): Added public readonly variable `StartLocation' and public
27891 variable `EndLocation'. The latter is to be set using SetEndLocation().
27892 (Block): Added constructor which takes a start and end location.
27893 (Block.SetEndLocation): New method. This sets the end location.
27894 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
27895 local variables we create.
27896 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
27897 each statement and do also mark the begin and end of the block.
27899 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
27900 tell it the current lexer.Location, use Location.Null for the end of the
27902 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
27903 current block, set its end location using SetEndLocation().
27904 (statement_expression): StatementExpression constructor now takes the
27905 lexer.Location as additional argument.
27906 (for_statement, declare_local_variables): Likewise.
27907 (declare_local_variables): When creating a new implicit block, use the
27908 new Block constructor and pass it the lexer.Location.
27910 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27912 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
27913 members also on the parent interfaces recursively.
27915 2002-03-27 Miguel de Icaza <miguel@ximian.com>
27917 * report.cs: Use new formats, since Gonzalo finished the missing
27920 * expression.cs (Binary.ResolveOperator): added missing operator|
27921 operator& and operator^ for bool/bool.
27923 * cs-parser.jay: CheckDef now takes a Location argument that is
27924 used to report errors more precisly (instead of reporting the end
27925 of a definition, we try to track something which is a lot closer
27926 to the source of the problem).
27928 * cs-tokenizer.cs: Track global token use, so we can properly flag
27929 the use of #define/#undef after the first token has been seen.
27931 Also, rename the reportXXXX to Error_DescriptiveName
27933 * decl.cs (DeclSpace.IsTopLevel): Move property here from
27934 TypeContainer, so that Enum and Interface can use this too.
27936 * class.cs (TypeContainer.LookupInterfaceOrClass,
27937 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
27938 `builder' argument. Typically this was used to pass the parent
27939 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
27942 The problem is that a nested class could trigger the definition of
27943 a toplevel class, and the builder would be obviously wrong in that
27946 So we drop this argument, and we compute dynamically the
27947 TypeBuilder/ModuleBuilder (the correct information was available
27948 to us anyways from DeclSpace.Parent)
27950 * interface.cs (Interface.DefineInterface): Drop builder
27951 parameter cleanup like class.cs
27953 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
27956 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
27959 (Try.Emit): Propagate the returns value from the statement.
27961 (Return.Emit): Even if we are leavning
27963 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
27965 * modifiers.cs: Fix the computation of MethodAttributes flags.
27967 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
27969 * driver.cs: allow compilation of files that start with '/'.
27970 Add a default case when checking the argument of --target.
27972 2002-03-25 Miguel de Icaza <miguel@ximian.com>
27974 * interface.cs: Implement the same search algorithm for types in
27975 the interface code.
27977 * delegate.cs: Do not allow multiple definition.
27979 * Recovered ChangeLog that got accidentally amputated
27981 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
27983 * rootcontext.cs: Load manually enum to allow core classes to
27984 contain enumerations.
27986 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
27987 Update to new static methods in TypeManager.
27989 * typemanager.cs (GetMethod, GetConstructor): Use our
27990 implementation of FindMembers to find the members, since during
27991 corlib compilation, the types are TypeBuilders and GetMethod and
27992 GetConstructor do not work.
27994 Make all methods in TypeManager static.
27996 (InitCodeHelpers): Split the functionality from
27997 the InitCodeTypes function.
27999 * driver.cs: Call InitCodeHelpers after we have populated the
28002 * cs-parser.jay (delegate_declaration): we did not used to compute
28003 the delegate name correctly for void delegates.
28005 2002-03-24 Miguel de Icaza <miguel@ximian.com>
28007 * rootcontext.cs (RootContext): Init the interface_resolve_order
28008 and type_container_resolve_order always.
28010 (ResolveCore, BootstrapCorlib_ResolveClass,
28011 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
28012 compiler when compiling with --nostdlib
28014 * class.cs (TypeContainer.DefineType): Check that our parent is
28015 not null. This test is most important when we are bootstraping
28018 * codegen.cs: Split out the symbol writing code.
28020 2002-03-25 Martin Baulig <martin@gnome.org>
28022 * driver.cs (-g): Made -g an alias for --debug.
28024 2002-03-24 Martin Baulig <martin@gnome.org>
28026 * codegen.cs (SymbolWriter): New public variable. Returns the
28027 current symbol writer.
28028 (CodeGen): Added `bool want_debugging_support' argument to the
28029 constructor. If true, tell the ModuleBuild that we want debugging
28030 support and ask it for the ISymbolWriter.
28031 (Save): If we have a symbol writer, call it's Close() method after
28032 saving the assembly.
28034 * driver.c (--debug): New command line argument to create a
28035 debugger information file.
28037 * location.cs (SymbolDocument): New public property. Returns an
28038 ISymbolDocumentWriter object for the current source file or null
28039 if we don't have a symbol writer.
28041 2002-03-21 Miguel de Icaza <miguel@ximian.com>
28043 * driver.cs (LoadAssembly): Correctly return when all the paths
28044 have been tried and not before.
28046 * statement.cs (Switch.Emit): return the actual coverage for this
28047 statement (returns/not-returns)
28049 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
28050 switch of the statement if we are the last switch section. That
28051 kills two problems: try/catch problems (we used to emit an empty
28052 nop at the end) and switch statements where all branches would
28055 2002-03-19 Miguel de Icaza <miguel@ximian.com>
28057 * driver.cs: Add default assemblies (the equivalent to the
28058 Microsoft CSC.RSP file)
28060 * cs-tokenizer.cs: When updating `cols and setting it to zero,
28061 also update tokens_seen and set it to false.
28063 * driver.cs: Implement --recurse for Mike.
28065 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
28066 correctly splitting out the paths.
28068 2002-03-18 Miguel de Icaza <miguel@ximian.com>
28070 * interface.cs (Interface.PopulateProperty): Instead of using
28071 `parent' as the declaration space for the set parameters, use
28074 * support.cs (InternalParameters): InternalParameters constructor
28075 takes a DeclSpace instead of a TypeContainer.
28077 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
28078 types are being initialized, load the address of it before calling
28081 (New): Provide a mechanism to disable the generation of local
28082 value type temporaries when the caller will be providing us with
28083 an address to store it.
28085 (ArrayCreation.EmitDynamicInitializers): Use it.
28087 2002-03-17 Miguel de Icaza <miguel@ximian.com>
28089 * expression.cs (Invocation.EmitArguments): Only probe for array
28090 property if there is more than one argument. Sorry about that.
28092 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
28093 empty param arrays.
28095 * class.cs (Method.LabelParameters): Fix incorrect code path that
28096 prevented the `ParamArrayAttribute' from being applied to the
28099 2002-03-16 Miguel de Icaza <miguel@ximian.com>
28101 * support.cs (ReflectionParameters): Correctly compute whether the
28102 last argument is a params array. Fixes the problem with
28105 * typemanager.cs: Make the assemblies array always be non-null
28106 (empty, but non-null)
28108 * tree.cs (RecordDecl): New function that abstracts the recording
28109 of names. This reports error 101, and provides a pointer to the
28110 previous declaration. Fixes a crash in the compiler.
28112 * cs-parser.jay (constructor_declaration): Update to new grammar,
28113 and provide a constructor_body that can be empty.
28115 2002-03-15 Miguel de Icaza <miguel@ximian.com>
28117 * driver.cs: Add support for --resources.
28119 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
28120 Make all types for the various array helper methods be integer.
28122 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
28123 CheckState to ConvCast.
28125 (ConvCast): Now it takes a `checked' state argument, to avoid
28126 depending on the emit context for the conversion, and just using
28127 the resolve time setting.
28129 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
28130 instead of Invocation.EmitArguments. We do not emit the original
28131 arguments, instead we emit those which have been converted to
28132 unsigned int expressions.
28134 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
28136 * codegen.cs: ditto.
28138 * expression.cs (LocalVariableReference): Drop the use of the
28139 Store function that depended on the variable index.
28141 * statement.cs (VariableInfo): Drop the `Idx' property from this
28142 class, as this is not taking into account the indexes for
28143 temporaries tat we generate during the execution, getting the
28146 * class.cs: First emit class initializers, then call the parent
28149 * expression.cs (Binary): Fix opcode emision.
28150 (UnaryMutator.EmitCode): Support checked code generation
28152 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
28153 matches for events for both the Static and Instance scans,
28154 pointing to the same element. Fix that.
28156 2002-03-14 Miguel de Icaza <miguel@ximian.com>
28158 * rootcontext.cs (ResolveTree): Always set the
28159 interface_resolve_order, because nested interfaces will be calling
28162 * class.cs (GetInterfaceOrClass): Track the same resolution
28163 process used by TypeManager.LookupType. This fixes the nested
28164 type lookups in class declarations (separate path from
28167 (TypeContainer.DefineType): Also define nested interfaces.
28168 (TypeContainer.RegisterOrder): New public function used to
28169 register the order in which child interfaces need to be closed.
28171 Nested interfaces need to be closed after their parents have been
28174 * interface.cs (InterfaceAttr): Put all the logic for computing
28175 the interface attribute here.
28177 (DefineInterface): Register our interface order with the
28178 RootContext or with the TypeContainer depending on the case.
28180 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28182 * cs-parser.jay: rework foreach statement to work with the new
28183 changes to the policy on SimpleNames.
28185 * report.cs: support Stacktrace on warnings as well.
28187 * makefile: drop --unsafe and /unsafe from the compile.
28189 2002-03-13 Ravi Pratap <ravi@ximian.com>
28191 * ecore.cs (StandardConversionExists): Modify to take an Expression
28192 as the first parameter. Ensure we do null -> reference type conversion
28195 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
28196 temporary Expression objects.
28198 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
28200 * interface.cs: workaround bug in method overloading resolution
28201 (there is already a bugzilla bug for it).
28203 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28205 We could also solve this problem by having a separate path for
28206 performing type lookups, instead of DoResolve, we could have a
28207 ResolveType entry point, and only participating pieces of the
28208 production (simplename, deref, array) would implement this.
28210 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
28211 signal SimpleName to only resolve type names and not attempt to
28212 resolve anything else.
28214 * expression.cs (Cast): Set the flag.
28216 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
28218 * class.cs: Only report 108 if there is no `new' modifier.
28220 * cs-parser.jay: rework foreach statement to work with the new
28221 changes to the policy on SimpleNames.
28223 * report.cs: support Stacktrace on warnings as well.
28225 * makefile: drop --unsafe and /unsafe from the compile.
28227 2002-03-11 Miguel de Icaza <miguel@ximian.com>
28229 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28230 lookups here, instead of doing that at parse time. This means
28231 that our grammar will not introduce `LocalVariableReferences' as
28232 expressions at this point. That solves the problem of code like
28236 static void Main ()
28240 This is only half the fix. The full fix requires parameters to
28241 also be handled in this way.
28243 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
28244 makes the use more obvious of the DeclSpace. The
28245 ec.TypeContainer.TypeBuilder is now only used to pull the
28246 TypeBuilder for it.
28248 My theory is that I can get rid of the TypeBuilder completely from
28249 the EmitContext, and have typecasts where it is used (from
28250 DeclSpace to where it matters).
28252 The only pending problem is that the code that implements Aliases
28253 is on TypeContainer, and probably should go in DeclSpace.
28255 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28256 lookups here, instead of doing that at parse time. This means
28257 that our grammar will not introduce `LocalVariableReferences' as
28258 expressions at this point. That solves the problem of code like
28262 static void Main ()
28266 This is only half the fix. The full fix requires parameters to
28267 also be handled in this way.
28269 * class.cs (Property.DefineMethod): When implementing an interface
28270 method, set newslot, when implementing an abstract method, do not
28271 set the flag (before we tried never setting it, or always setting
28272 it, which is the difference).
28273 (Indexer.DefineMethod): same.
28274 (Method.DefineMethod): same.
28276 * ecore.cs: Only set the status used flag if we get back a Field.
28278 * attribute.cs: Temporary hack, so Paolo can keep working.
28280 2002-03-08 Ravi Pratap <ravi@ximian.com>
28282 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
28283 the unmanaged type in the case we have a MarshalAs attribute.
28285 (Resolve): Handle the case when we are parsing the special MarshalAs
28286 attribute [we need to store the unmanaged type to use later]
28288 * typemanager.cs (marshal_as_attr_type): Built in type for the
28289 MarshalAs Attribute.
28291 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
28292 on parameters and accordingly set the marshalling info.
28294 2002-03-09 Miguel de Icaza <miguel@ximian.com>
28296 * class.cs: Optimizing slightly by removing redundant code after
28297 we switched to the `NoTypes' return value.
28298 (Property.DefineMethod): use NoTypes here too.
28300 This fixes the bug I introduced in my last batch of changes.
28302 2002-03-05 Ravi Pratap <ravi@ximian.com>
28304 * tree.cs (RecordEnum): Add. We now keep track of enums too.
28306 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
28307 Enums since those are types too.
28309 * cs-parser.jay (enum_declaration): Record enums as we parse them.
28311 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
28312 thanks to a call during the lookup process.
28314 2002-03-07 Miguel de Icaza <miguel@ximian.com>
28316 * statement.cs (Foreach): Lots of work to accomodate a particular
28317 kind of foreach statement that I had not kept in mind. It is
28318 possible to have foreachs on classes that provide a GetEnumerator
28319 method that return objects that implement the "pattern" for using
28320 a foreach, there is no need to support GetEnumerator
28323 This is needed to compile nant.
28325 * decl.cs: Only report 114 if the member is not `Finalize' and if
28326 the warning level is at least 2.
28328 * class.cs: Moved the compare function from Method to
28331 (MethodSignature.InheritableMemberSignatureCompare): Add new
28332 filter function that is used to extract inheritable methods from a
28335 (Method.Define): Use the new `inheritable_method_signature_filter'
28338 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
28341 2002-03-06 Miguel de Icaza <miguel@ximian.com>
28343 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
28345 * cs-parser.jay: Add opt_semicolon to the interface declaration.
28347 * expression.cs: Pass location information to
28348 ConvertImplicitStandard.
28350 * class.cs: Added debugging code to track return values from
28353 2002-03-05 Miguel de Icaza <miguel@ximian.com>
28355 * expression.cs (Is.DoResolve): If either side of the `is' is an
28356 interface, do not flag the warning.
28358 * ecore.cs (ImplicitReferenceConversion): We need a separate test
28361 * report.cs: Allow for --fatal to be used with --probe.
28363 * typemanager.cs (NoTypes): Move the definition for the empty Type
28366 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
28368 (TypeContainer.DefineProxy): New function used to proxy to parent
28369 implementations when implementing interfaces.
28370 (TypeContainer.ParentImplements): used to lookup if our parent
28371 implements a public function that is required by an interface.
28372 (TypeContainer.VerifyPendingMethods): Hook this up.
28374 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
28375 `modules' and `assemblies' arraylists into arrays. We only grow
28376 these are the very early start up of the program, so this improves
28377 the speedof LookupType (nicely measured).
28379 * expression.cs (MakeByteBlob): Replaced unsafe code with
28380 BitConverter, as suggested by Paolo.
28382 * cfold.cs (ConstantFold.Binary): Special case: perform constant
28383 folding of string concatenation, but if either side is a string,
28384 and the other is not, then return null, and let the runtime use
28385 the concatenation on the string plus the object (using
28386 `Object.ToString').
28388 2002-03-04 Miguel de Icaza <miguel@ximian.com>
28390 Constant Folding has been implemented now.
28392 * expression.cs (Unary.Reduce): Do not throw an exception, catch
28393 the error instead on types that are not supported in one's
28396 * constant.cs (Constant and all children): New set of functions to
28397 perform implict and explicit conversions.
28399 * ecore.cs (EnumConstant): Implement the new functions to perform
28400 conversion by proxying to the child expression.
28402 * codegen.cs: (ConstantCheckState): Constant evaluation has its
28403 own separate setting that can not be turned off from the command
28404 line using --unchecked or --checked and is only controlled using
28405 the checked/unchecked statements and expressions. This setting is
28406 used by the constant folder to flag errors.
28408 * expression.cs (CheckedExpr, UncheckedExpr): Set the
28409 ConstantCheckState as well.
28411 During Resolve, they also have to flag the state, because the
28412 constant folder runs completely in the Resolve phase.
28414 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
28417 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28419 * cfold.cs: New file, this file contains the constant folder.
28421 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
28422 argument to track whether we are using the resulting address to
28423 load or store a value and provide better error messages.
28425 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
28426 new AddressOf arguments.
28428 * statement.cs (Foreach.EmitCollectionForeach): Update
28430 * expression.cs (Argument.Emit): Call AddressOf with proper
28431 arguments to track usage.
28433 (New.DoEmit): Call AddressOf with new arguments.
28435 (Unary.Emit): Adjust AddressOf call.
28437 2002-03-01 Ravi Pratap <ravi@ximian.com>
28439 * cs-parser.jay (member_access): Change the case for pre-defined types
28440 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
28443 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
28446 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
28447 essentially like methods and apply attributes like MethodImplOptions to them too.
28449 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
28452 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
28453 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
28456 * Update code everywhere accordingly.
28458 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
28460 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
28462 2002-02-28 Ravi Pratap <ravi@ximian.com>
28464 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
28465 try performing lookups against those instead of jumping straight into using
28466 the 'using' clauses.
28468 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
28470 (LookupType): Perform lookups in implicit parents too.
28472 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
28473 sequence as RootContext.LookupType.
28475 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
28476 the various cases of namespace lookups into this method.
28478 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28480 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
28481 in positional arguments)
28483 * class.cs (Operator): Update the AllowedModifiers to contain
28486 * cs-parser.jay: Update operator declaration to allow for the
28487 operator body to be empty.
28489 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
28492 2002-02-27 Miguel de Icaza <miguel@ximian.com>
28494 * class.cs (Method.Emit): Label parameters.
28496 * driver.cs: Return 1 or 0 as the program exit code.
28498 2002-02-26 Miguel de Icaza <miguel@ximian.com>
28500 * expression.cs: Special case the `null' object when trying to
28501 auto-compute the type, as anything can be explicitly converted to
28504 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
28505 spotting this Paolo.
28507 (Expression.ImplicitNumericConversion): Perform comparissions of
28508 the type using the underlying type in the case of an enumeration
28509 rather than using the enumeration type for the compare.
28511 Cope with the underlying == type case, which is not possible to
28514 (Expression.ConvertNumericExplicit): Perform comparissions of
28515 the type using the underlying type in the case of an enumeration
28516 rather than using the enumeration type for the compare.
28518 * driver.cs: If the user does not supply an extension, assume .exe
28520 * cs-parser.jay (if_statement): Rewrote so that we can track the
28521 location for the if statement.
28523 * expression.cs (Binary.ConstantFold): Only concat strings when
28524 the operation is "+", not everything ;-)
28526 * statement.cs (Statement.EmitBoolExpression): Take a location
28528 (If, While, Do): Track location.
28530 * expression.cs (Binary.ResolveOperator): In the object + string
28531 case, I was missing a call to ConvertImplicit
28533 2002-02-25 Ravi Pratap <ravi@ximian.com>
28535 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
28536 Location arguments. Ensure we use RootContext.LookupType to do our work
28537 and not try to do a direct Type.GetType and ModuleBuilder.GetType
28539 * interface.cs (PopulateMethod): Handle the type of the parameter being
28542 * expression.cs (Invocation.BetterFunction): Handle the case when we
28543 have a params method with no fixed arguments and a call is made with no
28546 2002-02-25 Miguel de Icaza <miguel@ximian.com>
28548 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
28549 the verbatim-string-literal
28551 * support.cs (InternalParameters.ParameterModifier): handle null
28553 (InternalParameters.ParameterType): ditto.
28555 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
28556 duplicating the name of the variable parameter.
28557 (GetParameterByName): Fix bug where we were not looking up array
28558 paramters if they were the only present (thanks Paolo!).
28559 (GetParameterInfo): We only have an empty set of types if both
28560 fixed and array are set to null.
28561 (GetParameterInfo-idx): Handle FixedParameter == null
28563 * cs-parser.jay: Handle the case where there is no catch
28564 statements (missing null test).
28566 2002-02-22 Miguel de Icaza <miguel@ximian.com>
28568 * driver.cs (MainDriver): Be conservative on our command line
28571 Catch DirectoryNotFoundException when calling GetFiles.
28573 (SplitPathAndPattern): Used to split the input specification into
28574 a path and a pattern that we can feed to Directory.GetFiles.
28576 2002-02-21 Miguel de Icaza <miguel@ximian.com>
28578 * statement.cs (Fixed): Implement the last case of the Fixed
28579 statement (string handling).
28581 * expression.cs (StringPtr): New class used to return a char * to
28582 a string; Used by the Fixed statement.
28584 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
28586 * expression.cs (Binary.ResolveOperator): Remove redundant
28587 MemberLookup pn parent type.
28588 Optimize union call, we do not need a union if the types are the same.
28589 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
28592 Specialize the use of MemberLookup everywhere, instead of using
28593 the default settings.
28595 (StackAlloc): Implement stackalloc keyword.
28597 * cs-parser.jay: Add rule to parse stackalloc.
28599 * driver.cs: Handle /h, /help, /?
28601 * expression.cs (MakeByteBlob): Removed the hacks we had in place
28602 before we supported unsafe code.
28604 * makefile: add --unsafe to the self compilation of mcs.
28606 2002-02-20 Miguel de Icaza <miguel@ximian.com>
28608 * expression.cs (PointerArithmetic): New class that is used to
28609 perform pointer arithmetic.
28610 (Binary.Resolve): Handle pointer arithmetic
28611 Handle pointer comparission.
28612 (ArrayPtr): Utility expression class that is used to take the
28613 address of an array.
28615 (ElementAccess): Implement array access for pointers
28617 * statement.cs (Fixed): Implement fixed statement for arrays, we
28618 are missing one more case before we are done.
28620 * expression.cs (Indirection): Implement EmitAssign and set the
28621 ExprClass to Variable. This allows pointer dereferences to be
28622 treated as variables, and to have values assigned to them.
28624 * ecore.cs (Expression.StoreFromPtr): New utility function to
28625 store values dereferencing.
28627 2002-02-20 Ravi Pratap <ravi@ximian.com>
28629 * expression.cs (Binary.ResolveOperator): Ensure that we are
28630 not trying to operate on a void type - this fixes the reported
28633 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
28634 the parent implementation is sealed.
28636 * ../errors/cs0239.cs : Add.
28638 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
28640 * typemanager.cs (unverifiable_code_type): Corresponds to
28641 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
28642 which have unsafe code in them.
28644 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
28647 2002-02-19 Miguel de Icaza <miguel@ximian.com>
28649 * cs-tokenizer.cs: Add support for @"litreal strings"
28651 Make tokenizer accept pre-processor directives
28652 on any column (remove the old C-like limitation).
28654 * rootcontext.cs (EmitCode): Emit any global attributes.
28655 (AddGlobalAttributes): Used to keep track of assembly attributes.
28657 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
28659 * cs-parser.jay: Add support for global attributes.
28661 2002-02-17 Miguel de Icaza <miguel@ximian.com>
28663 * expression.cs (Indirection): New helper class. Unary will
28664 create Indirection classes to be able to implement the
28665 IMemoryLocation interface on it.
28667 2002-02-16 Miguel de Icaza <miguel@ximian.com>
28669 * cs-parser.jay (fixed_statement): reference the right statement.
28671 * statement.cs (Fixed.Emit): Finish implementing the fixed
28672 statement for the &x case.
28674 2002-02-14 Miguel de Icaza <miguel@ximian.com>
28676 * class.cs (Property.Define, Method.Define): Remove newslot when
28679 * modifiers.cs: My use of NewSlot when `Abstract' was set was
28680 wrong. NewSlot should only be used if the `new' keyword is present.
28682 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
28683 locating our system dir. Sorry about this.
28685 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28687 * driver.cs (GetSystemDir): Compute correctly the location of our
28688 system assemblies. I was using the compiler directory instead of
28689 the library directory.
28691 2002-02-13 Ravi Pratap <ravi@ximian.com>
28693 * expression.cs (BetterFunction): Put back in what Miguel commented out
28694 since it is the correct fix. The problem is elsewhere ;-)
28696 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
28697 parameters of the parms method are themselves compatible or not !
28699 (StandardConversionExists): Fix very dangerous bug where we were forgetting
28700 to check that a class implements an interface before saying that an implicit
28701 conversion was allowed. Use ImplementsInterface to do the checking.
28703 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28705 * class.cs (Method.Define): Track whether we are an explicit
28706 implementation or not. And only call DefineMethodOverride if we
28707 are an explicit implementation.
28709 (Property.DefineMethod): Ditto.
28711 2002-02-11 Ravi Pratap <ravi@ximian.com>
28713 * expression.cs (BetterFunction): Catch hideous bug which was
28714 preventing us from detecting ambiguous calls due to implicit casts i.e
28717 2002-01-29 Miguel de Icaza <miguel@ximian.com>
28719 * support.cs (Pair): Remove un-needed method. I figured why I was
28720 getting the error in cs-parser.jay, the variable in a foreach loop
28721 is readonly, and the compiler does not really treat this as a variable.
28723 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
28724 instead of EQUALS in grammar.
28726 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
28728 * expression.cs (Unary.DoResolve): Check whether the argument is
28731 2002-01-28 Miguel de Icaza <miguel@ximian.com>
28733 * support.cs: Api for Pair to set a value. Despite the fact that
28734 the variables are public the MS C# compiler refuses to compile
28735 code that accesses the field if the variable is part of a foreach
28738 * statement.cs (Fixed): Begin implementation of the fixed
28741 (Block.AddVariable): Return the VariableInfo on success and null
28742 on failure instead of true/false.
28744 * cs-parser.jay (foreach): Catch errors on variables already
28745 defined (we were ignoring this value before) and properly unwind
28746 the block hierarchy
28748 (fixed_statement): grammar for the fixed statement.
28750 2002-01-25 Miguel de Icaza <miguel@ximian.com>
28752 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
28753 pointer types to be incretemented.
28755 (SizeOf): Implement.
28757 * cs-parser.jay (pointer_member_access): Implement
28758 expr->IDENTIFIER production.
28760 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
28761 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
28764 (Unary): Implement indirection.
28766 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
28767 use in non-unsafe context).
28769 (SimpleName.DoResolve): Check for pointers in field access on safe
28772 (Expression.LoadFromPtr): Factor the load-indirect code in this
28773 function. This was duplicated in UnboxCast and ParameterReference
28775 2002-01-24 Miguel de Icaza <miguel@ximian.com>
28777 * expression.cs (ComposedCast): report an error if a pointer cast
28778 is used in a safe region.
28780 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
28781 pointer type casts in unsafe context.
28783 * codegen.cs (EmitContext): Set up IsUnsafe.
28785 * cs-parser.jay (non_expression_type): Add productions for pointer
28788 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
28789 code. We should not use force into static mode if the method is
28790 not virtual. Fixes bug in MIS
28792 * statement.cs (Do.Emit, While.Emit, For.Emit,
28793 Statement.EmitBoolExpression): Add support to Do and While to
28794 propagate infinite loop as `I do return' semantics.
28796 Improve the For case to also test for boolean constants.
28798 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
28799 to the list of attributes we can add.
28801 Remove `EmitContext' argument.
28803 * class.cs (Method.Define): Apply parameter attributes.
28804 (Constructor.Define): Apply parameter attributes.
28805 (MethodCore.LabelParameters): Move here the core of labeling
28808 * support.cs (ReflectionParameters.ParameterModifier,
28809 InternalParameters.ParameterModifier): Use IsByRef on the type and
28810 only return the OUT bit for these parameters instead of in/out/ref
28813 This is because I miss-understood things. The ParameterInfo.IsIn
28814 and IsOut represent whether the parameter has the [In] and [Out]
28817 2002-01-22 Miguel de Icaza <miguel@ximian.com>
28819 * ecore.cs (FieldExpr.Emit): Release temporaries.
28821 * assign.cs (LocalTemporary.Release): new function.
28823 * codegen.cs (EmitContext.GetTemporaryStorage,
28824 EmitContext.FreeTemporaryStorage): Rework the way we deal with
28825 temporary storage. Now we can "put back" localbuilders when we
28828 2002-01-21 Miguel de Icaza <miguel@ximian.com>
28830 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
28831 need to make a copy of the variable to generate verifiable code.
28833 2002-01-19 Miguel de Icaza <miguel@ximian.com>
28835 * driver.cs: Compute dynamically the system directory.
28837 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
28838 Slower, but more generally useful. Used by the abstract
28839 registering implementation.
28841 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
28842 the rules for the special rule on Type/instances. First check if
28843 we have the same name, and if so, try that special static path
28844 rather than the instance path.
28846 2002-01-18 Miguel de Icaza <miguel@ximian.com>
28848 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
28851 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
28852 Enum, ValueType, Delegate or Array for non-corlib compiles.
28854 * cs-tokenizer.cs: Catch long identifiers (645)
28856 * typemanager.cs (IndexerPropetyName): Ravi never tested this
28859 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
28860 fix, we were returning too early, so we were not registering
28861 pending methods from abstract classes.
28863 Do not register pending methods if the class is abstract.
28865 * expression.cs (Conditional.DoResolve): Report circular implicit
28866 conversions when we neecd to compute it for conditional
28869 (Is.DoResolve): If the expression is always of the provided type,
28870 flag warning 183. If the expression can not ever be of the
28871 provided type flag warning 184.
28873 * class.cs: Catch 169 as well.
28875 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
28878 2002-01-18 Nick Drochak <ndrochak@gol.com>
28880 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
28882 2002-01-17 Miguel de Icaza <miguel@ximian.com>
28884 * interface.cs: (PopulateMethod): Check for pointers being defined
28885 only if the unsafe context is active.
28886 (PopulateProperty): ditto.
28887 (PopulateIndexer): ditto.
28889 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
28890 specified. If pointers are present, make sure that they are
28891 present in an unsafe context.
28892 (Constructor, Constructor.Define): ditto.
28893 (Field, Field.Define): ditto.
28894 (Property, Property.Define): ditto.
28895 (Event, Event.Define): ditto.
28897 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
28898 hashtable if there are classes or structs defined.
28900 * expression.cs (LocalVariableReference.DoResolve): Simplify this
28901 code, as the constant resolution moved.
28903 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
28904 the metadata, so we can flag error 133.
28906 * decl.cs (MemberCore.UnsafeOK): New function to test that a
28907 pointer is being declared in an unsafe context.
28909 2002-01-16 Miguel de Icaza <miguel@ximian.com>
28911 * modifiers.cs (Modifiers.Check): Require a Location argument.
28912 Report error 227 for Unsafe use.
28914 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
28916 * statement.cs (For.Emit): If the test is null, then report that
28917 we do `return', as we wont reach anything afterwards.
28919 (Switch.SwitchGoverningType): Track the expression that matched
28922 * driver.cs: Allow negative numbers as an error code to flag.
28924 * cs-parser.jay: Handle 1551.
28926 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
28928 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28930 * cs-parser.jay: Report 1518 (type declaration can only contain
28931 class, struct, interface, enum or delegate)
28933 (switch_label): Report 1523 (keywords `case' or `default' must
28936 (opt_switch_sections): Report 1522 (empty switch)
28938 * driver.cs: Report 1515 (response file specified multiple times)
28939 Report 1516 (Source file specified multiple times).
28941 * expression.cs (Argument.Resolve): Signal 1510
28943 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
28944 access not allowed in static code)
28946 2002-01-11 Ravi Pratap <ravi@ximian.com>
28948 * typemanager.cs (IsPointerType): Utility method which we are going
28951 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
28952 the object type, so we take care of that.
28954 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
28956 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
28957 added to non-params parameters :-)
28959 * typemanager.cs (CSharpName): Include 'void' type too.
28961 (void_ptr_type): Include in the set of core types.
28963 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
28966 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
28969 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
28970 completely forgotten about it.
28972 2002-01-10 Ravi Pratap <ravi@ximian.com>
28974 * cs-parser.jay (pointer_type): Add. This begins our implementation
28975 of parsing rules for unsafe code.
28977 (unsafe_statement): Implement.
28979 (embedded_statement): Modify to include the above.
28981 * statement.cs (Unsafe): Implement new class for unsafe blocks.
28983 * codegen.cs (EmitContext.InUnsafe): Add. This determines
28984 if the current context is an unsafe one.
28986 * cs-parser.jay (local_variable_pointer_type): Since local variable types
28987 are handled differently, we need separate rules for them.
28989 (local_variable_declaration): Update to use local_variable_pointer_type
28990 to allow variable declarations of unmanaged pointer types.
28992 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
28993 in unsafe contexts.
28995 * ../errors/cs0214.cs : Add.
28997 2002-01-16 Nick Drochak <ndrochak@gol.com>
28999 * makefile: remove 'response' file when cleaning.
29001 2002-01-15 Miguel de Icaza <miguel@ximian.com>
29003 * cs-parser.jay: Report 1524.
29005 2002-01-14 Miguel de Icaza <miguel@ximian.com>
29007 * typemanager.cs (RegisterMethod): drop checking if we have
29008 registered this from here
29010 2002-01-12 Miguel de Icaza <miguel@ximian.com>
29012 * class.cs (Method.EmitDestructor): Implement calling our base
29015 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
29016 value of InFinally.
29018 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
29019 this routine and will wrap the call in a try/catch block. Deal
29022 2002-01-11 Miguel de Icaza <miguel@ximian.com>
29024 * ecore.cs (Expression.MemberLookup): instead of taking a
29025 parameter `same_type' that was used to tell whether we could
29026 access private members we compute our containing type from the
29029 (FieldExpr): Added partial support for volatile fields. This does
29030 not work for volatile fields exposed from assemblies, as I can not
29031 figure out how to extract the modreq from it.
29033 Updated all the source files to use this.
29035 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
29036 because it is referenced by MemberLookup very often.
29038 2002-01-09 Ravi Pratap <ravi@ximian.com>
29040 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
29041 TypeBuilder.GetCustomAttributes to retrieve what we need.
29043 Get rid of redundant default_member_attr_type as this is the same as
29044 default_member_type which already exists.
29046 * interface.cs, attribute.cs : Update accordingly.
29048 2002-01-08 Miguel de Icaza <miguel@ximian.com>
29050 * typemanager.cs: Enable IndexerPropertyName again. It does not
29051 work for TYpeBuilders though. Ravi, can you please fix this?
29053 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
29055 * expression.cs (Argument.Emit): Handle the case of ref objects
29056 being passed to ref functions;
29058 (ParameterReference.EmitLoad): Loads the content of the pointer
29059 without dereferencing.
29061 2002-01-07 Miguel de Icaza <miguel@ximian.com>
29063 * cs-tokenizer.cs: Implemented the pre-processing expressions.
29065 2002-01-08 Ravi Pratap <ravi@ximian.com>
29067 * class.cs (Indexer.DefineMethod): Incorporate the interface
29068 type in the name of the method if we are doing explicit interface
29071 * expression.cs (ConversionExists): Remove as it is completely obsolete.
29073 (BetterConversion): Fix extremely trivial bug where we were referring to
29074 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
29077 * ../errors/bug16.cs : Add although we have fixed it.
29079 2002-01-07 Miguel de Icaza <miguel@ximian.com>
29081 * expression.cs (BaseIndexer): Begin implementation.
29083 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
29085 * cs-parser.jay (indexer_declarator): Use qualified_identifier
29086 production directly to remove a shift/reduce, and implement
29087 explicit interface implementation.
29089 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
29090 after a floating point suffix.
29092 * expression.cs (DoNumericPromotions): Improved the conversion for
29093 uint/uint. If we have a constant, we avoid doing a typecast to a
29096 * class.cs (Indexer): Implement explicit interface implementation
29099 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
29101 * class.cs: make the default instance constructor public and hidebysig.
29103 2001-01-03 Ravi Pratap <ravi@ximian.com>
29105 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
29106 so we can call it from elsewhere.
29108 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
29109 we emit it internally if the class has a defined indexer; otherwise the user
29110 emits it by decorating the class definition with the DefaultMemberAttribute.
29112 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
29113 attribute is not used on a type which defines an indexer.
29115 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
29116 character when we skip whitespace.
29118 * ../errors/cs0646.cs : Add.
29120 2002-01-03 Miguel de Icaza <miguel@ximian.com>
29122 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
29125 * makefile: Add practical target `mcs3.exe' which builds the third
29126 generation compiler.
29128 * expression.cs (New): Fix structures constructor calling.
29130 * class.cs (Property, Method, Indexer): Emit Final flag on the
29131 method if we are an interface implementation and we are not
29134 * ecore.cs (PropertyExpr): New public field `IsBase', tells
29135 whether this property is referencing a `base' method.
29137 * expression.cs (Invocation.EmitCall): take an extra argument:
29138 is_base, this is used to determine whether the `call' or
29139 `callvirt' opcode should be used.
29142 * delegate.cs: update EmitCall.
29144 * class.cs (Method.Define): Set NewSlot for the cases where we are
29145 not implementing an interface method.
29147 (Property.Define): ditto.
29149 2002-01-02 Miguel de Icaza <miguel@ximian.com>
29151 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
29152 'r'. Allows mcs to parse itself fully.
29154 2002-01-02 Ravi Pratap <ravi@ximian.com>
29156 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
29157 of the number of initializers that require the InitializeArray method.
29159 (CheckIndices): Store the Expression in all cases - not the plain value. Also
29160 update the above field where necessary.
29162 (MakeByteBlob): Update accordingly.
29164 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
29167 (EmitDynamicInitializers): Update in accordance with the new optimization.
29169 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
29170 same OpCode applies.
29172 * cs-parser.jay : Fix some glaring errors I introduced.
29174 2002-01-01 Ravi Pratap <ravi@ximian.com>
29176 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
29177 so that we can check for name clashes there too.
29179 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
29180 for interface indexers.
29182 * interfaces.cs (Define): Emit the default member attribute.
29184 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
29185 variable was being referred to while setting the value ;-)
29187 2002-01-01 Miguel de Icaza <miguel@ximian.com>
29189 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
29190 byte-by-byte information when we know the data is zero.
29192 Make the block always a multiple of 4, because
29193 DefineInitializedData has a bug.
29195 * assign.cs: Fix, we should assign from the temporary, not from
29198 * expression.cs (MakeByteBlob): Fix my incorrect code.
29200 2001-12-31 Miguel de Icaza <miguel@ximian.com>
29202 * typemanager.cs (EnumToUnderlying): This function is used to get
29203 the underlying type from an enumeration, because it does not
29206 * constant.cs: Use the I4_S form for values between -128 and 127.
29208 * statement.cs (Block.LookupLabel): Looks up a label.
29209 (Block): Drop support for labeled blocks.
29211 (LabeledStatement): New kind of statement that represents a label
29214 (Goto): Finally implement this bad boy.
29216 * cs-parser.jay: Update to reflect new mechanism to implement
29219 2001-12-30 Miguel de Icaza <miguel@ximian.com>
29221 * codegen.cs (EmitContext.This): a codegen property that keeps the
29222 a single instance of this instead of creating many different this
29225 * delegate.cs (Delegate.DoResolve): Update to use the property;
29227 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
29229 * expression.cs (BaseAccess.DoResolve): Ditto.
29231 2001-12-29 Ravi Pratap <ravi@ximian.com>
29233 * typemanager.cs (methodimpl_attr_type): Add to hold the type
29234 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
29236 (InitCoreTypes): Update accordingly.
29238 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
29239 so we can quickly store the state.
29241 (ApplyAttributes): Set the correct implementation flags
29242 for InternalCall methods.
29244 2001-12-29 Miguel de Icaza <miguel@ximian.com>
29246 * expression.cs (EmitCall): if a method is not virtual, then do
29247 not use callvirt on it.
29249 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
29250 user defined stuff) requires the use of stobj, which takes an
29251 address on the stack instead of an array and an index. So emit
29252 the Ldelema operation for it.
29254 (EmitStoreOpcode): Use stobj for valuetypes.
29256 (UnaryMutator.EmitCode): Use the right 1 value depending on
29257 whether we are dealing with int64/uint64, float or doubles.
29259 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
29260 constructors that I implemented last night.
29262 (Constructor.IsDefault): Fix to work properly for static
29265 * cs-parser.jay (CheckDef): report method signature errors.
29266 Update error number 103 to be 132.
29268 * decl.cs: New AdditionResult enumeration value: MethodExists.
29269 Although we do this check for methods later on in the semantic
29270 analysis, catching repeated default constructors is so easy that
29271 we catch these here.
29273 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
29276 (ParameterReference.EmitAssign, Emit): handle
29279 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
29280 (ArrayAccess.EmitStoreOpcode): ditto.
29282 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
29284 * expression.cs (MakeByteBlob): Complete all the missing types
29285 (uint, short, ushort, byte, sbyte)
29287 * class.cs: Only init instance field initializers on instance
29290 Rename `constructors' to instance_constructors.
29292 (TypeContainer.AddConstructor): Only add constructors to the list
29293 if it is not static.
29295 Make sure that we handle default_static_constructor independently
29296 everywhere where we handle instance_constructors
29298 2001-12-28 Miguel de Icaza <miguel@ximian.com>
29300 * class.cs: Do not lookup or create a base initializer for a
29301 static constructor.
29303 (ConstructorInitializer.Resolve): use the proper type to lookup
29306 * cs-parser.jay: Report error 1585 (modifiers between type and name).
29308 * enum.cs, interface.cs: Remove CloseType, this is taken care by
29311 * decl.cs: CloseType is now an virtual method, the default
29312 implementation just closes this type.
29314 2001-12-28 Ravi Pratap <ravi@ximian.com>
29316 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
29317 to PreserveSig by default. Also emit HideBySig on such methods.
29319 Basically, set the defaults to standard values.
29321 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
29322 argument, if candidate is better, it can't be worse than the best !
29324 (Invocation): Re-write bits to differentiate between methods being
29325 applicable in their expanded form and their normal form - for params
29328 Get rid of use_standard everywhere as only standard conversions are allowed
29329 in overload resolution.
29331 More spec conformance.
29333 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29335 * driver.cs: Add --timestamp, to see where the compiler spends
29338 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
29339 `this' in static code.
29341 (SimpleName.DoResolve): Implement in terms of a helper function
29342 that allows static-references to be passed upstream to
29345 (Expression.ResolveWithSimpleName): Resolve specially simple
29346 names when called by MemberAccess to implement the special
29349 (Expression.ImplicitReferenceConversion): Handle conversions from
29350 Null to reference types before others, as Null's type is
29353 * expression.cs (Invocation.EmitCall): Handle the special case of
29354 calling methods declared on a reference type from a ValueType
29355 (Base classes System.Object and System.Enum)
29357 (MemberAccess.Resolve): Only perform lookups on Enumerations if
29358 the left hand side is a TypeExpr, not on every enumeration.
29360 (Binary.Resolve): If types are reference types, then do a cast to
29361 object on operators != and == of both arguments.
29363 * typemanager.cs (FindMembers): Extract instance and static
29364 members if requested.
29366 * interface.cs (PopulateProperty): Use void_type instead of null
29367 as the return type for the setter method.
29369 (PopulateIndexer): ditto.
29371 2001-12-27 Ravi Pratap <ravi@ximian.com>
29373 * support.cs (ReflectionParameters): Fix minor bug where we
29374 were examining the wrong parameter for the ParamArray attribute.
29376 Cope with requests for the type of the parameter at position
29377 greater than the params parameter's. We now return the element
29378 type of the params array as that makes more sense.
29380 * expression.cs (Invocation.IsParamsMethodApplicable): Update
29381 accordingly as we no longer have to extract the element type
29384 (Invocation.OverloadResolve): Update.
29386 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29388 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
29389 against IEnumerator, test whether the return value is a descendant
29390 of the IEnumerator interface.
29392 * class.cs (Indexer.Define): Use an auxiliary method to implement
29393 the other bits of the method definition. Begin support for
29394 explicit interface implementation.
29396 (Property.DefineMethod): Use TypeManager.void_type instead of null
29397 for an empty return value.
29399 2001-12-26 Miguel de Icaza <miguel@ximian.com>
29401 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
29402 dealing with a FieldExpr which is composed of a FieldBuilder, in
29403 the code path we did extract the constant, but we should have
29404 obtained the underlying value to be able to cast it (otherwise we
29405 end up in an infinite loop, this is what Ravi was running into).
29407 (ArrayCreation.UpdateIndices): Arrays might be empty.
29409 (MemberAccess.ResolveMemberAccess): Add support for section
29410 14.5.4.1 that deals with the special case of E.I when E is a type
29411 and something else, that I can be a reference to a static member.
29413 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
29414 handle a particular array type to create byte blobs, it is just
29415 something we dont generate byteblobs for.
29417 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
29420 * location.cs (Push): remove the key from the hashtable that we
29421 are about to add. This happens for empty files.
29423 * driver.cs: Dispose files after we have parsed them.
29425 (tokenize): new function that only runs the tokenizer on its
29426 input, for speed testing.
29428 2001-12-26 Ravi Pratap <ravi@ximian.com>
29430 * class.cs (Event.Define): Define the private field only if there
29431 are no accessors defined.
29433 * expression.cs (ResolveMemberAccess): If there is no associated
29434 field with the event, that means we have an event defined with its
29435 own accessors and we should flag error cs0070 since transforming
29436 ourselves into a field is not valid in that case.
29438 * ecore.cs (SimpleName.DoResolve): Same as above.
29440 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
29441 and charset to sane values.
29443 2001-12-25 Ravi Pratap <ravi@ximian.com>
29445 * assign.cs (DoResolve): Perform check on events only if they
29446 are being accessed outside the declaring type.
29448 * cs-parser.jay (event_declarations): Update rules to correctly
29449 set the type of the implicit parameter etc.
29451 (add_accessor, remove_accessor): Set current local parameters.
29453 * expression.cs (Binary): For delegate addition and subtraction,
29454 cast the return value from the method into the appropriate delegate
29457 2001-12-24 Ravi Pratap <ravi@ximian.com>
29459 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
29460 of these as the workaround is unnecessary.
29462 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
29463 delegate data - none of that is needed at all.
29465 Re-write bits to extract the instance expression and the delegate method
29468 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
29471 * attribute.cs (ApplyAttributes): New method to take care of common tasks
29472 of attaching attributes instead of duplicating code everywhere.
29474 * everywhere : Update code to do attribute emission using the above method.
29476 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29478 * expression.cs (IsParamsMethodApplicable): if there are not
29479 parameters, return immediately.
29481 * ecore.cs: The 0 literal can be implicity converted to an enum
29484 (SimpleName.DoResolve): First lookup the type, then lookup the
29487 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
29488 want to get its address. If the InstanceExpression is not
29489 addressable, store the result in a temporary variable, then get
29492 * codegen.cs: Only display 219 errors on warning level or above.
29494 * expression.cs (ArrayAccess): Make it implement the
29495 IMemoryLocation interface.
29497 (Binary.DoResolve): handle the operator == (object a, object b)
29498 and operator != (object a, object b) without incurring into a
29499 BoxedCast (because 5 != o should never be performed).
29501 Handle binary enumerator operators.
29503 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
29504 value type, otherwise use Ldelem_ref.
29506 Use precomputed names;
29508 (AddressOf): Implement address of
29510 * cs-parser.jay (labeled_statement): Fix recursive block
29511 addition by reworking the production.
29513 * expression.cs (New.DoEmit): New has a special case:
29515 If we are dealing with a ValueType, we have a few
29516 situations to deal with:
29518 * The target of New is a ValueType variable, that is
29519 easy, we just pass this as the variable reference
29521 * The target of New is being passed as an argument,
29522 to a boxing operation or a function that takes a
29525 In this case, we need to create a temporary variable
29526 that is the argument of New.
29529 2001-12-23 Ravi Pratap <ravi@ximian.com>
29531 * rootcontext.cs (LookupType): Check that current_type is not null before
29532 going about looking at nested types.
29534 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
29535 not implement the IAssignMethod interface any more.
29537 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
29538 where we tranform them into FieldExprs if they are being resolved from within
29539 the declaring type.
29541 * ecore.cs (SimpleName.DoResolve): Do the same here.
29543 * assign.cs (DoResolve, Emit): Clean up code considerably.
29545 * ../errors/bug10.cs : Add.
29547 * ../errors/cs0070.cs : Add.
29549 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
29551 * assign.cs : Get rid of EventIsLocal everywhere.
29553 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29555 * ecore.cs (ConvertIntLiteral): finished the implementation.
29557 * statement.cs (SwitchLabel): Convert the value we are using as a
29558 key before looking up the table.
29560 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29562 * codegen.cs (EmitTopBlock): Require a Location argument now.
29564 * cs-parser.jay (constructor_declarator): We need to setup
29565 current_local_parameters before we parse the
29566 opt_constructor_initializer, to allow the variables to be bound
29567 to the constructor arguments.
29569 * rootcontext.cs (LookupType): First lookup nested classes in our
29570 class and our parents before we go looking outside our class.
29572 * expression.cs (ConstantFold): Extract/debox the values at the
29575 * rootcontext.cs (EmitCode): Resolve the constants first before we
29576 resolve the types. This is not really needed, but it helps debugging.
29578 * statement.cs: report location.
29580 * cs-parser.jay: pass location to throw statement.
29582 * driver.cs: Small bug fix.
29584 * report.cs: Updated format to be 4-zero filled digits.
29586 2001-12-22 Ravi Pratap <ravi@ximian.com>
29588 * expression.cs (CheckIndices): Fix minor bug where the wrong
29589 variable was being referred to ;-)
29591 (DoEmit): Do not call EmitStaticInitializers when the
29592 underlying type is System.Object.
29594 2001-12-21 Ravi Pratap <ravi@ximian.com>
29596 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
29597 and do the usual workaround for SRE.
29599 * class.cs (MyEventBuilder.EventType): New member to get at the type
29600 of the event, quickly.
29602 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
29604 * assign.cs (Assign.DoResolve): Handle the case when the target
29605 is an EventExpr and perform the necessary checks.
29607 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
29610 (SimpleName.MemberStaticCheck): Include check for EventExpr.
29612 (EventExpr): Set the type in the constructor itself since we
29613 are meant to be born fully resolved.
29615 (EventExpr.Define): Revert code I wrote earlier.
29617 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
29618 instance expression is null. The instance expression is a This in that case
29619 or a null, depending on whether it is a static method or not.
29621 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
29622 refers to more than one method.
29624 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
29625 and accordingly flag errors.
29627 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29629 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
29631 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29633 * location.cs (ToString): Provide useful rutine.
29635 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29637 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
29638 objects, return the actual integral boxed.
29640 * statement.cs (SwitchLabel): define an ILLabel for each
29643 (Switch.CheckSwitch): If the value is a Literal, extract
29644 the underlying literal.
29646 Also in the unused hashtable we had, add the SwitchLabel so we can
29647 quickly look this value up.
29649 * constant.cs: Implement a bunch of new constants. Rewrite
29650 Literal based on this. Made changes everywhere to adapt to this.
29652 * expression.cs (Expression.MakeByteBlob): Optimize routine by
29653 dereferencing array only once, and also copes with enumrations.
29655 bytes are two bytes wide, not one.
29657 (Cast): Perform constant conversions.
29659 * ecore.cs (TryImplicitIntConversion): Return literals instead of
29660 wrappers to the literals here.
29662 * expression.cs (DoNumericPromotions): long literals can converted
29663 to ulong implicity (this is taken care of elsewhere, but I was
29664 missing this spot).
29666 * ecore.cs (Expression.Literalize): Make the return type Literal,
29667 to improve type checking.
29669 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
29671 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29673 * literal.cs: Revert code from ravi that checked the bounds. The
29674 bounds are sane by the definition of the type itself.
29676 * typemanager.cs: Fix implementation of ImplementsInterface. We
29677 need to actually look up in our parent hierarchy for interfaces
29680 * const.cs: Use the underlying type for enumerations
29682 * delegate.cs: Compute the basename for the delegate creation,
29683 that should fix the delegate test case, and restore the correct
29684 Type Lookup semantics in rootcontext
29686 * rootcontext.cs: Revert Ravi's last patch. The correct way of
29687 referencing a nested type with the Reflection API is using the "+"
29690 * cs-parser.jay: Do not require EOF token at the end.
29692 2001-12-20 Ravi Pratap <ravi@ximian.com>
29694 * rootcontext.cs (LookupType): Concatenate type names with
29695 a '.' instead of a '+' The test suite passes again.
29697 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
29698 field of the enumeration.
29700 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
29701 the case when the member is an EventExpr.
29703 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
29704 static has an associated instance expression.
29706 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
29708 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
29710 * class.cs (Event.Define): Register event and perform appropriate checks
29713 We define the Add and Remove methods even if the use provides none because
29714 in that case, we provide default implementations ourselves.
29716 Define a private field of the type of the event. This is done by the CSC compiler
29717 and we should be doing it too ;-)
29719 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
29720 More methods we use in code we generate.
29722 (multicast_delegate_type, delegate_type): Two separate types since the distinction
29725 (InitCoreTypes): Update accordingly for the above.
29727 * class.cs (Event.Emit): Generate code for default accessors that we provide
29729 (EmitDefaultMethod): Do the job in the above.
29731 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
29734 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29736 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
29737 builders even if we were missing one.
29739 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
29740 pass the Basename as our class name instead of the Name. The
29741 basename will be correctly composed for us.
29743 * parameter.cs (Paramters): Now takes a Location argument.
29745 * decl.cs (DeclSpace.LookupType): Removed convenience function and
29746 make all the code call directly LookupType in RootContext and take
29747 this chance to pass the Location information everywhere.
29749 * Everywhere: pass Location information.
29751 2001-12-19 Miguel de Icaza <miguel@ximian.com>
29753 * class.cs (Constructor.Define): Updated way of detecting the
29754 length of the parameters.
29756 (TypeContainer.DefineType): Use basename as the type name for
29759 (TypeContainer.Define): Do not recursively define types here, as
29760 definition is taken care in order by the RootContext.
29762 * tree.cs: Keep track of namespaces in a per-file basis.
29764 * parameter.cs (Parameter.ComputeSignature): Update to use
29767 (Parameters.GetSignature): ditto.
29769 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
29770 instead of a TypeContainer.
29772 (Interface.SemanticAnalysis): Use `this' instead of our parent to
29773 resolve names. Because we need to be resolve in our context, not
29776 * driver.cs: Implement response files.
29778 * class.cs (TypeContainer.DefineType): If we are defined, do not
29779 redefine ourselves.
29781 (Event.Emit): Emit the code for add/remove handlers.
29782 (Event.Define): Save the MethodBuilders for add/remove.
29784 * typemanager.cs: Use pair here too.
29786 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
29787 DictionaryEntry requires the first argument to be non-null.
29789 (enum_declaration): Compute full name for registering the
29792 (delegate_declaration): Instead of using
29793 formal_parameter_list, use opt_formal_parameter_list as the list
29796 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
29797 (EventParsing): New property that controls whether `add' and
29798 `remove' are returned as tokens or identifiers (for events);
29800 2001-12-19 Ravi Pratap <ravi@ximian.com>
29802 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
29803 use MyEventBuilder only and let it wrap the real builder for us.
29805 (MyEventBuilder): Revamp constructor etc.
29807 Implement all operations that we perform on EventBuilder in precisely the same
29810 (FindMembers): Update to use the EventBuilder member.
29812 (Event.Emit): Update accordingly.
29814 2001-12-18 Ravi Pratap <ravi@ximian.com>
29816 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
29817 by calling the appropriate methods.
29819 (GetCustomAttributes): Make stubs as they cannot possibly do anything
29822 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
29824 2001-12-17 Ravi Pratap <ravi@ximian.com>
29826 * delegate.cs (Delegate.Populate): Check that the return type
29827 and various parameters types are indeed accessible.
29829 * class.cs (Constructor.Define): Same here.
29831 (Field.Define): Ditto.
29833 (Event.Define): Ditto.
29835 (Operator.Define): Check that the underlying Method defined itself
29836 correctly - so it's MethodBuilder should not be null.
29838 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
29839 expression happens to be null.
29841 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
29842 members but as of now we don't seem to be able to do anything really useful with it.
29844 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
29845 not the EventBuilder.
29847 2001-12-18 Miguel de Icaza <miguel@ximian.com>
29849 * cs-tokenizer.cs: Add support for defines.
29850 Add support for #if, #elif, #else, #endif
29852 (eval_var): evaluates a variable.
29853 (eval): stubbed for evaluating functions.
29855 * cs-parser.jay: Pass the defines information
29857 * driver.cs: Add --define command line option.
29859 * decl.cs: Move MemberCore here.
29861 Make it the base class for DeclSpace. This allows us to catch and
29862 report 108 and 109 for everything now.
29864 * class.cs (TypeContainer.Define): Extract all the members
29865 before populating and emit the warning 108 (new keyword required
29866 to override) instead of having each member implement this.
29868 (MemberCore.Define): New abstract method, we will be using this in
29869 the warning reporting engine in Populate.
29871 (Operator.Define): Adjust to new MemberCore protocol.
29873 * const.cs (Const): This does not derive from Expression, it is a
29874 temporary object we use to create fields, it is a MemberCore.
29876 * class.cs (Method.Define): Allow the entry point to be in a
29879 * driver.cs: Rewrite the argument handler to clean it up a bit.
29881 * rootcontext.cs: Made it just an auxiliary namespace feature by
29882 making everything static.
29884 * driver.cs: Adapt code to use RootContext type name instead of
29887 * delegate.cs: Remove RootContext argument.
29889 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
29892 * class.cs (Event.Define): The lookup can fail.
29894 * cs-tokenizer.cs: Begin implementation of pre-procesor.
29896 * expression.cs: Resolve the this instance before invoking the code.
29898 2001-12-17 Miguel de Icaza <miguel@ximian.com>
29900 * cs-parser.jay: Add a production in element_access that allows
29901 the thing to become a "type" reference. This way we can parse
29902 things like "(string [])" as a type.
29904 Note that this still does not handle the more complex rules of
29908 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
29910 * ecore.cs: (CopyNewMethods): new utility function used to
29911 assemble the list of methods from running FindMembers.
29913 (MemberLookup): Rework FindMembers so that
29915 2001-12-16 Miguel de Icaza <miguel@ximian.com>
29917 * class.cs (TypeContainer): Remove Delegates who fail to be
29920 * delegate.cs (Populate): Verify that we dont get null return
29921 values. TODO: Check for AsAccessible.
29923 * cs-parser.jay: Use basename to emit error 574 (destructor should
29924 have the same name as container class), not the full name.
29926 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
29927 possible representation.
29929 Also implements integer type suffixes U and L.
29931 2001-12-15 Miguel de Icaza <miguel@ximian.com>
29933 * expression.cs (ArrayCreation.DoResolve): We need to do the
29934 argument resolution *always*.
29936 * decl.cs: Make this hold the namespace. Hold the root context as
29938 (LookupType): Move here.
29940 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
29942 * location.cs (Row, Name): Fixed the code, it was always returning
29943 references to the first file.
29945 * interface.cs: Register properties defined through interfaces.
29947 * driver.cs: Add support for globbing on the command line
29949 * class.cs (Field): Make it derive from MemberCore as well.
29952 2001-12-15 Ravi Pratap <ravi@ximian.com>
29954 * class.cs (Event::Define): Check that the type of the event is a delegate
29955 type else flag error #66.
29957 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
29960 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
29961 values of EntryPoint, CharSet etc etc.
29963 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
29965 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
29966 be null and we should ignore this. I am not sure if this is really clean. Apparently,
29967 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
29968 which needs this to do its work.
29970 * ../errors/cs0066.cs : Add.
29972 2001-12-14 Miguel de Icaza <miguel@ximian.com>
29974 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
29977 * class.cs: (MethodSignature.MethodSignature): Removed hack that
29978 clears out the parameters field.
29979 (MemberSignatureCompare): Cleanup
29981 (MemberCore): New base class used to share code between MethodCore
29984 (RegisterRequiredImplementations) BindingFlags.Public requires
29985 either BindingFlags.Instace or Static. Use instance here.
29987 (Property): Refactored code to cope better with the full spec.
29989 * parameter.cs (GetParameterInfo): Return an empty array instead
29992 * class.cs (Property): Abstract or extern properties have no bodies.
29994 * parameter.cs (GetParameterInfo): return a zero-sized array.
29996 * class.cs (TypeContainer.MethodModifiersValid): Move all the
29997 method modifier validation to the typecontainer so we can reuse
29998 this on properties.
30000 (MethodCore.ParameterTypes): return an empty sized array of types.
30002 (Property.Define): Test property modifier validity.
30004 Add tests for sealed/override too.
30006 (Method.Emit): abstract or extern methods have no bodies.
30008 2001-12-14 Ravi Pratap <ravi@ximian.com>
30010 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
30013 (Method::Define, ::Emit): Modify accordingly.
30015 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
30017 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
30019 * makefile: Pass in /unsafe.
30021 2001-12-13 Miguel de Icaza <miguel@ximian.com>
30023 * class.cs (MakeKey): Kill routine.
30025 * class.cs (TypeContainer.Define): Correctly define explicit
30026 method implementations (they require the full interface name plus
30029 * typemanager.cs: Deply the PtrHashtable here and stop using the
30030 lame keys. Things work so much better.
30032 This of course broke everyone who depended on `RegisterMethod' to
30033 do the `test for existance' test. This has to be done elsewhere.
30035 * support.cs (PtrHashtable): A hashtable that avoid comparing with
30036 the object stupid Equals method (because, that like fails all over
30037 the place). We still do not use it.
30039 * class.cs (TypeContainer.SetRequiredInterface,
30040 TypeContainer.RequireMethods): Killed these two routines and moved
30041 all the functionality to RegisterRequiredImplementations.
30043 (TypeContainer.RegisterRequiredImplementations): This routine now
30044 registers all the implementations required in an array for the
30045 interfaces and abstract methods. We use an array of structures
30046 which can be computed ahead of time to reduce memory usage and we
30047 also assume that lookups are cheap as most classes will not
30048 implement too many interfaces.
30050 We also avoid creating too many MethodSignatures.
30052 (TypeContainer.IsInterfaceMethod): Update and optionally does not
30053 clear the "pending" bit if we find that there are problems with
30056 (TypeContainer.VerifyPendingMethods): Update to report errors of
30057 methods that look like implementations but are not.
30059 (TypeContainer.Define): Add support for explicit interface method
30062 2001-12-12 Miguel de Icaza <miguel@ximian.com>
30064 * typemanager.cs: Keep track of the parameters here instead of
30065 being a feature of the TypeContainer.
30067 * class.cs: Drop the registration of parameters here, as
30068 InterfaceMethods are also interface declarations.
30070 * delegate.cs: Register methods with the TypeManager not only with
30071 the TypeContainer. This code was buggy.
30073 * interface.cs: Full registation here.
30075 2001-12-11 Miguel de Icaza <miguel@ximian.com>
30077 * expression.cs: Remove reducer for binary expressions, it can not
30080 * const.cs: Put here the code that used to go into constant.cs
30082 * constant.cs: Put here the code for constants, this is a new base
30083 class for Literals.
30085 * literal.cs: Make Literal derive from Constant.
30087 2001-12-09 Miguel de Icaza <miguel@ximian.com>
30089 * statement.cs (Return.Emit): Report error 157 if the user
30090 attempts to return from a finally block.
30092 (Return.Emit): Instead of emitting a return, jump to the end of
30095 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
30096 LocalBuilder to store the result of the function. ReturnLabel is
30097 the target where we jump.
30100 2001-12-09 Radek Doulik <rodo@ximian.com>
30102 * cs-parser.jay: remember alias in current namespace
30104 * ecore.cs (SimpleName::DoResolve): use aliases for types or
30107 * class.cs (LookupAlias): lookup alias in my_namespace
30109 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
30111 (LookupAlias): lookup alias in this and if needed in parent
30114 2001-12-08 Miguel de Icaza <miguel@ximian.com>
30118 * rootcontext.cs: (ModuleBuilder) Made static, first step into
30119 making things static. I need this to avoid passing the
30120 TypeContainer when calling ParameterType.
30122 * support.cs (InternalParameters.ParameterType): Remove ugly hack
30123 that did string manipulation to compute the type and then call
30124 GetType. Use Parameter.ParameterType instead.
30126 * cs-tokenizer.cs: Consume the suffix for floating values.
30128 * expression.cs (ParameterReference): figure out whether this is a
30129 reference parameter or not. Kill an extra variable by computing
30130 the arg_idx during emission.
30132 * parameter.cs (Parameters.GetParameterInfo): New overloaded
30133 function that returns whether a parameter is an out/ref value or not.
30135 (Parameter.ParameterType): The type of the parameter (base,
30136 without ref/out applied).
30138 (Parameter.Resolve): Perform resolution here.
30139 (Parameter.ExternalType): The full type (with ref/out applied).
30141 * statement.cs (Using.Emit, Using.EmitExpression): Implement
30142 support for expressions on the using statement.
30144 2001-12-07 Miguel de Icaza <miguel@ximian.com>
30146 * statement.cs (Using.EmitLocalVariableDecls): Split the
30147 localvariable handling of the using statement.
30149 (Block.EmitMeta): Keep track of variable count across blocks. We
30150 were reusing slots on separate branches of blocks.
30152 (Try.Emit): Emit the general code block, we were not emitting it.
30154 Check the type of the declaration to be an IDisposable or
30155 something that can be implicity converted to it.
30157 Emit conversions if required.
30159 * ecore.cs (EmptyExpression): New utility class.
30160 (Expression.ImplicitConversionExists): New utility function.
30162 2001-12-06 Miguel de Icaza <miguel@ximian.com>
30164 * statement.cs (Using): Implement.
30166 * expression.cs (LocalVariableReference): Support read only variables.
30168 * statement.cs: Remove the explicit emit for the Leave opcode.
30169 (VariableInfo): Add a readonly field.
30171 2001-12-05 Miguel de Icaza <miguel@ximian.com>
30173 * ecore.cs (ConvCast): new class used to encapsulate the various
30174 explicit integer conversions that works in both checked and
30175 unchecked contexts.
30177 (Expression.ConvertNumericExplicit): Use new ConvCast class to
30178 properly generate the overflow opcodes.
30180 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30182 * statement.cs: The correct type for the EmptyExpression is the
30183 element_type, not the variable type. Ravi pointed this out.
30185 2001-12-04 Ravi Pratap <ravi@ximian.com>
30187 * class.cs (Method::Define): Handle PInvoke methods specially
30188 by using DefinePInvokeMethod instead of the usual one.
30190 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
30191 above to do the task of extracting information and defining the method.
30193 2001-12-04 Ravi Pratap <ravi@ximian.com>
30195 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
30196 of the condition for string type.
30198 (Emit): Move that here.
30200 (ArrayCreation::CheckIndices): Keep string literals in their expression
30203 (EmitDynamicInitializers): Handle strings appropriately.
30205 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30207 * codegen.cs (EmitContext): Replace multiple variables with a
30208 single pointer to the current Switch statement.
30210 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
30213 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30217 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
30220 (Foreach.Emit): Foreach on arrays was not setting
30221 up the loop variables (for break/continue).
30223 (GotoCase): Semi-implented.
30225 2001-12-03 Ravi Pratap <ravi@ximian.com>
30227 * attribute.cs (CheckAttribute): Handle system attributes by using
30228 Attribute.GetAttributes to examine information we need.
30230 (GetValidPlaces): Same here.
30232 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
30234 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
30236 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
30238 (Method::Define): Set appropriate flags if we have a DllImport attribute.
30240 (Method::Emit): Handle the case when we are a PInvoke method.
30242 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30244 * expression.cs: Use ResolveWithSimpleName on compound names.
30246 2001-12-02 Ravi Pratap <ravi@ximian.com>
30248 * constant.cs (EmitConstant): Make sure we resolve the associated expression
30249 before trying to reduce it.
30251 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
30253 * constant.cs (LookupConstantValue): Implement.
30255 (EmitConstant): Use the above in emitting the constant.
30257 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
30258 that are user-defined by doing a LookupConstantValue on them.
30260 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
30263 2001-11-29 Miguel de Icaza <miguel@ximian.com>
30265 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
30267 (BaseAccess.DoResolve): Implement.
30269 (MemberAccess.DoResolve): Split this routine into a
30270 ResolveMemberAccess routine that can be used independently
30272 2001-11-28 Miguel de Icaza <miguel@ximian.com>
30274 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
30275 As that share bits of the implementation. Is returns a boolean,
30276 while As returns the Type that is being probed.
30278 2001-12-01 Ravi Pratap <ravi@ximian.com>
30280 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
30281 instead of a Literal - much easier.
30283 (EnumInTransit): Remove - utterly useless :-)
30285 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
30287 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
30289 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
30290 chain when we have no associated expression.
30292 2001-11-30 Ravi Pratap <ravi@ximian.com>
30294 * constant.cs (Define): Use Location while reporting the errror.
30296 Also emit a warning when 'new' is used and there is no inherited
30299 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
30302 (LookupEnumValue): Implement to lookup an enum member's value and define it
30305 (Populate): Re-write accordingly to use the above routine.
30307 2001-11-27 Miguel de Icaza <miguel@ximian.com>
30309 * expression.cs (This): Fix prototype for DoResolveLValue to
30310 override the base class DoResolveLValue.
30312 * cs-parser.cs: Report errors cs574 and cs575 (destructor
30315 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
30316 (we need to load the address of the field here). This fixes
30319 (FieldExpr.DoResolveLValue): Call the DoResolve
30320 function to initialize the Instance expression.
30322 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
30323 correctly the GetEnumerator operation on a value type.
30325 * cs-parser.jay: Add more simple parsing error catches.
30327 * statement.cs (Switch): Add support for string switches.
30328 Handle null specially.
30330 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
30332 2001-11-28 Ravi Pratap <ravi@ximian.com>
30334 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
30336 (declare_local_constant): New helper function.
30338 * statement.cs (AddConstant): Keep a separate record of constants
30340 (IsConstant): Implement to determine if a variable is a constant.
30342 (GetConstantExpression): Implement.
30344 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
30346 * statement.cs (IsVariableDefined): Re-write.
30348 2001-11-27 Ravi Pratap <ravi@ximian.com>
30350 * class.cs (TypeContainer::FindMembers): Look for constants
30351 in the case when we are looking for MemberTypes.Field
30353 * expression.cs (MemberAccess::DoResolve): Check that in the
30354 case we are a FieldExpr and a Literal, we are not being accessed
30355 by an instance reference.
30357 * cs-parser.jay (local_constant_declaration): Implement.
30359 (declaration_statement): Implement for constant declarations.
30361 2001-11-26 Miguel de Icaza <miguel@ximian.com>
30363 * statement.cs (Switch): Catch double defaults.
30365 (Switch): More work on the switch() statement
30366 implementation. It works for integral values now, need to finish
30370 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30372 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
30373 integer literals into other integer literals. To be used by
30376 2001-11-24 Ravi Pratap <ravi@ximian.com>
30378 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
30381 (EmitDynamicInitializers): Cope with the above since we extract data
30382 directly from ArrayData now.
30384 (ExpectInitializers): Keep track of whether initializers are mandatory
30387 (Bounds): Make it a hashtable to prevent the same dimension being
30388 recorded for every element in that dimension.
30390 (EmitDynamicInitializers): Fix bug which prevented the Set array method
30393 Also fix bug which was causing the indices to be emitted in the reverse
30396 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30398 * expression.cs (ArrayCreation): Implement the bits that Ravi left
30399 unfinished. They do not work, because the underlying code is
30402 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30404 * cs-parser.jay: Remove bogus fixme.
30406 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
30407 on Switch statement.
30409 2001-11-23 Ravi Pratap <ravi@ximian.com>
30411 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
30414 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
30415 parameter. Apparently, any expression is allowed.
30417 (ValidateInitializers): Update accordingly.
30419 (CheckIndices): Fix some tricky bugs thanks to recursion.
30421 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
30422 I was being completely brain-dead.
30424 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
30425 and re-write acordingly.
30427 (DelegateInvocation): Re-write accordingly.
30429 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
30431 (MakeByteBlob): Handle types more correctly.
30433 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
30434 initialization from expressions but it is incomplete because I am a complete
30437 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30439 * statement.cs (If.Emit): Fix a bug that generated incorrect code
30440 on If. Basically, we have to return `true' (ie, we do return to
30441 our caller) only if both branches of the if return.
30443 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
30444 short-circuit operators, handle them as short circuit operators.
30446 (Cast.DoResolve): Resolve type.
30447 (Cast.Cast): Take an expression as the target type.
30449 * cs-parser.jay (cast_expression): Remove old hack that only
30450 allowed a limited set of types to be handled. Now we take a
30451 unary_expression and we resolve to a type during semantic
30454 Use the grammar productions from Rhys to handle casts (this is
30455 not complete like Rhys syntax yet, we fail to handle that corner
30456 case that C# has regarding (-x), but we will get there.
30458 2001-11-22 Ravi Pratap <ravi@ximian.com>
30460 * class.cs (EmitFieldInitializer): Take care of the case when we have a
30461 field which is an array type.
30463 * cs-parser.jay (declare_local_variables): Support array initialization too.
30465 * typemanager.cs (MakeKey): Implement.
30467 (everywhere): Use the above appropriately.
30469 * cs-parser.jay (for_statement): Update for array initialization while
30470 declaring variables.
30472 * ecore.cs : The error message was correct, it's the variable's names that
30473 were misleading ;-) Make the code more readable.
30475 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
30476 the correct type etc.
30478 (ConvertExplicit): Handle Enum types by examining the underlying type.
30480 2001-11-21 Ravi Pratap <ravi@ximian.com>
30482 * parameter.cs (GetCallingConvention): Always return
30483 CallingConventions.Standard for now.
30485 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30487 * expression.cs (Binary.ResolveOperator): Update the values of `l'
30488 and `r' after calling DoNumericPromotions.
30490 * ecore.cs: Fix error message (the types were in the wrong order).
30492 * statement.cs (Foreach.ProbeCollectionType): Need to pass
30493 BindingFlags.Instance as well
30495 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
30496 implicit int literal conversion in an empty cast so that we
30497 propagate the right type upstream.
30499 (UnboxCast): new class used to unbox value types.
30500 (Expression.ConvertExplicit): Add explicit type conversions done
30503 (Expression.ImplicitNumericConversion): Oops, forgot to test for
30504 the target type before applying the implicit LongLiterals to ULong
30507 2001-11-21 Miguel de Icaza <miguel@ximian.com>
30509 * cs-parser.jay (for_statement): Reworked the way For works: now
30510 we declare manually any variables that are introduced in
30511 for_initializer to solve the problem of having out-of-band code
30512 emition (that is what got for broken).
30514 (declaration_statement): Perform the actual variable declaration
30515 that used to be done in local_variable_declaration here.
30517 (local_variable_declaration): Do not declare anything, just pass
30518 the information on a DictionaryEntry
30520 2001-11-20 Ravi Pratap <ravi@ximian.com>
30522 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
30523 re-write of the logic to now make it recursive.
30525 (UpdateIndices): Re-write accordingly.
30527 Store element data in a separate ArrayData list in the above methods.
30529 (MakeByteBlob): Implement to dump the array data into a byte array.
30531 2001-11-19 Ravi Pratap <ravi@ximian.com>
30533 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
30536 * constant.cs (Define): Implement.
30538 (EmitConstant): Re-write fully.
30540 Pass in location info.
30542 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
30545 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
30546 DictionaryEntry since we need location info too.
30548 (constant_declaration): Update accordingly.
30550 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
30551 code into another method : UpdateIndices.
30553 2001-11-18 Ravi Pratap <ravi@ximian.com>
30555 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
30556 some type checking etc.
30558 2001-11-17 Ravi Pratap <ravi@ximian.com>
30560 * expression.cs (ArrayCreation::ValidateInitializers): Implement
30561 bits to provide dimension info if the user skips doing that.
30563 Update second constructor to store the rank correctly.
30565 2001-11-16 Ravi Pratap <ravi@ximian.com>
30567 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
30568 and try to implement.
30570 * ../errors/cs0150.cs : Add.
30572 * ../errors/cs0178.cs : Add.
30574 2001-11-16 Miguel de Icaza <miguel@ximian.com>
30576 * statement.cs: Implement foreach on multi-dimensional arrays.
30578 * parameter.cs (Parameters.GetParameterByName): Also lookup the
30579 name of the params argument.
30581 * expression.cs: Use EmitStoreOpcode to get the right opcode while
30582 initializing the array.
30584 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
30585 we can use this elsewhere.
30587 * statement.cs: Finish implementation of foreach for single
30590 * cs-parser.jay: Use an out-of-band stack to pass information
30591 around, I wonder why I need this.
30593 foreach_block: Make the new foreach_block the current_block.
30595 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
30596 function used to return a static Parameters structure. Used for
30597 empty parameters, as those are created very frequently.
30599 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
30601 2001-11-15 Ravi Pratap <ravi@ximian.com>
30603 * interface.cs : Default modifier is private, not public. The
30604 make verify test passes again.
30606 2001-11-15 Ravi Pratap <ravi@ximian.com>
30608 * support.cs (ReflectionParameters): Fix logic to determine
30609 whether the last parameter is a params one. Test 9 passes again.
30611 * delegate.cs (Populate): Register the builders we define with
30612 RegisterParameterForBuilder. Test 19 passes again.
30614 * cs-parser.jay (property_declaration): Reference $6 instead
30615 of $$ to get at the location.
30617 (indexer_declaration): Similar stuff.
30619 (attribute): Ditto.
30621 * class.cs (Property): Register parameters for the Get and Set methods
30622 if they exist. Test 23 passes again.
30624 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
30625 call to EmitArguments as we are sure there aren't any params arguments.
30626 Test 32 passes again.
30628 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
30629 IndexOutOfRangeException.
30631 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
30632 Test 33 now passes again.
30634 2001-11-15 Miguel de Icaza <miguel@ximian.com>
30636 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
30637 broke a bunch of things. Will have to come up with a better way
30638 of tracking locations.
30640 * statement.cs: Implemented foreach for single dimension arrays.
30642 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30644 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
30645 an error. This removes the lookup from the critical path.
30647 * cs-parser.jay: Removed use of temporary_loc, which is completely
30650 2001-11-14 Miguel de Icaza <miguel@ximian.com>
30652 * support.cs (ReflectionParameters.ParameterModifier): Report
30653 whether the argument is a PARAMS argument or not.
30655 * class.cs: Set the attribute `ParamArrayAttribute' on the
30656 parameter argument.
30658 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
30659 and cons_param_array_attribute (ConstructorInfo for
30660 ParamArrayAttribute).,
30662 * codegen.cs: Emit the return using the `Return' statement, that
30663 way we can report the error correctly for missing return values.
30665 * class.cs (Method.Emit): Clean up.
30667 * expression.cs (Argument.Resolve): Take another argument: the
30668 location where this argument is used. Notice that this is not
30669 part of the "Argument" class as to reduce the size of the
30670 structure (we know the approximate location anyways).
30672 Test if the argument is a variable-reference, if not, then
30673 complain with a 206.
30675 (Argument.Emit): Emit addresses of variables.
30677 (Argument.FullDesc): Simplify.
30679 (Invocation.DoResolve): Update for Argument.Resolve.
30681 (ElementAccess.DoResolve): ditto.
30683 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
30684 method should be virtual, as this method is always virtual.
30686 (NewDelegate.DoResolve): Update for Argument.Resolve.
30688 * class.cs (ConstructorInitializer.DoResolve): ditto.
30690 * attribute.cs (Attribute.Resolve): ditto.
30692 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30694 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
30696 * expression.cs (ParameterReference): Drop IStackStorage and implement
30697 IAssignMethod instead.
30699 (LocalVariableReference): ditto.
30701 * ecore.cs (FieldExpr): Drop IStackStorage and implement
30702 IAssignMethod instead.
30704 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30706 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
30707 enumerations that are used in heavily used structures derive from
30708 byte in a laughable and pathetic attempt to reduce memory usage.
30709 This is the kind of pre-optimzations that you should not do at
30710 home without adult supervision.
30712 * expression.cs (UnaryMutator): New class, used to handle ++ and
30713 -- separatedly from the other unary operators. Cleans up the
30714 code, and kills the ExpressionStatement dependency in Unary.
30716 (Unary): Removed `method' and `Arguments' from this class, making
30717 it smaller, and moving it all to SimpleCall, so I can reuse this
30718 code in other locations and avoid creating a lot of transient data
30719 strucutres when not required.
30721 * cs-parser.jay: Adjust for new changes.
30723 2001-11-11 Miguel de Icaza <miguel@ximian.com>
30725 * enum.cs (Enum.Populate): If there is a failure during
30728 * cs-parser.jay (opt_enum_base): we used to catch type errors
30729 here, but this is really incorrect. The type error should be
30730 catched during semantic analysis.
30732 2001-12-11 Ravi Pratap <ravi@ximian.com>
30734 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
30735 current_local_parameters as expected since I, in my stupidity, had forgotten
30738 * attribute.cs (GetValidPlaces): Fix stupid bug.
30740 * class.cs (Method::Emit): Perform check on applicability of attributes.
30742 (Constructor::Emit): Ditto.
30744 (Field::Emit): Ditto.
30746 (Field.Location): Store location information.
30748 (Property, Event, Indexer, Operator): Ditto.
30750 * cs-parser.jay (field_declaration): Pass in location for each field.
30752 * ../errors/cs0592.cs : Add.
30754 2001-11-12 Ravi Pratap <ravi@ximian.com>
30756 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
30758 (InitCoreTypes): Update accordingly.
30760 (RegisterAttrType, LookupAttr): Implement.
30762 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
30763 info about the same.
30765 (Resolve): Update to populate the above as necessary.
30767 (Error592): Helper.
30769 (GetValidPlaces): Helper to the above.
30771 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
30773 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
30775 2001-11-12 Ravi Pratap <ravi@ximian.com>
30777 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
30779 * ../errors/cs0617.cs : Add.
30781 2001-11-11 Ravi Pratap <ravi@ximian.com>
30783 * enum.cs (Emit): Rename to Populate to be more consistent with what
30784 we expect it to do and when exactly it is called.
30786 * class.cs, rootcontext.cs : Update accordingly.
30788 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
30789 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
30791 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
30793 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
30794 of a fieldinfo using the above, when dealing with a FieldBuilder.
30796 2001-11-10 Ravi Pratap <ravi@ximian.com>
30798 * ../errors/cs0031.cs : Add.
30800 * ../errors/cs1008.cs : Add.
30802 * ../errrors/cs0543.cs : Add.
30804 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
30807 (FindMembers): Implement.
30809 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
30810 enums and delegates too.
30812 (enum_types): Rename to builder_to_enum.
30814 (delegate_types): Rename to builder_to_delegate.
30816 * delegate.cs (FindMembers): Implement.
30818 2001-11-09 Ravi Pratap <ravi@ximian.com>
30820 * typemanager.cs (IsEnumType): Implement.
30822 * enum.cs (Emit): Re-write parts to account for the underlying type
30823 better and perform checking etc.
30825 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
30826 of the underlying type.
30828 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
30831 * enum.cs (error31): Helper to report error #31.
30833 * cs-parser.jay (enum_declaration): Store location of each member too.
30835 * enum.cs (member_to_location): New hashtable.
30837 (AddEnumMember): Update location hashtable.
30839 (Emit): Use the location of each member while reporting errors.
30841 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30843 * cs-parser.jay: A for_initializer if is a
30844 local_variable_declaration really ammount to have an implicit
30845 block with the variable declaration and no initializer for for.
30847 * statement.cs (For.Emit): Cope with null initializers.
30849 This fixes the infinite loop on for initializers.
30851 2001-11-08 Miguel de Icaza <miguel@ximian.com>
30853 * enum.cs: More cleanup.
30855 * ecore.cs: Remove dead code.
30857 * class.cs (Property.Emit): More simplification.
30858 (Event.Emit): ditto.
30860 Reworked to have less levels of indentation.
30862 2001-11-08 Ravi Pratap <ravi@ximian.com>
30864 * class.cs (Property): Emit attributes.
30874 * enum.cs (Emit): Ditto.
30876 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
30879 * class.cs (Field, Event, etc.): Move attribute generation into the
30880 Emit method everywhere.
30882 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
30883 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
30884 as we had no way of defining nested enums !
30886 * rootcontext.cs : Adjust code accordingly.
30888 * typemanager.cs (AddEnumType): To keep track of enum types separately.
30890 2001-11-07 Ravi Pratap <ravi@ximian.com>
30892 * expression.cs (EvalConstantExpression): Move into ecore.cs
30894 * enum.cs (Enum): Rename some members and make them public and readonly
30895 according to our convention.
30897 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
30900 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
30902 (Enum::Emit): Write a simple version for now which doesn't try to compute
30903 expressions. I shall modify this to be more robust in just a while.
30905 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
30907 (TypeContainer::CloseType): Create the Enum types too.
30909 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
30911 * expression.cs (EvalConstantExpression): Get rid of completely.
30913 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
30914 user-defined values and other cases.
30916 (IsValidEnumLiteral): Helper function.
30918 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
30919 out there in the case we had a literal FieldExpr.
30921 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
30923 (Literalize): Revamp a bit to take two arguments.
30925 (EnumLiteral): New class which derives from Literal to wrap enum literals.
30927 2001-11-06 Ravi Pratap <ravi@ximian.com>
30929 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
30931 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
30933 (Resolve): Use the above to ensure we have proper initializers.
30935 2001-11-05 Ravi Pratap <ravi@ximian.com>
30937 * expression.cs (Expression::EvalConstantExpression): New method to
30938 evaluate constant expressions.
30940 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
30942 2001-11-07 Miguel de Icaza <miguel@ximian.com>
30944 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
30947 (Binary.ResolveOperator): Handle operator != (object a, object b)
30948 and operator == (object a, object b);
30950 (Binary.DoNumericPromotions): Indicate whether the numeric
30951 promotion was possible.
30953 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
30956 Made the ArrayAccess implement interface IAssignMethod instead of
30957 IStackStore as the order in which arguments are passed reflects
30960 * assign.cs: Instead of using expr.ExprClass to select the way of
30961 assinging, probe for the IStackStore/IAssignMethod interfaces.
30963 * typemanager.cs: Load InitializeArray definition.
30965 * rootcontext.cs (RootContext.MakeStaticData): Used to define
30966 static data that can be used to initialize arrays.
30968 2001-11-05 Miguel de Icaza <miguel@ximian.com>
30970 * expression.cs: Handle operator== and operator!= for booleans.
30972 (Conditioal.Reduce): Implement reducer for the ?: operator.
30974 (Conditional.Resolve): Implement dead code elimination.
30976 (Binary.Resolve): Catch string literals and return a new
30977 concatenated string.
30979 (Unary.Reduce): Implement reduction of unary expressions.
30981 * ecore.cs: Split out the expression core handling here.
30983 (Expression.Reduce): New method used to perform constant folding
30984 and CSE. This is needed to support constant-expressions.
30986 * statement.cs (Statement.EmitBoolExpression): Pass true and false
30987 targets, and optimize for !x.
30989 2001-11-04 Ravi Pratap <ravi@ximian.com>
30991 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
30992 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
30993 set custom atttributes.
30995 * literal.cs (Literal::GetValue): New abstract method to return the actual
30996 value of the literal, cast as an object.
30998 (*Literal): Implement GetValue method.
31000 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
31001 expressions to the arraylist but objects of type Argument.
31003 * class.cs (TypeContainer::Emit): Emit our attributes too.
31005 (Method::Emit, Constructor::Emit): Ditto.
31007 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
31008 to be ignoring earlier.
31010 2001-11-03 Ravi Pratap <ravi@ximian.com>
31012 * attribute.cs (AttributeSection::Define): Implement to do the business
31013 of constructing a CustomAttributeBuilder.
31015 (Attribute): New trivial class. Increases readability of code.
31017 * cs-parser.jay : Update accordingly.
31019 (positional_argument_list, named_argument_list, named_argument): New rules
31021 (attribute_arguments): Use the above so that we are more correct.
31023 2001-11-02 Ravi Pratap <ravi@ximian.com>
31025 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
31026 to perform all checks for a method with a params parameter.
31028 (Invocation::OverloadResolve): Update to use the above method and therefore
31029 cope correctly with params method invocations.
31031 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
31034 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
31035 constructors in our parent too because we can't afford to miss out on
31038 * attribute.cs (AttributeSection): New name for the class Attribute
31040 Other trivial changes to improve readability.
31042 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
31043 use the new class names.
31045 2001-11-01 Ravi Pratap <ravi@ximian.com>
31047 * class.cs (Method::Define): Complete definition for params types too
31049 (Indexer::Define): Ditto.
31051 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
31052 Cope everywhere with a request for info about the array parameter.
31054 2001-11-01 Ravi Pratap <ravi@ximian.com>
31056 * tree.cs (RecordNamespace): Fix up to check for the correct key.
31058 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
31059 local_variable_type to extract the string corresponding to the type.
31061 (local_variable_type): Fixup the action to use the new helper method.
31063 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
31066 * expression.cs : Clean out code which uses the above.
31068 2001-10-31 Ravi Pratap <ravi@ximian.com>
31070 * typemanager.cs (RegisterMethod): Check if we already have an existing key
31071 and bale out if necessary by returning a false.
31073 (RegisterProperty): Ditto.
31075 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
31076 and print out appropriate error messages.
31078 * interface.cs (everywhere): Ditto.
31080 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
31081 location to constructor.
31083 * class.cs (Property, Event, Indexer): Update accordingly.
31085 * ../errors/cs111.cs : Added.
31087 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
31088 of a method, as laid down by the spec.
31090 (Invocation::OverloadResolve): Use the above method.
31092 2001-10-31 Ravi Pratap <ravi@ximian.com>
31094 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
31095 now take a TypeContainer and a Parameters object.
31097 (ParameterData): Modify return type of ParameterModifier method to be
31098 Parameter.Modifier and not a string.
31100 (ReflectionParameters, InternalParameters): Update accordingly.
31102 * expression.cs (Argument::GetParameterModifier): Same here.
31104 * support.cs (InternalParameters::ParameterType): Find a better way of determining
31105 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
31106 symbol in it at all so maybe this is only for now.
31108 2001-10-30 Ravi Pratap <ravi@ximian.com>
31110 * support.cs (InternalParameters): Constructor now takes an extra argument
31111 which is the actual Parameters class.
31113 (ParameterDesc): Update to provide info on ref/out modifiers.
31115 * class.cs (everywhere): Update call to InternalParameters to pass in
31116 the second argument too.
31118 * support.cs (ParameterData): Add ParameterModifier, which is a method
31119 to return the modifier info [ref/out etc]
31121 (InternalParameters, ReflectionParameters): Implement the above.
31123 * expression.cs (Argument::ParameterModifier): Similar function to return
31124 info about the argument's modifiers.
31126 (Invocation::OverloadResolve): Update to take into account matching modifiers
31129 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
31130 a new SetFormalParameters object which we pass to InternalParameters.
31132 2001-10-30 Ravi Pratap <ravi@ximian.com>
31134 * expression.cs (NewArray): Merge into the ArrayCreation class.
31136 2001-10-29 Ravi Pratap <ravi@ximian.com>
31138 * expression.cs (NewArray): Merge classes NewBuiltinArray and
31139 NewUserdefinedArray into one as there wasn't much of a use in having
31142 * expression.cs (Argument): Change field's name to ArgType from Type.
31144 (Type): New readonly property which returns the proper type, taking into
31145 account ref/out modifiers.
31147 (everywhere): Adjust code accordingly for the above.
31149 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
31150 whether we are emitting for a ref or out parameter.
31152 * expression.cs (Argument::Emit): Use the above field to set the state.
31154 (LocalVariableReference::Emit): Update to honour the flag and emit the
31157 * parameter.cs (Attributes): Set the correct flags for ref parameters.
31159 * expression.cs (Argument::FullDesc): New function to provide a full desc.
31161 * support.cs (ParameterData): Add method ParameterDesc to the interface.
31163 (ReflectionParameters, InternalParameters): Implement the above method.
31165 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
31168 (Invocation::FullMethodDesc): Ditto.
31170 2001-10-29 Miguel de Icaza <miguel@ximian.com>
31172 * cs-parser.jay: Add extra production for the second form of array
31175 * expression.cs (ArrayCreation): Update to reflect the above
31178 * Small changes to prepare for Array initialization.
31180 2001-10-28 Miguel de Icaza <miguel@ximian.com>
31182 * typemanager.cs (ImplementsInterface): interface might be null;
31183 Deal with this problem;
31185 Also, we do store negative hits on the cache (null values), so use
31186 this instead of calling t.GetInterfaces on the type everytime.
31188 2001-10-28 Ravi Pratap <ravi@ximian.com>
31190 * typemanager.cs (IsBuiltinType): New method to help determine the same.
31192 * expression.cs (New::DoResolve): Get rid of array creation code and instead
31193 split functionality out into different classes.
31195 (New::FormArrayType): Move into NewBuiltinArray.
31197 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
31200 (NewBuiltinArray): New class to handle creation of built-in arrays.
31202 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
31203 account creation of one-dimensional arrays.
31205 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
31207 (NewUserdefinedArray::DoResolve): Implement.
31209 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
31211 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
31212 we maintain inside the TypeManager. This is necessary to perform lookups on the
31215 (LookupType): Update to perform GetType on the module builders too.
31217 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
31219 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
31221 2001-10-23 Ravi Pratap <ravi@ximian.com>
31223 * expression.cs (New::DoResolve): Implement guts of array creation.
31225 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
31227 2001-10-27 Miguel de Icaza <miguel@ximian.com>
31229 * expression.cs: Fix bug I introduced lsat night that broke
31232 (Expression.Resolve): Report a 246 error (can not resolve name)
31233 if we find a SimpleName in the stream.
31235 (Expression.ResolveLValue): Ditto.
31237 (Expression.ResolveWithSimpleName): This function is a variant of
31238 ResolveName, this one allows SimpleNames to be returned without a
31239 warning. The only consumer of SimpleNames is MemberAccess
31241 2001-10-26 Miguel de Icaza <miguel@ximian.com>
31243 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
31244 might arrive here. I have my doubts that this is correct.
31246 * statement.cs (Lock): Implement lock statement.
31248 * cs-parser.jay: Small fixes to support `lock' and `using'
31250 * cs-tokenizer.cs: Remove extra space
31252 * driver.cs: New flag --checked, allows to turn on integer math
31255 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
31256 Threading.Monitor.Exit
31258 2001-10-23 Miguel de Icaza <miguel@ximian.com>
31260 * expression.cs (IndexerAccess::DoResolveLValue): Set the
31261 Expression Class to be IndexerAccess.
31263 Notice that Indexer::DoResolve sets the eclass to Value.
31265 2001-10-22 Miguel de Icaza <miguel@ximian.com>
31267 * class.cs (TypeContainer::Emit): Emit code for indexers.
31269 * assign.cs (IAssignMethod): New interface implemented by Indexers
31270 and Properties for handling assignment.
31272 (Assign::Emit): Simplify and reuse code.
31274 * expression.cs (IndexerAccess, PropertyExpr): Implement
31275 IAssignMethod, clean up old code.
31277 2001-10-22 Ravi Pratap <ravi@ximian.com>
31279 * typemanager.cs (ImplementsInterface): New method to determine if a type
31280 implements a given interface. Provides a nice cache too.
31282 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
31285 (ConvertReferenceExplicit): Ditto.
31287 * delegate.cs (Delegate::Populate): Update to define the parameters on the
31288 various methods, with correct names etc.
31290 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
31291 Operator.UnaryNegation.
31293 * cs-parser.jay (operator_declarator): Be a little clever in the case where
31294 we have a unary plus or minus operator.
31296 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
31299 * everywhere : update accordingly.
31301 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
31304 * class.cs (Method::Define): For the case where we are implementing a method
31305 inherited from an interface, we need to set the MethodAttributes.Final flag too.
31306 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
31308 2001-10-21 Ravi Pratap <ravi@ximian.com>
31310 * interface.cs (FindMembers): Implement to work around S.R.E
31313 * typemanager.cs (IsInterfaceType): Implement.
31315 (FindMembers): Update to handle interface types too.
31317 * expression.cs (ImplicitReferenceConversion): Re-write bits which
31318 use IsAssignableFrom as that is not correct - it doesn't work.
31320 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
31321 and accordingly override EmitStatement.
31323 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
31324 using the correct logic :-)
31326 2001-10-19 Ravi Pratap <ravi@ximian.com>
31328 * ../errors/cs-11.cs : Add to demonstrate error -11
31330 2001-10-17 Miguel de Icaza <miguel@ximian.com>
31332 * assign.cs (Assign::Resolve): Resolve right hand side first, and
31333 then pass this as a hint to ResolveLValue.
31335 * expression.cs (FieldExpr): Add Location information
31337 (FieldExpr::LValueResolve): Report assignment to readonly
31340 (Expression::ExprClassFromMemberInfo): Pass location information.
31342 (Expression::ResolveLValue): Add new method that resolves an
31345 (Expression::DoResolveLValue): Default invocation calls
31348 (Indexers): New class used to keep track of indexers in a given
31351 (IStackStore): Renamed from LValue, as it did not really describe
31352 what this did. Also ResolveLValue is gone from this interface and
31353 now is part of Expression.
31355 (ElementAccess): Depending on the element access type
31357 * typemanager.cs: Add `indexer_name_type' as a Core type
31358 (System.Runtime.CompilerServices.IndexerNameAttribute)
31360 * statement.cs (Goto): Take a location.
31362 2001-10-18 Ravi Pratap <ravi@ximian.com>
31364 * delegate.cs (Delegate::VerifyDelegate): New method to verify
31365 if two delegates are compatible.
31367 (NewDelegate::DoResolve): Update to take care of the case when
31368 we instantiate a delegate from another delegate.
31370 * typemanager.cs (FindMembers): Don't even try to look up members
31371 of Delegate types for now.
31373 2001-10-18 Ravi Pratap <ravi@ximian.com>
31375 * delegate.cs (NewDelegate): New class to take care of delegate
31378 * expression.cs (New): Split the delegate related code out into
31379 the NewDelegate class.
31381 * delegate.cs (DelegateInvocation): New class to handle delegate
31384 * expression.cs (Invocation): Split out delegate related code into
31385 the DelegateInvocation class.
31387 2001-10-17 Ravi Pratap <ravi@ximian.com>
31389 * expression.cs (New::DoResolve): Implement delegate creation fully
31390 and according to the spec.
31392 (New::DoEmit): Update to handle delegates differently.
31394 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
31395 because of which we were printing out arguments in reverse order !
31397 * delegate.cs (VerifyMethod): Implement to check if the given method
31398 matches the delegate.
31400 (FullDelegateDesc): Implement.
31402 (VerifyApplicability): Implement.
31404 * expression.cs (Invocation::DoResolve): Update to accordingly handle
31405 delegate invocations too.
31407 (Invocation::Emit): Ditto.
31409 * ../errors/cs1593.cs : Added.
31411 * ../errors/cs1594.cs : Added.
31413 * delegate.cs (InstanceExpression, TargetMethod): New properties.
31415 2001-10-16 Ravi Pratap <ravi@ximian.com>
31417 * typemanager.cs (intptr_type): Core type for System.IntPtr
31419 (InitCoreTypes): Update for the same.
31421 (iasyncresult_type, asynccallback_type): Ditto.
31423 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
31426 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
31429 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
31430 the builders for the 4 members of a delegate type :-)
31432 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
31435 * expression.cs (New::DoResolve): Implement guts for delegate creation.
31437 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
31439 2001-10-15 Miguel de Icaza <miguel@ximian.com>
31441 * statement.cs (Break::Emit): Implement.
31442 (Continue::Emit): Implement.
31444 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
31445 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
31446 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
31447 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
31450 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
31451 properties that track the label for the current loop (begin of the
31452 loop and end of the loop).
31454 2001-10-15 Ravi Pratap <ravi@ximian.com>
31456 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
31457 use of emitting anything at all.
31459 * class.cs, rootcontext.cs : Get rid of calls to the same.
31461 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
31463 (Populate): Define the constructor correctly and set the implementation
31466 * typemanager.cs (delegate_types): New hashtable to hold delegates that
31469 (AddDelegateType): Implement.
31471 (IsDelegateType): Implement helper method.
31473 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
31475 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
31476 and accordingly handle it.
31478 * delegate.cs (Populate): Take TypeContainer argument.
31479 Implement bits to define the Invoke method. However, I still haven't figured out
31480 how to take care of the native int bit :-(
31482 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
31483 Qualify the name of the delegate, not its return type !
31485 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
31488 (StandardConversionExists): Checking for array types turns out to be recursive.
31490 (ConvertReferenceExplicit): Implement array conversion.
31492 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
31494 2001-10-12 Ravi Pratap <ravi@ximian.com>
31496 * cs-parser.jay (delegate_declaration): Store the fully qualified
31497 name as it is a type declaration.
31499 * delegate.cs (ReturnType, Name): Rename members to these. Make them
31502 (DefineDelegate): Renamed from Define. Does the same thing essentially,
31503 as TypeContainer::DefineType.
31505 (Populate): Method in which all the definition of the various methods (Invoke)
31508 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
31511 (CloseDelegate): Finally creates the delegate.
31513 * class.cs (TypeContainer::DefineType): Update to define delegates.
31514 (Populate, Emit and CloseType): Do the same thing here too.
31516 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
31517 delegates in all these operations.
31519 2001-10-14 Miguel de Icaza <miguel@ximian.com>
31521 * expression.cs: LocalTemporary: a new expression used to
31522 reference a temporary that has been created.
31524 * assign.cs: Handle PropertyAccess back here, so that we can
31525 provide the proper semantic access to properties.
31527 * expression.cs (Expression::ConvertReferenceExplicit): Implement
31528 a few more explicit conversions.
31530 * modifiers.cs: `NEW' modifier maps to HideBySig.
31532 * expression.cs (PropertyExpr): Make this into an
31533 ExpressionStatement, and support the EmitStatement code path.
31535 Perform get/set error checking, clean up the interface.
31537 * assign.cs: recognize PropertyExprs as targets, and if so, turn
31538 them into toplevel access objects.
31540 2001-10-12 Miguel de Icaza <miguel@ximian.com>
31542 * expression.cs: PropertyExpr::PropertyExpr: use work around the
31545 * typemanager.cs: Keep track here of our PropertyBuilders again to
31546 work around lameness in SRE.
31548 2001-10-11 Miguel de Icaza <miguel@ximian.com>
31550 * expression.cs (LValue::LValueResolve): New method in the
31551 interface, used to perform a second resolution pass for LValues.
31553 (This::DoResolve): Catch the use of this in static methods.
31555 (This::LValueResolve): Implement.
31557 (This::Store): Remove warning, assigning to `this' in structures
31560 (Invocation::Emit): Deal with invocation of
31561 methods on value types. We need to pass the address to structure
31562 methods rather than the object itself. (The equivalent code to
31563 emit "this" for structures leaves the entire structure on the
31564 stack instead of a pointer to it).
31566 (ParameterReference::DoResolve): Compute the real index for the
31567 argument based on whether the method takes or not a `this' pointer
31568 (ie, the method is static).
31570 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
31571 value types returned from functions when we need to invoke a
31572 method on the sturcture.
31575 2001-10-11 Ravi Pratap <ravi@ximian.com>
31577 * class.cs (TypeContainer::DefineType): Method to actually do the business of
31578 defining the type in the Modulebuilder or Typebuilder. This is to take
31579 care of nested types which need to be defined on the TypeBuilder using
31580 DefineNestedMethod.
31582 (TypeContainer::GetClassBases): Implement. Essentially the code from the
31583 methods in RootContext, only ported to be part of TypeContainer.
31585 (TypeContainer::GetInterfaceOrClass): Ditto.
31587 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
31589 * interface.cs (Interface::DefineInterface): New method. Does exactly
31590 what RootContext.CreateInterface did earlier, only it takes care of nested types
31593 (Interface::GetInterfaces): Move from RootContext here and port.
31595 (Interface::GetInterfaceByName): Same here.
31597 * rootcontext.cs (ResolveTree): Re-write.
31599 (PopulateTypes): Re-write.
31601 * class.cs (TypeContainer::Populate): Populate nested types too.
31602 (TypeContainer::Emit): Emit nested members too.
31604 * typemanager.cs (AddUserType): Do not make use of the FullName property,
31605 instead just use the name argument passed in as it is already fully
31608 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
31609 to TypeContainer mapping to see if a type is user-defined.
31611 * class.cs (TypeContainer::CloseType): Implement.
31613 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
31614 the default constructor.
31616 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
31619 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
31621 * interface.cs (CloseType): Create the type here.
31623 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
31626 Remove all the methods which are now in TypeContainer.
31628 2001-10-10 Ravi Pratap <ravi@ximian.com>
31630 * delegate.cs (Define): Re-write bits to define the delegate
31633 2001-10-10 Miguel de Icaza <miguel@ximian.com>
31635 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
31637 * expression.cs (ImplicitReferenceConversion): handle null as well
31638 as a source to convert to any reference type.
31640 * statement.cs (Return): Perform any implicit conversions to
31641 expected return type.
31643 Validate use of return statement.
31645 * codegen.cs (EmitContext): Pass the expected return type here.
31647 * class.cs (Method, Constructor, Property): Pass expected return
31648 type to EmitContext.
31650 2001-10-09 Miguel de Icaza <miguel@ximian.com>
31652 * expression.cs: Make DoResolve take an EmitContext instead of a
31655 Replaced `l' and `location' for `loc', for consistency.
31657 (Error, Warning): Remove unneeded Tc argument.
31659 * assign.cs, literal.cs, constant.cs: Update to new calling
31662 * codegen.cs: EmitContext now contains a flag indicating whether
31663 code is being generated in a static method or not.
31665 * cs-parser.jay: DecomposeQI, new function that replaces the old
31666 QualifiedIdentifier. Now we always decompose the assembled
31667 strings from qualified_identifier productions into a group of
31670 2001-10-08 Miguel de Icaza <miguel@ximian.com>
31672 * rootcontext.cs: Deal with field-less struct types correctly now
31673 by passing the size option to Define Type.
31675 * class.cs: Removed hack that created one static field.
31677 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31679 * statement.cs: Moved most of the code generation here.
31681 2001-10-09 Ravi Pratap <ravi@ximian.com>
31683 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
31686 (ElementAccess): Remove useless bits for now - keep checks as the spec
31689 2001-10-08 Ravi Pratap <ravi@ximian.com>
31691 * expression.cs (ElementAccess::DoResolve): Remove my crap code
31692 and start performing checks according to the spec.
31694 2001-10-07 Ravi Pratap <ravi@ximian.com>
31696 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
31697 rank_specifiers instead.
31699 (rank_specifiers): Change the order in which the rank specifiers are stored
31701 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
31703 * expression.cs (ElementAccess): Implement the LValue interface too.
31705 2001-10-06 Ravi Pratap <ravi@ximian.com>
31707 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
31708 except that user defined conversions are not included.
31710 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
31711 perform the conversion of the return type, if necessary.
31713 (New::DoResolve): Check whether we are creating an array or an object
31714 and accordingly do the needful.
31716 (New::Emit): Same here.
31718 (New::DoResolve): Implement guts of array creation.
31720 (New::FormLookupType): Helper function.
31722 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31724 * codegen.cs: Removed most of the code generation here, and move the
31725 corresponding code generation bits to the statement classes.
31727 Added support for try/catch/finalize and throw.
31729 * cs-parser.jay: Added support for try/catch/finalize.
31731 * class.cs: Catch static methods having the flags override,
31732 virtual or abstract.
31734 * expression.cs (UserCast): This user cast was not really doing
31735 what it was supposed to do. Which is to be born in fully resolved
31736 state. Parts of the resolution were being performed at Emit time!
31740 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31742 * expression.cs: Implicity convert the result from UserCast.
31744 2001-10-05 Ravi Pratap <ravi@ximian.com>
31746 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
31747 prevented it from working correctly.
31749 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
31750 merely ConvertImplicit.
31752 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31754 * typemanager.cs: Make the LookupTypeContainer function static,
31755 and not per-instance.
31757 * class.cs: Make static FindMembers (the one that takes a Type
31760 * codegen.cs: Add EmitForeach here.
31762 * cs-parser.jay: Make foreach a toplevel object instead of the
31763 inline expansion, as we need to perform semantic analysis on it.
31765 2001-10-05 Ravi Pratap <ravi@ximian.com>
31767 * expression.cs (Expression::ImplicitUserConversion): Rename to
31768 UserDefinedConversion.
31770 (Expression::UserDefinedConversion): Take an extra argument specifying
31771 whether we look for explicit user conversions too.
31773 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
31775 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
31777 (ExplicitUserConversion): Make it a call to UserDefinedConversion
31778 with the appropriate arguments.
31780 * cs-parser.jay (cast_expression): Record location too.
31782 * expression.cs (Cast): Record location info.
31784 (Expression::ConvertExplicit): Take location argument.
31786 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
31787 to determine if we are doing explicit conversions.
31789 (UserCast::Emit): Update accordingly.
31791 (Expression::ConvertExplicit): Report an error if everything fails.
31793 * ../errors/cs0030.cs : Add.
31795 2001-10-04 Miguel de Icaza <miguel@ximian.com>
31797 * modifiers.cs: If the ABSTRACT keyword is present, also set the
31798 virtual and newslot bits.
31800 * class.cs (TypeContainer::RegisterRequiredImplementations):
31801 Record methods we need.
31803 (TypeContainer::MakeKey): Helper function to make keys for
31804 MethodBases, since the Methodbase key is useless.
31806 (TypeContainer::Populate): Call RegisterRequiredImplementations
31807 before defining the methods.
31809 Create a mapping for method_builders_to_methods ahead of time
31810 instead of inside a tight loop.
31812 (::RequireMethods): Accept an object as the data to set into the
31813 hashtable so we can report interface vs abstract method mismatch.
31815 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31817 * report.cs: Make all of it static.
31819 * rootcontext.cs: Drop object_type and value_type computations, as
31820 we have those in the TypeManager anyways.
31822 Drop report instance variable too, now it is a global.
31824 * driver.cs: Use try/catch on command line handling.
31826 Add --probe option to debug the error reporting system with a test
31829 * report.cs: Add support for exiting program when a probe
31830 condition is reached.
31832 2001-10-03 Ravi Pratap <ravi@ximian.com>
31834 * expression.cs (Binary::DoNumericPromotions): Fix the case when
31835 we do a forcible conversion regardless of type, to check if
31836 ForceConversion returns a null.
31838 (Binary::error19): Use location to report error.
31840 (Unary::error23): Use location here too.
31842 * ../errors/cs0019.cs : Check in.
31844 * ../errors/cs0023.cs : Check in.
31846 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
31847 case of a non-null MethodInfo object with a length of 0 !
31849 (Binary::ResolveOperator): Flag error if overload resolution fails to find
31850 an applicable member - according to the spec :-)
31851 Also fix logic to find members in base types.
31853 (Unary::ResolveOperator): Same here.
31855 (Unary::report23): Change name to error23 and make first argument a TypeContainer
31856 as I was getting thoroughly confused between this and error19 :-)
31858 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
31859 (::FindMostEncompassedType): Implement.
31860 (::FindMostEncompassingType): Implement.
31861 (::StandardConversionExists): Implement.
31863 (UserImplicitCast): Re-vamp. We now need info about most specific
31864 source and target types so that we can do the necessary conversions.
31866 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
31867 mathematical union with no duplicates.
31869 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31871 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
31872 in order from base classes to child classes, so that we can in
31873 child classes look up in our parent for method names and
31874 attributes (required for handling abstract, virtual, new, override
31875 constructs: we need to instrospect our base class, and if we dont
31876 populate the classes in order, the introspection might be
31877 incorrect. For example, a method could query its parent before
31878 the parent has any methods and would determine that the parent has
31879 no abstract methods (while it could have had them)).
31881 (RootContext::CreateType): Record the order in which we define the
31884 2001-10-02 Miguel de Icaza <miguel@ximian.com>
31886 * class.cs (TypeContainer::Populate): Also method definitions can
31887 fail now, keep track of this.
31889 (TypeContainer::FindMembers): Implement support for
31890 DeclaredOnly/noDeclaredOnly flag.
31892 (Constructor::Emit) Return the ConstructorBuilder.
31894 (Method::Emit) Return the MethodBuilder.
31895 Check for abstract or virtual methods to be public.
31897 * rootcontext.cs (RootContext::CreateType): Register all the
31898 abstract methods required for the class to be complete and the
31899 interface methods that must be implemented.
31901 * cs-parser.jay: Report error 501 (method requires body if it is
31902 not marked abstract or extern).
31904 * expression.cs (TypeOf::Emit): Implement.
31906 * typemanager.cs: runtime_handle_type, new global type.
31908 * class.cs (Property::Emit): Generate code for properties.
31910 2001-10-02 Ravi Pratap <ravi@ximian.com>
31912 * expression.cs (Unary::ResolveOperator): Find operators on base type
31913 too - we now conform exactly to the spec.
31915 (Binary::ResolveOperator): Same here.
31917 * class.cs (Operator::Define): Fix minor quirk in the tests.
31919 * ../errors/cs0215.cs : Added.
31921 * ../errors/cs0556.cs : Added.
31923 * ../errors/cs0555.cs : Added.
31925 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31927 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
31928 single integer which is really efficient
31930 2001-10-01 Ravi Pratap <ravi@ximian.com>
31932 * expression.cs (Expression::ImplicitUserConversion): Use location
31933 even in the case when we are examining True operators.
31935 * class.cs (Operator::Define): Perform extensive checks to conform
31936 with the rules for operator overloading in the spec.
31938 * expression.cs (Expression::ImplicitReferenceConversion): Implement
31939 some of the other conversions mentioned in the spec.
31941 * typemanager.cs (array_type): New static member for the System.Array built-in
31944 (cloneable_interface): For System.ICloneable interface.
31946 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
31947 we start resolving the tree and populating types.
31949 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
31951 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31953 * expression.cs (Expression::ExprClassFromMemberInfo,
31954 Expression::Literalize): Create literal expressions from
31955 FieldInfos which are literals.
31957 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
31958 type casts, because they were wrong. The test suite in tests
31961 (ImplicitNumericConversion): ushort to ulong requires a widening
31964 Int32 constant to long requires widening cast as well.
31966 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
31967 for integers because the type on the stack is not i4.
31969 2001-09-30 Miguel de Icaza <miguel@ximian.com>
31971 * expression.cs (report118): require location argument.
31973 * parameter.cs: Do not dereference potential null value.
31975 * class.cs: Catch methods that lack the `new' keyword when
31976 overriding a name. Report warnings when `new' is used without
31977 anything being there to override.
31979 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
31981 * class.cs: Only add constructor to hashtable if it is non-null
31982 (as now constructors can fail on define).
31984 (TypeManager, Class, Struct): Take location arguments.
31986 Catch field instance initialization in structs as errors.
31988 accepting_filter: a new filter for FindMembers that is static so
31989 that we dont create an instance per invocation.
31991 (Constructor::Define): Catch errors where a struct constructor is
31994 * cs-parser.jay: Pass location information for various new
31997 * delegate.cs (Delegate): take a location argument.
31999 * driver.cs: Do not call EmitCode if there were problesm in the
32000 Definition of the types, as many Builders wont be there.
32002 * decl.cs (Decl::Decl): Require a location argument.
32004 * cs-tokenizer.cs: Handle properly hex constants that can not fit
32005 into integers, and find the most appropiate integer for it.
32007 * literal.cs: Implement ULongLiteral.
32009 * rootcontext.cs: Provide better information about the location of
32010 failure when CreateType fails.
32012 2001-09-29 Miguel de Icaza <miguel@ximian.com>
32014 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
32017 * expression.cs (Binary::CheckShiftArguments): Add missing type
32019 (Binary::ResolveOperator): Add type to the logical and and logical
32020 or, Bitwise And/Or and Exclusive Or code paths, it was missing
32023 (Binary::DoNumericPromotions): In the case where either argument
32024 is ulong (and most signed types combined with ulong cause an
32025 error) perform implicit integer constant conversions as well.
32027 2001-09-28 Miguel de Icaza <miguel@ximian.com>
32029 * expression.cs (UserImplicitCast): Method should always be
32031 (Invocation::BetterConversion): Simplified test for IntLiteral.
32033 (Expression::ImplicitNumericConversion): Split this routine out.
32034 Put the code that performs implicit constant integer conversions
32037 (Expression::Resolve): Become a wrapper around DoResolve so we can
32038 check eclass and type being set after resolve.
32040 (Invocation::Badness): Remove this dead function
32042 (Binary::ResolveOperator): Do not compute the expensive argumnets
32043 unless we have a union for it.
32045 (Probe::Emit): Is needs to do an isinst and then
32046 compare against null.
32048 (::CanConvert): Added Location argument. If the Location argument
32049 is null (Location.Null), then we do not report errors. This is
32050 used by the `probe' mechanism of the Explicit conversion. We do
32051 not want to generate an error for something that the user
32052 explicitly requested to be casted. But the pipeline for an
32053 explicit cast first tests for potential implicit casts.
32055 So for now, if the Location is null, it means `Probe only' to
32056 avoid adding another argument. Might have to revise this
32059 (ClassCast): New class used to type cast objects into arbitrary
32060 classes (used in Explicit Reference Conversions).
32062 Implement `as' as well.
32064 Reverted all the patches from Ravi below: they were broken:
32066 * The use of `level' as a mechanism to stop recursive
32067 invocations is wrong. That was there just to catch the
32068 bug with a strack trace but not as a way of addressing
32071 To fix the problem we have to *understand* what is going
32072 on and the interactions and come up with a plan, not
32073 just get things going.
32075 * The use of the type conversion cache that I proposed
32076 last night had an open topic: How does this work across
32077 protection domains. A user defined conversion might not
32078 be public in the location where we are applying the
32079 conversion, a different conversion might be selected
32080 (ie, private A->B (better) but public B->A (worse),
32081 inside A, A->B applies, but outside it, B->A will
32084 * On top of that (ie, even if the above is solved),
32085 conversions in a cache need to be abstract. Ie, `To
32086 convert from an Int to a Short use an OpcodeCast', not
32087 `To convert from an Int to a Short use the OpcodeCast on
32088 the variable 5' (which is what this patch was doing).
32090 2001-09-28 Ravi Pratap <ravi@ximian.com>
32092 * expression.cs (Invocation::ConversionExists): Re-write to use
32093 the conversion cache
32095 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
32096 cache all conversions done, not just user-defined ones.
32098 (Invocation::BetterConversion): The real culprit. Use ConversionExists
32099 to determine if a conversion exists instead of acutually trying to
32100 perform the conversion. It's faster too.
32102 (Expression::ConvertExplicit): Modify to use ConversionExists to check
32103 and only then attempt the implicit conversion.
32105 2001-09-28 Ravi Pratap <ravi@ximian.com>
32107 * expression.cs (ConvertImplicit): Use a cache for conversions
32108 already found. Check level of recursion and bail out if necessary.
32110 2001-09-28 Miguel de Icaza <miguel@ximian.com>
32112 * typemanager.cs (string_concat_string_string, string_concat_object_object):
32113 Export standard methods that we expect for string operations.
32115 * statement.cs (Block::UsageWarning): Track usage of variables and
32116 report the errors for not used variables.
32118 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
32121 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32123 * codegen.cs: remove unnneded code
32125 * expression.cs: Removed BuiltinTypeAccess class
32127 Fix the order in which implicit conversions are
32130 The previous fixed dropped support for boxed conversions (adding a
32131 test to the test suite now)
32133 (UserImplicitCast::CanConvert): Remove test for source being null,
32134 that code is broken. We should not feed a null to begin with, if
32135 we do, then we should track the bug where the problem originates
32136 and not try to cover it up here.
32138 Return a resolved expression of type UserImplicitCast on success
32139 rather than true/false. Ravi: this is what I was talking about,
32140 the pattern is to use a static method as a "constructor" for
32143 Also, do not create arguments until the very last minute,
32144 otherwise we always create the arguments even for lookups that
32145 will never be performed.
32147 (UserImplicitCast::Resolve): Eliminate, objects of type
32148 UserImplicitCast are born in a fully resolved state.
32150 * typemanager.cs (InitCoreTypes): Init also value_type
32151 (System.ValueType).
32153 * expression.cs (Cast::Resolve): First resolve the child expression.
32155 (LValue): Add new method AddressOf to be used by
32158 Change the argument of Store to take an EmitContext instead of an
32159 ILGenerator, because things like FieldExpr need to be able to call
32160 their children expression to generate the instance code.
32162 (Expression::Error, Expression::Warning): Sugar functions for
32165 (Expression::MemberLookup): Accept a TypeContainer instead of a
32166 Report as the first argument.
32168 (Expression::ResolvePrimary): Killed. I still want to improve
32169 this as currently the code is just not right.
32171 (Expression::ResolveMemberAccess): Simplify, but it is still
32174 (Unary::Resolve): Catch errors in AddressOf operators.
32176 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
32177 index to a byte for the short-version, or the compiler will choose
32178 the wrong Emit call, which generates the wrong data.
32180 (ParameterReference::Emit, ::Store): same.
32182 (FieldExpr::AddressOf): Implement.
32184 * typemanager.cs: TypeManager: made public variable instead of
32187 * driver.cs: document --fatal.
32189 * report.cs (ErrorMessage, WarningMessage): new names for the old
32190 Error and Warning classes.
32192 * cs-parser.jay (member_access): Turn built-in access to types
32193 into a normal simplename
32195 2001-09-27 Ravi Pratap <ravi@ximian.com>
32197 * expression.cs (Invocation::BetterConversion): Fix to cope
32198 with q being null, since this was introducing a bug.
32200 * expression.cs (ConvertImplicit): Do built-in conversions first.
32202 2001-09-27 Ravi Pratap <ravi@ximian.com>
32204 * expression.cs (UserImplicitCast::Resolve): Fix bug.
32206 2001-09-27 Ravi Pratap <ravi@ximian.com>
32208 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
32209 I had introduced long ago (what's new ?).
32211 * expression.cs (UserImplicitCast::CanConvert): Static method to do
32212 the work of all the checking.
32213 (ConvertImplicit): Call CanConvert and only then create object if necessary.
32214 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
32216 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
32217 that is the right way.
32219 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
32220 overloading resolution. Use everywhere instead of cutting and pasting code.
32222 (Binary::ResolveOperator): Use MakeUnionSet.
32224 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
32225 we have to convert to bool types. Not complete yet.
32227 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32229 * typemanager.cs (TypeManager::CSharpName): support ushort.
32231 * expression.cs (Expression::TryImplicitIntConversion): Attempts
32232 to provide an expression that performsn an implicit constant int
32233 conversion (section 6.1.6).
32234 (Expression::ConvertImplicitRequired): Reworked to include
32235 implicit constant expression conversions.
32237 (Expression::ConvertNumericExplicit): Finished.
32239 (Invocation::Emit): If InstanceExpression is null, then it means
32240 that we perform a call on this.
32242 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32244 * expression.cs (Unary::Emit): Remove some dead code.
32245 (Probe): Implement Resolve and Emit for `is'.
32246 (Expression::ConvertImplicitRequired): Attempt to do constant
32247 expression conversions here. Maybe should be moved to
32248 ConvertImplicit, but I am not sure.
32249 (Expression::ImplicitLongConstantConversionPossible,
32250 Expression::ImplicitIntConstantConversionPossible): New functions
32251 that tell whether is it possible to apply an implicit constant
32252 expression conversion.
32254 (ConvertNumericExplicit): Started work on explicit numeric
32257 * cs-parser.jay: Update operator constants.
32259 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
32260 (Parameters::GetSignature): Hook up VerifyArgs here.
32261 (Parameters::VerifyArgs): Verifies that no two arguments have the
32264 * class.cs (Operator): Update the operator names to reflect the
32265 ones that the spec expects (as we are just stringizing the
32268 * expression.cs (Unary::ResolveOperator): Fix bug: Use
32269 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
32270 previous usage did only work for our methods.
32271 (Expression::ConvertImplicit): Handle decimal implicit numeric
32272 conversions as well.
32273 (Expression::InternalTypeConstructor): Used to invoke constructors
32274 on internal types for default promotions.
32276 (Unary::Emit): Implement special handling for the pre/post
32277 increment/decrement for overloaded operators, as they need to have
32278 the same semantics as the other operators.
32280 (Binary::ResolveOperator): ditto.
32281 (Invocation::ConversionExists): ditto.
32282 (UserImplicitCast::Resolve): ditto.
32284 2001-09-26 Ravi Pratap <ravi@ximian.com>
32286 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
32287 operator, return after emitting body. Regression tests pass again !
32289 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
32290 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
32291 (Invocation::OverloadResolve): Ditto.
32292 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
32294 * everywhere : update calls to the above methods accordingly.
32296 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32298 * assign.cs (Assign): Make it inherit from ExpressionStatement.
32300 * expression.cs (ExpressionStatement): New base class used for
32301 expressions that can appear in statements, so that we can provide
32302 an alternate path to generate expression that do not leave a value
32305 (Expression::Emit, and all the derivatives): We no longer return
32306 whether a value is left on the stack or not. Every expression
32307 after being emitted leaves a single value on the stack.
32309 * codegen.cs (EmitContext::EmitStatementExpression): Use the
32310 facilties of ExpressionStatement if possible.
32312 * cs-parser.jay: Update statement_expression.
32314 2001-09-25 Miguel de Icaza <miguel@ximian.com>
32316 * driver.cs: Change the wording of message
32318 2001-09-25 Ravi Pratap <ravi@ximian.com>
32320 * expression.cs (Binary::ResolveOperator): Had forgottten to set
32321 the type of the expression to the return type of the method if
32322 we have an overloaded operator match ! The regression tests pass again !
32323 (Unary::ResolveOperator): Ditto.
32325 * expression.cs (Invocation::ConversionExists): Correct the member lookup
32326 to find "op_Implicit", not "implicit" ;-)
32327 (UserImplicitCast): New class to take care of user-defined implicit conversions.
32328 (ConvertImplicit, ForceConversion): Take TypeContainer argument
32330 * everywhere : Correct calls to the above accordingly.
32332 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
32333 (ConvertImplicit): Do user-defined conversion if it exists.
32335 2001-09-24 Miguel de Icaza <miguel@ximian.com>
32337 * assign.cs: track location.
32338 (Resolve): Use implicit conversions on assignment.
32340 * literal.cs: Oops. Not good, Emit of short access values should
32341 pass (Bytes) or the wrong argument will be selected.
32343 * expression.cs (Unary::Emit): Emit code for -expr.
32345 (Unary::ResolveOperator): Handle `Substract' for non-constants
32346 (substract from zero from the non-constants).
32347 Deal with Doubles as well.
32349 (Expression::ConvertImplicitRequired): New routine that reports an
32350 error if no implicit conversion exists.
32352 (Invocation::OverloadResolve): Store the converted implicit
32353 expressions if we make them
32355 2001-09-24 Ravi Pratap <ravi@ximian.com>
32357 * class.cs (ConstructorInitializer): Take a Location argument.
32358 (ConstructorBaseInitializer): Same here.
32359 (ConstructorThisInitializer): Same here.
32361 * cs-parser.jay : Update all calls accordingly.
32363 * expression.cs (Unary, Binary, New): Take location argument.
32364 Update accordingly everywhere.
32366 * cs-parser.jay : Update all calls to the above to take a location
32369 * class.cs : Ditto.
32371 2001-09-24 Ravi Pratap <ravi@ximian.com>
32373 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
32374 (Invocation::BetterConversion): Same here
32375 (Invocation::ConversionExists): Ditto.
32377 (Invocation::ConversionExists): Implement.
32379 2001-09-22 Ravi Pratap <ravi@ximian.com>
32381 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
32382 Also take an additional TypeContainer argument.
32384 * All over : Pass in TypeContainer as argument to OverloadResolve.
32386 * typemanager.cs (CSharpName): Update to check for the string type and return
32389 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
32392 2001-09-21 Ravi Pratap <ravi@ximian.com>
32394 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
32395 (Invocation::BetterFunction): Implement.
32396 (Invocation::BetterConversion): Implement.
32397 (Invocation::ConversionExists): Skeleton, no implementation yet.
32399 Okay, things work fine !
32401 2001-09-21 Miguel de Icaza <miguel@ximian.com>
32403 * typemanager.cs: declare and load enum_type, delegate_type and
32406 * expression.cs (Expression::Emit): Now emit returns a value that
32407 tells whether a value is left on the stack or not. This strategy
32408 might be reveted tomorrow with a mechanism that would address
32409 multiple assignments.
32410 (Expression::report118): Utility routine to report mismatches on
32413 (Unary::Report23): Report impossible type/operator combination
32416 (Unary::IsIncrementableNumber): Whether the type can be
32417 incremented or decremented with add.
32418 (Unary::ResolveOperator): Also allow enumerations to be bitwise
32420 (Unary::ResolveOperator): Implement ++, !, ~,
32422 (Invocation::Emit): Deal with new Emit convetion.
32424 * All Expression derivatives: Updated their Emit method to return
32425 whether they leave values on the stack or not.
32427 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
32428 stack for expressions that are statements.
32430 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32432 * expression.cs (LValue): New interface. Must be implemented by
32434 (LocalVariableReference, ParameterReference, FieldExpr): Implement
32437 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
32438 interface for generating code, simplifies the code.
32440 2001-09-20 Ravi Pratap <ravi@ximian.com>
32442 * expression.cs (everywhere): Comment out return statements in ::Resolve
32443 methods to avoid the warnings.
32445 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32447 * driver.cs (parse): Report error 2001 if we can not open the
32450 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
32453 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
32456 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
32457 otherwise nested blocks end up with the same index.
32459 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
32461 * expression.cs: Instead of having FIXMEs in the Resolve
32462 functions, throw exceptions so it is obvious that we are facing a
32465 * cs-parser.jay (invocation_expression): Pass Location information.
32467 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
32468 Use a basename for those routines because .NET does not like paths
32471 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
32474 2001-09-19 Miguel de Icaza <miguel@ximian.com>
32476 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
32477 are loading the correct data types (throws an exception if not).
32478 (TypeManager::InitCoreTypes): Use CoreLookupType
32480 * expression.cs (Unary::ResolveOperator): return the child
32481 expression for expressions which are just +expr.
32482 (Unary::ResolveOperator): Return negative literals for -LITERAL
32483 expressions (otherwise they are Unary {Literal}).
32484 (Invocation::Badness): Take into account `Implicit constant
32485 expression conversions'.
32487 * literal.cs (LongLiteral): Implement long literal class.
32488 (IntLiteral): export the `Value' of the intliteral.
32490 2001-09-19 Ravi Pratap <ravi@ximian.com>
32492 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
32494 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
32495 instead of 'Operator'
32497 * expression.cs (Binary::ResolveOperator): Update accordingly.
32498 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
32501 * cs-parser.jay (unary_expression): Update to use the new names.
32503 * gen-treedump.cs (GetUnary): Same here.
32505 * expression.cs (Unary::Resolve): Implement.
32506 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
32507 operators are found instead of making noise ;-)
32508 (Unary::ResolveOperator): New method to do precisely the same thing which
32509 Binary::ResolveOperator does for Binary expressions.
32510 (Unary.method, .Arguments): Add.
32511 (Unary::OperName): Implement.
32512 (Unary::ForceConversion): Copy and Paste !
32514 * class.cs (Operator::Define): Fix a small bug for the case when we have
32517 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
32518 for the inbuilt operators. Only overloading works for now ;-)
32520 2001-09-18 Miguel de Icaza <miguel@ximian.com>
32522 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
32523 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
32525 * expression.cs (This::Emit): Implement.
32526 (This::Resolve): Implement.
32527 (TypeOf:Resolve): Implement.
32528 (Expression::ResolveSimpleName): Add an implicit this to instance
32530 (MemberAccess::Resolve): Deal with Parameters and Fields.
32531 Bind instance variable to Field expressions.
32532 (FieldExpr::Instance): New field used to track the expression that
32533 represents the object instance.
32534 (FieldExpr::Resolve): Track potential errors from MemberLookup not
32536 (FieldExpr::Emit): Implement.
32538 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
32539 the last instruction contains a return opcode to avoid generating
32540 the last `ret' instruction (this generates correct code, and it is
32541 nice to pass the peverify output).
32543 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
32544 initializer for static and instance variables.
32545 (Constructor::Emit): Allow initializer to be null in the case of
32546 static constructors. Only emit initializer for instance
32549 (TypeContainer::FindMembers): Return a null array if there are no
32552 Also fix the code for the MemberTypes.Method branch, as it was not
32553 scanning that for operators (or tried to access null variables before).
32555 * assign.cs (Assign::Emit): Handle instance and static fields.
32559 * driver.cs: Stop compilation if there are parse errors.
32561 * cs-parser.jay (constructor_declaration): Provide default base
32562 initializer for non-static constructors.
32563 (constructor_declarator): Do not provide a default base
32564 initializers if none was specified.
32565 Catch the fact that constructors should not have parameters.
32567 * class.cs: Do not emit parent class initializers for static
32568 constructors, that should be flagged as an error.
32570 2001-09-18 Ravi Pratap <ravi@ximian.com>
32572 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
32573 Move back code into TypeContainer::Populate.
32575 2001-09-18 Ravi Pratap <ravi@ximian.com>
32577 * class.cs (TypeContainer::AddConstructor): Fix the check to
32578 compare against Name, not Basename.
32579 (Operator::OpType): Change Plus and Minus to Add and Subtract.
32581 * cs-parser.jay : Update accordingly.
32583 * class.cs (TypeContainer::FindMembers): For the case where we are searching
32584 for methods, don't forget to look into the operators too.
32585 (RegisterMethodBuilder): Helper method to take care of this for
32586 methods, constructors and operators.
32587 (Operator::Define): Completely revamp.
32588 (Operator.OperatorMethod, MethodName): New fields.
32589 (TypeContainer::Populate): Move the registering of builders into
32590 RegisterMethodBuilder.
32591 (Operator::Emit): Re-write.
32593 * expression.cs (Binary::Emit): Comment out code path to emit method
32594 invocation stuff for the case when we have a user defined operator. I am
32595 just not able to get it right !
32597 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32599 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
32602 (Expression::MemberLookup): Provide a version that allows to
32603 specify the MemberTypes and BindingFlags.
32605 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
32606 so it was not fetching variable information from outer blocks.
32608 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
32609 Beforefieldinit as it was buggy.
32611 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
32612 that Ravi put here.
32614 * class.cs (Constructor::Emit): Only emit if block is not null.
32615 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
32616 deal with this by semantically definining it as if the user had
32619 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
32620 constructors as we now "emit" them at a higher level.
32622 (TypeContainer::DefineDefaultConstructor): Used to define the
32623 default constructors if none was provided.
32625 (ConstructorInitializer): Add methods Resolve and Emit.
32627 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
32629 2001-09-17 Ravi Pratap <ravi@ximian.com>
32631 * class.cs (TypeContainer::EmitDefaultConstructor): Register
32632 the default constructor builder with our hashtable for methodbuilders
32635 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
32636 and argument_count is 0 in which case we have a match.
32637 (Binary::ResolveOperator): More null checking and miscellaneous coding
32640 2001-09-17 Ravi Pratap <ravi@ximian.com>
32642 * rootcontext.cs (IsNameSpace): Compare against null.
32644 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
32646 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
32647 and Unary::Operator.
32649 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
32652 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
32653 we have overloaded operators.
32654 (Binary::ResolveOperator): Implement the part which does the operator overload
32657 * class.cs (Operator::Emit): Implement.
32658 (TypeContainer::Emit): Emit the operators we have too.
32660 * expression.cs (Binary::Emit): Update to emit the appropriate code for
32661 the case when we have a user-defined operator.
32663 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32665 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
32667 2001-09-16 Ravi Pratap <ravi@ximian.com>
32669 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
32670 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
32671 (Constructor::Emit): Implement.
32672 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
32673 if we have no work to do.
32674 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
32677 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
32678 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
32680 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
32683 2001-09-15 Ravi Pratap <ravi@ximian.com>
32685 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
32687 (Tree::RecordNamespace): Method to do what the name says ;-)
32688 (Tree::Namespaces): Property to get at the namespaces hashtable.
32690 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
32693 * rootcontext.cs (IsNamespace): Fixed it :-)
32695 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32697 * class.cs (TypeContainer::FindMembers): Add support for
32699 (MethodCore): New class that encapsulates both the shared aspects
32700 of a Constructor and a Method.
32701 (Method, Constructor): Factored pieces into MethodCore.
32703 * driver.cs: Added --fatal which makes errors throw exceptions.
32704 Load System assembly as well as part of the standard library.
32706 * report.cs: Allow throwing exceptions on errors for debugging.
32708 * modifiers.cs: Do not use `parent', instead use the real type
32709 container to evaluate permission settings.
32711 * class.cs: Put Ravi's patch back in. He is right, and we will
32712 have to cope with the
32714 2001-09-14 Ravi Pratap <ravi@ximian.com>
32716 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
32717 FamORAssem, not FamANDAssem.
32719 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32721 * driver.cs: Added --parse option that only parses its input files
32724 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
32725 incorrect. IsTopLevel is not used to tell whether an object is
32726 root_types or not (that can be achieved by testing this ==
32727 root_types). But to see if this is a top-level *class* (not
32728 necessarly our "toplevel" container).
32730 2001-09-14 Ravi Pratap <ravi@ximian.com>
32732 * enum.cs (Enum::Define): Modify to call the Lookup method on the
32733 parent instead of a direct call to GetType.
32735 2001-09-14 Ravi Pratap <ravi@ximian.com>
32737 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
32738 Modifiers.TypeAttr. This should just be a call to that method.
32740 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
32741 object so that we can determine if we are top-level or not.
32743 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
32746 * enum.cs (Enum::Define): Ditto.
32748 * modifiers.cs (FieldAttr): Re-write.
32750 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
32751 (TypeContainer::HaveStaticConstructor): New property to provide access
32752 to precisely that info.
32754 * modifiers.cs (MethodAttr): Re-write.
32755 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
32757 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
32758 of top-level types as claimed.
32760 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32762 * expression.cs (MemberLookup): Fruitless attempt to lookup
32763 constructors. Maybe I need to emit default constructors? That
32764 might be it (currently .NET emits this for me automatically).
32765 (Invocation::OverloadResolve): Cope with Arguments == null.
32766 (Invocation::EmitArguments): new function, shared by the new
32767 constructor and us.
32768 (Invocation::Emit): Handle static and instance methods. Emit
32769 proper call instruction for virtual or non-virtual invocations.
32770 (New::Emit): Implement.
32771 (New::Resolve): Implement.
32772 (MemberAccess:Resolve): Implement.
32773 (MethodGroupExpr::InstanceExpression): used conforming to the spec
32774 to track instances.
32775 (FieldExpr::Resolve): Set type.
32777 * support.cs: Handle empty arguments.
32779 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
32780 SimpleLookup): Auxiliary routines to help parse a qualifier
32783 Update qualifier_identifier rule.
32785 * codegen.cs: Removed debugging messages.
32787 * class.cs: Make this a global thing, this acts just as a "key" to
32788 objects that we might have around.
32790 (Populate): Only initialize method_builders_to_methods once.
32792 * expression.cs (PropertyExpr): Initialize type from the
32795 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
32796 Resolve pattern. Attempt to implicitly convert value to boolean.
32799 * expression.cs: Set the type for the int32/int32 argument case.
32800 (Binary::ResolveOperator): Set the return type to boolean for
32801 comparission operators
32803 * typemanager.cs: Remove debugging print code.
32805 (Invocation::Resolve): resolve type.
32807 * class.cs: Allocate a MemberInfo of the correct size, as the code
32808 elsewhere depends on the test to reflect the correct contents.
32810 (Method::) Keep track of parameters, due to System.Reflection holes
32812 (TypeContainer::Populate): Keep track of MethodBuilders to Method
32815 (TypeContainer::FindMembers): Use ArrayList and then copy an array
32816 of the exact size and return that.
32818 (Class::LookupMethodByBuilder): New function that maps
32819 MethodBuilders to its methods. Required to locate the information
32820 on methods because System.Reflection bit us again.
32822 * support.cs: New file, contains an interface ParameterData and
32823 two implementations: ReflectionParameters and InternalParameters
32824 used to access Parameter information. We will need to grow this
32827 * expression.cs (Invocation::GetParameterData): implement a cache
32828 and a wrapper around the ParameterData creation for methods.
32829 (Invocation::OverloadResolve): Use new code.
32831 2001-09-13 Ravi Pratap <ravi@ximian.com>
32833 * class.cs (TypeContainer::EmitField): Remove and move into
32834 (Field::Define): here and modify accordingly.
32835 (Field.FieldBuilder): New member.
32836 (TypeContainer::Populate): Update accordingly.
32837 (TypeContainer::FindMembers): Implement.
32839 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32841 * statement.cs: (VariableInfo::VariableType): New field to be
32842 initialized with the full type once it is resolved.
32844 2001-09-12 Miguel de Icaza <miguel@ximian.com>
32846 * parameter.cs (GetParameterInfo): Use a type cache to compute
32847 things only once, and to reuse this information
32849 * expression.cs (LocalVariableReference::Emit): Implement.
32850 (OpcodeCast::Emit): fix.
32852 (ParameterReference::Resolve): Implement.
32853 (ParameterReference::Emit): Implement.
32855 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
32856 that are expressions need to stay as Expressions.
32858 * typemanager.cs (CSharpName): Returns the C# name of a type if
32861 * expression.cs (Expression::ConvertImplicit): New function that
32862 implements implicit type conversions.
32864 (Expression::ImplicitReferenceConversion): Implements implicit
32865 reference conversions.
32867 (EmptyCast): New type for transparent casts.
32869 (OpcodeCast): New type for casts of types that are performed with
32870 a sequence of bytecodes.
32872 (BoxedCast): New type used for casting value types into reference
32873 types. Emits a box opcode.
32875 (Binary::DoNumericPromotions): Implements numeric promotions of
32876 and computation of the Binary::Type.
32878 (Binary::EmitBranchable): Optimization.
32880 (Binary::Emit): Implement code emission for expressions.
32882 * typemanager.cs (TypeManager): Added two new core types: sbyte
32885 2001-09-12 Ravi Pratap <ravi@ximian.com>
32887 * class.cs (TypeContainer::FindMembers): Method which does exactly
32888 what Type.FindMembers does, only we don't have to use reflection. No
32889 implementation yet.
32891 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
32892 typecontainer objects as we need to get at them.
32893 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
32895 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
32896 typecontainer object.
32898 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
32899 of just a Report object.
32901 2001-09-11 Ravi Pratap <ravi@ximian.com>
32903 * class.cs (Event::Define): Go back to using the prefixes "add_" and
32905 (TypeContainer::Populate): Now define the delegates of the type too.
32906 (TypeContainer.Delegates): Property to access the list of delegates defined
32909 * delegates.cs (Delegate::Define): Implement partially.
32911 * modifiers.cs (TypeAttr): Handle more flags.
32913 2001-09-11 Ravi Pratap <ravi@ximian.com>
32915 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
32917 (Operator::Define): Re-write logic to get types by using the LookupType method
32918 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
32919 (Indexer::Define): Ditto.
32920 (Event::Define): Ditto.
32921 (Property::Define): Ditto.
32923 2001-09-10 Ravi Pratap <ravi@ximian.com>
32925 * class.cs (TypeContainer::Populate): Now define operators too.
32926 (TypeContainer.Operators): New property to access the list of operators
32928 (Operator.OperatorMethodBuilder): New member to hold the method builder
32929 for the operator we are defining.
32930 (Operator::Define): Implement.
32932 2001-09-10 Ravi Pratap <ravi@ximian.com>
32934 * class.cs (Event::Define): Make the prefixes of the accessor methods
32935 addOn_ and removeOn_
32937 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
32938 of the location being passed in too. Ideally, this should go later since all
32939 error reporting should be done through the Report object.
32941 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
32942 (Populate): Iterate thru the indexers we have and define them too.
32943 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
32944 for the get and set accessors.
32945 (Indexer::Define): Implement.
32947 2001-09-09 Miguel de Icaza <miguel@ximian.com>
32949 * expression.cs (Binary::Resolve): Beginning of it. I scratched
32950 my previous implementation, did not work.
32952 * typemanager.cs: Add a couple of missing types (the longs).
32954 * literal.cs: Use TypeManager.bool_type instead of getting it.
32956 * expression.cs (EventExpr): New kind of expressions.
32957 (Expressio::ExprClassFromMemberInfo): finish
32959 2001-09-08 Miguel de Icaza <miguel@ximian.com>
32961 * assign.cs: Emit stores to static fields differently.
32963 2001-09-08 Ravi Pratap <ravi@ximian.com>
32965 * Merge in changes and adjust code to tackle conflicts. Backed out my
32966 code in Assign::Resolve ;-)
32968 2001-09-08 Ravi Pratap <ravi@ximian.com>
32970 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
32971 instead Report.Error and also pass in the location.
32972 (CSharpParser::Lexer): New readonly property to return the reference
32973 to the Tokenizer object.
32974 (declare_local_variables): Use Report.Error with location instead of plain
32978 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
32979 (Operator.CheckBinaryOperator): Ditto.
32981 * cs-parser.jay (operator_declarator): Update accordingly.
32983 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
32984 (CheckBinaryOperator): Same here.
32986 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
32987 on the name without any prefixes of namespace names etc. This is because we
32988 already might have something already fully qualified like
32989 'System.Console.WriteLine'
32991 * assign.cs (Resolve): Begin implementation. Stuck ;-)
32993 2001-09-07 Ravi Pratap <ravi@ximian.com>
32995 * cs-tokenizer.cs (location): Return a string which also contains
32998 * expression.cs (ElementAccess): New class for expressions of the
32999 type 'element access.'
33000 (BaseAccess): New class for expressions of the type 'base access.'
33001 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
33004 * cs-parser.jay (element_access): Implement action.
33005 (base_access): Implement actions.
33006 (checked_expression, unchecked_expression): Implement.
33008 * cs-parser.jay (local_variable_type): Correct and implement.
33009 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
33011 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
33013 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
33014 name and the specifiers.
33016 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
33018 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
33019 making them all public ;-)
33021 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
33024 2001-09-07 Miguel de Icaza <miguel@ximian.com>
33026 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
33028 (FieldExpr, PropertyExprs): New resolved expressions.
33029 (SimpleName::MemberStaticCheck): Perform static checks for access
33030 to non-static fields on static methods. Maybe this should be
33031 generalized for MemberAccesses.
33032 (SimpleName::ResolveSimpleName): More work on simple name
33035 * cs-parser.jay (primary_expression/qualified_identifier): track
33036 the parameter index.
33038 * codegen.cs (CodeGen::Save): Catch save exception, report error.
33039 (EmitContext::EmitBoolExpression): Chain to expression generation
33040 instead of temporary hack.
33041 (::EmitStatementExpression): Put generic expression code generation.
33043 * assign.cs (Assign::Emit): Implement variable assignments to
33044 local variables, parameters and fields.
33046 2001-09-06 Miguel de Icaza <miguel@ximian.com>
33048 * statement.cs (Block::GetVariableInfo): New method, returns the
33049 VariableInfo for a variable name in a block.
33050 (Block::GetVariableType): Implement in terms of GetVariableInfo
33052 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
33053 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
33055 2001-09-06 Ravi Pratap <ravi@ximian.com>
33057 * cs-parser.jay (operator_declaration): Continue on my quest : update
33058 to take attributes argument.
33059 (event_declaration): Ditto.
33060 (enum_declaration): Ditto.
33061 (indexer_declaration): Ditto.
33063 * class.cs (Operator::Operator): Update constructor accordingly.
33064 (Event::Event): Ditto.
33066 * delegate.cs (Delegate::Delegate): Same here.
33068 * enum.cs (Enum::Enum): Same here.
33070 2001-09-05 Ravi Pratap <ravi@ximian.com>
33072 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
33074 * ../tests/cs0658.cs : New file to demonstrate error 0658.
33076 * attribute.cs (Attributes): New class to encapsulate all attributes which were
33077 being passed around as an arraylist.
33078 (Attributes::AddAttribute): Method to add attribute sections.
33080 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
33081 (struct_declaration): Update accordingly.
33082 (constant_declaration): Update.
33083 (field_declaration): Update.
33084 (method_header): Update.
33085 (fixed_parameter): Update.
33086 (parameter_array): Ditto.
33087 (property_declaration): Ditto.
33088 (destructor_declaration): Ditto.
33090 * class.cs (Struct::Struct): Update constructors accordingly.
33091 (Class::Class): Ditto.
33092 (Field::Field): Ditto.
33093 (Method::Method): Ditto.
33094 (Property::Property): Ditto.
33095 (TypeContainer::OptAttribute): update property's return type.
33097 * interface.cs (Interface.opt_attributes): New member.
33098 (Interface::Interface): Update to take the extra Attributes argument.
33100 * parameter.cs (Parameter::Parameter): Ditto.
33102 * constant.cs (Constant::Constant): Ditto.
33104 * interface.cs (InterfaceMemberBase): New OptAttributes field.
33105 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
33106 the attributes as a parameter.
33107 (InterfaceProperty): Update constructor call.
33108 (InterfaceEvent): Ditto.
33109 (InterfaceMethod): Ditto.
33110 (InterfaceIndexer): Ditto.
33112 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
33113 pass the attributes too.
33114 (interface_event_declaration): Ditto.
33115 (interface_property_declaration): Ditto.
33116 (interface_method_declaration): Ditto.
33117 (interface_declaration): Ditto.
33119 2001-09-05 Miguel de Icaza <miguel@ximian.com>
33121 * class.cs (Method::Define): Track the "static Main" definition to
33122 create an entry point.
33124 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
33125 EntryPoint if we find it.
33127 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
33128 (EmitContext::ig): Make this variable public.
33130 * driver.cs: Make the default output file be the first file name
33131 with the .exe extension.
33133 Detect empty compilations
33135 Handle various kinds of output targets. Handle --target and
33136 rename -t to --dumper.
33138 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
33139 methods inherited from Expression return now an Expression. This
33140 will is used during the tree rewriting as we resolve them during
33143 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
33144 the spec. Missing entirely is the information about
33145 accessability of elements of it.
33147 (Expression::ExprClassFromMemberInfo): New constructor for
33148 Expressions that creates a fully initialized Expression based on
33149 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
33152 (Invocation::Resolve): Begin implementing resolution of invocations.
33154 * literal.cs (StringLiteral): Implement Emit.
33156 2001-09-05 Ravi Pratap <ravi@ximian.com>
33158 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
33161 2001-09-04 Ravi Pratap <ravi@ximian.com>
33163 * cs-parser.jay (attribute_arguments): Implement actions.
33164 (attribute): Fix bug in production. Implement action.
33165 (attribute_list): Implement.
33166 (attribute_target): Implement.
33167 (attribute_target_specifier, opt_target_specifier): Implement
33168 (CheckAttributeTarget): New method to check if the attribute target
33170 (attribute_section): Implement.
33171 (opt_attributes): Implement.
33173 * attribute.cs : New file to handle attributes.
33174 (Attribute): Class to hold attribute info.
33176 * cs-parser.jay (opt_attribute_target_specifier): Remove production
33177 (attribute_section): Modify production to use 2 different rules to
33178 achieve the same thing. 1 s/r conflict down !
33179 Clean out commented, useless, non-reducing dimension_separator rules.
33181 * class.cs (TypeContainer.attributes): New member to hold list
33182 of attributes for a type.
33183 (Struct::Struct): Modify to take one more argument, the attribute list.
33184 (Class::Class): Ditto.
33185 (Field::Field): Ditto.
33186 (Method::Method): Ditto.
33187 (Property::Property): Ditto.
33189 * cs-parser.jay (struct_declaration): Update constructor call to
33190 pass in the attributes too.
33191 (class_declaration): Ditto.
33192 (constant_declaration): Ditto.
33193 (field_declaration): Ditto.
33194 (method_header): Ditto.
33195 (fixed_parameter): Ditto.
33196 (parameter_array): Ditto.
33197 (property_declaration): Ditto.
33199 * constant.cs (Constant::Constant): Update constructor similarly.
33200 Use System.Collections.
33202 * parameter.cs (Parameter::Parameter): Update as above.
33204 2001-09-02 Ravi Pratap <ravi@ximian.com>
33206 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
33207 (TypeContainer.delegates): New member to hold list of delegates.
33209 * cs-parser.jay (delegate_declaration): Implement the action correctly
33210 this time as I seem to be on crack ;-)
33212 2001-09-02 Miguel de Icaza <miguel@ximian.com>
33214 * rootcontext.cs (RootContext::IsNamespace): new function, used to
33215 tell whether an identifier represents a namespace.
33217 * expression.cs (NamespaceExpr): A namespace expression, used only
33218 temporarly during expression resolution.
33219 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
33220 utility functions to resolve names on expressions.
33222 2001-09-01 Miguel de Icaza <miguel@ximian.com>
33224 * codegen.cs: Add hook for StatementExpressions.
33226 * class.cs: Fix inverted test for static flag in methods.
33228 2001-09-02 Ravi Pratap <ravi@ximian.com>
33230 * class.cs (Operator::CheckUnaryOperator): Correct error number used
33231 to make it coincide with MS' number.
33232 (Operator::CheckBinaryOperator): Ditto.
33234 * ../errors/errors.txt : Remove error numbers added earlier.
33236 * ../errors/cs1019.cs : Test case for error # 1019
33238 * ../errros/cs1020.cs : Test case for error # 1020
33240 * cs-parser.jay : Clean out commented cruft.
33241 (dimension_separators, dimension_separator): Comment out. Ostensibly not
33242 used anywhere - non-reducing rule.
33243 (namespace_declarations): Non-reducing rule - comment out.
33245 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
33246 with TypeContainer::AddEnum.
33248 * delegate.cs : New file for delegate handling classes.
33249 (Delegate): Class for declaring delegates.
33251 * makefile : Update.
33253 * cs-parser.jay (delegate_declaration): Implement.
33255 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
33257 * class.cs (Event::Define): Implement.
33258 (Event.EventBuilder): New member.
33260 * class.cs (TypeContainer::Populate): Update to define all enums and events
33262 (Events): New property for the events arraylist we hold. Shouldn't we move to using
33263 readonly fields for all these cases ?
33265 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33267 * class.cs (Property): Revamp to use the convention of making fields readonly.
33268 Accordingly modify code elsewhere.
33270 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
33271 the Define method of the Property class.
33273 * class.cs : Clean up applied patch and update references to variables etc. Fix
33275 (TypeContainer::Populate): Update to define all the properties we have. Also
33276 define all enumerations.
33278 * enum.cs (Define): Implement.
33280 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33282 * cs-parser.jay (overloadable_operator): The semantic value is an
33283 enum of the Operator class.
33284 (operator_declarator): Implement actions.
33285 (operator_declaration): Implement.
33287 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
33288 validity of definitions.
33289 (Operator::CheckBinaryOperator): Static method to check for binary operators
33290 (TypeContainer::AddOperator): New method to add an operator to a type.
33292 * cs-parser.jay (indexer_declaration): Added line to actually call the
33293 AddIndexer method so it gets added ;-)
33295 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
33296 already taken care of by the MS compiler ?
33298 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33300 * class.cs (Operator): New class for operator declarations.
33301 (Operator::OpType): Enum for the various operators.
33303 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33305 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
33306 ostensibly handle this in semantic analysis.
33308 * cs-parser.jay (general_catch_clause): Comment out
33309 (specific_catch_clauses, specific_catch_clause): Ditto.
33310 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
33311 (catch_args, opt_catch_args): New productions.
33312 (catch_clause): Rewrite to use the new productions above
33313 (catch_clauses): Modify accordingly.
33314 (opt_catch_clauses): New production to use in try_statement
33315 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
33316 and re-write the code in the actions to extract the specific and
33317 general catch clauses by being a little smart ;-)
33319 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
33320 Hooray, try and catch statements parse fine !
33322 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33324 * statement.cs (Block::GetVariableType): Fix logic to extract the type
33325 string from the hashtable of variables.
33327 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
33328 I end up making that mistake ;-)
33329 (catch_clauses): Fixed gross error which made Key and Value of the
33330 DictionaryEntry the same : $1 !!
33332 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33334 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
33336 * cs-parser.jay (event_declaration): Correct to remove the semicolon
33337 when the add and remove accessors are specified.
33339 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33341 * cs-parser.jay (IndexerDeclaration): New helper class to hold
33342 information about indexer_declarator.
33343 (indexer_declarator): Implement actions.
33344 (parsing_indexer): New local boolean used to keep track of whether
33345 we are parsing indexers or properties. This is necessary because
33346 implicit_parameters come into picture even for the get accessor in the
33347 case of an indexer.
33348 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
33350 * class.cs (Indexer): New class for indexer declarations.
33351 (TypeContainer::AddIndexer): New method to add an indexer to a type.
33352 (TypeContainer::indexers): New member to hold list of indexers for the
33355 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33357 * cs-parser.jay (add_accessor_declaration): Implement action.
33358 (remove_accessor_declaration): Implement action.
33359 (event_accessors_declaration): Implement
33360 (variable_declarators): swap statements for first rule - trivial.
33362 * class.cs (Event): New class to hold information about event
33364 (TypeContainer::AddEvent): New method to add an event to a type
33365 (TypeContainer::events): New member to hold list of events.
33367 * cs-parser.jay (event_declaration): Implement actions.
33369 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33371 * cs-parser.jay (dim_separators): Implement. Make it a string
33372 concatenating all the commas together, just as they appear.
33373 (opt_dim_separators): Modify accordingly
33374 (rank_specifiers): Update accordingly. Basically do the same
33375 thing - instead, collect the brackets here.
33376 (opt_rank_sepcifiers): Modify accordingly.
33377 (array_type): Modify to actually return the complete type string
33378 instead of ignoring the rank_specifiers.
33379 (expression_list): Implement to collect the expressions
33380 (variable_initializer): Implement. We make it a list of expressions
33381 essentially so that we can handle the array_initializer case neatly too.
33382 (variable_initializer_list): Implement.
33383 (array_initializer): Make it a list of variable_initializers
33384 (opt_array_initializer): Modify accordingly.
33386 * expression.cs (New::NType): Add enumeration to help us
33387 keep track of whether we have an object/delegate creation
33388 or an array creation.
33389 (New:NewType, New::Rank, New::Indices, New::Initializers): New
33390 members to hold data about array creation.
33391 (New:New): Modify to update NewType
33392 (New:New): New Overloaded contructor for the array creation
33395 * cs-parser.jay (array_creation_expression): Implement to call
33396 the overloaded New constructor.
33398 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
33400 * class.cs (TypeContainer::Constructors): Return member
33401 constructors instead of returning null.
33403 2001-08-26 Miguel de Icaza <miguel@ximian.com>
33405 * typemanager.cs (InitCoreTypes): Initialize the various core
33406 types after we have populated the type manager with the user
33407 defined types (this distinction will be important later while
33408 compiling corlib.dll)
33410 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
33411 on Expression Classification. Now all expressions have a method
33412 `Resolve' and a method `Emit'.
33414 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
33415 generation from working. Also add some temporary debugging
33418 2001-08-24 Miguel de Icaza <miguel@ximian.com>
33420 * codegen.cs: Lots of code generation pieces. This is only the
33421 beginning, will continue tomorrow with more touches of polish. We
33422 handle the fundamentals of if, while, do, for, return. Others are
33423 trickier and I need to start working on invocations soon.
33425 * gen-treedump.cs: Bug fix, use s.Increment here instead of
33428 * codegen.cs (EmitContext): New struct, used during code
33429 emission to keep a context. Most of the code generation will be
33432 * cs-parser.jay: Add embedded blocks to the list of statements of
33433 this block. So code generation proceeds in a top down fashion.
33435 2001-08-23 Miguel de Icaza <miguel@ximian.com>
33437 * statement.cs: Add support for multiple child blocks.
33439 2001-08-22 Miguel de Icaza <miguel@ximian.com>
33441 * codegen.cs (EmitCode): New function, will emit the code for a
33442 Block of code given a TypeContainer and its ILGenerator.
33444 * statement.cs (Block): Standard public readonly optimization.
33445 (Block::Block constructors): Link children.
33446 (Block::Child): Child Linker.
33447 (Block::EmitVariables): Emits IL variable declarations.
33449 * class.cs: Drop support for MethodGroups here, delay until
33451 (Method::): Applied the same simplification that I did before, and
33452 move from Properties to public readonly fields.
33453 (Method::ParameterTypes): Returns the parameter types for the
33454 function, and implements a cache that will be useful later when I
33455 do error checking and the semantic analysis on the methods is
33457 (Constructor::GetCallingConvention): Renamed from CallingConvetion
33458 and made a method, optional argument tells whether this is a class
33459 or a structure to apply the `has-this' bit.
33460 (Method::GetCallingConvention): Implement, returns the calling
33462 (Method::Define): Defines the type, a second pass is performed
33463 later to populate the methods.
33465 (Constructor::ParameterTypes): implement a cache similar to the
33466 one on Method::ParameterTypes, useful later when we do semantic
33469 (TypeContainer::EmitMethod): New method. Emits methods.
33471 * expression.cs: Removed MethodGroup class from here.
33473 * parameter.cs (Parameters::GetCallingConvention): new method.
33475 2001-08-21 Miguel de Icaza <miguel@ximian.com>
33477 * class.cs (TypeContainer::Populate): Drop RootContext from the
33480 (Constructor::CallingConvention): Returns the calling convention.
33481 (Constructor::ParameterTypes): Returns the constructor parameter
33484 (TypeContainer::AddConstructor): Keep track of default constructor
33485 and the default static constructor.
33487 (Constructor::) Another class that starts using `public readonly'
33488 instead of properties.
33490 (Constructor::IsDefault): Whether this is a default constructor.
33492 (Field::) use readonly public fields instead of properties also.
33494 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
33495 track of static constructors; If none is used, turn on
33496 BeforeFieldInit in the TypeAttributes.
33498 * cs-parser.jay (opt_argument_list): now the return can be null
33499 for the cases where there are no arguments.
33501 (constructor_declarator): If there is no implicit `base' or
33502 `this', then invoke the default parent constructor.
33504 * modifiers.cs (MethodAttr): New static function maps a set of
33505 modifiers flags into a MethodAttributes enum
33506 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
33507 MethodAttr, TypeAttr to represent the various mappings where the
33508 modifiers are used.
33509 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
33511 2001-08-19 Miguel de Icaza <miguel@ximian.com>
33513 * parameter.cs (GetParameterInfo): Fix bug where there would be no
33516 * interface.cs (PopulateIndexer): Implemented the code generator
33517 for interface indexers.
33519 2001-08-17 Miguel de Icaza <miguel@ximian.com>
33521 * interface.cs (InterfaceMemberBase): Now we track the new status
33524 (PopulateProperty): Implement property population. Woohoo! Got
33525 Methods and Properties going today.
33527 Removed all the properties for interfaces, and replaced them with
33528 `public readonly' fields.
33530 2001-08-16 Miguel de Icaza <miguel@ximian.com>
33532 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
33533 initialize their hashtables/arraylists only when they are needed
33534 instead of doing this always.
33536 * parameter.cs: Handle refs and out parameters.
33538 * cs-parser.jay: Use an ArrayList to construct the arguments
33539 instead of the ParameterCollection, and then cast that to a
33542 * parameter.cs: Drop the use of ParameterCollection and use
33543 instead arrays of Parameters.
33545 (GetParameterInfo): Use the Type, not the Name when resolving
33548 2001-08-13 Miguel de Icaza <miguel@ximian.com>
33550 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
33551 and instead use public readonly fields.
33553 * class.cs: Put back walking code for type containers.
33555 2001-08-11 Miguel de Icaza <miguel@ximian.com>
33557 * class.cs (MakeConstant): Code to define constants.
33559 * rootcontext.cs (LookupType): New function. Used to locate types
33562 2001-08-08 Miguel de Icaza <miguel@ximian.com>
33564 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
33565 this System.Reflection code is. Kudos to Microsoft
33567 * typemanager.cs: Implement a type cache and avoid loading all
33568 types at boot time. Wrap in LookupType the internals. This made
33569 the compiler so much faster. Wow. I rule!
33571 * driver.cs: Make sure we always load mscorlib first (for
33572 debugging purposes, nothing really important).
33574 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
33575 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
33577 * rootcontext.cs: Lookup types on their namespace; Lookup types
33578 on namespaces that have been imported using the `using' keyword.
33580 * class.cs (TypeContainer::TypeAttr): Virtualize.
33581 (Class::TypeAttr): Return attributes suitable for this bad boy.
33582 (Struct::TypeAttr): ditto.
33583 Handle nested classes.
33584 (TypeContainer::) Remove all the type visiting code, it is now
33585 replaced with the rootcontext.cs code
33587 * rootcontext.cs (GetClassBases): Added support for structs.
33589 2001-08-06 Miguel de Icaza <miguel@ximian.com>
33591 * interface.cs, statement.cs, class.cs, parameter.cs,
33592 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
33593 Drop use of TypeRefs, and use strings instead.
33595 2001-08-04 Miguel de Icaza <miguel@ximian.com>
33599 * class.cs (Struct::Struct): set the SEALED flags after
33600 checking the modifiers.
33601 (TypeContainer::TypeAttr): new property, returns the
33602 TypeAttributes for a class.
33604 * cs-parser.jay (type_list): Oops, list production was creating a
33605 new list of base types.
33607 * rootcontext.cs (StdLib): New property.
33608 (GetInterfaceTypeByName): returns an interface by type name, and
33609 encapsulates error handling here.
33610 (GetInterfaces): simplified.
33611 (ResolveTree): Encapsulated all the tree resolution here.
33612 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
33615 * driver.cs: Add support for --nostdlib, to avoid loading the
33616 default assemblies.
33617 (Main): Do not put tree resolution here.
33619 * rootcontext.cs: Beginning of the class resolution.
33621 2001-08-03 Miguel de Icaza <miguel@ximian.com>
33623 * rootcontext.cs: Provide better error reporting.
33625 * cs-parser.jay (interface_base): set our $$ to be interfaces.
33627 * rootcontext.cs (CreateInterface): Handle the case where there
33628 are no parent interfaces.
33630 (CloseTypes): Routine to flush types at the end.
33631 (CreateInterface): Track types.
33632 (GetInterfaces): Returns an array of Types from the list of
33633 defined interfaces.
33635 * typemanager.c (AddUserType): Mechanism to track user types (puts
33636 the type on the global type hash, and allows us to close it at the
33639 2001-08-02 Miguel de Icaza <miguel@ximian.com>
33641 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
33642 RecordInterface instead.
33644 * cs-parser.jay: Updated to reflect changes above.
33646 * decl.cs (Definition): Keep track of the TypeBuilder type that
33647 represents this type here. Not sure we will use it in the long
33648 run, but wont hurt for now.
33650 * driver.cs: Smaller changes to accomodate the new code.
33652 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
33655 * rootcontext.cs (CreateInterface): New method, used to create
33656 the System.TypeBuilder type for interfaces.
33657 (ResolveInterfaces): new entry point to resolve the interface
33659 (CodeGen): Property, used to keep track of the code generator.
33661 2001-07-26 Miguel de Icaza <miguel@ximian.com>
33663 * cs-parser.jay: Add a second production for delegate_declaration
33666 (enum_body): Put an opt_comma here instead of putting it on
33667 enum_body or enum_member_declarations so we can handle trailing
33668 commas on enumeration members. Gets rid of a shift/reduce.
33670 (type_list): Need a COMMA in the middle.
33672 (indexer_declaration): Tell tokenizer to recognize get/set
33674 * Remove old targets.
33676 * Re-add the parser target.
33678 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33680 * cs-parser.jay: Add precendence rules for a number of operators
33681 ot reduce the number of shift/reduce conflicts in the grammar.
33683 2001-07-17 Miguel de Icaza <miguel@ximian.com>
33685 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
33688 Get rid of old crufty code.
33690 * rootcontext.cs: Use this to keep track of the parsed
33691 representation and the defined types available to the program.
33693 * gen-treedump.cs: adjust for new convention.
33695 * type.cs: Split out the type manager, and the assembly builder
33698 * typemanager.cs: the type manager will live here now.
33700 * cil-codegen.cs: And the code generator here.
33702 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
33704 * makefile: Fixed up for easy making.
33706 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33708 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
33711 (unary_expression): Expand pre_increment_expression and
33712 post_decrement_expression to reduce a shift/reduce.
33714 2001-07-11 Simon Cozens
33716 * cs-tokenizer.cs: Hex numbers should begin with a 0.
33718 Improve allow_keyword_as_indent name.
33720 2001-06-19 Miguel de Icaza <miguel@ximian.com>
33722 * Adjustments for Beta2.
33724 2001-06-13 Miguel de Icaza <miguel@ximian.com>
33726 * decl.cs: Added `Define' abstract method.
33727 (InTransit): new property, used to catch recursive definitions.
33729 * interface.cs: Implement `Define'.
33731 * modifiers.cs: Map Modifiers.constants to
33732 System.Reflection.TypeAttribute flags.
33734 * class.cs: Keep track of types and user-defined types.
33735 (BuilderInit): New method for creating an assembly
33736 (ResolveType): New function to launch the resolution process, only
33737 used by interfaces for now.
33739 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
33740 that are inserted into the name space.
33742 2001-06-08 Miguel de Icaza <miguel@ximian.com>
33744 * ARGH. I have screwed up my tree so many times due to the use of
33745 rsync rather than using CVS. Going to fix this at once.
33747 * driver.cs: Objetify driver. Load assemblies, use assemblies to
33750 2001-06-07 Miguel de Icaza <miguel@ximian.com>
33752 * Experiment successful: Use System.Type rather that our own
33755 2001-05-25 Miguel de Icaza <miguel@ximian.com>
33757 * cs-parser.jay: Removed nsAliases from here.
33759 Use new namespaces, handle `using XXX;'
33761 * namespace.cs: Reimplemented namespace handling, use a recursive
33762 definition of the class. Now we can keep track of using clauses
33763 and catch invalid using clauses.
33765 2001-05-24 Miguel de Icaza <miguel@ximian.com>
33767 * gen-treedump.cs: Adapted for all the renaming.
33769 * expression.cs (Expression): this class now has a Type property
33770 which returns an expression Type.
33772 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
33773 `Type', as this has a different meaning now in the base
33775 2001-05-22 Miguel de Icaza <miguel@ximian.com>
33777 * interface.cs, class.cs: Removed from all the sources the
33778 references to signature computation, as we can not do method
33779 signature computation during the parsing time, as we are not
33780 trying to solve at that point distinguishing:
33784 void a (NS.Blah x) {}
33787 Which depending on the context might be valid or not, as we do not
33788 know if Blah is the same thing as NS.Blah at that point.
33790 * Redid everything so the code uses TypeRefs now instead of
33791 Types. TypeRefs are just temporary type placeholders, that need
33792 to be resolved. They initially have a pointer to a string and the
33793 current scope in which they are used. This is used later by the
33794 compiler to resolve the reference to an actual Type.
33796 * DeclSpace is no longer a CIR.Type, and neither are
33797 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
33798 are all DeclSpaces, but no Types.
33800 * type.cs (TypeRefManager): This implements the TypeRef manager,
33801 which keeps track of all the types that need to be resolved after
33802 the parsing has finished.
33804 2001-05-13 Miguel de Icaza <miguel@ximian.com>
33806 * ARGH. We are going to have to store `foreach' as a class rather
33807 than resolving it, as we need to verify error 1579 after name
33808 resolution. *OR* we could keep a flag that says `This request to
33809 IEnumerator comes from a foreach statement' which we can then use
33810 to generate the error.
33812 2001-05-10 Miguel de Icaza <miguel@ximian.com>
33814 * class.cs (TypeContainer.AddMethod): we now add methods to the
33815 MethodGroup instead of the method hashtable.
33817 * expression.cs: Add MethodGroup abstraction, which gets us one
33818 step closer to the specification in the way we handle method
33821 * cs-parser.jay (primary_expression): qualified_identifier now
33822 tried to match up an identifier to a local variable reference or
33823 to a parameter reference.
33825 current_local_parameters is now a parser global variable that
33826 points to the current parameters for the block, used during name
33829 (property_declaration): Now creates an implicit `value' argument to
33832 2001-05-09 Miguel de Icaza <miguel@ximian.com>
33834 * parameter.cs: Do not use `param' arguments as part of the
33835 signature, per the spec.
33837 2001-05-08 Miguel de Icaza <miguel@ximian.com>
33839 * decl.cs: Base class for classes, structs and interfaces. This
33840 is the "Declaration Space"
33842 * cs-parser.jay: Use CheckDef for checking declaration errors
33843 instead of having one on each function.
33845 * class.cs: Factor out some code for handling error handling in
33846 accordance to the "Declarations" section in the "Basic Concepts"
33847 chapter in the ECMA C# spec.
33849 * interface.cs: Make all interface member classes derive from
33850 InterfaceMemberBase.
33852 2001-05-07 Miguel de Icaza <miguel@ximian.com>
33854 * Many things: all interfaces are parsed and generated in
33855 gen-treedump. Support for member variables, constructors,
33856 destructors, properties, constants is there.
33858 Beginning of the IL backend, but very little done, just there for
33861 2001-04-29 Miguel de Icaza <miguel@ximian.com>
33863 * cs-parser.jay: Fix labeled statement.
33865 * cs-tokenizer.cs (escape): Escape " and ' always.
33866 ref_line, ref_name: keep track of the line/filename as instructed
33867 by #line by the compiler.
33870 2001-04-27 Miguel de Icaza <miguel@ximian.com>
33872 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
33873 to match the values in System.CodeDOM.
33875 Divid renamed to Divide.
33877 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
33879 (Statements.set): remove.
33881 * System.CodeDOM/CodeCatchClause.cs: always have a valid
33884 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
33885 falseStatements always have valid values.
33887 * cs-parser.jay: Use System.CodeDOM now.